makepad/libs/stitch/benches/wat/fib_rec.wat
2025-05-06 10:11:37 +02:00

31 lines
725 B
WebAssembly Text Format

(module
(func $fib_rec (export "fib_rec") (param $n i64) (result i64)
(if
(i64.lt_u
(local.get $n)
(i64.const 2)
)
(then
(return
(local.get $n)
)
)
)
(return
(i64.add
(call $fib_rec
(i64.sub
(local.get $n)
(i64.const 2)
)
)
(call $fib_rec
(i64.sub
(local.get $n)
(i64.const 1)
)
)
)
)
)
)