Mesa (master): llvmpipe: Fix bad SI -> FP conversion into lp_build_log2_approx.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Tue Dec 15 13:16:47 UTC 2009


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Tue Dec 15 12:13:43 2009 +0000

llvmpipe: Fix bad SI -> FP conversion into lp_build_log2_approx.

It should be a bitcast  as the integer value is actually an encoded FP
already.

---

 src/gallium/drivers/llvmpipe/lp_bld_arit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c
index 9c59677..4fd459e 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c
@@ -1285,7 +1285,7 @@ lp_build_log2_approx(struct lp_build_context *bld,
       /* mant = (float) mantissa(x) */
       mant = LLVMBuildAnd(bld->builder, i, mantmask, "");
       mant = LLVMBuildOr(bld->builder, mant, one, "");
-      mant = LLVMBuildSIToFP(bld->builder, mant, vec_type, "");
+      mant = LLVMBuildBitCast(bld->builder, mant, vec_type, "");
 
       logmant = lp_build_polynomial(bld, mant, lp_build_log2_polynomial,
                                     Elements(lp_build_log2_polynomial));




More information about the mesa-commit mailing list