Stream: git-wasmtime

Topic: wasmtime / PR #4080 Improve x64 address lowering: consoli...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 02:41):

cfallin opened PR #4080 from x64-amodes to main:

This draft PR modifies the x64 backend's addressing-mode lowering to use both scaled indexing, e.g. [rax+rbx*4], and to consolidate offsets, so x+y+8+12 can become [rax+rbx+20]`.

Unfortunately this doesn't yet appear to be quite enough to improve on this really annoying sequence that occurs frequently in SpiderMonkey.wasm's hot blocks:

     0xC064911:  movq %rsi,%rdx
     0xC064914:  addl $3, %edx
     0xC064917:  movzbq 0(%r9,%rdx),%rdx

the issue being that edx+3, as a 32-bit add, can wrap around and so this is not quite equivalent to 3(%r9, %rsi) (assuming we could prove rsi is zero-extended). @abrown or others, if you have ideas on a better lowering here, I'd be happy to hear them!

This PR builds on top of #4072, #4078, and #4079; only the last commit is new.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 05:52):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:14):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:21):

iximeow created PR review comment:

not having to change this makes me seriously question something, somewhere. the 67 prefix should have made this sequence decode as lea 48(%r12d,%r13d,4), %eax?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:21):

iximeow submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:23):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:23):

cfallin created PR review comment:

Ah, this is our internal pretty-printing and doesn't go through any external (dis)assembler, so it isn't necessarily guaranteed to have the correct register names per the operand size. Or at least for this quick experiment/hack I didn't bother to hack the EA prettyprinting to take an OperandSize.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:25):

iximeow submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 06:25):

iximeow created PR review comment:

oh! i have a ~bridge~ disassembler to sell you, potentially :)

view this post on Zulip Wasmtime GitHub notifications bot (Apr 28 2022 at 23:42):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 29 2022 at 02:47):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 29 2022 at 03:08):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 29 2022 at 22:23):

cfallin updated PR #4080 from x64-amodes to main.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 29 2022 at 22:24):

cfallin has marked PR #4080 as ready for review.


Last updated: Dec 23 2024 at 13:07 UTC