@@ -21755,7 +21755,10 @@ static void GetReductionOp(WaveOps op, Type* opndTy, uint64_t& identity, e_opcod
2175521755
2175621756void EmitPass::emitWavePrefix(WavePrefixIntrinsic* I)
2175721757{
21758- bool disableHelperLanes = int_cast<int>(cast<ConstantInt>(I->getArgOperand(4))->getSExtValue()) == 2;
21758+ auto helperLanes = int_cast<int>( cast<ConstantInt>( I->getArgOperand( 4 ) )->getSExtValue() );
21759+ bool disableHelperLanes = (helperLanes == 2);
21760+ bool getFullPrefix = ( helperLanes == 4 );
21761+
2175921762 if (disableHelperLanes)
2176021763 {
2176121764 ForceDMask();
@@ -21771,7 +21774,7 @@ void EmitPass::emitWavePrefix(WavePrefixIntrinsic* I)
2177121774 }
2177221775 m_encoder->SetSubSpanDestination(false);
2177321776 emitScan(
21774- I->getSrc(), I->getOpKind(), I->isInclusiveScan(), Mask, false);
21777+ I->getSrc(), I->getOpKind(), I->isInclusiveScan(), Mask, false, getFullPrefix );
2177521778 if (disableHelperLanes)
2177621779 {
2177721780 ResetVMask();
@@ -21786,7 +21789,7 @@ void EmitPass::emitQuadPrefix(QuadPrefixIntrinsic* I)
2178621789
2178721790void EmitPass::emitScan(
2178821791 Value* Src, IGC::WaveOps Op,
21789- bool isInclusiveScan, Value* Mask, bool isQuad)
21792+ bool isInclusiveScan, Value* Mask, bool isQuad, bool noMask )
2179021793{
2179121794 VISA_Type type;
2179221795 e_opcode opCode;
@@ -21801,11 +21804,19 @@ void EmitPass::emitScan(
2180121804 false, src, dst, Flag,
2180221805 !isInclusiveScan, isQuad);
2180321806
21804- // Now that we've computed the result in temporary registers,
21805- // make sure we only write the results to lanes participating in the
21806- // scan as specified by 'mask'.
21807- if (Flag)
21808- m_encoder->SetPredicate(Flag);
21807+ if(noMask)
21808+ {
21809+ m_encoder->SetNoMask();
21810+ }
21811+ else
21812+ {
21813+ // Now that we've computed the result in temporary registers,
21814+ // make sure we only write the results to lanes participating in the
21815+ // scan as specified by 'mask'.
21816+ if (Flag)
21817+ m_encoder->SetPredicate(Flag);
21818+ }
21819+
2180921820 m_encoder->Copy(m_destination, dst[0]);
2181021821 if (m_currShader->m_numberInstance == 2)
2181121822 {
0 commit comments