Skip to content

Commit 1fb9f42

Browse files
Fix LLVM default CPU on powerpc64 and powerpc64le
We currently pass generic as the CPU to LLVM. This results in worse than required code generation. On little endian, which is only POWER8, we avoid many POWER4 and newer instructions. Pass ppc64 and ppc64le instead.
1 parent bff5292 commit 1fb9f42

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/librustc_back/target/powerpc64_unknown_linux_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::linux_base::opts();
15+
base.cpu = "ppc64".to_string();
1516
base.pre_link_args.push("-m64".to_string());
1617

1718
Target {

src/librustc_back/target/powerpc64le_unknown_linux_gnu.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::linux_base::opts();
15+
base.cpu = "ppc64le".to_string();
1516
base.pre_link_args.push("-m64".to_string());
1617

1718
Target {

0 commit comments

Comments
 (0)