Lines Matching +full:tri +full:- +full:default
1 //===- R600ExpandSpecialInstrs.cpp - Expand special instructions ----------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
25 #define DEBUG_TYPE "r600-expand-special-instrs"
65 int OpIdx = TII->getOperandIdx(*OldMI, Op); in SetFlagInNewMI()
66 if (OpIdx > -1) { in SetFlagInNewMI()
67 uint64_t Val = OldMI->getOperand(OpIdx).getImm(); in SetFlagInNewMI()
68 TII->setImmOperand(*NewMI, Op, Val); in SetFlagInNewMI()
76 const R600RegisterInfo &TRI = TII->getRegisterInfo(); in runOnMachineFunction() local
85 if (TII->isLDSRetInstr(MI.getOpcode())) { in runOnMachineFunction()
86 int DstIdx = TII->getOperandIdx(MI.getOpcode(), R600::OpName::dst); in runOnMachineFunction()
87 assert(DstIdx != -1); in runOnMachineFunction()
89 MachineInstr *Mov = TII->buildMovInstr(&MBB, I, in runOnMachineFunction()
92 int LDSPredSelIdx = TII->getOperandIdx(MI.getOpcode(), in runOnMachineFunction()
94 int MovPredSelIdx = TII->getOperandIdx(Mov->getOpcode(), in runOnMachineFunction()
97 Mov->getOperand(MovPredSelIdx).setReg( in runOnMachineFunction()
102 default: break; in runOnMachineFunction()
108 MachineInstr *PredSet = TII->buildDefaultInstruction(MBB, I, in runOnMachineFunction()
113 TII->addFlag(*PredSet, 0, MO_FLAG_MASK); in runOnMachineFunction()
115 TII->setImmOperand(*PredSet, R600::OpName::update_exec_mask, 1); in runOnMachineFunction()
117 TII->setImmOperand(*PredSet, R600::OpName::update_pred, 1); in runOnMachineFunction()
124 const R600RegisterInfo &TRI = TII->getRegisterInfo(); in runOnMachineFunction() local
127 unsigned DstBase = TRI.getEncodingValue(DstReg) & HW_REG_MASK; in runOnMachineFunction()
130 bool Mask = (Chan != TRI.getHWRegChan(DstReg)); in runOnMachineFunction()
134 TII->buildSlotOfVectorInstruction(MBB, &MI, Chan, SubDstReg); in runOnMachineFunction()
136 BMI->bundleWithPred(); in runOnMachineFunction()
139 TII->addFlag(*BMI, 0, MO_FLAG_MASK); in runOnMachineFunction()
142 TII->addFlag(*BMI, 0, MO_FLAG_NOT_LAST); in runOnMachineFunction()
143 unsigned Opcode = BMI->getOpcode(); in runOnMachineFunction()
147 BMI->getOperand(TII->getOperandIdx(Opcode, R600::OpName::src0)) in runOnMachineFunction()
150 BMI->getOperand(TII->getOperandIdx(Opcode, R600::OpName::src1)) in runOnMachineFunction()
154 if ((TRI.getEncodingValue(Src0) & 0xff) < 127 && in runOnMachineFunction()
155 (TRI.getEncodingValue(Src1) & 0xff) < 127) in runOnMachineFunction()
156 assert(TRI.getHWRegChan(Src0) == TRI.getHWRegChan(Src1)); in runOnMachineFunction()
163 bool IsReduction = TII->isReductionOp(MI.getOpcode()); in runOnMachineFunction()
164 bool IsVector = TII->isVector(MI); in runOnMachineFunction()
165 bool IsCube = TII->isCubeOp(MI.getOpcode()); in runOnMachineFunction()
197 MI.getOperand(TII->getOperandIdx(MI, R600::OpName::dst)).getReg(); in runOnMachineFunction()
199 MI.getOperand(TII->getOperandIdx(MI, R600::OpName::src0)).getReg(); in runOnMachineFunction()
204 int Src1Idx = TII->getOperandIdx(MI, R600::OpName::src1); in runOnMachineFunction()
205 if (Src1Idx != -1) { in runOnMachineFunction()
211 Src0 = TRI.getSubReg(Src0, SubRegIndex); in runOnMachineFunction()
212 Src1 = TRI.getSubReg(Src1, SubRegIndex); in runOnMachineFunction()
216 unsigned SubRegIndex1 = R600RegisterInfo::getSubRegFromChannel(CubeSrcSwz[3 - Chan]); in runOnMachineFunction()
217 Src1 = TRI.getSubReg(Src0, SubRegIndex1); in runOnMachineFunction()
218 Src0 = TRI.getSubReg(Src0, SubRegIndex0); in runOnMachineFunction()
226 DstReg = TRI.getSubReg(DstReg, SubRegIndex); in runOnMachineFunction()
230 Mask = (Chan != TRI.getHWRegChan(DstReg)); in runOnMachineFunction()
231 unsigned DstBase = TRI.getEncodingValue(DstReg) & HW_REG_MASK; in runOnMachineFunction()
247 default: in runOnMachineFunction()
252 TII->buildDefaultInstruction(MBB, I, Opcode, DstReg, Src0, Src1); in runOnMachineFunction()
255 NewMI->bundleWithPred(); in runOnMachineFunction()
257 TII->addFlag(*NewMI, 0, MO_FLAG_MASK); in runOnMachineFunction()
260 TII->addFlag(*NewMI, 0, MO_FLAG_NOT_LAST); in runOnMachineFunction()