[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 15:38:29 PST 2018


On Mon, 2018-01-29 at 22:15 +0300, Roman Lebedev via cfe-commits wrote:
> On Mon, Jan 29, 2018 at 10:05 PM, Jan Vesely via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > 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__
> 
> Shouldn't that be || and && ?

Yes, that would be more readable. It should work the same though, since
the values are 0 and 1. Do you want to send a patch?

Jan

> 
> > +#define HAVE_HW_FMA32() (0)
> > +#else
> >  #define HAVE_HW_FMA32() (1)
> > +#endif
> > +
> >  #define HAVE_BITALIGN() (0)
> >  #define HAVE_FAST_FMA32() (0)
> > 
> > 
> > 
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180129/ece2916d/attachment.sig>


More information about the cfe-commits mailing list