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

Last change on this file since 2196 was 2191, checked in by cameron, 7 years ago

Replace sh-128 with sh&12

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