Skip to content

amd64: fixes lowerSqmulRoundSat #2260

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

Merged
merged 1 commit into from
Jun 20, 2024
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
2 changes: 1 addition & 1 deletion internal/engine/wazevo/backend/isa/amd64/machine_vec.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (m *machine) lowerSqmulRoundSat(x, y, ret ssa.Value) {
tmpX := m.copyToTmp(xx.reg())

m.insert(m.allocateInstr().asXmmRmR(sseOpcodePmulhrsw, yy, tmpX))
m.insert(m.allocateInstr().asXmmRmR(sseOpcodePcmpeqd, newOperandReg(tmpX), tmp))
m.insert(m.allocateInstr().asXmmRmR(sseOpcodePcmpeqw, newOperandReg(tmpX), tmp))
Copy link
Member Author

Choose a reason for hiding this comment

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

this had to be w instead of d 😉

m.insert(m.allocateInstr().asXmmRmR(sseOpcodePxor, newOperandReg(tmp), tmpX))

m.copyTo(tmpX, m.c.VRegOf(ret))
Expand Down
7 changes: 7 additions & 0 deletions internal/integration_test/fuzzcases/fuzzcases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,3 +1080,10 @@ func Test2201(t *testing.T) {
}
nodiff.RequireNoDiffT(t, getWasmBinary(t, "2201"), false, false)
}

func Test2260(t *testing.T) {
if !platform.CompilerSupported() {
return
}
nodiff.RequireNoDiffT(t, getWasmBinary(t, "2260"), false, false)
}
Binary file not shown.
21 changes: 21 additions & 0 deletions internal/integration_test/fuzzcases/testdata/2260.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(module
(type (;0;) (func (param f64)))
(func (;0;) (type 0) (param f64)
(local v128 v128 v128)
v128.const i32x4 0x8a8a8aff 0x8a8a8aaa 0xff458a8a 0x8affffff
f32x4.ceil
global.set 0
global.get 0
v128.const i32x4 0x8a8a8aff 0x8a8a8aaa 0xff458a8a 0x8affffff
f32x4.ceil
global.set 1
global.get 1
i16x8.q15mulr_sat_s
global.set 2
)
(global (;0;) (mut v128) v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
(global (;0;) (mut v128) v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
(global (;0;) (mut v128) v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)
(global (;1;) (mut i32) i32.const 0)
(export "" (func 0))
)
Loading