Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvta_1.c

raw
1 /* This file tests an intrinsic which currently has only an f16 variant and that
2 is only available when FP16 arithmetic instructions are supported. */
3 /* { dg-require-effective-target arm_v8_2a_fp16_neon_hw } */
4
5 #include <arm_neon.h>
6 #include "arm-neon-ref.h"
7 #include "compute-ref-data.h"
8 #include <math.h>
9
10 /* Expected results. */
11 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
12 VECT_VAR_DECL(expected, int, 16, 4) [] = { 0xfff1, 0x5, 0xfff1, 0x5 };
13 VECT_VAR_DECL(expected, uint, 16, 4) [] = { 0x0, 0x5, 0x0, 0x5 };
14 VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x0, 0x0, 0xf, 0xfff1,
15 0x0, 0x0, 0xf, 0xfff1 };
16 VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x0, 0x0, 0xf, 0x0,
17 0x0, 0x0, 0xf, 0x0 };
18 #endif
19
20 /* Expected results with rounding. */
21 #if defined (__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
22 VECT_VAR_DECL(expected_rounding, int, 16, 4) [] = { 0xa, 0xa, 0xa, 0xa };
23 VECT_VAR_DECL(expected_rounding, uint, 16, 4) [] = { 0xa, 0xa, 0xa, 0xa };
24 VECT_VAR_DECL(expected_rounding, int, 16, 8) [] = { 0x7e, 0x7e, 0x7e, 0x7e,
25 0x7e, 0x7e, 0x7e, 0x7e };
26 VECT_VAR_DECL(expected_rounding, uint, 16, 8) [] = { 0x7e, 0x7e, 0x7e, 0x7e,
27 0x7e, 0x7e, 0x7e, 0x7e };
28 #endif
29
30 #define TEST_MSG "VCVTA/VCVTAQ"
31 #define INSN_NAME vcvta
32
33 #include "vcvtX.inc"