Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2019-01-07 Thread Alex Bennée
Emilio G. Cota writes: > On Thu, Dec 20, 2018 at 11:10:08 +, Alex Bennée wrote: > (snip) >> +#if defined(__GLIBC__) && (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 12) >> +#define QEMU_HARDFLOAT_USE_FMA 0 >> +#else >> +#define QEMU_HARDFLOAT_USE_FMA 1 >> +#endif >> +#else >> +#define QEMU_HARDFLOA

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2019-01-07 Thread Alex Bennée
Richard Henderson writes: > On 12/21/18 11:30 AM, Emilio G. Cota wrote: >> +ua.s = 0x0021; >> +ub.s = 0x3ca0; >> +uc.s = 0x0020; >> +ur.h = fma(ua.h, ub.h, uc.h); >> +if (ur.s != 0x0021) { > > Forgot your ull's, but otherwise o

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-21 Thread Aleksandar Markovic
On Dec 20, 2018 12:11 PM, "Alex Bennée" wrote: > > Some versions of glibc have been reported to have problems with > fused-multiply-accumulate operations. If the underlying fma > implementation does a two step operation it will instroduce subtle > rounding errors. Newer versions of the library see

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-21 Thread Richard Henderson
On 12/21/18 11:30 AM, Emilio G. Cota wrote: > +ua.s = 0x0021; > +ub.s = 0x3ca0; > +uc.s = 0x0020; > +ur.h = fma(ua.h, ub.h, uc.h); > +if (ur.s != 0x0021) { Forgot your ull's, but otherwise ok. In email to Alex, I did wonder if we

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-21 Thread Emilio G. Cota
On Thu, Dec 20, 2018 at 11:10:08 +, Alex Bennée wrote: (snip) > +#if defined(__GLIBC__) && (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 12) > +#define QEMU_HARDFLOAT_USE_FMA 0 > +#else > +#define QEMU_HARDFLOAT_USE_FMA 1 > +#endif > +#else > +#define QEMU_HARDFLOAT_USE_FMA 1 > +#endif > + > /* > *

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-21 Thread Laurent Desnogues
Hi, On Thu, Dec 20, 2018 at 12:10 PM Alex Bennée wrote: > > Some versions of glibc have been reported to have problems with > fused-multiply-accumulate operations. If the underlying fma > implementation does a two step operation it will instroduce subtle > rounding errors. Newer versions of the l

Re: [Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-20 Thread Aleksandar Markovic
On Dec 20, 2018 12:11 PM, "Alex Bennée" wrote: > > Some versions of glibc have been reported to have problems with > fused-multiply-accumulate operations. If the underlying fma > implementation does a two step operation it will instroduce subtle > rounding errors. Newer versions of the library see

[Qemu-devel] [RFC PATCH] fpu: add compile time check for old glibc/libm and fma

2018-12-20 Thread Alex Bennée
Some versions of glibc have been reported to have problems with fused-multiply-accumulate operations. If the underlying fma implementation does a two step operation it will instroduce subtle rounding errors. Newer versions of the library seem to deal with this better and modern hardware has fused o