mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-22 11:11:43 +00:00
Simplify isFinite & isNaN (#78)
This commit is contained in:
@ -1308,14 +1308,9 @@
|
||||
)
|
||||
)
|
||||
(func $isNaN<f64> (; 12 ;) (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 $~lib/math/NativeMath.atan (; 13 ;) (type $FF) (param $0 f64) (result f64)
|
||||
|
@ -3,8 +3,8 @@
|
||||
(type $FF (func (param f64) (result f64)))
|
||||
(type $f (func (result f32)))
|
||||
(type $Fi (func (param f64) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $FFF (func (param f64 f64) (result f64)))
|
||||
(type $i (func (result i32)))
|
||||
(type $FiF (func (param f64 i32) (result f64)))
|
||||
(type $Ff (func (param f64) (result f32)))
|
||||
(global $std/libm/E f64 (f64.const 2.718281828459045))
|
||||
@ -1557,20 +1557,9 @@
|
||||
)
|
||||
(func $isNaN<f64> (; 12 ;) (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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -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)
|
||||
|
@ -80,20 +80,9 @@
|
||||
(start $start)
|
||||
(func $isNaN<f64> (; 31 ;) (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)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -111,20 +100,12 @@
|
||||
)
|
||||
(func $isFinite<f64> (; 33 ;) (type $Fi) (param $0 f64) (result i32)
|
||||
(return
|
||||
(i64.lt_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.eq
|
||||
(f64.sub
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
(f64.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -427,22 +408,9 @@
|
||||
)
|
||||
(func $isNaN<f32> (; 38 ;) (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)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -458,22 +426,12 @@
|
||||
)
|
||||
(func $isFinite<f32> (; 40 ;) (type $fi) (param $0 f32) (result i32)
|
||||
(return
|
||||
(i64.lt_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.eq
|
||||
(f32.sub
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
(f32.const 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -16,14 +16,9 @@
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $isNaN<f64> (; 2 ;) (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 $~lib/math/NativeMath.mod (; 3 ;) (type $FFF) (param $0 f64) (param $1 f64) (result f64)
|
||||
@ -460,16 +455,9 @@
|
||||
)
|
||||
)
|
||||
(func $isNaN<f32> (; 6 ;) (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 $~lib/math/NativeMathf.mod (; 7 ;) (type $fff) (param $0 f32) (param $1 f32) (result f32)
|
||||
|
@ -2,8 +2,8 @@
|
||||
(type $FFFi (func (param f64 f64 f64) (result i32)))
|
||||
(type $FFF (func (param f64 f64) (result f64)))
|
||||
(type $Fi (func (param f64) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $FFi (func (param f64 f64) (result i32)))
|
||||
(type $i (func (result i32)))
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $F (func (result f64)))
|
||||
(type $fffi (func (param f32 f32 f32) (result i32)))
|
||||
@ -23,20 +23,9 @@
|
||||
(start $start)
|
||||
(func $isNaN<f64> (; 2 ;) (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)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -566,22 +555,9 @@
|
||||
)
|
||||
(func $isNaN<f32> (; 6 ;) (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)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user