aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-02-10 18:26:59 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-02-10 18:26:59 +0000
commit7954f7709a1d2ab50e779838a709531c914a644c (patch)
tree62089a8088f6bf88e0d08409540b2fb60bc96b0b
parentcbbc6d940bd6ddf7d96352b4b4e3033ff4e555fe (diff)
add ei_predux_mul for AltiVec
-rw-r--r--Eigen/src/Core/arch/AltiVec/PacketMath.h40
1 files changed, 30 insertions, 10 deletions
diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h
index e64983f36..37eafa81f 100644
--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h
+++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h
@@ -298,16 +298,6 @@ inline v4f ei_preduxp(const v4f* vecs)
return sum[0];
}
-inline float ei_predux(const v4f& a)
-{
- v4f b, sum;
- b = (v4f)vec_sld(a, a, 8);
- sum = vec_add(a, b);
- b = (v4f)vec_sld(sum, sum, 4);
- sum = vec_add(sum, b);
- return ei_pfirst(sum);
-}
-
inline v4i ei_preduxp(const v4i* vecs)
{
v4i v[4], sum[4];
@@ -335,6 +325,16 @@ inline v4i ei_preduxp(const v4i* vecs)
return sum[0];
}
+inline float ei_predux(const v4f& a)
+{
+ v4f b, sum;
+ b = (v4f)vec_sld(a, a, 8);
+ sum = vec_add(a, b);
+ b = (v4f)vec_sld(sum, sum, 4);
+ sum = vec_add(sum, b);
+ return ei_pfirst(sum);
+}
+
inline int ei_predux(const v4i& a)
{
USE_CONST_v0i;
@@ -344,6 +344,26 @@ inline int ei_predux(const v4i& a)
return ei_pfirst(sum);
}
+inline float ei_predux_mul(const v4f& a)
+{
+ v4f b, sum;
+ b = (v4f)vec_sld(a, a, 8);
+ sum = ei_pmul(a, b);
+ b = (v4f)vec_sld(sum, sum, 4);
+ sum = ei_pmul(sum, b);
+ return ei_pfirst(sum);
+}
+
+inline int ei_predux_mul(const v4i& a)
+{
+ v4i b, sum;
+ b = (v4i)vec_sld(a, a, 8);
+ sum = ei_pmul(a, b);
+ b = (v4i)vec_sld(sum, sum, 4);
+ sum = ei_pmul(sum, b);
+ return ei_pfirst(sum);
+}
+
template<int Offset>
struct ei_palign_impl<Offset, v4f>
{