annotate gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vsqrt_f16_1.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do run } */
kono
parents:
diff changeset
2 /* { dg-require-effective-target arm_v8_2a_fp16_neon_hw } */
kono
parents:
diff changeset
3 /* { dg-add-options arm_v8_2a_fp16_neon } */
kono
parents:
diff changeset
4 /* { dg-skip-if "" { arm*-*-* } } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #include <arm_neon.h>
kono
parents:
diff changeset
7 #include "arm-neon-ref.h"
kono
parents:
diff changeset
8 #include "compute-ref-data.h"
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 #define FP16_C(a) ((__fp16) a)
kono
parents:
diff changeset
11 #define A FP16_C (123.4)
kono
parents:
diff changeset
12 #define B FP16_C (567.8)
kono
parents:
diff changeset
13 #define C FP16_C (34.8)
kono
parents:
diff changeset
14 #define D FP16_C (1024)
kono
parents:
diff changeset
15 #define E FP16_C (663.1)
kono
parents:
diff changeset
16 #define F FP16_C (144.0)
kono
parents:
diff changeset
17 #define G FP16_C (4.8)
kono
parents:
diff changeset
18 #define H FP16_C (77)
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 #define SQRT_A 0x498E /* FP16_C (__builtin_sqrtf (123.4)). */
kono
parents:
diff changeset
21 #define SQRT_B 0x4DF5 /* FP16_C (__builtin_sqrtf (567.8)). */
kono
parents:
diff changeset
22 #define SQRT_C 0x45E6 /* FP16_C (__builtin_sqrtf (34.8)). */
kono
parents:
diff changeset
23 #define SQRT_D 0x5000 /* FP16_C (__builtin_sqrtf (1024)). */
kono
parents:
diff changeset
24 #define SQRT_E 0x4E70 /* FP16_C (__builtin_sqrtf (663.1)). */
kono
parents:
diff changeset
25 #define SQRT_F 0x4A00 /* FP16_C (__builtin_sqrtf (144.0)). */
kono
parents:
diff changeset
26 #define SQRT_G 0x4062 /* FP16_C (__builtin_sqrtf (4.8)). */
kono
parents:
diff changeset
27 #define SQRT_H 0x4863 /* FP16_C (__builtin_sqrtf (77)). */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* Expected results for vsqrt. */
kono
parents:
diff changeset
30 VECT_VAR_DECL (expected_static, hfloat, 16, 4) []
kono
parents:
diff changeset
31 = { SQRT_A, SQRT_B, SQRT_C, SQRT_D };
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 VECT_VAR_DECL (expected_static, hfloat, 16, 8) []
kono
parents:
diff changeset
34 = { SQRT_A, SQRT_B, SQRT_C, SQRT_D, SQRT_E, SQRT_F, SQRT_G, SQRT_H };
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 void exec_vsqrt_f16 (void)
kono
parents:
diff changeset
37 {
kono
parents:
diff changeset
38 #undef TEST_MSG
kono
parents:
diff changeset
39 #define TEST_MSG "VSQRT (FP16)"
kono
parents:
diff changeset
40 clean_results ();
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 DECL_VARIABLE(vsrc, float, 16, 4);
kono
parents:
diff changeset
43 VECT_VAR_DECL (buf_src, float, 16, 4) [] = {A, B, C, D};
kono
parents:
diff changeset
44 VLOAD (vsrc, buf_src, , float, f, 16, 4);
kono
parents:
diff changeset
45 DECL_VARIABLE (vector_res, float, 16, 4)
kono
parents:
diff changeset
46 = vsqrt_f16 (VECT_VAR (vsrc, float, 16, 4));
kono
parents:
diff changeset
47 vst1_f16 (VECT_VAR (result, float, 16, 4),
kono
parents:
diff changeset
48 VECT_VAR (vector_res, float, 16, 4));
kono
parents:
diff changeset
49
kono
parents:
diff changeset
50 CHECK_FP (TEST_MSG, float, 16, 4, PRIx16, expected_static, "");
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 #undef TEST_MSG
kono
parents:
diff changeset
53 #define TEST_MSG "VSQRTQ (FP16)"
kono
parents:
diff changeset
54 clean_results ();
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 DECL_VARIABLE(vsrc, float, 16, 8);
kono
parents:
diff changeset
57 VECT_VAR_DECL (buf_src, float, 16, 8) [] = {A, B, C, D, E, F, G, H};
kono
parents:
diff changeset
58 VLOAD (vsrc, buf_src, q, float, f, 16, 8);
kono
parents:
diff changeset
59 DECL_VARIABLE (vector_res, float, 16, 8)
kono
parents:
diff changeset
60 = vsqrtq_f16 (VECT_VAR (vsrc, float, 16, 8));
kono
parents:
diff changeset
61 vst1q_f16 (VECT_VAR (result, float, 16, 8),
kono
parents:
diff changeset
62 VECT_VAR (vector_res, float, 16, 8));
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 CHECK_FP (TEST_MSG, float, 16, 8, PRIx16, expected_static, "");
kono
parents:
diff changeset
65 }
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 int
kono
parents:
diff changeset
68 main (void)
kono
parents:
diff changeset
69 {
kono
parents:
diff changeset
70 exec_vsqrt_f16 ();
kono
parents:
diff changeset
71 return 0;
kono
parents:
diff changeset
72 }