1
+ #[ cfg( test) ]
2
+ use stdarch_test:: assert_instr;
3
+
1
4
/// Load tile configuration from a 64-byte memory location specified by mem_addr.
2
5
/// The tile configuration format is specified below, and includes the tile type pallette,
3
6
/// the number of bytes per row, and the number of rows. If the specified pallette_id is zero,
7
10
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_tile_loadconfig&ig_expand=6875)
8
11
#[ inline]
9
12
#[ target_feature( enable = "amx-tile" ) ]
13
+ #[ cfg_attr( test, assert_instr( ldtilecfg) ) ]
10
14
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
11
15
pub unsafe fn _tile_loadconfig ( mem_addr : * const u8 ) {
12
16
ldtilecfg ( mem_addr) ;
@@ -19,6 +23,7 @@ pub unsafe fn _tile_loadconfig(mem_addr: *const u8) {
19
23
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_tile_storeconfig&ig_expand=6879)
20
24
#[ inline]
21
25
#[ target_feature( enable = "amx-tile" ) ]
26
+ #[ cfg_attr( test, assert_instr( sttilecfg) ) ]
22
27
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
23
28
pub unsafe fn _tile_storeconfig ( mem_addr : * mut u8 ) {
24
29
sttilecfg ( mem_addr) ;
@@ -30,6 +35,7 @@ pub unsafe fn _tile_storeconfig(mem_addr: *mut u8) {
30
35
#[ inline]
31
36
#[ rustc_legacy_const_generics( 0 ) ]
32
37
#[ target_feature( enable = "amx-tile" ) ]
38
+ #[ cfg_attr( test, assert_instr( tileloadd, DST = 0 ) ) ]
33
39
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
34
40
pub unsafe fn _tile_loadd < const DST : i32 > ( base : * const u8 , stride : usize ) {
35
41
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -41,6 +47,7 @@ pub unsafe fn _tile_loadd<const DST: i32>(base: *const u8, stride: usize) {
41
47
/// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_tile_release&ig_expand=6878)
42
48
#[ inline]
43
49
#[ target_feature( enable = "amx-tile" ) ]
50
+ #[ cfg_attr( test, assert_instr( tilerelease) ) ]
44
51
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
45
52
pub unsafe fn _tile_release ( ) {
46
53
tilerelease ( ) ;
@@ -52,6 +59,7 @@ pub unsafe fn _tile_release() {
52
59
#[ inline]
53
60
#[ rustc_legacy_const_generics( 0 ) ]
54
61
#[ target_feature( enable = "amx-tile" ) ]
62
+ #[ cfg_attr( test, assert_instr( tilestored, DST = 0 ) ) ]
55
63
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
56
64
pub unsafe fn _tile_stored < const DST : i32 > ( base : * mut u8 , stride : usize ) {
57
65
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -66,6 +74,7 @@ pub unsafe fn _tile_stored<const DST: i32>(base: *mut u8, stride: usize) {
66
74
#[ inline]
67
75
#[ rustc_legacy_const_generics( 0 ) ]
68
76
#[ target_feature( enable = "amx-tile" ) ]
77
+ #[ cfg_attr( test, assert_instr( tileloaddt1, DST = 0 ) ) ]
69
78
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
70
79
pub unsafe fn _tile_stream_loadd < const DST : i32 > ( base : * const u8 , stride : usize ) {
71
80
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -78,6 +87,7 @@ pub unsafe fn _tile_stream_loadd<const DST: i32>(base: *const u8, stride: usize)
78
87
#[ inline]
79
88
#[ rustc_legacy_const_generics( 0 ) ]
80
89
#[ target_feature( enable = "amx-tile" ) ]
90
+ #[ cfg_attr( test, assert_instr( tilezero, DST = 0 ) ) ]
81
91
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
82
92
pub unsafe fn _tile_zero < const DST : i32 > ( ) {
83
93
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -92,6 +102,7 @@ pub unsafe fn _tile_zero<const DST: i32>() {
92
102
#[ inline]
93
103
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
94
104
#[ target_feature( enable = "amx-bf16" ) ]
105
+ #[ cfg_attr( test, assert_instr( tdpbf16ps, DST = 0 , A = 1 , B = 2 ) ) ]
95
106
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
96
107
pub unsafe fn _tile_dpbf16ps < const DST : i32 , const A : i32 , const B : i32 > ( ) {
97
108
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -109,6 +120,7 @@ pub unsafe fn _tile_dpbf16ps<const DST: i32, const A: i32, const B: i32>() {
109
120
#[ inline]
110
121
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
111
122
#[ target_feature( enable = "amx-int8" ) ]
123
+ #[ cfg_attr( test, assert_instr( tdpbssd, DST = 0 , A = 1 , B = 2 ) ) ]
112
124
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
113
125
pub unsafe fn _tile_dpbssd < const DST : i32 , const A : i32 , const B : i32 > ( ) {
114
126
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -126,6 +138,7 @@ pub unsafe fn _tile_dpbssd<const DST: i32, const A: i32, const B: i32>() {
126
138
#[ inline]
127
139
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
128
140
#[ target_feature( enable = "amx-int8" ) ]
141
+ #[ cfg_attr( test, assert_instr( tdpbsud, DST = 0 , A = 1 , B = 2 ) ) ]
129
142
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
130
143
pub unsafe fn _tile_dpbsud < const DST : i32 , const A : i32 , const B : i32 > ( ) {
131
144
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -143,6 +156,7 @@ pub unsafe fn _tile_dpbsud<const DST: i32, const A: i32, const B: i32>() {
143
156
#[ inline]
144
157
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
145
158
#[ target_feature( enable = "amx-int8" ) ]
159
+ #[ cfg_attr( test, assert_instr( tdpbusd, DST = 0 , A = 1 , B = 2 ) ) ]
146
160
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
147
161
pub unsafe fn _tile_dpbusd < const DST : i32 , const A : i32 , const B : i32 > ( ) {
148
162
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -160,6 +174,7 @@ pub unsafe fn _tile_dpbusd<const DST: i32, const A: i32, const B: i32>() {
160
174
#[ inline]
161
175
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
162
176
#[ target_feature( enable = "amx-int8" ) ]
177
+ #[ cfg_attr( test, assert_instr( tdpbuud, DST = 0 , A = 1 , B = 2 ) ) ]
163
178
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
164
179
pub unsafe fn _tile_dpbuud < const DST : i32 , const A : i32 , const B : i32 > ( ) {
165
180
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -176,6 +191,10 @@ pub unsafe fn _tile_dpbuud<const DST: i32, const A: i32, const B: i32>() {
176
191
#[ inline]
177
192
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
178
193
#[ target_feature( enable = "amx-fp16" ) ]
194
+ #[ cfg_attr(
195
+ all( test, any( target_os = "linux" , target_env = "msvc" ) ) ,
196
+ assert_instr( tdpfp16ps, DST = 0 , A = 1 , B = 2 )
197
+ ) ]
179
198
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
180
199
pub unsafe fn _tile_dpfp16ps < const DST : i32 , const A : i32 , const B : i32 > ( ) {
181
200
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -196,6 +215,10 @@ pub unsafe fn _tile_dpfp16ps<const DST: i32, const A: i32, const B: i32>() {
196
215
#[ inline]
197
216
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
198
217
#[ target_feature( enable = "amx-complex" ) ]
218
+ #[ cfg_attr(
219
+ all( test, any( target_os = "linux" , target_env = "msvc" ) ) ,
220
+ assert_instr( tcmmimfp16ps, DST = 0 , A = 1 , B = 2 )
221
+ ) ]
199
222
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
200
223
pub unsafe fn _tile_cmmimfp16ps < const DST : i32 , const A : i32 , const B : i32 > ( ) {
201
224
static_assert_uimm_bits ! ( DST , 3 ) ;
@@ -216,6 +239,10 @@ pub unsafe fn _tile_cmmimfp16ps<const DST: i32, const A: i32, const B: i32>() {
216
239
#[ inline]
217
240
#[ rustc_legacy_const_generics( 0 , 1 , 2 ) ]
218
241
#[ target_feature( enable = "amx-complex" ) ]
242
+ #[ cfg_attr(
243
+ all( test, any( target_os = "linux" , target_env = "msvc" ) ) ,
244
+ assert_instr( tcmmrlfp16ps, DST = 0 , A = 1 , B = 2 )
245
+ ) ]
219
246
#[ unstable( feature = "x86_amx_intrinsics" , issue = "126622" ) ]
220
247
pub unsafe fn _tile_cmmrlfp16ps < const DST : i32 , const A : i32 , const B : i32 > ( ) {
221
248
static_assert_uimm_bits ! ( DST , 3 ) ;
0 commit comments