From aecf865c2c77da435d5f351b7eaeb49d200944a4 Mon Sep 17 00:00:00 2001 From: TomW Date: Mon, 17 Nov 2014 20:23:29 +0000 Subject: [PATCH] Re-added FCOMPP 80387 detection hack accidentally removed in FPU reorganisation. --- src/x87_ops_arith.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/x87_ops_arith.h b/src/x87_ops_arith.h index 65c5608..d2985e1 100644 --- a/src/x87_ops_arith.h +++ b/src/x87_ops_arith.h @@ -159,8 +159,12 @@ static int opFCOMPP(uint32_t fetchdat) pc++; if (fplog) pclog("FCOMPP\n"); npxs &= ~(C0|C2|C3); - if (ST(0) == ST(1)) npxs |= C3; - else if (ST(0) < ST(1)) npxs |= C0; + if (*(uint64_t *)&ST(0) == ((uint64_t)1 << 63) && *(uint64_t *)&ST(1) == 0) + npxs |= C0; /*Nasty hack to fix 80387 detection*/ + else if (ST(0) == ST(1)) + npxs |= C3; + else if (ST(0) < ST(1)) + npxs |= C0; x87_pop(); x87_pop(); CLOCK_CYCLES(4);