[llvm] 3d47afd - APFloat: Simplify makeSmallestNormalized implementation
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 2 15:47:49 PST 2022
Author: Matt Arsenault
Date: 2022-12-02T18:47:43-05:00
New Revision: 3d47afdf5a9a129737fefeb47f4e3e334bc6af68
URL: https://github.com/llvm/llvm-project/commit/3d47afdf5a9a129737fefeb47f4e3e334bc6af68
DIFF: https://github.com/llvm/llvm-project/commit/3d47afdf5a9a129737fefeb47f4e3e334bc6af68.diff
LOG: APFloat: Simplify makeSmallestNormalized implementation
Added:
Modified:
llvm/lib/Support/APFloat.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index 22dd40cbc4c6..00e863ae091d 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -3900,8 +3900,7 @@ void IEEEFloat::makeSmallestNormalized(bool Negative) {
zeroSignificand();
sign = Negative;
exponent = semantics->minExponent;
- significandParts()[partCountForBits(semantics->precision) - 1] |=
- (((integerPart)1) << ((semantics->precision - 1) % integerPartWidth));
+ APInt::tcSetBit(significandParts(), semantics->precision - 1);
}
IEEEFloat::IEEEFloat(const fltSemantics &Sem, const APInt &API) {
More information about the llvm-commits
mailing list