| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mavx512fp16 -mavx512vl -Ofast" } */ |
| 3 |
/* { dg-final { scan-assembler-times {(?n)vmaxph[ \t].*%xmm[0-9]} 2 { target { ! ia32 } } } } */ |
| 4 |
/* { dg-final { scan-assembler-times {(?n)vminph[ \t].*%xmm[0-9]} 2 { target { ! ia32 } } } } */ |
| 5 |
|
| 6 |
void |
| 7 |
foo16_max (_Float16* a, _Float16* b, _Float16* __restrict c) |
| 8 |
{ |
| 9 |
c[0] = __builtin_fmaxf16 (a[0], b[0]); |
| 10 |
c[1] = __builtin_fmaxf16 (a[1], b[1]); |
| 11 |
} |
| 12 |
|
| 13 |
void |
| 14 |
foo32_max(_Float16* a, _Float16* b, _Float16* __restrict c) |
| 15 |
{ |
| 16 |
c[0] = __builtin_fmaxf16 (a[0], b[0]); |
| 17 |
c[1] = __builtin_fmaxf16 (a[1], b[1]); |
| 18 |
c[2] = __builtin_fmaxf16 (a[2], b[2]); |
| 19 |
c[3] = __builtin_fmaxf16 (a[3], b[3]); |
| 20 |
} |
| 21 |
|
| 22 |
void |
| 23 |
foo16_min (_Float16* a, _Float16* b, _Float16* __restrict c) |
| 24 |
{ |
| 25 |
c[0] = __builtin_fminf16 (a[0], b[0]); |
| 26 |
c[1] = __builtin_fminf16 (a[1], b[1]); |
| 27 |
} |
| 28 |
|
| 29 |
void |
| 30 |
foo32_min(_Float16* a, _Float16* b, _Float16* __restrict c) |
| 31 |
{ |
| 32 |
c[0] = __builtin_fminf16 (a[0], b[0]); |
| 33 |
c[1] = __builtin_fminf16 (a[1], b[1]); |
| 34 |
c[2] = __builtin_fminf16 (a[2], b[2]); |
| 35 |
c[3] = __builtin_fminf16 (a[3], b[3]); |
| 36 |
} |