clang 22.0.0git
clang::interp::FixedPoint Class Referencefinal

Wrapper around fixed point types. More...

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/FixedPoint.h"

Public Member Functions

 FixedPoint (llvm::APFixedPoint &&V)
 FixedPoint (llvm::APFixedPoint &V)
 FixedPoint (APInt V, llvm::FixedPointSemantics Sem)
 FixedPoint ()
 operator bool () const
void print (llvm::raw_ostream &OS) const
APValue toAPValue (const ASTContext &) const
APSInt toAPSInt (unsigned BitWidth=0) const
unsigned bitWidth () const
bool isSigned () const
bool isZero () const
bool isNegative () const
bool isPositive () const
bool isMin () const
bool isMinusOne () const
FixedPoint truncate (unsigned BitWidth) const
FixedPoint toSemantics (const llvm::FixedPointSemantics &Sem, bool *Overflow) const
llvm::FixedPointSemantics getSemantics () const
llvm::APFloat toFloat (const llvm::fltSemantics *Sem) const
llvm::APSInt toInt (unsigned BitWidth, bool Signed, bool *Overflow) const
std::string toDiagnosticString (const ASTContext &Ctx) const
ComparisonCategoryResult compare (const FixedPoint &Other) const
size_t bytesToSerialize () const
void serialize (std::byte *Buff) const

Static Public Member Functions

static FixedPoint zero (llvm::FixedPointSemantics Sem)
static FixedPoint from (const APSInt &I, llvm::FixedPointSemantics Sem, bool *Overflow)
static FixedPoint from (const llvm::APFloat &I, llvm::FixedPointSemantics Sem, bool *Overflow)
static FixedPoint deserialize (const std::byte *Buff)
static bool neg (const FixedPoint &A, FixedPoint *R)
static bool add (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool sub (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool mul (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool div (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool shiftLeft (const FixedPoint A, const FixedPoint B, unsigned OpBits, FixedPoint *R)
static bool shiftRight (const FixedPoint A, const FixedPoint B, unsigned OpBits, FixedPoint *R)
static bool rem (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool bitAnd (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool bitOr (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool bitXor (const FixedPoint A, const FixedPoint B, unsigned Bits, FixedPoint *R)
static bool increment (const FixedPoint &A, FixedPoint *R)
static bool decrement (const FixedPoint &A, FixedPoint *R)

Detailed Description

Wrapper around fixed point types.

Definition at line 23 of file FixedPoint.h.

Constructor & Destructor Documentation

◆ FixedPoint() [1/4]

clang::interp::FixedPoint::FixedPoint ( llvm::APFixedPoint && V)
inline

◆ FixedPoint() [2/4]

clang::interp::FixedPoint::FixedPoint ( llvm::APFixedPoint & V)
inline

Definition at line 29 of file FixedPoint.h.

◆ FixedPoint() [3/4]

clang::interp::FixedPoint::FixedPoint ( APInt V,
llvm::FixedPointSemantics Sem )
inline

Definition at line 30 of file FixedPoint.h.

◆ FixedPoint() [4/4]

clang::interp::FixedPoint::FixedPoint ( )
inline

Definition at line 32 of file FixedPoint.h.

References false.

Referenced by add(), deserialize(), div(), from(), from(), mul(), neg(), shiftLeft(), shiftRight(), sub(), toSemantics(), and zero().

Member Function Documentation

◆ add()

bool clang::interp::FixedPoint::add ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 126 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ bitAnd()

bool clang::interp::FixedPoint::bitAnd ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 171 of file FixedPoint.h.

References FixedPoint().

◆ bitOr()

bool clang::interp::FixedPoint::bitOr ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 175 of file FixedPoint.h.

References FixedPoint().

◆ bitWidth()

unsigned clang::interp::FixedPoint::bitWidth ( ) const
inline

Definition at line 55 of file FixedPoint.h.

Referenced by serialize().

◆ bitXor()

bool clang::interp::FixedPoint::bitXor ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 179 of file FixedPoint.h.

References FixedPoint().

◆ bytesToSerialize()

size_t clang::interp::FixedPoint::bytesToSerialize ( ) const
inline

Definition at line 94 of file FixedPoint.h.

References CHAR_BIT.

Referenced by clang::interp::ReadArg< FixedPoint >().

◆ compare()

ComparisonCategoryResult clang::interp::FixedPoint::compare ( const FixedPoint & Other) const
inline

Definition at line 85 of file FixedPoint.h.

References c, clang::Equal, FixedPoint(), clang::Greater, clang::Less, and clang::Other.

◆ decrement()

bool clang::interp::FixedPoint::decrement ( const FixedPoint & A,
FixedPoint * R )
inlinestatic

Definition at line 185 of file FixedPoint.h.

References FixedPoint().

◆ deserialize()

FixedPoint clang::interp::FixedPoint::deserialize ( const std::byte * Buff)
inlinestatic

Definition at line 108 of file FixedPoint.h.

References CHAR_BIT, FixedPoint(), and FixedPoint().

Referenced by printArg< FixedPoint >(), and clang::interp::ReadArg< FixedPoint >().

◆ div()

bool clang::interp::FixedPoint::div ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 144 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ from() [1/2]

FixedPoint clang::interp::FixedPoint::from ( const APSInt & I,
llvm::FixedPointSemantics Sem,
bool * Overflow )
inlinestatic

◆ from() [2/2]

FixedPoint clang::interp::FixedPoint::from ( const llvm::APFloat & I,
llvm::FixedPointSemantics Sem,
bool * Overflow )
inlinestatic

Definition at line 44 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ getSemantics()

llvm::FixedPointSemantics clang::interp::FixedPoint::getSemantics ( ) const
inline

Definition at line 71 of file FixedPoint.h.

Referenced by clang::interp::ShiftFixedPoint().

◆ increment()

bool clang::interp::FixedPoint::increment ( const FixedPoint & A,
FixedPoint * R )
inlinestatic

Definition at line 184 of file FixedPoint.h.

References FixedPoint().

◆ isMin()

bool clang::interp::FixedPoint::isMin ( ) const
inline

Definition at line 60 of file FixedPoint.h.

◆ isMinusOne()

bool clang::interp::FixedPoint::isMinusOne ( ) const
inline

Definition at line 63 of file FixedPoint.h.

◆ isNegative()

bool clang::interp::FixedPoint::isNegative ( ) const
inline

Definition at line 58 of file FixedPoint.h.

◆ isPositive()

bool clang::interp::FixedPoint::isPositive ( ) const
inline

Definition at line 59 of file FixedPoint.h.

◆ isSigned()

bool clang::interp::FixedPoint::isSigned ( ) const
inline

Definition at line 56 of file FixedPoint.h.

◆ isZero()

bool clang::interp::FixedPoint::isZero ( ) const
inline

Definition at line 57 of file FixedPoint.h.

◆ mul()

bool clang::interp::FixedPoint::mul ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 138 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ neg()

bool clang::interp::FixedPoint::neg ( const FixedPoint & A,
FixedPoint * R )
inlinestatic

Definition at line 120 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ operator bool()

clang::interp::FixedPoint::operator bool ( ) const
inline

Definition at line 49 of file FixedPoint.h.

◆ print()

void clang::interp::FixedPoint::print ( llvm::raw_ostream & OS) const
inline

Definition at line 50 of file FixedPoint.h.

Referenced by clang::interp::operator<<().

◆ rem()

bool clang::interp::FixedPoint::rem ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 166 of file FixedPoint.h.

References FixedPoint().

◆ serialize()

void clang::interp::FixedPoint::serialize ( std::byte * Buff) const
inline

Definition at line 98 of file FixedPoint.h.

References bitWidth().

◆ shiftLeft()

bool clang::interp::FixedPoint::shiftLeft ( const FixedPoint A,
const FixedPoint B,
unsigned OpBits,
FixedPoint * R )
inlinestatic

Definition at line 151 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

Referenced by clang::interp::ShiftFixedPoint().

◆ shiftRight()

bool clang::interp::FixedPoint::shiftRight ( const FixedPoint A,
const FixedPoint B,
unsigned OpBits,
FixedPoint * R )
inlinestatic

Definition at line 158 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

Referenced by clang::interp::ShiftFixedPoint().

◆ sub()

bool clang::interp::FixedPoint::sub ( const FixedPoint A,
const FixedPoint B,
unsigned Bits,
FixedPoint * R )
inlinestatic

Definition at line 132 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ toAPSInt()

APSInt clang::interp::FixedPoint::toAPSInt ( unsigned BitWidth = 0) const
inline

Definition at line 53 of file FixedPoint.h.

◆ toAPValue()

APValue clang::interp::FixedPoint::toAPValue ( const ASTContext & ) const
inline

Definition at line 52 of file FixedPoint.h.

References clang::APValue.

◆ toDiagnosticString()

std::string clang::interp::FixedPoint::toDiagnosticString ( const ASTContext & Ctx) const
inline

Definition at line 81 of file FixedPoint.h.

Referenced by clang::interp::handleFixedPointOverflow().

◆ toFloat()

llvm::APFloat clang::interp::FixedPoint::toFloat ( const llvm::fltSemantics * Sem) const
inline

Definition at line 73 of file FixedPoint.h.

◆ toInt()

llvm::APSInt clang::interp::FixedPoint::toInt ( unsigned BitWidth,
bool Signed,
bool * Overflow ) const
inline

Definition at line 77 of file FixedPoint.h.

References clang::Signed.

◆ toSemantics()

FixedPoint clang::interp::FixedPoint::toSemantics ( const llvm::FixedPointSemantics & Sem,
bool * Overflow ) const
inline

Definition at line 67 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().

◆ truncate()

FixedPoint clang::interp::FixedPoint::truncate ( unsigned BitWidth) const
inline

Definition at line 65 of file FixedPoint.h.

References FixedPoint().

◆ zero()

FixedPoint clang::interp::FixedPoint::zero ( llvm::FixedPointSemantics Sem)
inlinestatic

Definition at line 36 of file FixedPoint.h.

References FixedPoint(), and FixedPoint().


The documentation for this class was generated from the following file: