Skip to content
Snippets Groups Projects
Commit 0cc83d15 authored by Warren Hunt's avatar Warren Hunt
Browse files

Fixing implementation of bittestandset in Intrin.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191783 91177308-0d34-0410-b5e6-96231b3b80d8
parent d11344a7
No related branches found
No related tags found
No related merge requests found
......@@ -497,7 +497,7 @@ _bittestandreset(long *a, long b) {
static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))
_bittestandset(long *a, long b) {
unsigned char x = (*a >> b) & 1;
*a = *a & (1 << b);
*a = *a | (1 << b);
return x;
}
#ifdef __x86_64__
......@@ -546,7 +546,7 @@ _bittestandreset64(__int64 *a, __int64 b) {
static __inline__ unsigned char __attribute__((__always_inline__, __nodebug__))
_bittestandset64(__int64 *a, __int64 b) {
unsigned char x = (*a >> b) & 1;
*a = *a & (1ll << b);
*a = *a | (1ll << b);
return x;
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment