Support parameter properties; Minor formatting

This commit is contained in:
dcodeIO
2018-03-25 00:21:58 +01:00
parent c80bf35747
commit 38a025950e
17 changed files with 314 additions and 234 deletions

View File

@ -258,10 +258,8 @@
)
)
(f64.mul
(tee_local $0
(f64.convert_s/i32
(get_local $2)
)
(f64.convert_s/i32
(get_local $2)
)
(f64.const 1.9082149292705877e-10)
)
@ -271,7 +269,9 @@
(get_local $4)
)
(f64.mul
(get_local $0)
(f64.convert_s/i32
(get_local $2)
)
(f64.const 0.6931471803691238)
)
)

View File

@ -16,17 +16,17 @@
(start $start)
(func "$(lib)/math/Math.log" (; 3 ;) (type $FF) (param $0 f64) (result f64)
(local $1 i64)
(local $2 f64)
(local $3 f64)
(local $4 f64)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 f64)
(local $6 f64)
(local $7 f64)
(local $8 f64)
(local $9 f64)
(local $10 f64)
(local $11 i32)
(local $12 i32)
(local $11 f64)
(local $12 f64)
(local $13 i32)
(nop)
(set_local $1
@ -34,8 +34,7 @@
(get_local $0)
)
)
(nop)
(set_local $11
(set_local $2
(i32.wrap/i64
(i64.shr_u
(get_local $1)
@ -43,22 +42,22 @@
)
)
)
(set_local $12
(set_local $3
(i32.const 0)
)
(if
(i32.and
(if (result i32)
(tee_local $13
(tee_local $4
(i32.lt_u
(get_local $11)
(get_local $2)
(i32.const 1048576)
)
)
(get_local $13)
(get_local $4)
(i32.and
(i32.shr_u
(get_local $11)
(get_local $2)
(i32.const 31)
)
(i32.const 1)
@ -87,7 +86,7 @@
)
(if
(i32.shr_u
(get_local $11)
(get_local $2)
(i32.const 31)
)
(return
@ -100,9 +99,9 @@
)
)
)
(set_local $12
(set_local $3
(i32.sub
(get_local $12)
(get_local $3)
(i32.const 54)
)
)
@ -117,7 +116,7 @@
(get_local $0)
)
)
(set_local $11
(set_local $2
(i32.wrap/i64
(i64.shr_u
(get_local $1)
@ -128,7 +127,7 @@
)
(if
(i32.ge_u
(get_local $11)
(get_local $2)
(i32.const 2146435072)
)
(return
@ -137,9 +136,9 @@
(if
(i32.and
(if (result i32)
(tee_local $13
(tee_local $4
(i32.eq
(get_local $11)
(get_local $2)
(i32.const 1072693248)
)
)
@ -150,7 +149,7 @@
)
(i64.const 0)
)
(get_local $13)
(get_local $4)
)
(i32.const 1)
)
@ -160,31 +159,31 @@
)
)
)
(set_local $11
(set_local $2
(i32.add
(get_local $11)
(get_local $2)
(i32.sub
(i32.const 1072693248)
(i32.const 1072079006)
)
)
)
(set_local $12
(set_local $3
(i32.add
(get_local $12)
(get_local $3)
(i32.sub
(i32.shr_s
(get_local $11)
(get_local $2)
(i32.const 20)
)
(i32.const 1023)
)
)
)
(set_local $11
(set_local $2
(i32.add
(i32.and
(get_local $11)
(get_local $2)
(i32.const 1048575)
)
(i32.const 1072079006)
@ -194,7 +193,7 @@
(i64.or
(i64.shl
(i64.extend_u/i32
(get_local $11)
(get_local $2)
)
(i64.const 32)
)
@ -209,53 +208,53 @@
(get_local $1)
)
)
(set_local $3
(set_local $5
(f64.sub
(get_local $0)
(f64.const 1)
)
)
(set_local $2
(set_local $6
(f64.mul
(f64.mul
(f64.const 0.5)
(get_local $3)
(get_local $5)
)
(get_local $3)
)
)
(set_local $4
(f64.div
(get_local $3)
(f64.add
(f64.const 2)
(get_local $3)
)
)
)
(set_local $5
(f64.mul
(get_local $4)
(get_local $4)
(get_local $5)
)
)
(set_local $7
(f64.mul
(get_local $5)
(f64.div
(get_local $5)
(f64.add
(f64.const 2)
(get_local $5)
)
)
)
(set_local $8
(f64.mul
(get_local $7)
(get_local $7)
)
)
(set_local $9
(f64.mul
(get_local $8)
(get_local $8)
)
)
(set_local $10
(f64.mul
(get_local $9)
(f64.add
(f64.const 0.3999999999940942)
(f64.mul
(get_local $7)
(get_local $9)
(f64.add
(f64.const 0.22222198432149784)
(f64.mul
(get_local $7)
(get_local $9)
(f64.const 0.15313837699209373)
)
)
@ -263,21 +262,21 @@
)
)
)
(set_local $9
(set_local $11
(f64.mul
(get_local $5)
(get_local $8)
(f64.add
(f64.const 0.6666666666666735)
(f64.mul
(get_local $7)
(get_local $9)
(f64.add
(f64.const 0.2857142874366239)
(f64.mul
(get_local $7)
(get_local $9)
(f64.add
(f64.const 0.1818357216161805)
(f64.mul
(get_local $7)
(get_local $9)
(f64.const 0.14798198605116586)
)
)
@ -287,16 +286,14 @@
)
)
)
(set_local $6
(set_local $12
(f64.add
(get_local $9)
(get_local $8)
(get_local $11)
(get_local $10)
)
)
(set_local $10
(f64.convert_s/i32
(get_local $12)
)
(set_local $13
(get_local $3)
)
(return
(f64.add
@ -304,23 +301,27 @@
(f64.sub
(f64.add
(f64.mul
(get_local $4)
(get_local $7)
(f64.add
(get_local $2)
(get_local $6)
(get_local $12)
)
)
(f64.mul
(get_local $10)
(f64.convert_s/i32
(get_local $13)
)
(f64.const 1.9082149292705877e-10)
)
)
(get_local $2)
(get_local $6)
)
(get_local $3)
(get_local $5)
)
(f64.mul
(get_local $10)
(f64.convert_s/i32
(get_local $13)
)
(f64.const 0.6931471803691238)
)
)
@ -328,8 +329,8 @@
)
(func "$(lib)/math/Mathf.log" (; 4 ;) (type $ff) (param $0 f32) (result f32)
(local $1 i32)
(local $2 f32)
(local $3 f32)
(local $2 i32)
(local $3 i32)
(local $4 f32)
(local $5 f32)
(local $6 f32)
@ -337,35 +338,30 @@
(local $8 f32)
(local $9 f32)
(local $10 f32)
(local $11 i32)
(local $12 i32)
(local $13 i32)
(local $11 f32)
(local $12 f32)
(nop)
(set_local $1
(i32.reinterpret/f32
(get_local $0)
)
)
(nop)
(set_local $11
(get_local $1)
)
(set_local $12
(set_local $2
(i32.const 0)
)
(if
(i32.and
(if (result i32)
(tee_local $13
(tee_local $3
(i32.lt_u
(get_local $11)
(get_local $1)
(i32.const 8388608)
)
)
(get_local $13)
(get_local $3)
(i32.and
(i32.shr_u
(get_local $11)
(get_local $1)
(i32.const 31)
)
(i32.const 1)
@ -377,7 +373,7 @@
(if
(i32.eq
(i32.shl
(get_local $11)
(get_local $1)
(i32.const 1)
)
(i32.const 0)
@ -394,7 +390,7 @@
)
(if
(i32.shr_u
(get_local $11)
(get_local $1)
(i32.const 31)
)
(return
@ -407,9 +403,9 @@
)
)
)
(set_local $12
(set_local $2
(i32.sub
(get_local $12)
(get_local $2)
(i32.const 25)
)
)
@ -424,13 +420,10 @@
(get_local $0)
)
)
(set_local $11
(get_local $1)
)
)
(if
(i32.ge_u
(get_local $11)
(get_local $1)
(i32.const 2139095040)
)
(return
@ -438,7 +431,7 @@
)
(if
(i32.eq
(get_local $11)
(get_local $1)
(i32.const 1065353216)
)
(return
@ -447,31 +440,31 @@
)
)
)
(set_local $11
(set_local $1
(i32.add
(get_local $11)
(get_local $1)
(i32.sub
(i32.const 1065353216)
(i32.const 1060439283)
)
)
)
(set_local $12
(set_local $2
(i32.add
(get_local $12)
(get_local $2)
(i32.sub
(i32.shr_s
(get_local $11)
(get_local $1)
(i32.const 23)
)
(i32.const 127)
)
)
)
(set_local $11
(set_local $1
(i32.add
(i32.and
(get_local $11)
(get_local $1)
(i32.const 8388607)
)
(i32.const 1060439283)
@ -479,34 +472,34 @@
)
(set_local $0
(f32.reinterpret/i32
(get_local $11)
(get_local $1)
)
)
(set_local $3
(set_local $4
(f32.sub
(get_local $0)
(f32.const 1)
)
)
(set_local $4
(set_local $5
(f32.div
(get_local $3)
(get_local $4)
(f32.add
(f32.const 2)
(get_local $3)
(get_local $4)
)
)
)
(set_local $5
(set_local $6
(f32.mul
(get_local $4)
(get_local $4)
(get_local $5)
(get_local $5)
)
)
(set_local $7
(f32.mul
(get_local $5)
(get_local $5)
(get_local $6)
(get_local $6)
)
)
(set_local $8
@ -523,7 +516,7 @@
)
(set_local $9
(f32.mul
(get_local $5)
(get_local $6)
(f32.add
(f32.const 0.6666666269302368)
(f32.mul
@ -533,24 +526,24 @@
)
)
)
(set_local $6
(set_local $10
(f32.add
(get_local $9)
(get_local $8)
)
)
(set_local $2
(set_local $11
(f32.mul
(f32.mul
(f32.const 0.5)
(get_local $3)
(get_local $4)
)
(get_local $3)
(get_local $4)
)
)
(set_local $10
(set_local $12
(f32.convert_s/i32
(get_local $12)
(get_local $2)
)
)
(return
@ -559,23 +552,23 @@
(f32.sub
(f32.add
(f32.mul
(get_local $4)
(get_local $5)
(f32.add
(get_local $2)
(get_local $6)
(get_local $11)
(get_local $10)
)
)
(f32.mul
(get_local $10)
(get_local $12)
(f32.const 9.05800061445916e-06)
)
)
(get_local $2)
(get_local $11)
)
(get_local $3)
(get_local $4)
)
(f32.mul
(get_local $10)
(get_local $12)
(f32.const 0.6931381225585938)
)
)