2009-05-03 12:57:15 +00:00
|
|
|
//===- MSP430InstrInfo.td - MSP430 Instruction defs -----------*- tblgen-*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file describes the MSP430 instructions in TableGen format.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
include "MSP430InstrFormats.td"
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Type Constraints.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
class SDTCisI8<int OpNum> : SDTCisVT<OpNum, i8>;
|
|
|
|
class SDTCisI16<int OpNum> : SDTCisVT<OpNum, i16>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Type Profiles.
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-05-03 13:07:54 +00:00
|
|
|
def SDT_MSP430Call : SDTypeProfile<0, -1, [SDTCisVT<0, iPTR>]>;
|
|
|
|
def SDT_MSP430CallSeqStart : SDCallSeqStart<[SDTCisVT<0, i16>]>;
|
|
|
|
def SDT_MSP430CallSeqEnd : SDCallSeqEnd<[SDTCisVT<0, i16>, SDTCisVT<1, i16>]>;
|
2009-05-03 13:08:33 +00:00
|
|
|
def SDT_MSP430Wrapper : SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>, SDTCisPtrTy<0>]>;
|
2009-05-03 13:12:06 +00:00
|
|
|
def SDT_MSP430Cmp : SDTypeProfile<0, 2, [SDTCisSameAs<0, 1>]>;
|
2009-05-03 13:19:09 +00:00
|
|
|
def SDT_MSP430BrCC : SDTypeProfile<0, 2, [SDTCisVT<0, OtherVT>,
|
|
|
|
SDTCisVT<1, i8>]>;
|
|
|
|
def SDT_MSP430SelectCC : SDTypeProfile<1, 3, [SDTCisSameAs<0, 1>, SDTCisSameAs<1, 2>,
|
|
|
|
SDTCisVT<3, i8>]>;
|
2009-05-03 12:57:15 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// MSP430 Specific Node Definitions.
|
|
|
|
//===----------------------------------------------------------------------===//
|
2009-05-03 13:03:33 +00:00
|
|
|
def MSP430retflag : SDNode<"MSP430ISD::RET_FLAG", SDTNone,
|
2009-05-03 12:59:50 +00:00
|
|
|
[SDNPHasChain, SDNPOptInFlag]>;
|
2009-05-03 12:57:15 +00:00
|
|
|
|
2009-05-03 13:03:33 +00:00
|
|
|
def MSP430rra : SDNode<"MSP430ISD::RRA", SDTIntUnaryOp, []>;
|
2009-05-03 13:13:17 +00:00
|
|
|
def MSP430rla : SDNode<"MSP430ISD::RLA", SDTIntUnaryOp, []>;
|
2009-05-03 13:16:37 +00:00
|
|
|
def MSP430rrc : SDNode<"MSP430ISD::RRC", SDTIntUnaryOp, []>;
|
2009-05-03 13:03:33 +00:00
|
|
|
|
2009-05-03 13:07:31 +00:00
|
|
|
def MSP430call : SDNode<"MSP430ISD::CALL", SDT_MSP430Call,
|
|
|
|
[SDNPHasChain, SDNPOutFlag, SDNPOptInFlag]>;
|
2009-05-03 13:07:54 +00:00
|
|
|
def MSP430callseq_start :
|
|
|
|
SDNode<"ISD::CALLSEQ_START", SDT_MSP430CallSeqStart,
|
|
|
|
[SDNPHasChain, SDNPOutFlag]>;
|
|
|
|
def MSP430callseq_end :
|
|
|
|
SDNode<"ISD::CALLSEQ_END", SDT_MSP430CallSeqEnd,
|
|
|
|
[SDNPHasChain, SDNPOptInFlag, SDNPOutFlag]>;
|
2009-05-03 13:12:06 +00:00
|
|
|
def MSP430Wrapper : SDNode<"MSP430ISD::Wrapper", SDT_MSP430Wrapper>;
|
2009-05-03 13:19:09 +00:00
|
|
|
def MSP430cmp : SDNode<"MSP430ISD::CMP", SDT_MSP430Cmp, [SDNPOutFlag]>;
|
|
|
|
def MSP430brcc : SDNode<"MSP430ISD::BR_CC", SDT_MSP430BrCC, [SDNPHasChain, SDNPInFlag]>;
|
|
|
|
def MSP430selectcc: SDNode<"MSP430ISD::SELECT_CC", SDT_MSP430SelectCC, [SDNPInFlag]>;
|
2009-05-03 13:07:31 +00:00
|
|
|
|
2009-05-03 12:57:15 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2009-05-03 13:06:03 +00:00
|
|
|
// MSP430 Operand Definitions.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-05-03 13:06:26 +00:00
|
|
|
// Address operands
|
2009-05-03 13:06:03 +00:00
|
|
|
def memsrc : Operand<i16> {
|
|
|
|
let PrintMethod = "printSrcMemOperand";
|
2009-05-03 13:09:40 +00:00
|
|
|
let MIOperandInfo = (ops GR16, i16imm);
|
2009-05-03 13:06:03 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:06:26 +00:00
|
|
|
def memdst : Operand<i16> {
|
|
|
|
let PrintMethod = "printSrcMemOperand";
|
2009-05-03 13:09:40 +00:00
|
|
|
let MIOperandInfo = (ops GR16, i16imm);
|
2009-05-03 13:06:26 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:12:06 +00:00
|
|
|
// Branch targets have OtherVT type.
|
|
|
|
def brtarget : Operand<OtherVT>;
|
|
|
|
|
2009-05-03 13:12:23 +00:00
|
|
|
// Operand for printing out a condition code.
|
|
|
|
def cc : Operand<i8> {
|
|
|
|
let PrintMethod = "printCCOperand";
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:06:03 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// MSP430 Complex Pattern Definitions.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
def addr : ComplexPattern<iPTR, 2, "SelectAddr", [], []>;
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Pattern Fragments
|
|
|
|
def zextloadi16i8 : PatFrag<(ops node:$ptr), (i16 (zextloadi8 node:$ptr))>;
|
|
|
|
def extloadi16i8 : PatFrag<(ops node:$ptr), (i16 ( extloadi8 node:$ptr))>;
|
|
|
|
|
2009-05-03 12:57:15 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2009-05-03 13:07:54 +00:00
|
|
|
// Instruction list..
|
|
|
|
|
|
|
|
// ADJCALLSTACKDOWN/UP implicitly use/def SP because they may be expanded into
|
|
|
|
// a stack adjustment and the codegen must know that they may modify the stack
|
|
|
|
// pointer before prolog-epilog rewriting occurs.
|
|
|
|
// Pessimistically assume ADJCALLSTACKDOWN / ADJCALLSTACKUP will become
|
|
|
|
// sub / add which can clobber SRW.
|
|
|
|
let Defs = [SPW, SRW], Uses = [SPW] in {
|
|
|
|
def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i16imm:$amt),
|
|
|
|
"#ADJCALLSTACKDOWN",
|
|
|
|
[(MSP430callseq_start timm:$amt)]>;
|
|
|
|
def ADJCALLSTACKUP : Pseudo<(outs), (ins i16imm:$amt1, i16imm:$amt2),
|
|
|
|
"#ADJCALLSTACKUP",
|
|
|
|
[(MSP430callseq_end timm:$amt1, timm:$amt2)]>;
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:12:23 +00:00
|
|
|
let usesCustomDAGSchedInserter = 1 in {
|
2009-05-08 18:50:26 +00:00
|
|
|
def Select8 : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2, i8imm:$cc),
|
|
|
|
"# Select8 PSEUDO",
|
|
|
|
[(set GR8:$dst,
|
|
|
|
(MSP430selectcc GR8:$src1, GR8:$src2, imm:$cc))]>;
|
2009-05-03 13:12:23 +00:00
|
|
|
def Select16 : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2, i8imm:$cc),
|
|
|
|
"# Select16 PSEUDO",
|
|
|
|
[(set GR16:$dst,
|
2009-05-03 13:19:09 +00:00
|
|
|
(MSP430selectcc GR16:$src1, GR16:$src2, imm:$cc))]>;
|
2009-05-03 13:12:23 +00:00
|
|
|
}
|
2009-05-03 12:57:15 +00:00
|
|
|
|
2009-05-03 13:04:23 +00:00
|
|
|
let neverHasSideEffects = 1 in
|
2009-05-03 12:57:15 +00:00
|
|
|
def NOP : Pseudo<(outs), (ins), "nop", []>;
|
2009-05-03 12:59:50 +00:00
|
|
|
|
2009-05-03 13:12:06 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Control Flow Instructions...
|
|
|
|
//
|
|
|
|
|
2009-05-03 12:59:50 +00:00
|
|
|
// FIXME: Provide proper encoding!
|
|
|
|
let isReturn = 1, isTerminator = 1 in {
|
2009-05-03 13:07:54 +00:00
|
|
|
def RET : Pseudo<(outs), (ins), "ret", [(MSP430retflag)]>;
|
2009-05-03 13:02:04 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:12:58 +00:00
|
|
|
let isBranch = 1, isTerminator = 1 in {
|
|
|
|
|
|
|
|
// Direct branch
|
|
|
|
let isBarrier = 1 in
|
|
|
|
def JMP : Pseudo<(outs), (ins brtarget:$dst),
|
|
|
|
"jmp\t$dst",
|
|
|
|
[(br bb:$dst)]>;
|
|
|
|
|
2009-05-03 13:12:06 +00:00
|
|
|
// Conditional branches
|
2009-05-03 13:12:58 +00:00
|
|
|
let Uses = [SRW] in
|
|
|
|
def JCC : Pseudo<(outs), (ins brtarget:$dst, cc:$cc),
|
|
|
|
"j$cc $dst",
|
2009-05-03 13:19:09 +00:00
|
|
|
[(MSP430brcc bb:$dst, imm:$cc)]>;
|
2009-05-03 13:12:58 +00:00
|
|
|
} // isBranch, isTerminator
|
2009-05-03 13:12:06 +00:00
|
|
|
|
2009-05-03 13:07:54 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Call Instructions...
|
|
|
|
//
|
|
|
|
let isCall = 1 in
|
|
|
|
// All calls clobber the non-callee saved registers. SPW is marked as
|
|
|
|
// a use to prevent stack-pointer assignments that appear immediately
|
|
|
|
// before calls from potentially appearing dead. Uses for argument
|
|
|
|
// registers are added manually.
|
|
|
|
let Defs = [R12W, R13W, R14W, R15W, SRW],
|
|
|
|
Uses = [SPW] in {
|
2009-05-03 13:08:13 +00:00
|
|
|
def CALLi : Pseudo<(outs), (ins i16imm:$dst, variable_ops),
|
|
|
|
"call\t${dst:call}", [(MSP430call imm:$dst)]>;
|
|
|
|
def CALLr : Pseudo<(outs), (ins GR16:$dst, variable_ops),
|
|
|
|
"call\t$dst", [(MSP430call GR16:$dst)]>;
|
|
|
|
def CALLm : Pseudo<(outs), (ins memsrc:$dst, variable_ops),
|
|
|
|
"call\t${dst:mem}", [(MSP430call (load addr:$dst))]>;
|
2009-05-03 13:07:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-05-03 13:11:04 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Miscellaneous Instructions...
|
|
|
|
//
|
|
|
|
let Defs = [SPW], Uses = [SPW], neverHasSideEffects=1 in {
|
|
|
|
let mayLoad = 1 in
|
|
|
|
def POP16r : Pseudo<(outs GR16:$reg), (ins), "pop.w\t$reg", []>;
|
|
|
|
|
|
|
|
let mayStore = 1 in
|
|
|
|
def PUSH16r : Pseudo<(outs), (ins GR16:$reg), "push.w\t$reg",[]>;
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:02:04 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Move Instructions
|
|
|
|
|
|
|
|
// FIXME: Provide proper encoding!
|
|
|
|
let neverHasSideEffects = 1 in {
|
2009-05-03 13:05:42 +00:00
|
|
|
def MOV8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[]>;
|
2009-05-03 13:06:03 +00:00
|
|
|
def MOV16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.w\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[]>;
|
2009-05-03 13:02:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: Provide proper encoding!
|
|
|
|
let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
|
2009-05-03 13:05:42 +00:00
|
|
|
def MOV8ri : Pseudo<(outs GR8:$dst), (ins i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, imm:$src)]>;
|
2009-05-03 13:06:03 +00:00
|
|
|
def MOV16ri : Pseudo<(outs GR16:$dst), (ins i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.w\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[(set GR16:$dst, imm:$src)]>;
|
|
|
|
}
|
2009-05-03 13:05:42 +00:00
|
|
|
|
2009-05-03 13:06:03 +00:00
|
|
|
let canFoldAsLoad = 1, isReMaterializable = 1, mayHaveSideEffects = 1 in {
|
|
|
|
def MOV8rm : Pseudo<(outs GR8:$dst), (ins memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[(set GR8:$dst, (load addr:$src))]>;
|
|
|
|
def MOV16rm : Pseudo<(outs GR16:$dst), (ins memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.w\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[(set GR16:$dst, (load addr:$src))]>;
|
2009-05-03 12:59:50 +00:00
|
|
|
}
|
2009-05-03 13:02:39 +00:00
|
|
|
|
2009-05-03 13:06:03 +00:00
|
|
|
def MOVZX16rr8 : Pseudo<(outs GR16:$dst), (ins GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[(set GR16:$dst, (zext GR8:$src))]>;
|
|
|
|
def MOVZX16rm8 : Pseudo<(outs GR16:$dst), (ins memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:06:03 +00:00
|
|
|
[(set GR16:$dst, (zextloadi16i8 addr:$src))]>;
|
|
|
|
|
2009-05-03 15:50:18 +00:00
|
|
|
// Any instruction that defines a 8-bit result leaves the high half of the
|
|
|
|
// register. Truncate can be lowered to EXTRACT_SUBREG, and CopyFromReg may
|
|
|
|
// be copying from a truncate, but any other 8-bit operation will zero-extend
|
|
|
|
// up to 16 bits.
|
|
|
|
def def8 : PatLeaf<(i8 GR8:$src), [{
|
|
|
|
return N->getOpcode() != ISD::TRUNCATE &&
|
|
|
|
N->getOpcode() != TargetInstrInfo::EXTRACT_SUBREG &&
|
|
|
|
N->getOpcode() != ISD::CopyFromReg;
|
|
|
|
}]>;
|
|
|
|
|
|
|
|
// In the case of a 8-bit def that is known to implicitly zero-extend,
|
|
|
|
// we can use a SUBREG_TO_REG.
|
|
|
|
def : Pat<(i16 (zext def8:$src)),
|
|
|
|
(SUBREG_TO_REG (i16 0), GR8:$src, subreg_8bit)>;
|
|
|
|
|
|
|
|
|
2009-05-03 13:06:26 +00:00
|
|
|
def MOV8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:06:26 +00:00
|
|
|
[(store (i8 imm:$src), addr:$dst)]>;
|
|
|
|
def MOV16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.w\t{$src, $dst}",
|
2009-05-03 13:06:26 +00:00
|
|
|
[(store (i16 imm:$src), addr:$dst)]>;
|
|
|
|
|
|
|
|
def MOV8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.b\t{$src, $dst}",
|
2009-05-03 13:06:26 +00:00
|
|
|
[(store GR8:$src, addr:$dst)]>;
|
|
|
|
def MOV16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"mov.w\t{$src, $dst}",
|
2009-05-03 13:06:26 +00:00
|
|
|
[(store GR16:$src, addr:$dst)]>;
|
|
|
|
|
2009-05-03 13:02:39 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Arithmetic Instructions
|
|
|
|
|
2009-05-03 13:04:06 +00:00
|
|
|
let isTwoAddress = 1 in {
|
|
|
|
|
2009-05-03 13:05:22 +00:00
|
|
|
let Defs = [SRW] in {
|
2009-05-03 13:02:39 +00:00
|
|
|
|
2009-05-03 13:04:06 +00:00
|
|
|
let isCommutable = 1 in { // X = ADD Y, Z == X = ADD Z, Y
|
2009-05-03 13:02:39 +00:00
|
|
|
// FIXME: Provide proper encoding!
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADD8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (add GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:02:39 +00:00
|
|
|
def ADD16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src2, $dst}",
|
2009-05-03 13:02:39 +00:00
|
|
|
[(set GR16:$dst, (add GR16:$src1, GR16:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
}
|
2009-05-03 13:05:42 +00:00
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADD8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (add GR8:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADD16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (add GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
2009-05-03 13:05:42 +00:00
|
|
|
def ADD8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (add GR8:$src1, imm:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADD16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (add GR16:$src1, imm:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def ADD8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADD16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def ADD8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADD16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def ADD8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADD16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"add.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (add (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:05:22 +00:00
|
|
|
let Uses = [SRW] in {
|
2009-05-03 13:04:41 +00:00
|
|
|
|
|
|
|
let isCommutable = 1 in { // X = ADDC Y, Z == X = ADDC Z, Y
|
2009-05-03 13:05:42 +00:00
|
|
|
def ADC8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (adde GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADC16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (adde GR16:$src1, GR16:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
} // isCommutable
|
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def ADC8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (adde GR8:$src1, imm:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
def ADC16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src2, $dst}",
|
2009-05-03 13:04:41 +00:00
|
|
|
[(set GR16:$dst, (adde GR16:$src1, imm:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def ADC8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (adde GR8:$src1, (load addr:$src2))),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADC16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (adde GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:07:10 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def ADC8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADC16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def ADC8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADC16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def ADC8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def ADC16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"addc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (adde (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
} // Uses = [SRW]
|
|
|
|
|
2009-05-03 13:04:06 +00:00
|
|
|
let isCommutable = 1 in { // X = AND Y, Z == X = AND Z, Y
|
2009-05-03 13:05:42 +00:00
|
|
|
def AND8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (and GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def AND16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (and GR16:$src1, GR16:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def AND8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (and GR8:$src1, imm:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
def AND16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src2, $dst}",
|
2009-05-03 13:04:41 +00:00
|
|
|
[(set GR16:$dst, (and GR16:$src1, imm:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def AND8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (and GR8:$src1, (load addr:$src2))),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def AND16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (and GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def AND8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def AND16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def AND8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def AND16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def AND8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def AND16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"and.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (and (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-05-03 13:04:41 +00:00
|
|
|
let isCommutable = 1 in { // X = XOR Y, Z == X = XOR Z, Y
|
2009-05-03 13:05:42 +00:00
|
|
|
def XOR8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (xor GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def XOR16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (xor GR16:$src1, GR16:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def XOR8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (xor GR8:$src1, imm:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
def XOR16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src2, $dst}",
|
2009-05-03 13:04:41 +00:00
|
|
|
[(set GR16:$dst, (xor GR16:$src1, imm:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def XOR8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (xor GR8:$src1, (load addr:$src2))),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def XOR16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (xor GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def XOR8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def XOR16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def XOR8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def XOR16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def XOR8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def XOR16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"xor.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (xor (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def SUB8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sub GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
def SUB16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src2, $dst}",
|
2009-05-03 13:04:06 +00:00
|
|
|
[(set GR16:$dst, (sub GR16:$src1, GR16:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def SUB8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sub GR8:$src1, imm:$src2)),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
def SUB16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src2, $dst}",
|
2009-05-03 13:04:41 +00:00
|
|
|
[(set GR16:$dst, (sub GR16:$src1, imm:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def SUB8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sub GR8:$src1, (load addr:$src2))),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SUB16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (sub GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def SUB8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SUB16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def SUB8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SUB16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def SUB8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SUB16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"sub.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sub (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:05:22 +00:00
|
|
|
let Uses = [SRW] in {
|
2009-05-03 13:06:46 +00:00
|
|
|
def SBC8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sube GR8:$src1, GR8:$src2)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:06 +00:00
|
|
|
def SBC16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src2, $dst}",
|
2009-05-03 13:04:06 +00:00
|
|
|
[(set GR16:$dst, (sube GR16:$src1, GR16:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def SBC8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sube GR8:$src1, imm:$src2)),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:04:41 +00:00
|
|
|
def SBC16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src2, $dst}",
|
2009-05-03 13:04:41 +00:00
|
|
|
[(set GR16:$dst, (sube GR16:$src1, imm:$src2)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
|
|
|
|
def SBC8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (sube GR8:$src1, (load addr:$src2))),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SBC16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (sube GR16:$src1, (load addr:$src2))),
|
2009-05-03 13:05:42 +00:00
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:07:10 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def SBC8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SBC16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def SBC8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SBC16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def SBC8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def SBC16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"subc.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (sube (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:02:39 +00:00
|
|
|
}
|
2009-05-03 13:03:33 +00:00
|
|
|
|
2009-05-03 13:07:10 +00:00
|
|
|
} // Uses = [SRW]
|
|
|
|
|
2009-05-03 13:03:33 +00:00
|
|
|
// FIXME: Provide proper encoding!
|
2009-05-03 13:16:37 +00:00
|
|
|
def SAR8r1 : Pseudo<(outs GR8:$dst), (ins GR8:$src),
|
|
|
|
"rra.b\t$dst",
|
|
|
|
[(set GR8:$dst, (MSP430rra GR8:$src)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:03:33 +00:00
|
|
|
def SAR16r1 : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
|
|
|
"rra.w\t$dst",
|
|
|
|
[(set GR16:$dst, (MSP430rra GR16:$src)),
|
2009-05-03 13:05:22 +00:00
|
|
|
(implicit SRW)]>;
|
|
|
|
|
2009-05-03 13:16:37 +00:00
|
|
|
def SHL8r1 : Pseudo<(outs GR8:$dst), (ins GR8:$src),
|
|
|
|
"rla.b\t$dst",
|
|
|
|
[(set GR8:$dst, (MSP430rla GR8:$src)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:13:17 +00:00
|
|
|
def SHL16r1 : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
|
|
|
"rla.w\t$dst",
|
|
|
|
[(set GR16:$dst, (MSP430rla GR16:$src)),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
2009-05-03 13:16:37 +00:00
|
|
|
def SAR8r1c : Pseudo<(outs GR8:$dst), (ins GR8:$src),
|
2009-05-17 10:15:22 +00:00
|
|
|
"clrc\n\t"
|
2009-05-03 13:16:37 +00:00
|
|
|
"rrc.b\t$dst",
|
|
|
|
[(set GR8:$dst, (MSP430rrc GR8:$src)),
|
|
|
|
(implicit SRW)]>;
|
2009-05-03 13:16:17 +00:00
|
|
|
def SAR16r1c : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
2009-05-17 10:15:22 +00:00
|
|
|
"clrc\n\t"
|
2009-05-03 13:16:17 +00:00
|
|
|
"rrc.w\t$dst",
|
|
|
|
[(set GR16:$dst, (MSP430rrc GR16:$src)),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
2009-05-03 13:05:22 +00:00
|
|
|
def SEXT16r : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
|
|
|
"sxt\t$dst",
|
|
|
|
[(set GR16:$dst, (sext_inreg GR16:$src, i8)),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
} // Defs = [SRW]
|
2009-05-03 13:05:00 +00:00
|
|
|
|
2009-05-03 13:15:03 +00:00
|
|
|
def SWPB16r : Pseudo<(outs GR16:$dst), (ins GR16:$src),
|
|
|
|
"swpb\t$dst",
|
|
|
|
[(set GR16:$dst, (bswap GR16:$src))]>;
|
|
|
|
|
2009-05-03 13:05:00 +00:00
|
|
|
let isCommutable = 1 in { // X = OR Y, Z == X = OR Z, Y
|
2009-05-03 13:05:42 +00:00
|
|
|
def OR8rr : Pseudo<(outs GR8:$dst), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (or GR8:$src1, GR8:$src2))]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def OR16rr : Pseudo<(outs GR16:$dst), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (or GR16:$src1, GR16:$src2))]>;
|
2009-05-03 13:05:00 +00:00
|
|
|
}
|
|
|
|
|
2009-05-03 13:05:42 +00:00
|
|
|
def OR8ri : Pseudo<(outs GR8:$dst), (ins GR8:$src1, i8imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src2, $dst}",
|
2009-05-03 13:05:42 +00:00
|
|
|
[(set GR8:$dst, (or GR8:$src1, imm:$src2))]>;
|
2009-05-03 13:06:46 +00:00
|
|
|
def OR16ri : Pseudo<(outs GR16:$dst), (ins GR16:$src1, i16imm:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (or GR16:$src1, imm:$src2))]>;
|
2009-05-03 13:05:00 +00:00
|
|
|
|
2009-05-03 13:06:46 +00:00
|
|
|
def OR8rm : Pseudo<(outs GR8:$dst), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR8:$dst, (or GR8:$src1, (load addr:$src2)))]>;
|
|
|
|
def OR16rm : Pseudo<(outs GR16:$dst), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src2, $dst}",
|
2009-05-03 13:06:46 +00:00
|
|
|
[(set GR16:$dst, (or GR16:$src1, (load addr:$src2)))]>;
|
2009-05-03 13:07:10 +00:00
|
|
|
|
|
|
|
let isTwoAddress = 0 in {
|
|
|
|
def OR8mr : Pseudo<(outs), (ins memdst:$dst, GR8:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def OR16mr : Pseudo<(outs), (ins memdst:$dst, GR16:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def OR8mi : Pseudo<(outs), (ins memdst:$dst, i8imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), (i8 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def OR16mi : Pseudo<(outs), (ins memdst:$dst, i16imm:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), (i16 imm:$src)), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
|
|
|
|
def OR8mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.b\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
def OR16mm : Pseudo<(outs), (ins memdst:$dst, memsrc:$src),
|
2009-05-03 13:12:37 +00:00
|
|
|
"bis.w\t{$src, $dst}",
|
2009-05-03 13:07:10 +00:00
|
|
|
[(store (or (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(implicit SRW)]>;
|
|
|
|
}
|
|
|
|
|
2009-05-03 13:04:06 +00:00
|
|
|
} // isTwoAddress = 1
|
2009-05-03 13:06:03 +00:00
|
|
|
|
2009-05-03 13:12:06 +00:00
|
|
|
// Integer comparisons
|
|
|
|
let Defs = [SRW] in {
|
|
|
|
def CMP8rr : Pseudo<(outs), (ins GR8:$src1, GR8:$src2),
|
2009-05-03 13:12:23 +00:00
|
|
|
"cmp.b\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp GR8:$src1, GR8:$src2), (implicit SRW)]>;
|
|
|
|
def CMP16rr : Pseudo<(outs), (ins GR16:$src1, GR16:$src2),
|
2009-05-03 13:12:23 +00:00
|
|
|
"cmp.w\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp GR16:$src1, GR16:$src2), (implicit SRW)]>;
|
|
|
|
|
2009-05-10 14:49:00 +00:00
|
|
|
def CMP8ir : Pseudo<(outs), (ins i8imm:$src1, GR8:$src2),
|
|
|
|
"cmp.b\t{$src1, $src2}",
|
|
|
|
[(MSP430cmp imm:$src1, GR8:$src2), (implicit SRW)]>;
|
|
|
|
def CMP16ir : Pseudo<(outs), (ins i16imm:$src1, GR16:$src2),
|
|
|
|
"cmp.w\t{$src1, $src2}",
|
|
|
|
[(MSP430cmp imm:$src1, GR16:$src2), (implicit SRW)]>;
|
|
|
|
|
|
|
|
def CMP8im : Pseudo<(outs), (ins i8imm:$src1, memsrc:$src2),
|
|
|
|
"cmp.b\t{$src1, $src2}",
|
|
|
|
[(MSP430cmp (i8 imm:$src1), (load addr:$src2)), (implicit SRW)]>;
|
|
|
|
def CMP16im : Pseudo<(outs), (ins i16imm:$src1, memsrc:$src2),
|
|
|
|
"cmp.w\t{$src1, $src2}",
|
|
|
|
[(MSP430cmp (i16 imm:$src1), (load addr:$src2)), (implicit SRW)]>;
|
|
|
|
|
2009-05-03 13:12:06 +00:00
|
|
|
def CMP8rm : Pseudo<(outs), (ins GR8:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"cmp.b\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp GR8:$src1, (load addr:$src2)), (implicit SRW)]>;
|
|
|
|
def CMP16rm : Pseudo<(outs), (ins GR16:$src1, memsrc:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"cmp.w\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp GR16:$src1, (load addr:$src2)), (implicit SRW)]>;
|
|
|
|
|
|
|
|
def CMP8mr : Pseudo<(outs), (ins memsrc:$src1, GR8:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"cmp.b\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp (load addr:$src1), GR8:$src2), (implicit SRW)]>;
|
|
|
|
def CMP16mr : Pseudo<(outs), (ins memsrc:$src1, GR16:$src2),
|
2009-05-03 13:12:37 +00:00
|
|
|
"cmp.w\t{$src1, $src2}",
|
2009-05-03 13:12:06 +00:00
|
|
|
[(MSP430cmp (load addr:$src1), GR16:$src2), (implicit SRW)]>;
|
|
|
|
|
2009-05-03 13:18:50 +00:00
|
|
|
def CMP8mi0 : Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.b\t{$src1, #0}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i8 0)), (implicit SRW)]>;
|
|
|
|
def CMP16mi0: Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.w\t{$src1, #0}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i16 0)), (implicit SRW)]>;
|
|
|
|
def CMP8mi1 : Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.b\t{$src1, #1}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i8 1)), (implicit SRW)]>;
|
|
|
|
def CMP16mi1: Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.w\t{$src1, #1}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i16 1)), (implicit SRW)]>;
|
|
|
|
def CMP8mi2 : Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.b\t{$src1, #2}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i8 2)), (implicit SRW)]>;
|
|
|
|
def CMP16mi2: Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.w\t{$src1, #2}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i16 2)), (implicit SRW)]>;
|
|
|
|
def CMP8mi4 : Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.b\t{$src1, #4}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i8 4)), (implicit SRW)]>;
|
|
|
|
def CMP16mi4: Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.w\t{$src1, #4}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i16 4)), (implicit SRW)]>;
|
|
|
|
def CMP8mi8 : Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.b\t{$src1, #8}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i8 8)), (implicit SRW)]>;
|
|
|
|
def CMP16mi8: Pseudo<(outs), (ins memsrc:$src1),
|
|
|
|
"cmp.w\t{$src1, #8}",
|
|
|
|
[(MSP430cmp (load addr:$src1), (i16 8)), (implicit SRW)]>;
|
2009-05-03 13:12:06 +00:00
|
|
|
|
|
|
|
} // Defs = [SRW]
|
|
|
|
|
2009-05-03 13:06:03 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Non-Instruction Patterns
|
|
|
|
|
|
|
|
// extload
|
|
|
|
def : Pat<(extloadi16i8 addr:$src), (MOVZX16rm8 addr:$src)>;
|
2009-05-03 13:06:26 +00:00
|
|
|
|
2009-05-03 13:15:57 +00:00
|
|
|
// anyext
|
|
|
|
def : Pat<(anyext addr:$src), (MOVZX16rr8 GR8:$src)>;
|
|
|
|
|
2009-05-03 13:06:26 +00:00
|
|
|
// truncs
|
|
|
|
def : Pat<(i8 (trunc GR16:$src)),
|
|
|
|
(EXTRACT_SUBREG GR16:$src, subreg_8bit)>;
|
2009-05-03 13:08:13 +00:00
|
|
|
|
2009-05-03 13:14:46 +00:00
|
|
|
// GlobalAddress, ExternalSymbol
|
2009-05-03 13:10:26 +00:00
|
|
|
def : Pat<(i16 (MSP430Wrapper tglobaladdr:$dst)), (MOV16ri tglobaladdr:$dst)>;
|
2009-05-03 13:14:46 +00:00
|
|
|
def : Pat<(i16 (MSP430Wrapper texternalsym:$dst)), (MOV16ri texternalsym:$dst)>;
|
2009-05-03 13:08:33 +00:00
|
|
|
|
|
|
|
def : Pat<(add GR16:$src1, (MSP430Wrapper tglobaladdr :$src2)),
|
|
|
|
(ADD16ri GR16:$src1, tglobaladdr:$src2)>;
|
2009-05-03 13:14:46 +00:00
|
|
|
def : Pat<(add GR16:$src1, (MSP430Wrapper texternalsym:$src2)),
|
|
|
|
(ADD16ri GR16:$src1, texternalsym:$src2)>;
|
|
|
|
|
|
|
|
def : Pat<(store (i16 (MSP430Wrapper tglobaladdr:$src)), addr:$dst),
|
|
|
|
(MOV16mi addr:$dst, tglobaladdr:$src)>;
|
|
|
|
def : Pat<(store (i16 (MSP430Wrapper texternalsym:$src)), addr:$dst),
|
|
|
|
(MOV16mi addr:$dst, texternalsym:$src)>;
|
2009-05-03 13:08:33 +00:00
|
|
|
|
2009-05-03 13:08:13 +00:00
|
|
|
// calls
|
|
|
|
def : Pat<(MSP430call (i16 tglobaladdr:$dst)),
|
|
|
|
(CALLi tglobaladdr:$dst)>;
|
2009-05-03 13:14:46 +00:00
|
|
|
def : Pat<(MSP430call (i16 texternalsym:$dst)),
|
|
|
|
(CALLi texternalsym:$dst)>;
|
2009-05-03 13:13:34 +00:00
|
|
|
|
|
|
|
// add and sub always produce carry
|
|
|
|
def : Pat<(addc GR16:$src1, GR16:$src2),
|
|
|
|
(ADD16rr GR16:$src1, GR16:$src2)>;
|
|
|
|
def : Pat<(addc GR16:$src1, (load addr:$src2)),
|
|
|
|
(ADD16rm GR16:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(addc GR16:$src1, imm:$src2),
|
|
|
|
(ADD16ri GR16:$src1, imm:$src2)>;
|
|
|
|
def : Pat<(store (addc (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(ADD16mr addr:$dst, GR16:$src)>;
|
|
|
|
def : Pat<(store (addc (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(ADD16mm addr:$dst, addr:$src)>;
|
|
|
|
|
|
|
|
def : Pat<(addc GR8:$src1, GR8:$src2),
|
|
|
|
(ADD8rr GR8:$src1, GR8:$src2)>;
|
|
|
|
def : Pat<(addc GR8:$src1, (load addr:$src2)),
|
|
|
|
(ADD8rm GR8:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(addc GR8:$src1, imm:$src2),
|
|
|
|
(ADD8ri GR8:$src1, imm:$src2)>;
|
|
|
|
def : Pat<(store (addc (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(ADD8mr addr:$dst, GR8:$src)>;
|
|
|
|
def : Pat<(store (addc (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(ADD8mm addr:$dst, addr:$src)>;
|
|
|
|
|
|
|
|
def : Pat<(subc GR16:$src1, GR16:$src2),
|
|
|
|
(SUB16rr GR16:$src1, GR16:$src2)>;
|
|
|
|
def : Pat<(subc GR16:$src1, (load addr:$src2)),
|
|
|
|
(SUB16rm GR16:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(subc GR16:$src1, imm:$src2),
|
|
|
|
(SUB16ri GR16:$src1, imm:$src2)>;
|
|
|
|
def : Pat<(store (subc (load addr:$dst), GR16:$src), addr:$dst),
|
|
|
|
(SUB16mr addr:$dst, GR16:$src)>;
|
|
|
|
def : Pat<(store (subc (load addr:$dst), (i16 (load addr:$src))), addr:$dst),
|
|
|
|
(SUB16mm addr:$dst, addr:$src)>;
|
|
|
|
|
|
|
|
def : Pat<(subc GR8:$src1, GR8:$src2),
|
|
|
|
(SUB8rr GR8:$src1, GR8:$src2)>;
|
|
|
|
def : Pat<(subc GR8:$src1, (load addr:$src2)),
|
|
|
|
(SUB8rm GR8:$src1, addr:$src2)>;
|
|
|
|
def : Pat<(subc GR8:$src1, imm:$src2),
|
|
|
|
(SUB8ri GR8:$src1, imm:$src2)>;
|
|
|
|
def : Pat<(store (subc (load addr:$dst), GR8:$src), addr:$dst),
|
|
|
|
(SUB8mr addr:$dst, GR8:$src)>;
|
|
|
|
def : Pat<(store (subc (load addr:$dst), (i8 (load addr:$src))), addr:$dst),
|
|
|
|
(SUB8mm addr:$dst, addr:$src)>;
|