Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64 #120820

Merged
merged 7 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
pub fn target() -> Target {
let mut base = base::windows_gnu::opts();
base.cpu = "x86-64".into();
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
// Use high-entropy 64 bit address space for ASLR
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pep", "--high-entropy-va"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.linker = Some("x86_64-w64-mingw32-gcc".into());

Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
pub fn target() -> Target {
let mut base = base::windows_gnullvm::opts();
base.cpu = "x86-64".into();
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.linker = Some("x86_64-w64-mingw32-clang".into());

Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use crate::spec::{base, SanitizerSet, Target};
pub fn target() -> Target {
let mut base = base::windows_msvc::opts();
base.cpu = "x86-64".into();
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);
base.supported_sanitizers = SanitizerSet::ADDRESS;

Target {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ use crate::spec::{base, Cc, LinkerFlavor, Lld, Target};
pub fn target() -> Target {
let mut base = base::windows_uwp_gnu::opts();
base.cpu = "x86-64".into();
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
// Use high-entropy 64 bit address space for ASLR
base.add_pre_link_args(
LinkerFlavor::Gnu(Cc::No, Lld::No),
&["-m", "i386pep", "--high-entropy-va"],
);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]);
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);

Target {
llvm_target: "x86_64-pc-windows-gnu".into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use crate::spec::{base, Target};
pub fn target() -> Target {
let mut base = base::windows_uwp_msvc::opts();
base.cpu = "x86-64".into();
base.features = "+cx16,+sse3,+sahf".into();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
base.max_atomic_width = Some(128);

Target {
llvm_target: "x86_64-pc-windows-msvc".into(),
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/sse42-implies-crc32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pub unsafe fn crc32sse(v: u8) -> u32 {
_mm_crc32_u8(out, v)
}

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