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, 0x6, 0xfff1, 0x6 }; 13 VECT_VAR_DECL(expected, uint, 16, 4) [] = { 0x0, 0x6, 0x0, 0x6 }; 14 VECT_VAR_DECL(expected, int, 16, 8) [] = { 0x0, 0x0, 0x10, 0xfff1, 15 0x0, 0x0, 0x10, 0xfff1 }; 16 VECT_VAR_DECL(expected, uint, 16, 8) [] = { 0x0, 0x0, 0x10, 0x0, 17 0x0, 0x0, 0x10, 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) [] = { 0xb, 0xb, 0xb, 0xb }; 23 VECT_VAR_DECL(expected_rounding, uint, 16, 4) [] = { 0xb, 0xb, 0xb, 0xb }; 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 "VCVTP/VCVTPQ" 31 #define INSN_NAME vcvtp 32 33 #include "vcvtX.inc" 34