1 | |
---|
2 | /* Copyright (c) 2011, Hua Huang and Robert D. Cameron. |
---|
3 | Licensed under the Academic Free License 3.0. |
---|
4 | This file is generated by the IDISA+ generator; |
---|
5 | modifications should be made only by changing the |
---|
6 | generator configuration and data files. */ |
---|
7 | |
---|
8 | #ifndef IDISA_SSE4_2_CPP |
---|
9 | #define IDISA_SSE4_2_CPP |
---|
10 | #include <stdint.h> |
---|
11 | #include "../config.hpp" |
---|
12 | |
---|
13 | #include "smmintrin.h" |
---|
14 | |
---|
15 | typedef __m128i bitblock128_t; |
---|
16 | template <uint32_t fw> |
---|
17 | class simd128 |
---|
18 | { |
---|
19 | public: |
---|
20 | static IDISA_ALWAYS_INLINE bitblock128_t max(bitblock128_t arg1, bitblock128_t arg2); |
---|
21 | static IDISA_ALWAYS_INLINE bitblock128_t mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
22 | static IDISA_ALWAYS_INLINE bitblock128_t gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
23 | static IDISA_ALWAYS_INLINE bitblock128_t umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
24 | static IDISA_ALWAYS_INLINE bitblock128_t ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
25 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1); |
---|
26 | static IDISA_ALWAYS_INLINE bitblock128_t ctz(bitblock128_t arg1); |
---|
27 | static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
28 | static IDISA_ALWAYS_INLINE bitblock128_t eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
29 | static IDISA_ALWAYS_INLINE bitblock128_t popcount(bitblock128_t arg1); |
---|
30 | static IDISA_ALWAYS_INLINE bitblock128_t neg(bitblock128_t arg1); |
---|
31 | static IDISA_ALWAYS_INLINE bitblock128_t himask(); |
---|
32 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1); |
---|
33 | static IDISA_ALWAYS_INLINE bitblock128_t ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
34 | static IDISA_ALWAYS_INLINE bitblock128_t sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
35 | static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1); |
---|
36 | static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
37 | static IDISA_ALWAYS_INLINE bitblock128_t lomask(); |
---|
38 | static IDISA_ALWAYS_INLINE bitblock128_t umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
39 | template <uint64_t val> static IDISA_ALWAYS_INLINE bitblock128_t constant(); |
---|
40 | static IDISA_ALWAYS_INLINE bitblock128_t min(bitblock128_t arg1, bitblock128_t arg2); |
---|
41 | static IDISA_ALWAYS_INLINE bitblock128_t umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
42 | static IDISA_ALWAYS_INLINE bitblock128_t abs(bitblock128_t arg1); |
---|
43 | static IDISA_ALWAYS_INLINE bitblock128_t xor_hl(bitblock128_t arg1); |
---|
44 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srai(bitblock128_t arg1); |
---|
45 | static IDISA_ALWAYS_INLINE bitblock128_t lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
46 | static IDISA_ALWAYS_INLINE bitblock128_t add(bitblock128_t arg1, bitblock128_t arg2); |
---|
47 | static IDISA_ALWAYS_INLINE bitblock128_t ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
48 | }; |
---|
49 | |
---|
50 | template <uint32_t fw> |
---|
51 | class hsimd128 |
---|
52 | { |
---|
53 | public: |
---|
54 | static IDISA_ALWAYS_INLINE bitblock128_t umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
55 | static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
56 | static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
57 | static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
58 | static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1); |
---|
59 | static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
60 | static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
61 | static IDISA_ALWAYS_INLINE bitblock128_t packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
62 | }; |
---|
63 | |
---|
64 | template <uint32_t fw> |
---|
65 | class esimd128 |
---|
66 | { |
---|
67 | public: |
---|
68 | static IDISA_ALWAYS_INLINE bitblock128_t mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
69 | static IDISA_ALWAYS_INLINE bitblock128_t signextendh(bitblock128_t arg1); |
---|
70 | static IDISA_ALWAYS_INLINE bitblock128_t mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
71 | static IDISA_ALWAYS_INLINE bitblock128_t zeroextendh(bitblock128_t arg1); |
---|
72 | static IDISA_ALWAYS_INLINE bitblock128_t zeroextendl(bitblock128_t arg1); |
---|
73 | static IDISA_ALWAYS_INLINE bitblock128_t signextendl(bitblock128_t arg1); |
---|
74 | }; |
---|
75 | |
---|
76 | template <uint32_t fw> |
---|
77 | class mvmd128 |
---|
78 | { |
---|
79 | public: |
---|
80 | template <uint64_t msk> static IDISA_ALWAYS_INLINE bitblock128_t shufflei(bitblock128_t arg1); |
---|
81 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
82 | static IDISA_ALWAYS_INLINE bitblock128_t fill(uint64_t val1); |
---|
83 | static IDISA_ALWAYS_INLINE bitblock128_t shuffle(bitblock128_t arg1, bitblock128_t arg2); |
---|
84 | template <uint64_t pos> static IDISA_ALWAYS_INLINE uint64_t extract(bitblock128_t arg1); |
---|
85 | template <uint64_t pos> static IDISA_ALWAYS_INLINE bitblock128_t splat(bitblock128_t arg1); |
---|
86 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1); |
---|
87 | static IDISA_ALWAYS_INLINE bitblock128_t fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
88 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1); |
---|
89 | static IDISA_ALWAYS_INLINE bitblock128_t fill2(uint64_t val1, uint64_t val2); |
---|
90 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
91 | static IDISA_ALWAYS_INLINE bitblock128_t fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
92 | static IDISA_ALWAYS_INLINE bitblock128_t fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16); |
---|
93 | }; |
---|
94 | |
---|
95 | class bitblock128 |
---|
96 | { |
---|
97 | public: |
---|
98 | static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2); |
---|
99 | static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(const bitblock128_t* arg1); |
---|
100 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1); |
---|
101 | static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2); |
---|
102 | static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t arg1, bitblock128_t* arg2); |
---|
103 | static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1); |
---|
104 | static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1); |
---|
105 | static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1); |
---|
106 | template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1); |
---|
107 | static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(const bitblock128_t* arg1); |
---|
108 | static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t arg1, bitblock128_t* arg2); |
---|
109 | }; |
---|
110 | |
---|
111 | //Declaration Part |
---|
112 | IDISA_ALWAYS_INLINE bitblock128_t simd_nor(bitblock128_t arg1, bitblock128_t arg2); |
---|
113 | IDISA_ALWAYS_INLINE bitblock128_t simd_not(bitblock128_t arg1); |
---|
114 | IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2); |
---|
115 | IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2); |
---|
116 | IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2); |
---|
117 | IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2); |
---|
118 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
119 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
120 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
121 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
122 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
123 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
124 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
125 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::max(bitblock128_t arg1, bitblock128_t arg2); |
---|
126 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
127 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
128 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
129 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
130 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
131 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
132 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
133 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::mult(bitblock128_t arg1, bitblock128_t arg2); |
---|
134 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
135 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
136 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
137 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
138 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
139 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
140 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
141 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::gt(bitblock128_t arg1, bitblock128_t arg2); |
---|
142 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
143 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
144 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
145 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
146 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
147 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
148 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umult(bitblock128_t arg1, bitblock128_t arg2); |
---|
149 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
150 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
151 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
152 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
153 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
154 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
155 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
156 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ult(bitblock128_t arg1, bitblock128_t arg2); |
---|
157 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
158 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
159 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
160 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
161 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
162 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
163 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
164 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::lt(bitblock128_t arg1, bitblock128_t arg2); |
---|
165 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::srli(bitblock128_t arg1); |
---|
166 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::srli(bitblock128_t arg1); |
---|
167 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srli(bitblock128_t arg1); |
---|
168 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srli(bitblock128_t arg1); |
---|
169 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srli(bitblock128_t arg1); |
---|
170 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srli(bitblock128_t arg1); |
---|
171 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srli(bitblock128_t arg1); |
---|
172 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ctz(bitblock128_t arg1); |
---|
173 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ctz(bitblock128_t arg1); |
---|
174 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ctz(bitblock128_t arg1); |
---|
175 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ctz(bitblock128_t arg1); |
---|
176 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ctz(bitblock128_t arg1); |
---|
177 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ctz(bitblock128_t arg1); |
---|
178 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ctz(bitblock128_t arg1); |
---|
179 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ctz(bitblock128_t arg1); |
---|
180 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
181 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::sll(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
182 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
183 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
184 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
185 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
186 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
187 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
188 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
189 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ugt(bitblock128_t arg1, bitblock128_t arg2); |
---|
190 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::xor_hl(bitblock128_t arg1); |
---|
191 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::xor_hl(bitblock128_t arg1); |
---|
192 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::xor_hl(bitblock128_t arg1); |
---|
193 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::xor_hl(bitblock128_t arg1); |
---|
194 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::xor_hl(bitblock128_t arg1); |
---|
195 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::xor_hl(bitblock128_t arg1); |
---|
196 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::xor_hl(bitblock128_t arg1); |
---|
197 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::popcount(bitblock128_t arg1); |
---|
198 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::popcount(bitblock128_t arg1); |
---|
199 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::popcount(bitblock128_t arg1); |
---|
200 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::popcount(bitblock128_t arg1); |
---|
201 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::popcount(bitblock128_t arg1); |
---|
202 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::popcount(bitblock128_t arg1); |
---|
203 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::popcount(bitblock128_t arg1); |
---|
204 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::popcount(bitblock128_t arg1); |
---|
205 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::neg(bitblock128_t arg1); |
---|
206 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::neg(bitblock128_t arg1); |
---|
207 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::neg(bitblock128_t arg1); |
---|
208 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::neg(bitblock128_t arg1); |
---|
209 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::neg(bitblock128_t arg1); |
---|
210 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::neg(bitblock128_t arg1); |
---|
211 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::neg(bitblock128_t arg1); |
---|
212 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::slli(bitblock128_t arg1); |
---|
213 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::slli(bitblock128_t arg1); |
---|
214 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::slli(bitblock128_t arg1); |
---|
215 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::slli(bitblock128_t arg1); |
---|
216 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::slli(bitblock128_t arg1); |
---|
217 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::slli(bitblock128_t arg1); |
---|
218 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::slli(bitblock128_t arg1); |
---|
219 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
220 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
221 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
222 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
223 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
224 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
225 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
226 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3); |
---|
227 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
228 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
229 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
230 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
231 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
232 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
233 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
234 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::sub(bitblock128_t arg1, bitblock128_t arg2); |
---|
235 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::add_hl(bitblock128_t arg1); |
---|
236 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::add_hl(bitblock128_t arg1); |
---|
237 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::add_hl(bitblock128_t arg1); |
---|
238 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::add_hl(bitblock128_t arg1); |
---|
239 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::add_hl(bitblock128_t arg1); |
---|
240 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::add_hl(bitblock128_t arg1); |
---|
241 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::add_hl(bitblock128_t arg1); |
---|
242 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
243 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srl(bitblock128_t arg1, bitblock128_t shift_mask); |
---|
244 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::constant(); |
---|
245 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant(); |
---|
246 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant(); |
---|
247 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::constant(); |
---|
248 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::constant(); |
---|
249 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant(); |
---|
250 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::constant(); |
---|
251 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::constant(); |
---|
252 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
253 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
254 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
255 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
256 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
257 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
258 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
259 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::min(bitblock128_t arg1, bitblock128_t arg2); |
---|
260 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::lomask(); |
---|
261 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::lomask(); |
---|
262 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::lomask(); |
---|
263 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::lomask(); |
---|
264 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::lomask(); |
---|
265 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::lomask(); |
---|
266 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::lomask(); |
---|
267 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
268 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
269 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
270 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
271 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
272 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
273 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
274 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::umin(bitblock128_t arg1, bitblock128_t arg2); |
---|
275 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::abs(bitblock128_t arg1); |
---|
276 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::abs(bitblock128_t arg1); |
---|
277 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::abs(bitblock128_t arg1); |
---|
278 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::abs(bitblock128_t arg1); |
---|
279 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::abs(bitblock128_t arg1); |
---|
280 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::abs(bitblock128_t arg1); |
---|
281 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::abs(bitblock128_t arg1); |
---|
282 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
283 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
284 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
285 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
286 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
287 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
288 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
289 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::eq(bitblock128_t arg1, bitblock128_t arg2); |
---|
290 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::srai(bitblock128_t arg1); |
---|
291 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::srai(bitblock128_t arg1); |
---|
292 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srai(bitblock128_t arg1); |
---|
293 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srai(bitblock128_t arg1); |
---|
294 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srai(bitblock128_t arg1); |
---|
295 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srai(bitblock128_t arg1); |
---|
296 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srai(bitblock128_t arg1); |
---|
297 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::himask(); |
---|
298 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::himask(); |
---|
299 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::himask(); |
---|
300 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::himask(); |
---|
301 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::himask(); |
---|
302 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::himask(); |
---|
303 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::himask(); |
---|
304 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
305 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
306 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
307 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
308 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
309 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
310 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
311 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::add(bitblock128_t arg1, bitblock128_t arg2); |
---|
312 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
313 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
314 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
315 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
316 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
317 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
318 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
319 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::umax(bitblock128_t arg1, bitblock128_t arg2); |
---|
320 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
321 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
322 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
323 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
324 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
325 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
326 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::umin_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
327 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
328 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
329 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
330 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
331 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
332 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
333 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::add_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
334 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
335 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
336 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
337 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
338 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
339 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
340 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packss(bitblock128_t arg1, bitblock128_t arg2); |
---|
341 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<4>::signmask(bitblock128_t arg1); |
---|
342 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<8>::signmask(bitblock128_t arg1); |
---|
343 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1); |
---|
344 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1); |
---|
345 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1); |
---|
346 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<128>::signmask(bitblock128_t arg1); |
---|
347 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
348 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
349 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
350 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
351 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
352 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
353 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packl(bitblock128_t arg1, bitblock128_t arg2); |
---|
354 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
355 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
356 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
357 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
358 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
359 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
360 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packh(bitblock128_t arg1, bitblock128_t arg2); |
---|
361 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
362 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
363 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
364 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
365 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
366 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
367 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::min_hl(bitblock128_t arg1, bitblock128_t arg2); |
---|
368 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
369 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
370 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
371 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
372 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
373 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
374 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packus(bitblock128_t arg1, bitblock128_t arg2); |
---|
375 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
376 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
377 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
378 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
379 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
380 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
381 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::mergel(bitblock128_t arg1, bitblock128_t arg2); |
---|
382 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
383 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
384 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
385 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
386 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
387 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
388 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::mergeh(bitblock128_t arg1, bitblock128_t arg2); |
---|
389 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::zeroextendh(bitblock128_t arg1); |
---|
390 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::zeroextendh(bitblock128_t arg1); |
---|
391 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::zeroextendh(bitblock128_t arg1); |
---|
392 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::zeroextendh(bitblock128_t arg1); |
---|
393 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::zeroextendh(bitblock128_t arg1); |
---|
394 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::zeroextendh(bitblock128_t arg1); |
---|
395 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::zeroextendh(bitblock128_t arg1); |
---|
396 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::zeroextendl(bitblock128_t arg1); |
---|
397 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::zeroextendl(bitblock128_t arg1); |
---|
398 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::zeroextendl(bitblock128_t arg1); |
---|
399 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::zeroextendl(bitblock128_t arg1); |
---|
400 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::zeroextendl(bitblock128_t arg1); |
---|
401 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::zeroextendl(bitblock128_t arg1); |
---|
402 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::zeroextendl(bitblock128_t arg1); |
---|
403 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::signextendh(bitblock128_t arg1); |
---|
404 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::signextendh(bitblock128_t arg1); |
---|
405 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::signextendh(bitblock128_t arg1); |
---|
406 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::signextendh(bitblock128_t arg1); |
---|
407 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::signextendh(bitblock128_t arg1); |
---|
408 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendh(bitblock128_t arg1); |
---|
409 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendh(bitblock128_t arg1); |
---|
410 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::signextendl(bitblock128_t arg1); |
---|
411 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::signextendl(bitblock128_t arg1); |
---|
412 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::signextendl(bitblock128_t arg1); |
---|
413 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::signextendl(bitblock128_t arg1); |
---|
414 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::signextendl(bitblock128_t arg1); |
---|
415 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendl(bitblock128_t arg1); |
---|
416 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendl(bitblock128_t arg1); |
---|
417 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::shufflei(bitblock128_t arg1); |
---|
418 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::shufflei(bitblock128_t arg1); |
---|
419 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::shufflei(bitblock128_t arg1); |
---|
420 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
421 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
422 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
423 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
424 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
425 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
426 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dsrli(bitblock128_t arg1, bitblock128_t arg2); |
---|
427 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill(uint64_t val1); |
---|
428 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill(uint64_t val1); |
---|
429 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill(uint64_t val1); |
---|
430 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill(uint64_t val1); |
---|
431 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill(uint64_t val1); |
---|
432 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(uint64_t val1); |
---|
433 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill(uint64_t val1); |
---|
434 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::fill(uint64_t val1); |
---|
435 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::shuffle(bitblock128_t arg1, bitblock128_t arg2); |
---|
436 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::shuffle(bitblock128_t arg1, bitblock128_t arg2); |
---|
437 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::shuffle(bitblock128_t arg1, bitblock128_t arg2); |
---|
438 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::shuffle(bitblock128_t arg1, bitblock128_t arg2); |
---|
439 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<1>::extract(bitblock128_t arg1); |
---|
440 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<2>::extract(bitblock128_t arg1); |
---|
441 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<4>::extract(bitblock128_t arg1); |
---|
442 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<8>::extract(bitblock128_t arg1); |
---|
443 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<16>::extract(bitblock128_t arg1); |
---|
444 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<32>::extract(bitblock128_t arg1); |
---|
445 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<64>::extract(bitblock128_t arg1); |
---|
446 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::splat(bitblock128_t arg1); |
---|
447 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::splat(bitblock128_t arg1); |
---|
448 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::splat(bitblock128_t arg1); |
---|
449 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::splat(bitblock128_t arg1); |
---|
450 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::splat(bitblock128_t arg1); |
---|
451 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::splat(bitblock128_t arg1); |
---|
452 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::splat(bitblock128_t arg1); |
---|
453 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::splat(bitblock128_t arg1); |
---|
454 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16); |
---|
455 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16); |
---|
456 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16); |
---|
457 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16); |
---|
458 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
459 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
460 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
461 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
462 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
463 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4); |
---|
464 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::srli(bitblock128_t arg1); |
---|
465 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1); |
---|
466 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::srli(bitblock128_t arg1); |
---|
467 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::srli(bitblock128_t arg1); |
---|
468 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1); |
---|
469 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::srli(bitblock128_t arg1); |
---|
470 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1); |
---|
471 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill2(uint64_t val1, uint64_t val2); |
---|
472 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill2(uint64_t val1, uint64_t val2); |
---|
473 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill2(uint64_t val1, uint64_t val2); |
---|
474 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill2(uint64_t val1, uint64_t val2); |
---|
475 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill2(uint64_t val1, uint64_t val2); |
---|
476 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(uint64_t val1, uint64_t val2); |
---|
477 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill2(uint64_t val1, uint64_t val2); |
---|
478 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
479 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
480 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
481 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
482 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
483 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
484 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dslli(bitblock128_t arg1, bitblock128_t arg2); |
---|
485 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::slli(bitblock128_t arg1); |
---|
486 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1); |
---|
487 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::slli(bitblock128_t arg1); |
---|
488 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1); |
---|
489 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::slli(bitblock128_t arg1); |
---|
490 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1); |
---|
491 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::slli(bitblock128_t arg1); |
---|
492 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
493 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
494 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
495 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
496 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8); |
---|
497 | |
---|
498 | //Implementation Part |
---|
499 | |
---|
500 | #define shufflemask4(s1, s2, s3, s4) \ |
---|
501 | ((s1<<6) | (s2<<4) | (s3<<2) | s4) |
---|
502 | |
---|
503 | #define shufflemask4_from_shufflemask2(msk) \ |
---|
504 | (msk==3 ? 238 : (msk==2 ? 228 : (msk==1 ? 78 : 68))) |
---|
505 | |
---|
506 | #define shufflemask8_to_shufflemask4(msk) \ |
---|
507 | ((msk&3) | (((msk>>3)&3)<<2) | (((msk>>6)&3)<<4) | (((msk>>9)&3)<<6) | (((msk>>12)&3)<<8) | (((msk>>15)&3)<<10) | (((msk>>18)&3)<<12) | (((msk>>21)&3)<<14)) |
---|
508 | //The total number of operations is 2.0 |
---|
509 | IDISA_ALWAYS_INLINE bitblock128_t simd_nor(bitblock128_t arg1, bitblock128_t arg2) |
---|
510 | { |
---|
511 | return simd_not(simd_or(arg1, arg2)); |
---|
512 | } |
---|
513 | |
---|
514 | //The total number of operations is 1.0 |
---|
515 | IDISA_ALWAYS_INLINE bitblock128_t simd_not(bitblock128_t arg1) |
---|
516 | { |
---|
517 | return simd_xor(arg1, simd128<32>::constant<-1>()); |
---|
518 | } |
---|
519 | |
---|
520 | //The total number of operations is 1.0 |
---|
521 | IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2) |
---|
522 | { |
---|
523 | return _mm_andnot_si128(arg2, arg1); |
---|
524 | } |
---|
525 | |
---|
526 | //The total number of operations is 1.0 |
---|
527 | IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2) |
---|
528 | { |
---|
529 | return _mm_or_si128(arg1, arg2); |
---|
530 | } |
---|
531 | |
---|
532 | //The total number of operations is 1.0 |
---|
533 | IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2) |
---|
534 | { |
---|
535 | return _mm_and_si128(arg1, arg2); |
---|
536 | } |
---|
537 | |
---|
538 | //The total number of operations is 1.0 |
---|
539 | IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2) |
---|
540 | { |
---|
541 | return _mm_xor_si128(arg1, arg2); |
---|
542 | } |
---|
543 | |
---|
544 | //The total number of operations is 1.0 |
---|
545 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
546 | { |
---|
547 | return simd_and(arg1, arg2); |
---|
548 | } |
---|
549 | |
---|
550 | //The total number of operations is 15.6666666667 |
---|
551 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
552 | { |
---|
553 | return simd128<1>::ifh(simd128<2>::himask(), simd_and(arg1, arg2), simd_or(simd_and(arg2, simd128<128>::srli<1>(simd_or(arg1, simd_not(arg2)))), simd_and(arg1, simd128<128>::srli<1>(simd_or(simd_not(arg1), arg2))))); |
---|
554 | } |
---|
555 | |
---|
556 | //The total number of operations is 9.0 |
---|
557 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
558 | { |
---|
559 | bitblock128_t high_bit = simd128<4>::constant<(8)>(); |
---|
560 | return simd_xor(simd128<4>::umax(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)), high_bit); |
---|
561 | } |
---|
562 | |
---|
563 | //The total number of operations is 1.0 |
---|
564 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
565 | { |
---|
566 | return _mm_max_epi8(arg1, arg2); |
---|
567 | } |
---|
568 | |
---|
569 | //The total number of operations is 1.0 |
---|
570 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
571 | { |
---|
572 | return _mm_max_epi16(arg1, arg2); |
---|
573 | } |
---|
574 | |
---|
575 | //The total number of operations is 1.0 |
---|
576 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
577 | { |
---|
578 | return _mm_max_epi32(arg1, arg2); |
---|
579 | } |
---|
580 | |
---|
581 | //The total number of operations is 4.0 |
---|
582 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
583 | { |
---|
584 | return simd128<1>::ifh(simd128<64>::gt(arg1, arg2), arg1, arg2); |
---|
585 | } |
---|
586 | |
---|
587 | //The total number of operations is 26.6666666667 |
---|
588 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::max(bitblock128_t arg1, bitblock128_t arg2) |
---|
589 | { |
---|
590 | bitblock128_t hiAns = simd128<(64)>::max(arg1, arg2); |
---|
591 | bitblock128_t loAns = simd128<(64)>::umax(arg1, arg2); |
---|
592 | bitblock128_t eqMask1 = simd128<128>::srli<(64)>(simd128<(64)>::eq(hiAns, arg1)); |
---|
593 | bitblock128_t eqMask2 = simd128<128>::srli<(64)>(simd128<(64)>::eq(hiAns, arg2)); |
---|
594 | return simd128<1>::ifh(simd128<128>::himask(), hiAns, simd128<1>::ifh(eqMask1, simd128<1>::ifh(eqMask2, loAns, arg1), arg2)); |
---|
595 | } |
---|
596 | |
---|
597 | //The total number of operations is 1.0 |
---|
598 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
599 | { |
---|
600 | return simd_and(arg1, arg2); |
---|
601 | } |
---|
602 | |
---|
603 | //The total number of operations is 19.6666666667 |
---|
604 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
605 | { |
---|
606 | bitblock128_t tmp1 = simd128<128>::slli<1>(arg1); |
---|
607 | bitblock128_t tmp2 = simd128<128>::slli<1>(arg2); |
---|
608 | return simd128<1>::ifh(simd128<2>::himask(), simd_or(simd_and(tmp1, simd_and(arg2, simd_or(simd_not(arg1), simd_not(tmp2)))), simd_and(arg1, simd_and(tmp2, simd_or(simd_not(tmp1), simd_not(arg2))))), simd_and(arg1, arg2)); |
---|
609 | } |
---|
610 | |
---|
611 | //The total number of operations is 31.0 |
---|
612 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
613 | { |
---|
614 | bitblock128_t loMask = simd128<(8)>::lomask(); |
---|
615 | bitblock128_t tmpAns1 = simd128<(8)>::mult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
616 | bitblock128_t tmpAns2 = simd128<(8)>::mult(simd128<(8)>::srli<4>(arg1), simd128<(8)>::srli<4>(arg2)); |
---|
617 | return simd128<1>::ifh(loMask, tmpAns1, simd128<(8)>::slli<4>(tmpAns2)); |
---|
618 | } |
---|
619 | |
---|
620 | //The total number of operations is 10.0 |
---|
621 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
622 | { |
---|
623 | bitblock128_t loMask = simd128<(16)>::lomask(); |
---|
624 | bitblock128_t tmpAns1 = simd128<(16)>::mult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
625 | bitblock128_t tmpAns2 = simd128<(16)>::mult(simd128<(16)>::srli<8>(arg1), simd128<(16)>::srli<8>(arg2)); |
---|
626 | return simd128<1>::ifh(loMask, tmpAns1, simd128<(16)>::slli<8>(tmpAns2)); |
---|
627 | } |
---|
628 | |
---|
629 | //The total number of operations is 1.0 |
---|
630 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
631 | { |
---|
632 | return _mm_mullo_epi16(arg1, arg2); |
---|
633 | } |
---|
634 | |
---|
635 | //The total number of operations is 1.0 |
---|
636 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
637 | { |
---|
638 | return _mm_mullo_epi32(arg1, arg2); |
---|
639 | } |
---|
640 | |
---|
641 | //The total number of operations is 11.0 |
---|
642 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
643 | { |
---|
644 | bitblock128_t loMask = simd128<64>::lomask(); |
---|
645 | bitblock128_t arg1_low = simd_and(arg1, loMask); |
---|
646 | bitblock128_t arg1_high = simd128<64>::srli<(32)>(arg1); |
---|
647 | bitblock128_t arg2_low = simd_and(arg2, loMask); |
---|
648 | bitblock128_t arg2_high = simd128<64>::srli<(32)>(arg2); |
---|
649 | bitblock128_t tmpAns1 = simd128<(32)>::umult(arg1_low, arg2_low); |
---|
650 | bitblock128_t tmpAns2 = simd128<64>::slli<(32)>(simd128<(32)>::umult(arg1_low, arg2_high)); |
---|
651 | bitblock128_t tmpAns3 = simd128<64>::slli<(32)>(simd128<(32)>::umult(arg1_high, arg2_low)); |
---|
652 | return simd128<64>::add(tmpAns1, simd128<64>::add(tmpAns2, tmpAns3)); |
---|
653 | } |
---|
654 | |
---|
655 | //The total number of operations is 165.0 |
---|
656 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::mult(bitblock128_t arg1, bitblock128_t arg2) |
---|
657 | { |
---|
658 | bitblock128_t loMask = simd128<128>::lomask(); |
---|
659 | bitblock128_t arg1_low = simd_and(arg1, loMask); |
---|
660 | bitblock128_t arg1_high = simd128<128>::srli<(64)>(arg1); |
---|
661 | bitblock128_t arg2_low = simd_and(arg2, loMask); |
---|
662 | bitblock128_t arg2_high = simd128<128>::srli<(64)>(arg2); |
---|
663 | bitblock128_t tmpAns1 = simd128<(64)>::umult(arg1_low, arg2_low); |
---|
664 | bitblock128_t tmpAns2 = simd128<128>::slli<(64)>(simd128<(64)>::umult(arg1_low, arg2_high)); |
---|
665 | bitblock128_t tmpAns3 = simd128<128>::slli<(64)>(simd128<(64)>::umult(arg1_high, arg2_low)); |
---|
666 | return simd128<128>::add(tmpAns1, simd128<128>::add(tmpAns2, tmpAns3)); |
---|
667 | } |
---|
668 | |
---|
669 | //The total number of operations is 1.0 |
---|
670 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
671 | { |
---|
672 | return simd_andc(arg2, arg1); |
---|
673 | } |
---|
674 | |
---|
675 | //The total number of operations is 14.6666666667 |
---|
676 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
677 | { |
---|
678 | bitblock128_t tmp = simd_not(arg1); |
---|
679 | bitblock128_t tmpAns = simd_or(simd_and(tmp, arg2), simd_and(simd128<128>::slli<1>(simd_and(arg1, simd_not(arg2))), simd_or(tmp, arg2))); |
---|
680 | return simd128<1>::ifh(simd128<2>::himask(), tmpAns, simd128<128>::srli<1>(tmpAns)); |
---|
681 | } |
---|
682 | |
---|
683 | //The total number of operations is 10.0 |
---|
684 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
685 | { |
---|
686 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::gt(simd_and(simd128<(8)>::himask(), arg1), arg2), simd128<(8)>::gt(simd128<(8)>::slli<4>(arg1), simd128<(8)>::slli<4>(arg2))); |
---|
687 | } |
---|
688 | |
---|
689 | //The total number of operations is 1.0 |
---|
690 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
691 | { |
---|
692 | return _mm_cmpgt_epi8(arg1, arg2); |
---|
693 | } |
---|
694 | |
---|
695 | //The total number of operations is 1.0 |
---|
696 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
697 | { |
---|
698 | return _mm_cmpgt_epi16(arg1, arg2); |
---|
699 | } |
---|
700 | |
---|
701 | //The total number of operations is 1.0 |
---|
702 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
703 | { |
---|
704 | return _mm_cmpgt_epi32(arg1, arg2); |
---|
705 | } |
---|
706 | |
---|
707 | //The total number of operations is 1.0 |
---|
708 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
709 | { |
---|
710 | return _mm_cmpgt_epi64(arg1, arg2); |
---|
711 | } |
---|
712 | |
---|
713 | //The total number of operations is 23.75 |
---|
714 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::gt(bitblock128_t arg1, bitblock128_t arg2) |
---|
715 | { |
---|
716 | bitblock128_t hiAns = simd128<(64)>::gt(arg1, arg2); |
---|
717 | bitblock128_t loAns = simd128<(64)>::ugt(arg1, arg2); |
---|
718 | bitblock128_t mask = simd_and(loAns, simd128<128>::srli<(64)>(simd128<(64)>::eq(arg1, arg2))); |
---|
719 | mask = simd_or(mask, simd128<128>::slli<(64)>(mask)); |
---|
720 | return simd_or(simd128<128>::srai<(64)>(hiAns), mask); |
---|
721 | } |
---|
722 | |
---|
723 | //The total number of operations is 289.0 |
---|
724 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
725 | { |
---|
726 | bitblock128_t loMask = simd128<(2)>::lomask(); |
---|
727 | bitblock128_t tmpAns1 = simd128<(2)>::umult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
728 | bitblock128_t tmpAns2 = simd128<(2)>::umult(simd_and(loMask, simd128<(4)>::srli<(2)>(arg1)), simd_and(loMask, simd128<(4)>::srli<(2)>(arg2))); |
---|
729 | return simd_or(tmpAns1, simd128<(4)>::slli<(2)>(tmpAns2)); |
---|
730 | } |
---|
731 | |
---|
732 | //The total number of operations is 139.0 |
---|
733 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
734 | { |
---|
735 | bitblock128_t loMask = simd128<(4)>::lomask(); |
---|
736 | bitblock128_t tmpAns1 = simd128<(4)>::umult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
737 | bitblock128_t tmpAns2 = simd128<(4)>::umult(simd_and(loMask, simd128<(8)>::srli<(4)>(arg1)), simd_and(loMask, simd128<(8)>::srli<(4)>(arg2))); |
---|
738 | return simd_or(tmpAns1, simd128<(8)>::slli<(4)>(tmpAns2)); |
---|
739 | } |
---|
740 | |
---|
741 | //The total number of operations is 64.0 |
---|
742 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
743 | { |
---|
744 | bitblock128_t loMask = simd128<(8)>::lomask(); |
---|
745 | bitblock128_t tmpAns1 = simd128<(8)>::umult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
746 | bitblock128_t tmpAns2 = simd128<(8)>::umult(simd_and(loMask, simd128<(16)>::srli<(8)>(arg1)), simd_and(loMask, simd128<(16)>::srli<(8)>(arg2))); |
---|
747 | return simd_or(tmpAns1, simd128<(16)>::slli<(8)>(tmpAns2)); |
---|
748 | } |
---|
749 | |
---|
750 | //The total number of operations is 28.0 |
---|
751 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
752 | { |
---|
753 | bitblock128_t loMask = simd128<(16)>::lomask(); |
---|
754 | bitblock128_t tmpAns1 = simd128<(16)>::umult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
755 | bitblock128_t tmpAns2 = simd128<(16)>::umult(simd_and(loMask, simd128<(32)>::srli<(16)>(arg1)), simd_and(loMask, simd128<(32)>::srli<(16)>(arg2))); |
---|
756 | return simd_or(tmpAns1, simd128<(32)>::slli<(16)>(tmpAns2)); |
---|
757 | } |
---|
758 | |
---|
759 | //The total number of operations is 10.0 |
---|
760 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
761 | { |
---|
762 | bitblock128_t loMask = simd128<(32)>::lomask(); |
---|
763 | bitblock128_t tmpAns1 = simd128<(32)>::umult(simd_and(loMask, arg1), simd_and(loMask, arg2)); |
---|
764 | bitblock128_t tmpAns2 = simd128<(32)>::umult(simd_and(loMask, simd128<(64)>::srli<(32)>(arg1)), simd_and(loMask, simd128<(64)>::srli<(32)>(arg2))); |
---|
765 | return simd_or(tmpAns1, simd128<(64)>::slli<(32)>(tmpAns2)); |
---|
766 | } |
---|
767 | |
---|
768 | //The total number of operations is 1.0 |
---|
769 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
770 | { |
---|
771 | return _mm_mul_epu32(arg1, arg2); |
---|
772 | } |
---|
773 | |
---|
774 | //The total number of operations is 45.0 |
---|
775 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umult(bitblock128_t arg1, bitblock128_t arg2) |
---|
776 | { |
---|
777 | bitblock128_t loMask1 = simd128<(128)>::lomask(); |
---|
778 | bitblock128_t arg11 = simd_and(arg1, loMask1); |
---|
779 | bitblock128_t arg22 = simd_and(arg2, loMask1); |
---|
780 | bitblock128_t loMask2 = simd128<64>::lomask(); |
---|
781 | bitblock128_t arg1_low = simd_and(arg11, loMask2); |
---|
782 | bitblock128_t arg1_high = simd128<64>::srli<(32)>(arg11); |
---|
783 | bitblock128_t arg2_low = simd_and(arg22, loMask2); |
---|
784 | bitblock128_t arg2_high = simd128<64>::srli<(32)>(arg22); |
---|
785 | bitblock128_t tmpAns1 = simd128<(32)>::umult(arg1_low, arg2_low); |
---|
786 | bitblock128_t tmpAns2 = simd128<(128)>::slli<(32)>(simd128<(32)>::umult(arg1_low, arg2_high)); |
---|
787 | bitblock128_t tmpAns3 = simd128<(128)>::slli<(32)>(simd128<(32)>::umult(arg1_high, arg2_low)); |
---|
788 | bitblock128_t tmpAns4 = simd128<(128)>::slli<64>(simd128<(32)>::umult(arg1_high, arg2_high)); |
---|
789 | return simd128<(128)>::add(tmpAns1, simd128<(128)>::add(tmpAns2, simd128<(128)>::add(tmpAns3, tmpAns4))); |
---|
790 | } |
---|
791 | |
---|
792 | //The total number of operations is 1.0 |
---|
793 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
794 | { |
---|
795 | return simd_andc(arg2, arg1); |
---|
796 | } |
---|
797 | |
---|
798 | //The total number of operations is 13.6666666667 |
---|
799 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
800 | { |
---|
801 | bitblock128_t tmp = simd_not(arg1); |
---|
802 | bitblock128_t tmpAns = simd_or(simd_and(tmp, arg2), simd_and(simd128<128>::slli<1>(simd_and(tmp, arg2)), simd_or(tmp, arg2))); |
---|
803 | return simd128<1>::ifh(simd128<2>::himask(), tmpAns, simd128<128>::srli<1>(tmpAns)); |
---|
804 | } |
---|
805 | |
---|
806 | //The total number of operations is 20.0 |
---|
807 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
808 | { |
---|
809 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::ult(arg1, simd_and(simd128<(8)>::himask(), arg2)), simd128<(8)>::ult(simd_andc(arg1, simd128<(8)>::himask()), simd_andc(arg2, simd128<(8)>::himask()))); |
---|
810 | } |
---|
811 | |
---|
812 | //The total number of operations is 7.0 |
---|
813 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
814 | { |
---|
815 | bitblock128_t high_bit = simd128<8>::constant<(128)>(); |
---|
816 | return simd128<8>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
817 | } |
---|
818 | |
---|
819 | //The total number of operations is 7.0 |
---|
820 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
821 | { |
---|
822 | bitblock128_t high_bit = simd128<16>::constant<(32768)>(); |
---|
823 | return simd128<16>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
824 | } |
---|
825 | |
---|
826 | //The total number of operations is 7.0 |
---|
827 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
828 | { |
---|
829 | bitblock128_t high_bit = simd128<32>::constant<(2147483648ULL)>(); |
---|
830 | return simd128<32>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
831 | } |
---|
832 | |
---|
833 | //The total number of operations is 7.0 |
---|
834 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
835 | { |
---|
836 | bitblock128_t high_bit = simd128<64>::constant<(9223372036854775808ULL)>(); |
---|
837 | return simd128<64>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
838 | } |
---|
839 | |
---|
840 | //The total number of operations is 26.75 |
---|
841 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ult(bitblock128_t arg1, bitblock128_t arg2) |
---|
842 | { |
---|
843 | bitblock128_t tmpAns = simd128<(64)>::ult(arg1, arg2); |
---|
844 | bitblock128_t mask = simd_and(tmpAns, simd128<128>::srli<(64)>(simd128<(64)>::eq(arg1, arg2))); |
---|
845 | mask = simd_or(mask, simd128<128>::slli<(64)>(mask)); |
---|
846 | return simd_or(simd128<128>::srai<(64)>(tmpAns), mask); |
---|
847 | } |
---|
848 | |
---|
849 | //The total number of operations is 1.0 |
---|
850 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
851 | { |
---|
852 | return simd_andc(arg1, arg2); |
---|
853 | } |
---|
854 | |
---|
855 | //The total number of operations is 14.6666666667 |
---|
856 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
857 | { |
---|
858 | bitblock128_t tmp = simd_not(arg2); |
---|
859 | bitblock128_t tmpAns = simd_or(simd_and(arg1, tmp), simd_and(simd128<128>::slli<1>(simd_and(simd_not(arg1), arg2)), simd_or(arg1, tmp))); |
---|
860 | return simd128<1>::ifh(simd128<2>::himask(), tmpAns, simd128<128>::srli<1>(tmpAns)); |
---|
861 | } |
---|
862 | |
---|
863 | //The total number of operations is 18.0 |
---|
864 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
865 | { |
---|
866 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::lt(arg1, simd_and(simd128<(8)>::himask(), arg2)), simd128<(8)>::lt(simd128<(8)>::slli<4>(arg1), simd128<(8)>::slli<4>(arg2))); |
---|
867 | } |
---|
868 | |
---|
869 | //The total number of operations is 5.0 |
---|
870 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
871 | { |
---|
872 | return simd_and(simd_not(simd128<8>::gt(arg1, arg2)), simd_not(simd128<8>::eq(arg1, arg2))); |
---|
873 | } |
---|
874 | |
---|
875 | //The total number of operations is 5.0 |
---|
876 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
877 | { |
---|
878 | return simd_and(simd_not(simd128<16>::gt(arg1, arg2)), simd_not(simd128<16>::eq(arg1, arg2))); |
---|
879 | } |
---|
880 | |
---|
881 | //The total number of operations is 5.0 |
---|
882 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
883 | { |
---|
884 | return simd_and(simd_not(simd128<32>::gt(arg1, arg2)), simd_not(simd128<32>::eq(arg1, arg2))); |
---|
885 | } |
---|
886 | |
---|
887 | //The total number of operations is 5.0 |
---|
888 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
889 | { |
---|
890 | return simd_and(simd_not(simd128<64>::gt(arg1, arg2)), simd_not(simd128<64>::eq(arg1, arg2))); |
---|
891 | } |
---|
892 | |
---|
893 | //The total number of operations is 31.75 |
---|
894 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::lt(bitblock128_t arg1, bitblock128_t arg2) |
---|
895 | { |
---|
896 | bitblock128_t hiAns = simd128<(64)>::lt(arg1, arg2); |
---|
897 | bitblock128_t loAns = simd128<(64)>::ult(arg1, arg2); |
---|
898 | bitblock128_t mask = simd_and(loAns, simd128<128>::srli<(64)>(simd128<(64)>::eq(arg1, arg2))); |
---|
899 | mask = simd_or(mask, simd128<128>::slli<(64)>(mask)); |
---|
900 | return simd_or(simd128<128>::srai<(64)>(hiAns), mask); |
---|
901 | } |
---|
902 | |
---|
903 | //The total number of operations is 2.0 |
---|
904 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::srli(bitblock128_t arg1) |
---|
905 | { |
---|
906 | return simd_and(simd128<32>::srli<sh>(arg1), simd128<2>::constant<((3)>>sh)>()); |
---|
907 | } |
---|
908 | |
---|
909 | //The total number of operations is 2.0 |
---|
910 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::srli(bitblock128_t arg1) |
---|
911 | { |
---|
912 | return simd_and(simd128<32>::srli<sh>(arg1), simd128<4>::constant<((15)>>sh)>()); |
---|
913 | } |
---|
914 | |
---|
915 | //The total number of operations is 2.0 |
---|
916 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srli(bitblock128_t arg1) |
---|
917 | { |
---|
918 | return simd_and(simd128<32>::srli<sh>(arg1), simd128<8>::constant<((255)>>sh)>()); |
---|
919 | } |
---|
920 | |
---|
921 | //The total number of operations is 1.0 |
---|
922 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srli(bitblock128_t arg1) |
---|
923 | { |
---|
924 | return _mm_srli_epi16(arg1, (int32_t)(sh)); |
---|
925 | } |
---|
926 | |
---|
927 | //The total number of operations is 1.0 |
---|
928 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srli(bitblock128_t arg1) |
---|
929 | { |
---|
930 | return _mm_srli_epi32(arg1, (int32_t)(sh)); |
---|
931 | } |
---|
932 | |
---|
933 | //The total number of operations is 1.0 |
---|
934 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srli(bitblock128_t arg1) |
---|
935 | { |
---|
936 | return _mm_srli_epi64(arg1, (int32_t)(sh)); |
---|
937 | } |
---|
938 | |
---|
939 | //The total number of operations is 2.33333333333 |
---|
940 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srli(bitblock128_t arg1) |
---|
941 | { |
---|
942 | return (((sh%8) == 0) ? _mm_srli_si128(arg1, (int32_t)((sh/8))) : ((sh >= 64) ? simd128<64>::srli<(sh-64)>(_mm_srli_si128(arg1, (int32_t)(8))) : simd_or(simd128<64>::srli<sh>(arg1), _mm_srli_si128(simd128<64>::slli<(64-sh)>(arg1), (int32_t)(8))))); |
---|
943 | } |
---|
944 | |
---|
945 | //The total number of operations is 1.0 |
---|
946 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ctz(bitblock128_t arg1) |
---|
947 | { |
---|
948 | return simd_not(arg1); |
---|
949 | } |
---|
950 | |
---|
951 | //The total number of operations is 10.6666666667 |
---|
952 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ctz(bitblock128_t arg1) |
---|
953 | { |
---|
954 | bitblock128_t tmp = simd_not(arg1); |
---|
955 | return simd128<1>::ifh(simd128<2>::himask(), simd_and(tmp, simd128<128>::slli<1>(tmp)), simd_and(simd128<128>::srli<1>(arg1), tmp)); |
---|
956 | } |
---|
957 | |
---|
958 | //The total number of operations is 14.0 |
---|
959 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ctz(bitblock128_t arg1) |
---|
960 | { |
---|
961 | return simd128<4>::popcount(simd_andc(simd128<4>::sub(arg1, simd128<4>::constant<1>()), arg1)); |
---|
962 | } |
---|
963 | |
---|
964 | //The total number of operations is 13.0 |
---|
965 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ctz(bitblock128_t arg1) |
---|
966 | { |
---|
967 | return simd128<8>::popcount(simd_andc(simd128<8>::sub(arg1, simd128<8>::constant<1>()), arg1)); |
---|
968 | } |
---|
969 | |
---|
970 | //The total number of operations is 16.0 |
---|
971 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ctz(bitblock128_t arg1) |
---|
972 | { |
---|
973 | return simd128<16>::popcount(simd_andc(simd128<16>::sub(arg1, simd128<16>::constant<1>()), arg1)); |
---|
974 | } |
---|
975 | |
---|
976 | //The total number of operations is 19.0 |
---|
977 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ctz(bitblock128_t arg1) |
---|
978 | { |
---|
979 | return simd128<32>::popcount(simd_andc(simd128<32>::sub(arg1, simd128<32>::constant<1>()), arg1)); |
---|
980 | } |
---|
981 | |
---|
982 | //The total number of operations is 14.0 |
---|
983 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ctz(bitblock128_t arg1) |
---|
984 | { |
---|
985 | return simd128<64>::popcount(simd_andc(simd128<64>::sub(arg1, simd128<64>::constant<1>()), arg1)); |
---|
986 | } |
---|
987 | |
---|
988 | //The total number of operations is 26.6666666667 |
---|
989 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ctz(bitblock128_t arg1) |
---|
990 | { |
---|
991 | return simd128<128>::popcount(simd_andc(simd128<128>::sub(arg1, simd128<128>::constant<1>()), arg1)); |
---|
992 | } |
---|
993 | |
---|
994 | //The total number of operations is 10.0 |
---|
995 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask) |
---|
996 | { |
---|
997 | return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, simd_and(_mm_srli_si128(shift_mask, (int32_t)(8)), _mm_cvtsi32_si128((int32_t)(63)))), _mm_sll_epi64(arg1, simd_and(shift_mask, _mm_cvtsi32_si128((int32_t)(63))))); |
---|
998 | } |
---|
999 | |
---|
1000 | //The total number of operations is 13.0 |
---|
1001 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::sll(bitblock128_t arg1, bitblock128_t shift_mask) |
---|
1002 | { |
---|
1003 | bitblock128_t shift = simd_and(shift_mask, _mm_cvtsi32_si128((int32_t)(127))); |
---|
1004 | return simd_or(_mm_sll_epi64(arg1, shift), simd_or(_mm_slli_si128(_mm_sll_epi64(arg1, simd128<32>::sub(shift, _mm_cvtsi32_si128((int32_t)(64)))), (int32_t)(8)), _mm_slli_si128(_mm_srl_epi64(arg1, simd128<32>::sub(_mm_cvtsi32_si128((int32_t)(64)), shift)), (int32_t)(8)))); |
---|
1005 | } |
---|
1006 | |
---|
1007 | //The total number of operations is 1.0 |
---|
1008 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1009 | { |
---|
1010 | return simd_andc(arg1, arg2); |
---|
1011 | } |
---|
1012 | |
---|
1013 | //The total number of operations is 13.6666666667 |
---|
1014 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1015 | { |
---|
1016 | bitblock128_t tmp = simd_not(arg2); |
---|
1017 | bitblock128_t tmpAns = simd_or(simd_and(arg1, tmp), simd_and(simd128<128>::slli<1>(simd_and(arg1, tmp)), simd_or(arg1, tmp))); |
---|
1018 | return simd128<1>::ifh(simd128<2>::himask(), tmpAns, simd128<128>::srli<1>(tmpAns)); |
---|
1019 | } |
---|
1020 | |
---|
1021 | //The total number of operations is 12.0 |
---|
1022 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1023 | { |
---|
1024 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::ugt(simd_and(simd128<(8)>::himask(), arg1), arg2), simd128<(8)>::ugt(simd_andc(arg1, simd128<(8)>::himask()), simd_andc(arg2, simd128<(8)>::himask()))); |
---|
1025 | } |
---|
1026 | |
---|
1027 | //The total number of operations is 3.0 |
---|
1028 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1029 | { |
---|
1030 | bitblock128_t high_bit = simd128<8>::constant<(128)>(); |
---|
1031 | return simd128<8>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
1032 | } |
---|
1033 | |
---|
1034 | //The total number of operations is 3.0 |
---|
1035 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1036 | { |
---|
1037 | bitblock128_t high_bit = simd128<16>::constant<(32768)>(); |
---|
1038 | return simd128<16>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
1039 | } |
---|
1040 | |
---|
1041 | //The total number of operations is 3.0 |
---|
1042 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1043 | { |
---|
1044 | bitblock128_t high_bit = simd128<32>::constant<(2147483648ULL)>(); |
---|
1045 | return simd128<32>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
1046 | } |
---|
1047 | |
---|
1048 | //The total number of operations is 3.0 |
---|
1049 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1050 | { |
---|
1051 | bitblock128_t high_bit = simd128<64>::constant<(9223372036854775808ULL)>(); |
---|
1052 | return simd128<64>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)); |
---|
1053 | } |
---|
1054 | |
---|
1055 | //The total number of operations is 22.75 |
---|
1056 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ugt(bitblock128_t arg1, bitblock128_t arg2) |
---|
1057 | { |
---|
1058 | bitblock128_t tmpAns = simd128<(64)>::ugt(arg1, arg2); |
---|
1059 | bitblock128_t mask = simd_and(tmpAns, simd128<128>::srli<(64)>(simd128<(64)>::eq(arg1, arg2))); |
---|
1060 | mask = simd_or(mask, simd128<128>::slli<(64)>(mask)); |
---|
1061 | return simd_or(simd128<128>::srai<(64)>(tmpAns), mask); |
---|
1062 | } |
---|
1063 | |
---|
1064 | //The total number of operations is 4.0 |
---|
1065 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::xor_hl(bitblock128_t arg1) |
---|
1066 | { |
---|
1067 | return simd_xor(simd128<2>::srli<(1)>(arg1), simd_and(arg1, simd128<2>::lomask())); |
---|
1068 | } |
---|
1069 | |
---|
1070 | //The total number of operations is 4.0 |
---|
1071 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::xor_hl(bitblock128_t arg1) |
---|
1072 | { |
---|
1073 | return simd_xor(simd128<4>::srli<(2)>(arg1), simd_and(arg1, simd128<4>::lomask())); |
---|
1074 | } |
---|
1075 | |
---|
1076 | //The total number of operations is 4.0 |
---|
1077 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::xor_hl(bitblock128_t arg1) |
---|
1078 | { |
---|
1079 | return simd_xor(simd128<8>::srli<(4)>(arg1), simd_and(arg1, simd128<8>::lomask())); |
---|
1080 | } |
---|
1081 | |
---|
1082 | //The total number of operations is 3.0 |
---|
1083 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::xor_hl(bitblock128_t arg1) |
---|
1084 | { |
---|
1085 | return simd_xor(simd128<16>::srli<(8)>(arg1), simd_and(arg1, simd128<16>::lomask())); |
---|
1086 | } |
---|
1087 | |
---|
1088 | //The total number of operations is 3.0 |
---|
1089 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::xor_hl(bitblock128_t arg1) |
---|
1090 | { |
---|
1091 | return simd_xor(simd128<32>::srli<(16)>(arg1), simd_and(arg1, simd128<32>::lomask())); |
---|
1092 | } |
---|
1093 | |
---|
1094 | //The total number of operations is 3.0 |
---|
1095 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::xor_hl(bitblock128_t arg1) |
---|
1096 | { |
---|
1097 | return simd_xor(simd128<64>::srli<(32)>(arg1), simd_and(arg1, simd128<64>::lomask())); |
---|
1098 | } |
---|
1099 | |
---|
1100 | //The total number of operations is 4.33333333333 |
---|
1101 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::xor_hl(bitblock128_t arg1) |
---|
1102 | { |
---|
1103 | return simd_xor(simd128<128>::srli<(64)>(arg1), simd_and(arg1, simd128<128>::lomask())); |
---|
1104 | } |
---|
1105 | |
---|
1106 | //The total number of operations is 0 |
---|
1107 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::popcount(bitblock128_t arg1) |
---|
1108 | { |
---|
1109 | return arg1; |
---|
1110 | } |
---|
1111 | |
---|
1112 | //The total number of operations is 3.0 |
---|
1113 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::popcount(bitblock128_t arg1) |
---|
1114 | { |
---|
1115 | return simd128<2>::add_hl(simd128<(1)>::popcount(arg1)); |
---|
1116 | } |
---|
1117 | |
---|
1118 | //The total number of operations is 7.0 |
---|
1119 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::popcount(bitblock128_t arg1) |
---|
1120 | { |
---|
1121 | return simd128<4>::add_hl(simd128<(2)>::popcount(arg1)); |
---|
1122 | } |
---|
1123 | |
---|
1124 | //The total number of operations is 11.0 |
---|
1125 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::popcount(bitblock128_t arg1) |
---|
1126 | { |
---|
1127 | return simd128<8>::add_hl(simd128<(4)>::popcount(arg1)); |
---|
1128 | } |
---|
1129 | |
---|
1130 | //The total number of operations is 14.0 |
---|
1131 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::popcount(bitblock128_t arg1) |
---|
1132 | { |
---|
1133 | return simd128<16>::add_hl(simd128<(8)>::popcount(arg1)); |
---|
1134 | } |
---|
1135 | |
---|
1136 | //The total number of operations is 17.0 |
---|
1137 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::popcount(bitblock128_t arg1) |
---|
1138 | { |
---|
1139 | return simd128<32>::add_hl(simd128<(16)>::popcount(arg1)); |
---|
1140 | } |
---|
1141 | |
---|
1142 | //The total number of operations is 12.0 |
---|
1143 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::popcount(bitblock128_t arg1) |
---|
1144 | { |
---|
1145 | return _mm_sad_epu8(simd128<8>::popcount(arg1), simd128<8>::constant<0>()); |
---|
1146 | } |
---|
1147 | |
---|
1148 | //The total number of operations is 16.3333333333 |
---|
1149 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::popcount(bitblock128_t arg1) |
---|
1150 | { |
---|
1151 | bitblock128_t tmpAns = simd128<(64)>::popcount(arg1); |
---|
1152 | return simd128<(64)>::add(simd_and(tmpAns, simd128<128>::lomask()), simd128<128>::srli<(64)>(tmpAns)); |
---|
1153 | } |
---|
1154 | |
---|
1155 | //The total number of operations is 6.33333333333 |
---|
1156 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::neg(bitblock128_t arg1) |
---|
1157 | { |
---|
1158 | return simd128<1>::ifh(simd128<2>::himask(), simd_xor(arg1, simd128<128>::slli<1>(arg1)), arg1); |
---|
1159 | } |
---|
1160 | |
---|
1161 | //The total number of operations is 6.0 |
---|
1162 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::neg(bitblock128_t arg1) |
---|
1163 | { |
---|
1164 | return simd128<4>::sub(simd128<4>::constant<0>(), arg1); |
---|
1165 | } |
---|
1166 | |
---|
1167 | //The total number of operations is 1.0 |
---|
1168 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::neg(bitblock128_t arg1) |
---|
1169 | { |
---|
1170 | return simd128<8>::sub(simd128<8>::constant<0>(), arg1); |
---|
1171 | } |
---|
1172 | |
---|
1173 | //The total number of operations is 1.0 |
---|
1174 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::neg(bitblock128_t arg1) |
---|
1175 | { |
---|
1176 | return simd128<16>::sub(simd128<16>::constant<0>(), arg1); |
---|
1177 | } |
---|
1178 | |
---|
1179 | //The total number of operations is 1.0 |
---|
1180 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::neg(bitblock128_t arg1) |
---|
1181 | { |
---|
1182 | return _mm_sign_epi32(arg1, simd128<32>::constant<-1>()); |
---|
1183 | } |
---|
1184 | |
---|
1185 | //The total number of operations is 1.0 |
---|
1186 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::neg(bitblock128_t arg1) |
---|
1187 | { |
---|
1188 | return simd128<64>::sub(simd128<64>::constant<0>(), arg1); |
---|
1189 | } |
---|
1190 | |
---|
1191 | //The total number of operations is 9.33333333333 |
---|
1192 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::neg(bitblock128_t arg1) |
---|
1193 | { |
---|
1194 | return simd128<128>::sub(simd128<128>::constant<0>(), arg1); |
---|
1195 | } |
---|
1196 | |
---|
1197 | //The total number of operations is 2.0 |
---|
1198 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::slli(bitblock128_t arg1) |
---|
1199 | { |
---|
1200 | return simd_and(simd128<32>::slli<sh>(arg1), simd128<2>::constant<(((3)<<sh)&(3))>()); |
---|
1201 | } |
---|
1202 | |
---|
1203 | //The total number of operations is 2.0 |
---|
1204 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::slli(bitblock128_t arg1) |
---|
1205 | { |
---|
1206 | return simd_and(simd128<32>::slli<sh>(arg1), simd128<4>::constant<(((15)<<sh)&(15))>()); |
---|
1207 | } |
---|
1208 | |
---|
1209 | //The total number of operations is 2.0 |
---|
1210 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::slli(bitblock128_t arg1) |
---|
1211 | { |
---|
1212 | return simd_and(simd128<32>::slli<sh>(arg1), simd128<8>::constant<(((255)<<sh)&(255))>()); |
---|
1213 | } |
---|
1214 | |
---|
1215 | //The total number of operations is 1.0 |
---|
1216 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::slli(bitblock128_t arg1) |
---|
1217 | { |
---|
1218 | return _mm_slli_epi16(arg1, (int32_t)(sh)); |
---|
1219 | } |
---|
1220 | |
---|
1221 | //The total number of operations is 1.0 |
---|
1222 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::slli(bitblock128_t arg1) |
---|
1223 | { |
---|
1224 | return _mm_slli_epi32(arg1, (int32_t)(sh)); |
---|
1225 | } |
---|
1226 | |
---|
1227 | //The total number of operations is 1.0 |
---|
1228 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::slli(bitblock128_t arg1) |
---|
1229 | { |
---|
1230 | return _mm_slli_epi64(arg1, (int32_t)(sh)); |
---|
1231 | } |
---|
1232 | |
---|
1233 | //The total number of operations is 2.33333333333 |
---|
1234 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::slli(bitblock128_t arg1) |
---|
1235 | { |
---|
1236 | return (((sh%8) == 0) ? _mm_slli_si128(arg1, (int32_t)((sh/8))) : ((sh >= 64) ? simd128<64>::slli<(sh-64)>(_mm_slli_si128(arg1, (int32_t)(8))) : simd_or(simd128<64>::slli<sh>(arg1), _mm_slli_si128(simd128<64>::srli<(64-sh)>(arg1), (int32_t)(8))))); |
---|
1237 | } |
---|
1238 | |
---|
1239 | //The total number of operations is 3.0 |
---|
1240 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1241 | { |
---|
1242 | return simd_or(simd_and(arg2, arg1), simd_andc(arg3, arg1)); |
---|
1243 | } |
---|
1244 | |
---|
1245 | //The total number of operations is 8.0 |
---|
1246 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1247 | { |
---|
1248 | return simd128<(1)>::ifh(simd128<1>::ifh(simd128<2>::himask(), arg1, simd128<2>::srli<(1)>(arg1)), arg2, arg3); |
---|
1249 | } |
---|
1250 | |
---|
1251 | //The total number of operations is 13.0 |
---|
1252 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1253 | { |
---|
1254 | return simd128<1>::ifh(simd128<4>::gt(simd128<4>::constant<0>(), arg1), arg2, arg3); |
---|
1255 | } |
---|
1256 | |
---|
1257 | //The total number of operations is 1.0 |
---|
1258 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1259 | { |
---|
1260 | return _mm_blendv_epi8(arg3, arg2, arg1); |
---|
1261 | } |
---|
1262 | |
---|
1263 | //The total number of operations is 4.0 |
---|
1264 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1265 | { |
---|
1266 | return simd128<1>::ifh(simd128<16>::gt(simd128<16>::constant<0>(), arg1), arg2, arg3); |
---|
1267 | } |
---|
1268 | |
---|
1269 | //The total number of operations is 4.0 |
---|
1270 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1271 | { |
---|
1272 | return simd128<1>::ifh(simd128<32>::gt(simd128<32>::constant<0>(), arg1), arg2, arg3); |
---|
1273 | } |
---|
1274 | |
---|
1275 | //The total number of operations is 4.0 |
---|
1276 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1277 | { |
---|
1278 | return simd128<1>::ifh(simd128<64>::gt(simd128<64>::constant<0>(), arg1), arg2, arg3); |
---|
1279 | } |
---|
1280 | |
---|
1281 | //The total number of operations is 9.33333333333 |
---|
1282 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ifh(bitblock128_t arg1, bitblock128_t arg2, bitblock128_t arg3) |
---|
1283 | { |
---|
1284 | return simd128<(64)>::ifh(simd128<1>::ifh(simd128<128>::himask(), arg1, simd128<128>::srli<(64)>(arg1)), arg2, arg3); |
---|
1285 | } |
---|
1286 | |
---|
1287 | //The total number of operations is 1.0 |
---|
1288 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1289 | { |
---|
1290 | return simd_xor(arg1, arg2); |
---|
1291 | } |
---|
1292 | |
---|
1293 | //The total number of operations is 9.33333333333 |
---|
1294 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1295 | { |
---|
1296 | bitblock128_t tmp = simd_xor(arg1, arg2); |
---|
1297 | return simd128<1>::ifh(simd128<2>::himask(), simd_xor(tmp, simd128<128>::slli<1>(simd_and(simd_not(arg1), arg2))), tmp); |
---|
1298 | } |
---|
1299 | |
---|
1300 | //The total number of operations is 6.0 |
---|
1301 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1302 | { |
---|
1303 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::sub(arg1, simd_and(simd128<(8)>::himask(), arg2)), simd128<(8)>::sub(arg1, arg2)); |
---|
1304 | } |
---|
1305 | |
---|
1306 | //The total number of operations is 1.0 |
---|
1307 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1308 | { |
---|
1309 | return _mm_sub_epi8(arg1, arg2); |
---|
1310 | } |
---|
1311 | |
---|
1312 | //The total number of operations is 1.0 |
---|
1313 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1314 | { |
---|
1315 | return _mm_sub_epi16(arg1, arg2); |
---|
1316 | } |
---|
1317 | |
---|
1318 | //The total number of operations is 1.0 |
---|
1319 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1320 | { |
---|
1321 | return _mm_sub_epi32(arg1, arg2); |
---|
1322 | } |
---|
1323 | |
---|
1324 | //The total number of operations is 1.0 |
---|
1325 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1326 | { |
---|
1327 | return _mm_sub_epi64(arg1, arg2); |
---|
1328 | } |
---|
1329 | |
---|
1330 | //The total number of operations is 9.33333333333 |
---|
1331 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::sub(bitblock128_t arg1, bitblock128_t arg2) |
---|
1332 | { |
---|
1333 | bitblock128_t partial = simd128<(64)>::sub(arg1, arg2); |
---|
1334 | bitblock128_t borrowMask = simd_or(simd_andc(arg2, arg1), simd_andc(partial, simd_xor(arg1, arg2))); |
---|
1335 | bitblock128_t borrow = simd128<128>::slli<(64)>(simd128<(64)>::srli<(63)>(borrowMask)); |
---|
1336 | return simd128<(64)>::sub(partial, borrow); |
---|
1337 | } |
---|
1338 | |
---|
1339 | //The total number of operations is 3.0 |
---|
1340 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::add_hl(bitblock128_t arg1) |
---|
1341 | { |
---|
1342 | return simd128<16>::sub(arg1, simd_and(simd128<2>::lomask(), simd128<16>::srli<1>(arg1))); |
---|
1343 | } |
---|
1344 | |
---|
1345 | //The total number of operations is 4.0 |
---|
1346 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::add_hl(bitblock128_t arg1) |
---|
1347 | { |
---|
1348 | return simd128<(8)>::add(simd128<4>::srli<(2)>(arg1), simd_and(arg1, simd128<4>::lomask())); |
---|
1349 | } |
---|
1350 | |
---|
1351 | //The total number of operations is 4.0 |
---|
1352 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::add_hl(bitblock128_t arg1) |
---|
1353 | { |
---|
1354 | return simd128<(16)>::add(simd128<8>::srli<(4)>(arg1), simd_and(arg1, simd128<8>::lomask())); |
---|
1355 | } |
---|
1356 | |
---|
1357 | //The total number of operations is 3.0 |
---|
1358 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::add_hl(bitblock128_t arg1) |
---|
1359 | { |
---|
1360 | return simd128<(32)>::add(simd128<16>::srli<(8)>(arg1), simd_and(arg1, simd128<16>::lomask())); |
---|
1361 | } |
---|
1362 | |
---|
1363 | //The total number of operations is 3.0 |
---|
1364 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::add_hl(bitblock128_t arg1) |
---|
1365 | { |
---|
1366 | return simd128<(64)>::add(simd128<32>::srli<(16)>(arg1), simd_and(arg1, simd128<32>::lomask())); |
---|
1367 | } |
---|
1368 | |
---|
1369 | //The total number of operations is 3.0 |
---|
1370 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::add_hl(bitblock128_t arg1) |
---|
1371 | { |
---|
1372 | return simd128<64>::add(simd128<64>::srli<(32)>(arg1), simd_and(arg1, simd128<64>::lomask())); |
---|
1373 | } |
---|
1374 | |
---|
1375 | //The total number of operations is 12.6666666667 |
---|
1376 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::add_hl(bitblock128_t arg1) |
---|
1377 | { |
---|
1378 | return simd128<128>::add(simd128<128>::srli<(64)>(arg1), simd_and(arg1, simd128<128>::lomask())); |
---|
1379 | } |
---|
1380 | |
---|
1381 | //The total number of operations is 10.0 |
---|
1382 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask) |
---|
1383 | { |
---|
1384 | return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, simd_and(_mm_srli_si128(shift_mask, (int32_t)(8)), _mm_cvtsi32_si128((int32_t)(63)))), _mm_srl_epi64(arg1, simd_and(shift_mask, _mm_cvtsi32_si128((int32_t)(63))))); |
---|
1385 | } |
---|
1386 | |
---|
1387 | //The total number of operations is 13.0 |
---|
1388 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srl(bitblock128_t arg1, bitblock128_t shift_mask) |
---|
1389 | { |
---|
1390 | bitblock128_t shift = simd_and(shift_mask, _mm_cvtsi32_si128((int32_t)(127))); |
---|
1391 | return simd_or(_mm_srl_epi64(arg1, shift), simd_or(_mm_srli_si128(_mm_srl_epi64(arg1, simd128<32>::sub(shift, _mm_cvtsi32_si128((int32_t)(64)))), (int32_t)(8)), _mm_srli_si128(_mm_sll_epi64(arg1, simd128<32>::sub(_mm_cvtsi32_si128((int32_t)(64)), shift)), (int32_t)(8)))); |
---|
1392 | } |
---|
1393 | |
---|
1394 | //The total number of operations is 0 |
---|
1395 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::constant() |
---|
1396 | { |
---|
1397 | return simd128<32>::constant<(-1*val)>(); |
---|
1398 | } |
---|
1399 | |
---|
1400 | //The total number of operations is 0 |
---|
1401 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant() |
---|
1402 | { |
---|
1403 | return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>()); |
---|
1404 | } |
---|
1405 | |
---|
1406 | //The total number of operations is 0 |
---|
1407 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant() |
---|
1408 | { |
---|
1409 | return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>()); |
---|
1410 | } |
---|
1411 | |
---|
1412 | //The total number of operations is 0 |
---|
1413 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::constant() |
---|
1414 | { |
---|
1415 | return _mm_set1_epi8((int32_t)(val)); |
---|
1416 | } |
---|
1417 | |
---|
1418 | //The total number of operations is 0 |
---|
1419 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::constant() |
---|
1420 | { |
---|
1421 | return _mm_set1_epi16((int32_t)(val)); |
---|
1422 | } |
---|
1423 | |
---|
1424 | //The total number of operations is 0 |
---|
1425 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant() |
---|
1426 | { |
---|
1427 | return _mm_set1_epi32((int32_t)(val)); |
---|
1428 | } |
---|
1429 | |
---|
1430 | //The total number of operations is 0 |
---|
1431 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::constant() |
---|
1432 | { |
---|
1433 | return _mm_set_epi32((int32_t)((val>>32)), (int32_t)(val), (int32_t)((val>>32)), (int32_t)(val)); |
---|
1434 | } |
---|
1435 | |
---|
1436 | //The total number of operations is 0 |
---|
1437 | template <> template <uint64_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::constant() |
---|
1438 | { |
---|
1439 | return _mm_set_epi32((int32_t)(0), (int32_t)(0), (int32_t)((val>>32)), (int32_t)(val)); |
---|
1440 | } |
---|
1441 | |
---|
1442 | //The total number of operations is 1.0 |
---|
1443 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1444 | { |
---|
1445 | return simd_or(arg1, arg2); |
---|
1446 | } |
---|
1447 | |
---|
1448 | //The total number of operations is 16.6666666667 |
---|
1449 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1450 | { |
---|
1451 | bitblock128_t tmp1 = simd128<128>::srli<1>(arg1); |
---|
1452 | bitblock128_t tmp2 = simd128<128>::srli<1>(arg2); |
---|
1453 | return simd128<1>::ifh(simd128<2>::himask(), simd_or(arg1, arg2), simd_or(simd_and(arg1, simd_and(tmp1, simd_not(tmp2))), simd_and(arg2, simd_or(simd_and(simd_not(tmp1), tmp2), arg1)))); |
---|
1454 | } |
---|
1455 | |
---|
1456 | //The total number of operations is 9.0 |
---|
1457 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1458 | { |
---|
1459 | bitblock128_t high_bit = simd128<4>::constant<(8)>(); |
---|
1460 | return simd_xor(simd128<4>::umin(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)), high_bit); |
---|
1461 | } |
---|
1462 | |
---|
1463 | //The total number of operations is 1.0 |
---|
1464 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1465 | { |
---|
1466 | return _mm_min_epi8(arg1, arg2); |
---|
1467 | } |
---|
1468 | |
---|
1469 | //The total number of operations is 1.0 |
---|
1470 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1471 | { |
---|
1472 | return _mm_min_epi16(arg1, arg2); |
---|
1473 | } |
---|
1474 | |
---|
1475 | //The total number of operations is 1.0 |
---|
1476 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1477 | { |
---|
1478 | return _mm_min_epi32(arg1, arg2); |
---|
1479 | } |
---|
1480 | |
---|
1481 | //The total number of operations is 4.0 |
---|
1482 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1483 | { |
---|
1484 | return simd128<1>::ifh(simd128<64>::gt(arg1, arg2), arg2, arg1); |
---|
1485 | } |
---|
1486 | |
---|
1487 | //The total number of operations is 26.6666666667 |
---|
1488 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::min(bitblock128_t arg1, bitblock128_t arg2) |
---|
1489 | { |
---|
1490 | bitblock128_t hiAns = simd128<(64)>::min(arg1, arg2); |
---|
1491 | bitblock128_t loAns = simd128<(64)>::umin(arg1, arg2); |
---|
1492 | bitblock128_t eqMask1 = simd128<128>::srli<(64)>(simd128<(64)>::eq(hiAns, arg1)); |
---|
1493 | bitblock128_t eqMask2 = simd128<128>::srli<(64)>(simd128<(64)>::eq(hiAns, arg2)); |
---|
1494 | return simd128<1>::ifh(simd128<128>::himask(), hiAns, simd128<1>::ifh(eqMask1, simd128<1>::ifh(eqMask2, loAns, arg1), arg2)); |
---|
1495 | } |
---|
1496 | |
---|
1497 | //The total number of operations is 0 |
---|
1498 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::lomask() |
---|
1499 | { |
---|
1500 | return simd128<2>::constant<(1)>(); |
---|
1501 | } |
---|
1502 | |
---|
1503 | //The total number of operations is 0 |
---|
1504 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::lomask() |
---|
1505 | { |
---|
1506 | return simd128<4>::constant<(3)>(); |
---|
1507 | } |
---|
1508 | |
---|
1509 | //The total number of operations is 0 |
---|
1510 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::lomask() |
---|
1511 | { |
---|
1512 | return simd128<8>::constant<(15)>(); |
---|
1513 | } |
---|
1514 | |
---|
1515 | //The total number of operations is 0 |
---|
1516 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::lomask() |
---|
1517 | { |
---|
1518 | return simd128<16>::constant<(255)>(); |
---|
1519 | } |
---|
1520 | |
---|
1521 | //The total number of operations is 0 |
---|
1522 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::lomask() |
---|
1523 | { |
---|
1524 | return simd128<32>::constant<(65535)>(); |
---|
1525 | } |
---|
1526 | |
---|
1527 | //The total number of operations is 0 |
---|
1528 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::lomask() |
---|
1529 | { |
---|
1530 | return _mm_set_epi32((int32_t)(0), (int32_t)(-1), (int32_t)(0), (int32_t)(-1)); |
---|
1531 | } |
---|
1532 | |
---|
1533 | //The total number of operations is 0 |
---|
1534 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::lomask() |
---|
1535 | { |
---|
1536 | return _mm_set_epi32((int32_t)(0), (int32_t)(0), (int32_t)(-1), (int32_t)(-1)); |
---|
1537 | } |
---|
1538 | |
---|
1539 | //The total number of operations is 1.0 |
---|
1540 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1541 | { |
---|
1542 | return simd_and(arg1, arg2); |
---|
1543 | } |
---|
1544 | |
---|
1545 | //The total number of operations is 16.0 |
---|
1546 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1547 | { |
---|
1548 | return simd_or(simd_and(simd128<(4)>::himask(), simd128<(4)>::umin(arg1, arg2)), simd128<(4)>::umin(simd_and(simd128<(4)>::lomask(), arg1), simd_and(simd128<(4)>::lomask(), arg2))); |
---|
1549 | } |
---|
1550 | |
---|
1551 | //The total number of operations is 6.0 |
---|
1552 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1553 | { |
---|
1554 | return simd_or(simd_and(simd128<(8)>::himask(), simd128<(8)>::umin(arg1, arg2)), simd128<(8)>::umin(simd_and(simd128<(8)>::lomask(), arg1), simd_and(simd128<(8)>::lomask(), arg2))); |
---|
1555 | } |
---|
1556 | |
---|
1557 | //The total number of operations is 1.0 |
---|
1558 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1559 | { |
---|
1560 | return _mm_min_epu8(arg1, arg2); |
---|
1561 | } |
---|
1562 | |
---|
1563 | //The total number of operations is 1.0 |
---|
1564 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1565 | { |
---|
1566 | return _mm_min_epu16(arg1, arg2); |
---|
1567 | } |
---|
1568 | |
---|
1569 | //The total number of operations is 1.0 |
---|
1570 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1571 | { |
---|
1572 | return _mm_min_epu32(arg1, arg2); |
---|
1573 | } |
---|
1574 | |
---|
1575 | //The total number of operations is 7.0 |
---|
1576 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1577 | { |
---|
1578 | bitblock128_t high_bit = simd128<64>::constant<(9223372036854775808ULL)>(); |
---|
1579 | return simd_xor(simd128<64>::min(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)), high_bit); |
---|
1580 | } |
---|
1581 | |
---|
1582 | //The total number of operations is 22.6666666667 |
---|
1583 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::umin(bitblock128_t arg1, bitblock128_t arg2) |
---|
1584 | { |
---|
1585 | bitblock128_t tmpAns = simd128<(64)>::umin(arg1, arg2); |
---|
1586 | bitblock128_t eqMask1 = simd128<128>::srli<(64)>(simd128<(64)>::eq(tmpAns, arg1)); |
---|
1587 | bitblock128_t eqMask2 = simd128<128>::srli<(64)>(simd128<(64)>::eq(tmpAns, arg2)); |
---|
1588 | return simd128<1>::ifh(simd128<128>::himask(), tmpAns, simd128<1>::ifh(eqMask1, simd128<1>::ifh(eqMask2, tmpAns, arg1), arg2)); |
---|
1589 | } |
---|
1590 | |
---|
1591 | //The total number of operations is 7.33333333333 |
---|
1592 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::abs(bitblock128_t arg1) |
---|
1593 | { |
---|
1594 | return simd128<1>::ifh(simd128<2>::himask(), simd_and(arg1, simd128<128>::slli<1>(simd_not(arg1))), arg1); |
---|
1595 | } |
---|
1596 | |
---|
1597 | //The total number of operations is 19.0 |
---|
1598 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::abs(bitblock128_t arg1) |
---|
1599 | { |
---|
1600 | bitblock128_t gtMask = simd128<4>::gt(arg1, simd128<4>::constant<0>()); |
---|
1601 | return simd128<1>::ifh(gtMask, arg1, simd128<4>::sub(gtMask, arg1)); |
---|
1602 | } |
---|
1603 | |
---|
1604 | //The total number of operations is 1.0 |
---|
1605 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::abs(bitblock128_t arg1) |
---|
1606 | { |
---|
1607 | return _mm_abs_epi8(arg1); |
---|
1608 | } |
---|
1609 | |
---|
1610 | //The total number of operations is 1.0 |
---|
1611 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::abs(bitblock128_t arg1) |
---|
1612 | { |
---|
1613 | return _mm_abs_epi16(arg1); |
---|
1614 | } |
---|
1615 | |
---|
1616 | //The total number of operations is 1.0 |
---|
1617 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::abs(bitblock128_t arg1) |
---|
1618 | { |
---|
1619 | return _mm_abs_epi32(arg1); |
---|
1620 | } |
---|
1621 | |
---|
1622 | //The total number of operations is 5.0 |
---|
1623 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::abs(bitblock128_t arg1) |
---|
1624 | { |
---|
1625 | bitblock128_t gtMask = simd128<64>::gt(arg1, simd128<64>::constant<0>()); |
---|
1626 | return simd128<1>::ifh(gtMask, arg1, simd128<64>::sub(gtMask, arg1)); |
---|
1627 | } |
---|
1628 | |
---|
1629 | //The total number of operations is 28.0 |
---|
1630 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::abs(bitblock128_t arg1) |
---|
1631 | { |
---|
1632 | bitblock128_t eqMask = simd128<128>::eq(simd128<1>::ifh(simd128<128>::himask(), simd128<(64)>::abs(arg1), arg1), arg1); |
---|
1633 | return simd128<1>::ifh(eqMask, arg1, simd128<128>::sub(eqMask, arg1)); |
---|
1634 | } |
---|
1635 | |
---|
1636 | //The total number of operations is 2.0 |
---|
1637 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1638 | { |
---|
1639 | return simd_not(simd_xor(arg1, arg2)); |
---|
1640 | } |
---|
1641 | |
---|
1642 | //The total number of operations is 8.0 |
---|
1643 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1644 | { |
---|
1645 | bitblock128_t tmpAns = simd128<(1)>::eq(arg1, arg2); |
---|
1646 | bitblock128_t loMask = simd_and(tmpAns, simd128<2>::srli<(1)>(tmpAns)); |
---|
1647 | bitblock128_t hiMask = simd128<2>::slli<(1)>(loMask); |
---|
1648 | return simd_or(loMask, hiMask); |
---|
1649 | } |
---|
1650 | |
---|
1651 | //The total number of operations is 9.0 |
---|
1652 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1653 | { |
---|
1654 | return simd_or(simd_and(simd128<(8)>::himask(), simd128<(8)>::eq(simd_and(simd128<(8)>::himask(), arg1), simd_and(simd128<(8)>::himask(), arg2))), simd_and(simd128<(8)>::lomask(), simd128<(8)>::eq(simd_and(simd128<(8)>::lomask(), arg1), simd_and(simd128<(8)>::lomask(), arg2)))); |
---|
1655 | } |
---|
1656 | |
---|
1657 | //The total number of operations is 1.0 |
---|
1658 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1659 | { |
---|
1660 | return _mm_cmpeq_epi8(arg1, arg2); |
---|
1661 | } |
---|
1662 | |
---|
1663 | //The total number of operations is 1.0 |
---|
1664 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1665 | { |
---|
1666 | return _mm_cmpeq_epi16(arg1, arg2); |
---|
1667 | } |
---|
1668 | |
---|
1669 | //The total number of operations is 1.0 |
---|
1670 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1671 | { |
---|
1672 | return _mm_cmpeq_epi32(arg1, arg2); |
---|
1673 | } |
---|
1674 | |
---|
1675 | //The total number of operations is 1.0 |
---|
1676 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1677 | { |
---|
1678 | return _mm_cmpeq_epi64(arg1, arg2); |
---|
1679 | } |
---|
1680 | |
---|
1681 | //The total number of operations is 7.66666666667 |
---|
1682 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::eq(bitblock128_t arg1, bitblock128_t arg2) |
---|
1683 | { |
---|
1684 | bitblock128_t tmpAns = simd128<(64)>::eq(arg1, arg2); |
---|
1685 | bitblock128_t loMask = simd_and(tmpAns, simd128<128>::srli<(64)>(tmpAns)); |
---|
1686 | bitblock128_t hiMask = simd128<128>::slli<(64)>(loMask); |
---|
1687 | return simd_or(loMask, hiMask); |
---|
1688 | } |
---|
1689 | |
---|
1690 | //The total number of operations is 4.0 |
---|
1691 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::srai(bitblock128_t arg1) |
---|
1692 | { |
---|
1693 | return ((sh == 0) ? arg1 : simd_or(simd_and(simd128<2>::himask(), arg1), simd128<2>::srli<1>(arg1))); |
---|
1694 | } |
---|
1695 | |
---|
1696 | //The total number of operations is 10.0 |
---|
1697 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::srai(bitblock128_t arg1) |
---|
1698 | { |
---|
1699 | bitblock128_t tmp = simd128<4>::srli<((sh >= 4) ? (3) : ((sh < 0) ? 0 : sh))>(arg1); |
---|
1700 | return simd_or(tmp, simd128<4>::sub(simd128<4>::constant<0>(), simd_and(simd128<4>::constant<(1<<((4-((sh >= 4) ? (3) : ((sh < 0) ? 0 : sh)))-1))>(), tmp))); |
---|
1701 | } |
---|
1702 | |
---|
1703 | //The total number of operations is 5.0 |
---|
1704 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::srai(bitblock128_t arg1) |
---|
1705 | { |
---|
1706 | bitblock128_t tmp = simd128<8>::srli<((sh >= 8) ? (7) : ((sh < 0) ? 0 : sh))>(arg1); |
---|
1707 | return simd_or(tmp, simd128<8>::sub(simd128<8>::constant<0>(), simd_and(simd128<8>::constant<(1<<((8-((sh >= 8) ? (7) : ((sh < 0) ? 0 : sh)))-1))>(), tmp))); |
---|
1708 | } |
---|
1709 | |
---|
1710 | //The total number of operations is 1.0 |
---|
1711 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::srai(bitblock128_t arg1) |
---|
1712 | { |
---|
1713 | return _mm_srai_epi16(arg1, (int32_t)(sh)); |
---|
1714 | } |
---|
1715 | |
---|
1716 | //The total number of operations is 1.0 |
---|
1717 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::srai(bitblock128_t arg1) |
---|
1718 | { |
---|
1719 | return _mm_srai_epi32(arg1, (int32_t)(sh)); |
---|
1720 | } |
---|
1721 | |
---|
1722 | //The total number of operations is 4.5 |
---|
1723 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srai(bitblock128_t arg1) |
---|
1724 | { |
---|
1725 | return simd_or(simd_and(simd128<64>::himask(), simd128<(32)>::srai<((sh < (32)) ? sh : (32))>(arg1)), ((sh <= (32)) ? simd128<64>::srli<sh>(arg1) : simd128<(32)>::srai<(sh-(32))>(simd128<64>::srli<(32)>(arg1)))); |
---|
1726 | } |
---|
1727 | |
---|
1728 | //The total number of operations is 11.0833333333 |
---|
1729 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srai(bitblock128_t arg1) |
---|
1730 | { |
---|
1731 | return simd_or(simd_and(simd128<128>::himask(), simd128<(64)>::srai<((sh < (64)) ? sh : (64))>(arg1)), ((sh <= (64)) ? simd128<128>::srli<sh>(arg1) : simd128<(64)>::srai<(sh-(64))>(simd128<128>::srli<(64)>(arg1)))); |
---|
1732 | } |
---|
1733 | |
---|
1734 | //The total number of operations is 0 |
---|
1735 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::himask() |
---|
1736 | { |
---|
1737 | return simd128<2>::constant<(2)>(); |
---|
1738 | } |
---|
1739 | |
---|
1740 | //The total number of operations is 0 |
---|
1741 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::himask() |
---|
1742 | { |
---|
1743 | return simd128<4>::constant<(12)>(); |
---|
1744 | } |
---|
1745 | |
---|
1746 | //The total number of operations is 0 |
---|
1747 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::himask() |
---|
1748 | { |
---|
1749 | return simd128<8>::constant<(240)>(); |
---|
1750 | } |
---|
1751 | |
---|
1752 | //The total number of operations is 0 |
---|
1753 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::himask() |
---|
1754 | { |
---|
1755 | return simd128<16>::constant<(65280)>(); |
---|
1756 | } |
---|
1757 | |
---|
1758 | //The total number of operations is 0 |
---|
1759 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::himask() |
---|
1760 | { |
---|
1761 | return simd128<32>::constant<-65536>(); |
---|
1762 | } |
---|
1763 | |
---|
1764 | //The total number of operations is 0 |
---|
1765 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::himask() |
---|
1766 | { |
---|
1767 | return _mm_set_epi32((int32_t)(-1), (int32_t)(0), (int32_t)(-1), (int32_t)(0)); |
---|
1768 | } |
---|
1769 | |
---|
1770 | //The total number of operations is 0 |
---|
1771 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::himask() |
---|
1772 | { |
---|
1773 | return _mm_set_epi32((int32_t)(-1), (int32_t)(-1), (int32_t)(0), (int32_t)(0)); |
---|
1774 | } |
---|
1775 | |
---|
1776 | //The total number of operations is 1.0 |
---|
1777 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1778 | { |
---|
1779 | return simd_xor(arg1, arg2); |
---|
1780 | } |
---|
1781 | |
---|
1782 | //The total number of operations is 8.33333333333 |
---|
1783 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1784 | { |
---|
1785 | bitblock128_t tmp = simd_xor(arg1, arg2); |
---|
1786 | return simd128<1>::ifh(simd128<2>::himask(), simd_xor(tmp, simd128<128>::slli<1>(simd_and(arg1, arg2))), tmp); |
---|
1787 | } |
---|
1788 | |
---|
1789 | //The total number of operations is 6.0 |
---|
1790 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1791 | { |
---|
1792 | return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::add(arg1, simd_and(simd128<(8)>::himask(), arg2)), simd128<(8)>::add(arg1, arg2)); |
---|
1793 | } |
---|
1794 | |
---|
1795 | //The total number of operations is 1.0 |
---|
1796 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1797 | { |
---|
1798 | return _mm_add_epi8(arg1, arg2); |
---|
1799 | } |
---|
1800 | |
---|
1801 | //The total number of operations is 1.0 |
---|
1802 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1803 | { |
---|
1804 | return _mm_add_epi16(arg1, arg2); |
---|
1805 | } |
---|
1806 | |
---|
1807 | //The total number of operations is 1.0 |
---|
1808 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1809 | { |
---|
1810 | return _mm_add_epi32(arg1, arg2); |
---|
1811 | } |
---|
1812 | |
---|
1813 | //The total number of operations is 1.0 |
---|
1814 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1815 | { |
---|
1816 | return _mm_add_epi64(arg1, arg2); |
---|
1817 | } |
---|
1818 | |
---|
1819 | //The total number of operations is 9.33333333333 |
---|
1820 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::add(bitblock128_t arg1, bitblock128_t arg2) |
---|
1821 | { |
---|
1822 | bitblock128_t partial = simd128<(64)>::add(arg1, arg2); |
---|
1823 | bitblock128_t carryMask = simd_or(simd_and(arg1, arg2), simd_andc(simd_xor(arg1, arg2), partial)); |
---|
1824 | bitblock128_t carry = simd128<128>::slli<(64)>(simd128<(64)>::srli<(63)>(carryMask)); |
---|
1825 | return simd128<(64)>::add(partial, carry); |
---|
1826 | } |
---|
1827 | |
---|
1828 | //The total number of operations is 1.0 |
---|
1829 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1830 | { |
---|
1831 | return simd_or(arg1, arg2); |
---|
1832 | } |
---|
1833 | |
---|
1834 | //The total number of operations is 15.6666666667 |
---|
1835 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1836 | { |
---|
1837 | return simd128<1>::ifh(simd128<2>::himask(), simd_or(arg1, arg2), simd_or(simd_and(arg2, simd128<128>::srli<1>(simd_or(simd_not(arg1), arg2))), simd_and(arg1, simd128<128>::srli<1>(simd_or(arg1, simd_not(arg2)))))); |
---|
1838 | } |
---|
1839 | |
---|
1840 | //The total number of operations is 6.0 |
---|
1841 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1842 | { |
---|
1843 | return simd_or(simd_and(simd128<(8)>::himask(), simd128<(8)>::umax(arg1, arg2)), simd128<(8)>::umax(simd_and(simd128<(8)>::lomask(), arg1), simd_and(simd128<(8)>::lomask(), arg2))); |
---|
1844 | } |
---|
1845 | |
---|
1846 | //The total number of operations is 1.0 |
---|
1847 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1848 | { |
---|
1849 | return _mm_max_epu8(arg1, arg2); |
---|
1850 | } |
---|
1851 | |
---|
1852 | //The total number of operations is 1.0 |
---|
1853 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1854 | { |
---|
1855 | return _mm_max_epu16(arg1, arg2); |
---|
1856 | } |
---|
1857 | |
---|
1858 | //The total number of operations is 1.0 |
---|
1859 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1860 | { |
---|
1861 | return _mm_max_epu32(arg1, arg2); |
---|
1862 | } |
---|
1863 | |
---|
1864 | //The total number of operations is 7.0 |
---|
1865 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1866 | { |
---|
1867 | bitblock128_t high_bit = simd128<64>::constant<(9223372036854775808ULL)>(); |
---|
1868 | return simd_xor(simd128<64>::max(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit)), high_bit); |
---|
1869 | } |
---|
1870 | |
---|
1871 | //The total number of operations is 22.6666666667 |
---|
1872 | template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::umax(bitblock128_t arg1, bitblock128_t arg2) |
---|
1873 | { |
---|
1874 | bitblock128_t tmpAns = simd128<(64)>::umax(arg1, arg2); |
---|
1875 | bitblock128_t eqMask1 = simd128<128>::srli<(64)>(simd128<(64)>::eq(tmpAns, arg1)); |
---|
1876 | bitblock128_t eqMask2 = simd128<128>::srli<(64)>(simd128<(64)>::eq(tmpAns, arg2)); |
---|
1877 | return simd128<1>::ifh(simd128<128>::himask(), tmpAns, simd128<1>::ifh(eqMask1, simd128<1>::ifh(eqMask2, tmpAns, arg1), arg2)); |
---|
1878 | } |
---|
1879 | |
---|
1880 | //The total number of operations is 73.0 |
---|
1881 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1882 | { |
---|
1883 | return simd128<(1)>::umin(hsimd128<2>::packh(arg1, arg2), hsimd128<2>::packl(arg1, arg2)); |
---|
1884 | } |
---|
1885 | |
---|
1886 | //The total number of operations is 66.6666666667 |
---|
1887 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1888 | { |
---|
1889 | return simd128<(2)>::umin(hsimd128<4>::packh(arg1, arg2), hsimd128<4>::packl(arg1, arg2)); |
---|
1890 | } |
---|
1891 | |
---|
1892 | //The total number of operations is 35.3333333333 |
---|
1893 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1894 | { |
---|
1895 | return simd128<(4)>::umin(hsimd128<8>::packh(arg1, arg2), hsimd128<8>::packl(arg1, arg2)); |
---|
1896 | } |
---|
1897 | |
---|
1898 | //The total number of operations is 7.0 |
---|
1899 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1900 | { |
---|
1901 | return simd128<(8)>::umin(hsimd128<16>::packh(arg1, arg2), hsimd128<16>::packl(arg1, arg2)); |
---|
1902 | } |
---|
1903 | |
---|
1904 | //The total number of operations is 7.0 |
---|
1905 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1906 | { |
---|
1907 | return simd128<(16)>::umin(hsimd128<32>::packh(arg1, arg2), hsimd128<32>::packl(arg1, arg2)); |
---|
1908 | } |
---|
1909 | |
---|
1910 | //The total number of operations is 7.0 |
---|
1911 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1912 | { |
---|
1913 | return simd128<(32)>::umin(hsimd128<64>::packh(arg1, arg2), hsimd128<64>::packl(arg1, arg2)); |
---|
1914 | } |
---|
1915 | |
---|
1916 | //The total number of operations is 17.6666666667 |
---|
1917 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::umin_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1918 | { |
---|
1919 | return simd128<(64)>::umin(hsimd128<128>::packh(arg1, arg2), hsimd128<128>::packl(arg1, arg2)); |
---|
1920 | } |
---|
1921 | |
---|
1922 | //The total number of operations is 73.0 |
---|
1923 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1924 | { |
---|
1925 | return simd128<(1)>::add(hsimd128<2>::packh(arg1, arg2), hsimd128<2>::packl(arg1, arg2)); |
---|
1926 | } |
---|
1927 | |
---|
1928 | //The total number of operations is 59.0 |
---|
1929 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1930 | { |
---|
1931 | return simd128<(2)>::add(hsimd128<4>::packh(arg1, arg2), hsimd128<4>::packl(arg1, arg2)); |
---|
1932 | } |
---|
1933 | |
---|
1934 | //The total number of operations is 35.3333333333 |
---|
1935 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1936 | { |
---|
1937 | return simd128<(4)>::add(hsimd128<8>::packh(arg1, arg2), hsimd128<8>::packl(arg1, arg2)); |
---|
1938 | } |
---|
1939 | |
---|
1940 | //The total number of operations is 7.0 |
---|
1941 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1942 | { |
---|
1943 | return simd128<(8)>::add(hsimd128<16>::packh(arg1, arg2), hsimd128<16>::packl(arg1, arg2)); |
---|
1944 | } |
---|
1945 | |
---|
1946 | //The total number of operations is 1.0 |
---|
1947 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1948 | { |
---|
1949 | return _mm_hadd_epi16(arg2, arg1); |
---|
1950 | } |
---|
1951 | |
---|
1952 | //The total number of operations is 1.0 |
---|
1953 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1954 | { |
---|
1955 | return _mm_hadd_epi32(arg2, arg1); |
---|
1956 | } |
---|
1957 | |
---|
1958 | //The total number of operations is 11.6666666667 |
---|
1959 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::add_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
1960 | { |
---|
1961 | return simd128<(64)>::add(hsimd128<128>::packh(arg1, arg2), hsimd128<128>::packl(arg1, arg2)); |
---|
1962 | } |
---|
1963 | |
---|
1964 | //The total number of operations is 108.666666667 |
---|
1965 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
1966 | { |
---|
1967 | bitblock128_t hiBound = simd128<2>::srli<1>(simd128<2>::lomask()); |
---|
1968 | bitblock128_t loBound = simd_not(hiBound); |
---|
1969 | return hsimd128<2>::packl(simd128<1>::ifh(simd128<2>::gt(arg1, hiBound), hiBound, simd128<1>::ifh(simd128<2>::gt(arg1, loBound), arg1, loBound)), simd128<1>::ifh(simd128<2>::gt(arg2, hiBound), hiBound, simd128<1>::ifh(simd128<2>::gt(arg2, loBound), arg2, loBound))); |
---|
1970 | } |
---|
1971 | |
---|
1972 | //The total number of operations is 79.3333333333 |
---|
1973 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
1974 | { |
---|
1975 | bitblock128_t hiBound = simd128<4>::srli<1>(simd128<4>::lomask()); |
---|
1976 | bitblock128_t loBound = simd_not(hiBound); |
---|
1977 | return hsimd128<4>::packl(simd128<1>::ifh(simd128<4>::gt(arg1, hiBound), hiBound, simd128<1>::ifh(simd128<4>::gt(arg1, loBound), arg1, loBound)), simd128<1>::ifh(simd128<4>::gt(arg2, hiBound), hiBound, simd128<1>::ifh(simd128<4>::gt(arg2, loBound), arg2, loBound))); |
---|
1978 | } |
---|
1979 | |
---|
1980 | //The total number of operations is 32.6666666667 |
---|
1981 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
1982 | { |
---|
1983 | bitblock128_t hiBound = simd128<8>::srli<1>(simd128<8>::lomask()); |
---|
1984 | bitblock128_t loBound = simd_not(hiBound); |
---|
1985 | return hsimd128<8>::packl(simd128<1>::ifh(simd128<8>::gt(arg1, hiBound), hiBound, simd128<1>::ifh(simd128<8>::gt(arg1, loBound), arg1, loBound)), simd128<1>::ifh(simd128<8>::gt(arg2, hiBound), hiBound, simd128<1>::ifh(simd128<8>::gt(arg2, loBound), arg2, loBound))); |
---|
1986 | } |
---|
1987 | |
---|
1988 | //The total number of operations is 1.0 |
---|
1989 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
1990 | { |
---|
1991 | return _mm_packs_epi16(arg2, arg1); |
---|
1992 | } |
---|
1993 | |
---|
1994 | //The total number of operations is 1.0 |
---|
1995 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
1996 | { |
---|
1997 | return _mm_packs_epi32(arg2, arg1); |
---|
1998 | } |
---|
1999 | |
---|
2000 | //The total number of operations is 21.0 |
---|
2001 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
2002 | { |
---|
2003 | bitblock128_t hiBound = simd128<64>::srli<1>(simd128<64>::lomask()); |
---|
2004 | bitblock128_t loBound = simd_not(hiBound); |
---|
2005 | return hsimd128<64>::packl(simd128<1>::ifh(simd128<64>::gt(arg1, hiBound), hiBound, simd128<1>::ifh(simd128<64>::gt(arg1, loBound), arg1, loBound)), simd128<1>::ifh(simd128<64>::gt(arg2, hiBound), hiBound, simd128<1>::ifh(simd128<64>::gt(arg2, loBound), arg2, loBound))); |
---|
2006 | } |
---|
2007 | |
---|
2008 | //The total number of operations is 115.666666667 |
---|
2009 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packss(bitblock128_t arg1, bitblock128_t arg2) |
---|
2010 | { |
---|
2011 | bitblock128_t hiBound = simd128<128>::srli<1>(simd128<128>::lomask()); |
---|
2012 | bitblock128_t loBound = simd_not(hiBound); |
---|
2013 | return hsimd128<128>::packl(simd128<1>::ifh(simd128<128>::gt(arg1, hiBound), hiBound, simd128<1>::ifh(simd128<128>::gt(arg1, loBound), arg1, loBound)), simd128<1>::ifh(simd128<128>::gt(arg2, hiBound), hiBound, simd128<1>::ifh(simd128<128>::gt(arg2, loBound), arg2, loBound))); |
---|
2014 | } |
---|
2015 | |
---|
2016 | //The total number of operations is 24.0 |
---|
2017 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<4>::signmask(bitblock128_t arg1) |
---|
2018 | { |
---|
2019 | uint64_t tmpAns1 = hsimd128<(8)>::signmask(esimd128<4>::mergeh(arg1, simd128<4>::constant<0>())); |
---|
2020 | uint64_t tmpAns2 = hsimd128<(8)>::signmask(esimd128<4>::mergel(arg1, simd128<4>::constant<0>())); |
---|
2021 | return ((tmpAns1<<(16))+tmpAns2); |
---|
2022 | } |
---|
2023 | |
---|
2024 | //The total number of operations is 1.0 |
---|
2025 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<8>::signmask(bitblock128_t arg1) |
---|
2026 | { |
---|
2027 | return _mm_movemask_epi8(arg1); |
---|
2028 | } |
---|
2029 | |
---|
2030 | //The total number of operations is 2.0 |
---|
2031 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1) |
---|
2032 | { |
---|
2033 | return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1)); |
---|
2034 | } |
---|
2035 | |
---|
2036 | //The total number of operations is 3.0 |
---|
2037 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1) |
---|
2038 | { |
---|
2039 | return hsimd128<(16)>::signmask(hsimd128<32>::packss(simd128<32>::constant<0>(), arg1)); |
---|
2040 | } |
---|
2041 | |
---|
2042 | //The total number of operations is 1.0 |
---|
2043 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1) |
---|
2044 | { |
---|
2045 | return _mm_movemask_pd(_mm_castsi128_pd(arg1)); |
---|
2046 | } |
---|
2047 | |
---|
2048 | //The total number of operations is 6.33333333333 |
---|
2049 | template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<128>::signmask(bitblock128_t arg1) |
---|
2050 | { |
---|
2051 | return hsimd128<(64)>::signmask(hsimd128<128>::packh(simd128<128>::constant<0>(), arg1)); |
---|
2052 | } |
---|
2053 | |
---|
2054 | //The total number of operations is 35.0 |
---|
2055 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2056 | { |
---|
2057 | return hsimd128<(4)>::packl(simd128<1>::ifh(simd128<2>::himask(), simd128<128>::srli<(1)>(arg1), arg1), simd128<1>::ifh(simd128<2>::himask(), simd128<128>::srli<(1)>(arg2), arg2)); |
---|
2058 | } |
---|
2059 | |
---|
2060 | //The total number of operations is 24.3333333333 |
---|
2061 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2062 | { |
---|
2063 | return hsimd128<(8)>::packl(simd128<1>::ifh(simd128<4>::himask(), simd128<128>::srli<(2)>(arg1), arg1), simd128<1>::ifh(simd128<4>::himask(), simd128<128>::srli<(2)>(arg2), arg2)); |
---|
2064 | } |
---|
2065 | |
---|
2066 | //The total number of operations is 13.6666666667 |
---|
2067 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2068 | { |
---|
2069 | return hsimd128<(16)>::packl(simd128<1>::ifh(simd128<8>::himask(), simd128<128>::srli<(4)>(arg1), arg1), simd128<1>::ifh(simd128<8>::himask(), simd128<128>::srli<(4)>(arg2), arg2)); |
---|
2070 | } |
---|
2071 | |
---|
2072 | //The total number of operations is 3.0 |
---|
2073 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2074 | { |
---|
2075 | return hsimd128<16>::packus(simd_and(arg1, simd128<16>::lomask()), simd_and(arg2, simd128<16>::lomask())); |
---|
2076 | } |
---|
2077 | |
---|
2078 | //The total number of operations is 3.0 |
---|
2079 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2080 | { |
---|
2081 | return hsimd128<32>::packus(simd_and(arg1, simd128<32>::lomask()), simd_and(arg2, simd128<32>::lomask())); |
---|
2082 | } |
---|
2083 | |
---|
2084 | //The total number of operations is 3.0 |
---|
2085 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2086 | { |
---|
2087 | return _mm_hsub_epi32(simd_and(arg2, simd128<64>::lomask()), simd_and(arg1, simd128<64>::lomask())); |
---|
2088 | } |
---|
2089 | |
---|
2090 | //The total number of operations is 5.33333333333 |
---|
2091 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2092 | { |
---|
2093 | return simd128<1>::ifh(simd128<128>::himask(), simd128<128>::slli<(64)>(arg1), arg2); |
---|
2094 | } |
---|
2095 | |
---|
2096 | //The total number of operations is 37.0 |
---|
2097 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2098 | { |
---|
2099 | return hsimd128<2>::packl(simd128<64>::srli<(1)>(arg1), simd128<64>::srli<(1)>(arg2)); |
---|
2100 | } |
---|
2101 | |
---|
2102 | //The total number of operations is 26.3333333333 |
---|
2103 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2104 | { |
---|
2105 | return hsimd128<4>::packl(simd128<64>::srli<(2)>(arg1), simd128<64>::srli<(2)>(arg2)); |
---|
2106 | } |
---|
2107 | |
---|
2108 | //The total number of operations is 15.6666666667 |
---|
2109 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2110 | { |
---|
2111 | return hsimd128<8>::packl(simd128<64>::srli<(4)>(arg1), simd128<64>::srli<(4)>(arg2)); |
---|
2112 | } |
---|
2113 | |
---|
2114 | //The total number of operations is 3.0 |
---|
2115 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2116 | { |
---|
2117 | return hsimd128<16>::packus(simd128<16>::srli<(8)>(arg1), simd128<16>::srli<(8)>(arg2)); |
---|
2118 | } |
---|
2119 | |
---|
2120 | //The total number of operations is 3.0 |
---|
2121 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2122 | { |
---|
2123 | return _mm_hsub_epi16(simd128<32>::srli<(16)>(arg2), simd128<32>::srli<(16)>(arg1)); |
---|
2124 | } |
---|
2125 | |
---|
2126 | //The total number of operations is 3.0 |
---|
2127 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2128 | { |
---|
2129 | return _mm_hsub_epi32(simd128<64>::srli<(32)>(arg2), simd128<64>::srli<(32)>(arg1)); |
---|
2130 | } |
---|
2131 | |
---|
2132 | //The total number of operations is 5.33333333333 |
---|
2133 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2134 | { |
---|
2135 | return simd128<1>::ifh(simd128<128>::himask(), arg1, simd128<128>::srli<(64)>(arg2)); |
---|
2136 | } |
---|
2137 | |
---|
2138 | //The total number of operations is 73.0 |
---|
2139 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2140 | { |
---|
2141 | return simd128<(1)>::min(hsimd128<2>::packh(arg1, arg2), hsimd128<2>::packl(arg1, arg2)); |
---|
2142 | } |
---|
2143 | |
---|
2144 | //The total number of operations is 67.3333333333 |
---|
2145 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2146 | { |
---|
2147 | return simd128<(2)>::min(hsimd128<4>::packh(arg1, arg2), hsimd128<4>::packl(arg1, arg2)); |
---|
2148 | } |
---|
2149 | |
---|
2150 | //The total number of operations is 38.3333333333 |
---|
2151 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2152 | { |
---|
2153 | return simd128<(4)>::min(hsimd128<8>::packh(arg1, arg2), hsimd128<8>::packl(arg1, arg2)); |
---|
2154 | } |
---|
2155 | |
---|
2156 | //The total number of operations is 7.0 |
---|
2157 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2158 | { |
---|
2159 | return simd128<(8)>::min(hsimd128<16>::packh(arg1, arg2), hsimd128<16>::packl(arg1, arg2)); |
---|
2160 | } |
---|
2161 | |
---|
2162 | //The total number of operations is 7.0 |
---|
2163 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2164 | { |
---|
2165 | return simd128<(16)>::min(hsimd128<32>::packh(arg1, arg2), hsimd128<32>::packl(arg1, arg2)); |
---|
2166 | } |
---|
2167 | |
---|
2168 | //The total number of operations is 7.0 |
---|
2169 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2170 | { |
---|
2171 | return simd128<(32)>::min(hsimd128<64>::packh(arg1, arg2), hsimd128<64>::packl(arg1, arg2)); |
---|
2172 | } |
---|
2173 | |
---|
2174 | //The total number of operations is 14.6666666667 |
---|
2175 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::min_hl(bitblock128_t arg1, bitblock128_t arg2) |
---|
2176 | { |
---|
2177 | return simd128<(64)>::min(hsimd128<128>::packh(arg1, arg2), hsimd128<128>::packl(arg1, arg2)); |
---|
2178 | } |
---|
2179 | |
---|
2180 | //The total number of operations is 75.0 |
---|
2181 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2182 | { |
---|
2183 | bitblock128_t arg11 = simd128<2>::ifh(arg1, simd128<2>::constant<0>(), arg1); |
---|
2184 | bitblock128_t arg12 = simd_and(simd128<2>::lomask(), arg11); |
---|
2185 | bitblock128_t arg21 = simd128<2>::ifh(arg2, simd128<2>::constant<0>(), arg2); |
---|
2186 | bitblock128_t arg22 = simd_and(simd128<2>::lomask(), arg21); |
---|
2187 | return hsimd128<2>::packl(simd128<1>::ifh(simd128<2>::eq(arg12, arg11), arg12, simd128<2>::lomask()), simd128<1>::ifh(simd128<2>::eq(arg22, arg21), arg22, simd128<2>::lomask())); |
---|
2188 | } |
---|
2189 | |
---|
2190 | //The total number of operations is 74.3333333333 |
---|
2191 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<4>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2192 | { |
---|
2193 | bitblock128_t hiPart = hsimd128<4>::packh(arg1, arg2); |
---|
2194 | return simd128<(2)>::ifh(hiPart, simd128<(2)>::constant<0>(), simd_or(simd128<(2)>::gt(hiPart, simd128<(2)>::constant<0>()), hsimd128<4>::packl(arg1, arg2))); |
---|
2195 | } |
---|
2196 | |
---|
2197 | //The total number of operations is 25.6666666667 |
---|
2198 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<8>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2199 | { |
---|
2200 | bitblock128_t arg11 = simd128<8>::ifh(arg1, simd128<8>::constant<0>(), arg1); |
---|
2201 | bitblock128_t arg12 = simd_and(simd128<8>::lomask(), arg11); |
---|
2202 | bitblock128_t arg21 = simd128<8>::ifh(arg2, simd128<8>::constant<0>(), arg2); |
---|
2203 | bitblock128_t arg22 = simd_and(simd128<8>::lomask(), arg21); |
---|
2204 | return hsimd128<8>::packl(simd128<1>::ifh(simd128<8>::eq(arg12, arg11), arg12, simd128<8>::lomask()), simd128<1>::ifh(simd128<8>::eq(arg22, arg21), arg22, simd128<8>::lomask())); |
---|
2205 | } |
---|
2206 | |
---|
2207 | //The total number of operations is 1.0 |
---|
2208 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<16>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2209 | { |
---|
2210 | return _mm_packus_epi16(arg2, arg1); |
---|
2211 | } |
---|
2212 | |
---|
2213 | //The total number of operations is 1.0 |
---|
2214 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<32>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2215 | { |
---|
2216 | return _mm_packus_epi32(arg2, arg1); |
---|
2217 | } |
---|
2218 | |
---|
2219 | //The total number of operations is 12.0 |
---|
2220 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2221 | { |
---|
2222 | bitblock128_t hiPart = hsimd128<64>::packh(arg1, arg2); |
---|
2223 | return simd128<(32)>::ifh(hiPart, simd128<(32)>::constant<0>(), simd_or(simd128<(32)>::gt(hiPart, simd128<(32)>::constant<0>()), hsimd128<64>::packl(arg1, arg2))); |
---|
2224 | } |
---|
2225 | |
---|
2226 | //The total number of operations is 16.6666666667 |
---|
2227 | template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packus(bitblock128_t arg1, bitblock128_t arg2) |
---|
2228 | { |
---|
2229 | bitblock128_t hiPart = hsimd128<128>::packh(arg1, arg2); |
---|
2230 | return simd128<(64)>::ifh(hiPart, simd128<(64)>::constant<0>(), simd_or(simd128<(64)>::gt(hiPart, simd128<(64)>::constant<0>()), hsimd128<128>::packl(arg1, arg2))); |
---|
2231 | } |
---|
2232 | |
---|
2233 | //The total number of operations is 31.0 |
---|
2234 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2235 | { |
---|
2236 | return esimd128<(2)>::mergel(simd128<1>::ifh(simd128<(2)>::himask(), arg1, simd128<(2)>::srli<1>(arg2)), simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::slli<1>(arg1), arg2)); |
---|
2237 | } |
---|
2238 | |
---|
2239 | //The total number of operations is 21.0 |
---|
2240 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2241 | { |
---|
2242 | return esimd128<(4)>::mergel(simd128<1>::ifh(simd128<(4)>::himask(), arg1, simd128<(4)>::srli<2>(arg2)), simd128<1>::ifh(simd128<(4)>::himask(), simd128<(4)>::slli<2>(arg1), arg2)); |
---|
2243 | } |
---|
2244 | |
---|
2245 | //The total number of operations is 11.0 |
---|
2246 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2247 | { |
---|
2248 | return esimd128<(8)>::mergel(simd128<1>::ifh(simd128<(8)>::himask(), arg1, simd128<(8)>::srli<4>(arg2)), simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::slli<4>(arg1), arg2)); |
---|
2249 | } |
---|
2250 | |
---|
2251 | //The total number of operations is 1.0 |
---|
2252 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2253 | { |
---|
2254 | return _mm_unpacklo_epi8(arg2, arg1); |
---|
2255 | } |
---|
2256 | |
---|
2257 | //The total number of operations is 1.0 |
---|
2258 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2259 | { |
---|
2260 | return _mm_unpacklo_epi16(arg2, arg1); |
---|
2261 | } |
---|
2262 | |
---|
2263 | //The total number of operations is 1.0 |
---|
2264 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2265 | { |
---|
2266 | return _mm_unpacklo_epi32(arg2, arg1); |
---|
2267 | } |
---|
2268 | |
---|
2269 | //The total number of operations is 1.0 |
---|
2270 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::mergel(bitblock128_t arg1, bitblock128_t arg2) |
---|
2271 | { |
---|
2272 | return _mm_unpacklo_epi64(arg2, arg1); |
---|
2273 | } |
---|
2274 | |
---|
2275 | //The total number of operations is 31.0 |
---|
2276 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2277 | { |
---|
2278 | return esimd128<(2)>::mergeh(simd128<1>::ifh(simd128<(2)>::himask(), arg1, simd128<(2)>::srli<1>(arg2)), simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::slli<1>(arg1), arg2)); |
---|
2279 | } |
---|
2280 | |
---|
2281 | //The total number of operations is 21.0 |
---|
2282 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2283 | { |
---|
2284 | return esimd128<(4)>::mergeh(simd128<1>::ifh(simd128<(4)>::himask(), arg1, simd128<(4)>::srli<2>(arg2)), simd128<1>::ifh(simd128<(4)>::himask(), simd128<(4)>::slli<2>(arg1), arg2)); |
---|
2285 | } |
---|
2286 | |
---|
2287 | //The total number of operations is 11.0 |
---|
2288 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2289 | { |
---|
2290 | return esimd128<(8)>::mergeh(simd128<1>::ifh(simd128<(8)>::himask(), arg1, simd128<(8)>::srli<4>(arg2)), simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::slli<4>(arg1), arg2)); |
---|
2291 | } |
---|
2292 | |
---|
2293 | //The total number of operations is 1.0 |
---|
2294 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2295 | { |
---|
2296 | return _mm_unpackhi_epi8(arg2, arg1); |
---|
2297 | } |
---|
2298 | |
---|
2299 | //The total number of operations is 1.0 |
---|
2300 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2301 | { |
---|
2302 | return _mm_unpackhi_epi16(arg2, arg1); |
---|
2303 | } |
---|
2304 | |
---|
2305 | //The total number of operations is 1.0 |
---|
2306 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2307 | { |
---|
2308 | return _mm_unpackhi_epi32(arg2, arg1); |
---|
2309 | } |
---|
2310 | |
---|
2311 | //The total number of operations is 1.0 |
---|
2312 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::mergeh(bitblock128_t arg1, bitblock128_t arg2) |
---|
2313 | { |
---|
2314 | return _mm_unpackhi_epi64(arg2, arg1); |
---|
2315 | } |
---|
2316 | |
---|
2317 | //The total number of operations is 24.0 |
---|
2318 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::zeroextendh(bitblock128_t arg1) |
---|
2319 | { |
---|
2320 | return esimd128<(2)>::mergeh(simd128<(2)>::srli<1>(arg1), simd_and(simd128<(2)>::lomask(), arg1)); |
---|
2321 | } |
---|
2322 | |
---|
2323 | //The total number of operations is 14.0 |
---|
2324 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::zeroextendh(bitblock128_t arg1) |
---|
2325 | { |
---|
2326 | return esimd128<(4)>::mergeh(simd128<(4)>::srli<2>(arg1), simd_and(simd128<(4)>::lomask(), arg1)); |
---|
2327 | } |
---|
2328 | |
---|
2329 | //The total number of operations is 4.0 |
---|
2330 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::zeroextendh(bitblock128_t arg1) |
---|
2331 | { |
---|
2332 | return esimd128<(8)>::mergeh(simd128<(8)>::srli<4>(arg1), simd_and(simd128<(8)>::lomask(), arg1)); |
---|
2333 | } |
---|
2334 | |
---|
2335 | //The total number of operations is 3.0 |
---|
2336 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::zeroextendh(bitblock128_t arg1) |
---|
2337 | { |
---|
2338 | return esimd128<(16)>::mergeh(simd128<(16)>::srli<8>(arg1), simd_and(simd128<(16)>::lomask(), arg1)); |
---|
2339 | } |
---|
2340 | |
---|
2341 | //The total number of operations is 3.0 |
---|
2342 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::zeroextendh(bitblock128_t arg1) |
---|
2343 | { |
---|
2344 | return esimd128<(32)>::mergeh(simd128<(32)>::srli<16>(arg1), simd_and(simd128<(32)>::lomask(), arg1)); |
---|
2345 | } |
---|
2346 | |
---|
2347 | //The total number of operations is 3.0 |
---|
2348 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::zeroextendh(bitblock128_t arg1) |
---|
2349 | { |
---|
2350 | return esimd128<(64)>::mergeh(simd128<(64)>::srli<32>(arg1), simd_and(simd128<(64)>::lomask(), arg1)); |
---|
2351 | } |
---|
2352 | |
---|
2353 | //The total number of operations is 2.33333333333 |
---|
2354 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::zeroextendh(bitblock128_t arg1) |
---|
2355 | { |
---|
2356 | return simd128<(128)>::srli<64>(arg1); |
---|
2357 | } |
---|
2358 | |
---|
2359 | //The total number of operations is 24.0 |
---|
2360 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::zeroextendl(bitblock128_t arg1) |
---|
2361 | { |
---|
2362 | return esimd128<(2)>::mergel(simd128<(2)>::srli<1>(arg1), simd_and(simd128<(2)>::lomask(), arg1)); |
---|
2363 | } |
---|
2364 | |
---|
2365 | //The total number of operations is 14.0 |
---|
2366 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::zeroextendl(bitblock128_t arg1) |
---|
2367 | { |
---|
2368 | return esimd128<(4)>::mergel(simd128<(4)>::srli<2>(arg1), simd_and(simd128<(4)>::lomask(), arg1)); |
---|
2369 | } |
---|
2370 | |
---|
2371 | //The total number of operations is 4.0 |
---|
2372 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::zeroextendl(bitblock128_t arg1) |
---|
2373 | { |
---|
2374 | return esimd128<(8)>::mergel(simd128<(8)>::srli<4>(arg1), simd_and(simd128<(8)>::lomask(), arg1)); |
---|
2375 | } |
---|
2376 | |
---|
2377 | //The total number of operations is 1.0 |
---|
2378 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::zeroextendl(bitblock128_t arg1) |
---|
2379 | { |
---|
2380 | return _mm_cvtepu8_epi16(arg1); |
---|
2381 | } |
---|
2382 | |
---|
2383 | //The total number of operations is 1.0 |
---|
2384 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::zeroextendl(bitblock128_t arg1) |
---|
2385 | { |
---|
2386 | return _mm_cvtepu16_epi32(arg1); |
---|
2387 | } |
---|
2388 | |
---|
2389 | //The total number of operations is 1.0 |
---|
2390 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::zeroextendl(bitblock128_t arg1) |
---|
2391 | { |
---|
2392 | return _mm_cvtepu32_epi64(arg1); |
---|
2393 | } |
---|
2394 | |
---|
2395 | //The total number of operations is 1.0 |
---|
2396 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::zeroextendl(bitblock128_t arg1) |
---|
2397 | { |
---|
2398 | return simd_and(simd128<(128)>::lomask(), arg1); |
---|
2399 | } |
---|
2400 | |
---|
2401 | //The total number of operations is 31.0 |
---|
2402 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::signextendh(bitblock128_t arg1) |
---|
2403 | { |
---|
2404 | return esimd128<(2)>::mergeh(simd128<(2)>::srai<1>(arg1), simd128<(2)>::srai<1>(simd128<(2)>::slli<1>(arg1))); |
---|
2405 | } |
---|
2406 | |
---|
2407 | //The total number of operations is 33.0 |
---|
2408 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::signextendh(bitblock128_t arg1) |
---|
2409 | { |
---|
2410 | return esimd128<(4)>::mergeh(simd128<(4)>::srai<2>(arg1), simd128<(4)>::srai<2>(simd128<(4)>::slli<2>(arg1))); |
---|
2411 | } |
---|
2412 | |
---|
2413 | //The total number of operations is 13.0 |
---|
2414 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::signextendh(bitblock128_t arg1) |
---|
2415 | { |
---|
2416 | return esimd128<(8)>::mergeh(simd128<(8)>::srai<4>(arg1), simd128<(8)>::srai<4>(simd128<(8)>::slli<4>(arg1))); |
---|
2417 | } |
---|
2418 | |
---|
2419 | //The total number of operations is 3.33333333333 |
---|
2420 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::signextendh(bitblock128_t arg1) |
---|
2421 | { |
---|
2422 | return esimd128<8>::signextendl(simd128<128>::srli<(64)>(arg1)); |
---|
2423 | } |
---|
2424 | |
---|
2425 | //The total number of operations is 3.33333333333 |
---|
2426 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::signextendh(bitblock128_t arg1) |
---|
2427 | { |
---|
2428 | return esimd128<16>::signextendl(simd128<128>::srli<(64)>(arg1)); |
---|
2429 | } |
---|
2430 | |
---|
2431 | //The total number of operations is 3.33333333333 |
---|
2432 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendh(bitblock128_t arg1) |
---|
2433 | { |
---|
2434 | return esimd128<32>::signextendl(simd128<128>::srli<(64)>(arg1)); |
---|
2435 | } |
---|
2436 | |
---|
2437 | //The total number of operations is 11.0833333333 |
---|
2438 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendh(bitblock128_t arg1) |
---|
2439 | { |
---|
2440 | return simd128<(128)>::srai<64>(arg1); |
---|
2441 | } |
---|
2442 | |
---|
2443 | //The total number of operations is 31.0 |
---|
2444 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<1>::signextendl(bitblock128_t arg1) |
---|
2445 | { |
---|
2446 | return esimd128<(2)>::mergel(simd128<(2)>::srai<1>(arg1), simd128<(2)>::srai<1>(simd128<(2)>::slli<1>(arg1))); |
---|
2447 | } |
---|
2448 | |
---|
2449 | //The total number of operations is 33.0 |
---|
2450 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<2>::signextendl(bitblock128_t arg1) |
---|
2451 | { |
---|
2452 | return esimd128<(4)>::mergel(simd128<(4)>::srai<2>(arg1), simd128<(4)>::srai<2>(simd128<(4)>::slli<2>(arg1))); |
---|
2453 | } |
---|
2454 | |
---|
2455 | //The total number of operations is 13.0 |
---|
2456 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<4>::signextendl(bitblock128_t arg1) |
---|
2457 | { |
---|
2458 | return esimd128<(8)>::mergel(simd128<(8)>::srai<4>(arg1), simd128<(8)>::srai<4>(simd128<(8)>::slli<4>(arg1))); |
---|
2459 | } |
---|
2460 | |
---|
2461 | //The total number of operations is 1.0 |
---|
2462 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<8>::signextendl(bitblock128_t arg1) |
---|
2463 | { |
---|
2464 | return _mm_cvtepi8_epi16(arg1); |
---|
2465 | } |
---|
2466 | |
---|
2467 | //The total number of operations is 1.0 |
---|
2468 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<16>::signextendl(bitblock128_t arg1) |
---|
2469 | { |
---|
2470 | return _mm_cvtepi16_epi32(arg1); |
---|
2471 | } |
---|
2472 | |
---|
2473 | //The total number of operations is 1.0 |
---|
2474 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendl(bitblock128_t arg1) |
---|
2475 | { |
---|
2476 | return _mm_cvtepi32_epi64(arg1); |
---|
2477 | } |
---|
2478 | |
---|
2479 | //The total number of operations is 13.4166666667 |
---|
2480 | template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendl(bitblock128_t arg1) |
---|
2481 | { |
---|
2482 | return simd128<(128)>::srai<64>(simd128<(128)>::slli<64>(arg1)); |
---|
2483 | } |
---|
2484 | |
---|
2485 | //The total number of operations is 13.6666666667 |
---|
2486 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::shufflei(bitblock128_t arg1) |
---|
2487 | { |
---|
2488 | bitblock128_t tmphi = _mm_shufflehi_epi16(arg1, (int32_t)((shufflemask8_to_shufflemask4(msk)>>8))); |
---|
2489 | bitblock128_t tmpAns = _mm_shufflelo_epi16(tmphi, (int32_t)((shufflemask8_to_shufflemask4(msk)&255))); |
---|
2490 | bitblock128_t tmplh = _mm_shufflehi_epi16(simd128<128>::slli<64>(arg1), (int32_t)((shufflemask8_to_shufflemask4(msk)>>8))); |
---|
2491 | bitblock128_t tmphl = _mm_shufflelo_epi16(simd128<128>::srli<64>(arg1), (int32_t)((shufflemask8_to_shufflemask4(msk)&255))); |
---|
2492 | uint32_t a1 = ((((msk>>21)&4) == 0) ? 0 : (131071)); |
---|
2493 | uint32_t a2 = ((((msk>>18)&4) == 0) ? 0 : (131071)); |
---|
2494 | uint32_t a3 = ((((msk>>15)&4) == 0) ? 0 : (131071)); |
---|
2495 | uint32_t a4 = ((((msk>>12)&4) == 0) ? 0 : (131071)); |
---|
2496 | uint32_t a5 = ((((msk>>9)&4) == 0) ? (131071) : 0); |
---|
2497 | uint32_t a6 = ((((msk>>6)&4) == 0) ? (131071) : 0); |
---|
2498 | uint32_t a7 = ((((msk>>3)&4) == 0) ? (131071) : 0); |
---|
2499 | uint32_t a8 = (((msk&4) == 0) ? (131071) : 0); |
---|
2500 | return simd128<1>::ifh(mvmd128<16>::fill8(a1, a2, a3, a4, a5, a6, a7, a8), tmpAns, simd_or(tmplh, tmphl)); |
---|
2501 | } |
---|
2502 | |
---|
2503 | //The total number of operations is 1.0 |
---|
2504 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::shufflei(bitblock128_t arg1) |
---|
2505 | { |
---|
2506 | return _mm_shuffle_epi32(arg1, (int32_t)(msk)); |
---|
2507 | } |
---|
2508 | |
---|
2509 | //The total number of operations is 1.0 |
---|
2510 | template <> template <uint64_t msk> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::shufflei(bitblock128_t arg1) |
---|
2511 | { |
---|
2512 | return mvmd128<32>::shufflei<shufflemask4_from_shufflemask2(msk)>(arg1); |
---|
2513 | } |
---|
2514 | |
---|
2515 | //The total number of operations is 5.66666666667 |
---|
2516 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2517 | { |
---|
2518 | return simd_or(mvmd128<2>::srli<sh>(arg1), mvmd128<2>::slli<((64)-sh)>(arg2)); |
---|
2519 | } |
---|
2520 | |
---|
2521 | //The total number of operations is 5.66666666667 |
---|
2522 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2523 | { |
---|
2524 | return simd_or(mvmd128<4>::srli<sh>(arg1), mvmd128<4>::slli<((32)-sh)>(arg2)); |
---|
2525 | } |
---|
2526 | |
---|
2527 | //The total number of operations is 3.0 |
---|
2528 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2529 | { |
---|
2530 | return simd_or(mvmd128<8>::srli<sh>(arg1), mvmd128<8>::slli<((16)-sh)>(arg2)); |
---|
2531 | } |
---|
2532 | |
---|
2533 | //The total number of operations is 3.0 |
---|
2534 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2535 | { |
---|
2536 | return simd_or(mvmd128<16>::srli<sh>(arg1), mvmd128<16>::slli<((8)-sh)>(arg2)); |
---|
2537 | } |
---|
2538 | |
---|
2539 | //The total number of operations is 3.0 |
---|
2540 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2541 | { |
---|
2542 | return simd_or(mvmd128<32>::srli<sh>(arg1), mvmd128<32>::slli<((4)-sh)>(arg2)); |
---|
2543 | } |
---|
2544 | |
---|
2545 | //The total number of operations is 3.0 |
---|
2546 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2547 | { |
---|
2548 | return simd_or(mvmd128<64>::srli<sh>(arg1), mvmd128<64>::slli<((2)-sh)>(arg2)); |
---|
2549 | } |
---|
2550 | |
---|
2551 | //The total number of operations is 3.0 |
---|
2552 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dsrli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2553 | { |
---|
2554 | return simd_or(mvmd128<128>::srli<sh>(arg1), mvmd128<128>::slli<((1)-sh)>(arg2)); |
---|
2555 | } |
---|
2556 | |
---|
2557 | //The total number of operations is 1.0 |
---|
2558 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill(uint64_t val1) |
---|
2559 | { |
---|
2560 | return mvmd128<32>::fill((-1*val1)); |
---|
2561 | } |
---|
2562 | |
---|
2563 | //The total number of operations is 1.0 |
---|
2564 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill(uint64_t val1) |
---|
2565 | { |
---|
2566 | return mvmd128<(4)>::fill(((val1<<2)|val1)); |
---|
2567 | } |
---|
2568 | |
---|
2569 | //The total number of operations is 1.0 |
---|
2570 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill(uint64_t val1) |
---|
2571 | { |
---|
2572 | return mvmd128<(8)>::fill(((val1<<4)|val1)); |
---|
2573 | } |
---|
2574 | |
---|
2575 | //The total number of operations is 1.0 |
---|
2576 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill(uint64_t val1) |
---|
2577 | { |
---|
2578 | return _mm_set1_epi8((int32_t)(val1)); |
---|
2579 | } |
---|
2580 | |
---|
2581 | //The total number of operations is 1.0 |
---|
2582 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill(uint64_t val1) |
---|
2583 | { |
---|
2584 | return _mm_set1_epi16((int32_t)(val1)); |
---|
2585 | } |
---|
2586 | |
---|
2587 | //The total number of operations is 1.0 |
---|
2588 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(uint64_t val1) |
---|
2589 | { |
---|
2590 | return _mm_set1_epi32((int32_t)(val1)); |
---|
2591 | } |
---|
2592 | |
---|
2593 | //The total number of operations is 1.0 |
---|
2594 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill(uint64_t val1) |
---|
2595 | { |
---|
2596 | return _mm_set_epi32((int32_t)((val1>>32)), (int32_t)(val1), (int32_t)((val1>>32)), (int32_t)(val1)); |
---|
2597 | } |
---|
2598 | |
---|
2599 | //The total number of operations is 1.0 |
---|
2600 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::fill(uint64_t val1) |
---|
2601 | { |
---|
2602 | return _mm_set_epi32((int32_t)(0), (int32_t)(0), (int32_t)((val1>>32)), (int32_t)(val1)); |
---|
2603 | } |
---|
2604 | |
---|
2605 | //The total number of operations is 1.0 |
---|
2606 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::shuffle(bitblock128_t arg1, bitblock128_t arg2) |
---|
2607 | { |
---|
2608 | return _mm_shuffle_epi8(arg1, arg2); |
---|
2609 | } |
---|
2610 | |
---|
2611 | //The total number of operations is 10.0 |
---|
2612 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::shuffle(bitblock128_t arg1, bitblock128_t arg2) |
---|
2613 | { |
---|
2614 | bitblock128_t tmp1 = simd_and(simd128<16>::constant<(7)>(), arg2); |
---|
2615 | bitblock128_t msk1 = simd128<16>::add(tmp1, tmp1); |
---|
2616 | bitblock128_t msk2 = simd128<16>::add(msk1, simd128<16>::constant<1>()); |
---|
2617 | bitblock128_t msk = simd_or(msk1, simd128<16>::slli<(8)>(msk2)); |
---|
2618 | return simd128<16>::ifh(arg2, simd128<16>::constant<0>(), mvmd128<(8)>::shuffle(arg1, msk)); |
---|
2619 | } |
---|
2620 | |
---|
2621 | //The total number of operations is 19.0 |
---|
2622 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::shuffle(bitblock128_t arg1, bitblock128_t arg2) |
---|
2623 | { |
---|
2624 | bitblock128_t tmp1 = simd_and(simd128<32>::constant<(3)>(), arg2); |
---|
2625 | bitblock128_t msk1 = simd128<32>::add(tmp1, tmp1); |
---|
2626 | bitblock128_t msk2 = simd128<32>::add(msk1, simd128<32>::constant<1>()); |
---|
2627 | bitblock128_t msk = simd_or(msk1, simd128<32>::slli<(16)>(msk2)); |
---|
2628 | return simd128<32>::ifh(arg2, simd128<32>::constant<0>(), mvmd128<(16)>::shuffle(arg1, msk)); |
---|
2629 | } |
---|
2630 | |
---|
2631 | //The total number of operations is 28.0 |
---|
2632 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::shuffle(bitblock128_t arg1, bitblock128_t arg2) |
---|
2633 | { |
---|
2634 | bitblock128_t tmp1 = simd_and(simd128<64>::constant<(1)>(), arg2); |
---|
2635 | bitblock128_t msk1 = simd128<64>::add(tmp1, tmp1); |
---|
2636 | bitblock128_t msk2 = simd128<64>::add(msk1, simd128<64>::constant<1>()); |
---|
2637 | bitblock128_t msk = simd_or(msk1, simd128<64>::slli<(32)>(msk2)); |
---|
2638 | return simd128<64>::ifh(arg2, simd128<64>::constant<0>(), mvmd128<(32)>::shuffle(arg1, msk)); |
---|
2639 | } |
---|
2640 | |
---|
2641 | //The total number of operations is 1.0 |
---|
2642 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<1>::extract(bitblock128_t arg1) |
---|
2643 | { |
---|
2644 | return (((pos%2) == 0) ? (mvmd128<(2)>::extract<(pos/2)>(arg1)&(1)) : (mvmd128<(2)>::extract<(pos/2)>(arg1)>>1)); |
---|
2645 | } |
---|
2646 | |
---|
2647 | //The total number of operations is 1.0 |
---|
2648 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<2>::extract(bitblock128_t arg1) |
---|
2649 | { |
---|
2650 | return (((pos%2) == 0) ? (mvmd128<(4)>::extract<(pos/2)>(arg1)&(3)) : (mvmd128<(4)>::extract<(pos/2)>(arg1)>>2)); |
---|
2651 | } |
---|
2652 | |
---|
2653 | //The total number of operations is 1.0 |
---|
2654 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<4>::extract(bitblock128_t arg1) |
---|
2655 | { |
---|
2656 | return (((pos%2) == 0) ? (mvmd128<(8)>::extract<(pos/2)>(arg1)&(15)) : (mvmd128<(8)>::extract<(pos/2)>(arg1)>>4)); |
---|
2657 | } |
---|
2658 | |
---|
2659 | //The total number of operations is 1.0 |
---|
2660 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<8>::extract(bitblock128_t arg1) |
---|
2661 | { |
---|
2662 | return (((pos%2) == 0) ? (mvmd128<(16)>::extract<(pos/2)>(arg1)&(255)) : (mvmd128<(16)>::extract<(pos/2)>(arg1)>>8)); |
---|
2663 | } |
---|
2664 | |
---|
2665 | //The total number of operations is 1.0 |
---|
2666 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<16>::extract(bitblock128_t arg1) |
---|
2667 | { |
---|
2668 | return (65535&_mm_extract_epi16(arg1, (int32_t)(pos))); |
---|
2669 | } |
---|
2670 | |
---|
2671 | //The total number of operations is 1.0 |
---|
2672 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<32>::extract(bitblock128_t arg1) |
---|
2673 | { |
---|
2674 | return (((uint64_t)(((4294967296ULL)-1)))&_mm_extract_epi32(arg1, (int32_t)(pos))); |
---|
2675 | } |
---|
2676 | |
---|
2677 | //The total number of operations is 2.0 |
---|
2678 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE uint64_t mvmd128<64>::extract(bitblock128_t arg1) |
---|
2679 | { |
---|
2680 | return ((mvmd128<(32)>::extract<((2*pos)+1)>(arg1)<<(32))|mvmd128<(32)>::extract<(2*pos)>(arg1)); |
---|
2681 | } |
---|
2682 | |
---|
2683 | //The total number of operations is 12.6666666667 |
---|
2684 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::splat(bitblock128_t arg1) |
---|
2685 | { |
---|
2686 | return simd128<128>::sub(simd128<128>::constant<0>(), simd_and(simd128<128>::constant<1>(), simd128<128>::srli<pos>(arg1))); |
---|
2687 | } |
---|
2688 | |
---|
2689 | //The total number of operations is 10.0 |
---|
2690 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::splat(bitblock128_t arg1) |
---|
2691 | { |
---|
2692 | bitblock128_t tmpArg = (((pos%2) == 0) ? simd128<(4)>::slli<2>(arg1) : simd128<(4)>::srli<2>(arg1)); |
---|
2693 | bitblock128_t arg11 = (((pos%2) == 0) ? simd_and(simd128<(4)>::lomask(), arg1) : simd_and(simd128<(4)>::himask(), arg1)); |
---|
2694 | return mvmd128<(4)>::splat<(pos/2)>(simd_or(tmpArg, arg11)); |
---|
2695 | } |
---|
2696 | |
---|
2697 | //The total number of operations is 6.0 |
---|
2698 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::splat(bitblock128_t arg1) |
---|
2699 | { |
---|
2700 | bitblock128_t tmpArg = (((pos%2) == 0) ? simd128<(8)>::slli<4>(arg1) : simd128<(8)>::srli<4>(arg1)); |
---|
2701 | bitblock128_t arg11 = (((pos%2) == 0) ? simd_and(simd128<(8)>::lomask(), arg1) : simd_and(simd128<(8)>::himask(), arg1)); |
---|
2702 | return mvmd128<(8)>::splat<(pos/2)>(simd_or(tmpArg, arg11)); |
---|
2703 | } |
---|
2704 | |
---|
2705 | //The total number of operations is 2.0 |
---|
2706 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::splat(bitblock128_t arg1) |
---|
2707 | { |
---|
2708 | return mvmd128<8>::fill(_mm_extract_epi8(arg1, (int32_t)(pos))); |
---|
2709 | } |
---|
2710 | |
---|
2711 | //The total number of operations is 2.0 |
---|
2712 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::splat(bitblock128_t arg1) |
---|
2713 | { |
---|
2714 | return mvmd128<16>::fill(_mm_extract_epi16(arg1, (int32_t)(pos))); |
---|
2715 | } |
---|
2716 | |
---|
2717 | //The total number of operations is 1.0 |
---|
2718 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::splat(bitblock128_t arg1) |
---|
2719 | { |
---|
2720 | return mvmd128<32>::shufflei<shufflemask4(pos, pos, pos, pos)>(arg1); |
---|
2721 | } |
---|
2722 | |
---|
2723 | //The total number of operations is 5.0 |
---|
2724 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::splat(bitblock128_t arg1) |
---|
2725 | { |
---|
2726 | return simd128<1>::ifh(simd128<64>::himask(), mvmd128<(32)>::splat<((2*pos)+1)>(arg1), mvmd128<(32)>::splat<(2*pos)>(arg1)); |
---|
2727 | } |
---|
2728 | |
---|
2729 | //The total number of operations is 13.0 |
---|
2730 | template <> template <uint64_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::splat(bitblock128_t arg1) |
---|
2731 | { |
---|
2732 | return simd128<1>::ifh(simd128<128>::himask(), mvmd128<(64)>::splat<((2*pos)+1)>(arg1), mvmd128<(64)>::splat<(2*pos)>(arg1)); |
---|
2733 | } |
---|
2734 | |
---|
2735 | //The total number of operations is 15.0 |
---|
2736 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16) |
---|
2737 | { |
---|
2738 | return simd_or(mvmd128<(2)>::fill16((val1<<1), (val3<<1), (val5<<1), (val7<<1), (val9<<1), (val11<<1), (val13<<1), (val15<<1), (val1<<1), (val3<<1), (val5<<1), (val7<<1), (val9<<1), (val11<<1), (val13<<1), (val15<<1)), mvmd128<(2)>::fill16((val2&(1)), (val4&(1)), (val6&(1)), (val8&(1)), (val10&(1)), (val12&(1)), (val14&(1)), (val16&(1)), (val2&(1)), (val4&(1)), (val6&(1)), (val8&(1)), (val10&(1)), (val12&(1)), (val14&(1)), (val16&(1)))); |
---|
2739 | } |
---|
2740 | |
---|
2741 | //The total number of operations is 7.0 |
---|
2742 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16) |
---|
2743 | { |
---|
2744 | return simd_or(mvmd128<(4)>::fill16((val1<<2), (val3<<2), (val5<<2), (val7<<2), (val9<<2), (val11<<2), (val13<<2), (val15<<2), (val1<<2), (val3<<2), (val5<<2), (val7<<2), (val9<<2), (val11<<2), (val13<<2), (val15<<2)), mvmd128<(4)>::fill16((val2&(3)), (val4&(3)), (val6&(3)), (val8&(3)), (val10&(3)), (val12&(3)), (val14&(3)), (val16&(3)), (val2&(3)), (val4&(3)), (val6&(3)), (val8&(3)), (val10&(3)), (val12&(3)), (val14&(3)), (val16&(3)))); |
---|
2745 | } |
---|
2746 | |
---|
2747 | //The total number of operations is 3.0 |
---|
2748 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16) |
---|
2749 | { |
---|
2750 | return simd_or(mvmd128<(8)>::fill16((val1<<4), (val3<<4), (val5<<4), (val7<<4), (val9<<4), (val11<<4), (val13<<4), (val15<<4), (val1<<4), (val3<<4), (val5<<4), (val7<<4), (val9<<4), (val11<<4), (val13<<4), (val15<<4)), mvmd128<(8)>::fill16((val2&(15)), (val4&(15)), (val6&(15)), (val8&(15)), (val10&(15)), (val12&(15)), (val14&(15)), (val16&(15)), (val2&(15)), (val4&(15)), (val6&(15)), (val8&(15)), (val10&(15)), (val12&(15)), (val14&(15)), (val16&(15)))); |
---|
2751 | } |
---|
2752 | |
---|
2753 | //The total number of operations is 1.0 |
---|
2754 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill16(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8, uint64_t val9, uint64_t val10, uint64_t val11, uint64_t val12, uint64_t val13, uint64_t val14, uint64_t val15, uint64_t val16) |
---|
2755 | { |
---|
2756 | return _mm_set_epi8((int32_t)(val1), (int32_t)(val2), (int32_t)(val3), (int32_t)(val4), (int32_t)(val5), (int32_t)(val6), (int32_t)(val7), (int32_t)(val8), (int32_t)(val9), (int32_t)(val10), (int32_t)(val11), (int32_t)(val12), (int32_t)(val13), (int32_t)(val14), (int32_t)(val15), (int32_t)(val16)); |
---|
2757 | } |
---|
2758 | |
---|
2759 | //The total number of operations is 5.0 |
---|
2760 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2761 | { |
---|
2762 | return simd128<1>::ifh(simd128<(4)>::himask(), mvmd128<1>::fill2(val1, val2), mvmd128<1>::fill2(val3, val4)); |
---|
2763 | } |
---|
2764 | |
---|
2765 | //The total number of operations is 5.0 |
---|
2766 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2767 | { |
---|
2768 | return simd128<1>::ifh(simd128<(8)>::himask(), mvmd128<2>::fill2(val1, val2), mvmd128<2>::fill2(val3, val4)); |
---|
2769 | } |
---|
2770 | |
---|
2771 | //The total number of operations is 5.0 |
---|
2772 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2773 | { |
---|
2774 | return simd128<1>::ifh(simd128<(16)>::himask(), mvmd128<4>::fill2(val1, val2), mvmd128<4>::fill2(val3, val4)); |
---|
2775 | } |
---|
2776 | |
---|
2777 | //The total number of operations is 5.0 |
---|
2778 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2779 | { |
---|
2780 | return simd128<1>::ifh(simd128<(32)>::himask(), mvmd128<8>::fill2(val1, val2), mvmd128<8>::fill2(val3, val4)); |
---|
2781 | } |
---|
2782 | |
---|
2783 | //The total number of operations is 3.0 |
---|
2784 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2785 | { |
---|
2786 | return simd_or(mvmd128<(32)>::fill4((val1<<16), (val3<<16), (val1<<16), (val3<<16)), mvmd128<(32)>::fill4((val2&(65535)), (val4&(65535)), (val2&(65535)), (val4&(65535)))); |
---|
2787 | } |
---|
2788 | |
---|
2789 | //The total number of operations is 1.0 |
---|
2790 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4) |
---|
2791 | { |
---|
2792 | return _mm_set_epi32((int32_t)(val1), (int32_t)(val2), (int32_t)(val3), (int32_t)(val4)); |
---|
2793 | } |
---|
2794 | |
---|
2795 | //The total number of operations is 2.33333333333 |
---|
2796 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::srli(bitblock128_t arg1) |
---|
2797 | { |
---|
2798 | return simd128<128>::srli<(sh*2)>(arg1); |
---|
2799 | } |
---|
2800 | |
---|
2801 | //The total number of operations is 2.33333333333 |
---|
2802 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1) |
---|
2803 | { |
---|
2804 | return simd128<128>::srli<(sh*4)>(arg1); |
---|
2805 | } |
---|
2806 | |
---|
2807 | //The total number of operations is 1.0 |
---|
2808 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::srli(bitblock128_t arg1) |
---|
2809 | { |
---|
2810 | return _mm_srli_si128(arg1, (int32_t)(sh)); |
---|
2811 | } |
---|
2812 | |
---|
2813 | //The total number of operations is 1.0 |
---|
2814 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::srli(bitblock128_t arg1) |
---|
2815 | { |
---|
2816 | return mvmd128<(8)>::srli<(sh*2)>(arg1); |
---|
2817 | } |
---|
2818 | |
---|
2819 | //The total number of operations is 1.0 |
---|
2820 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1) |
---|
2821 | { |
---|
2822 | return mvmd128<(16)>::srli<(sh*2)>(arg1); |
---|
2823 | } |
---|
2824 | |
---|
2825 | //The total number of operations is 1.0 |
---|
2826 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::srli(bitblock128_t arg1) |
---|
2827 | { |
---|
2828 | return mvmd128<(32)>::srli<(sh*2)>(arg1); |
---|
2829 | } |
---|
2830 | |
---|
2831 | //The total number of operations is 1.0 |
---|
2832 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1) |
---|
2833 | { |
---|
2834 | return mvmd128<(64)>::srli<(sh*2)>(arg1); |
---|
2835 | } |
---|
2836 | |
---|
2837 | //The total number of operations is 1.0 |
---|
2838 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill2(uint64_t val1, uint64_t val2) |
---|
2839 | { |
---|
2840 | return mvmd128<(2)>::fill(((val1<<1)|(val2&(1)))); |
---|
2841 | } |
---|
2842 | |
---|
2843 | //The total number of operations is 1.0 |
---|
2844 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill2(uint64_t val1, uint64_t val2) |
---|
2845 | { |
---|
2846 | return mvmd128<(4)>::fill(((val1<<2)|(val2&(3)))); |
---|
2847 | } |
---|
2848 | |
---|
2849 | //The total number of operations is 1.0 |
---|
2850 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill2(uint64_t val1, uint64_t val2) |
---|
2851 | { |
---|
2852 | return mvmd128<(8)>::fill(((val1<<4)|(val2&(15)))); |
---|
2853 | } |
---|
2854 | |
---|
2855 | //The total number of operations is 1.0 |
---|
2856 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill2(uint64_t val1, uint64_t val2) |
---|
2857 | { |
---|
2858 | return mvmd128<(16)>::fill(((val1<<8)|(val2&(255)))); |
---|
2859 | } |
---|
2860 | |
---|
2861 | //The total number of operations is 1.0 |
---|
2862 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill2(uint64_t val1, uint64_t val2) |
---|
2863 | { |
---|
2864 | return mvmd128<(32)>::fill(((val1<<16)|(val2&(65535)))); |
---|
2865 | } |
---|
2866 | |
---|
2867 | //The total number of operations is 5.0 |
---|
2868 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(uint64_t val1, uint64_t val2) |
---|
2869 | { |
---|
2870 | return simd128<1>::ifh(simd128<(64)>::himask(), mvmd128<32>::fill(val1), mvmd128<32>::fill(val2)); |
---|
2871 | } |
---|
2872 | |
---|
2873 | //The total number of operations is 5.0 |
---|
2874 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill2(uint64_t val1, uint64_t val2) |
---|
2875 | { |
---|
2876 | return simd128<1>::ifh(simd128<(128)>::himask(), mvmd128<64>::fill(val1), mvmd128<64>::fill(val2)); |
---|
2877 | } |
---|
2878 | |
---|
2879 | //The total number of operations is 5.66666666667 |
---|
2880 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2881 | { |
---|
2882 | return simd_or(mvmd128<2>::slli<sh>(arg1), mvmd128<2>::srli<((64)-sh)>(arg2)); |
---|
2883 | } |
---|
2884 | |
---|
2885 | //The total number of operations is 5.66666666667 |
---|
2886 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2887 | { |
---|
2888 | return simd_or(mvmd128<4>::slli<sh>(arg1), mvmd128<4>::srli<((32)-sh)>(arg2)); |
---|
2889 | } |
---|
2890 | |
---|
2891 | //The total number of operations is 3.0 |
---|
2892 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2893 | { |
---|
2894 | return simd_or(mvmd128<8>::slli<sh>(arg1), mvmd128<8>::srli<((16)-sh)>(arg2)); |
---|
2895 | } |
---|
2896 | |
---|
2897 | //The total number of operations is 3.0 |
---|
2898 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2899 | { |
---|
2900 | return simd_or(mvmd128<16>::slli<sh>(arg1), mvmd128<16>::srli<((8)-sh)>(arg2)); |
---|
2901 | } |
---|
2902 | |
---|
2903 | //The total number of operations is 3.0 |
---|
2904 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2905 | { |
---|
2906 | return simd_or(mvmd128<32>::slli<sh>(arg1), mvmd128<32>::srli<((4)-sh)>(arg2)); |
---|
2907 | } |
---|
2908 | |
---|
2909 | //The total number of operations is 3.0 |
---|
2910 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2911 | { |
---|
2912 | return simd_or(mvmd128<64>::slli<sh>(arg1), mvmd128<64>::srli<((2)-sh)>(arg2)); |
---|
2913 | } |
---|
2914 | |
---|
2915 | //The total number of operations is 3.0 |
---|
2916 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dslli(bitblock128_t arg1, bitblock128_t arg2) |
---|
2917 | { |
---|
2918 | return simd_or(mvmd128<128>::slli<sh>(arg1), mvmd128<128>::srli<((1)-sh)>(arg2)); |
---|
2919 | } |
---|
2920 | |
---|
2921 | //The total number of operations is 2.33333333333 |
---|
2922 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::slli(bitblock128_t arg1) |
---|
2923 | { |
---|
2924 | return simd128<128>::slli<(sh*2)>(arg1); |
---|
2925 | } |
---|
2926 | |
---|
2927 | //The total number of operations is 2.33333333333 |
---|
2928 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1) |
---|
2929 | { |
---|
2930 | return mvmd128<(2)>::slli<(sh*2)>(arg1); |
---|
2931 | } |
---|
2932 | |
---|
2933 | //The total number of operations is 1.0 |
---|
2934 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::slli(bitblock128_t arg1) |
---|
2935 | { |
---|
2936 | return _mm_slli_si128(arg1, (int32_t)(sh)); |
---|
2937 | } |
---|
2938 | |
---|
2939 | //The total number of operations is 1.0 |
---|
2940 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1) |
---|
2941 | { |
---|
2942 | return mvmd128<(8)>::slli<(sh*2)>(arg1); |
---|
2943 | } |
---|
2944 | |
---|
2945 | //The total number of operations is 1.0 |
---|
2946 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::slli(bitblock128_t arg1) |
---|
2947 | { |
---|
2948 | return mvmd128<(16)>::slli<(sh*2)>(arg1); |
---|
2949 | } |
---|
2950 | |
---|
2951 | //The total number of operations is 1.0 |
---|
2952 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1) |
---|
2953 | { |
---|
2954 | return mvmd128<(32)>::slli<(sh*2)>(arg1); |
---|
2955 | } |
---|
2956 | |
---|
2957 | //The total number of operations is 1.0 |
---|
2958 | template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::slli(bitblock128_t arg1) |
---|
2959 | { |
---|
2960 | return mvmd128<(64)>::slli<(sh*2)>(arg1); |
---|
2961 | } |
---|
2962 | |
---|
2963 | //The total number of operations is 13.0 |
---|
2964 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8) |
---|
2965 | { |
---|
2966 | return simd128<1>::ifh(simd128<(8)>::himask(), mvmd128<1>::fill4(val1, val2, val3, val4), mvmd128<1>::fill4(val5, val6, val7, val8)); |
---|
2967 | } |
---|
2968 | |
---|
2969 | //The total number of operations is 13.0 |
---|
2970 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8) |
---|
2971 | { |
---|
2972 | return simd128<1>::ifh(simd128<(16)>::himask(), mvmd128<2>::fill4(val1, val2, val3, val4), mvmd128<2>::fill4(val5, val6, val7, val8)); |
---|
2973 | } |
---|
2974 | |
---|
2975 | //The total number of operations is 7.0 |
---|
2976 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8) |
---|
2977 | { |
---|
2978 | return simd_or(mvmd128<(8)>::fill8((val1<<4), (val3<<4), (val5<<4), (val7<<4), (val1<<4), (val3<<4), (val5<<4), (val7<<4)), mvmd128<(8)>::fill8((val2&(15)), (val4&(15)), (val6&(15)), (val8&(15)), (val2&(15)), (val4&(15)), (val6&(15)), (val8&(15)))); |
---|
2979 | } |
---|
2980 | |
---|
2981 | //The total number of operations is 3.0 |
---|
2982 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8) |
---|
2983 | { |
---|
2984 | return simd_or(mvmd128<(16)>::fill8((val1<<8), (val3<<8), (val5<<8), (val7<<8), (val1<<8), (val3<<8), (val5<<8), (val7<<8)), mvmd128<(16)>::fill8((val2&(255)), (val4&(255)), (val6&(255)), (val8&(255)), (val2&(255)), (val4&(255)), (val6&(255)), (val8&(255)))); |
---|
2985 | } |
---|
2986 | |
---|
2987 | //The total number of operations is 1.0 |
---|
2988 | template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill8(uint64_t val1, uint64_t val2, uint64_t val3, uint64_t val4, uint64_t val5, uint64_t val6, uint64_t val7, uint64_t val8) |
---|
2989 | { |
---|
2990 | return _mm_set_epi16((int32_t)(val1), (int32_t)(val2), (int32_t)(val3), (int32_t)(val4), (int32_t)(val5), (int32_t)(val6), (int32_t)(val7), (int32_t)(val8)); |
---|
2991 | } |
---|
2992 | |
---|
2993 | //The total number of operations is 13.0 |
---|
2994 | IDISA_ALWAYS_INLINE bitblock128_t bitblock128::sll(bitblock128_t arg1, bitblock128_t arg2) |
---|
2995 | { |
---|
2996 | return simd128<128>::sll(arg1, arg2); |
---|
2997 | } |
---|
2998 | |
---|
2999 | //The total number of operations is 1.0 |
---|
3000 | IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(const bitblock128_t* arg1) |
---|
3001 | { |
---|
3002 | return _mm_loadu_si128((bitblock128_t*)(arg1)); |
---|
3003 | } |
---|
3004 | |
---|
3005 | //The total number of operations is 2.33333333333 |
---|
3006 | template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t bitblock128::srli(bitblock128_t arg1) |
---|
3007 | { |
---|
3008 | return simd128<128>::srli<sh>(arg1); |
---|
3009 | } |
---|
3010 | |
---|
3011 | //The total number of operations is 1.0 |
---|
3012 | IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t arg1, bitblock128_t* arg2) |
---|
3013 | { |
---|
3014 | _mm_store_si128((bitblock128_t*)(arg2), arg1); |
---|
3015 | } |
---|
3016 | |
---|
3017 | //The total number of operations is 18.3333333333 |
---|
3018 | IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1) |
---|
3019 | { |
---|
3020 | return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1)); |
---|
3021 | } |
---|
3022 | |
---|
3023 | //The total number of operations is 2.0 |
---|
3024 | IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1) |
---|
3025 | { |
---|
3026 | return hsimd128<8>::signmask(simd128<8>::eq(arg1, simd128<8>::constant<-1>())) == 65535; |
---|
3027 | } |
---|
3028 | |
---|
3029 | //The total number of operations is 13.0 |
---|
3030 | IDISA_ALWAYS_INLINE bitblock128_t bitblock128::srl(bitblock128_t arg1, bitblock128_t arg2) |
---|
3031 | { |
---|
3032 | return simd128<128>::srl(arg1, arg2); |
---|
3033 | } |
---|
3034 | |
---|
3035 | //The total number of operations is 2.33333333333 |
---|
3036 | template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t bitblock128::slli(bitblock128_t arg1) |
---|
3037 | { |
---|
3038 | return simd128<128>::slli<sh>(arg1); |
---|
3039 | } |
---|
3040 | |
---|
3041 | //The total number of operations is 2.0 |
---|
3042 | IDISA_ALWAYS_INLINE bool bitblock128::any(bitblock128_t arg1) |
---|
3043 | { |
---|
3044 | return hsimd128<8>::signmask(simd128<8>::eq(arg1, simd128<8>::constant<0>())) != 65535; |
---|
3045 | } |
---|
3046 | |
---|
3047 | //The total number of operations is 1.0 |
---|
3048 | IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(const bitblock128_t* arg1) |
---|
3049 | { |
---|
3050 | return _mm_load_si128((bitblock128_t*)(arg1)); |
---|
3051 | } |
---|
3052 | |
---|
3053 | //The total number of operations is 1.0 |
---|
3054 | IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t arg1, bitblock128_t* arg2) |
---|
3055 | { |
---|
3056 | _mm_storeu_si128((bitblock128_t*)(arg2), arg1); |
---|
3057 | } |
---|
3058 | |
---|
3059 | #endif |
---|