[PATCH 1/2] Fix implementation of copysign

This was previously implemented with a macro and we were using
__builtin_copysign(), which takes double inputs for the float
version of copysign().

Reviewed-by: Aaron Watry <awatry@gmail.com>

This fixes the atan2 issue I was running into on evergreen as well, so
feel free to add:
Tested-by: Aaron Watry <awatry@gmail.com>

--Aaron

The good news: It's almost identical to a WIP patch that I hadn't
sent into the list yet (besides the usage of
<clc/relational/floatn.inc> in my version).

The bad news: It results in the following for both EG and SI for me:

LLVM triggered Diagnostic Handler: unsupported call to function fabsf
in test_1_isinf_float
Segmentation fault (core dumped)

Curiously, the fabs() tests that I just wrote seem to be ok (which
uses the llvm.fabs intrinsic)

kernel and bitcode of builtin-float-isinf-1.0.generated.cl (just the
scalar float test) is attached just in case it helps.

--Aaron

isinf.cl (336 Bytes)

isinf.ll (1.74 KB)

Reviewed-by: Aaron Watry <awatry@gmail.com>

This fixes the atan2 issue I was running into on evergreen as well, so
feel free to add:
Tested-by: Aaron Watry <awatry@gmail.com>

it also fixes a piglit I've just posted.
LGTM

jan

The good news: It's almost identical to a WIP patch that I hadn't
sent into the list yet (besides the usage of
<clc/relational/floatn.inc> in my version).

The bad news: It results in the following for both EG and SI for me:

LLVM triggered Diagnostic Handler: unsupported call to function fabsf
in test_1_isinf_float
Segmentation fault (core dumped)

This should be fixed with this clang patch:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140901/114007.html

-Tom

> The good news: It's almost identical to a WIP patch that I hadn't
> sent into the list yet (besides the usage of
> <clc/relational/floatn.inc> in my version).
>
> The bad news: It results in the following for both EG and SI for me:
>
> LLVM triggered Diagnostic Handler: unsupported call to function fabsf
> in test_1_isinf_float
> Segmentation fault (core dumped)
>

This should be fixed with this clang patch:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140901/114007.html

with that patch is passes the piglit on my TURKS

LGTM

do you plan to add the remaining ops that have buitin implementation
(isfinite, islessgreater, isnormal, unordered)?

jan

> > The good news: It's almost identical to a WIP patch that I hadn't
> > sent into the list yet (besides the usage of
> > <clc/relational/floatn.inc> in my version).
> >
> > The bad news: It results in the following for both EG and SI for me:
> >
> > LLVM triggered Diagnostic Handler: unsupported call to function fabsf
> > in test_1_isinf_float
> > Segmentation fault (core dumped)
> >
>
> This should be fixed with this clang patch:
>
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140901/114007.html

with that patch is passes the piglit on my TURKS

LGTM

do you plan to add the remaining ops that have buitin implementation
(isfinite, islessgreater, isnormal, unordered)?

Yes, but I'm not sure when I'll get to it.

-Tom

> > > The good news: It's almost identical to a WIP patch that I hadn't
> > > sent into the list yet (besides the usage of
> > > <clc/relational/floatn.inc> in my version).
> > >
> > > The bad news: It results in the following for both EG and SI for me:
> > >
> > > LLVM triggered Diagnostic Handler: unsupported call to function fabsf
> > > in test_1_isinf_float
> > > Segmentation fault (core dumped)
> > >
> >
> > This should be fixed with this clang patch:
> >
> > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140901/114007.html
>
> with that patch is passes the piglit on my TURKS
>
> LGTM
>
> do you plan to add the remaining ops that have buitin implementation
> (isfinite, islessgreater, isnormal, unordered)?

Yes, but I'm not sure when I'll get to it.

I have these patches ready, so unless you planned to do something else
than simple copy+paste+replace, I can post them.

jan

> > > > The good news: It's almost identical to a WIP patch that I hadn't
> > > > sent into the list yet (besides the usage of
> > > > <clc/relational/floatn.inc> in my version).
> > > >
> > > > The bad news: It results in the following for both EG and SI for me:
> > > >
> > > > LLVM triggered Diagnostic Handler: unsupported call to function fabsf
> > > > in test_1_isinf_float
> > > > Segmentation fault (core dumped)
> > > >
> > >
> > > This should be fixed with this clang patch:
> > >
> > > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140901/114007.html
> >
> > with that patch is passes the piglit on my TURKS
> >
> > LGTM
> >
> > do you plan to add the remaining ops that have buitin implementation
> > (isfinite, islessgreater, isnormal, unordered)?
>
> Yes, but I'm not sure when I'll get to it.

I have these patches ready, so unless you planned to do something else
than simple copy+paste+replace, I can post them.

Ok, go ahead and send your patches.

-Tom