summaryrefslogtreecommitdiff
path: root/media-libs/mesa/files/enableFastMath.patch
blob: ab8a25a101d53d843a827b4e4847ad32fa6eaad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 5d61fa4e68b7eb6d481a37efdbb35fdce675a6ad Mon Sep 17 00:00:00 2001
From: Tobias Droste <tdroste@gmx.de>
Date: Wed, 8 Nov 2017 10:44:19 +0100
Subject: gallivm: Use new LLVM fast-math-flags API
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

LLVM 6 changed the API on the fast-math-flags:
https://reviews.llvm.org/rL317488

NOTE: This also enables the new flag 'ApproxFunc' to allow for
approximations for library functions (sin, cos, ...). I'm not completly
convinced, that this is something mesa should do.

Signed-off-by: Tobias Droste <tdroste@gmx.de>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/gallium/auxiliary/gallivm/lp_bld_misc.cpp | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index d988910..1319407 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -830,7 +830,11 @@ lp_create_builder(LLVMContextRef ctx, enum lp_float_mode float_mode)
       llvm::unwrap(builder)->setFastMathFlags(flags);
       break;
    case LP_FLOAT_MODE_UNSAFE_FP_MATH:
+#if HAVE_LLVM >= 0x0600
+      flags.setFast();
+#else
       flags.setUnsafeAlgebra();
+#endif
       llvm::unwrap(builder)->setFastMathFlags(flags);
       break;
    }
-- 
cgit v1.1