Skip to content

Commit fc424fc

Browse files
gkluczekgfxbot
authored andcommitted
Creating MUL Q D imm:D instead of MUL Q D imm:W
Change-Id: Ic5147d2697f6a3ea6df8dbf58c26aec69ce6cd8d
1 parent 86f3c10 commit fc424fc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

visa/HWConformity.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -2565,7 +2565,28 @@ void HWConformity::fixMULHInst( INST_LIST_ITER &i, G4_BB *bb )
25652565
src1 = inst->getSrc(1);
25662566
}
25672567

2568+
bool useMulQDD = false;
25682569
if (exec_size <= 8 && !builder.no64bitRegioning())
2570+
{
2571+
useMulQDD = true;
2572+
if (!IS_DTYPE(src0->getType()) || !IS_DTYPE(src1->getType()))
2573+
{
2574+
if (src1->isImm() &&
2575+
IS_DTYPE(src0->getType()) &&
2576+
(IS_WTYPE(src1->getType()) || IS_BTYPE(src1->getType())))
2577+
{
2578+
// Ensure src1 has the same type size as src0.
2579+
const G4_Imm *oldImm = src1->asImm();
2580+
G4_Imm *newImm = builder.createImm(oldImm->getInt(), src0->getType());
2581+
inst->setSrc(newImm, 1);
2582+
}
2583+
else
2584+
{
2585+
useMulQDD = false;
2586+
}
2587+
}
2588+
}
2589+
if (useMulQDD)
25692590
{
25702591
// use mul Q D D to get the upper 32-bit
25712592
// note that we don't do this for CHV/BXT due to the 64-bit type restrictions

0 commit comments

Comments
 (0)