aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-24 20:27:40 +0000
committerChris Lattner <sabre@nondot.org>2006-02-24 20:27:40 +0000
commit2c003e26e583e6acafca142ef93efa95a84866a1 (patch)
tree5de750824cf4b97b9db46787d75f416827338fc0 /lib/Target
parentdd26033002b1b4c569df84ac947828c0fc02f6ba (diff)
Add memory printing support for PPC. Input memory operands now work with
inline asms! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 76ca256832..cc40bbf76a 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -98,6 +98,9 @@ namespace {
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 printU5ImmOperand(const MachineInstr *MI, unsigned OpNo) {
unsigned char value = MI->getOperand(OpNo).getImmedValue();
@@ -187,7 +190,7 @@ namespace {
unsigned RegNo = enumRegToMachineReg(CCReg);
O << (0x80 >> RegNo);
}
- // The new addressing mode printers, currently empty
+ // The new addressing mode printers.
void printMemRegImm(const MachineInstr *MI, unsigned OpNo) {
printSymbolLo(MI, OpNo);
O << '(';
@@ -419,6 +422,14 @@ bool PPCAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
return false;
}
+bool PPCAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode) {
+ if (ExtraCode && ExtraCode[0])
+ return true; // Unknown modifier.
+ printMemRegReg(MI, OpNo);
+ return false;
+}
/// printMachineInstruction -- Print out a single PowerPC MI in Darwin syntax to
/// the current output stream.