[libcxx-commits] [PATCH] D119647: [libcxx] Fix setup of MSVC specific intrinsics in Ryu code
Martin Storsjö via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 14 12:11:31 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b89360d3a14: [libcxx] Fix setup of MSVC specific intrinsics in Ryu code (authored by mstorsjo).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119647/new/
https://reviews.llvm.org/D119647
Files:
libcxx/src/include/ryu/d2s_intrinsics.h
libcxx/src/include/ryu/ryu.h
Index: libcxx/src/include/ryu/ryu.h
===================================================================
--- libcxx/src/include/ryu/ryu.h
+++ libcxx/src/include/ryu/ryu.h
@@ -56,9 +56,9 @@
#include "include/ryu/d2s.h"
#include "include/ryu/d2fixed.h"
-#if defined(_M_X64) && defined(_LIBCPP_COMPILER_MSVC)
-#include <intrin0.h> // for _umul128() and __shiftright128()
-#endif // defined(_M_X64) && defined(_LIBCPP_COMPILER_MSVC)
+#if defined(_MSC_VER)
+#include <intrin.h> // for _umul128(), __shiftright128(), _BitScanForward{,64}
+#endif // defined(_MSC_VER)
#if defined(_WIN64) || defined(_M_AMD64) || defined(__x86_64__) || defined(__aarch64__)
#define _LIBCPP_64_BIT
@@ -68,7 +68,7 @@
// https://github.com/ulfjack/ryu/tree/59661c3/ryu
-#if !defined(_LIBCPP_COMPILER_MSVC)
+#if !defined(_MSC_VER)
_LIBCPP_HIDE_FROM_ABI inline unsigned char _BitScanForward64(unsigned long* __index, unsigned long long __mask) {
if (__mask == 0) {
return false;
@@ -84,7 +84,7 @@
*__index = __builtin_ctz(__mask);
return true;
}
-#endif // _LIBCPP_COMPILER_MSVC
+#endif // !_MSC_VER
template <class _Floating>
[[nodiscard]] to_chars_result _Floating_to_chars_ryu(
Index: libcxx/src/include/ryu/d2s_intrinsics.h
===================================================================
--- libcxx/src/include/ryu/d2s_intrinsics.h
+++ libcxx/src/include/ryu/d2s_intrinsics.h
@@ -44,6 +44,8 @@
#include "__config"
+#include "include/ryu/ryu.h"
+
_LIBCPP_BEGIN_NAMESPACE_STD
#if defined(_M_X64) && defined(_MSC_VER)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119647.408548.patch
Type: text/x-patch
Size: 1537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220214/baad9081/attachment.bin>
More information about the libcxx-commits
mailing list