Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMD support #267

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

SIMD support #267

wants to merge 8 commits into from

Conversation

jay-tux
Copy link
Contributor

@jay-tux jay-tux commented Oct 3, 2024

Provides support for the following SIMD instructions (using (dim) as a placeholder for any of i8x16, i16x8, etc):

  • (dim).splat (copy a single scalar value into every lane of a v128)
  • (dim).extract_lane ImmIdx (extract a single lane from a v128)
  • (dim).replace_lane ImmIdx (replace a single lane from a v128)
  • v128.const i128 (construct a v128 from a byte buffer)
  • v128.store memarg (store a v128 to memory)
  • v128.load memarg (load a v128 from memory)
    All of these instructions are emulated (i.e. they don't use intrinsics or specialized instructions).

Provides debugger support for v128 values when dumping the stack:

  • Values are sent as {"type": "v128", "value": "i64x2.lane0 i64x2.lane1"}. The 128-bit vector is interpreted as 2 64-bit integers (i64x2.lane0 and i64x2.lane1).

Provides additional spec-tests:

  • simd_splat.wast

Implementation notes:

  • This changes sizeof(StackValue) from 16 to 24, as each stack slot now has to accommodate a 16-byte v128 argument
  • v128.load and v128.store each use 2 consecutive i64 fields in memory

Related to #25, #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant