diff --git a/libclc/generic/lib/math/math.h b/libclc/generic/lib/math/math.h index c931d19a380c..351e37dc3f12 100644 --- a/libclc/generic/lib/math/math.h +++ b/libclc/generic/lib/math/math.h @@ -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 diff --git a/libclc/spirv/lib/math/fma.cl b/libclc/spirv/lib/math/fma.cl index 982ddc4374f3..79142425e52d 100644 --- a/libclc/spirv/lib/math/fma.cl +++ b/libclc/spirv/lib/math/fma.cl @@ -4,3 +4,8 @@ #define __CLC_BODY #define __FLOAT_ONLY #include + +bool __clc_runtime_has_hw_fma32() +{ + return false; +} diff --git a/libclc/spirv64/lib/math/fma.cl b/libclc/spirv64/lib/math/fma.cl index 982ddc4374f3..79142425e52d 100644 --- a/libclc/spirv64/lib/math/fma.cl +++ b/libclc/spirv64/lib/math/fma.cl @@ -4,3 +4,8 @@ #define __CLC_BODY #define __FLOAT_ONLY #include + +bool __clc_runtime_has_hw_fma32() +{ + return false; +}