Ignore:
Timestamp:
Oct 22, 2011, 6:22:11 PM (8 years ago)
Author:
cameron
Message:

bitblock::(load,store) (aligned,unaligned); <1>::add, sub

File:
1 edited

Legend:

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

    r1557 r1570  
    6060public:
    6161        static IDISA_ALWAYS_INLINE bitblock128_t mergel(bitblock128_t arg1, bitblock128_t arg2);
     62        static IDISA_ALWAYS_INLINE bitblock128_t signextendh(bitblock128_t arg1);
    6263        static IDISA_ALWAYS_INLINE bitblock128_t mergeh(bitblock128_t arg1, bitblock128_t arg2);
    6364        static IDISA_ALWAYS_INLINE bitblock128_t zeroextendh(bitblock128_t arg1);
    6465        static IDISA_ALWAYS_INLINE bitblock128_t zeroextendl(bitblock128_t arg1);
    65         static IDISA_ALWAYS_INLINE bitblock128_t signextendh(bitblock128_t arg1);
    6666        static IDISA_ALWAYS_INLINE bitblock128_t signextendl(bitblock128_t arg1);
    6767};
     
    8989{
    9090public:
     91        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     92        static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
    9193        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9294        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9395        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
     96        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
     97        static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
    9498};
    9599
     
    11451149}
    11461150
    1147 //The total number of operations is 26
     1151//The total number of operations is 1
    11481152template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::neg(bitblock128_t arg1)
    11491153{
     
    12831287}
    12841288
    1285 //The total number of operations is 26
     1289//The total number of operations is 1
    12861290template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2)
    12871291{
    1288         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::sub(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::sub(arg1, arg2));
     1292        return simd_xor(arg1, arg2);
    12891293}
    12901294
     
    17791783}
    17801784
    1781 //The total number of operations is 24
     1785//The total number of operations is 1
    17821786template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2)
    17831787{
    1784         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::add(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::add(arg1, arg2));
     1788        return simd_xor(arg1, arg2);
    17851789}
    17861790
     
    18311835}
    18321836
    1833 //The total number of operations is 71
     1837//The total number of operations is 46
    18341838template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1)
    18351839{
     
    19251929}
    19261930
    1927 //The total number of operations is 116
     1931//The total number of operations is 93
    19281932template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2)
    19291933{
     
    30013005}
    30023006
     3007//The total number of operations is 1
     3008IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     3009{
     3010        return _mm_loadu_si128((bitblock128_t*)(arg1));
     3011}
     3012
     3013//The total number of operations is 1
     3014IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3015{
     3016        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     3017}
     3018
    30033019//The total number of operations is 20
    30043020IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     
    30193035}
    30203036
     3037//The total number of operations is 1
     3038IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3039{
     3040        return _mm_load_si128((bitblock128_t*)(arg1));
     3041}
     3042
     3043//The total number of operations is 1
     3044IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3045{
     3046        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
     3047}
     3048
    30213049#endif
Note: See TracChangeset for help on using the changeset viewer.