Files
acceptance-tests
data
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
benchmarks
cmake
docs
fuzzing
include
experimental
ext
support
android
fuchsia
ibm
limits.h
locale_mgmt_aix.h
support.h
xlocale.h
musl
newlib
solaris
win32
xlocale
CMakeLists.txt
__bit_reference
__bsd_locale_defaults.h
__bsd_locale_fallbacks.h
__config
__config_site.in
__debug
__functional_03
__functional_base
__functional_base_03
__hash_table
__libcpp_version
__locale
__mutex_base
__nullptr
__split_buffer
__sso_allocator
__std_stream
__string
__threading_support
__tree
__tuple
__undef_macros
algorithm.REMOVED.git-id
any
array
atomic
bitset
cassert
ccomplex
cctype
cerrno
cfenv
cfloat
chrono
cinttypes
ciso646
climits
clocale
cmath
codecvt
complex
complex.h
condition_variable
csetjmp
csignal
cstdarg
cstdbool
cstddef
cstdint
cstdio
cstdlib
cstring
ctgmath
ctime
ctype.h
cwchar
cwctype
deque.REMOVED.git-id
errno.h
exception
float.h
forward_list
fstream
functional
future
initializer_list
inttypes.h
iomanip
ios
iosfwd
iostream
istream
iterator
limits
limits.h
list
locale.REMOVED.git-id
locale.h
map
math.h
memory.REMOVED.git-id
module.modulemap
mutex
new
numeric
optional
ostream
queue
random.REMOVED.git-id
ratio
regex.REMOVED.git-id
scoped_allocator
set
setjmp.h
shared_mutex
sstream
stack
stdbool.h
stddef.h
stdexcept
stdint.h
stdio.h
stdlib.h
streambuf
string.REMOVED.git-id
string.h
string_view
strstream
system_error
tgmath.h
thread
tuple
type_traits.REMOVED.git-id
typeindex
typeinfo
unordered_map
unordered_set
utility
valarray.REMOVED.git-id
variant
vector.REMOVED.git-id
wchar.h
wctype.h
lib
src
utils
www
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
CREDITS.TXT
LICENSE.TXT
NOTES.TXT
TODO.TXT
appveyor-reqs-install.cmd
appveyor.yml
libcxxabi
libunwind
lld
lldb
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

55 lines
1.6 KiB
C++

// -*- C++ -*-
//===----------------------- support/ibm/support.h ----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
#define _LIBCPP_SUPPORT_IBM_SUPPORT_H
extern "builtin" int __popcnt4(unsigned int);
extern "builtin" int __popcnt8(unsigned long long);
extern "builtin" unsigned int __cnttz4(unsigned int);
extern "builtin" unsigned int __cnttz8(unsigned long long);
extern "builtin" unsigned int __cntlz4(unsigned int);
extern "builtin" unsigned int __cntlz8(unsigned long long);
// Builtin functions for counting population
#define __builtin_popcount(x) __popcnt4(x)
#define __builtin_popcountll(x) __popcnt8(x)
#if defined(__64BIT__)
#define __builtin_popcountl(x) __builtin_popcountll(x)
#else
#define __builtin_popcountl(x) __builtin_popcount(x)
#endif
// Builtin functions for counting trailing zeros
#define __builtin_ctz(x) __cnttz4(x)
#define __builtin_ctzll(x) __cnttz8(x)
#if defined(__64BIT__)
#define __builtin_ctzl(x) __builtin_ctzll(x)
#else
#define __builtin_ctzl(x) __builtin_ctz(x)
#endif
// Builtin functions for counting leading zeros
#define __builtin_clz(x) __cntlz4(x)
#define __builtin_clzll(x) __cntlz8(x)
#if defined(__64BIT__)
#define __builtin_clzl(x) __builtin_clzll(x)
#else
#define __builtin_clzl(x) __builtin_clz(x)
#endif
#if defined(__64BIT__)
#define __SIZE_WIDTH__ 64
#else
#define __SIZE_WIDTH__ 32
#endif
#endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H