mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Initial support for inline asm memory operand constraints.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132768 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -56,6 +56,9 @@ namespace {
|
||||
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
unsigned AsmVariant, const char *ExtraCode,
|
||||
raw_ostream &O);
|
||||
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNum,
|
||||
unsigned AsmVariant, const char *ExtraCode,
|
||||
raw_ostream &O);
|
||||
void printOperand(const MachineInstr *MI, int opNum, raw_ostream &O);
|
||||
void printUnsignedImm(const MachineInstr *MI, int opNum, raw_ostream &O);
|
||||
void printMemOperand(const MachineInstr *MI, int opNum, raw_ostream &O,
|
||||
@@ -304,6 +307,19 @@ bool MipsAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MipsAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||
unsigned OpNum, unsigned AsmVariant,
|
||||
const char *ExtraCode,
|
||||
raw_ostream &O) {
|
||||
if (ExtraCode && ExtraCode[0])
|
||||
return true; // Unknown modifier.
|
||||
|
||||
const MachineOperand &MO = MI->getOperand(OpNum);
|
||||
assert(MO.isReg() && "unexpected inline asm memory operand");
|
||||
O << "0($" << MipsAsmPrinter::getRegisterName(MO.getReg()) << ")";
|
||||
return false;
|
||||
}
|
||||
|
||||
void MipsAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
|
||||
raw_ostream &O) {
|
||||
const MachineOperand &MO = MI->getOperand(opNum);
|
||||
|
@@ -94,6 +94,10 @@ private:
|
||||
inline SDValue getI32Imm(unsigned Imm) {
|
||||
return CurDAG->getTargetConstant(Imm, MVT::i32);
|
||||
}
|
||||
|
||||
virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
|
||||
char ConstraintCode,
|
||||
std::vector<SDValue> &OutOps);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -462,6 +466,14 @@ SDNode* MipsDAGToDAGISel::Select(SDNode *Node) {
|
||||
return ResNode;
|
||||
}
|
||||
|
||||
bool MipsDAGToDAGISel::
|
||||
SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode,
|
||||
std::vector<SDValue> &OutOps) {
|
||||
assert(ConstraintCode == 'm' && "unexpected asm memory constraint");
|
||||
OutOps.push_back(Op);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// createMipsISelDag - This pass converts a legalized DAG into a
|
||||
/// MIPS-specific DAG, ready for instruction scheduling.
|
||||
FunctionPass *llvm::createMipsISelDag(MipsTargetMachine &TM) {
|
||||
|
Reference in New Issue
Block a user