Skip to content

Commit

Permalink
Synchronize i686 rustc triples with Clang
Browse files Browse the repository at this point in the history
Try to be consistently replicate Clang default CPU for i686 triples.
  • Loading branch information
ranma42 committed Feb 13, 2016
1 parent 0062f72 commit 8c840ee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
7 changes: 2 additions & 5 deletions src/librustc_back/target/i686_apple_darwin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::apple_base::opts();

// Use yonah as default CPU to enable SSE[2] instructions.
// Clang defaults to i686 for this target, but defaulting to yonah
// is consistent with what Clang does for i386-apple-darwin.
base.cpu = "yonah".to_string();
// Use i686 as default CPU. Clang uses the same default.
base.cpu = "i686".to_string();

base.pre_link_args.push("-m32".to_string());

Expand Down
9 changes: 4 additions & 5 deletions src/librustc_back/target/i686_linux_android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ use target::Target;
pub fn target() -> Target {
let mut base = super::android_base::opts();

// Use pentium4 as default CPU to enable SSE[2] instructions.
// Clang defaults to i686 and enables SSSE3 for this target, but
// defaulting to pentium4 is consistent with linux and windows
// targets.
base.cpu = "pentium4".to_string();
// Use i686 as default CPU and enable SSSE3.
// Clang and GCC do the same.
base.cpu = "i686".to_string();
base.features = "+ssse3".to_string();

Target {
llvm_target: "i686-linux-android".to_string(),
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_back/target/i686_unknown_freebsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ use target::Target;
pub fn target() -> Target {
let mut base = super::freebsd_base::opts();

// Use pentium4 as default CPU to enable SSE[2] instructions.
// Clang defaults to i486 for this target, but defaulting to
// pentium4 is consistent with linux and windows targets.
base.cpu = "pentium4".to_string();
// Use i486 as default CPU. Clang uses the same default.
base.cpu = "i486".to_string();

base.pre_link_args.push("-m32".to_string());

Expand Down

0 comments on commit 8c840ee

Please sign in to comment.