aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_arit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_arit.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_arit.c6
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 5d6a0335654..114c76665f9 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_arit.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_arit.c
@@ -270,6 +270,12 @@ lp_build_fmuladd(LLVMBuilderRef builder,
LLVMTypeRef type = LLVMTypeOf(a);
assert(type == LLVMTypeOf(b));
assert(type == LLVMTypeOf(c));
+ if (HAVE_LLVM < 0x0304) {
+ /* XXX: LLVM 3.3 does not breakdown llvm.fmuladd into mul+add when FMA is
+ * not supported, and instead it falls-back to a C function.
+ */
+ return LLVMBuildFAdd(builder, LLVMBuildFMul(builder, a, b, ""), c, "");
+ }
char intrinsic[32];
lp_format_intrinsic(intrinsic, sizeof intrinsic, "llvm.fmuladd", type);
LLVMValueRef args[] = { a, b, c };