Ops
ops
RISCV = Dialect('riscv', [AddiOp, SltiOp, SltiuOp, AndiOp, OriOp, XoriOp, SlliOp, SrliOp, SraiOp, LuiOp, AuipcOp, MVOp, SeqzOp, SnezOp, ZextBOp, ZextWOp, SextWOp, AddOp, SltOp, SltuOp, AndOp, OrOp, XorOp, SllOp, SrlOp, SubOp, SraOp, NopOp, JalOp, JOp, JalrOp, ReturnOp, BeqOp, BneOp, BltOp, BgeOp, BltuOp, BgeuOp, LbOp, LbuOp, LhOp, LhuOp, LwOp, SbOp, ShOp, SwOp, CsrrwOp, CsrrsOp, CsrrcOp, CsrrwiOp, CsrrsiOp, CsrrciOp, MulOp, MulhOp, MulhsuOp, MulhuOp, DivOp, DivuOp, RemOp, RemuOp, LiOp, RolOp, RorOp, RemuwOp, SrliwOp, SraiwOp, AddwOp, SubwOp, SllwOp, SrlwOp, SrawOp, RemwOp, MulwOp, DivwOp, DivuwOp, CZeroEqzOp, CZeroNezOp, BclrOp, BextOp, BinvOp, BsetOp, RolwOp, RorwOp, AddUwOp, Sh1addOp, Sh2addOp, Sh3addOp, Sh1addUwOp, Sh2addUwOp, Sh3addUwOp, SextBOp, SextHOp, ZextHOp, AndnOp, OrnOp, XnorOp, MaxOp, MaxUOp, MinOp, MinUOp, BclrIOp, BextIOp, BsetIOp, BinvIOp, RoriOp, RoriwOp, SlliUwOp, EcallOp, LabelOp, DirectiveOp, AssemblySectionOp, EbreakOp, WfiOp, CustomAssemblyInstructionOp, CommentOp, GetRegisterOp, GetFloatRegisterOp, FMVOp, FMAddSOp, FMSubSOp, FNMSubSOp, FNMAddSOp, FAddSOp, FSubSOp, FMulSOp, FDivSOp, FSqrtSOp, FSgnJSOp, FSgnJNSOp, FSgnJXSOp, FMinSOp, FMaxSOp, FCvtWSOp, FCvtWuSOp, FMvXWOp, FeqSOp, FltSOp, FleSOp, FClassSOp, FCvtSWOp, FCvtSWuOp, FMvWXOp, FLwOp, FSwOp, FMAddDOp, FMSubDOp, FAddDOp, FSubDOp, FMulDOp, FDivDOp, FMinDOp, FMaxDOp, FCvtDWOp, FCvtDWuOp, FLdOp, FSdOp, FMvDOp, VFAddSOp, VFMulSOp, ParallelMovOp], [IntRegisterType, FloatRegisterType, LabelAttr, FastMathFlagsAttr])
module-attribute
AddiOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
106 107 108 109 110 111 112 113 114 115 116 117 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
107 108 109 110 111 112 113 114 115 116 117 | |
AddiOp
dataclass
Bases: RdRsImmIntegerOperation
Adds the sign-extended 12-bit immediate to register rs1. Arithmetic overflow is ignored and the result is simply the low XLEN bits of the result.
x[rd] = x[rs1] + sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
name = 'riscv.addi'
class-attribute
instance-attribute
traits = traits_def(Pure(), AddiOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SltiOp
dataclass
Bases: RdRsImmIntegerOperation
Place the value 1 in register rd if register rs1 is less than the sign-extended immediate when both are treated as signed numbers, else 0 is written to rd.
x[rd] = x[rs1] <s sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
136 137 138 139 140 141 142 143 144 145 146 147 | |
name = 'riscv.slti'
class-attribute
instance-attribute
SltiuOp
dataclass
Bases: RdRsImmIntegerOperation
Place the value 1 in register rd if register rs1 is less than the immediate when both are treated as unsigned numbers, else 0 is written to rd.
x[rd] = x[rs1] <u sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
150 151 152 153 154 155 156 157 158 159 160 161 | |
name = 'riscv.sltiu'
class-attribute
instance-attribute
AndiOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
164 165 166 167 168 169 170 171 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
165 166 167 168 169 170 171 | |
AndiOp
dataclass
Bases: RdRsImmIntegerOperation
Performs bitwise AND on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
x[rd] = x[rs1] & sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
174 175 176 177 178 179 180 181 182 183 184 185 186 | |
name = 'riscv.andi'
class-attribute
instance-attribute
traits = traits_def(AndiOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
OriOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
189 190 191 192 193 194 195 196 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
190 191 192 193 194 195 196 | |
OriOp
dataclass
Bases: RdRsImmIntegerOperation
Performs bitwise OR on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
x[rd] = x[rs1] | sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
199 200 201 202 203 204 205 206 207 208 209 210 211 | |
name = 'riscv.ori'
class-attribute
instance-attribute
traits = traits_def(OriOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
XoriOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
214 215 216 217 218 219 220 221 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
215 216 217 218 219 220 221 | |
XoriOp
dataclass
Bases: RdRsImmIntegerOperation
Performs bitwise XOR on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
x[rd] = x[rs1] ^ sext(immediate)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
224 225 226 227 228 229 230 231 232 233 234 235 236 | |
name = 'riscv.xori'
class-attribute
instance-attribute
traits = traits_def(XoriOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SlliOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
239 240 241 242 243 244 245 246 247 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
240 241 242 243 244 245 246 247 | |
SlliOp
dataclass
Bases: RdRsImmShiftOperation
Performs logical left shift on the value in register rs1 by the shift amount held in the lower 5 bits of the immediate.
x[rd] = x[rs1] << shamt
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 | |
name = 'riscv.slli'
class-attribute
instance-attribute
traits = traits_def(SlliOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SrliOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
266 267 268 269 270 271 272 273 274 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
267 268 269 270 271 272 273 274 | |
SrliOp
dataclass
Bases: RdRsImmShiftOperation
Performs logical right shift on the value in register rs1 by the shift amount held in the lower 5 bits of the immediate.
x[rd] = x[rs1] >>u shamt
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
name = 'riscv.srli'
class-attribute
instance-attribute
traits = traits_def(SrliOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SraiOp
dataclass
Bases: RdRsImmShiftOperation
Performs arithmetic right shift on the value in register rs1 by the shift amount held in the lower 5 bits of the immediate.
x[rd] = x[rs1] >>s shamt
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
293 294 295 296 297 298 299 300 301 302 303 304 | |
name = 'riscv.srai'
class-attribute
instance-attribute
AddiwOp
dataclass
Bases: RdRsImmIntegerOperation
Adds the sign-extended 12-bit immediate to register rs1 and produces the proper sign-extension of a 32-bit result in rd. Overflows are ignored and the result is the low 32 bits of the result sign-extended to 64 bits.
x[rd] = sext((x[rs1] + sext(immediate))[31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 | |
name = 'riscv.addiw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SlliwOp
dataclass
Bases: RdRsImmShiftOperation
Performs logical left shift on the 32-bit of value in register rs1 by the shift amount held in the lower 5 bits of the immediate.
x[rd] = sext((x[rs1] << shamt)[31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
name = 'riscv.slliw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SrliwOp
dataclass
Bases: RdRsImmShiftOperation
Performs logical right shift on the 32-bit of value in register rs1 by the shift amount held in the lower 5 bits of the immediate.
x[rd] = sext(x[rs1][31:0] >>u shamt)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
name = 'riscv.srliw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SraiwOp
dataclass
Bases: RdRsImmIntegerOperation
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.
x[rd] = sext(x[rs1][31:0] >>s shamt)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | |
name = 'riscv.sraiw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
AddwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Adds the 32-bit of registers rs1 and 32-bit of register rs2 and stores the result in rd. Arithmetic overflow is ignored and the low 32-bits of the result is sign-extended to 64-bits and written to the destination register.
x[rd] = sext((x[rs1] + x[rs2])[31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | |
name = 'riscv.addw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SubwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Subtract the 32-bit of registers rs1 and 32-bit of register rs2 and stores the result in rd. Arithmetic overflow is ignored and the low 32-bits of the result is sign-extended to 64-bits and written to the destination register.
x[rd] = sext((x[rs1] - x[rs2])[31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | |
name = 'riscv.subw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SllwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs logical left shift on the low 32-bits value in register rs1 by the shift amount held in the lower 5 bits of register rs2 and produce 32-bit results and written to the destination register rd.
x[rd] = sext((x[rs1] << x[rs2][4:0])[31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
name = 'riscv.sllw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SrlwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs logical right shift on the low 32-bits value in register rs1 by the shift amount held in the lower 5 bits of register rs2 and produce 32-bit results and written to the destination register rd.
x[rd] = sext(x[rs1][31:0] >>u x[rs2][4:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 | |
name = 'riscv.srlw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SrawOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs arithmetic right shift on the low 32-bits value in register rs1 by the shift amount held in the lower 5 bits of register rs2 and produce 32-bit results and written to the destination register rd.
x[rd] = sext(x[rs1][31:0] >>s x[rs2][4:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | |
name = 'riscv.sraw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
LuiOp
dataclass
Bases: RdImmIntegerOperation
Build 32-bit constants and uses the U-type format. LUI places the U-immediate value in the top 20 bits of the destination register rd, filling in the lowest 12 bits with zeros.
x[rd] = sext(immediate[31:12] << 12)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
462 463 464 465 466 467 468 469 470 471 472 473 | |
name = 'riscv.lui'
class-attribute
instance-attribute
AuipcOp
dataclass
Bases: RdImmIntegerOperation
Build pc-relative addresses and uses the U-type format. AUIPC forms a 32-bit offset from the 20-bit U-immediate, filling in the lowest 12 bits with zeros, adds this offset to the pc, then places the result in register rd.
x[rd] = pc + sext(immediate[31:12] << 12)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
476 477 478 479 480 481 482 483 484 485 486 487 488 | |
name = 'riscv.auipc'
class-attribute
instance-attribute
MVHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
491 492 493 494 495 496 497 498 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
492 493 494 495 496 497 498 | |
MVOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction to copy contents of one int register to another.
Equivalent to addi rd, rs, 0
Source code in xdsl/dialects/riscv/ops.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 | |
name = 'riscv.mv'
class-attribute
instance-attribute
traits = traits_def(Pure(), MVHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SeqzOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction that sets the destination register to 1 if the source register is equal to zero.
Equivalent to `sltiu rd, rs, 1
Source code in xdsl/dialects/riscv/ops.py
517 518 519 520 521 522 523 524 525 | |
name = 'riscv.seqz'
class-attribute
instance-attribute
SnezOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction that sets the destination register to 1 if the source register is not equal to zero.
Equivalent to sltu rd, x0, rs1
Source code in xdsl/dialects/riscv/ops.py
528 529 530 531 532 533 534 535 536 | |
name = 'riscv.snez'
class-attribute
instance-attribute
ZextBOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction that zero-extends the least-significant byte of the source to XLEN by copying the into all of the bits more significant than 31.
Equivalent to andi rd, rs1, 255
Source code in xdsl/dialects/riscv/ops.py
539 540 541 542 543 544 545 546 547 548 549 550 | |
name = 'riscv.zext.b'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
ZextWOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction that zero-extends the least-significant word of the source to XLEN by inserting 0’s into all of the bits more significant than 31.
Equivalent to add.uw rd, rs1, 0
See external documentation
Source code in xdsl/dialects/riscv/ops.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 | |
name = 'riscv.zext.w'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SextWOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
A pseudo instruction that writes the sign-extension of the lower 32 bits of register rs1 into register rd.
Equivalent to addiw rd, rs, 0
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
569 570 571 572 573 574 575 576 577 578 579 580 581 | |
name = 'riscv.sext.w'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FMVHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
584 585 586 587 588 589 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
585 586 587 588 589 | |
FMVOp
dataclass
Bases: RdRsFloatOperation[FloatRegisterType]
A pseudo instruction to copy contents of one float register to another.
Equivalent to fsgnj.s rd, rs, rs.
Both clang and gcc emit fsw rs, 0(x); flw rd, 0(x) to copy floats, possibly because
storing and loading bits from memory is a lower overhead in practice than reasoning
about floating-point values.
Source code in xdsl/dialects/riscv/ops.py
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | |
name = 'riscv.fmv.s'
class-attribute
instance-attribute
traits = traits_def(Pure(), FMVHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
AddOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
615 616 617 618 619 620 621 622 623 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
616 617 618 619 620 621 622 623 | |
AddOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Adds the registers rs1 and rs2 and stores the result in rd. Arithmetic overflow is ignored and the result is simply the low XLEN bits of the result.
x[rd] = x[rs1] + x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 | |
name = 'riscv.add'
class-attribute
instance-attribute
traits = traits_def(Pure(), AddOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SltOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Place the value 1 in register rd if register rs1 is less than register rs2 when both are treated as signed numbers, else 0 is written to rd.
x[rd] = x[rs1] <s x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
647 648 649 650 651 652 653 654 655 656 657 658 | |
name = 'riscv.slt'
class-attribute
instance-attribute
SltuOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Place the value 1 in register rd if register rs1 is less than register rs2 when both are treated as unsigned numbers, else 0 is written to rd.
x[rd] = x[rs1] <u x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
661 662 663 664 665 666 667 668 669 670 671 672 | |
name = 'riscv.sltu'
class-attribute
instance-attribute
BitwiseAndHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
675 676 677 678 679 680 681 682 683 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
676 677 678 679 680 681 682 683 | |
AndOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs bitwise AND on registers rs1 and rs2 and place the result in rd.
x[rd] = x[rs1] & x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
686 687 688 689 690 691 692 693 694 695 696 697 698 | |
name = 'riscv.and'
class-attribute
instance-attribute
traits = traits_def(BitwiseAndHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
BitwiseOrHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
701 702 703 704 705 706 707 708 709 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
702 703 704 705 706 707 708 709 | |
OrOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs bitwise OR on registers rs1 and rs2 and place the result in rd.
x[rd] = x[rs1] | x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
712 713 714 715 716 717 718 719 720 721 722 723 724 | |
name = 'riscv.or'
class-attribute
instance-attribute
traits = traits_def(BitwiseOrHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
BitwiseXorHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
727 728 729 730 731 732 733 734 735 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
728 729 730 731 732 733 734 735 | |
XorOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs bitwise XOR on registers rs1 and rs2 and place the result in rd.
x[rd] = x[rs1] ^ x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
738 739 740 741 742 743 744 745 746 747 748 749 750 | |
name = 'riscv.xor'
class-attribute
instance-attribute
traits = traits_def(BitwiseXorHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SllOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs logical left shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2.
x[rd] = x[rs1] << x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
753 754 755 756 757 758 759 760 761 762 763 764 | |
name = 'riscv.sll'
class-attribute
instance-attribute
SrlOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Logical right shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2.
x[rd] = x[rs1] >>u x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
767 768 769 770 771 772 773 774 775 776 777 778 | |
name = 'riscv.srl'
class-attribute
instance-attribute
SubOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
781 782 783 784 785 786 787 788 789 790 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
782 783 784 785 786 787 788 789 790 | |
SubOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Subtracts the registers rs1 and rs2 and stores the result in rd. Arithmetic overflow is ignored and the result is simply the low XLEN bits of the result.
x[rd] = x[rs1] - x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
793 794 795 796 797 798 799 800 801 802 803 804 805 806 | |
name = 'riscv.sub'
class-attribute
instance-attribute
traits = traits_def(SubOpHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
SraOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs arithmetic right shift on the value in register rs1 by the shift amount held in the lower 5 bits of register rs2.
x[rd] = x[rs1] >>s x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
809 810 811 812 813 814 815 816 817 818 819 820 | |
name = 'riscv.sra'
class-attribute
instance-attribute
NopOp
dataclass
Bases: NullaryOperation
Does not change any user-visible state, except for advancing the pc register. Canonical nop is encoded as addi x0, x0, 0.
Source code in xdsl/dialects/riscv/ops.py
823 824 825 826 827 828 829 830 | |
name = 'riscv.nop'
class-attribute
instance-attribute
JalOp
dataclass
Bases: RdImmJumpOperation
Jump to address and place return address in rd.
jal mylabel is a pseudoinstruction for jal ra, mylabel
x[rd] = pc+4; pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
840 841 842 843 844 845 846 847 848 849 850 851 852 | |
name = 'riscv.jal'
class-attribute
instance-attribute
JOp
Bases: RdImmJumpOperation
A pseudo-instruction, for unconditional jumps you don't expect to return from.
Is equivalent to JalOp with rd = x0.
Used to be a part of the spec, removed in 2.0.
Source code in xdsl/dialects/riscv/ops.py
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 | |
name = 'riscv.j'
class-attribute
instance-attribute
__init__(immediate: int | IntegerAttr[SI20] | str | LabelAttr, *, comment: str | StringAttr | None = None)
Source code in xdsl/dialects/riscv/ops.py
865 866 867 868 869 870 871 | |
assembly_line_args() -> tuple[AssemblyInstructionArg, ...]
Source code in xdsl/dialects/riscv/ops.py
873 874 875 | |
JalrOp
dataclass
Bases: RdRsImmJumpOperation
Jump to address and place return address in rd.
t = pc+4
pc = (x[rs1] + sext(offset)) & ~1
x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | |
name = 'riscv.jalr'
class-attribute
instance-attribute
ReturnOp
dataclass
Bases: NullaryOperation
Pseudo-op for returning from subroutine.
Equivalent to jalr x0, x1, 0
Source code in xdsl/dialects/riscv/ops.py
895 896 897 898 899 900 901 902 903 904 905 | |
name = 'riscv.ret'
class-attribute
instance-attribute
traits = traits_def(IsTerminator())
class-attribute
instance-attribute
BeqOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 and rs2 are equal.
if (x[rs1] == x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
911 912 913 914 915 916 917 918 919 920 921 922 923 | |
name = 'riscv.beq'
class-attribute
instance-attribute
BneOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 and rs2 are not equal.
if (x[rs1] != x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
926 927 928 929 930 931 932 933 934 935 936 937 938 | |
name = 'riscv.bne'
class-attribute
instance-attribute
BltOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 is less than rs2, using signed comparison.
if (x[rs1] <s x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
941 942 943 944 945 946 947 948 949 950 951 952 953 | |
name = 'riscv.blt'
class-attribute
instance-attribute
BgeOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 is greater than or equal to rs2, using signed comparison.
if (x[rs1] >=s x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
956 957 958 959 960 961 962 963 964 965 966 967 968 | |
name = 'riscv.bge'
class-attribute
instance-attribute
BltuOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 is less than rs2, using unsigned comparison.
if (x[rs1] <u x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
971 972 973 974 975 976 977 978 979 980 981 982 983 | |
name = 'riscv.bltu'
class-attribute
instance-attribute
BgeuOp
dataclass
Bases: RsRsOffIntegerOperation
Take the branch if registers rs1 is greater than or equal to rs2, using unsigned comparison.
if (x[rs1] >=u x[rs2]) pc += sext(offset)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
986 987 988 989 990 991 992 993 994 995 996 997 998 | |
name = 'riscv.bgeu'
class-attribute
instance-attribute
LbOp
dataclass
Bases: RdRsImmIntegerOperation
Loads a 8-bit value from memory and sign-extends this to XLEN bits before storing it in register rd.
x[rd] = sext(M[x[rs1] + sext(offset)][7:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 | |
name = 'riscv.lb'
class-attribute
instance-attribute
LbuOp
dataclass
Bases: RdRsImmIntegerOperation
Loads a 8-bit value from memory and zero-extends this to XLEN bits before storing it in register rd.
x[rd] = M[x[rs1] + sext(offset)][7:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | |
name = 'riscv.lbu'
class-attribute
instance-attribute
LhOp
dataclass
Bases: RdRsImmIntegerOperation
Loads a 16-bit value from memory and sign-extends this to XLEN bits before storing it in register rd.
x[rd] = sext(M[x[rs1] + sext(offset)][15:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 | |
name = 'riscv.lh'
class-attribute
instance-attribute
LhuOp
dataclass
Bases: RdRsImmIntegerOperation
Loads a 16-bit value from memory and zero-extends this to XLEN bits before storing it in register rd.
x[rd] = M[x[rs1] + sext(offset)][15:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 | |
name = 'riscv.lhu'
class-attribute
instance-attribute
LwOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
1070 1071 1072 1073 1074 1075 1076 1077 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
1071 1072 1073 1074 1075 1076 1077 | |
LwOp
dataclass
Bases: RdRsImmIntegerOperation
Loads a 32-bit value from memory and sign-extends this to XLEN bits before storing it in register rd.
x[rd] = sext(M[x[rs1] + sext(offset)][31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 | |
name = 'riscv.lw'
class-attribute
instance-attribute
traits = traits_def(LwOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
1097 1098 1099 1100 1101 1102 1103 1104 | |
SbOp
dataclass
Bases: RsRsImmIntegerOperation
Store 8-bit, values from the low bits of register rs2 to memory.
M[x[rs1] + sext(offset)] = x[rs2][7:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | |
name = 'riscv.sb'
class-attribute
instance-attribute
ShOp
dataclass
Bases: RsRsImmIntegerOperation
Store 16-bit, values from the low bits of register rs2 to memory.
M[x[rs1] + sext(offset)] = x[rs2][15:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 | |
name = 'riscv.sh'
class-attribute
instance-attribute
SwOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
1138 1139 1140 1141 1142 1143 1144 1145 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
1139 1140 1141 1142 1143 1144 1145 | |
SwOp
dataclass
Bases: RsRsImmIntegerOperation
Store 32-bit, values from the low bits of register rs2 to memory.
M[x[rs1] + sext(offset)] = x[rs2][31:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 | |
name = 'riscv.sw'
class-attribute
instance-attribute
traits = traits_def(SwOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
1164 1165 1166 1167 1168 1169 1170 1171 | |
CsrrwOp
dataclass
Bases: CsrReadWriteOperation
Atomically swaps values in the CSRs and integer registers. CSRRW reads the old value of the CSR, zero-extends the value to XLEN bits, then writes it to integer register rd. The initial value in rs1 is written to the CSR. If the 'writeonly' attribute evaluates to False, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read; in this case rd must be allocated to x0.
t = CSRs[csr]; CSRs[csr] = x[rs1]; x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 | |
name = 'riscv.csrrw'
class-attribute
instance-attribute
CsrrsOp
dataclass
Bases: CsrBitwiseOperation
Reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written).
If the 'readonly' attribute evaluates to True, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value back to the CSR and will cause any attendant side effects.
t = CSRs[csr]; CSRs[csr] = t | x[rs1]; x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | |
name = 'riscv.csrrs'
class-attribute
instance-attribute
CsrrcOp
dataclass
Bases: CsrBitwiseOperation
Reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be cleared in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written).
If the 'readonly' attribute evaluates to True, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs. Note that if rs1 specifies a register holding a zero value other than x0, the instruction will still attempt to write the unmodified value back to the CSR and will cause any attendant side effects.
t = CSRs[csr]; CSRs[csr] = t &~x[rs1]; x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 | |
name = 'riscv.csrrc'
class-attribute
instance-attribute
CsrrwiOp
dataclass
Bases: CsrReadWriteImmOperation
Update the CSR using an XLEN-bit value obtained by zero-extending the 'immediate' attribute. If the 'writeonly' attribute evaluates to False, then the instruction shall not read the CSR and shall not cause any of the side effects that might occur on a CSR read; in this case rd must be allocated to x0.
x[rd] = CSRs[csr]; CSRs[csr] = zimm
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 | |
name = 'riscv.csrrwi'
class-attribute
instance-attribute
CsrrsiOp
dataclass
Bases: CsrBitwiseImmOperation
Reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The value in the 'immediate' attribute is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in it will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written).
If the 'immediate' attribute value is zero, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs.
t = CSRs[csr]; CSRs[csr] = t | zimm; x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 | |
name = 'riscv.csrrsi'
class-attribute
instance-attribute
CsrrciOp
dataclass
Bases: CsrBitwiseImmOperation
Reads the value of the CSR, zero-extends the value to XLEN bits, and writes it to integer register rd. The value in the 'immediate' attribute is treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be cleared in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written).
If the 'immediate' attribute value is zero, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs.
t = CSRs[csr]; CSRs[csr] = t &~zimm; x[rd] = t
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 | |
name = 'riscv.csrrci'
class-attribute
instance-attribute
MulOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
1317 1318 1319 1320 1321 1322 1323 1324 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
1318 1319 1320 1321 1322 1323 1324 | |
MulOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs an XLEN-bit × XLEN-bit multiplication of signed rs1 by signed rs2 and places the lower XLEN bits in the destination register. x[rd] = x[rs1] * x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 | |
name = 'riscv.mul'
class-attribute
instance-attribute
traits = traits_def(MulOpHasCanonicalizationPatternsTrait(), Pure())
class-attribute
instance-attribute
MulhOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs an XLEN-bit × XLEN-bit multiplication of signed rs1 by signed rs2 and places the upper XLEN bits in the destination register. x[rd] = (x[rs1] s×s x[rs2]) >>s XLEN
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 | |
name = 'riscv.mulh'
class-attribute
instance-attribute
MulhsuOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs an XLEN-bit × XLEN-bit multiplication of signed rs1 by unsigned rs2 and places the upper XLEN bits in the destination register. x[rd] = (x[rs1] s × x[rs2]) >>s XLEN
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 | |
name = 'riscv.mulhsu'
class-attribute
instance-attribute
MulhuOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs an XLEN-bit × XLEN-bit multiplication of unsigned rs1 by unsigned rs2 and places the upper XLEN bits in the destination register. x[rd] = (x[rs1] u × x[rs2]) >>u XLEN
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 | |
name = 'riscv.mulhu'
class-attribute
instance-attribute
MulwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs an 32-bit × 32-bit multiplication of signed rs1 by signed rs2.
x[rd] = (x[rs1] s × x[rs2]) >>s XLEN
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 | |
name = 'riscv.mulw'
class-attribute
instance-attribute
DivOpHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
1395 1396 1397 1398 1399 1400 1401 1402 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
1396 1397 1398 1399 1400 1401 1402 | |
DivOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an XLEN bits by XLEN bits signed integer division of rs1 by rs2, rounding towards zero. x[rd] = x[rs1] /s x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 | |
name = 'riscv.div'
class-attribute
instance-attribute
traits = traits_def(DivOpHasCanonicalizationPatternsTrait(), Pure())
class-attribute
instance-attribute
DivuOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an XLEN bits by XLEN bits unsigned integer division of rs1 by rs2, rounding towards zero. x[rd] = x[rs1] /u x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 | |
name = 'riscv.divu'
class-attribute
instance-attribute
DivuwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an 32 bits by 32 bits unsigned integer division of rs1 by rs2.
x[rd] = sext(x[rs1][31:0] /u x[rs2][31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 | |
name = 'riscv.divuw'
class-attribute
instance-attribute
DivwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an 32 bits by 32 bits signed integer division of rs1 by rs2.
x[rd] = sext(x[rs1][31:0] /s x[rs2][31:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 | |
name = 'riscv.divw'
class-attribute
instance-attribute
RemOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an XLEN bits by XLEN bits signed integer reminder of rs1 by rs2. x[rd] = x[rs1] %s x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 | |
name = 'riscv.rem'
class-attribute
instance-attribute
RemuOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an XLEN bits by XLEN bits unsigned integer reminder of rs1 by rs2. x[rd] = x[rs1] %u x[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 | |
name = 'riscv.remu'
class-attribute
instance-attribute
RemuwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an 32 bits by 32 bits unsigned integer reminder of rs1 by rs2.
x[rd] = sext(x[rs1][31:0] %u x[rs2][31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 | |
name = 'riscv.remuw'
class-attribute
instance-attribute
RemwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Perform an 32 bits by 32 bits signed integer reminder of rs1 by rs2.
x[rd] = sext(x[rs1][31:0] %s x[rs2][31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 | |
name = 'riscv.remw'
class-attribute
instance-attribute
RolOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs a rotate left of rs1 by the amount in least-significant log2(XLEN) bits of rs2.
let shamt = if xlen == 32
then x[rs2][4..0]
else x[rs2][5..0];
let result = (x[rs1] << shamt) | (x[rs2] >> (xlen - shamt));
x[rd] = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 | |
name = 'riscv.rol'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
RorOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Performs a rotate right of rs1 by the amount in least-significant log2(XLEN) bits of rs2.
let shamt = if xlen == 32
then x[rs2][4..0]
else x[rs2][5..0];
let result = (x[rs1] >> shamt) | (x[rs2] << (xlen - shamt));
x[rd] = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 | |
name = 'riscv.ror'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SextHOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
This instruction sign-extends the least-significant halfword in rs to XLEN by copying the most-significant bit in the halfword (i.e., bit 15) to all of the more-significant bits.
x[rd] = EXTS(x[rs][15..0]);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 | |
name = 'riscv.sext.h'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
ZextHOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
This instruction zero-extends the least-significant halfword of the source to XLEN by inserting 0’s into all of the bits more significant than 15.
x[rd] = EXTZ(x[rs][15..0]);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 | |
name = 'riscv.zext.h'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SextBOp
dataclass
Bases: RdRsIntegerOperation[IntRegisterType]
This instruction sign-extends the least-significant byte in the source to XLEN by copying the most-significant bit in the byte (i.e., bit 7) to all of the more-significant bits.
X[rd] = EXTS(X[rs][7..0]);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 | |
name = 'riscv.sext.b'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BclrOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns rs1 with a single bit cleared at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
let index = X(rs2) & (XLEN - 1);
X(rd) = X(rs1) & ~(1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 | |
name = 'riscv.bclr'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BclrIOp
dataclass
Bases: RdRsImmShiftOperation
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.
let index = shamt & (XLEN - 1);
X(rd) = X(rs1) & ~(1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 | |
name = 'riscv.bclri'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BextOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns a single bit extracted from rs1 at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
let index = X(rs2) & (XLEN - 1);
X(rd) = (X(rs1) >> index) & 1;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 | |
name = 'riscv.bext'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BextIOp
dataclass
Bases: RdRsImmShiftOperation
This instruction returns a single bit extracted from rs1 at the index specified in rs2. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
let index = shamt & (XLEN - 1);
X(rd) = (X(rs1) >> index) & 1;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 | |
name = 'riscv.bexti'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BinvOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
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.
let index = shamt & (XLEN - 1);
X(rd) = X(rs1) ^ (1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 | |
name = 'riscv.binv'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BinvIOp
dataclass
Bases: RdRsImmShiftOperation
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.
let index = shamt & (XLEN - 1);
x[rd] = x[rs1] & ~(1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 | |
name = 'riscv.binvi'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BsetOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns rs1 with a single bit set at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
let index = X(rs2) & (XLEN - 1);
X(rd) = X(rs1) | (1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 | |
name = 'riscv.bset'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
BsetIOp
dataclass
Bases: RdRsImmShiftOperation
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.
let index = shamt & (XLEN - 1);
x[rd] = x[rs1] | (1 << index)
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 | |
name = 'riscv.bseti'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
RolwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs a rotate left on the least-significant word of rs1 by the amount in least-significant 5 bits of rs2. The resulting word value is sign-extended by copying bit 31 to all of the more-significant bits.
let rs1 = EXTZ(X(rs1)[31..0])
let shamt = X(rs2)[4..0];
let result = (rs1 << shamt) | (rs1 >> (32 - shamt));
X(rd) = EXTS(result);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 | |
name = 'riscv.rolw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
RorwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs a rotate right on the least-significant word of rs1 by the amount in least-significant 5 bits of rs2. The resultant word is sign-extended by copying bit 31 to all of the more-significant bits.
let rs1 = EXTZ(X(rs1)[31..0])
let shamt = X(rs2)[4..0];
let result = (rs1 >> shamt) | (rs1 << (32 - shamt));
X(rd) = EXTS(result);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 | |
name = 'riscv.rorw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
RoriOp
dataclass
Bases: RdRsImmShiftOperation
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.
let shamt = if xlen == 32
then shamt[4..0]
else shamt[5..0];
let result = (X(rs1) >> shamt) | (X(rs2) << (xlen - shamt));
X(rd) = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 | |
name = 'riscv.rori'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
RoriwOp
dataclass
Bases: RdRsImmShiftOperation
This instruction performs a rotate right on the least-significant word of rs1 by the amount in the least-significant log2(XLEN) bits of shamt. The resulting word value is sign-extended by copying bit 31 to all of the more-significant bits.
let rs1 = EXTZ(X(rs1)[31..0];
let result = (rs1 >> shamt[4..0]) | (X(rs1) << (32 - shamt[4..0]));
X(rd) = EXTS(result[31..0]);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 | |
name = 'riscv.roriw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
AddUwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs an XLEN-wide addition between rs2 and the zero-extended least-significant word of rs1.
let base = X(rs2);
let index = EXTZ(X(rs1)[31..0]);
X(rd) = base + index;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 | |
name = 'riscv.add.uw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh1addOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction shifts rs1 to the left by 1 bit and adds it to rs2.
X(rd) = X(rs2) + (X(rs1) << 1);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 | |
name = 'riscv.sh1add'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh2addOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction shifts rs1 to the left by 2 places and adds it to rs2.
X(rd) = X(rs2) + (X(rs1) << 2);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 | |
name = 'riscv.sh2add'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh3addOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction shifts rs1 to the left by 2 places and adds it to rs2.
X(rd) = X(rs2) + (X(rs1) << 3);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 | |
name = 'riscv.sh3add'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh1addUwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 1 place.
let base = x[rs2];
let index = EXTZ(x[rs1][31..0]);
x[rd] = base + (index << 1);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 | |
name = 'riscv.sh1add.uw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh2addUwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 2 places.
let base = x[rs2];
let index = EXTZ(x[rs1][31..0]);
x[rd] = base + (index << 2);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 | |
name = 'riscv.sh2add.uw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
Sh3addUwOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 3 places.
let base = x[rs2];
let index = EXTZ(x[rs1][31..0]);
x[rd] = base + (index << 3);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 | |
name = 'riscv.sh3add.uw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
SlliUwOp
dataclass
Bases: RdRsImmShiftOperation
This instruction takes the least-significant word of rs1, zero-extends it, and shifts it left by the immediate.
x[rd] = (EXTZ(x[rs][31..0]) << shamt);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 | |
name = 'riscv.slli.uw'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
AndnOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs the bitwise logical AND operation between rs1 and the bitwise inversion of rs2.
X(rd) = X(rs1) & ~X(rs2);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 | |
name = 'riscv.andn'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
OrnOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs the bitwise logical OR operation between rs1 and the bitwise inversion of rs2.
X(rd) = X(rs1) | ~X(rs2);
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 | |
name = 'riscv.orn'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
XnorOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction performs the bit-wise exclusive-NOR operation on rs1 and rs2.
X(rd) = ~(X(rs1) ^ X(rs2));
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 | |
name = 'riscv.xnor'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
MaxOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns the larger of two signed integers.
let rs1_val = X(rs1);
let rs2_val = X(rs2);
let result = if rs1_val <_s rs2_val
then rs2_val
else rs1_val;
X(rd) = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | |
name = 'riscv.max'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
MaxUOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns the larger of two unsigned integers.
let rs1_val = X(rs1);
let rs2_val = X(rs2);
let result = if rs1_val <_u rs2_val
then rs2_val
else rs1_val;
X(rd) = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 | |
name = 'riscv.maxu'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
MinOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns the smaller of two signed integers.
let rs1_val = X(rs1);
let rs2_val = X(rs2);
let result = if rs1_val <_s rs2_val
then rs1_val
else rs2_val;
X(rd) = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 | |
name = 'riscv.min'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
MinUOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
This instruction returns the smaller of two unsigned integers.
let rs1_val = X(rs1);
let rs2_val = X(rs2);
let result = if rs1_val <_u rs2_val
then rs1_val
else rs2_val;
X(rd) = result;
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 | |
name = 'riscv.minu'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
CZeroEqzOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Moves zero to a register rd, if the condition rs2 is equal to zero, otherwise moves rs1 to rd.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2092 2093 2094 2095 2096 2097 2098 2099 2100 | |
name = 'riscv.czero.eqz'
class-attribute
instance-attribute
CZeroNezOp
dataclass
Bases: RdRsRsIntegerOperation[IntRegisterType, IntRegisterType]
Moves zero to a register rd, if the condition rs2 is nonzero, otherwise moves rs1 to rd.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2103 2104 2105 2106 2107 2108 2109 2110 2111 | |
name = 'riscv.czero.nez'
class-attribute
instance-attribute
LiOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
2120 2121 2122 2123 2124 2125 2126 2127 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2121 2122 2123 2124 2125 2126 2127 | |
LiOp
Bases: RISCVCustomFormatOperation, RISCVInstruction, ConstantLikeInterface
Loads a 32-bit immediate into rd.
This is an assembler pseudo-instruction.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 | |
name = 'riscv.li'
class-attribute
instance-attribute
rd = result_def(IntRegisterType)
class-attribute
instance-attribute
immediate = attr_def(IntegerAttr[I32] | LabelAttr)
class-attribute
instance-attribute
traits = traits_def(Pure(), LiOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
__init__(immediate: int | IntegerAttr[I32] | str | LabelAttr, *, rd: IntRegisterType = Registers.UNALLOCATED_INT, comment: str | StringAttr | None = None)
Source code in xdsl/dialects/riscv/ops.py
2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 | |
assembly_line_args() -> tuple[AssemblyInstructionArg, ...]
Source code in xdsl/dialects/riscv/ops.py
2169 2170 | |
get_constant_value()
Source code in xdsl/dialects/riscv/ops.py
2172 2173 | |
custom_parse_attributes(parser: Parser) -> dict[str, Attribute]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2175 2176 2177 2178 2179 | |
custom_print_attributes(printer: Printer) -> AbstractSet[str]
Source code in xdsl/dialects/riscv/ops.py
2181 2182 2183 2184 | |
parse_op_type(parser: Parser) -> tuple[Sequence[Attribute], Sequence[Attribute]]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2186 2187 2188 2189 2190 2191 2192 | |
print_op_type(printer: Printer) -> None
Source code in xdsl/dialects/riscv/ops.py
2194 2195 2196 | |
EcallOp
dataclass
Bases: NullaryOperation
The ECALL instruction is used to make a request to the supporting execution environment, which is usually an operating system. The ABI for the system will define how parameters for the environment request are passed, but usually these will be in defined locations in the integer register file.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 | |
name = 'riscv.ecall'
class-attribute
instance-attribute
LabelOp
Bases: RISCVCustomFormatOperation, RISCVAsmOperation, RISCVRegallocOperation
The label operation is used to emit text labels (e.g. loop:) that are used as branch, unconditional jump targets and symbol offsets.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 | |
name = 'riscv.label'
class-attribute
instance-attribute
label = attr_def(LabelAttr)
class-attribute
instance-attribute
comment = opt_attr_def(StringAttr)
class-attribute
instance-attribute
__init__(label: str | LabelAttr, *, comment: str | StringAttr | None = None)
Source code in xdsl/dialects/riscv/ops.py
2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 | |
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
2245 2246 | |
custom_parse_attributes(parser: Parser) -> dict[str, Attribute]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2248 2249 2250 2251 2252 | |
custom_print_attributes(printer: Printer) -> AbstractSet[str]
Source code in xdsl/dialects/riscv/ops.py
2254 2255 2256 2257 | |
print_op_type(printer: Printer) -> None
Source code in xdsl/dialects/riscv/ops.py
2259 2260 | |
parse_op_type(parser: Parser) -> tuple[Sequence[Attribute], Sequence[Attribute]]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2262 2263 2264 2265 2266 | |
DirectiveOp
Bases: RISCVCustomFormatOperation, RISCVAsmOperation, RISCVRegallocOperation
The directive operation is used to emit assembler directives (e.g. .word; .equ; etc.) without any associated region of assembly code. A more complete list of directives can be found here:
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 | |
name = 'riscv.directive'
class-attribute
instance-attribute
directive = attr_def(StringAttr)
class-attribute
instance-attribute
value = opt_attr_def(StringAttr)
class-attribute
instance-attribute
__init__(directive: str | StringAttr, value: str | StringAttr | None)
Source code in xdsl/dialects/riscv/ops.py
2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 | |
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
2302 2303 2304 2305 2306 2307 2308 2309 2310 | |
custom_parse_attributes(parser: Parser) -> dict[str, Attribute]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2312 2313 2314 2315 2316 2317 2318 2319 2320 | |
custom_print_attributes(printer: Printer) -> AbstractSet[str]
Source code in xdsl/dialects/riscv/ops.py
2322 2323 2324 2325 2326 2327 2328 | |
print_op_type(printer: Printer) -> None
Source code in xdsl/dialects/riscv/ops.py
2330 2331 | |
parse_op_type(parser: Parser) -> tuple[Sequence[Attribute], Sequence[Attribute]]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2333 2334 2335 2336 2337 | |
AssemblySectionOp
Bases: IRDLOperation, AssemblyPrintable
The directive operation is used to emit assembler directives (e.g. .text; .data; etc.) with the scope of a section.
A more complete list of directives can be found here:
See external documentation.
This operation can have nested operations, corresponding to a section of the assembly.
Source code in xdsl/dialects/riscv/ops.py
2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 | |
name = 'riscv.assembly_section'
class-attribute
instance-attribute
directive = attr_def(StringAttr)
class-attribute
instance-attribute
data = region_def('single_block')
class-attribute
instance-attribute
traits = traits_def(NoTerminator(), IsolatedFromAbove())
class-attribute
instance-attribute
__init__(directive: str | StringAttr, region: Region | None = None)
Source code in xdsl/dialects/riscv/ops.py
2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 | |
parse(parser: Parser) -> AssemblySectionOp
classmethod
Source code in xdsl/dialects/riscv/ops.py
2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 | |
print(printer: Printer) -> None
Source code in xdsl/dialects/riscv/ops.py
2390 2391 2392 2393 2394 2395 2396 2397 2398 | |
print_assembly(printer: AssemblyPrinter) -> None
Source code in xdsl/dialects/riscv/ops.py
2400 2401 | |
CustomAssemblyInstructionOp
Bases: RISCVCustomFormatOperation, RISCVInstruction
An instruction with unspecified semantics, that can be printed during assembly emission.
During assembly emission, the results are printed before the operands:
s0 = riscv.GetRegisterOp(Registers.s0).res
s1 = riscv.GetRegisterOp(Registers.s1).res
rs2 = riscv.Registers.s2
rs3 = riscv.Registers.s3
op = CustomAssemblyInstructionOp("my_instr", (s0, s1), (rs2, rs3))
op.assembly_line() # "my_instr s2, s3, s0, s1"
Source code in xdsl/dialects/riscv/ops.py
2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 | |
name = 'riscv.custom_assembly_instruction'
class-attribute
instance-attribute
inputs = var_operand_def()
class-attribute
instance-attribute
outputs = var_result_def()
class-attribute
instance-attribute
instruction_name = attr_def(StringAttr)
class-attribute
instance-attribute
comment = opt_attr_def(StringAttr)
class-attribute
instance-attribute
__init__(instruction_name: str | StringAttr, inputs: Sequence[SSAValue], result_types: Sequence[Attribute], *, comment: str | StringAttr | None = None)
Source code in xdsl/dialects/riscv/ops.py
2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 | |
assembly_instruction_name() -> str
Source code in xdsl/dialects/riscv/ops.py
2451 2452 | |
assembly_line_args() -> tuple[AssemblyInstructionArg, ...]
Source code in xdsl/dialects/riscv/ops.py
2454 2455 | |
CommentOp
Bases: RISCVCustomFormatOperation, RISCVAsmOperation, RISCVRegallocOperation
Source code in xdsl/dialects/riscv/ops.py
2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 | |
name = 'riscv.comment'
class-attribute
instance-attribute
comment = attr_def(StringAttr)
class-attribute
instance-attribute
__init__(comment: str | StringAttr)
Source code in xdsl/dialects/riscv/ops.py
2463 2464 2465 2466 2467 2468 2469 2470 2471 | |
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
2473 2474 | |
EbreakOp
dataclass
Bases: NullaryOperation
The EBREAK instruction is used by debuggers to cause control to be transferred back to a debugging environment.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 | |
name = 'riscv.ebreak'
class-attribute
instance-attribute
WfiOp
dataclass
Bases: NullaryOperation
The Wait for Interrupt instruction (WFI) provides a hint to the implementation that the current hart can be stalled until an interrupt might need servicing.
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 | |
name = 'riscv.wfi'
class-attribute
instance-attribute
GetRegisterOp
dataclass
Bases: GetAnyRegisterOperation[IntRegisterType]
Source code in xdsl/dialects/riscv/ops.py
2507 2508 2509 | |
name = 'riscv.get_register'
class-attribute
instance-attribute
GetFloatRegisterOp
dataclass
Bases: GetAnyRegisterOperation[FloatRegisterType]
Source code in xdsl/dialects/riscv/ops.py
2512 2513 2514 | |
name = 'riscv.get_float_register'
class-attribute
instance-attribute
ParallelMovOp
Bases: RISCVRegallocOperation
Source code in xdsl/dialects/riscv/ops.py
2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 | |
name = 'riscv.parallel_mov'
class-attribute
instance-attribute
inputs = var_operand_def(RangeOf(RISCVRegisterType).of_length(_L))
class-attribute
instance-attribute
outputs: VarOpResult[RISCVRegisterType] = var_result_def(RangeOf(RISCVRegisterType).of_length(_L))
class-attribute
instance-attribute
input_widths = prop_def(DenseArrayBase.constr(i32))
class-attribute
instance-attribute
free_registers = opt_prop_def(ArrayAttr[RISCVRegisterType])
class-attribute
instance-attribute
assembly_format = '$inputs $input_widths attr-dict `:` functional-type($inputs, $outputs)'
class-attribute
instance-attribute
irdl_options = (ParsePropInAttrDict(),)
class-attribute
instance-attribute
__init__(inputs: Sequence[SSAValue], outputs: Sequence[RISCVRegisterType], input_widths: DenseArrayBase[I32], free_registers: ArrayAttr[RISCVRegisterType] | None = None)
Source code in xdsl/dialects/riscv/ops.py
2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 | |
verify_() -> None
Source code in xdsl/dialects/riscv/ops.py
2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 | |
FMAddSOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform single-precision fused multiply addition.
f[rd] = f[rs1]×f[rs2]+f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 | |
name = 'riscv.fmadd.s'
class-attribute
instance-attribute
FMSubSOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform single-precision fused multiply substraction.
f[rd] = f[rs1]×f[rs2]+f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 | |
name = 'riscv.fmsub.s'
class-attribute
instance-attribute
FNMSubSOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform single-precision fused multiply substraction.
f[rd] = -f[rs1]×f[rs2]+f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 | |
name = 'riscv.fnmsub.s'
class-attribute
instance-attribute
FNMAddSOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform single-precision fused multiply addition.
f[rd] = -f[rs1]×f[rs2]-f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 | |
name = 'riscv.fnmadd.s'
class-attribute
instance-attribute
FAddSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform single-precision floating-point addition.
f[rd] = f[rs1]+f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 | |
name = 'riscv.fadd.s'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FSubSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform single-precision floating-point substraction.
f[rd] = f[rs1]-f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 | |
name = 'riscv.fsub.s'
class-attribute
instance-attribute
FMulSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform single-precision floating-point multiplication.
f[rd] = f[rs1]×f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 | |
name = 'riscv.fmul.s'
class-attribute
instance-attribute
FDivSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform single-precision floating-point division.
f[rd] = f[rs1] / f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 | |
name = 'riscv.fdiv.s'
class-attribute
instance-attribute
FSqrtSOp
dataclass
Bases: RdRsFloatOperation[FloatRegisterType]
Perform single-precision floating-point square root.
f[rd] = sqrt(f[rs1])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 | |
name = 'riscv.fsqrt.s'
class-attribute
instance-attribute
FSgnJSOp
dataclass
Bases: RdRsRsFloatOperation[FloatRegisterType, FloatRegisterType]
Produce a result that takes all bits except the sign bit from rs1. The result’s sign bit is rs2’s sign bit.
f[rd] = {f[rs2][31], f[rs1][30:0]}
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 | |
name = 'riscv.fsgnj.s'
class-attribute
instance-attribute
FSgnJNSOp
dataclass
Bases: RdRsRsFloatOperation[FloatRegisterType, FloatRegisterType]
Produce a result that takes all bits except the sign bit from rs1. The result’s sign bit is opposite of rs2’s sign bit.
f[rd] = {~f[rs2][31], f[rs1][30:0]}
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 | |
name = 'riscv.fsgnjn.s'
class-attribute
instance-attribute
FSgnJXSOp
dataclass
Bases: RdRsRsFloatOperation[FloatRegisterType, FloatRegisterType]
Produce a result that takes all bits except the sign bit from rs1. The result’s sign bit is XOR of sign bit of rs1 and rs2.
f[rd] = {f[rs1][31] ^ f[rs2][31], f[rs1][30:0]}
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 | |
name = 'riscv.fsgnjx.s'
class-attribute
instance-attribute
FMinSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Write the smaller of single precision data in rs1 and rs2 to rd.
f[rd] = min(f[rs1], f[rs2])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 | |
name = 'riscv.fmin.s'
class-attribute
instance-attribute
FMaxSOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Write the larger of single precision data in rs1 and rs2 to rd.
f[rd] = max(f[rs1], f[rs2])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 | |
name = 'riscv.fmax.s'
class-attribute
instance-attribute
FCvtWSOp
dataclass
Bases: RdRsIntegerOperation[FloatRegisterType]
Convert a floating-point number in floating-point register rs1 to a signed 32-bit in integer register rd.
x[rd] = sext(s32_{f32}(f[rs1]))
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 | |
name = 'riscv.fcvt.w.s'
class-attribute
instance-attribute
FCvtWuSOp
dataclass
Bases: RdRsIntegerOperation[FloatRegisterType]
Convert a floating-point number in floating-point register rs1 to a signed 32-bit in unsigned integer register rd.
x[rd] = sext(u32_{f32}(f[rs1]))
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 | |
name = 'riscv.fcvt.wu.s'
class-attribute
instance-attribute
FMvXWOp
dataclass
Bases: RdRsIntegerOperation[FloatRegisterType]
Move the single-precision value in floating-point register rs1 represented in IEEE 754-2008 encoding to the lower 32 bits of integer register rd.
x[rd] = sext(f[rs1][31:0])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 | |
name = 'riscv.fmv.x.w'
class-attribute
instance-attribute
FeqSOp
dataclass
Bases: RdRsRsFloatFloatIntegerOperationWithFastMath
Performs a quiet equal comparison between floating-point registers rs1 and rs2 and record the Boolean result in integer register rd. Only signaling NaN inputs cause an Invalid Operation exception. The result is 0 if either operand is NaN.
x[rd] = f[rs1] == f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 | |
name = 'riscv.feq.s'
class-attribute
instance-attribute
FltSOp
dataclass
Bases: RdRsRsFloatFloatIntegerOperationWithFastMath
Performs a quiet less comparison between floating-point registers rs1 and rs2 and record the Boolean result in integer register rd. Only signaling NaN inputs cause an Invalid Operation exception. The result is 0 if either operand is NaN.
x[rd] = f[rs1] < f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 | |
name = 'riscv.flt.s'
class-attribute
instance-attribute
FleSOp
dataclass
Bases: RdRsRsFloatFloatIntegerOperationWithFastMath
Performs a quiet less or equal comparison between floating-point registers rs1 and rs2 and record the Boolean result in integer register rd. Only signaling NaN inputs cause an Invalid Operation exception. The result is 0 if either operand is NaN.
x[rd] = f[rs1] <= f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 | |
name = 'riscv.fle.s'
class-attribute
instance-attribute
FClassSOp
dataclass
Bases: RdRsIntegerOperation[FloatRegisterType]
Examines the value in floating-point register rs1 and writes to integer register rd a 10-bit mask that indicates the class of the floating-point number. The format of the mask is described in [classify table]_. The corresponding bit in rd will be set if the property is true and clear otherwise. All other bits in rd are cleared. Note that exactly one bit in rd will be set.
x[rd] = classifys(f[rs1])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 | |
name = 'riscv.fclass.s'
class-attribute
instance-attribute
FCvtSWOp
dataclass
Bases: RdRsFloatOperation[IntRegisterType]
Converts a 32-bit signed integer, in integer register rs1 into a floating-point number in floating-point register rd.
f[rd] = f32_{s32}(x[rs1])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 | |
name = 'riscv.fcvt.s.w'
class-attribute
instance-attribute
FCvtSWuOp
dataclass
Bases: RdRsFloatOperation[IntRegisterType]
Converts a 32-bit unsigned integer, in integer register rs1 into a floating-point number in floating-point register rd.
f[rd] = f32_{u32}(x[rs1])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 | |
name = 'riscv.fcvt.s.wu'
class-attribute
instance-attribute
FMvWXOp
dataclass
Bases: RdRsFloatOperation[IntRegisterType]
Move the single-precision value encoded in IEEE 754-2008 standard encoding from the lower 32 bits of integer register rs1 to the floating-point register rd.
f[rd] = x[rs1][31:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 | |
name = 'riscv.fmv.w.x'
class-attribute
instance-attribute
FLwOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
2949 2950 2951 2952 2953 2954 2955 2956 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2950 2951 2952 2953 2954 2955 2956 | |
FLwOp
dataclass
Bases: RdRsImmFloatOperation
Load a single-precision value from memory into floating-point register rd.
f[rd] = M[x[rs1] + sext(offset)][31:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 | |
name = 'riscv.flw'
class-attribute
instance-attribute
traits = traits_def(FLwOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
2975 2976 2977 2978 2979 2980 2981 2982 | |
FSwOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
2985 2986 2987 2988 2989 2990 2991 2992 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
2986 2987 2988 2989 2990 2991 2992 | |
FSwOp
dataclass
Bases: RsRsImmFloatOperation
Store a single-precision value from floating-point register rs2 to memory.
M[x[rs1] + offset] = f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 | |
name = 'riscv.fsw'
class-attribute
instance-attribute
traits = traits_def(FSwOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
3009 3010 3011 3012 3013 3014 3015 3016 | |
FMAddDOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform double-precision fused multiply addition.
f[rd] = f[rs1]×f[rs2]+f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 | |
name = 'riscv.fmadd.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FMSubDOp
dataclass
Bases: RdRsRsRsFloatOperation
Perform double-precision fused multiply substraction.
f[rd] = f[rs1]×f[rs2]+f[rs3]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 | |
name = 'riscv.fmsub.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FuseMultiplyAddDCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
3054 3055 3056 3057 3058 3059 3060 3061 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
3055 3056 3057 3058 3059 3060 3061 | |
FAddDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform double-precision floating-point addition.
f[rd] = f[rs1]+f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 | |
name = 'riscv.fadd.d'
class-attribute
instance-attribute
traits = traits_def(Pure(), FuseMultiplyAddDCanonicalizationPatternTrait())
class-attribute
instance-attribute
FSubDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform double-precision floating-point substraction.
f[rd] = f[rs1]-f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 | |
name = 'riscv.fsub.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FMulDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform double-precision floating-point multiplication.
f[rd] = f[rs1]×f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 | |
name = 'riscv.fmul.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FDivDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Perform double-precision floating-point division.
f[rd] = f[rs1] / f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 | |
name = 'riscv.fdiv.d'
class-attribute
instance-attribute
FLdOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
3125 3126 3127 3128 3129 3130 3131 3132 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
3126 3127 3128 3129 3130 3131 3132 | |
FMinDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Write the smaller of double precision data in rs1 and rs2 to rd.
f[rd] = min(f[rs1], f[rs2])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 | |
name = 'riscv.fmin.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FMaxDOp
dataclass
Bases: RdRsRsFloatOperationWithFastMath
Write the larger of single precision data in rs1 and rs2 to rd.
f[rd] = max(f[rs1], f[rs2])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 | |
name = 'riscv.fmax.d'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FCvtDWOp
dataclass
Bases: RdRsFloatOperation[IntRegisterType]
Converts a 32-bit signed integer, in integer register rs1 into a double-precision floating-point number in floating-point register rd.
x[rd] = sext(s32_{f64}(f[rs1]))
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 | |
name = 'riscv.fcvt.d.w'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FCvtDWuOp
dataclass
Bases: RdRsFloatOperation[IntRegisterType]
Converts a 32-bit unsigned integer, in integer register rs1 into a double-precision floating-point number in floating-point register rd.
f[rd] = f64_{u32}(x[rs1])
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 | |
name = 'riscv.fcvt.d.wu'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
FLdOp
dataclass
Bases: RdRsImmFloatOperation
Load a double-precision value from memory into floating-point register rd.
f[rd] = M[x[rs1] + sext(offset)][63:0]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 | |
name = 'riscv.fld'
class-attribute
instance-attribute
traits = traits_def(FLdOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 | |
FSdOpHasCanonicalizationPatternTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
3228 3229 3230 3231 3232 3233 3234 3235 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
3229 3230 3231 3232 3233 3234 3235 | |
FSdOp
dataclass
Bases: RsRsImmFloatOperation
Store a double-precision value from floating-point register rs2 to memory.
M[x[rs1] + offset] = f[rs2]
See external documentation.
Source code in xdsl/dialects/riscv/ops.py
3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 | |
name = 'riscv.fsd'
class-attribute
instance-attribute
traits = traits_def(FSdOpHasCanonicalizationPatternTrait())
class-attribute
instance-attribute
assembly_line() -> str | None
Source code in xdsl/dialects/riscv/ops.py
3252 3253 3254 3255 3256 3257 3258 3259 | |
FMvDHasCanonicalizationPatternsTrait
dataclass
Bases: HasCanonicalizationPatternsTrait
Source code in xdsl/dialects/riscv/ops.py
3262 3263 3264 3265 3266 3267 | |
get_canonicalization_patterns() -> tuple[RewritePattern, ...]
classmethod
Source code in xdsl/dialects/riscv/ops.py
3263 3264 3265 3266 3267 | |
FMvDOp
dataclass
Bases: RdRsFloatOperation[FloatRegisterType]
A pseudo instruction to copy 64 bits of one float register to another.
Equivalent to fsgnj.d rd, rs, rs.
Source code in xdsl/dialects/riscv/ops.py
3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 | |
name = 'riscv.fmv.d'
class-attribute
instance-attribute
traits = traits_def(Pure(), FMvDHasCanonicalizationPatternsTrait())
class-attribute
instance-attribute
VFAddSOp
dataclass
Bases: RdRsRsFloatOperation[FloatRegisterType, FloatRegisterType]
Perform a pointwise single-precision floating-point addition over vectors.
If the registers used are FloatRegisterType, they must be 64-bit wide, and contain two 32-bit single-precision floating point values.
Source code in xdsl/dialects/riscv/ops.py
3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 | |
name = 'riscv.vfadd.s'
class-attribute
instance-attribute
traits = traits_def(Pure())
class-attribute
instance-attribute
VFMulSOp
dataclass
Bases: RdRsRsFloatOperation[FloatRegisterType, FloatRegisterType]
Perform a pointwise single-precision floating-point multiplication over vectors.
If the registers used are FloatRegisterType, they must be 64-bit wide, and contain two 32-bit single-precision floating point values.
Source code in xdsl/dialects/riscv/ops.py
3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 | |