Stream: git-wasmtime

Topic: wasmtime / PR #6976 x64: Add support for some BMI2 instru...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 16:35):

alexcrichton opened PR #6976 from alexcrichton:x64-bmi2 to bytecodealliance:main:

This PR adds support for some isntructions in the BMI2 instruction set, namely sarx, shlx, shrx, and rorx. The shifting instructions can't encode immediates but use a 3-operand form and place no constraints on the amount being shifted by (as opposed to sar-style instructions which require that in %cl). The x-suffixed instructions are prioritized for this reason when BMI2 is enabled so long as an immediate shift amount isn't used. These new instrutions additionally support loading the value-to-shift from memory, unlike the old instructions (they store the result to memory as opposed to the new instructions which store the result in a register), but this functionality is not exposed at this time.

For rorx the benefits are similar, but the amount being shifted by is required to be an immediate. This means that rotation instructions, either left or right, will unconditionally use rorx so long as the amount-to-rotate is an immediate. This theoretically reduces register allocator pressure since the destination register can be different from the source.

I'll note that I don't personally have a compelling performance reason for adding these. I was poking around at instruction set extensions awhile back and never got around to making a PR for this until just now.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 16:35):

alexcrichton requested elliottt for a review on PR #6976.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 16:35):

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

view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 19:35):

alexcrichton updated PR #6976.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 07 2023 at 21:01):

alexcrichton updated PR #6976.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 00:25):

elliottt submitted PR review:

This looks good to me!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 12 2023 at 15:52):

alexcrichton merged PR #6976.


Last updated: Dec 23 2024 at 13:07 UTC