|
|
|
@ -557,92 +557,96 @@ Here's an abridged summary of the floating point submodule: |
|
|
|
|
(most of these support the shorthand version too - `RW` in place of `Wr Rd`) |
|
|
|
|
|
|
|
|
|
``` |
|
|
|
|
; IntToFloat |
|
|
|
|
; Convert int to float |
|
|
|
|
(itf Wr Rd) |
|
|
|
|
; FloatToInt (round) |
|
|
|
|
; Convert float to int (round) |
|
|
|
|
(fti Wr Rd) |
|
|
|
|
; FloatToInt (ceil) |
|
|
|
|
; Convert float to int (ceil) |
|
|
|
|
(ftic Wr Rd) |
|
|
|
|
; FloatToInt (floor) |
|
|
|
|
; Convert float to int (floor) |
|
|
|
|
(ftif Wr Rd) |
|
|
|
|
|
|
|
|
|
; FloatTest - nan->invalid, infinities->overflow, positive, negative, zero |
|
|
|
|
; Test properties of a float |
|
|
|
|
; Set flags: |
|
|
|
|
; NaN -> invalid |
|
|
|
|
; Infinities -> overflow |
|
|
|
|
; Positive, negative, zero |
|
|
|
|
(ftst Rd) |
|
|
|
|
; FloatCompare |
|
|
|
|
; Float compare |
|
|
|
|
(fcmp Rd Rd) |
|
|
|
|
; FloatRangeTest |
|
|
|
|
; Float range test |
|
|
|
|
(fcmpr Rd Rd'min Rd'max) |
|
|
|
|
|
|
|
|
|
; FloatRng |
|
|
|
|
; FloatRng. Unlike rng, frng is exclusive in the higher bound |
|
|
|
|
(frng Wr Rd'min Rd'max) |
|
|
|
|
|
|
|
|
|
; --- Basic float arith --- |
|
|
|
|
|
|
|
|
|
; FloatAdd |
|
|
|
|
; Float add |
|
|
|
|
(fadd Wr Rd Rd) |
|
|
|
|
; FloatSub |
|
|
|
|
; Float subtract |
|
|
|
|
(fsub Wr Rd Rd) |
|
|
|
|
; FloatMul |
|
|
|
|
; Float multiply |
|
|
|
|
(fmul Wr Rd Rd) |
|
|
|
|
; FloatPow |
|
|
|
|
; Float power |
|
|
|
|
(fpow Wr Rd Rd'pow) |
|
|
|
|
; FloatRoot |
|
|
|
|
; Float root |
|
|
|
|
(froot Wr Rd Rd'root) |
|
|
|
|
; FloatHyp |
|
|
|
|
; Float hyp - sqrt(a*a + b*b) |
|
|
|
|
(fhyp Wr Rd Rd) |
|
|
|
|
; FloatDiv |
|
|
|
|
; Float divide |
|
|
|
|
(fdiv Wr Wr'rem Rd'a Rd'div) |
|
|
|
|
; FloatMod |
|
|
|
|
; Float modulo |
|
|
|
|
(fmod Wr Rd'a Rd'div) |
|
|
|
|
; FloatAbs |
|
|
|
|
; Float abs value |
|
|
|
|
(fabs Wr Rd) |
|
|
|
|
; FloatSgn |
|
|
|
|
; Float signum (returns -1 or 1) |
|
|
|
|
(fsgn Wr Rd) |
|
|
|
|
|
|
|
|
|
; --- Basic trig --- |
|
|
|
|
|
|
|
|
|
; FloatSin |
|
|
|
|
; Float sine |
|
|
|
|
(fsin Wr Rd) |
|
|
|
|
; FloatAsin |
|
|
|
|
; Float arcsine |
|
|
|
|
(fasin Wr Rd) |
|
|
|
|
; FloatCos |
|
|
|
|
; Float cosine |
|
|
|
|
(fcos Wr Rd) |
|
|
|
|
; FloatAcos |
|
|
|
|
; Float arccosine |
|
|
|
|
(facos Wr Rd) |
|
|
|
|
; FloatTan |
|
|
|
|
; Float tangent |
|
|
|
|
(ftan Wr Rd) |
|
|
|
|
; FloatAtan |
|
|
|
|
; Float arctangent |
|
|
|
|
(fatan Wr Rd) |
|
|
|
|
; FloatAtan2 |
|
|
|
|
; Float 2-argumenmt arctangent |
|
|
|
|
(fatan2 Wr Rd'y Rd'x) |
|
|
|
|
; FloatCot |
|
|
|
|
; Float cotangent |
|
|
|
|
(fcot Wr Rd) |
|
|
|
|
; FloatAcot |
|
|
|
|
; Float arccotangent |
|
|
|
|
(facot Wr Rd) |
|
|
|
|
|
|
|
|
|
; --- Hyperbolic trig --- |
|
|
|
|
|
|
|
|
|
; FloatHypSin |
|
|
|
|
; Float hyperbolic sine |
|
|
|
|
(fsinh Wr Rd) |
|
|
|
|
; FloatHypAsin |
|
|
|
|
; Float hyperbolic arcsine |
|
|
|
|
(fasinh Wr Rd) |
|
|
|
|
; FloatHypCos |
|
|
|
|
; Float hyperbolic cosine |
|
|
|
|
(fcosh Wr Rd) |
|
|
|
|
; FloatHypAcos |
|
|
|
|
; Float hyperbolic arccosine |
|
|
|
|
(facosh Wr Rd) |
|
|
|
|
; FloatHypTan |
|
|
|
|
; Float hyperbolic tangent |
|
|
|
|
(ftanh Wr Rd) |
|
|
|
|
; FloatHypAtan |
|
|
|
|
; Float hyperbolic arctangent |
|
|
|
|
(fatanh Wr Rd) |
|
|
|
|
; FloatHypCot |
|
|
|
|
; Float hyperbolic cotangent |
|
|
|
|
(fcoth Wr Rd) |
|
|
|
|
; FloatHypAcot |
|
|
|
|
; Float hyperbolic arccotangent |
|
|
|
|
(facoth Wr Rd) |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
Wow, thats a lot. I didn't test many of these yet. There may be bugs. |
|
|
|
|
|
|
|
|
|
There are also some pre-defined constants: `PI`, `PI_2`, `TAU`, `E` |
|
|
|
|
There are also some pre-defined constants: `PI`, `PI_2` (½×`PI`), `TAU` (2×`PI`), `E` |
|
|
|
|
|
|
|
|
|
## Buffers Module |
|
|
|
|
|
|
|
|
|