mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-02 08:45:55 +00:00
[mips] Fix emission of '.option pic0' for MIPS-IV.
Summary: This was a case of incorrect usage of hasMips64() vs isABI_N64() Reviewers: matheusalmeida, dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D3398 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206388 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
849ca451c8
commit
4134d06487
@ -620,10 +620,17 @@ printFCCOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
|
|||||||
void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
|
||||||
// TODO: Need to add -mabicalls and -mno-abicalls flags.
|
// TODO: Need to add -mabicalls and -mno-abicalls flags.
|
||||||
// Currently we assume that -mabicalls is the default.
|
// Currently we assume that -mabicalls is the default.
|
||||||
getTargetStreamer().emitDirectiveAbiCalls();
|
bool IsABICalls = true;
|
||||||
Reloc::Model RM = Subtarget->getRelocationModel();
|
if (IsABICalls) {
|
||||||
if (RM == Reloc::Static && !Subtarget->hasMips64())
|
getTargetStreamer().emitDirectiveAbiCalls();
|
||||||
getTargetStreamer().emitDirectiveOptionPic0();
|
Reloc::Model RM = Subtarget->getRelocationModel();
|
||||||
|
// FIXME: This condition should be a lot more complicated that it is here.
|
||||||
|
// Ideally it should test for properties of the ABI and not the ABI
|
||||||
|
// itself.
|
||||||
|
// For the moment, I'm only correcting enough to make MIPS-IV work.
|
||||||
|
if (RM == Reloc::Static && !Subtarget->isABI_N64())
|
||||||
|
getTargetStreamer().emitDirectiveOptionPic0();
|
||||||
|
}
|
||||||
|
|
||||||
// Tell the assembler which ABI we are using
|
// Tell the assembler which ABI we are using
|
||||||
std::string SectionName = std::string(".mdebug.") + getCurrentABIString();
|
std::string SectionName = std::string(".mdebug.") + getCurrentABIString();
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-STATIC %s
|
; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-STATIC %s
|
||||||
; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-PIC %s
|
; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 %s -o - | FileCheck -check-prefix=CHECK-PIC %s
|
||||||
|
; RUN: llc -filetype=asm -mtriple mips64el-unknown-linux -mcpu=mips4 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-PIC %s
|
||||||
; RUN: llc -filetype=asm -mtriple mips64el-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-PIC %s
|
; RUN: llc -filetype=asm -mtriple mips64el-unknown-linux -mcpu=mips64 -relocation-model=static %s -o - | FileCheck -check-prefix=CHECK-PIC %s
|
||||||
|
|
||||||
; CHECK-STATIC: .abicalls
|
; CHECK-STATIC: .abicalls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user