aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/VirtualFileSystemTest.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-08-08 19:55:52 +0000
committerCraig Topper <craig.topper@intel.com>2018-08-08 19:55:52 +0000
commit0a4f6be4434c9c5d03d9e7ed46ed21af1fdd6a1a (patch)
tree0f9fe4abfb1b3259057c8bceb8ec9666783d6d8f /clang/unittests/Basic/VirtualFileSystemTest.cpp
parent2a92a0efc7006c86da255041649412e429796e22 (diff)
downloadllvm-0a4f6be4434c9c5d03d9e7ed46ed21af1fdd6a1a.zip
llvm-0a4f6be4434c9c5d03d9e7ed46ed21af1fdd6a1a.tar.gz
llvm-0a4f6be4434c9c5d03d9e7ed46ed21af1fdd6a1a.tar.bz2
[Builtins] Implement __builtin_clrsb to be compatible with gcc
gcc defines an intrinsic called __builtin_clrsb which counts the number of extra sign bits on a number. This is equivalent to counting the number of leading zeros on a positive number or the number of leading ones on a negative number and subtracting one from the result. Since we can't count leading ones we need to invert negative numbers to count zeros. This patch will cause the builtin to be expanded inline while gcc uses a call to a function like clrsbdi2 that is implemented in libgcc. But this is similar to what we already do for popcnt. And I don't think compiler-rt supports clrsbdi2. Differential Revision: https://reviews.llvm.org/D50168 llvm-svn: 339282
Diffstat (limited to 'clang/unittests/Basic/VirtualFileSystemTest.cpp')
0 files changed, 0 insertions, 0 deletions