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

wazeroir: backfill vector instruction unittets #623

Merged
merged 5 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions internal/wasm/func_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2709,8 +2709,7 @@ func TestModule_funcValidation_SIMD(t *testing.T) {
vi2v := func(vec OpcodeVec) (ret []byte) {
ret = addV128Const(ret)
return append(ret,
OpcodeI32Const,
1, 1, 1, 1,
OpcodeI32Const, 1,
Copy link
Member Author

Choose a reason for hiding this comment

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

needs leb128 encoding but yeah somehow this worked since before but fixed it 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

ah cool

OpcodeVecPrefix,
vec,
OpcodeDrop,
Expand All @@ -2720,8 +2719,7 @@ func TestModule_funcValidation_SIMD(t *testing.T) {

load := func(vec OpcodeVec, offset, align uint32) (ret []byte) {
ret = []byte{
OpcodeI32Const,
1, 1, 1, 1,
OpcodeI32Const, 1,
OpcodeVecPrefix,
vec,
}
Expand All @@ -2736,7 +2734,7 @@ func TestModule_funcValidation_SIMD(t *testing.T) {
}

loadLane := func(vec OpcodeVec, offset, align uint32, lane byte) (ret []byte) {
ret = addV128Const([]byte{OpcodeI32Const, 1, 1, 1, 1})
ret = addV128Const([]byte{OpcodeI32Const, 1})
ret = append(ret,
OpcodeVecPrefix,
vec,
Expand All @@ -2753,7 +2751,7 @@ func TestModule_funcValidation_SIMD(t *testing.T) {
}

storeLane := func(vec OpcodeVec, offset, align uint32, lane byte) (ret []byte) {
ret = addV128Const([]byte{OpcodeI32Const, 1, 1, 1, 1})
ret = addV128Const([]byte{OpcodeI32Const, 1})
ret = append(ret,
OpcodeVecPrefix,
vec,
Expand Down Expand Up @@ -2784,9 +2782,9 @@ func TestModule_funcValidation_SIMD(t *testing.T) {

switch vec {
case OpcodeVecI8x16ReplaceLane, OpcodeVecI16x8ReplaceLane, OpcodeVecI32x4ReplaceLane:
ret = append(ret, OpcodeI32Const, 0, 0, 0, 0)
ret = append(ret, OpcodeI32Const, 0)
case OpcodeVecI64x2ReplaceLane:
ret = append(ret, OpcodeI64Const, 0, 0, 0, 0, 0, 0, 0, 0)
ret = append(ret, OpcodeI64Const, 0)
case OpcodeVecF32x4ReplaceLane:
ret = append(ret, OpcodeF32Const, 0, 0, 0, 0)
case OpcodeVecF64x2ReplaceLane:
Expand Down
Loading