From e3bfff5cb68035dc55e8238573e7b2e8f0dcce44 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 7 Dec 2024 12:11:41 +0100 Subject: [PATCH] JitArm64: Optimize ps_sel with d == b || d == c --- Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp index 900d9c87c1..7ac2c31bb9 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp @@ -7,6 +7,7 @@ #include "Common/CommonTypes.h" #include "Common/Config/Config.h" #include "Common/StringUtil.h" +#include "Common/Unreachable.h" #include "Core/Config/SessionSettings.h" #include "Core/ConfigManager.h" @@ -337,8 +338,12 @@ void JitArm64::ps_sel(UGeckoInstruction inst) const auto V0Q = fpr.GetScopedReg(); const ARM64Reg V0 = reg_encoder(V0Q); m_float_emit.FCMGE(size, V0, VA); - m_float_emit.BSL(V0, VC, VB); - m_float_emit.MOV(VD, V0); + if (d == b) + m_float_emit.BIT(VD, VC, V0); + else if (d == c) + m_float_emit.BIF(VD, VB, V0); + else + Common::Unreachable(); } ASSERT_MSG(DYNA_REC, singles == (fpr.IsSingle(a) && fpr.IsSingle(b) && fpr.IsSingle(c)),