clang 20.0.0git
Public Member Functions | Static Public Member Functions | List of all members
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
 

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 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

Definition at line 28 of file FixedPoint.h.

References V.

◆ FixedPoint() [2/4]

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

Definition at line 29 of file FixedPoint.h.

References V.

◆ FixedPoint() [3/4]

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

Definition at line 30 of file FixedPoint.h.

References V.

◆ FixedPoint() [4/4]

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

Definition at line 32 of file FixedPoint.h.

References V.

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

Member Function Documentation

◆ add()

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

Definition at line 100 of file FixedPoint.h.

References FixedPoint().

◆ bitAnd()

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

Definition at line 145 of file FixedPoint.h.

◆ bitOr()

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

Definition at line 149 of file FixedPoint.h.

◆ bitWidth()

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

Definition at line 55 of file FixedPoint.h.

References V.

◆ bitXor()

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

Definition at line 153 of file FixedPoint.h.

◆ compare()

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

Definition at line 85 of file FixedPoint.h.

References c, clang::Equal, clang::Greater, clang::Less, clang::Other, and V.

◆ decrement()

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

Definition at line 159 of file FixedPoint.h.

◆ div()

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

Definition at line 118 of file FixedPoint.h.

References FixedPoint().

◆ from() [1/2]

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

◆ from() [2/2]

static 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().

◆ getSemantics()

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

Definition at line 71 of file FixedPoint.h.

References V.

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

◆ increment()

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

Definition at line 158 of file FixedPoint.h.

◆ isMin()

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

Definition at line 60 of file FixedPoint.h.

References V.

◆ isMinusOne()

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

Definition at line 63 of file FixedPoint.h.

References V.

◆ isNegative()

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

Definition at line 58 of file FixedPoint.h.

References V.

◆ isPositive()

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

Definition at line 59 of file FixedPoint.h.

References V.

◆ isSigned()

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

Definition at line 56 of file FixedPoint.h.

References V.

◆ isZero()

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

Definition at line 57 of file FixedPoint.h.

References V.

◆ mul()

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

Definition at line 112 of file FixedPoint.h.

References FixedPoint().

◆ neg()

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

Definition at line 94 of file FixedPoint.h.

References FixedPoint().

◆ operator bool()

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

Definition at line 49 of file FixedPoint.h.

References V.

◆ print()

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

Definition at line 50 of file FixedPoint.h.

References V.

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

◆ rem()

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

Definition at line 140 of file FixedPoint.h.

◆ shiftLeft()

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

Definition at line 125 of file FixedPoint.h.

References FixedPoint().

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

◆ shiftRight()

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

Definition at line 132 of file FixedPoint.h.

References FixedPoint().

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

◆ sub()

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

Definition at line 106 of file FixedPoint.h.

References FixedPoint().

◆ toAPSInt()

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

Definition at line 53 of file FixedPoint.h.

References V.

◆ toAPValue()

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

Definition at line 52 of file FixedPoint.h.

References V.

◆ toDiagnosticString()

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

Definition at line 81 of file FixedPoint.h.

References V.

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.

References V.

◆ 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, and V.

◆ 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 V.

◆ truncate()

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

Definition at line 65 of file FixedPoint.h.

◆ zero()

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

Definition at line 36 of file FixedPoint.h.

References FixedPoint().


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