mirror of https://github.com/PCSX2/pcsx2.git
Merge pull request #144 from Sonicadvance1/fix-BitScanFoward
Fix the BitScanForward implementations for x86_64.
This commit is contained in:
commit
904f5de1ea
|
@ -591,7 +591,7 @@ static __inline__ __attribute__((always_inline)) void __addfsdword(const unsigne
|
|||
/*** Bit manipulation ***/
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -374,7 +374,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)
|
||||
{
|
||||
__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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue