[libclc] r323677 - math.h: Set HAVE_HW_FMA32 based on compiler provided macro

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 11:05:08 PST 2018


Author: jvesely
Date: Mon Jan 29 11:05:08 2018
New Revision: 323677

URL: http://llvm.org/viewvc/llvm-project?rev=323677&view=rev
Log:
math.h: Set HAVE_HW_FMA32 based on compiler provided macro

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

Reviewer: Tom Stellard
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Modified:
    libclc/trunk/generic/lib/math/math.h

Modified: libclc/trunk/generic/lib/math/math.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/math/math.h?rev=323677&r1=323676&r2=323677&view=diff
==============================================================================
--- libclc/trunk/generic/lib/math/math.h (original)
+++ libclc/trunk/generic/lib/math/math.h Mon Jan 29 11:05:08 2018
@@ -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)
 




More information about the cfe-commits mailing list