mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 09:18:40 +12:00
Remove cpu_translator::scarry, cpu_translator::merge
This commit is contained in:
parent
524aac75ed
commit
42448cf3e5
3 changed files with 7 additions and 19 deletions
|
@ -1296,20 +1296,6 @@ public:
|
||||||
return llvm_max<T, U>{std::forward<T>(a), std::forward<U>(b)};
|
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
|
// Rotate left
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static inline auto rol(T a, T b)
|
static inline auto rol(T a, T b)
|
||||||
|
|
|
@ -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));
|
// 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 s = eval(c + m);
|
||||||
// const auto z = eval((c >> 15) ^ 0x7fff);
|
// const auto z = eval((c >> 15) ^ 0x7fff);
|
||||||
// const auto x = eval(scarry(c, m, s) >> 15);
|
// const auto x = eval(((m ^ s) & ~(c ^ m)) >> 15);
|
||||||
// set_vr(op.vd, eval(merge(x, z, s)));
|
// set_vr(op.vd, eval((z & x) | (s & ~x)));
|
||||||
//SetSat(IsNotZero(saturated.second));
|
//SetSat(IsNotZero(saturated.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1078,8 +1078,9 @@ void PPUTranslator::VMSUMSHS(ppu_opcode_t op)
|
||||||
const auto m = eval(ml + mh);
|
const auto m = eval(ml + mh);
|
||||||
const auto s = eval(m + c);
|
const auto s = eval(m + c);
|
||||||
const auto z = eval((c >> 31) ^ 0x7fffffff);
|
const auto z = eval((c >> 31) ^ 0x7fffffff);
|
||||||
const auto x = eval(scarry(c, eval(m ^ sext<s32[4]>(m == 0x80000000u)), s) >> 31);
|
const auto mx = eval(m ^ sext<s32[4]>(m == 0x80000000u));
|
||||||
set_vr(op.vd, eval(merge(x, z, s)));
|
const auto x = eval(((mx ^ s) & ~(c ^ mx)) >> 31);
|
||||||
|
set_vr(op.vd, eval((z & x) | (s & ~x)));
|
||||||
SetSat(IsNotZero(x.value));
|
SetSat(IsNotZero(x.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5678,7 +5678,8 @@ public:
|
||||||
return;
|
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) //
|
void SHUFB(spu_opcode_t op) //
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue