Debian Codegraph @

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

raw
1 #define INSN_NAME vneg
2 #define TEST_MSG "VNEG/VNEGQ"
3
4 /* Extra tests for functions requiring floating-point types. */
5 void exec_vneg_f32(void);
6 #define EXTRA_TESTS exec_vneg_f32
7
8 #include "unary_op.inc"
9
10 /* Expected results. */
11 VECT_VAR_DECL(expected,int,8,8) [] = { 0x10, 0xf, 0xe, 0xd,
12 0xc, 0xb, 0xa, 0x9 };
13 VECT_VAR_DECL(expected,int,16,4) [] = { 0x10, 0xf, 0xe, 0xd };
14 VECT_VAR_DECL(expected,int,32,2) [] = { 0x10, 0xf };
15 VECT_VAR_DECL(expected,int,8,16) [] = { 0x10, 0xf, 0xe, 0xd, 0xc, 0xb, 0xa, 0x9,
16 0x8, 0x7, 0x6, 0x5, 0x4, 0x3, 0x2, 0x1 };
17 VECT_VAR_DECL(expected,int,16,8) [] = { 0x10, 0xf, 0xe, 0xd,
18 0xc, 0xb, 0xa, 0x9 };
19 VECT_VAR_DECL(expected,int,32,4) [] = { 0x10, 0xf, 0xe, 0xd };
20
21 /* Expected results for float32 variants. Needs to be separated since
22 the generic test function does not test floating-point
23 versions. */
24 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
25 VECT_VAR_DECL(expected_float16, hfloat, 16, 4) [] = { 0xc09a, 0xc09a,
26 0xc09a, 0xc09a };
27 VECT_VAR_DECL(expected_float16, hfloat, 16, 8) [] = { 0xc2cd, 0xc2cd,
28 0xc2cd, 0xc2cd,
29 0xc2cd, 0xc2cd,
30 0xc2cd, 0xc2cd };
31 #endif
32 VECT_VAR_DECL(expected_float32,hfloat,32,2) [] = { 0xc0133333, 0xc0133333 };
33 VECT_VAR_DECL(expected_float32,hfloat,32,4) [] = { 0xc059999a, 0xc059999a,
34 0xc059999a, 0xc059999a };
35
36 void exec_vneg_f32(void)
37 {
38 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
39 DECL_VARIABLE(vector, float, 16, 4);
40 DECL_VARIABLE(vector, float, 16, 8);
41 #endif
42 DECL_VARIABLE(vector, float, 32, 2);
43 DECL_VARIABLE(vector, float, 32, 4);
44
45
46 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
47 DECL_VARIABLE(vector_res, float, 16, 4);
48 DECL_VARIABLE(vector_res, float, 16, 8);
49 #endif
50 DECL_VARIABLE(vector_res, float, 32, 2);
51 DECL_VARIABLE(vector_res, float, 32, 4);
52
53 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
54 VDUP(vector, , float, f, 16, 4, 2.3f);
55 VDUP(vector, q, float, f, 16, 8, 3.4f);
56 #endif
57 VDUP(vector, , float, f, 32, 2, 2.3f);
58 VDUP(vector, q, float, f, 32, 4, 3.4f);
59
60 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
61 TEST_UNARY_OP(INSN_NAME, , float, f, 16, 4);
62 TEST_UNARY_OP(INSN_NAME, q, float, f, 16, 8);
63 #endif
64 TEST_UNARY_OP(INSN_NAME, , float, f, 32, 2);
65 TEST_UNARY_OP(INSN_NAME, q, float, f, 32, 4);
66
67 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
68 CHECK_FP(TEST_MSG, float, 16, 4, PRIx16, expected_float16, "");
69 CHECK_FP(TEST_MSG, float, 16, 8, PRIx16, expected_float16, "");
70 #endif
71 CHECK_FP(TEST_MSG, float, 32, 2, PRIx32, expected_float32, "");
72 CHECK_FP(TEST_MSG, float, 32, 4, PRIx32, expected_float32, "");
73 }