]> granicus.if.org Git - llvm/commitdiff
[X86] Enable printAliasInstr for the Intel assembly printer so that AAM and AAD will...
authorCraig Topper <craig.topper@intel.com>
Wed, 13 Mar 2019 00:43:03 +0000 (00:43 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 13 Mar 2019 00:43:03 +0000 (00:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355997 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
test/MC/X86/x86-32-coverage.s

index 9015aa14768c6ff07a2a1a7399b675610f53d444..6c597166dbf07db76b61f511ebf161d7358b0384 100644 (file)
@@ -28,6 +28,8 @@ using namespace llvm;
 
 #define DEBUG_TYPE "asm-printer"
 
+// Include the auto-generated portion of the assembly writer.
+#define PRINT_ALIAS_INSTR
 #include "X86GenAsmWriter1.inc"
 
 void X86IntelInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const {
@@ -43,7 +45,7 @@ void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS,
   if (MI->getOpcode() == X86::DATA16_PREFIX &&
       STI.getFeatureBits()[X86::Mode16Bit]) {
     OS << "\tdata32";
-  } else
+  } else if (!printAliasInstr(MI, OS))
     printInstruction(MI, OS);
 
   // Next always print the annotation.
index 5155dee178a7dec08eef49662d36335ffe58f885..67ea9b7fa97406b7a54a61a9a03b1e174994441a 100644 (file)
@@ -28,6 +28,12 @@ public:
   void printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot,
                  const MCSubtargetInfo &STI) override;
 
+  // Autogenerated by tblgen, returns true if we successfully printed an
+  // alias.
+  bool printAliasInstr(const MCInst *MI, raw_ostream &OS);
+  void printCustomAliasOperand(const MCInst *MI, unsigned OpIdx,
+                               unsigned PrintMethodIdx, raw_ostream &O);
+
   // Autogenerated by tblgen.
   void printInstruction(const MCInst *MI, raw_ostream &O);
   static const char *getRegisterName(unsigned RegNo);
index ba59fb357b9741b8a59dbe5883527d219af3902c..6b0da89b821e74e4145052a2ab3f92a236d8f499 100644 (file)
@@ -10808,3 +10808,11 @@ enclu
 // CHECK: enclv
 // CHECK: encoding: [0x0f,0x01,0xc0]
 enclv
+
+// CHECK: aam # encoding: [0xd4,0x0a]
+// INTEL: aam{{$}}
+aam $10
+
+// CHECK: aad # encoding: [0xd5,0x0a]
+// INTEL: aad{{$}}
+aad $10