-
Notifications
You must be signed in to change notification settings - Fork 887
[multibyte] Support all array element types in the interpreter #9115
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
Open
brendandahl
wants to merge
1
commit into
WebAssembly:main
Choose a base branch
from
brendandahl:multibyte-array-interpreter-v5-cla
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| ;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. | ||
| ;; RUN: wasm-ctor-eval %s --ctors=test --kept-exports= --quiet -all -S -o - | filecheck %s | ||
|
|
||
| ;; Multibyte stores are evaluated at compile time, and the resulting array | ||
| ;; contents are serialized back into the module as elements of the array's | ||
| ;; element type. | ||
|
|
||
| (module | ||
| ;; CHECK: (type $i32_array (array (mut i32))) | ||
| (type $i32_array (array (mut i32))) | ||
| ;; CHECK: (type $i16_array (array (mut i16))) | ||
| (type $i16_array (array (mut i16))) | ||
| ;; CHECK: (type $v128_array (array (mut v128))) | ||
| (type $v128_array (array (mut v128))) | ||
|
|
||
| ;; CHECK: (global $ctor-eval$global_12 (ref (exact $i32_array)) (array.new_fixed $i32_array 4 | ||
| ;; CHECK-NEXT: (i32.const 0) | ||
| ;; CHECK-NEXT: (i32.const 1432778632) | ||
| ;; CHECK-NEXT: (i32.const 287454020) | ||
| ;; CHECK-NEXT: (i32.const 0) | ||
| ;; CHECK-NEXT: )) | ||
|
|
||
| ;; CHECK: (global $ctor-eval$global_13 (ref (exact $i16_array)) (array.new_fixed $i16_array 4 | ||
| ;; CHECK-NEXT: (i32.const 56576) | ||
| ;; CHECK-NEXT: (i32.const 48076) | ||
| ;; CHECK-NEXT: (i32.const 170) | ||
| ;; CHECK-NEXT: (i32.const 0) | ||
| ;; CHECK-NEXT: )) | ||
|
|
||
| ;; CHECK: (global $ctor-eval$global_14 (ref (exact $v128_array)) (array.new_fixed $v128_array 1 | ||
| ;; CHECK-NEXT: (v128.const i32x4 0x00000001 0x00000002 0x00000003 0x00000004) | ||
| ;; CHECK-NEXT: )) | ||
|
|
||
| ;; CHECK: (global $i32 (mut (ref null $i32_array)) (global.get $ctor-eval$global_12)) | ||
| (global $i32 (export "i32") (mut (ref null $i32_array)) (ref.null $i32_array)) | ||
| ;; CHECK: (global $i16 (mut (ref null $i16_array)) (global.get $ctor-eval$global_13)) | ||
| (global $i16 (export "i16") (mut (ref null $i16_array)) (ref.null $i16_array)) | ||
| ;; CHECK: (global $v128 (mut (ref null $v128_array)) (global.get $ctor-eval$global_14)) | ||
| (global $v128 (export "v128") (mut (ref null $v128_array)) (ref.null $v128_array)) | ||
|
|
||
| (func $test (export "test") | ||
| ;; An i64 store covers two i32 elements. | ||
| (global.set $i32 (array.new_default $i32_array (i32.const 4))) | ||
| (i64.store (type $i32_array) (global.get $i32) (i32.const 4) | ||
| (i64.const 0x1122334455667788) | ||
| ) | ||
| ;; An unaligned i32 store covers parts of two i16 elements. | ||
| (global.set $i16 (array.new_default $i16_array (i32.const 4))) | ||
| (i32.store (type $i16_array) offset=1 (global.get $i16) (i32.const 0) | ||
| (i32.const 0xaabbccdd) | ||
| ) | ||
| ;; A v128 store covers an entire v128 element. | ||
| (global.set $v128 (array.new_default $v128_array (i32.const 1))) | ||
| (v128.store (type $v128_array) (global.get $v128) (i32.const 0) | ||
| (v128.const i32x4 1 2 3 4) | ||
| ) | ||
| ) | ||
| ) | ||
| ;; CHECK: (export "i32" (global $i32)) | ||
|
|
||
| ;; CHECK: (export "i16" (global $i16)) | ||
|
|
||
| ;; CHECK: (export "v128" (global $v128)) | ||
Oops, something went wrong.
Oops, something went wrong.
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.
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.