blob: 8c680cdf9b47ff4350163ce5dcd3652e1c5d6dd9 [file] [log] [blame]
Diana Picus22274932016-11-11 08:27:37 +00001//===- ARMInstructionSelector.cpp ----------------------------*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9/// \file
10/// This file implements the targeting of the InstructionSelector class for ARM.
11/// \todo This should be generated by TableGen.
12//===----------------------------------------------------------------------===//
13
Diana Picus22274932016-11-11 08:27:37 +000014#include "ARMRegisterBankInfo.h"
15#include "ARMSubtarget.h"
16#include "ARMTargetMachine.h"
Diana Picus674888d2017-04-28 09:10:38 +000017#include "llvm/CodeGen/GlobalISel/InstructionSelector.h"
Diana Picus812caee2016-12-16 12:54:46 +000018#include "llvm/CodeGen/MachineRegisterInfo.h"
Diana Picus22274932016-11-11 08:27:37 +000019#include "llvm/Support/Debug.h"
20
21#define DEBUG_TYPE "arm-isel"
22
23using namespace llvm;
24
25#ifndef LLVM_BUILD_GLOBAL_ISEL
26#error "You shouldn't build this"
27#endif
28
Diana Picus674888d2017-04-28 09:10:38 +000029namespace {
Diana Picus8abcbbb2017-05-02 09:40:49 +000030
31#define GET_GLOBALISEL_PREDICATE_BITSET
32#include "ARMGenGlobalISel.inc"
33#undef GET_GLOBALISEL_PREDICATE_BITSET
34
Diana Picus674888d2017-04-28 09:10:38 +000035class ARMInstructionSelector : public InstructionSelector {
36public:
Diana Picus8abcbbb2017-05-02 09:40:49 +000037 ARMInstructionSelector(const ARMBaseTargetMachine &TM, const ARMSubtarget &STI,
Diana Picus674888d2017-04-28 09:10:38 +000038 const ARMRegisterBankInfo &RBI);
39
40 bool select(MachineInstr &I) const override;
41
42private:
Diana Picus8abcbbb2017-05-02 09:40:49 +000043 bool selectImpl(MachineInstr &I) const;
44
Diana Picus674888d2017-04-28 09:10:38 +000045 const ARMBaseInstrInfo &TII;
46 const ARMBaseRegisterInfo &TRI;
Diana Picus8abcbbb2017-05-02 09:40:49 +000047 const ARMBaseTargetMachine &TM;
Diana Picus674888d2017-04-28 09:10:38 +000048 const ARMRegisterBankInfo &RBI;
Diana Picus8abcbbb2017-05-02 09:40:49 +000049 const ARMSubtarget &STI;
50
51#define GET_GLOBALISEL_PREDICATES_DECL
52#include "ARMGenGlobalISel.inc"
53#undef GET_GLOBALISEL_PREDICATES_DECL
54
55// We declare the temporaries used by selectImpl() in the class to minimize the
56// cost of constructing placeholder values.
57#define GET_GLOBALISEL_TEMPORARIES_DECL
58#include "ARMGenGlobalISel.inc"
59#undef GET_GLOBALISEL_TEMPORARIES_DECL
Diana Picus674888d2017-04-28 09:10:38 +000060};
61} // end anonymous namespace
62
63namespace llvm {
64InstructionSelector *
Diana Picus8abcbbb2017-05-02 09:40:49 +000065createARMInstructionSelector(const ARMBaseTargetMachine &TM,
66 const ARMSubtarget &STI,
Diana Picus674888d2017-04-28 09:10:38 +000067 const ARMRegisterBankInfo &RBI) {
Diana Picus8abcbbb2017-05-02 09:40:49 +000068 return new ARMInstructionSelector(TM, STI, RBI);
Diana Picus674888d2017-04-28 09:10:38 +000069}
70}
71
Diana Picus8abcbbb2017-05-02 09:40:49 +000072unsigned zero_reg = 0;
73
74#define GET_GLOBALISEL_IMPL
75#include "ARMGenGlobalISel.inc"
76#undef GET_GLOBALISEL_IMPL
77
78ARMInstructionSelector::ARMInstructionSelector(const ARMBaseTargetMachine &TM,
79 const ARMSubtarget &STI,
Diana Picus22274932016-11-11 08:27:37 +000080 const ARMRegisterBankInfo &RBI)
Diana Picus895c6aa2016-11-15 16:42:10 +000081 : InstructionSelector(), TII(*STI.getInstrInfo()),
Diana Picus8abcbbb2017-05-02 09:40:49 +000082 TRI(*STI.getRegisterInfo()), TM(TM), RBI(RBI), STI(STI),
83#define GET_GLOBALISEL_PREDICATES_INIT
84#include "ARMGenGlobalISel.inc"
85#undef GET_GLOBALISEL_PREDICATES_INIT
86#define GET_GLOBALISEL_TEMPORARIES_INIT
87#include "ARMGenGlobalISel.inc"
88#undef GET_GLOBALISEL_TEMPORARIES_INIT
89{
90}
Diana Picus22274932016-11-11 08:27:37 +000091
Diana Picus812caee2016-12-16 12:54:46 +000092static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII,
93 MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI,
94 const RegisterBankInfo &RBI) {
95 unsigned DstReg = I.getOperand(0).getReg();
96 if (TargetRegisterInfo::isPhysicalRegister(DstReg))
97 return true;
98
99 const RegisterBank *RegBank = RBI.getRegBank(DstReg, MRI, TRI);
Benjamin Kramer24bf8682016-12-16 13:13:03 +0000100 (void)RegBank;
Diana Picus812caee2016-12-16 12:54:46 +0000101 assert(RegBank && "Can't get reg bank for virtual register");
102
Diana Picus36aa09f2016-12-19 14:07:50 +0000103 const unsigned DstSize = MRI.getType(DstReg).getSizeInBits();
Diana Picus4fa83c02017-02-08 13:23:04 +0000104 assert((RegBank->getID() == ARM::GPRRegBankID ||
105 RegBank->getID() == ARM::FPRRegBankID) &&
106 "Unsupported reg bank");
107
Diana Picus812caee2016-12-16 12:54:46 +0000108 const TargetRegisterClass *RC = &ARM::GPRRegClass;
109
Diana Picus4fa83c02017-02-08 13:23:04 +0000110 if (RegBank->getID() == ARM::FPRRegBankID) {
Diana Picus6beef3c2017-02-16 12:19:52 +0000111 if (DstSize == 32)
112 RC = &ARM::SPRRegClass;
113 else if (DstSize == 64)
114 RC = &ARM::DPRRegClass;
115 else
116 llvm_unreachable("Unsupported destination size");
Diana Picus4fa83c02017-02-08 13:23:04 +0000117 }
118
Diana Picus812caee2016-12-16 12:54:46 +0000119 // No need to constrain SrcReg. It will get constrained when
120 // we hit another of its uses or its defs.
121 // Copies do not have constraints.
122 if (!RBI.constrainGenericRegister(DstReg, *RC, MRI)) {
123 DEBUG(dbgs() << "Failed to constrain " << TII.getName(I.getOpcode())
124 << " operand\n");
125 return false;
126 }
127 return true;
128}
129
Diana Picusb1701e02017-02-16 12:19:57 +0000130static bool selectSequence(MachineInstrBuilder &MIB,
131 const ARMBaseInstrInfo &TII,
132 MachineRegisterInfo &MRI,
133 const TargetRegisterInfo &TRI,
134 const RegisterBankInfo &RBI) {
135 assert(TII.getSubtarget().hasVFP2() && "Can't select sequence without VFP");
136
137 // We only support G_SEQUENCE as a way to stick together two scalar GPRs
138 // into one DPR.
139 unsigned VReg0 = MIB->getOperand(0).getReg();
140 (void)VReg0;
141 assert(MRI.getType(VReg0).getSizeInBits() == 64 &&
142 RBI.getRegBank(VReg0, MRI, TRI)->getID() == ARM::FPRRegBankID &&
143 "Unsupported operand for G_SEQUENCE");
144 unsigned VReg1 = MIB->getOperand(1).getReg();
145 (void)VReg1;
146 assert(MRI.getType(VReg1).getSizeInBits() == 32 &&
147 RBI.getRegBank(VReg1, MRI, TRI)->getID() == ARM::GPRRegBankID &&
148 "Unsupported operand for G_SEQUENCE");
149 unsigned VReg2 = MIB->getOperand(3).getReg();
150 (void)VReg2;
151 assert(MRI.getType(VReg2).getSizeInBits() == 32 &&
152 RBI.getRegBank(VReg2, MRI, TRI)->getID() == ARM::GPRRegBankID &&
153 "Unsupported operand for G_SEQUENCE");
154
155 // Remove the operands corresponding to the offsets.
156 MIB->RemoveOperand(4);
157 MIB->RemoveOperand(2);
158
159 MIB->setDesc(TII.get(ARM::VMOVDRR));
160 MIB.add(predOps(ARMCC::AL));
161
162 return true;
163}
164
165static bool selectExtract(MachineInstrBuilder &MIB, const ARMBaseInstrInfo &TII,
166 MachineRegisterInfo &MRI,
167 const TargetRegisterInfo &TRI,
168 const RegisterBankInfo &RBI) {
169 assert(TII.getSubtarget().hasVFP2() && "Can't select extract without VFP");
170
171 // We only support G_EXTRACT as a way to break up one DPR into two GPRs.
172 unsigned VReg0 = MIB->getOperand(0).getReg();
173 (void)VReg0;
174 assert(MRI.getType(VReg0).getSizeInBits() == 32 &&
175 RBI.getRegBank(VReg0, MRI, TRI)->getID() == ARM::GPRRegBankID &&
Tim Northoverc2c545b2017-03-06 23:50:28 +0000176 "Unsupported operand for G_EXTRACT");
Diana Picusb1701e02017-02-16 12:19:57 +0000177 unsigned VReg1 = MIB->getOperand(1).getReg();
178 (void)VReg1;
Tim Northoverc2c545b2017-03-06 23:50:28 +0000179 assert(MRI.getType(VReg1).getSizeInBits() == 64 &&
180 RBI.getRegBank(VReg1, MRI, TRI)->getID() == ARM::FPRRegBankID &&
181 "Unsupported operand for G_EXTRACT");
182 assert(MIB->getOperand(2).getImm() % 32 == 0 &&
183 "Unsupported operand for G_EXTRACT");
Diana Picusb1701e02017-02-16 12:19:57 +0000184
185 // Remove the operands corresponding to the offsets.
Tim Northoverc2c545b2017-03-06 23:50:28 +0000186 MIB->getOperand(2).setImm(MIB->getOperand(2).getImm() / 32);
Diana Picusb1701e02017-02-16 12:19:57 +0000187
Tim Northoverc2c545b2017-03-06 23:50:28 +0000188 MIB->setDesc(TII.get(ARM::VGETLNi32));
Diana Picusb1701e02017-02-16 12:19:57 +0000189 MIB.add(predOps(ARMCC::AL));
190
191 return true;
192}
193
Diana Picus8b6c6be2017-01-25 08:10:40 +0000194/// Select the opcode for simple extensions (that translate to a single SXT/UXT
195/// instruction). Extension operations more complicated than that should not
Diana Picuse8368782017-02-17 13:44:19 +0000196/// invoke this. Returns the original opcode if it doesn't know how to select a
197/// better one.
Diana Picus8b6c6be2017-01-25 08:10:40 +0000198static unsigned selectSimpleExtOpc(unsigned Opc, unsigned Size) {
199 using namespace TargetOpcode;
200
Diana Picuse8368782017-02-17 13:44:19 +0000201 if (Size != 8 && Size != 16)
202 return Opc;
Diana Picus8b6c6be2017-01-25 08:10:40 +0000203
204 if (Opc == G_SEXT)
205 return Size == 8 ? ARM::SXTB : ARM::SXTH;
206
207 if (Opc == G_ZEXT)
208 return Size == 8 ? ARM::UXTB : ARM::UXTH;
209
Diana Picuse8368782017-02-17 13:44:19 +0000210 return Opc;
Diana Picus8b6c6be2017-01-25 08:10:40 +0000211}
212
Diana Picus3b99c642017-02-24 14:01:27 +0000213/// Select the opcode for simple loads and stores. For types smaller than 32
214/// bits, the value will be zero extended. Returns the original opcode if it
215/// doesn't know how to select a better one.
216static unsigned selectLoadStoreOpCode(unsigned Opc, unsigned RegBank,
217 unsigned Size) {
218 bool isStore = Opc == TargetOpcode::G_STORE;
219
Diana Picus1540b062017-02-16 14:10:50 +0000220 if (RegBank == ARM::GPRRegBankID) {
221 switch (Size) {
222 case 1:
223 case 8:
Diana Picus3b99c642017-02-24 14:01:27 +0000224 return isStore ? ARM::STRBi12 : ARM::LDRBi12;
Diana Picus1540b062017-02-16 14:10:50 +0000225 case 16:
Diana Picus3b99c642017-02-24 14:01:27 +0000226 return isStore ? ARM::STRH : ARM::LDRH;
Diana Picus1540b062017-02-16 14:10:50 +0000227 case 32:
Diana Picus3b99c642017-02-24 14:01:27 +0000228 return isStore ? ARM::STRi12 : ARM::LDRi12;
Diana Picuse8368782017-02-17 13:44:19 +0000229 default:
Diana Picus3b99c642017-02-24 14:01:27 +0000230 return Opc;
Diana Picus1540b062017-02-16 14:10:50 +0000231 }
Diana Picus1540b062017-02-16 14:10:50 +0000232 }
233
Diana Picuse8368782017-02-17 13:44:19 +0000234 if (RegBank == ARM::FPRRegBankID) {
235 switch (Size) {
236 case 32:
Diana Picus3b99c642017-02-24 14:01:27 +0000237 return isStore ? ARM::VSTRS : ARM::VLDRS;
Diana Picuse8368782017-02-17 13:44:19 +0000238 case 64:
Diana Picus3b99c642017-02-24 14:01:27 +0000239 return isStore ? ARM::VSTRD : ARM::VLDRD;
Diana Picuse8368782017-02-17 13:44:19 +0000240 default:
Diana Picus3b99c642017-02-24 14:01:27 +0000241 return Opc;
Diana Picuse8368782017-02-17 13:44:19 +0000242 }
Diana Picus278c7222017-01-26 09:20:47 +0000243 }
244
Diana Picus3b99c642017-02-24 14:01:27 +0000245 return Opc;
Diana Picus278c7222017-01-26 09:20:47 +0000246}
247
Diana Picus812caee2016-12-16 12:54:46 +0000248bool ARMInstructionSelector::select(MachineInstr &I) const {
249 assert(I.getParent() && "Instruction should be in a basic block!");
250 assert(I.getParent()->getParent() && "Instruction should be in a function!");
251
252 auto &MBB = *I.getParent();
253 auto &MF = *MBB.getParent();
254 auto &MRI = MF.getRegInfo();
255
256 if (!isPreISelGenericOpcode(I.getOpcode())) {
257 if (I.isCopy())
258 return selectCopy(I, TII, MRI, TRI, RBI);
259
260 return true;
261 }
262
Diana Picus8abcbbb2017-05-02 09:40:49 +0000263 if (selectImpl(I))
264 return true;
265
Diana Picus519807f2016-12-19 11:26:31 +0000266 MachineInstrBuilder MIB{MF, I};
Diana Picusd83df5d2017-01-25 08:47:40 +0000267 bool isSExt = false;
Diana Picus519807f2016-12-19 11:26:31 +0000268
269 using namespace TargetOpcode;
270 switch (I.getOpcode()) {
Diana Picus8b6c6be2017-01-25 08:10:40 +0000271 case G_SEXT:
Diana Picusd83df5d2017-01-25 08:47:40 +0000272 isSExt = true;
273 LLVM_FALLTHROUGH;
Diana Picus8b6c6be2017-01-25 08:10:40 +0000274 case G_ZEXT: {
275 LLT DstTy = MRI.getType(I.getOperand(0).getReg());
276 // FIXME: Smaller destination sizes coming soon!
277 if (DstTy.getSizeInBits() != 32) {
278 DEBUG(dbgs() << "Unsupported destination size for extension");
279 return false;
280 }
281
282 LLT SrcTy = MRI.getType(I.getOperand(1).getReg());
283 unsigned SrcSize = SrcTy.getSizeInBits();
284 switch (SrcSize) {
Diana Picusd83df5d2017-01-25 08:47:40 +0000285 case 1: {
286 // ZExt boils down to & 0x1; for SExt we also subtract that from 0
287 I.setDesc(TII.get(ARM::ANDri));
288 MIB.addImm(1).add(predOps(ARMCC::AL)).add(condCodeOp());
289
290 if (isSExt) {
291 unsigned SExtResult = I.getOperand(0).getReg();
292
293 // Use a new virtual register for the result of the AND
294 unsigned AndResult = MRI.createVirtualRegister(&ARM::GPRRegClass);
295 I.getOperand(0).setReg(AndResult);
296
297 auto InsertBefore = std::next(I.getIterator());
Martin Bohme8396e142017-01-25 14:28:19 +0000298 auto SubI =
Diana Picusd83df5d2017-01-25 08:47:40 +0000299 BuildMI(MBB, InsertBefore, I.getDebugLoc(), TII.get(ARM::RSBri))
300 .addDef(SExtResult)
301 .addUse(AndResult)
302 .addImm(0)
303 .add(predOps(ARMCC::AL))
304 .add(condCodeOp());
305 if (!constrainSelectedInstRegOperands(*SubI, TII, TRI, RBI))
306 return false;
307 }
308 break;
309 }
Diana Picus8b6c6be2017-01-25 08:10:40 +0000310 case 8:
311 case 16: {
312 unsigned NewOpc = selectSimpleExtOpc(I.getOpcode(), SrcSize);
Diana Picuse8368782017-02-17 13:44:19 +0000313 if (NewOpc == I.getOpcode())
314 return false;
Diana Picus8b6c6be2017-01-25 08:10:40 +0000315 I.setDesc(TII.get(NewOpc));
316 MIB.addImm(0).add(predOps(ARMCC::AL));
317 break;
318 }
319 default:
320 DEBUG(dbgs() << "Unsupported source size for extension");
321 return false;
322 }
323 break;
324 }
Diana Picus657bfd32017-05-11 08:28:31 +0000325 case G_ANYEXT:
Diana Picus64a33432017-04-21 13:16:50 +0000326 case G_TRUNC: {
327 // The high bits are undefined, so there's nothing special to do, just
328 // treat it as a copy.
329 auto SrcReg = I.getOperand(1).getReg();
330 auto DstReg = I.getOperand(0).getReg();
331
332 const auto &SrcRegBank = *RBI.getRegBank(SrcReg, MRI, TRI);
333 const auto &DstRegBank = *RBI.getRegBank(DstReg, MRI, TRI);
334
335 if (SrcRegBank.getID() != DstRegBank.getID()) {
Diana Picus657bfd32017-05-11 08:28:31 +0000336 DEBUG(dbgs() << "G_TRUNC/G_ANYEXT operands on different register banks\n");
Diana Picus64a33432017-04-21 13:16:50 +0000337 return false;
338 }
339
340 if (SrcRegBank.getID() != ARM::GPRRegBankID) {
Diana Picus657bfd32017-05-11 08:28:31 +0000341 DEBUG(dbgs() << "G_TRUNC/G_ANYEXT on non-GPR not supported yet\n");
Diana Picus64a33432017-04-21 13:16:50 +0000342 return false;
343 }
344
345 I.setDesc(TII.get(COPY));
346 return selectCopy(I, TII, MRI, TRI, RBI);
347 }
Diana Picus519807f2016-12-19 11:26:31 +0000348 case G_ADD:
Diana Picus9d070942017-02-28 10:14:38 +0000349 case G_GEP:
Diana Picus812caee2016-12-16 12:54:46 +0000350 I.setDesc(TII.get(ARM::ADDrr));
Diana Picus8a73f552017-01-13 10:18:01 +0000351 MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
Diana Picus519807f2016-12-19 11:26:31 +0000352 break;
Diana Picusa3a0ccc2017-04-18 12:35:28 +0000353 case G_SUB:
354 I.setDesc(TII.get(ARM::SUBrr));
355 MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
356 break;
Diana Picus49472ff2017-04-19 07:29:46 +0000357 case G_MUL:
358 if (TII.getSubtarget().hasV6Ops()) {
359 I.setDesc(TII.get(ARM::MUL));
360 } else {
361 assert(TII.getSubtarget().useMulOps() && "Unsupported target");
362 I.setDesc(TII.get(ARM::MULv5));
363 MIB->getOperand(0).setIsEarlyClobber(true);
364 }
365 MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
366 break;
Diana Picus519807f2016-12-19 11:26:31 +0000367 case G_FRAME_INDEX:
368 // Add 0 to the given frame index and hope it will eventually be folded into
369 // the user(s).
370 I.setDesc(TII.get(ARM::ADDri));
Diana Picus8a73f552017-01-13 10:18:01 +0000371 MIB.addImm(0).add(predOps(ARMCC::AL)).add(condCodeOp());
Diana Picus519807f2016-12-19 11:26:31 +0000372 break;
Diana Picus5a7203a2017-02-28 13:05:42 +0000373 case G_CONSTANT: {
374 unsigned Reg = I.getOperand(0).getReg();
375 if (MRI.getType(Reg).getSizeInBits() != 32)
376 return false;
377
378 assert(RBI.getRegBank(Reg, MRI, TRI)->getID() == ARM::GPRRegBankID &&
379 "Expected constant to live in a GPR");
380 I.setDesc(TII.get(ARM::MOVi));
381 MIB.add(predOps(ARMCC::AL)).add(condCodeOp());
Diana Picus95a8aa92017-04-24 06:30:56 +0000382
383 auto &Val = I.getOperand(1);
384 if (Val.isCImm()) {
385 if (Val.getCImm()->getBitWidth() > 32)
386 return false;
387 Val.ChangeToImmediate(Val.getCImm()->getZExtValue());
388 }
389
390 if (!Val.isImm()) {
391 return false;
392 }
393
Diana Picus5a7203a2017-02-28 13:05:42 +0000394 break;
395 }
Diana Picus3b99c642017-02-24 14:01:27 +0000396 case G_STORE:
Diana Picus278c7222017-01-26 09:20:47 +0000397 case G_LOAD: {
Diana Picus1c33c9f2017-02-20 14:45:58 +0000398 const auto &MemOp = **I.memoperands_begin();
399 if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) {
400 DEBUG(dbgs() << "Atomic load/store not supported yet\n");
401 return false;
402 }
403
Diana Picus1540b062017-02-16 14:10:50 +0000404 unsigned Reg = I.getOperand(0).getReg();
405 unsigned RegBank = RBI.getRegBank(Reg, MRI, TRI)->getID();
406
407 LLT ValTy = MRI.getType(Reg);
Diana Picus278c7222017-01-26 09:20:47 +0000408 const auto ValSize = ValTy.getSizeInBits();
409
Diana Picus1540b062017-02-16 14:10:50 +0000410 assert((ValSize != 64 || TII.getSubtarget().hasVFP2()) &&
Diana Picus3b99c642017-02-24 14:01:27 +0000411 "Don't know how to load/store 64-bit value without VFP");
Diana Picus1540b062017-02-16 14:10:50 +0000412
Diana Picus3b99c642017-02-24 14:01:27 +0000413 const auto NewOpc = selectLoadStoreOpCode(I.getOpcode(), RegBank, ValSize);
414 if (NewOpc == G_LOAD || NewOpc == G_STORE)
Diana Picuse8368782017-02-17 13:44:19 +0000415 return false;
416
Diana Picus278c7222017-01-26 09:20:47 +0000417 I.setDesc(TII.get(NewOpc));
418
Diana Picus3b99c642017-02-24 14:01:27 +0000419 if (NewOpc == ARM::LDRH || NewOpc == ARM::STRH)
Diana Picus278c7222017-01-26 09:20:47 +0000420 // LDRH has a funny addressing mode (there's already a FIXME for it).
421 MIB.addReg(0);
Diana Picus4f8c3e12017-01-13 09:37:56 +0000422 MIB.addImm(0).add(predOps(ARMCC::AL));
Diana Picus519807f2016-12-19 11:26:31 +0000423 break;
Diana Picus278c7222017-01-26 09:20:47 +0000424 }
Diana Picusb1701e02017-02-16 12:19:57 +0000425 case G_SEQUENCE: {
426 if (!selectSequence(MIB, TII, MRI, TRI, RBI))
427 return false;
428 break;
429 }
430 case G_EXTRACT: {
431 if (!selectExtract(MIB, TII, MRI, TRI, RBI))
432 return false;
433 break;
434 }
Diana Picus519807f2016-12-19 11:26:31 +0000435 default:
436 return false;
Diana Picus812caee2016-12-16 12:54:46 +0000437 }
438
Diana Picus519807f2016-12-19 11:26:31 +0000439 return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
Diana Picus22274932016-11-11 08:27:37 +0000440}