@@ -32,46 +32,67 @@ def SDT_AVRSelectCC
3232// AVR Specific Node Definitions
3333//===----------------------------------------------------------------------===//
3434
35+ // Return from subroutine.
3536def AVRretglue : SDNode<"AVRISD::RET_GLUE", SDTNone,
3637 [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
38+
39+ // Return from ISR.
3740def AVRretiglue : SDNode<"AVRISD::RETI_GLUE", SDTNone,
3841 [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
3942
43+
4044def AVRcallseq_start : SDNode<"ISD::CALLSEQ_START", SDT_AVRCallSeqStart,
4145 [SDNPHasChain, SDNPOutGlue]>;
4246def AVRcallseq_end : SDNode<"ISD::CALLSEQ_END", SDT_AVRCallSeqEnd,
4347 [SDNPHasChain, SDNPOptInGlue, SDNPOutGlue]>;
4448
49+ // Represents an abstract call instruction,
50+ // which includes a bunch of information.
4551def AVRcall : SDNode<"AVRISD::CALL", SDT_AVRCall,
4652 [SDNPHasChain, SDNPOutGlue, SDNPOptInGlue, SDNPVariadic]>;
4753
54+ // A wrapper node for TargetConstantPool,
55+ // TargetExternalSymbol, and TargetGlobalAddress.
4856def AVRWrapper : SDNode<"AVRISD::WRAPPER", SDT_AVRWrapper>;
4957
58+ // AVR conditional branches. Operand 0 is the chain operand, operand 1
59+ // is the block to branch if condition is true, operand 2 is the
60+ // condition code, and operand 3 is the flag operand produced by a CMP
61+ // or TEST instruction.
5062def AVRbrcond
5163 : SDNode<"AVRISD::BRCOND", SDT_AVRBrcond, [SDNPHasChain, SDNPInGlue]>;
64+
65+ // Compare instruction.
5266def AVRcmp : SDNode<"AVRISD::CMP", SDT_AVRCmp, [SDNPOutGlue]>;
67+
68+ // Compare with carry instruction.
5369def AVRcmpc : SDNode<"AVRISD::CMPC", SDT_AVRCmp, [SDNPInGlue, SDNPOutGlue]>;
70+
71+ // Test for zero or minus instruction.
5472def AVRtst : SDNode<"AVRISD::TST", SDT_AVRTst, [SDNPOutGlue]>;
73+
74+ // Operand 0 and operand 1 are selection variable, operand 2
75+ // is condition code and operand 3 is flag operand.
5576def AVRselectcc : SDNode<"AVRISD::SELECT_CC", SDT_AVRSelectCC, [SDNPInGlue]>;
5677
5778// Shift nodes.
58- def AVRlsl : SDNode<"AVRISD::LSL", SDTIntUnaryOp>;
59- def AVRlsr : SDNode<"AVRISD::LSR", SDTIntUnaryOp>;
60- def AVRrol : SDNode<"AVRISD::ROL", SDTIntUnaryOp>;
61- def AVRror : SDNode<"AVRISD::ROR", SDTIntUnaryOp>;
62- def AVRasr : SDNode<"AVRISD::ASR", SDTIntUnaryOp>;
63- def AVRlslhi : SDNode<"AVRISD::LSLHI", SDTIntUnaryOp>;
64- def AVRlsrlo : SDNode<"AVRISD::LSRLO", SDTIntUnaryOp>;
65- def AVRasrlo : SDNode<"AVRISD::ASRLO", SDTIntUnaryOp>;
66- def AVRlslbn : SDNode<"AVRISD::LSLBN", SDTIntBinOp>;
67- def AVRlsrbn : SDNode<"AVRISD::LSRBN", SDTIntBinOp>;
68- def AVRasrbn : SDNode<"AVRISD::ASRBN", SDTIntBinOp>;
69- def AVRlslwn : SDNode<"AVRISD::LSLWN", SDTIntBinOp>;
70- def AVRlsrwn : SDNode<"AVRISD::LSRWN", SDTIntBinOp>;
71- def AVRasrwn : SDNode<"AVRISD::ASRWN", SDTIntBinOp>;
72- def AVRlslw : SDNode<"AVRISD::LSLW", SDTIntShiftPairOp>;
73- def AVRlsrw : SDNode<"AVRISD::LSRW", SDTIntShiftPairOp>;
74- def AVRasrw : SDNode<"AVRISD::ASRW", SDTIntShiftPairOp>;
79+ def AVRlsl : SDNode<"AVRISD::LSL", SDTIntUnaryOp>; // Logical shift left.
80+ def AVRlsr : SDNode<"AVRISD::LSR", SDTIntUnaryOp>; // Logical shift right.
81+ def AVRrol : SDNode<"AVRISD::ROL", SDTIntUnaryOp>; // Bit rotate left.
82+ def AVRror : SDNode<"AVRISD::ROR", SDTIntUnaryOp>; // Bit rotate right.
83+ def AVRasr : SDNode<"AVRISD::ASR", SDTIntUnaryOp>; // Arithmetic shift right.
84+ def AVRlslhi : SDNode<"AVRISD::LSLHI", SDTIntUnaryOp>; // Higher 8-bit of word logical shift left.
85+ def AVRlsrlo : SDNode<"AVRISD::LSRLO", SDTIntUnaryOp>; // Lower 8-bit of word logical shift right.
86+ def AVRasrlo : SDNode<"AVRISD::ASRLO", SDTIntUnaryOp>; // Lower 8-bit of word arithmetic shift right.
87+ def AVRlslbn : SDNode<"AVRISD::LSLBN", SDTIntBinOp>; // Byte logical shift left N bits.
88+ def AVRlsrbn : SDNode<"AVRISD::LSRBN", SDTIntBinOp>; // Byte logical shift right N bits.
89+ def AVRasrbn : SDNode<"AVRISD::ASRBN", SDTIntBinOp>; // Byte arithmetic shift right N bits.
90+ def AVRlslwn : SDNode<"AVRISD::LSLWN", SDTIntBinOp>; // Higher 8-bit of word logical shift left.
91+ def AVRlsrwn : SDNode<"AVRISD::LSRWN", SDTIntBinOp>; // Word logical shift right N bits.
92+ def AVRasrwn : SDNode<"AVRISD::ASRWN", SDTIntBinOp>; // Word arithmetic shift right N bits.
93+ def AVRlslw : SDNode<"AVRISD::LSLW", SDTIntShiftPairOp>; // Wide logical shift left.
94+ def AVRlsrw : SDNode<"AVRISD::LSRW", SDTIntShiftPairOp>; // Wide logical shift right.
95+ def AVRasrw : SDNode<"AVRISD::ASRW", SDTIntShiftPairOp>; // Wide arithmetic shift right.
7596
7697// Pseudo shift nodes for non-constant shift amounts.
7798def AVRlslLoop : SDNode<"AVRISD::LSLLOOP", SDTIntShiftOp>;
0 commit comments