summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
diff options
context:
space:
mode:
authorPavel Chupin <pavel.v.chupin@intel.com>2014-09-09 11:54:12 +0000
committerPavel Chupin <pavel.v.chupin@intel.com>2014-09-09 11:54:12 +0000
commite6617fc6d406eeaed24e89906b986c293cea6433 (patch)
treeca4d44166600d6336f61acbb2685cd2b5c26a22d /llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
parent4abcfe2cda7f03a70237d6e8e9d8d168508d61e2 (diff)
downloadbcm5719-llvm-e6617fc6d406eeaed24e89906b986c293cea6433.tar.gz
bcm5719-llvm-e6617fc6d406eeaed24e89906b986c293cea6433.zip
[x32] Emit callq for CALLpcrel32
Summary: In AT&T annotation for both x86_64 and x32 calls should be printed as callq in assembly. It's only a matter of correct mnemonic, object output is ok. Test Plan: trivial test added Reviewers: nadav, dschuff, craig.topper Subscribers: llvm-commits, zinovy.nis Differential Revision: http://reviews.llvm.org/D5213 llvm-svn: 217435
Diffstat (limited to 'llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp')
-rw-r--r--llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp b/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
index d74a19e4dbc..b72730cef52 100644
--- a/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
+++ b/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
@@ -53,8 +53,19 @@ void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
if (TSFlags & X86II::LOCK)
OS << "\tlock\n";
+ // Output CALLpcrel32 as "callq" in 64-bit mode.
+ // In Intel annotation it's always emitted as "call".
+ //
+ // TODO: Probably this hack should be redesigned via InstAlias in
+ // InstrInfo.td as soon as Requires clause is supported properly
+ // for InstAlias.
+ if (MI->getOpcode() == X86::CALLpcrel32 &&
+ (getAvailableFeatures() & X86::Mode64Bit) != 0) {
+ OS << "\tcallq\t";
+ printPCRelImm(MI, 0, OS);
+ }
// Try to print any aliases first.
- if (!printAliasInstr(MI, OS))
+ else if (!printAliasInstr(MI, OS))
printInstruction(MI, OS);
// Next always print the annotation.
OpenPOWER on IntegriCloud