@@ -346,12 +346,6 @@ G4_SrcRegRegion* HWConformity::insertCopyAtBBEntry(G4_BB* bb, G4_ExecSize execSi
346346G4_Operand* HWConformity::insertMovBefore (
347347 INST_LIST_ITER it, uint32_t srcNum, G4_Type type, G4_BB* bb,
348348 G4_SubReg_Align tmpAlign)
349- {
350- return insertMovBefore (it, srcNum, type, bb, 0 , tmpAlign);
351- }
352-
353- G4_Operand* HWConformity::insertMovBefore (INST_LIST_ITER it, uint32_t srcNum, G4_Type type, G4_BB* bb,
354- uint16_t tmpStride, G4_SubReg_Align tmpAlign)
355349{
356350 G4_INST* inst = *it;
357351 G4_SubReg_Align subAlign;
@@ -366,20 +360,13 @@ G4_Operand* HWConformity::insertMovBefore(INST_LIST_ITER it, uint32_t srcNum, G4
366360
367361 if (newExecSize > 1 )
368362 {
369- if (tmpStride )
363+ if (scale == 1 && ! IS_VTYPE (src-> getType ()) )
370364 {
371- scale = tmpStride ;
365+ scale = ( uint16_t )( getTypeSize (src-> getType ()) / getTypeSize (type)) ;
372366 }
373- else
367+ if (scale == 0 )
374368 {
375- if (scale == 1 && !IS_VTYPE (src->getType ()))
376- {
377- scale = (uint16_t )(getTypeSize (src->getType ()) / getTypeSize (type));
378- }
379- if (scale == 0 )
380- {
381- scale = 1 ;
382- }
369+ scale = 1 ;
383370 }
384371 region = builder.createRegionDesc (scale, 1 , 0 );
385372 }
@@ -4015,24 +4002,7 @@ bool HWConformity::generateAlign1Mad(G4_BB* bb, INST_LIST_ITER iter)
40154002 }
40164003 else
40174004 {
4018- // Promote src2 from :b to :w to allow mad, for example:
4019- // pseudo_mad (16) V211(0,0)<1>:d V210(0,0)<1;0>:d V106(0,0)<0;0>:b V81(0,0)<1;0>:d
4020- // =>
4021- // mov (1) TV74(0,0)<1>:w V106(0,0)<0;1,0>:b {Q1, Align1, NoMask}
4022- // mad (16) V211(0,0)<1>:d V81(0,0)<1;0>:d V210(0,0)<1;0>:d TV74(0,0)<0;0>:w {H1, Align1}
4023-
4024- bool isSrc2 = (k == 0 );
4025- if (builder.noSrc2Regioning () && isSrc2 && IS_BTYPE (src->getType ()))
4026- {
4027- G4_Type type = (src->getType () == Type_UB) ? Type_UW : Type_W;
4028- auto dstStrideInBytes = inst->getDst ()->getHorzStride () * getTypeSize (inst->getDst ()->getType ());
4029- uint16_t stride = (uint16_t )(dstStrideInBytes / getTypeSize (type));
4030- inst->setSrc (insertMovBefore (iter, k, type, bb, stride, GRFALIGN), k);
4031- }
4032- else
4033- {
4034- return false ;
4035- }
4005+ return false ;
40364006 }
40374007 }
40384008 else
0 commit comments