diff options
Diffstat (limited to 'include/llvm/Support/ScaledNumber.h')
-rw-r--r-- | include/llvm/Support/ScaledNumber.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/ScaledNumber.h b/include/llvm/Support/ScaledNumber.h index 54b5386c5a..f6594ec6aa 100644 --- a/include/llvm/Support/ScaledNumber.h +++ b/include/llvm/Support/ScaledNumber.h @@ -53,6 +53,18 @@ inline std::pair<DigitsT, int16_t> getRounded(DigitsT Digits, int16_t Scale, return std::make_pair(Digits, Scale); } +/// \brief Convenience helper for 32-bit rounding. +inline std::pair<uint32_t, int16_t> getRounded32(uint32_t Digits, int16_t Scale, + bool ShouldRound) { + return getRounded(Digits, Scale, ShouldRound); +} + +/// \brief Convenience helper for 64-bit rounding. +inline std::pair<uint64_t, int16_t> getRounded64(uint64_t Digits, int16_t Scale, + bool ShouldRound) { + return getRounded(Digits, Scale, ShouldRound); +} + /// \brief Adjust a 64-bit scaled number down to the appropriate width. /// /// Adjust a soft float with 64-bits of digits down, keeping as much |