summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2019-02-26 14:45:17 +0000
committerSimon Atanasyan <simon@atanasyan.com>2019-02-26 14:45:17 +0000
commit8cb497027d262372d33d56040d513a4935d08b7a (patch)
treeba0cbaca6e2bfa322879a79b222c7d0c5cd8498f /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
parent0d4f9216aabfefe2dc9e9d74427a9699793db4bc (diff)
downloadbcm5719-llvm-8cb497027d262372d33d56040d513a4935d08b7a.tar.gz
bcm5719-llvm-8cb497027d262372d33d56040d513a4935d08b7a.zip
[mips] Emit `.module softfloat` directive
This change fixes crash on an assertion in case of using `soft float` ABI for mips32r6 target. llvm-svn: 354882
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index f00a9fe20ef..ba645d2f6ab 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -699,8 +699,11 @@ void MipsTargetAsmStreamer::emitDirectiveCpreturn(unsigned SaveLocation,
}
void MipsTargetAsmStreamer::emitDirectiveModuleFP() {
- OS << "\t.module\tfp=";
- OS << ABIFlagsSection.getFpABIString(ABIFlagsSection.getFpABI()) << "\n";
+ MipsABIFlagsSection::FpABIKind FpABI = ABIFlagsSection.getFpABI();
+ if (FpABI == MipsABIFlagsSection::FpABIKind::SOFT)
+ OS << "\t.module\tsoftfloat\n";
+ else
+ OS << "\t.module\tfp=" << ABIFlagsSection.getFpABIString(FpABI) << "\n";
}
void MipsTargetAsmStreamer::emitDirectiveSetFp(
OpenPOWER on IntegriCloud