58
58
ConstraintShift = InstFormatShift + 5 ,
59
59
VS2Constraint = 0b001 << ConstraintShift,
60
60
VS1Constraint = 0b010 << ConstraintShift,
61
- VMConstraint = 0b100 << ConstraintShift,
61
+ VMConstraint = 0b100 << ConstraintShift,
62
62
ConstraintMask = 0b111 << ConstraintShift,
63
63
64
64
VLMulShift = ConstraintShift + 3 ,
@@ -68,15 +68,14 @@ enum {
68
68
ForceTailAgnosticShift = VLMulShift + 3 ,
69
69
ForceTailAgnosticMask = 1 << ForceTailAgnosticShift,
70
70
71
- // Does this instruction have a merge operand that must be removed when
72
- // converting to MCInst. It will be the first explicit use operand. Used by
73
- // RVV Pseudos.
74
- HasMergeOpShift = ForceTailAgnosticShift + 1 ,
75
- HasMergeOpMask = 1 << HasMergeOpShift,
71
+ // Is this a _TIED vector pseudo instruction. For these instructions we
72
+ // shouldn't skip the tied operand when converting to MC instructions.
73
+ IsTiedPseudoShift = ForceTailAgnosticShift + 1 ,
74
+ IsTiedPseudoMask = 1 << IsTiedPseudoShift,
76
75
77
76
// Does this instruction have a SEW operand. It will be the last explicit
78
77
// operand unless there is a vector policy operand. Used by RVV Pseudos.
79
- HasSEWOpShift = HasMergeOpShift + 1 ,
78
+ HasSEWOpShift = IsTiedPseudoShift + 1 ,
80
79
HasSEWOpMask = 1 << HasSEWOpShift,
81
80
82
81
// Does this instruction have a VL operand. It will be the second to last
@@ -140,9 +139,9 @@ static inline VLMUL getLMul(uint64_t TSFlags) {
140
139
static inline bool doesForceTailAgnostic (uint64_t TSFlags) {
141
140
return TSFlags & ForceTailAgnosticMask;
142
141
}
143
- // / \returns true if there is a merge operand for the instruction .
144
- static inline bool hasMergeOp (uint64_t TSFlags) {
145
- return TSFlags & HasMergeOpMask ;
142
+ // / \returns true if this a _TIED pseudo .
143
+ static inline bool isTiedPseudo (uint64_t TSFlags) {
144
+ return TSFlags & IsTiedPseudoMask ;
146
145
}
147
146
// / \returns true if there is a SEW operand for the instruction.
148
147
static inline bool hasSEWOp (uint64_t TSFlags) {
@@ -165,12 +164,6 @@ static inline bool usesMaskPolicy(uint64_t TSFlags) {
165
164
return TSFlags & UsesMaskPolicyMask;
166
165
}
167
166
168
- static inline unsigned getMergeOpNum (const MCInstrDesc &Desc) {
169
- assert (hasMergeOp (Desc.TSFlags ));
170
- assert (!Desc.isVariadic ());
171
- return Desc.getNumDefs ();
172
- }
173
-
174
167
static inline unsigned getVLOpNum (const MCInstrDesc &Desc) {
175
168
const uint64_t TSFlags = Desc.TSFlags ;
176
169
// This method is only called if we expect to have a VL operand, and all
@@ -199,9 +192,7 @@ static inline unsigned getVecPolicyOpNum(const MCInstrDesc &Desc) {
199
192
// Is the first def operand tied to the first use operand. This is true for
200
193
// vector pseudo instructions that have a merge operand for tail/mask
201
194
// undisturbed. It's also true for vector FMA instructions where one of the
202
- // operands is also the destination register. This is different than
203
- // RISCVII::hasMergeOp which only indicates whether the tied operand from the
204
- // pseudoinstruction also exists on the MC layer instruction.
195
+ // operands is also the destination register.
205
196
static inline bool isFirstDefTiedToFirstUse (const MCInstrDesc &Desc) {
206
197
return Desc.getNumDefs () < Desc.getNumOperands () &&
207
198
Desc.getOperandConstraint (Desc.getNumDefs (), MCOI::TIED_TO) == 0 ;
0 commit comments