bug 1244: update pospopcnt.s assembler comments
[libreriscv.git] / openpower / transcendentals.mdwn
index 38886535528278d172c67e6322a01021e4df0e19..9e6b86118b1f2687e3a14d18851165041faa155b 100644 (file)
@@ -250,8 +250,8 @@ Note (6) 4xf32-only, requires VMX.
 | fmaxmagnum19 | IEEE 754-2019 maximumMagnitudeNumber | FRT = minmaxmag(FRA, FRB, True, fmaxnum19) (2) | Zfminmax    |
 | fminmagc     | C ternary-op minimum magnitude       | FRT = minmaxmag(FRA, FRB, False, fminc) (2)    | Zfminmax    |
 | fmaxmagc     | C ternary-op maximum magnitude       | FRT = minmaxmag(FRA, FRB, True, fmaxc) (2)     | Zfminmax    |
-| fmod         | modulus                              | FRT = fmod(FRA, FRB)                           | TBD         |
-| fremainder   | IEEE 754 remainder                   | FRT = remainder(FRA, FRB)                      | TBD         |
+| fmod         | modulus                              | FRT = fmod(FRA, FRB)                           | ZftransExt  |
+| fremainder   | IEEE 754 remainder                   | FRT = remainder(FRA, FRB)                      | ZftransExt  |
 
 Note (1): for the purposes of minNum/maxNum, -0.0 is defined to be less than +0.0. This is left unspecified in IEEE 754-2008.
 
@@ -397,7 +397,7 @@ They are therefore considered "base" (essential) transcendentals.
 
 ### ZftransExt
 
-LOG, EXP, EXP10, LOG10, LOGP1, EXP1M
+LOG, EXP, EXP10, LOG10, LOGP1, EXP1M, fmod, fremainder
 
 These are extra transcendental functions that are useful, not generally
 needed for 3D, however for Numerical Computation they may be useful.
@@ -436,6 +436,11 @@ CBRT, POW, POWN, POWR, ROOTN
 These are simply much more complex to implement in hardware, and typically
 will only be put into HPC applications.
 
+Note that `pow` is commonly used in Blinn-Phong shading (the shading model used
+by OpenGL 1.0 and commonly used by shader authors that need basic 3D graphics
+with specular highlights), however it can be sufficiently emulated using
+`pow(b, n) = exp2(n*log2(b))`.
+
 * **Zfrsqrt**: Reciprocal square-root.
 
 ## Trigonometric subsets
@@ -529,6 +534,10 @@ high-performance or correctly-rounding):
 
     ASINH( x ) = ln( x + SQRT(x**2+1))
 
+`pow` sufficient for 3D Graphics:
+
+    pow(b, x) = exp2(x * log2(b))
+
 # Evaluation and commentary
 
 Moved to [[discussion]]