summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorMichael Zuckerman <Michael.zuckerman@intel.com>2016-06-22 12:32:43 +0000
committerMichael Zuckerman <Michael.zuckerman@intel.com>2016-06-22 12:32:43 +0000
commit716859aa644f0df05a84b77f8bd11a057083efe1 (patch)
treea8548369aa3845f3eade287a4e69169cfa551334 /clang/lib
parent397a34a08db195717d0357a6e55437ee4f84fd2c (diff)
downloadbcm5719-llvm-716859aa644f0df05a84b77f8bd11a057083efe1.tar.gz
bcm5719-llvm-716859aa644f0df05a84b77f8bd11a057083efe1.zip
[Clang][bmi][intrinsics] Adding _mm_tzcnt_64 _mm_tzcnt_32 intrinsics to clang.
Differential Revision: http://reviews.llvm.org/D21373 llvm-svn: 273401
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Headers/bmiintrin.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/clang/lib/Headers/bmiintrin.h b/clang/lib/Headers/bmiintrin.h
index d39b04c8c68..30acfaeb9f3 100644
--- a/clang/lib/Headers/bmiintrin.h
+++ b/clang/lib/Headers/bmiintrin.h
@@ -287,6 +287,22 @@ __tzcnt_u32(unsigned int __X)
return __X ? __builtin_ctz(__X) : 32;
}
+/// \brief Counts the number of trailing zero bits in the operand.
+///
+/// \headerfile <x86intrin.h>
+///
+/// This intrinsic corresponds to the \c TZCNT instruction.
+///
+/// \param __X
+/// An unsigned 32-bit integer whose trailing zeros are to be counted.
+/// \returns An 32-bit integer containing the number of trailing zero
+/// bits in the operand.
+static __inline__ int __RELAXED_FN_ATTRS
+_mm_tzcnt_32(unsigned int __X)
+{
+ return __X ? __builtin_ctz(__X) : 32;
+}
+
#ifdef __x86_64__
/// \brief Performs a bitwise AND of the second operand with the one's
@@ -508,6 +524,22 @@ __tzcnt_u64(unsigned long long __X)
return __X ? __builtin_ctzll(__X) : 64;
}
+/// \brief Counts the number of trailing zero bits in the operand.
+///
+/// \headerfile <x86intrin.h>
+///
+/// This intrinsic corresponds to the \c TZCNT instruction.
+///
+/// \param __X
+/// An unsigned 64-bit integer whose trailing zeros are to be counted.
+/// \returns An 64-bit integer containing the number of trailing zero
+/// bits in the operand.
+static __inline__ long long __RELAXED_FN_ATTRS
+_mm_tzcnt_64(unsigned long long __X)
+{
+ return __X ? __builtin_ctzll(__X) : 64;
+}
+
#endif /* __x86_64__ */
#undef __DEFAULT_FN_ATTRS
OpenPOWER on IntegriCloud