2015-05-19 Christophe Lyon <christophe.lyon@linaro.org>
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / advsimd-intrinsics / vneg.c
blob78f17ed155c920b693b0793ecd1ce200ab25ee2d
1 #define INSN_NAME vneg
2 #define TEST_MSG "VNEG/VNEGQ"
4 /* Extra tests for functions requiring floating-point types. */
5 void exec_vneg_f32(void);
6 #define EXTRA_TESTS exec_vneg_f32
8 #include "unary_op.inc"
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 };
21 /* Expected results for float32 variants. Needs to be separated since
22 the generic test function does not test floating-point
23 versions. */
24 VECT_VAR_DECL(expected_float32,hfloat,32,2) [] = { 0xc0133333, 0xc0133333 };
25 VECT_VAR_DECL(expected_float32,hfloat,32,4) [] = { 0xc059999a, 0xc059999a,
26 0xc059999a, 0xc059999a };
28 void exec_vneg_f32(void)
30 DECL_VARIABLE(vector, float, 32, 2);
31 DECL_VARIABLE(vector, float, 32, 4);
33 DECL_VARIABLE(vector_res, float, 32, 2);
34 DECL_VARIABLE(vector_res, float, 32, 4);
36 VDUP(vector, , float, f, 32, 2, 2.3f);
37 VDUP(vector, q, float, f, 32, 4, 3.4f);
39 TEST_UNARY_OP(INSN_NAME, , float, f, 32, 2);
40 TEST_UNARY_OP(INSN_NAME, q, float, f, 32, 4);
42 CHECK_FP(TEST_MSG, float, 32, 2, PRIx32, expected_float32, "");
43 CHECK_FP(TEST_MSG, float, 32, 4, PRIx32, expected_float32, "");