diff options
| author | Richard Qin <richard.qin.x@gmail.com> | 2026-10-16 02:39:56 +0800 |
|---|---|---|
| committer | Richard Qin <richard.qin.x@gmail.com> | 2026-10-16 02:39:56 +0800 |
| commit | 8cace3f05003c6cb4d38c36890055f03151c2ad4 (patch) | |
| tree | aa739deaac0266f17c4e91b333957501cb1ea2e9 /third_party/libcxx/include/c++/v1/__bit | |
| parent | 3ad39e9878310e5317ee73c9b353c1e2c1c5c4ee (diff) | |
| download | lume-8cace3f05003c6cb4d38c36890055f03151c2ad4.tar.gz lume-8cace3f05003c6cb4d38c36890055f03151c2ad4.tar.xz | |
Remove old code
Signed-off-by: Richard Qin <richard.qin.x@gmail.com>
Diffstat (limited to 'third_party/libcxx/include/c++/v1/__bit')
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/bit_cast.h | 44 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/bit_ceil.h | 54 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/bit_floor.h | 33 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/bit_log2.h | 33 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/bit_width.h | 33 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/blsr.h | 34 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/byteswap.h | 53 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/countl.h | 48 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/countr.h | 48 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/endian.h | 38 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/has_single_bit.h | 37 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/invert_if.h | 30 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/popcount.h | 42 | ||||
| -rw-r--r-- | third_party/libcxx/include/c++/v1/__bit/rotate.h | 60 |
14 files changed, 0 insertions, 587 deletions
diff --git a/third_party/libcxx/include/c++/v1/__bit/bit_cast.h b/third_party/libcxx/include/c++/v1/__bit/bit_cast.h deleted file mode 100644 index 7350250..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/bit_cast.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BIT_CAST_H -#define _LIBCPP___BIT_BIT_CAST_H - -#include <__config> -#include <__type_traits/is_trivially_copyable.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#ifndef _LIBCPP_CXX03_LANG - -template <class _ToType, class _FromType> -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI constexpr _ToType __bit_cast(const _FromType& __from) noexcept { - return __builtin_bit_cast(_ToType, __from); -} - -#endif // _LIBCPP_CXX03_LANG - -#if _LIBCPP_STD_VER >= 20 - -template <class _ToType, class _FromType> - requires(sizeof(_ToType) == sizeof(_FromType) && is_trivially_copyable_v<_ToType> && - is_trivially_copyable_v<_FromType>) -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _ToType bit_cast(const _FromType& __from) noexcept { - return __builtin_bit_cast(_ToType, __from); -} - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BIT_CAST_H diff --git a/third_party/libcxx/include/c++/v1/__bit/bit_ceil.h b/third_party/libcxx/include/c++/v1/__bit/bit_ceil.h deleted file mode 100644 index 99881a8..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/bit_ceil.h +++ /dev/null @@ -1,54 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BIT_CEIL_H -#define _LIBCPP___BIT_BIT_CEIL_H - -#include <__assert> -#include <__bit/countl.h> -#include <__config> -#include <__type_traits/integer_traits.h> -#include <limits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if _LIBCPP_STD_VER >= 17 - -template <class _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp __bit_ceil(_Tp __t) noexcept { - if (__t < 2) - return 1; - const unsigned __n = numeric_limits<_Tp>::digits - std::__countl_zero((_Tp)(__t - 1u)); - _LIBCPP_ASSERT_ARGUMENT_WITHIN_DOMAIN(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil"); - - if constexpr (sizeof(_Tp) >= sizeof(unsigned)) - return _Tp{1} << __n; - else { - const unsigned __extra = numeric_limits<unsigned>::digits - numeric_limits<_Tp>::digits; - const unsigned __ret_val = 1u << (__n + __extra); - return (_Tp)(__ret_val >> __extra); - } -} - -# if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_ceil(_Tp __t) noexcept { - return std::__bit_ceil(__t); -} - -# endif // _LIBCPP_STD_VER >= 20 -#endif // _LIBCPP_STD_VER >= 17 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BIT_CEIL_H diff --git a/third_party/libcxx/include/c++/v1/__bit/bit_floor.h b/third_party/libcxx/include/c++/v1/__bit/bit_floor.h deleted file mode 100644 index 799a064..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/bit_floor.h +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BIT_FLOOR_H -#define _LIBCPP___BIT_BIT_FLOOR_H - -#include <__bit/bit_log2.h> -#include <__config> -#include <__type_traits/integer_traits.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp bit_floor(_Tp __t) noexcept { - return __t == 0 ? 0 : _Tp{1} << std::__bit_log2(__t); -} - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BIT_FLOOR_H diff --git a/third_party/libcxx/include/c++/v1/__bit/bit_log2.h b/third_party/libcxx/include/c++/v1/__bit/bit_log2.h deleted file mode 100644 index 9ceeec1..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/bit_log2.h +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BIT_LOG2_H -#define _LIBCPP___BIT_BIT_LOG2_H - -#include <__assert> -#include <__bit/countl.h> -#include <__config> -#include <__type_traits/integer_traits.h> -#include <limits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __bit_log2(_Tp __t) _NOEXCEPT { - static_assert(__is_unsigned_integer_v<_Tp>, "__bit_log2 requires an unsigned integer type"); - _LIBCPP_ASSERT_INTERNAL(__t != 0, "logarithm of 0 is undefined"); - return numeric_limits<_Tp>::digits - 1 - std::__countl_zero(__t); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BIT_LOG2_H diff --git a/third_party/libcxx/include/c++/v1/__bit/bit_width.h b/third_party/libcxx/include/c++/v1/__bit/bit_width.h deleted file mode 100644 index 75050ac..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/bit_width.h +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BIT_WIDTH_H -#define _LIBCPP___BIT_BIT_WIDTH_H - -#include <__bit/bit_log2.h> -#include <__config> -#include <__type_traits/integer_traits.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER >= 20 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int bit_width(_Tp __t) noexcept { - return __t == 0 ? 0 : std::__bit_log2(__t) + 1; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 20 - -#endif // _LIBCPP___BIT_BIT_WIDTH_H diff --git a/third_party/libcxx/include/c++/v1/__bit/blsr.h b/third_party/libcxx/include/c++/v1/__bit/blsr.h deleted file mode 100644 index 76bd521..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/blsr.h +++ /dev/null @@ -1,34 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BLSR_H -#define _LIBCPP___BIT_BLSR_H - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unsigned __libcpp_blsr(unsigned __x) _NOEXCEPT { - return __x ^ (__x & -__x); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unsigned long __libcpp_blsr(unsigned long __x) _NOEXCEPT { - return __x ^ (__x & -__x); -} - -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR unsigned long long __libcpp_blsr(unsigned long long __x) _NOEXCEPT { - return __x ^ (__x & -__x); -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BLSR_H diff --git a/third_party/libcxx/include/c++/v1/__bit/byteswap.h b/third_party/libcxx/include/c++/v1/__bit/byteswap.h deleted file mode 100644 index 7ce7e06..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/byteswap.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_BYTESWAP_H -#define _LIBCPP___BIT_BYTESWAP_H - -#include <__concepts/arithmetic.h> -#include <__config> -#include <cstdint> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -#if _LIBCPP_STD_VER >= 23 - -template <integral _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp byteswap(_Tp __val) noexcept { - if constexpr (sizeof(_Tp) == 1) { - return __val; - } else if constexpr (sizeof(_Tp) == 2) { - return __builtin_bswap16(__val); - } else if constexpr (sizeof(_Tp) == 4) { - return __builtin_bswap32(__val); - } else if constexpr (sizeof(_Tp) == 8) { - return __builtin_bswap64(__val); -# if _LIBCPP_HAS_INT128 - } else if constexpr (sizeof(_Tp) == 16) { -# if __has_builtin(__builtin_bswap128) - return __builtin_bswap128(__val); -# else - return (static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val))) << 64) | - static_cast<_Tp>(byteswap(static_cast<uint64_t>(__val >> 64))); -# endif // __has_builtin(__builtin_bswap128) -# endif // _LIBCPP_HAS_INT128 - } else { - static_assert(sizeof(_Tp) == 0, "byteswap is unimplemented for integral types of this size"); - } -} - -#endif // _LIBCPP_STD_VER >= 23 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_BYTESWAP_H diff --git a/third_party/libcxx/include/c++/v1/__bit/countl.h b/third_party/libcxx/include/c++/v1/__bit/countl.h deleted file mode 100644 index c95828f..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/countl.h +++ /dev/null @@ -1,48 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_COUNTL_H -#define _LIBCPP___BIT_COUNTL_H - -#include <__config> -#include <__type_traits/integer_traits.h> -#include <limits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 int __countl_zero(_Tp __t) _NOEXCEPT { - return __builtin_clzg(__t, numeric_limits<_Tp>::digits); -} - -#if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_zero(_Tp __t) noexcept { - return std::__countl_zero(__t); -} - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countl_one(_Tp __t) noexcept { - return std::countl_zero(static_cast<_Tp>(~__t)); -} - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___BIT_COUNTL_H diff --git a/third_party/libcxx/include/c++/v1/__bit/countr.h b/third_party/libcxx/include/c++/v1/__bit/countr.h deleted file mode 100644 index 16f689d..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/countr.h +++ /dev/null @@ -1,48 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_COUNTR_H -#define _LIBCPP___BIT_COUNTR_H - -#include <__config> -#include <__type_traits/integer_traits.h> -#include <limits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __countr_zero(_Tp __t) _NOEXCEPT { - return __builtin_ctzg(__t, numeric_limits<_Tp>::digits); -} - -#if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_zero(_Tp __t) noexcept { - return std::__countr_zero(__t); -} - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int countr_one(_Tp __t) noexcept { - return std::countr_zero(static_cast<_Tp>(~__t)); -} - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___BIT_COUNTR_H diff --git a/third_party/libcxx/include/c++/v1/__bit/endian.h b/third_party/libcxx/include/c++/v1/__bit/endian.h deleted file mode 100644 index 2d31e5d..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/endian.h +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_ENDIAN_H -#define _LIBCPP___BIT_ENDIAN_H - -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -#if _LIBCPP_STD_VER >= 20 - -_LIBCPP_BEGIN_NAMESPACE_STD - -enum class endian { - little = 0xDEAD, - big = 0xFACE, -# if defined(_LIBCPP_LITTLE_ENDIAN) - native = little -# elif defined(_LIBCPP_BIG_ENDIAN) - native = big -# else - native = 0xCAFE -# endif -}; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 20 - -#endif // _LIBCPP___BIT_ENDIAN_H diff --git a/third_party/libcxx/include/c++/v1/__bit/has_single_bit.h b/third_party/libcxx/include/c++/v1/__bit/has_single_bit.h deleted file mode 100644 index c49c518..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/has_single_bit.h +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_HAS_SINGLE_BIT_H -#define _LIBCPP___BIT_HAS_SINGLE_BIT_H - -#include <__config> -#include <__type_traits/integer_traits.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -#if _LIBCPP_STD_VER >= 20 - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool has_single_bit(_Tp __t) noexcept { - return __builtin_popcountg(__t) == 1; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___BIT_HAS_SINGLE_BIT_H diff --git a/third_party/libcxx/include/c++/v1/__bit/invert_if.h b/third_party/libcxx/include/c++/v1/__bit/invert_if.h deleted file mode 100644 index f7606ed..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/invert_if.h +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_INVERT_IF_H -#define _LIBCPP___BIT_INVERT_IF_H - -#include <__concepts/arithmetic.h> -#include <__config> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <bool _Invert, class _Tp> -_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp __invert_if(_Tp __v) { - if (_Invert) - return ~__v; - return __v; -} - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_INVERT_IF_H diff --git a/third_party/libcxx/include/c++/v1/__bit/popcount.h b/third_party/libcxx/include/c++/v1/__bit/popcount.h deleted file mode 100644 index d104c8e..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/popcount.h +++ /dev/null @@ -1,42 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_POPCOUNT_H -#define _LIBCPP___BIT_POPCOUNT_H - -#include <__config> -#include <__type_traits/integer_traits.h> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_PUSH_MACROS -#include <__undef_macros> - -_LIBCPP_BEGIN_NAMESPACE_STD - -template <class _Tp> -[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR int __popcount(_Tp __t) _NOEXCEPT { - return __builtin_popcountg(__t); -} - -#if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int popcount(_Tp __t) noexcept { - return std::__popcount(__t); -} - -#endif - -_LIBCPP_END_NAMESPACE_STD - -_LIBCPP_POP_MACROS - -#endif // _LIBCPP___BIT_POPCOUNT_H diff --git a/third_party/libcxx/include/c++/v1/__bit/rotate.h b/third_party/libcxx/include/c++/v1/__bit/rotate.h deleted file mode 100644 index fde9058..0000000 --- a/third_party/libcxx/include/c++/v1/__bit/rotate.h +++ /dev/null @@ -1,60 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef _LIBCPP___BIT_ROTATE_H -#define _LIBCPP___BIT_ROTATE_H - -#include <__config> -#include <__type_traits/integer_traits.h> -#include <limits> - -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif - -_LIBCPP_BEGIN_NAMESPACE_STD - -// Writing two full functions for rotl and rotr makes it easier for the compiler -// to optimize the code. On x86 this function becomes the ROL instruction and -// the rotr function becomes the ROR instruction. - -#if _LIBCPP_STD_VER >= 20 - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotl(_Tp __t, int __cnt) noexcept { - const int __n = numeric_limits<_Tp>::digits; - int __r = __cnt % __n; - - if (__r == 0) - return __t; - - if (__r > 0) - return (__t << __r) | (__t >> (__n - __r)); - - return (__t >> -__r) | (__t << (__n + __r)); -} - -template <__unsigned_integer _Tp> -[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr _Tp rotr(_Tp __t, int __cnt) noexcept { - const int __n = numeric_limits<_Tp>::digits; - int __r = __cnt % __n; - - if (__r == 0) - return __t; - - if (__r > 0) - return (__t >> __r) | (__t << (__n - __r)); - - return (__t << -__r) | (__t >> (__n + __r)); -} - -#endif // _LIBCPP_STD_VER >= 20 - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP___BIT_ROTATE_H |
