@@ -164,37 +164,18 @@ INST_LIST_ITER InstSplitPass::splitInstruction(INST_LIST_ITER it,
164164 return false ;
165165 };
166166
167- // Check destination
168- bool isDstCross2GRF = cross2GRFDst (inst->getDst ());
169- if (inst->getDst () && isDstCross2GRF && !AllowCross2GRF (inst->getDst ())) {
170- doSplit = true ;
171- }
172-
173167 // Check sources
174168 for (int i = 0 , numSrc = inst->getNumSrc (); i < numSrc; ++i) {
175169 if (!inst->getSrc (i)->isSrcRegRegion ())
176170 continue ;
177- G4_SrcRegRegion *src = inst->getSrc (i)->asSrcRegRegion ();
178-
179- // If dst spans 4 GRFs(dst must be 64b datatype and execSize == 32), src
180- // operand must be broadcast regioning or flat regioning (dst/src is
181- // aligned). In other words if src is not 64b datatype, we must fix src
182- // with >1 stride. In this way src also spans 4 GRFs after fixing.
183- // Although this is allowed by HW but it's not allowed by vISA as vISA
184- // requires contiguous regioning for 4 GRFs operand. So, we have to split
185- // for such case. For example:
186- // mov (32|M0) r48.0<1>:q r12.0<1;1,0>:d
187- // =>
188- // mov (16|M0) r48.0<1>:q r12.0<1;1,0>:d
189- // mov (16|M16) r50.0<1>:q r13.0<1;1,0>:d
190- if ((isDstCross2GRF && src->getTypeSize () != 8 && !src->isScalarSrc ()) ||
191- (cross2GRF (src) && !AllowCross2GRF (src))) {
171+ if (cross2GRF (inst->getSrc (i)) && !AllowCross2GRF (inst->getSrc (i))) {
192172 doSplit = true ;
193173 break ;
194174 }
195175 if (m_builder->getPlatform () >= Xe_XeHPSDV) {
196176 // Instructions whose operands are 64b and have 2D regioning need to be
197177 // split up front to help fixUnalignedRegions(..) covering 2D cases.
178+ G4_SrcRegRegion *src = inst->getSrc (i)->asSrcRegRegion ();
198179 if ((src->getType () == Type_DF || IS_QTYPE (src->getType ())) &&
199180 !src->getRegion ()->isSingleStride (execSize)) {
200181 // Try splitting the inst if it's a mov. Otherwise, legalize
@@ -212,6 +193,12 @@ INST_LIST_ITER InstSplitPass::splitInstruction(INST_LIST_ITER it,
212193 }
213194 }
214195
196+ // Check destination
197+ if (inst->getDst () && cross2GRFDst (inst->getDst ()) &&
198+ !AllowCross2GRF (inst->getDst ())) {
199+ doSplit = true ;
200+ }
201+
215202 // Handle split exceptions
216203 if (!doSplit) {
217204 if (inst->opcode () == G4_cmp && !m_builder->supportNativeSIMD32 ()) {
0 commit comments