Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 8ee1c1c

Browse files
committed
Post process ADC/SBB and use a shorter encoding if they use a sign extended immediate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177243 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 4bef961 commit 8ee1c1c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/Target/X86/AsmParser/X86AsmParser.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,6 +1801,12 @@ processInstruction(MCInst &Inst,
18011801
case X86::SUB16i16: return convert16i16to16ri8(Inst, X86::SUB16ri8);
18021802
case X86::SUB32i32: return convert32i32to32ri8(Inst, X86::SUB32ri8);
18031803
case X86::SUB64i32: return convert64i32to64ri8(Inst, X86::SUB64ri8);
1804+
case X86::ADC16i16: return convert16i16to16ri8(Inst, X86::ADC16ri8);
1805+
case X86::ADC32i32: return convert32i32to32ri8(Inst, X86::ADC32ri8);
1806+
case X86::ADC64i32: return convert64i32to64ri8(Inst, X86::ADC64ri8);
1807+
case X86::SBB16i16: return convert16i16to16ri8(Inst, X86::SBB16ri8);
1808+
case X86::SBB32i32: return convert32i32to32ri8(Inst, X86::SBB32ri8);
1809+
case X86::SBB64i32: return convert64i32to64ri8(Inst, X86::SBB64ri8);
18041810
}
18051811
}
18061812

test/MC/X86/intel-syntax-encoding.s

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@
3131
// CHECK: encoding: [0x48,0x83,0xc0,0xf4]
3232
add rax, -12
3333

34+
// CHECK: encoding: [0x66,0x83,0xd0,0xf4]
35+
adc ax, -12
36+
// CHECK: encoding: [0x83,0xd0,0xf4]
37+
adc eax, -12
38+
// CHECK: encoding: [0x48,0x83,0xd0,0xf4]
39+
adc rax, -12
40+
41+
// CHECK: encoding: [0x66,0x83,0xd8,0xf4]
42+
sbb ax, -12
43+
// CHECK: encoding: [0x83,0xd8,0xf4]
44+
sbb eax, -12
45+
// CHECK: encoding: [0x48,0x83,0xd8,0xf4]
46+
sbb rax, -12
47+
3448
// CHECK: encoding: [0x66,0x83,0xf8,0xf4]
3549
cmp ax, -12
3650
// CHECK: encoding: [0x83,0xf8,0xf4]

0 commit comments

Comments
 (0)