source: trunk/lib/idisa_cpp/idisa_sse2.cpp @ 2326

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

Try int for simd<fw>::constant

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