timshen created this revision.
timshen added a reviewer: mclow.lists.
Herald added subscribers: christof, sanjoy.
Herald added a reviewer: EricWF.
Herald added a reviewer: EricWF.

In __simd_reference, the conversion between bool and mask integer is
in wrong place.


https://reviews.llvm.org/D44657

Files:
  libcxx/include/experimental/simd
  libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
  libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp

Index: libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp
===================================================================
--- libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp
+++ libcxx/test/std/experimental/simd/simd.mask.access/default.pass.cpp
@@ -159,11 +159,11 @@
     }
     {
       auto c = a;
-      (void)(a[0] + (c[0] >>= a[0]));
+      (void)(a[0] + (c[0] >>= b[0]));
     }
     {
       auto c = a;
-      (void)(a[0] + (c[0] <<= a[0]));
+      (void)(a[0] + (c[0] <<= b[0]));
     }
     {
       auto c = a;
Index: libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
===================================================================
--- libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
+++ libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
@@ -160,11 +160,11 @@
     }
     {
       auto c = a;
-      (void)(a[0] + (c[0] >>= a[0]));
+      (void)(a[0] + (c[0] >>= b[0]));
     }
     {
       auto c = a;
-      (void)(a[0] + (c[0] <<= a[0]));
+      (void)(a[0] + (c[0] <<= b[0]));
     }
     {
       auto c = a;
Index: libcxx/include/experimental/simd
===================================================================
--- libcxx/include/experimental/simd
+++ libcxx/include/experimental/simd
@@ -978,52 +978,52 @@
 
   __simd_reference operator+=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) + __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) + __val);
   }
 
   __simd_reference operator-=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) - __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) - __val);
   }
 
   __simd_reference operator*=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) * __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) * __val);
   }
 
   __simd_reference operator/=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) / __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) / __val);
   }
 
   __simd_reference operator%=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) % __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) % __val);
   }
 
   __simd_reference operator>>=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) >> __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) >> __val);
   }
 
   __simd_reference operator<<=(_Vp __val) && {
-    return std::move(*this) = __ptr_->__get(__index_)
-                              << __from_value_type(__val);
+    return std::move(*this) =
+               __from_value_type(__ptr_->__get(__index_) << __val);
   }
 
   __simd_reference operator&=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) & __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) & __val);
   }
 
   __simd_reference operator|=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) | __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) | __val);
   }
 
   __simd_reference operator^=(_Vp __val) && {
     return std::move(*this) =
-               __ptr_->__get(__index_) ^ __from_value_type(__val);
+               __from_value_type(__ptr_->__get(__index_) ^ __val);
   }
 };
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to