Changeset 1661


Ignore:
Timestamp:
Nov 5, 2011, 12:32:19 PM (7 years ago)
Author:
ksherdy
Message:

Added mvmd srli slli builtins and strategies.

Location:
trunk
Files:
8 edited

Legend:

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

    r1584 r1661  
    101101IDISA_ALWAYS_INLINE bitblock256_t simd_andc(bitblock256_t arg1, bitblock256_t arg2);
    102102IDISA_ALWAYS_INLINE bitblock256_t simd_or(bitblock256_t arg1, bitblock256_t arg2);
     103IDISA_ALWAYS_INLINE bitblock256_t simd_xor(bitblock256_t arg1, bitblock256_t arg2);
    103104IDISA_ALWAYS_INLINE bitblock256_t simd_and(bitblock256_t arg1, bitblock256_t arg2);
    104 IDISA_ALWAYS_INLINE bitblock256_t simd_xor(bitblock256_t arg1, bitblock256_t arg2);
    105105template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::max(bitblock256_t arg1, bitblock256_t arg2);
    106106template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<2>::max(bitblock256_t arg1, bitblock256_t arg2);
     
    562562
    563563//The total number of operations is 1
     564IDISA_ALWAYS_INLINE bitblock256_t simd_xor(bitblock256_t arg1, bitblock256_t arg2)
     565{
     566        return _mm256_xor_ps(arg1, arg2);
     567}
     568
     569//The total number of operations is 1
    564570IDISA_ALWAYS_INLINE bitblock256_t simd_and(bitblock256_t arg1, bitblock256_t arg2)
    565571{
    566572        return _mm256_and_ps(arg1, arg2);
    567 }
    568 
    569 //The total number of operations is 1
    570 IDISA_ALWAYS_INLINE bitblock256_t simd_xor(bitblock256_t arg1, bitblock256_t arg2)
    571 {
    572         return _mm256_xor_ps(arg1, arg2);
    573573}
    574574
     
    30973097template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<4>::srli(bitblock256_t arg1)
    30983098{
    3099         return simd256<256>::srli<(sh*4)>(arg1);
     3099        return mvmd256<(2)>::srli<(sh*2)>(arg1);
    31003100}
    31013101
     
    31093109template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::srli(bitblock256_t arg1)
    31103110{
    3111         return simd256<256>::srli<(sh*16)>(arg1);
     3111        return mvmd256<(8)>::srli<(sh*2)>(arg1);
    31123112}
    31133113
     
    31273127template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<128>::srli(bitblock256_t arg1)
    31283128{
    3129         return simd256<256>::srli<(sh*128)>(arg1);
     3129        return mvmd256<(64)>::srli<(sh*2)>(arg1);
    31303130}
    31313131
     
    32413241template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<16>::slli(bitblock256_t arg1)
    32423242{
    3243         return simd256<256>::slli<(sh*16)>(arg1);
     3243        return mvmd256<(8)>::slli<(sh*2)>(arg1);
    32443244}
    32453245
     
    32593259template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock256_t mvmd256<128>::slli(bitblock256_t arg1)
    32603260{
    3261         return simd256<256>::slli<(sh*128)>(arg1);
     3261        return mvmd256<(64)>::slli<(sh*2)>(arg1);
    32623262}
    32633263
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r1585 r1661  
    106106IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2);
    107107IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2);
     108IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    108109IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2);
    109 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    110110template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2);
    111111template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2);
     
    519519
    520520//The total number of operations is 1
     521IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
     522{
     523        return _mm_xor_si128(arg1, arg2);
     524}
     525
     526//The total number of operations is 1
    521527IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2)
    522528{
    523529        return _mm_and_si128(arg1, arg2);
    524 }
    525 
    526 //The total number of operations is 1
    527 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
    528 {
    529         return _mm_xor_si128(arg1, arg2);
    530530}
    531531
     
    25472547}
    25482548
    2549 //The total number of operations is 9
     2549//The total number of operations is 3
    25502550template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dsrli(bitblock128_t arg1, bitblock128_t arg2)
    25512551{
     
    25532553}
    25542554
    2555 //The total number of operations is 9
     2555//The total number of operations is 3
    25562556template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dsrli(bitblock128_t arg1, bitblock128_t arg2)
    25572557{
     
    25592559}
    25602560
    2561 //The total number of operations is 9
     2561//The total number of operations is 3
    25622562template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dsrli(bitblock128_t arg1, bitblock128_t arg2)
    25632563{
     
    25652565}
    25662566
    2567 //The total number of operations is 9
     2567//The total number of operations is 3
    25682568template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dsrli(bitblock128_t arg1, bitblock128_t arg2)
    25692569{
     
    25712571}
    25722572
    2573 //The total number of operations is 9
     2573//The total number of operations is 3
    25742574template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dsrli(bitblock128_t arg1, bitblock128_t arg2)
    25752575{
     
    27902790template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1)
    27912791{
    2792         return simd128<128>::srli<(sh*4)>(arg1);
    2793 }
    2794 
    2795 //The total number of operations is 4
     2792        return mvmd128<(2)>::srli<(sh*2)>(arg1);
     2793}
     2794
     2795//The total number of operations is 1
    27962796template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::srli(bitblock128_t arg1)
    27972797{
    2798         return simd128<128>::srli<(sh*8)>(arg1);
    2799 }
    2800 
    2801 //The total number of operations is 4
     2798        return _mm_srli_si128(arg1, (int32_t)(sh));
     2799}
     2800
     2801//The total number of operations is 1
    28022802template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::srli(bitblock128_t arg1)
    28032803{
    2804         return simd128<128>::srli<(sh*16)>(arg1);
    2805 }
    2806 
    2807 //The total number of operations is 4
     2804        return mvmd128<(8)>::srli<(sh*2)>(arg1);
     2805}
     2806
     2807//The total number of operations is 1
    28082808template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1)
    28092809{
    2810         return simd128<128>::srli<(sh*32)>(arg1);
    2811 }
    2812 
    2813 //The total number of operations is 4
     2810        return mvmd128<(16)>::srli<(sh*2)>(arg1);
     2811}
     2812
     2813//The total number of operations is 1
    28142814template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::srli(bitblock128_t arg1)
    28152815{
    2816         return simd128<128>::srli<(sh*64)>(arg1);
    2817 }
    2818 
    2819 //The total number of operations is 4
     2816        return mvmd128<(32)>::srli<(sh*2)>(arg1);
     2817}
     2818
     2819//The total number of operations is 1
    28202820template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1)
    28212821{
    2822         return simd128<128>::srli<(sh*128)>(arg1);
     2822        return mvmd128<(64)>::srli<(sh*2)>(arg1);
    28232823}
    28242824
     
    28772877}
    28782878
    2879 //The total number of operations is 9
     2879//The total number of operations is 3
    28802880template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::dslli(bitblock128_t arg1, bitblock128_t arg2)
    28812881{
     
    28832883}
    28842884
    2885 //The total number of operations is 9
     2885//The total number of operations is 3
    28862886template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::dslli(bitblock128_t arg1, bitblock128_t arg2)
    28872887{
     
    28892889}
    28902890
    2891 //The total number of operations is 9
     2891//The total number of operations is 3
    28922892template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::dslli(bitblock128_t arg1, bitblock128_t arg2)
    28932893{
     
    28952895}
    28962896
    2897 //The total number of operations is 9
     2897//The total number of operations is 3
    28982898template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::dslli(bitblock128_t arg1, bitblock128_t arg2)
    28992899{
     
    29012901}
    29022902
    2903 //The total number of operations is 9
     2903//The total number of operations is 3
    29042904template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::dslli(bitblock128_t arg1, bitblock128_t arg2)
    29052905{
     
    29162916template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1)
    29172917{
    2918         return simd128<128>::slli<(sh*4)>(arg1);
    2919 }
    2920 
    2921 //The total number of operations is 4
     2918        return mvmd128<(2)>::slli<(sh*2)>(arg1);
     2919}
     2920
     2921//The total number of operations is 1
    29222922template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::slli(bitblock128_t arg1)
    29232923{
    2924         return simd128<128>::slli<(sh*8)>(arg1);
    2925 }
    2926 
    2927 //The total number of operations is 4
     2924        return _mm_slli_si128(arg1, (int32_t)(sh));
     2925}
     2926
     2927//The total number of operations is 1
    29282928template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1)
    29292929{
    2930         return simd128<128>::slli<(sh*16)>(arg1);
    2931 }
    2932 
    2933 //The total number of operations is 4
     2930        return mvmd128<(8)>::slli<(sh*2)>(arg1);
     2931}
     2932
     2933//The total number of operations is 1
    29342934template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::slli(bitblock128_t arg1)
    29352935{
    2936         return simd128<128>::slli<(sh*32)>(arg1);
    2937 }
    2938 
    2939 //The total number of operations is 4
     2936        return mvmd128<(16)>::slli<(sh*2)>(arg1);
     2937}
     2938
     2939//The total number of operations is 1
    29402940template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1)
    29412941{
    2942         return simd128<128>::slli<(sh*64)>(arg1);
    2943 }
    2944 
    2945 //The total number of operations is 4
     2942        return mvmd128<(32)>::slli<(sh*2)>(arg1);
     2943}
     2944
     2945//The total number of operations is 1
    29462946template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::slli(bitblock128_t arg1)
    29472947{
    2948         return simd128<128>::slli<(sh*128)>(arg1);
     2948        return mvmd128<(64)>::slli<(sh*2)>(arg1);
    29492949}
    29502950
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1585 r1661  
    106106IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2);
    107107IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2);
     108IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    108109IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2);
    109 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    110110template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2);
    111111template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2);
     
    519519
    520520//The total number of operations is 1
     521IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
     522{
     523        return _mm_xor_si128(arg1, arg2);
     524}
     525
     526//The total number of operations is 1
    521527IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2)
    522528{
    523529        return _mm_and_si128(arg1, arg2);
    524 }
    525 
    526 //The total number of operations is 1
    527 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
    528 {
    529         return _mm_xor_si128(arg1, arg2);
    530530}
    531531
     
    27902790template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1)
    27912791{
    2792         return simd128<128>::srli<(sh*4)>(arg1);
     2792        return mvmd128<(2)>::srli<(sh*2)>(arg1);
    27932793}
    27942794
     
    28082808template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1)
    28092809{
    2810         return simd128<128>::srli<(sh*32)>(arg1);
     2810        return mvmd128<(16)>::srli<(sh*2)>(arg1);
    28112811}
    28122812
     
    28202820template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1)
    28212821{
    2822         return simd128<128>::srli<(sh*128)>(arg1);
     2822        return mvmd128<(64)>::srli<(sh*2)>(arg1);
    28232823}
    28242824
     
    29162916template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1)
    29172917{
    2918         return simd128<128>::slli<(sh*4)>(arg1);
     2918        return mvmd128<(2)>::slli<(sh*2)>(arg1);
    29192919}
    29202920
     
    29282928template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1)
    29292929{
    2930         return simd128<128>::slli<(sh*16)>(arg1);
     2930        return mvmd128<(8)>::slli<(sh*2)>(arg1);
    29312931}
    29322932
     
    29402940template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1)
    29412941{
    2942         return simd128<128>::slli<(sh*64)>(arg1);
     2942        return mvmd128<(32)>::slli<(sh*2)>(arg1);
    29432943}
    29442944
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1585 r1661  
    107107IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2);
    108108IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2);
     109IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    109110IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2);
    110 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    111111template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2);
    112112template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2);
     
    524524
    525525//The total number of operations is 1
     526IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
     527{
     528        return _mm_xor_si128(arg1, arg2);
     529}
     530
     531//The total number of operations is 1
    526532IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2)
    527533{
    528534        return _mm_and_si128(arg1, arg2);
    529 }
    530 
    531 //The total number of operations is 1
    532 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
    533 {
    534         return _mm_xor_si128(arg1, arg2);
    535535}
    536536
     
    28222822template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1)
    28232823{
    2824         return simd128<128>::srli<(sh*4)>(arg1);
     2824        return mvmd128<(2)>::srli<(sh*2)>(arg1);
    28252825}
    28262826
     
    28402840template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1)
    28412841{
    2842         return simd128<128>::srli<(sh*32)>(arg1);
     2842        return mvmd128<(16)>::srli<(sh*2)>(arg1);
    28432843}
    28442844
     
    28522852template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1)
    28532853{
    2854         return simd128<128>::srli<(sh*128)>(arg1);
     2854        return mvmd128<(64)>::srli<(sh*2)>(arg1);
    28552855}
    28562856
     
    29482948template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1)
    29492949{
    2950         return simd128<128>::slli<(sh*4)>(arg1);
     2950        return mvmd128<(2)>::slli<(sh*2)>(arg1);
    29512951}
    29522952
     
    29602960template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1)
    29612961{
    2962         return simd128<128>::slli<(sh*16)>(arg1);
     2962        return mvmd128<(8)>::slli<(sh*2)>(arg1);
    29632963}
    29642964
     
    29722972template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1)
    29732973{
    2974         return simd128<128>::slli<(sh*64)>(arg1);
     2974        return mvmd128<(32)>::slli<(sh*2)>(arg1);
    29752975}
    29762976
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1585 r1661  
    107107IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2);
    108108IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2);
     109IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    109110IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2);
    110 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    111111template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2);
    112112template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2);
     
    524524
    525525//The total number of operations is 1
     526IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
     527{
     528        return _mm_xor_si128(arg1, arg2);
     529}
     530
     531//The total number of operations is 1
    526532IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2)
    527533{
    528534        return _mm_and_si128(arg1, arg2);
    529 }
    530 
    531 //The total number of operations is 1
    532 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
    533 {
    534         return _mm_xor_si128(arg1, arg2);
    535535}
    536536
     
    28042804template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1)
    28052805{
    2806         return simd128<128>::srli<(sh*4)>(arg1);
     2806        return mvmd128<(2)>::srli<(sh*2)>(arg1);
    28072807}
    28082808
     
    28222822template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1)
    28232823{
    2824         return simd128<128>::srli<(sh*32)>(arg1);
     2824        return mvmd128<(16)>::srli<(sh*2)>(arg1);
    28252825}
    28262826
     
    28342834template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1)
    28352835{
    2836         return simd128<128>::srli<(sh*128)>(arg1);
     2836        return mvmd128<(64)>::srli<(sh*2)>(arg1);
    28372837}
    28382838
     
    29302930template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1)
    29312931{
    2932         return simd128<128>::slli<(sh*4)>(arg1);
     2932        return mvmd128<(2)>::slli<(sh*2)>(arg1);
    29332933}
    29342934
     
    29422942template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1)
    29432943{
    2944         return simd128<128>::slli<(sh*16)>(arg1);
     2944        return mvmd128<(8)>::slli<(sh*2)>(arg1);
    29452945}
    29462946
     
    29542954template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1)
    29552955{
    2956         return simd128<128>::slli<(sh*64)>(arg1);
     2956        return mvmd128<(32)>::slli<(sh*2)>(arg1);
    29572957}
    29582958
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1585 r1661  
    107107IDISA_ALWAYS_INLINE bitblock128_t simd_andc(bitblock128_t arg1, bitblock128_t arg2);
    108108IDISA_ALWAYS_INLINE bitblock128_t simd_or(bitblock128_t arg1, bitblock128_t arg2);
     109IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    109110IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2);
    110 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2);
    111111template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::max(bitblock128_t arg1, bitblock128_t arg2);
    112112template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::max(bitblock128_t arg1, bitblock128_t arg2);
     
    524524
    525525//The total number of operations is 1
     526IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
     527{
     528        return _mm_xor_si128(arg1, arg2);
     529}
     530
     531//The total number of operations is 1
    526532IDISA_ALWAYS_INLINE bitblock128_t simd_and(bitblock128_t arg1, bitblock128_t arg2)
    527533{
    528534        return _mm_and_si128(arg1, arg2);
    529 }
    530 
    531 //The total number of operations is 1
    532 IDISA_ALWAYS_INLINE bitblock128_t simd_xor(bitblock128_t arg1, bitblock128_t arg2)
    533 {
    534         return _mm_xor_si128(arg1, arg2);
    535535}
    536536
     
    28252825template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1)
    28262826{
    2827         return simd128<128>::srli<(sh*4)>(arg1);
     2827        return mvmd128<(2)>::srli<(sh*2)>(arg1);
    28282828}
    28292829
     
    28432843template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::srli(bitblock128_t arg1)
    28442844{
    2845         return simd128<128>::srli<(sh*32)>(arg1);
     2845        return mvmd128<(16)>::srli<(sh*2)>(arg1);
    28462846}
    28472847
     
    28552855template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::srli(bitblock128_t arg1)
    28562856{
    2857         return simd128<128>::srli<(sh*128)>(arg1);
     2857        return mvmd128<(64)>::srli<(sh*2)>(arg1);
    28582858}
    28592859
     
    29512951template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::slli(bitblock128_t arg1)
    29522952{
    2953         return simd128<128>::slli<(sh*4)>(arg1);
     2953        return mvmd128<(2)>::slli<(sh*2)>(arg1);
    29542954}
    29552955
     
    29632963template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::slli(bitblock128_t arg1)
    29642964{
    2965         return simd128<128>::slli<(sh*16)>(arg1);
     2965        return mvmd128<(8)>::slli<(sh*2)>(arg1);
    29662966}
    29672967
     
    29752975template <> template <uint64_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::slli(bitblock128_t arg1)
    29762976{
    2977         return simd128<128>::slli<(sh*64)>(arg1);
     2977        return mvmd128<(32)>::slli<(sh*2)>(arg1);
    29782978}
    29792979
  • trunk/libgen/Library_Generator/SSE2Instructions.py

    r1570 r1661  
    164164                "fws":[8, 16, 32, 64],
    165165        },
     166        "mvmd_srli":\
     167        {
     168                "signature":"SIMD_type _mm_srli_si128(SIMD_type arg1, int sh)",
     169                "args_type":{"arg1":"SIMD_type", "sh":"signed_int(32)"},
     170                "return_type":"SIMD_type",
     171                "fws":[8],
     172        },
     173        "mvmd_slli":\
     174        {
     175                "signature":"SIMD_type _mm_slli_si128(SIMD_type arg1, int sh)",
     176                "args_type":{"arg1":"SIMD_type", "sh":"signed_int(32)"},
     177                "return_type":"SIMD_type",
     178                "fws":[8],
     179        },     
    166180        "mvmd_fill":\
    167181        {
  • trunk/libgen/Library_Generator/StrategyPool.py

    r1579 r1661  
    17961796                "Platforms":[configure.ALL],
    17971797                },
    1798                
     1798
     1799                "mvmd_srli_halving":\
     1800                {
     1801                "body":r'''
     1802return (mvmd_srli(fw/2, sh*2, arg1))''',
     1803                "Ops":["mvmd_srli"],
     1804                "Fws":[-1],
     1805                "Platforms":[configure.ALL],
     1806                },
     1807
     1808                "mvmd_slli_halving":\
     1809                {
     1810                "body":r'''
     1811return (mvmd_slli(fw/2, sh*2, arg1))''',
     1812                "Ops":["mvmd_slli"],
     1813                "Fws":[-1],
     1814                "Platforms":[configure.ALL],
     1815                },
     1816                       
    17991817                "simd_add_2_logic":\
    18001818                {
Note: See TracChangeset for help on using the changeset viewer.