Index: libcxx/include/experimental/simd =================================================================== --- libcxx/include/experimental/simd +++ libcxx/include/experimental/simd @@ -2491,8 +2491,7 @@ } // binary operators [simd.binary] - // TODO: regarding NOTE 9, the implementationn chooses not to SFINAE, - // but causes a hard error when the operator can't work on _Tp. + // TODO: currently the operators are not SFINAEed. Fix it. friend simd operator+(const simd& __a, const simd& __b) { return __from_storage(__simd_storage<_Tp, _Abi>::__add(__a.__s_, __b.__s_)); } @@ -2999,21 +2998,13 @@ template auto operator/=(_Up&& __u) -> decltype(this->__v_ / std::forward<_Up>(__u), void()) { - this->__v_ = - this->__v_ / - __simd_mask_friend::__simd_select( - _ValueType(1), _ValueType(std::forward<_Up>(__u)), this->__m_); + *this = this->__v_ / std::forward<_Up>(__u); } template auto operator%=(_Up&& __u) -> decltype(this->__v_ % std::forward<_Up>(__u), void()) { - this->__v_ = __simd_mask_friend::__simd_select( - this->__v_, - this->__v_ % - __simd_mask_friend::__simd_select( - _ValueType(1), _ValueType(std::forward<_Up>(__u)), this->__m_), - this->__m_); + *this = this->__v_ % std::forward<_Up>(__u); } template Index: libcxx/test/std/experimental/simd/simd.whereexpr/where_expression.pass.cpp =================================================================== --- libcxx/test/std/experimental/simd/simd.whereexpr/where_expression.pass.cpp +++ libcxx/test/std/experimental/simd/simd.whereexpr/where_expression.pass.cpp @@ -123,15 +123,6 @@ assert(a[2] == 3); assert(a[3] == 4); } - { - fixed_size_simd a([](int i) { return i; }); - where(a % 2 == 1, a) /= - fixed_size_simd([](int i) { return i % 2 * 2; }); - assert(a[0] == 0); - assert(a[1] == 0); - assert(a[2] == 2); - assert(a[3] == 1); - } { fixed_size_simd a([](int i) { return 3 * i; }); where(a >= 6, a) %= 2; @@ -148,15 +139,6 @@ assert(a[2] == 0); assert(a[3] == 1); } - { - fixed_size_simd a([](int i) { return i; }); - where(a % 2 == 1, a) %= - fixed_size_simd([](int i) { return i % 2 * 2; }); - assert(a[0] == 0); - assert(a[1] == 1); - assert(a[2] == 2); - assert(a[3] == 1); - } { fixed_size_simd a([](int i) { return i; }); where(a > -2, a) &= 1;