Skip to content

Commit c688ac4

Browse files
bcheng0127pszymich
authored andcommitted
HW WA
1 parent c43553e commit c688ac4

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

visa/HWCaps.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,4 +1077,9 @@ SPDX-License-Identifier: MIT
10771077
{
10781078
return (getPlatform() < Xe_DG2);
10791079
}
1080+
1081+
bool hasBDstWSrc1EvenAlignIssue() const {
1082+
return getPlatform() == Xe_PVCXT;
1083+
}
1084+
10801085
// end HW capabilities

visa/HWConformity.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5989,7 +5989,7 @@ void HWConformity::conformBB(G4_BB* bb)
59895989
}
59905990
// do this early since otherwise the moves inserted by other passes may still
59915991
// inherit bad regions from the original inst
5992-
fixSrcRegion(inst);
5992+
fixSrcRegion(i, bb);
59935993

59945994
bool changed = fixMov(i, bb);
59955995
if (changed)
@@ -7298,8 +7298,8 @@ G4_INST* HWConformity::splitInstWithByteDst(G4_INST* expand_op)
72987298
// 7. Dst.HorzStride must not be 0. -- this needs not to be checked.
72997299
// 8. VertStride must be used to cross GRF register boundaries. This rule implies that
73007300
// elements within a 'Width' cannot cross GRF boundaries.
7301-
void HWConformity::fixSrcRegion(G4_INST* inst)
7302-
{
7301+
void HWConformity::fixSrcRegion(INST_LIST_ITER i, G4_BB *bb) {
7302+
G4_INST *inst = *i;
73037303
bool comprInst = isCompressedInst(inst);
73047304
for (int i = 0; i < G4_MAX_SRCS; i++)
73057305
{
@@ -7411,10 +7411,27 @@ void HWConformity::fixSrcRegion(G4_INST* inst)
74117411
}
74127412
}
74137413
}
7414+
74147415
if (inst->getDst() && !inst->hasNULLDst())
74157416
{
74167417
MUST_BE_TRUE(inst->getDst()->getHorzStride() != 0,
74177418
"Bad source region: Width is greater than execution size.");
7419+
7420+
if (builder.hasBDstWSrc1EvenAlignIssue()) {
7421+
G4_Operand *src1 = inst->getSrc(1);
7422+
if (src1 && src1->isSrcRegRegion()) {
7423+
G4_Operand *dst = inst->getDst();
7424+
if (dst && dst->isDstRegRegion() &&
7425+
dst->asDstRegRegion()->getHorzStride() > 2 &&
7426+
(dst->getType() == Type_B || dst->getType() == Type_UB) &&
7427+
(src1->getType() == Type_W || src1->getType() == Type_UW) &&
7428+
(src1->asSrcRegRegion()->getSubRegOff() % 2)) {
7429+
G4_Operand *new_src1 =
7430+
insertMovBefore(i, 1, src1->getType(), bb, Even_Word);
7431+
inst->setSrc(new_src1, 1);
7432+
}
7433+
}
7434+
}
74187435
}
74197436
}
74207437

visa/HWConformity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace vISA
126126
bool fixAcc(INST_LIST_ITER i, G4_BB* bb);
127127
void fixDstHstride(INST_LIST_ITER i, int extypesize);
128128
void fixMADInst(G4_BB* bb);
129-
void fixSrcRegion(G4_INST *inst);
129+
void fixSrcRegion(INST_LIST_ITER i, G4_BB *bb);
130130
void conformBB(G4_BB* bb);
131131
void fixSADA2Inst(G4_BB* bb);
132132
void fixMixedHFInst(G4_BB* bb);

0 commit comments

Comments
 (0)