From 2b8e81f01e7b9fca44cea8f75016be54efa389a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 15 Aug 2017 14:35:21 +0200 Subject: [PATCH] NEON-optimize bone matrix loads --- GPU/GPUState.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index 4b39884c17..a3d23694e5 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -28,6 +28,9 @@ #ifdef _M_SSE #include #endif +#if PPSSPP_ARCH(ARM_NEON) +#include +#endif // This must be aligned so that the matrices within are aligned. GPUgstate MEMORY_ALIGNED16(gstate); @@ -138,6 +141,13 @@ void GPUgstate::FastLoadBoneMatrix(u32 addr) { _mm_storeu_si128((__m128i *)(dst + 4), row2); _mm_storeu_si128((__m128i *)(dst + 8), row3); } +#elif PPSSPP_ARCH(ARM_NEON) + const uint32x4_t row1 = vshlq_n_u32(vld1q_u32(src), 8); + const uint32x4_t row2 = vshlq_n_u32(vld1q_u32(src + 4), 8); + const uint32x4_t row3 = vshlq_n_u32(vld1q_u32(src + 8), 8); + vst1q_u32(dst, row1); + vst1q_u32(dst + 4, row2); + vst1q_u32(dst + 8, row3); #else for (int i = 0; i < 12; i++) { dst[i] = src[i] << 8;