]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
FACOS fix.
authorToni Wilen <twilen@winuae.net>
Tue, 3 Jul 2018 18:57:54 +0000 (21:57 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 3 Jul 2018 18:57:54 +0000 (21:57 +0300)
jit/codegen_x86.cpp
jit/compemu_fpp.cpp
od-win32/fpp_native_msvc_80bit.cpp
od-win32/fpux64_80.asm
od-win32/fpux86_80.asm

index 5dffefaf6a9d03d1bd889284641f79ae8d70416c..8bd53e85c0ef093cdca7fa1fe1f53778508e3c16 100644 (file)
@@ -4999,7 +4999,7 @@ LOWFUNC(NONE,NONE,2,raw_fasin_rr,(FW d, FR s))
 }
 LENDFUNC(NONE,NONE,2,raw_fasin_rr,(FW d, FR s))
 
-static uae_u32 pihalf[] = {0x2168c234, 0xc90fdaa2, 0x3fff}; // LSB=0 to get acos(1)=0
+static uae_u32 pihalf[] = {0x2168c235, 0xc90fdaa2, 0x3fff};
 
 LOWFUNC(NONE,NONE,2,raw_facos_rr,(FW d, FR s))
 {
index ebbaa6b2bcd1d56eea0fb76aedc5f61192f4c07f..e35de7a68bc88e2b28a74ec1ff98f7bf92780bbe 100644 (file)
@@ -1186,7 +1186,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra)
                        fneg_rr (dreg, sreg);
                        break;
                        case 0x1c: /* FACOS */
-#if USE_X86_FPUCW
+#if 0 && USE_X86_FPUCW
                        if ((regs.fpcr & 0x30) != 0x10) { /* use round to zero */
                                mov_l_ri (S1, (regs.fpcr & 0xC0) | 0x10);
                                fldcw_m_indexed (S1, uae_p32(x86_fpucw));
index 80f3e0758adb06019fef5491c862ca40b9258acf..80bfcc0f35f38d0e92d8bf60bf6a8fc63020de45 100644 (file)
@@ -345,11 +345,24 @@ static void xfp_resetnormal(fpdata *fp)
                fp_round_double(fp);
 }
 
+// precision bits 8,9
+//
+// 24-bit: 00
+// 32-bit: 10
+// 64-bit: 11
+
+// rounding bits 10,11
+//
+// nearest even: 00
+// down toward infinity: 01
+// up toward infinity 10
+// toward zero: 11
+
 static void xfp_setnormal(void)
 {
        uae_u16 v = fpx_mode;
        v |= 3 << 8; // extended
-       v &= ~(10 << 3); // round nearest
+       v &= ~(3 << 10); // round nearest
        if (v != fpx_mode) {
                xfp_fldcw(&v);
                xfp_swprec = fs.floatx80_rounding_precision;
index 4397d51c7568dfff4d2a85daa64a0a37471f7b38..81e63eef835af08b50653438de44f622fe796907 100644 (file)
@@ -489,4 +489,4 @@ align 4
 one:
        dd 1.0
 pihalf:
-       dd 0x2168c234,0xc90fdaa2,0x00003fff
+       dd 0x2168c235,0xc90fdaa2,0x00003fff
index ffe780ecd98a161ebd35a2bdb202b889c0b5a510..4549b820b04cf55c6afb9c097fdb06ba166ea6bf 100644 (file)
@@ -512,4 +512,4 @@ align 4
 one:
        dd 1.0
 pihalf:
-       dd 0x2168c234,0xc90fdaa2,0x00003fff
+       dd 0x2168c235,0xc90fdaa2,0x00003fff