mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-05 00:59:19 +00:00
Bare-bone X86 inline asm printer support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28014 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
771f88ad1b
commit
3d48a90fbd
@ -264,6 +264,34 @@ void X86ATTAsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op) {
|
|||||||
O << "\"L" << getFunctionNumber() << "$pb\":";
|
O << "\"L" << getFunctionNumber() << "$pb\":";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// PrintAsmOperand - Print out an operand for an inline asm expression.
|
||||||
|
///
|
||||||
|
bool X86ATTAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant,
|
||||||
|
const char *ExtraCode) {
|
||||||
|
// Does this asm operand have a single letter operand modifier?
|
||||||
|
if (ExtraCode && ExtraCode[0]) {
|
||||||
|
if (ExtraCode[1] != 0) return true; // Unknown modifier.
|
||||||
|
|
||||||
|
switch (ExtraCode[0]) {
|
||||||
|
default: return true; // Unknown modifier.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printOperand(MI, OpNo);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X86ATTAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||||
|
unsigned OpNo,
|
||||||
|
unsigned AsmVariant,
|
||||||
|
const char *ExtraCode) {
|
||||||
|
if (ExtraCode && ExtraCode[0])
|
||||||
|
return true; // Unknown modifier.
|
||||||
|
printMemReference(MI, OpNo);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
||||||
/// MI in Intel syntax to the current output stream.
|
/// MI in Intel syntax to the current output stream.
|
||||||
///
|
///
|
||||||
|
@ -61,7 +61,11 @@ struct X86ATTAsmPrinter : public X86SharedAsmPrinter {
|
|||||||
printMemReference(MI, OpNo);
|
printMemReference(MI, OpNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printMachineInstruction(const MachineInstr *MI);
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
|
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
|
void printMachineInstruction(const MachineInstr *MI);
|
||||||
void printSSECC(const MachineInstr *MI, unsigned Op);
|
void printSSECC(const MachineInstr *MI, unsigned Op);
|
||||||
void printMemReference(const MachineInstr *MI, unsigned Op);
|
void printMemReference(const MachineInstr *MI, unsigned Op);
|
||||||
void printPICLabel(const MachineInstr *MI, unsigned Op);
|
void printPICLabel(const MachineInstr *MI, unsigned Op);
|
||||||
|
@ -242,6 +242,34 @@ void X86IntelAsmPrinter::printPICLabel(const MachineInstr *MI, unsigned Op) {
|
|||||||
O << "\"L" << getFunctionNumber() << "$pb\":";
|
O << "\"L" << getFunctionNumber() << "$pb\":";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// PrintAsmOperand - Print out an operand for an inline asm expression.
|
||||||
|
///
|
||||||
|
bool X86IntelAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant,
|
||||||
|
const char *ExtraCode) {
|
||||||
|
// Does this asm operand have a single letter operand modifier?
|
||||||
|
if (ExtraCode && ExtraCode[0]) {
|
||||||
|
if (ExtraCode[1] != 0) return true; // Unknown modifier.
|
||||||
|
|
||||||
|
switch (ExtraCode[0]) {
|
||||||
|
default: return true; // Unknown modifier.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printOperand(MI, OpNo);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X86IntelAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
|
||||||
|
unsigned OpNo,
|
||||||
|
unsigned AsmVariant,
|
||||||
|
const char *ExtraCode) {
|
||||||
|
if (ExtraCode && ExtraCode[0])
|
||||||
|
return true; // Unknown modifier.
|
||||||
|
printMemReference(MI, OpNo);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
/// printMachineInstruction -- Print out a single X86 LLVM instruction
|
||||||
/// MI in Intel syntax to the current output stream.
|
/// MI in Intel syntax to the current output stream.
|
||||||
///
|
///
|
||||||
|
@ -80,7 +80,11 @@ struct X86IntelAsmPrinter : public X86SharedAsmPrinter {
|
|||||||
printMemReference(MI, OpNo);
|
printMemReference(MI, OpNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void printMachineInstruction(const MachineInstr *MI);
|
bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
|
bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
|
||||||
|
unsigned AsmVariant, const char *ExtraCode);
|
||||||
|
void printMachineInstruction(const MachineInstr *MI);
|
||||||
void printOp(const MachineOperand &MO, const char *Modifier = 0);
|
void printOp(const MachineOperand &MO, const char *Modifier = 0);
|
||||||
void printSSECC(const MachineInstr *MI, unsigned Op);
|
void printSSECC(const MachineInstr *MI, unsigned Op);
|
||||||
void printMemReference(const MachineInstr *MI, unsigned Op);
|
void printMemReference(const MachineInstr *MI, unsigned Op);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user