X86Disassembler - fixed a bug in immediate print

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206953 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Elena Demikhovsky 2014-04-23 07:21:04 +00:00
parent 8c5b3146ed
commit 3890a42255
2 changed files with 5 additions and 1 deletions

View File

@ -319,7 +319,7 @@ static void translateImmediate(MCInst &mcInst, uint64_t immediate,
} }
// By default sign-extend all X86 immediates based on their encoding. // By default sign-extend all X86 immediates based on their encoding.
else if (type == TYPE_IMM8 || type == TYPE_IMM16 || type == TYPE_IMM32 || else if (type == TYPE_IMM8 || type == TYPE_IMM16 || type == TYPE_IMM32 ||
type == TYPE_IMM64) { type == TYPE_IMM64 || type == TYPE_IMMv) {
uint32_t Opcode = mcInst.getOpcode(); uint32_t Opcode = mcInst.getOpcode();
switch (operand.encoding) { switch (operand.encoding) {
default: default:

View File

@ -44,6 +44,10 @@
# CHECK-NEXT: nop # CHECK-NEXT: nop
0xf0 0x90 0xf0 0x90
# Test that immediate is printed correctly within opsize prefix
# CHECK: addw $-12, %ax
0x66,0x83,0xc0,0xf4
# Test that multiple redundant prefixes work (redundant, but valid x86). # Test that multiple redundant prefixes work (redundant, but valid x86).
# CHECK: rep # CHECK: rep
# CHECK-NEXT: rep # CHECK-NEXT: rep