Skip to content

Commit 46d8f7b

Browse files
authored
Unrolled build for rust-lang#138003
Rollup merge of rust-lang#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` (rust-lang#126622) - `amx-avx512` - `amx-fp8` - `amx-movrs` - `amx-tf32` - `amx-transpose` Adds the `movrs` target feature (from rust-lang#137976). `@rustbot` label O-x86_64 O-x86_32 T-compiler A-target-feature r? `@Amanieu`
2 parents 70dab5a + 7c2434c commit 46d8f7b

File tree

7 files changed

+40
-0
lines changed

7 files changed

+40
-0
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
300300
("sparc", "v8plus") if get_version().0 == 19 => Some(LLVMFeature::new("v9")),
301301
("sparc", "v8plus") if get_version().0 < 19 => None,
302302
("powerpc", "power8-crypto") => Some(LLVMFeature::new("crypto")),
303+
// These new `amx` variants and `movrs` were introduced in LLVM20
304+
("x86", "amx-avx512" | "amx-fp8" | "amx-movrs" | "amx-tf32" | "amx-transpose")
305+
if get_version().0 < 20 =>
306+
{
307+
None
308+
}
309+
("x86", "movrs") if get_version().0 < 20 => None,
303310
(_, s) => Some(LLVMFeature::new(s)),
304311
}
305312
}

Diff for: compiler/rustc_feature/src/unstable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ declare_features! (
324324
(unstable, loongarch_target_feature, "1.73.0", Some(44839)),
325325
(unstable, m68k_target_feature, "1.85.0", Some(134328)),
326326
(unstable, mips_target_feature, "1.27.0", Some(44839)),
327+
(unstable, movrs_target_feature, "CURRENT_RUSTC_VERSION", Some(137976)),
327328
(unstable, powerpc_target_feature, "1.27.0", Some(44839)),
328329
(unstable, prfchw_target_feature, "1.78.0", Some(44839)),
329330
(unstable, riscv_target_feature, "1.45.0", Some(44839)),

Diff for: compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,7 @@ symbols! {
13781378
movbe_target_feature,
13791379
move_ref_pattern,
13801380
move_size_limit,
1381+
movrs_target_feature,
13811382
mul,
13821383
mul_assign,
13831384
mul_with_overflow,

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

+6
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"]),
@@ -418,6 +423,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
418423
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
419424
("lzcnt", Stable, &[]),
420425
("movbe", Stable, &[]),
426+
("movrs", Unstable(sym::movrs_target_feature), &[]),
421427
("pclmulqdq", Stable, &["sse2"]),
422428
("popcnt", Stable, &[]),
423429
("prfchw", Unstable(sym::prfchw_target_feature), &[]),

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

+6
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`
@@ -152,6 +157,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
152157
`mclass`
153158
`mops`
154159
`movbe`
160+
`movrs`
155161
`mp`
156162
`mp1e2`
157163
`msa`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ only-x86_64
2+
#[target_feature(enable = "movrs")]
3+
//~^ ERROR: currently unstable
4+
unsafe fn foo() {}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: the target feature `movrs` is currently unstable
2+
--> $DIR/feature-gate-movrs_target_feature.rs:2:18
3+
|
4+
LL | #[target_feature(enable = "movrs")]
5+
| ^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #137976 <https://github.com/rust-lang/rust/issues/137976> for more information
8+
= help: add `#![feature(movrs_target_feature)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)