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_ssse3.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
     
    11541158}
    11551159
    1156 //The total number of operations is 26
     1160//The total number of operations is 1
    11571161template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::neg(bitblock128_t arg1)
    11581162{
     
    12921296}
    12931297
    1294 //The total number of operations is 26
     1298//The total number of operations is 1
    12951299template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2)
    12961300{
    1297         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::sub(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::sub(arg1, arg2));
     1301        return simd_xor(arg1, arg2);
    12981302}
    12991303
     
    17991803}
    18001804
    1801 //The total number of operations is 24
     1805//The total number of operations is 1
    18021806template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2)
    18031807{
    1804         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::add(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::add(arg1, arg2));
     1808        return simd_xor(arg1, arg2);
    18051809}
    18061810
     
    18511855}
    18521856
    1853 //The total number of operations is 71
     1857//The total number of operations is 46
    18541858template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1)
    18551859{
     
    19451949}
    19461950
    1947 //The total number of operations is 116
     1951//The total number of operations is 93
    19481952template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2)
    19491953{
     
    30223026}
    30233027
     3028//The total number of operations is 1
     3029IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     3030{
     3031        return _mm_loadu_si128((bitblock128_t*)(arg1));
     3032}
     3033
     3034//The total number of operations is 1
     3035IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3036{
     3037        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     3038}
     3039
    30243040//The total number of operations is 22
    30253041IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     
    30403056}
    30413057
     3058//The total number of operations is 1
     3059IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3060{
     3061        return _mm_load_si128((bitblock128_t*)(arg1));
     3062}
     3063
     3064//The total number of operations is 1
     3065IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3066{
     3067        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
     3068}
     3069
    30423070#endif
Note: See TracChangeset for help on using the changeset viewer.