about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-02-02 16:11:39 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-02-02 16:11:39 +0100
commit0861a88d6e3009b3e70604da089d54672d5942ef (patch)
treed2b751cb19797105dd43d6094cb7f4edd5875972 /src
parent1c0dc8ec7c2d06a1c14c5c7349e08fe89fd00470 (diff)
downloadbox64-0861a88d6e3009b3e70604da089d54672d5942ef.tar.gz
box64-0861a88d6e3009b3e70604da089d54672d5942ef.zip
[COSIM] Don't do div by 0 signal on interpreter part when testing
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index c339dcf5..49600889 100644
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -1974,13 +1974,17 @@ x64emurun:
                     imul8(emu, EB->byte[0]);
                     break;
                 case 6:                 /* DIV Eb */
+                    #ifndef TEST_INTERPRETER
                     if(!EB->byte[0])
                         emit_div0(emu, (void*)R_RIP, 1);
+                    #endif
                     div8(emu, EB->byte[0]);
                     break;
                 case 7:                 /* IDIV Eb */
+                    #ifndef TEST_INTERPRETER
                     if(!EB->byte[0])
                         emit_div0(emu, (void*)R_RIP, 1);
+                    #endif
                     idiv8(emu, EB->byte[0]);
                     break;
             }
@@ -2009,13 +2013,17 @@ x64emurun:
                         imul64_rax(emu, ED->q[0]);
                         break;
                     case 6:                 /* DIV Ed */
+                        #ifndef TEST_INTERPRETER
                         if(!ED->q[0])
                             emit_div0(emu, (void*)R_RIP, 1);
+                        #endif
                         div64(emu, ED->q[0]);
                         break;
                     case 7:                 /* IDIV Ed */
+                        #ifndef TEST_INTERPRETER
                         if(!ED->q[0])
                             emit_div0(emu, (void*)R_RIP, 1);
+                        #endif
                         idiv64(emu, ED->q[0]);
                         break;
                 }
@@ -2049,15 +2057,19 @@ x64emurun:
                         emu->regs[_DX].dword[1] = 0;
                         break;
                     case 6:                 /* DIV Ed */
+                        #ifndef TEST_INTERPRETER
                         if(!ED->dword[0])
                             emit_div0(emu, (void*)R_RIP, 1);
+                        #endif
                         div32(emu, ED->dword[0]);
                         //emu->regs[_AX].dword[1] = 0;  // already put high regs to 0
                         //emu->regs[_DX].dword[1] = 0;
                         break;
                     case 7:                 /* IDIV Ed */
+                        #ifndef TEST_INTERPRETER
                         if(!ED->dword[0])
                             emit_div0(emu, (void*)R_RIP, 1);
+                        #endif
                         idiv32(emu, ED->dword[0]);
                         //emu->regs[_AX].dword[1] = 0;
                         //emu->regs[_DX].dword[1] = 0;