Changeset 1923 for trunk/lib/idisa_cpp


Ignore:
Timestamp:
Feb 11, 2012, 4:56:04 PM (7 years ago)
Author:
cameron
Message:

Corrections for simd<64>::sll, srl (mod 64 shift)

Location:
trunk/lib/idisa_cpp
Files:
5 edited

Legend:

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

    r1897 r1923  
    990990}
    991991
    992 //The total number of operations is 7.0
     992//The total number of operations is 10.0
    993993template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask)
    994994{
    995         return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_sll_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     995        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)))));
    996996}
    997997
     
    13781378}
    13791379
    1380 //The total number of operations is 7.0
     1380//The total number of operations is 10.0
    13811381template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask)
    13821382{
    1383         return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_srl_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1383        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)))));
    13841384}
    13851385
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1897 r1923  
    990990}
    991991
    992 //The total number of operations is 7.0
     992//The total number of operations is 10.0
    993993template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask)
    994994{
    995         return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_sll_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     995        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)))));
    996996}
    997997
     
    13781378}
    13791379
    1380 //The total number of operations is 7.0
     1380//The total number of operations is 10.0
    13811381template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask)
    13821382{
    1383         return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_srl_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1383        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)))));
    13841384}
    13851385
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1897 r1923  
    10001000}
    10011001
    1002 //The total number of operations is 7.0
     1002//The total number of operations is 10.0
    10031003template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask)
    10041004{
    1005         return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_sll_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1005        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)))));
    10061006}
    10071007
     
    13881388}
    13891389
    1390 //The total number of operations is 7.0
     1390//The total number of operations is 10.0
    13911391template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask)
    13921392{
    1393         return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_srl_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1393        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)))));
    13941394}
    13951395
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1897 r1923  
    992992}
    993993
    994 //The total number of operations is 7.0
     994//The total number of operations is 10.0
    995995template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask)
    996996{
    997         return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_sll_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     997        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)))));
    998998}
    999999
     
    13781378}
    13791379
    1380 //The total number of operations is 7.0
     1380//The total number of operations is 10.0
    13811381template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask)
    13821382{
    1383         return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_srl_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1383        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)))));
    13841384}
    13851385
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1897 r1923  
    995995}
    996996
    997 //The total number of operations is 7.0
     997//The total number of operations is 10.0
    998998template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::sll(bitblock128_t arg1, bitblock128_t shift_mask)
    999999{
    1000         return simd128<1>::ifh(simd128<128>::himask(), _mm_sll_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_sll_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1000        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)))));
    10011001}
    10021002
     
    13831383}
    13841384
    1385 //The total number of operations is 7.0
     1385//The total number of operations is 10.0
    13861386template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask)
    13871387{
    1388         return simd128<1>::ifh(simd128<128>::himask(), _mm_srl_epi64(arg1, _mm_srli_si128(shift_mask, (int32_t)(8))), _mm_srl_epi64(arg1, simd_andc(shift_mask, simd128<128>::himask())));
     1388        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)))));
    13891389}
    13901390
Note: See TracChangeset for help on using the changeset viewer.