1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2025-01-31 12:31:45 +01:00

Remove cpu_translator::scarry, cpu_translator::merge

This commit is contained in:
Nekotekina 2019-04-19 13:27:11 +03:00
parent 524aac75ed
commit 42448cf3e5
3 changed files with 7 additions and 19 deletions

View File

@ -1296,20 +1296,6 @@ public:
return llvm_max<T, U>{std::forward<T>(a), std::forward<U>(b)};
}
// Get signed addition overflow into the sign bit (s = a + b)
template <typename T>
static inline auto scarry(T a, T b, T s)
{
return (b ^ s) & ~(a ^ b);
}
// Bitwise select (c ? a : b)
template <typename T>
static inline auto merge(T c, T a, T b)
{
return (a & c) | (b & ~c);
}
// Rotate left
template <typename T>
static inline auto rol(T a, T b)

View File

@ -950,8 +950,8 @@ void PPUTranslator::VMHADDSHS(ppu_opcode_t op)
// m.value = m_ir->CreateOr(m.value, m_ir->CreateLShr(m_ir->CreateMul(a.value, b.value), 15));
// const auto s = eval(c + m);
// const auto z = eval((c >> 15) ^ 0x7fff);
// const auto x = eval(scarry(c, m, s) >> 15);
// set_vr(op.vd, eval(merge(x, z, s)));
// const auto x = eval(((m ^ s) & ~(c ^ m)) >> 15);
// set_vr(op.vd, eval((z & x) | (s & ~x)));
//SetSat(IsNotZero(saturated.second));
}
@ -1078,8 +1078,9 @@ void PPUTranslator::VMSUMSHS(ppu_opcode_t op)
const auto m = eval(ml + mh);
const auto s = eval(m + c);
const auto z = eval((c >> 31) ^ 0x7fffffff);
const auto x = eval(scarry(c, eval(m ^ sext<s32[4]>(m == 0x80000000u)), s) >> 31);
set_vr(op.vd, eval(merge(x, z, s)));
const auto mx = eval(m ^ sext<s32[4]>(m == 0x80000000u));
const auto x = eval(((mx ^ s) & ~(c ^ mx)) >> 31);
set_vr(op.vd, eval((z & x) | (s & ~x)));
SetSat(IsNotZero(x.value));
}

View File

@ -5678,7 +5678,8 @@ public:
return;
}
set_vr(op.rt4, merge(get_vr(op.rc), get_vr(op.rb), get_vr(op.ra)));
const auto c = get_vr(op.rc);
set_vr(op.rt4, (get_vr(op.rb) & c) | (get_vr(op.ra) & ~c));
}
void SHUFB(spu_opcode_t op) //