Skip to content

Commit f346eaf

Browse files
PiotrFusikZuul
authored andcommitted
Fix SIMD16 shuffle down
Change-Id: I19d39ccd3049bfa73ee5469d98085f6a3fe425bd
1 parent ae1935d commit f346eaf

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

IGC/Compiler/CISACodeGen/EmitVISAPass.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4818,9 +4818,10 @@ void EmitPass::emitSimdShuffleDown(llvm::Instruction* inst)
48184818
m_encoder->Cast(pLaneId, imm0);
48194819
m_encoder->Push();
48204820

4821-
if (m_SimdMode == SIMDMode::SIMD16)
4821+
if (m_SimdMode == SIMDMode::SIMD16 || m_SimdMode == SIMDMode::SIMD32)
48224822
{
4823-
m_encoder->SetDstSubVar(1);
4823+
m_encoder->SetDstSubVar(0);
4824+
m_encoder->SetDstSubReg(8);
48244825
m_encoder->SetSimdSize(SIMDMode::SIMD8);
48254826
m_encoder->SetNoMask();
48264827
CVariable* imm1 = m_currShader->ImmToVariable(0x8, ISA_TYPE_UD);
@@ -4830,18 +4831,10 @@ void EmitPass::emitSimdShuffleDown(llvm::Instruction* inst)
48304831

48314832
if (m_SimdMode == SIMDMode::SIMD32)
48324833
{
4833-
m_encoder->SetDstSubVar(0);
4834-
m_encoder->SetDstSubReg(8);
4835-
m_encoder->SetSimdSize(SIMDMode::SIMD8);
4836-
m_encoder->SetNoMask();
4837-
CVariable* imm1 = m_currShader->ImmToVariable(0x8, ISA_TYPE_UD);
4838-
m_encoder->Add(pLaneId, pLaneId, imm1);
4839-
m_encoder->Push();
4840-
48414834
m_encoder->SetSimdSize(SIMDMode::SIMD16);
48424835
m_encoder->SetDstSubReg(16);
48434836
m_encoder->SetNoMask();
4844-
imm1 = m_currShader->ImmToVariable(0x10, ISA_TYPE_UD);
4837+
CVariable* imm1 = m_currShader->ImmToVariable(0x10, ISA_TYPE_UD);
48454838
m_encoder->Add(pLaneId, pLaneId, imm1);
48464839
m_encoder->Push();
48474840
}

visa/HWConformity.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,15 +1694,15 @@ bool HWConformity::fixIndirectOpnd( INST_LIST_ITER i, G4_BB *bb )
16941694
addr_dcl0 = src0->asSrcRegRegion()->getBase()->asRegVar()->getDeclare()->getRootDeclare();
16951695
// is the following precise?
16961696
src0_count = addr_dcl0->getTotalElems();
1697-
MUST_BE_TRUE(src0_count <= addr_reg_max_count, "More than 8 address subregisters required for one oerand.");
1697+
MUST_BE_TRUE(src0_count <= addr_reg_max_count, "More than 8 address subregisters required for one operand.");
16981698
src_uniq_count += src0_count;
16991699
}
17001700

17011701
if (!null_src1 && src1->isSrcRegRegion() &&
17021702
src1->getRegAccess() != Direct && src1->asSrcRegRegion()->getBase()->isRegVar()) {
17031703
addr_dcl1 = src1->asSrcRegRegion()->getBase()->asRegVar()->getDeclare()->getRootDeclare();
17041704
src1_count = addr_dcl1->getTotalElems();
1705-
MUST_BE_TRUE(src1_count <= addr_reg_max_count, "More than 8 address subregisters required for one oerand.");
1705+
MUST_BE_TRUE(src1_count <= addr_reg_max_count, "More than 8 address subregisters required for one operand.");
17061706
if (addr_dcl1 != addr_dcl0) {
17071707
// should we use top level dcl here?
17081708
src_uniq_count += src1_count;
@@ -1718,7 +1718,7 @@ bool HWConformity::fixIndirectOpnd( INST_LIST_ITER i, G4_BB *bb )
17181718
{
17191719
addr_dcl2 = dst->getBase()->asRegVar()->getDeclare()->getRootDeclare();
17201720
dst_count = addr_dcl2->getTotalElems();
1721-
MUST_BE_TRUE(dst_count <= addr_reg_max_count, "More than 8 address subregisters required for one oerand.");
1721+
MUST_BE_TRUE(dst_count <= addr_reg_max_count, "More than 8 address subregisters required for one operand.");
17221722
if (addr_dcl2 != addr_dcl0 && addr_dcl2 != addr_dcl1) {
17231723
dst_uniq_count += dst_count;
17241724
}

0 commit comments

Comments
 (0)