Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed7590f

Browse filesBrowse files
authored
Rollup merge of rust-lang#139675 - sayantn:avx10, r=Amanieu
Add the AVX10 target features Parent rust-lang#138843 Adds the `avx10_target_feature` feature gate, and `avx10.1` and `avx10.2` target features. It is confirmed that Intel is dropping AVX10/256 (see [this comment](rust-lang#111137 (comment))), so this should be safe to implement now. The LLVM fix for llvm/llvm-project#135394 was merged, and has been backported to LLVM20, and the patch has also been propagated to rustc in rust-lang#140502 `@rustbot` label O-x86_64 O-x86_32 A-target-feature A-SIMD
2 parents 3559e0a + 163fb85 commit ed7590f
Copy full SHA for ed7590f

File tree

Expand file treeCollapse file tree

8 files changed

+48
-1
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+48
-1
lines changed

‎compiler/rustc_codegen_llvm/src/llvm_util.rs

Copy file name to clipboardExpand all lines: compiler/rustc_codegen_llvm/src/llvm_util.rs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
301301
None
302302
}
303303
("x86", "movrs") if get_version().0 < 20 => None,
304+
("x86", "avx10.1") => Some(LLVMFeature::new("avx10.1-512")),
305+
("x86", "avx10.2") if get_version().0 < 20 => None,
306+
("x86", "avx10.2") if get_version().0 >= 20 => Some(LLVMFeature::new("avx10.2-512")),
304307
(_, s) => Some(LLVMFeature::new(s)),
305308
}
306309
}

‎compiler/rustc_feature/src/unstable.rs

Copy file name to clipboardExpand all lines: compiler/rustc_feature/src/unstable.rs
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ declare_features! (
393393
(unstable, async_for_loop, "1.77.0", Some(118898)),
394394
/// Allows `async` trait bound modifier.
395395
(unstable, async_trait_bounds, "1.85.0", Some(62290)),
396+
/// Allows using Intel AVX10 target features and intrinsics
397+
(unstable, avx10_target_feature, "CURRENT_RUSTC_VERSION", Some(138843)),
396398
/// Allows using C-variadics.
397399
(unstable, c_variadic, "1.34.0", Some(44930)),
398400
/// Allows the use of `#[cfg(contract_checks)` to check if contract checks are enabled.

‎compiler/rustc_span/src/symbol.rs

Copy file name to clipboardExpand all lines: compiler/rustc_span/src/symbol.rs
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ symbols! {
531531
autodiff,
532532
automatically_derived,
533533
avx,
534+
avx10_target_feature,
534535
avx512_target_feature,
535536
avx512bw,
536537
avx512f,

‎compiler/rustc_target/src/target_features.rs

Copy file name to clipboardExpand all lines: compiler/rustc_target/src/target_features.rs
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,26 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
394394
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
395395
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
396396
("avx", Stable, &["sse4.2"]),
397+
(
398+
"avx10.1",
399+
Unstable(sym::avx10_target_feature),
400+
&[
401+
"avx512bf16",
402+
"avx512bitalg",
403+
"avx512bw",
404+
"avx512cd",
405+
"avx512dq",
406+
"avx512f",
407+
"avx512fp16",
408+
"avx512ifma",
409+
"avx512vbmi",
410+
"avx512vbmi2",
411+
"avx512vl",
412+
"avx512vnni",
413+
"avx512vpopcntdq",
414+
],
415+
),
416+
("avx10.2", Unstable(sym::avx10_target_feature), &["avx10.1"]),
397417
("avx2", Stable, &["avx"]),
398418
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
399419
("avx512bitalg", Unstable(sym::avx512_target_feature), &["avx512bw"]),

‎tests/ui/check-cfg/and-more-diagnostic.rs

Copy file name to clipboardExpand all lines: tests/ui/check-cfg/and-more-diagnostic.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ no-auto-check-cfg
66
//@ compile-flags: --check-cfg=cfg()
77
//@ normalize-stderr: "and \d+ more" -> "and X more"
8-
//@ normalize-stderr: "`[a-zA-Z0-9_-]+`" -> "`xxx`"
8+
//@ normalize-stderr: "`[a-zA-Z0-9_\.-]+`" -> "`xxx`"
99

1010
fn main() {
1111
cfg!(target_feature = "zebra");

‎tests/ui/check-cfg/target_feature.stderr

Copy file name to clipboardExpand all lines: tests/ui/check-cfg/target_feature.stderr
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
2929
`amx-transpose`
3030
`atomics`
3131
`avx`
32+
`avx10.1`
33+
`avx10.2`
3234
`avx2`
3335
`avx512bf16`
3436
`avx512bitalg`
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ only-x86_64
2+
#[target_feature(enable = "avx10.1")]
3+
//~^ ERROR: currently unstable
4+
unsafe fn foo() {}
5+
6+
fn main() {}
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: the target feature `avx10.1` is currently unstable
2+
--> $DIR/feature-gate-avx10_target_feature.rs:2:18
3+
|
4+
LL | #[target_feature(enable = "avx10.1")]
5+
| ^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #138843 <https://github.com/rust-lang/rust/issues/138843> for more information
8+
= help: add `#![feature(avx10_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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.