2 #define TEST_MSG "VABS/VABSQ"
4 /* Extra tests for functions requiring floating-point types. */
5 void exec_vabs_f32(void);
6 #define EXTRA_TESTS exec_vabs_f32
8 #include "unary_op.inc"
10 /* Expected results. */
11 VECT_VAR_DECL(expected
,int,8,8) [] = { 0x10, 0xf, 0xe, 0xd,
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,
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
24 VECT_VAR_DECL(expected_float32
,hfloat
,32,2) [] = { 0x40133333, 0x40133333 };
25 VECT_VAR_DECL(expected_float32
,hfloat
,32,4) [] = { 0x4059999a, 0x4059999a,
26 0x4059999a, 0x4059999a };
28 void exec_vabs_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
, "");