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:
parent
9c40495a35
commit
291bfff5db
3 changed files with 13 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue