mirror of https://github.com/RPCS3/rpcs3.git
PPU LLVM: fix regression from warning fixes
Forgot that negative power is used here.
This commit is contained in:
parent
f1147f70f4
commit
0a41999818
|
@ -230,8 +230,23 @@ Value* PPUTranslator::GetAddr(u64 _add)
|
||||||
Type* PPUTranslator::ScaleType(Type* type, s32 pow2)
|
Type* PPUTranslator::ScaleType(Type* type, s32 pow2)
|
||||||
{
|
{
|
||||||
verify(HERE), (type->getScalarType()->isIntegerTy());
|
verify(HERE), (type->getScalarType()->isIntegerTy());
|
||||||
|
verify(HERE), pow2 > -32, pow2 < 32;
|
||||||
|
|
||||||
const auto new_type = m_ir->getIntNTy(type->getScalarSizeInBits() * (1 << pow2));
|
uint scaled = type->getScalarSizeInBits();
|
||||||
|
|
||||||
|
verify(HERE), utils::popcnt32(scaled) == 1;
|
||||||
|
|
||||||
|
if (pow2 > 0)
|
||||||
|
{
|
||||||
|
scaled <<= pow2;
|
||||||
|
}
|
||||||
|
else if (pow2 < 0)
|
||||||
|
{
|
||||||
|
scaled >>= -pow2;
|
||||||
|
}
|
||||||
|
|
||||||
|
verify(HERE), (scaled != 0);
|
||||||
|
const auto new_type = m_ir->getIntNTy(scaled);
|
||||||
return type->isVectorTy() ? VectorType::get(new_type, type->getVectorNumElements()) : cast<Type>(new_type);
|
return type->isVectorTy() ? VectorType::get(new_type, type->getVectorNumElements()) : cast<Type>(new_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue