APFloat: Simplify makeSmallestNormalized implementation
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 1 Dec 2022 14:42:20 +0000 (09:42 -0500)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 2 Dec 2022 23:47:43 +0000 (18:47 -0500)
llvm/lib/Support/APFloat.cpp

index 22dd40c..00e863a 100644 (file)
@@ -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) {