ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
lzcntintrin.h
Go to the documentation of this file.
1 /*===---- lzcntintrin.h - LZCNT intrinsics ---------------------------------===
2  *
3  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4  * See https://llvm.org/LICENSE.txt for license information.
5  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6  *
7  *===-----------------------------------------------------------------------===
8  */
9 
10 #if !defined __X86INTRIN_H && !defined __IMMINTRIN_H
11 #error "Never use <lzcntintrin.h> directly; include <x86intrin.h> instead."
12 #endif
13 
14 #ifndef __LZCNTINTRIN_H
15 #define __LZCNTINTRIN_H
16 
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("lzcnt")))
19 
20 #ifndef _MSC_VER
31 #define __lzcnt16(X) __builtin_ia32_lzcnt_u16((unsigned short)(X))
32 #endif // _MSC_VER
33 
45 static __inline__ unsigned int __DEFAULT_FN_ATTRS
46 __lzcnt32(unsigned int __X)
47 {
48  return __builtin_ia32_lzcnt_u32(__X);
49 }
50 
62 static __inline__ unsigned int __DEFAULT_FN_ATTRS
63 _lzcnt_u32(unsigned int __X)
64 {
65  return __builtin_ia32_lzcnt_u32(__X);
66 }
67 
68 #ifdef __x86_64__
69 #ifndef _MSC_VER
81 #define __lzcnt64(X) __builtin_ia32_lzcnt_u64((unsigned long long)(X))
82 #endif // _MSC_VER
83 
95 static __inline__ unsigned long long __DEFAULT_FN_ATTRS
96 _lzcnt_u64(unsigned long long __X)
97 {
98  return __builtin_ia32_lzcnt_u64(__X);
99 }
100 #endif
101 
102 #undef __DEFAULT_FN_ATTRS
103 
104 #endif /* __LZCNTINTRIN_H */
static __inline__ unsigned int __DEFAULT_FN_ATTRS __lzcnt32(unsigned int __X)
Counts the number of leading zero bits in the operand.
Definition: lzcntintrin.h:46
static __inline__ unsigned int __DEFAULT_FN_ATTRS _lzcnt_u32(unsigned int __X)
Counts the number of leading zero bits in the operand.
Definition: lzcntintrin.h:63
#define __DEFAULT_FN_ATTRS
Definition: lzcntintrin.h:18