[hatari-devel] Bug in FPU code |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
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
}