https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109378

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to g.peterhoff from comment #11)
> Ok, in detail:
> std::sqrt/__builtin_sqrt performs the check for nan in the calling context.
> This causes the following problems:

It is a check for less than 0; not NAN.

> * the calling context contains error handling/conditional jumps, which have
> nothing to do there but have to be handled in the error handling of std::sqrt

> * Because this does NOT happen in your implementation of std::sqrt, the code
> gets bloated, at the latest when a function contains more than one std::sqrt.

There could be a check on errno later on even ... There is no way for GCC to
know that.

> 
> Therefore
> * do complete error handling in std::sqrt/__builtin_sqrt
> * so there is only one exact call for std::sqrt, which can/must be
> vectorized.

Again it still cannot be vectorized because it needs to be exact. It is also
hard to detect if errno is not being used too.

Reply via email to