Mesa (master): gallivm: Add a note about log2 computation and denormalized numbers.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Sat Jul 23 01:52:32 UTC 2011


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Jul 20 14:53:59 2011 -0700

gallivm: Add a note about log2 computation and denormalized numbers.

---

 src/gallium/auxiliary/gallivm/lp_bld_arit.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 0c075ba..2be8598 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -2465,6 +2465,12 @@ lp_build_log2_approx(struct lp_build_context *bld,
 
       assert(type.floating && type.width == 32);
 
+      /* 
+       * We don't explicitly handle denormalized numbers. They will yield a
+       * result in the neighbourhood of -127, which appears to be adequate
+       * enough.
+       */
+
       i = LLVMBuildBitCast(builder, x, int_vec_type, "");
 
       /* exp = (float) exponent(x) */




More information about the mesa-commit mailing list