Insert dummy ED table entries for pseudo-instructions.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 10 Oct 2011 18:30:16 +0000 (18:30 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 10 Oct 2011 18:30:16 +0000 (18:30 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141562 91177308-0d34-0410-b5e6-96231b3b80d8

test/MC/Disassembler/X86/enhanced.txt
utils/TableGen/EDEmitter.cpp

index fc6949901b72168bf87f18b9fc829058c2ec67f8..752ab179af6693a2076dc3a9e717a5421a3d670a 100644 (file)
@@ -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
index fa7058c89738d5f614411727e98e85ed1d2a005e..6c048dae486dec3cc05282d825d875d03e21f66a 100644 (file)
@@ -802,14 +802,14 @@ static void populateInstInfo(CompoundConstantEmitter &infoArray,
   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);