mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 05:31:06 +00:00
Add more instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70717 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8639f5214
commit
0ba0a89c6b
@ -66,22 +66,56 @@ def MOV16ri : Pseudo<(outs GR16:$dst), (ins i16imm:$src),
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Arithmetic Instructions
|
// Arithmetic Instructions
|
||||||
|
|
||||||
let Defs = [SR] in {
|
let isTwoAddress = 1 in {
|
||||||
let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
|
|
||||||
|
|
||||||
|
let Defs = [SR] in {
|
||||||
|
|
||||||
|
let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
|
||||||
// FIXME: Provide proper encoding!
|
// FIXME: Provide proper encoding!
|
||||||
def ADD16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
def ADD16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
"add.w\t{$src2, $dst|$dst, $src2}",
|
"add.w\t{$src2, $dst|$dst, $src2}",
|
||||||
[(set GR16:$dst, (add GR16:$src1, GR16:$src2)),
|
[(set GR16:$dst, (add GR16:$src1, GR16:$src2)),
|
||||||
(implicit SR)]>;
|
(implicit SR)]>;
|
||||||
|
|
||||||
|
let Uses = [SR] in {
|
||||||
|
def ADC16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
|
"addc.w\t{$src2, $dst|$dst, $src2}",
|
||||||
|
[(set GR16:$dst, (adde GR16:$src1, GR16:$src2)),
|
||||||
|
(implicit SR)]>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let isCommutable = 1 in { // X = AND Y, Z == X = AND Z, Y
|
||||||
|
def AND16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
|
"and.w\t{$src2, $dst|$dst, $src2}",
|
||||||
|
[(set GR16:$dst, (and GR16:$src1, GR16:$src2)),
|
||||||
|
(implicit SR)]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
let isCommutable = 1 in { // X = AND Y, Z == X = AND Z, Y
|
||||||
|
def XOR16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
|
"xor.w\t{$src2, $dst|$dst, $src2}",
|
||||||
|
[(set GR16:$dst, (xor GR16:$src1, GR16:$src2)),
|
||||||
|
(implicit SR)]>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def SUB16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
|
"sub.w\t{$src2, $dst|$dst, $src2}",
|
||||||
|
[(set GR16:$dst, (sub GR16:$src1, GR16:$src2)),
|
||||||
|
(implicit SR)]>;
|
||||||
|
|
||||||
|
let Uses = [SR] in {
|
||||||
|
def SBC16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
||||||
|
"subc.w\t{$src2, $dst|$dst, $src2}",
|
||||||
|
[(set GR16:$dst, (sube GR16:$src1, GR16:$src2)),
|
||||||
|
(implicit SR)]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Provide proper encoding!
|
// FIXME: Provide proper encoding!
|
||||||
let isTwoAddress = 1 in {
|
|
||||||
def SAR16r1 : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
def SAR16r1 : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
||||||
"rra.w\t$dst",
|
"rra.w\t$dst",
|
||||||
[(set GR16:$dst, (MSP430rra GR16:$src)),
|
[(set GR16:$dst, (MSP430rra GR16:$src)),
|
||||||
(implicit SR)]>;
|
(implicit SR)]>;
|
||||||
}
|
|
||||||
|
|
||||||
} // Defs = [SR]
|
} // Defs = [SR]
|
||||||
|
} // isTwoAddress = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user