My Project
Classes | Functions
mlir::fxpmath::detail Namespace Reference

Classes

struct  QuantizedMultiplierSmallerThanOneExp
 
struct  UniformBinaryOpInfo
 

Functions

quant::UniformQuantizedType getUniformElementType (Type t)
 
bool hasStorageBitWidth (quant::QuantizedType t, ArrayRef< unsigned > checkWidths)
 
template<typename F >
bool integralLog2 (F x, int &log2Result)
 
Type castElementType (Type t, Type newElementType)
 Casts an integer or floating point based shaped type to a new element type. More...
 
Attribute broadcastScalarConstIntValue (Type t, int64_t value)
 
APFloat convertFloatToType (FloatType ft, APFloat value)
 
Attribute broadcastScalarConstFloatValue (Type t, APFloat value)
 

Function Documentation

◆ broadcastScalarConstFloatValue()

Attribute mlir::fxpmath::detail::broadcastScalarConstFloatValue ( Type  t,
APFloat  value 
)
inline

Creates a FloatAttr with a type that matches the shape of 't' (which can be a scalar primitive or a shaped type).

◆ broadcastScalarConstIntValue()

Attribute mlir::fxpmath::detail::broadcastScalarConstIntValue ( Type  t,
int64_t  value 
)
inline

Creates an IntegerAttr with a type that matches the shape of 't' (which can be a scalar primitive or a shaped type).

◆ castElementType()

Type mlir::fxpmath::detail::castElementType ( Type  t,
Type  newElementType 
)
inline

Casts an integer or floating point based shaped type to a new element type.

◆ convertFloatToType()

APFloat mlir::fxpmath::detail::convertFloatToType ( FloatType  ft,
APFloat  value 
)
inline

Given an APFloat, converts it to the float semantics that matches the given FloatType, silently ignoring inexact conversions.

◆ getUniformElementType()

quant::UniformQuantizedType mlir::fxpmath::detail::getUniformElementType ( Type  t)
inline

◆ hasStorageBitWidth()

bool mlir::fxpmath::detail::hasStorageBitWidth ( quant::QuantizedType  t,
ArrayRef< unsigned >  checkWidths 
)
inline

◆ integralLog2()

template<typename F >
bool mlir::fxpmath::detail::integralLog2 ( x,
int &  log2Result 
)

Computes the log2(x), rounded to an integral value. Returns whether 'x' can be considered an exact integral value.