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 } */
7 test_load_1 (__fp16
* a
)
13 test_load_2 (__fp16
* a
, int i
)
18 /* { dg-final { scan-assembler-times {vld1\.16\t\{d[0-9]+\[[0-9]+\]\}, \[r[0-9]+\]} 2 } } */
21 test_store_1 (__fp16
* a
, __fp16 b
)
27 test_store_2 (__fp16
* a
, int i
, __fp16 b
)
32 /* { dg-final { scan-assembler-times {vst1\.16\t\{d[0-9]+\[[0-9]+\]\}, \[r[0-9]+\]} 2 } } */
35 test_load_store_1 (__fp16
* a
, int i
, __fp16
* b
)
41 test_load_store_2 (__fp16
* a
, int i
, __fp16
* b
)
46 /* { dg-final { scan-assembler-times {ldrh\tr[0-9]+} 2 } } */
47 /* { dg-final { scan-assembler-times {strh\tr[0-9]+} 2 } } */
50 test_select_1 (int sel
, __fp16 a
, __fp16 b
)
59 test_select_2 (int sel
, __fp16 a
, __fp16 b
)
65 test_select_3 (__fp16 a
, __fp16 b
, __fp16 c
)
67 return (a
== b
) ? b
: c
;
71 test_select_4 (__fp16 a
, __fp16 b
, __fp16 c
)
73 return (a
!= b
) ? b
: c
;
77 test_select_5 (__fp16 a
, __fp16 b
, __fp16 c
)
79 return (a
< b
) ? b
: c
;
83 test_select_6 (__fp16 a
, __fp16 b
, __fp16 c
)
85 return (a
<= b
) ? b
: c
;
89 test_select_7 (__fp16 a
, __fp16 b
, __fp16 c
)
91 return (a
> b
) ? b
: c
;
95 test_select_8 (__fp16 a
, __fp16 b
, __fp16 c
)
97 return (a
>= b
) ? b
: c
;
100 /* { dg-final { scan-assembler-times {vseleq\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 4 } } */
101 /* { dg-final { scan-assembler-times {vselgt\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 1 } } */
102 /* { dg-final { scan-assembler-times {vselge\.f16\ts[0-9]+, s[0-9]+, s[0-9]+} 1 } } */
104 /* { dg-final { scan-assembler-times {vmov\.f16\ts[0-9]+, r[0-9]+} 4 } } */
105 /* { dg-final { scan-assembler-times {vmov\.f16\tr[0-9]+, s[0-9]+} 4 } } */
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 } } */