source: trunk/lib/idisa_cpp/idisa_ssse3.cpp @ 4032

Last change on this file since 4032 was 3576, checked in by linmengl, 6 years ago

regenerate libraries, with negative number constants eliminated.

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