| 1 |
#define FNNAME1(NAME) exec_ ## NAME |
| 2 |
#define FNNAME(NAME) FNNAME1 (NAME) |
| 3 |
|
| 4 |
void FNNAME (INSN) (void) |
| 5 |
{ |
| 6 |
/* vector_res = vrndX (vector), then store the result. */ |
| 7 |
#define TEST_VRND2(INSN, Q, T1, T2, W, N) \ |
| 8 |
VECT_VAR (vector_res, T1, W, N) = \ |
| 9 |
INSN##Q##_##T2##W (VECT_VAR (vector, T1, W, N)); \ |
| 10 |
vst1##Q##_##T2##W (VECT_VAR (result, T1, W, N), \ |
| 11 |
VECT_VAR (vector_res, T1, W, N)) |
| 12 |
|
| 13 |
/* Two auxliary macros are necessary to expand INSN. */ |
| 14 |
#define TEST_VRND1(INSN, Q, T1, T2, W, N) \ |
| 15 |
TEST_VRND2 (INSN, Q, T1, T2, W, N) |
| 16 |
|
| 17 |
#define TEST_VRND(Q, T1, T2, W, N) \ |
| 18 |
TEST_VRND1 (INSN, Q, T1, T2, W, N) |
| 19 |
|
| 20 |
#if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 21 |
DECL_VARIABLE(vector, float, 16, 4); |
| 22 |
DECL_VARIABLE(vector, float, 16, 8); |
| 23 |
#endif |
| 24 |
DECL_VARIABLE (vector, float, 32, 2); |
| 25 |
DECL_VARIABLE (vector, float, 32, 4); |
| 26 |
|
| 27 |
#if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 28 |
DECL_VARIABLE(vector_res, float, 16, 4); |
| 29 |
DECL_VARIABLE(vector_res, float, 16, 8); |
| 30 |
#endif |
| 31 |
DECL_VARIABLE (vector_res, float, 32, 2); |
| 32 |
DECL_VARIABLE (vector_res, float, 32, 4); |
| 33 |
|
| 34 |
clean_results (); |
| 35 |
|
| 36 |
#if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 37 |
VLOAD (vector, buffer, , float, f, 16, 4); |
| 38 |
VLOAD (vector, buffer, q, float, f, 16, 8); |
| 39 |
#endif |
| 40 |
VLOAD (vector, buffer, , float, f, 32, 2); |
| 41 |
VLOAD (vector, buffer, q, float, f, 32, 4); |
| 42 |
|
| 43 |
#if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 44 |
TEST_VRND ( , float, f, 16, 4); |
| 45 |
TEST_VRND (q, float, f, 16, 8); |
| 46 |
#endif |
| 47 |
TEST_VRND ( , float, f, 32, 2); |
| 48 |
TEST_VRND (q, float, f, 32, 4); |
| 49 |
|
| 50 |
#if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 51 |
CHECK_FP (TEST_MSG, float, 16, 4, PRIx16, expected, ""); |
| 52 |
CHECK_FP (TEST_MSG, float, 16, 8, PRIx16, expected, ""); |
| 53 |
#endif |
| 54 |
CHECK_FP (TEST_MSG, float, 32, 2, PRIx32, expected, ""); |
| 55 |
CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected, ""); |
| 56 |
} |
| 57 |
|
| 58 |
int |
| 59 |
main (void) |
| 60 |
{ |
| 61 |
FNNAME (INSN) (); |
| 62 |
return 0; |
| 63 |
} |