Skip to content

Commit fccaf25

Browse files
committed
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.
1 parent f53f2fa commit fccaf25

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn target() -> TargetResult {
2626

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

3232
// see #36994

0 commit comments

Comments
 (0)