Skip to content

Commit 6d4754f

Browse files
authored
Rollup merge of rust-lang#138940 - sayantn:stabilize-avx512, r=Amanieu,traviscross
Stabilize the avx512 target features This PR stabilizes the AVX512 target features - see [this comment](rust-lang#111137 (comment)). Tracking Issue - rust-lang#44839 The target feature UI tests have been changed to `x87` (chosen because this is very unlikely to stablize ever, please comment if some other feature will be better) related: rust-lang#111137
2 parents 6a1f6b9 + 2898680 commit 6d4754f

21 files changed

+54
-64
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
@@ -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)]

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@only-target: x86_64 i686
33
//@compile-flags: -C target-feature=+aes,+vaes,+avx512f
44

5-
#![feature(avx512_target_feature, stdarch_x86_avx512)]
5+
#![feature(stdarch_x86_avx512)]
66

77
use core::mem::transmute;
88
#[cfg(target_arch = "x86")]

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@only-target: x86_64 i686
33
//@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq
44

5-
#![feature(avx512_target_feature)]
65
#![feature(stdarch_x86_avx512)]
76

87
#[cfg(target_arch = "x86")]

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-gfni.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// be interpreted as integers; signedness does not make sense for them, but
77
// __mXXXi happens to be defined in terms of signed integers.
88
#![allow(overflowing_literals)]
9-
#![feature(avx512_target_feature)]
109
#![feature(stdarch_x86_avx512)]
1110

1211
#[cfg(target_arch = "x86")]

src/tools/miri/tests/pass/shims/x86/intrinsics-x86-vpclmulqdq.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// be interpreted as integers; signedness does not make sense for them, but
99
// __mXXXi happens to be defined in terms of signed integers.
1010
#![allow(overflowing_literals)]
11-
#![feature(avx512_target_feature)]
1211
#![feature(stdarch_x86_avx512)]
1312

1413
#[cfg(target_arch = "x86")]

tests/ui/abi/homogenous-floats-target-feature-mixup.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
//@ run-pass
88
//@ needs-subprocess
99

10-
#![feature(avx512_target_feature)]
11-
1210
#![allow(overflowing_literals)]
1311
#![allow(unused_variables)]
1412

0 commit comments

Comments
 (0)