mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
[mips] Do not emit '.module [no]oddspreg' unless we really need to.
We now emit this directive when we need to contradict the default value (e.g. -mno-odd-spreg is given) or an option changed the default value (e.g. -mfpxx is given). This restores support for the currently available head of binutils. However, at this point binutils 2.24 is still not sufficient since it does not support '.module fp=...'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213511 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
80a15c2ff3
commit
8ecdc6d34f
@ -710,9 +710,14 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
|||||||
getTargetStreamer().updateABIInfo(*Subtarget);
|
getTargetStreamer().updateABIInfo(*Subtarget);
|
||||||
getTargetStreamer().emitDirectiveModuleFP();
|
getTargetStreamer().emitDirectiveModuleFP();
|
||||||
|
|
||||||
if (Subtarget->isABI_O32())
|
// If we are targeting O32 then we must emit a '.module [no]oddspreg' ...
|
||||||
getTargetStreamer().emitDirectiveModuleOddSPReg(Subtarget->useOddSPReg(),
|
if (Subtarget->isABI_O32()) {
|
||||||
Subtarget->isABI_O32());
|
// ... but don't emit it unless we are contradicting the default or an
|
||||||
|
// option has changed the default (i.e. FPXX).
|
||||||
|
if (!Subtarget->useOddSPReg() || Subtarget->isABI_FPXX())
|
||||||
|
getTargetStreamer().emitDirectiveModuleOddSPReg(Subtarget->useOddSPReg(),
|
||||||
|
Subtarget->isABI_O32());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MipsAsmPrinter::EmitJal(MCSymbol *Symbol) {
|
void MipsAsmPrinter::EmitJal(MCSymbol *Symbol) {
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s -check-prefix=ALL -check-prefix=ODDSPREG
|
; RUN: llc -march=mipsel -mcpu=mips32 < %s | FileCheck %s -check-prefix=ALL -check-prefix=ODDSPREG -check-prefix=ODDSPREG-NO-EMIT
|
||||||
; RUN: llc -march=mipsel -mcpu=mips32 -mattr=+nooddspreg < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOODDSPREG
|
; RUN: llc -march=mipsel -mcpu=mips32 -mattr=+nooddspreg < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOODDSPREG
|
||||||
; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=fp64 < %s | FileCheck %s -check-prefix=ALL -check-prefix=ODDSPREG
|
; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=fp64 < %s | FileCheck %s -check-prefix=ALL -check-prefix=ODDSPREG -check-prefix=ODDSPREG-NO-EMIT
|
||||||
; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=fp64,+nooddspreg < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOODDSPREG
|
; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=fp64,+nooddspreg < %s | FileCheck %s -check-prefix=ALL -check-prefix=NOODDSPREG
|
||||||
|
; RUN: llc -march=mipsel -mcpu=mips32r6 -mattr=fpxx,-nooddspreg < %s | FileCheck %s -check-prefix=ALL -check-prefix=ODDSPREG -check-prefix=ODDSPREG-EMIT
|
||||||
|
|
||||||
; ODDSPREG: .module oddspreg
|
; We don't emit a directive unless we need to. This is to support versions of
|
||||||
; NOODDSPREG: .module nooddspreg
|
; GAS which do not support the directive.
|
||||||
|
; ODDSPREG-EMIT: .module oddspreg
|
||||||
|
; ODDSPREG-NO-EMIT-NOT: .module oddspreg
|
||||||
|
; NOODDSPREG: .module nooddspreg
|
||||||
|
|
||||||
define float @two_floats(float %a) {
|
define float @two_floats(float %a) {
|
||||||
entry:
|
entry:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user