aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/AltiVec/Complex.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-04-23 13:09:26 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-04-23 13:09:26 +0200
commit82b09fcb911c5a0734ccf441504269f33034194a (patch)
treeaed86616b46c613c5a0e3118b14a438e856539f6 /Eigen/src/Core/arch/AltiVec/Complex.h
parentecbd67a15a55372f189d3718ff8661791bfa1c9f (diff)
Add Altivec implementation of pgather/pscatter (not tested)
Diffstat (limited to 'Eigen/src/Core/arch/AltiVec/Complex.h')
-rw-r--r--Eigen/src/Core/arch/AltiVec/Complex.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/AltiVec/Complex.h b/Eigen/src/Core/arch/AltiVec/Complex.h
index db52074f4..ec11cfaa0 100644
--- a/Eigen/src/Core/arch/AltiVec/Complex.h
+++ b/Eigen/src/Core/arch/AltiVec/Complex.h
@@ -66,6 +66,22 @@ template<> EIGEN_STRONG_INLINE Packet2cf pset1<Packet2cf>(const std::complex<flo
return res;
}
+template<> EIGEN_DEVICE_FUNC inline Packet2cf pgather<std::complex<float>, Packet2cf>(const std::complex<float>* from, int stride)
+{
+ std::complex<float> EIGEN_ALIGN16 af[2];
+ af[0] = from[0*stride];
+ af[1] = from[1*stride];
+ return Packet2cf(vec_ld(0, af));
+}
+template<> EIGEN_DEVICE_FUNC inline void pscatter<std::complex<float>, Packet2cf>(std::complex<float>* to, const Packet2cf& from, int stride)
+{
+ std::complex<float> EIGEN_ALIGN16 af[2];
+ vec_st(from.v, 0, af);
+ to[0*stride] = af[0];
+ to[1*stride] = af[1];
+}
+
+
template<> EIGEN_STRONG_INLINE Packet2cf padd<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_add(a.v,b.v)); }
template<> EIGEN_STRONG_INLINE Packet2cf psub<Packet2cf>(const Packet2cf& a, const Packet2cf& b) { return Packet2cf(vec_sub(a.v,b.v)); }
template<> EIGEN_STRONG_INLINE Packet2cf pnegate(const Packet2cf& a) { return Packet2cf(pnegate(a.v)); }