clang
9.0.0
|
The fixed point semantics work similarly to llvm::fltSemantics. More...
#include "clang/Basic/FixedPoint.h"
Public Member Functions | |
FixedPointSemantics (unsigned Width, unsigned Scale, bool IsSigned, bool IsSaturated, bool HasUnsignedPadding) | |
unsigned | getWidth () const |
unsigned | getScale () const |
bool | isSigned () const |
bool | isSaturated () const |
bool | hasUnsignedPadding () const |
void | setSaturated (bool Saturated) |
unsigned | getIntegralBits () const |
Return the number of integral bits represented by these semantics. More... | |
FixedPointSemantics | getCommonSemantics (const FixedPointSemantics &Other) const |
Return the FixedPointSemantics that allows for calculating the full precision semantic that can precisely represent the precision and ranges of both input values. More... | |
Static Public Member Functions | |
static FixedPointSemantics | GetIntegerSemantics (unsigned Width, bool IsSigned) |
Return the FixedPointSemantics for an integer type. More... | |
The fixed point semantics work similarly to llvm::fltSemantics.
The width specifies the whole bit width of the underlying scaled integer (with padding if any). The scale represents the number of fractional bits in this type. When HasUnsignedPadding is true and this type is signed, the first bit in the value this represents is treaded as padding.
Definition at line 33 of file FixedPoint.h.
|
inline |
Definition at line 35 of file FixedPoint.h.
Referenced by GetIntegerSemantics().
FixedPointSemantics clang::FixedPointSemantics::getCommonSemantics | ( | const FixedPointSemantics & | Other | ) | const |
Return the FixedPointSemantics that allows for calculating the full precision semantic that can precisely represent the precision and ranges of both input values.
This does not compute the resulting semantics for a given binary operation.
Definition at line 127 of file FixedPoint.cpp.
References getIntegralBits(), getScale(), clang::APFixedPoint::getScale(), hasUnsignedPadding(), isSaturated(), clang::APFixedPoint::isSaturated(), isSigned(), clang::APFixedPoint::isSigned(), and max().
Referenced by getIntegralBits(), and tryEmitFMulAdd().
|
inlinestatic |
Return the FixedPointSemantics for an integer type.
Definition at line 70 of file FixedPoint.h.
References FixedPointSemantics().
Referenced by clang::ASTContext::getFixedPointSemantics(), and clang::APFixedPoint::getFromIntValue().
|
inline |
Return the number of integral bits represented by these semantics.
These are separate from the fractional bits and do not include the sign or padding bit.
Definition at line 55 of file FixedPoint.h.
References getCommonSemantics().
Referenced by clang::APFixedPoint::convert(), and getCommonSemantics().
|
inline |
Definition at line 45 of file FixedPoint.h.
Referenced by clang::APFixedPoint::convert(), getCommonSemantics(), clang::APFixedPoint::getIntPart(), and WriteFixedPointSemantics().
|
inline |
Definition at line 44 of file FixedPoint.h.
Referenced by clang::APFixedPoint::APFixedPoint(), clang::APFixedPoint::convert(), clang::APFixedPoint::getMax(), clang::APFixedPoint::getMin(), and WriteFixedPointSemantics().
|
inline |
Definition at line 48 of file FixedPoint.h.
Referenced by getCommonSemantics(), clang::APFixedPoint::getMax(), and WriteFixedPointSemantics().
|
inline |
Definition at line 47 of file FixedPoint.h.
Referenced by clang::APFixedPoint::convert(), getCommonSemantics(), and WriteFixedPointSemantics().
|
inline |
Definition at line 46 of file FixedPoint.h.
Referenced by clang::APFixedPoint::convert(), getCommonSemantics(), clang::APFixedPoint::getMax(), clang::APFixedPoint::getMin(), and WriteFixedPointSemantics().
|
inline |
Definition at line 50 of file FixedPoint.h.