-
Notifications
You must be signed in to change notification settings - Fork 682
Add V128 SIMD value type #3412
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
Add V128 SIMD value type #3412
Conversation
@@ -213,10 +213,11 @@ typedef struct WASMTag WASMTag; | |||
|
|||
#ifndef WASM_VALUE_DEFINED | |||
#define WASM_VALUE_DEFINED | |||
|
|||
typedef union V128 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about that but it's a little confused to keep both union V128
and union wasm_v128_t
, especially when they are sharing the same definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to change them to use the same name. Which do you prefer? I'm not completely sure about the naming rules, but using the name V128 in wasm_export.h didn't feel correct.
@bnason-nf is there any requirement from you to get v128 param/result type from func type? This really causes AOT ABI compatibility issue, the aot compiler assumes that the sizeof(wasm_val_t) is 16 when enabling the This PR means that the old AOT file generated by |
@wenyongh yes that's what I was concerned about. However, this change is confusing to me then. Is the goal to add v128 to the value type enum, but not add v128 to the value type itself? Is there a use case for that? |
@bnason-nf I think adding I think we had better keep For |
I see, thanks for the explanation. I've removed v128 from wasm_val_t. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@wenyongh do you know why the checks for this PR are not running? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It is really strange, I have re-run the CIs manually. |
Referencing a comment here:
#3363 (comment)
@wenyongh suggested that a 128 bit vector type should be added to the value type enum for SIMD support. This change adds an item to the relevant enums, and also adds code in various places to support that enum item. Please let me know if I missed anything.
Note that this requires changing the union inside the
wasm_val_t
structure to add a v128 member, which increases the overall size of the structure. As far as I can tell that doesn't cause any compatibility issues, even with AOT, but I'm not confident about that.