@@ -339,8 +339,6 @@ const WASM_ALLOWED_FEATURES: &[(&str, Stability)] = &[
339339 // tidy-alphabetical-end
340340] ;
341341
342- const WASM_IMPLICIT_FEATURES : & [ ( & str , & str ) ] = & [ ( "relaxed-simd" , "simd128" ) ] ;
343-
344342const BPF_ALLOWED_FEATURES : & [ ( & str , Stability ) ] = & [ ( "alu32" , Unstable ( sym:: bpf_target_feature) ) ] ;
345343
346344const CSKY_ALLOWED_FEATURES : & [ ( & str , Stability ) ] = & [
@@ -411,6 +409,54 @@ const IBMZ_ALLOWED_FEATURES: &[(&str, Stability)] = &[
411409 // tidy-alphabetical-end
412410] ;
413411
412+ const X86_IMPLIED_FEATURES : & [ ( & str , & [ & str ] ) ] = & [
413+ // tidy-alphabetical-start
414+ ( "aes" , & [ "sse2" ] ) ,
415+ ( "avx" , & [ "sse4.2" ] ) ,
416+ ( "avx2" , & [ "avx" ] ) ,
417+ ( "f16c" , & [ "avx" ] ) ,
418+ ( "fma" , & [ "avx" ] ) ,
419+ ( "pclmulqdq" , & [ "sse2" ] ) ,
420+ ( "sha" , & [ "sse2" ] ) ,
421+ ( "sse2" , & [ "sse" ] ) ,
422+ ( "sse3" , & [ "sse2" ] ) ,
423+ ( "sse4.1" , & [ "ssse3" ] ) ,
424+ ( "sse4.2" , & [ "sse4.1" ] ) ,
425+ ( "ssse3" , & [ "sse3" ] ) ,
426+ // tidy-alphabetical-end
427+ ] ;
428+
429+ const AARCH64_IMPLIED_FEATURES : & [ ( & str , & [ & str ] ) ] = & [
430+ // tidy-alphabetical-start
431+ ( "aes" , & [ "neon" ] ) ,
432+ ( "f32mm" , & [ "sve" ] ) ,
433+ ( "f64mm" , & [ "sve" ] ) ,
434+ ( "fcma" , & [ "neon" ] ) ,
435+ ( "fhm" , & [ "fp16" ] ) ,
436+ ( "fp16" , & [ "neon" ] ) ,
437+ ( "jsconv" , & [ "neon" ] ) ,
438+ ( "rcpc2" , & [ "rcpc" ] ) ,
439+ ( "sha2" , & [ "neon" ] ) ,
440+ ( "sha3" , & [ "sha2" ] ) ,
441+ ( "sm4" , & [ "neon" ] ) ,
442+ ( "sve" , & [ "fp16" ] ) ,
443+ ( "sve2" , & [ "sve" ] ) ,
444+ ( "sve2-aes" , & [ "sve2" , "aes" ] ) ,
445+ ( "sve2-bitperm" , & [ "sve2" ] ) ,
446+ ( "sve2-sha3" , & [ "sve2" , "sha3" ] ) ,
447+ ( "sve2-sm4" , & [ "sve2" , "sm4" ] ) ,
448+ // tidy-alphabetical-end
449+ ] ;
450+
451+ const RISCV_IMPLIED_FEATURES : & [ ( & str , & [ & str ] ) ] = & [
452+ // tidy-alphabetical-start
453+ ( "zb" , & [ "zba" , "zbc" , "zbs" ] ) ,
454+ ( "zk" , & [ "zkn" , "zkr" , "zks" , "zkt" , "zbkb" , "zbkc" , "zkbx" ] ) ,
455+ ( "zkn" , & [ "zknd" , "zkne" , "zknh" , "zbkb" , "zbkc" , "zkbx" ] ) ,
456+ ( "zks" , & [ "zksed" , "zksh" , "zbkb" , "zbkc" , "zkbx" ] ) ,
457+ // tidy-alphabetical-end
458+ ] ;
459+
414460/// When rustdoc is running, provide a list of all known features so that all their respective
415461/// primitives may be documented.
416462///
@@ -458,11 +504,11 @@ impl super::spec::Target {
458504 }
459505 }
460506
461- /// Returns a list of target features. Each items first target feature
462- /// implicitly enables the second one.
463- pub fn implicit_target_features ( & self ) -> & ' static [ ( & ' static str , & ' static str ) ] {
507+ pub fn implied_target_features ( & self ) -> & ' static [ ( & ' static str , & ' static [ & ' static str ] ) ] {
464508 match & * self . arch {
465- "wasm32" | "wasm64" => WASM_IMPLICIT_FEATURES ,
509+ "aarch4" => AARCH64_IMPLIED_FEATURES ,
510+ "riscv32" | "riscv64" => RISCV_IMPLIED_FEATURES ,
511+ "x86" | "x86_64" => X86_IMPLIED_FEATURES ,
466512 _ => & [ ] ,
467513 }
468514 }
0 commit comments