clang
8.0.0
|
The APFixedPoint class works similarly to APInt/APSInt in that it is a functional replacement for a scaled integer. More...
#include "clang/Basic/FixedPoint.h"
Public Member Functions | |
APFixedPoint (const llvm::APInt &Val, const FixedPointSemantics &Sema) | |
APFixedPoint (uint64_t Val, const FixedPointSemantics &Sema) | |
llvm::APSInt | getValue () const |
unsigned | getWidth () const |
unsigned | getScale () const |
bool | isSaturated () const |
bool | isSigned () const |
bool | hasPadding () const |
APFixedPoint | convert (const FixedPointSemantics &DstSema) const |
APFixedPoint | shr (unsigned Amt) const |
APFixedPoint | shl (unsigned Amt) const |
llvm::APSInt | getIntPart () const |
int | compare (const APFixedPoint &Other) const |
bool | operator== (const APFixedPoint &Other) const |
bool | operator!= (const APFixedPoint &Other) const |
bool | operator> (const APFixedPoint &Other) const |
bool | operator< (const APFixedPoint &Other) const |
bool | operator>= (const APFixedPoint &Other) const |
bool | operator<= (const APFixedPoint &Other) const |
Static Public Member Functions | |
static APFixedPoint | getMax (const FixedPointSemantics &Sema) |
static APFixedPoint | getMin (const FixedPointSemantics &Sema) |
The APFixedPoint class works similarly to APInt/APSInt in that it is a functional replacement for a scaled integer.
It is meant to replicate the fixed point types proposed in ISO/IEC JTC1 SC22 WG14 N1169. The class carries info about the fixed point type's width, sign, scale, and saturation, and provides different operations that would normally be performed on fixed point types.
Semantically this does not represent any existing C type other than fixed point types and should eventually be moved to LLVM if fixed point types gain native IR support.
Definition at line 74 of file FixedPoint.h.
|
inline |
Definition at line 76 of file FixedPoint.h.
References clang::FixedPointSemantics::getWidth().
|
inline |
Definition at line 82 of file FixedPoint.h.
int clang::APFixedPoint::compare | ( | const APFixedPoint & | Other | ) | const |
Definition at line 51 of file FixedPoint.cpp.
References getScale(), getValue(), and max().
APFixedPoint clang::APFixedPoint::convert | ( | const FixedPointSemantics & | DstSema | ) | const |
Definition at line 19 of file FixedPoint.cpp.
References APFixedPoint(), clang::FixedPointSemantics::getIntegralBits(), clang::FixedPointSemantics::getScale(), getScale(), clang::FixedPointSemantics::getWidth(), clang::FixedPointSemantics::isSaturated(), clang::FixedPointSemantics::isSigned(), and min().
|
inline |
Definition at line 104 of file FixedPoint.h.
References compare(), and clang::FixedPointSemantics::getScale().
|
static |
Definition at line 102 of file FixedPoint.cpp.
References APFixedPoint(), clang::FixedPointSemantics::getWidth(), clang::FixedPointSemantics::hasUnsignedPadding(), and clang::FixedPointSemantics::isSigned().
Referenced by clang::ASTContext::getFixedPointMax().
|
static |
Definition at line 110 of file FixedPoint.cpp.
References APFixedPoint(), clang::FixedPointSemantics::getWidth(), and clang::FixedPointSemantics::isSigned().
Referenced by clang::ASTContext::getFixedPointMin().
|
inline |
Definition at line 88 of file FixedPoint.h.
|
inline |
Definition at line 86 of file FixedPoint.h.
Referenced by compare().
|
inline |
Definition at line 87 of file FixedPoint.h.
|
inline |
Definition at line 91 of file FixedPoint.h.
|
inline |
Definition at line 89 of file FixedPoint.h.
|
inline |
Definition at line 90 of file FixedPoint.h.
|
inline |
Definition at line 116 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 120 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 124 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 113 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 119 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 121 of file FixedPoint.h.
References compare().
|
inline |
Definition at line 100 of file FixedPoint.h.
|
inline |
Definition at line 96 of file FixedPoint.h.