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

Last change on this file since 3063 was 3063, checked in by cameron, 6 years ago

Add floating point operations: i2f, f2i, fmul, fdiv, fadd, fsub, flt, fle, feq, fsqrt

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