Stream: git-wasmtime

Topic: wasmtime / PR #7136 riscv64: Refactor implementation of `...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton opened PR #7136 from alexcrichton:rv64-divrem to bytecodealliance:main:

This commit's goal is to remove the usage of gen_icmp with division-related instructions in the riscv64 backend. I've opted for a slightly more verbose approach than what was present prior to make sign/zero extensions more precise and additionally enable some immediate-related optimizations.

Divison/remainder by an immediate will no longer emit checks to see if a trap needs to be emitted. Instead only the raw div/rem instructions are emitted. Additionally a few minor sign extensions are now avoided such as the dividend in 32-bit remainders/division because only the low 32-bits are inspected.

Finally, while I was here, I went ahead an added has_m guards to all these lowering rules. The M extension is always required with riscv64 right now and won't work if it's turned off, but I figure it's not too bad to add in terms of completeness for now.

As to the meat of the commit, the check for trapping value as part of division now happens without gen_icmp but instead gen_trapif which enables avoiding materializing the comparison's value into a register.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton requested afonso360 for a review on PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton requested cfallin for a review on PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton requested elliottt for a review on PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 01:05):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 02:05):

alexcrichton updated PR #7136.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 10:21):

afonso360 submitted PR review:

Looks great! Thanks!

Also I'm gonna tag you for review on these riscv64 PRs @afonso360 but if it gets too much and/or you'd prefer I'd not, just let me know.

I'm happy to review these, but I'll let you know if I'm unable to for whatever reason.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 11:11):

afonso360 merged PR #7136.


Last updated: Nov 22 2024 at 17:03 UTC