diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 162295b15c72..00a4a4b7c1ed 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-11-17 Quentin Neill + + PR target/46422 + * config/i386/bmiintrin.h (__lzcnt_u16, __lzcnt_u32, __lzcnt_u64): + Call the clz builtin. + 2010-11-17 Dinar Temirbulatov Steve Ellcey diff --git a/gcc/config/i386/bmiintrin.h b/gcc/config/i386/bmiintrin.h index d3b3bbdf4b5d..225f2ecbe23d 100644 --- a/gcc/config/i386/bmiintrin.h +++ b/gcc/config/i386/bmiintrin.h @@ -35,13 +35,13 @@ extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u16 (unsigned short __X) { - return __builtin_ia32_lzcnt_u16 (__X); + return __builtin_clzs (__X); } extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u16 (unsigned short __X) { - return __builtin_ctzs(__X); + return __builtin_ctzs (__X); } @@ -82,14 +82,14 @@ __blsr_u32 (unsigned int __X) extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u32 (unsigned int __X) { - return __builtin_ia32_lzcnt_u32 (__X); + return __builtin_clz (__X); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u32 (unsigned int __X) { - return __builtin_ctz(__X); + return __builtin_ctz (__X); } @@ -131,13 +131,13 @@ __blsr_u64 (unsigned long long __X) extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u64 (unsigned long long __X) { - return __builtin_ia32_lzcnt_u64 (__X); + return __builtin_clzll (__X); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u64 (unsigned long long __X) { - return __builtin_ctzll(__X); + return __builtin_ctzll (__X); } #endif /* __x86_64__ */