forked from premiere/premiere-libtorrent
using bsr even with no popcnt present (#852)
This commit is contained in:
parent
9efba7d752
commit
c84aceea3f
|
@ -76,16 +76,13 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TORRENT_HAS_SSE
|
#if TORRENT_HAS_SSE
|
||||||
if (aux::mmx_support)
|
|
||||||
{
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
return ret + __builtin_clz(v);
|
return ret + __builtin_clz(v);
|
||||||
#else
|
#else
|
||||||
DWORD pos;
|
DWORD pos;
|
||||||
_BitScanReverse(&pos, v);
|
_BitScanReverse(&pos, v);
|
||||||
return ret + 31 - pos;
|
return ret + 31 - pos;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious
|
// http://graphics.stanford.edu/~seander/bithacks.html#IntegerLogObvious
|
||||||
static const int MultiplyDeBruijnBitPosition[32] =
|
static const int MultiplyDeBruijnBitPosition[32] =
|
||||||
|
|
Loading…
Reference in New Issue