aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/AVX
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-10-25 16:48:49 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-10-25 16:48:49 +0200
commit13fc18d3a24849529efe605992cddf4498a59c74 (patch)
tree4b69b0a6aaea7efb64c5696f60f5917109187edb /Eigen/src/Core/arch/AVX
parent2634f9386c661d423683580be24a7eb2882ff693 (diff)
Add a pinsertlast function replacing the last entry of a packet by a scalar.
(useful to vectorize LinSpaced)
Diffstat (limited to 'Eigen/src/Core/arch/AVX')
-rw-r--r--Eigen/src/Core/arch/AVX/PacketMath.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/AVX/PacketMath.h b/Eigen/src/Core/arch/AVX/PacketMath.h
index dae0ca5d0..8fb844982 100644
--- a/Eigen/src/Core/arch/AVX/PacketMath.h
+++ b/Eigen/src/Core/arch/AVX/PacketMath.h
@@ -604,6 +604,16 @@ template<> EIGEN_STRONG_INLINE Packet4d pblend(const Selector<4>& ifPacket, cons
return _mm256_blendv_pd(thenPacket, elsePacket, false_mask);
}
+template<> EIGEN_DEVICE_FUNC Packet8f pinsertlast(const Packet8f& a, float b)
+{
+ return _mm256_blend_ps(a,pset1<Packet8f>(b),(1<<7));
+}
+
+template<> EIGEN_DEVICE_FUNC Packet4d pinsertlast(const Packet4d& a, double b)
+{
+ return _mm256_blend_pd(a,pset1<Packet4d>(b),(1<<3));
+}
+
} // end namespace internal
} // end namespace Eigen