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_sse3.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};
     
    8888{
    8989public:
     90        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     91        static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
    9092        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9193        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9294        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
     95        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
     96        static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
    9397};
    9498
     
    11491153}
    11501154
    1151 //The total number of operations is 26
     1155//The total number of operations is 1
    11521156template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::neg(bitblock128_t arg1)
    11531157{
     
    12871291}
    12881292
    1289 //The total number of operations is 26
     1293//The total number of operations is 1
    12901294template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2)
    12911295{
    1292         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::sub(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::sub(arg1, arg2));
     1296        return simd_xor(arg1, arg2);
    12931297}
    12941298
     
    17941798}
    17951799
    1796 //The total number of operations is 24
     1800//The total number of operations is 1
    17971801template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2)
    17981802{
    1799         return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::add(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::add(arg1, arg2));
     1803        return simd_xor(arg1, arg2);
    18001804}
    18011805
     
    18461850}
    18471851
    1848 //The total number of operations is 71
     1852//The total number of operations is 46
    18491853template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1)
    18501854{
     
    19431947}
    19441948
    1945 //The total number of operations is 116
     1949//The total number of operations is 93
    19461950template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2)
    19471951{
     
    29872991}
    29882992
     2993//The total number of operations is 1
     2994IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     2995{
     2996        return _mm_loadu_si128((bitblock128_t*)(arg1));
     2997}
     2998
     2999//The total number of operations is 1
     3000IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3001{
     3002        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     3003}
     3004
    29893005//The total number of operations is 22
    29903006IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     
    30053021}
    30063022
     3023//The total number of operations is 1
     3024IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3025{
     3026        return _mm_load_si128((bitblock128_t*)(arg1));
     3027}
     3028
     3029//The total number of operations is 1
     3030IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3031{
     3032        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
     3033}
     3034
    30073035#endif
Note: See TracChangeset for help on using the changeset viewer.