-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
std.Target: Use lime1 as wasm baseline model and mvp as generic model
#22098
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
Conversation
9faab7a to
b9ecd95
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
b9ecd95 to
abb51dd
Compare
|
Ok, the |
abb51dd to
60cc7e1
Compare
60cc7e1 to
b157cf5
Compare
andrewrk
left a comment
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.
|
What do you think about my idea to introduce a CPU feature called |
Seems reasonable. I'll add that. |
…ill. Apparently the WebAssembly spec requires these instructions to trap if the computed memory access could be out of bounds, even if the length is zero. Really a rather bizarre design choice.
As discussed in #21818, generic is a poor baseline model because that model is a moving target in LLVM. Instead, use mvp, which has no features enabled.
…embly. See: WebAssembly/tool-conventions#235 This is not *quite* using the same features as the spec'd lime1 model because LLVM 19 doesn't have the level of feature granularity that we need for that. This will be fixed once we upgrade to LLVM 20. Part of #21818.
b157cf5 to
5e54390
Compare
|
Ok, I've implemented a I did a |
andrewrk
left a comment
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.
Looks great, thanks!
This will mainly be used when targeting our wasm2c implementation which has no problem with zero-length bulk memory operations, as a non-standard extension.
This is more verbose, but at least we now get a compile error instead of UB when a new feature is added to std.Target.wasm.Feature but not to link.Wasm.Feature.
848c589 to
68c6a88
Compare
|
|
||
| pub fn fromCpuFeature(feature: std.Target.wasm.Feature) Tag { | ||
| return @enumFromInt(@intFromEnum(feature)); | ||
| return switch (feature) { |
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.
Good move, this looks a lot better. Sorry about the trouble, I should have done this from the beginning.
See #21818 and commit messages.
(#21818 should remain open after this to track aligning
lime1exactly with the spec when we upgrade to LLVM 20.)