Lines Matching +full:wide +full:- +full:range
1 //===- APFixedPoint.cpp - Fixed point constant handling ---------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
35 int RelativeUpscale = getLsbWeight() - DstSema.getLsbWeight(); in convert()
45 std::min(DstSema.getIntegralBits() - DstSema.getLsbWeight(), in convert()
81 unsigned CommonWidth = CommonMsb - CommonLsb + 1; in compare()
86 ThisVal = ThisVal.shl(getLsbWeight() - CommonLsb); in compare()
87 OtherVal = OtherVal.shl(Other.getLsbWeight() - CommonLsb); in compare()
93 return -1; in compare()
98 return -1; in compare()
101 return -1; in compare()
105 return -1; in compare()
113 return -1; in compare()
164 int CommonMSb = std::max(getMsbWeight() - hasSignOrPaddingBit(), in getCommonSemantics()
165 Other.getMsbWeight() - Other.hasSignOrPaddingBit()); in getCommonSemantics()
166 unsigned CommonWidth = CommonMSb - CommonLsb + 1; in getCommonSemantics()
245 unsigned Wide = CommonFXSema.getWidth() * 2; in mul() local
247 ThisVal = ThisVal.sext(Wide); in mul()
248 OtherVal = OtherVal.sext(Wide); in mul()
250 ThisVal = ThisVal.zext(Wide); in mul()
251 OtherVal = OtherVal.zext(Wide); in mul()
258 // outside the representable range. We interpret the spec as allowing us to in mul()
271 // If our result lies outside of the representative range of the common in mul()
274 .extOrTrunc(Wide); in mul()
276 .extOrTrunc(Wide); in mul()
304 unsigned Wide = in div() local
305 CommonFXSema.getWidth() * 2 + std::max(-CommonFXSema.getMsbWeight(), 0); in div()
307 ThisVal = ThisVal.sext(Wide); in div()
308 OtherVal = OtherVal.sext(Wide); in div()
310 ThisVal = ThisVal.zext(Wide); in div()
311 OtherVal = OtherVal.zext(Wide); in div()
317 ThisVal = ThisVal.shl(-CommonFXSema.getLsbWeight()); in div()
327 Result = Result - 1; in div()
332 // If our result lies outside of the representative range of the common in div()
335 .extOrTrunc(Wide); in div()
337 .extOrTrunc(Wide); in div()
358 unsigned Wide = Sema.getWidth() * 2; in shl() local
360 ThisVal = ThisVal.sext(Wide); in shl()
362 ThisVal = ThisVal.zext(Wide); in shl()
369 // If our result lies outside of the representative range of the in shl()
371 APSInt Max = APFixedPoint::getMax(Sema).getValue().extOrTrunc(Wide); in shl()
372 APSInt Min = APFixedPoint::getMin(Sema).getValue().extOrTrunc(Wide); in shl()
403 Val = -Val; in toString()
405 Str.push_back('-'); in toString()
408 int Scale = -getLsbWeight(); in toString()
439 return APFixedPoint(-Val, Sema); in negate()
447 return Val.isMinSignedValue() ? getMax(Sema) : APFixedPoint(-Val, Sema); in negate()
500 // Make sure that we are operating in a type that works with this fixed-point in convertToFloat()
557 // Make sure that we are operating in a type that works with this fixed-point in getFromFloatValue()
570 // the integer range instead. Rounding mode is irrelevant here. in getFromFloatValue()
573 APFloat ScaleFactor(std::pow(2, -DstFXSema.getLsbWeight())); in getFromFloatValue()
585 // representable range of the fixed-point semantic even though no overflow in getFromFloatValue()
593 // is outside the range representable by the fixed-point value. in getFromFloatValue()