From 2a6656050c75dc8cb646acd8c311d31be5f4eabb Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Tue, 15 Jul 2014 18:13:32 -0500 Subject: [PATCH] Fix the BitScanForward implementations for x86_64. --- common/include/intrin_x86.h | 2 +- plugins/GSdx/stdafx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/include/intrin_x86.h b/common/include/intrin_x86.h index a77d71b5e2..3781b322d3 100644 --- a/common/include/intrin_x86.h +++ b/common/include/intrin_x86.h @@ -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; } diff --git a/plugins/GSdx/stdafx.h b/plugins/GSdx/stdafx.h index aac003178d..9e09ff3836 100644 --- a/plugins/GSdx/stdafx.h +++ b/plugins/GSdx/stdafx.h @@ -375,7 +375,7 @@ struct aligned_free_second {template 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; }