Also lint stdlib

This commit is contained in:
dcodeIO
2018-02-25 23:21:32 +01:00
parent ae05006d21
commit 9ef8b162a9
30 changed files with 506 additions and 461 deletions

View File

@ -69,12 +69,6 @@
(i32.const 1)
)
)
(set_global $binary/i
(i32.mul
(get_global $binary/i)
(i32.const 1)
)
)
(set_global $binary/i
(i32.div_s
(get_global $binary/i)
@ -135,12 +129,6 @@
(i32.const 1)
)
)
(set_global $binary/i
(i32.mul
(get_global $binary/i)
(i32.const 1)
)
)
(set_global $binary/i
(i32.rem_s
(get_global $binary/i)

View File

@ -18,13 +18,13 @@
)
(loop $continue|0
(if
(if (result i32)
(get_local $2)
(i32.rem_u
(select
(i32.and
(get_local $1)
(i32.const 4)
(i32.const 3)
)
(get_local $2)
(get_local $2)
)
(block
(set_local $0
@ -63,9 +63,9 @@
)
(if
(i32.eqz
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 4)
(i32.const 3)
)
)
(block
@ -269,9 +269,9 @@
(block $tablify|0
(br_table $case0|2 $case1|2 $case2|2 $tablify|0
(i32.sub
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 4)
(i32.const 3)
)
(i32.const 1)
)

View File

@ -31,21 +31,21 @@
(block
(if
(i32.eq
(i32.rem_u
(i32.and
(get_local $1)
(i32.const 8)
(i32.const 7)
)
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 8)
(i32.const 7)
)
)
(block
(loop $continue|0
(if
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 8)
(i32.const 7)
)
(block
(if
@ -169,24 +169,24 @@
(block
(if
(i32.eq
(i32.rem_u
(i32.and
(get_local $1)
(i32.const 8)
(i32.const 7)
)
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 8)
(i32.const 7)
)
)
(block
(loop $continue|3
(if
(i32.rem_u
(i32.and
(i32.add
(get_local $0)
(get_local $2)
)
(i32.const 8)
(i32.const 7)
)
(block
(if

View File

@ -92,13 +92,13 @@
)
(loop $continue|0
(if
(if (result i32)
(get_local $2)
(i32.rem_u
(select
(i32.and
(get_local $1)
(i32.const 4)
(i32.const 3)
)
(get_local $2)
(get_local $2)
)
(block
(set_local $0
@ -137,9 +137,9 @@
)
(if
(i32.eqz
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 4)
(i32.const 3)
)
)
(block
@ -343,9 +343,9 @@
(block $tablify|0
(br_table $case0|2 $case1|2 $case2|2 $tablify|0
(i32.sub
(i32.rem_u
(i32.and
(get_local $0)
(i32.const 4)
(i32.const 3)
)
(i32.const 1)
)
@ -2858,12 +2858,6 @@
(i32.const 1)
)
)
(set_global $binary/i
(i32.mul
(get_global $binary/i)
(i32.const 1)
)
)
(set_global $binary/i
(i32.div_s
(get_global $binary/i)
@ -2924,12 +2918,6 @@
(i32.const 1)
)
)
(set_global $binary/i
(i32.mul
(get_global $binary/i)
(i32.const 1)
)
)
(set_global $binary/i
(i32.rem_s
(get_global $binary/i)

View File

@ -1994,9 +1994,9 @@
)
(set_local $2
(call "$(lib)/allocator/arena/allocate_memory"
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2010,11 +2010,11 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.load offset=4
(get_local $0)
)
(i32.const 4)
(i32.const 2)
)
)
(call "$(lib)/allocator/arena/free_memory"
@ -2065,11 +2065,11 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.load offset=8
(get_local $0)
)
(i32.const 4)
(i32.const 2)
)
)
(get_local $1)
@ -2102,9 +2102,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2137,9 +2137,9 @@
)
)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2181,7 +2181,7 @@
(call $abort
(i32.const 0)
(i32.const 32)
(i32.const 105)
(i32.const 128)
(i32.const 6)
)
(unreachable)
@ -2189,9 +2189,9 @@
)
(set_local $4
(call "$(lib)/allocator/arena/allocate_memory"
(i32.mul
(i32.shl
(get_local $3)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2208,9 +2208,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
(call "$(lib)/allocator/arena/free_memory"
@ -2239,9 +2239,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2625,14 +2625,14 @@
)
(i32.const 4)
)
(i32.mul
(i32.shl
(i32.sub
(i32.load offset=4
(get_local $0)
)
(i32.const 1)
)
(i32.const 4)
(i32.const 2)
)
)
(call "$(lib)/memory/set_memory"
@ -2640,14 +2640,14 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.sub
(i32.load offset=4
(get_local $0)
)
(i32.const 1)
)
(i32.const 4)
(i32.const 2)
)
)
(i32.const 0)
@ -2689,9 +2689,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2701,9 +2701,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
(i32.load
@ -2711,9 +2711,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2723,9 +2723,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
(get_local $3)
@ -2779,9 +2779,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2856,16 +2856,16 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.add
(get_local $1)
(tee_local $2
@ -2886,12 +2886,12 @@
)
)
)
(i32.const 4)
(i32.const 2)
)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
(i32.store offset=8

View File

@ -2479,7 +2479,7 @@
(call $abort
(i32.const 0)
(i32.const 32)
(i32.const 105)
(i32.const 128)
(i32.const 6)
)
(unreachable)

View File

@ -21,9 +21,9 @@
(i32.load
(i32.add
(get_local $0)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
)
@ -39,9 +39,9 @@
(i32.store
(i32.add
(get_local $0)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
(get_local $2)

View File

@ -50,25 +50,19 @@
)
(return
(i32.or
(i32.or
(i32.and
(i32.shl
(get_local $0)
(i32.const 8)
)
(i32.const 65280)
)
(i32.and
(i32.shr_u
(get_local $0)
(i32.const 8)
)
(i32.const 255)
(i32.and
(i32.shl
(get_local $0)
(i32.const 8)
)
(i32.const 65280)
)
(i32.and
(get_local $0)
(i32.const 0)
(i32.shr_u
(get_local $0)
(i32.const 8)
)
(i32.const 255)
)
)
)
@ -159,34 +153,28 @@
(i32.shr_s
(i32.shl
(i32.or
(i32.or
(i32.shr_s
(i32.shl
(i32.and
(i32.shr_s
(i32.shl
(get_local $0)
(i32.const 24)
)
(i32.const 16)
(i32.shr_s
(i32.shl
(i32.and
(i32.shr_s
(i32.shl
(get_local $0)
(i32.const 24)
)
(i32.const -256)
(i32.const 16)
)
(i32.const 16)
(i32.const -256)
)
(i32.const 16)
)
(i32.and
(i32.shr_s
(get_local $0)
(i32.const 8)
)
(i32.const 255)
)
(i32.const 16)
)
(i32.and
(get_local $0)
(i32.const 0)
(i32.shr_s
(get_local $0)
(i32.const 8)
)
(i32.const 255)
)
)
(i32.const 16)

View File

@ -1981,7 +1981,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 31)
(i32.const 33)
(i32.const 4)
)
(unreachable)
@ -1999,7 +1999,7 @@
(block
(set_local $2
(call "$(lib)/allocator/arena/allocate_memory"
(i32.mul
(i32.shl
(tee_local $3
(select
(tee_local $2
@ -2019,7 +2019,7 @@
)
)
)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2033,11 +2033,11 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.load offset=4
(get_local $0)
)
(i32.const 4)
(i32.const 2)
)
)
(call "$(lib)/allocator/arena/free_memory"
@ -2062,11 +2062,11 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.load offset=8
(get_local $0)
)
(i32.const 4)
(i32.const 2)
)
)
(get_local $1)
@ -2118,9 +2118,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2153,7 +2153,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 49)
(i32.const 51)
(i32.const 4)
)
(unreachable)
@ -2178,9 +2178,9 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
)
@ -2202,21 +2202,21 @@
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(get_local $2)
(i32.const 4)
(i32.const 2)
)
)
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(i32.shl
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.const 4)
(i32.const 2)
)
)
(i32.sub
@ -2265,7 +2265,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 62)
(i32.const 70)
(i32.const 4)
)
(unreachable)

View File

@ -2267,7 +2267,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 31)
(i32.const 33)
(i32.const 4)
)
(unreachable)
@ -2409,23 +2409,25 @@
(get_local $3)
)
(block
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(get_local $2)
(i32.const 4)
(block
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(get_local $2)
(i32.const 4)
)
)
)
(get_local $1)
)
(return
(i32.const 1)
)
(get_local $1)
)
(return
(i32.const 1)
)
)
(set_local $2
@ -2457,7 +2459,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 49)
(i32.const 51)
(i32.const 4)
)
(unreachable)
@ -2481,33 +2483,10 @@
(get_local $3)
)
(block
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(get_local $2)
(i32.const 4)
)
)
)
(get_local $1)
)
(block
(if
(i32.lt_u
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.load offset=8
(get_local $0)
)
)
(call "$(lib)/memory/move_memory"
(block
(if
(i32.eq
(i32.load
(i32.add
(i32.load
(get_local $0)
@ -2517,41 +2496,66 @@
(i32.const 4)
)
)
(i32.add
(i32.load
)
(get_local $1)
)
(block
(if
(i32.lt_u
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.load offset=8
(get_local $0)
)
(i32.mul
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.const 4)
)
)
(i32.sub
(i32.sub
(i32.load offset=8
(call "$(lib)/memory/move_memory"
(i32.add
(i32.load
(get_local $0)
)
(get_local $2)
(i32.mul
(get_local $2)
(i32.const 4)
)
)
(i32.add
(i32.load
(get_local $0)
)
(i32.mul
(i32.add
(get_local $2)
(i32.const 1)
)
(i32.const 4)
)
)
(i32.sub
(i32.sub
(i32.load offset=8
(get_local $0)
)
(get_local $2)
)
(i32.const 1)
)
)
)
(i32.store offset=8
(get_local $0)
(i32.sub
(i32.load offset=8
(get_local $0)
)
(i32.const 1)
)
)
)
(i32.store offset=8
(get_local $0)
(i32.sub
(i32.load offset=8
(get_local $0)
)
(return
(i32.const 1)
)
)
(return
(i32.const 1)
)
)
)
(set_local $2
@ -2581,7 +2585,7 @@
(call $abort
(i32.const 0)
(i32.const 28)
(i32.const 62)
(i32.const 70)
(i32.const 4)
)
(unreachable)

View File

@ -41,7 +41,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 38)
(i32.const 39)
(i32.const 4)
)
(unreachable)
@ -140,7 +140,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 166)
(i32.const 168)
(i32.const 4)
)
(unreachable)
@ -227,7 +227,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 103)
(i32.const 105)
(i32.const 4)
)
(unreachable)
@ -314,7 +314,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 144)
(i32.const 145)
(i32.const 4)
)
(unreachable)
@ -957,7 +957,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 469)
(i32.const 493)
(i32.const 10)
)
(unreachable)

View File

@ -71,7 +71,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 38)
(i32.const 39)
(i32.const 4)
)
(unreachable)
@ -187,7 +187,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 166)
(i32.const 168)
(i32.const 4)
)
(unreachable)
@ -215,7 +215,7 @@
(tee_local $5
(select
(tee_local $5
(get_local $2)
(get_local $3)
)
(tee_local $6
(i32.const 0)
@ -294,7 +294,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 103)
(i32.const 105)
(i32.const 4)
)
(unreachable)
@ -400,7 +400,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 144)
(i32.const 145)
(i32.const 4)
)
(unreachable)
@ -467,31 +467,33 @@
(get_local $4)
)
(block
(if
(i32.eqz
(call "$(lib)/memory/compare_memory"
(i32.add
(block
(if
(i32.eqz
(call "$(lib)/memory/compare_memory"
(i32.add
(get_local $0)
(i32.add
(get_local $0)
(i32.const 4)
)
(i32.shl
(get_local $9)
(i32.const 1)
)
)
(i32.add
(get_local $1)
(i32.const 4)
)
(i32.shl
(get_local $9)
(get_local $8)
(i32.const 1)
)
)
(i32.add
(get_local $1)
(i32.const 4)
)
(i32.shl
(get_local $8)
(i32.const 1)
)
)
)
(return
(get_local $9)
(return
(get_local $9)
)
)
)
(set_local $9
@ -1142,7 +1144,7 @@
(call $abort
(i32.const 0)
(i32.const 72)
(i32.const 469)
(i32.const 493)
(i32.const 10)
)
(unreachable)

View File

@ -81,9 +81,9 @@
(get_local $0)
(i32.const 20)
)
(i32.mul
(i32.shl
(get_local $1)
(i32.const 4)
(i32.const 2)
)
)
(get_local $2)
@ -126,15 +126,15 @@
(get_local $0)
(i32.const 112)
)
(i32.mul
(i32.shl
(i32.add
(i32.mul
(i32.shl
(get_local $1)
(i32.const 32)
(i32.const 5)
)
(get_local $2)
)
(i32.const 4)
(i32.const 2)
)
)
(get_local $3)