Skip to content

Commit cf7cade

Browse files
committed
Stabilize avx512_target_feature
1 parent ac17c34 commit cf7cade

File tree

10 files changed

+37
-37
lines changed

10 files changed

+37
-37
lines changed

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ declare_features! (
318318
(unstable, aarch64_ver_target_feature, "1.27.0", Some(44839)),
319319
(unstable, apx_target_feature, "1.88.0", Some(139284)),
320320
(unstable, arm_target_feature, "1.27.0", Some(44839)),
321-
(unstable, avx512_target_feature, "1.27.0", Some(44839)),
322321
(unstable, bpf_target_feature, "1.54.0", Some(44839)),
323322
(unstable, csky_target_feature, "1.73.0", Some(44839)),
324323
(unstable, ermsb_target_feature, "1.49.0", Some(44839)),

compiler/rustc_target/src/target_features.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -416,33 +416,33 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
416416
),
417417
("avx10.2", Unstable(sym::avx10_target_feature), &["avx10.1"]),
418418
("avx2", Stable, &["avx"]),
419-
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
420-
("avx512bitalg", Unstable(sym::avx512_target_feature), &["avx512bw"]),
421-
("avx512bw", Unstable(sym::avx512_target_feature), &["avx512f"]),
422-
("avx512cd", Unstable(sym::avx512_target_feature), &["avx512f"]),
423-
("avx512dq", Unstable(sym::avx512_target_feature), &["avx512f"]),
424-
("avx512f", Unstable(sym::avx512_target_feature), &["avx2", "fma", "f16c"]),
425-
("avx512fp16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
426-
("avx512ifma", Unstable(sym::avx512_target_feature), &["avx512f"]),
427-
("avx512vbmi", Unstable(sym::avx512_target_feature), &["avx512bw"]),
428-
("avx512vbmi2", Unstable(sym::avx512_target_feature), &["avx512bw"]),
429-
("avx512vl", Unstable(sym::avx512_target_feature), &["avx512f"]),
430-
("avx512vnni", Unstable(sym::avx512_target_feature), &["avx512f"]),
431-
("avx512vp2intersect", Unstable(sym::avx512_target_feature), &["avx512f"]),
432-
("avx512vpopcntdq", Unstable(sym::avx512_target_feature), &["avx512f"]),
433-
("avxifma", Unstable(sym::avx512_target_feature), &["avx2"]),
434-
("avxneconvert", Unstable(sym::avx512_target_feature), &["avx2"]),
435-
("avxvnni", Unstable(sym::avx512_target_feature), &["avx2"]),
436-
("avxvnniint16", Unstable(sym::avx512_target_feature), &["avx2"]),
437-
("avxvnniint8", Unstable(sym::avx512_target_feature), &["avx2"]),
419+
("avx512bf16", Stable, &["avx512bw"]),
420+
("avx512bitalg", Stable, &["avx512bw"]),
421+
("avx512bw", Stable, &["avx512f"]),
422+
("avx512cd", Stable, &["avx512f"]),
423+
("avx512dq", Stable, &["avx512f"]),
424+
("avx512f", Stable, &["avx2", "fma", "f16c"]),
425+
("avx512fp16", Stable, &["avx512bw"]),
426+
("avx512ifma", Stable, &["avx512f"]),
427+
("avx512vbmi", Stable, &["avx512bw"]),
428+
("avx512vbmi2", Stable, &["avx512bw"]),
429+
("avx512vl", Stable, &["avx512f"]),
430+
("avx512vnni", Stable, &["avx512f"]),
431+
("avx512vp2intersect", Stable, &["avx512f"]),
432+
("avx512vpopcntdq", Stable, &["avx512f"]),
433+
("avxifma", Stable, &["avx2"]),
434+
("avxneconvert", Stable, &["avx2"]),
435+
("avxvnni", Stable, &["avx2"]),
436+
("avxvnniint16", Stable, &["avx2"]),
437+
("avxvnniint8", Stable, &["avx2"]),
438438
("bmi1", Stable, &[]),
439439
("bmi2", Stable, &[]),
440440
("cmpxchg16b", Stable, &[]),
441441
("ermsb", Unstable(sym::ermsb_target_feature), &[]),
442442
("f16c", Stable, &["avx"]),
443443
("fma", Stable, &["avx"]),
444444
("fxsr", Stable, &[]),
445-
("gfni", Unstable(sym::avx512_target_feature), &["sse2"]),
445+
("gfni", Stable, &["sse2"]),
446446
("kl", Unstable(sym::keylocker_x86), &["sse2"]),
447447
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
448448
("lzcnt", Stable, &[]),
@@ -469,8 +469,8 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
469469
("sse4a", Unstable(sym::sse4a_target_feature), &["sse3"]),
470470
("ssse3", Stable, &["sse3"]),
471471
("tbm", Unstable(sym::tbm_target_feature), &[]),
472-
("vaes", Unstable(sym::avx512_target_feature), &["avx2", "aes"]),
473-
("vpclmulqdq", Unstable(sym::avx512_target_feature), &["avx", "pclmulqdq"]),
472+
("vaes", Stable, &["avx2", "aes"]),
473+
("vpclmulqdq", Stable, &["avx", "pclmulqdq"]),
474474
("widekl", Unstable(sym::keylocker_x86), &["kl"]),
475475
("x87", Unstable(sym::x87_target_feature), &[]),
476476
("xop", Unstable(sym::xop_target_feature), &[/*"fma4", */ "avx", "sse4a"]),

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
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)]
Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 5 additions & 5 deletions
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
Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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)