• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define __INTRINSIC_ONLYSPECIAL
2 #define __INTRINSIC_SPECIAL__InterlockedXor64 /* Causes code generation in intrin-impl.h */
3 
4 #include <intrin.h>
5 
6 #ifdef _WIN64
7 #else
8 __int64 __stdcall InterlockedCompareExchange64(__int64 volatile *Destination,
9   __int64 Exchange, __int64 Comperand);
10 __int64 _InterlockedXor64 (__int64 volatile *Destination,__int64 Value);
_InterlockedXor64(__int64 volatile * Destination,__int64 Value)11 __int64 _InterlockedXor64 (__int64 volatile *Destination,__int64 Value)
12 {
13     __int64 Old;
14     do {
15       Old = *Destination;
16     } while(InterlockedCompareExchange64(Destination,Old ^ Value,Old)!=Old);
17 
18     return Old;
19   }
20 #endif
21 
22 #ifdef _WIN64
23 __int64 InterlockedXor64(__int64 volatile *, __int64) __attribute__((alias("_InterlockedXor64")));
24 #else
25 __int64 __stdcall InterlockedXor64(__int64 volatile *Destination, __int64 Value);
InterlockedXor64(__int64 volatile * Destination,__int64 Value)26 __int64 __stdcall InterlockedXor64(__int64 volatile *Destination, __int64 Value)
27 {
28   return _InterlockedXor64(Destination, Value);
29 }
30 #endif
31