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

Added mvmd srli slli builtins and strategies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.