[Bug libstdc++/71921] missed vectorization optimization

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 18 21:05:00 GMT 2016


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |libstdc++

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The problem is:
  _7 = _5 < 0.0 ? 0.0 : _5;


Is not converted into MAX_EXPR which it does with -ffast-math (and you get the
vectorized version with maxps).

The question now becomes should:
  template<typename _Tp>
    _GLIBCXX14_CONSTEXPR
    inline const _Tp&
    max(const _Tp& __a, const _Tp& __b)
    {
      // concept requirements
      __glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
      //return  __a < __b ? __b : __a;
      if (__a < __b)
        return __b;
      return __a;
    }


Be <= or < ?
Then this becomes a libstdc++ question :).


More information about the Gcc-bugs mailing list