#include "llvm/ADT/APFixedPoint.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
#include "gtest/gtest.h"
APFixedPoint;
APFloat;
APInt;
APSInt;
FixedPointSemantics;
namespace {
FixedPointSemantics Saturated(FixedPointSemantics Sema) { … }
FixedPointSemantics getSAccumSema() { … }
FixedPointSemantics getAccumSema() { … }
FixedPointSemantics getLAccumSema() { … }
FixedPointSemantics getSFractSema() { … }
FixedPointSemantics getFractSema() { … }
FixedPointSemantics getLFractSema() { … }
FixedPointSemantics getUSAccumSema() { … }
FixedPointSemantics getUAccumSema() { … }
FixedPointSemantics getULAccumSema() { … }
FixedPointSemantics getUSFractSema() { … }
FixedPointSemantics getUFractSema() { … }
FixedPointSemantics getULFractSema() { … }
FixedPointSemantics getPadUSAccumSema() { … }
FixedPointSemantics getPadUAccumSema() { … }
FixedPointSemantics getPadULAccumSema() { … }
FixedPointSemantics getPadUSFractSema() { … }
FixedPointSemantics getPadUFractSema() { … }
FixedPointSemantics getPadULFractSema() { … }
FixedPointSemantics getU8Neg10() { … }
FixedPointSemantics getS16Neg18() { … }
FixedPointSemantics getU8Pos4() { … }
FixedPointSemantics getS32Pos2() { … }
void CheckUnpaddedMax(const FixedPointSemantics &Sema) { … }
void CheckPaddedMax(const FixedPointSemantics &Sema) { … }
void CheckMin(const FixedPointSemantics &Sema) { … }
TEST(FixedPointTest, getMax) { … }
TEST(FixedPointTest, getMin) { … }
int64_t relativeShr(int64_t Int, int64_t Shift) { … }
void CheckIntPart(const FixedPointSemantics &Sema, int64_t IntPart) { … }
void CheckIntPartMin(const FixedPointSemantics &Sema, int64_t Expected) { … }
void CheckIntPartMax(const FixedPointSemantics &Sema, uint64_t Expected) { … }
void CheckIntPartRes(const FixedPointSemantics &Sema, int64_t Representation,
uint64_t Result) { … }
TEST(FixedPoint, getIntPart) { … }
TEST(FixedPoint, compare) { … }
void CheckUnsaturatedConversion(FixedPointSemantics Src,
FixedPointSemantics Dst, int64_t TestVal) { … }
void CheckSaturatedConversionMin(FixedPointSemantics Src,
FixedPointSemantics Dst, int64_t TestVal) { … }
void CheckSaturatedConversionMax(FixedPointSemantics Src,
FixedPointSemantics Dst, int64_t TestVal) { … }
void CheckSignedAccumConversionsAgainstOthers(FixedPointSemantics Src,
int64_t OneVal) { … }
void CheckUnsignedAccumConversionsAgainstOthers(FixedPointSemantics Src,
int64_t OneVal) { … }
TEST(FixedPoint, AccumConversions) { … }
TEST(FixedPoint, AccumConversionOverflow) { … }
TEST(FixedPoint, SAccumConversionOverflow) { … }
TEST(FixedPoint, GetValueSignAfterConversion) { … }
TEST(FixedPoint, ModularWrapAround) { … }
enum OvfKind { … };
void CheckFloatToFixedConversion(APFloat &Val, const FixedPointSemantics &Sema,
int64_t ExpectedNonSat) { … }
void CheckFloatToFixedConversion(APFloat &Val, const FixedPointSemantics &Sema,
OvfKind ExpectedOvf) { … }
TEST(FixedPoint, toString) { … }
TEST(FixedPoint, FloatToFixed) { … }
void CheckFixedToFloatConversion(int64_t Val, const FixedPointSemantics &Sema,
float Result) { … }
void CheckFixedToHalfConversion(int64_t Val, const FixedPointSemantics &Sema,
float Result) { … }
TEST(FixedPoint, FixedToFloat) { … }
void CheckAdd(const APFixedPoint &Lhs, const APFixedPoint &Rhs,
const APFixedPoint &Res) { … }
void CheckAddOverflow(const APFixedPoint &Lhs, const APFixedPoint &Rhs) { … }
TEST(FixedPoint, add) { … }
void CheckMul(const APFixedPoint &Lhs, const APFixedPoint &Rhs,
const APFixedPoint &Res) { … }
void CheckMulOverflow(const APFixedPoint &Lhs, const APFixedPoint &Rhs) { … }
TEST(FixedPoint, mul) { … }
void CheckDiv(const APFixedPoint &Lhs, const APFixedPoint &Rhs,
const APFixedPoint &Expected) { … }
void CheckDivOverflow(const APFixedPoint &Lhs, const APFixedPoint &Rhs) { … }
TEST(FixedPoint, div) { … }
}