Rv64
rv64
¶
RISC-V 64-bit (RV64) dialect operations and types.
This module defines the RV64-specific variant of RISC-V operations, using 6-bit immediates for 64-bit architectures.
RV64 = Dialect('rv64', [SlliOp, SrliOp, SraiOp, SlliwOp, SrliwOp, BclrIOp, BextIOp, BinvIOp, BsetIOp, RorIOp, LiOp, LdOp, SdOp, GetRegisterOp], [])
module-attribute
¶
LiOp
¶
Bases: LiOperation[I64]
Loads a 64-bit immediate into rd.
This is an assembler pseudo-instruction.
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.li'
class-attribute
instance-attribute
¶
__init__(immediate: int | IntegerAttr[I64] | str | LabelAttr, *, rd: IntRegisterType = Registers.UNALLOCATED_INT, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/rv64.py
custom_parse_attributes(parser: Parser) -> dict[str, Attribute]
classmethod
¶
RV64RdRsImmShiftOperation
¶
Bases: RdRsImmShiftOperation[UI6, I64]
Base class for RISC-V 64-bit shift immediate operations with rd, rs1 and imm6.
Source code in xdsl/dialects/rv64.py
traits = lazy_traits_def(lambda: (ImmShiftOpRV64HasCanonicalizationPatternsTrait(),))
class-attribute
instance-attribute
¶
__init__(rs1: Operation | SSAValue, immediate: int | IntegerAttr[UI6], *, rd: IntRegisterType = Registers.UNALLOCATED_INT, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/rv64.py
ImmShiftOpRV64HasCanonicalizationPatternsTrait
dataclass
¶
Bases: ImmShiftOpHasCanonicalizationPatternsTrait[I64]
Trait for RISC-V 64-bit shift immediate operations with canonicalization patterns.
Source code in xdsl/dialects/rv64.py
SlliOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
Performs logical left shift on the value in register rs1 by the shift amount held in the 6-bit immediate.
x[rd] = x[rs1] << shamt
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.slli'
class-attribute
instance-attribute
¶
SrliOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
Performs logical right shift on the value in register rs1 by the shift amount held in the 6-bit immediate.
x[rd] = x[rs1] >>u shamt
See external documentation.
Source code in xdsl/dialects/rv64.py
BclrIOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
This instruction returns rs1 with a single bit cleared at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.bclri'
class-attribute
instance-attribute
¶
BextIOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
This instruction returns a single bit extracted from rs1 at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
See external documentation.
Source code in xdsl/dialects/rv64.py
BinvIOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
This instruction returns rs1 with a single bit inverted at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.binvi'
class-attribute
instance-attribute
¶
BsetIOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
This instruction returns rs1 with a single bit set at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.bseti'
class-attribute
instance-attribute
¶
RorIOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
This instruction performs a rotate right of rs1 by the amount in the least-significant log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.rori'
class-attribute
instance-attribute
¶
py_operation(rs1: IntegerAttr[I64]) -> IntegerAttr[I64]
¶
Source code in xdsl/dialects/rv64.py
SraiOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
Performs arithmetic right shift on the value in register rs1 by the shift amount held in the 6-bit immediate.
x[rd] = x[rs1] >>s shamt
See external documentation.
Source code in xdsl/dialects/rv64.py
name = 'rv64.srai'
class-attribute
instance-attribute
¶
SlliwOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
Performs logical left shift on the lower 32 bits of the value in register rs1 by the shift amount held in the immediate (RV64-only instruction). The result is sign-extended to 64 bits.
See external documentation.
Source code in xdsl/dialects/rv64.py
SrliwOp
dataclass
¶
Bases: RV64RdRsImmShiftOperation
Performs arithmetic right shift on the 32-bit of value in register rs1 by the shift amount held in the lower 5 bits of the immediate. (RV64-only instruction). The result is sign-extended to 64 bits.
See external documentation.
Source code in xdsl/dialects/rv64.py
LdOp
dataclass
¶
Bases: RdRsImmIntegerOperation
Loads a 64-bit value from memory into register rd for RV64I.
See external documentation.
Source code in xdsl/dialects/rv64.py
SdOp
dataclass
¶
Bases: RsRsImmIntegerOperation
Store 64-bit, values from register rs2 to memory.
See external documentation.
Source code in xdsl/dialects/rv64.py
GetRegisterOp
dataclass
¶
Bases: GetAnyRegisterOperation[IntRegisterType]