On 8/23/07, Joseph S. Myers <[EMAIL PROTECTED]> wrote: > On Thu, 23 Aug 2007, Ian Lance Taylor wrote: > > > I think we should revert the patch, and continue permitting the > > bitwise operations on vector float. > > > > There seem to be solid reasons to permit this, and no very strong ones > > to prohibit it. We can consider it to be a GNU extension for vectors. > > Vectors are of course themselves an extension already. > > We decided long ago that the extension would be based on what's permitted > by C++ valarray rather than by a particular CPU's vector intrinsics. So > unless C++ valarray allows this operation, I think we should leave it > prohibited
And it is not supported by valarray. Testcase: #include <valarray> using std::valarray; valarray<float> a, b; int f(void) { a = a | b; } ----------------------- cut ---------------------- Error messages: /usr/include/c++/4.0.0/bits/valarray_before.h: In member function '_Tp std::__bitwise_or::operator()(const _Tp&, const _Tp&) const [with _Tp = float]': /usr/include/c++/4.0.0/bits/valarray_before.h:527: instantiated from 'typename std::__fun<_Oper, typename _Arg::value_type>::result_type std::_BinBase<_Oper, _FirstArg, _SecondArg>::operator[](size_t) const [with _Oper = std::__bitwise_or, _FirstArg = std::valarray<float>, _SecondArg = std::valarray<float>]' /usr/include/c++/4.0.0/bits/valarray_after.h:220: instantiated from '_Tp std::_Expr<_Clos, _Tp>::operator[](size_t) const [with _Clos = std::_BinClos<std::__bitwise_or, std::_ValArray, std::_ValArray, float, float>, _Tp = float]' /usr/include/c++/4.0.0/bits/valarray_array.tcc:149: instantiated from 'void std::__valarray_copy(const std::_Expr<_Dom, _Tp>&, size_t, std::_Array<_Tp>) [with _Tp = float, _Dom = std::_BinClos<std::__bitwise_or, std::_ValArray, std::_ValArray, float, float>]' /usr/include/c++/4.0.0/valarray:696: instantiated from 'std::valarray<_Tp>& std::valarray<_Tp>::operator=(const std::_Expr<_Dom, _Tp>&) [with _Dom = std::_BinClos<std::__bitwise_or, std::_ValArray, std::_ValArray, float, float>, _Tp = float]' t.cc:8: instantiated from here /usr/include/c++/4.0.0/bits/valarray_before.h:243: error: invalid operands of types 'const float' and 'const float' to binary 'operator|' Thanks, Andrew Pinski