LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
APIntHelper.h File Reference

This file defines helpers for manipulating APInts/APSInts for large numbers and operations over those numbers that may require bit width changes. More...

#include <llvm/ADT/APSInt.h>
#include <algorithm>
#include <initializer_list>
Include dependency graph for APIntHelper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  llzk
 

Functions

llvm::APSInt llzk::expandingAdd (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely add lhs and rhs, expanding the width of the result as necessary.
 
llvm::APSInt llzk::expandingSub (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely subtract lhs and rhs, expanding the width of the result as necessary.
 
llvm::APSInt llzk::expandingMul (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Safely multiple lhs and rhs, expanding the width of the result as necessary.
 
std::strong_ordering llzk::safeCmp (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 Compares lhs and rhs, regardless of the bitwidth of lhs and rhs.
 
bool llzk::safeLt (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool llzk::safeLe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool llzk::safeEq (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool llzk::safeNe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool llzk::safeGt (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
bool llzk::safeGe (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt llzk::safeMin (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt llzk::safeMin (std::initializer_list< llvm::APSInt > ilist)
 
llvm::APSInt llzk::safeMax (const llvm::APSInt &lhs, const llvm::APSInt &rhs)
 
llvm::APSInt llzk::safeMax (std::initializer_list< llvm::APSInt > ilist)
 

Detailed Description

This file defines helpers for manipulating APInts/APSInts for large numbers and operations over those numbers that may require bit width changes.

NOTE: MLIR 19/20 introduces a dynamic version of APInt that manages bitwidths automatically. When we upgrade LLZK to a newer version of MLIR, we can remove these utilities in favor of that.

Definition in file APIntHelper.h.