Skip to content

Commit 2b153e7

Browse files
author
Günther Brammer
committed
Enable usage of XMM0 per-target
Activating SSE2 with -C target-feature doesn't change the Rust ABI anymore, while deactivating it still does.
1 parent fed8bd1 commit 2b153e7

16 files changed

+19
-0
lines changed

compiler/rustc_target/src/spec/i686_apple_darwin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub fn target() -> Target {
99
base.add_pre_link_args(LinkerFlavor::Darwin(Cc::Yes, Lld::No), &["-m32"]);
1010
base.stack_probes = StackProbeType::X86;
1111
base.frame_pointer = FramePointer::Always;
12+
base.x86_use_xmm0 = true;
1213

1314
Target {
1415
// Clang automatically chooses a more specific target based on

compiler/rustc_target/src/spec/i686_linux_android.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pub fn target() -> Target {
1212
base.cpu = "pentiumpro".into();
1313
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".into();
1414
base.stack_probes = StackProbeType::X86;
15+
base.x86_use_xmm0 = true;
1516

1617
Target {
1718
llvm_target: "i686-linux-android".into(),

compiler/rustc_target/src/spec/i686_pc_windows_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub fn target() -> Target {
1414
&["-m", "i386pe", "--large-address-aware"],
1515
);
1616
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]);
17+
base.x86_use_xmm0 = true;
1718

1819
Target {
1920
llvm_target: "i686-pc-windows-gnu".into(),

compiler/rustc_target/src/spec/i686_pc_windows_gnullvm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub fn target() -> Target {
1313
LinkerFlavor::Gnu(Cc::No, Lld::No),
1414
&["-m", "i386pe", "--large-address-aware"],
1515
);
16+
base.x86_use_xmm0 = true;
1617

1718
Target {
1819
llvm_target: "i686-pc-windows-gnu".into(),

compiler/rustc_target/src/spec/i686_pc_windows_msvc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub fn target() -> Target {
1919
);
2020
// Workaround for #95429
2121
base.has_thread_local = false;
22+
base.x86_use_xmm0 = true;
2223

2324
Target {
2425
llvm_target: "i686-pc-windows-msvc".into(),

compiler/rustc_target/src/spec/i686_unknown_freebsd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn target() -> Target {
66
base.max_atomic_width = Some(64);
77
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-znotext"]);
88
base.stack_probes = StackProbeType::X86;
9+
base.x86_use_xmm0 = true;
910

1011
Target {
1112
llvm_target: "i686-unknown-freebsd".into(),

compiler/rustc_target/src/spec/i686_unknown_haiku.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn target() -> Target {
66
base.max_atomic_width = Some(64);
77
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
88
base.stack_probes = StackProbeType::X86;
9+
base.x86_use_xmm0 = true;
910

1011
Target {
1112
llvm_target: "i686-unknown-haiku".into(),

compiler/rustc_target/src/spec/i686_unknown_linux_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub fn target() -> Target {
77
base.supported_sanitizers = SanitizerSet::ADDRESS;
88
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
99
base.stack_probes = StackProbeType::X86;
10+
base.x86_use_xmm0 = true;
1011

1112
Target {
1213
llvm_target: "i686-unknown-linux-gnu".into(),

compiler/rustc_target/src/spec/i686_unknown_linux_musl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub fn target() -> Target {
2020
// This may or may not be related to this bug:
2121
// https://llvm.org/bugs/show_bug.cgi?id=30879
2222
base.frame_pointer = FramePointer::Always;
23+
base.x86_use_xmm0 = true;
2324

2425
Target {
2526
llvm_target: "i686-unknown-linux-musl".into(),

compiler/rustc_target/src/spec/i686_unknown_netbsd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn target() -> Target {
66
base.max_atomic_width = Some(64);
77
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]);
88
base.stack_probes = StackProbeType::X86;
9+
base.x86_use_xmm0 = true;
910

1011
Target {
1112
llvm_target: "i686-unknown-netbsdelf".into(),

0 commit comments

Comments
 (0)