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

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

Library with field-width based integer types

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