llvm.org GIT mirror llvm / 8d44dac
Merging r354882: ------------------------------------------------------------------------ r354882 | atanasyan | 2019-02-26 06:45:17 -0800 (Tue, 26 Feb 2019) | 4 lines [mips] Emit `.module softfloat` directive This change fixes crash on an assertion in case of using `soft float` ABI for mips32r6 target. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@358934 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 4 months ago
3 changed file(s) with 15 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
699699 }
700700
701701 void MipsTargetAsmStreamer::emitDirectiveModuleFP() {
702 OS << "\t.module\tfp=";
703 OS << ABIFlagsSection.getFpABIString(ABIFlagsSection.getFpABI()) << "\n";
702 MipsABIFlagsSection::FpABIKind FpABI = ABIFlagsSection.getFpABI();
703 if (FpABI == MipsABIFlagsSection::FpABIKind::SOFT)
704 OS << "\t.module\tsoftfloat\n";
705 else
706 OS << "\t.module\tfp=" << ABIFlagsSection.getFpABIString(FpABI) << "\n";
704707 }
705708
706709 void MipsTargetAsmStreamer::emitDirectiveSetFp(
812812 // We should always emit a '.module fp=...' but binutils 2.24 does not accept
813813 // it. We therefore emit it when it contradicts the ABI defaults (-mfpxx or
814814 // -mfp64) and omit it otherwise.
815 if (ABI.IsO32() && (STI.isABI_FPXX() || STI.isFP64bit()))
815 if ((ABI.IsO32() && (STI.isABI_FPXX() || STI.isFP64bit())) ||
816 STI.useSoftFloat())
816817 TS.emitDirectiveModuleFP();
817818
818819 // We should always emit a '.module [no]oddspreg' but binutils 2.24 does not
0 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck %s
11 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 -mattr=fp64 %s -o - | FileCheck -check-prefix=CHECK-64 %s
22 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips64 -target-abi n32 %s -o - | FileCheck -check-prefix=CHECK-64n %s
3 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 \
4 ; RUN: -mattr=soft-float %s -o - | FileCheck -check-prefix=SOFT %s
5 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32r6 \
6 ; RUN: -mattr=soft-float %s -o - | FileCheck -check-prefix=SOFT %s
7 ; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips64 \
8 ; RUN: -mattr=soft-float -target-abi n64 %s -o - | FileCheck -check-prefix=SOFT %s
39
410 ; CHECK: .nan legacy
511 ; We don't emit '.module fp=32' for compatibility with binutils 2.24 which
1420 ; We don't emit '.module fp=64' for compatibility with binutils 2.24 which
1521 ; doesn't accept .module.
1622 ; CHECK-64n-NOT: .module fp=64
23
24 ; SOFT: .module softfloat