Arith
arith
¶
boolLike = container_of(IntegerType(1))
module-attribute
¶
signlessIntegerLike = container_of(AnyOf.get(IntegerType, IndexType))
module-attribute
¶
floatingPointLike = container_of(AnyFloat)
module-attribute
¶
CMPI_COMPARISON_OPERATIONS = ['eq', 'ne', 'slt', 'sle', 'sgt', 'sge', 'ult', 'ule', 'ugt', 'uge']
module-attribute
¶
CMPF_COMPARISON_OPERATIONS = ['false', 'oeq', 'ogt', 'oge', 'olt', 'ole', 'one', 'ord', 'ueq', 'ugt', 'uge', 'ult', 'ule', 'une', 'uno', 'true']
module-attribute
¶
Arith = Dialect('arith', [ConstantOp, AddiOp, AddUIExtendedOp, SubiOp, MuliOp, MulUIExtendedOp, MulSIExtendedOp, DivUIOp, DivSIOp, FloorDivSIOp, CeilDivSIOp, CeilDivUIOp, RemUIOp, RemSIOp, MinSIOp, MaxSIOp, MinUIOp, MaxUIOp, AddfOp, SubfOp, MulfOp, DivfOp, NegfOp, CmpiOp, CmpfOp, SelectOp, AndIOp, OrIOp, XOrIOp, ShLIOp, ShRUIOp, ShRSIOp, MinimumfOp, MinnumfOp, MaximumfOp, MaxnumfOp, BitcastOp, IndexCastOp, FPToSIOp, FPToUIOp, SIToFPOp, UIToFPOp, ExtFOp, TruncFOp, TruncIOp, ExtSIOp, ExtUIOp], [FastMathFlagsAttr, IntegerOverflowAttr], [ArithConstantMaterializationInterface()])
module-attribute
¶
FastMathFlagsAttr
¶
Bases: FastMathAttrBase
arith.fastmath is a mirror of LLVMs fastmath flags.
Source code in xdsl/dialects/arith.py
IntegerOverflowFlag
¶
IntegerOverflowAttr
¶
Bases: BitEnumAttribute[IntegerOverflowFlag]
Source code in xdsl/dialects/arith.py
ConstantOp
¶
Bases: IRDLOperation, HasFolderInterface
Source code in xdsl/dialects/arith.py
name = 'arith.constant'
class-attribute
instance-attribute
¶
result = result_def(_T)
class-attribute
instance-attribute
¶
value = prop_def(ParamAttrConstraint.get(IntegerAttr, None, _T & (AnySignlessIntegerType | IndexType)) | ParamAttrConstraint.get(FloatAttr, None, _T) | ParamAttrConstraint.get(DenseIntOrFPElementsAttr, _T, None) | ParamAttrConstraint.get(DenseResourceAttr, None, _T))
class-attribute
instance-attribute
¶
traits = traits_def(Pure(), ConstantLike())
class-attribute
instance-attribute
¶
assembly_format = 'attr-dict $value'
class-attribute
instance-attribute
¶
__init__(value: IntegerAttr | FloatAttr | DenseIntOrFPElementsAttr | DenseResourceAttr, value_type: Attribute | None = None)
¶
Source code in xdsl/dialects/arith.py
from_int_and_width(value: int | IntAttr, value_type: int | IntegerType | IndexType, *, truncate_bits: bool = False) -> ConstantOp
staticmethod
¶
Source code in xdsl/dialects/arith.py
SignlessIntegerBinaryOperation
¶
Bases: IRDLOperation, HasFolderInterface, ABC
A generic base class for arith's binary operations on signless integers.
Source code in xdsl/dialects/arith.py
T: ClassVar = VarConstraint('T', signlessIntegerLike)
class-attribute
instance-attribute
¶
lhs = operand_def(T)
class-attribute
instance-attribute
¶
rhs = operand_def(T)
class-attribute
instance-attribute
¶
result = result_def(T)
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
py_operation(lhs: int, rhs: int) -> int | None
staticmethod
¶
Performs a python function corresponding to this operation.
If i := py_operation(lhs, rhs) is an int, then this operation can be
canonicalized to a constant with value i when the inputs are constants
with values lhs and rhs.
Source code in xdsl/dialects/arith.py
is_right_zero(attr: IntegerAttr) -> bool
staticmethod
¶
Returns True only when 'attr' is a right zero for the operation
See external documentation.
Note that this depends on the operation and does not imply that attr.value.data == 0
Source code in xdsl/dialects/arith.py
is_right_unit(attr: IntegerAttr) -> bool
staticmethod
¶
Return True only when 'attr' is a right unit/identity for the operation
See external documentation.
fold()
¶
Source code in xdsl/dialects/arith.py
__init__(operand1: OperandArg, operand2: OperandArg, result_type: Attribute | None = None)
¶
Source code in xdsl/dialects/arith.py
SignlessIntegerBinaryOperationHasCanonicalizationPatternsTrait
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/arith.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
Source code in xdsl/dialects/arith.py
SignlessIntegerBinaryOperationWithOverflow
¶
Bases: SignlessIntegerBinaryOperation, ABC
A generic base class for arith's binary operations on signless integers which can overflow.
Source code in xdsl/dialects/arith.py
overflow_flags = prop_def(IntegerOverflowAttr, default_value=IntegerOverflowAttr('none'), prop_name='overflowFlags')
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs (`overflow` `` $overflowFlags^)? attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, result_type: Attribute | None = None, overflow: IntegerOverflowAttr = IntegerOverflowAttr('none'))
¶
Source code in xdsl/dialects/arith.py
FloatingPointLikeBinaryOpHasCanonicalizationPatternsTrait
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/arith.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
FloatingPointLikeBinaryOpHasFastReassociativeCanonicalizationPatternsTrait
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/arith.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
Source code in xdsl/dialects/arith.py
FloatingPointLikeBinaryOperation
¶
Bases: IRDLOperation, ABC
A generic base class for arith's binary operations on floats.
Source code in xdsl/dialects/arith.py
T: ClassVar = VarConstraint('T', floatingPointLike)
class-attribute
instance-attribute
¶
lhs = operand_def(T)
class-attribute
instance-attribute
¶
rhs = operand_def(T)
class-attribute
instance-attribute
¶
result = result_def(T)
class-attribute
instance-attribute
¶
fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr('none'))
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, flags: FastMathFlagsAttr | None = None, result_type: Attribute | None = None)
¶
Source code in xdsl/dialects/arith.py
AddiOp
dataclass
¶
Bases: SignlessIntegerBinaryOperationWithOverflow
Source code in xdsl/dialects/arith.py
AddUIExtendedOp
¶
Bases: IRDLOperation
An add operation on an unsigned representation of integers that returns a flag indicating if the result overflowed.
Source code in xdsl/dialects/arith.py
name = 'arith.addui_extended'
class-attribute
instance-attribute
¶
T: ClassVar = VarConstraint('T', signlessIntegerLike)
class-attribute
instance-attribute
¶
lhs = operand_def(T)
class-attribute
instance-attribute
¶
rhs = operand_def(T)
class-attribute
instance-attribute
¶
sum = result_def(T)
class-attribute
instance-attribute
¶
overflow = result_def(boolLike)
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs attr-dict `:` type($sum) `,` type($overflow)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, attributes: Mapping[str, Attribute] | None = None, result_type: Attribute | None = None)
¶
Source code in xdsl/dialects/arith.py
verify_()
¶
Source code in xdsl/dialects/arith.py
infer_overflow_type(input_type: Attribute) -> Attribute
staticmethod
¶
Source code in xdsl/dialects/arith.py
MuliOp
dataclass
¶
Bases: SignlessIntegerBinaryOperationWithOverflow
Source code in xdsl/dialects/arith.py
name = 'arith.muli'
class-attribute
instance-attribute
¶
traits = traits_def(Pure(), Commutative(), SignlessIntegerBinaryOperationHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
¶
py_operation(lhs: int, rhs: int) -> int | None
staticmethod
¶
is_right_unit(attr: IntegerAttr) -> bool
staticmethod
¶
MulExtendedBase
¶
Bases: IRDLOperation
Base class for extended multiplication operations.
Source code in xdsl/dialects/arith.py
T: ClassVar = VarConstraint('T', signlessIntegerLike)
class-attribute
instance-attribute
¶
lhs = operand_def(T)
class-attribute
instance-attribute
¶
rhs = operand_def(T)
class-attribute
instance-attribute
¶
low = result_def(T)
class-attribute
instance-attribute
¶
high = result_def(T)
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
assembly_format = '$lhs `,` $rhs attr-dict `:` type($lhs)'
class-attribute
instance-attribute
¶
__init__(operand1: SSAValue, operand2: SSAValue, result_type: Attribute | None = None)
¶
Source code in xdsl/dialects/arith.py
MulUIExtendedOp
dataclass
¶
Bases: MulExtendedBase
Extended unsigned integer multiplication operation.
Source code in xdsl/dialects/arith.py
name = 'arith.mului_extended'
class-attribute
instance-attribute
¶
MulSIExtendedOp
dataclass
¶
Bases: MulExtendedBase
Extended unsigned integer multiplication operation.
Source code in xdsl/dialects/arith.py
name = 'arith.mulsi_extended'
class-attribute
instance-attribute
¶
SubiOp
dataclass
¶
Bases: SignlessIntegerBinaryOperationWithOverflow
Source code in xdsl/dialects/arith.py
DivUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation, ConditionallySpeculatableInterface
Unsigned integer division. Rounds towards zero. Treats the leading bit as
the most significant, i.e. for i16 given two's complement representation,
6 / -2 = 6 / (2^16 - 2) = 0.
Source code in xdsl/dialects/arith.py
DivSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation, ConditionallySpeculatableInterface
Signed integer division. Rounds towards zero. Treats the leading bit as
sign, i.e. 6 / -2 = -3.
Source code in xdsl/dialects/arith.py
FloorDivSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Signed floor integer division. Rounds towards negative infinity i.e. 5 / -2 = -3.
Source code in xdsl/dialects/arith.py
CeilDivSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
CeilDivUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
RemUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
name = 'arith.remui'
class-attribute
instance-attribute
¶
RemSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
MinUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
MaxUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
MinSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
MaxSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
AndIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
OrIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
XOrIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
Source code in xdsl/dialects/arith.py
ShLIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperationWithOverflow
The shli operation shifts an integer value to the left by a variable
amount. The low order bits are filled with zeros.
Source code in xdsl/dialects/arith.py
ShRUIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
The shrui operation shifts an integer value to the right by a variable
amount. The integer is interpreted as unsigned. The high order bits are
always filled with zeros.
Source code in xdsl/dialects/arith.py
ShRSIOp
dataclass
¶
Bases: SignlessIntegerBinaryOperation
The shrsi operation shifts an integer value to the right by a variable
amount. The integer is interpreted as signed. The high order bits in the
output are filled with copies of the most-significant bit of the shifted
value (which means that the sign of the value is preserved).
Source code in xdsl/dialects/arith.py
ComparisonOperation
dataclass
¶
Bases: IRDLOperation
A generic comparison operation, operation definitions inherit this class.
The first argument to these comparison operations is the type of comparison being performed, the following comparisons are supported:
- equal (mnemonic:
"eq"; integer value:0) - not equal (mnemonic:
"ne"; integer value:1) - signed less than (mnemonic:
"slt"; integer value:2) - signed less than or equal (mnemonic:
"sle"; integer value:3) - signed greater than (mnemonic:
"sgt"; integer value:4) - signed greater than or equal (mnemonic:
"sge"; integer value:5) - unsigned less than (mnemonic:
"ult"; integer value:6) - unsigned less than or equal (mnemonic:
"ule"; integer value:7) - unsigned greater than (mnemonic:
"ugt"; integer value:8) - unsigned greater than or equal (mnemonic:
"uge"; integer value:9)
Source code in xdsl/dialects/arith.py
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
CmpiHasCanonicalizationPatterns
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/arith.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
CmpiOp
¶
Bases: ComparisonOperation
The cmpi operation is a generic comparison for integer-like types. Its two arguments can be integers, vectors or tensors thereof as long as their types match. The operation produces an i1 for the former case, a vector or a tensor of i1 with the same shape as inputs in the other cases.
The result is 1 if the comparison is true and 0 otherwise. For vector or
tensor operands, the comparison is performed elementwise and the element of
the result indicates whether the comparison is true for the operand elements
with the same indices as those of the result.
Example:
// Custom form of scalar "signed less than" comparison. %x = arith.cmpi slt, %lhs, %rhs : i32
// Generic form of the same operation. %x = "arith.cmpi"(%lhs, %rhs) {predicate = 2 : i64} : (i32, i32) -> i1
// Custom form of vector equality comparison. %x = arith.cmpi eq, %lhs, %rhs : vector<4xi64>
// Generic form of the same operation. %x = "arith.cmpi"(%lhs, %rhs) {predicate = 0 : i64} : (vector<4xi64>, vector<4xi64>) -> vector<4xi1>
Source code in xdsl/dialects/arith.py
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | |
name = 'arith.cmpi'
class-attribute
instance-attribute
¶
predicate = prop_def(IntegerAttr)
class-attribute
instance-attribute
¶
lhs = operand_def(signlessIntegerLike)
class-attribute
instance-attribute
¶
rhs = operand_def(signlessIntegerLike)
class-attribute
instance-attribute
¶
result = result_def(IntegerType(1))
class-attribute
instance-attribute
¶
traits = traits_def(CmpiHasCanonicalizationPatterns(), Pure())
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, arg: int | str)
¶
Source code in xdsl/dialects/arith.py
parse(parser: Parser)
classmethod
¶
Source code in xdsl/dialects/arith.py
print(printer: Printer)
¶
Source code in xdsl/dialects/arith.py
CmpfOp
¶
Bases: ComparisonOperation
The cmpf operation compares its two operands according to the float comparison rules and the predicate specified by the respective attribute. The predicate defines the type of comparison: (un)orderedness, (in)equality and signed less/greater than (or equal to) as well as predicates that are always true or false. The operands must have the same type, and this type must be a float type, or a vector or tensor thereof. The result is an i1, or a vector/tensor thereof having the same shape as the inputs. Unlike cmpi, the operands are always treated as signed. The u prefix indicates unordered comparison, not unsigned comparison, so "une" means unordered or not equal. For the sake of readability by humans, custom assembly form for the operation uses a string-typed attribute for the predicate. The value of this attribute corresponds to lower-cased name of the predicate constant, e.g., "one" means "ordered not equal". The string representation of the attribute is merely a syntactic sugar and is converted to an integer attribute by the parser.
Example:
%r1 = arith.cmpf oeq, %0, %1 : f32 %r2 = arith.cmpf ult, %0, %1 : tensor<42x42xf64> %r3 = "arith.cmpf"(%0, %1) {predicate: 0} : (f8, f8) -> i1
Source code in xdsl/dialects/arith.py
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 | |
name = 'arith.cmpf'
class-attribute
instance-attribute
¶
predicate = prop_def(IntegerAttr)
class-attribute
instance-attribute
¶
lhs = operand_def(floatingPointLike)
class-attribute
instance-attribute
¶
rhs = operand_def(floatingPointLike)
class-attribute
instance-attribute
¶
fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr('none'))
class-attribute
instance-attribute
¶
result = result_def(IntegerType(1))
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, arg: int | str, fastmath: FastMathFlagsAttr = FastMathFlagsAttr('none'))
¶
Source code in xdsl/dialects/arith.py
parse(parser: Parser)
classmethod
¶
Source code in xdsl/dialects/arith.py
print(printer: Printer)
¶
Source code in xdsl/dialects/arith.py
SelectHasCanonicalizationPatterns
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/arith.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
Source code in xdsl/dialects/arith.py
SelectOp
¶
Bases: IRDLOperation
The arith.select operation chooses one value based on a binary condition
supplied as its first operand. If the value of the first operand is 1,
the second operand is chosen, otherwise the third operand is chosen.
The second and the third operand must have the same type.
Source code in xdsl/dialects/arith.py
name = 'arith.select'
class-attribute
instance-attribute
¶
cond = operand_def(IntegerType(1))
class-attribute
instance-attribute
¶
lhs = operand_def(_T)
class-attribute
instance-attribute
¶
rhs = operand_def(_T)
class-attribute
instance-attribute
¶
result = result_def(_T)
class-attribute
instance-attribute
¶
traits = traits_def(Pure(), SelectHasCanonicalizationPatterns())
class-attribute
instance-attribute
¶
assembly_format = '$cond `,` $lhs `,` $rhs attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
__init__(operand1: OperandArg, operand2: OperandArg, operand3: OperandArg)
¶
AddfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Source code in xdsl/dialects/arith.py
SubfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Source code in xdsl/dialects/arith.py
MulfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Source code in xdsl/dialects/arith.py
DivfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Source code in xdsl/dialects/arith.py
NegfOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.negf'
class-attribute
instance-attribute
¶
fastmath = prop_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr('none'))
class-attribute
instance-attribute
¶
operand = operand_def(_T)
class-attribute
instance-attribute
¶
result = result_def(_T)
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
assembly_format = '$operand (`fastmath` `` $fastmath^)? attr-dict `:` type($result)'
class-attribute
instance-attribute
¶
__init__(operand: OperandArg, fastmath: FastMathFlagsAttr | None = None)
¶
MaximumfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Returns the maximum of the two arguments, treating -0.0 as less than +0.0. If one of the arguments is NaN, then the result is also NaN.
Source code in xdsl/dialects/arith.py
MaxnumfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Returns the maximum of the two arguments. If the arguments are -0.0 and +0.0, then the result is either of them. If one of the arguments is NaN, then the result is the other argument.
Source code in xdsl/dialects/arith.py
MinimumfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Returns the minimum of the two arguments, treating -0.0 as less than +0.0. If one of the arguments is NaN, then the result is also NaN.
Source code in xdsl/dialects/arith.py
MinnumfOp
dataclass
¶
Bases: FloatingPointLikeBinaryOperation
Returns the minimum of the two arguments. If the arguments are -0.0 and +0.0, then the result is either of them. If one of the arguments is NaN, then the result is the other argument.
Source code in xdsl/dialects/arith.py
BitcastOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.bitcast'
class-attribute
instance-attribute
¶
input = operand_def(container_of(IntegerType | IndexType | AnyFloat) | MemRefType.constr(element_type=AnyFloat | AnySignlessIntegerType))
class-attribute
instance-attribute
¶
result = result_def(container_of(IntegerType | IndexType | AnyFloat) | MemRefType.constr(element_type=AnyFloat | AnySignlessIntegerType))
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
__init__(in_arg: OperandArg, target_type: Attribute)
¶
verify_() -> None
¶
Source code in xdsl/dialects/arith.py
IndexCastOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.index_cast'
class-attribute
instance-attribute
¶
input = operand_def(IntegerType | IndexType)
class-attribute
instance-attribute
¶
result = result_def(IntegerType | IndexType)
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
__init__(input_arg: OperandArg, target_type: Attribute)
¶
verify_() -> None
¶
Source code in xdsl/dialects/arith.py
FloatingPointToIntegerBaseOp
¶
Bases: IRDLOperation, ABC
Source code in xdsl/dialects/arith.py
input = operand_def(AnyFloat)
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
FPToSIOp
dataclass
¶
Bases: FloatingPointToIntegerBaseOp
Source code in xdsl/dialects/arith.py
name = 'arith.fptosi'
class-attribute
instance-attribute
¶
FPToUIOp
dataclass
¶
Bases: FloatingPointToIntegerBaseOp
Source code in xdsl/dialects/arith.py
name = 'arith.fptoui'
class-attribute
instance-attribute
¶
IntegerToFloatingPointBaseOp
¶
Bases: IRDLOperation, ABC
Source code in xdsl/dialects/arith.py
input = operand_def(IntegerType)
class-attribute
instance-attribute
¶
result = result_def(AnyFloat)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
SIToFPOp
dataclass
¶
Bases: IntegerToFloatingPointBaseOp
Source code in xdsl/dialects/arith.py
name = 'arith.sitofp'
class-attribute
instance-attribute
¶
UIToFPOp
dataclass
¶
Bases: IntegerToFloatingPointBaseOp
Source code in xdsl/dialects/arith.py
name = 'arith.uitofp'
class-attribute
instance-attribute
¶
ExtFOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.extf'
class-attribute
instance-attribute
¶
input = operand_def(floatingPointLike)
class-attribute
instance-attribute
¶
result = result_def(floatingPointLike)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
TruncFOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.truncf'
class-attribute
instance-attribute
¶
input = operand_def(floatingPointLike)
class-attribute
instance-attribute
¶
result = result_def(floatingPointLike)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
TruncIOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.trunci'
class-attribute
instance-attribute
¶
input = operand_def(IntegerType)
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
__init__(op: OperandArg, target_type: IntegerType)
¶
verify_() -> None
¶
ExtSIOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.extsi'
class-attribute
instance-attribute
¶
input = operand_def(IntegerType)
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
__init__(op: OperandArg, target_type: IntegerType)
¶
verify_() -> None
¶
ExtUIOp
¶
Bases: IRDLOperation
Source code in xdsl/dialects/arith.py
name = 'arith.extui'
class-attribute
instance-attribute
¶
input = operand_def(IntegerType)
class-attribute
instance-attribute
¶
result = result_def(IntegerType)
class-attribute
instance-attribute
¶
assembly_format = '$input attr-dict `:` type($input) `to` type($result)'
class-attribute
instance-attribute
¶
traits = traits_def(Pure())
class-attribute
instance-attribute
¶
__init__(op: OperandArg, target_type: IntegerType)
¶
verify_() -> None
¶
ArithConstantMaterializationInterface
¶
Bases: ConstantMaterializationInterface