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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |mkretz at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
At least all of that
            if constexpr (sizeof(_V) == 2)
              {
                const auto __xs = reinterpret_cast<short>(__x._M_data);
                const auto __ys = reinterpret_cast<short>(__y._M_data);
                return reinterpret_cast<__vector_type_t<_Tp, 2>>(short(
                  ((__xs * __ys) & 0xff) | ((__xs >> 8) * (__ys & 0xff00))));
              }
            else if constexpr (sizeof(_V) == 4 && _VVT::_S_partial_width == 3)
              {
                const auto __xi = reinterpret_cast<int>(__x._M_data);
                const auto __yi = reinterpret_cast<int>(__y._M_data);
                return reinterpret_cast<__vector_type_t<_Tp, 3>>(
                  ((__xi * __yi) & 0xff)
                  | (((__xi >> 8) * (__yi & 0xff00)) & 0xff00)
                  | ((__xi >> 16) * (__yi & 0xff0000)));
              }
            else if constexpr (sizeof(_V) == 4)
              {
                const auto __xi = reinterpret_cast<int>(__x._M_data);
                const auto __yi = reinterpret_cast<int>(__y._M_data);
                return reinterpret_cast<__vector_type_t<_Tp, 4>>(
                  ((__xi * __yi) & 0xff)
                  | (((__xi >> 8) * (__yi & 0xff00)) & 0xff00)
                  | (((__xi >> 16) * (__yi & 0xff0000)) & 0xff0000)
                  | ((__xi >> 24) * (__yi & 0xff000000u)));
              }
looks problematic for -fsanitize=undefined, should be reinterpret_cast to
unsigned short and unsigned int instead I think.

Reply via email to