[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can we revert "avoid 64-bit intrinsics on 32-bit Windows"?
From: |
Gisle Vanem |
Subject: |
Re: Can we revert "avoid 64-bit intrinsics on 32-bit Windows"? |
Date: |
Tue, 06 Jan 2015 18:29:16 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 5.1; rv:34.0) Gecko/20100101 Firefox/34.0 SeaMonkey/2.31 |
Pádraig Brady wrote:
Gisle, how does this this version work for you?
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/count-leading-zeros.h;h=5904eb7f
Compiling that, results in some warnings:
count-leading-zeros.h(42) : warning C4083: expected '('; found identifier
'_BitScanReverse'
count-leading-zeros.h(43) : warning C4083: expected '('; found identifier
'_BitScanReverse64'
diff on diff:
--- count-leading-zeros.h.git 2015-01-06 19:16:49 +0000
+++ count-leading-zeros.h 2015-01-06 19:14:19 +0000
@@ -39,8 +39,8 @@
# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \
return x ? BUILTIN (x) : CHAR_BIT * sizeof x;
#elif _MSC_VER
-# pragma intrinsic _BitScanReverse
-# pragma intrinsic _BitScanReverse64
+# pragma intrinsic (_BitScanReverse)
+# pragma intrinsic (_BitScanReverse64)
# define COUNT_LEADING_ZEROS(BUILTIN, MSC_BUILTIN, TYPE) \
do \
{ \
But MSVC v16 still warns:
count-leading-zeros.h(43) : warning C4163: '_BitScanReverse64' :
not available as an intrinsic function
And the dis-asm of test-leading-zeros.obj still has:
_count_leading_zeros_ll:
push ebp
mov ebp,esp
sub esp,0x00000008
X$72:
mov eax,dword ptr 0xc[ebp]
push eax
mov ecx,dword ptr 0x8[ebp]
push ecx
lea edx,-0x4[ebp]
push edx
call j^__BitScanReverse64
According to:
http://msdn.microsoft.com/en-us/library/fbxyd7zd.aspx
the requirement for '_BitScanReverse64' is ARM, x64. I.e. not x86.
--
--gv