diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-04-13 17:36:56 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-04-13 17:36:56 +0200 |
| commit | 459311187197964f44db932d9c42e0461b8cc895 (patch) | |
| tree | 47927aff7c6b778043d807213edc72f45e9672a9 /src | |
| parent | 7440be495e08aad8fd9ffb7e264e2bf53ac62a5e (diff) | |
| download | box64-459311187197964f44db932d9c42e0461b8cc895.tar.gz box64-459311187197964f44db932d9c42e0461b8cc895.zip | |
Added 67 0F 2E/2F opcodes
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64run67.c | 2 | ||||
| -rw-r--r-- | src/emu/x64run670f.c | 68 | ||||
| -rwxr-xr-x | src/emu/x64run_private.h | 1 |
3 files changed, 71 insertions, 0 deletions
diff --git a/src/emu/x64run67.c b/src/emu/x64run67.c index 75f64125..320ea2ac 100644 --- a/src/emu/x64run67.c +++ b/src/emu/x64run67.c @@ -96,6 +96,8 @@ int Run67(x64emu_t *emu, rex_t rex, int rep) GO(0x00, add) /* ADD 0x00 -> 0x05 */ GO(0x08, or) /* OR 0x08 -> 0x0D */ + case 0x0F: + return Run670F(emu, rex, rep); GO(0x10, adc) /* ADC 0x10 -> 0x15 */ GO(0x18, sbb) /* SBB 0x18 -> 0x1D */ GO(0x20, and) /* AND 0x20 -> 0x25 */ diff --git a/src/emu/x64run670f.c b/src/emu/x64run670f.c new file mode 100644 index 00000000..749dfde8 --- /dev/null +++ b/src/emu/x64run670f.c @@ -0,0 +1,68 @@ +#define _GNU_SOURCE +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <math.h> +#include <string.h> +#include <signal.h> +#include <sys/types.h> +#include <unistd.h> + +#include "debug.h" +#include "box64stack.h" +#include "x64emu.h" +#include "x64run.h" +#include "x64emu_private.h" +#include "x64run_private.h" +#include "x64primop.h" +#include "x64trace.h" +#include "x87emu_private.h" +#include "box64context.h" +#include "bridge.h" +#ifdef DYNAREC +#include "../dynarec/arm64_lock.h" +#endif + +#include "modrm.h" + +int Run670F(x64emu_t *emu, rex_t rex, int rep) +{ + uint8_t opcode; + uint8_t nextop; + uint8_t tmp8u; + int8_t tmp8s; + int32_t tmp32s, tmp32s2; + uint32_t tmp32u, tmp32u2; + uint64_t tmp64u, tmp64u2; + reg64_t *oped, *opgd; + sse_regs_t *opex, *opgx, eax1; + mmx87_regs_t *opem, *opgm, eam1; + + opcode = F8; + + switch(opcode) { + + case 0x2E: /* UCOMISS Gx, Ex */ + // same for now + case 0x2F: /* COMISS Gx, Ex */ + RESET_FLAGS(emu); + nextop = F8; + GETEX32(0); + GETGX; + if(isnan(GX->f[0]) || isnan(EX->f[0])) { + SET_FLAG(F_ZF); SET_FLAG(F_PF); SET_FLAG(F_CF); + } else if(isgreater(GX->f[0], EX->f[0])) { + CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); + } else if(isless(GX->f[0], EX->f[0])) { + CLEAR_FLAG(F_ZF); CLEAR_FLAG(F_PF); SET_FLAG(F_CF); + } else { + SET_FLAG(F_ZF); CLEAR_FLAG(F_PF); CLEAR_FLAG(F_CF); + } + CLEAR_FLAG(F_OF); CLEAR_FLAG(F_AF); CLEAR_FLAG(F_SF); + break; + + default: + return 1; + } + return 0; +} \ No newline at end of file diff --git a/src/emu/x64run_private.h b/src/emu/x64run_private.h index e465c6b0..e30edbec 100755 --- a/src/emu/x64run_private.h +++ b/src/emu/x64run_private.h @@ -109,6 +109,7 @@ int Run6664(x64emu_t *emu, rex_t rex); int Run66D9(x64emu_t *emu, rex_t rex); int Run66DD(x64emu_t *emu, rex_t rex); int Run67(x64emu_t *emu, rex_t rex, int rep); +int Run670F(x64emu_t *emu, rex_t rex, int rep); int Run6766(x64emu_t *emu, rex_t rex, int rep); int Run67660F(x64emu_t *emu, rex_t rex); int RunD8(x64emu_t *emu, rex_t rex); |