From a77fd1e7f5e7f5091d21c94bb48795dd048658e2 Mon Sep 17 00:00:00 2001 From: SarahW Date: Sun, 9 Feb 2020 17:55:28 +0000 Subject: [PATCH] 8087 FNINIT initialises control word to 0x3ff. Fixes FPU detection on Xi8088. --- src/x87_ops_misc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/x87_ops_misc.h b/src/x87_ops_misc.h index 3a572cc..b2f7d32 100644 --- a/src/x87_ops_misc.h +++ b/src/x87_ops_misc.h @@ -58,7 +58,10 @@ static int opFINIT(uint32_t fetchdat) { FP_ENTER(); cpu_state.pc++; - cpu_state.npxc = 0x37F; + if (fpu_type == FPU_8087) + cpu_state.npxc = 0x3ff; + else + cpu_state.npxc = 0x37f; codegen_set_rounding_mode(X87_ROUNDING_NEAREST); cpu_state.npxs = 0; *(uint64_t *)cpu_state.tag = 0;