@@ -57,8 +57,8 @@ inline std::pair<DigitsT, int16_t> getRounded(DigitsT Digits, int16_t Scale,
57
57
if (ShouldRound)
58
58
if (!++Digits)
59
59
// Overflow.
60
- return std::make_pair ( DigitsT (1 ) << (getWidth<DigitsT>() - 1 ), Scale + 1 ) ;
61
- return std::make_pair ( Digits, Scale) ;
60
+ return { DigitsT (1 ) << (getWidth<DigitsT>() - 1 ), Scale + 1 } ;
61
+ return { Digits, Scale} ;
62
62
}
63
63
64
64
// / Convenience helper for 32-bit rounding.
@@ -83,7 +83,7 @@ inline std::pair<DigitsT, int16_t> getAdjusted(uint64_t Digits,
83
83
84
84
const int Width = getWidth<DigitsT>();
85
85
if (Width == 64 || Digits <= std::numeric_limits<DigitsT>::max ())
86
- return std::make_pair ( Digits, Scale) ;
86
+ return { Digits, Scale} ;
87
87
88
88
// Shift right and round.
89
89
int Shift = llvm::bit_width (Digits) - Width;
@@ -160,9 +160,9 @@ std::pair<DigitsT, int16_t> getQuotient(DigitsT Dividend, DigitsT Divisor) {
160
160
161
161
// Check for zero.
162
162
if (!Dividend)
163
- return std::make_pair ( 0 , 0 ) ;
163
+ return { 0 , 0 } ;
164
164
if (!Divisor)
165
- return std::make_pair (std:: numeric_limits<DigitsT>::max (), MaxScale) ;
165
+ return { std::numeric_limits<DigitsT>::max (), MaxScale} ;
166
166
167
167
if (getWidth<DigitsT>() == 64 )
168
168
return divide64 (Dividend, Divisor);
@@ -192,7 +192,7 @@ inline std::pair<int32_t, int> getLgImpl(DigitsT Digits, int16_t Scale) {
192
192
static_assert (!std::numeric_limits<DigitsT>::is_signed, " expected unsigned" );
193
193
194
194
if (!Digits)
195
- return std::make_pair ( INT32_MIN, 0 ) ;
195
+ return { INT32_MIN, 0 } ;
196
196
197
197
// Get the floor of the lg of Digits.
198
198
static_assert (sizeof (Digits) <= sizeof (uint64_t ));
@@ -201,12 +201,12 @@ inline std::pair<int32_t, int> getLgImpl(DigitsT Digits, int16_t Scale) {
201
201
// Get the actual floor.
202
202
int32_t Floor = Scale + LocalFloor;
203
203
if (Digits == UINT64_C (1 ) << LocalFloor)
204
- return std::make_pair ( Floor, 0 ) ;
204
+ return { Floor, 0 } ;
205
205
206
206
// Round based on the next digit.
207
207
assert (LocalFloor >= 1 );
208
208
bool Round = Digits & UINT64_C (1 ) << (LocalFloor - 1 );
209
- return std::make_pair ( Floor + Round, Round ? 1 : -1 ) ;
209
+ return { Floor + Round, Round ? 1 : -1 } ;
210
210
}
211
211
212
212
// / Get the lg (rounded) of a scaled number.
@@ -348,11 +348,11 @@ std::pair<DigitsT, int16_t> getSum(DigitsT LDigits, int16_t LScale,
348
348
// Compute sum.
349
349
DigitsT Sum = LDigits + RDigits;
350
350
if (Sum >= RDigits)
351
- return std::make_pair ( Sum, Scale) ;
351
+ return { Sum, Scale} ;
352
352
353
353
// Adjust sum after arithmetic overflow.
354
354
DigitsT HighBit = DigitsT (1 ) << (getWidth<DigitsT>() - 1 );
355
- return std::make_pair ( HighBit | Sum >> 1 , Scale + 1 ) ;
355
+ return { HighBit | Sum >> 1 , Scale + 1 } ;
356
356
}
357
357
358
358
// / Convenience helper for 32-bit sum.
@@ -384,18 +384,18 @@ std::pair<DigitsT, int16_t> getDifference(DigitsT LDigits, int16_t LScale,
384
384
385
385
// Compute difference.
386
386
if (LDigits <= RDigits)
387
- return std::make_pair ( 0 , 0 ) ;
387
+ return { 0 , 0 } ;
388
388
if (RDigits || !SavedRDigits)
389
- return std::make_pair ( LDigits - RDigits, LScale) ;
389
+ return { LDigits - RDigits, LScale} ;
390
390
391
391
// Check if RDigits just barely lost its last bit. E.g., for 32-bit:
392
392
//
393
393
// 1*2^32 - 1*2^0 == 0xffffffff != 1*2^32
394
394
const auto RLgFloor = getLgFloor (SavedRDigits, SavedRScale);
395
395
if (!compare (LDigits, LScale, DigitsT (1 ), RLgFloor + getWidth<DigitsT>()))
396
- return std::make_pair (std:: numeric_limits<DigitsT>::max (), RLgFloor) ;
396
+ return { std::numeric_limits<DigitsT>::max (), RLgFloor} ;
397
397
398
- return std::make_pair ( LDigits, LScale) ;
398
+ return { LDigits, LScale} ;
399
399
}
400
400
401
401
// / Convenience helper for 32-bit difference.
@@ -435,9 +435,9 @@ class ScaledNumberBase {
435
435
436
436
static std::pair<uint64_t , bool > splitSigned (int64_t N) {
437
437
if (N >= 0 )
438
- return std::make_pair ( N, false ) ;
438
+ return { N, false } ;
439
439
uint64_t Unsigned = N == INT64_MIN ? UINT64_C (1 ) << 63 : uint64_t (-N);
440
- return std::make_pair ( Unsigned, true ) ;
440
+ return { Unsigned, true } ;
441
441
}
442
442
static int64_t joinSigned (uint64_t U, bool IsNeg) {
443
443
if (U > uint64_t (INT64_MAX))
0 commit comments