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