| 1 |
/* { dg-require-effective-target arm_v8_2a_fp16_scalar_hw } */ |
| 2 |
/* { dg-add-options arm_v8_2a_fp16_scalar } */ |
| 3 |
/* { dg-skip-if "" { arm*-*-* } } */ |
| 4 |
|
| 5 |
#include <arm_fp16.h> |
| 6 |
|
| 7 |
/* Input values. */ |
| 8 |
uint16_t input[] = { 1, 10, 48, 100, 1000, 0, 500, 9 }; |
| 9 |
|
| 10 |
/* Expected results (16-bit hexadecimal representation). */ |
| 11 |
uint16_t expected_1[] = { 0x3800 /* 0.5. */, |
| 12 |
0x4500 /* 5. */, |
| 13 |
0x4E00 /* 24. */, |
| 14 |
0x5240 /* 50. */, |
| 15 |
0x5FD0 /* 500. */, |
| 16 |
0x0000 /* 0.0. */, |
| 17 |
0x5BD0 /* 250. */, |
| 18 |
0x4480 /* 4.5. */ }; |
| 19 |
|
| 20 |
uint16_t expected_2[] = { 0x3400 /* 0.25. */, |
| 21 |
0x4100 /* 2.5. */, |
| 22 |
0x4A00 /* 12. */, |
| 23 |
0x4E40 /* 25. */, |
| 24 |
0x5BD0 /* 250. */, |
| 25 |
0x0000 /* 0.0. */, |
| 26 |
0x57D0 /* 125. */, |
| 27 |
0x4080 /* 2.25. */ }; |
| 28 |
|
| 29 |
#define TEST_MSG "VCVTH_N_F16_U16" |
| 30 |
#define INSN_NAME vcvth_n_f16_u16 |
| 31 |
|
| 32 |
#define INPUT input |
| 33 |
#define EXPECTED_1 expected_1 |
| 34 |
#define EXPECTED_2 expected_2 |
| 35 |
|
| 36 |
#define INPUT_TYPE uint16_t |
| 37 |
#define OUTPUT_TYPE float16_t |
| 38 |
#define OUTPUT_TYPE_SIZE 16 |
| 39 |
|
| 40 |
#define SCALAR_OPERANDS |
| 41 |
#define SCALAR_1 1 |
| 42 |
#define SCALAR_2 2 |
| 43 |
|
| 44 |
/* Include the template for unary scalar operations. */ |
| 45 |
#include "unary_scalar_op.inc" |