From f21523ff7413d882cf71fe9cff50b28b7745368c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 5 Oct 2023 18:56:15 +0200 Subject: [PATCH] WriteVector: Pluck transpose out of the loop --- Core/MIPS/MIPSVFPUUtils.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Core/MIPS/MIPSVFPUUtils.cpp b/Core/MIPS/MIPSVFPUUtils.cpp index ebb91d863b..0f547be819 100644 --- a/Core/MIPS/MIPSVFPUUtils.cpp +++ b/Core/MIPS/MIPSVFPUUtils.cpp @@ -215,14 +215,19 @@ void WriteVector(const float *rd, VectorSize size, int reg) { V(base + ((row+i)&3)*32) = rd[i]; } } else { - for (int i = 0; i < length; i++) { - if (!currentMIPS->VfpuWriteMask(i)) { - int index = mtx; - if (transpose) - index += ((row+i)&3) + col*32; - else - index += col + ((row+i)&3)*32; - V(index) = rd[i]; + if (transpose) { + for (int i = 0; i < length; i++) { + if (!currentMIPS->VfpuWriteMask(i)) { + int index = mtx + ((row + i) & 3) + col * 32; + V(index) = rd[i]; + } + } + } else { + for (int i = 0; i < length; i++) { + if (!currentMIPS->VfpuWriteMask(i)) { + int index = mtx + col + ((row + i) & 3) * 32; + V(index) = rd[i]; + } } } }