@@ -446,16 +446,7 @@ namespace IGC
446446 SIMD_SKIP_ML, // 8: skip this SIMD due to ML engine prediction.
447447 SIMD_FORCE_CONTENT, // 9: force this simd due to shader content (simd32 if WaveActive, barriers + interlocks)
448448 SIMD_FORCE_HINT, // 10: force this simd by hint(s) (now for WaveSize only)
449- SIMD_INFO_RESERVED // 11: *** If new entry is added, make sure it still fits in m_SIMDInfo ***
450- };
451-
452- enum SIMDInfoOffset
453- {
454- SIMD8_OFFSET = 0 ,
455- SIMD16_OFFSET = SIMD_INFO_RESERVED,
456- SIMD32_OFFSET = SIMD_INFO_RESERVED*2 ,
457- DUAL_SIMD8_OFFSET = SIMD_INFO_RESERVED * 3 ,
458- QUAD_SIMD8_DYNAMIC_OFFSET = SIMD_INFO_RESERVED*6 ,
449+ SIMD_INFO_RESERVED // 11: *** If new entry is added, make sure it still fits in each m_SIMDInfo Ex:m_simd8_SIMDInfo ***
459450 };
460451
461452 struct SKernelProgram
@@ -493,7 +484,11 @@ namespace IGC
493484
494485 SSimplePushInfo simplePushInfoArr[g_c_maxNumberOfBufferPushed];
495486
496- uint64_t SIMDInfo = 0 ;
487+ uint32_t simd8_SIMDInfo = 0 ;
488+ uint32_t simd16_SIMDInfo = 0 ;
489+ uint32_t simd32_SIMDInfo = 0 ;
490+ uint32_t dual_simd8_SIMDInfo = 0 ;
491+ uint32_t quad_simd8_dynamic_SIMDInfo = 0 ;
497492 void * m_StagingCtx;
498493 bool m_RequestStage2;
499494 };
@@ -1019,7 +1014,11 @@ namespace IGC
10191014 std::vector<int > m_gsNonDefaultIdxMap;
10201015 std::vector<int > m_psIdxMap;
10211016 DWORD LtoUsedMask = 0 ;
1022- uint64_t m_SIMDInfo = 0 ;
1017+ uint32_t m_simd8_SIMDInfo = 0 ;
1018+ uint32_t m_simd16_SIMDInfo = 0 ;
1019+ uint32_t m_simd32_SIMDInfo = 0 ;
1020+ uint32_t m_dual_simd8_SIMDInfo = 0 ;
1021+ uint32_t m_quad_simd8_dynamic_SIMDInfo = 0 ;
10231022 uint32_t HdcEnableIndexSize = 0 ;
10241023 std::vector<RoutingIndex> HdcEnableIndexValues;
10251024
@@ -1065,7 +1064,7 @@ namespace IGC
10651064 const bool createResourceDimTypes = true ,
10661065 LLVMContextWrapper* LLVMContext = nullptr )// /< LLVM context to use, if null a new one will be created
10671066 : type(_type), platform(_platform), btiLayout(_bitLayout), m_DriverInfo(driverInfo),
1068- llvmCtxWrapper (LLVMContext), m_SIMDInfo( 0 )
1067+ llvmCtxWrapper (LLVMContext)
10691068 {
10701069 if (llvmCtxWrapper == nullptr )
10711070 {
@@ -1167,57 +1166,63 @@ namespace IGC
11671166
11681167 bool isSWSubTriangleOpacityCullingEmulationEnabled () const ;
11691168
1170- unsigned int GetSIMDInfoOffset (SIMDMode simd, ShaderDispatchMode mode)
1171- {
1172- unsigned int offset = 0 ;
1169+ enum Action { Set, Clear };
11731170
1174- switch (mode) {
1171+ // ModifySIMDInfo is used by both Set and ClearSIMDInfo. Since Clear function doesn't have bit information, it defaults
1172+ // to SIMD_INFO_RESERVED if the argument is not passed. bit will not be used when action is Action::clear
1173+ void ModifySIMDInfo (SIMDMode simd, ShaderDispatchMode mode, Action action, SIMDInfoBit bit = SIMD_INFO_RESERVED)
1174+ {
1175+ uint32_t bit_value = 1UL << bit;
1176+ bool clear = action == Action::Clear ? true : false ;
1177+ switch (mode)
1178+ {
11751179 case ShaderDispatchMode::NOT_APPLICABLE:
1176- switch (simd) {
1180+ switch (simd)
1181+ {
11771182 case SIMDMode::SIMD8:
1178- offset = SIMD8_OFFSET ;
1183+ m_simd8_SIMDInfo = clear ? 0 : m_simd8_SIMDInfo | bit_value ;
11791184 break ;
11801185 case SIMDMode::SIMD16:
1181- offset = SIMD16_OFFSET ;
1186+ m_simd16_SIMDInfo = clear ? 0 : m_simd16_SIMDInfo | bit_value ;
11821187 break ;
11831188 case SIMDMode::SIMD32:
1184- offset = SIMD32_OFFSET ;
1189+ m_simd32_SIMDInfo = clear ? 0 : m_simd32_SIMDInfo | bit_value ;
11851190 break ;
11861191 default :
1192+ IGC_ASSERT_MESSAGE (0 , " Unknown SIMD Mode" );
11871193 break ;
11881194 }
11891195 break ;
11901196
11911197 case ShaderDispatchMode::DUAL_SIMD8:
1192- offset = DUAL_SIMD8_OFFSET ;
1198+ m_dual_simd8_SIMDInfo = clear ? 0 : m_dual_simd8_SIMDInfo | bit_value ;
11931199 break ;
11941200 case ShaderDispatchMode::QUAD_SIMD8_DYNAMIC:
1195- offset = QUAD_SIMD8_DYNAMIC_OFFSET ;
1201+ m_quad_simd8_dynamic_SIMDInfo = clear ? 0 : m_quad_simd8_dynamic_SIMDInfo | bit_value ;
11961202 break ;
11971203
11981204 default :
1205+ IGC_ASSERT_MESSAGE (0 , " Unknown SIMD Mode" );
11991206 break ;
12001207 }
1201- IGC_ASSERT (offset < 64 );
1202- return offset;
12031208 }
12041209
12051210 void SetSIMDInfo (SIMDInfoBit bit, SIMDMode simd, ShaderDispatchMode mode)
12061211 {
1207- unsigned int offset = GetSIMDInfoOffset (simd, mode);
1208- unsigned int shift = bit + offset;
1209- IGC_ASSERT (shift < 64 );
1210- m_SIMDInfo |= 1ULL << shift;
1212+ IGC_ASSERT (bit < SIMD_INFO_RESERVED);
1213+ ModifySIMDInfo (simd, mode, Action::Set, bit);
12111214 }
12121215
12131216 void ClearSIMDInfo (SIMDMode simd, ShaderDispatchMode mode)
12141217 {
1215- unsigned int offset = GetSIMDInfoOffset (simd, mode);
1216- IGC_ASSERT (offset < 64 );
1217- m_SIMDInfo &= ~(0xffULL << offset);
1218+ ModifySIMDInfo (simd, mode, Action::Clear);
12181219 }
12191220
1220- uint64_t GetSIMDInfo () { return m_SIMDInfo; }
1221+ uint32_t GetSimd8SIMDInfo () const { return m_simd8_SIMDInfo; }
1222+ uint32_t GetSimd16SIMDInfo () const { return m_simd16_SIMDInfo; }
1223+ uint32_t GetSimd32SIMDInfo () const { return m_simd32_SIMDInfo; }
1224+ uint32_t GetDualSimd8SIMDInfo () const { return m_dual_simd8_SIMDInfo; }
1225+ uint32_t GetQuadSimd8DynamicSIMDInfo () const { return m_quad_simd8_dynamic_SIMDInfo; }
12211226
12221227 SIMDMode GetSIMDMode () const ;
12231228
0 commit comments