Re: [hatari-devel] Bug in FPU code

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

Eero, Thomas, Nicolas, I've tested the patch with the esquimau demo, but I haven't seen any change. (Eskimau does a lot of FPU).

As I'm not a specialist of #if USE_LONG_DOUBLE defines and the code after, I prefer asking you your advice on this patch before uploading anything.

Is the fix OK for any case of #if USE_LONG_DOUBLE ? (on every computer, .... little / big endian, ...) ?

At least, the patch doesn't seem to break anything, but I've done only one test.

Regards

Laurent


Le 05/03/2012 19:51, Andreas Grabher a écrit :
While working on Previous i found a bug in the FPU code and fixed it. This makes the FPU pass NeXT's power-on test using 68040 with its internal FPU. 68030/68882 still not working but getting to the next stage now.

I appended the patch to this message.
As i am still new to coding, please check the code before applying the patch.

Regards,

Andreas


diff -crB /Users/andi/Desktop/branch_scsiold/src/cpu/md-fpp.h /Users/andi/Desktop/branch_scsi/src/cpu/md-fpp.h
*** /Users/andi/Desktop/branch_scsiold/src/cpu/md-fpp.h	2011-12-14 19:29:29.000000000 +0100
--- /Users/andi/Desktop/branch_scsi/src/cpu/md-fpp.h	2012-03-05 19:09:33.000000000 +0100
***************
*** 33,41 ****
   STATIC_INLINE void from_exten(long double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u32 * wrd3)
   {
       register uae_u32 *longarray = (uae_u32 *)&src;
!     register uae_u16 *finalword = (uae_u16 *)(&src + 8);

!     *wrd1 = ((uae_u32)*finalword)<<16;
       *wrd2 = longarray[1];
       *wrd3 = longarray[0]; // little endian
   }
--- 33,42 ----
   STATIC_INLINE void from_exten(long double src, uae_u32 * wrd1, uae_u32 * wrd2, uae_u32 * wrd3)
   {
       register uae_u32 *longarray = (uae_u32 *)&src;
! //    register uae_u16 *finalword = (uae_u16 *)(&src + 8);

! //    *wrd1 = ((uae_u32)*finalword)<<16;
!     *wrd1 = (longarray[2]&  0xffff)<<16;
       *wrd2 = longarray[1];
       *wrd3 = longarray[0]; // little endian
   }








Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/