From 1ebec40e4d4c473bc717b1d5836b8320f4851388 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 6 Aug 2023 11:52:25 +0200 Subject: [PATCH] JitArm64: Prefer MOVI with 64-bit elements for zeroing The Cortex-X2 and Cortex-X3 (and possibly others) recognize MOVI with 64-bit elements as a zeroing idiom, but not MOVI with other sizes. --- Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp | 2 +- Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp index c5624ee6d4f2..54ba054bce93 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp @@ -832,7 +832,7 @@ void JitArm64::ConvertSingleToDoublePair(size_t guest_reg, ARM64Reg dest_reg, AR { // Set each 32-bit element of scratch_reg to 0x0000'0000 or 0xFFFF'FFFF depending on whether // the absolute value of the corresponding element in src_reg compares greater than 0 - m_float_emit.MOVI(8, EncodeRegToDouble(scratch_reg), 0); + m_float_emit.MOVI(64, EncodeRegToDouble(scratch_reg), 0); m_float_emit.FACGT(32, EncodeRegToDouble(scratch_reg), EncodeRegToDouble(src_reg), EncodeRegToDouble(scratch_reg)); diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp index 4c0730f9d0b2..a79bf83cb047 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Paired.cpp @@ -254,7 +254,7 @@ void JitArm64::ps_arith(UGeckoInstruction inst) // Pick the right NaNs - m_float_emit.MOVI(8, zero_reg, 0); + m_float_emit.MOVI(64, zero_reg, 0); const auto check_input = [&](ARM64Reg input) { m_float_emit.FACGE(size, nan_temp_reg_paired, input, zero_reg);