Improve Math#sign (#72)

This commit is contained in:
Max Graey
2018-04-12 20:26:50 +03:00
committed by Daniel Wirtz
parent 2002e32c9c
commit 1cea3c6f08
5 changed files with 40 additions and 50 deletions

View File

@ -6839,18 +6839,16 @@
(br $~lib/math/NativeMath.sign|inlined.0
(if (result f64)
(f64.gt
(get_local $1)
(f64.abs
(get_local $1)
)
(f64.const 0)
)
(f64.const 1)
(if (result f64)
(f64.lt
(get_local $1)
(f64.const 0)
)
(f64.const -1)
(f64.copysign
(f64.const 1)
(get_local $1)
)
(get_local $1)
)
)
)