diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-12 21:35:56 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-12 21:35:56 +0000 |
commit | c6cb3eb699e3048b2a11cc137f16c8cbb372a793 (patch) | |
tree | 43be61e75847bbd49df9f4f7d6e65ba0715b060f /staging_vespalib | |
parent | c2a2c5c703ad1fb5a853bc9483ce111d36eea964 (diff) |
Use a single typedef.
Diffstat (limited to 'staging_vespalib')
-rw-r--r-- | staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp b/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp index 5863f77b1f6..b4d4696ea1f 100644 --- a/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp +++ b/staging_vespalib/src/vespa/vespalib/hwaccelrated/avxprivate.hpp @@ -26,34 +26,10 @@ T sumT(const V & v) { } template <typename T, size_t VLEN> -class TypeSpecifics { }; - -template <> -struct TypeSpecifics<float, 32u> { - static constexpr const size_t V_SZ = 32u; - typedef float V __attribute__ ((vector_size (V_SZ))); - static float sum(const V & v) { return sumT<float, V>(v); } -}; - -template <> -struct TypeSpecifics<double, 32u> { - static constexpr const size_t V_SZ = 32u; - typedef double V __attribute__ ((vector_size (V_SZ))); - static double sum(const V & v) { return sumT<double, V>(v); } -}; - -template <> -struct TypeSpecifics<float, 64u> { - static constexpr const size_t V_SZ = 64u; - typedef float V __attribute__ ((vector_size (V_SZ))); - static float sum(const V & v) { return sumT<float, V>(v); } -}; - -template <> -struct TypeSpecifics<double, 64u> { - static constexpr const size_t V_SZ = 64u; - typedef double V __attribute__ ((vector_size (V_SZ))); - static double sum(const V & v) { return sumT<double, V>(v); } +struct TypeSpecifics { + static constexpr const size_t V_SZ = VLEN; + typedef T V __attribute__ ((vector_size (V_SZ))); + static T sum(const V & v) { return sumT<T, V>(v); } }; template <typename T, size_t VLEN, unsigned AlignA, unsigned AlignB, size_t VectorsPerChunk> |