Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread David Grayson
Ah, from your paste, it looks like mingw-w64 and clang are fighting to declare a lot of builtins when -fms-extensions is turned on. I would personally prefer to use compiler implementations of these things instead of header file implementations, so I think that mingw-w64 should try to support clan

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread Mateusz MikuĊ‚a
You are right David and now I remember the thing about ms-extensions. Declspec was part of those extensions and enabling it by default caused errors with specific code so declspec was changed to general attribute instead. Since I have clang git build (trying to upstream some patches used by MSYS2),

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread David Grayson
I can confirm that MSYS2's x86_64 clang++ compiler does not support __popcnt but does support __builtin_popcount. I looked into it a little bit, and found out that the clang commit that adds the __popcnt builtins is very recent (September 2016). I seems like it has not made it into a release yet.

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread Mateusz
Opps, gmail put output into quote. Improved version: $ clang++ popcnt.cc -std=c++14 -fms-extensions popcnt.cc:9:26: error: use of undeclared identifier '__popcnt16' unsigned short usr = __popcnt16(us[i]); ^ popcnt.cc:17:24: error: use of undeclared identifier '__popcnt'

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread Mateusz
I think ms-extensions was made default option for mingw and msvc clang and codegen is used only for creating msvc libs. Here is Clang output anyway: $ clang++ popcnt.cc -std=c++14 -fms-extensions popcnt.cc:9:26: error: use of undeclared identifier '__popcnt16' unsigned short usr = __popcnt16(u

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread David Grayson
Mateusz, thanks for looking in to this. Here are the relevant lines from the clang source code that indicate that it supports those builtins: https://github.com/llvm-mirror/clang/blob/3e45634a7f951c2306e4b368f9fb8c8d80c48273/include/clang/Basic/Builtins.def#L760-L762 https://github.com/llvm-mirro

Re: [Mingw-w64-public] After last update I can't compile cross-compiler

2017-02-08 Thread Mateusz
Hi Jacek, Now it is OK. Thanks! Mateusz W dniu 2017-02-08 o 18:53, Jacek Caban pisze: > Hi Mateusz, > > Thanks for the notice. I just pushed a fix, please retest. > > Jacek > > On 08.02.2017 18:06, Mateusz wrote: >> Hi! >> >> After last update by Jonathan Yong [5c7bc5] I can't compile cross-c

Re: [Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread Mateusz
MSYS2 native Clang test-popcnt.cpp: $ clang++ popcnt.cc -std=c++14 popcnt.cc:9:26: error: use of undeclared identifier '__popcnt16' unsigned short usr = __popcnt16(us[i]); ^ popcnt.cc:17:24: error: use of undeclared identifier '__popcnt' unsigned int uir = __popcnt

Re: [Mingw-w64-public] After last update I can't compile cross-compiler

2017-02-08 Thread Jacek Caban
Hi Mateusz, Thanks for the notice. I just pushed a fix, please retest. Jacek On 08.02.2017 18:06, Mateusz wrote: > Hi! > > After last update by Jonathan Yong [5c7bc5] I can't compile cross-compiler > (on Ubuntu). > > The error message (for 64-bit cross-compiler): > /home/ma/m/cross/bin/x86_64-w

[Mingw-w64-public] [PATCH] intrin-impl.h: Added __popcnt16, __popcnt, and __popcnt64.

2017-02-08 Thread David Grayson
Hello. This patch adds support for the Microsoft __popcnt16, __popcnt, and __popcnt64 intrinsics, which are documented here: https://msdn.microsoft.com/en-us/library/bb385231.aspx I was trying to compile ANGLE recently and one of the first errors I encountered was due to both GCC/mingw-w64 not

[Mingw-w64-public] After last update I can't compile cross-compiler

2017-02-08 Thread Mateusz
Hi! After last update by Jonathan Yong [5c7bc5] I can't compile cross-compiler (on Ubuntu). The error message (for 64-bit cross-compiler): /home/ma/m/cross/bin/x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I/home/ma/m/source/mingw-w64-v5/mingw-w64-crt -m64 -I/home/ma/m/target/x86_64-w64-mingw32

Re: [Mingw-w64-public] Relocation errors when linking with static libstdc++ starting with GCC 6 (64-bit only)

2017-02-08 Thread Ricardo Constantino
On 8 February 2017 at 02:55, Liu Hao wrote: > On 2017/2/8 1:45, Ricardo Constantino wrote: > > Should be fixed with > > https://github.com/Alexpux/MINGW-packages/commit/ba282a67e, but I > thought > > someone would've reported it to upstream by now? > Probably you could comment this PR > https://g