[Libclc-dev] [PATCH] Fix definition of INFINITY and add NAN/HUGE_VAL[F]
Aaron Watry
awatry at gmail.com
Mon Jun 16 14:43:47 PDT 2014
Does anyone mind if I commit the infinify/huge_val[f] change now while
we continue discussing the NAN change? The infinity/huge_valf changes
are simple in comparison to the requirements of nan, and I've tested
that the __builtin_inff() and __builtin_huge_valf() implementations
work with the attached CL-based test (runnable via piglit).
--Aaron
On Mon, Jun 16, 2014 at 4:33 AM, Jeroen Ketema <j.ketema at imperial.ac.uk> wrote:
>
> Hi,
>
> Changing the 2 to a 0 works for me with the NVPTX target:
>
> #define NAN __builtin_nanf((const __attribute__((address_space(0))) char
> *)("”))
>
> However, clang turns the builtin into a call into the C math library, which
> is not what we want…
>
> Jeroen
>
> On 15 Jun 2014, at 23:38, Matt Arsenault <arsenm2 at gmail.com> wrote:
>
>
> On Jun 15, 2014, at 3:33 PM, Jeroen Ketema <j.ketema at imperial.ac.uk> wrote:
>
> Hi Matt,
>
> This needs to be replaced with:
>
> :#define NAN __builtin_nanf((const __attribute__((address_space(2))) char
> *)("”))
>
>
> This won’t work with the NVPTX target. It uses 4 as its constant address
> space and not 2 like r600.
>
> Jeroen
>
>
> It turns out this doesn’t really work either. This is what the OS X headers
> use, and the public version of clang this seems to be broken
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: float_specials.cl
Type: application/octet-stream
Size: 849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20140616/8a4af65a/attachment-0002.obj>
More information about the Libclc-dev
mailing list