1 /* { dg-do compile } */
2 /* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
3 /* { dg-options "-O2" } */
4 /* { dg-add-options arm_v8_2a_fp16_scalar } */
5 /* { dg-additional-options "-mfloat-abi=hard" } */
8 test_load_1 (__fp16
* a
)
14 test_load_2 (__fp16
* a
, int i
)
19 /* { dg-final { scan-assembler-times {vld1\.16\t\{d[0-9]+\[[0-9]+\]\}, \[r[0-9]+\]} 2 } } */
22 test_store_1 (__fp16
* a
, __fp16 b
)
28 test_store_2 (__fp16
* a
, int i
, __fp16 b
)
33 /* { dg-final { scan-assembler-times {vst1\.16\t\{d[0-9]+\[[0-9]+\]\}, \[r[0-9]+\]} 2 } } */
36 test_load_store_1 (__fp16
* a
, int i
, __fp16
* b
)
42 test_load_store_2 (__fp16
* a
, int i
, __fp16
* b
)
47 /* { dg-final { scan-assembler-times {ldrh\tr[0-9]+} 2 } } */
48 /* { dg-final { scan-assembler-times {strh\tr[0-9]+} 2 } } */
51 test_select_1 (int sel
, __fp16 a
, __fp16 b
)
60 test_select_2 (int sel
, __fp16 a
, __fp16 b
)
66 test_select_3 (__fp16 a
, __fp16 b
, __fp16 c
)
68 return (a
== b
) ? b
: c
;
72 test_select_4 (__fp16 a
, __fp16 b
, __fp16 c
)
74 return (a
!= b
) ? b
: c
;
78 test_select_5 (__fp16 a
, __fp16 b
, __fp16 c
)
80 return (a
< b
) ? b
: c
;
84 test_select_6 (__fp16 a
, __fp16 b
, __fp16 c
)
86 return (a
<= b
) ? b
: c
;
90 test_select_7 (__fp16 a
, __fp16 b
, __fp16 c
)
92 return (a
> b
) ? b
: c
;
96 test_select_8 (__fp16 a
, __fp16 b
, __fp16 c
)
98 return (a
>= b
) ? b
: c
;
101 /* { dg-final { scan-assembler-times {vseleq\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 4 } } */
102 /* { dg-final { scan-assembler-times {vselgt\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 1 } } */
103 /* { dg-final { scan-assembler-times {vselge\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 1 } } */
105 /* { dg-final { scan-assembler-times {vmov\.f16\ts[0-9]+, r[0-9]+} 2 } } */
108 test_compare_1 (__fp16 a
, __fp16 b
)
117 test_compare_ (__fp16 a
, __fp16 b
)
126 test_compare_2 (__fp16 a
, __fp16 b
)
135 test_compare_3 (__fp16 a
, __fp16 b
)
144 test_compare_4 (__fp16 a
, __fp16 b
)
153 test_compare_5 (__fp16 a
, __fp16 b
)
161 /* { dg-final { scan-assembler-not {vcmp\.f16} } } */
162 /* { dg-final { scan-assembler-not {vcmpe\.f16} } } */
164 /* { dg-final { scan-assembler-times {vcmp\.f32} 4 } } */
165 /* { dg-final { scan-assembler-times {vcmpe\.f32} 8 } } */