Skip to content

Commit 090ca2f

Browse files
1 parent df21344 commit 090ca2f

11 files changed

Lines changed: 46 additions & 46 deletions

File tree

stl/inc/atomic

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@ struct _Atomic_storage_traits { // properties for how _Ty is stored in an atomic
354354
: sizeof(_Ty) == 2 ? 2
355355
: sizeof(_Ty) <= 4 ? 4
356356
: sizeof(_Ty) <= 8 ? 8
357-
#if defined(_M_X64) || defined(_M_ARM64) || defined(_M_ARM64EC)
357+
#ifdef _WIN64
358358
: sizeof(_Ty) <= 16 ? 16
359-
#endif // 64 bits
359+
#endif // ^^^ 64-bit ^^^
360360
: sizeof(_Ty);
361361

362362
static constexpr size_t _Padding_size = _Storage_size - sizeof(_Ty);
@@ -515,7 +515,7 @@ inline bool __stdcall _Atomic_wait_compare_16_bytes(const void* _Storage, void*
515515
return _InterlockedCompareExchange128_nf(_Dest, _Tmp[1], _Tmp[0], _Tmp) != 0;
516516
#endif // ^^^ ARM64, _M_ARM64EC ^^^
517517
}
518-
#endif // _WIN64
518+
#endif // ^^^ 64-bit ^^^
519519
#endif // _HAS_CXX20
520520
#endif // TRANSITION, ABI
521521

@@ -1295,7 +1295,7 @@ struct _Atomic_storage<_Ty&, 16> { // lock-free using 16-byte intrinsics
12951295

12961296
typename _Atomic_storage_types<_Ty&>::_TStorage _Storage;
12971297
};
1298-
#endif // defined(_WIN64)
1298+
#endif // ^^^ 64-bit ^^^
12991299

13001300
template <class _Ty, size_t = sizeof(_Ty)>
13011301
struct _Atomic_integral; // not defined
@@ -1942,13 +1942,13 @@ struct _Atomic_pointer : _Atomic_storage<_Ty> {
19421942
const ptrdiff_t _Shift_bytes =
19431943
static_cast<ptrdiff_t>(static_cast<size_t>(_Diff) * sizeof(remove_pointer_t<_Ty>));
19441944
ptrdiff_t _Result;
1945-
#if defined(_M_IX86)
1946-
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd,
1947-
_STD _Atomic_address_as<long>(this->_Storage), _Shift_bytes);
1948-
#else // ^^^ 32 bits / 64 bits vvv
1945+
#ifdef _WIN64
19491946
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd64,
19501947
_STD _Atomic_address_as<long long>(this->_Storage), _Shift_bytes);
1951-
#endif // ^^^ 64 bits ^^^
1948+
#else // ^^^ 64-bit / 32-bit vvv
1949+
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd,
1950+
_STD _Atomic_address_as<long>(this->_Storage), _Shift_bytes);
1951+
#endif // ^^^ 32-bit ^^^
19521952
return reinterpret_cast<_Ty>(_Result);
19531953
}
19541954

@@ -2040,13 +2040,13 @@ struct _Atomic_pointer<_Ty&> : _Atomic_storage<_Ty&> {
20402040
const ptrdiff_t _Shift_bytes =
20412041
static_cast<ptrdiff_t>(static_cast<size_t>(_Diff) * sizeof(remove_pointer_t<_Ty>));
20422042
ptrdiff_t _Result;
2043-
#if defined(_M_IX86)
2044-
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd,
2045-
_STD _Atomic_address_as<long>(this->_Storage), _Shift_bytes);
2046-
#else // ^^^ 32 bits / 64 bits vvv
2043+
#ifdef _WIN64
20472044
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd64,
20482045
_STD _Atomic_address_as<long long>(this->_Storage), _Shift_bytes);
2049-
#endif // ^^^ 64 bits ^^^
2046+
#else // ^^^ 64-bit / 32-bit vvv
2047+
_ATOMIC_CHOOSE_INTRINSIC(static_cast<unsigned int>(_Order), _Result, _InterlockedExchangeAdd,
2048+
_STD _Atomic_address_as<long>(this->_Storage), _Shift_bytes);
2049+
#endif // ^^^ 32-bit ^^^
20502050
return reinterpret_cast<_TVal>(_Result);
20512051
}
20522052

