Skip to content

Commit 05b151a

Browse files
committed
Add the avx10.1 and avx10.2 target features
1 parent 71b68da commit 05b151a

File tree

8 files changed

+48
-1
lines changed

8 files changed

+48
-1
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
294294
None
295295
}
296296
("x86", "movrs") if get_version().0 < 20 => None,
297+
("x86", "avx10.1") => Some(LLVMFeature::new("avx10.1-512")),
298+
("x86", "avx10.2") if get_version().0 < 20 => None,
299+
("x86", "avx10.2") if get_version().0 >= 20 => Some(LLVMFeature::new("avx10.2-512")),
297300
(_, s) => Some(LLVMFeature::new(s)),
298301
}
299302
}

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

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ declare_features! (
390390
/// Allows `async` trait bound modifier.
391391
(unstable, async_trait_bounds, "1.85.0", Some(62290)),
392392
/// Allows using C-variadics.
393+
(unstable, avx10_target_feature, "CURRENT_RUSTC_VERSION", Some(138843)),
394+
/// Allows using Intel AVX10 target features and intrinsics
393395
(unstable, c_variadic, "1.34.0", Some(44930)),
394396
/// Allows the use of `#[cfg(<true/false>)]`.
395397
(unstable, cfg_boolean_literals, "1.83.0", Some(131204)),

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

+1
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ symbols! {
538538
autodiff,
539539
automatically_derived,
540540
avx,
541+
avx10_target_feature,
541542
avx512_target_feature,
542543
avx512bw,
543544
avx512f,

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

+20
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,26 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
391391
("amx-tile", Unstable(sym::x86_amx_intrinsics), &[]),
392392
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
393393
("avx", Stable, &["sse4.2"]),
394+
(
395+
"avx10.1",
396+
Unstable(sym::avx10_target_feature),
397+
&[
398+
"avx512bf16",
399+
"avx512bitalg",
400+
"avx512bw",
401+
"avx512cd",
402+
"avx512dq",
403+
"avx512f",
404+
"avx512fp16",
405+
"avx512ifma",
406+
"avx512vbmi",
407+
"avx512vbmi2",
408+
"avx512vl",
409+
"avx512vnni",
410+
"avx512vpopcntdq",
411+
],
412+
),
413+
("avx10.2", Unstable(sym::avx10_target_feature), &["avx10.1"]),
394414
("avx2", Stable, &["avx"]),
395415
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
396416
("avx512bitalg", Unstable(sym::avx512_target_feature), &["avx512bw"]),

Diff for: tests/ui/check-cfg/and-more-diagnostic.rs

+1-1
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");

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

+2
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`
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() {}
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)