diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2007-03-03 05:29:51 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2007-03-03 05:29:51 +0000 |
commit | f54949dc494ced20b24b968284a25037fca06743 (patch) | |
tree | 3773694ea4160f59c7d6d787f44cc03bfc272f63 /lib | |
parent | c739cd6d0701c940d3b76fec5a8793ba66c1172f (diff) |
Emit low/high immediate loads properly for Linux/PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index fc952273ff..f6b5d483e3 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -215,24 +215,28 @@ namespace { if (MI->getOperand(OpNo).isImmediate()) { printS16ImmOperand(MI, OpNo); } else { - O << "ha16("; + if (Subtarget.isDarwin()) O << "ha16("; printOp(MI->getOperand(OpNo)); if (TM.getRelocationModel() == Reloc::PIC_) - O << "-\"L" << getFunctionNumber() << "$pb\")"; - else + O << "-\"L" << getFunctionNumber() << "$pb\""; + if (Subtarget.isDarwin()) O << ')'; + else + O << "@ha"; } } void printSymbolLo(const MachineInstr *MI, unsigned OpNo) { if (MI->getOperand(OpNo).isImmediate()) { printS16ImmOperand(MI, OpNo); } else { - O << "lo16("; + if (Subtarget.isDarwin()) O << "lo16("; printOp(MI->getOperand(OpNo)); if (TM.getRelocationModel() == Reloc::PIC_) - O << "-\"L" << getFunctionNumber() << "$pb\")"; - else + O << "-\"L" << getFunctionNumber() << "$pb\""; + if (Subtarget.isDarwin()) O << ')'; + else + O << "@l"; } } void printcrbitm(const MachineInstr *MI, unsigned OpNo) { |