Skip to content

Commit 200751c

Browse files
committed
[Ryu, performance] Use our private _BitScanForward64 for non-MSVC (in src/include/ryu/ryu.h).
Use MSVC _BitScanForward64 on _M_AMD64 and _M_ARM64, but not on the _M_ARM. Remove erroneous public #define _LIBCPP_HAS_BITSCAN64 (should be defined for _M_ARM64 but not for _M_ARM).
1 parent 6cf53da commit 200751c

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

libcxx/include/__config

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,9 @@ _LIBCPP_HARDENING_MODE_DEBUG
222222
# if defined(_MSC_VER) && !defined(__MINGW32__)
223223
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
224224
# endif
225-
# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
226-
# define _LIBCPP_HAS_BITSCAN64 1
227-
# else
228-
# define _LIBCPP_HAS_BITSCAN64 0
229-
# endif
230225
# define _LIBCPP_HAS_OPEN_WITH_WCHAR 1
231226
# else
232227
# define _LIBCPP_HAS_OPEN_WITH_WCHAR 0
233-
# define _LIBCPP_HAS_BITSCAN64 0
234228
# endif // defined(_WIN32)
235229

236230
# if defined(_AIX) && !defined(__64BIT__)

libcxx/include/__cxx03/__config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
229229
# if defined(_MSC_VER) && !defined(__MINGW32__)
230230
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
231231
# endif
232-
# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
233-
# define _LIBCPP_HAS_BITSCAN64
234-
# endif
235232
# define _LIBCPP_HAS_OPEN_WITH_WCHAR
236233
# endif // defined(_WIN32)
237234

libcxx/src/ryu/d2s.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ struct __floating_decimal_64 {
479479
36893488u, 7378697u, 1475739u, 295147u, 59029u, 11805u, 2361u, 472u, 94u, 18u, 3u };
480480

481481
unsigned long _Trailing_zero_bits;
482-
#if _LIBCPP_HAS_BITSCAN64
482+
#if !defined(_MSC_VER) || defined(_M_AMD64) || defined(_M_ARM64) // we have own _BitScanForward64 for non-MSVC
483483
(void) _BitScanForward64(&_Trailing_zero_bits, __v.__mantissa); // __v.__mantissa is guaranteed nonzero
484484
#else // ^^^ 64-bit ^^^ / vvv 32-bit vvv
485485
const uint32_t _Low_mantissa = static_cast<uint32_t>(__v.__mantissa);

0 commit comments

Comments
 (0)