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

Tom Stellard via Libclc-dev libclc-dev at lists.llvm.org
Mon Jan 29 04:42:53 PST 2018


On 01/18/2018 03:06 PM, Jan Vesely via Libclc-dev wrote:
> 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>

LGTM.

> ---
>  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)
>  
> 



More information about the Libclc-dev mailing list