Hi Christian, thanks for the hints.
On Sun, May 29, 2016 at 01:42:44PM +0200, Christian Seiler wrote: > On Thu, 21 Jan 2016 22:29:16 -0500 "Aaron M. Ucko" <[email protected]> wrote: > > * On i386 and kfreebsd-i386, 57 other test cases failed with output > > differences (perhaps related to floating-point unit idiosyncracies -- > > it normally works with double-extended precision internally, rather > > than rounding at every step). > > I don't have anything to do with the package, but saw the bug > referenced on debian-release, and know a bit about the x86 FPU. > You can actually set the x86 FPU to use double precision internally > (80bit long double calculations will not work as expected then, > though, because the coprocessor will always truncate them to 64bit), > by using: > > static void set_fpu_mode() > { > #ifdef __i386__ > unsigned short cw; > asm volatile ("fnstcw %0" : "=m" (cw)); > cw = (cw & ~0x100) | 0x200; > asm volatile ("fldcw %0" :: "m" (cw)); > #endif > } > > (double extended precision is 0x300, double is 0x200 and single > is 0x0, in case you want to change it back. There are other > settings in the control word, so I would recommend touching only > the bits 0x100 and 0x200.) > > Other platforms (including x86_64) shouldn't have this trouble, > because even if they support other floating point types, operations > with the double data type are always done in double precision. > > (Alternatively, you could use -msse2 as a compiler flag on new > enough x86_32 processors, the compiler would then use the SIMD > instructions instead of the older FPU, but that has the problem > that the code then won't run on older processors, which are still > supported in Debian at the moment.) If you ask me the best solution would be to use -msse2 and just add some code to throw an error if the machine has a to old FPU. Typically nobody will use those tools on old hardware anyway - so that's no practical constraint. > Hope that helps. Yes, thanks for the hint Andreas. > _______________________________________________ > Debian-med-packaging mailing list > [email protected] > http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-packaging -- http://fam-tille.de