stl/inc/execution

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2843,9 +2843,9 @@ inline size_t _Get_stable_sort_tree_height(const size_t _Count, const size_t _Hw
28432843
const size_t _Log_ideal_chunks = _Floor_of_log_2(_Ideal_chunks);
28442844
#ifdef _WIN64
28452845
constexpr size_t _Max_tree_height = 62; // to avoid ptrdiff_t overflow
2846-
#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
2846+
#else // ^^^ 64-bit / 32-bit vvv
28472847
constexpr size_t _Max_tree_height = 30;
2848-
#endif // ^^^ !defined(_WIN64) ^^^
2848+
#endif // ^^^ 32-bit ^^^
28492849
const size_t _Clamped_ideal_chunks = (_STD min) (_Max_tree_height, _Log_ideal_chunks);
28502850

28512851
// similarly, if _Clamped_ideal_chunks is odd, that would break our 2 to even power invariant,

stl/inc/type_traits

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,13 +2412,13 @@ _NODISCARD constexpr bool _Bitmask_includes_all(_Bitmask _Left, _Bitmask _Elemen
24122412

24132413
// These FNV-1a utility functions are extremely performance sensitive,
24142414
// check examples like that in VSO-653642 before making changes.
2415-
#if defined(_WIN64)
2415+
#ifdef _WIN64
24162416
_INLINE_VAR constexpr size_t _FNV_offset_basis = 14695981039346656037ULL;
24172417
_INLINE_VAR constexpr size_t _FNV_prime = 1099511628211ULL;
2418-
#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
2418+
#else // ^^^ 64-bit / 32-bit vvv
24192419
_INLINE_VAR constexpr size_t _FNV_offset_basis = 2166136261U;
24202420
_INLINE_VAR constexpr size_t _FNV_prime = 16777619U;
2421-
#endif // ^^^ !defined(_WIN64) ^^^
2421+
#endif // ^^^ 32-bit ^^^
24222422

24232423
_NODISCARD inline size_t _Fnv1a_append_bytes(size_t _Val, const unsigned char* const _First,
24242424
const size_t _Count) noexcept { // accumulate range [_First, _First + _Count) into partial FNV-1a hash _Val

stl/inc/xlocnum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,9 +628,9 @@ protected:
628628
char* _Ep;
629629
#ifdef _WIN64
630630
_Val = reinterpret_cast<void*>(_CSTD _Stoullx(_Ac, &_Ep, _Parse_result._Base, &_Errno));
631-
#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
631+
#else // ^^^ 64-bit / 32-bit vvv
632632
_Val = reinterpret_cast<void*>(_CSTD _Stoulx(_Ac, &_Ep, _Parse_result._Base, &_Errno));
633-
#endif // ^^^ !defined(_WIN64) ^^^
633+
#endif // ^^^ 32-bit ^^^
634634
if (_Ep == _Ac || _Errno != 0) { // N4950 [facet.num.get.virtuals]/3
635635
_State = ios_base::failbit;
636636
_Val = nullptr;

stl/inc/xmemory

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ _INLINE_VAR constexpr size_t _Non_user_size = sizeof(void*) + _Big_allocation_al
174174

175175
#ifdef _WIN64
176176
_INLINE_VAR constexpr size_t _Big_allocation_sentinel = 0xFAFAFAFAFAFAFAFAULL;
177-
#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
177+
#else // ^^^ 64-bit / 32-bit vvv
178178
_INLINE_VAR constexpr size_t _Big_allocation_sentinel = 0xFAFAFAFAUL;
179-
#endif // ^^^ !defined(_WIN64) ^^^
179+
#endif // ^^^ 32-bit ^^^
180180

181181
template <class _Traits>
182182
__declspec(allocator) void* _Allocate_manually_vector_aligned(const size_t _Bytes) {
@@ -2782,7 +2782,7 @@ _NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // used by bot
27822782

27832783
#ifdef _WIN64
27842784
auto _UVal_trunc = _UVal;
2785-
#else // ^^^ defined(_WIN64) / !defined(_WIN64) vvv
2785+
#else // ^^^ 64-bit / 32-bit vvv
27862786

27872787
if constexpr (sizeof(_UTy) > 4) { // For 64-bit numbers, work in chunks to avoid 64-bit divisions.
27882788
while (_UVal > 0xFFFFFFFFU) {
@@ -2802,7 +2802,7 @@ _NODISCARD _Elem* _UIntegral_to_buff(_Elem* _RNext, _UTy _UVal) { // used by bot
28022802
}
28032803

28042804
auto _UVal_trunc = static_cast<unsigned long>(_UVal);
2805-
#endif // ^^^ !defined(_WIN64) ^^^
2805+
#endif // ^^^ 32-bit ^^^
28062806

28072807
// If we have a single digit, print [0, 9] and return. (This is necessary to correctly handle 0.)
28082808
if (_UVal_trunc < 10) {

stl/src/vector_algorithms.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9614,10 +9614,10 @@ __declspec(noalias) void __stdcall __std_replace_8(
96149614
#ifdef _WIN64
96159615
const __m256i _Comparand = _mm256_broadcastq_epi64(_mm_cvtsi64_si128(_Old_val));
96169616
const __m256i _Replacement = _mm256_broadcastq_epi64(_mm_cvtsi64_si128(_New_val));
9617-
#else // ^^^ defined(_WIN64) / !defined(_WIN64), workaround, _mm_cvtsi64_si128 does not compile vvv
9617+
#else // ^^^ 64-bit / 32-bit, workaround, _mm_cvtsi64_si128 does not compile vvv
96189618
const __m256i _Comparand = _mm256_set1_epi64x(_Old_val);
96199619
const __m256i _Replacement = _mm256_set1_epi64x(_New_val);
9620-
#endif // ^^^ !defined(_WIN64) ^^^
9620+
#endif // ^^^ 32-bit ^^^
96219621
const size_t _Full_length = _Byte_length(_First, _Last);
96229622

96239623
void* _Stop_at = _First;
@@ -10729,9 +10729,9 @@ namespace {
1072910729
static __m256i _Broadcast(const uint64_t _Data) noexcept {
1073010730
#ifdef _WIN64
1073110731
return _mm256_broadcastq_epi64(_mm_cvtsi64_si128(_Data));
10732-
#else // ^^^ defined(_WIN64) / !defined(_WIN64), workaround, _mm_cvtsi64_si128 does not compile vvv
10732+
#else // ^^^ 64-bit / 32-bit, workaround, _mm_cvtsi64_si128 does not compile vvv
1073310733
return _mm256_set1_epi64x(_Data);
10734-
#endif // ^^^ !defined(_WIN64) ^^^
10734+
#endif // ^^^ 32-bit ^^^
1073510735
}
1073610736

1073710737
static __m256i _Cmp_gt(const __m256i _First, const __m256i _Second) noexcept {
@@ -10813,9 +10813,9 @@ namespace {
1081310813
static __m128i _Broadcast(const uint64_t _Data) noexcept {
1081410814
#ifdef _WIN64
1081510815
return _mm_shuffle_epi32(_mm_cvtsi64_si128(_Data), _MM_SHUFFLE(1, 0, 1, 0));
10816-
#else // ^^^ defined(_WIN64) / !defined(_WIN64), workaround, _mm_cvtsi64_si128 does not compile vvv
10816+
#else // ^^^ 64-bit / 32-bit, workaround, _mm_cvtsi64_si128 does not compile vvv
1081710817
return _mm_set1_epi64x(_Data);
10818-
#endif // ^^^ !defined(_WIN64) ^^^
10818+
#endif // ^^^ 32-bit ^^^
1081910819
}
1082010820

1082110821
static __m128i _Cmp_gt(const __m128i _First, const __m128i _Second) noexcept {

tests/std/tests/Dev09_158181_tr1_unordered_meow_swap/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,11 @@ void test_LWG_2156() {
127127

128128
#ifndef _WIN64
129129
// make it so rehash can't meet its postcondition, even when not asking for more buckets
130-
// skip on 64 bit because creating reasonable container sizes to trigger this problem there
130+
// skip on 64-bit because creating reasonable container sizes to trigger this problem there
131131
// consumes too much RAM.
132132
x.max_load_factor(FLT_EPSILON);
133133
assert_throws<length_error>([&] { x.rehash(0); });
134-
#endif // !_WIN64
134+
#endif // ^^^ 32-bit ^^^
135135
}
136136

137137
void test_bad_rehash_size() {

tests/std/tests/P2374R4_views_cartesian_product_recommended_practices/test.compile.pass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ using cpv_const_difference_t = range_difference_t<const cartesian_product_view<R
2929

3030
#ifdef _WIN64
3131
constexpr bool is_64_bit = true;
32-
#else // ^^^ 64 bit / 32 bit vvv
32+
#else // ^^^ 64-bit / 32-bit vvv
3333
constexpr bool is_64_bit = false;
34-
#endif // ^^^ 32 bit ^^^
34+
#endif // ^^^ 32-bit ^^^
3535

3636
constexpr void check_array() {
3737
// Check '_Compile_time_max_size' type trait
@@ -265,7 +265,7 @@ constexpr void check_join_view() {
265265
static_assert(_Compile_time_max_size<const V3> == (numeric_limits<size_t>::max)());
266266
static_assert(sizeof(cpv_const_difference_t<V3>) <= sizeof(ptrdiff_t));
267267
static_assert(sizeof(cpv_const_difference_t<V3, V3, V3>) > sizeof(ptrdiff_t));
268-
#endif // ^^^ 64 bit ^^^
268+
#endif // ^^^ 64-bit ^^^
269269
}
270270

271271
constexpr void check_join_with_view() {
@@ -297,7 +297,7 @@ constexpr void check_join_with_view() {
297297
static_assert(_Compile_time_max_size<const V3> == (numeric_limits<size_t>::max)());
298298
static_assert(sizeof(cpv_const_difference_t<V3>) <= sizeof(ptrdiff_t));
299299
static_assert(sizeof(cpv_const_difference_t<V3, V3, V3>) > sizeof(ptrdiff_t));
300-
#endif // ^^^ 64 bit ^^^
300+
#endif // ^^^ 64-bit ^^^
301301

302302
// Check '_Compile_time_max_size' when size of joined range is 0
303303
using V4 = ranges::join_with_view<span<span<int, 5>, 0>, span<int, 2>>;
@@ -425,7 +425,7 @@ constexpr void check_cartesian_product_view() {
425425
static_assert(_Compile_time_max_size<const V3> == (numeric_limits<_Unsigned128>::max)());
426426
static_assert(sizeof(cpv_const_difference_t<V3>) > sizeof(ptrdiff_t));
427427
static_assert(sizeof(cpv_const_difference_t<V3, V3, V3>) > sizeof(ptrdiff_t));
428-
#endif // ^^^ 64 bit ^^^
428+
#endif // ^^^ 64-bit ^^^
429429
}
430430

431431
struct Pred {

tests/std/tests/VSO_0000000_fancy_pointers/test.compile.pass.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class fancy_pointer {
104104
rep += rhs;
105105
return *this;
106106
}
107-
#endif // _WIN64
107+
#endif // ^^^ 64-bit ^^^
108108

109109
fancy_pointer& operator+=(std::ptrdiff_t rhs) {
110110
rep += rhs;
@@ -120,7 +120,7 @@ class fancy_pointer {
120120
fancy_pointer operator+(int rhs) const {
121121
return fancy_pointer{rep + rhs};
122122
}
123-
#endif // _WIN64
123+
#endif // ^^^ 64-bit ^^^
124124

125125
fancy_pointer operator+(std::ptrdiff_t rhs) const {
126126
return fancy_pointer{rep + rhs};
@@ -135,7 +135,7 @@ class fancy_pointer {
135135
rep -= rhs;
136136
return *this;
137137
}
138-
#endif // _WIN64
138+
#endif // ^^^ 64-bit ^^^
139139

140140
fancy_pointer& operator-=(std::ptrdiff_t rhs) {
141141
rep -= rhs;
@@ -151,7 +151,7 @@ class fancy_pointer {
151151
fancy_pointer operator-(int rhs) const {
152152
return fancy_pointer{rep - rhs};
153153
}
154-
#endif // _WIN64
154+
#endif // ^^^ 64-bit ^^^
155155

156156
fancy_pointer operator-(std::ptrdiff_t rhs) const {
157157
return fancy_pointer{rep - rhs};
@@ -165,7 +165,7 @@ class fancy_pointer {
165165
std::add_lvalue_reference_t<Val> operator[](int offset) const {
166166
return rep[offset];
167167
}
168-
#endif // _WIN64
168+
#endif // ^^^ 64-bit ^^^
169169

170170
std::add_lvalue_reference_t<Val> operator[](std::ptrdiff_t offset) const {
171171
return rep[offset];

tests/std/tests/VSO_0000000_initialize_everything/test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ using namespace std;
1616

1717
#ifdef _WIN64
1818
const size_t bad_size = 0xCCCC'CCCC'CCCC'CCCCULL;
19-
#else // ^^^ _WIN64 / !_WIN64 vvv
19+
#else // ^^^ 64-bit / 32-bit vvv
2020
const size_t bad_size = 0xCCCC'CCCCUL;
21-
#endif // _WIN64
21+
#endif // ^^^ 32-bit ^^^
2222
const unsigned long long default_state = 0xB01DFACEDEBAC1EULL;
2323

2424
template <typename T>

0 commit comments

Comments
 (0)