Merge pull request #13212 from JosJuice/jitarm64-ps-sel-same-reg

JitArm64: Optimize ps_sel with d == b || d == c
This commit is contained in:
JMC47 2024-12-22 18:34:32 -05:00 committed by GitHub
commit a1d6aa7d3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,6 +7,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Config/Config.h" #include "Common/Config/Config.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Unreachable.h"
#include "Core/Config/SessionSettings.h" #include "Core/Config/SessionSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
@ -337,8 +338,12 @@ void JitArm64::ps_sel(UGeckoInstruction inst)
const auto V0Q = fpr.GetScopedReg(); const auto V0Q = fpr.GetScopedReg();
const ARM64Reg V0 = reg_encoder(V0Q); const ARM64Reg V0 = reg_encoder(V0Q);
m_float_emit.FCMGE(size, V0, VA); m_float_emit.FCMGE(size, V0, VA);
m_float_emit.BSL(V0, VC, VB); if (d == b)
m_float_emit.MOV(VD, V0); 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)), ASSERT_MSG(DYNA_REC, singles == (fpr.IsSingle(a) && fpr.IsSingle(b) && fpr.IsSingle(c)),