about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2023-04-02 18:59:56 +0800
committerGitHub <noreply@github.com>2023-04-02 12:59:56 +0200
commit518e6782d87eb2923fef7f36e49992d0aa195182 (patch)
tree46d2e514df1d581b8acd96a2165fe4d1f786b284 /src
parent2a346ef0b951ce9a2dd7296fbad15f24b7566971 (diff)
downloadbox64-518e6782d87eb2923fef7f36e49992d0aa195182.tar.gz
box64-518e6782d87eb2923fef7f36e49992d0aa195182.zip
[RV64_DYNAREC] Reverted changes to GETED and fixed emit_and32* (#663)
* [RV64_DYNAREC] Revert changes to GETED

* [RV64_DYNAREC] Fixed emit_and32*
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_emit_logic.c4
-rw-r--r--src/dynarec/rv64/dynarec_rv64_helper.h1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_emit_logic.c b/src/dynarec/rv64/dynarec_rv64_emit_logic.c
index c72e5add..9ee739bb 100644
--- a/src/dynarec/rv64/dynarec_rv64_emit_logic.c
+++ b/src/dynarec/rv64/dynarec_rv64_emit_logic.c
@@ -388,12 +388,12 @@ void emit_and32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s
     }
 
     AND(s1, s1, s2); // res = s1 & s2
+    if (!rex.w) ZEROUP(s1);
 
     IFX(X_PEND) {
         SDxw(s1, xEmu, offsetof(x64emu_t, res));
     }
     IFX(X_SF) {
-        if (!rex.w) ZEROUP(s1);
         SRLI(s3, s1, rex.w?63:31);
         BEQZ(s3, 8);
         ORI(xFlags, xFlags, 1 << F_SF);
@@ -423,12 +423,12 @@ void emit_and32c(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int64_t c, i
         MOV64xw(s3, c);
         AND(s1, s1, s3); // res = s1 & s2
     }
+    if (!rex.w) ZEROUP(s1);
 
     IFX(X_PEND) {
         SDxw(s1, xEmu, offsetof(x64emu_t, res));
     }
     IFX(X_SF) {
-        if (!rex.w) ZEROUP(s1);
         SRLI(s3, s1, rex.w?63:31);
         BEQZ(s3, 8);
         ORI(xFlags, xFlags, 1 << F_SF);
diff --git a/src/dynarec/rv64/dynarec_rv64_helper.h b/src/dynarec/rv64/dynarec_rv64_helper.h
index adbf3989..be5931d6 100644
--- a/src/dynarec/rv64/dynarec_rv64_helper.h
+++ b/src/dynarec/rv64/dynarec_rv64_helper.h
@@ -66,7 +66,6 @@
 #define GETED(D)  if(MODREG) {                          \
                     ed = xRAX+(nextop&7)+(rex.b<<3);    \
                     wback = 0;                          \
-                    if (!rex.w) ZEROUP(ed);              \
                 } else {                                \
                     SMREAD()                            \
                     addr = geted(dyn, addr, ninst, nextop, &wback, x2, x1, &fixedaddress, rex, NULL, 1, D); \