aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-06-24 18:08:35 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-06-24 18:08:35 +0000
commit5b0da4b778d8f51e21dd7c35f6f7397c38c6be03 (patch)
tree0df9f2ba1e23c2aa375c72206bcb0ae62203ad13 /Eigen
parent3b94436d2fc7d8f6716b056ed544acecf256c4fe (diff)
make use of ei_pmadd in dot-product: will further improve performance
on architectures having a packed-mul-add assembly instruction.
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/Dot.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h
index bf487c462..8f38ee946 100644
--- a/Eigen/src/Core/Dot.h
+++ b/Eigen/src/Core/Dot.h
@@ -108,8 +108,9 @@ struct ei_dot_vec_unroller
inline static PacketScalar run(const Derived1& v1, const Derived2& v2)
{
- return ei_padd(
- ei_pmul(v1.template packet<Aligned>(row1, col1), v2.template packet<Aligned>(row2, col2)),
+ return ei_pmadd(
+ v1.template packet<Aligned>(row1, col1),
+ v2.template packet<Aligned>(row2, col2),
ei_dot_vec_unroller<Derived1, Derived2, Index+ei_packet_traits<Scalar>::size, Stop>::run(v1, v2)
);
}
@@ -192,12 +193,10 @@ struct ei_dot_impl<Derived1, Derived2, LinearVectorization, NoUnrolling>
const int col1 = rowVector1 ? index : 0;
const int row2 = rowVector2 ? 0 : index;
const int col2 = rowVector2 ? index : 0;
- packet_res = ei_padd(
- packet_res,
- ei_pmul(
- v1.template packet<Aligned>(row1, col1),
- v2.template packet<Aligned>(row2, col2)
- )
+ packet_res = ei_pmadd(
+ v1.template packet<Aligned>(row1, col1),
+ v2.template packet<Aligned>(row2, col2),
+ packet_res
);
}
res = ei_predux(packet_res);