Created
June 19, 2017 23:35
-
-
Save denismerigoux/c091fe69ea0ac0ad13627993e2148b3d to your computer and use it in GitHub Desktop.
First translation from wasm to Cretonne IL
This file contains 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
function %(i32, i32) -> i32 { | |
ebb0(v0: i32, v1: i32): | |
v2 = iconst.i32 1 | |
v3 = iadd v2, v0 | |
v4 = iconst.i32 1 | |
v5 = iadd v4, v1 | |
v6 = icmp slt v5, v3 | |
v7 = sextend.i32 v6 | |
return v7 | |
} | |
function %(i32, i32) -> i32 { | |
ebb0(v0: i32, v1: i32): | |
v2 = iconst.i32 1 | |
v3 = iadd v2, v0 | |
v4 = iconst.i32 1 | |
v5 = iadd v4, v1 | |
v6 = icmp ult v5, v3 | |
v7 = uextend.i32 v6 | |
return v7 | |
} | |
function %(i64, i64) -> i32 { | |
ebb0(v0: i64, v1: i64): | |
v2 = iconst.i64 1 | |
v3 = iadd v2, v0 | |
v4 = iconst.i64 1 | |
v5 = iadd v4, v1 | |
v6 = icmp slt v5, v3 | |
v7 = sextend.i32 v6 | |
return v7 | |
} | |
function %(i64, i64) -> i32 { | |
ebb0(v0: i64, v1: i64): | |
v2 = iconst.i64 1 | |
v3 = iadd v2, v0 | |
v4 = iconst.i64 1 | |
v5 = iadd v4, v1 | |
v6 = icmp ult v5, v3 | |
v7 = uextend.i32 v6 | |
return v7 | |
} |
This file contains 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 (export "i32.no_fold_cmp_s_offset") (param $x i32) (param $y i32) (result i32) | |
(i32.lt_s (i32.add (get_local $x) (i32.const 1)) (i32.add (get_local $y) (i32.const 1)))) | |
(func (export "i32.no_fold_cmp_u_offset") (param $x i32) (param $y i32) (result i32) | |
(i32.lt_u (i32.add (get_local $x) (i32.const 1)) (i32.add (get_local $y) (i32.const 1)))) | |
(func (export "i64.no_fold_cmp_s_offset") (param $x i64) (param $y i64) (result i32) | |
(i64.lt_s (i64.add (get_local $x) (i64.const 1)) (i64.add (get_local $y) (i64.const 1)))) | |
(func (export "i64.no_fold_cmp_u_offset") (param $x i64) (param $y i64) (result i32) | |
(i64.lt_u (i64.add (get_local $x) (i64.const 1)) (i64.add (get_local $y) (i64.const 1)))) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment