Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-22 Thread lhmouse
On 2017/1/23 9:08, David Wohlferd wrote: > Hmm. > > It seems a bit backwards to have the function that takes a 'long double' > calling the function that takes a 'double.' Yes, they are both the same > size on ARM, but I think I would have gone the other way. Plus I kinda > like having all the

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-22 Thread David Wohlferd
Hmm. It seems a bit backwards to have the function that takes a 'long double' calling the function that takes a 'double.' Yes, they are both the same size on ARM, but I think I would have gone the other way. Plus I kinda like having all the implementations in one file (fmal.c). Other than

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-20 Thread lhmouse
The mail has been being rejected for spamming for a few hours. Hope it wouldn't be this time. -- Best regards, lh_mouse From 82fd24e992a402ff2f7c55780fd76945ef83e094 Mon Sep 17 00:00:00 2001 From: LH_Mouse Date: Wed, 18 Jan 2017 19:35:43 +0800 Subject: [PATCH]

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-19 Thread lhmouse
> So you have decided that __builtins can't be used then? That's too bad. Yes it results in a call to `fma()` on x64. Can't test it on ARM though. > I know almost nothing about the guts of floating point, so I'm prepared > to defer to your judgement, but here's what I think: > > Let me propose

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-19 Thread David Wohlferd
So you have decided that __builtins can't be used then? That's too bad. I know almost nothing about the guts of floating point, so I'm prepared to defer to your judgement, but here's what I think: Let me propose an alternative for fma.c: /** * This file has no copyright assigned

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-19 Thread lhmouse
New patch attached. This patch fixes ARM functions and adds a check in `fpu_fma()` for potential NaN or INF results.  -- Best regards, lh_mouse 2017-01-19 From 3c55daec84dac190b9e3cb032371960e1acbc38f Mon Sep 17 00:00:00 2001 From: LH_Mouse

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-18 Thread lhmouse
> I see that you have replaced the x86 parts for fma and fmaf with C > code. That seems like a good thing. Is there some reason you can't do > that with the ARM versions too? ARM has hardware FMA and software emulation is not optimal. > Reducing the amount of platform-specific code also seems

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-18 Thread David Wohlferd
On 1/18/2017 5:14 AM, lhmouse wrote: > Patch is attached. I see that you have replaced the x86 parts for fma and fmaf with C code. That seems like a good thing. Is there some reason you can't do that with the ARM versions too? Reducing the amount of platform-specific code also seems like a

Re: [Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-18 Thread lhmouse
The correctness of fma() function can be verified using the following program: --- #include #include volatile double x = 0x1.3p52; volatile double y = 0x1.5p52; volatile double z = -0x1.8p104; int main(){

[Mingw-w64-public] Implement fused multiply-add (FMA) funcitons for x86 families properly

2017-01-18 Thread lhmouse
Patch is attached. This patch removes assembly files that implement FMA on ARM and merges them into the corresponding C files with the same name using inline assembly. A re-generation of Makefile.in is required. I don't have any knowledge about ARM assembly. Those functions for ARM were created