Skip to content

Attrs

attrs

UI5: TypeAlias = IntegerType[Literal[5], Literal[Signedness.UNSIGNED]] module-attribute

UI6: TypeAlias = IntegerType[Literal[6], Literal[Signedness.UNSIGNED]] module-attribute

UI12: TypeAlias = IntegerType[Literal[12], Literal[Signedness.UNSIGNED]] module-attribute

SI20: TypeAlias = IntegerType[Literal[20], Literal[Signedness.SIGNED]] module-attribute

SI12: TypeAlias = IntegerType[Literal[12], Literal[Signedness.SIGNED]] module-attribute

I12: TypeAlias = IntegerType[Literal[12], Literal[Signedness.SIGNLESS]] module-attribute

I20: TypeAlias = IntegerType[Literal[20], Literal[Signedness.SIGNLESS]] module-attribute

ui5: UI5 = IntegerType(5, Signedness.UNSIGNED) module-attribute

ui6: UI6 = IntegerType(6, Signedness.UNSIGNED) module-attribute

ui12: UI12 = IntegerType(12, Signedness.UNSIGNED) module-attribute

si20: SI20 = IntegerType(20, Signedness.SIGNED) module-attribute

si12: SI12 = IntegerType(12, Signedness.SIGNED) module-attribute

i12: I12 = IntegerType(12, Signedness.SIGNLESS) module-attribute

i20: I20 = IntegerType(20, Signedness.SIGNLESS) module-attribute

FastMathFlagsAttr

Bases: FastMathAttrBase

riscv.fastmath is a mirror of LLVMs fastmath flags.

Source code in xdsl/dialects/riscv/attrs.py
@irdl_attr_definition
class FastMathFlagsAttr(FastMathAttrBase):
    """
    riscv.fastmath is a mirror of LLVMs fastmath flags.
    """

    name = "riscv.fastmath"

    def __init__(self, flags: Iterable[FastMathFlag] | Literal["none", "fast"] | None):
        # irdl_attr_definition defines an __init__ if none is defined, so we need to
        # explicitely define one here.
        super().__init__(flags)

name = 'riscv.fastmath' class-attribute instance-attribute

__init__(flags: Iterable[FastMathFlag] | Literal['none', 'fast'] | None)

Source code in xdsl/dialects/riscv/attrs.py
def __init__(self, flags: Iterable[FastMathFlag] | Literal["none", "fast"] | None):
    # irdl_attr_definition defines an __init__ if none is defined, so we need to
    # explicitely define one here.
    super().__init__(flags)

ImmediateI12 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateI12(_Immediate):
    INTEGER_TYPE = i12

INTEGER_TYPE = i12 class-attribute instance-attribute

ImmediateSI12 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateSI12(_Immediate):
    INTEGER_TYPE = si12

INTEGER_TYPE = si12 class-attribute instance-attribute

ImmediateI20 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateI20(_Immediate):
    INTEGER_TYPE = i20

INTEGER_TYPE = i20 class-attribute instance-attribute

ImmediateSI20 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateSI20(_Immediate):
    INTEGER_TYPE = si20

INTEGER_TYPE = si20 class-attribute instance-attribute

ImmediateUI5 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateUI5(_Immediate):
    INTEGER_TYPE = ui5

INTEGER_TYPE = ui5 class-attribute instance-attribute

ImmediateI32 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateI32(_Immediate):
    INTEGER_TYPE = i32

INTEGER_TYPE = i32 class-attribute instance-attribute

ImmediateI64 dataclass

Bases: _Immediate

Source code in xdsl/dialects/riscv/attrs.py
class ImmediateI64(_Immediate):
    INTEGER_TYPE = i64

INTEGER_TYPE = i64 class-attribute instance-attribute

parse_immediate_value(parser: AttrParser, integer_type: IntegerType | IndexType) -> IntegerAttr[IntegerType | IndexType] | StringAttr

Source code in xdsl/dialects/riscv/attrs.py
def parse_immediate_value(
    parser: AttrParser, integer_type: IntegerType | IndexType
) -> IntegerAttr[IntegerType | IndexType] | StringAttr:
    return parser.expect(
        lambda: _parse_optional_immediate_value(parser, integer_type),
        "Expected immediate",
    )

print_immediate_value(printer: Printer, immediate: IntegerAttr | StringAttr)

Source code in xdsl/dialects/riscv/attrs.py
def print_immediate_value(printer: Printer, immediate: IntegerAttr | StringAttr):
    match immediate:
        case IntegerAttr():
            immediate.print_without_type(printer)
        case StringAttr():
            printer.print_attribute(immediate)