mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
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
This commit is contained in:
parent
4bef961baf
commit
8ee1c1cfaf
@ -1801,6 +1801,12 @@ processInstruction(MCInst &Inst,
|
||||
case X86::SUB16i16: return convert16i16to16ri8(Inst, X86::SUB16ri8);
|
||||
case X86::SUB32i32: return convert32i32to32ri8(Inst, X86::SUB32ri8);
|
||||
case X86::SUB64i32: return convert64i32to64ri8(Inst, X86::SUB64ri8);
|
||||
case X86::ADC16i16: return convert16i16to16ri8(Inst, X86::ADC16ri8);
|
||||
case X86::ADC32i32: return convert32i32to32ri8(Inst, X86::ADC32ri8);
|
||||
case X86::ADC64i32: return convert64i32to64ri8(Inst, X86::ADC64ri8);
|
||||
case X86::SBB16i16: return convert16i16to16ri8(Inst, X86::SBB16ri8);
|
||||
case X86::SBB32i32: return convert32i32to32ri8(Inst, X86::SBB32ri8);
|
||||
case X86::SBB64i32: return convert64i32to64ri8(Inst, X86::SBB64ri8);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,20 @@
|
||||
// CHECK: encoding: [0x48,0x83,0xc0,0xf4]
|
||||
add rax, -12
|
||||
|
||||
// CHECK: encoding: [0x66,0x83,0xd0,0xf4]
|
||||
adc ax, -12
|
||||
// CHECK: encoding: [0x83,0xd0,0xf4]
|
||||
adc eax, -12
|
||||
// CHECK: encoding: [0x48,0x83,0xd0,0xf4]
|
||||
adc rax, -12
|
||||
|
||||
// CHECK: encoding: [0x66,0x83,0xd8,0xf4]
|
||||
sbb ax, -12
|
||||
// CHECK: encoding: [0x83,0xd8,0xf4]
|
||||
sbb eax, -12
|
||||
// CHECK: encoding: [0x48,0x83,0xd8,0xf4]
|
||||
sbb rax, -12
|
||||
|
||||
// CHECK: encoding: [0x66,0x83,0xf8,0xf4]
|
||||
cmp ax, -12
|
||||
// CHECK: encoding: [0x83,0xf8,0xf4]
|
||||
|
Loading…
x
Reference in New Issue
Block a user