Riscv snitch
riscv_snitch
¶
ALLOWED_FREP_OP_TYPES: tuple[type[Operation], ...] = (ReadOp, WriteOp, UnrealizedConversionCastOp)
module-attribute
¶
I3: TypeAlias = IntegerType[Literal[3]]
module-attribute
¶
I4: TypeAlias = IntegerType[Literal[4]]
module-attribute
¶
i3 = I3(3)
module-attribute
¶
i4 = I4(4)
module-attribute
¶
RISCV_Snitch = Dialect('riscv_snitch', [ScfgwOp, ScfgwiOp, FrepOuterOp, FrepInnerOp, FrepYieldOp, ReadOp, WriteOp, GetStreamOp, DMSourceOp, DMDestinationOp, DMStrideOp, DMRepOp, DMCopyOp, DMCopyImmOp, DMStatOp, DMStatImmOp, VFMulSOp, VFAddSOp, VFSubSOp, VFCpkASSOp, VFMacSOp, VFSumSOp, VFMulHOp, VFAddHOp, VFSubHOp, VFMaxSOp], [])
module-attribute
¶
ScfgwOpHasCanonicalizationPatternsTrait
dataclass
¶
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv_snitch.py
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
¶
ScfgwOp
dataclass
¶
Bases: RsRsIntegerOperation
Write the value in rs1 to the Snitch stream configuration location pointed by rs2 in the memory-mapped address space.
This is a RISC-V ISA extension, part of the `Xssr' extension.
See external documentation.
Source code in xdsl/dialects/riscv_snitch.py
ScfgwiOp
¶
Bases: RISCVInstruction
Write the value in rs to the Snitch stream configuration location pointed by immediate value in the memory-mapped address space.
This is a RISC-V ISA extension, part of the `Xssr' extension.
See external documentation.
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.scfgwi'
class-attribute
instance-attribute
¶
rs1 = operand_def(IntRegisterType)
class-attribute
instance-attribute
¶
immediate = attr_def(IntegerAttr[SI12])
class-attribute
instance-attribute
¶
assembly_format = '$rs1 `,` $immediate attr-dict `:` `(` type($rs1) `)` `->` `(` `)`'
class-attribute
instance-attribute
¶
traits = traits_def(MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(rs1: Operation | SSAValue, immediate: int | IntegerAttr[SI12], *, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/riscv_snitch.py
FrepYieldOp
dataclass
¶
Bases: AbstractYieldOperation[Attribute], RISCVAsmOperation, RISCVRegallocOperation
Source code in xdsl/dialects/riscv_snitch.py
ReadOp
¶
Bases: RISCVAsmOperation, RISCVRegallocOperation
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.read'
class-attribute
instance-attribute
¶
T: ClassVar = VarConstraint('T', AnyAttr())
class-attribute
instance-attribute
¶
stream = operand_def(snitch.ReadableStreamType.constr(T))
class-attribute
instance-attribute
¶
res = result_def(T)
class-attribute
instance-attribute
¶
assembly_format = '`from` $stream attr-dict `:` type($res)'
class-attribute
instance-attribute
¶
traits = traits_def(MemoryWriteEffect(), MemoryReadEffect(), RegisterAllocatedMemoryEffect())
class-attribute
instance-attribute
¶
__init__(stream_val: SSAValue, result_type: Attribute | None = None)
¶
Source code in xdsl/dialects/riscv_snitch.py
assembly_line() -> str | None
¶
iter_excluded_registers()
¶
WriteOp
¶
Bases: RISCVAsmOperation, RISCVRegallocOperation
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.write'
class-attribute
instance-attribute
¶
T: ClassVar = VarConstraint('T', AnyAttr())
class-attribute
instance-attribute
¶
value = operand_def(T)
class-attribute
instance-attribute
¶
stream = operand_def(snitch.WritableStreamType.constr(T))
class-attribute
instance-attribute
¶
assembly_format = '$value `to` $stream attr-dict `:` type($value)'
class-attribute
instance-attribute
¶
traits = traits_def(MemoryWriteEffect(), RegisterAllocatedMemoryEffect())
class-attribute
instance-attribute
¶
__init__(value: SSAValue, stream: SSAValue)
¶
assembly_line() -> str | None
¶
iter_excluded_registers()
¶
FRepOperation
¶
Bases: RISCVInstruction
The frep instruction marks the beginning of a floating-point kernel which should be repeated. It indicates how many subsequent instructions are stored in the sequence buffer, how often and how (operand staggering, repetition mode) each instruction is going to be repeated.
Snitch paper: See external documentation.
Source code in xdsl/dialects/riscv_snitch.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
max_rep = operand_def(IntRegisterType)
class-attribute
instance-attribute
¶
Number of times to repeat the instructions.
body = region_def('single_block')
class-attribute
instance-attribute
¶
Instructions to repeat, containing maximum 15 instructions, with no side effects.
iter_args = var_operand_def(riscv.RISCVRegisterType)
class-attribute
instance-attribute
¶
Loop-carried variable initial values.
stagger_mask = attr_def(IntegerAttr[I4], default_value=IntegerAttr(0, i4))
class-attribute
instance-attribute
¶
4 bits for each operand (rs1 rs2 rs3 rd). If the bit is set, the corresponding operand is staggered.
stagger_count = attr_def(IntegerAttr[I3], default_value=IntegerAttr(0, i3))
class-attribute
instance-attribute
¶
3 bits, indicating for how many iterations the stagger should increment before it wraps again (up to 23 = 8).
res = var_result_def(riscv.RISCVRegisterType)
class-attribute
instance-attribute
¶
Loop-carried variable initial values.
traits = lazy_traits_def(lambda: (SingleBlockImplicitTerminator(FrepYieldOp), RecursiveMemoryEffect()))
class-attribute
instance-attribute
¶
max_inst: int
property
¶
Number of instructions to be repeated.
__init__(max_rep: SSAValue | Operation, body: Sequence[Operation] | Sequence[Block] | Region, iter_args: Sequence[SSAValue | Operation] = (), stagger_mask: IntegerAttr[I4] | None = None, stagger_count: IntegerAttr[I3] | None = None)
¶
Source code in xdsl/dialects/riscv_snitch.py
assembly_line_args() -> tuple[AssemblyInstructionArg | None, ...]
¶
parse(parser: Parser) -> Self
classmethod
¶
Source code in xdsl/dialects/riscv_snitch.py
print(printer: Printer) -> None
¶
Source code in xdsl/dialects/riscv_snitch.py
verify_() -> None
¶
Source code in xdsl/dialects/riscv_snitch.py
allocate_registers(allocator: BlockAllocator) -> None
¶
Source code in xdsl/dialects/riscv_snitch.py
FrepOuterOp
dataclass
¶
Bases: FRepOperation
Repeats the instruction in the body as if the body were the body of a for loop, for example:
# Repeat 4 times, stagger 1, period 2
li a0, 4
frep.o a0, 2, 1, 0b1010
fadd.d fa0, ft0, ft2
fmul.d fa0, ft3, fa0
is equivalent to:
fadd.d fa0, ft0, ft2
fmul.d fa0, ft3, fa0
fadd.d fa1, ft0, ft3
fmul.d fa1, ft3, fa1
fadd.d fa0, ft0, ft2
fmul.d fa0, ft3, fa0
fadd.d fa1, ft0, ft3
fmul.d fa1, ft3, fa1
Source code in xdsl/dialects/riscv_snitch.py
FrepInnerOp
dataclass
¶
Bases: FRepOperation
Repeats the instruction in the body, as if each were in its own body of a for loop, for example:
# Repeat three times, stagger 2, period 2
li a0, 3
frep.i a0, 2, 2, 0b0100
fadd.d fa0, ft0, ft2
fmul.d fa0, ft3, fa0
is equivalent to:
fadd.d fa0, ft0, ft2
fadd.d fa0, ft1, ft3
fadd.d fa0, ft2, ft3
fmul.d fa0, ft3, fa0
fmul.d fa0, ft4, fa0
fmul.d fa0, ft5, fa0
Source code in xdsl/dialects/riscv_snitch.py
GetStreamOp
¶
Bases: RISCVAsmOperation, RISCVRegallocOperation
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.get_stream'
class-attribute
instance-attribute
¶
stream = result_def(snitch.ReadableStreamType.constr(BaseAttr(riscv.FloatRegisterType)) | snitch.WritableStreamType.constr(BaseAttr(riscv.FloatRegisterType)))
class-attribute
instance-attribute
¶
traits = traits_def(NoMemoryEffect())
class-attribute
instance-attribute
¶
__init__(result_type: Attribute)
¶
parse(parser: Parser) -> GetStreamOp
classmethod
¶
print(printer: Printer)
¶
DMSourceOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmsrc'
class-attribute
instance-attribute
¶
ptrlo = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
ptrhi = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$ptrlo `,` $ptrhi attr-dict `:` `(` type($ptrlo) `,` type($ptrhi) `)` `->` `(` `)`'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 0, x0, {0}, {1}'), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(ptrlo: SSAValue | Operation, ptrhi: SSAValue | Operation)
¶
DMDestinationOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmdst'
class-attribute
instance-attribute
¶
ptrlo = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
ptrhi = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$ptrlo `,` $ptrhi attr-dict `:` `(` type($ptrlo) `,` type($ptrhi) `)` `->` `(` `)`'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 1, x0, {0}, {1}'), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(ptrlo: SSAValue | Operation, ptrhi: SSAValue | Operation)
¶
DMStrideOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmstr'
class-attribute
instance-attribute
¶
srcstrd = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
dststrd = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$srcstrd `,` $dststrd attr-dict `:` `(` type($srcstrd) `,` type($dststrd) `)` `->` `(` `)`'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 6, x0, {0}, {1}'), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(srcstrd: SSAValue | Operation, dststrd: SSAValue | Operation)
¶
DMRepOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmrep'
class-attribute
instance-attribute
¶
reps = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$reps attr-dict `:` `(` type($reps) `)` `->` `(` `)`'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 7, x0, {0}, x0'), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(reps: SSAValue | Operation)
¶
DMCopyOp
¶
Bases: RISCVInstruction
DMCPY and DMCPYI initiate an asynchronous data movement with the parameters configured by the previous DM instructions. A transfer id is placed in register rd, which is necessary to later check for transfer completion. size contains the number of consecutive bytes to transfer. For multi-dimensional transfers this is the size of the innermost dimension.
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmcpy'
class-attribute
instance-attribute
¶
dest = result_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
size = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
config = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
config* determines the following parameters of the transfer:
| Bit(s) | Field | Description |
|---|---|---|
| config[0] | decouple_rw | Decouple the handshakes of the read and write channels |
| config[1] | enable_2d | Enable two-dimensional transfer |
| config[4:2] | channel_sel | Selects the DMA backend if a multi-channel DMA is used |
assembly_format = '$size `,` $config attr-dict `:` functional-type(operands, results)'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 3, {0}, {1}, {2}'), MemoryReadEffect(), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(size: SSAValue | Operation, config: SSAValue | Operation, result_type: IntRegisterType = riscv.Registers.UNALLOCATED_INT)
¶
DMStatOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmstat'
class-attribute
instance-attribute
¶
dest = result_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
status = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$status attr-dict `:` functional-type(operands, results)'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 5, {0}, {1}, {2}'), MemoryReadEffect())
class-attribute
instance-attribute
¶
__init__(status: SSAValue | Operation, result_type: IntRegisterType = riscv.Registers.UNALLOCATED_INT)
¶
DMCopyImmOp
¶
Bases: RISCVInstruction
DMCPY and DMCPYI initiate an asynchronous data movement with the parameters configured by the previous DM instructions. A transfer id is placed in register rd, which is necessary to later check for transfer completion. size contains the number of consecutive bytes to transfer. For multi-dimensional transfers this is the size of the innermost dimension.
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmcpyi'
class-attribute
instance-attribute
¶
dest = result_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
size = operand_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
config = prop_def(IntegerAttr[UI5])
class-attribute
instance-attribute
¶
config* determines the following parameters of the transfer:
| Bit(s) | Field | Description |
|---|---|---|
| config[0] | decouple_rw | Decouple the handshakes of the read and write channels |
| config[1] | enable_2d | Enable two-dimensional transfer |
| config[4:2] | channel_sel | Selects the DMA backend if a multi-channel DMA is used |
assembly_format = '$size `,` $config attr-dict `:` functional-type(operands, results)'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 2, {0}, {1}, {2}'), MemoryReadEffect(), MemoryWriteEffect())
class-attribute
instance-attribute
¶
__init__(size: SSAValue | Operation, config: int | IntegerAttr[UI5], result_type: IntRegisterType = riscv.Registers.UNALLOCATED_INT)
¶
Source code in xdsl/dialects/riscv_snitch.py
DMStatImmOp
¶
Bases: RISCVInstruction
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.dmstati'
class-attribute
instance-attribute
¶
dest = result_def(riscv.IntRegisterType)
class-attribute
instance-attribute
¶
status = prop_def(IntegerAttr[UI5])
class-attribute
instance-attribute
¶
assembly_format = '$status attr-dict `:` `(` `)` `->` type($dest)'
class-attribute
instance-attribute
¶
traits = traits_def(StaticInsnRepresentation(insn='.insn r 0x2b, 0, 4, {0}, {1}, {2}'), MemoryReadEffect())
class-attribute
instance-attribute
¶
__init__(status: int | IntegerAttr[UI5], result_type: IntRegisterType = riscv.Registers.UNALLOCATED_INT)
¶
Source code in xdsl/dialects/riscv_snitch.py
VFCpkASSOp
dataclass
¶
Bases: RdRsRsOperation[FloatRegisterType, FloatRegisterType, FloatRegisterType]
Packs two scalar f32 values from rs1 and rs2 and packs the result as two adjacent entries into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
VFMulSOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial multiplication of corresponding f32 values from rs1 and rs2 and stores the results in the corresponding f32 lanes into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
VFAddSOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial addition of corresponding f32 values from rs1 and rs2 and stores the results in the corresponding f32 lanes into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
VFSubSOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial subtraction of corresponding f32 values from rs1 and rs2 and stores the results in the corresponding f32 lanes into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
VFAddHOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial addition of corresponding f16 values from rs1 and rs2 and stores the results in the corresponding f16 lanes into the vectorial 4xf16 rd operand, such as:
f[rd][0] = f[rs1][0] + f[rs2][0]
f[rd][1] = f[rs1][1] + f[rs2][1]
f[rd][2] = f[rs1][2] + f[rs2][2]
f[rd][3] = f[rs1][3] + f[rs2][3]
Source code in xdsl/dialects/riscv_snitch.py
VFSubHOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial subtraction of corresponding f16 values from rs1 and rs2 and stores the results in the corresponding f16 lanes into the vectorial 4xf16 rd operand, such as:
f[rd][0] = f[rs1][0] - f[rs2][0]
f[rd][1] = f[rs1][1] - f[rs2][1]
f[rd][2] = f[rs1][2] - f[rs2][2]
f[rd][3] = f[rs1][3] - f[rs2][3]
Source code in xdsl/dialects/riscv_snitch.py
VFMulHOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial multiplication of corresponding f16 values from rs1 and rs2 and stores the results in the corresponding f16 lanes into the vectorial 4xf16 rd operand, such as:
f[rd][0] = f[rs1][0] * f[rs2][0]
f[rd][1] = f[rs1][1] * f[rs2][1]
f[rd][2] = f[rs1][2] * f[rs2][2]
f[rd][3] = f[rs1][3] * f[rs2][3]
Source code in xdsl/dialects/riscv_snitch.py
VFMaxSOp
dataclass
¶
Bases: RdRsRsFloatOperationWithFastMath
Performs vectorial maximum of corresponding f32 values from rs1 and rs2 and stores the results in the corresponding f32 lanes into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
RdRsRsAccumulatingFloatOperationWithFastMath
¶
Bases: RISCVInstruction, ABC
A base class for RISC-V operations that have one destination floating-point register, that also acts as a source register, and two source floating-point registers and can be annotated with fastmath flags.
Source code in xdsl/dialects/riscv_snitch.py
SAME_FLOAT_REGISTER_TYPE: ClassVar = VarConstraint('SAME_FLOAT_REGISTER_TYPE', base(FloatRegisterType))
class-attribute
instance-attribute
¶
rd_out = result_def(SAME_FLOAT_REGISTER_TYPE)
class-attribute
instance-attribute
¶
rd_in = operand_def(SAME_FLOAT_REGISTER_TYPE)
class-attribute
instance-attribute
¶
rs1 = operand_def(FloatRegisterType)
class-attribute
instance-attribute
¶
rs2 = operand_def(FloatRegisterType)
class-attribute
instance-attribute
¶
fastmath = attr_def(FastMathFlagsAttr, default_value=FastMathFlagsAttr('none'))
class-attribute
instance-attribute
¶
assembly_format = '$rd_in `,` $rs1 `,` $rs2 (`fastmath` `` $fastmath^)? attr-dict `:` functional-type(operands, results)'
class-attribute
instance-attribute
¶
traits = traits_def(AlwaysSpeculatable())
class-attribute
instance-attribute
¶
__init__(rd: Operation | SSAValue, rs1: Operation | SSAValue, rs2: Operation | SSAValue, *, fastmath: FastMathFlagsAttr | None = None, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/riscv_snitch.py
assembly_line_args() -> tuple[AssemblyInstructionArg, ...]
¶
RdRsAccumulatingFloatOperation
¶
Bases: RISCVInstruction, ABC
A base class for RISC-V operations that have one destination floating-point register, that also acts as a source register, and a source floating-point register.
Source code in xdsl/dialects/riscv_snitch.py
SAME_FLOAT_REGISTER_TYPE: ClassVar = VarConstraint('SAME_FLOAT_REGISTER_TYPE', base(FloatRegisterType))
class-attribute
instance-attribute
¶
rd_out = result_def(SAME_FLOAT_REGISTER_TYPE)
class-attribute
instance-attribute
¶
rd_in = operand_def(SAME_FLOAT_REGISTER_TYPE)
class-attribute
instance-attribute
¶
rs = operand_def(FloatRegisterType)
class-attribute
instance-attribute
¶
assembly_format = '$rd_in `,` $rs attr-dict `:` functional-type(operands, results)'
class-attribute
instance-attribute
¶
traits = traits_def(AlwaysSpeculatable())
class-attribute
instance-attribute
¶
__init__(rd: Operation | SSAValue, rs: Operation | SSAValue, *, comment: str | StringAttr | None = None)
¶
Source code in xdsl/dialects/riscv_snitch.py
assembly_line_args() -> tuple[AssemblyInstructionArg, ...]
¶
VFMacSOp
dataclass
¶
Bases: RdRsRsAccumulatingFloatOperationWithFastMath
Performs vectorial multiplication of corresponding f32 values from rs1 and rs2 and accumulates the results in the corresponding f32 lanes into the vectorial 2xf32 rd operand, such as:
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.vfmac.s'
class-attribute
instance-attribute
¶
VFSumSOp
dataclass
¶
Bases: RdRsAccumulatingFloatOperation
Performs sum of f32 values from rs and accumulates the result in the lower f32 value of the rd operand:
Source code in xdsl/dialects/riscv_snitch.py
name = 'riscv_snitch.vfsum.s'
class-attribute
instance-attribute
¶
is_valid_frep_body_op(operation: Operation) -> bool
¶
Helper method to determine whether the frep loop on the Snitch core can contain
the given operation.
frep loops can only contain instructions that are executed on the FPU, and only
contain memory effects via ReadOp / WriteOp.
We also allow UnrealizedConversionCastOp to support partial lowering of dialects.