@@ -22,44 +22,44 @@ namespace llvm
22
22
23
23
namespace AVRISD
24
24
{
25
- // / AVR Specific DAG Nodes
25
+ // ! \brief AVR Specific DAG Nodes
26
26
enum NodeType
27
27
{
28
- // / Start the numbering where the builtin ops leave off.
28
+ // ! Start the numbering where the builtin ops leave off.
29
29
FIRST_NUMBER = ISD::BUILTIN_OP_END,
30
- // / Return from subroutine.
30
+ // ! Return from subroutine.
31
31
RET_FLAG,
32
- // / Return from ISR.
32
+ // ! Return from ISR.
33
33
RETI_FLAG,
34
- // / CALL - These operations represent an abstract call
35
- // / instruction, which includes a bunch of information.
34
+ // ! These operations represent an abstract call
35
+ // ! instruction, which includes a bunch of information.
36
36
CALL,
37
- // / Wrapper - A wrapper node for TargetConstantPool,
38
- // / TargetExternalSymbol, and TargetGlobalAddress.
37
+ // ! A wrapper node for TargetConstantPool,
38
+ // ! TargetExternalSymbol, and TargetGlobalAddress.
39
39
Wrapper,
40
- // / Bit shifting and rotation.
40
+ // ! Bit shifting and rotation.
41
41
LSL,
42
42
LSR,
43
43
ASR,
44
44
ROR,
45
45
ROL,
46
- // / Non-constant shifts.
46
+ // ! Non-constant shifts.
47
47
LSLLOOP,
48
48
LSRLOOP,
49
49
ASRLOOP,
50
- // / AVR conditional branches. Operand 0 is the chain operand, operand 1
51
- // / is the block to branch if condition is true, operand 2 is the
52
- // / condition code, and operand 3 is the flag operand produced by a CMP
53
- // / or TEST instruction.
50
+ // ! AVR conditional branches. Operand 0 is the chain operand, operand 1
51
+ // ! is the block to branch if condition is true, operand 2 is the
52
+ // ! condition code, and operand 3 is the flag operand produced by a CMP
53
+ // ! or TEST instruction.
54
54
BRCOND,
55
- // / CMP - Compare instruction.
55
+ // ! Compare instruction.
56
56
CMP,
57
- // / CMPC - Compare with carry instruction.
57
+ // ! Compare with carry instruction.
58
58
CMPC,
59
- // / TST - Test for zero or minus instruction.
59
+ // ! Test for zero or minus instruction.
60
60
TST,
61
- // / SELECT_CC - Operand 0 and operand 1 are selection variable, operand 2
62
- // / is condition code and operand 3 is flag operand.
61
+ // ! Operand 0 and operand 1 are selection variable, operand 2
62
+ // ! is condition code and operand 3 is flag operand.
63
63
SELECT_CC
64
64
};
65
65
}
@@ -70,63 +70,73 @@ class AVRTargetLowering : public TargetLowering
70
70
{
71
71
public:
72
72
explicit AVRTargetLowering (AVRTargetMachine &TM);
73
- public: // TargetLowering
73
+ public:
74
74
MVT getScalarShiftAmountTy (EVT LHSTy) const { return MVT::i8 ; }
75
- const char *getTargetNodeName (unsigned Opcode) const ;
75
+ const char *getTargetNodeName (unsigned Opcode) const override ;
76
76
77
- // / LowerOperation - Provide custom lowering hooks for some operations.
78
- // /
79
- SDValue LowerOperation (SDValue Op, SelectionDAG &DAG) const ;
77
+ /* !
78
+ * \brief Provide custom lowering hooks for some operations.
79
+ */
80
+ SDValue LowerOperation (SDValue Op, SelectionDAG &DAG) const override ;
80
81
81
- // / ReplaceNodeResults - Replace the results of node with an illegal result
82
- // / type with new values built out of custom code.
83
- // /
82
+ /* !
83
+ * \brief Replace the results of node with an illegal result
84
+ * type with new values built out of custom code.
85
+ */
84
86
void ReplaceNodeResults (SDNode *N, SmallVectorImpl<SDValue> &Results,
85
- SelectionDAG &DAG) const ;
86
-
87
- // / isLegalAddressingMode - Return true if the addressing mode represented
88
- // / by AM is legal for this target, for a load/store of the specified type.
89
- // /
90
- bool isLegalAddressingMode (const AddrMode &AM, Type *Ty) const ;
91
-
92
- // / getPreIndexedAddressParts - returns true by value, base pointer and
93
- // / offset pointer and addressing mode by reference if the node's address
94
- // / can be legally represented as pre-indexed load / store address.
87
+ SelectionDAG &DAG) const override ;
88
+
89
+ /* !
90
+ * \brief Return true if the addressing mode represented
91
+ * by AM is legal for this target, for a load/store
92
+ * of the specified type.
93
+ */
94
+ bool isLegalAddressingMode (const AddrMode &AM, Type *Ty) const override ;
95
+
96
+ /* !
97
+ * \brief Returns true by value, base pointer and
98
+ * offset pointer and addressing mode by reference if the node's address
99
+ * can be legally represented as pre-indexed load / store address.
100
+ */
95
101
bool getPreIndexedAddressParts (SDNode *N, SDValue &Base, SDValue &Offset,
96
102
ISD::MemIndexedMode &AM,
97
- SelectionDAG &DAG) const ;
103
+ SelectionDAG &DAG) const override ;
98
104
99
- // / getPostIndexedAddressParts - returns true by value, base pointer and
100
- // / offset pointer and addressing mode by reference if this node can be
101
- // / combined with a load / store to form a post-indexed load / store.
105
+ /* !
106
+ * \brief Returns true by value, base pointer and
107
+ * offset pointer and addressing mode by reference if this node can be
108
+ * combined with a load / store to form a post-indexed load / store.
109
+ */
102
110
bool getPostIndexedAddressParts (SDNode *N, SDNode *Op, SDValue &Base,
103
111
SDValue &Offset, ISD::MemIndexedMode &AM,
104
- SelectionDAG &DAG) const ;
112
+ SelectionDAG &DAG) const override ;
105
113
106
- // / isOffsetFoldingLegal - Return true if folding a constant offset
107
- // / with the given GlobalAddress is legal. It is frequently not legal in
108
- // / PIC relocation models.
109
- bool isOffsetFoldingLegal (const GlobalAddressSDNode *GA) const ;
114
+ /* !
115
+ * \brief Return true if folding a constant offset
116
+ * with the given GlobalAddress is legal. It is frequently not legal in
117
+ * PIC relocation models.
118
+ */
119
+ bool isOffsetFoldingLegal (const GlobalAddressSDNode *GA) const override ;
110
120
111
121
MachineBasicBlock *EmitInstrWithCustomInserter (MachineInstr *MI,
112
- MachineBasicBlock *MBB) const ;
113
- MachineBasicBlock *EmitShiftInstr (MachineInstr *MI,
114
- MachineBasicBlock *BB) const ;
122
+ MachineBasicBlock *MBB) const override ;
115
123
116
124
// / Inline Asm support.
117
125
// / Implementation of TargetLowering hooks.
118
- ConstraintType getConstraintType (const std::string &Constraint) const ;
126
+ ConstraintType getConstraintType (const std::string &Constraint) const override ;
119
127
120
128
ConstraintWeight
121
129
getSingleConstraintMatchWeight (AsmOperandInfo &info,
122
- const char *constraint) const ;
130
+ const char *constraint) const override ;
123
131
124
132
std::pair<unsigned , const TargetRegisterClass *>
125
- getRegForInlineAsmConstraint (const std::string &Constraint, MVT VT) const ;
133
+ getRegForInlineAsmConstraint (const TargetRegisterInfo *TRI,
134
+ const std::string &Constraint,
135
+ MVT VT) const override ;
126
136
127
137
void LowerAsmOperandForConstraint (SDValue Op, std::string &Constraint,
128
138
std::vector<SDValue> &Ops,
129
- SelectionDAG &DAG) const ;
139
+ SelectionDAG &DAG) const override ;
130
140
131
141
private:
132
142
SDValue getAVRCmp (SDValue LHS, SDValue RHS, ISD::CondCode CC, SDValue &AVRcc,
@@ -156,6 +166,8 @@ class AVRTargetLowering : public TargetLowering
156
166
const SmallVectorImpl<ISD::InputArg> &Ins,
157
167
SDLoc dl, SelectionDAG &DAG,
158
168
SmallVectorImpl<SDValue> &InVals) const ;
169
+ MachineBasicBlock *EmitShiftInstr (MachineInstr *MI,
170
+ MachineBasicBlock *BB) const ;
159
171
};
160
172
161
173
} // end namespace llvm
0 commit comments