diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-10 18:30:16 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-10-10 18:30:16 +0000 |
commit | b253f490c3560c0b5e68b6af43c56c3ec377bf85 (patch) | |
tree | f49b34f0d30fc6bc0617ea1ea3c446528fb66bbf /llvm | |
parent | caf3390d449ccc4a2eb97958dd3d456d1ea4bf90 (diff) | |
download | bcm5719-llvm-b253f490c3560c0b5e68b6af43c56c3ec377bf85.tar.gz bcm5719-llvm-b253f490c3560c0b5e68b6af43c56c3ec377bf85.zip |
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.
llvm-svn: 141562
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/test/MC/Disassembler/X86/enhanced.txt | 4 | ||||
-rw-r--r-- | llvm/utils/TableGen/EDEmitter.cpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/llvm/test/MC/Disassembler/X86/enhanced.txt b/llvm/test/MC/Disassembler/X86/enhanced.txt index fc6949901b7..752ab179af6 100644 --- a/llvm/test/MC/Disassembler/X86/enhanced.txt +++ b/llvm/test/MC/Disassembler/X86/enhanced.txt @@ -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 diff --git a/llvm/utils/TableGen/EDEmitter.cpp b/llvm/utils/TableGen/EDEmitter.cpp index fa7058c8973..6c048dae486 100644 --- a/llvm/utils/TableGen/EDEmitter.cpp +++ b/llvm/utils/TableGen/EDEmitter.cpp @@ -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); |