Convert arith to riscv
convert_arith_to_riscv
RdRsRsIntegerOperation = riscv.RdRsRsOperation[riscv.IntRegisterType, riscv.IntRegisterType, riscv.IntRegisterType]
module-attribute
RdRsRsFloatOperation = riscv.RdRsRsOperation[riscv.FloatRegisterType, riscv.FloatRegisterType, riscv.FloatRegisterType]
module-attribute
lower_arith_addi = LowerBinaryIntegerOp(arith.AddiOp, riscv.AddOp)
module-attribute
lower_arith_subi = LowerBinaryIntegerOp(arith.SubiOp, riscv.SubOp)
module-attribute
lower_arith_muli = LowerBinaryIntegerOp(arith.MuliOp, riscv.MulOp)
module-attribute
lower_arith_divui = LowerBinaryIntegerOp(arith.DivUIOp, riscv.DivuOp)
module-attribute
lower_arith_divsi = LowerBinaryIntegerOp(arith.DivSIOp, riscv.DivOp)
module-attribute
lower_arith_remui = LowerBinaryIntegerOp(arith.RemUIOp, riscv.RemuOp)
module-attribute
lower_arith_remsi = LowerBinaryIntegerOp(arith.RemSIOp, riscv.RemOp)
module-attribute
lower_arith_andi = LowerBinaryIntegerOp(arith.AndIOp, riscv.AndOp)
module-attribute
lower_arith_ori = LowerBinaryIntegerOp(arith.OrIOp, riscv.OrOp)
module-attribute
lower_arith_xori = LowerBinaryIntegerOp(arith.XOrIOp, riscv.XorOp)
module-attribute
lower_arith_shli = LowerBinaryIntegerOp(arith.ShLIOp, riscv.SllOp)
module-attribute
lower_arith_shrui = LowerBinaryIntegerOp(arith.ShRUIOp, riscv.SrlOp)
module-attribute
lower_arith_shrsi = LowerBinaryIntegerOp(arith.ShRSIOp, riscv.SraOp)
module-attribute
lower_arith_addf = LowerBinaryFloatOp(arith.AddfOp, riscv.FAddSOp, riscv.FAddDOp)
module-attribute
lower_arith_subf = LowerBinaryFloatOp(arith.SubfOp, riscv.FSubSOp, riscv.FSubDOp)
module-attribute
lower_arith_mulf = LowerBinaryFloatOp(arith.MulfOp, riscv.FMulSOp, riscv.FMulDOp)
module-attribute
lower_arith_divf = LowerBinaryFloatOp(arith.DivfOp, riscv.FDivSOp, riscv.FDivDOp)
module-attribute
lower_arith_minf = LowerBinaryFloatOp(arith.MinimumfOp, riscv.FMinSOp, riscv.FMinDOp)
module-attribute
lower_arith_maxf = LowerBinaryFloatOp(arith.MaximumfOp, riscv.FMaxSOp, riscv.FMaxDOp)
module-attribute
LowerArithConstant
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
match_and_rewrite(op: arith.ConstantOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
LowerArithIndexCast
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
136 137 138 139 140 141 142 143 144 145 146 147 | |
match_and_rewrite(op: arith.IndexCastOp, rewriter: PatternRewriter) -> None
On a RV32 triple, the index type is 32 bits, so we can just drop the cast.
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
137 138 139 140 141 142 143 144 145 146 147 | |
LowerBinaryIntegerOp
dataclass
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
arith_op_cls: type[arith.SignlessIntegerBinaryOperation]
instance-attribute
riscv_op_cls: type[RdRsRsIntegerOperation]
instance-attribute
__init__(arith_op_cls: type[arith.SignlessIntegerBinaryOperation], riscv_op_cls: type[RdRsRsIntegerOperation]) -> None
match_and_rewrite(op: Operation, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
164 165 166 167 168 169 170 171 172 173 | |
LowerBinaryFloatOp
dataclass
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
arith_op_cls: type[arith.FloatingPointLikeBinaryOperation]
instance-attribute
riscv_f_op_cls: type[riscv.RdRsRsFloatOperationWithFastMath]
instance-attribute
riscv_d_op_cls: type[riscv.RdRsRsFloatOperationWithFastMath]
instance-attribute
__init__(arith_op_cls: type[arith.FloatingPointLikeBinaryOperation], riscv_f_op_cls: type[riscv.RdRsRsFloatOperationWithFastMath], riscv_d_op_cls: type[riscv.RdRsRsFloatOperationWithFastMath]) -> None
match_and_rewrite(op: Operation, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
LowerArithFloorDivSI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
211 212 213 214 215 216 | |
match_and_rewrite(op: arith.FloorDivSIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
212 213 214 215 216 | |
LowerArithCeilDivSI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
219 220 221 222 223 224 | |
match_and_rewrite(op: arith.CeilDivSIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
220 221 222 223 224 | |
LowerArithCeilDivUI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
227 228 229 230 231 232 | |
match_and_rewrite(op: arith.CeilDivUIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
228 229 230 231 232 | |
LowerArithMinSI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
239 240 241 242 | |
match_and_rewrite(op: arith.MinSIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
240 241 242 | |
LowerArithMaxSI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
245 246 247 248 | |
match_and_rewrite(op: arith.MaxSIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
246 247 248 | |
LowerArithMinUI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
251 252 253 254 | |
match_and_rewrite(op: arith.MinUIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
252 253 254 | |
LowerArithMaxUI
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
257 258 259 260 | |
match_and_rewrite(op: arith.MaxUIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
258 259 260 | |
LowerArithCmpi
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
match_and_rewrite(op: arith.CmpiOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
LowerArithSelect
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
310 311 312 313 | |
match_and_rewrite(op: arith.SelectOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
311 312 313 | |
LowerArithNegf
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
332 333 334 335 336 337 338 339 340 341 342 343 344 | |
match_and_rewrite(op: arith.NegfOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
333 334 335 336 337 338 339 340 341 342 343 344 | |
LowerArithCmpf
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
match_and_rewrite(op: arith.CmpfOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |
LowerArithSIToFPOp
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | |
match_and_rewrite(op: arith.SIToFPOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | |
LowerArithFPToSIOp
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
461 462 463 464 465 466 467 468 469 470 471 472 473 | |
match_and_rewrite(op: arith.FPToSIOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
462 463 464 465 466 467 468 469 470 471 472 473 | |
LowerArithExtFOp
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
476 477 478 479 | |
match_and_rewrite(op: arith.ExtFOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
477 478 479 | |
LowerArithTruncFOp
Bases: RewritePattern
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
482 483 484 485 | |
match_and_rewrite(op: arith.TruncFOp, rewriter: PatternRewriter) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
483 484 485 | |
ConvertArithToRiscvPass
dataclass
Bases: ModulePass
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | |
name = 'convert-arith-to-riscv'
class-attribute
instance-attribute
apply(ctx: Context, op: ModuleOp) -> None
Source code in xdsl/backend/riscv/lowering/convert_arith_to_riscv.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 | |