Skip to content

Commit 8146e05

Browse files
committed
Stabilize avx512_target_feature
1 parent 7c96085 commit 8146e05

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

compiler/rustc_feature/src/accepted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ declare_features! (
8282
(accepted, attr_literals, "1.30.0", Some(34981)),
8383
/// Allows overloading augmented assignment operations like `a += b`.
8484
(accepted, augmented_assignments, "1.8.0", Some(28235)),
85+
/// Allows using `avx512*` target features.
86+
(accepted, avx512_target_feature, "CURRENT_RUSTC_VERSION", Some(44839)),
8587
/// Allows mixing bind-by-move in patterns and references to those identifiers in guards.
8688
(accepted, bind_by_move_pattern_guards, "1.39.0", Some(15287)),
8789
/// Allows bindings in the subpattern of a binding pattern.

compiler/rustc_feature/src/unstable.rs

-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ declare_features! (
317317
(unstable, aarch64_unstable_target_feature, "1.82.0", Some(44839)),
318318
(unstable, aarch64_ver_target_feature, "1.27.0", Some(44839)),
319319
(unstable, arm_target_feature, "1.27.0", Some(44839)),
320-
(unstable, avx512_target_feature, "1.27.0", Some(44839)),
321320
(unstable, bpf_target_feature, "1.54.0", Some(44839)),
322321
(unstable, csky_target_feature, "1.73.0", Some(44839)),
323322
(unstable, ermsb_target_feature, "1.49.0", Some(44839)),

compiler/rustc_target/src/target_features.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -395,33 +395,33 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
395395
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
396396
("avx", Stable, &["sse4.2"]),
397397
("avx2", Stable, &["avx"]),
398-
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
399-
("avx512bitalg", Unstable(sym::avx512_target_feature), &["avx512bw"]),
400-
("avx512bw", Unstable(sym::avx512_target_feature), &["avx512f"]),
401-
("avx512cd", Unstable(sym::avx512_target_feature), &["avx512f"]),
402-
("avx512dq", Unstable(sym::avx512_target_feature), &["avx512f"]),
403-
("avx512f", Unstable(sym::avx512_target_feature), &["avx2", "fma", "f16c"]),
404-
("avx512fp16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
405-
("avx512ifma", Unstable(sym::avx512_target_feature), &["avx512f"]),
406-
("avx512vbmi", Unstable(sym::avx512_target_feature), &["avx512bw"]),
407-
("avx512vbmi2", Unstable(sym::avx512_target_feature), &["avx512bw"]),
408-
("avx512vl", Unstable(sym::avx512_target_feature), &["avx512f"]),
409-
("avx512vnni", Unstable(sym::avx512_target_feature), &["avx512f"]),
410-
("avx512vp2intersect", Unstable(sym::avx512_target_feature), &["avx512f"]),
411-
("avx512vpopcntdq", Unstable(sym::avx512_target_feature), &["avx512f"]),
412-
("avxifma", Unstable(sym::avx512_target_feature), &["avx2"]),
413-
("avxneconvert", Unstable(sym::avx512_target_feature), &["avx2"]),
414-
("avxvnni", Unstable(sym::avx512_target_feature), &["avx2"]),
415-
("avxvnniint16", Unstable(sym::avx512_target_feature), &["avx2"]),
416-
("avxvnniint8", Unstable(sym::avx512_target_feature), &["avx2"]),
398+
("avx512bf16", Stable, &["avx512bw"]),
399+
("avx512bitalg", Stable, &["avx512bw"]),
400+
("avx512bw", Stable, &["avx512f"]),
401+
("avx512cd", Stable, &["avx512f"]),
402+
("avx512dq", Stable, &["avx512f"]),
403+
("avx512f", Stable, &["avx2", "fma", "f16c"]),
404+
("avx512fp16", Stable, &["avx512bw"]),
405+
("avx512ifma", Stable, &["avx512f"]),
406+
("avx512vbmi", Stable, &["avx512bw"]),
407+
("avx512vbmi2", Stable, &["avx512bw"]),
408+
("avx512vl", Stable, &["avx512f"]),
409+
("avx512vnni", Stable, &["avx512f"]),
410+
("avx512vp2intersect", Stable, &["avx512f"]),
411+
("avx512vpopcntdq", Stable, &["avx512f"]),
412+
("avxifma", Stable, &["avx2"]),
413+
("avxneconvert", Stable, &["avx2"]),
414+
("avxvnni", Stable, &["avx2"]),
415+
("avxvnniint16", Stable, &["avx2"]),
416+
("avxvnniint8", Stable, &["avx2"]),
417417
("bmi1", Stable, &[]),
418418
("bmi2", Stable, &[]),
419419
("cmpxchg16b", Stable, &[]),
420420
("ermsb", Unstable(sym::ermsb_target_feature), &[]),
421421
("f16c", Stable, &["avx"]),
422422
("fma", Stable, &["avx"]),
423423
("fxsr", Stable, &[]),
424-
("gfni", Unstable(sym::avx512_target_feature), &["sse2"]),
424+
("gfni", Stable, &["sse2"]),
425425
("kl", Unstable(sym::keylocker_x86), &["sse2"]),
426426
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
427427
("lzcnt", Stable, &[]),
@@ -448,8 +448,8 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
448448
("sse4a", Unstable(sym::sse4a_target_feature), &["sse3"]),
449449
("ssse3", Stable, &["sse3"]),
450450
("tbm", Unstable(sym::tbm_target_feature), &[]),
451-
("vaes", Unstable(sym::avx512_target_feature), &["avx2", "aes"]),
452-
("vpclmulqdq", Unstable(sym::avx512_target_feature), &["avx", "pclmulqdq"]),
451+
("vaes", Stable, &["avx2", "aes"]),
452+
("vpclmulqdq", Stable, &["avx", "pclmulqdq"]),
453453
("widekl", Unstable(sym::keylocker_x86), &["kl"]),
454454
("x87", Unstable(sym::x87_target_feature), &[]),
455455
("xop", Unstable(sym::xop_target_feature), &[/*"fma4", */ "avx", "sse4a"]),

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@
188188
//
189189
// Target features:
190190
// tidy-alphabetical-start
191+
#![cfg_attr(bootstrap, feature(avx512_target_feature))]
191192
#![feature(aarch64_unstable_target_feature)]
192193
#![feature(arm_target_feature)]
193-
#![feature(avx512_target_feature)]
194194
#![feature(hexagon_target_feature)]
195195
#![feature(keylocker_x86)]
196196
#![feature(loongarch_target_feature)]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#![feature(avx512_target_feature)]
1+
#![feature(x87_target_feature)]
22

33
#[inline]
4-
#[target_feature(enable = "avx512ifma")]
4+
#[target_feature(enable = "x87")]
55
pub unsafe fn foo() {}

tests/ui/target-feature/gate.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//
33
// gate-test-sse4a_target_feature
44
// gate-test-powerpc_target_feature
5-
// gate-test-avx512_target_feature
65
// gate-test-tbm_target_feature
76
// gate-test-arm_target_feature
87
// gate-test-hexagon_target_feature
@@ -27,7 +26,7 @@
2726
// gate-test-x87_target_feature
2827
// gate-test-m68k_target_feature
2928

30-
#[target_feature(enable = "avx512bw")]
29+
#[target_feature(enable = "x87")]
3130
//~^ ERROR: currently unstable
3231
unsafe fn foo() {}
3332

tests/ui/target-feature/gate.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0658]: the target feature `avx512bw` is currently unstable
2-
--> $DIR/gate.rs:30:18
1+
error[E0658]: the target feature `x87` is currently unstable
2+
--> $DIR/gate.rs:29:18
33
|
4-
LL | #[target_feature(enable = "avx512bw")]
5-
| ^^^^^^^^^^^^^^^^^^^
4+
LL | #[target_feature(enable = "x87")]
5+
| ^^^^^^^^^^^^^^
66
|
77
= note: see issue #44839 <https://github.com/rust-lang/rust/issues/44839> for more information
8-
= help: add `#![feature(avx512_target_feature)]` to the crate attributes to enable
8+
= help: add `#![feature(x87_target_feature)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error: aborting due to 1 previous error
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//@ compile-flags: -Ctarget-feature=+vaes --crate-type=rlib --target=x86_64-unknown-linux-gnu
1+
//@ compile-flags: -Ctarget-feature=+x87 --crate-type=rlib --target=x86_64-unknown-linux-gnu
22
//@ build-pass
33
//@ needs-llvm-components: x86
44

55
#![feature(no_core)]
66
#![no_core]
77

8-
//~? WARN unstable feature specified for `-Ctarget-feature`: `vaes`
8+
//~? WARN unstable feature specified for `-Ctarget-feature`: `x87`

tests/ui/target-feature/unstable-feature.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: unstable feature specified for `-Ctarget-feature`: `vaes`
1+
warning: unstable feature specified for `-Ctarget-feature`: `x87`
22
|
33
= note: this feature is not stably supported; its behavior can change in the future
44

0 commit comments

Comments
 (0)