[Libclc-dev] [PATCH 1/1] math.h: Set HAVE_HW_FMA32 based on compiler provided macro

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Thu Jan 18 15:06:56 PST 2018


Fixes sin/cos piglits on non-FMA capable asics.
Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35983

Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 generic/lib/math/math.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/generic/lib/math/math.h b/generic/lib/math/math.h
index f46c7ea..0a10991 100644
--- a/generic/lib/math/math.h
+++ b/generic/lib/math/math.h
@@ -31,7 +31,12 @@
 #define PNOR 0x100
 #define PINF 0x200
 
+#if (defined __AMDGCN__ | defined __R600__) & !defined __HAS_FMAF__
+#define HAVE_HW_FMA32() (0)
+#else
 #define HAVE_HW_FMA32() (1)
+#endif
+
 #define HAVE_BITALIGN() (0)
 #define HAVE_FAST_FMA32() (0)
 
-- 
2.14.3



More information about the Libclc-dev mailing list