mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 09:10:11 +01:00
swr: Use ElemenCount constructor for LLVM 11
In LLVM 12 ElementCount constructor is private
and instead of using it explicitly, ::get function
should be used, but in LLVM 11, the constructor
is still the way to go.
Reviewed-by: Krzysztof Raszkowski <krzysztof.raszkowski@intel.com>
Closes: #3490
Fixes: 639605e5ba
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6648>
This commit is contained in:
parent
6049dc1a9d
commit
28df8ffde7
2 changed files with 55 additions and 33 deletions
|
|
@ -133,91 +133,111 @@ namespace SwrJit
|
||||||
|
|
||||||
Value* Builder::VIMMED1(uint64_t i)
|
Value* Builder::VIMMED1(uint64_t i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1_16(uint64_t i)
|
Value* Builder::VIMMED1_16(uint64_t i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1(int i)
|
Value* Builder::VIMMED1(int i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1_16(int i)
|
Value* Builder::VIMMED1_16(int i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1(uint32_t i)
|
Value* Builder::VIMMED1(uint32_t i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1_16(uint32_t i)
|
Value* Builder::VIMMED1_16(uint32_t i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1(float i)
|
Value* Builder::VIMMED1(float i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantFP>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth, cast<ConstantFP>(C(i)));
|
return ConstantVector::getSplat(mVWidth, cast<ConstantFP>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantFP>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantFP>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1_16(float i)
|
Value* Builder::VIMMED1_16(float i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantFP>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth16, cast<ConstantFP>(C(i)));
|
return ConstantVector::getSplat(mVWidth16, cast<ConstantFP>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantFP>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantFP>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1(bool i)
|
Value* Builder::VIMMED1(bool i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Value* Builder::VIMMED1_16(bool i)
|
Value* Builder::VIMMED1_16(bool i)
|
||||||
{
|
{
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
|
||||||
#else
|
|
||||||
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
|
#else
|
||||||
|
return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -555,10 +555,12 @@ namespace SwrJit
|
||||||
B->STORE(vSrc, pTmp);
|
B->STORE(vSrc, pTmp);
|
||||||
|
|
||||||
v32Gather = UndefValue::get(vSrc->getType());
|
v32Gather = UndefValue::get(vSrc->getType());
|
||||||
#if LLVM_VERSION_MAJOR > 10
|
#if LLVM_VERSION_MAJOR <= 10
|
||||||
auto vi32Scale = ConstantVector::getSplat(ElementCount::get(numElem, false), cast<ConstantInt>(i32Scale));
|
|
||||||
#else
|
|
||||||
auto vi32Scale = ConstantVector::getSplat(numElem, cast<ConstantInt>(i32Scale));
|
auto vi32Scale = ConstantVector::getSplat(numElem, cast<ConstantInt>(i32Scale));
|
||||||
|
#elif LLVM_VERSION_MAJOR == 11
|
||||||
|
auto vi32Scale = ConstantVector::getSplat(ElementCount(numElem, false), cast<ConstantInt>(i32Scale));
|
||||||
|
#else
|
||||||
|
auto vi32Scale = ConstantVector::getSplat(ElementCount::get(numElem, false), cast<ConstantInt>(i32Scale));
|
||||||
#endif
|
#endif
|
||||||
auto vi32Offsets = B->MUL(vi32Indices, vi32Scale);
|
auto vi32Offsets = B->MUL(vi32Indices, vi32Scale);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue