Skip to content

Traits

traits

StaticInsnRepresentation dataclass

Bases: HasInsnRepresentation

Returns the first parameter as an insn template string.

See external documentation.

Source code in xdsl/backend/riscv/traits.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
@dataclass(frozen=True)
class StaticInsnRepresentation(HasInsnRepresentation):
    """
    Returns the first parameter as an insn template string.

    See external [documentation](https://sourceware.org/binutils/docs/as/RISC_002dV_002dDirectives.html).
    """

    insn: str = field(kw_only=True)

    def get_insn(self, op: Operation) -> str:
        """
        Return the insn representation of the operation for printing.
        """
        return self.insn

insn: str = field(kw_only=True) class-attribute instance-attribute

__init__(*, insn: str) -> None

get_insn(op: Operation) -> str

Return the insn representation of the operation for printing.

Source code in xdsl/backend/riscv/traits.py
17
18
19
20
21
def get_insn(self, op: Operation) -> str:
    """
    Return the insn representation of the operation for printing.
    """
    return self.insn