| 1 |
/* { dg-require-effective-target arm_v8_2a_fp16_scalar_hw } */ |
| 2 |
/* { dg-add-options arm_v8_2a_fp16_scalar } */ |
| 3 |
|
| 4 |
#include <arm_fp16.h> |
| 5 |
|
| 6 |
/* Input values. */ |
| 7 |
float16_t input[] = |
| 8 |
{ |
| 9 |
0.0, -0.0, |
| 10 |
123.4, -567.8, |
| 11 |
-34.8, 1024, |
| 12 |
663.1, 169.1, |
| 13 |
-4.8, 77.0, |
| 14 |
-144.5, -56.8, |
| 15 |
|
| 16 |
(float16_t) -16, (float16_t) -15, |
| 17 |
(float16_t) -14, (float16_t) -13, |
| 18 |
}; |
| 19 |
|
| 20 |
/* Expected results (32-bit hexadecimal representation). */ |
| 21 |
uint32_t expected_1[] = |
| 22 |
{ |
| 23 |
0x00000000, |
| 24 |
0x00000000, |
| 25 |
0x000000f6, |
| 26 |
0x00000000, |
| 27 |
0x00000000, |
| 28 |
0x00000800, |
| 29 |
0x0000052e, |
| 30 |
0x00000152, |
| 31 |
0x00000000, |
| 32 |
0x0000009a, |
| 33 |
0x00000000, |
| 34 |
0x00000000, |
| 35 |
0x00000000, |
| 36 |
0x00000000, |
| 37 |
0x00000000, |
| 38 |
0x00000000, |
| 39 |
}; |
| 40 |
|
| 41 |
uint32_t expected_2[] = |
| 42 |
{ |
| 43 |
0x00000000, |
| 44 |
0x00000000, |
| 45 |
0x000001ed, |
| 46 |
0x00000000, |
| 47 |
0x00000000, |
| 48 |
0x00001000, |
| 49 |
0x00000a5c, |
| 50 |
0x000002a4, |
| 51 |
0x00000000, |
| 52 |
0x00000134, |
| 53 |
0x00000000, |
| 54 |
0x00000000, |
| 55 |
0x00000000, |
| 56 |
0x00000000, |
| 57 |
0x00000000, |
| 58 |
0x00000000, |
| 59 |
}; |
| 60 |
|
| 61 |
uint32_t expected_3[] = |
| 62 |
{ |
| 63 |
0x00000000, |
| 64 |
0x00000000, |
| 65 |
0xffffffff, |
| 66 |
0x00000000, |
| 67 |
0x00000000, |
| 68 |
0xffffffff, |
| 69 |
0xffffffff, |
| 70 |
0xffffffff, |
| 71 |
0x00000000, |
| 72 |
0xffffffff, |
| 73 |
0x00000000, |
| 74 |
0x00000000, |
| 75 |
0x00000000, |
| 76 |
0x00000000, |
| 77 |
0x00000000, |
| 78 |
0x00000000, |
| 79 |
}; |
| 80 |
|
| 81 |
#define TEST_MSG "VCVTH_N_U32_F16" |
| 82 |
#define INSN_NAME vcvth_n_u32_f16 |
| 83 |
|
| 84 |
#define INPUT input |
| 85 |
#define EXPECTED_1 expected_1 |
| 86 |
#define EXPECTED_2 expected_2 |
| 87 |
#define EXPECTED_3 expected_3 |
| 88 |
|
| 89 |
#define INPUT_TYPE float16_t |
| 90 |
#define OUTPUT_TYPE uint32_t |
| 91 |
#define OUTPUT_TYPE_SIZE 32 |
| 92 |
|
| 93 |
#define SCALAR_OPERANDS |
| 94 |
#define SCALAR_1 1 |
| 95 |
#define SCALAR_2 2 |
| 96 |
#define SCALAR_3 32 |
| 97 |
|
| 98 |
/* Include the template for unary scalar operations. */ |
| 99 |
#include "unary_scalar_op.inc" |