1/* Copyright (C) 2014 Povilas Kanapickas <povilas@radix.lt>
2
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt)
6*/
7
8#ifndef LIBSIMDPP_SIMDPP_DETAIL_EXPR_VEC_H
9#define LIBSIMDPP_SIMDPP_DETAIL_EXPR_VEC_H
10
11#ifndef LIBSIMDPP_SIMD_H
12 #error "This file must be included through simd.h"
13#endif
14
15#include <simdpp/types.h>
16
17namespace simdpp {
18namespace SIMDPP_ARCH_NAMESPACE {
19namespace detail {
20
21template<class R, unsigned N>
22struct expr_eval<R, uint8<N>> {
23 static SIMDPP_INL R eval(const uint8<N>& e) { return (R) e; }
24};
25template<class R, unsigned N>
26struct expr_eval<R, int8<N>> {
27 static SIMDPP_INL R eval(const int8<N>& e) { return (R) e; }
28};
29template<class R, unsigned N>
30struct expr_eval<R, mask_int8<N>> {
31 static SIMDPP_INL R eval(const mask_int8<N>& e) { return (R) e; }
32};
33
34template<class R, unsigned N>
35struct expr_eval<R, uint16<N>> {
36 static SIMDPP_INL R eval(const uint16<N>& e) { return (R) e; }
37};
38template<class R, unsigned N>
39struct expr_eval<R, int16<N>> {
40 static SIMDPP_INL R eval(const int16<N>& e) { return (R) e; }
41};
42template<class R, unsigned N>
43struct expr_eval<R, mask_int16<N>> {
44 static SIMDPP_INL R eval(const mask_int16<N>& e) { return (R) e; }
45};
46
47template<class R, unsigned N>
48struct expr_eval<R, uint32<N>> {
49 static SIMDPP_INL R eval(const uint32<N>& e) { return (R) e; }
50};
51template<class R, unsigned N>
52struct expr_eval<R, int32<N>> {
53 static SIMDPP_INL R eval(const int32<N>& e) { return (R) e; }
54};
55template<class R, unsigned N>
56struct expr_eval<R, mask_int32<N>> {
57 static SIMDPP_INL R eval(const mask_int32<N>& e) { return (R) e; }
58};
59
60template<class R, unsigned N>
61struct expr_eval<R, uint64<N>> {
62 static SIMDPP_INL R eval(const uint64<N>& e) { return (R) e; }
63};
64template<class R, unsigned N>
65struct expr_eval<R, int64<N>> {
66 static SIMDPP_INL R eval(const int64<N>& e) { return (R) e; }
67};
68template<class R, unsigned N>
69struct expr_eval<R, mask_int64<N>> {
70 static SIMDPP_INL R eval(const mask_int64<N>& e) { return (R) e; }
71};
72
73template<class R, unsigned N>
74struct expr_eval<R, float32<N>> {
75 static SIMDPP_INL R eval(const float32<N>& e) { return (R) e; }
76};
77template<class R, unsigned N>
78struct expr_eval<R, mask_float32<N>> {
79 static SIMDPP_INL R eval(const mask_float32<N>& e) { return (R) e; }
80};
81
82template<class R, unsigned N>
83struct expr_eval<R, float64<N>> {
84 static SIMDPP_INL R eval(const float64<N>& e) { return (R) e; }
85};
86template<class R, unsigned N>
87struct expr_eval<R, mask_float64<N>> {
88 static SIMDPP_INL R eval(const mask_float64<N>& e) { return (R) e; }
89};
90
91template<class R, unsigned N>
92struct expr_eval<R, uint8<N, expr_empty>> {
93 static SIMDPP_INL R eval(const uint8<N, expr_empty>& e) { return (R) e.e; }
94};
95template<class R, unsigned N>
96struct expr_eval<R, int8<N, expr_empty>> {
97 static SIMDPP_INL R eval(const int8<N, expr_empty>& e) { return (R) e.e; }
98};
99template<class R, unsigned N>
100struct expr_eval<R, mask_int8<N, expr_empty>> {
101 static SIMDPP_INL R eval(const mask_int8<N, expr_empty>& e) { return (R) e.e; }
102};
103
104template<class R, unsigned N>
105struct expr_eval<R, uint16<N, expr_empty>> {
106 static SIMDPP_INL R eval(const uint16<N, expr_empty>& e) { return (R) e.e; }
107};
108template<class R, unsigned N>
109struct expr_eval<R, int16<N, expr_empty>> {
110 static SIMDPP_INL R eval(const int16<N, expr_empty>& e) { return (R) e.e; }
111};
112template<class R, unsigned N>
113struct expr_eval<R, mask_int16<N, expr_empty>> {
114 static SIMDPP_INL R eval(const mask_int16<N, expr_empty>& e) { return (R) e.e; }
115};
116
117template<class R, unsigned N>
118struct expr_eval<R, uint32<N, expr_empty>> {
119 static SIMDPP_INL R eval(const uint32<N, expr_empty>& e) { return (R) e.e; }
120};
121template<class R, unsigned N>
122struct expr_eval<R, int32<N, expr_empty>> {
123 static SIMDPP_INL R eval(const int32<N, expr_empty>& e) { return (R) e.e; }
124};
125template<class R, unsigned N>
126struct expr_eval<R, mask_int32<N, expr_empty>> {
127 static SIMDPP_INL R eval(const mask_int32<N, expr_empty>& e) { return (R) e.e; }
128};
129
130template<class R, unsigned N>
131struct expr_eval<R, uint64<N, expr_empty>> {
132 static SIMDPP_INL R eval(const uint64<N, expr_empty>& e) { return (R) e.e; }
133};
134template<class R, unsigned N>
135struct expr_eval<R, int64<N, expr_empty>> {
136 static SIMDPP_INL R eval(const int64<N, expr_empty>& e) { return (R) e.e; }
137};
138template<class R, unsigned N>
139struct expr_eval<R, mask_int64<N, expr_empty>> {
140 static SIMDPP_INL R eval(const mask_int64<N, expr_empty>& e) { return (R) e.e; }
141};
142
143template<class R, unsigned N>
144struct expr_eval<R, float32<N, expr_empty>> {
145 static SIMDPP_INL R eval(const float32<N, expr_empty>& e) { return (R) e.e; }
146};
147template<class R, unsigned N>
148struct expr_eval<R, mask_float32<N, expr_empty>> {
149 static SIMDPP_INL R eval(const mask_float32<N, expr_empty>& e) { return (R) e.e; }
150};
151
152template<class R, unsigned N>
153struct expr_eval<R, float64<N, expr_empty>> {
154 static SIMDPP_INL R eval(const float64<N, expr_empty>& e) { return (R) e.e; }
155};
156template<class R, unsigned N>
157struct expr_eval<R, mask_float64<N, expr_empty>> {
158 static SIMDPP_INL R eval(const mask_float64<N, expr_empty>& e) { return (R) e.e; }
159};
160
161
162} // namespace detail
163} // namespace SIMDPP_ARCH_NAMESPACE
164} // namespace simdpp
165
166#endif
167