@@ -140,14 +140,6 @@ macro_rules! __unstable_detect_feature {
140
140
$crate:: vendor:: __unstable_detect_feature(
141
141
$crate:: vendor:: __Feature:: xsaveopt{ } )
142
142
} ;
143
- ( "xsave" ) => {
144
- $crate:: vendor:: __unstable_detect_feature(
145
- $crate:: vendor:: __Feature:: xsave{ } )
146
- } ;
147
- ( "xsaveopt" ) => {
148
- $crate:: vendor:: __unstable_detect_feature(
149
- $crate:: vendor:: __Feature:: xsaveopt{ } )
150
- } ;
151
143
( "xsaves" ) => {
152
144
$crate:: vendor:: __unstable_detect_feature(
153
145
$crate:: vendor:: __Feature:: xsaves{ } )
@@ -265,9 +257,9 @@ pub fn detect_features() -> usize {
265
257
// leaf value for subsequent calls of `cpuinfo` in range [0,
266
258
// 0x8000_0000]. - The vendor ID is stored in 12 u8 ascii chars,
267
259
// returned in EBX, EDX, and ECX (in that order):
268
- let ( max_leaf , vendor_id) = unsafe {
260
+ let ( max_basic_leaf , vendor_id) = unsafe {
269
261
let CpuidResult {
270
- eax : max_leaf ,
262
+ eax : max_basic_leaf ,
271
263
ebx,
272
264
ecx,
273
265
edx,
@@ -278,10 +270,10 @@ pub fn detect_features() -> usize {
278
270
mem:: transmute ( ecx) ,
279
271
] ;
280
272
let vendor_id: [ u8 ; 12 ] = mem:: transmute ( vendor_id) ;
281
- ( max_leaf , vendor_id)
273
+ ( max_basic_leaf , vendor_id)
282
274
} ;
283
275
284
- if max_leaf < 1 {
276
+ if max_basic_leaf < 1 {
285
277
// Earlier Intel 486, CPUID not implemented
286
278
return value;
287
279
}
@@ -296,7 +288,8 @@ pub fn detect_features() -> usize {
296
288
297
289
// EAX = 7, ECX = 0: Queries "Extended Features";
298
290
// Contains information about bmi,bmi2, and avx2 support.
299
- let ( extended_features_ebx, extended_features_ecx) = if max_leaf >= 7 {
291
+ let ( extended_features_ebx, extended_features_ecx) = if max_basic_leaf >= 7
292
+ {
300
293
let CpuidResult { ebx, ecx, .. } = unsafe { __cpuid ( 0x0000_0007_u32 ) } ;
301
294
( ebx, ecx)
302
295
} else {
@@ -307,13 +300,13 @@ pub fn detect_features() -> usize {
307
300
// - EAX returns the max leaf value for extended information, that is,
308
301
// `cpuid` calls in range [0x8000_0000; u32::MAX]:
309
302
let CpuidResult {
310
- eax : extended_max_leaf ,
303
+ eax : extended_max_basic_leaf ,
311
304
..
312
305
} = unsafe { __cpuid ( 0x8000_0000_u32 ) } ;
313
306
314
307
// EAX = 0x8000_0001, ECX=0: Queries "Extended Processor Info and Feature
315
308
// Bits"
316
- let extended_proc_info_ecx = if extended_max_leaf >= 1 {
309
+ let extended_proc_info_ecx = if extended_max_basic_leaf >= 1 {
317
310
let CpuidResult { ecx, .. } = unsafe { __cpuid ( 0x8000_0001_u32 ) } ;
318
311
ecx
319
312
} else {
@@ -393,7 +386,7 @@ pub fn detect_features() -> usize {
393
386
394
387
// Processor Extended State Enumeration Sub-leaf (EAX = 0DH, ECX =
395
388
// 1)
396
- if max_leaf >= 0xd {
389
+ if max_basic_leaf >= 0xd {
397
390
let CpuidResult {
398
391
eax : proc_extended_state1_eax,
399
392
..
0 commit comments