mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 09:51:33 +00:00
Optimize some std mem methods by replacing expensive rem operations to fast bit logic (#24)
This commit is contained in:
@ -106,13 +106,13 @@
|
||||
(local $4 i32)
|
||||
(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
|
||||
@ -151,9 +151,9 @@
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.rem_u
|
||||
(i32.and
|
||||
(get_local $0)
|
||||
(i32.const 4)
|
||||
(i32.const 3)
|
||||
)
|
||||
)
|
||||
(block
|
||||
@ -355,9 +355,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)
|
||||
)
|
||||
@ -1726,21 +1726,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
|
||||
@ -1862,24 +1862,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
|
||||
|
Reference in New Issue
Block a user