summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-08-11 18:44:17 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-08-11 18:45:26 +0100
commitb481a1237e00e1e1fb68ffca0653df3a96f21788 (patch)
tree04c3815cc97bab4b16eb2612b6194a9eed742157 /src
parent457378e031ffb89a2011604c7798a6f5f2142207 (diff)
gallivm: Fix and enable the extra Newton/Raphson step in lp_build_rcp().
Thanks to Michal for spotting this.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index cf2feeb163..816ee70119 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -1274,7 +1274,7 @@ lp_build_rcp(struct lp_build_context *bld,
* when we have a better system in place to track minimum precision.
*/
-#if 0
+#if 1
/*
* Do one Newton-Raphson step to improve precision:
*
@@ -1291,7 +1291,7 @@ lp_build_rcp(struct lp_build_context *bld,
res = LLVMBuildFSub(bld->builder, two, res, "");
res = LLVMBuildFMul(bld->builder, res, rcp_a, "");
- return rcp_a;
+ return res;
#else
return lp_build_intrinsic_unary(bld->builder, "llvm.x86.sse.rcp.ps", lp_build_vec_type(type), a);
#endif