about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-03-18 09:23:26 +0000
committerptitSeb <sebastien.chev@gmail.com>2023-03-18 09:23:26 +0000
commit2c903dcb676e5d7d1e03a9e9810c85bf8d141e1a (patch)
tree1d426eb0dbd738f89786f94320498081952a5694 /src
parent2d3aafefe1756e6ffca6af99240fa1ff25d18871 (diff)
downloadbox64-2c903dcb676e5d7d1e03a9e9810c85bf8d141e1a.tar.gz
box64-2c903dcb676e5d7d1e03a9e9810c85bf8d141e1a.zip
[RV64_DYNAREC] Added 0F BE MOVSX opcode
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/rv64/dynarec_rv64_0f.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c
index 51e2784a..f2c684ab 100644
--- a/src/dynarec/rv64/dynarec_rv64_0f.c
+++ b/src/dynarec/rv64/dynarec_rv64_0f.c
@@ -347,6 +347,30 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
             }
             break;
 
+        case 0xBE:
+            INST_NAME("MOVSX Gd, Eb");
+            nextop = F8;
+            GETGD;
+            if(MODREG) {
+                if(rex.rex) {
+                    wback = xRAX+(nextop&7)+(rex.b<<3);
+                    wb2 = 0;
+                } else {
+                    wback = (nextop&7);
+                    wb2 = (wback>>2)*8;
+                    wback = xRAX+(wback&3);
+                }
+                SLLI(gd, wback, 56-wb2);
+                SRAI(gd, gd, 56);
+            } else {
+                SMREAD();
+                addr = geted(dyn, addr, ninst, nextop, &ed, x3, x1, &fixedaddress, rex, NULL, 1, 0);
+                LB(gd, ed, fixedaddress);
+            }
+            if(!rex.w)
+                ZEROUP(gd);
+            break;
+
         default:
             DEFAULT;
     }