@@ -4677,6 +4677,7 @@ void EmitPass::FPTrunc(const SSource sources[2], const DstModifier& modifier) {
4677
4677
}
4678
4678
}
4679
4679
4680
+
4680
4681
void EmitPass::Add(const SSource sources[2], const DstModifier& modifier)
4681
4682
{
4682
4683
CVariable* src[2];
@@ -4692,21 +4693,6 @@ void EmitPass::Add(const SSource sources[2], const DstModifier& modifier)
4692
4693
IGC_ASSERT_EXIT_MESSAGE(numLanes(m_encoder->GetSimdSize()) == 16, "As of now Vector Emission is only supported for SIMD16");
4693
4694
unsigned VectorSize = getVectorSize(sources[0].value);
4694
4695
4695
- bool AllUniform = src[0]->IsUniform() && src[1]->IsUniform() && m_destination->IsUniform();
4696
- // cannot emit 16 SIMD if SIMD SIZE is set to 8, but can emit 4
4697
- // simple ALU instructions has the same possible width as SIMD, "math" pipeline instructions
4698
- // has reduced width
4699
- bool CanEmitThisSize = VectorSize <= numLanes(m_currShader->m_SIMDSize);
4700
-
4701
- if (IGC_IS_FLAG_ENABLED(VectorizerUniformValueVectorizationEnabled) && AllUniform && CanEmitThisSize) {
4702
- m_encoder->SetSrcRegion(0, 1, 1, 0);
4703
- m_encoder->SetSrcRegion(1, 1, 1, 0);
4704
- m_encoder->SetUniformSIMDSize(lanesToSIMDMode(VectorSize));
4705
- m_encoder->Add(m_destination, src[0], src[1]);
4706
- m_encoder->Push();
4707
- return;
4708
- }
4709
-
4710
4696
for (unsigned i = 0; i < VectorSize; ++i) {
4711
4697
SetSourceModifiers(0, sources[0]);
4712
4698
SetSourceModifiers(1, sources[1]);
@@ -4740,30 +4726,13 @@ void EmitPass::Mul(const SSource sources[2], const DstModifier& modifier)
4740
4726
src[i] = GetSrcVariable(sources[i]);
4741
4727
}
4742
4728
4743
- unsigned SIMDSize = numLanes(m_currShader->m_SIMDSize);
4744
-
4745
4729
if (IGC_IS_FLAG_ENABLED(EnableVectorEmitter) &&
4746
4730
sources[0].value->getType()->isVectorTy() &&
4747
4731
sources[1].value->getType()->isVectorTy()) {
4748
4732
4749
4733
IGC_ASSERT_EXIT_MESSAGE(numLanes(m_encoder->GetSimdSize()) == 16, "As of now Vector Emission is only supported for SIMD16");
4750
4734
unsigned VectorSize = getVectorSize(sources[0].value);
4751
4735
4752
- bool AllUniform = src[0]->IsUniform() && src[1]->IsUniform() && m_destination->IsUniform();
4753
- // cannot emit 16 SIMD if SIMD SIZE is set to 8, but can emit 4
4754
- // simple ALU instructions has the same possible width as SIMD, "math" pipeline instructions
4755
- // has reduced width
4756
- bool CanEmitThisSize = VectorSize <= SIMDSize;
4757
-
4758
- if (IGC_IS_FLAG_ENABLED(VectorizerUniformValueVectorizationEnabled) && AllUniform && CanEmitThisSize) {
4759
- m_encoder->SetSrcRegion(0, 1, 1, 0);
4760
- m_encoder->SetSrcRegion(1, 1, 1, 0);
4761
- m_encoder->SetUniformSIMDSize(lanesToSIMDMode(VectorSize));
4762
- m_encoder->Mul(m_destination, src[0], src[1]);
4763
- m_encoder->Push();
4764
- return;
4765
- }
4766
-
4767
4736
for (unsigned i = 0; i < VectorSize; ++i) {
4768
4737
SetSourceModifiers(0, sources[0]);
4769
4738
SetSourceModifiers(1, sources[1]);
@@ -4881,27 +4850,6 @@ void EmitPass::VectorMad(const SSource sources[3], const DstModifier& modifier)
4881
4850
4882
4851
unsigned VectorSize = getVectorSize(sources[0].value);
4883
4852
4884
- bool AllUniform = src[0]->IsUniform() &&
4885
- src[1]->IsUniform() && src[2]->IsUniform() &&
4886
- m_destination->IsUniform();
4887
-
4888
- // cannot emit 16 SIMD if SIMD SIZE is set to 8, but can emit 4
4889
- // simple ALU instructions has the same possible width as SIMD, "math" pipeline instructions
4890
- // has reduced width
4891
- bool CanEmitThisSize = VectorSize <= numLanes(m_currShader->m_SIMDSize);
4892
-
4893
- if (IGC_IS_FLAG_ENABLED(VectorizerUniformValueVectorizationEnabled) && AllUniform && CanEmitThisSize) {
4894
- // regioning must be updated by hand, DO NOT COPY for fptrunc
4895
- m_encoder->SetSrcRegion(0, 1, 1, 0);
4896
- m_encoder->SetSrcRegion(1, 1, 1, 0);
4897
- m_encoder->SetSrcRegion(2, 1, 1, 0);
4898
- // this will force no_mask and proper uniform SIMD SIZE
4899
- m_encoder->SetUniformSIMDSize(lanesToSIMDMode(VectorSize));
4900
- m_encoder->Mad(m_destination, src[0], src[1], src[2]);
4901
- m_encoder->Push();
4902
- return;
4903
- }
4904
-
4905
4853
for (unsigned i = 0; i < VectorSize; ++i) {
4906
4854
4907
4855
SetSourceModifiers(0, sources[0]);
@@ -4915,8 +4863,10 @@ void EmitPass::VectorMad(const SSource sources[3], const DstModifier& modifier)
4915
4863
if (src[2]->IsUniform()) m_encoder->SetSrcSubReg(2, i);
4916
4864
else m_encoder->SetSrcSubVar(2, i);
4917
4865
4866
+ bool AllAreUniform = src[0]->IsUniform() &&
4867
+ src[1]->IsUniform() && src[2]->IsUniform();
4918
4868
4919
- if (AllUniform ) m_encoder->SetDstSubReg(i);
4869
+ if (AllAreUniform ) m_encoder->SetDstSubReg(i);
4920
4870
else m_encoder->SetDstSubVar(i);
4921
4871
4922
4872
m_encoder->Mad(m_destination, src[0], src[1], src[2]);
0 commit comments