1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Global Instruction Selector for the BPF target *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9#ifdef GET_GLOBALISEL_PREDICATE_BITSET
10const unsigned MAX_SUBTARGET_PREDICATES = 10;
11using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>;
12#endif // ifdef GET_GLOBALISEL_PREDICATE_BITSET
13
14#ifdef GET_GLOBALISEL_TEMPORARIES_DECL
15 mutable MatcherState State;
16 typedef ComplexRendererFns(BPFInstructionSelector::*ComplexMatcherMemFn)(MachineOperand &) const;
17 typedef void(BPFInstructionSelector::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
18 const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
19 static BPFInstructionSelector::ComplexMatcherMemFn ComplexPredicateFns[];
20 static BPFInstructionSelector::CustomRendererFn CustomRenderers[];
21 bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
22 bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
23 bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
24 const uint8_t *getMatchTable() const override;
25 bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override;
26 bool testSimplePredicate(unsigned PredicateID) const override;
27 bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override;
28#endif // ifdef GET_GLOBALISEL_TEMPORARIES_DECL
29
30#ifdef GET_GLOBALISEL_TEMPORARIES_INIT
31, State(0),
32ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
33#endif // ifdef GET_GLOBALISEL_TEMPORARIES_INIT
34
35#ifdef GET_GLOBALISEL_IMPL
36// LLT Objects.
37enum {
38 GILLT_s32,
39 GILLT_s64,
40};
41const static size_t NumTypeObjects = 2;
42const static LLT TypeObjects[] = {
43 LLT::scalar(32),
44 LLT::scalar(64),
45};
46
47// Bits for subtarget features that participate in instruction matching.
48enum SubtargetFeatureBits : uint8_t {
49 Feature_BPFIsLittleEndianBit = 7,
50 Feature_BPFIsBigEndianBit = 8,
51 Feature_BPFHasALU32Bit = 5,
52 Feature_BPFNoALU32Bit = 2,
53 Feature_BPFHasLdsxBit = 4,
54 Feature_BPFHasMovsxBit = 1,
55 Feature_BPFHasBswapBit = 6,
56 Feature_BPFHasSdivSmodBit = 0,
57 Feature_BPFNoMovsxBit = 9,
58 Feature_BPFHasStoreImmBit = 3,
59};
60
61PredicateBitset BPFInstructionSelector::
62computeAvailableModuleFeatures(const BPFSubtarget *Subtarget) const {
63 PredicateBitset Features{};
64 if (Subtarget->isLittleEndian())
65 Features.set(Feature_BPFIsLittleEndianBit);
66 if (!Subtarget->isLittleEndian())
67 Features.set(Feature_BPFIsBigEndianBit);
68 if (Subtarget->getHasAlu32())
69 Features.set(Feature_BPFHasALU32Bit);
70 if (!Subtarget->getHasAlu32())
71 Features.set(Feature_BPFNoALU32Bit);
72 if (Subtarget->hasLdsx())
73 Features.set(Feature_BPFHasLdsxBit);
74 if (Subtarget->hasMovsx())
75 Features.set(Feature_BPFHasMovsxBit);
76 if (Subtarget->hasBswap())
77 Features.set(Feature_BPFHasBswapBit);
78 if (Subtarget->hasSdivSmod())
79 Features.set(Feature_BPFHasSdivSmodBit);
80 if (!Subtarget->hasMovsx())
81 Features.set(Feature_BPFNoMovsxBit);
82 if (Subtarget->hasStoreImm())
83 Features.set(Feature_BPFHasStoreImmBit);
84 return Features;
85}
86
87void BPFInstructionSelector::setupGeneratedPerFunctionState(MachineFunction &MF) {
88 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const BPFSubtarget *)&MF.getSubtarget(), &MF);
89}
90PredicateBitset BPFInstructionSelector::
91computeAvailableFunctionFeatures(const BPFSubtarget *Subtarget, const MachineFunction *MF) const {
92 PredicateBitset Features{};
93 return Features;
94}
95
96// Feature bitsets.
97enum {
98 GIFBS_Invalid,
99 GIFBS_BPFHasBswap,
100 GIFBS_BPFHasMovsx,
101 GIFBS_BPFHasSdivSmod,
102 GIFBS_BPFIsBigEndian,
103 GIFBS_BPFIsLittleEndian,
104 GIFBS_BPFNoMovsx,
105};
106constexpr static PredicateBitset FeatureBitsets[] {
107 {}, // GIFBS_Invalid
108 {Feature_BPFHasBswapBit, },
109 {Feature_BPFHasMovsxBit, },
110 {Feature_BPFHasSdivSmodBit, },
111 {Feature_BPFIsBigEndianBit, },
112 {Feature_BPFIsLittleEndianBit, },
113 {Feature_BPFNoMovsxBit, },
114};
115
116// ComplexPattern predicates.
117enum {
118 GICP_Invalid,
119};
120// See constructor for table contents
121
122BPFInstructionSelector::ComplexMatcherMemFn
123BPFInstructionSelector::ComplexPredicateFns[] = {
124 nullptr, // GICP_Invalid
125};
126
127// PatFrag predicates.
128bool BPFInstructionSelector::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
129 const MachineFunction &MF = *MI.getParent()->getParent();
130 const MachineRegisterInfo &MRI = MF.getRegInfo();
131 const auto &Operands = State.RecordedOperands;
132 (void)Operands;
133 (void)MRI;
134 llvm_unreachable("Unknown predicate");
135 return false;
136}
137// PatFrag predicates.
138bool BPFInstructionSelector::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
139 llvm_unreachable("Unknown predicate");
140 return false;
141}
142// PatFrag predicates.
143bool BPFInstructionSelector::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
144 llvm_unreachable("Unknown predicate");
145 return false;
146}
147// PatFrag predicates.
148bool BPFInstructionSelector::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
149 llvm_unreachable("Unknown predicate");
150 return false;
151}
152bool BPFInstructionSelector::testSimplePredicate(unsigned) const {
153 llvm_unreachable("BPFInstructionSelector does not support simple predicates!");
154 return false;
155}
156// Custom renderers.
157enum {
158 GICR_Invalid,
159};
160BPFInstructionSelector::CustomRendererFn
161BPFInstructionSelector::CustomRenderers[] = {
162 nullptr, // GICR_Invalid
163};
164
165bool BPFInstructionSelector::selectImpl(MachineInstr &I, CodeGenCoverage &CoverageInfo) const {
166 const PredicateBitset AvailableFeatures = getAvailableFeatures();
167 MachineIRBuilder B(I);
168 State.MIs.clear();
169 State.MIs.push_back(&I);
170
171 if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), TII, MF->getRegInfo(), TRI, RBI, AvailableFeatures, &CoverageInfo)) {
172 return true;
173 }
174
175 return false;
176}
177
178bool BPFInstructionSelector::runCustomAction(unsigned, const MatcherState&, NewMIVector &) const {
179 llvm_unreachable("BPFInstructionSelector does not support custom C++ actions!");
180}
181#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
182#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((uint16_t)Val >> 8)
183#define GIMT_Encode4(Val) uint8_t(Val), uint8_t((uint32_t)Val >> 8), uint8_t((uint32_t)Val >> 16), uint8_t((uint32_t)Val >> 24)
184#define GIMT_Encode8(Val) uint8_t(Val), uint8_t((uint64_t)Val >> 8), uint8_t((uint64_t)Val >> 16), uint8_t((uint64_t)Val >> 24), uint8_t((uint64_t)Val >> 32), uint8_t((uint64_t)Val >> 40), uint8_t((uint64_t)Val >> 48), uint8_t((uint64_t)Val >> 56)
185#else
186#define GIMT_Encode2(Val) uint8_t((uint16_t)Val >> 8), uint8_t(Val)
187#define GIMT_Encode4(Val) uint8_t((uint32_t)Val >> 24), uint8_t((uint32_t)Val >> 16), uint8_t((uint32_t)Val >> 8), uint8_t(Val)
188#define GIMT_Encode8(Val) uint8_t((uint64_t)Val >> 56), uint8_t((uint64_t)Val >> 48), uint8_t((uint64_t)Val >> 40), uint8_t((uint64_t)Val >> 32), uint8_t((uint64_t)Val >> 24), uint8_t((uint64_t)Val >> 16), uint8_t((uint64_t)Val >> 8), uint8_t(Val)
189#endif
190const uint8_t *BPFInstructionSelector::getMatchTable() const {
191 constexpr static uint8_t MatchTable0[] = {
192 GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(51), GIMT_Encode2(237), /*)*//*default:*//*Label 21*/ GIMT_Encode4(2407),
193 /*TargetOpcode::G_ADD*//*Label 0*/ GIMT_Encode4(754),
194 /*TargetOpcode::G_SUB*//*Label 1*/ GIMT_Encode4(820),
195 /*TargetOpcode::G_MUL*//*Label 2*/ GIMT_Encode4(934),
196 /*TargetOpcode::G_SDIV*//*Label 3*/ GIMT_Encode4(1000),
197 /*TargetOpcode::G_UDIV*//*Label 4*/ GIMT_Encode4(1072),
198 /*TargetOpcode::G_SREM*//*Label 5*/ GIMT_Encode4(1138),
199 /*TargetOpcode::G_UREM*//*Label 6*/ GIMT_Encode4(1210), GIMT_Encode4(0), GIMT_Encode4(0),
200 /*TargetOpcode::G_AND*//*Label 7*/ GIMT_Encode4(1276),
201 /*TargetOpcode::G_OR*//*Label 8*/ GIMT_Encode4(1402),
202 /*TargetOpcode::G_XOR*//*Label 9*/ GIMT_Encode4(1468), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
203 /*TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS*//*Label 10*/ GIMT_Encode4(1534), GIMT_Encode4(0), GIMT_Encode4(0),
204 /*TargetOpcode::G_ANYEXT*//*Label 11*/ GIMT_Encode4(1598),
205 /*TargetOpcode::G_TRUNC*//*Label 12*/ GIMT_Encode4(1661),
206 /*TargetOpcode::G_CONSTANT*//*Label 13*/ GIMT_Encode4(1703), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
207 /*TargetOpcode::G_SEXT*//*Label 14*/ GIMT_Encode4(1726), GIMT_Encode4(0),
208 /*TargetOpcode::G_ZEXT*//*Label 15*/ GIMT_Encode4(1842),
209 /*TargetOpcode::G_SHL*//*Label 16*/ GIMT_Encode4(1869),
210 /*TargetOpcode::G_LSHR*//*Label 17*/ GIMT_Encode4(1935),
211 /*TargetOpcode::G_ASHR*//*Label 18*/ GIMT_Encode4(2259), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
212 /*TargetOpcode::G_BR*//*Label 19*/ GIMT_Encode4(2325), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
213 /*TargetOpcode::G_BSWAP*//*Label 20*/ GIMT_Encode4(2341),
214 // Label 0: @754
215 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 24*/ GIMT_Encode4(819),
216 /*GILLT_s32*//*Label 22*/ GIMT_Encode4(773),
217 /*GILLT_s64*//*Label 23*/ GIMT_Encode4(796),
218 // Label 22: @773
219 GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(795), // Rule ID 46 //
220 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
221 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
222 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
223 // (add:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (ADD_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
224 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::ADD_rr_32),
225 GIR_RootConstrainSelectedInstOperands,
226 // GIR_Coverage, 46,
227 GIR_Done,
228 // Label 25: @795
229 GIM_Reject,
230 // Label 23: @796
231 GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(818), // Rule ID 44 //
232 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
233 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
234 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
235 // (add:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (ADD_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
236 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::ADD_rr),
237 GIR_RootConstrainSelectedInstOperands,
238 // GIR_Coverage, 44,
239 GIR_Done,
240 // Label 26: @818
241 GIM_Reject,
242 // Label 24: @819
243 GIM_Reject,
244 // Label 1: @820
245 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 29*/ GIMT_Encode4(933),
246 /*GILLT_s32*//*Label 27*/ GIMT_Encode4(839),
247 /*GILLT_s64*//*Label 28*/ GIMT_Encode4(886),
248 // Label 27: @839
249 GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(885),
250 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
251 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
252 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
253 GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(872), // Rule ID 97 //
254 GIM_CheckConstantInt8, /*MI*/0, /*Op*/1, 0,
255 // (sub:{ *:[i32] } 0:{ *:[i32] }, i32:{ *:[i32] }:$src) => (NEG_32:{ *:[i32] } i32:{ *:[i32] }:$src)
256 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::NEG_32),
257 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
258 GIR_RootToRootCopy, /*OpIdx*/2, // src
259 GIR_RootConstrainSelectedInstOperands,
260 // GIR_Coverage, 97,
261 GIR_EraseRootFromParent_Done,
262 // Label 31: @872
263 GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(884), // Rule ID 50 //
264 // (sub:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SUB_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
265 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SUB_rr_32),
266 GIR_RootConstrainSelectedInstOperands,
267 // GIR_Coverage, 50,
268 GIR_Done,
269 // Label 32: @884
270 GIM_Reject,
271 // Label 30: @885
272 GIM_Reject,
273 // Label 28: @886
274 GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(932),
275 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
276 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
277 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
278 GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(919), // Rule ID 96 //
279 GIM_CheckConstantInt8, /*MI*/0, /*Op*/1, 0,
280 // (sub:{ *:[i64] } 0:{ *:[i64] }, i64:{ *:[i64] }:$src) => (NEG_64:{ *:[i64] } i64:{ *:[i64] }:$src)
281 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::NEG_64),
282 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
283 GIR_RootToRootCopy, /*OpIdx*/2, // src
284 GIR_RootConstrainSelectedInstOperands,
285 // GIR_Coverage, 96,
286 GIR_EraseRootFromParent_Done,
287 // Label 34: @919
288 GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(931), // Rule ID 48 //
289 // (sub:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SUB_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
290 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SUB_rr),
291 GIR_RootConstrainSelectedInstOperands,
292 // GIR_Coverage, 48,
293 GIR_Done,
294 // Label 35: @931
295 GIM_Reject,
296 // Label 33: @932
297 GIM_Reject,
298 // Label 29: @933
299 GIM_Reject,
300 // Label 2: @934
301 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 38*/ GIMT_Encode4(999),
302 /*GILLT_s32*//*Label 36*/ GIMT_Encode4(953),
303 /*GILLT_s64*//*Label 37*/ GIMT_Encode4(976),
304 // Label 36: @953
305 GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(975), // Rule ID 78 //
306 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
307 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
308 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
309 // (mul:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (MUL_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
310 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::MUL_rr_32),
311 GIR_RootConstrainSelectedInstOperands,
312 // GIR_Coverage, 78,
313 GIR_Done,
314 // Label 39: @975
315 GIM_Reject,
316 // Label 37: @976
317 GIM_Try, /*On fail goto*//*Label 40*/ GIMT_Encode4(998), // Rule ID 76 //
318 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
319 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
320 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
321 // (mul:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (MUL_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
322 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::MUL_rr),
323 GIR_RootConstrainSelectedInstOperands,
324 // GIR_Coverage, 76,
325 GIR_Done,
326 // Label 40: @998
327 GIM_Reject,
328 // Label 38: @999
329 GIM_Reject,
330 // Label 3: @1000
331 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 43*/ GIMT_Encode4(1071),
332 /*GILLT_s32*//*Label 41*/ GIMT_Encode4(1019),
333 /*GILLT_s64*//*Label 42*/ GIMT_Encode4(1045),
334 // Label 41: @1019
335 GIM_Try, /*On fail goto*//*Label 44*/ GIMT_Encode4(1044), // Rule ID 90 //
336 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
337 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
338 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
339 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
340 // (sdiv:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SDIV_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
341 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SDIV_rr_32),
342 GIR_RootConstrainSelectedInstOperands,
343 // GIR_Coverage, 90,
344 GIR_Done,
345 // Label 44: @1044
346 GIM_Reject,
347 // Label 42: @1045
348 GIM_Try, /*On fail goto*//*Label 45*/ GIMT_Encode4(1070), // Rule ID 88 //
349 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
350 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
351 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
352 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
353 // (sdiv:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SDIV_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
354 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SDIV_rr),
355 GIR_RootConstrainSelectedInstOperands,
356 // GIR_Coverage, 88,
357 GIR_Done,
358 // Label 45: @1070
359 GIM_Reject,
360 // Label 43: @1071
361 GIM_Reject,
362 // Label 4: @1072
363 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 48*/ GIMT_Encode4(1137),
364 /*GILLT_s32*//*Label 46*/ GIMT_Encode4(1091),
365 /*GILLT_s64*//*Label 47*/ GIMT_Encode4(1114),
366 // Label 46: @1091
367 GIM_Try, /*On fail goto*//*Label 49*/ GIMT_Encode4(1113), // Rule ID 82 //
368 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
369 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
370 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
371 // (udiv:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (DIV_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
372 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::DIV_rr_32),
373 GIR_RootConstrainSelectedInstOperands,
374 // GIR_Coverage, 82,
375 GIR_Done,
376 // Label 49: @1113
377 GIM_Reject,
378 // Label 47: @1114
379 GIM_Try, /*On fail goto*//*Label 50*/ GIMT_Encode4(1136), // Rule ID 80 //
380 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
381 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
382 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
383 // (udiv:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (DIV_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
384 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::DIV_rr),
385 GIR_RootConstrainSelectedInstOperands,
386 // GIR_Coverage, 80,
387 GIR_Done,
388 // Label 50: @1136
389 GIM_Reject,
390 // Label 48: @1137
391 GIM_Reject,
392 // Label 5: @1138
393 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 53*/ GIMT_Encode4(1209),
394 /*GILLT_s32*//*Label 51*/ GIMT_Encode4(1157),
395 /*GILLT_s64*//*Label 52*/ GIMT_Encode4(1183),
396 // Label 51: @1157
397 GIM_Try, /*On fail goto*//*Label 54*/ GIMT_Encode4(1182), // Rule ID 94 //
398 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
399 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
400 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
401 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
402 // (srem:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SMOD_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
403 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SMOD_rr_32),
404 GIR_RootConstrainSelectedInstOperands,
405 // GIR_Coverage, 94,
406 GIR_Done,
407 // Label 54: @1182
408 GIM_Reject,
409 // Label 52: @1183
410 GIM_Try, /*On fail goto*//*Label 55*/ GIMT_Encode4(1208), // Rule ID 92 //
411 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
412 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
413 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
414 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
415 // (srem:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SMOD_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
416 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SMOD_rr),
417 GIR_RootConstrainSelectedInstOperands,
418 // GIR_Coverage, 92,
419 GIR_Done,
420 // Label 55: @1208
421 GIM_Reject,
422 // Label 53: @1209
423 GIM_Reject,
424 // Label 6: @1210
425 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 58*/ GIMT_Encode4(1275),
426 /*GILLT_s32*//*Label 56*/ GIMT_Encode4(1229),
427 /*GILLT_s64*//*Label 57*/ GIMT_Encode4(1252),
428 // Label 56: @1229
429 GIM_Try, /*On fail goto*//*Label 59*/ GIMT_Encode4(1251), // Rule ID 86 //
430 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
431 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
432 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
433 // (urem:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (MOD_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
434 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::MOD_rr_32),
435 GIR_RootConstrainSelectedInstOperands,
436 // GIR_Coverage, 86,
437 GIR_Done,
438 // Label 59: @1251
439 GIM_Reject,
440 // Label 57: @1252
441 GIM_Try, /*On fail goto*//*Label 60*/ GIMT_Encode4(1274), // Rule ID 84 //
442 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
443 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
444 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
445 // (urem:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (MOD_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
446 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::MOD_rr),
447 GIR_RootConstrainSelectedInstOperands,
448 // GIR_Coverage, 84,
449 GIR_Done,
450 // Label 60: @1274
451 GIM_Reject,
452 // Label 58: @1275
453 GIM_Reject,
454 // Label 7: @1276
455 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 63*/ GIMT_Encode4(1401),
456 /*GILLT_s32*//*Label 61*/ GIMT_Encode4(1295),
457 /*GILLT_s64*//*Label 62*/ GIMT_Encode4(1318),
458 // Label 61: @1295
459 GIM_Try, /*On fail goto*//*Label 64*/ GIMT_Encode4(1317), // Rule ID 58 //
460 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
461 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
462 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
463 // (and:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (AND_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
464 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::AND_rr_32),
465 GIR_RootConstrainSelectedInstOperands,
466 // GIR_Coverage, 58,
467 GIR_Done,
468 // Label 64: @1317
469 GIM_Reject,
470 // Label 62: @1318
471 GIM_Try, /*On fail goto*//*Label 65*/ GIMT_Encode4(1400),
472 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
473 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
474 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
475 GIM_Try, /*On fail goto*//*Label 66*/ GIMT_Encode4(1387), // Rule ID 176 //
476 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
477 GIM_CheckConstantInt, /*MI*/0, /*Op*/2, GIMT_Encode8(4294967295),
478 // (and:{ *:[i64] } GPR:{ *:[i64] }:$src, 4294967295:{ *:[i64] }) => (SRL_ri:{ *:[i64] } (SLL_ri:{ *:[i64] } GPR:{ *:[i64] }:$src, 32:{ *:[i64] }), 32:{ *:[i64] })
479 GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
480 GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(BPF::SLL_ri),
481 GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
482 GIR_Copy, /*NewInsnID*/1, /*OldInsnID*/0, /*OpIdx*/1, // src
483 GIR_AddImm8, /*InsnID*/1, /*Imm*/32,
484 GIR_ConstrainSelectedInstOperands, /*InsnID*/1,
485 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::SRL_ri),
486 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
487 GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
488 GIR_AddImm8, /*InsnID*/0, /*Imm*/32,
489 GIR_RootConstrainSelectedInstOperands,
490 // GIR_Coverage, 176,
491 GIR_EraseRootFromParent_Done,
492 // Label 66: @1387
493 GIM_Try, /*On fail goto*//*Label 67*/ GIMT_Encode4(1399), // Rule ID 56 //
494 // (and:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (AND_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
495 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::AND_rr),
496 GIR_RootConstrainSelectedInstOperands,
497 // GIR_Coverage, 56,
498 GIR_Done,
499 // Label 67: @1399
500 GIM_Reject,
501 // Label 65: @1400
502 GIM_Reject,
503 // Label 63: @1401
504 GIM_Reject,
505 // Label 8: @1402
506 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 70*/ GIMT_Encode4(1467),
507 /*GILLT_s32*//*Label 68*/ GIMT_Encode4(1421),
508 /*GILLT_s64*//*Label 69*/ GIMT_Encode4(1444),
509 // Label 68: @1421
510 GIM_Try, /*On fail goto*//*Label 71*/ GIMT_Encode4(1443), // Rule ID 54 //
511 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
512 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
513 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
514 // (or:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (OR_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
515 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::OR_rr_32),
516 GIR_RootConstrainSelectedInstOperands,
517 // GIR_Coverage, 54,
518 GIR_Done,
519 // Label 71: @1443
520 GIM_Reject,
521 // Label 69: @1444
522 GIM_Try, /*On fail goto*//*Label 72*/ GIMT_Encode4(1466), // Rule ID 52 //
523 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
524 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
525 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
526 // (or:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (OR_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
527 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::OR_rr),
528 GIR_RootConstrainSelectedInstOperands,
529 // GIR_Coverage, 52,
530 GIR_Done,
531 // Label 72: @1466
532 GIM_Reject,
533 // Label 70: @1467
534 GIM_Reject,
535 // Label 9: @1468
536 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 75*/ GIMT_Encode4(1533),
537 /*GILLT_s32*//*Label 73*/ GIMT_Encode4(1487),
538 /*GILLT_s64*//*Label 74*/ GIMT_Encode4(1510),
539 // Label 73: @1487
540 GIM_Try, /*On fail goto*//*Label 76*/ GIMT_Encode4(1509), // Rule ID 70 //
541 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
542 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
543 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
544 // (xor:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (XOR_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
545 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::XOR_rr_32),
546 GIR_RootConstrainSelectedInstOperands,
547 // GIR_Coverage, 70,
548 GIR_Done,
549 // Label 76: @1509
550 GIM_Reject,
551 // Label 74: @1510
552 GIM_Try, /*On fail goto*//*Label 77*/ GIMT_Encode4(1532), // Rule ID 68 //
553 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
554 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
555 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
556 // (xor:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (XOR_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
557 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::XOR_rr),
558 GIR_RootConstrainSelectedInstOperands,
559 // GIR_Coverage, 68,
560 GIR_Done,
561 // Label 77: @1532
562 GIM_Reject,
563 // Label 75: @1533
564 GIM_Reject,
565 // Label 10: @1534
566 GIM_Try, /*On fail goto*//*Label 78*/ GIMT_Encode4(1597), // Rule ID 107 //
567 GIM_CheckNumOperands, /*MI*/0, /*Expected*/4,
568 GIM_CheckIntrinsicID, /*MI*/0, /*Op*/1, GIMT_Encode2(Intrinsic::bpf_pseudo),
569 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
570 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
571 GIM_RootCheckType, /*Op*/3, /*Type*/GILLT_s64,
572 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
573 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
574 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_CONSTANT),
575 // MIs[1] Operand 1
576 // No operand predicates
577 GIM_RecordInsn, /*DefineMI*/2, /*MI*/0, /*OpIdx*/3, // MIs[2]
578 GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_CONSTANT),
579 // MIs[2] Operand 1
580 // No operand predicates
581 GIM_CheckIsSafeToFold, /*NumInsns*/2,
582 // (intrinsic_w_chain:{ *:[i64] } 3628:{ *:[iPTR] }, (imm:{ *:[i64] }):$pseudo, (imm:{ *:[i64] }):$imm) => (LD_pseudo:{ *:[i64] } (imm:{ *:[i64] }):$pseudo, (imm:{ *:[i64] }):$imm)
583 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::LD_pseudo),
584 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
585 GIR_CopyConstantAsSImm, /*NewInsnID*/0, /*OldInsnID*/1, // pseudo
586 GIR_CopyConstantAsSImm, /*NewInsnID*/0, /*OldInsnID*/2, // imm
587 GIR_MergeMemOperands, /*InsnID*/0, /*NumInsns*/3, /*MergeInsnID's*/0, 1, 2,
588 GIR_RootConstrainSelectedInstOperands,
589 // GIR_Coverage, 107,
590 GIR_EraseRootFromParent_Done,
591 // Label 78: @1597
592 GIM_Reject,
593 // Label 11: @1598
594 GIM_Try, /*On fail goto*//*Label 79*/ GIMT_Encode4(1660), // Rule ID 190 //
595 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
596 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
597 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
598 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
599 // (anyext:{ *:[i64] } GPR32:{ *:[i32] }:$src) => (INSERT_SUBREG:{ *:[i64] } (IMPLICIT_DEF:{ *:[i64] }), GPR32:{ *:[i32] }:$src, sub_32:{ *:[i32] })
600 GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
601 GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(TargetOpcode::IMPLICIT_DEF),
602 GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
603 GIR_ConstrainSelectedInstOperands, /*InsnID*/1,
604 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::INSERT_SUBREG),
605 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
606 GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
607 GIR_RootToRootCopy, /*OpIdx*/1, // src
608 GIR_AddImm8, /*InsnID*/0, /*Imm*/1,
609 GIR_ConstrainOperandRC, /*InsnID*/0, /*Op*/0, GIMT_Encode2(BPF::GPRRegClassID),
610 GIR_ConstrainOperandRC, /*InsnID*/0, /*Op*/1, GIMT_Encode2(BPF::GPRRegClassID),
611 GIR_ConstrainOperandRC, /*InsnID*/0, /*Op*/2, GIMT_Encode2(BPF::GPR32RegClassID),
612 // GIR_Coverage, 190,
613 GIR_EraseRootFromParent_Done,
614 // Label 79: @1660
615 GIM_Reject,
616 // Label 12: @1661
617 GIM_Try, /*On fail goto*//*Label 80*/ GIMT_Encode4(1702), // Rule ID 189 //
618 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
619 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
620 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
621 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
622 // (trunc:{ *:[i32] } GPR:{ *:[i64] }:$src) => (EXTRACT_SUBREG:{ *:[i32] } GPR:{ *:[i64] }:$src, sub_32:{ *:[i32] })
623 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::COPY),
624 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
625 GIR_CopySubReg, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/1, /*SubRegIdx*/GIMT_Encode2(1), // src
626 GIR_ConstrainOperandRC, /*InsnID*/0, /*Op*/0, GIMT_Encode2(BPF::GPR32RegClassID),
627 GIR_ConstrainOperandRC, /*InsnID*/0, /*Op*/1, GIMT_Encode2(BPF::GPRRegClassID),
628 // GIR_Coverage, 189,
629 GIR_EraseRootFromParent_Done,
630 // Label 80: @1702
631 GIM_Reject,
632 // Label 13: @1703
633 GIM_Try, /*On fail goto*//*Label 81*/ GIMT_Encode4(1725), // Rule ID 98 //
634 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
635 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
636 // MIs[0] Operand 1
637 // No operand predicates
638 // (imm:{ *:[i64] }):$imm => (LD_imm64:{ *:[i64] } (imm:{ *:[i64] }):$imm)
639 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::LD_imm64),
640 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
641 GIR_CopyConstantAsSImm, /*NewInsnID*/0, /*OldInsnID*/0, // imm
642 GIR_RootConstrainSelectedInstOperands,
643 // GIR_Coverage, 98,
644 GIR_EraseRootFromParent_Done,
645 // Label 81: @1725
646 GIM_Reject,
647 // Label 14: @1726
648 GIM_Try, /*On fail goto*//*Label 82*/ GIMT_Encode4(1841),
649 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
650 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
651 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
652 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
653 GIM_Try, /*On fail goto*//*Label 83*/ GIMT_Encode4(1804), // Rule ID 186 //
654 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFNoMovsx),
655 // (sext:{ *:[i64] } GPR32:{ *:[i32] }:$src) => (SRA_ri:{ *:[i64] } (SLL_ri:{ *:[i64] } (MOV_32_64:{ *:[i64] } GPR32:{ *:[i32] }:$src), 32:{ *:[i64] }), 32:{ *:[i64] })
656 GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
657 GIR_MakeTempReg, /*TempRegID*/1, /*TypeID*/GILLT_s64,
658 GIR_BuildMI, /*InsnID*/2, /*Opcode*/GIMT_Encode2(BPF::MOV_32_64),
659 GIR_AddTempRegister, /*InsnID*/2, /*TempRegID*/1, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
660 GIR_Copy, /*NewInsnID*/2, /*OldInsnID*/0, /*OpIdx*/1, // src
661 GIR_ConstrainSelectedInstOperands, /*InsnID*/2,
662 GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(BPF::SLL_ri),
663 GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
664 GIR_AddSimpleTempRegister, /*InsnID*/1, /*TempRegID*/1,
665 GIR_AddImm8, /*InsnID*/1, /*Imm*/32,
666 GIR_ConstrainSelectedInstOperands, /*InsnID*/1,
667 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::SRA_ri),
668 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
669 GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
670 GIR_AddImm8, /*InsnID*/0, /*Imm*/32,
671 GIR_RootConstrainSelectedInstOperands,
672 // GIR_Coverage, 186,
673 GIR_EraseRootFromParent_Done,
674 // Label 83: @1804
675 GIM_Try, /*On fail goto*//*Label 84*/ GIMT_Encode4(1840), // Rule ID 187 //
676 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasMovsx),
677 // (sext:{ *:[i64] } GPR32:{ *:[i32] }:$src) => (MOVSX_rr_32:{ *:[i64] } (MOV_32_64:{ *:[i64] } GPR32:{ *:[i32] }:$src))
678 GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s64,
679 GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(BPF::MOV_32_64),
680 GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
681 GIR_Copy, /*NewInsnID*/1, /*OldInsnID*/0, /*OpIdx*/1, // src
682 GIR_ConstrainSelectedInstOperands, /*InsnID*/1,
683 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::MOVSX_rr_32),
684 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
685 GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
686 GIR_RootConstrainSelectedInstOperands,
687 // GIR_Coverage, 187,
688 GIR_EraseRootFromParent_Done,
689 // Label 84: @1840
690 GIM_Reject,
691 // Label 82: @1841
692 GIM_Reject,
693 // Label 15: @1842
694 GIM_Try, /*On fail goto*//*Label 85*/ GIMT_Encode4(1868), // Rule ID 188 //
695 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
696 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
697 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
698 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
699 // (zext:{ *:[i64] } GPR32:{ *:[i32] }:$src) => (MOV_32_64:{ *:[i64] } GPR32:{ *:[i32] }:$src)
700 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::MOV_32_64),
701 GIR_RootConstrainSelectedInstOperands,
702 // GIR_Coverage, 188,
703 GIR_Done,
704 // Label 85: @1868
705 GIM_Reject,
706 // Label 16: @1869
707 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 88*/ GIMT_Encode4(1934),
708 /*GILLT_s32*//*Label 86*/ GIMT_Encode4(1888),
709 /*GILLT_s64*//*Label 87*/ GIMT_Encode4(1911),
710 // Label 86: @1888
711 GIM_Try, /*On fail goto*//*Label 89*/ GIMT_Encode4(1910), // Rule ID 62 //
712 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
713 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
714 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
715 // (shl:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SLL_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
716 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SLL_rr_32),
717 GIR_RootConstrainSelectedInstOperands,
718 // GIR_Coverage, 62,
719 GIR_Done,
720 // Label 89: @1910
721 GIM_Reject,
722 // Label 87: @1911
723 GIM_Try, /*On fail goto*//*Label 90*/ GIMT_Encode4(1933), // Rule ID 60 //
724 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
725 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
726 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
727 // (shl:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SLL_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
728 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SLL_rr),
729 GIR_RootConstrainSelectedInstOperands,
730 // GIR_Coverage, 60,
731 GIR_Done,
732 // Label 90: @1933
733 GIM_Reject,
734 // Label 88: @1934
735 GIM_Reject,
736 // Label 17: @1935
737 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 93*/ GIMT_Encode4(2258),
738 /*GILLT_s32*//*Label 91*/ GIMT_Encode4(1954),
739 /*GILLT_s64*//*Label 92*/ GIMT_Encode4(1977),
740 // Label 91: @1954
741 GIM_Try, /*On fail goto*//*Label 94*/ GIMT_Encode4(1976), // Rule ID 66 //
742 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
743 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
744 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
745 // (srl:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SRL_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
746 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SRL_rr_32),
747 GIR_RootConstrainSelectedInstOperands,
748 // GIR_Coverage, 66,
749 GIR_Done,
750 // Label 94: @1976
751 GIM_Reject,
752 // Label 92: @1977
753 GIM_Try, /*On fail goto*//*Label 95*/ GIMT_Encode4(2257),
754 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
755 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
756 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
757 GIM_Try, /*On fail goto*//*Label 96*/ GIMT_Encode4(2034), // Rule ID 148 //
758 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
759 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
760 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
761 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
762 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
763 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 48,
764 GIM_CheckIsSafeToFold, /*NumInsns*/1,
765 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 48:{ *:[i64] }) => (BSWAP16:{ *:[i64] } GPR:{ *:[i64] }:$src)
766 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::BSWAP16),
767 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
768 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
769 GIR_RootConstrainSelectedInstOperands,
770 // GIR_Coverage, 148,
771 GIR_EraseRootFromParent_Done,
772 // Label 96: @2034
773 GIM_Try, /*On fail goto*//*Label 97*/ GIMT_Encode4(2076), // Rule ID 149 //
774 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
775 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
776 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
777 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
778 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
779 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 32,
780 GIM_CheckIsSafeToFold, /*NumInsns*/1,
781 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 32:{ *:[i64] }) => (BSWAP32:{ *:[i64] } GPR:{ *:[i64] }:$src)
782 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::BSWAP32),
783 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
784 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
785 GIR_RootConstrainSelectedInstOperands,
786 // GIR_Coverage, 149,
787 GIR_EraseRootFromParent_Done,
788 // Label 97: @2076
789 GIM_Try, /*On fail goto*//*Label 98*/ GIMT_Encode4(2118), // Rule ID 151 //
790 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
791 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
792 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
793 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
794 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
795 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 48,
796 GIM_CheckIsSafeToFold, /*NumInsns*/1,
797 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 48:{ *:[i64] }) => (BE16:{ *:[i64] } GPR:{ *:[i64] }:$src)
798 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::BE16),
799 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
800 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
801 GIR_RootConstrainSelectedInstOperands,
802 // GIR_Coverage, 151,
803 GIR_EraseRootFromParent_Done,
804 // Label 98: @2118
805 GIM_Try, /*On fail goto*//*Label 99*/ GIMT_Encode4(2160), // Rule ID 152 //
806 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
807 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
808 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
809 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
810 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
811 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 32,
812 GIM_CheckIsSafeToFold, /*NumInsns*/1,
813 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 32:{ *:[i64] }) => (BE32:{ *:[i64] } GPR:{ *:[i64] }:$src)
814 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::BE32),
815 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
816 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
817 GIR_RootConstrainSelectedInstOperands,
818 // GIR_Coverage, 152,
819 GIR_EraseRootFromParent_Done,
820 // Label 99: @2160
821 GIM_Try, /*On fail goto*//*Label 100*/ GIMT_Encode4(2202), // Rule ID 154 //
822 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
823 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
824 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
825 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
826 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
827 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 48,
828 GIM_CheckIsSafeToFold, /*NumInsns*/1,
829 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 48:{ *:[i64] }) => (LE16:{ *:[i64] } GPR:{ *:[i64] }:$src)
830 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::LE16),
831 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
832 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
833 GIR_RootConstrainSelectedInstOperands,
834 // GIR_Coverage, 154,
835 GIR_EraseRootFromParent_Done,
836 // Label 100: @2202
837 GIM_Try, /*On fail goto*//*Label 101*/ GIMT_Encode4(2244), // Rule ID 155 //
838 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
839 GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
840 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BSWAP),
841 GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s64,
842 GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
843 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 32,
844 GIM_CheckIsSafeToFold, /*NumInsns*/1,
845 // (srl:{ *:[i64] } (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src), 32:{ *:[i64] }) => (LE32:{ *:[i64] } GPR:{ *:[i64] }:$src)
846 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(BPF::LE32),
847 GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
848 GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
849 GIR_RootConstrainSelectedInstOperands,
850 // GIR_Coverage, 155,
851 GIR_EraseRootFromParent_Done,
852 // Label 101: @2244
853 GIM_Try, /*On fail goto*//*Label 102*/ GIMT_Encode4(2256), // Rule ID 64 //
854 // (srl:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SRL_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
855 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SRL_rr),
856 GIR_RootConstrainSelectedInstOperands,
857 // GIR_Coverage, 64,
858 GIR_Done,
859 // Label 102: @2256
860 GIM_Reject,
861 // Label 95: @2257
862 GIM_Reject,
863 // Label 93: @2258
864 GIM_Reject,
865 // Label 18: @2259
866 GIM_SwitchType, /*MI*/0, /*Op*/0, /*[*/GIMT_Encode2(0), GIMT_Encode2(2), /*)*//*default:*//*Label 105*/ GIMT_Encode4(2324),
867 /*GILLT_s32*//*Label 103*/ GIMT_Encode4(2278),
868 /*GILLT_s64*//*Label 104*/ GIMT_Encode4(2301),
869 // Label 103: @2278
870 GIM_Try, /*On fail goto*//*Label 106*/ GIMT_Encode4(2300), // Rule ID 74 //
871 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
872 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
873 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPR32RegClassID),
874 // (sra:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src) => (SRA_rr_32:{ *:[i32] } i32:{ *:[i32] }:$src2, i32:{ *:[i32] }:$src)
875 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SRA_rr_32),
876 GIR_RootConstrainSelectedInstOperands,
877 // GIR_Coverage, 74,
878 GIR_Done,
879 // Label 106: @2300
880 GIM_Reject,
881 // Label 104: @2301
882 GIM_Try, /*On fail goto*//*Label 107*/ GIMT_Encode4(2323), // Rule ID 72 //
883 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
884 GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s64,
885 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
886 // (sra:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src) => (SRA_rr:{ *:[i64] } i64:{ *:[i64] }:$src2, i64:{ *:[i64] }:$src)
887 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::SRA_rr),
888 GIR_RootConstrainSelectedInstOperands,
889 // GIR_Coverage, 72,
890 GIR_Done,
891 // Label 107: @2323
892 GIM_Reject,
893 // Label 105: @2324
894 GIM_Reject,
895 // Label 19: @2325
896 GIM_Try, /*On fail goto*//*Label 108*/ GIMT_Encode4(2340), // Rule ID 123 //
897 // MIs[0] BrDst
898 GIM_CheckIsMBB, /*MI*/0, /*Op*/0,
899 // (br (bb:{ *:[Other] }):$BrDst) => (JMP (bb:{ *:[Other] }):$BrDst)
900 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::JMP),
901 GIR_RootConstrainSelectedInstOperands,
902 // GIR_Coverage, 123,
903 GIR_Done,
904 // Label 108: @2340
905 GIM_Reject,
906 // Label 20: @2341
907 GIM_Try, /*On fail goto*//*Label 109*/ GIMT_Encode4(2406),
908 GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s64,
909 GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s64,
910 GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
911 GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(BPF::GPRRegClassID),
912 GIM_Try, /*On fail goto*//*Label 110*/ GIMT_Encode4(2375), // Rule ID 150 //
913 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
914 // (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src) => (BSWAP64:{ *:[i64] } GPR:{ *:[i64] }:$src)
915 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::BSWAP64),
916 GIR_RootConstrainSelectedInstOperands,
917 // GIR_Coverage, 150,
918 GIR_Done,
919 // Label 110: @2375
920 GIM_Try, /*On fail goto*//*Label 111*/ GIMT_Encode4(2390), // Rule ID 153 //
921 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
922 // (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src) => (BE64:{ *:[i64] } GPR:{ *:[i64] }:$src)
923 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::BE64),
924 GIR_RootConstrainSelectedInstOperands,
925 // GIR_Coverage, 153,
926 GIR_Done,
927 // Label 111: @2390
928 GIM_Try, /*On fail goto*//*Label 112*/ GIMT_Encode4(2405), // Rule ID 156 //
929 GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
930 // (bswap:{ *:[i64] } GPR:{ *:[i64] }:$src) => (LE64:{ *:[i64] } GPR:{ *:[i64] }:$src)
931 GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(BPF::LE64),
932 GIR_RootConstrainSelectedInstOperands,
933 // GIR_Coverage, 156,
934 GIR_Done,
935 // Label 112: @2405
936 GIM_Reject,
937 // Label 109: @2406
938 GIM_Reject,
939 // Label 21: @2407
940 GIM_Reject,
941 }; // Size: 2408 bytes
942 return MatchTable0;
943}
944#undef GIMT_Encode2
945#undef GIMT_Encode4
946#undef GIMT_Encode8
947
948#endif // ifdef GET_GLOBALISEL_IMPL
949
950#ifdef GET_GLOBALISEL_PREDICATES_DECL
951PredicateBitset AvailableModuleFeatures;
952mutable PredicateBitset AvailableFunctionFeatures;
953PredicateBitset getAvailableFeatures() const {
954 return AvailableModuleFeatures | AvailableFunctionFeatures;
955}
956PredicateBitset
957computeAvailableModuleFeatures(const BPFSubtarget *Subtarget) const;
958PredicateBitset
959computeAvailableFunctionFeatures(const BPFSubtarget *Subtarget,
960 const MachineFunction *MF) const;
961void setupGeneratedPerFunctionState(MachineFunction &MF) override;
962#endif // ifdef GET_GLOBALISEL_PREDICATES_DECL
963#ifdef GET_GLOBALISEL_PREDICATES_INIT
964AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
965AvailableFunctionFeatures()
966#endif // ifdef GET_GLOBALISEL_PREDICATES_INIT
967