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 | |
17 | namespace simdpp { |
18 | namespace SIMDPP_ARCH_NAMESPACE { |
19 | namespace detail { |
20 | |
21 | template<class R, unsigned N> |
22 | struct expr_eval<R, uint8<N>> { |
23 | static SIMDPP_INL R eval(const uint8<N>& e) { return (R) e; } |
24 | }; |
25 | template<class R, unsigned N> |
26 | struct expr_eval<R, int8<N>> { |
27 | static SIMDPP_INL R eval(const int8<N>& e) { return (R) e; } |
28 | }; |
29 | template<class R, unsigned N> |
30 | struct expr_eval<R, mask_int8<N>> { |
31 | static SIMDPP_INL R eval(const mask_int8<N>& e) { return (R) e; } |
32 | }; |
33 | |
34 | template<class R, unsigned N> |
35 | struct expr_eval<R, uint16<N>> { |
36 | static SIMDPP_INL R eval(const uint16<N>& e) { return (R) e; } |
37 | }; |
38 | template<class R, unsigned N> |
39 | struct expr_eval<R, int16<N>> { |
40 | static SIMDPP_INL R eval(const int16<N>& e) { return (R) e; } |
41 | }; |
42 | template<class R, unsigned N> |
43 | struct expr_eval<R, mask_int16<N>> { |
44 | static SIMDPP_INL R eval(const mask_int16<N>& e) { return (R) e; } |
45 | }; |
46 | |
47 | template<class R, unsigned N> |
48 | struct expr_eval<R, uint32<N>> { |
49 | static SIMDPP_INL R eval(const uint32<N>& e) { return (R) e; } |
50 | }; |
51 | template<class R, unsigned N> |
52 | struct expr_eval<R, int32<N>> { |
53 | static SIMDPP_INL R eval(const int32<N>& e) { return (R) e; } |
54 | }; |
55 | template<class R, unsigned N> |
56 | struct expr_eval<R, mask_int32<N>> { |
57 | static SIMDPP_INL R eval(const mask_int32<N>& e) { return (R) e; } |
58 | }; |
59 | |
60 | template<class R, unsigned N> |
61 | struct expr_eval<R, uint64<N>> { |
62 | static SIMDPP_INL R eval(const uint64<N>& e) { return (R) e; } |
63 | }; |
64 | template<class R, unsigned N> |
65 | struct expr_eval<R, int64<N>> { |
66 | static SIMDPP_INL R eval(const int64<N>& e) { return (R) e; } |
67 | }; |
68 | template<class R, unsigned N> |
69 | struct expr_eval<R, mask_int64<N>> { |
70 | static SIMDPP_INL R eval(const mask_int64<N>& e) { return (R) e; } |
71 | }; |
72 | |
73 | template<class R, unsigned N> |
74 | struct expr_eval<R, float32<N>> { |
75 | static SIMDPP_INL R eval(const float32<N>& e) { return (R) e; } |
76 | }; |
77 | template<class R, unsigned N> |
78 | struct expr_eval<R, mask_float32<N>> { |
79 | static SIMDPP_INL R eval(const mask_float32<N>& e) { return (R) e; } |
80 | }; |
81 | |
82 | template<class R, unsigned N> |
83 | struct expr_eval<R, float64<N>> { |
84 | static SIMDPP_INL R eval(const float64<N>& e) { return (R) e; } |
85 | }; |
86 | template<class R, unsigned N> |
87 | struct expr_eval<R, mask_float64<N>> { |
88 | static SIMDPP_INL R eval(const mask_float64<N>& e) { return (R) e; } |
89 | }; |
90 | |
91 | template<class R, unsigned N> |
92 | struct expr_eval<R, uint8<N, expr_empty>> { |
93 | static SIMDPP_INL R eval(const uint8<N, expr_empty>& e) { return (R) e.e; } |
94 | }; |
95 | template<class R, unsigned N> |
96 | struct expr_eval<R, int8<N, expr_empty>> { |
97 | static SIMDPP_INL R eval(const int8<N, expr_empty>& e) { return (R) e.e; } |
98 | }; |
99 | template<class R, unsigned N> |
100 | struct 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 | |
104 | template<class R, unsigned N> |
105 | struct expr_eval<R, uint16<N, expr_empty>> { |
106 | static SIMDPP_INL R eval(const uint16<N, expr_empty>& e) { return (R) e.e; } |
107 | }; |
108 | template<class R, unsigned N> |
109 | struct expr_eval<R, int16<N, expr_empty>> { |
110 | static SIMDPP_INL R eval(const int16<N, expr_empty>& e) { return (R) e.e; } |
111 | }; |
112 | template<class R, unsigned N> |
113 | struct 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 | |
117 | template<class R, unsigned N> |
118 | struct expr_eval<R, uint32<N, expr_empty>> { |
119 | static SIMDPP_INL R eval(const uint32<N, expr_empty>& e) { return (R) e.e; } |
120 | }; |
121 | template<class R, unsigned N> |
122 | struct expr_eval<R, int32<N, expr_empty>> { |
123 | static SIMDPP_INL R eval(const int32<N, expr_empty>& e) { return (R) e.e; } |
124 | }; |
125 | template<class R, unsigned N> |
126 | struct 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 | |
130 | template<class R, unsigned N> |
131 | struct expr_eval<R, uint64<N, expr_empty>> { |
132 | static SIMDPP_INL R eval(const uint64<N, expr_empty>& e) { return (R) e.e; } |
133 | }; |
134 | template<class R, unsigned N> |
135 | struct expr_eval<R, int64<N, expr_empty>> { |
136 | static SIMDPP_INL R eval(const int64<N, expr_empty>& e) { return (R) e.e; } |
137 | }; |
138 | template<class R, unsigned N> |
139 | struct 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 | |
143 | template<class R, unsigned N> |
144 | struct expr_eval<R, float32<N, expr_empty>> { |
145 | static SIMDPP_INL R eval(const float32<N, expr_empty>& e) { return (R) e.e; } |
146 | }; |
147 | template<class R, unsigned N> |
148 | struct 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 | |
152 | template<class R, unsigned N> |
153 | struct expr_eval<R, float64<N, expr_empty>> { |
154 | static SIMDPP_INL R eval(const float64<N, expr_empty>& e) { return (R) e.e; } |
155 | }; |
156 | template<class R, unsigned N> |
157 | struct 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 | |