Changeset 1872 for trunk/lib


Ignore:
Timestamp:
Jan 21, 2012, 3:47:37 PM (8 years ago)
Author:
cameron
Message:

signmask strategy using packss

Location:
trunk/lib/idisa_cpp
Files:
6 edited

Legend:

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

    r1807 r1872  
    22932293}
    22942294
    2295 //The total number of operations is 16.0
     2295//The total number of operations is 8.0
    22962296template <> IDISA_ALWAYS_INLINE uint64_t hsimd256<16>::signmask(bitblock256_t arg1)
    22972297{
    2298         return hsimd256<(8)>::signmask(hsimd256<16>::packh(simd256<16>::constant<0>(), arg1));
    2299 }
    2300 
    2301 //The total number of operations is 29.0
     2298        return hsimd256<(8)>::signmask(hsimd256<16>::packss(simd256<16>::constant<0>(), arg1));
     2299}
     2300
     2301//The total number of operations is 13.0
    23022302template <> IDISA_ALWAYS_INLINE uint64_t hsimd256<32>::signmask(bitblock256_t arg1)
    23032303{
    2304         return hsimd256<(16)>::signmask(hsimd256<32>::packh(simd256<32>::constant<0>(), arg1));
    2305 }
    2306 
    2307 //The total number of operations is 120.0
     2304        return hsimd256<(16)>::signmask(hsimd256<32>::packss(simd256<32>::constant<0>(), arg1));
     2305}
     2306
     2307//The total number of operations is 104.0
    23082308template <> IDISA_ALWAYS_INLINE uint64_t hsimd256<64>::signmask(bitblock256_t arg1)
    23092309{
     
    23112311}
    23122312
    2313 //The total number of operations is 264.666666667
     2313//The total number of operations is 248.666666667
    23142314template <> IDISA_ALWAYS_INLINE uint64_t hsimd256<128>::signmask(bitblock256_t arg1)
    23152315{
     
    23172317}
    23182318
    2319 //The total number of operations is 282.166666667
     2319//The total number of operations is 266.166666667
    23202320template <> IDISA_ALWAYS_INLINE uint64_t hsimd256<256>::signmask(bitblock256_t arg1)
    23212321{
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r1870 r1872  
    20362036}
    20372037
    2038 //The total number of operations is 4.0
     2038//The total number of operations is 2.0
    20392039template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1)
    20402040{
    2041         uint64_t tmpAns1 = hsimd128<(32)>::signmask(esimd128<16>::mergeh(arg1, simd128<16>::constant<0>()));
    2042         uint64_t tmpAns2 = hsimd128<(32)>::signmask(esimd128<16>::mergel(arg1, simd128<16>::constant<0>()));
    2043         return ((tmpAns1<<(4))+tmpAns2);
     2041        return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1));
    20442042}
    20452043
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1870 r1872  
    20362036}
    20372037
    2038 //The total number of operations is 4.0
     2038//The total number of operations is 2.0
    20392039template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1)
    20402040{
    2041         return hsimd128<(8)>::signmask(hsimd128<16>::packh(simd128<16>::constant<0>(), arg1));
    2042 }
    2043 
    2044 //The total number of operations is 4.0
     2041        return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1));
     2042}
     2043
     2044//The total number of operations is 3.0
    20452045template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20462046{
    2047         uint64_t tmpAns1 = hsimd128<(64)>::signmask(esimd128<32>::mergeh(arg1, simd128<32>::constant<0>()));
    2048         uint64_t tmpAns2 = hsimd128<(64)>::signmask(esimd128<32>::mergel(arg1, simd128<32>::constant<0>()));
    2049         return ((tmpAns1<<(2))+tmpAns2);
     2047        return hsimd128<(16)>::signmask(hsimd128<32>::packss(simd128<32>::constant<0>(), arg1));
    20502048}
    20512049
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1870 r1872  
    20442044}
    20452045
    2046 //The total number of operations is 4.0
     2046//The total number of operations is 2.0
    20472047template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1)
    20482048{
    2049         return hsimd128<(8)>::signmask(hsimd128<16>::packh(simd128<16>::constant<0>(), arg1));
    2050 }
    2051 
    2052 //The total number of operations is 4.0
     2049        return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1));
     2050}
     2051
     2052//The total number of operations is 3.0
    20532053template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20542054{
    2055         uint64_t tmpAns1 = hsimd128<(64)>::signmask(esimd128<32>::mergeh(arg1, simd128<32>::constant<0>()));
    2056         uint64_t tmpAns2 = hsimd128<(64)>::signmask(esimd128<32>::mergel(arg1, simd128<32>::constant<0>()));
    2057         return ((tmpAns1<<(2))+tmpAns2);
     2055        return hsimd128<(16)>::signmask(hsimd128<32>::packss(simd128<32>::constant<0>(), arg1));
    20582056}
    20592057
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1870 r1872  
    20262026}
    20272027
    2028 //The total number of operations is 4.0
     2028//The total number of operations is 2.0
    20292029template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1)
    20302030{
    2031         return hsimd128<(8)>::signmask(hsimd128<16>::packh(simd128<16>::constant<0>(), arg1));
    2032 }
    2033 
    2034 //The total number of operations is 4.0
     2031        return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1));
     2032}
     2033
     2034//The total number of operations is 3.0
    20352035template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20362036{
    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);
     2037        return hsimd128<(16)>::signmask(hsimd128<32>::packss(simd128<32>::constant<0>(), arg1));
    20402038}
    20412039
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1870 r1872  
    20382038}
    20392039
    2040 //The total number of operations is 4.0
     2040//The total number of operations is 2.0
    20412041template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<16>::signmask(bitblock128_t arg1)
    20422042{
    2043         return hsimd128<(8)>::signmask(hsimd128<16>::packh(simd128<16>::constant<0>(), arg1));
    2044 }
    2045 
    2046 //The total number of operations is 4.0
     2043        return hsimd128<(8)>::signmask(hsimd128<16>::packss(simd128<16>::constant<0>(), arg1));
     2044}
     2045
     2046//The total number of operations is 3.0
    20472047template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20482048{
    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);
     2049        return hsimd128<(16)>::signmask(hsimd128<32>::packss(simd128<32>::constant<0>(), arg1));
    20522050}
    20532051
Note: See TracChangeset for help on using the changeset viewer.