Skip to content

Commit 0ec1d46

Browse files
committed
Add the new amx target features
1 parent f9e0239 commit 0ec1d46

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Diff for: compiler/rustc_codegen_llvm/src/llvm_util.rs

+6
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
298298
("sparc", "v8plus") if get_version().0 == 19 => Some(LLVMFeature::new("v9")),
299299
("sparc", "v8plus") if get_version().0 < 19 => None,
300300
("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
301+
// These new `amx` variants and `movrs` were introduced in LLVM20
302+
("x86", "amx-avx512" | "amx-fp8" | "amx-movrs" | "amx-tf32" | "amx-transpose")
303+
if get_version().0 < 20 =>
304+
{
305+
None
306+
}
301307
(_, s) => Some(LLVMFeature::new(s)),
302308
}
303309
}

Diff for: compiler/rustc_target/src/target_features.rs

+5
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,16 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
380380
// tidy-alphabetical-start
381381
("adx", Stable, &[]),
382382
("aes", Stable, &["sse2"]),
383+
("amx-avx512", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
383384
("amx-bf16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
384385
("amx-complex", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
385386
("amx-fp16", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
387+
("amx-fp8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
386388
("amx-int8", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
389+
("amx-movrs", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
390+
("amx-tf32", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
387391
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
392+
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
388393
("avx", Stable, &["sse4.2"]),
389394
("avx2", Stable, &["avx"]),
390395
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),

Diff for: tests/ui/check-cfg/target_feature.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
1717
`aes`
1818
`altivec`
1919
`alu32`
20+
`amx-avx512`
2021
`amx-bf16`
2122
`amx-complex`
2223
`amx-fp16`
24+
`amx-fp8`
2325
`amx-int8`
26+
`amx-movrs`
27+
`amx-tf32`
2428
`amx-tile`
29+
`amx-transpose`
2530
`atomics`
2631
`avx`
2732
`avx2`

0 commit comments

Comments
 (0)