/-
AUTO-GENERATED by `verifier emit`. Do not edit by hand.
-/
import CodeLib
set_option maxRecDepth 1048576
namespace Project.FloatRound
open Wasm
def func0 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.globalSet 0,
.localGet 0,
.call 1,
.localSet 2,
.localGet 0,
.localGet 2,
.f32Sub,
.localSet 3,
.block 0 0 [
.block 0 0 [
.block 0 0 [
.block 0 0 [
.localGet 3,
.f32Const (1056964608 : UInt32),
.f32Ge,
.const (1 : UInt32),
.and,
.br_if 0,
.localGet 3,
.f32Const (3204448256 : UInt32),
.f32Le,
.const (1 : UInt32),
.and,
.br_if 2,
.br 1
],
.localGet 1,
.localGet 2,
.call 2,
.f32Store (12 : UInt32),
.br 2
],
.localGet 1,
.localGet 2,
.f32Store (12 : UInt32),
.br 1
],
.localGet 1,
.localGet 2,
.call 3,
.f32Store (12 : UInt32)
],
.localGet 1,
.f32Load (12 : UInt32),
.localSet 4,
.localGet 1,
.const (16 : UInt32),
.add,
.globalSet 0,
.localGet 4,
.ret
]
def func0Def : Wasm.Function :=
{ params := [.f32], locals := [.i32, .f32, .f32, .f32], body := func0, results := [.f32] }
def func1 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.localGet 0,
.f32Trunc,
.f32Store (12 : UInt32),
.localGet 1,
.f32Load (12 : UInt32),
.ret
]
def func1Def : Wasm.Function :=
{ params := [.f32], locals := [.i32], body := func1, results := [.f32] }
def func2 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.localGet 0,
.f32Ceil,
.f32Store (12 : UInt32),
.localGet 1,
.f32Load (12 : UInt32),
.ret
]
def func2Def : Wasm.Function :=
{ params := [.f32], locals := [.i32], body := func2, results := [.f32] }
def func3 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.localGet 0,
.f32Floor,
.f32Store (12 : UInt32),
.localGet 1,
.f32Load (12 : UInt32),
.ret
]
def func3Def : Wasm.Function :=
{ params := [.f32], locals := [.i32], body := func3, results := [.f32] }
def func4 : Wasm.Program :=
[
.localGet 0,
.call 5,
.ret
]
def func4Def : Wasm.Function :=
{ params := [.f32], locals := [], body := func4, results := [.f32] }
def func5 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.localGet 0,
.f32Nearest,
.f32Store (12 : UInt32),
.localGet 1,
.f32Load (12 : UInt32),
.ret
]
def func5Def : Wasm.Function :=
{ params := [.f32], locals := [.i32], body := func5, results := [.f32] }
/-- export: check_round -/
def func6 : Wasm.Program :=
[
.globalGet 0,
.const (16 : UInt32),
.sub,
.localSet 1,
.localGet 1,
.globalSet 0,
.block 0 0 [
.block 0 0 [
.localGet 0,
.call 0,
.localGet 0,
.call 4,
.f32Eq,
.const (1 : UInt32),
.and,
.br_if 0,
.localGet 1,
.const (0 : UInt32),
.store32 (12 : UInt32),
.br 1
],
.localGet 1,
.const (1 : UInt32),
.store32 (12 : UInt32)
],
.localGet 1,
.load32 (12 : UInt32),
.localSet 2,
.localGet 1,
.const (16 : UInt32),
.add,
.globalSet 0,
.localGet 2,
.ret
]
def func6Def : Wasm.Function :=
{ params := [.f32], locals := [.i32, .i32], body := func6, results := [.i32] }
def «module» : Wasm.Module :=
{
imports := [],
funcs := [
func0Def,
func1Def,
func2Def,
func3Def,
func4Def,
func5Def,
func6Def
],
exports := [
{ name := "check_round", funcIdx := 6 }
],
memory := some { pagesMin := (16 : UInt32), pagesMax := none, data := [] },
globals := [
{ init := .i32 (1048576 : UInt32) },
{ init := .i32 (1048576 : UInt32) },
{ init := .i32 (1048576 : UInt32) }
],
types := [
{ params := [.f32], results := [.f32] },
{ params := [.f32], results := [.i32] }
],
tables := [
{ min := 1, max := some 1, elemType := .funcref }
],
elements := []
}
end Project.FloatRound