Skip to content

Commit d0c6e38

Browse files
committed
Stabilize avx512_target_feature
1 parent c6aad02 commit d0c6e38

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

Diff for: 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.

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

-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ declare_features! (
315315
(unstable, aarch64_unstable_target_feature, "1.82.0", Some(44839)),
316316
(unstable, aarch64_ver_target_feature, "1.27.0", Some(44839)),
317317
(unstable, arm_target_feature, "1.27.0", Some(44839)),
318-
(unstable, avx512_target_feature, "1.27.0", Some(44839)),
319318
(unstable, bpf_target_feature, "1.54.0", Some(44839)),
320319
(unstable, csky_target_feature, "1.73.0", Some(44839)),
321320
(unstable, ermsb_target_feature, "1.49.0", Some(44839)),

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

+22-22
Original file line numberDiff line numberDiff line change
@@ -392,33 +392,33 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
392392
("amx-transpose", Unstable(sym::x86_amx_intrinsics), &["amx-tile"]),
393393
("avx", Stable, &["sse4.2"]),
394394
("avx2", Stable, &["avx"]),
395-
("avx512bf16", Unstable(sym::avx512_target_feature), &["avx512bw"]),
396-
("avx512bitalg", Unstable(sym::avx512_target_feature), &["avx512bw"]),
397-
("avx512bw", Unstable(sym::avx512_target_feature), &["avx512f"]),
398-
("avx512cd", Unstable(sym::avx512_target_feature), &["avx512f"]),
399-
("avx512dq", Unstable(sym::avx512_target_feature), &["avx512f"]),
400-
("avx512f", Unstable(sym::avx512_target_feature), &["avx2", "fma", "f16c"]),
401-
("avx512fp16", Unstable(sym::avx512_target_feature), &["avx512bw", "avx512vl", "avx512dq"]),
402-
("avx512ifma", Unstable(sym::avx512_target_feature), &["avx512f"]),
403-
("avx512vbmi", Unstable(sym::avx512_target_feature), &["avx512bw"]),
404-
("avx512vbmi2", Unstable(sym::avx512_target_feature), &["avx512bw"]),
405-
("avx512vl", Unstable(sym::avx512_target_feature), &["avx512f"]),
406-
("avx512vnni", Unstable(sym::avx512_target_feature), &["avx512f"]),
407-
("avx512vp2intersect", Unstable(sym::avx512_target_feature), &["avx512f"]),
408-
("avx512vpopcntdq", Unstable(sym::avx512_target_feature), &["avx512f"]),
409-
("avxifma", Unstable(sym::avx512_target_feature), &["avx2"]),
410-
("avxneconvert", Unstable(sym::avx512_target_feature), &["avx2"]),
411-
("avxvnni", Unstable(sym::avx512_target_feature), &["avx2"]),
412-
("avxvnniint16", Unstable(sym::avx512_target_feature), &["avx2"]),
413-
("avxvnniint8", Unstable(sym::avx512_target_feature), &["avx2"]),
395+
("avx512bf16", Stable, &["avx512bw"]),
396+
("avx512bitalg", Stable, &["avx512bw"]),
397+
("avx512bw", Stable, &["avx512f"]),
398+
("avx512cd", Stable, &["avx512f"]),
399+
("avx512dq", Stable, &["avx512f"]),
400+
("avx512f", Stable, &["avx2", "fma", "f16c"]),
401+
("avx512fp16", Stable, &["avx512bw", "avx512vl", "avx512dq"]),
402+
("avx512ifma", Stable, &["avx512f"]),
403+
("avx512vbmi", Stable, &["avx512bw"]),
404+
("avx512vbmi2", Stable, &["avx512bw"]),
405+
("avx512vl", Stable, &["avx512f"]),
406+
("avx512vnni", Stable, &["avx512f"]),
407+
("avx512vp2intersect", Stable, &["avx512f"]),
408+
("avx512vpopcntdq", Stable, &["avx512f"]),
409+
("avxifma", Stable, &["avx2"]),
410+
("avxneconvert", Stable, &["avx2"]),
411+
("avxvnni", Stable, &["avx2"]),
412+
("avxvnniint16", Stable, &["avx2"]),
413+
("avxvnniint8", Stable, &["avx2"]),
414414
("bmi1", Stable, &[]),
415415
("bmi2", Stable, &[]),
416416
("cmpxchg16b", Stable, &[]),
417417
("ermsb", Unstable(sym::ermsb_target_feature), &[]),
418418
("f16c", Stable, &["avx"]),
419419
("fma", Stable, &["avx"]),
420420
("fxsr", Stable, &[]),
421-
("gfni", Unstable(sym::avx512_target_feature), &["sse2"]),
421+
("gfni", Stable, &["sse2"]),
422422
("kl", Unstable(sym::keylocker_x86), &["sse2"]),
423423
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
424424
("lzcnt", Stable, &[]),
@@ -445,8 +445,8 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
445445
("sse4a", Unstable(sym::sse4a_target_feature), &["sse3"]),
446446
("ssse3", Stable, &["sse3"]),
447447
("tbm", Unstable(sym::tbm_target_feature), &[]),
448-
("vaes", Unstable(sym::avx512_target_feature), &["avx2", "aes"]),
449-
("vpclmulqdq", Unstable(sym::avx512_target_feature), &["avx", "pclmulqdq"]),
448+
("vaes", Stable, &["avx2", "aes"]),
449+
("vpclmulqdq", Stable, &["avx", "pclmulqdq"]),
450450
("widekl", Unstable(sym::keylocker_x86), &["kl"]),
451451
("x87", Unstable(sym::x87_target_feature), &[]),
452452
("xop", Unstable(sym::xop_target_feature), &[/*"fma4", */ "avx", "sse4a"]),

Diff for: library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@
189189
//
190190
// Target features:
191191
// tidy-alphabetical-start
192+
#![cfg_attr(bootstrap, feature(avx512_target_feature))]
192193
#![feature(aarch64_unstable_target_feature)]
193194
#![feature(arm_target_feature)]
194-
#![feature(avx512_target_feature)]
195195
#![feature(hexagon_target_feature)]
196196
#![feature(keylocker_x86)]
197197
#![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() {}

Diff for: 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

Diff for: 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

Diff for: tests/ui/target-feature/unstable-feature.rs

+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`

Diff for: 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)