This revision was automatically updated to reflect the committed changes.
Closed by commit rL253358: bmiintrin.h: Allow using the tzcnt intrinsics for 
non-BMI targets (authored by hans).

Changed prior to commit:
  http://reviews.llvm.org/D14748?vs=40399&id=40411#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D14748

Files:
  cfe/trunk/lib/Headers/bmiintrin.h

Index: cfe/trunk/lib/Headers/bmiintrin.h
===================================================================
--- cfe/trunk/lib/Headers/bmiintrin.h
+++ cfe/trunk/lib/Headers/bmiintrin.h
@@ -39,7 +39,12 @@
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, 
__target__("bmi")))
 
-static __inline__ unsigned short __DEFAULT_FN_ATTRS
+/* Allow using the tzcnt intrinsics even for non-BMI targets. Since the TZCNT
+   instruction behaves as BSF on non-BMI targets, there is code that expects
+   to use it as a potentially faster version of BSF. */
+#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
+
+static __inline__ unsigned short __RELAXED_FN_ATTRS
 __tzcnt_u16(unsigned short __X)
 {
   return __X ? __builtin_ctzs(__X) : 16;
@@ -83,7 +88,7 @@
   return __X & (__X - 1);
 }
 
-static __inline__ unsigned int __DEFAULT_FN_ATTRS
+static __inline__ unsigned int __RELAXED_FN_ATTRS
 __tzcnt_u32(unsigned int __X)
 {
   return __X ? __builtin_ctz(__X) : 32;
@@ -136,14 +141,15 @@
   return __X & (__X - 1);
 }
 
-static __inline__ unsigned long long __DEFAULT_FN_ATTRS
+static __inline__ unsigned long long __RELAXED_FN_ATTRS
 __tzcnt_u64(unsigned long long __X)
 {
   return __X ? __builtin_ctzll(__X) : 64;
 }
 
 #endif /* __x86_64__ */
 
 #undef __DEFAULT_FN_ATTRS
+#undef __RELAXED_FN_ATTRS
 
 #endif /* __BMIINTRIN_H */


Index: cfe/trunk/lib/Headers/bmiintrin.h
===================================================================
--- cfe/trunk/lib/Headers/bmiintrin.h
+++ cfe/trunk/lib/Headers/bmiintrin.h
@@ -39,7 +39,12 @@
 /* Define the default attributes for the functions in this file. */
 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
 
-static __inline__ unsigned short __DEFAULT_FN_ATTRS
+/* Allow using the tzcnt intrinsics even for non-BMI targets. Since the TZCNT
+   instruction behaves as BSF on non-BMI targets, there is code that expects
+   to use it as a potentially faster version of BSF. */
+#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
+
+static __inline__ unsigned short __RELAXED_FN_ATTRS
 __tzcnt_u16(unsigned short __X)
 {
   return __X ? __builtin_ctzs(__X) : 16;
@@ -83,7 +88,7 @@
   return __X & (__X - 1);
 }
 
-static __inline__ unsigned int __DEFAULT_FN_ATTRS
+static __inline__ unsigned int __RELAXED_FN_ATTRS
 __tzcnt_u32(unsigned int __X)
 {
   return __X ? __builtin_ctz(__X) : 32;
@@ -136,14 +141,15 @@
   return __X & (__X - 1);
 }
 
-static __inline__ unsigned long long __DEFAULT_FN_ATTRS
+static __inline__ unsigned long long __RELAXED_FN_ATTRS
 __tzcnt_u64(unsigned long long __X)
 {
   return __X ? __builtin_ctzll(__X) : 64;
 }
 
 #endif /* __x86_64__ */
 
 #undef __DEFAULT_FN_ATTRS
+#undef __RELAXED_FN_ATTRS
 
 #endif /* __BMIINTRIN_H */
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to