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

@ -69,14 +69,9 @@
(export "memory" (memory $0))
(start $start)
(func $isNaN<f64> (; 31 ;) (type $Fi) (param $0 f64) (result i32)
(i64.gt_u
(i64.and
(i64.reinterpret/f64
(get_local $0)
)
(i64.const 9223372036854775807)
)
(i64.const 9218868437227405312)
(f64.ne
(get_local $0)
(get_local $0)
)
)
(func $std/math/signbit (; 32 ;) (type $Fi) (param $0 f64) (result i32)
@ -90,14 +85,12 @@
)
)
(func $isFinite<f64> (; 33 ;) (type $Fi) (param $0 f64) (result i32)
(i64.lt_u
(i64.and
(i64.reinterpret/f64
(get_local $0)
)
(i64.const 9223372036854775807)
(f64.eq
(f64.sub
(get_local $0)
(get_local $0)
)
(i64.const 9218868437227405312)
(f64.const 0)
)
)
(func $std/math/eulp (; 34 ;) (type $Fi) (param $0 f64) (result i32)
@ -374,16 +367,9 @@
(i32.const 1)
)
(func $isNaN<f32> (; 38 ;) (type $fi) (param $0 f32) (result i32)
(i64.gt_u
(i64.and
(i64.reinterpret/f64
(f64.promote/f32
(get_local $0)
)
)
(i64.const 9223372036854775807)
)
(i64.const 9218868437227405312)
(f32.ne
(get_local $0)
(get_local $0)
)
)
(func $std/math/signbitf (; 39 ;) (type $fi) (param $0 f32) (result i32)
@ -395,16 +381,12 @@
)
)
(func $isFinite<f32> (; 40 ;) (type $fi) (param $0 f32) (result i32)
(i64.lt_u
(i64.and
(i64.reinterpret/f64
(f64.promote/f32
(get_local $0)
)
)
(i64.const 9223372036854775807)
(f32.eq
(f32.sub
(get_local $0)
(get_local $0)
)
(i64.const 9218868437227405312)
(f32.const 0)
)
)
(func $std/math/eulpf (; 41 ;) (type $fi) (param $0 f32) (result i32)