source: trunk/lib/idisa_cpp/idisa_sse2_hand.cpp @ 5257

Last change on this file since 5257 was 3525, checked in by linmengl, 6 years ago

add mvmd_insert to sse and avx. Update all sse library. Hand modified sse2 is saved as idisa_sse2_hand.cpp

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