| 1 |
/* { dg-do run { target { ! ia32 } } } */ |
| 2 |
/* { dg-require-effective-target amx_tile } */ |
| 3 |
/* { dg-options "-O2 -mamx-tile " } */ |
| 4 |
#include <immintrin.h> |
| 5 |
|
| 6 |
#define DO_TEST test_amx_tile |
| 7 |
void test_amx_tile (); |
| 8 |
#include "amx-check.h" |
| 9 |
|
| 10 |
void test_amx_tile () |
| 11 |
{ |
| 12 |
__tilecfg_u cfg_src, cfg_dst; |
| 13 |
__tile reg_src1, reg_src2, reg_ref; |
| 14 |
|
| 15 |
/* check tile config load & store. */ |
| 16 |
init_tile_config (&cfg_src); |
| 17 |
_tile_storeconfig (cfg_dst.a); |
| 18 |
|
| 19 |
if (!check_tile_config (&cfg_src, &cfg_dst)) |
| 20 |
abort (); |
| 21 |
|
| 22 |
/* check tile register load & store. */ |
| 23 |
init_tile_reg_and_src (1, reg_src1); |
| 24 |
_tile_stored (1, reg_ref.buf, _STRIDE); |
| 25 |
if (!check_tile_register (®_ref, ®_src1)) |
| 26 |
abort (); |
| 27 |
|
| 28 |
/* check tile stream load instruction */ |
| 29 |
init_tile_src (2, ®_src2, NULL); |
| 30 |
_tile_stream_loadd (2, reg_src2.buf, _STRIDE); |
| 31 |
_tile_stored (2, reg_ref.buf, _STRIDE); |
| 32 |
if (!check_tile_register (®_ref, ®_src2)) |
| 33 |
abort (); |
| 34 |
|
| 35 |
/* check tile register zeroing */ |
| 36 |
zero_tile_src (®_src2); |
| 37 |
_tile_zero (2); |
| 38 |
_tile_stored (2, reg_ref.buf, _STRIDE); |
| 39 |
if (!check_tile_register (®_ref, ®_src2)) |
| 40 |
abort (); |
| 41 |
|
| 42 |
/* check tile cfg zeroing */ |
| 43 |
memset (cfg_dst.a, 0, sizeof(__tilecfg)); |
| 44 |
_tile_release (); |
| 45 |
_tile_storeconfig (cfg_src.a); |
| 46 |
if (!check_tile_config (&cfg_src, &cfg_dst)) |
| 47 |
abort (); |
| 48 |
} |