Created
August 25, 2018 23:50
-
-
Save chikoski/3227689e6196583625ec283fc21b66de 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
#[wasm_bindgen] | |
pub fn count(max: i32) -> i32 { | |
let mut res = 0; | |
for _i in 0..max { | |
res = res + 1; | |
} | |
res | |
} |
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
(func $count (type 0) (param i32) (result i32) | |
i32.const 0 | |
i32.const 0 | |
i32.store offset=1048640 | |
get_local 0 | |
i32.const 0 | |
get_local 0 | |
i32.const 0 | |
i32.gt_s | |
select) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment