Skip to content

Commit 3fc399d

Browse files
weiyu-chengfxbot
authored andcommitted
Fix a bug when doing source 2 region checks
Change-Id: If22567225fbc92572632c93e3f1ed02b60bb6af2
1 parent ab54cdb commit 3fc399d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

visa/HWConformity.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7453,8 +7453,8 @@ void HWConformity::fixSrc2(INST_LIST_ITER it, G4_BB* bb, bool swapSrc0and2)
74537453
{
74547454
auto src = inst->getSrc(srcPos);
74557455
// we have to make sure src2 and dst are aligned
7456-
// Promote src2's type to f if necessary.
7457-
//
7456+
// Promote src2's type to f if mix mode is supported.
7457+
// e.g.,
74587458
// mad (4) r10.0<1>:f src0 src1 r12.0<1>:hf --> f
74597459
// mad (4) r10.0<2>:hf src0 src1 r12.0<1>:hf --> f
74607460
// mad (4) r10.0<1>:hf src0 src1 r12.0<2>:hf --> hf
@@ -7464,11 +7464,14 @@ void HWConformity::fixSrc2(INST_LIST_ITER it, G4_BB* bb, bool swapSrc0and2)
74647464
unsigned short dstEltSz = inst->getDst()->getExecTypeSize();
74657465
if (dstEltSz >= 4)
74667466
{
7467-
srcTy = IS_TYPE_FLOAT_ALL(srcTy) ? Type_F : Type_D;
7468-
if (!builder.hasMixMode() && srcTy == Type_F)
7467+
if (IS_TYPE_INT(srcTy))
74697468
{
7470-
// we can't change the srcType
7471-
srcTy = src->getType();
7469+
srcTy = Type_D;
7470+
}
7471+
else if (builder.hasMixMode() && builder.getMixModeType() == srcTy)
7472+
{
7473+
// we can change operand type to F to save one move
7474+
srcTy = Type_F;
74727475
}
74737476
}
74747477
inst->setSrc(insertMovBefore(it, srcPos, srcTy, bb, Sixteen_Word), srcPos);

0 commit comments

Comments
 (0)