[vISA]: Update the W/A for the qword type instructions.

1) Must not use non-qword scalar broadcast when qword is present in any of
the source or destination, instead must convert the non-qword scalar into a qword
before doing a qword scalar broadcast. For example:

mov (8|M0) r88.0<1>:q r2.0<0;1,0>:d
=>
mov (1|M0) r3.0<1>:q r2.0<0;1,0>:d
mov (8|M0) r88.0<1>:q r3.0<0;1,0>:q

2)Instructions with the following pattern must not be used - destination
crosses GRF boundary with qword datatype, and none of the sources datatype is
qword. For example:
shl (16|M0)  r11.0<1>:q  r7.0<2;1,0>:d   2:w
=>
shl (8|M0)   r11.0<1>:q  r7.0<2;1,0>:d   2:w
shl (8|M8)   r12.0<1>:q  r8.0<2;1,0>:d   2:w
This commit is contained in:
liufang
2022-01-12 18:28:35 +00:00
committed by igcbot
parent 964748a518
commit 01082960d8
4 changed files with 79 additions and 26 deletions

View File

@ -8333,3 +8333,9 @@ SPDX-License-Identifier: MIT
"Workaround",
WA_BUG_TYPE_UNKNOWN,
WA_BUG_PERF_IMPACT_UNKNOWN, WA_COMPONENT_UNKNOWN)
WA_DECLARE(
Wa_16012725276,
"Workaround",
WA_BUG_TYPE_UNKNOWN,
WA_BUG_PERF_IMPACT_UNKNOWN, WA_COMPONENT_UNKNOWN)

View File

@ -82,5 +82,10 @@ void InitPvc_XtHwWaTable(PWA_TABLE pWaTable, PSKU_FEATURE_TABLE pSkuTable, PWA_I
PLATFORM_ALL,
SI_WA_BETWEEN(iStepId_PVC_XT_ComputeTile, PVC_XT_GT_REV_ID_COMPUTETILE_A0, PVC_XT_GT_REV_ID_COMPUTETILE_B0));
SI_WA_ENABLE(
Wa_16012725276,
"No Link Provided",
"No HWSightingLink provided",
PLATFORM_ALL,
SI_WA_BETWEEN(iStepId_PVC_XT_ComputeTile, PVC_XT_GT_REV_ID_COMPUTETILE_A0, PVC_XT_GT_REV_ID_COMPUTETILE_B0));
}

View File

@ -220,6 +220,10 @@ static const WA_TABLE *CreateVisaWaTable(TARGET_PLATFORM platform, Stepping step
break;
case Xe_PVCXT:
VISA_WA_ENABLE(pWaTable, Wa_16013338947);
if (step == Step_A)
{
VISA_WA_ENABLE(pWaTable, Wa_16012725276);
}
break;
default:
break;

View File

@ -3651,9 +3651,9 @@ bool HWConformity::fix64bInst(INST_LIST_ITER iter, G4_BB* bb)
}
}
}
}
return false;
}
}
return false;
}
//------------------------------------------------------------------------------
//
@ -5824,35 +5824,73 @@ void HWConformity::conformBB(G4_BB* bb)
#endif
}
if (builder.getPlatform() == Xe_PVCXT) {
for (auto I = bb->begin(), E = bb->end(); I != E;) {
auto inst = *I;
auto next = std::next(I);
G4_DstRegRegion *dst = inst->getDst();
bool crossGRFDst = dst && dst->isCrossGRFDst();
if (crossGRFDst && IS_QTYPE(dst->getType()) && !inst->isSend() &&
!inst->isDpas()) {
bool hasQTypeSrc = false;
for (int i = 0; i < inst->getNumSrc(); i++) {
if (IS_QTYPE(inst->getSrc(i)->getType())) {
hasQTypeSrc = true;
break;
if (VISA_WA_CHECK(builder.getPWaTable(), Wa_16012725276))
{
for (auto it = bb->begin(), itEnd = bb->end(); it != itEnd; ++it)
{
auto inst = *it;
if (!inst->getDst() || inst->isSend() || inst->isDpas())
{
continue;
}
}
if (!hasQTypeSrc) {
evenlySplitInst(I, bb);
bool hasNonQTypeScalarSrc = false;
bool hasQTypeDst = false;
bool hasQTypeSrc = false;
if (IS_QTYPE(inst->getDst()->getType()))
{
hasQTypeDst = true;
}
for (int i = 0; i < inst->getNumSrc(); i++)
{
auto src = inst->getSrc(i);
if (IS_QTYPE(src->getType()))
{
hasQTypeSrc = true;
}
else if (src->isSrcRegRegion() && src->asSrcRegRegion()->getRegion()->isScalar())
{
hasNonQTypeScalarSrc = true;
}
}
// WA-1
if ((hasQTypeDst || hasQTypeSrc) && hasNonQTypeScalarSrc && inst->getExecSize() != g4::SIMD1)
{
for (int i = 0; i < inst->getNumSrc(); i++)
{
auto src = inst->getSrc(i);
if (!IS_QTYPE(src->getType()) && src->isSrcRegRegion() && src->asSrcRegRegion()->getRegion()->isScalar())
{
inst->setSrc(insertMovBefore(it, i, IS_SIGNED_INT(src->getType()) ? Type_Q : Type_UQ, bb, GRFALIGN), i);
}
}
}
// WA-2
if (hasQTypeDst && inst->getDst()->isCrossGRFDst())
{
hasQTypeSrc = false;
for (int i = 0; i < inst->getNumSrc(); i++)
{
if (IS_QTYPE(inst->getSrc(i)->getType()))
{
hasQTypeSrc = true;
break;
}
}
if (!hasQTypeSrc)
{
evenlySplitInst(it, bb);
}
}
#ifdef _DEBUG
verifyG4Kernel(kernel, Optimizer::PI_HWConformityChk, false);
#endif
}
}
I = next;
}
}
}