[Bug middle-end/81478] By default, GCC emits a function call for complex multiplication, should partially inline that
smcallis at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jul 19 19:26:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81478
--- Comment #5 from Sean McAllister <smcallis at gmail dot com> ---
(In reply to Richard Biener from comment #3)
> Confirmed. It shouldn't be very difficult to do,
> gcc/tree-complex.c:expand_complex_multiplication would need to emit if
> (isnan(rr) || isnan(ri)) <expand_complex_libcall>.
>
> Unless we want to optimize the corner case futher by skipping the
> multiplication
> in the libcall in which case we need a new entry in libgcc.
>
> Note that the same optimization applies to division.
I think as rarely as the average user is going to have to deal with NaN/Inf in
their complex numbers, doing the multiplication, checking, and then re-doing it
if needed with full semantics is totally defensible. Then no need for glibc
changes. If all your numbers are NaN/Inf, then performance will be terrible,
but you probably have other problems at that juncture anyways.
More information about the Gcc-bugs
mailing list