Hi Mateusz,
Could you please try the attached patch? It should existing failures on
clang. It also changes our generic guard to take __has_builtin into
account, so this should prevent problems in the future, if clang
introduces more builtins, but I don't have clang setup to test it.
Thanks,
Jacek
On 09.02.2017 01:35, Mateusz Mikuła wrote:
> 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), I tried it also:
> https://paste.ubuntu.com/23957478/
>
> While for 3.9.x Clang `-fms-extensions` didn't hurt, master branch require
> some corrections but it is another issue.
>
>
> 2017-02-09 0:15 GMT+01:00 David Grayson <davidegray...@gmail.com>:
>
>> 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.
>>
>> Here is the commit:
>>
>> https://github.com/llvm-mirror/clang/commit/5eb95c4c284486351e3ed0fdad011a
>> cf41540c8b
>>
>> The source code archive that Alexey used to build the MSYS2 clang++
>> does not have the changes from that commit in it:
>>
>> http://repo.msys2.org/mingw/sources/mingw-w64-clang-3.9.1-3.src.tar.gz
>>
>> I don't intend to submit any more patches for this issue. Jacek has
>> already committed my patch to mingw-w64 (thanks!). Once the new
>> version of clang comes out and people start using it there should not
>> be any problems. If any clang users are itching to use __popcnt
>> before the new version of clang comes out, they can easily remove the
>> #if I put in intrin-impl.h. They could also use __has_builtin in
>> intrin-impl.h to detect whether clang has the builtin or not.
>>
>> Mateusz, the "CodeGen" folder in clang is not just used for MSVC libs,
>> it has tons of general-purpose code for generating LLVM code from
>> C/C++ code.
>>
>> --David Grayson
>>
>> On Wed, Feb 8, 2017 at 1:24 PM, Mateusz <mati...@gmail.com> wrote:
>>> 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'
>>> 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.
>>>
>>>
>>>
>>> 2017-02-08 22:22 GMT+01:00 Mateusz <mati...@gmail.com>:
>>>
>>>> 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(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.
>>>>
>>>> 2017-02-08 20:10 GMT+01:00 David Grayson <davidegray...@gmail.com>:
>>>>
>>>>> 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/3e45634a7f951c2306
>>>>> e4b368f9fb8c8d80c48273/include/clang/Basic/Builtins.def#L760-L762
>>>>> https://github.com/llvm-mirror/clang/blob/4cedfcc1ecf8387082
>>>>> 183508604b7f47c634f708/lib/CodeGen/CGBuiltin.cpp#L804-L821
>>>>>
>>>>> Can you try your clang test again with the "-fms-extensions" argument?
>>>>>
>>>>> (I tried to test clang myself earlier but I had various issues. I
>>>>> could probably try again tonight if you don't want to.)
>>>>>
>>>>> --David
>>>>>
>>>>> On Wed, Feb 8, 2017 at 10:54 AM, Mateusz <mati...@gmail.com> wrote:
>>>>>> 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
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> 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
>> ------------------------------------------------------------
>> ------------------
>> 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
diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
index fc781ff..f2f0a75 100644
--- a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+++ b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
@@ -404,7 +404,10 @@ supports ReadWriteBarrier, map all 3 to do the same. */
)
)
*/
-#define __INTRINSIC_PROLOG(name) (!defined(__INTRINSIC_DEFINED_ ## name)) &&
((!defined (__INTRINSIC_ONLYSPECIAL)) || (defined (__INTRINSIC_ONLYSPECIAL) &&
defined(__INTRINSIC_SPECIAL_ ## name)))
+#define __INTRINSIC_PROLOG(name) \
+ (!defined(__INTRINSIC_DEFINED_ ## name) && \
+ ((!defined (__INTRINSIC_ONLYSPECIAL)) || defined(__INTRINSIC_SPECIAL_ ##
name)) && \
+ !__has_builtin(name))
#ifdef __INTRINSIC_ONLYSPECIAL
#define __INTRINSICS_USEINLINE
@@ -548,8 +551,8 @@ extern "C" {
#undef _lrotl
#undef _lrotr
-#if __INTRINSIC_PROLOG(_lrotl)
unsigned long _lrotl(unsigned long __X, int __C);
+#if __INTRINSIC_PROLOG(_lrotl)
__INTRINSICS_USEINLINE
unsigned long _lrotl(unsigned long __X, int __C)
{
@@ -558,8 +561,8 @@ unsigned long _lrotl(unsigned long __X, int __C)
#define __INTRINSIC_DEFINED__lrotl
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_lrotr)
unsigned long _lrotr(unsigned long __X, int __C);
+#if __INTRINSIC_PROLOG(_lrotr)
__INTRINSICS_USEINLINE
unsigned long _lrotr(unsigned long __X, int __C)
{
@@ -570,8 +573,8 @@ unsigned long _lrotr(unsigned long __X, int __C)
#if defined(__x86_64__) || defined(_AMD64_)
-#if __INTRINSIC_PROLOG(__faststorefence)
void __faststorefence(void);
+#if __INTRINSIC_PROLOG(__faststorefence)
__INTRINSICS_USEINLINE
void __faststorefence(void) {
/* Turns out this is actually faster than MS's "trick" on newer cpus. Note
@@ -581,78 +584,78 @@ void __faststorefence(void) {
#define __INTRINSIC_DEFINED___faststorefence
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__stosq)
__MINGW_EXTENSION void __stosq(unsigned __int64 *, unsigned __int64, size_t);
+#if __INTRINSIC_PROLOG(__stosq)
__INTRINSICS_USEINLINE
__buildstos(__stosq, unsigned __int64, "q|q")
#define __INTRINSIC_DEFINED___stosq
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandset64)
__MINGW_EXTENSION unsigned char _interlockedbittestandset64(__int64 *a,
__int64 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandset64)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandset64, __int64, "lock bts{q
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED__interlockedbittestandset64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandreset64)
__MINGW_EXTENSION unsigned char _interlockedbittestandreset64(__int64 *a,
__int64 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandreset64)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandreset64, __int64, "lock btr{q
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED__interlockedbittestandreset64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement64)
__MINGW_EXTENSION unsigned char _interlockedbittestandcomplement64(__int64 *a,
__int64 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement64)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandcomplement64, __int64, "lock btc{q
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED__interlockedbittestandcomplement64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet64)
__MINGW_EXTENSION unsigned char InterlockedBitTestAndSet64(volatile __int64
*a, __int64 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet64)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndSet64, volatile __int64, "lock bts{q
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndSet64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset64)
__MINGW_EXTENSION unsigned char InterlockedBitTestAndReset64(volatile __int64
*a, __int64 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset64)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndReset64, volatile __int64, "lock btr{q
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndReset64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement64)
__MINGW_EXTENSION unsigned char InterlockedBitTestAndComplement64(volatile
__int64 *a, __int64 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement64)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndComplement64, volatile __int64, "lock
btc{q %[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "J", __int64)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndComplement64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedAnd64)
__MINGW_EXTENSION __int64 _InterlockedAnd64(__int64 volatile *, __int64);
+#if __INTRINSIC_PROLOG(_InterlockedAnd64)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedAnd64, __int64, and)
#define __INTRINSIC_DEFINED__InterlockedAnd64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedOr64)
__MINGW_EXTENSION __int64 _InterlockedOr64(__int64 volatile *, __int64);
+#if __INTRINSIC_PROLOG(_InterlockedOr64)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedOr64, __int64, or)
#define __INTRINSIC_DEFINED__InterlockedOr64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedXor64)
__MINGW_EXTENSION __int64 _InterlockedXor64(__int64 volatile *, __int64);
+#if __INTRINSIC_PROLOG(_InterlockedXor64)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedXor64, __int64, xor)
#define __INTRINSIC_DEFINED__InterlockedXor64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedIncrement64)
__MINGW_EXTENSION __int64 _InterlockedIncrement64(__int64 volatile *Addend);
+#if __INTRINSIC_PROLOG(_InterlockedIncrement64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedIncrement64(__int64 volatile *Addend) {
return __sync_add_and_fetch(Addend, 1);
@@ -660,8 +663,8 @@ __int64 _InterlockedIncrement64(__int64 volatile *Addend) {
#define __INTRINSIC_DEFINED__InterlockedIncrement64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedDecrement64)
__MINGW_EXTENSION __int64 _InterlockedDecrement64(__int64 volatile *Addend);
+#if __INTRINSIC_PROLOG(_InterlockedDecrement64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedDecrement64(__int64 volatile *Addend) {
return __sync_sub_and_fetch(Addend, 1);
@@ -669,8 +672,8 @@ __int64 _InterlockedDecrement64(__int64 volatile *Addend) {
#define __INTRINSIC_DEFINED__InterlockedDecrement64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedExchange64)
__MINGW_EXTENSION __int64 _InterlockedExchange64(__int64 volatile *Target,
__int64 Value);
+#if __INTRINSIC_PROLOG(_InterlockedExchange64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedExchange64(__int64 volatile *Target, __int64 Value) {
return __sync_lock_test_and_set(Target, Value);
@@ -678,8 +681,8 @@ __int64 _InterlockedExchange64(__int64 volatile *Target,
__int64 Value) {
#define __INTRINSIC_DEFINED__InterlockedExchange64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedExchangeAdd64)
__MINGW_EXTENSION __int64 _InterlockedExchangeAdd64(__int64 volatile *Addend,
__int64 Value);
+#if __INTRINSIC_PROLOG(_InterlockedExchangeAdd64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedExchangeAdd64(__int64 volatile *Addend, __int64 Value) {
return __sync_fetch_and_add(Addend, Value);
@@ -687,176 +690,176 @@ __int64 _InterlockedExchangeAdd64(__int64 volatile
*Addend, __int64 Value) {
#define __INTRINSIC_DEFINED__InterlockedExchangeAdd64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readgsbyte)
unsigned char __readgsbyte(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readgsbyte)
__INTRINSICS_USEINLINE
__buildreadseg(__readgsbyte, unsigned char, "gs", "b")
#define __INTRINSIC_DEFINED___readgsbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readgsword)
unsigned short __readgsword(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readgsword)
__INTRINSICS_USEINLINE
__buildreadseg(__readgsword, unsigned short, "gs", "w")
#define __INTRINSIC_DEFINED___readgsword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readgsdword)
unsigned __LONG32 __readgsdword(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readgsdword)
__INTRINSICS_USEINLINE
__buildreadseg(__readgsdword, unsigned __LONG32, "gs", "l")
#define __INTRINSIC_DEFINED___readgsdword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readgsqword)
__MINGW_EXTENSION unsigned __int64 __readgsqword(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readgsqword)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildreadseg(__readgsqword, unsigned __int64, "gs", "q")
#define __INTRINSIC_DEFINED___readgsqword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writegsbyte)
void __writegsbyte(unsigned __LONG32 Offset,unsigned char Data);
+#if __INTRINSIC_PROLOG(__writegsbyte)
__INTRINSICS_USEINLINE
__buildwriteseg(__writegsbyte, unsigned char, "gs", "b")
#define __INTRINSIC_DEFINED___writegsbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writegsword)
void __writegsword(unsigned __LONG32 Offset,unsigned short Data);
+#if __INTRINSIC_PROLOG(__writegsword)
__INTRINSICS_USEINLINE
__buildwriteseg(__writegsword, unsigned short, "gs", "w")
#define __INTRINSIC_DEFINED___writegsword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writegsdword)
void __writegsdword(unsigned __LONG32 Offset,unsigned __LONG32 Data);
+#if __INTRINSIC_PROLOG(__writegsdword)
__INTRINSICS_USEINLINE
__buildwriteseg(__writegsdword, unsigned __LONG32, "gs", "l")
#define __INTRINSIC_DEFINED___writegsdword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writegsqword)
__MINGW_EXTENSION void __writegsqword(unsigned __LONG32 Offset,unsigned
__int64 Data);
+#if __INTRINSIC_PROLOG(__writegsqword)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildwriteseg(__writegsqword, unsigned __int64, "gs", "q")
#define __INTRINSIC_DEFINED___writegsqword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_BitScanForward64)
__MINGW_EXTENSION unsigned char _BitScanForward64(unsigned __LONG32 *Index,
unsigned __int64 Mask);
+#if __INTRINSIC_PROLOG(_BitScanForward64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbitscan(_BitScanForward64, unsigned __int64, "bsf{q %[Mask],%[Index] |
%[Index],%[Mask]}")
#define __INTRINSIC_DEFINED__BitScanForward64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_BitScanReverse64)
__MINGW_EXTENSION unsigned char _BitScanReverse64(unsigned __LONG32 *Index,
unsigned __int64 Mask);
+#if __INTRINSIC_PROLOG(_BitScanReverse64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbitscan(_BitScanReverse64, unsigned __int64, "bsr{q %[Mask],%[Index] |
%[Index],%[Mask]}")
#define __INTRINSIC_DEFINED__BitScanReverse64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittest64)
__MINGW_EXTENSION unsigned char _bittest64(__int64 const *a, __int64 b);
+#if __INTRINSIC_PROLOG(_bittest64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbittest(_bittest64, __int64, "q", "J")
#define __INTRINSIC_DEFINED__bittest64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandset64)
__MINGW_EXTENSION unsigned char _bittestandset64(__int64 *a, __int64 b);
+#if __INTRINSIC_PROLOG(_bittestandset64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbittestand(_bittestandset64, __int64, "bts", "J", "q")
#define __INTRINSIC_DEFINED__bittestandset64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandreset64)
__MINGW_EXTENSION unsigned char _bittestandreset64(__int64 *a, __int64 b);
+#if __INTRINSIC_PROLOG(_bittestandreset64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbittestand(_bittestandreset64, __int64, "btr", "J", "q")
#define __INTRINSIC_DEFINED__bittestandreset64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandcomplement64)
__MINGW_EXTENSION unsigned char _bittestandcomplement64(__int64 *a, __int64 b);
+#if __INTRINSIC_PROLOG(_bittestandcomplement64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildbittestand(_bittestandcomplement64, __int64, "btc", "J", "q")
#define __INTRINSIC_DEFINED__bittestandcomplement64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr0)
__MINGW_EXTENSION unsigned __int64 __readcr0(void);
+#if __INTRINSIC_PROLOG(__readcr0)
__INTRINSICS_USEINLINE
__build_readcr(__readcr0, unsigned __int64, "0")
#define __INTRINSIC_DEFINED___readcr0
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr2)
__MINGW_EXTENSION unsigned __int64 __readcr2(void);
+#if __INTRINSIC_PROLOG(__readcr2)
__INTRINSICS_USEINLINE
__build_readcr(__readcr2, unsigned __int64, "2")
#define __INTRINSIC_DEFINED___readcr2
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr3)
__MINGW_EXTENSION unsigned __int64 __readcr3(void);
+#if __INTRINSIC_PROLOG(__readcr3)
__INTRINSICS_USEINLINE
__build_readcr(__readcr3, unsigned __int64, "3")
#define __INTRINSIC_DEFINED___readcr3
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr4)
__MINGW_EXTENSION unsigned __int64 __readcr4(void);
+#if __INTRINSIC_PROLOG(__readcr4)
__INTRINSICS_USEINLINE
__build_readcr(__readcr4, unsigned __int64, "4")
#define __INTRINSIC_DEFINED___readcr4
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr8)
__MINGW_EXTENSION unsigned __int64 __readcr8(void);
+#if __INTRINSIC_PROLOG(__readcr8)
__INTRINSICS_USEINLINE
__build_readcr(__readcr8, unsigned __int64, "8")
#define __INTRINSIC_DEFINED___readcr8
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr0)
__MINGW_EXTENSION void __writecr0(unsigned __int64);
+#if __INTRINSIC_PROLOG(__writecr0)
__INTRINSICS_USEINLINE
__build_writecr(__writecr0, unsigned __int64, "0")
#define __INTRINSIC_DEFINED___writecr0
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr3)
__MINGW_EXTENSION void __writecr3(unsigned __int64);
+#if __INTRINSIC_PROLOG(__writecr3)
__INTRINSICS_USEINLINE
__build_writecr(__writecr3, unsigned __int64, "3")
#define __INTRINSIC_DEFINED___writecr3
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr4)
__MINGW_EXTENSION void __writecr4(unsigned __int64);
+#if __INTRINSIC_PROLOG(__writecr4)
__INTRINSICS_USEINLINE
__build_writecr(__writecr4, unsigned __int64, "4")
#define __INTRINSIC_DEFINED___writecr4
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr8)
__MINGW_EXTENSION void __writecr8(unsigned __int64);
+#if __INTRINSIC_PROLOG(__writecr8)
__INTRINSICS_USEINLINE
__build_writecr(__writecr8, unsigned __int64, "8")
#define __INTRINSIC_DEFINED___writecr8
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__movsq)
__MINGW_EXTENSION void __movsq(unsigned __int64 *Dest, unsigned __int64 const
*Source, size_t Count);
+#if __INTRINSIC_PROLOG(__movsq)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__buildmov(__movsq, unsigned __int64, "q")
#define __INTRINSIC_DEFINED___movsq
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_umul128)
unsigned __int64 _umul128(unsigned __int64, unsigned __int64, unsigned __int64
*);
+#if __INTRINSIC_PROLOG(_umul128)
__INTRINSICS_USEINLINE
unsigned __int64 _umul128(unsigned __int64 a, unsigned __int64 b, unsigned
__int64 *hi)
{
@@ -869,8 +872,8 @@ unsigned __int64 _umul128(unsigned __int64 a, unsigned
__int64 b, unsigned __int
#define __INTRINSIC_DEFINED__umul128
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_mul128)
__int64 _mul128(__int64, __int64, __int64 *);
+#if __INTRINSIC_PROLOG(_mul128)
__INTRINSICS_USEINLINE
__int64 _mul128(__int64 a, __int64 b, __int64 *hi)
{
@@ -883,8 +886,8 @@ __int64 _mul128(__int64 a, __int64 b, __int64 *hi)
#define __INTRINSIC_DEFINED__mul128
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__shiftleft128)
unsigned __int64 __shiftleft128(unsigned __int64 LowPart, unsigned __int64
HighPart, unsigned char Shift);
+#if __INTRINSIC_PROLOG(__shiftleft128)
__INTRINSICS_USEINLINE
unsigned __int64 __shiftleft128 (unsigned __int64 LowPart, unsigned __int64
HighPart, unsigned char Shift)
{
@@ -900,8 +903,8 @@ unsigned __int64 __shiftleft128 (unsigned __int64 LowPart,
unsigned __int64 Hig
#define __INTRINSIC_DEFINED___shiftleft128
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__shiftright128)
unsigned __int64 __shiftright128 (unsigned __int64 LowPart, unsigned __int64
HighPart, unsigned char Shift);
+#if __INTRINSIC_PROLOG(__shiftright128)
__INTRINSICS_USEINLINE
unsigned __int64 __shiftright128 (unsigned __int64 LowPart, unsigned __int64
HighPart, unsigned char Shift)
{
@@ -923,43 +926,43 @@ unsigned __int64 __shiftright128 (unsigned __int64
LowPart, unsigned __int64 Hi
#if defined(__arm__) || defined(_ARM_)
-#if __INTRINSIC_PROLOG(_interlockedbittestandset)
unsigned char _interlockedbittestandset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandset)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandset, __LONG32, "orr", "M", /* unused
param */)
#define __INTRINSIC_DEFINED__interlockedbittestandset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandreset)
unsigned char _interlockedbittestandreset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandreset)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandreset, __LONG32, "bic", "M", /* unused
param */)
#define __INTRINSIC_DEFINED__interlockedbittestandreset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement)
unsigned char _interlockedbittestandcomplement(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandcomplement, __LONG32, "eor", "M", /*
unused param */)
#define __INTRINSIC_DEFINED__interlockedbittestandcomplement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet)
unsigned char InterlockedBitTestAndSet(volatile __LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndSet, __LONG32, "orr", "M", volatile)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndSet
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset)
unsigned char InterlockedBitTestAndReset(volatile __LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndReset, __LONG32, "bic", "M", volatile)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndReset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement)
unsigned char InterlockedBitTestAndComplement(volatile __LONG32 *a, __LONG32
b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndComplement, __LONG32, "eor", "M",
volatile)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndComplement
@@ -971,10 +974,8 @@ __buildbittesti(InterlockedBitTestAndComplement, __LONG32,
"eor", "M", volatile)
#if defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) ||
defined(_X86_) || defined(__arm__) || defined(_ARM_)
-#if !defined(__clang__)
-
-#if __INTRINSIC_PROLOG(__popcnt16)
unsigned short __popcnt16(unsigned short);
+#if __INTRINSIC_PROLOG(__popcnt16)
__INTRINSICS_USEINLINE
unsigned short __popcnt16(unsigned short value)
{
@@ -983,8 +984,8 @@ unsigned short __popcnt16(unsigned short value)
#define __INTRINSIC_DEFINED___popcnt16
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__popcnt)
unsigned int __popcnt(unsigned int);
+#if __INTRINSIC_PROLOG(__popcnt)
__INTRINSICS_USEINLINE
unsigned int __popcnt(unsigned int value)
{
@@ -993,8 +994,8 @@ unsigned int __popcnt(unsigned int value)
#define __INTRINSIC_DEFINED___popcnt
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__popcnt64)
unsigned __int64 __popcnt64(unsigned __int64);
+#if __INTRINSIC_PROLOG(__popcnt64)
__INTRINSICS_USEINLINE
unsigned __int64 __popcnt64(unsigned __int64 value)
{
@@ -1003,31 +1004,29 @@ unsigned __int64 __popcnt64(unsigned __int64 value)
#define __INTRINSIC_DEFINED___popcnt64
#endif /* __INTRINSIC_PROLOG */
-#endif /* !defined(__clang__) */
-
-#if __INTRINSIC_PROLOG(_InterlockedAnd)
__LONG32 _InterlockedAnd(__LONG32 volatile *, __LONG32);
+#if __INTRINSIC_PROLOG(_InterlockedAnd)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedAnd, __LONG32, and)
#define __INTRINSIC_DEFINED__InterlockedAnd
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedOr)
__LONG32 _InterlockedOr(__LONG32 volatile *, __LONG32);
+#if __INTRINSIC_PROLOG(_InterlockedOr)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedOr, __LONG32, or)
#define __INTRINSIC_DEFINED__InterlockedOr
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedXor)
__LONG32 _InterlockedXor(__LONG32 volatile *, __LONG32);
+#if __INTRINSIC_PROLOG(_InterlockedXor)
__INTRINSICS_USEINLINE
__buildlogicali(_InterlockedXor, __LONG32, xor)
#define __INTRINSIC_DEFINED__InterlockedXor
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedIncrement16)
short _InterlockedIncrement16(short volatile *Addend);
+#if __INTRINSIC_PROLOG(_InterlockedIncrement16)
__INTRINSICS_USEINLINE
short _InterlockedIncrement16(short volatile *Addend) {
return __sync_add_and_fetch(Addend, 1);
@@ -1035,8 +1034,8 @@ short _InterlockedIncrement16(short volatile *Addend) {
#define __INTRINSIC_DEFINED__InterlockedIncrement16
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedDecrement16)
short _InterlockedDecrement16(short volatile *Addend);
+#if __INTRINSIC_PROLOG(_InterlockedDecrement16)
__INTRINSICS_USEINLINE
short _InterlockedDecrement16(short volatile *Addend) {
return __sync_sub_and_fetch(Addend, 1);
@@ -1044,8 +1043,8 @@ short _InterlockedDecrement16(short volatile *Addend) {
#define __INTRINSIC_DEFINED__InterlockedDecrement16
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedCompareExchange16)
short _InterlockedCompareExchange16(short volatile *Destination, short
ExChange, short Comperand);
+#if __INTRINSIC_PROLOG(_InterlockedCompareExchange16)
__INTRINSICS_USEINLINE
short _InterlockedCompareExchange16(short volatile *Destination, short
ExChange, short Comperand) {
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
@@ -1053,52 +1052,44 @@ short _InterlockedCompareExchange16(short volatile
*Destination, short ExChange,
#define __INTRINSIC_DEFINED__InterlockedCompareExchange16
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedExchangeAdd)
__LONG32 _InterlockedExchangeAdd(__LONG32 volatile *Addend, __LONG32 Value);
-#if !__has_builtin(_InterlockedExchangeAdd)
+#if __INTRINSIC_PROLOG(_InterlockedExchangeAdd)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedExchangeAdd(__LONG32 volatile *Addend, __LONG32 Value) {
return __sync_fetch_and_add(Addend, Value);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedExchangeAdd
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedCompareExchange)
__LONG32 _InterlockedCompareExchange(__LONG32 volatile *Destination, __LONG32
ExChange, __LONG32 Comperand);
-#if !__has_builtin(_InterlockedCompareExchange)
+#if __INTRINSIC_PROLOG(_InterlockedCompareExchange)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedCompareExchange(__LONG32 volatile *Destination, __LONG32
ExChange, __LONG32 Comperand) {
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedCompareExchange
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedIncrement)
__LONG32 _InterlockedIncrement(__LONG32 volatile *Addend);
-#if !__has_builtin(_InterlockedIncrement)
+#if __INTRINSIC_PROLOG(_InterlockedIncrement)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedIncrement(__LONG32 volatile *Addend) {
return __sync_add_and_fetch(Addend, 1);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedIncrement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedDecrement)
__LONG32 _InterlockedDecrement(__LONG32 volatile *Addend);
-#if !__has_builtin(_InterlockedDecrement)
+#if __INTRINSIC_PROLOG(_InterlockedDecrement)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedDecrement(__LONG32 volatile *Addend) {
return __sync_sub_and_fetch(Addend, 1);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedDecrement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedAdd)
__LONG32 _InterlockedAdd(__LONG32 volatile *Addend, __LONG32 Value);
+#if __INTRINSIC_PROLOG(_InterlockedAdd)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedAdd(__LONG32 volatile *Addend, __LONG32 Value) {
return __sync_add_and_fetch(Addend, Value);
@@ -1106,8 +1097,8 @@ __LONG32 _InterlockedAdd(__LONG32 volatile *Addend,
__LONG32 Value) {
#define __INTRINSIC_DEFINED__InterlockedAdd
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedAdd64)
__MINGW_EXTENSION __int64 _InterlockedAdd64(__int64 volatile *Addend, __int64
Value);
+#if __INTRINSIC_PROLOG(_InterlockedAdd64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedAdd64(__int64 volatile *Addend, __int64 Value) {
return __sync_add_and_fetch(Addend, Value);
@@ -1115,19 +1106,17 @@ __int64 _InterlockedAdd64(__int64 volatile *Addend,
__int64 Value) {
#define __INTRINSIC_DEFINED__InterlockedAdd64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedExchange)
__LONG32 _InterlockedExchange(__LONG32 volatile *Target, __LONG32 Value);
-#if !__has_builtin(_InterlockedExchange)
+#if __INTRINSIC_PROLOG(_InterlockedExchange)
__INTRINSICS_USEINLINE
__LONG32 _InterlockedExchange(__LONG32 volatile *Target, __LONG32 Value) {
return __sync_lock_test_and_set(Target, Value);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedExchange
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedCompareExchange64)
__MINGW_EXTENSION __int64 _InterlockedCompareExchange64(__int64 volatile
*Destination, __int64 ExChange, __int64 Comperand);
+#if __INTRINSIC_PROLOG(_InterlockedCompareExchange64)
__MINGW_EXTENSION __INTRINSICS_USEINLINE
__int64 _InterlockedCompareExchange64(__int64 volatile *Destination, __int64
ExChange, __int64 Comperand) {
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
@@ -1135,25 +1124,21 @@ __int64 _InterlockedCompareExchange64(__int64 volatile
*Destination, __int64 ExC
#define __INTRINSIC_DEFINED__InterlockedCompareExchange64
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedCompareExchangePointer)
void *_InterlockedCompareExchangePointer(void * volatile *Destination, void
*ExChange, void *Comperand);
-#if !__has_builtin(_InterlockedCompareExchangePointer)
+#if __INTRINSIC_PROLOG(_InterlockedCompareExchangePointer)
__INTRINSICS_USEINLINE
void *_InterlockedCompareExchangePointer(void *volatile *Destination, void
*ExChange, void *Comperand) {
return __sync_val_compare_and_swap(Destination, Comperand, ExChange);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedCompareExchangePointer
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_InterlockedExchangePointer)
void *_InterlockedExchangePointer(void *volatile *Target,void *Value);
-#if !__has_builtin(_InterlockedExchangePointer)
+#if __INTRINSIC_PROLOG(_InterlockedExchangePointer)
__INTRINSICS_USEINLINE
void *_InterlockedExchangePointer(void *volatile *Target,void *Value) {
return __sync_lock_test_and_set(Target, Value);
}
-#endif
#define __INTRINSIC_DEFINED__InterlockedExchangePointer
#endif /* __INTRINSIC_PROLOG */
@@ -1161,8 +1146,8 @@ void *_InterlockedExchangePointer(void *volatile
*Target,void *Value) {
#if defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) ||
defined(_X86_)
-#if __INTRINSIC_PROLOG(__int2c)
void __int2c(void);
+#if __INTRINSIC_PROLOG(__int2c)
__INTRINSICS_USEINLINE
void __int2c(void) {
__buildint(0x2c);
@@ -1170,197 +1155,197 @@ void __int2c(void) {
#define __INTRINSIC_DEFINED___int2c
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__stosb)
void __stosb(unsigned char *, unsigned char, size_t);
+#if __INTRINSIC_PROLOG(__stosb)
__INTRINSICS_USEINLINE
__buildstos(__stosb, unsigned char, "b|b")
#define __INTRINSIC_DEFINED___stosb
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__stosw)
void __stosw(unsigned short *, unsigned short, size_t);
+#if __INTRINSIC_PROLOG(__stosw)
__INTRINSICS_USEINLINE
__buildstos(__stosw, unsigned short, "w|w")
#define __INTRINSIC_DEFINED___stosw
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__stosd)
void __stosd(unsigned __LONG32 *, unsigned __LONG32, size_t);
+#if __INTRINSIC_PROLOG(__stosd)
__INTRINSICS_USEINLINE
__buildstos(__stosd, unsigned __LONG32, "l|d")
#define __INTRINSIC_DEFINED___stosd
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandset)
unsigned char _interlockedbittestandset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandset)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandset, __LONG32, "lock bts{l
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED__interlockedbittestandset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandreset)
unsigned char _interlockedbittestandreset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandreset)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandreset, __LONG32, "lock btr{l
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED__interlockedbittestandreset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement)
unsigned char _interlockedbittestandcomplement(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_interlockedbittestandcomplement)
__INTRINSICS_USEINLINE
__buildbittesti(_interlockedbittestandcomplement, __LONG32, "lock btc{l
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED__interlockedbittestandcomplement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet)
unsigned char InterlockedBitTestAndSet(volatile __LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndSet)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndSet, volatile __LONG32, "lock bts{l
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndSet
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset)
unsigned char InterlockedBitTestAndReset(volatile __LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndReset)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndReset, volatile __LONG32, "lock btr{l
%[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndReset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement)
unsigned char InterlockedBitTestAndComplement(volatile __LONG32 *a, __LONG32
b);
+#if __INTRINSIC_PROLOG(InterlockedBitTestAndComplement)
__INTRINSICS_USEINLINE
__buildbittesti(InterlockedBitTestAndComplement, volatile __LONG32, "lock
btc{l %[Offset],%[Base] | %[Base],%[Offset]}" __FLAGSET, "I", __LONG32)
#define __INTRINSIC_DEFINED_InterlockedBitTestAndComplement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_BitScanForward)
unsigned char _BitScanForward(unsigned __LONG32 *Index, unsigned __LONG32
Mask);
+#if __INTRINSIC_PROLOG(_BitScanForward)
__INTRINSICS_USEINLINE
__buildbitscan(_BitScanForward, unsigned __LONG32, "bsf{l %[Mask],%[Index] |
%[Index],%[Mask]}")
#define __INTRINSIC_DEFINED__BitScanForward
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_BitScanReverse)
unsigned char _BitScanReverse(unsigned __LONG32 *Index, unsigned __LONG32
Mask);
+#if __INTRINSIC_PROLOG(_BitScanReverse)
__INTRINSICS_USEINLINE
__buildbitscan(_BitScanReverse, unsigned __LONG32, "bsr{l %[Mask],%[Index] |
%[Index],%[Mask]}")
#define __INTRINSIC_DEFINED__BitScanReverse
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittest)
unsigned char _bittest(__LONG32 const *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_bittest)
__INTRINSICS_USEINLINE
__buildbittest(_bittest, __LONG32, "l", "I")
#define __INTRINSIC_DEFINED__bittest
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandset)
unsigned char _bittestandset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_bittestandset)
__INTRINSICS_USEINLINE
__buildbittestand(_bittestandset, __LONG32, "bts", "I", "l")
#define __INTRINSIC_DEFINED__bittestandset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandreset)
unsigned char _bittestandreset(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_bittestandreset)
__INTRINSICS_USEINLINE
__buildbittestand(_bittestandreset, __LONG32, "btr", "I", "l")
#define __INTRINSIC_DEFINED__bittestandreset
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(_bittestandcomplement)
unsigned char _bittestandcomplement(__LONG32 *a, __LONG32 b);
+#if __INTRINSIC_PROLOG(_bittestandcomplement)
__INTRINSICS_USEINLINE
__buildbittestand(_bittestandcomplement, __LONG32, "btc", "I", "l")
#define __INTRINSIC_DEFINED__bittestandcomplement
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__inbyte)
unsigned char __inbyte(unsigned short Port);
+#if __INTRINSIC_PROLOG(__inbyte)
__INTRINSICS_USEINLINE
__build_inport(__inbyte, unsigned char, "b")
#define __INTRINSIC_DEFINED___inbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__inword)
unsigned short __inword(unsigned short Port);
+#if __INTRINSIC_PROLOG(__inword)
__INTRINSICS_USEINLINE
__build_inport(__inword, unsigned short, "w")
#define __INTRINSIC_DEFINED___inword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__indword)
unsigned __LONG32 __indword(unsigned short Port);
+#if __INTRINSIC_PROLOG(__indword)
__INTRINSICS_USEINLINE
__build_inport(__indword, unsigned __LONG32, "l")
#define __INTRINSIC_DEFINED___indword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outbyte)
void __outbyte(unsigned short Port, unsigned char Data);
+#if __INTRINSIC_PROLOG(__outbyte)
__INTRINSICS_USEINLINE
__build_outport(__outbyte, unsigned char, "b")
#define __INTRINSIC_DEFINED___outbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outword)
void __outword(unsigned short Port, unsigned short Data);
+#if __INTRINSIC_PROLOG(__outword)
__INTRINSICS_USEINLINE
__build_outport(__outword, unsigned short, "w")
#define __INTRINSIC_DEFINED___outword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outdword)
void __outdword(unsigned short Port, unsigned __LONG32 Data);
+#if __INTRINSIC_PROLOG(__outdword)
__INTRINSICS_USEINLINE
__build_outport(__outdword, unsigned __LONG32, "l")
#define __INTRINSIC_DEFINED___outdword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__inbytestring)
void __inbytestring(unsigned short Port, unsigned char *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__inbytestring)
__INTRINSICS_USEINLINE
__build_inportstring(__inbytestring, unsigned char, "b", "b")
#define __INTRINSIC_DEFINED___inbytestring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__inwordstring)
void __inwordstring(unsigned short Port, unsigned short *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__inwordstring)
__INTRINSICS_USEINLINE
__build_inportstring(__inwordstring, unsigned short, "w", "w")
#define __INTRINSIC_DEFINED___inwordstring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__indwordstring)
void __indwordstring(unsigned short Port, unsigned __LONG32 *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__indwordstring)
__INTRINSICS_USEINLINE
__build_inportstring(__indwordstring, unsigned __LONG32, "l", "d")
#define __INTRINSIC_DEFINED___indwordstring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outbytestring)
void __outbytestring(unsigned short Port, unsigned char *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__outbytestring)
__INTRINSICS_USEINLINE
__build_outportstring(__outbytestring, unsigned char, "b", "b")
#define __INTRINSIC_DEFINED___outbytestring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outwordstring)
void __outwordstring(unsigned short Port, unsigned short *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__outwordstring)
__INTRINSICS_USEINLINE
__build_outportstring(__outwordstring, unsigned short, "w", "w")
#define __INTRINSIC_DEFINED___outwordstring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__outdwordstring)
void __outdwordstring(unsigned short Port, unsigned __LONG32 *Buffer, unsigned
__LONG32 Count);
+#if __INTRINSIC_PROLOG(__outdwordstring)
__INTRINSICS_USEINLINE
__build_outportstring(__outdwordstring, unsigned __LONG32, "l", "d")
#define __INTRINSIC_DEFINED___outdwordstring
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__cpuid)
void __cpuid(int CPUInfo[4], int InfoType);
+#if __INTRINSIC_PROLOG(__cpuid)
__INTRINSICS_USEINLINE
void __cpuid(int CPUInfo[4], int InfoType) {
__asm__ __volatile__ (
@@ -1371,8 +1356,8 @@ void __cpuid(int CPUInfo[4], int InfoType) {
#define __INTRINSIC_DEFINED___cpuid
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__cpuidex)
void __cpuidex(int CPUInfo[4], int, int);
+#if __INTRINSIC_PROLOG(__cpuidex)
__INTRINSICS_USEINLINE
void __cpuidex(int CPUInfo[4], int function_id, int subfunction_id) {
__asm__ __volatile__ (
@@ -1383,8 +1368,8 @@ void __cpuidex(int CPUInfo[4], int function_id, int
subfunction_id) {
#define __INTRINSIC_DEFINED___cpuidex
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readmsr)
__MINGW_EXTENSION unsigned __int64 __readmsr(unsigned __LONG32);
+#if __INTRINSIC_PROLOG(__readmsr)
__INTRINSICS_USEINLINE
unsigned __int64 __readmsr(unsigned __LONG32 msr)
{
@@ -1404,8 +1389,8 @@ unsigned __int64 __readmsr(unsigned __LONG32 msr)
#define __INTRINSIC_DEFINED___readmsr
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writemsr)
__MINGW_EXTENSION void __writemsr(unsigned __LONG32, unsigned __int64);
+#if __INTRINSIC_PROLOG(__writemsr)
__INTRINSICS_USEINLINE
void __writemsr(unsigned __LONG32 msr, unsigned __int64 Value)
{
@@ -1418,30 +1403,30 @@ void __writemsr(unsigned __LONG32 msr, unsigned __int64
Value)
#define __INTRINSIC_DEFINED___writemsr
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__movsb)
void __movsb(unsigned char *Destination, unsigned char const *Source, size_t
Count);
+#if __INTRINSIC_PROLOG(__movsb)
__INTRINSICS_USEINLINE
__buildmov(__movsb, unsigned char, "b")
#define __INTRINSIC_DEFINED___movsb
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__movsw)
void __movsw(unsigned short *Dest, unsigned short const *Source, size_t Count);
+#if __INTRINSIC_PROLOG(__movsw)
__INTRINSICS_USEINLINE
__buildmov(__movsw, unsigned short, "w")
#define __INTRINSIC_DEFINED___movsw
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__movsd)
void __movsd(unsigned __LONG32 *Dest, unsigned __LONG32 const *Source, size_t
Count);
+#if __INTRINSIC_PROLOG(__movsd)
__INTRINSICS_USEINLINE
__buildmov(__movsd, unsigned __LONG32, "d")
#define __INTRINSIC_DEFINED___movsd
#endif /* __INTRINSIC_PROLOG */
/* NOTE: This should be in immintrin.h */
-#if __INTRINSIC_PROLOG(_xgetbv)
unsigned __int64 _xgetbv(unsigned int);
+#if __INTRINSIC_PROLOG(_xgetbv)
__INTRINSICS_USEINLINE
unsigned __int64 _xgetbv(unsigned int index)
{
@@ -1467,108 +1452,106 @@ unsigned __int64 _xgetbv(unsigned int index)
#if defined(__i386__) || defined(_X86_)
-#if __INTRINSIC_PROLOG(__readfsbyte)
unsigned char __readfsbyte(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readfsbyte)
__INTRINSICS_USEINLINE
__buildreadseg(__readfsbyte, unsigned char, "fs", "b")
#define __INTRINSIC_DEFINED___readfsbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readfsword)
unsigned short __readfsword(unsigned __LONG32 Offset);
+#if __INTRINSIC_PROLOG(__readfsword)
__INTRINSICS_USEINLINE
__buildreadseg(__readfsword, unsigned short, "fs", "w")
#define __INTRINSIC_DEFINED___readfsword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readfsdword)
unsigned __LONG32 __readfsdword(unsigned __LONG32 Offset);
-#if !__has_builtin(__readfsdword)
+#if __INTRINSIC_PROLOG(__readfsdword)
__INTRINSICS_USEINLINE
__buildreadseg(__readfsdword, unsigned __LONG32, "fs", "l")
#define __INTRINSIC_DEFINED___readfsdword
-#endif
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writefsbyte)
void __writefsbyte(unsigned __LONG32 Offset,unsigned char Data);
+#if __INTRINSIC_PROLOG(__writefsbyte)
__INTRINSICS_USEINLINE
__buildwriteseg(__writefsbyte, unsigned char, "fs", "b")
#define __INTRINSIC_DEFINED___writefsbyte
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writefsword)
void __writefsword(unsigned __LONG32 Offset,unsigned short Data);
+#if __INTRINSIC_PROLOG(__writefsword)
__INTRINSICS_USEINLINE
__buildwriteseg(__writefsword, unsigned short, "fs", "w")
#define __INTRINSIC_DEFINED___writefsword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writefsdword)
void __writefsdword(unsigned __LONG32 Offset,unsigned __LONG32 Data);
+#if __INTRINSIC_PROLOG(__writefsdword)
__INTRINSICS_USEINLINE
__buildwriteseg(__writefsdword, unsigned __LONG32, "fs", "l")
#define __INTRINSIC_DEFINED___writefsdword
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr0)
unsigned __LONG32 __readcr0(void);
+#if __INTRINSIC_PROLOG(__readcr0)
__INTRINSICS_USEINLINE
__build_readcr(__readcr0, unsigned __LONG32, "0")
#define __INTRINSIC_DEFINED___readcr0
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr2)
unsigned __LONG32 __readcr2(void);
+#if __INTRINSIC_PROLOG(__readcr2)
__INTRINSICS_USEINLINE
__build_readcr(__readcr2, unsigned __LONG32, "2")
#define __INTRINSIC_DEFINED___readcr2
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr3)
unsigned __LONG32 __readcr3(void);
+#if __INTRINSIC_PROLOG(__readcr3)
__INTRINSICS_USEINLINE
__build_readcr(__readcr3, unsigned __LONG32, "3")
#define __INTRINSIC_DEFINED___readcr3
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr4)
unsigned __LONG32 __readcr4(void);
+#if __INTRINSIC_PROLOG(__readcr4)
__INTRINSICS_USEINLINE
__build_readcr(__readcr4, unsigned __LONG32, "4")
#define __INTRINSIC_DEFINED___readcr4
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__readcr8)
unsigned __LONG32 __readcr8(void);
+#if __INTRINSIC_PROLOG(__readcr8)
__INTRINSICS_USEINLINE
__build_readcr(__readcr8, unsigned __LONG32, "8")
#define __INTRINSIC_DEFINED___readcr8
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr0)
void __writecr0(unsigned __LONG32);
+#if __INTRINSIC_PROLOG(__writecr0)
__INTRINSICS_USEINLINE
__build_writecr(__writecr0, unsigned __LONG32, "0")
#define __INTRINSIC_DEFINED___writecr0
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr3)
void __writecr3(unsigned __LONG32);
+#if __INTRINSIC_PROLOG(__writecr3)
__INTRINSICS_USEINLINE
__build_writecr(__writecr3, unsigned __LONG32, "3")
#define __INTRINSIC_DEFINED___writecr3
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr4)
void __writecr4(unsigned __LONG32);
+#if __INTRINSIC_PROLOG(__writecr4)
__INTRINSICS_USEINLINE
__build_writecr(__writecr4, unsigned __LONG32, "4")
#define __INTRINSIC_DEFINED___writecr4
#endif /* __INTRINSIC_PROLOG */
-#if __INTRINSIC_PROLOG(__writecr8)
void __writecr8(unsigned __LONG32);
+#if __INTRINSIC_PROLOG(__writecr8)
__INTRINSICS_USEINLINE
__build_writecr(__writecr8, unsigned __LONG32, "8")
#define __INTRINSIC_DEFINED___writecr8
------------------------------------------------------------------------------
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