[llvm-commits] [llvm] r141562 - in /llvm/trunk: test/MC/Disassembler/X86/enhanced.txt utils/TableGen/EDEmitter.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Oct 10 11:30:16 PDT 2011


Author: stoklund
Date: Mon Oct 10 13:30:16 2011
New Revision: 141562

URL: http://llvm.org/viewvc/llvm-project?rev=141562&view=rev
Log:
Insert dummy ED table entries for pseudo-instructions.

The table is indexed by opcode, so simply removing pseudo-instructions
creates a wrong mapping from opcode to table entry.

Add a test case for xorps which has a very high opcode that exposes this
problem.

Modified:
    llvm/trunk/test/MC/Disassembler/X86/enhanced.txt
    llvm/trunk/utils/TableGen/EDEmitter.cpp

Modified: llvm/trunk/test/MC/Disassembler/X86/enhanced.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/X86/enhanced.txt?rev=141562&r1=141561&r2=141562&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/X86/enhanced.txt (original)
+++ llvm/trunk/test/MC/Disassembler/X86/enhanced.txt Mon Oct 10 13:30:16 2011
@@ -4,3 +4,7 @@
 0x0f 0x85 0xf6 0xff 0xff 0xff
 # CHECK: [o:movq][w:	][1-r:%gs=r63][1-p::][1-l:8=8][p:,][w: ][0-r:%rcx=r108] <mov> 0:[RCX/108]=0 1:[GS/63]=8
 0x65 0x48 0x8b 0x0c 0x25 0x08 0x00 0x00 0x00
+# CHECK: [o:xorps][w:	][2-r:%xmm1=r129][p:,][w: ][0-r:%xmm2=r130] 0:[XMM2/130]=0 1:[XMM2/130]=0 2:[XMM1/129]=0
+0x0f 0x57 0xd1
+# CHECK: [o:andps][w:	][2-r:%xmm1=r129][p:,][w: ][0-r:%xmm2=r130] 0:[XMM2/130]=0 1:[XMM2/130]=0 2:[XMM1/129]=0
+0x0f 0x54 0xd1

Modified: llvm/trunk/utils/TableGen/EDEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/EDEmitter.cpp?rev=141562&r1=141561&r2=141562&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/EDEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/EDEmitter.cpp Mon Oct 10 13:30:16 2011
@@ -802,14 +802,14 @@
   for (index = 0; index < numInstructions; ++index) {
     const CodeGenInstruction& inst = *numberedInstructions[index];
 
+    CompoundConstantEmitter *infoStruct = new CompoundConstantEmitter;
+    infoArray.addEntry(infoStruct);
+
     // We don't need to do anything for pseudo-instructions, as we'll never
     // see them here. We'll only see real instructions.
     if (inst.isPseudo)
       continue;
 
-    CompoundConstantEmitter *infoStruct = new CompoundConstantEmitter;
-    infoArray.addEntry(infoStruct);
-
     LiteralConstantEmitter *instType = new LiteralConstantEmitter;
     infoStruct->addEntry(instType);
 





More information about the llvm-commits mailing list