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

[WIP] Initial SIMD support #528

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

Conversation

andreaTP
Copy link
Collaborator

I wanted to relax a bit, and took this yak shaving task.
I realized that the SIMD support needs a few little tweaks to the public API, and, the initial support, requires quite a bit of wiring rising the bar for possible contributions.

Notes:

  • I discussed with @evacchi and the usage of the Stack with double push and double pop comes straight from wazero I think it's a good approach for further optimizations!
  • the vector API, at the moment requires copy of arrays, I should resurrect and finalize Exploration - long array primitive MStack #447 to improve here
  • there is only one operation actually implemented as a Vector instruction V128_NOT but demonstrates that the entire wiring works
  • I'll clean up the PR in the next days and try to finalize it (with CI setup etc.)

@evacchi
Copy link
Collaborator

evacchi commented Sep 17, 2024

I am not 100% sold on the approach Map<Opcode, OpImpl>, especially because OpImpl causes the indirection of a method reference. All SIMD opcodes are prefixed with 0xFD so one approach could be

  • in InterpreterMachine, add a new case with SIMD_PREFIX(0xFD);
  • if SIMD support is enabled, then delegate to another class/method that implements the switch table for that set of opcodes

while this requires adding SIMD_PREFIX(0xFD) to the Opcode enum, it also allows to raise a proper error message if the feature is not enabled.

@andreaTP
Copy link
Collaborator Author

Thanks for your proposal @evacchi , I have no strong opinions here, happy to go down with it if there is agreement, let's @bhelx or @electrum break the tie 🙂

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.

2 participants