mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 12:11:50 +00:00
Inline isNaN and isFinite
Looking at our existing tests it seems that inlining these can be performed by reusing locals most of the time, and sometimes enables erasing quite a bit of unnecessary code when optimizing.
This commit is contained in:
@ -8598,7 +8598,8 @@
|
||||
)
|
||||
)
|
||||
(set_local $7
|
||||
(call $~lib/builtins/isNaN<f64>
|
||||
(f64.ne
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
@ -8994,14 +8995,18 @@
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(call $~lib/builtins/isNaN<f32>
|
||||
(f32.ne
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(get_local $3)
|
||||
(i32.and
|
||||
(get_local $3)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(set_local $3
|
||||
(i32.eq
|
||||
@ -9011,7 +9016,10 @@
|
||||
)
|
||||
)
|
||||
(if
|
||||
(get_local $3)
|
||||
(i32.and
|
||||
(get_local $3)
|
||||
(i32.const 1)
|
||||
)
|
||||
(return
|
||||
(f32.div
|
||||
(tee_local $0
|
||||
|
Reference in New Issue
Block a user