Simplify isFinite & isNaN (#78)

This commit is contained in:
Max Graey
2018-04-18 16:14:24 +03:00
committed by Daniel Wirtz
parent 5a2f834c0d
commit a15457d8b9
13 changed files with 132 additions and 409 deletions

View File

@ -4,7 +4,6 @@
(type $FiF (func (param f64 i32) (result f64)))
(type $fff (func (param f32 f32) (result f32)))
(type $fi (func (param f32) (result i32)))
(type $i (func (result i32)))
(type $f (func (result f32)))
(type $fif (func (param f32 i32) (result f32)))
(type $Fi (func (param f64) (result i32)))
@ -1721,22 +1720,9 @@
)
(func $isNaN<f32> (; 2 ;) (type $fi) (param $0 f32) (result i32)
(return
(i64.gt_u
(i64.and
(i64.reinterpret/f64
(f64.promote/f32
(get_local $0)
)
)
(i64.shr_u
(i64.const -1)
(i64.const 1)
)
)
(i64.shl
(i64.const 2047)
(i64.const 52)
)
(f32.ne
(get_local $0)
(get_local $0)
)
)
)
@ -3624,20 +3610,9 @@
)
(func $isNaN<f64> (; 6 ;) (type $Fi) (param $0 f64) (result i32)
(return
(i64.gt_u
(i64.and
(i64.reinterpret/f64
(get_local $0)
)
(i64.shr_u
(i64.const -1)
(i64.const 1)
)
)
(i64.shl
(i64.const 2047)
(i64.const 52)
)
(f64.ne
(get_local $0)
(get_local $0)
)
)
)