about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-05-27 13:13:52 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-05-27 13:13:52 +0200
commitde831ee5ac321883dcbad8408082c2423439781c (patch)
tree1dda690fab8c01dd9e5f0474cf7a2fd3d31c455f /src
parentda1cb42f2ac441da03b74dc37897838852d0ceee (diff)
downloadbox64-de831ee5ac321883dcbad8408082c2423439781c.tar.gz
box64-de831ee5ac321883dcbad8408082c2423439781c.zip
[INTERPRETER] Some fixes when opcode use with same reg as src and dest
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run0f.c4
-rw-r--r--src/emu/x64run660f.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/src/emu/x64run0f.c b/src/emu/x64run0f.c
index 2b229c5c..0dadfe2d 100644
--- a/src/emu/x64run0f.c
+++ b/src/emu/x64run0f.c
@@ -457,6 +457,10 @@ uintptr_t Run0F(x64emu_t *emu, rex_t rex, uintptr_t addr, int *step)
                     nextop = F8;

                     GETEM(0);

                     GETGM;

+                    if(GM==EM) {

+                        eam1 = *EM;

+                        EM = &eam1;

+                    }

                     for (int i=0; i<4; ++i) {

                         tmp32s = (int32_t)(GM->ub[i*2+0])*EM->sb[i*2+0] + (int32_t)(GM->ub[i*2+1])*EM->sb[i*2+1];

                         GM->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);

diff --git a/src/emu/x64run660f.c b/src/emu/x64run660f.c
index 3cee04c9..b602d997 100644
--- a/src/emu/x64run660f.c
+++ b/src/emu/x64run660f.c
@@ -332,6 +332,10 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                 nextop = F8;

                 GETEX(0);

                 GETGX;

+                if(GX==EX) {

+                    eax1 = *EX;

+                    EX=&eax1;

+                }

                 for (int i=0; i<8; ++i) {

                     tmp32s = (int32_t)(GX->ub[i*2+0])*EX->sb[i*2+0] + (int32_t)(GX->ub[i*2+1])*EX->sb[i*2+1];

                     GX->sw[i] = (tmp32s>32767)?32767:((tmp32s<-32768)?-32768:tmp32s);

@@ -1083,6 +1087,10 @@ uintptr_t Run660F(x64emu_t *emu, rex_t rex, uintptr_t addr)
                 nextop = F8;

                 GETEX(1);

                 GETGX;

+                if(GX==EX) {

+                    eax1 = *EX;

+                    EX=&eax1;

+                }

                 tmp8u = F8;

                 {

                     int src = tmp8u&3;