Changeset 3526


Ignore:
Timestamp:
Sep 30, 2013, 4:29:47 PM (5 years ago)
Author:
linmengl
Message:

fix some problem according to svn history. fix cycle countings

Location:
trunk/lib/idisa_cpp
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/idisa_cpp/idisa_avx.cpp

    r3525 r3526  
    681681}
    682682
    683 //The total number of operations is 186.666666667
     683//The total number of operations is 185.666666667
    684684template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::max(bitblock256_t arg1, bitblock256_t arg2)
    685685{
     
    763763}
    764764
    765 //The total number of operations is 2711.33333333
     765//The total number of operations is 2710.33333333
    766766template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::mult(bitblock256_t arg1, bitblock256_t arg2)
    767767{
     
    834834}
    835835
    836 //The total number of operations is 239.166666667
     836//The total number of operations is 238.166666667
    837837template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::gt(bitblock256_t arg1, bitblock256_t arg2)
    838838{
     
    989989}
    990990
    991 //The total number of operations is 182.166666667
     991//The total number of operations is 181.166666667
    992992template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ult(bitblock256_t arg1, bitblock256_t arg2)
    993993{
     
    10891089}
    10901090
    1091 //The total number of operations is 14.5
     1091//The total number of operations is 14.0
    10921092template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::srli(bitblock256_t arg1)
    10931093{
    1094         return ((sh < 128) ? simd_or(simd256<128>::srli<sh>(arg1), simd256<128>::slli<(128-sh)>(((bitblock256_t)(_mm256_castsi128_si256(avx_select_hi128(arg1)))))) : simd256<128>::srli<(sh-128)>(avx_move_hi128_to_lo128(arg1)));
     1094        return ((sh < 128) ? simd_or(simd256<128>::srli<sh>(arg1), simd256<128>::slli<(128-sh)>(_mm256_castsi128_si256(avx_select_hi128(arg1)))) : simd256<128>::srli<(sh-128)>(avx_move_hi128_to_lo128(arg1)));
    10951095}
    10961096
     
    11431143}
    11441144
    1145 //The total number of operations is 192.166666667
     1145//The total number of operations is 191.666666667
    11461146template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ctz(bitblock256_t arg1)
    11471147{
     
    12721272}
    12731273
    1274 //The total number of operations is 174.166666667
     1274//The total number of operations is 173.166666667
    12751275template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ugt(bitblock256_t arg1, bitblock256_t arg2)
    12761276{
     
    13231323}
    13241324
    1325 //The total number of operations is 16.5
     1325//The total number of operations is 16.0
    13261326template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::xor_hl(bitblock256_t arg1)
    13271327{
     
    13781378}
    13791379
    1380 //The total number of operations is 115.5
     1380//The total number of operations is 115.0
    13811381template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::popcount(bitblock256_t arg1)
    13821382{
     
    15791579}
    15801580
    1581 //The total number of operations is 29.8333333333
     1581//The total number of operations is 29.3333333333
    15821582template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ifh(bitblock256_t arg1, bitblock256_t arg2, bitblock256_t arg3)
    15831583{
     
    16281628}
    16291629
    1630 //The total number of operations is 59.0
     1630//The total number of operations is 58.5
    16311631template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::srai(bitblock256_t arg1)
    16321632{
     
    16761676}
    16771677
    1678 //The total number of operations is 91.1666666667
     1678//The total number of operations is 90.6666666667
    16791679template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::add_hl(bitblock256_t arg1)
    16801680{
     
    17391739template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock256_t simd256<2>::constant()
    17401740{
    1741         return ((val < 0) ? simd256<(4)>::constant<((val<<2)|(val^(-4)))>() : simd256<(4)>::constant<((val<<2)|val)>());
     1741        return simd256<(4)>::constant<((val<<2)|(val&(3)))>();
    17421742}
    17431743
     
    17451745template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::constant()
    17461746{
    1747         return ((val < 0) ? simd256<(8)>::constant<((val<<4)|(val^(-16)))>() : simd256<(8)>::constant<((val<<4)|val)>());
     1747        return simd256<(8)>::constant<((val<<4)|(val&(15)))>();
    17481748}
    17491749
     
    18411841}
    18421842
    1843 //The total number of operations is 186.666666667
     1843//The total number of operations is 185.666666667
    18441844template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::min(bitblock256_t arg1, bitblock256_t arg2)
    18451845{
     
    19061906}
    19071907
    1908 //The total number of operations is 132.0
     1908//The total number of operations is 131.0
    19091909template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::umin(bitblock256_t arg1, bitblock256_t arg2)
    19101910{
     
    19701970}
    19711971
    1972 //The total number of operations is 132.0
     1972//The total number of operations is 131.0
    19731973template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::umax(bitblock256_t arg1, bitblock256_t arg2)
    19741974{
     
    20362036}
    20372037
    2038 //The total number of operations is 263.166666667
     2038//The total number of operations is 262.166666667
    20392039template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::lt(bitblock256_t arg1, bitblock256_t arg2)
    20402040{
     
    21002100}
    21012101
    2102 //The total number of operations is 54.1666666667
     2102//The total number of operations is 53.6666666667
    21032103template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::eq(bitblock256_t arg1, bitblock256_t arg2)
    21042104{
     
    22672267}
    22682268
    2269 //The total number of operations is 204.833333333
     2269//The total number of operations is 204.333333333
    22702270template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::abs(bitblock256_t arg1)
    22712271{
     
    22742274}
    22752275
    2276 //The total number of operations is 233.0
     2276//The total number of operations is 227.0
    22772277template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    22782278{
     
    22802280}
    22812281
    2282 //The total number of operations is 186.0
     2282//The total number of operations is 182.0
    22832283template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    22842284{
     
    22862286}
    22872287
    2288 //The total number of operations is 106.0
     2288//The total number of operations is 104.0
    22892289template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    22902290{
     
    23042304}
    23052305
    2306 //The total number of operations is 179.0
     2306//The total number of operations is 175.0
    23072307template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23082308{
     
    23102310}
    23112311
    2312 //The total number of operations is 203.666666667
     2312//The total number of operations is 201.666666667
    23132313template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23142314{
     
    23162316}
    23172317
    2318 //The total number of operations is 81.1666666667
     2318//The total number of operations is 80.6666666667
    23192319template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23202320{
     
    23222322}
    23232323
    2324 //The total number of operations is 233.0
     2324//The total number of operations is 227.0
    23252325template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23262326{
     
    23282328}
    23292329
    2330 //The total number of operations is 178.0
     2330//The total number of operations is 174.0
    23312331template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23322332{
     
    23342334}
    23352335
    2336 //The total number of operations is 106.0
     2336//The total number of operations is 104.0
    23372337template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23382338{
     
    23582358}
    23592359
    2360 //The total number of operations is 197.666666667
     2360//The total number of operations is 195.666666667
    23612361template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23622362{
     
    23642364}
    23652365
    2366 //The total number of operations is 60.8333333333
     2366//The total number of operations is 60.3333333333
    23672367template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23682368{
     
    23702370}
    23712371
    2372 //The total number of operations is 226.0
     2372//The total number of operations is 223.0
    23732373template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packss(bitblock256_t arg1, bitblock256_t arg2)
    23742374{
     
    23782378}
    23792379
    2380 //The total number of operations is 183.0
     2380//The total number of operations is 181.0
    23812381template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packss(bitblock256_t arg1, bitblock256_t arg2)
    23822382{
     
    23862386}
    23872387
    2388 //The total number of operations is 80.0
     2388//The total number of operations is 79.0
    23892389template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packss(bitblock256_t arg1, bitblock256_t arg2)
    23902390{
     
    24062406}
    24072407
    2408 //The total number of operations is 120.0
     2408//The total number of operations is 118.0
    24092409template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24102410{
     
    24142414}
    24152415
    2416 //The total number of operations is 329.333333333
     2416//The total number of operations is 328.333333333
    24172417template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24182418{
     
    24222422}
    24232423
    2424 //The total number of operations is 1001.16666667
     2424//The total number of operations is 996.666666667
    24252425template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24262426{
     
    24482448}
    24492449
    2450 //The total number of operations is 104.0
     2450//The total number of operations is 102.0
    24512451template <> IDISA_ALWAYS_INLINE FieldType<256/64>::T hsimd256<64>::signmask(bitblock256_t arg1)
    24522452{
     
    24542454}
    24552455
    2456 //The total number of operations is 248.666666667
     2456//The total number of operations is 245.666666667
    24572457template <> IDISA_ALWAYS_INLINE FieldType<256/128>::T hsimd256<128>::signmask(bitblock256_t arg1)
    24582458{
     
    24602460}
    24612461
    2462 //The total number of operations is 266.166666667
     2462//The total number of operations is 262.666666667
    24632463template <> IDISA_ALWAYS_INLINE FieldType<256/256>::T hsimd256<256>::signmask(bitblock256_t arg1)
    24642464{
     
    24662466}
    24672467
    2468 //The total number of operations is 112.0
     2468//The total number of operations is 109.0
    24692469template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packl(bitblock256_t arg1, bitblock256_t arg2)
    24702470{
     
    24722472}
    24732473
    2474 //The total number of operations is 77.0
     2474//The total number of operations is 75.0
    24752475template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packl(bitblock256_t arg1, bitblock256_t arg2)
    24762476{
     
    24782478}
    24792479
    2480 //The total number of operations is 42.0
     2480//The total number of operations is 41.0
    24812481template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packl(bitblock256_t arg1, bitblock256_t arg2)
    24822482{
     
    24962496}
    24972497
    2498 //The total number of operations is 83.0
     2498//The total number of operations is 81.0
    24992499template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25002500{
     
    25022502}
    25032503
    2504 //The total number of operations is 48.0
     2504//The total number of operations is 47.0
    25052505template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25062506{
     
    25142514}
    25152515
    2516 //The total number of operations is 120.0
     2516//The total number of operations is 117.0
    25172517template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25182518{
     
    25202520}
    25212521
    2522 //The total number of operations is 85.0
     2522//The total number of operations is 83.0
    25232523template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25242524{
     
    25262526}
    25272527
    2528 //The total number of operations is 50.0
     2528//The total number of operations is 49.0
    25292529template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25302530{
     
    25442544}
    25452545
    2546 //The total number of operations is 91.0
     2546//The total number of operations is 89.0
    25472547template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25482548{
     
    25502550}
    25512551
    2552 //The total number of operations is 144.666666667
     2552//The total number of operations is 143.666666667
    25532553template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25542554{
     
    25562556}
    25572557
    2558 //The total number of operations is 17.5
     2558//The total number of operations is 17.0
    25592559template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25602560{
     
    25622562}
    25632563
    2564 //The total number of operations is 233.0
     2564//The total number of operations is 227.0
    25652565template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    25662566{
     
    25682568}
    25692569
    2570 //The total number of operations is 187.0
     2570//The total number of operations is 183.0
    25712571template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    25722572{
     
    25742574}
    25752575
    2576 //The total number of operations is 109.0
     2576//The total number of operations is 107.0
    25772577template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    25782578{
     
    25922592}
    25932593
    2594 //The total number of operations is 179.0
     2594//The total number of operations is 175.0
    25952595template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    25962596{
     
    25982598}
    25992599
    2600 //The total number of operations is 200.666666667
     2600//The total number of operations is 198.666666667
    26012601template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26022602{
     
    26042604}
    26052605
    2606 //The total number of operations is 89.1666666667
     2606//The total number of operations is 88.6666666667
    26072607template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26082608{
     
    26102610}
    26112611
    2612 //The total number of operations is 170.0
     2612//The total number of operations is 167.0
    26132613template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26142614{
     
    26202620}
    26212621
    2622 //The total number of operations is 157.0
     2622//The total number of operations is 155.0
    26232623template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26242624{
     
    26302630}
    26312631
    2632 //The total number of operations is 76.0
     2632//The total number of operations is 75.0
    26332633template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26342634{
     
    26522652}
    26532653
    2654 //The total number of operations is 103.0
     2654//The total number of operations is 101.0
    26552655template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26562656{
     
    26622662}
    26632663
    2664 //The total number of operations is 128.0
     2664//The total number of operations is 127.0
    26652665template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26662666{
     
    26722672}
    26732673
    2674 //The total number of operations is 112.833333333
     2674//The total number of operations is 112.333333333
    26752675template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26762676{
     
    28332833}
    28342834
    2835 //The total number of operations is 14.5
     2835//The total number of operations is 14.0
    28362836template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::zeroextendh(bitblock256_t arg1)
    28372837{
     
    29292929}
    29302930
    2931 //The total number of operations is 59.0
     2931//The total number of operations is 58.5
    29322932template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::signextendh(bitblock256_t arg1)
    29332933{
     
    29772977}
    29782978
    2979 //The total number of operations is 73.0
     2979//The total number of operations is 72.5
    29802980template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::signextendl(bitblock256_t arg1)
    29812981{
     
    29832983}
    29842984
    2985 //The total number of operations is 29.5
     2985//The total number of operations is 29.0
    29862986template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    29872987{
     
    29892989}
    29902990
    2991 //The total number of operations is 29.5
     2991//The total number of operations is 29.0
    29922992template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    29932993{
     
    29952995}
    29962996
    2997 //The total number of operations is 29.5
     2997//The total number of operations is 29.0
    29982998template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    29992999{
     
    30013001}
    30023002
    3003 //The total number of operations is 29.5
     3003//The total number of operations is 29.0
    30043004template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30053005{
     
    30073007}
    30083008
    3009 //The total number of operations is 29.5
     3009//The total number of operations is 29.0
    30103010template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30113011{
     
    30133013}
    30143014
    3015 //The total number of operations is 29.5
     3015//The total number of operations is 29.0
    30163016template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<64>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30173017{
     
    30193019}
    30203020
    3021 //The total number of operations is 29.5
     3021//The total number of operations is 29.0
    30223022template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<128>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30233023{
     
    30253025}
    30263026
    3027 //The total number of operations is 29.5
     3027//The total number of operations is 29.0
    30283028template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<256>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30293029{
     
    32533253}
    32543254
    3255 //The total number of operations is 14.5
     3255//The total number of operations is 14.0
    32563256template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::srli(bitblock256_t arg1)
    32573257{
     
    32593259}
    32603260
    3261 //The total number of operations is 14.5
     3261//The total number of operations is 14.0
    32623262template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::srli(bitblock256_t arg1)
    32633263{
     
    32653265}
    32663266
    3267 //The total number of operations is 14.5
     3267//The total number of operations is 14.0
    32683268template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::srli(bitblock256_t arg1)
    32693269{
     
    32713271}
    32723272
    3273 //The total number of operations is 14.5
     3273//The total number of operations is 14.0
    32743274template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::srli(bitblock256_t arg1)
    32753275{
     
    32773277}
    32783278
    3279 //The total number of operations is 14.5
     3279//The total number of operations is 14.0
    32803280template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::srli(bitblock256_t arg1)
    32813281{
     
    32833283}
    32843284
    3285 //The total number of operations is 14.5
     3285//The total number of operations is 14.0
    32863286template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<64>::srli(bitblock256_t arg1)
    32873287{
     
    32893289}
    32903290
    3291 //The total number of operations is 14.5
     3291//The total number of operations is 14.0
    32923292template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<128>::srli(bitblock256_t arg1)
    32933293{
     
    32953295}
    32963296
    3297 //The total number of operations is 14.5
     3297//The total number of operations is 14.0
    32983298template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<256>::srli(bitblock256_t arg1)
    32993299{
     
    33493349}
    33503350
    3351 //The total number of operations is 29.5
     3351//The total number of operations is 29.0
    33523352template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33533353{
     
    33553355}
    33563356
    3357 //The total number of operations is 29.5
     3357//The total number of operations is 29.0
    33583358template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33593359{
     
    33613361}
    33623362
    3363 //The total number of operations is 29.5
     3363//The total number of operations is 29.0
    33643364template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33653365{
     
    33673367}
    33683368
    3369 //The total number of operations is 29.5
     3369//The total number of operations is 29.0
    33703370template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33713371{
     
    33733373}
    33743374
    3375 //The total number of operations is 29.5
     3375//The total number of operations is 29.0
    33763376template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33773377{
     
    33793379}
    33803380
    3381 //The total number of operations is 29.5
     3381//The total number of operations is 29.0
    33823382template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<64>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33833383{
     
    33853385}
    33863386
    3387 //The total number of operations is 29.5
     3387//The total number of operations is 29.0
    33883388template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<128>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33893389{
     
    33913391}
    33923392
    3393 //The total number of operations is 29.5
     3393//The total number of operations is 29.0
    33943394template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<256>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    33953395{
     
    34873487}
    34883488
    3489 //The total number of operations is 14.5
     3489//The total number of operations is 14.0
    34903490template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t bitblock256::srli(bitblock256_t arg1)
    34913491{
     
    34933493}
    34943494
    3495 //The total number of operations is 118.5
     3495//The total number of operations is 118.0
    34963496IDISA_ALWAYS_INLINE uint16_t bitblock256::popcount(bitblock256_t arg1)
    34973497{
  • trunk/lib/idisa_cpp/idisa_avx2.cpp

    r3525 r3526  
    699699}
    700700
    701 //The total number of operations is 117.666666667
     701//The total number of operations is 116.666666667
    702702template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::max(bitblock256_t arg1, bitblock256_t arg2)
    703703{
     
    781781}
    782782
    783 //The total number of operations is 1401.33333333
     783//The total number of operations is 1400.33333333
    784784template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::mult(bitblock256_t arg1, bitblock256_t arg2)
    785785{
     
    851851}
    852852
    853 //The total number of operations is 133.791666667
     853//The total number of operations is 132.791666667
    854854template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::gt(bitblock256_t arg1, bitblock256_t arg2)
    855855{
     
    10061006}
    10071007
    1008 //The total number of operations is 105.041666667
     1008//The total number of operations is 104.041666667
    10091009template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ult(bitblock256_t arg1, bitblock256_t arg2)
    10101010{
     
    11061106}
    11071107
    1108 //The total number of operations is 10.0
     1108//The total number of operations is 9.5
    11091109template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::srli(bitblock256_t arg1)
    11101110{
    1111         return ((sh < 128) ? simd_or(simd256<128>::srli<sh>(arg1), simd256<128>::slli<(128-sh)>(((bitblock256_t)(_mm256_castsi128_si256(avx_select_hi128(arg1)))))) : simd256<128>::srli<(sh-128)>(avx_move_hi128_to_lo128(arg1)));
     1111        return ((sh < 128) ? simd_or(simd256<128>::srli<sh>(arg1), simd256<128>::slli<(128-sh)>(_mm256_castsi128_si256(avx_select_hi128(arg1)))) : simd256<128>::srli<(sh-128)>(avx_move_hi128_to_lo128(arg1)));
    11121112}
    11131113
     
    13161316}
    13171317
    1318 //The total number of operations is 101.041666667
     1318//The total number of operations is 100.041666667
    13191319template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ugt(bitblock256_t arg1, bitblock256_t arg2)
    13201320{
     
    13671367}
    13681368
    1369 //The total number of operations is 12.0
     1369//The total number of operations is 11.5
    13701370template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::xor_hl(bitblock256_t arg1)
    13711371{
     
    16341634}
    16351635
    1636 //The total number of operations is 25.3333333333
     1636//The total number of operations is 24.8333333333
    16371637template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::ifh(bitblock256_t arg1, bitblock256_t arg2, bitblock256_t arg3)
    16381638{
     
    16841684}
    16851685
    1686 //The total number of operations is 33.125
     1686//The total number of operations is 32.625
    16871687template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::srai(bitblock256_t arg1)
    16881688{
     
    17321732}
    17331733
    1734 //The total number of operations is 54.1666666667
     1734//The total number of operations is 53.6666666667
    17351735template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::add_hl(bitblock256_t arg1)
    17361736{
     
    18221822template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock256_t simd256<2>::constant()
    18231823{
    1824         return ((val < 0) ? simd256<(4)>::constant<((val<<2)|(val^(-4)))>() : simd256<(4)>::constant<((val<<2)|val)>());
     1824        return simd256<(4)>::constant<((val<<2)|(val&(3)))>();
    18251825}
    18261826
     
    18281828template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::constant()
    18291829{
    1830         return ((val < 0) ? simd256<(8)>::constant<((val<<4)|(val^(-16)))>() : simd256<(8)>::constant<((val<<4)|val)>());
     1830        return simd256<(8)>::constant<((val<<4)|(val&(15)))>();
    18311831}
    18321832
     
    19201920}
    19211921
    1922 //The total number of operations is 117.666666667
     1922//The total number of operations is 116.666666667
    19231923template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::min(bitblock256_t arg1, bitblock256_t arg2)
    19241924{
     
    19821982}
    19831983
    1984 //The total number of operations is 85.0
     1984//The total number of operations is 84.0
    19851985template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::umin(bitblock256_t arg1, bitblock256_t arg2)
    19861986{
     
    20432043}
    20442044
    2045 //The total number of operations is 85.0
     2045//The total number of operations is 84.0
    20462046template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::umax(bitblock256_t arg1, bitblock256_t arg2)
    20472047{
     
    21082108}
    21092109
    2110 //The total number of operations is 145.791666667
     2110//The total number of operations is 144.791666667
    21112111template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::lt(bitblock256_t arg1, bitblock256_t arg2)
    21122112{
     
    21722172}
    21732173
    2174 //The total number of operations is 35.1666666667
     2174//The total number of operations is 34.6666666667
    21752175template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::eq(bitblock256_t arg1, bitblock256_t arg2)
    21762176{
     
    23392339}
    23402340
    2341 //The total number of operations is 121.333333333
     2341//The total number of operations is 120.833333333
    23422342template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<256>::abs(bitblock256_t arg1)
    23432343{
     
    23462346}
    23472347
    2348 //The total number of operations is 169.0
     2348//The total number of operations is 163.0
    23492349template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23502350{
     
    23522352}
    23532353
    2354 //The total number of operations is 132.0
     2354//The total number of operations is 128.0
    23552355template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23562356{
     
    23582358}
    23592359
    2360 //The total number of operations is 70.0
     2360//The total number of operations is 68.0
    23612361template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23622362{
     
    23762376}
    23772377
    2378 //The total number of operations is 132.0
     2378//The total number of operations is 128.0
    23792379template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23802380{
     
    23822382}
    23832383
    2384 //The total number of operations is 154.666666667
     2384//The total number of operations is 152.666666667
    23852385template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23862386{
     
    23882388}
    23892389
    2390 //The total number of operations is 54.1666666667
     2390//The total number of operations is 53.6666666667
    23912391template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::umin_hl(bitblock256_t arg1, bitblock256_t arg2)
    23922392{
     
    23942394}
    23952395
    2396 //The total number of operations is 169.0
     2396//The total number of operations is 163.0
    23972397template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    23982398{
     
    24002400}
    24012401
    2402 //The total number of operations is 129.0
     2402//The total number of operations is 125.0
    24032403template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    24042404{
     
    24062406}
    24072407
    2408 //The total number of operations is 70.0
     2408//The total number of operations is 68.0
    24092409template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    24102410{
     
    24342434}
    24352435
    2436 //The total number of operations is 148.666666667
     2436//The total number of operations is 146.666666667
    24372437template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    24382438{
     
    24402440}
    24412441
    2442 //The total number of operations is 37.8333333333
     2442//The total number of operations is 37.3333333333
    24432443template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::add_hl(bitblock256_t arg1, bitblock256_t arg2)
    24442444{
     
    24462446}
    24472447
    2448 //The total number of operations is 158.0
     2448//The total number of operations is 155.0
    24492449template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24502450{
     
    24542454}
    24552455
    2456 //The total number of operations is 112.0
     2456//The total number of operations is 110.0
    24572457template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24582458{
     
    24622462}
    24632463
    2464 //The total number of operations is 50.0
     2464//The total number of operations is 49.0
    24652465template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24662466{
     
    24862486}
    24872487
    2488 //The total number of operations is 82.5
     2488//The total number of operations is 80.5
    24892489template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24902490{
     
    24942494}
    24952495
    2496 //The total number of operations is 187.833333333
     2496//The total number of operations is 186.833333333
    24972497template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packss(bitblock256_t arg1, bitblock256_t arg2)
    24982498{
     
    25022502}
    25032503
    2504 //The total number of operations is 570.666666667
     2504//The total number of operations is 566.166666667
    25052505template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packss(bitblock256_t arg1, bitblock256_t arg2)
    25062506{
     
    25222522}
    25232523
    2524 //The total number of operations is 2.0
     2524//The total number of operations is 1.0
    25252525template <> IDISA_ALWAYS_INLINE FieldType<256/32>::T hsimd256<32>::signmask(bitblock256_t arg1)
    25262526{
     
    25282528}
    25292529
    2530 //The total number of operations is 2.0
     2530//The total number of operations is 1.0
    25312531template <> IDISA_ALWAYS_INLINE FieldType<256/64>::T hsimd256<64>::signmask(bitblock256_t arg1)
    25322532{
     
    25342534}
    25352535
    2536 //The total number of operations is 111.166666667
     2536//The total number of operations is 109.166666667
    25372537template <> IDISA_ALWAYS_INLINE FieldType<256/128>::T hsimd256<128>::signmask(bitblock256_t arg1)
    25382538{
     
    25402540}
    25412541
    2542 //The total number of operations is 124.166666667
     2542//The total number of operations is 121.666666667
    25432543template <> IDISA_ALWAYS_INLINE FieldType<256/256>::T hsimd256<256>::signmask(bitblock256_t arg1)
    25442544{
     
    25462546}
    25472547
    2548 //The total number of operations is 83.0
     2548//The total number of operations is 80.0
    25492549template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25502550{
     
    25522552}
    25532553
    2554 //The total number of operations is 57.0
     2554//The total number of operations is 55.0
    25552555template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25562556{
     
    25582558}
    25592559
    2560 //The total number of operations is 31.0
     2560//The total number of operations is 30.0
    25612561template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25622562{
     
    25762576}
    25772577
    2578 //The total number of operations is 64.5
     2578//The total number of operations is 62.5
    25792579template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25802580{
     
    25822582}
    25832583
    2584 //The total number of operations is 38.5
     2584//The total number of operations is 37.5
    25852585template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packl(bitblock256_t arg1, bitblock256_t arg2)
    25862586{
     
    25942594}
    25952595
    2596 //The total number of operations is 85.0
     2596//The total number of operations is 82.0
    25972597template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packh(bitblock256_t arg1, bitblock256_t arg2)
    25982598{
     
    26002600}
    26012601
    2602 //The total number of operations is 59.0
     2602//The total number of operations is 57.0
    26032603template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packh(bitblock256_t arg1, bitblock256_t arg2)
    26042604{
     
    26062606}
    26072607
    2608 //The total number of operations is 33.0
     2608//The total number of operations is 32.0
    26092609template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packh(bitblock256_t arg1, bitblock256_t arg2)
    26102610{
     
    26242624}
    26252625
    2626 //The total number of operations is 66.5
     2626//The total number of operations is 64.5
    26272627template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packh(bitblock256_t arg1, bitblock256_t arg2)
    26282628{
     
    26302630}
    26312631
    2632 //The total number of operations is 109.166666667
     2632//The total number of operations is 108.166666667
    26332633template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packh(bitblock256_t arg1, bitblock256_t arg2)
    26342634{
     
    26362636}
    26372637
    2638 //The total number of operations is 13.0
     2638//The total number of operations is 12.5
    26392639template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packh(bitblock256_t arg1, bitblock256_t arg2)
    26402640{
     
    26422642}
    26432643
    2644 //The total number of operations is 169.0
     2644//The total number of operations is 163.0
    26452645template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26462646{
     
    26482648}
    26492649
    2650 //The total number of operations is 134.0
     2650//The total number of operations is 130.0
    26512651template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26522652{
     
    26542654}
    26552655
    2656 //The total number of operations is 73.0
     2656//The total number of operations is 71.0
    26572657template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26582658{
     
    26722672}
    26732673
    2674 //The total number of operations is 132.0
     2674//The total number of operations is 128.0
    26752675template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26762676{
     
    26782678}
    26792679
    2680 //The total number of operations is 151.666666667
     2680//The total number of operations is 149.666666667
    26812681template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26822682{
     
    26842684}
    26852685
    2686 //The total number of operations is 58.1666666667
     2686//The total number of operations is 57.6666666667
    26872687template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::min_hl(bitblock256_t arg1, bitblock256_t arg2)
    26882688{
     
    26902690}
    26912691
    2692 //The total number of operations is 123.0
     2692//The total number of operations is 120.0
    26932693template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packus(bitblock256_t arg1, bitblock256_t arg2)
    26942694{
     
    27002700}
    27012701
    2702 //The total number of operations is 109.0
     2702//The total number of operations is 107.0
    27032703template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packus(bitblock256_t arg1, bitblock256_t arg2)
    27042704{
     
    27102710}
    27112711
    2712 //The total number of operations is 43.0
     2712//The total number of operations is 42.0
    27132713template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<8>::packus(bitblock256_t arg1, bitblock256_t arg2)
    27142714{
     
    27362736}
    27372737
    2738 //The total number of operations is 82.5
     2738//The total number of operations is 80.5
    27392739template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<64>::packus(bitblock256_t arg1, bitblock256_t arg2)
    27402740{
     
    27462746}
    27472747
    2748 //The total number of operations is 98.5
     2748//The total number of operations is 97.5
    27492749template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<128>::packus(bitblock256_t arg1, bitblock256_t arg2)
    27502750{
     
    27562756}
    27572757
    2758 //The total number of operations is 71.5833333333
     2758//The total number of operations is 71.0833333333
    27592759template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<256>::packus(bitblock256_t arg1, bitblock256_t arg2)
    27602760{
     
    29172917}
    29182918
    2919 //The total number of operations is 10.0
     2919//The total number of operations is 9.5
    29202920template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::zeroextendh(bitblock256_t arg1)
    29212921{
     
    30133013}
    30143014
    3015 //The total number of operations is 33.125
     3015//The total number of operations is 32.625
    30163016template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::signextendh(bitblock256_t arg1)
    30173017{
     
    30613061}
    30623062
    3063 //The total number of operations is 42.625
     3063//The total number of operations is 42.125
    30643064template <> IDISA_ALWAYS_INLINE bitblock256_t esimd256<128>::signextendl(bitblock256_t arg1)
    30653065{
     
    30673067}
    30683068
    3069 //The total number of operations is 20.5
     3069//The total number of operations is 20.0
    30703070template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30713071{
     
    30733073}
    30743074
    3075 //The total number of operations is 20.5
     3075//The total number of operations is 20.0
    30763076template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30773077{
     
    30793079}
    30803080
    3081 //The total number of operations is 20.5
     3081//The total number of operations is 20.0
    30823082template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30833083{
     
    30853085}
    30863086
    3087 //The total number of operations is 20.5
     3087//The total number of operations is 20.0
    30883088template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30893089{
     
    30913091}
    30923092
    3093 //The total number of operations is 20.5
     3093//The total number of operations is 20.0
    30943094template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::dsrli(bitblock256_t arg1, bitblock256_t arg2)
    30953095{
     
    33793379}
    33803380
    3381 //The total number of operations is 10.0
     3381//The total number of operations is 9.5
    33823382template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::srli(bitblock256_t arg1)
    33833383{
     
    33853385}
    33863386
    3387 //The total number of operations is 10.0
     3387//The total number of operations is 9.5
    33883388template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::srli(bitblock256_t arg1)
    33893389{
     
    33913391}
    33923392
    3393 //The total number of operations is 10.0
     3393//The total number of operations is 9.5
    33943394template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::srli(bitblock256_t arg1)
    33953395{
     
    33973397}
    33983398
    3399 //The total number of operations is 10.0
     3399//The total number of operations is 9.5
    34003400template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::srli(bitblock256_t arg1)
    34013401{
     
    34033403}
    34043404
    3405 //The total number of operations is 10.0
     3405//The total number of operations is 9.5
    34063406template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::srli(bitblock256_t arg1)
    34073407{
     
    34753475}
    34763476
    3477 //The total number of operations is 20.5
     3477//The total number of operations is 20.0
    34783478template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<2>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    34793479{
     
    34813481}
    34823482
    3483 //The total number of operations is 20.5
     3483//The total number of operations is 20.0
    34843484template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    34853485{
     
    34873487}
    34883488
    3489 //The total number of operations is 20.5
     3489//The total number of operations is 20.0
    34903490template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<8>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    34913491{
     
    34933493}
    34943494
    3495 //The total number of operations is 20.5
     3495//The total number of operations is 20.0
    34963496template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    34973497{
     
    34993499}
    35003500
    3501 //The total number of operations is 20.5
     3501//The total number of operations is 20.0
    35023502template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<32>::dslli(bitblock256_t arg1, bitblock256_t arg2)
    35033503{
     
    36193619}
    36203620
    3621 //The total number of operations is 10.0
     3621//The total number of operations is 9.5
    36223622template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock256_t bitblock256::srli(bitblock256_t arg1)
    36233623{
  • trunk/lib/idisa_cpp/idisa_neon.cpp

    r3525 r3526  
    14061406template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    14071407{
    1408         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1408        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    14091409}
    14101410
     
    14121412template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    14131413{
    1414         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1414        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    14151415}
    14161416
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r3525 r3526  
    15781578template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    15791579{
    1580         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1580        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    15811581}
    15821582
     
    15841584template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    15851585{
    1586         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1586        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    15871587}
    15881588
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r3525 r3526  
    15781578template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    15791579{
    1580         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1580        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    15811581}
    15821582
     
    15841584template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    15851585{
    1586         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1586        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    15871587}
    15881588
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r3525 r3526  
    15881588template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    15891589{
    1590         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1590        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    15911591}
    15921592
     
    15941594template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    15951595{
    1596         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1596        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    15971597}
    15981598
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r3525 r3526  
    15791579template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    15801580{
    1581         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1581        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    15821582}
    15831583
     
    15851585template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    15861586{
    1587         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1587        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    15881588}
    15891589
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r3525 r3526  
    15831583template <> template <FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant()
    15841584{
    1585         return ((val < 0) ? simd128<(4)>::constant<((val<<2)|(val^(-4)))>() : simd128<(4)>::constant<((val<<2)|val)>());
     1585        return simd128<(4)>::constant<((val<<2)|(val&(3)))>();
    15861586}
    15871587
     
    15891589template <> template <FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant()
    15901590{
    1591         return ((val < 0) ? simd128<(8)>::constant<((val<<4)|(val^(-16)))>() : simd128<(8)>::constant<((val<<4)|val)>());
     1591        return simd128<(8)>::constant<((val<<4)|(val&(15)))>();
    15921592}
    15931593
Note: See TracChangeset for help on using the changeset viewer.