mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
Try to factorize the specification of saturating add/subtract operations a bit,
as suggested by Bob Wilson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96153 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
590bfe8641
commit
2faf3919d4
@ -1360,76 +1360,61 @@ def : ARMPat<(add GPR:$src, so_imm_neg:$imm),
|
||||
|
||||
// Saturating adds/subtracts -- for disassembly only
|
||||
|
||||
class AQI<bits<8> op27_20, bits<4> op7_4, dag oops, dag iops, Format f,
|
||||
InstrItinClass itin, string opc, string asm, list<dag> pattern>
|
||||
: AI<oops, iops, f, itin, opc, asm, pattern> {
|
||||
// GPR:$dst = GPR:$a op GPR:$b
|
||||
class AQI<bits<8> op27_20, bits<4> op7_4, string opc, list<dag> pattern>
|
||||
: AI<(outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm, IIC_iALUr,
|
||||
opc, "\t$dst, $a, $b", pattern> {
|
||||
let Inst{27-20} = op27_20;
|
||||
let Inst{7-4} = op7_4;
|
||||
}
|
||||
|
||||
def QADD : AQI<0b00010000, 0b0101, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qadd", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QADD : AQI<0b00010000, 0b0101, "qadd",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QADD16 : AQI<0b01100010, 0b0001,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qadd16", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QADD16 : AQI<0b01100010, 0b0001, "qadd16",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QADD8 : AQI<0b01100010, 0b1001, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qadd8", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QADD8 : AQI<0b01100010, 0b1001, "qadd8",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QASX : AQI<0b01100010, 0b0011, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qasx", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QASX : AQI<0b01100010, 0b0011, "qasx",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QDADD : AQI<0b00010100, 0b0101,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qdadd", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QDADD : AQI<0b00010100, 0b0101, "qdadd",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QDSUB : AQI<0b00010110, 0b0101,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qdsub", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QDSUB : AQI<0b00010110, 0b0101, "qdsub",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QSAX : AQI<0b01100010, 0b0101, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qsax", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QSAX : AQI<0b01100010, 0b0101, "qsax",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QSUB : AQI<0b00010010, 0b0101, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qsub", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QSUB : AQI<0b00010010, 0b0101, "qsub",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QSUB16 : AQI<0b01100010, 0b0111,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qsub16", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QSUB16 : AQI<0b01100010, 0b0111, "qsub16",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def QSUB8 : AQI<0b01100010, 0b1111,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "qsub8", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def QSUB8 : AQI<0b01100010, 0b1111, "qsub8",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQADD16 : AQI<0b01100110, 0b0001,(outs GPR:$dst),(ins GPR:$a, GPR:$b),DPFrm,
|
||||
IIC_iALUr, "uqadd16", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQADD16 : AQI<0b01100110, 0b0001, "uqadd16",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQADD8 : AQI<0b01100110, 0b1001,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "uqadd8", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQADD8 : AQI<0b01100110, 0b1001, "uqadd8",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQASX : AQI<0b01100110, 0b0011, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "uqasx", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQASX : AQI<0b01100110, 0b0011, "uqasx",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQSAX : AQI<0b01100110, 0b0101, (outs GPR:$dst), (ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "uqsax", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQSAX : AQI<0b01100110, 0b0101, "uqsax",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQSUB16 : AQI<0b01100110, 0b0111,(outs GPR:$dst),(ins GPR:$a, GPR:$b),DPFrm,
|
||||
IIC_iALUr, "uqsub16", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQSUB16 : AQI<0b01100110, 0b0111, "uqsub16",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
def UQSUB8 : AQI<0b01100110, 0b1111,(outs GPR:$dst),(ins GPR:$a, GPR:$b), DPFrm,
|
||||
IIC_iALUr, "uqsub8", "\t$dst, $a, $b",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
def UQSUB8 : AQI<0b01100110, 0b1111, "uqsub8",
|
||||
[/* For disassembly only; pattern left blank */]>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Bitwise Instructions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user