mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 12:31:45 +01: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)
|
void PPUTranslator::VSEL(ppu_opcode_t op)
|
||||||
{
|
{
|
||||||
const auto abc = GetVrs(VrType::vi32, op.va, op.vb, op.vc);
|
const auto [a, b, c] = get_vrs<u32[4]>(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]))));
|
set_vr(op.vd, eval((b & c) | (a & ~c)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPUTranslator::VSL(ppu_opcode_t op)
|
void PPUTranslator::VSL(ppu_opcode_t op)
|
||||||
|
@ -87,6 +87,12 @@ public:
|
|||||||
return result;
|
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>
|
template <typename T>
|
||||||
void set_vr(u32 vr, value_t<T> v)
|
void set_vr(u32 vr, value_t<T> v)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user