Mesa (master): program: Use exp2(x) instead of pow(2.0, x).

Matt Turner mattst88 at kemper.freedesktop.org
Wed Jul 29 16:32:06 UTC 2015


Module: Mesa
Branch: master
Commit: b73782bf184b7053026e8dda54800d48e64e20da
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b73782bf184b7053026e8dda54800d48e64e20da

Author: Matt Turner <mattst88 at gmail.com>
Date:   Mon Jul 13 15:19:33 2015 -0700

program: Use exp2(x) instead of pow(2.0, x).

---

 src/mesa/program/prog_execute.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/program/prog_execute.c b/src/mesa/program/prog_execute.c
index 46260b5..77274e2 100644
--- a/src/mesa/program/prog_execute.c
+++ b/src/mesa/program/prog_execute.c
@@ -723,7 +723,7 @@ _mesa_execute_program(struct gl_context * ctx,
                 * result.z = result.x * APPX(result.y)
                 * We do what the ARB extension says.
                 */
-               q[2] = (GLfloat) pow(2.0, t[0]);
+               q[2] = exp2f(t[0]);
             }
             q[1] = t[0] - floor_t0;
             q[3] = 1.0F;
@@ -734,7 +734,7 @@ _mesa_execute_program(struct gl_context * ctx,
          {
             GLfloat a[4], result[4], val;
             fetch_vector1(&inst->SrcReg[0], machine, a);
-            val = (GLfloat) pow(2.0, a[0]);
+            val = exp2f(a[0]);
             /*
             if (IS_INF_OR_NAN(val))
                val = 1.0e10;




More information about the mesa-commit mailing list