From 388531c37f24910441e088aa10e926a33dc55c9e Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Fri, 6 Aug 2021 11:34:13 +0200 Subject: [PATCH] split cxz_operation: move Access and Expression classes to extra files --- src/include/access.cc.h | 41 +++++++ src/include/access.h | 171 +++++++++++++++++++++++++++ src/include/cnorxz.cc.h | 2 + src/include/cxz_operation.cc.h | 91 +-------------- src/include/cxz_operation.h | 200 +------------------------------- src/include/op_expressions.cc.h | 72 ++++++++++++ src/include/op_expressions.h | 60 ++++++++++ 7 files changed, 351 insertions(+), 286 deletions(-) create mode 100644 src/include/access.cc.h create mode 100644 src/include/access.h create mode 100644 src/include/op_expressions.cc.h create mode 100644 src/include/op_expressions.h diff --git a/src/include/access.cc.h b/src/include/access.cc.h new file mode 100644 index 0000000..68aee49 --- /dev/null +++ b/src/include/access.cc.h @@ -0,0 +1,41 @@ + +#include "access.h" + +namespace CNORXZ +{ + namespace + { + using namespace CNORXZInternal; + } + + /************************ + * AccessTemplate * + ************************/ + + template + auto AccessTemplate::get(size_t pos) + { + return THIS().get(pos); + } + + template + auto AccessTemplate::get(size_t pos) const + { + return THIS().get(pos); + } + + template + auto AccessTemplate::oget(size_t pos) const + { + return THIS().oget(pos); + } + + template + template + void AccessTemplate::exec(size_t pos, const Op& op, ExtType e) const + { + return THIS().template exec(pos,op,e); + } + + +} // namespace CNORXZ diff --git a/src/include/access.h b/src/include/access.h new file mode 100644 index 0000000..c9ffeb1 --- /dev/null +++ b/src/include/access.h @@ -0,0 +1,171 @@ + +#ifndef __cxz_access_h__ +#define __cxz_access_h__ + +namespace CNORXZ +{ + namespace + { + using namespace CNORXZInternal; + } + + + template + struct VType + { + typedef T type; + static constexpr size_t MULT = sizeof(type)/sizeof(T); + }; + + template <> + struct VType + { + typedef v256 type; + static constexpr size_t MULT = sizeof(type)/sizeof(double); + }; + + template