Stream: git-wasmtime

Topic: wasmtime / PR #6587 riscv64: Implement SIMD `popcnt`


view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 12:19):

afonso360 opened PR #6587 from afonso360:riscv-simd-popcnt to bytecodealliance:main:

:wave: Hey,

This PR Implements the SIMD popcnt instruction for RISC-V. We don't have a native version of this, so we need to use one of the popular algorithms that is normally replaces the native instruction. This is the variant that LLVM uses.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 12:19):

afonso360 requested cfallin for a review on PR #6587.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 12:19):

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

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 12:19):

afonso360 edited PR #6587:

:wave: Hey,

This PR Implements the SIMD popcnt instruction for RISC-V. We don't have a native version of this, so we need to use one of the popular algorithms that normally replaces the native instruction. This is the variant that LLVM uses.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 12:22):

afonso360 edited PR #6587:

:wave: Hey,

This PR Implements the SIMD popcnt instruction for RISC-V. We don't have a native version of this, so we need to use one of the popular algorithms that normally replaces the native instruction. This is the variant that LLVM uses for element types larger than i8, they also have a shorter implementation for i8x16, but I didn't implement it here.

I also checked what V8 produces and they do a loop that sums each bit. In our case that would involve having a custom instruction and I didn't really want to do that.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 13:02):

afonso360 updated PR #6587.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 16 2023 at 16:12):

itsrainy submitted PR review:

this looks good to me!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 17 2023 at 09:52):

afonso360 merged PR #6587.


Last updated: Dec 23 2024 at 12:05 UTC