summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-10-16 01:42:57 +0100
committerJosé Fonseca <[email protected]>2011-10-16 14:18:41 +0100
commite9c1d87ce73eb3da829d5124cc5f4716d79e8973 (patch)
tree966eafd2779237cc281d23d3bd8307838fb0770d /src/gallium/auxiliary/gallivm
parent1350882e4950bc957e60e68a685b8fea08693e13 (diff)
llvmpipe: Use lp_build_ifloor_fract for exp2 calculation.
Instead of separate ifloor / fract calls. No change for SSE4.1 code, but less FP<->SI conversions on non SSE4.1 systems.
Diffstat (limited to 'src/gallium/auxiliary/gallivm')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index 2be8598704e..a15dcb085f5 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -2255,7 +2255,6 @@ lp_build_exp2_approx(struct lp_build_context *bld,
LLVMBuilderRef builder = bld->gallivm->builder;
const struct lp_type type = bld->type;
LLVMTypeRef vec_type = lp_build_vec_type(bld->gallivm, type);
- LLVMTypeRef int_vec_type = lp_build_int_vec_type(bld->gallivm, type);
LLVMValueRef ipart = NULL;
LLVMValueRef fpart = NULL;
LLVMValueRef expipart = NULL;
@@ -2278,15 +2277,12 @@ lp_build_exp2_approx(struct lp_build_context *bld,
x = lp_build_max(bld, x, lp_build_const_vec(bld->gallivm, type, -126.99999));
/* ipart = floor(x) */
- ipart = lp_build_floor(bld, x);
-
/* fpart = x - ipart */
- fpart = LLVMBuildFSub(builder, x, ipart, "");
+ lp_build_ifloor_fract(bld, x, &ipart, &fpart);
}
if(p_exp2_int_part || p_exp2) {
/* expipart = (float) (1 << ipart) */
- ipart = LLVMBuildFPToSI(builder, ipart, int_vec_type, "");
expipart = LLVMBuildAdd(builder, ipart,
lp_build_const_int_vec(bld->gallivm, type, 127), "");
expipart = LLVMBuildShl(builder, expipart,