Lines Matching defs:Sema
22 FixedPointSemantics Saturated(FixedPointSemantics Sema) {
23 Sema.setSaturated(true);
24 return Sema;
164 void CheckUnpaddedMax(const FixedPointSemantics &Sema) {
165 ASSERT_EQ(APFixedPoint::getMax(Sema).getValue(),
166 APSInt::getMaxValue(Sema.getWidth(), !Sema.isSigned()));
169 void CheckPaddedMax(const FixedPointSemantics &Sema) {
170 ASSERT_EQ(APFixedPoint::getMax(Sema).getValue(),
171 APSInt::getMaxValue(Sema.getWidth(), !Sema.isSigned()) >> 1);
174 void CheckMin(const FixedPointSemantics &Sema) {
175 ASSERT_EQ(APFixedPoint::getMin(Sema).getValue(),
176 APSInt::getMinValue(Sema.getWidth(), !Sema.isSigned()));
235 void CheckIntPart(const FixedPointSemantics &Sema, int64_t IntPart) {
237 (Sema.getLsbWeight() > 0) ? 0 : (1ULL << (-Sema.getLsbWeight() - 1));
241 APInt(Sema.getWidth(),
242 relativeShr(IntPart, Sema.getLsbWeight()) + FullFactPart,
243 Sema.isSigned(), /*implicitTrunc=*/true),
244 Sema);
248 APFixedPoint JustFract(APInt(Sema.getWidth(), FullFactPart, Sema.isSigned(),
250 Sema);
254 APFixedPoint WholeNum(APInt(Sema.getWidth(),
255 relativeShr(IntPart, Sema.getLsbWeight()),
256 Sema.isSigned(), /*implicitTrunc=*/true),
257 Sema);
261 if (Sema.isSigned()) {
262 APFixedPoint Negative(APInt(Sema.getWidth(),
263 relativeShr(IntPart, Sema.getLsbWeight()),
264 Sema.isSigned(), /*implicitTrunc=*/true),
265 Sema);
270 void CheckIntPartMin(const FixedPointSemantics &Sema, int64_t Expected) {
271 EXPECT_TRUE(APSInt::compareValues(APFixedPoint::getMin(Sema).getIntPart(),
275 void CheckIntPartMax(const FixedPointSemantics &Sema, uint64_t Expected) {
276 EXPECT_TRUE(APSInt::compareValues(APFixedPoint::getMax(Sema).getIntPart(),
280 void CheckIntPartRes(const FixedPointSemantics &Sema, int64_t Representation,
282 APFixedPoint Val(Representation, Sema);
731 void CheckFloatToFixedConversion(APFloat &Val, const FixedPointSemantics &Sema,
734 ASSERT_EQ(APFixedPoint::getFromFloatValue(Val, Sema, &Ovf).getValue(),
738 APFixedPoint::getFromFloatValue(Val, Saturated(Sema), &Ovf).getValue(),
743 void CheckFloatToFixedConversion(APFloat &Val, const FixedPointSemantics &Sema,
746 (void)APFixedPoint::getFromFloatValue(Val, Sema, &Ovf);
749 APFixedPoint::getFromFloatValue(Val, Saturated(Sema), &Ovf).getValue(),
750 (ExpectedOvf == MinSat ? APFixedPoint::getMin(Sema)
751 : APFixedPoint::getMax(Sema))
979 void CheckFixedToFloatConversion(int64_t Val, const FixedPointSemantics &Sema,
981 APFixedPoint FXVal(Val, Sema);
986 void CheckFixedToHalfConversion(int64_t Val, const FixedPointSemantics &Sema,
988 APFixedPoint FXVal(Val, Sema);