diff options
author | Simon Atanasyan <simon@atanasyan.com> | 2013-11-19 12:20:17 +0000 |
---|---|---|
committer | Simon Atanasyan <simon@atanasyan.com> | 2013-11-19 12:20:17 +0000 |
commit | 1093afe27a3e34a51b3042142b478b30301bd32e (patch) | |
tree | 68877d7d77c3a49bcf91bfe888c94add9b6930bb /llvm/lib/Target/Mips/MipsSubtarget.cpp | |
parent | a07e4f5b0f330c099320a5f5807c1b7331bb972a (diff) | |
download | bcm5719-llvm-1093afe27a3e34a51b3042142b478b30301bd32e.tar.gz bcm5719-llvm-1093afe27a3e34a51b3042142b478b30301bd32e.zip |
[Mips] Adjust float ABI settings in case of MIPS16 mode.
Hard float for mips16 means essentially to compile as soft float but to
use a runtime library for soft float that is written with native mips32
floating point instructions (those runtime routines run in mips32 hard
float mode).
The patch reviewed by Reed Kotler.
llvm-svn: 195123
Diffstat (limited to 'llvm/lib/Target/Mips/MipsSubtarget.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsSubtarget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MipsSubtarget.cpp b/llvm/lib/Target/Mips/MipsSubtarget.cpp index 0a81072b085..9688f0e264b 100644 --- a/llvm/lib/Target/Mips/MipsSubtarget.cpp +++ b/llvm/lib/Target/Mips/MipsSubtarget.cpp @@ -81,6 +81,16 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU, // Parse features string. ParseSubtargetFeatures(CPUName, FS); + if (InMips16Mode && !TM->Options.UseSoftFloat) { + // Hard float for mips16 means essentially to compile as soft float + // but to use a runtime library for soft float that is written with + // native mips32 floating point instructions (those runtime routines + // run in mips32 hard float mode). + TM->Options.UseSoftFloat = true; + TM->Options.FloatABIType = FloatABI::Soft; + InMips16HardFloat = true; + } + PreviousInMips16Mode = InMips16Mode; // Initialize scheduling itinerary for the specified CPU. |