Created
October 24, 2015 13:04
-
-
Save soma-arc/f29182340b6d95bbde60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (module | |
| (func $double-loop (param $width i32) (param $height i32) (result i32) | |
| (local $x i32) | |
| (local $y i32) | |
| (local $sum i32) | |
| (loop $x-loop | |
| (set_local $y (i32.const 0)) | |
| (loop $y-loop | |
| (set_local $sum (i32.add (get_local $sum) (i32.const 1))) | |
| (set_local $y (i32.add (get_local $y) (i32.const 1))) | |
| (if (i32.eq (get_local $y) (get_local $height)) | |
| (break $y-loop))) | |
| (set_local $x (i32.add (get_local $x) (i32.const 1))) | |
| (if (i32.eq (get_local $x) (get_local $width)) | |
| (break $x-loop))) | |
| (return (get_local $sum))) | |
| (export "test" $test) | |
| (func $test (result i32) | |
| (call $double-loop (i32.const 10) (i32.const 10)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment