afonso360 opened PR #7480 from afonso360:riscv-add-sub
to bytecodealliance:main
:
:wave: Hey,
This PR does two small instruction selection and encoding optimizations.
Use
addi
for subsThis is one of the regressions that showed up in #7468. That PR changes
iadd_imm(x, -k)
toisub(x, iconst(k))
. We can use the sameiadd
instruction for both, but we didn't have a rule to do it.So we now try to negate an Imm12 and if we are able to do that we emit an
addi
when subtracting.Try to swap registers when encoding compressed instructions for commutative operations
This is pretty much the same as #7471 but for all of the remaining compressed commutative instructions.
afonso360 requested cfallin for a review on PR #7480.
afonso360 requested wasmtime-compiler-reviewers for a review on PR #7480.
afonso360 edited PR #7480:
:wave: Hey,
This PR does two small instruction selection and encoding optimizations.
Use
addi
for subsThis is one of the regressions that showed up in #7468. That PR changes
iadd_imm(x, -k)
toisub(x, iconst(k))
. We can use the sameiadd
instruction for both, but we didn't have a rule to do it.So we now try to negate an Imm12 and if we are able to do that we emit an
addi
when subtracting.Try to swap registers when encoding compressed instructions for commutative operations
This is pretty much the same as #7471 but for all of the remaining compressed commutative instructions.
It allows us to emit these instructions as compressed more often.
alexcrichton submitted PR review.
alexcrichton merged PR #7480.
Last updated: Dec 23 2024 at 13:07 UTC