Skip to content

Commit b7311ea

Browse files
authored
Merge pull request 86Box#5260 from Cacodemon345/fpu-interpreter-fix
Fix compile on ARM64
2 parents 7af8533 + c715391 commit b7311ea

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

src/cpu/386_dynarec.c

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ x386_dynarec_log(const char *fmt, ...)
7474
# define x386_dynarec_log(fmt, ...)
7575
#endif
7676

77-
/* Deliberately stashed here; this function is only relevant for dynamic recompilers. */
7877
#if defined(_MSC_VER) && !defined(__clang__)
7978
# if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _M_IX86
8079
# define X87_INLINE_ASM
@@ -85,40 +84,6 @@ x386_dynarec_log(const char *fmt, ...)
8584
# endif
8685
#endif
8786

88-
#ifdef USE_NEW_DYNAREC
89-
void
90-
x87_to_mmxreg(uint16_t reg)
91-
#else
92-
void
93-
x87_to_mmxreg(void)
94-
#endif
95-
{
96-
#ifndef USE_NEW_DYNAREC
97-
uint32_t reg = cpu_state.TOP & 7;
98-
#endif
99-
double val = cpu_state.ST[reg & 7];
100-
#ifdef X87_INLINE_ASM
101-
unsigned char buffer[10];
102-
#else
103-
x87_conv_t test;
104-
#endif
105-
106-
#ifdef X87_INLINE_ASM
107-
__asm volatile(""
108-
:
109-
:
110-
: "memory");
111-
112-
__asm volatile("fldl %1\n"
113-
"fstpt %0\n" : "=m"(buffer) : "m"(val));
114-
115-
cpu_state.MM[reg & 7].q = (*(uint64_t*)buffer);
116-
#else
117-
x87_to80(val, &test);
118-
cpu_state.MM[reg & 7].q = test.eind.ll;
119-
#endif
120-
}
121-
12287
static __inline void
12388
fetch_ea_32_long(uint32_t rmdat)
12489
{
@@ -278,6 +243,41 @@ fetch_ea_16_long(uint32_t rmdat)
278243
# define CACHE_ON() (!(cr0 & (1 << 30)) && !(cpu_state.flags & T_FLAG))
279244
#endif
280245

246+
/* Deliberately stashed here; this function is only relevant for dynamic recompilers. */
247+
#ifdef USE_NEW_DYNAREC
248+
void
249+
x87_to_mmxreg(uint16_t reg)
250+
#else
251+
void
252+
x87_to_mmxreg(void)
253+
#endif
254+
{
255+
#ifndef USE_NEW_DYNAREC
256+
uint32_t reg = cpu_state.TOP & 7;
257+
#endif
258+
double val = cpu_state.ST[reg & 7];
259+
#ifdef X87_INLINE_ASM
260+
unsigned char buffer[10];
261+
#else
262+
x87_conv_t test;
263+
#endif
264+
265+
#ifdef X87_INLINE_ASM
266+
__asm volatile(""
267+
:
268+
:
269+
: "memory");
270+
271+
__asm volatile("fldl %1\n"
272+
"fstpt %0\n" : "=m"(buffer) : "m"(val));
273+
274+
cpu_state.MM[reg & 7].q = (*(uint64_t*)buffer);
275+
#else
276+
x87_to80(val, &test);
277+
cpu_state.MM[reg & 7].q = test.eind.ll;
278+
#endif
279+
}
280+
281281
#ifdef USE_DYNAREC
282282
int32_t cycles_main = 0;
283283
static int32_t cycles_old = 0;

0 commit comments

Comments
 (0)