Skip to content

Commit 583850e

Browse files
JaroszPiotrigcbot
authored andcommitted
Disable denorm retain for math instructions for OCL
Denorm retain for math instructions has to be disabled for OCL shaders because of performance regression.
1 parent fab64a9 commit 583850e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

IGC/Compiler/CISACodeGen/CISABuilder.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4326,10 +4326,11 @@ namespace IGC
43264326

43274327
CodeGenContext* pCtx = m_program->GetContext();
43284328
bool needsDenormRetainForMathInstructions =
4329-
(pCtx->m_floatDenormMode16 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4330-
(pCtx->m_floatDenormMode32 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4331-
(pCtx->m_floatDenormMode64 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4332-
(pCtx->m_floatDenormModeBFTF == FLOAT_DENORM_FLUSH_TO_ZERO);
4329+
(context->type != ShaderType::OPENCL_SHADER) &&
4330+
((pCtx->m_floatDenormMode16 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4331+
(pCtx->m_floatDenormMode32 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4332+
(pCtx->m_floatDenormMode64 == FLOAT_DENORM_FLUSH_TO_ZERO) ||
4333+
(pCtx->m_floatDenormModeBFTF == FLOAT_DENORM_FLUSH_TO_ZERO));
43334334

43344335
if (m_program->m_Platform->hasCorrectlyRoundedMacros() && needsDenormRetainForMathInstructions)
43354336
{

0 commit comments

Comments
 (0)