about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJames Cowgill <jcowgill@debian.org>2018-03-08 11:53:19 +0000
committerJames Cowgill <jcowgill@debian.org>2018-03-08 13:16:02 +0000
commitfccaf252df7d5426ae5b0d8b8359357fe526fc58 (patch)
tree058f494ac612d81842f70bde873a8cf0627a7f24
parentf53f2fa2e894c4709d7b09995331f30c596d0724 (diff)
downloadrust-fccaf252df7d5426ae5b0d8b8359357fe526fc58.tar.gz
rust-fccaf252df7d5426ae5b0d8b8359357fe526fc58.zip
librustc_back: enable fpxx on 32-bit hardfloat mips targets
See this page for details about FPXX:
https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

Using FPXX is the most compatible floating point mode available and
allows the generated code to work in both FR0 and FR1 modes of the
processor. Using MSA (MIPS SIMD) requires FR1, so to use any MSA code we
need a compatible floating point mode.

This commit also sets nooddspreg (disabling the use of odd numbered
single precision float registers) as recommended when enabling FPXX.
-rw-r--r--src/librustc_back/target/mips_unknown_linux_gnu.rs2
-rw-r--r--src/librustc_back/target/mipsel_unknown_linux_gnu.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_back/target/mips_unknown_linux_gnu.rs b/src/librustc_back/target/mips_unknown_linux_gnu.rs
index 5a43e1c4c7a..cffd1daed99 100644
--- a/src/librustc_back/target/mips_unknown_linux_gnu.rs
+++ b/src/librustc_back/target/mips_unknown_linux_gnu.rs
@@ -25,7 +25,7 @@ pub fn target() -> TargetResult {
         linker_flavor: LinkerFlavor::Gcc,
         options: TargetOptions {
             cpu: "mips32r2".to_string(),
-            features: "+mips32r2".to_string(),
+            features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
             max_atomic_width: Some(32),
 
             // see #36994
diff --git a/src/librustc_back/target/mipsel_unknown_linux_gnu.rs b/src/librustc_back/target/mipsel_unknown_linux_gnu.rs
index 94f82adfacd..555855b8f81 100644
--- a/src/librustc_back/target/mipsel_unknown_linux_gnu.rs
+++ b/src/librustc_back/target/mipsel_unknown_linux_gnu.rs
@@ -26,7 +26,7 @@ pub fn target() -> TargetResult {
 
         options: TargetOptions {
             cpu: "mips32r2".to_string(),
-            features: "+mips32r2".to_string(),
+            features: "+mips32r2,+fpxx,+nooddspreg".to_string(),
             max_atomic_width: Some(32),
 
             // see #36994