jyknight wrote:

> You'll get different results depending on whether the input is implicitly 
> flushed in fcmp vs. not in the is.fpclass

This sounds intuitively like the sort of semantics-breaking optimization which 
is expected from `-ffast-math`. If the only issues are things like getting a 
slightly-wrong answer from is.fpclass if you somehow pass a denormal to it, 
when you've disabled denormal handling...that just doesn't seem so bad.

> Arguably, the only safe value is dynamic (compiler doesn't know what it's set 
> to).

Yes, we could change the default to "dynamic" for _all_ builds (except on 
platforms where FTZ/DAZ flags don't exist). Potentially doing so is justified 
regardless of `-ffast-math`, since users can of course use `fesetenv` or 
`_mm_setcsr` to enable these flags themselves. (Sidenote: "dynamic" isn't even 
[documented](https://clang.llvm.org/docs/UsersManual.html#cmdoption-fdenormal-fp-math)).
 

> So it's a matter of which behavior is going to be the least likely to be 
> incorrect in practice.

So, alternatively...we could just go with the simplest solution, and use "ieee" 
as the default even under `-ffast-math`.

https://github.com/llvm/llvm-project/pull/80475
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to