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

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

Field types fw1_t, fw2_t...

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