From 77ab872bec4412ea1c14296b2832529545690df3 Mon Sep 17 00:00:00 2001 From: sguo35 Date: Sat, 9 Jul 2022 23:35:27 -0700 Subject: [PATCH] spu: remove rotqby C++ impl rotqby C++ implementation is broken, since replacing it with the intrinsic version reliably fixes spurs test. A conditional branch immediately after a rotqby instruction will fail using the C++ version but succeed using the intrinsic. --- rpcs3/Emu/Cell/SPURecompiler.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 7bcbf07b64..722116aa60 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -27,6 +27,10 @@ #include "util/simd.hpp" #include "util/sysinfo.hpp" +#if defined(ARCH_ARM64) +#include "Emu/CPU/sse2neon.h" +#endif + const extern spu_decoder g_spu_itype; const extern spu_decoder g_spu_iname; const extern spu_decoder g_spu_iflag; @@ -6877,20 +6881,14 @@ public: set_vr(op.rt, fshl(a, zshuffle(a, 4, 0, 1, 2), b)); } -#if defined(ARCH_X64) +#if defined(ARCH_X64) || defined(ARCH_ARM64) static __m128i exec_rotqby(__m128i a, u8 b) { alignas(32) const __m128i buf[2]{a, a}; return _mm_loadu_si128(reinterpret_cast(reinterpret_cast(buf) + (16 - (b & 0xf)))); } #else - static v128 exec_rotqby(v128 a, u8 b) - { - alignas(32) const v128 buf[2]{a, a}; - alignas(16) v128 res; - std::memcpy(&res, reinterpret_cast(buf) + (16 - (b & 0xf)), 16); - return res; - } +#error "Unimplemented" #endif void ROTQBY(spu_opcode_t op)