Rollup merge of #138003 - sayantn:new-amx, r=Amanieu
Add the new `amx` target features and the `movrs` target feature Adds 5 new `amx` target features included in LLVM20. These are guarded under `x86_amx_intrinsics` (#126622) - `amx-avx512` - `amx-fp8` - `amx-movrs` - `amx-tf32` - `amx-transpose` Adds the `movrs` target feature (from #137976). `@rustbot` label O-x86_64 O-x86_32 T-compiler A-target-feature r? `@Amanieu`
This commit is contained in:
commit
5b0f658922
7 changed files with 40 additions and 0 deletions
|
@ -300,6 +300,13 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
|
||||||
("sparc", "v8plus") if get_version().0 == 19 => Some(LLVMFeature::new("v9")),
|
("sparc", "v8plus") if get_version().0 == 19 => Some(LLVMFeature::new("v9")),
|
||||||
("sparc", "v8plus") if get_version().0 < 19 => None,
|
("sparc", "v8plus") if get_version().0 < 19 => None,
|
||||||
("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
|
("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
|
||||||
|
// These new `amx` variants and `movrs` were introduced in LLVM20
|
||||||
|
("x86", "amx-avx512" | "amx-fp8" | "amx-movrs" | "amx-tf32" | "amx-transpose")
|
||||||
|
if get_version().0 < 20 =>
|
||||||
|
{
|
||||||
|
None
|
||||||
|
}
|
||||||
|
("x86", "movrs") if get_version().0 < 20 => None,
|
||||||
(_, s) => Some(LLVMFeature::new(s)),
|
(_, s) => Some(LLVMFeature::new(s)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,6 +324,7 @@ declare_features! (
|
||||||
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
|
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
|
||||||
(unstable, m68k_target_feature, "1.85.0", Some(134328)),
|
(unstable, m68k_target_feature, "1.85.0", Some(134328)),
|
||||||
(unstable, mips_target_feature, "1.27.0", Some(44839)),
|
(unstable, mips_target_feature, "1.27.0", Some(44839)),
|
||||||
|
(unstable, movrs_target_feature, "CURRENT_RUSTC_VERSION", Some(137976)),
|
||||||
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
|
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
|
||||||
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),
|
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),
|
||||||
(unstable, riscv_target_feature, "1.45.0", Some(44839)),
|
(unstable, riscv_target_feature, "1.45.0", Some(44839)),
|
||||||
|
|
|
@ -1378,6 +1378,7 @@ symbols! {
|
||||||
movbe_target_feature,
|
movbe_target_feature,
|
||||||
move_ref_pattern,
|
move_ref_pattern,
|
||||||
move_size_limit,
|
move_size_limit,
|
||||||
|
movrs_target_feature,
|
||||||
mul,
|
mul,
|
||||||
mul_assign,
|
mul_assign,
|
||||||
mul_with_overflow,
|
mul_with_overflow,
|
||||||
|
|
|
@ -380,11 +380,16 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
("adx", Stable, &[]),
|
("adx", Stable, &[]),
|
||||||
("aes", Stable, &["sse2"]),
|
("aes", Stable, &["sse2"]),
|
||||||
|
("amx-avx512", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
|
("amx-fp8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
|
("amx-movrs", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
|
("amx-tf32", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
|
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
|
||||||
|
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
|
||||||
("avx", Stable, &["sse4.2"]),
|
("avx", Stable, &["sse4.2"]),
|
||||||
("avx2", Stable, &["avx"]),
|
("avx2", Stable, &["avx"]),
|
||||||
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
|
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
|
||||||
|
@ -418,6 +423,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
|
||||||
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
|
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
|
||||||
("lzcnt", Stable, &[]),
|
("lzcnt", Stable, &[]),
|
||||||
("movbe", Stable, &[]),
|
("movbe", Stable, &[]),
|
||||||
|
("movrs", Unstable(sym::movrs_target_feature), &[]),
|
||||||
("pclmulqdq", Stable, &["sse2"]),
|
("pclmulqdq", Stable, &["sse2"]),
|
||||||
("popcnt", Stable, &[]),
|
("popcnt", Stable, &[]),
|
||||||
("prfchw", Unstable(sym::prfchw_target_feature), &[]),
|
("prfchw", Unstable(sym::prfchw_target_feature), &[]),
|
||||||
|
|
|
@ -17,11 +17,16 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
|
||||||
`aes`
|
`aes`
|
||||||
`altivec`
|
`altivec`
|
||||||
`alu32`
|
`alu32`
|
||||||
|
`amx-avx512`
|
||||||
`amx-bf16`
|
`amx-bf16`
|
||||||
`amx-complex`
|
`amx-complex`
|
||||||
`amx-fp16`
|
`amx-fp16`
|
||||||
|
`amx-fp8`
|
||||||
`amx-int8`
|
`amx-int8`
|
||||||
|
`amx-movrs`
|
||||||
|
`amx-tf32`
|
||||||
`amx-tile`
|
`amx-tile`
|
||||||
|
`amx-transpose`
|
||||||
`atomics`
|
`atomics`
|
||||||
`avx`
|
`avx`
|
||||||
`avx2`
|
`avx2`
|
||||||
|
@ -152,6 +157,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
|
||||||
`mclass`
|
`mclass`
|
||||||
`mops`
|
`mops`
|
||||||
`movbe`
|
`movbe`
|
||||||
|
`movrs`
|
||||||
`mp`
|
`mp`
|
||||||
`mp1e2`
|
`mp1e2`
|
||||||
`msa`
|
`msa`
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
//@ only-x86_64
|
||||||
|
#[target_feature(enable = "movrs")]
|
||||||
|
//~^ ERROR: currently unstable
|
||||||
|
unsafe fn foo() {}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0658]: the target feature `movrs` is currently unstable
|
||||||
|
--> $DIR/feature-gate-movrs_target_feature.rs:2:18
|
||||||
|
|
|
||||||
|
LL | #[target_feature(enable = "movrs")]
|
||||||
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #137976 <https://github.com/rust-lang/rust/issues/137976> for more information
|
||||||
|
= help: add `#![feature(movrs_target_feature)]` to the crate attributes to enable
|
||||||
|
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0658`.
|
Loading…
Add table
Add a link
Reference in a new issue