Ignore:
Timestamp:
Jan 21, 2012, 1:39:58 PM (7 years ago)
Author:
cameron
Message:

signmask built-ins for 32 and 64 bits on SSE

File:
1 edited

Legend:

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

    r1807 r1870  
    20442044}
    20452045
    2046 //The total number of operations is 7.0
     2046//The total number of operations is 4.0
    20472047template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20482048{
    2049         return hsimd128<(16)>::signmask(hsimd128<32>::packh(simd128<32>::constant<0>(), arg1));
    2050 }
    2051 
    2052 //The total number of operations is 8.0
     2049        uint64_t tmpAns1 = hsimd128<(64)>::signmask(esimd128<32>::mergeh(arg1, simd128<32>::constant<0>()));
     2050        uint64_t tmpAns2 = hsimd128<(64)>::signmask(esimd128<32>::mergel(arg1, simd128<32>::constant<0>()));
     2051        return ((tmpAns1<<(2))+tmpAns2);
     2052}
     2053
     2054//The total number of operations is 1.0
    20532055template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20542056{
    2055         return (((mvmd128<64>::extract<1>(arg1)>>62)&2)|(mvmd128<64>::extract<0>(arg1)>>63));
    2056 }
    2057 
    2058 //The total number of operations is 13.3333333333
     2057        return _mm_movemask_pd(((__m128d)arg1));
     2058}
     2059
     2060//The total number of operations is 6.33333333333
    20592061template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<128>::signmask(bitblock128_t arg1)
    20602062{
Note: See TracChangeset for help on using the changeset viewer.