@@ -91,9 +91,7 @@ EVT splitType(EVT);
91
91
// (requiring a packed VL param..)
92
92
bool isPackedType (EVT SomeVT);
93
93
bool isMaskType (EVT VT);
94
- static inline bool isPackedMaskType (EVT SomeVT) {
95
- return isPackedType (SomeVT) && isMaskType (SomeVT);
96
- }
94
+ bool isPackedMaskType (EVT SomeVT);
97
95
bool isOverPackedType (EVT VT);
98
96
99
97
// whether this VVP operation has no mask argument
@@ -159,86 +157,38 @@ enum class PackElem : int8_t {
159
157
Hi = 1 // float (32, 0]
160
158
};
161
159
162
- static PackElem getPartForLane (unsigned ElemIdx) {
163
- return (ElemIdx % 2 == 0 ) ? PackElem::Hi : PackElem::Lo;
164
- }
160
+ PackElem getPartForLane (unsigned ElemIdx);
165
161
166
- static PackElem getOtherPart (PackElem Part) {
167
- return Part == PackElem::Lo ? PackElem::Hi : PackElem::Lo;
168
- }
162
+ PackElem getOtherPart (PackElem Part);
169
163
170
- static unsigned getOverPackedSubRegIdx (PackElem Part) {
171
- return Part == PackElem::Lo ? VE::sub_pack_lo : VE::sub_pack_hi;
172
- }
164
+ unsigned getOverPackedSubRegIdx (PackElem Part);
173
165
174
- static unsigned getPackedMaskSubRegIdx (PackElem Part) {
175
- return Part == PackElem::Lo ? VE::sub_vm_lo : VE::sub_vm_hi;
176
- }
166
+ unsigned getPackedMaskSubRegIdx (PackElem Part);
177
167
178
- static inline MVT getMaskVT (Packing P) {
179
- return P == Packing::Normal ? MVT::v256i1 : MVT::v512i1;
180
- }
168
+ MVT getMaskVT (Packing P);
181
169
182
- static PackElem getPackElemForVT (EVT VT) {
183
- if (VT.isFloatingPoint ())
184
- return PackElem::Hi;
185
- if (VT.isVector ())
186
- return getPackElemForVT (VT.getVectorElementType ());
187
- return PackElem::Lo;
188
- }
170
+ PackElem getPackElemForVT (EVT VT);
189
171
190
172
// The subregister VT an unpack of part \p Elem from \p VT would source its
191
173
// result from.
192
- static MVT getUnpackSourceType (EVT VT, PackElem Elem) {
193
- if (!VT.isVector ())
194
- return Elem == PackElem::Hi ? MVT::f32 : MVT::i32;
195
-
196
- EVT ElemVT = VT.getVectorElementType ();
197
- if (isMaskType (VT))
198
- return MVT::v256i1;
199
- if (isOverPackedType (VT))
200
- return ElemVT.isFloatingPoint () ? MVT::v256f64 : MVT::v256i64;
201
- return ElemVT.isFloatingPoint () ? MVT::v256f32 : MVT::v256i32;
202
- }
174
+ MVT getUnpackSourceType (EVT VT, PackElem Elem);
203
175
204
- static inline Packing getPackingForVT (EVT VT) {
205
- assert (VT.isVector ());
206
- return isPackedType (VT) ? Packing::Dense : Packing::Normal;
207
- }
176
+ Packing getPackingForVT (EVT VT);
208
177
209
178
template <typename MaskBits> Packing getPackingForMaskBits (const MaskBits MB);
210
179
211
180
// True, iff this is a VEC_UNPACK_LO/HI, VEC_SWAP or VEC_PACK.
212
- static inline bool isPackingSupportOpcode (unsigned Opcode) {
213
- switch (Opcode) {
214
- case VEISD::VEC_UNPACK_LO:
215
- case VEISD::VEC_UNPACK_HI:
216
- case VEISD::VEC_PACK:
217
- case VEISD::VEC_SWAP:
218
- return true ;
219
- }
220
- return false ;
221
- }
181
+ bool isPackingSupportOpcode (unsigned Opcode);
222
182
223
- static bool isUnpackOp (unsigned OPC) {
224
- return (OPC == VEISD::VEC_UNPACK_LO) || (OPC == VEISD::VEC_UNPACK_HI);
225
- }
183
+ bool isUnpackOp (unsigned OPC);
226
184
227
- static PackElem getPartForUnpackOpcode (unsigned OPC) {
228
- if (OPC == VEISD::VEC_UNPACK_LO)
229
- return PackElem::Lo;
230
- if (OPC == VEISD::VEC_UNPACK_HI)
231
- return PackElem::Hi;
232
- llvm_unreachable (" Not an unpack opcode!" );
233
- }
185
+ PackElem getPartForUnpackOpcode (unsigned OPC);
234
186
235
- static unsigned getUnpackOpcodeForPart (PackElem Part) {
236
- return (Part == PackElem::Lo) ? VEISD::VEC_UNPACK_LO : VEISD::VEC_UNPACK_HI;
237
- }
187
+ unsigned getUnpackOpcodeForPart (PackElem Part);
238
188
239
- static SDValue getUnpackPackOperand (SDValue N) { return N-> getOperand ( 0 ); }
189
+ SDValue getUnpackPackOperand (SDValue N);
240
190
241
- static SDValue getUnpackAVL (SDValue N) { return N-> getOperand ( 1 ); }
191
+ SDValue getUnpackAVL (SDValue N);
242
192
243
193
// / } Packing
244
194
0 commit comments