MLIR: lib/Dialect/Arith/Transforms/EmulateWideInt.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
Functions
static std::pair< APInt, APInt > getHalves (const APInt &value, unsigned newBitWidth)
Returns N bottom and N top bits from value, where N = newBitWidth. More...
static Type reduceInnermostDim (VectorType type)
Returns the type with the last (innermost) dimension reduced to x1. More...
static Value extractLastDimSlice (ConversionPatternRewriter &rewriter, Location loc, Value input, int64_t lastOffset)
Extracts the input vector slice with elements at the last dimension offset by lastOffset. More...
static std::pair< Value, Value > extractLastDimHalves (ConversionPatternRewriter &rewriter, Location loc, Value input)
Extracts two vector slices from the input whose type is vector<...x2T>, with the first element at offset 0 and the second element at offset 1. More...
static Value dropTrailingX1Dim (ConversionPatternRewriter &rewriter, Location loc, Value input)
static Value appendX1Dim (ConversionPatternRewriter &rewriter, Location loc, Value input)
Performs a vector shape cast to append an x1 dimension. More...
static Value insertLastDimSlice (ConversionPatternRewriter &rewriter, Location loc, Value source, Value dest, int64_t lastOffset)
Inserts the source vector slice into the dest vector at offset lastOffset in the last dimension. More...
static Value constructResultVector (ConversionPatternRewriter &rewriter, Location loc, VectorType resultType, ValueRange resultComponents)
Constructs a new vector of type resultType by creating a series of insertions of resultComponents, each at the next offset of the last vector dimension. More...

GEN_PASS_DEF_ARITHEMULATEWIDEINT

#define GEN_PASS_DEF_ARITHEMULATEWIDEINT

appendX1Dim()

constructResultVector()

dropTrailingX1Dim()

extractLastDimHalves()

Extracts two vector slices from the input whose type is vector<...x2T>, with the first element at offset 0 and the second element at offset 1.

Definition at line 90 of file EmulateWideInt.cpp.

References extractLastDimSlice().

extractLastDimSlice()

getHalves()

static std::pair<APInt, APInt> getHalves ( const APInt & value, unsigned newBitWidth ) static

Returns N bottom and N top bits from value, where N = newBitWidth.

Treats value as a 2*N bits-wide integer. The bottom bits are returned in the first pair element, while the top bits in the second one.

Definition at line 41 of file EmulateWideInt.cpp.

insertLastDimSlice()

reduceInnermostDim()

static Type reduceInnermostDim ( VectorType type) static

Returns the type with the last (innermost) dimension reduced to x1.

Scalarizes 1D vector inputs to match how we extract/insert vector values, e.g.:

Definition at line 53 of file EmulateWideInt.cpp.

References mlir::get().