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

Last change on this file since 2330 was 2275, checked in by ksherdy, 7 years ago

Reverted previous del.

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