Changeset 1570 for trunk/lib/idisa_cpp/idisa_sse3.cpp
 Timestamp:
 Oct 22, 2011, 6:22:11 PM (8 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/idisa_cpp/idisa_sse3.cpp
r1557 r1570 60 60 public: 61 61 static IDISA_ALWAYS_INLINE bitblock128_t mergel(bitblock128_t arg1, bitblock128_t arg2); 62 static IDISA_ALWAYS_INLINE bitblock128_t signextendh(bitblock128_t arg1); 62 63 static IDISA_ALWAYS_INLINE bitblock128_t mergeh(bitblock128_t arg1, bitblock128_t arg2); 63 64 static IDISA_ALWAYS_INLINE bitblock128_t zeroextendh(bitblock128_t arg1); 64 65 static IDISA_ALWAYS_INLINE bitblock128_t zeroextendl(bitblock128_t arg1); 65 static IDISA_ALWAYS_INLINE bitblock128_t signextendh(bitblock128_t arg1);66 66 static IDISA_ALWAYS_INLINE bitblock128_t signextendl(bitblock128_t arg1); 67 67 }; … … 88 88 { 89 89 public: 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); 90 92 static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1); 91 93 static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1); 92 94 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); 93 97 }; 94 98 … … 1149 1153 } 1150 1154 1151 //The total number of operations is 261155 //The total number of operations is 1 1152 1156 template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::neg(bitblock128_t arg1) 1153 1157 { … … 1287 1291 } 1288 1292 1289 //The total number of operations is 261293 //The total number of operations is 1 1290 1294 template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::sub(bitblock128_t arg1, bitblock128_t arg2) 1291 1295 { 1292 return simd 128<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); 1293 1297 } 1294 1298 … … 1794 1798 } 1795 1799 1796 //The total number of operations is 241800 //The total number of operations is 1 1797 1801 template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::add(bitblock128_t arg1, bitblock128_t arg2) 1798 1802 { 1799 return simd 128<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); 1800 1804 } 1801 1805 … … 1846 1850 } 1847 1851 1848 //The total number of operations is 711852 //The total number of operations is 46 1849 1853 template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1) 1850 1854 { … … 1943 1947 } 1944 1948 1945 //The total number of operations is 1161949 //The total number of operations is 93 1946 1950 template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<2>::add_hl(bitblock128_t arg1, bitblock128_t arg2) 1947 1951 { … … 2987 2991 } 2988 2992 2993 //The total number of operations is 1 2994 IDISA_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 3000 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2) 3001 { 3002 _mm_store_si128((bitblock128_t*)(arg1), arg2); 3003 } 3004 2989 3005 //The total number of operations is 22 2990 3006 IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1) … … 3005 3021 } 3006 3022 3023 //The total number of operations is 1 3024 IDISA_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 3030 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2) 3031 { 3032 _mm_storeu_si128((bitblock128_t*)(arg1), arg2); 3033 } 3034 3007 3035 #endif
Note: See TracChangeset
for help on using the changeset viewer.