diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-09-25 10:37:17 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-09-25 10:37:17 +0000 |
commit | 76f8ae87b4705f5c08c3995948223531715a2d58 (patch) | |
tree | 744e1d8378c7bd2cff4bf2c110da7a00f499a2db /lib/Target/SystemZ/SystemZAsmPrinter.cpp | |
parent | e39a156b921f47a374f091b43205555ee90cd555 (diff) | |
download | llvm-76f8ae87b4705f5c08c3995948223531715a2d58.tar.gz llvm-76f8ae87b4705f5c08c3995948223531715a2d58.tar.bz2 llvm-76f8ae87b4705f5c08c3995948223531715a2d58.tar.xz |
[SystemZ] Define the call instructions as pseudo aliases.
Similar to r191364, but for calls. This patch also removes the shortening
of BRASL to BRAS within a TU. Doing that was a bit controversial internally,
since there's a strong expectation with the z assembler that WYWIWYG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZAsmPrinter.cpp')
-rw-r--r-- | lib/Target/SystemZ/SystemZAsmPrinter.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/Target/SystemZ/SystemZAsmPrinter.cpp b/lib/Target/SystemZ/SystemZAsmPrinter.cpp index 84227614c0..3f3ce6bed6 100644 --- a/lib/Target/SystemZ/SystemZAsmPrinter.cpp +++ b/lib/Target/SystemZ/SystemZAsmPrinter.cpp @@ -27,14 +27,36 @@ using namespace llvm; void SystemZAsmPrinter::EmitInstruction(const MachineInstr *MI) { + SystemZMCInstLower Lower(Mang, MF->getContext(), *this); MCInst LoweredMI; switch (MI->getOpcode()) { case SystemZ::Return: LoweredMI = MCInstBuilder(SystemZ::BR).addReg(SystemZ::R14D); break; + case SystemZ::CallBRASL: + LoweredMI = MCInstBuilder(SystemZ::BRASL) + .addReg(SystemZ::R14D) + .addExpr(Lower.getExpr(MI->getOperand(0), MCSymbolRefExpr::VK_PLT)); + break; + + case SystemZ::CallBASR: + LoweredMI = MCInstBuilder(SystemZ::BASR) + .addReg(SystemZ::R14D) + .addReg(MI->getOperand(0).getReg()); + break; + + case SystemZ::CallJG: + LoweredMI = MCInstBuilder(SystemZ::JG) + .addExpr(Lower.getExpr(MI->getOperand(0), MCSymbolRefExpr::VK_PLT)); + break; + + case SystemZ::CallBR: + LoweredMI = MCInstBuilder(SystemZ::BR).addReg(SystemZ::R1D); + break; + default: - SystemZMCInstLower(Mang, MF->getContext(), *this).lower(MI, LoweredMI); + Lower.lower(MI, LoweredMI); break; } OutStreamer.EmitInstruction(LoweredMI); |