[AArch64] Add support for 16-bit FMOV immediates
[official-gcc.git] / gcc / testsuite / gcc.target / aarch64 / f16_mov_immediate_2.c
blob53c43240a36486cc37de11872f0d77aa777be315
1 /* { dg-do compile } */
2 /* { dg-options "-O3" } */
3 /* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok } */
4 /* { dg-add-options arm_v8_2a_fp16_scalar } */
6 #include <arm_fp16.h>
8 float16_t f0(void)
10 float16_t x = 0.0f;
11 return x;
14 float16_t fn1(void)
16 float16_t x = -0.0f;
17 return x;
20 float16_t f1(void)
22 float16_t x = 256.0f;
23 return x;
26 float16_t f2(void)
28 float16_t x = 123256.0f;
29 return x;
32 float16_t f3(void)
34 float16_t x = 17.0;
35 return x;
38 /* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, ?#0" 1 } } */
39 /* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, 0x80, lsl 8" 1 } } */
40 /* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, 0x5c, lsl 8" 1 } } */
41 /* { dg-final { scan-assembler-times "movi\tv\[0-9\]+\\\.4h, 0x7c, lsl 8" 1 } } */
43 /* { dg-final { scan-assembler-times {fmov\th[0-9]+, #?1.7e\+1} 1 } } */