Skip to content

Commit 3605bad

Browse files
authored
Add the feature gate and target-features
1 parent f873ae0 commit 3605bad

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

compiler/rustc_codegen_ssa/src/target_features.rs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ pub fn from_target_feature(
8080
Some(sym::loongarch_target_feature) => rust_features.loongarch_target_feature,
8181
Some(sym::lahfsahf_target_feature) => rust_features.lahfsahf_target_feature,
8282
Some(sym::prfchw_target_feature) => rust_features.prfchw_target_feature,
83+
Some(sym::x86_amx_intrinsics) => rust_features.x86_amx_intrinsics,
8384
Some(name) => bug!("unknown target feature gate {}", name),
8485
None => true,
8586
};

compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,8 @@ declare_features! (
638638
(unstable, used_with_arg, "1.60.0", Some(93798)),
639639
/// Allows `extern "wasm" fn`
640640
(unstable, wasm_abi, "1.53.0", Some(83788)),
641+
/// Allows use of x86 `AMX` target-feature attributes and intrinsics
642+
(unstable, x86_amx_intrinsics, "CURRENT_RUSTC_VERSION", Some(126622))
641643
/// Allows `do yeet` expressions
642644
(unstable, yeet_expr, "1.62.0", Some(96373)),
643645
// !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!! !!!!

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,7 @@ symbols! {
20462046
write_str,
20472047
write_via_move,
20482048
writeln_macro,
2049+
x86_amx_intrinsics,
20492050
x87_reg,
20502051
xer,
20512052
xmm_reg,

compiler/rustc_target/src/target_features.rs

+5
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ const X86_ALLOWED_FEATURES: &[(&str, Stability)] = &[
192192
// tidy-alphabetical-start
193193
("adx", Stable),
194194
("aes", Stable),
195+
("amx-bf16", Unstable(sym::x86_amx_intrinsics)),
196+
("amx-complex", Unstable(sym::x86_amx_intrinsics)),
197+
("amx-fp16", Unstable(sym::x86_amx_intrinsics)),
198+
("amx-int8", Unstable(sym::x86_amx_intrinsics)),
199+
("amx-tile", Unstable(sym::x86_amx_intrinsics)),
195200
("avx", Stable),
196201
("avx2", Stable),
197202
("avx512bf16", Unstable(sym::avx512_target_feature)),

0 commit comments

Comments
 (0)