Skip to content

Commit beab2e6

Browse files
committedMar 14, 2018
Rollup merge of rust-lang#48874 - jcowgill:mips-features, r=sanxiyn
bump mipsel isa leval and enable fpxx This PR: * Bumps the default ISA level of the mipsel targets to `mips32r2`. The big endian mips targets are already built with `mips32r2`. This is the usual baseline for the MIPS ISA these days used by other projects, although it does drop support for the 4K processor (which was the only processor released with mips32 r1). Debian no longer supports pre-R2 processors. Using R2 also improves code generation in FPXX in certain circumstances. * Enables the FPXX floating point ABI[1] on 32-bit hard-float targets by default. This ABI adds some extra restrictions to the existing ABI which allows code to run on the two main floating point modes found on MIPS (FR0 and FR1) and remains compatible with the FR32 ABI currently in use. All code within an executable (including all shared libraries) must be compiled with FPXX/FP64 to be able to use MSA on 32-bit MIPS. * Enables the "nooddspreg" feature with FPXX. This feature is usually enabled whenever FPXX is. It also helps workaround some issues on Loongson processors. I'm hoping this will fix some test failures mentioned in rust-lang#39013. * Adds the `fp64` feature to the MIPS whitelist. This feature must be enabled to use MSA on 32-bit MIPS, otherwise LLVM will complain. [1] See https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
2 parents 508ffa3 + 0711a7a commit beab2e6

5 files changed

+8
-8
lines changed
 

‎src/librustc_back/target/mips_unknown_linux_gnu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
2525
linker_flavor: LinkerFlavor::Gcc,
2626
options: TargetOptions {
2727
cpu: "mips32r2".to_string(),
28-
features: "+mips32r2".to_string(),
28+
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
2929
max_atomic_width: Some(32),
3030

3131
// see #36994

‎src/librustc_back/target/mipsel_unknown_linux_gnu.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pub fn target() -> TargetResult {
2525
linker_flavor: LinkerFlavor::Gcc,
2626

2727
options: TargetOptions {
28-
cpu: "mips32".to_string(),
29-
features: "+mips32".to_string(),
28+
cpu: "mips32r2".to_string(),
29+
features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
3030
max_atomic_width: Some(32),
3131

3232
// see #36994

‎src/librustc_back/target/mipsel_unknown_linux_musl.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use target::{Target, TargetResult};
1313

1414
pub fn target() -> TargetResult {
1515
let mut base = super::linux_musl_base::opts();
16-
base.cpu = "mips32".to_string();
17-
base.features = "+mips32,+soft-float".to_string();
16+
base.cpu = "mips32r2".to_string();
17+
base.features = "+mips32r2,+soft-float".to_string();
1818
base.max_atomic_width = Some(32);
1919
// see #36994
2020
base.exe_allocation_crate = None;

‎src/librustc_back/target/mipsel_unknown_linux_uclibc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pub fn target() -> TargetResult {
2525
linker_flavor: LinkerFlavor::Gcc,
2626

2727
options: TargetOptions {
28-
cpu: "mips32".to_string(),
29-
features: "+mips32,+soft-float".to_string(),
28+
cpu: "mips32r2".to_string(),
29+
features: "+mips32r2,+soft-float".to_string(),
3030
max_atomic_width: Some(32),
3131

3232
// see #36994

‎src/librustc_trans/llvm_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const POWERPC_WHITELIST: &'static [&'static str] = &["altivec",
104104
"power8-vector", "power9-vector",
105105
"vsx"];
106106

107-
const MIPS_WHITELIST: &'static [&'static str] = &["msa"];
107+
const MIPS_WHITELIST: &'static [&'static str] = &["fp64", "msa"];
108108

109109
pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
110110
let arch = if sess.target.target.arch == "x86_64" {

0 commit comments

Comments
 (0)