mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
PPU LLVM: fix regression from warning fixes
Forgot that negative power is used here.
This commit is contained in:
parent
f1147f70f4
commit
0a41999818
1 changed files with 16 additions and 1 deletions
|
@ -230,8 +230,23 @@ Value* PPUTranslator::GetAddr(u64 _add)
|
|||
Type* PPUTranslator::ScaleType(Type* type, s32 pow2)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue