mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-25 12:49:50 +00:00
MIPS DSP: add code necessary for pseudo instruction lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7e105bcc3a
commit
cc46fe591a
@ -11,6 +11,7 @@ tablegen(LLVM MipsGenCallingConv.inc -gen-callingconv)
|
||||
tablegen(LLVM MipsGenSubtargetInfo.inc -gen-subtarget)
|
||||
tablegen(LLVM MipsGenEDInfo.inc -gen-enhanced-disassembly-info)
|
||||
tablegen(LLVM MipsGenAsmMatcher.inc -gen-asm-matcher)
|
||||
tablegen(LLVM MipsGenMCPseudoLowering.inc -gen-pseudo-lowering)
|
||||
add_public_tablegen_target(MipsCommonTableGen)
|
||||
|
||||
add_llvm_target(MipsCodeGen
|
||||
|
@ -17,7 +17,7 @@ BUILT_SOURCES = MipsGenRegisterInfo.inc MipsGenInstrInfo.inc \
|
||||
MipsGenDAGISel.inc MipsGenCallingConv.inc \
|
||||
MipsGenSubtargetInfo.inc MipsGenMCCodeEmitter.inc \
|
||||
MipsGenEDInfo.inc MipsGenDisassemblerTables.inc \
|
||||
MipsGenAsmMatcher.inc
|
||||
MipsGenMCPseudoLowering.inc MipsGenAsmMatcher.inc
|
||||
|
||||
DIRS = InstPrinter Disassembler AsmParser TargetInfo MCTargetDesc
|
||||
|
||||
|
@ -50,6 +50,13 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MipsAsmPrinter::lowerOperand(const MachineOperand &MO, MCOperand &MCOp) {
|
||||
MCOp = MCInstLowering.LowerOperand(MO);
|
||||
return MCOp.isValid();
|
||||
}
|
||||
|
||||
#include "MipsGenMCPseudoLowering.inc"
|
||||
|
||||
void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
if (MI->isDebugValue()) {
|
||||
SmallString<128> Str;
|
||||
@ -59,6 +66,10 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do any auto-generated pseudo lowerings.
|
||||
if (emitPseudoExpansionLowering(OutStreamer, MI))
|
||||
return;
|
||||
|
||||
MachineBasicBlock::const_instr_iterator I = MI;
|
||||
MachineBasicBlock::const_instr_iterator E = MI->getParent()->instr_end();
|
||||
|
||||
|
@ -32,6 +32,14 @@ class LLVM_LIBRARY_VISIBILITY MipsAsmPrinter : public AsmPrinter {
|
||||
|
||||
void EmitInstrWithMacroNoAT(const MachineInstr *MI);
|
||||
|
||||
private:
|
||||
// tblgen'erated function.
|
||||
bool emitPseudoExpansionLowering(MCStreamer &OutStreamer,
|
||||
const MachineInstr *MI);
|
||||
|
||||
// lowerOperand - Convert a MachineOperand into the equivalent MCOperand.
|
||||
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp);
|
||||
|
||||
public:
|
||||
|
||||
const MipsSubtarget *Subtarget;
|
||||
|
@ -33,11 +33,11 @@ public:
|
||||
MipsMCInstLower(MipsAsmPrinter &asmprinter);
|
||||
void Initialize(Mangler *mang, MCContext *C);
|
||||
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
||||
MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
|
||||
|
||||
private:
|
||||
MCOperand LowerSymbolOperand(const MachineOperand &MO,
|
||||
MachineOperandType MOTy, unsigned Offset) const;
|
||||
MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user