Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 1 | //===- 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 | |
| 14 | #include "ARMInstructionSelector.h" |
| 15 | #include "ARMRegisterBankInfo.h" |
| 16 | #include "ARMSubtarget.h" |
| 17 | #include "ARMTargetMachine.h" |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 19 | #include "llvm/Support/Debug.h" |
| 20 | |
| 21 | #define DEBUG_TYPE "arm-isel" |
| 22 | |
| 23 | using namespace llvm; |
| 24 | |
| 25 | #ifndef LLVM_BUILD_GLOBAL_ISEL |
| 26 | #error "You shouldn't build this" |
| 27 | #endif |
| 28 | |
Diana Picus | 895c6aa | 2016-11-15 16:42:10 +0000 | [diff] [blame] | 29 | ARMInstructionSelector::ARMInstructionSelector(const ARMSubtarget &STI, |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 30 | const ARMRegisterBankInfo &RBI) |
Diana Picus | 895c6aa | 2016-11-15 16:42:10 +0000 | [diff] [blame] | 31 | : InstructionSelector(), TII(*STI.getInstrInfo()), |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 32 | TRI(*STI.getRegisterInfo()), RBI(RBI) {} |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 33 | |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 34 | static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, |
| 35 | MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, |
| 36 | const RegisterBankInfo &RBI) { |
| 37 | unsigned DstReg = I.getOperand(0).getReg(); |
| 38 | if (TargetRegisterInfo::isPhysicalRegister(DstReg)) |
| 39 | return true; |
| 40 | |
| 41 | const RegisterBank *RegBank = RBI.getRegBank(DstReg, MRI, TRI); |
Benjamin Kramer | 24bf868 | 2016-12-16 13:13:03 +0000 | [diff] [blame] | 42 | (void)RegBank; |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 43 | assert(RegBank && "Can't get reg bank for virtual register"); |
| 44 | |
Diana Picus | 36aa09f | 2016-12-19 14:07:50 +0000 | [diff] [blame] | 45 | const unsigned DstSize = MRI.getType(DstReg).getSizeInBits(); |
Daniel Jasper | 24218d5 | 2016-12-19 14:24:22 +0000 | [diff] [blame] | 46 | (void)DstSize; |
Diana Picus | 36aa09f | 2016-12-19 14:07:50 +0000 | [diff] [blame] | 47 | unsigned SrcReg = I.getOperand(1).getReg(); |
| 48 | const unsigned SrcSize = RBI.getSizeInBits(SrcReg, MRI, TRI); |
| 49 | (void)SrcSize; |
| 50 | assert((DstSize == SrcSize || |
| 51 | // Copies are a means to setup initial types, the number of |
| 52 | // bits may not exactly match. |
| 53 | (TargetRegisterInfo::isPhysicalRegister(SrcReg) && |
| 54 | DstSize <= SrcSize)) && |
Benjamin Kramer | 24bf868 | 2016-12-16 13:13:03 +0000 | [diff] [blame] | 55 | "Copy with different width?!"); |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 56 | |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 57 | assert((RegBank->getID() == ARM::GPRRegBankID || |
| 58 | RegBank->getID() == ARM::FPRRegBankID) && |
| 59 | "Unsupported reg bank"); |
| 60 | |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 61 | const TargetRegisterClass *RC = &ARM::GPRRegClass; |
| 62 | |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 63 | if (RegBank->getID() == ARM::FPRRegBankID) { |
Diana Picus | 6beef3c | 2017-02-16 12:19:52 +0000 | [diff] [blame] | 64 | if (DstSize == 32) |
| 65 | RC = &ARM::SPRRegClass; |
| 66 | else if (DstSize == 64) |
| 67 | RC = &ARM::DPRRegClass; |
| 68 | else |
| 69 | llvm_unreachable("Unsupported destination size"); |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 70 | } |
| 71 | |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 72 | // No need to constrain SrcReg. It will get constrained when |
| 73 | // we hit another of its uses or its defs. |
| 74 | // Copies do not have constraints. |
| 75 | if (!RBI.constrainGenericRegister(DstReg, *RC, MRI)) { |
| 76 | DEBUG(dbgs() << "Failed to constrain " << TII.getName(I.getOpcode()) |
| 77 | << " operand\n"); |
| 78 | return false; |
| 79 | } |
| 80 | return true; |
| 81 | } |
| 82 | |
Diana Picus | 6beef3c | 2017-02-16 12:19:52 +0000 | [diff] [blame] | 83 | static bool selectFAdd(MachineInstrBuilder &MIB, const ARMBaseInstrInfo &TII, |
| 84 | MachineRegisterInfo &MRI) { |
| 85 | assert(TII.getSubtarget().hasVFP2() && "Can't select fp add without vfp"); |
| 86 | |
| 87 | LLT Ty = MRI.getType(MIB->getOperand(0).getReg()); |
| 88 | unsigned ValSize = Ty.getSizeInBits(); |
| 89 | |
| 90 | if (ValSize == 32) { |
| 91 | if (TII.getSubtarget().useNEONForSinglePrecisionFP()) |
| 92 | return false; |
| 93 | MIB->setDesc(TII.get(ARM::VADDS)); |
| 94 | } else { |
| 95 | assert(ValSize == 64 && "Unsupported size for floating point value"); |
| 96 | if (TII.getSubtarget().isFPOnlySP()) |
| 97 | return false; |
| 98 | MIB->setDesc(TII.get(ARM::VADDD)); |
| 99 | } |
| 100 | MIB.add(predOps(ARMCC::AL)); |
| 101 | |
| 102 | return true; |
| 103 | } |
| 104 | |
Diana Picus | b1701e0 | 2017-02-16 12:19:57 +0000 | [diff] [blame] | 105 | static bool selectSequence(MachineInstrBuilder &MIB, |
| 106 | const ARMBaseInstrInfo &TII, |
| 107 | MachineRegisterInfo &MRI, |
| 108 | const TargetRegisterInfo &TRI, |
| 109 | const RegisterBankInfo &RBI) { |
| 110 | assert(TII.getSubtarget().hasVFP2() && "Can't select sequence without VFP"); |
| 111 | |
| 112 | // We only support G_SEQUENCE as a way to stick together two scalar GPRs |
| 113 | // into one DPR. |
| 114 | unsigned VReg0 = MIB->getOperand(0).getReg(); |
| 115 | (void)VReg0; |
| 116 | assert(MRI.getType(VReg0).getSizeInBits() == 64 && |
| 117 | RBI.getRegBank(VReg0, MRI, TRI)->getID() == ARM::FPRRegBankID && |
| 118 | "Unsupported operand for G_SEQUENCE"); |
| 119 | unsigned VReg1 = MIB->getOperand(1).getReg(); |
| 120 | (void)VReg1; |
| 121 | assert(MRI.getType(VReg1).getSizeInBits() == 32 && |
| 122 | RBI.getRegBank(VReg1, MRI, TRI)->getID() == ARM::GPRRegBankID && |
| 123 | "Unsupported operand for G_SEQUENCE"); |
| 124 | unsigned VReg2 = MIB->getOperand(3).getReg(); |
| 125 | (void)VReg2; |
| 126 | assert(MRI.getType(VReg2).getSizeInBits() == 32 && |
| 127 | RBI.getRegBank(VReg2, MRI, TRI)->getID() == ARM::GPRRegBankID && |
| 128 | "Unsupported operand for G_SEQUENCE"); |
| 129 | |
| 130 | // Remove the operands corresponding to the offsets. |
| 131 | MIB->RemoveOperand(4); |
| 132 | MIB->RemoveOperand(2); |
| 133 | |
| 134 | MIB->setDesc(TII.get(ARM::VMOVDRR)); |
| 135 | MIB.add(predOps(ARMCC::AL)); |
| 136 | |
| 137 | return true; |
| 138 | } |
| 139 | |
| 140 | static bool selectExtract(MachineInstrBuilder &MIB, const ARMBaseInstrInfo &TII, |
| 141 | MachineRegisterInfo &MRI, |
| 142 | const TargetRegisterInfo &TRI, |
| 143 | const RegisterBankInfo &RBI) { |
| 144 | assert(TII.getSubtarget().hasVFP2() && "Can't select extract without VFP"); |
| 145 | |
| 146 | // We only support G_EXTRACT as a way to break up one DPR into two GPRs. |
| 147 | unsigned VReg0 = MIB->getOperand(0).getReg(); |
| 148 | (void)VReg0; |
| 149 | assert(MRI.getType(VReg0).getSizeInBits() == 32 && |
| 150 | RBI.getRegBank(VReg0, MRI, TRI)->getID() == ARM::GPRRegBankID && |
| 151 | "Unsupported operand for G_SEQUENCE"); |
| 152 | unsigned VReg1 = MIB->getOperand(1).getReg(); |
| 153 | (void)VReg1; |
| 154 | assert(MRI.getType(VReg1).getSizeInBits() == 32 && |
| 155 | RBI.getRegBank(VReg1, MRI, TRI)->getID() == ARM::GPRRegBankID && |
| 156 | "Unsupported operand for G_SEQUENCE"); |
| 157 | unsigned VReg2 = MIB->getOperand(2).getReg(); |
| 158 | (void)VReg2; |
| 159 | assert(MRI.getType(VReg2).getSizeInBits() == 64 && |
| 160 | RBI.getRegBank(VReg2, MRI, TRI)->getID() == ARM::FPRRegBankID && |
| 161 | "Unsupported operand for G_SEQUENCE"); |
| 162 | |
| 163 | // Remove the operands corresponding to the offsets. |
| 164 | MIB->RemoveOperand(4); |
| 165 | MIB->RemoveOperand(3); |
| 166 | |
| 167 | MIB->setDesc(TII.get(ARM::VMOVRRD)); |
| 168 | MIB.add(predOps(ARMCC::AL)); |
| 169 | |
| 170 | return true; |
| 171 | } |
| 172 | |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 173 | /// Select the opcode for simple extensions (that translate to a single SXT/UXT |
| 174 | /// instruction). Extension operations more complicated than that should not |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 175 | /// invoke this. Returns the original opcode if it doesn't know how to select a |
| 176 | /// better one. |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 177 | static unsigned selectSimpleExtOpc(unsigned Opc, unsigned Size) { |
| 178 | using namespace TargetOpcode; |
| 179 | |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 180 | if (Size != 8 && Size != 16) |
| 181 | return Opc; |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 182 | |
| 183 | if (Opc == G_SEXT) |
| 184 | return Size == 8 ? ARM::SXTB : ARM::SXTH; |
| 185 | |
| 186 | if (Opc == G_ZEXT) |
| 187 | return Size == 8 ? ARM::UXTB : ARM::UXTH; |
| 188 | |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 189 | return Opc; |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 190 | } |
| 191 | |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 192 | /// Select the opcode for simple loads. For types smaller than 32 bits, the |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 193 | /// value will be zero extended. Returns G_LOAD if it doesn't know how to select |
| 194 | /// an opcode. |
Diana Picus | 1540b06 | 2017-02-16 14:10:50 +0000 | [diff] [blame] | 195 | static unsigned selectLoadOpCode(unsigned RegBank, unsigned Size) { |
| 196 | if (RegBank == ARM::GPRRegBankID) { |
| 197 | switch (Size) { |
| 198 | case 1: |
| 199 | case 8: |
| 200 | return ARM::LDRBi12; |
| 201 | case 16: |
| 202 | return ARM::LDRH; |
| 203 | case 32: |
| 204 | return ARM::LDRi12; |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 205 | default: |
| 206 | return TargetOpcode::G_LOAD; |
Diana Picus | 1540b06 | 2017-02-16 14:10:50 +0000 | [diff] [blame] | 207 | } |
Diana Picus | 1540b06 | 2017-02-16 14:10:50 +0000 | [diff] [blame] | 208 | } |
| 209 | |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 210 | if (RegBank == ARM::FPRRegBankID) { |
| 211 | switch (Size) { |
| 212 | case 32: |
| 213 | return ARM::VLDRS; |
| 214 | case 64: |
| 215 | return ARM::VLDRD; |
| 216 | default: |
| 217 | return TargetOpcode::G_LOAD; |
| 218 | } |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 219 | } |
| 220 | |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 221 | return TargetOpcode::G_LOAD; |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 222 | } |
| 223 | |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 224 | bool ARMInstructionSelector::select(MachineInstr &I) const { |
| 225 | assert(I.getParent() && "Instruction should be in a basic block!"); |
| 226 | assert(I.getParent()->getParent() && "Instruction should be in a function!"); |
| 227 | |
| 228 | auto &MBB = *I.getParent(); |
| 229 | auto &MF = *MBB.getParent(); |
| 230 | auto &MRI = MF.getRegInfo(); |
| 231 | |
| 232 | if (!isPreISelGenericOpcode(I.getOpcode())) { |
| 233 | if (I.isCopy()) |
| 234 | return selectCopy(I, TII, MRI, TRI, RBI); |
| 235 | |
| 236 | return true; |
| 237 | } |
| 238 | |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 239 | MachineInstrBuilder MIB{MF, I}; |
Diana Picus | d83df5d | 2017-01-25 08:47:40 +0000 | [diff] [blame] | 240 | bool isSExt = false; |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 241 | |
| 242 | using namespace TargetOpcode; |
| 243 | switch (I.getOpcode()) { |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 244 | case G_SEXT: |
Diana Picus | d83df5d | 2017-01-25 08:47:40 +0000 | [diff] [blame] | 245 | isSExt = true; |
| 246 | LLVM_FALLTHROUGH; |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 247 | case G_ZEXT: { |
| 248 | LLT DstTy = MRI.getType(I.getOperand(0).getReg()); |
| 249 | // FIXME: Smaller destination sizes coming soon! |
| 250 | if (DstTy.getSizeInBits() != 32) { |
| 251 | DEBUG(dbgs() << "Unsupported destination size for extension"); |
| 252 | return false; |
| 253 | } |
| 254 | |
| 255 | LLT SrcTy = MRI.getType(I.getOperand(1).getReg()); |
| 256 | unsigned SrcSize = SrcTy.getSizeInBits(); |
| 257 | switch (SrcSize) { |
Diana Picus | d83df5d | 2017-01-25 08:47:40 +0000 | [diff] [blame] | 258 | case 1: { |
| 259 | // ZExt boils down to & 0x1; for SExt we also subtract that from 0 |
| 260 | I.setDesc(TII.get(ARM::ANDri)); |
| 261 | MIB.addImm(1).add(predOps(ARMCC::AL)).add(condCodeOp()); |
| 262 | |
| 263 | if (isSExt) { |
| 264 | unsigned SExtResult = I.getOperand(0).getReg(); |
| 265 | |
| 266 | // Use a new virtual register for the result of the AND |
| 267 | unsigned AndResult = MRI.createVirtualRegister(&ARM::GPRRegClass); |
| 268 | I.getOperand(0).setReg(AndResult); |
| 269 | |
| 270 | auto InsertBefore = std::next(I.getIterator()); |
Martin Bohme | 8396e14 | 2017-01-25 14:28:19 +0000 | [diff] [blame] | 271 | auto SubI = |
Diana Picus | d83df5d | 2017-01-25 08:47:40 +0000 | [diff] [blame] | 272 | BuildMI(MBB, InsertBefore, I.getDebugLoc(), TII.get(ARM::RSBri)) |
| 273 | .addDef(SExtResult) |
| 274 | .addUse(AndResult) |
| 275 | .addImm(0) |
| 276 | .add(predOps(ARMCC::AL)) |
| 277 | .add(condCodeOp()); |
| 278 | if (!constrainSelectedInstRegOperands(*SubI, TII, TRI, RBI)) |
| 279 | return false; |
| 280 | } |
| 281 | break; |
| 282 | } |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 283 | case 8: |
| 284 | case 16: { |
| 285 | unsigned NewOpc = selectSimpleExtOpc(I.getOpcode(), SrcSize); |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 286 | if (NewOpc == I.getOpcode()) |
| 287 | return false; |
Diana Picus | 8b6c6be | 2017-01-25 08:10:40 +0000 | [diff] [blame] | 288 | I.setDesc(TII.get(NewOpc)); |
| 289 | MIB.addImm(0).add(predOps(ARMCC::AL)); |
| 290 | break; |
| 291 | } |
| 292 | default: |
| 293 | DEBUG(dbgs() << "Unsupported source size for extension"); |
| 294 | return false; |
| 295 | } |
| 296 | break; |
| 297 | } |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 298 | case G_ADD: |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 299 | I.setDesc(TII.get(ARM::ADDrr)); |
Diana Picus | 8a73f55 | 2017-01-13 10:18:01 +0000 | [diff] [blame] | 300 | MIB.add(predOps(ARMCC::AL)).add(condCodeOp()); |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 301 | break; |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 302 | case G_FADD: |
Diana Picus | 6beef3c | 2017-02-16 12:19:52 +0000 | [diff] [blame] | 303 | if (!selectFAdd(MIB, TII, MRI)) |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 304 | return false; |
Diana Picus | 4fa83c0 | 2017-02-08 13:23:04 +0000 | [diff] [blame] | 305 | break; |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 306 | case G_FRAME_INDEX: |
| 307 | // Add 0 to the given frame index and hope it will eventually be folded into |
| 308 | // the user(s). |
| 309 | I.setDesc(TII.get(ARM::ADDri)); |
Diana Picus | 8a73f55 | 2017-01-13 10:18:01 +0000 | [diff] [blame] | 310 | MIB.addImm(0).add(predOps(ARMCC::AL)).add(condCodeOp()); |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 311 | break; |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 312 | case G_LOAD: { |
Diana Picus | 1c33c9f | 2017-02-20 14:45:58 +0000 | [diff] [blame^] | 313 | const auto &MemOp = **I.memoperands_begin(); |
| 314 | if (MemOp.getOrdering() != AtomicOrdering::NotAtomic) { |
| 315 | DEBUG(dbgs() << "Atomic load/store not supported yet\n"); |
| 316 | return false; |
| 317 | } |
| 318 | |
Diana Picus | 1540b06 | 2017-02-16 14:10:50 +0000 | [diff] [blame] | 319 | unsigned Reg = I.getOperand(0).getReg(); |
| 320 | unsigned RegBank = RBI.getRegBank(Reg, MRI, TRI)->getID(); |
| 321 | |
| 322 | LLT ValTy = MRI.getType(Reg); |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 323 | const auto ValSize = ValTy.getSizeInBits(); |
| 324 | |
Diana Picus | 1540b06 | 2017-02-16 14:10:50 +0000 | [diff] [blame] | 325 | assert((ValSize != 64 || TII.getSubtarget().hasVFP2()) && |
| 326 | "Don't know how to load 64-bit value without VFP"); |
| 327 | |
| 328 | const auto NewOpc = selectLoadOpCode(RegBank, ValSize); |
Diana Picus | e836878 | 2017-02-17 13:44:19 +0000 | [diff] [blame] | 329 | if (NewOpc == G_LOAD) |
| 330 | return false; |
| 331 | |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 332 | I.setDesc(TII.get(NewOpc)); |
| 333 | |
| 334 | if (NewOpc == ARM::LDRH) |
| 335 | // LDRH has a funny addressing mode (there's already a FIXME for it). |
| 336 | MIB.addReg(0); |
Diana Picus | 4f8c3e1 | 2017-01-13 09:37:56 +0000 | [diff] [blame] | 337 | MIB.addImm(0).add(predOps(ARMCC::AL)); |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 338 | break; |
Diana Picus | 278c722 | 2017-01-26 09:20:47 +0000 | [diff] [blame] | 339 | } |
Diana Picus | b1701e0 | 2017-02-16 12:19:57 +0000 | [diff] [blame] | 340 | case G_SEQUENCE: { |
| 341 | if (!selectSequence(MIB, TII, MRI, TRI, RBI)) |
| 342 | return false; |
| 343 | break; |
| 344 | } |
| 345 | case G_EXTRACT: { |
| 346 | if (!selectExtract(MIB, TII, MRI, TRI, RBI)) |
| 347 | return false; |
| 348 | break; |
| 349 | } |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 350 | default: |
| 351 | return false; |
Diana Picus | 812caee | 2016-12-16 12:54:46 +0000 | [diff] [blame] | 352 | } |
| 353 | |
Diana Picus | 519807f | 2016-12-19 11:26:31 +0000 | [diff] [blame] | 354 | return constrainSelectedInstRegOperands(I, TII, TRI, RBI); |
Diana Picus | 2227493 | 2016-11-11 08:27:37 +0000 | [diff] [blame] | 355 | } |