Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vmull_high_laneq.c

raw
1 /* { dg-skip-if "" { arm*-*-* } } */
2
3 #include <arm_neon.h>
4 #include "arm-neon-ref.h"
5 #include "compute-ref-data.h"
6
7 /* Expected results. */
8 VECT_VAR_DECL(expected, int, 32, 4) [] = { 0x4000, 0x4000, 0x4000, 0x4000 };
9 VECT_VAR_DECL(expected, int, 64, 2) [] = { 0x2000, 0x2000 };
10 VECT_VAR_DECL(expected, uint, 32, 4) [] = { 0x4000, 0x4000, 0x4000, 0x4000 };
11 VECT_VAR_DECL(expected, uint, 64, 2) [] = { 0x2000, 0x2000 };
12
13 #define TEST_MSG "VMULL_HIGH_LANEQ"
14 void exec_vmull_high_laneq (void)
15 {
16 /* vector_res = vmull_high_laneq(vector, vector2, lane), store the result. */
17 #define TEST_VMULL_HIGH_LANEQ(T1, T2, W1, W2, N1, N2, L) \
18 VECT_VAR(vector_res, T1, W2, N2) = \
19 vmull_high_laneq_##T2##W1(VECT_VAR(vector, T1, W1, N1), \
20 VECT_VAR(vector2, T1, W1, N1), \
21 L); \
22 vst1q_##T2##W2(VECT_VAR(result, T1, W2, N2), \
23 VECT_VAR(vector_res, T1, W2, N2))
24
25 DECL_VARIABLE(vector, int, 16, 8);
26 DECL_VARIABLE(vector, int, 32, 4);
27 DECL_VARIABLE(vector, uint, 16, 8);
28 DECL_VARIABLE(vector, uint, 32, 4);
29 DECL_VARIABLE(vector2, int, 16, 8);
30 DECL_VARIABLE(vector2, int, 32, 4);
31 DECL_VARIABLE(vector2, uint, 16, 8);
32 DECL_VARIABLE(vector2, uint, 32, 4);
33
34 DECL_VARIABLE(vector_res, int, 32, 4);
35 DECL_VARIABLE(vector_res, int, 64, 2);
36 DECL_VARIABLE(vector_res, uint, 32, 4);
37 DECL_VARIABLE(vector_res, uint, 64, 2);
38
39 clean_results ();
40
41 /* Initialize vector. */
42 VDUP(vector, q, int, s, 16, 8, 0x1000);
43 VDUP(vector, q, int, s, 32, 4, 0x1000);
44 VDUP(vector, q, uint, u, 16, 8, 0x1000);
45 VDUP(vector, q, uint, u, 32, 4, 0x1000);
46
47 /* Initialize vector2. */
48 VDUP(vector2, q, int, s, 16, 8, 0x4);
49 VDUP(vector2, q, int, s, 32, 4, 0x2);
50 VDUP(vector2, q, uint, u, 16, 8, 0x4);
51 VDUP(vector2, q, uint, u, 32, 4, 0x2);
52
53 /* Choose lane arbitrarily. */
54 TEST_VMULL_HIGH_LANEQ(int, s, 16, 32, 8, 4, 5);
55 TEST_VMULL_HIGH_LANEQ(int, s, 32, 64, 4, 2, 1);
56 TEST_VMULL_HIGH_LANEQ(uint, u, 16, 32, 8, 4, 7);
57 TEST_VMULL_HIGH_LANEQ(uint, u, 32, 64, 4, 2, 3);
58
59 CHECK(TEST_MSG, int, 32, 4, PRIx32, expected, "");
60 CHECK(TEST_MSG, int, 64, 2, PRIx64, expected, "");
61 CHECK(TEST_MSG, uint, 32, 4, PRIx32, expected, "");
62 CHECK(TEST_MSG, uint, 64, 2, PRIx64, expected, "");
63 }
64
65 int main (void)
66 {
67 exec_vmull_high_laneq ();
68 return 0;
69 }