aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-11-02 10:38:13 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-11-02 10:38:13 +0100
commit598de8b193a8182e1a88872e2127355cdea0de05 (patch)
treef641d1d28065dce5d08af54f24a824730dd816a8 /test
parente44519744e6a788c12e572d654bb21de6bdf5684 (diff)
Add pinsertfirst function and implement pinsertlast for complex on SSE/AVX.
Diffstat (limited to 'test')
-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];