Bigint
bigint
¶
Dialect for unlimited precision integers with Python int semantics.
bigint = BigIntegerType()
module-attribute
¶
BigInt = Dialect('bigint', [ConstantOp, TruncateToIntOp, AddOp, SubOp, MulOp, FloorDivOp, ModOp, PowOp, LShiftOp, RShiftOp, BitOrOp, BitXorOp, BitAndOp, DivOp, EqOp, NeqOp, GtOp, GteOp, LtOp, LteOp], [BigIntegerType])
module-attribute
¶
BigIntegerType
dataclass
¶
Bases: ParametrizedAttribute, TypeAttribute
Type for unlimited precision integers, with Python int semantics.
Source code in xdsl/dialects/bigint.py
name = 'bigint.bigint'
class-attribute
instance-attribute
¶
BinaryOperation
¶
Bases: IRDLOperation, ABC
Binary operation where all operands and results are bigints.
Source code in xdsl/dialects/bigint.py
ConstantOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/bigint.py
name = 'bigint.constant'
class-attribute
instance-attribute
¶
result = result_def(bigint)
class-attribute
instance-attribute
¶
value = prop_def(IntAttr)
class-attribute
instance-attribute
¶
traits = traits_def(ConstantLike(), HasFolder(), Pure())
class-attribute
instance-attribute
¶
parse(parser: Parser)
classmethod
¶
print(printer: Printer)
¶
__init__(value: IntAttr | int, attrs: dict[str, Attribute] | None = None)
¶
Source code in xdsl/dialects/bigint.py
TruncateToIntOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/bigint.py
name = 'bigint.truncate_to_int'
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
value = operand_def(bigint)
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
assembly_format = '$value attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
AddOp
dataclass
¶
SubOp
dataclass
¶
MulOp
dataclass
¶
FloorDivOp
dataclass
¶
Bases: BinaryOperation
Floor divide two bigints, rounding down to the nearest integer.
Source code in xdsl/dialects/bigint.py
ModOp
dataclass
¶
Bases: BinaryOperation
Modulo two bigints, taking the sign of the divisor.
Source code in xdsl/dialects/bigint.py
PowOp
dataclass
¶
LShiftOp
dataclass
¶
RShiftOp
dataclass
¶
BitOrOp
dataclass
¶
BitXorOp
dataclass
¶
BitAndOp
dataclass
¶
DivOp
¶
Bases: IRDLOperation
Divide two bigints, yielding a 64-bit floating point type.
Note that this operation follows Python semantics, for example by rounding to minus infinity.
Source code in xdsl/dialects/bigint.py
name = 'bigint.div'
class-attribute
instance-attribute
¶
lhs = operand_def(bigint)
class-attribute
instance-attribute
¶
rhs = operand_def(bigint)
class-attribute
instance-attribute
¶
result = result_def(f64)
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
ComparisonOperation
¶
Bases: IRDLOperation, ABC
Binary operation comparing two bigints and returning a boolean.
Source code in xdsl/dialects/bigint.py
EqOp
dataclass
¶
NeqOp
dataclass
¶
GtOp
dataclass
¶
Bases: ComparisonOperation
Check if one bigint is greater than another.
Source code in xdsl/dialects/bigint.py
GteOp
dataclass
¶
Bases: ComparisonOperation
Check if one bigint is greater than or equal to another.
Source code in xdsl/dialects/bigint.py
LtOp
dataclass
¶
Bases: ComparisonOperation
Check if one bigint is less than another.
Source code in xdsl/dialects/bigint.py
LteOp
dataclass
¶
Bases: ComparisonOperation
Check if one bigint is less than or equal to another.