mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-30 21:52:18 +00:00
Change semantics of f32/f64.MIN_VALUE to match JS's Number.MIN_VALUE
* Also renames MIN_POSITIVE_VALUE to MIN_NORMAL_VALUE * Also adds POSITIVE_INFINITY/NEGATIVE_INFINITY and NaN
This commit is contained in:
@@ -33,16 +33,20 @@
|
||||
(global $~lib/builtins/u64.MAX_VALUE i64 (i64.const -1))
|
||||
(global $~lib/builtins/bool.MIN_VALUE i32 (i32.const 0))
|
||||
(global $~lib/builtins/bool.MAX_VALUE i32 (i32.const 1))
|
||||
(global $~lib/builtins/f32.MIN_VALUE f32 (f32.const -3402823466385288598117041e14))
|
||||
(global $~lib/builtins/f32.MIN_NORMAL_VALUE f32 (f32.const 1.1754943508222875e-38))
|
||||
(global $~lib/builtins/f32.MIN_VALUE f32 (f32.const 1.401298464324817e-45))
|
||||
(global $~lib/builtins/f32.MAX_VALUE f32 (f32.const 3402823466385288598117041e14))
|
||||
(global $~lib/builtins/f32.MIN_SAFE_INTEGER f32 (f32.const -16777215))
|
||||
(global $~lib/builtins/f32.MAX_SAFE_INTEGER f32 (f32.const 16777215))
|
||||
(global $~lib/builtins/f32.EPSILON f32 (f32.const 1.1920928955078125e-07))
|
||||
(global $~lib/builtins/f64.MIN_VALUE f64 (f64.const -1797693134862315708145274e284))
|
||||
(global $~lib/builtins/f32.NaN f32 (f32.const nan:0x400000))
|
||||
(global $~lib/builtins/f64.MIN_NORMAL_VALUE f64 (f64.const 2.2250738585072014e-308))
|
||||
(global $~lib/builtins/f64.MIN_VALUE f64 (f64.const 5e-324))
|
||||
(global $~lib/builtins/f64.MAX_VALUE f64 (f64.const 1797693134862315708145274e284))
|
||||
(global $~lib/builtins/f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
|
||||
(global $~lib/builtins/f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
|
||||
(global $~lib/builtins/f64.EPSILON f64 (f64.const 2.220446049250313e-16))
|
||||
(global $~lib/builtins/f64.NaN f64 (f64.const nan:0x8000000000000))
|
||||
(global $HEAP_BASE i32 (i32.const 48))
|
||||
(table 2 2 anyfunc)
|
||||
(elem (i32.const 0) $null $start~anonymous|1)
|
||||
@@ -2668,8 +2672,8 @@
|
||||
(if
|
||||
(i32.eqz
|
||||
(f32.eq
|
||||
(get_global $~lib/builtins/f32.MIN_VALUE)
|
||||
(f32.const -3402823466385288598117041e14)
|
||||
(get_global $~lib/builtins/f32.MIN_NORMAL_VALUE)
|
||||
(f32.const 1.1754943508222875e-38)
|
||||
)
|
||||
)
|
||||
(block
|
||||
@@ -2682,6 +2686,23 @@
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(f32.eq
|
||||
(get_global $~lib/builtins/f32.MIN_VALUE)
|
||||
(f32.const 1.401298464324817e-45)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 312)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(f32.eq
|
||||
@@ -2693,7 +2714,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 312)
|
||||
(i32.const 313)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2710,7 +2731,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 313)
|
||||
(i32.const 314)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2727,7 +2748,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 314)
|
||||
(i32.const 315)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2744,7 +2765,49 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 315)
|
||||
(i32.const 316)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.and
|
||||
(block $~lib/builtins/isNaN<f32>|inlined.4 (result i32)
|
||||
(set_local $4
|
||||
(get_global $~lib/builtins/f32.NaN)
|
||||
)
|
||||
(f32.ne
|
||||
(get_local $4)
|
||||
(get_local $4)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 317)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(f64.eq
|
||||
(get_global $~lib/builtins/f64.MIN_NORMAL_VALUE)
|
||||
(f64.const 2.2250738585072014e-308)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 318)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2754,14 +2817,14 @@
|
||||
(i32.eqz
|
||||
(f64.eq
|
||||
(get_global $~lib/builtins/f64.MIN_VALUE)
|
||||
(f64.const -1797693134862315708145274e284)
|
||||
(f64.const 5e-324)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 316)
|
||||
(i32.const 319)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2778,7 +2841,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 317)
|
||||
(i32.const 320)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2795,7 +2858,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 318)
|
||||
(i32.const 321)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2812,7 +2875,7 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 319)
|
||||
(i32.const 322)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -2829,7 +2892,32 @@
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 320)
|
||||
(i32.const 323)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(i32.and
|
||||
(block $~lib/builtins/isNaN<f64>|inlined.4 (result i32)
|
||||
(set_local $5
|
||||
(get_global $~lib/builtins/f64.NaN)
|
||||
)
|
||||
(f64.ne
|
||||
(get_local $5)
|
||||
(get_local $5)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $~lib/env/abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 324)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
@@ -3112,7 +3200,7 @@
|
||||
)
|
||||
)
|
||||
(drop
|
||||
(block $~lib/builtins/isNaN<f64>|inlined.4 (result i32)
|
||||
(block $~lib/builtins/isNaN<f64>|inlined.5 (result i32)
|
||||
(set_local $5
|
||||
(f64.const 1)
|
||||
)
|
||||
|
Reference in New Issue
Block a user