r245923 - [X86] Expose the various _rot intrinsics on non-MS platforms

İsmail Dönmez via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 25 04:17:02 PDT 2015


Hi,

On Tue, Aug 25, 2015 at 10:21 AM, Michael Kuperstein via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: mkuper
> Date: Tue Aug 25 02:21:33 2015
> New Revision: 245923
>
> URL: http://llvm.org/viewvc/llvm-project?rev=245923&view=rev
> Log:
> [X86] Expose the various _rot intrinsics on non-MS platforms
>
> _rotl, _rotwl and _lrotl (and their right-shift counterparts) are official x86
> intrinsics, and should be supported regardless of environment. This is in contrast
> to _rotl8, _rotl16, and _rotl64 which are MS-specific.
>
> Note that the MS documentation for _lrotl is different from the Intel
> documentation. Intel explicitly documents it as a 64-bit rotate, while for MS,
> since sizeof(unsigned long) for MSVC is always 4, a 32-bit rotate is implied.
>
> Differential Revision: http://reviews.llvm.org/D12271
>
> Added:
>     cfe/trunk/test/CodeGen/x86-rot-intrinsics.c   (with props)
> Modified:
>     cfe/trunk/lib/Headers/Intrin.h
>     cfe/trunk/lib/Headers/immintrin.h

This seems to break clang + mingw-w64 :

λ echo "#include <winsock2.h>" | clang -x c -target x86_64-w64-mingw32
--sysroot C:/mingw-w64-6.0.0 -
In file included from <stdin>:1:
In file included from
C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\winsock2.h:23:
In file included from
C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\windows.h:69:
In file included from C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\windef.h:8:
In file included from
C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\minwindef.h:163:
In file included from
C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\winnt.h:1516:
In file included from C:\Program
Files\LLVM\bin\..\lib\clang\3.8.0\include\x86intrin.h:29:
C:\Program Files\LLVM\bin\..\lib\clang\3.8.0\include\immintrin.h:164:1:
error: static declaration of '_rotl' follows non-static declaration
_rotl(unsigned int _Value, int _Shift) {
^
C:/mingw-w64-6.0.0\x86_64-w64-mingw32\include\stdlib.h:581:24: note:
previous declaration is here
  unsigned int __cdecl _rotl(unsigned int _Val,int _Shift);
                       ^


More information about the cfe-commits mailing list