[libc-commits] [PATCH] D120579: Use __builtin_clz to find leading 1 in generic sqrt (where possible)
Clint Caywood via Phabricator via libc-commits
libc-commits at lists.llvm.org
Fri Feb 25 11:14:27 PST 2022
cratonica updated this revision to Diff 411468.
cratonica added a comment.
Fix some declaration ordering
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120579/new/
https://reviews.llvm.org/D120579
Files:
libc/src/__support/FPUtil/generic/sqrt.h
Index: libc/src/__support/FPUtil/generic/sqrt.h
===================================================================
--- libc/src/__support/FPUtil/generic/sqrt.h
+++ libc/src/__support/FPUtil/generic/sqrt.h
@@ -21,8 +21,6 @@
namespace internal {
-template <typename T> static inline int clz(T val);
-
template <typename T> struct SpecialLongDouble {
static constexpr bool VALUE = false;
};
@@ -37,6 +35,7 @@
// __builtin_clz* rather than using the exactly-sized aliases from stdint.h.
// This way, we can avoid making any assumptions about integer sizes and let the
// compiler match for us.
+template <typename T> static inline int clz(T val);
template <> inline int clz<unsigned int>(unsigned int val) {
return __builtin_clz(val);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120579.411468.patch
Type: text/x-patch
Size: 752 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220225/a437672f/attachment-0001.bin>
More information about the libc-commits
mailing list