From e9d4869965825d31cfb380cebbc27b3166d973ba Mon Sep 17 00:00:00 2001 From: Sintendo Date: Wed, 5 Jun 2019 23:58:44 +0200 Subject: [PATCH] Jit64AsmCommon: Micro-optimize GenFrsqrte Save 2 bytes by testing register against itself and branching on the sign flag. Before: 0: 48 0f ba e0 3f bt rax,0x3f After: 0: 48 85 c0 test rax,rax --- Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp index 81b4b27204..70224162f0 100644 --- a/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp +++ b/Source/Core/Core/PowerPC/Jit64Common/Jit64AsmCommon.cpp @@ -101,8 +101,8 @@ void CommonAsmRoutines::GenFrsqrte() MOVQ_xmm(XMM0, R(RSCRATCH)); RET(); SetJumpTarget(inf); - BT(64, R(RSCRATCH), Imm8(63)); - FixupBranch negative = J_CC(CC_C); + TEST(64, R(RSCRATCH), R(RSCRATCH)); + FixupBranch negative = J_CC(CC_S); XORPD(XMM0, R(XMM0)); RET();