From 5757eba7bf5bdbbdbd18c5d80bfa4b597cde5d48 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 12 Dec 2012 15:31:35 +0000 Subject: [PATCH] Undo 27799 on vectorization as the new trick did the same thing and obscured things. git-svn-id: https://svn.dealii.org/trunk@27801 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/vectorization.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/deal.II/include/deal.II/base/vectorization.h b/deal.II/include/deal.II/base/vectorization.h index f5830f514f..28403b7d48 100644 --- a/deal.II/include/deal.II/base/vectorization.h +++ b/deal.II/include/deal.II/base/vectorization.h @@ -103,10 +103,7 @@ public: operator [] (const unsigned int comp) { AssertIndexRange (comp, 4); - // __m256d stores doubles in adjacent memory blocks. to access one double - // data field at a time, first cast the address of the given data field to - // void* and then back to double*. - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -116,7 +113,7 @@ public: operator [] (const unsigned int comp) const { AssertIndexRange (comp, 4); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -289,7 +286,7 @@ public: operator [] (const unsigned int comp) { AssertIndexRange (comp, 8); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -299,7 +296,7 @@ public: operator [] (const unsigned int comp) const { AssertIndexRange (comp, 8); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -475,7 +472,7 @@ public: operator [] (const unsigned int comp) { AssertIndexRange (comp, 2); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -485,7 +482,7 @@ public: operator [] (const unsigned int comp) const { AssertIndexRange (comp, 2); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -654,7 +651,7 @@ public: operator [] (const unsigned int comp) { AssertIndexRange (comp, 4); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp); } /** @@ -664,7 +661,7 @@ public: operator [] (const unsigned int comp) const { AssertIndexRange (comp, 4); - return *(static_cast(static_cast(&data))+comp); + return *(reinterpret_cast(&data)+comp);; } /** -- 2.39.5