source: trunk/lib/idisa_cpp/idisa_sse3.cpp @ 4905

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

regenerate libraries, with negative number constants eliminated.

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