Add disassembler support for long encodings for INC/DEC in 32-bit mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192086 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2013-10-07 04:28:06 +00:00
parent 6a971bb8f5
commit 36a9b31b98
4 changed files with 66 additions and 3 deletions

View File

@ -497,6 +497,21 @@ def DEC64_32r : I<0xFF, MRM1r, (outs GR32:$dst), (ins GR32:$src1),
Requires<[In64BitMode]>;
} // isConvertibleToThreeAddress = 1, CodeSize = 2
let isCodeGenOnly = 1, CodeSize = 2 in {
def INC32_16r : I<0xFF, MRM0r, (outs GR16:$dst), (ins GR16:$src1),
"inc{w}\t$dst", [], IIC_UNARY_REG>,
OpSize, Requires<[In32BitMode]>;
def INC32_32r : I<0xFF, MRM0r, (outs GR32:$dst), (ins GR32:$src1),
"inc{l}\t$dst", [], IIC_UNARY_REG>,
Requires<[In32BitMode]>;
def DEC32_16r : I<0xFF, MRM1r, (outs GR16:$dst), (ins GR16:$src1),
"dec{w}\t$dst", [], IIC_UNARY_REG>,
OpSize, Requires<[In32BitMode]>;
def DEC32_32r : I<0xFF, MRM1r, (outs GR32:$dst), (ins GR32:$src1),
"dec{l}\t$dst", [], IIC_UNARY_REG>,
Requires<[In32BitMode]>;
} // isCodeGenOnly = 1, CodeSize = 2
} // Constraints = "$src1 = $dst", SchedRW
let CodeSize = 2, SchedRW = [WriteALULd, WriteRMW] in {
@ -578,7 +593,6 @@ let CodeSize = 2, SchedRW = [WriteALULd, WriteRMW] in {
} // CodeSize = 2, SchedRW
} // Defs = [EFLAGS]
/// X86TypeInfo - This is a bunch of information that describes relevant X86
/// information about value types. For example, it can tell you what the
/// register class and preferred load to use.

View File

@ -666,3 +666,27 @@
# CHECK: movl %eax, 878082192
0xa3 0x90 0x78 0x56 0x34
# CHECK: incl %ecx
0xff 0xc1
# CHECK: decl %ecx
0xff 0xc9
# CHECK: incw %cx
0x66 0xff 0xc1
# CHECK: decw %cx
0x66 0xff 0xc9
# CHECK: incb %cl
0xfe 0xc1
# CHECK: decb %cl
0xfe 0xc9
# CHECK: incl %ecx
0x41
# CHECK: decl %ecx
0x49

View File

@ -198,4 +198,28 @@
0x0f 0x38 0xcd 0xd1
# CHECK: sha256msg2 (%rax), %xmm2
0x0f 0x38 0xcd 0x10
0x0f 0x38 0xcd 0x10
# CHECK: incl %ecx
0xff 0xc1
# CHECK: decl %ecx
0xff 0xc9
# CHECK: incw %cx
0x66 0xff 0xc1
# CHECK: decw %cx
0x66 0xff 0xc9
# CHECK: incb %cl
0xfe 0xc1
# CHECK: decb %cl
0xfe 0xc9
# CHECK: incq %rcx
0x48 0xff 0xc1
# CHECK: decq %rcx
0x48 0xff 0xc9

View File

@ -491,7 +491,8 @@ RecognizableInstr::filter_ret RecognizableInstr::filter() const {
assert(Rec->isSubClassOf("X86Inst") && "Can only filter X86 instructions");
if (Form == X86Local::Pseudo ||
(IsCodeGenOnly && Name.find("_REV") == Name.npos))
(IsCodeGenOnly && Name.find("_REV") == Name.npos &&
Name.find("INC32") == Name.npos && Name.find("DEC32") == Name.npos))
return FILTER_STRONG;