forked from OSchip/llvm-project
Added JumpTable support
Fixed some AsmPrinter issues Added GLOBAL_OFFSET_TABLE Node handle. llvm-svn: 44024
This commit is contained in:
parent
040f696bfc
commit
b439132d16
|
@ -29,6 +29,7 @@
|
||||||
#include "llvm/Target/TargetAsmInfo.h"
|
#include "llvm/Target/TargetAsmInfo.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
#include "llvm/Target/TargetOptions.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
#include "llvm/Support/Mangler.h"
|
||||||
#include "llvm/ADT/Statistic.h"
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/ADT/SetVector.h"
|
#include "llvm/ADT/SetVector.h"
|
||||||
|
@ -237,9 +238,8 @@ emitFunctionStart(MachineFunction &MF)
|
||||||
const Function *F = MF.getFunction();
|
const Function *F = MF.getFunction();
|
||||||
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
||||||
|
|
||||||
// On Mips GAS, if .align #n is present, #n means the number of bits
|
// 2 bits aligned
|
||||||
// to be cleared. So, if we want 4 byte alignment, we must have .align 2
|
EmitAlignment(2, F);
|
||||||
EmitAlignment(1, F);
|
|
||||||
|
|
||||||
O << "\t.globl\t" << CurrentFnName << "\n";
|
O << "\t.globl\t" << CurrentFnName << "\n";
|
||||||
O << "\t.ent\t" << CurrentFnName << "\n";
|
O << "\t.ent\t" << CurrentFnName << "\n";
|
||||||
|
@ -280,6 +280,9 @@ runOnMachineFunction(MachineFunction &MF)
|
||||||
// Print out constants referenced by the function
|
// Print out constants referenced by the function
|
||||||
EmitConstantPool(MF.getConstantPool());
|
EmitConstantPool(MF.getConstantPool());
|
||||||
|
|
||||||
|
// Print out jump tables referenced by the function
|
||||||
|
EmitJumpTableInfo(MF.getJumpTableInfo(), MF);
|
||||||
|
|
||||||
O << "\n\n";
|
O << "\n\n";
|
||||||
|
|
||||||
// What's my mangled name?
|
// What's my mangled name?
|
||||||
|
@ -388,6 +391,11 @@ printOperand(const MachineInstr *MI, int opNum)
|
||||||
O << MO.getSymbolName();
|
O << MO.getSymbolName();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MachineOperand::MO_JumpTableIndex:
|
||||||
|
O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
|
||||||
|
<< '_' << MO.getJumpTableIndex();
|
||||||
|
break;
|
||||||
|
|
||||||
// FIXME: Verify correct
|
// FIXME: Verify correct
|
||||||
case MachineOperand::MO_ConstantPoolIndex:
|
case MachineOperand::MO_ConstantPoolIndex:
|
||||||
O << TAI->getPrivateGlobalPrefix() << "CPI"
|
O << TAI->getPrivateGlobalPrefix() << "CPI"
|
||||||
|
@ -450,19 +458,30 @@ doFinalization(Module &M)
|
||||||
std::string name = Mang->getValueName(I);
|
std::string name = Mang->getValueName(I);
|
||||||
Constant *C = I->getInitializer();
|
Constant *C = I->getInitializer();
|
||||||
unsigned Size = TD->getABITypeSize(C->getType());
|
unsigned Size = TD->getABITypeSize(C->getType());
|
||||||
unsigned Align = TD->getPrefTypeAlignment(C->getType());
|
unsigned Align = TD->getPreferredAlignmentLog(I);
|
||||||
|
|
||||||
|
// Is this correct ?
|
||||||
if (C->isNullValue() && (I->hasLinkOnceLinkage() ||
|
if (C->isNullValue() && (I->hasLinkOnceLinkage() ||
|
||||||
I->hasInternalLinkage() || I->hasWeakLinkage()
|
I->hasInternalLinkage() || I->hasWeakLinkage()))
|
||||||
/* FIXME: Verify correct */)) {
|
{
|
||||||
|
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
||||||
|
|
||||||
SwitchToDataSection(".data", I);
|
if (!NoZerosInBSS && TAI->getBSSSection())
|
||||||
if (I->hasInternalLinkage())
|
SwitchToDataSection(TAI->getBSSSection(), I);
|
||||||
O << "\t.local " << name << "\n";
|
else
|
||||||
|
SwitchToDataSection(TAI->getDataSection(), I);
|
||||||
|
|
||||||
O << "\t.comm " << name << ","
|
if (I->hasInternalLinkage()) {
|
||||||
<< TD->getABITypeSize(C->getType())
|
if (TAI->getLCOMMDirective())
|
||||||
<< "," << Align << "\n";
|
O << TAI->getLCOMMDirective() << name << "," << Size;
|
||||||
|
else
|
||||||
|
O << "\t.local\t" << name << "\n";
|
||||||
|
} else {
|
||||||
|
O << TAI->getCOMMDirective() << name << "," << Size;
|
||||||
|
// The .comm alignment in bytes.
|
||||||
|
if (TAI->getCOMMDirectiveTakesAlignment())
|
||||||
|
O << "," << (1 << Align);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -483,24 +502,37 @@ doFinalization(Module &M)
|
||||||
// something. For now, just emit them as external.
|
// something. For now, just emit them as external.
|
||||||
case GlobalValue::ExternalLinkage:
|
case GlobalValue::ExternalLinkage:
|
||||||
// If external or appending, declare as a global symbol
|
// If external or appending, declare as a global symbol
|
||||||
O << "\t.globl " << name << "\n";
|
O << TAI->getGlobalDirective() << name << "\n";
|
||||||
|
// Fall Through
|
||||||
case GlobalValue::InternalLinkage:
|
case GlobalValue::InternalLinkage:
|
||||||
if (C->isNullValue())
|
// FIXME: special handling for ".ctors" & ".dtors" sections
|
||||||
SwitchToDataSection(".bss", I);
|
if (I->hasSection() && (I->getSection() == ".ctors" ||
|
||||||
else
|
I->getSection() == ".dtors")) {
|
||||||
SwitchToDataSection(".data", I);
|
std::string SectionName = ".section " + I->getSection();
|
||||||
|
SectionName += ",\"aw\",%progbits";
|
||||||
|
SwitchToDataSection(SectionName.c_str());
|
||||||
|
} else {
|
||||||
|
if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection())
|
||||||
|
SwitchToDataSection(TAI->getBSSSection(), I);
|
||||||
|
else if (!I->isConstant())
|
||||||
|
SwitchToDataSection(TAI->getDataSection(), I);
|
||||||
|
else {
|
||||||
|
// Read-only data.
|
||||||
|
if (TAI->getReadOnlySection())
|
||||||
|
SwitchToDataSection(TAI->getReadOnlySection(), I);
|
||||||
|
else
|
||||||
|
SwitchToDataSection(TAI->getDataSection(), I);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case GlobalValue::GhostLinkage:
|
case GlobalValue::GhostLinkage:
|
||||||
cerr << "Should not have any"
|
cerr << "Should not have any unmaterialized functions!\n";
|
||||||
<< "unmaterialized functions!\n";
|
|
||||||
abort();
|
abort();
|
||||||
case GlobalValue::DLLImportLinkage:
|
case GlobalValue::DLLImportLinkage:
|
||||||
cerr << "DLLImport linkage is"
|
cerr << "DLLImport linkage is not supported by this target!\n";
|
||||||
<< "not supported by this target!\n";
|
|
||||||
abort();
|
abort();
|
||||||
case GlobalValue::DLLExportLinkage:
|
case GlobalValue::DLLExportLinkage:
|
||||||
cerr << "DLLExport linkage is"
|
cerr << "DLLExport linkage is not supported by this target!\n";
|
||||||
<< "not supported by this target!\n";
|
|
||||||
abort();
|
abort();
|
||||||
default:
|
default:
|
||||||
assert(0 && "Unknown linkage type!");
|
assert(0 && "Unknown linkage type!");
|
||||||
|
|
|
@ -78,6 +78,7 @@ private:
|
||||||
// Include the pieces autogenerated from the target description.
|
// Include the pieces autogenerated from the target description.
|
||||||
#include "MipsGenDAGISel.inc"
|
#include "MipsGenDAGISel.inc"
|
||||||
|
|
||||||
|
SDOperand getGlobalBaseReg();
|
||||||
SDNode *Select(SDOperand N);
|
SDNode *Select(SDOperand N);
|
||||||
|
|
||||||
// Complex Pattern.
|
// Complex Pattern.
|
||||||
|
@ -124,6 +125,23 @@ InstructionSelectBasicBlock(SelectionDAG &SD)
|
||||||
ScheduleAndEmitDAG(SD);
|
ScheduleAndEmitDAG(SD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getGlobalBaseReg - Output the instructions required to put the
|
||||||
|
/// GOT address into a register.
|
||||||
|
SDOperand MipsDAGToDAGISel::getGlobalBaseReg()
|
||||||
|
{
|
||||||
|
MachineFunction* MF = BB->getParent();
|
||||||
|
unsigned GP = 0;
|
||||||
|
for(MachineFunction::livein_iterator ii = MF->livein_begin(),
|
||||||
|
ee = MF->livein_end(); ii != ee; ++ii)
|
||||||
|
if (ii->first == Mips::GP) {
|
||||||
|
GP = ii->second;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
assert(GP && "GOT PTR not in liveins");
|
||||||
|
return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
|
||||||
|
GP, MVT::i32);
|
||||||
|
}
|
||||||
|
|
||||||
/// ComplexPattern used on MipsInstrInfo
|
/// ComplexPattern used on MipsInstrInfo
|
||||||
/// Used on Mips Load/Store instructions
|
/// Used on Mips Load/Store instructions
|
||||||
bool MipsDAGToDAGISel::
|
bool MipsDAGToDAGISel::
|
||||||
|
@ -138,7 +156,8 @@ SelectAddr(SDOperand Op, SDOperand Addr, SDOperand &Offset, SDOperand &Base)
|
||||||
|
|
||||||
// on PIC code Load GA
|
// on PIC code Load GA
|
||||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||||
if (Addr.getOpcode() == ISD::TargetGlobalAddress) {
|
if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
|
||||||
|
(Addr.getOpcode() == ISD::TargetJumpTable)){
|
||||||
Base = CurDAG->getRegister(Mips::GP, MVT::i32);
|
Base = CurDAG->getRegister(Mips::GP, MVT::i32);
|
||||||
Offset = Addr;
|
Offset = Addr;
|
||||||
return true;
|
return true;
|
||||||
|
@ -253,6 +272,13 @@ Select(SDOperand N)
|
||||||
return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, MFInFlag);
|
return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, MFInFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get target GOT address.
|
||||||
|
case ISD::GLOBAL_OFFSET_TABLE: {
|
||||||
|
SDOperand Result = getGlobalBaseReg();
|
||||||
|
ReplaceUses(N, Result);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/// Handle direct and indirect calls when using PIC. On PIC, when
|
/// Handle direct and indirect calls when using PIC. On PIC, when
|
||||||
/// GOT is smaller than about 64k (small code) the GA target is
|
/// GOT is smaller than about 64k (small code) the GA target is
|
||||||
/// loaded with only one instruction. Otherwise GA's target must
|
/// loaded with only one instruction. Otherwise GA's target must
|
||||||
|
|
|
@ -55,6 +55,9 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM)
|
||||||
setSetCCResultType(MVT::i32);
|
setSetCCResultType(MVT::i32);
|
||||||
setSetCCResultContents(ZeroOrOneSetCCResult);
|
setSetCCResultContents(ZeroOrOneSetCCResult);
|
||||||
|
|
||||||
|
// JumpTable targets must use GOT when using PIC_
|
||||||
|
setUsesGlobalOffsetTable(true);
|
||||||
|
|
||||||
// Set up the register classes
|
// Set up the register classes
|
||||||
addRegisterClass(MVT::i32, Mips::CPURegsRegisterClass);
|
addRegisterClass(MVT::i32, Mips::CPURegsRegisterClass);
|
||||||
|
|
||||||
|
@ -62,6 +65,7 @@ MipsTargetLowering(MipsTargetMachine &TM): TargetLowering(TM)
|
||||||
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
|
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
|
||||||
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
|
setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
|
||||||
setOperationAction(ISD::RET, MVT::Other, Custom);
|
setOperationAction(ISD::RET, MVT::Other, Custom);
|
||||||
|
setOperationAction(ISD::JumpTable, MVT::i32, Custom);
|
||||||
|
|
||||||
// Load extented operations for i1 types must be promoted
|
// Load extented operations for i1 types must be promoted
|
||||||
setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
|
setLoadXAction(ISD::EXTLOAD, MVT::i1, Promote);
|
||||||
|
@ -119,6 +123,7 @@ LowerOperation(SDOperand Op, SelectionDAG &DAG)
|
||||||
case ISD::RET: return LowerRET(Op, DAG);
|
case ISD::RET: return LowerRET(Op, DAG);
|
||||||
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
|
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
|
||||||
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
|
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
|
||||||
|
case ISD::JumpTable: return LowerJumpTable(Op, DAG);
|
||||||
}
|
}
|
||||||
return SDOperand();
|
return SDOperand();
|
||||||
}
|
}
|
||||||
|
@ -175,6 +180,29 @@ LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG)
|
||||||
assert(0 && "TLS not implemented for MIPS.");
|
assert(0 && "TLS not implemented for MIPS.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDOperand MipsTargetLowering::
|
||||||
|
LowerJumpTable(SDOperand Op, SelectionDAG &DAG)
|
||||||
|
{
|
||||||
|
SDOperand ResNode;
|
||||||
|
SDOperand HiPart;
|
||||||
|
|
||||||
|
MVT::ValueType PtrVT = Op.getValueType();
|
||||||
|
JumpTableSDNode *JT = cast<JumpTableSDNode>(Op);
|
||||||
|
SDOperand JTI = DAG.getTargetJumpTable(JT->getIndex(), PtrVT);
|
||||||
|
|
||||||
|
if (getTargetMachine().getRelocationModel() != Reloc::PIC_) {
|
||||||
|
const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::i32);
|
||||||
|
SDOperand Ops[] = { JTI };
|
||||||
|
HiPart = DAG.getNode(MipsISD::Hi, VTs, 1, Ops, 1);
|
||||||
|
} else // Emit Load from Global Pointer
|
||||||
|
HiPart = DAG.getLoad(MVT::i32, DAG.getEntryNode(), JTI, NULL, 0);
|
||||||
|
|
||||||
|
SDOperand Lo = DAG.getNode(MipsISD::Lo, MVT::i32, JTI);
|
||||||
|
ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo);
|
||||||
|
|
||||||
|
return ResNode;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Calling Convention Implementation
|
// Calling Convention Implementation
|
||||||
//
|
//
|
||||||
|
@ -346,13 +374,11 @@ LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
|
||||||
// location is used on function prologue to save GP and also after all
|
// location is used on function prologue to save GP and also after all
|
||||||
// emited CALL's to restore GP.
|
// emited CALL's to restore GP.
|
||||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
||||||
|
|
||||||
// Function can have an arbitrary number of calls, so
|
// Function can have an arbitrary number of calls, so
|
||||||
// hold the LastStackLoc with the biggest offset.
|
// hold the LastStackLoc with the biggest offset.
|
||||||
int FI;
|
int FI;
|
||||||
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
MipsFunctionInfo *MipsFI = MF.getInfo<MipsFunctionInfo>();
|
||||||
if (LastStackLoc >= MipsFI->getGPStackOffset()) {
|
if (LastStackLoc >= MipsFI->getGPStackOffset()) {
|
||||||
|
|
||||||
LastStackLoc = (!LastStackLoc) ? (16) : (LastStackLoc+4);
|
LastStackLoc = (!LastStackLoc) ? (16) : (LastStackLoc+4);
|
||||||
// Create the frame index only once. SPOffset here can be anything
|
// Create the frame index only once. SPOffset here can be anything
|
||||||
// (this will be fixed on processFunctionBeforeFrameFinalized)
|
// (this will be fixed on processFunctionBeforeFrameFinalized)
|
||||||
|
@ -363,7 +389,6 @@ LowerCCCCallTo(SDOperand Op, SelectionDAG &DAG, unsigned CC)
|
||||||
MipsFI->setGPStackOffset(LastStackLoc);
|
MipsFI->setGPStackOffset(LastStackLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reload GP value.
|
// Reload GP value.
|
||||||
FI = MipsFI->getGPFI();
|
FI = MipsFI->getGPFI();
|
||||||
SDOperand FIN = DAG.getFrameIndex(FI,getPointerTy());
|
SDOperand FIN = DAG.getFrameIndex(FI,getPointerTy());
|
||||||
|
@ -455,6 +480,10 @@ LowerCCCArguments(SDOperand Op, SelectionDAG &DAG)
|
||||||
|
|
||||||
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
|
unsigned StackReg = MF.getTarget().getRegisterInfo()->getFrameRegister(MF);
|
||||||
|
|
||||||
|
// GP holds the GOT address on PIC calls.
|
||||||
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
|
||||||
|
AddLiveIn(MF, Mips::GP, Mips::CPURegsRegisterClass);
|
||||||
|
|
||||||
// Assign locations to all of the incoming arguments.
|
// Assign locations to all of the incoming arguments.
|
||||||
SmallVector<CCValAssign, 16> ArgLocs;
|
SmallVector<CCValAssign, 16> ArgLocs;
|
||||||
CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
|
CCState CCInfo(CC, isVarArg, getTargetMachine(), ArgLocs);
|
||||||
|
|
|
@ -76,6 +76,7 @@ namespace llvm {
|
||||||
SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
|
SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG);
|
||||||
SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
|
SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG);
|
||||||
SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
|
SDOperand LowerGlobalTLSAddress(SDOperand Op, SelectionDAG &DAG);
|
||||||
|
SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG);
|
||||||
|
|
||||||
// Inline asm support
|
// Inline asm support
|
||||||
ConstraintType getConstraintType(const std::string &Constraint) const;
|
ConstraintType getConstraintType(const std::string &Constraint) const;
|
||||||
|
|
|
@ -274,13 +274,13 @@ class JumpFR<bits<6> op, bits<6> func, string instr_asm>:
|
||||||
(outs),
|
(outs),
|
||||||
(ins CPURegs:$target),
|
(ins CPURegs:$target),
|
||||||
!strconcat(instr_asm, " $target"),
|
!strconcat(instr_asm, " $target"),
|
||||||
[], IIBranch>;
|
[(brind CPURegs:$target)], IIBranch>;
|
||||||
|
|
||||||
// Jump and Link (Call)
|
// Jump and Link (Call)
|
||||||
let isCall=1, hasDelaySlot=1,
|
let isCall=1, hasDelaySlot=1,
|
||||||
// All calls clobber the non-callee saved registers...
|
// All calls clobber the non-callee saved registers...
|
||||||
Defs = [AT, V0, V1, A0, A1, A2, A3, T0, T1, T2,
|
Defs = [AT, V0, V1, A0, A1, A2, A3, T0, T1, T2,
|
||||||
T3, T4, T5, T6, T7, T8, T9, K0, K1] in {
|
T3, T4, T5, T6, T7, T8, T9, K0, K1], Uses = [GP] in {
|
||||||
class JumpLink<bits<6> op, string instr_asm>:
|
class JumpLink<bits<6> op, string instr_asm>:
|
||||||
FJ< op,
|
FJ< op,
|
||||||
(outs),
|
(outs),
|
||||||
|
@ -518,6 +518,10 @@ def : Pat<(MipsHi tglobaladdr:$in), (LUi tglobaladdr:$in)>;
|
||||||
def : Pat<(MipsLo tglobaladdr:$in), (ADDiu ZERO, tglobaladdr:$in)>;
|
def : Pat<(MipsLo tglobaladdr:$in), (ADDiu ZERO, tglobaladdr:$in)>;
|
||||||
def : Pat<(add CPURegs:$hi, (MipsLo tglobaladdr:$lo)),
|
def : Pat<(add CPURegs:$hi, (MipsLo tglobaladdr:$lo)),
|
||||||
(ADDiu CPURegs:$hi, tglobaladdr:$lo)>;
|
(ADDiu CPURegs:$hi, tglobaladdr:$lo)>;
|
||||||
|
def : Pat<(MipsHi tjumptable:$in), (LUi tjumptable:$in)>;
|
||||||
|
def : Pat<(MipsLo tjumptable:$in), (ADDiu ZERO, tjumptable:$in)>;
|
||||||
|
def : Pat<(add CPURegs:$hi, (MipsLo tjumptable:$lo)),
|
||||||
|
(ADDiu CPURegs:$hi, tjumptable:$lo)>;
|
||||||
|
|
||||||
// Mips does not have not, so we increase the operation
|
// Mips does not have not, so we increase the operation
|
||||||
def : Pat<(not CPURegs:$in),
|
def : Pat<(not CPURegs:$in),
|
||||||
|
|
|
@ -12,11 +12,27 @@
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "MipsTargetAsmInfo.h"
|
#include "MipsTargetAsmInfo.h"
|
||||||
|
#include "MipsTargetMachine.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) {
|
MipsTargetAsmInfo::MipsTargetAsmInfo(const MipsTargetMachine &TM) {
|
||||||
Data16bitsDirective = "\t.half\t";
|
AlignmentIsInBytes = false;
|
||||||
Data32bitsDirective = "\t.word\t";
|
Data16bitsDirective = "\t.half\t";
|
||||||
CommentString = "#";
|
Data32bitsDirective = "\t.word\t";
|
||||||
|
PrivateGlobalPrefix = "$";
|
||||||
|
JumpTableDataSection = "\t.rdata";
|
||||||
|
CommentString = "#";
|
||||||
|
ReadOnlySection = "\t.rdata";
|
||||||
|
ZeroDirective = "\t.space\t";
|
||||||
|
BSSSection = "\t.section\t.bss";
|
||||||
|
GlobalDirective = "\t.globl\t";
|
||||||
|
LCOMMDirective = "\t.lcomm\t";
|
||||||
|
|
||||||
|
if (TM.getRelocationModel() == Reloc::Static)
|
||||||
|
JumpTableDirective = "\t.word\t";
|
||||||
|
else
|
||||||
|
JumpTableDirective = "\t.gpword\t";
|
||||||
|
|
||||||
|
COMMDirectiveTakesAlignment = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue