mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-16 23:17:29 +00:00
PPU LLVM: implement get_vrs<>() adaptor
Make use of structured bindings
This commit is contained in:
parent
d77fed6105
commit
7e0b941e9f
@ -1331,8 +1331,8 @@ void PPUTranslator::VRSQRTEFP(ppu_opcode_t op)
|
||||
|
||||
void PPUTranslator::VSEL(ppu_opcode_t op)
|
||||
{
|
||||
const auto abc = GetVrs(VrType::vi32, op.va, op.vb, op.vc);
|
||||
SetVr(op.vd, m_ir->CreateOr(m_ir->CreateAnd(abc[1], abc[2]), m_ir->CreateAnd(abc[0], m_ir->CreateNot(abc[2]))));
|
||||
const auto [a, b, c] = get_vrs<u32[4]>(op.va, op.vb, op.vc);
|
||||
set_vr(op.vd, eval((b & c) | (a & ~c)));
|
||||
}
|
||||
|
||||
void PPUTranslator::VSL(ppu_opcode_t op)
|
||||
|
@ -87,6 +87,12 @@ public:
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
std::tuple<std::conditional_t<false, Args, value_t<T>>...> get_vrs(const Args&... args)
|
||||
{
|
||||
return {get_vr<T>(args)...};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void set_vr(u32 vr, value_t<T> v)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user