Stream: git-wasmtime

Topic: wasmtime / PR #7480 riscv64: Instruction selection improv...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 10:57):

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 subs

This is one of the regressions that showed up in #7468. That PR changes iadd_imm(x, -k) to isub(x, iconst(k)). We can use the same iadd 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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 10:57):

afonso360 requested cfallin for a review on PR #7480.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 10:57):

afonso360 requested wasmtime-compiler-reviewers for a review on PR #7480.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 10:58):

afonso360 edited PR #7480:

:wave: Hey,

This PR does two small instruction selection and encoding optimizations.

Use addi for subs

This is one of the regressions that showed up in #7468. That PR changes iadd_imm(x, -k) to isub(x, iconst(k)). We can use the same iadd 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.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 16:50):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 04 2023 at 17:29):

alexcrichton merged PR #7480.


Last updated: Nov 22 2024 at 16:03 UTC