| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=x86-64-v3 -mavx10.2 -O2" } */ |
| 3 |
/* { dg-final { scan-assembler-times "vmulbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ |
| 4 |
/* { dg-final { scan-assembler-times "vaddbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 5 |
/* { dg-final { scan-assembler-times "vdivbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 6 |
/* { dg-final { scan-assembler-times "vsubbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 7 |
/* { dg-final { scan-assembler-times "vrcpbf16\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\r]*%zmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ |
| 8 |
|
| 9 |
#include <immintrin.h> |
| 10 |
|
| 11 |
typedef __bf16 v32bf __attribute__ ((__vector_size__ (64))); |
| 12 |
|
| 13 |
v32bf |
| 14 |
foo_mul (v32bf a, v32bf b) |
| 15 |
{ |
| 16 |
return a * b; |
| 17 |
} |
| 18 |
|
| 19 |
v32bf |
| 20 |
foo_add (v32bf a, v32bf b) |
| 21 |
{ |
| 22 |
return a + b; |
| 23 |
} |
| 24 |
|
| 25 |
v32bf |
| 26 |
foo_div (v32bf a, v32bf b) |
| 27 |
{ |
| 28 |
return a / b; |
| 29 |
} |
| 30 |
|
| 31 |
v32bf |
| 32 |
foo_sub (v32bf a, v32bf b) |
| 33 |
{ |
| 34 |
return a - b; |
| 35 |
} |
| 36 |
|
| 37 |
__attribute__((optimize("fast-math"))) |
| 38 |
v32bf |
| 39 |
foo_div_fast_math (v32bf a, v32bf b) |
| 40 |
{ |
| 41 |
return a / b; |
| 42 |
} |