wasm2c: Extend segue to simd and unshared atomics - #2803
Merged
Conversation
Member
|
Can you explain what all the MEM_ADDR -> MEM_ADDR_MEMOP changes are for? |
Collaborator
Author
@sbc100 MEM_ADDR_MEMOP is a macro that uses segments to access memory if this feature is enabled, and falls back to using instance parameter's memory field to access memory otherwise. MEM_ADDR is the macro that unconditionally uses the instance parameter's memory field to access memory. Right now using segments was only allowed in the scalar loads/stores, but there is no reason to restrict this as the hardware supports segments on Simd operations as well. So this change ensures simd operations can use segments as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part 1 of the wasm2c performance optimization round I am conducting. Second part is here
This part, part 1, is just minor cleanup of segue --- the major performance optimization will come in part 2.
This PR extends the use of segment registers to simd and unshared atomics. The initial implementation of segue didn't cover simd because simd everywhere didn't support taking pointers to the gs segment. However, it turns out there is an easy way to solve it --- all we need are wrappers that copy to a local variable first and then pass that to simde. The optimizations in clang are able to eliminate all the extra memcpy operations and the result is what we'd want.