amd64: fixes lowerSqmulRoundSat (#2260)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2024-06-20 10:21:26 -07:00
committed by GitHub
parent 69c78f9b77
commit 7929b200f4
4 changed files with 29 additions and 1 deletions

View File

@@ -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))
m.insert(m.allocateInstr().asXmmRmR(sseOpcodePxor, newOperandReg(tmp), tmpX))
m.copyTo(tmpX, m.c.VRegOf(ret))

View File

@@ -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.

View File

@@ -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))
)