Re: Missing _BitScanReverse64()

2015-01-05 Thread Gisle Vanem
Pádraig Brady wrote: Does the following address the issue for you? It should drop back to the more generic slow path on 32 bit. But I do have _BitReverse. That could be an intrinsic. BTW do we have the same issue with __popcnt64 in count-one-bits.h? Seems so: __MACHINEX64(unsigned

Re: Missing _BitScanReverse64()

2015-01-05 Thread Paul Eggert
Pádraig Brady wrote: I noticed that count_one_bits() branches on the popcount_support variable on each call, which might negate much of the gain from using this instruction? Could be. As far as I know it's never been benchmarked. I stole that code from Emacs without investigating its

Re: Missing _BitScanReverse64()

2015-01-05 Thread Pádraig Brady
On 05/01/15 21:32, Gisle Vanem wrote: Pádraig Brady wrote: Does the following address the issue for you? It should drop back to the more generic slow path on 32 bit. But I do have _BitReverse. That could be an intrinsic. I was assuming we could do the simpler patch and be slightly slower

Missing _BitScanReverse64()

2015-01-05 Thread Gisle Vanem
I'm on Win-XP (32bit, MSVC v16) and get a link error on a missing '__BitScanReverse64()' in test-count-leading-zeros.c:. Here is the dis-asm: _count_leading_zeros_ll: pushebp mov ebp,esp sub esp,0x0008 X$72: mov

Re: Missing _BitScanReverse64()

2015-01-05 Thread Pádraig Brady
On 05/01/15 20:05, Gisle Vanem wrote: I'm on Win-XP (32bit, MSVC v16) and get a link error on a missing '__BitScanReverse64()' in test-count-leading-zeros.c:. Here is the dis-asm: _count_leading_zeros_ll: pushebp mov ebp,esp sub