[ create a new paste ] login | about

Link: http://codepad.org/cGUynxZ9    [ raw code | fork ]

Evetro - C++, pasted on Jul 11:
1
2
3
4
5
6
7
/// halves-optimized, 32-bit using intrinsics for bswap + rotation
unsigned rbH5 (const unsigned arg)
{
  const unsigned a = (_rotl(arg, 2) & 0x55555555) | (arg & 0xAAAAAAAA);
  const unsigned b = (_rotl(a, 4) & 0x66666666) | (a & 0x99999999);
  return _byteswap_ulong(_rotr((_rotl(b, 8) & 0x78787878) | (b & 0x87878787), 7));
}


Create a new paste based on this one


Comments: