[Bug target/108922] fmod() 13x slowdown in gcc4.9 dropping "fprem" and calling fmod()
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 27 09:17:16 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108922
--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #17)
> So, based on the above finding, should insn condition be changed to
> !flag_errno_math?
I'd say that it shouldn't be the business of backends to check flag_errno_math,
it should be the middle-end. And it can either ignore the fmod (but isn't say
hypot and others a similar case) optab in that case or it could do the sqrt
trick by using the optab inline even for flag_errno_math, then using comparison
detect if it is one of the exceptional cases and call the library function in
that case.
Of course, that is probably GCC 14 material and so a hack on the backend side
would be acceptable too.
More information about the Gcc-bugs
mailing list