Mesa (master): gallivm: add lp_create_builder with an unsafe_fpmath option
Marek Olšák
mareko at kemper.freedesktop.org
Tue Nov 15 18:18:16 UTC 2016
Module: Mesa
Branch: master
Commit: 41d20d492087477fd1f0f03e12598970d95e6e1f
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=41d20d492087477fd1f0f03e12598970d95e6e1f
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sat Nov 12 23:08:51 2016 +0100
gallivm: add lp_create_builder with an unsafe_fpmath option
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 14 ++++++++++++++
src/gallium/auxiliary/gallivm/lp_bld_misc.h | 3 +++
2 files changed, 17 insertions(+)
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index bd4d4d3..da3cbdd 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -733,3 +733,17 @@ lp_is_function(LLVMValueRef v)
return llvm::isa<llvm::Function>(llvm::unwrap(v));
#endif
}
+
+extern "C" LLVMBuilderRef
+lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath)
+{
+ LLVMBuilderRef builder = LLVMCreateBuilderInContext(ctx);
+
+ if (unsafe_fpmath) {
+ llvm::FastMathFlags flags;
+ flags.setUnsafeAlgebra();
+ llvm::unwrap(builder)->setFastMathFlags(flags);
+ }
+
+ return builder;
+}
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.h b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
index a55c6bd..c499a6f 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.h
@@ -82,6 +82,9 @@ lp_get_called_value(LLVMValueRef call);
extern bool
lp_is_function(LLVMValueRef v);
+extern LLVMBuilderRef
+lp_create_builder(LLVMContextRef ctx, bool unsafe_fpmath);
+
#ifdef __cplusplus
}
#endif
More information about the mesa-commit
mailing list