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

x64: Lower SIMD requirement to SSE2 #6625

Merged

Conversation

alexcrichton
Copy link
Member

All instructions in Cranelift now have lowerings for SSE2 as a baseline, even if they're not exactly the speediest things in the world. This enables lowering the baseline required for the SIMD proposal for WebAssembly to SSE2, the base features set of x86_64. Lots of tests were updated here to remove explicit has_foo=false annotations as they no longer have any effect.

Additionally fuzzing has been updated to enable disabling sse3 and ssse3 which will help stress-test all previously-added lowerings.

All instructions in Cranelift now have lowerings for SSE2 as a baseline,
even if they're not exactly the speediest things in the world. This
enables lowering the baseline required for the SIMD proposal for
WebAssembly to SSE2, the base features set of x86_64. Lots of tests were
updated here to remove explicit `has_foo=false` annotations as they no
longer have any effect.

Additionally fuzzing has been updated to enable disabling `sse3` and
`ssse3` which will help stress-test all previously-added lowerings.
@alexcrichton alexcrichton requested review from a team as code owners June 22, 2023 14:40
@alexcrichton alexcrichton requested review from elliottt and fitzgen and removed request for a team June 22, 2023 14:40
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. labels Jun 22, 2023
Copy link
Member

@fitzgen fitzgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@fitzgen fitzgen added this pull request to the merge queue Jun 22, 2023
Merged via the queue into bytecodealliance:main with commit 0c98078 Jun 22, 2023
@alexcrichton alexcrichton deleted the x64-lower-baseline-simd-reqs branch June 22, 2023 19:11
@alexcrichton
Copy link
Member Author

With @fitzgen's excellent idea of actually testing these on somewhat real hardware I ran the test suite through QEMU with QEMU_CPU=core2duo,-sse3,-ssse3 (couldn't figure out a shorter way of saying "no features") and the entire test suite passes with #6629 and #6630 so there were indeed a few mistakes to catch, but after that I think we're looking good!

(I don't have actual old hardware to test on myeslf)

alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Jun 22, 2023
This commit removes a setting for Cranelift which I've found a bit
confusing historically and I think is no longer necessary. The setting
is currently documented as enabling SIMD instructions, but that only
sort of works for the x64 backend and none of the other backends look at
it. Historically this was used to flag to Cranelift that a higher x64
baseline feature set is required for codegen but as of bytecodealliance#6625 that's no
longer necessary.

Otherwise it seems more Cranelift-like nowadays to say that vector
instructions generate SIMD instructions where non-vector instructions
probably don't, but may still depending on activated CPU features. In
that sense I'm not sure if a dedicated `enable_simd` setting is still
motivated, so this PR removes it.

This renames some features in the x86 backend such as `use_avx_simd` to
`use_avx` since the `_simd` part is no longer part of the computation
now that `enable_simd` is gone.
github-merge-queue bot pushed a commit that referenced this pull request Jun 22, 2023
This commit removes a setting for Cranelift which I've found a bit
confusing historically and I think is no longer necessary. The setting
is currently documented as enabling SIMD instructions, but that only
sort of works for the x64 backend and none of the other backends look at
it. Historically this was used to flag to Cranelift that a higher x64
baseline feature set is required for codegen but as of #6625 that's no
longer necessary.

Otherwise it seems more Cranelift-like nowadays to say that vector
instructions generate SIMD instructions where non-vector instructions
probably don't, but may still depending on activated CPU features. In
that sense I'm not sure if a dedicated `enable_simd` setting is still
motivated, so this PR removes it.

This renames some features in the x86 backend such as `use_avx_simd` to
`use_avx` since the `_simd` part is no longer part of the computation
now that `enable_simd` is gone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants