mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-24 04:01:46 +00:00
Proper isNaN/isFinite without a temp. local
This commit is contained in:
@ -20,23 +20,21 @@
|
||||
(nop)
|
||||
)
|
||||
(func $start (; 2 ;) (type $v)
|
||||
(local $0 f32)
|
||||
(local $1 f64)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i64)
|
||||
(local $5 i64)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i64)
|
||||
(local $3 i64)
|
||||
(drop
|
||||
(select
|
||||
(tee_local $2
|
||||
(tee_local $0
|
||||
(i32.const 1)
|
||||
)
|
||||
(tee_local $3
|
||||
(tee_local $1
|
||||
(i32.const 2)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -57,15 +55,15 @@
|
||||
)
|
||||
(set_global $builtins/i
|
||||
(select
|
||||
(tee_local $2
|
||||
(tee_local $0
|
||||
(i32.const -42)
|
||||
)
|
||||
(i32.sub
|
||||
(i32.const 0)
|
||||
(get_local $2)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $0)
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
@ -87,13 +85,13 @@
|
||||
)
|
||||
(set_global $builtins/i
|
||||
(select
|
||||
(tee_local $2
|
||||
(tee_local $0
|
||||
(i32.const 1)
|
||||
)
|
||||
(i32.const 2)
|
||||
(i32.gt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -117,8 +115,8 @@
|
||||
(i32.const 1)
|
||||
(i32.const 2)
|
||||
(i32.lt_s
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -154,15 +152,15 @@
|
||||
)
|
||||
(set_global $builtins/I
|
||||
(select
|
||||
(tee_local $4
|
||||
(tee_local $2
|
||||
(i64.const -42)
|
||||
)
|
||||
(i64.sub
|
||||
(i64.const 0)
|
||||
(get_local $4)
|
||||
(get_local $2)
|
||||
)
|
||||
(i64.gt_s
|
||||
(get_local $4)
|
||||
(get_local $2)
|
||||
(i64.const 0)
|
||||
)
|
||||
)
|
||||
@ -184,15 +182,15 @@
|
||||
)
|
||||
(set_global $builtins/I
|
||||
(select
|
||||
(tee_local $4
|
||||
(tee_local $2
|
||||
(i64.const 1)
|
||||
)
|
||||
(tee_local $5
|
||||
(tee_local $3
|
||||
(i64.const 2)
|
||||
)
|
||||
(i64.gt_s
|
||||
(get_local $4)
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -216,8 +214,8 @@
|
||||
(i64.const 1)
|
||||
(i64.const 2)
|
||||
(i64.lt_s
|
||||
(get_local $4)
|
||||
(get_local $5)
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -270,27 +268,10 @@
|
||||
(f32.const 1)
|
||||
)
|
||||
(set_global $builtins/b
|
||||
(f32.ne
|
||||
(tee_local $0
|
||||
(f32.const 1.25)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(set_global $builtins/b
|
||||
(select
|
||||
(f32.ne
|
||||
(f32.abs
|
||||
(f32.const 1.25)
|
||||
)
|
||||
(f32.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f32.eq
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $builtins/F
|
||||
(f64.const nan:0x8000000000000)
|
||||
@ -326,27 +307,10 @@
|
||||
(f64.const 1)
|
||||
)
|
||||
(set_global $builtins/b
|
||||
(f64.ne
|
||||
(tee_local $1
|
||||
(f64.const 1.25)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
(set_global $builtins/b
|
||||
(select
|
||||
(f64.ne
|
||||
(f64.abs
|
||||
(f64.const 1.25)
|
||||
)
|
||||
(f64.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f64.eq
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
(set_global $builtins/i
|
||||
(i32.load
|
||||
@ -646,199 +610,5 @@
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(f32.eq
|
||||
(tee_local $0
|
||||
(f32.const nan:0x400000)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 253)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(f64.eq
|
||||
(tee_local $1
|
||||
(f64.const nan:0x8000000000000)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 254)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(select
|
||||
(f32.ne
|
||||
(f32.abs
|
||||
(tee_local $0
|
||||
(f32.const nan:0x400000)
|
||||
)
|
||||
)
|
||||
(f32.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f32.eq
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 255)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(select
|
||||
(f32.ne
|
||||
(f32.abs
|
||||
(tee_local $0
|
||||
(f32.const inf)
|
||||
)
|
||||
)
|
||||
(f32.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f32.eq
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 256)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(select
|
||||
(f64.ne
|
||||
(f64.abs
|
||||
(tee_local $1
|
||||
(f64.const nan:0x8000000000000)
|
||||
)
|
||||
)
|
||||
(f64.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f64.eq
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 257)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(select
|
||||
(f64.ne
|
||||
(f64.abs
|
||||
(tee_local $1
|
||||
(f64.const inf)
|
||||
)
|
||||
)
|
||||
(f64.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f64.eq
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 258)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(select
|
||||
(f32.ne
|
||||
(f32.abs
|
||||
(tee_local $0
|
||||
(f32.const 0)
|
||||
)
|
||||
)
|
||||
(f32.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f32.eq
|
||||
(get_local $0)
|
||||
(get_local $0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 259)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(i32.eqz
|
||||
(select
|
||||
(f64.ne
|
||||
(f64.abs
|
||||
(tee_local $1
|
||||
(f64.const 0)
|
||||
)
|
||||
)
|
||||
(f64.const inf)
|
||||
)
|
||||
(i32.const 0)
|
||||
(f64.eq
|
||||
(get_local $1)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 4)
|
||||
(i32.const 260)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user