From 7e0b941e9f1e838a89b52fcd17da9f56e733febb Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 30 Mar 2019 01:14:52 +0300 Subject: [PATCH] PPU LLVM: implement get_vrs<>() adaptor Make use of structured bindings --- rpcs3/Emu/Cell/PPUTranslator.cpp | 4 ++-- rpcs3/Emu/Cell/PPUTranslator.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 784771975e..285edb123f 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -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(op.va, op.vb, op.vc); + set_vr(op.vd, eval((b & c) | (a & ~c))); } void PPUTranslator::VSL(ppu_opcode_t op) diff --git a/rpcs3/Emu/Cell/PPUTranslator.h b/rpcs3/Emu/Cell/PPUTranslator.h index baf071832c..c22ecb9658 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.h +++ b/rpcs3/Emu/Cell/PPUTranslator.h @@ -87,6 +87,12 @@ public: return result; } + template + std::tuple>...> get_vrs(const Args&... args) + { + return {get_vr(args)...}; + } + template void set_vr(u32 vr, value_t v) {