2 #define TEST_MSG "VSUB/VSUBQ"
4 /* Extra tests for functions requiring floating-point types */
5 void exec_vsub_f32(void);
6 #define EXTRA_TESTS exec_vsub_f32
8 #include "binary_op.inc"
10 /* Expected results. */
11 VECT_VAR_DECL(expected
,int,8,8) [] = { 0xee, 0xef, 0xf0, 0xf1,
12 0xf2, 0xf3, 0xf4, 0xf5 };
13 VECT_VAR_DECL(expected
,int,16,4) [] = { 0xfff4, 0xfff5, 0xfff6, 0xfff7 };
14 VECT_VAR_DECL(expected
,int,32,2) [] = { 0xffffffed, 0xffffffee };
15 VECT_VAR_DECL(expected
,int,64,1) [] = { 0xffffffffffffff8c };
16 VECT_VAR_DECL(expected
,uint
,8,8) [] = { 0xdc, 0xdd, 0xde, 0xdf,
17 0xe0, 0xe1, 0xe2, 0xe3 };
18 VECT_VAR_DECL(expected
,uint
,16,4) [] = { 0xffd2, 0xffd3, 0xffd4, 0xffd5 };
19 VECT_VAR_DECL(expected
,uint
,32,2) [] = { 0xffffffc8, 0xffffffc9 };
20 VECT_VAR_DECL(expected
,uint
,64,1) [] = { 0xffffffffffffffee };
21 VECT_VAR_DECL(expected
,int,8,16) [] = { 0xfa, 0xfb, 0xfc, 0xfd,
25 VECT_VAR_DECL(expected
,int,16,8) [] = { 0x4, 0x5, 0x6, 0x7,
27 VECT_VAR_DECL(expected
,int,32,4) [] = { 0xe, 0xf, 0x10, 0x11 };
28 VECT_VAR_DECL(expected
,int,64,2) [] = { 0xffffffffffffffd8,
30 VECT_VAR_DECL(expected
,uint
,8,16) [] = { 0xe4, 0xe5, 0xe6, 0xe7,
31 0xe8, 0xe9, 0xea, 0xeb,
32 0xec, 0xed, 0xee, 0xef,
33 0xf0, 0xf1, 0xf2, 0xf3};
34 VECT_VAR_DECL(expected
,uint
,16,8) [] = { 0xffed, 0xffee, 0xffef, 0xfff0,
35 0xfff1, 0xfff2, 0xfff3, 0xfff4 };
36 VECT_VAR_DECL(expected
,uint
,32,4) [] = { 0xffffffb9, 0xffffffba,
37 0xffffffbb, 0xffffffbc };
38 VECT_VAR_DECL(expected
,uint
,64,2) [] = { 0xffffffffffffffed,
41 /* Expected results for float32 variants. Needs to be separated since
42 the generic test function does not test floating-point
44 VECT_VAR_DECL(expected_float32
,hfloat
,32,2) [] = { 0xc00ccccd, 0xc00ccccd };
45 VECT_VAR_DECL(expected_float32
,hfloat
,32,4) [] = { 0xc00ccccc, 0xc00ccccc,
46 0xc00ccccc, 0xc00ccccc };
47 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
48 VECT_VAR_DECL(expected_float16
, hfloat
, 16, 4) [] = { 0xc066, 0xc066,
50 VECT_VAR_DECL(expected_float16
, hfloat
, 16, 8) [] = { 0xc067, 0xc067,
56 void exec_vsub_f32(void)
58 DECL_VARIABLE(vector
, float, 32, 2);
59 DECL_VARIABLE(vector
, float, 32, 4);
61 DECL_VARIABLE(vector2
, float, 32, 2);
62 DECL_VARIABLE(vector2
, float, 32, 4);
64 DECL_VARIABLE(vector_res
, float, 32, 2);
65 DECL_VARIABLE(vector_res
, float, 32, 4);
67 VDUP(vector
, , float, f
, 32, 2, 2.3f
);
68 VDUP(vector
, q
, float, f
, 32, 4, 3.4f
);
70 VDUP(vector2
, , float, f
, 32, 2, 4.5f
);
71 VDUP(vector2
, q
, float, f
, 32, 4, 5.6f
);
73 TEST_BINARY_OP(INSN_NAME
, , float, f
, 32, 2);
74 TEST_BINARY_OP(INSN_NAME
, q
, float, f
, 32, 4);
76 CHECK_FP(TEST_MSG
, float, 32, 2, PRIx32
, expected_float32
, "");
77 CHECK_FP(TEST_MSG
, float, 32, 4, PRIx32
, expected_float32
, "");
79 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
80 DECL_VARIABLE(vector
, float, 16, 4);
81 DECL_VARIABLE(vector
, float, 16, 8);
83 DECL_VARIABLE(vector2
, float, 16, 4);
84 DECL_VARIABLE(vector2
, float, 16, 8);
86 DECL_VARIABLE(vector_res
, float, 16, 4);
87 DECL_VARIABLE(vector_res
, float, 16, 8);
89 VDUP(vector
, , float, f
, 16, 4, 2.3f
);
90 VDUP(vector
, q
, float, f
, 16, 8, 3.4f
);
92 VDUP(vector2
, , float, f
, 16, 4, 4.5f
);
93 VDUP(vector2
, q
, float, f
, 16, 8, 5.6f
);
95 TEST_BINARY_OP(INSN_NAME
, , float, f
, 16, 4);
96 TEST_BINARY_OP(INSN_NAME
, q
, float, f
, 16, 8);
98 CHECK_FP(TEST_MSG
, float, 16, 4, PRIx16
, expected_float16
, "");
99 CHECK_FP(TEST_MSG
, float, 16, 8, PRIx16
, expected_float16
, "");