@@ -112,9 +112,18 @@ def MxRet : SDNode<"M68kISD::RET", MxSDT_Ret,
112112def MxTCRet : SDNode<"M68kISD::TC_RETURN", MxSDT_TCRet,
113113 [SDNPHasChain, SDNPOptInGlue, SDNPVariadic]>;
114114
115+ def MxGlobalBaseReg : SDNode<"M68kISD::GLOBAL_BASE_REG",
116+ SDTypeProfile<1, 0, [SDTCisVT<0, iPTR>]>>;
117+
118+ // A wrapper node for TargetConstantPool,
119+ // TargetExternalSymbol, and TargetGlobalAddress.
115120def MxWrapper : SDNode<"M68kISD::Wrapper", MxSDT_Wrapper>;
121+
122+ // Special wrapper used under M68k PIC mode for PC
123+ // relative displacements.
116124def MxWrapperPC : SDNode<"M68kISD::WrapperPC", MxSDT_Wrapper>;
117125
126+ // Arithmetic operations with CCR results.
118127def MxAdd : SDNode<"M68kISD::ADD", MxSDT_BiArithCCROut, [SDNPCommutative]>;
119128def MxSub : SDNode<"M68kISD::SUB", MxSDT_BiArithCCROut>;
120129def MxOr : SDNode<"M68kISD::OR", MxSDT_BiArithCCROut, [SDNPCommutative]>;
@@ -127,15 +136,37 @@ def MxSubX : SDNode<"M68kISD::SUBX", MxSDT_BiArithCCRInOut>;
127136def MxSMul : SDNode<"M68kISD::SMUL", MxSDT_BiArithCCROut, [SDNPCommutative]>;
128137def MxUMul : SDNode<"M68kISD::UMUL", MxSDT_BiArithCCROut, [SDNPCommutative]>;
129138
139+ // M68k compare and logical compare instructions. Subtracts the source
140+ // operand from the destination data register and sets the condition
141+ // codes according to the result. Immediate always goes first.
130142def MxCmp : SDNode<"M68kISD::CMP", MxSDT_CmpTest>;
143+
144+ // M68k bit-test instructions.
131145def MxBtst : SDNode<"M68kISD::BTST", MxSDT_CmpTest>;
132146
147+ // M68k conditional moves. Operand 0 and operand 1 are the two values
148+ // to select from. Operand 2 is the condition code, and operand 3 is the
149+ // flag operand produced by a CMP or TEST instruction. It also writes a
150+ // flag result.
133151def MxCmov : SDNode<"M68kISD::CMOV", MxSDT_Cmov>;
152+
153+ // M68k conditional branches. Operand 0 is the chain operand, operand 1
154+ // is the block to branch if condition is true, operand 2 is the
155+ // condition code, and operand 3 is the flag operand produced by a CMP
156+ // or TEST instruction.
134157def MxBrCond : SDNode<"M68kISD::BRCOND", MxSDT_BrCond, [SDNPHasChain]>;
158+
159+ // M68k SetCC. Operand 0 is condition code, and operand 1 is the CCR
160+ // operand, usually produced by a CMP instruction.
135161def MxSetCC : SDNode<"M68kISD::SETCC", MxSDT_SetCC>;
136- def MxSetCC_C : SDNode<"M68kISD::SETCC_CARRY", MxSDT_SetCC_C>;
137162
163+ // Same as SETCC except it's materialized with a subx and the value is all
164+ // one's or all zero's.
165+ def MxSetCC_C : SDNode<"M68kISD::SETCC_CARRY", MxSDT_SetCC_C>;
138166
167+ // For allocating variable amounts of stack space when using
168+ // segmented stacks. Check if the current stacklet has enough space, and
169+ // falls back to heap allocation if not.
139170def MxSegAlloca : SDNode<"M68kISD::SEG_ALLOCA", MxSDT_SEG_ALLOCA,
140171 [SDNPHasChain]>;
141172
0 commit comments