24 #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
25 #error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."
31 #define _tzcnt_u16(a) (__tzcnt_u16((a)))
32 #define _andn_u32(a, b) (__andn_u32((a), (b)))
34 #define _blsi_u32(a) (__blsi_u32((a)))
35 #define _blsmsk_u32(a) (__blsmsk_u32((a)))
36 #define _blsr_u32(a) (__blsr_u32((a)))
37 #define _tzcnt_u32(a) (__tzcnt_u32((a)))
40 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("bmi")))
45 #define __RELAXED_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
48 __tzcnt_u16(
unsigned short __X)
50 return __X ? __builtin_ctzs(__X) : 16;
54 __andn_u32(
unsigned int __X,
unsigned int __Y)
61 __bextr_u32(
unsigned int __X,
unsigned int __Y)
63 return __builtin_ia32_bextr_u32(__X, __Y);
68 _bextr_u32(
unsigned int __X,
unsigned int __Y,
unsigned int __Z)
70 return __builtin_ia32_bextr_u32 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
74 __blsi_u32(
unsigned int __X)
80 __blsmsk_u32(
unsigned int __X)
82 return __X ^ (__X - 1);
86 __blsr_u32(
unsigned int __X)
88 return __X & (__X - 1);
92 __tzcnt_u32(
unsigned int __X)
94 return __X ? __builtin_ctz(__X) : 32;
99 #define _andn_u64(a, b) (__andn_u64((a), (b)))
101 #define _blsi_u64(a) (__blsi_u64((a)))
102 #define _blsmsk_u64(a) (__blsmsk_u64((a)))
103 #define _blsr_u64(a) (__blsr_u64((a)))
104 #define _tzcnt_u64(a) (__tzcnt_u64((a)))
107 __andn_u64 (
unsigned long long __X,
unsigned long long __Y)
114 __bextr_u64(
unsigned long long __X,
unsigned long long __Y)
116 return __builtin_ia32_bextr_u64(__X, __Y);
121 _bextr_u64(
unsigned long long __X,
unsigned int __Y,
unsigned int __Z)
123 return __builtin_ia32_bextr_u64 (__X, ((__Y & 0xff) | ((__Z & 0xff) << 8)));
127 __blsi_u64(
unsigned long long __X)
133 __blsmsk_u64(
unsigned long long __X)
135 return __X ^ (__X - 1);
139 __blsr_u64(
unsigned long long __X)
141 return __X & (__X - 1);
145 __tzcnt_u64(
unsigned long long __X)
147 return __X ? __builtin_ctzll(__X) : 64;
152 #undef __DEFAULT_FN_ATTRS
153 #undef __RELAXED_FN_ATTRS
#define __RELAXED_FN_ATTRS
Definition: bmiintrin.h:45
#define __DEFAULT_FN_ATTRS
Definition: bmiintrin.h:40