aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/packetmath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/packetmath.cpp')
-rw-r--r--test/packetmath.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/packetmath.cpp b/test/packetmath.cpp
index a53786ae5..43b62a03f 100644
--- a/test/packetmath.cpp
+++ b/test/packetmath.cpp
@@ -16,6 +16,12 @@
#endif
// using namespace Eigen;
+#ifdef EIGEN_VECTORIZE_SSE
+const bool g_vectorize_sse = true;
+#else
+const bool g_vectorize_sse = false;
+#endif
+
namespace Eigen {
namespace internal {
template<typename T> T negate(const T& x) { return -x; }
@@ -290,7 +296,17 @@ template<typename Scalar> void packetmath()
}
}
- if (PacketTraits::HasBlend) {
+ if (PacketTraits::HasBlend || g_vectorize_sse) {
+ // pinsertfirst
+ for (int i=0; i<PacketSize; ++i)
+ ref[i] = data1[i];
+ Scalar s = internal::random<Scalar>();
+ ref[0] = s;
+ internal::pstore(data2, internal::pinsertfirst(internal::pload<Packet>(data1),s));
+ VERIFY(areApprox(ref, data2, PacketSize) && "internal::pinsertfirst");
+ }
+
+ if (PacketTraits::HasBlend || g_vectorize_sse) {
// pinsertlast
for (int i=0; i<PacketSize; ++i)
ref[i] = data1[i];