return __X ? __builtin_clz(__X) : 32;
}
+static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__))
+_lzcnt_u32(unsigned int __X)
+{
+ return __X ? __builtin_clz(__X) : 32;
+}
+
#ifdef __x86_64__
static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
__lzcnt64(unsigned long long __X)
{
return __X ? __builtin_clzll(__X) : 64;
}
+
+static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__))
+_lzcnt_u64(unsigned long long __X)
+{
+ return __X ? __builtin_clzll(__X) : 64;
+}
#endif
#endif /* __LZCNTINTRIN_H */
// CHECK: @llvm.ctlz.i64
return __lzcnt64(__X);
}
+
+unsigned int test_lzcnt_u32(unsigned int __X)
+{
+ // CHECK: @llvm.ctlz.i32
+ return _lzcnt_u32(__X);
+}
+
+unsigned long long test__lzcnt_u64(unsigned long long __X)
+{
+ // CHECK: @llvm.ctlz.i64
+ return _lzcnt_u64(__X);
+}