@@ -134,17 +134,17 @@ static void CopySrcToMsgPayload(
134
134
}
135
135
136
136
static void Copy_Source_To_Payload (
137
- IR_Builder * IRB, G4_ExecSize batchExSize,
138
- G4_Declare * msg, unsigned & regOff,
139
- G4_SrcRegRegion * source, G4_ExecSize execSize ,
137
+ IR_Builder* IRB, G4_ExecSize batchExSize,
138
+ G4_Declare* msg, unsigned & regOff,
139
+ G4_SrcRegRegion* source, uint32_t numElts ,
140
140
uint32_t eMask)
141
141
{
142
142
ASSERT_USER (batchExSize == 1 || batchExSize == 2 || batchExSize == 4 ||
143
143
batchExSize == 8 || batchExSize == 16 || batchExSize == 32 ,
144
144
" Invalid execution size for message payload copy!" );
145
145
146
146
unsigned srcRegOff = 0 ;
147
- G4_ExecSize batchSize = std::min (batchExSize, execSize) ;
147
+ G4_ExecSize batchSize { std::min (( uint32_t ) batchExSize, numElts) } ;
148
148
uint32_t numSrcRegs = (source->getElemSize () * batchSize) / IRB->getGRFSize ();
149
149
if (numSrcRegs == 0 )
150
150
{
@@ -165,13 +165,13 @@ static void Copy_Source_To_Payload(
165
165
msg, regOff, source, srcRegOff);
166
166
}
167
167
// regOff : need to advance to the next payload grf
168
- // This payload takes this size: execSize * source->getElemSize()
169
- uint32_t numPayloadRegs = (source->getElemSize () * execSize ) / IRB->getGRFSize ();
168
+ // This payload takes this size: numElts * source->getElemSize()
169
+ uint32_t numPayloadRegs = (source->getElemSize () * numElts ) / IRB->getGRFSize ();
170
170
regOff += (numPayloadRegs == 0 ? 1 : numPayloadRegs);
171
171
return ;
172
172
}
173
173
174
- for (unsigned i = 0 ; i < execSize ; i += batchSize) {
174
+ for (unsigned i = 0 ; i < numElts ; i += batchSize) {
175
175
if (!source->isNullReg ()) {
176
176
CopySrcToMsgPayload (IRB, batchSize, eMask,
177
177
msg, regOff, source, srcRegOff);
@@ -210,7 +210,7 @@ void IR_Builder::preparePayload(
210
210
211
211
// this is the size of message payload that holds srcReg.
212
212
// (Thus, this size >= srcReg's size!)
213
- unsigned regionSize = srcs[i].execSize * srcReg->getTypeSize ();
213
+ unsigned regionSize = srcs[i].numElts * srcReg->getTypeSize ();
214
214
215
215
if (regionSize < getGRFSize ()) {
216
216
// FIXME: Need a better solution to decouple the value type from
@@ -286,7 +286,7 @@ void IR_Builder::preparePayload(
286
286
// Count remaining message size.
287
287
for (; i != len; ++i) {
288
288
G4_SrcRegRegion *srcReg = srcs[i].opnd ;
289
- unsigned regionSize = srcs[i].execSize * srcReg->getTypeSize ();
289
+ unsigned regionSize = srcs[i].numElts * srcReg->getTypeSize ();
290
290
if (regionSize < getGRFSize ()) {
291
291
// FIXME: Need a better solution to decouple the value type from
292
292
// the container type to generate better COPY if required.
@@ -305,7 +305,7 @@ void IR_Builder::preparePayload(
305
305
for (i = splitPos; i != len; ++i)
306
306
{
307
307
Copy_Source_To_Payload (this , batchExSize, msg, regOff, srcs[i].opnd ,
308
- srcs[i].execSize , srcs[i].instOpt );
308
+ srcs[i].numElts , srcs[i].instOpt );
309
309
}
310
310
311
311
i = 0 ;
0 commit comments