Ignore:
Timestamp:
Jan 21, 2012, 1:39:58 PM (8 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_sse4_2.cpp

    r1807 r1870  
    20352035template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20362036{
    2037         return (((((mvmd128<32>::extract<3>(arg1)>>28)&8)|((mvmd128<32>::extract<2>(arg1)>>29)&4))|((mvmd128<32>::extract<1>(arg1)>>30)&2))|(mvmd128<32>::extract<0>(arg1)>>31));
    2038 }
    2039 
    2040 //The total number of operations is 4.0
     2037        uint64_t tmpAns1 = hsimd128<(64)>::signmask(esimd128<32>::mergeh(arg1, simd128<32>::constant<0>()));
     2038        uint64_t tmpAns2 = hsimd128<(64)>::signmask(esimd128<32>::mergel(arg1, simd128<32>::constant<0>()));
     2039        return ((tmpAns1<<(2))+tmpAns2);
     2040}
     2041
     2042//The total number of operations is 1.0
    20412043template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20422044{
    2043         return (((mvmd128<64>::extract<1>(arg1)>>62)&2)|(mvmd128<64>::extract<0>(arg1)>>63));
    2044 }
    2045 
    2046 //The total number of operations is 9.33333333333
     2045        return _mm_movemask_pd(((__m128d)arg1));
     2046}
     2047
     2048//The total number of operations is 6.33333333333
    20472049template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<128>::signmask(bitblock128_t arg1)
    20482050{
Note: See TracChangeset for help on using the changeset viewer.