libclc: Add a __builtin to let SPIRV targets select between SW and HW FMA

Reviewer: jenatali jvesely
Differential Revision: https://reviews.llvm.org/D85910
This commit is contained in:
Daniel Stone authored and Jan Vesely committed 2020-09-16 01:37:22 -04:00
1 parent 9c40495a35
commit 291bfff5db
3 files changed
+13

No files matched your search

+3
View File
@@ -40,6 +40,9 @@
#if (defined __AMDGCN__ || defined __R600__) && !defined __HAS_FMAF__
#define HAVE_HW_FMA32() (0)
#elif defined CLC_SPIRV || defined CLC_SPIRV64
bool __attribute__((noinline)) __clc_runtime_has_hw_fma32(void);
#define HAVE_HW_FMA32() __clc_runtime_has_hw_fma32()
#else
#define HAVE_HW_FMA32() (1)
#endif
+5
View File
@@ -4,3 +4,8 @@
#define __CLC_BODY <fma.inc>
#define __FLOAT_ONLY
#include <clc/math/gentype.inc>
bool __clc_runtime_has_hw_fma32()
{
return false;
}
+5
View File
@@ -4,3 +4,8 @@
#define __CLC_BODY <fma.inc>
#define __FLOAT_ONLY
#include <clc/math/gentype.inc>
bool __clc_runtime_has_hw_fma32()
{
return false;
}