| 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 } */ |
| 5 |
|
| 6 |
#include <arm_fp16.h> |
| 7 |
|
| 8 |
float16_t f0(void) |
| 9 |
{ |
| 10 |
float16_t x = 0.0f; |
| 11 |
return x; |
| 12 |
} |
| 13 |
|
| 14 |
float16_t fn1(void) |
| 15 |
{ |
| 16 |
float16_t x = -0.0f; |
| 17 |
return x; |
| 18 |
} |
| 19 |
|
| 20 |
float16_t f1(void) |
| 21 |
{ |
| 22 |
float16_t x = 256.0f; |
| 23 |
return x; |
| 24 |
} |
| 25 |
|
| 26 |
float16_t f2(void) |
| 27 |
{ |
| 28 |
float16_t x = 123256.0f; |
| 29 |
return x; |
| 30 |
} |
| 31 |
|
| 32 |
float16_t f3(void) |
| 33 |
{ |
| 34 |
float16_t x = 17.0; |
| 35 |
return x; |
| 36 |
} |
| 37 |
|
| 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 } } */ |
| 42 |
|
| 43 |
/* { dg-final { scan-assembler-times {fmov\th[0-9]+, #?1.7e\+1} 1 } } */ |