Skip to content

Commit e1ea54e

Browse files
PiotrFusiksys_zuul
authored andcommitted
Fix 64-bit multiplication emulation where the result is one of the factors.
Change-Id: Ia33b9bef921a7d6d54d726eb1a5363f4ff838aca
1 parent 04364e1 commit e1ea54e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,21 +2013,23 @@ void EmitPass::EmitMulPair(GenIntrinsicInst* GII, const SSource Sources[4], cons
20132013
return;
20142014
}
20152015

2016-
m_encoder->MulH(Hi, L0, L1);
2016+
CVariable* THi = m_currShader->GetNewVariable(Hi->GetNumberElement(), Hi->GetType(), Hi->GetAlign(), Hi->IsUniform());
2017+
2018+
m_encoder->MulH(THi, L0, L1);
20172019
m_encoder->Push();
20182020

20192021
CVariable* T0 = m_currShader->GetNewVariable(Hi->GetNumberElement(), Hi->GetType(), Hi->GetAlign(), Hi->IsUniform());
20202022

20212023
m_encoder->Mul(T0, L0, H1);
20222024
m_encoder->Push();
20232025

2024-
m_encoder->Add(Hi, Hi, T0);
2026+
m_encoder->Add(THi, THi, T0);
20252027
m_encoder->Push();
20262028

20272029
m_encoder->Mul(T0, L1, H0);
20282030
m_encoder->Push();
20292031

2030-
m_encoder->Add(Hi, Hi, T0);
2032+
m_encoder->Add(Hi, THi, T0);
20312033
m_encoder->Push();
20322034
}
20332035

0 commit comments

Comments
 (0)