Skip to content

Commit 8b8562a

Browse files
Kotynia, Piotrigcbot
authored andcommitted
Refactoring prod/core child
Simplifying overcomplicated isProductChildOf nad isCoreChildOf functions.
1 parent 0cabf8d commit 8b8562a

File tree

1 file changed

+6
-25
lines changed

1 file changed

+6
-25
lines changed

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -137,37 +137,18 @@ bool support16BitImmSrcForMad() const {
137137
return (m_platformInfo.eRenderCoreFamily >= IGFX_GEN10_CORE);
138138
}
139139

140-
//This function is for handling special cases,
141-
//where simple >= comparison between products/cores doesn't produce expected results.
140+
// This function checks if product is child of another product
142141
bool isProductChildOf(PRODUCT_FAMILY product) const
143142
{
144-
bool result;
145-
switch (product) {
146-
case IGFX_PVC:
147-
result = isCoreChildOf(IGFX_XE_HPC_CORE);
148-
break;
149-
case IGFX_XE_HP_SDV:
150-
result = isCoreChildOf(IGFX_XE_HP_CORE);
151-
break;
152-
case IGFX_DG2:
153-
result = isCoreChildOf(IGFX_XE_HPG_CORE);
154-
break;
155-
default:
156-
result = m_platformInfo.eProductFamily >= product;
157-
break;
158-
}
159-
return result;
143+
if (product == IGFX_PVC)
144+
return isCoreChildOf(IGFX_XE_HPC_CORE);
145+
return m_platformInfo.eProductFamily >= product;
160146
}
161147

148+
// This function checks if core is child of another core
162149
bool isCoreChildOf(GFXCORE_FAMILY core) const
163150
{
164-
bool result;
165-
switch (core) {
166-
default:
167-
result = m_platformInfo.eRenderCoreFamily >= core;
168-
break;
169-
}
170-
return result;
151+
return m_platformInfo.eRenderCoreFamily >= core;
171152
}
172153

173154
bool supports8DWLSCMessage() const {

0 commit comments

Comments
 (0)