wazevo(amd64): alignment for Fmax/min (#2084)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2024-02-21 09:10:50 +09:00
committed by GitHub
parent 08998eda2d
commit c16735db52
4 changed files with 29 additions and 1 deletions

View File

@@ -2171,7 +2171,8 @@ func (m *machine) lowerFminFmax(instr *ssa.Instruction) {
xDef, yDef := m.c.ValueDefinition(x), m.c.ValueDefinition(y)
rm := m.getOperand_Reg(xDef)
rn := m.getOperand_Mem_Reg(yDef)
// We cannot ensure that y is aligned to 16 bytes, so we have to use it on reg.
rn := m.getOperand_Reg(yDef)
rd := m.c.VRegOf(instr.Return())
tmp := m.copyToTmp(rm.reg())

View File

@@ -1018,3 +1018,10 @@ func Test2082(t *testing.T) {
}
nodiff.RequireNoDiffT(t, getWasmBinary(t, "2082"), true, true)
}
func Test2084(t *testing.T) {
if !platform.CompilerSupported() {
return
}
nodiff.RequireNoDiffT(t, getWasmBinary(t, "2084"), true, true)
}

Binary file not shown.

View File

@@ -0,0 +1,20 @@
(module
(type (;0;) (func (param i32 f64)))
(func (;0;) (type 0) (param i32 f64)
(local i32 f32 f32)
i32.const 0
if ;; label = @1
unreachable
end
f32.const 0x0p+0 (;=0;)
memory.size
f32.load offset=93531 align=2
f32.max
i32.reinterpret_f32
i32.const 0
i32.xor
global.set 0
)
(memory (;0;) 6 8)
(global (;0;) (mut i32) i32.const 0)
(export "" (func 0)))