llvm/llvm/unittests/ADT/APFixedPointTest.cpp

//===- unittests/ADT/FixedPointTest.cpp -- fixed point number tests -----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#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) {}

// Check that a fixed point value in one sema is the same in another sema
void CheckUnsaturatedConversion(FixedPointSemantics Src,
                                FixedPointSemantics Dst, int64_t TestVal) {}

// Check the value in a given fixed point sema overflows to the saturated min
// for another sema
void CheckSaturatedConversionMin(FixedPointSemantics Src,
                                 FixedPointSemantics Dst, int64_t TestVal) {}

// Check the value in a given fixed point sema overflows to the saturated max
// for another sema
void CheckSaturatedConversionMax(FixedPointSemantics Src,
                                 FixedPointSemantics Dst, int64_t TestVal) {}

// Check one signed _Accum sema converted to other sema for different values.
void CheckSignedAccumConversionsAgainstOthers(FixedPointSemantics Src,
                                              int64_t OneVal) {}

// Check one unsigned _Accum sema converted to other sema for different
// values.
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) {}

} // namespace