[Bug middle-end/66462] GCC isinf/isnan/... builtins cause sNaN exceptions
wdijkstr at arm dot com
gcc-bugzilla@gcc.gnu.org
Tue Sep 3 19:12:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66462
--- Comment #12 from Wilco <wdijkstr at arm dot com> ---
(In reply to Segher Boessenkool from comment #11)
> I currently have
>
> ===
> diff --git a/gcc/builtins.c b/gcc/builtins.c
> index ad5135c..bc3d318 100644
> --- a/gcc/builtins.c
> +++ b/gcc/builtins.c
> @@ -9050,6 +9050,12 @@ fold_builtin_interclass_mathfn (location_t loc, tree
> fnde
> if (interclass_mathfn_icode (arg, fndecl) != CODE_FOR_nothing)
> return NULL_TREE;
>
> + /* None of these builtins are ever exceptional, not even for signaling
> NaNs,
> + so we cannot do any of these optimizations that involve a floating
> point
> + comparison. */
> + if (flag_signaling_nans)
> + return NULL_TREE;
> +
> mode = TYPE_MODE (TREE_TYPE (arg));
>
> bool is_ibm_extended = MODE_COMPOSITE_P (mode);
> ===
>
> but we should really handle this with some non-signaling insns, not punt
> it to libm to do.
Well we should simply commit Tamar's patch again since it works fine on any
IEEE targets and showed performance gains across many targets. Any issues with
weird 128-bit FP formats can be addressed separately.
More information about the Gcc-bugs
mailing list