 Timestamp:
 Sep 8, 2013, 11:54:45 AM (5 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/lib/bitblock256.hpp
r3443 r3446 53 53 static IDISA_ALWAYS_INLINE carry_t bitblock2carry(bitblock256_t carry) { return carry;} 54 54 55 static inlinevoid add_ci_co(bitblock256_t x, bitblock256_t y, carry_t carry_in, carry_t & carry_out, bitblock256_t & sum) {55 static IDISA_ALWAYS_INLINE void add_ci_co(bitblock256_t x, bitblock256_t y, carry_t carry_in, carry_t & carry_out, bitblock256_t & sum) { 56 56 bitblock256_t all_ones = simd256<1>::constant<1>(); 57 57 bitblock256_t gen = simd_and(x, y); … … 69 69 } 70 70 71 IDISA_ALWAYS_INLINE void sub_bi_bo(bitblock256_t x, bitblock256_t y, carry_t borrow_in, carry_t & borrow_out, bitblock256_t & difference){71 static IDISA_ALWAYS_INLINE void sub_bi_bo(bitblock256_t x, bitblock256_t y, carry_t borrow_in, carry_t & borrow_out, bitblock256_t & difference){ 72 72 bitblock256_t gen = simd_andc(y, x); 73 73 bitblock256_t prop = simd_not(simd_xor(x, y)); … … 85 85 } 86 86 87 IDISA_ALWAYS_INLINE bitblock256_t convert(uint64_t s) 88 { 89 ubitblock b = {b._256 = simd256<128>::constant<0>()}; // = {0}; 90 b._64[0] = s; 91 return b._256; 92 } 93 94 IDISA_ALWAYS_INLINE bitblock128_t convert_128(uint64_t s) 95 { 96 ubitblock b = {b._256 = simd256<128>::constant<0>()}; // = {0}; 97 b._64[0] = s; 98 return b._128[0]; 99 } 100 101 IDISA_ALWAYS_INLINE uint64_t convert(bitblock256_t v) 102 { 103 return (uint64_t) mvmd256<64>::extract<0>(v); 104 } 105 106 // The code below is not used. 87 107 88 108 #ifdef AVX … … 183 203 #endif 184 204 185 186 187 188 189 205 IDISA_ALWAYS_INLINE void sbb128(bitblock128_t x, bitblock128_t y, bitblock128_t borrow_in, bitblock128_t & borrow_out, bitblock128_t & difference) 190 206 { … … 237 253 #endif 238 254 239 IDISA_ALWAYS_INLINE bitblock256_t convert(uint64_t s)240 {241 ubitblock b = {b._256 = simd256<128>::constant<0>()}; // = {0};242 b._64[0] = s;243 return b._256;244 }245 246 IDISA_ALWAYS_INLINE bitblock128_t convert_128(uint64_t s)247 {248 ubitblock b = {b._256 = simd256<128>::constant<0>()}; // = {0};249 b._64[0] = s;250 return b._128[0];251 }252 253 IDISA_ALWAYS_INLINE uint64_t convert(bitblock256_t v)254 {255 return (uint64_t) mvmd256<64>::extract<0>(v);256 }257 258 259 255 #endif // BITBLOCK256_HPP_
Note: See TracChangeset
for help on using the changeset viewer.