Browse Source

Fix left value warning in SWAPDWORDS + groestl change

master
Tanguy Pruvot 10 years ago
parent
commit
149143d5cd
  1. 2
      cuda_helper.h
  2. 4
      groestl_functions_quad.cu

2
cuda_helper.h

@ -343,7 +343,7 @@ uint64_t ROTL64(const uint64_t x, const int offset)
#endif #endif
__device__ __forceinline__ __device__ __forceinline__
uint64_t SWAPDWORDS(const uint64_t value) uint64_t SWAPDWORDS(uint64_t value)
{ {
#if __CUDA_ARCH__ >= 320 #if __CUDA_ARCH__ >= 320
uint2 temp; uint2 temp;

4
groestl_functions_quad.cu

@ -32,8 +32,8 @@ void G256_AddRoundConstantQ_quad(uint32_t &x7, uint32_t &x6, uint32_t &x5, uint3
int andmask = 0xFFFF0000; int andmask = 0xFFFF0000;
#else #else
/* from sp: weird but faster */ /* from sp: faster (branching problem with if ?) */
int andmask = ((~((threadIdx.x & 0x03) - 3)) & 0xFFFF0000); uint32_t andmask = -((threadIdx.x & 3) == 3) & 0xFFFF0000U;
#endif #endif
x0 ^= ((- (rnd & 0x01) ) & andmask); x0 ^= ((- (rnd & 0x01) ) & andmask);

Loading…
Cancel
Save