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(ui[i]); ^ popcnt.cc:26:28: error: use of undeclared identifier '__popcnt64'; did you mean '_popcnt64'? unsigned __int64 ulr = __popcnt64(ul[i]); ^~~~~~~~~~ _popcnt64 D:\msys64\mingw64\bin\..\lib\clang\3.9.1\include\popcntintrin.h:90:1: note: '_popcnt64' declared here _popcnt64(long long __A) ^ 3 errors generated.
Probably its safe to enable it for Clang, I'll try tomorrow late. 2017-02-08 18:37 GMT+01:00 David Grayson <davidegray...@gmail.com>: > 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 supporting __popcnt. > > I attached the simple C++ program I used to test this patch. > > I am not totally sure, but it looks like Clang already supports the > __popcnt intrinsics because I saw code for it in the clang repository. So > that is why this patch has "#if !defined(__clang__)" around it. > > I read the documentation for intrin.h and intrin-impl.h and I believe this > patch follows all the rules. It would be great if it could be merged in. > Thanks! > > --David Grayson > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public