Skip to content

Commit 8bbe83c

Browse files
authored
Unrolled build for rust-lang#120820
Rollup merge of rust-lang#120820 - CKingX:cpu-base-minimum, r=petrochenkov,ChrisDenton Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64 As Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature. Windows 10 requires CMPXCHG16B, LAHF/SAHF, and PrefetchW as stated in the requirements [here](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf). Furthermore, CPUs that meet these requirements also have SSE3 ([see](https://walbourn.github.io/directxmath-sse3-and-ssse3/))
2 parents 384d26f + 2d25c3b commit 8bbe83c

6 files changed

+11
-6
lines changed

compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
33
pub fn target() -> Target {
44
let mut base = base::windows_gnu::opts();
55
base.cpu = "x86-64".into();
6+
base.features = "+cx16,+sse3,+sahf".into();
67
base.plt_by_default = false;
78
// Use high-entropy 64 bit address space for ASLR
89
base.add_pre_link_args(
910
LinkerFlavor::Gnu(Cc::No, Lld::No),
1011
&["-m", "i386pep", "--high-entropy-va"],
1112
);
1213
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
13-
base.max_atomic_width = Some(64);
14+
base.max_atomic_width = Some(128);
1415
base.linker = Some("x86_64-w64-mingw32-gcc".into());
1516

1617
Target {

compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
33
pub fn target() -> Target {
44
let mut base = base::windows_gnullvm::opts();
55
base.cpu = "x86-64".into();
6+
base.features = "+cx16,+sse3,+sahf".into();
67
base.plt_by_default = false;
78
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
8-
base.max_atomic_width = Some(64);
9+
base.max_atomic_width = Some(128);
910
base.linker = Some("x86_64-w64-mingw32-clang".into());
1011

1112
Target {

compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ use crate::spec::{base, SanitizerSet, Target};
33
pub fn target() -> Target {
44
let mut base = base::windows_msvc::opts();
55
base.cpu = "x86-64".into();
6+
base.features = "+cx16,+sse3,+sahf".into();
67
base.plt_by_default = false;
7-
base.max_atomic_width = Some(64);
8+
base.max_atomic_width = Some(128);
89
base.supported_sanitizers = SanitizerSet::ADDRESS;
910

1011
Target {

compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
33
pub fn target() -> Target {
44
let mut base = base::windows_uwp_gnu::opts();
55
base.cpu = "x86-64".into();
6+
base.features = "+cx16,+sse3,+sahf".into();
67
base.plt_by_default = false;
78
// Use high-entropy 64 bit address space for ASLR
89
base.add_pre_link_args(
910
LinkerFlavor::Gnu(Cc::No, Lld::No),
1011
&["-m", "i386pep", "--high-entropy-va"],
1112
);
1213
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
13-
base.max_atomic_width = Some(64);
14+
base.max_atomic_width = Some(128);
1415

1516
Target {
1617
llvm_target: "x86_64-pc-windows-gnu".into(),

compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ use crate::spec::{base, Target};
33
pub fn target() -> Target {
44
let mut base = base::windows_uwp_msvc::opts();
55
base.cpu = "x86-64".into();
6+
base.features = "+cx16,+sse3,+sahf".into();
67
base.plt_by_default = false;
7-
base.max_atomic_width = Some(64);
8+
base.max_atomic_width = Some(128);
89

910
Target {
1011
llvm_target: "x86_64-pc-windows-msvc".into(),

tests/codegen/sse42-implies-crc32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ pub unsafe fn crc32sse(v: u8) -> u32 {
1212
_mm_crc32_u8(out, v)
1313
}
1414

15-
// CHECK: attributes #0 {{.*"target-features"="\+sse4.2,\+crc32"}}
15+
// CHECK: attributes #0 {{.*"target-features"=".*\+sse4.2,\+crc32"}}

0 commit comments

Comments
 (0)