Fix the BitScanForward implementations for x86_64.

This commit is contained in:
Ryan Houdek 2014-07-15 18:13:32 -05:00
parent 80b22ca2be
commit 2a6656050c
2 changed files with 2 additions and 2 deletions

View File

@ -591,7 +591,7 @@ static __inline__ __attribute__((always_inline)) void __addfsdword(const unsigne
/*** Bit manipulation ***/ /*** Bit manipulation ***/
static __inline__ __attribute__((always_inline)) unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask) static __inline__ __attribute__((always_inline)) unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
{ {
__asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask)); __asm__("bsfl %k[Mask], %k[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
return Mask ? 1 : 0; return Mask ? 1 : 0;
} }

View File

@ -375,7 +375,7 @@ struct aligned_free_second {template<class T> void operator()(T& p) {_aligned_fr
__forceinline unsigned char _BitScanForward(unsigned long* const Index, const unsigned long Mask) __forceinline unsigned char _BitScanForward(unsigned long* const Index, const unsigned long Mask)
{ {
__asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask)); __asm__("bsfl %k[Mask], %k[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
return Mask ? 1 : 0; return Mask ? 1 : 0;
} }