about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorphorcys <phorcys@126.com>2025-04-14 15:14:45 +0800
committerGitHub <noreply@github.com>2025-04-14 09:14:45 +0200
commitb7cb36d362861cf857a6958c13c2357657c1d967 (patch)
tree680f2dad3ebc25558d0e6a0e0011db66b4df2d49 /src
parent1bd471bf135dce48949975eeee89b3324ee75b51 (diff)
downloadbox64-b7cb36d362861cf857a6958c13c2357657c1d967.tar.gz
box64-b7cb36d362861cf857a6958c13c2357657c1d967.zip
[LA64_DYNAREC] Optimize sse_setround (#2527)
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/la64/dynarec_la64_helper.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/dynarec/la64/dynarec_la64_helper.c b/src/dynarec/la64/dynarec_la64_helper.c
index c5e0b00e..c76690d9 100644
--- a/src/dynarec/la64/dynarec_la64_helper.c
+++ b/src/dynarec/la64/dynarec_la64_helper.c
@@ -798,19 +798,12 @@ int sse_setround(dynarec_la64_t* dyn, int ninst, int s1, int s2)
     MAYUSE(s1);
     MAYUSE(s2);
     LD_W(s1, xEmu, offsetof(x64emu_t, mxcsr));
-    SRLI_D(s1, s1, 13);
-    ANDI(s1, s1, 0b11);
+    BSTRPICK_W(s1, s1, 14, 13);
     // MMX/x87 Round mode: 0..3: Nearest, Down, Up, Chop
     // LA64: 0..3: Nearest, TowardZero, TowardsPositive, TowardsNegative
     // 0->0, 1->3, 2->2, 3->1
-    BEQ(s1, xZR, 4 + 4 * 8); // done + 4
-    ADDI_D(s2, xZR, 2);
-    BEQ(s1, s2, 4 + 4 * 5); // done
-    ADDI_D(s2, xZR, 3);
-    BEQ(s1, s2, 4 + 4 * 2);
-    ADDI_D(s1, xZR, 3);
-    B(8);
-    ADDI_D(s1, xZR, 1);
+    SUB_W(s1, xZR, s1);
+    ANDI(s1, s1, 3);
     // done
     SLLI_D(s1, s1, 8);
     MOVFCSR2GR(s2, FCSR3);