@@ -13127,10 +13127,10 @@ void EmitPass::emitTypedRead(llvm::Instruction* pInsn)
13127
13127
CVariable* flag = nullptr;
13128
13128
bool needLoop = ResourceLoopHeader(resource, flag, label);
13129
13129
CVariable* tempdst[4] = { nullptr, nullptr, nullptr, nullptr };
13130
- bool needsSplit = m_currShader->m_SIMDSize == SIMDMode::SIMD16
13131
- && ! m_currShader->m_Platform->supportsSIMD16TypedRW();
13132
-
13133
- auto instWidth = SIMDMode::SIMD8 ;
13130
+ SIMDMode instWidth = std::min(
13131
+ m_currShader->m_Platform->supportsSIMD16TypedRW() ? SIMDMode::SIMD16 : SIMDMode::SIMD8,
13132
+ m_currShader->m_SIMDSize);
13133
+ bool needsSplit = m_currShader->m_SIMDSize > instWidth ;
13134
13134
13135
13135
if (!needsSplit)
13136
13136
{
@@ -13213,9 +13213,10 @@ void EmitPass::emitTypedWrite(llvm::Instruction* pInsn)
13213
13213
bool needLoop = ResourceLoopHeader(resource, flag, label);
13214
13214
uint parameterLength = 4;
13215
13215
13216
- bool needsSplit = m_currShader->m_SIMDSize == SIMDMode::SIMD16
13217
- && !m_currShader->m_Platform->supportsSIMD16TypedRW();
13218
- auto instWidth = SIMDMode::SIMD8;
13216
+ SIMDMode instWidth = std::min(
13217
+ m_currShader->m_Platform->supportsSIMD16TypedRW() ? SIMDMode::SIMD16 : SIMDMode::SIMD8,
13218
+ m_currShader->m_SIMDSize);
13219
+ bool needsSplit = m_currShader->m_SIMDSize > instWidth;
13219
13220
13220
13221
if (!needsSplit)
13221
13222
{
@@ -13236,7 +13237,11 @@ void EmitPass::emitTypedWrite(llvm::Instruction* pInsn)
13236
13237
}
13237
13238
else
13238
13239
{
13239
- for (uint i = 0; i < 2; ++i)
13240
+ IGC_ASSERT(instWidth == SIMDMode::SIMD8 ||
13241
+ instWidth == SIMDMode::SIMD16);
13242
+ IGC_ASSERT(m_currShader->m_SIMDSize > instWidth);
13243
+ const uint numInst = numLanes(m_currShader->m_SIMDSize) / numLanes(instWidth);
13244
+ for (uint i = 0; i < numInst; ++i)
13240
13245
{
13241
13246
CVariable* pPayload = nullptr;
13242
13247
0 commit comments