@@ -8,9 +8,8 @@ use std::io::{BufWriter, Write};
8
8
use serde:: Deserialize ;
9
9
10
10
const PRINT_INSTRUCTION_VIOLATIONS : bool = false ;
11
- const PRINT_MISSING_LISTS : bool = false ;
12
- const PRINT_MISSING_LISTS_MARKDOWN : bool = false ;
13
- const SS : u8 = ( 8 * core:: mem:: size_of :: < usize > ( ) ) as u8 ;
11
+ const GENERATE_MISSING_X86_MD : bool = false ;
12
+ const SS : u8 = ( 8 * size_of :: < usize > ( ) ) as u8 ;
14
13
15
14
struct Function {
16
15
name : & ' static str ,
@@ -291,16 +290,13 @@ fn verify_all_signatures() {
291
290
"__cpuid" |
292
291
"__get_cpuid_max" |
293
292
// Not listed with intel, but manually verified
294
- "cmpxchg16b"
295
- => continue ,
293
+ "cmpxchg16b" |
296
294
// Intel requires the mask argument for _mm_shuffle_ps to be an
297
295
// unsigned integer, but all other _mm_shuffle_.. intrinsics
298
296
// take a signed-integer. This breaks `_MM_SHUFFLE` for
299
- // `_mm_shuffle_ps`:
300
- name@"_mm_shuffle_ps" => {
301
- map. remove ( name) ;
302
- continue ;
303
- } ,
297
+ // `_mm_shuffle_ps`
298
+ "_mm_shuffle_ps"
299
+ => continue ,
304
300
_ => { }
305
301
}
306
302
@@ -331,10 +327,7 @@ fn verify_all_signatures() {
331
327
}
332
328
assert ! ( all_valid) ;
333
329
334
- if PRINT_MISSING_LISTS {
335
- print_missing ( & map, io:: stdout ( ) ) . unwrap ( ) ;
336
- }
337
- if PRINT_MISSING_LISTS_MARKDOWN {
330
+ if GENERATE_MISSING_X86_MD {
338
331
print_missing (
339
332
& map,
340
333
BufWriter :: new ( File :: create ( "../core_arch/missing-x86.md" ) . unwrap ( ) ) ,
@@ -367,23 +360,16 @@ fn print_missing(map: &HashMap<&str, Vec<&Intrinsic>>, mut f: impl Write) -> io:
367
360
368
361
for ( k, v) in & mut missing {
369
362
v. sort_by_key ( |intrinsic| & intrinsic. name ) ; // sort to make the order of everything same
370
- if PRINT_MISSING_LISTS_MARKDOWN {
371
- writeln ! ( f, "\n <details><summary>{k:?}</summary><p>\n " ) ?;
372
- for intel in v {
373
- let url = format ! (
374
- "https://software.intel.com/sites/landingpage\
363
+ writeln ! ( f, "\n <details><summary>{k:?}</summary><p>\n " ) ?;
364
+ for intel in v {
365
+ let url = format ! (
366
+ "https://software.intel.com/sites/landingpage\
375
367
/IntrinsicsGuide/#text={}",
376
- intel. name
377
- ) ;
378
- writeln ! ( f, " * [ ] [`{}`]({url})" , intel. name) ?;
379
- }
380
- writeln ! ( f, "</p></details>\n " ) ?;
381
- } else {
382
- writeln ! ( f, "\n {k:?}\n " ) ?;
383
- for intel in v {
384
- writeln ! ( f, "\t {}" , intel. name) ?;
385
- }
368
+ intel. name
369
+ ) ;
370
+ writeln ! ( f, " * [ ] [`{}`]({url})" , intel. name) ?;
386
371
}
372
+ writeln ! ( f, "</p></details>\n " ) ?;
387
373
}
388
374
389
375
f. flush ( )
@@ -454,51 +440,18 @@ fn check_target_features(rust: &Function, intel: &Intrinsic) -> Result<(), Strin
454
440
continue ;
455
441
}
456
442
457
- let cpuid = cpuid. to_lowercase ( ) ;
443
+ let cpuid = cpuid. to_lowercase ( ) . replace ( '_' , "" ) ;
458
444
459
445
// Fix mismatching feature names:
460
- let fixup_cpuid = | cpuid : String | match cpuid. as_ref ( ) {
446
+ let fixed_cpuid = match cpuid. as_ref ( ) {
461
447
// The XML file names IFMA as "avx512ifma52", while Rust calls
462
448
// it "avx512ifma".
463
449
"avx512ifma52" => String :: from ( "avx512ifma" ) ,
464
- // The XML file names BITALG as "avx512_bitalg", while Rust calls
465
- // it "avx512bitalg".
466
- "avx512_bitalg" => String :: from ( "avx512bitalg" ) ,
467
- // The XML file names VBMI as "avx512_vbmi", while Rust calls
468
- // it "avx512vbmi".
469
- "avx512_vbmi" => String :: from ( "avx512vbmi" ) ,
470
- // The XML file names VBMI2 as "avx512_vbmi2", while Rust calls
471
- // it "avx512vbmi2".
472
- "avx512_vbmi2" => String :: from ( "avx512vbmi2" ) ,
473
- // The XML file names VNNI as "avx512_vnni", while Rust calls
474
- // it "avx512vnni".
475
- "avx512_vnni" => String :: from ( "avx512vnni" ) ,
476
- // The XML file names BF16 as "avx512_bf16", while Rust calls
477
- // it "avx512bf16".
478
- "avx512_bf16" => String :: from ( "avx512bf16" ) ,
479
- // The XML file names FP16 as "avx512_fp16", while Rust calls
480
- // it "avx512fp16".
481
- "avx512_fp16" => String :: from ( "avx512fp16" ) ,
482
- // The XML file names AVX-VNNI as "avx_vnni", while Rust calls
483
- // it "avxvnni"
484
- "avx_vnni" => String :: from ( "avxvnni" ) ,
485
- // The XML file names AVX-VNNI_INT8 as "avx_vnni_int8", while Rust calls
486
- // it "avxvnniint8"
487
- "avx_vnni_int8" => String :: from ( "avxvnniint8" ) ,
488
- // The XML file names AVX-NE-CONVERT as "avx_ne_convert", while Rust calls
489
- // it "avxvnni"
490
- "avx_ne_convert" => String :: from ( "avxneconvert" ) ,
491
- // The XML file names AVX-IFMA as "avx_ifma", while Rust calls
492
- // it "avxifma"
493
- "avx_ifma" => String :: from ( "avxifma" ) ,
494
- // The XML file names AVX-VNNI_INT16 as "avx_vnni_int16", while Rust calls
495
- // it "avxvnniint16"
496
- "avx_vnni_int16" => String :: from ( "avxvnniint16" ) ,
497
450
"xss" => String :: from ( "xsaves" ) ,
498
451
_ => cpuid,
499
452
} ;
500
453
501
- intel_cpuids. insert ( fixup_cpuid ( cpuid ) ) ;
454
+ intel_cpuids. insert ( fixed_cpuid ) ;
502
455
}
503
456
504
457
if intel_cpuids. contains ( "gfni" ) {
0 commit comments