10#if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
11#error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."
20#if defined(__cplusplus) && (__cplusplus >= 201103L)
21#define __RELAXED_FN_ATTRS \
22 __attribute__((__always_inline__, __nodebug__)) constexpr
24#define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
40 return __builtin_ia32_tzcnt_u16(__X);
58#define _tzcnt_u16 __tzcnt_u16
73 return __builtin_ia32_tzcnt_u32(__X);
89 return (
int)__builtin_ia32_tzcnt_u32(__X);
107#define _tzcnt_u32 __tzcnt_u32
123__tzcnt_u64(
unsigned long long __X) {
124 return __builtin_ia32_tzcnt_u64(__X);
139_mm_tzcnt_64(
unsigned long long __X) {
140 return (
long long)__builtin_ia32_tzcnt_u64(__X);
158#define _tzcnt_u64 __tzcnt_u64
162#undef __RELAXED_FN_ATTRS
164#if !defined(__SCE__) || __has_feature(modules) || defined(__BMI__)
167#if defined(__cplusplus) && (__cplusplus >= 201103L)
168#define __DEFAULT_FN_ATTRS \
169 __attribute__((__always_inline__, __nodebug__, __target__("bmi"))) constexpr
171#define __DEFAULT_FN_ATTRS \
172 __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
212#define _andn_u32 __andn_u32
233 return __builtin_ia32_bextr_u32(__X,
__Y);
257 return __builtin_ia32_bextr_u32(__X, ((
__Y & 0xff) | ((__Z & 0xff) << 8)));
279 return __builtin_ia32_bextr_u32(__X,
__Y);
315#define _blsi_u32 __blsi_u32
331 return __X ^ (__X - 1);
350#define _blsmsk_u32 __blsmsk_u32
366 return __X & (__X - 1);
385#define _blsr_u32 __blsr_u32
404__andn_u64 (
unsigned long long __X,
unsigned long long __Y) {
427#define _andn_u64 __andn_u64
447__bextr_u64(
unsigned long long __X,
unsigned long long __Y) {
448 return __builtin_ia32_bextr_u64(__X,
__Y);
471_bextr_u64(
unsigned long long __X,
unsigned int __Y,
unsigned int __Z) {
472 return __builtin_ia32_bextr_u64(__X, ((
__Y & 0xff) | ((__Z & 0xff) << 8)));
493_bextr2_u64(
unsigned long long __X,
unsigned long long __Y) {
494 return __builtin_ia32_bextr_u64(__X,
__Y);
510__blsi_u64(
unsigned long long __X) {
530#define _blsi_u64 __blsi_u64
545__blsmsk_u64(
unsigned long long __X) {
546 return __X ^ (__X - 1);
565#define _blsmsk_u64 __blsmsk_u64
580__blsr_u64(
unsigned long long __X) {
581 return __X & (__X - 1);
600#define _blsr_u64 __blsr_u64
604#undef __DEFAULT_FN_ATTRS
static __inline__ unsigned int __RELAXED_FN_ATTRS __tzcnt_u32(unsigned int __X)
Counts the number of trailing zero bits in the operand.
#define __DEFAULT_FN_ATTRS
static __inline__ unsigned int __DEFAULT_FN_ATTRS __bextr_u32(unsigned int __X, unsigned int __Y)
Extracts the specified bits from the first operand and returns them in the least significant bits of ...
static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsmsk_u32(unsigned int __X)
Creates a mask whose bits are set to 1, using bit 0 up to and including the least significant bit tha...
static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsi_u32(unsigned int __X)
Clears all bits in the source except for the least significant bit containing a value of 1 and return...
static __inline__ unsigned int __DEFAULT_FN_ATTRS _bextr_u32(unsigned int __X, unsigned int __Y, unsigned int __Z)
Extracts the specified bits from the first operand and returns them in the least significant bits of ...
static __inline__ unsigned int __DEFAULT_FN_ATTRS _bextr2_u32(unsigned int __X, unsigned int __Y)
Extracts the specified bits from the first operand and returns them in the least significant bits of ...
#define __RELAXED_FN_ATTRS
static __inline__ unsigned int __DEFAULT_FN_ATTRS __andn_u32(unsigned int __X, unsigned int __Y)
Performs a bitwise AND of the second operand with the one's complement of the first operand.
static __inline__ unsigned short __RELAXED_FN_ATTRS __tzcnt_u16(unsigned short __X)
Counts the number of trailing zero bits in the operand.
static __inline__ int __RELAXED_FN_ATTRS _mm_tzcnt_32(unsigned int __X)
Counts the number of trailing zero bits in the operand.
static __inline__ unsigned int __DEFAULT_FN_ATTRS __blsr_u32(unsigned int __X)
Clears the least significant bit that is set to 1 in the source operand and returns the result.
__inline unsigned int unsigned int __Y