Some MMX optimizations.

This commit is contained in:
OBattler
2023-07-16 03:43:54 +02:00
parent e47e1b62c8
commit 1d59351c03
5 changed files with 11 additions and 6 deletions

View File

@@ -14,7 +14,7 @@
# #
add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c add_library(cpu OBJECT cpu.c cpu_table.c fpu.c x86.c 808x.c 386.c 386_common.c
386_dynarec.c x86seg.c x87.c x87_timings.c 8080.c) 386_dynarec.c x86_ops_mmx.c x86seg.c x87.c x87_timings.c 8080.c)
if(AMD_K5) if(AMD_K5)
target_compile_definitions(cpu PRIVATE USE_AMD_K5) target_compile_definitions(cpu PRIVATE USE_AMD_K5)

View File

@@ -1646,6 +1646,7 @@ cpu_set(void)
cpu_exec = exec386; cpu_exec = exec386;
else else
cpu_exec = execx86; cpu_exec = execx86;
mmx_init();
gdbstub_cpu_init(); gdbstub_cpu_init();
} }

View File

@@ -850,4 +850,9 @@ extern void cpu_fast_off_reset(void);
extern void smi_raise(void); extern void smi_raise(void);
extern void nmi_raise(void); extern void nmi_raise(void);
extern MMX_REG *MMP[8];
extern uint16_t *MMEP[8];
extern void mmx_init(void);
#endif /*EMU_CPU_H*/ #endif /*EMU_CPU_H*/

View File

@@ -3,12 +3,11 @@
#define USATB(val) (((val) < 0) ? 0 : (((val) > 255) ? 255 : (val))) #define USATB(val) (((val) < 0) ? 0 : (((val) > 255) ? 255 : (val)))
#define USATW(val) (((val) < 0) ? 0 : (((val) > 65535) ? 65535 : (val))) #define USATW(val) (((val) < 0) ? 0 : (((val) > 65535) ? 65535 : (val)))
#define MMX_GETREGP(r) fpu_softfloat ? ((MMX_REG *) &fpu_state.st_space[r].fraction) : &(cpu_state.MM[r]) #define MMX_GETREGP(r) MMP[r]
#define MMX_GETREG(r) fpu_softfloat ? (*(MMX_REG *) &fpu_state.st_space[r].fraction) : cpu_state.MM[r] #define MMX_GETREG(r) *(MMP[r])
#define MMX_SETEXP(r) \ #define MMX_SETEXP(r) \
if (fpu_softfloat) \ *(MMEP[r]) = 0xffff
fpu_state.st_space[r].exp = 0xffff
#define MMX_GETSRC() \ #define MMX_GETSRC() \
if (cpu_mod == 3) { \ if (cpu_mod == 3) { \

View File

@@ -553,7 +553,7 @@ CPUOBJ := $(DYNARECOBJ) \
$(CGTOBJ) \ $(CGTOBJ) \
cpu.o cpu_table.o fpu.o x86.o \ cpu.o cpu_table.o fpu.o x86.o \
8080.o 808x.o 386.o 386_common.o 386_dynarec.o 386_dynarec_ops.o \ 8080.o 808x.o 386.o 386_common.o 386_dynarec.o 386_dynarec_ops.o \
x86seg.o x87.o x87_timings.o \ x86_ops_mmx.o x86seg.o x87.o x87_timings.o \
f2xm1.o fpatan.o fprem.o fsincos.o fyl2x.o softfloat_poly.o softfloat.o softfloat16.o \ f2xm1.o fpatan.o fprem.o fsincos.o fyl2x.o softfloat_poly.o softfloat.o softfloat16.o \
softfloat-muladd.o softfloat-round-pack.o softfloat-specialize.o softfloatx80.o softfloat-muladd.o softfloat-round-pack.o softfloat-specialize.o softfloatx80.o