@@ -83,11 +83,11 @@ struct AtHwcap {
83
83
dcpodp : bool ,
84
84
sve2 : bool ,
85
85
sveaes : bool ,
86
- // svepmull: No LLVM support.
86
+ svepmull : bool ,
87
87
svebitperm : bool ,
88
88
svesha3 : bool ,
89
89
svesm4 : bool ,
90
- // flagm2: No LLVM support.
90
+ flagm2 : bool ,
91
91
frint : bool ,
92
92
// svei8mm: See i8mm feature.
93
93
svef32mm : bool ,
@@ -99,6 +99,31 @@ struct AtHwcap {
99
99
rng : bool ,
100
100
bti : bool ,
101
101
mte : bool ,
102
+ ecv : bool ,
103
+ // afp: bool,
104
+ // rpres: bool,
105
+ // mte3: bool,
106
+ wfxt : bool ,
107
+ // ebf16: bool,
108
+ // sveebf16: bool,
109
+ cssc : bool ,
110
+ // rprfm: bool,
111
+ sve2p1 : bool ,
112
+ smeb16b16 : bool ,
113
+ mops : bool ,
114
+ hbc : bool ,
115
+ sveb16b16 : bool ,
116
+ lrcpc3 : bool ,
117
+ lse128 : bool ,
118
+ fpmr : bool ,
119
+ lut : bool ,
120
+ faminmax : bool ,
121
+ f8cvt : bool ,
122
+ f8fma : bool ,
123
+ f8dp4 : bool ,
124
+ f8dp2 : bool ,
125
+ f8e4m3 : bool ,
126
+ f8e5m2 : bool ,
102
127
}
103
128
104
129
impl From < auxvec:: AuxVec > for AtHwcap {
@@ -137,14 +162,16 @@ impl From<auxvec::AuxVec> for AtHwcap {
137
162
sb : bit:: test ( auxv. hwcap , 29 ) ,
138
163
paca : bit:: test ( auxv. hwcap , 30 ) ,
139
164
pacg : bit:: test ( auxv. hwcap , 31 ) ,
165
+
166
+ // AT_HWCAP2
140
167
dcpodp : bit:: test ( auxv. hwcap2 , 0 ) ,
141
168
sve2 : bit:: test ( auxv. hwcap2 , 1 ) ,
142
169
sveaes : bit:: test ( auxv. hwcap2 , 2 ) ,
143
- // svepmull: bit::test(auxv.hwcap2, 3),
170
+ svepmull : bit:: test ( auxv. hwcap2 , 3 ) ,
144
171
svebitperm : bit:: test ( auxv. hwcap2 , 4 ) ,
145
172
svesha3 : bit:: test ( auxv. hwcap2 , 5 ) ,
146
173
svesm4 : bit:: test ( auxv. hwcap2 , 6 ) ,
147
- // flagm2: bit::test(auxv.hwcap2, 7),
174
+ flagm2 : bit:: test ( auxv. hwcap2 , 7 ) ,
148
175
frint : bit:: test ( auxv. hwcap2 , 8 ) ,
149
176
// svei8mm: bit::test(auxv.hwcap2, 9),
150
177
svef32mm : bit:: test ( auxv. hwcap2 , 10 ) ,
@@ -156,6 +183,31 @@ impl From<auxvec::AuxVec> for AtHwcap {
156
183
rng : bit:: test ( auxv. hwcap2 , 16 ) ,
157
184
bti : bit:: test ( auxv. hwcap2 , 17 ) ,
158
185
mte : bit:: test ( auxv. hwcap2 , 18 ) ,
186
+ ecv : bit:: test ( auxv. hwcap2 , 19 ) ,
187
+ // afp: bit::test(auxv.hwcap2, 20),
188
+ // rpres: bit::test(auxv.hwcap2, 21),
189
+ // mte3: bit::test(auxv.hwcap2, 22),
190
+ wfxt : bit:: test ( auxv. hwcap2 , 31 ) ,
191
+ // ebf16: bit::test(auxv.hwcap2, 32),
192
+ // sveebf16: bit::test(auxv.hwcap2, 33),
193
+ cssc : bit:: test ( auxv. hwcap2 , 34 ) ,
194
+ // rprfm: bit::test(auxv.hwcap2, 35),
195
+ sve2p1 : bit:: test ( auxv. hwcap2 , 36 ) ,
196
+ smeb16b16 : bit:: test ( auxv. hwcap2 , 41 ) ,
197
+ mops : bit:: test ( auxv. hwcap2 , 43 ) ,
198
+ hbc : bit:: test ( auxv. hwcap2 , 44 ) ,
199
+ sveb16b16 : bit:: test ( auxv. hwcap2 , 45 ) ,
200
+ lrcpc3 : bit:: test ( auxv. hwcap2 , 46 ) ,
201
+ lse128 : bit:: test ( auxv. hwcap2 , 47 ) ,
202
+ fpmr : bit:: test ( auxv. hwcap2 , 48 ) ,
203
+ lut : bit:: test ( auxv. hwcap2 , 49 ) ,
204
+ faminmax : bit:: test ( auxv. hwcap2 , 50 ) ,
205
+ f8cvt : bit:: test ( auxv. hwcap2 , 51 ) ,
206
+ f8fma : bit:: test ( auxv. hwcap2 , 52 ) ,
207
+ f8dp4 : bit:: test ( auxv. hwcap2 , 53 ) ,
208
+ f8dp2 : bit:: test ( auxv. hwcap2 , 54 ) ,
209
+ f8e4m3 : bit:: test ( auxv. hwcap2 , 55 ) ,
210
+ f8e5m2 : bit:: test ( auxv. hwcap2 , 56 ) ,
159
211
}
160
212
}
161
213
}
@@ -201,14 +253,16 @@ impl From<super::cpuinfo::CpuInfo> for AtHwcap {
201
253
sb : f. has ( "sb" ) ,
202
254
paca : f. has ( "paca" ) ,
203
255
pacg : f. has ( "pacg" ) ,
256
+
257
+ // AT_HWCAP2
204
258
dcpodp : f. has ( "dcpodp" ) ,
205
259
sve2 : f. has ( "sve2" ) ,
206
260
sveaes : f. has ( "sveaes" ) ,
207
- // svepmull: f.has("svepmull"),
261
+ svepmull : f. has ( "svepmull" ) ,
208
262
svebitperm : f. has ( "svebitperm" ) ,
209
263
svesha3 : f. has ( "svesha3" ) ,
210
264
svesm4 : f. has ( "svesm4" ) ,
211
- // flagm2: f.has("flagm2"),
265
+ flagm2 : f. has ( "flagm2" ) ,
212
266
frint : f. has ( "frint" ) ,
213
267
// svei8mm: f.has("svei8mm"),
214
268
svef32mm : f. has ( "svef32mm" ) ,
@@ -220,6 +274,31 @@ impl From<super::cpuinfo::CpuInfo> for AtHwcap {
220
274
rng : f. has ( "rng" ) ,
221
275
bti : f. has ( "bti" ) ,
222
276
mte : f. has ( "mte" ) ,
277
+ ecv : f. has ( "ecv" ) ,
278
+ // afp: f.has("afp"),
279
+ // rpres: f.has("rpres"),
280
+ // mte3: f.has("mte3"),
281
+ wfxt : f. has ( "wfxt" ) ,
282
+ // ebf16: f.has("ebf16"),
283
+ // sveebf16: f.has("sveebf16"),
284
+ cssc : f. has ( "cssc" ) ,
285
+ // rprfm: f.has("rprfm"),
286
+ sve2p1 : f. has ( "sve2p1" ) ,
287
+ smeb16b16 : f. has ( "smeb16b16" ) ,
288
+ mops : f. has ( "mops" ) ,
289
+ hbc : f. has ( "hbc" ) ,
290
+ sveb16b16 : f. has ( "sveb16b16" ) ,
291
+ lrcpc3 : f. has ( "lrcpc3" ) ,
292
+ lse128 : f. has ( "lse128" ) ,
293
+ fpmr : f. has ( "fpmr" ) ,
294
+ lut : f. has ( "lut" ) ,
295
+ faminmax : f. has ( "faminmax" ) ,
296
+ f8cvt : f. has ( "f8cvt" ) ,
297
+ f8fma : f. has ( "f8fma" ) ,
298
+ f8dp4 : f. has ( "f8dp4" ) ,
299
+ f8dp2 : f. has ( "f8dp2" ) ,
300
+ f8e4m3 : f. has ( "f8e4m3" ) ,
301
+ f8e5m2 : f. has ( "f8e5m2" ) ,
223
302
}
224
303
}
225
304
}
@@ -267,11 +346,14 @@ impl AtHwcap {
267
346
enable_feature ( Feature :: crc, self . crc32 ) ;
268
347
enable_feature ( Feature :: lse, self . atomics ) ;
269
348
enable_feature ( Feature :: lse2, self . uscat ) ;
349
+ enable_feature ( Feature :: lse128, self . lse128 ) ;
270
350
enable_feature ( Feature :: rcpc, self . lrcpc ) ;
271
351
// RCPC2 (rcpc-immo in LLVM) requires RCPC support
272
352
enable_feature ( Feature :: rcpc2, self . ilrcpc && self . lrcpc ) ;
353
+ enable_feature ( Feature :: rcpc3, self . lrcpc3 ) ;
273
354
enable_feature ( Feature :: dit, self . dit ) ;
274
355
enable_feature ( Feature :: flagm, self . flagm ) ;
356
+ enable_feature ( Feature :: flagm2, self . flagm2 ) ;
275
357
enable_feature ( Feature :: ssbs, self . ssbs ) ;
276
358
enable_feature ( Feature :: sb, self . sb ) ;
277
359
enable_feature ( Feature :: paca, self . paca ) ;
@@ -317,8 +399,12 @@ impl AtHwcap {
317
399
// SVE2 requires SVE
318
400
let sve2 = self . sve2 && self . sve && asimd;
319
401
enable_feature ( Feature :: sve2, sve2) ;
402
+ enable_feature ( Feature :: sve2p1, self . sve2p1 ) ;
320
403
// SVE2 extensions require SVE2 and crypto features
321
- enable_feature ( Feature :: sve2_aes, self . sveaes && sve2 && self . aes ) ;
404
+ enable_feature (
405
+ Feature :: sve2_aes,
406
+ self . sveaes && self . svepmull && sve2 && self . aes ,
407
+ ) ;
322
408
enable_feature (
323
409
Feature :: sve2_sm4,
324
410
self . svesm4 && sve2 && self . sm3 && self . sm4 ,
@@ -328,6 +414,23 @@ impl AtHwcap {
328
414
self . svesha3 && sve2 && self . sha512 && self . sha3 && self . sha1 && self . sha2 ,
329
415
) ;
330
416
enable_feature ( Feature :: sve2_bitperm, self . svebitperm && self . sve2 ) ;
417
+ // SVE_B16B16 can be implemented either for SVE or SME
418
+ enable_feature (
419
+ Feature :: sve_b16b16,
420
+ self . bf16 && ( self . sveb16b16 || self . smeb16b16 ) ,
421
+ ) ;
422
+ enable_feature ( Feature :: hbc, self . hbc ) ;
423
+ enable_feature ( Feature :: mops, self . mops ) ;
424
+ enable_feature ( Feature :: ecv, self . ecv ) ;
425
+ enable_feature ( Feature :: lut, self . lut ) ;
426
+ enable_feature ( Feature :: cssc, self . cssc ) ;
427
+ enable_feature ( Feature :: fpmr, self . fpmr ) ;
428
+ enable_feature ( Feature :: faminmax, self . faminmax ) ;
429
+ enable_feature ( Feature :: fp8, self . f8cvt ) ;
430
+ enable_feature ( Feature :: fp8fma, self . f8fma ) ;
431
+ enable_feature ( Feature :: fp8dot4, self . f8dp4 ) ;
432
+ enable_feature ( Feature :: fp8dot2, self . f8dp2 ) ;
433
+ enable_feature ( Feature :: wfxt, self . wfxt ) ;
331
434
}
332
435
value
333
436
}
0 commit comments