| 1 |
/* { dg-do compile { target { ! ia32 } } } */ |
| 2 |
/* { dg-options "-mamx-tile -mamx-fp8 -O0" } */ |
| 3 |
/* { dg-final { scan-assembler "tdpbf8ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm0" } } */ |
| 4 |
/* { dg-final { scan-assembler "tdpbhf8ps\[ \\t]+%tmm5,\[ \\t\]*%tmm4,\[ \\t\]*%tmm3" } } */ |
| 5 |
/* { dg-final { scan-assembler "tdphbf8ps\[ \\t]+%tmm2,\[ \\t\]*%tmm1,\[ \\t\]*%tmm6" } } */ |
| 6 |
/* { dg-final { scan-assembler "tdphf8ps\[ \\t]+%tmm1,\[ \\t\]*%tmm0,\[ \\t\]*%tmm7" } } */ |
| 7 |
|
| 8 |
#include <immintrin.h> |
| 9 |
|
| 10 |
template <int dst, int src1, int src2> |
| 11 |
struct dpbf8ps |
| 12 |
{ |
| 13 |
void operator()() { _tile_dpbf8ps(dst, src1, src2); } |
| 14 |
}; |
| 15 |
|
| 16 |
template <int dst, int src1, int src2> |
| 17 |
struct dpbhf8ps |
| 18 |
{ |
| 19 |
void operator()() { _tile_dpbhf8ps(dst, src1, src2); } |
| 20 |
}; |
| 21 |
|
| 22 |
template <int dst, int src1, int src2> |
| 23 |
struct dphbf8ps |
| 24 |
{ |
| 25 |
void operator()() { _tile_dphbf8ps(dst, src1, src2); } |
| 26 |
}; |
| 27 |
|
| 28 |
template <int dst, int src1, int src2> |
| 29 |
struct dphf8ps |
| 30 |
{ |
| 31 |
void operator()() { _tile_dphf8ps(dst, src1, src2); } |
| 32 |
}; |
| 33 |
|
| 34 |
void test_amx_fp8() |
| 35 |
{ |
| 36 |
dpbf8ps<0, 1, 2>()(); |
| 37 |
dpbhf8ps<3, 4, 5>()(); |
| 38 |
dphbf8ps<6, 1, 2>()(); |
| 39 |
dphf8ps<7, 0, 1>()(); |
| 40 |
} |