| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-Ofast -mavx512fp16" } */ |
| 3 |
|
| 4 |
_Float16 |
| 5 |
f1 (_Float16 x) |
| 6 |
{ |
| 7 |
return __builtin_truncf16 (x); |
| 8 |
} |
| 9 |
|
| 10 |
_Float16 |
| 11 |
f2 (_Float16 x) |
| 12 |
{ |
| 13 |
return __builtin_floorf16 (x); |
| 14 |
} |
| 15 |
|
| 16 |
_Float16 |
| 17 |
f3 (_Float16 x) |
| 18 |
{ |
| 19 |
return __builtin_ceilf16 (x); |
| 20 |
} |
| 21 |
|
| 22 |
_Float16 |
| 23 |
f4 (_Float16 x) |
| 24 |
{ |
| 25 |
return __builtin_roundevenf16 (x); |
| 26 |
} |
| 27 |
|
| 28 |
_Float16 |
| 29 |
f5 (_Float16 x) |
| 30 |
{ |
| 31 |
return __builtin_rintf16 (x); |
| 32 |
} |
| 33 |
|
| 34 |
_Float16 |
| 35 |
f6 (_Float16 x) |
| 36 |
{ |
| 37 |
return __builtin_nearbyintf16 (x); |
| 38 |
} |
| 39 |
|
| 40 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$11\[^\n\r\]*xmm\[0-9\]" 1 } } */ |
| 41 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$10\[^\n\r\]*xmm\[0-9\]" 1 } } */ |
| 42 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$9\[^\n\r\]*xmm\[0-9\]" 1 } } */ |
| 43 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$8\[^\n\r\]*xmm\[0-9\]" 1 } } */ |
| 44 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$4\[^\n\r\]*xmm\[0-9\]" 1 } } */ |
| 45 |
/* { dg-final { scan-assembler-times "vrndscalesh\[ \\t\]+\\\$12\[^\n\r\]*xmm\[0-9\]" 1 } } */ |