@@ -83,11 +83,11 @@ struct AtHwcap {
8383 dcpodp : bool ,
8484 sve2 : bool ,
8585 sveaes : bool ,
86- // svepmull: No LLVM support.
86+ svepmull : bool ,
8787 svebitperm : bool ,
8888 svesha3 : bool ,
8989 svesm4 : bool ,
90- // flagm2: No LLVM support.
90+ flagm2 : bool ,
9191 frint : bool ,
9292 // svei8mm: See i8mm feature.
9393 svef32mm : bool ,
@@ -99,6 +99,31 @@ struct AtHwcap {
9999 rng : bool ,
100100 bti : bool ,
101101 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 ,
102127}
103128
104129impl From < auxvec:: AuxVec > for AtHwcap {
@@ -137,14 +162,16 @@ impl From<auxvec::AuxVec> for AtHwcap {
137162 sb : bit:: test ( auxv. hwcap , 29 ) ,
138163 paca : bit:: test ( auxv. hwcap , 30 ) ,
139164 pacg : bit:: test ( auxv. hwcap , 31 ) ,
165+
166+ // AT_HWCAP2
140167 dcpodp : bit:: test ( auxv. hwcap2 , 0 ) ,
141168 sve2 : bit:: test ( auxv. hwcap2 , 1 ) ,
142169 sveaes : bit:: test ( auxv. hwcap2 , 2 ) ,
143- // svepmull: bit::test(auxv.hwcap2, 3),
170+ svepmull : bit:: test ( auxv. hwcap2 , 3 ) ,
144171 svebitperm : bit:: test ( auxv. hwcap2 , 4 ) ,
145172 svesha3 : bit:: test ( auxv. hwcap2 , 5 ) ,
146173 svesm4 : bit:: test ( auxv. hwcap2 , 6 ) ,
147- // flagm2: bit::test(auxv.hwcap2, 7),
174+ flagm2 : bit:: test ( auxv. hwcap2 , 7 ) ,
148175 frint : bit:: test ( auxv. hwcap2 , 8 ) ,
149176 // svei8mm: bit::test(auxv.hwcap2, 9),
150177 svef32mm : bit:: test ( auxv. hwcap2 , 10 ) ,
@@ -156,6 +183,31 @@ impl From<auxvec::AuxVec> for AtHwcap {
156183 rng : bit:: test ( auxv. hwcap2 , 16 ) ,
157184 bti : bit:: test ( auxv. hwcap2 , 17 ) ,
158185 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 ) ,
159211 }
160212 }
161213}
@@ -201,14 +253,16 @@ impl From<super::cpuinfo::CpuInfo> for AtHwcap {
201253 sb : f. has ( "sb" ) ,
202254 paca : f. has ( "paca" ) ,
203255 pacg : f. has ( "pacg" ) ,
256+
257+ // AT_HWCAP2
204258 dcpodp : f. has ( "dcpodp" ) ,
205259 sve2 : f. has ( "sve2" ) ,
206260 sveaes : f. has ( "sveaes" ) ,
207- // svepmull: f.has("svepmull"),
261+ svepmull : f. has ( "svepmull" ) ,
208262 svebitperm : f. has ( "svebitperm" ) ,
209263 svesha3 : f. has ( "svesha3" ) ,
210264 svesm4 : f. has ( "svesm4" ) ,
211- // flagm2: f.has("flagm2"),
265+ flagm2 : f. has ( "flagm2" ) ,
212266 frint : f. has ( "frint" ) ,
213267 // svei8mm: f.has("svei8mm"),
214268 svef32mm : f. has ( "svef32mm" ) ,
@@ -220,6 +274,31 @@ impl From<super::cpuinfo::CpuInfo> for AtHwcap {
220274 rng : f. has ( "rng" ) ,
221275 bti : f. has ( "bti" ) ,
222276 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" ) ,
223302 }
224303 }
225304}
@@ -267,11 +346,14 @@ impl AtHwcap {
267346 enable_feature ( Feature :: crc, self . crc32 ) ;
268347 enable_feature ( Feature :: lse, self . atomics ) ;
269348 enable_feature ( Feature :: lse2, self . uscat ) ;
349+ enable_feature ( Feature :: lse128, self . lse128 ) ;
270350 enable_feature ( Feature :: rcpc, self . lrcpc ) ;
271351 // RCPC2 (rcpc-immo in LLVM) requires RCPC support
272352 enable_feature ( Feature :: rcpc2, self . ilrcpc && self . lrcpc ) ;
353+ enable_feature ( Feature :: rcpc3, self . lrcpc3 ) ;
273354 enable_feature ( Feature :: dit, self . dit ) ;
274355 enable_feature ( Feature :: flagm, self . flagm ) ;
356+ enable_feature ( Feature :: flagm2, self . flagm2 ) ;
275357 enable_feature ( Feature :: ssbs, self . ssbs ) ;
276358 enable_feature ( Feature :: sb, self . sb ) ;
277359 enable_feature ( Feature :: paca, self . paca ) ;
@@ -317,8 +399,12 @@ impl AtHwcap {
317399 // SVE2 requires SVE
318400 let sve2 = self . sve2 && self . sve && asimd;
319401 enable_feature ( Feature :: sve2, sve2) ;
402+ enable_feature ( Feature :: sve2p1, self . sve2p1 ) ;
320403 // 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+ ) ;
322408 enable_feature (
323409 Feature :: sve2_sm4,
324410 self . svesm4 && sve2 && self . sm3 && self . sm4 ,
@@ -328,6 +414,23 @@ impl AtHwcap {
328414 self . svesha3 && sve2 && self . sha512 && self . sha3 && self . sha1 && self . sha2 ,
329415 ) ;
330416 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 ) ;
331434 }
332435 value
333436 }
0 commit comments