summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_arit.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-08-09 17:26:18 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-08-09 17:31:18 +0100
commit8a3a971743a90463e65b44f1769a5301a31ce4cd (patch)
tree4ce0ffe09478b1ddaaa3697451d08532f8015d3c /src/gallium/auxiliary/gallivm/lp_bld_arit.c
parentfc9a49b638c26801951c33a570178bbb2b67ec60 (diff)
gallivm: Don't call LLVMBuildFNeg on llvm-2.6.
It didn't exist yet.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_arit.c b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
index d2dde41e9f..cecc1858bc 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -512,10 +512,7 @@ lp_build_mul_imm(struct lp_build_context *bld,
return a;
if(b == -1)
- if (bld->type.floating)
- return LLVMBuildFNeg(bld->builder, a, "");
- else
- return LLVMBuildNeg(bld->builder, a, "");
+ return lp_build_negate(bld, a);
if(b == 2 && bld->type.floating)
return lp_build_add(bld, a, a);
@@ -748,9 +745,11 @@ LLVMValueRef
lp_build_negate(struct lp_build_context *bld,
LLVMValueRef a)
{
+#if HAVE_LLVM >= 0x0207
if (bld->type.floating)
a = LLVMBuildFNeg(bld->builder, a, "");
else
+#endif
a = LLVMBuildNeg(bld->builder, a, "");
return a;