Mesa (master): gallium/tgsi: correct typo propagated from NV_vertex_program1_1

Brian Paul brianp at kemper.freedesktop.org
Fri Feb 7 15:26:49 UTC 2014


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

Author: Erik Faye-Lund <kusmabite at gmail.com>
Date:   Fri Feb  7 13:45:11 2014 +0100

gallium/tgsi: correct typo propagated from NV_vertex_program1_1

In the specification text of NV_vertex_program1_1, the upper
limit of the RCC instruction is written as 1.884467e+19 in
scientific notation, but as 0x5F800000 in binary. But the binary
version translates to 1.84467e+19 rather than 1.884467e+19 in
scientific notation.

Since the lower-limit equals 2^-64 and the binary version equals
2^+64, let's assume the value in scientific notation is a typo
and implement this using the value from the binary version
instead.

Signed-off-by: Erik Faye-Lund <kusmabite at gmail.com>
Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/auxiliary/tgsi/tgsi_exec.c |    4 ++--
 src/gallium/docs/source/tgsi.rst       |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 96809cd..55da60a 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -915,9 +915,9 @@ micro_rcc(union tgsi_exec_channel *dst,
       float recip = 1.0f / src->f[i];
 
       if (recip > 0.0f)
-         dst->f[i] = CLAMP(recip, 5.42101e-020f, 1.884467e+019f);
+         dst->f[i] = CLAMP(recip, 5.42101e-020f, 1.84467e+019f);
       else
-         dst->f[i] = CLAMP(recip, -1.884467e+019f, -5.42101e-020f);
+         dst->f[i] = CLAMP(recip, -1.84467e+019f, -5.42101e-020f);
    }
 }
 
diff --git a/src/gallium/docs/source/tgsi.rst b/src/gallium/docs/source/tgsi.rst
index 0501aca..be42572 100644
--- a/src/gallium/docs/source/tgsi.rst
+++ b/src/gallium/docs/source/tgsi.rst
@@ -424,7 +424,7 @@ XXX cleanup on aisle three
 
 .. math::
 
-  dst = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.884467e+019) : clamp(1 / src.x, -1.884467e+019, -5.42101e-020)
+  dst = (1 / src.x) > 0 ? clamp(1 / src.x, 5.42101e-020, 1.84467e+019) : clamp(1 / src.x, -1.84467e+019, -5.42101e-020)
 
 
 .. opcode:: DPH - Homogeneous Dot Product




More information about the mesa-commit mailing list