Re: 3rd deficiency (was: Superfluous branches due to insufficient flow analysis)

2021-08-14 Thread Stefan Kanthak
Gabriel Ravier wrote: Independent from the defunct flow analysis in the presence of NaNs, my example demonstrates another minor deficiency: know thy instruction set! See the comments in the assembly below. > On 8/13/21 8:58 PM, Stefan Kanthak wrote: >> Hi, >> >> compile the following naive imple

Re: Superfluous branches due to insufficient flow analysis

2021-08-14 Thread Stefan Kanthak
"Gabriel Ravier" wrote: Please don't FULL QUOTE! > On 8/13/21 8:58 PM, Stefan Kanthak wrote: >> Hi, >> >> compile the following naive implementation of nextafter() for AMD64: >> >> JFTR: ignore the aliasing casts, they don't matter here! >> >> $ cat repro.c [...] > Shouldn't this kind of stuff

Re: Superfluous branches due to insufficient flow analysis

2021-08-13 Thread Gabriel Ravier via Gcc
On 8/13/21 8:58 PM, Stefan Kanthak wrote: Hi, compile the following naive implementation of nextafter() for AMD64: JFTR: ignore the aliasing casts, they don't matter here! $ cat repro.c double nextafter(double from, double to) { if (to != to) return to;// to is NAN

Superfluous branches due to insufficient flow analysis

2021-08-13 Thread Stefan Kanthak
Hi, compile the following naive implementation of nextafter() for AMD64: JFTR: ignore the aliasing casts, they don't matter here! $ cat repro.c double nextafter(double from, double to) { if (to != to) return to;// to is NAN if (from != from) return from; //