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