source: trunk/lib/idisa_cpp/idisa_avx.cpp @ 1573

Last change on this file since 1573 was 1573, checked in by cameron, 8 years ago

FW=1 operations

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