forked from OSchip/llvm-project
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-and-Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217045
This commit is contained in:
parent
2a9b6aae9a
commit
d8a73abfc3
|
@ -1 +1,2 @@
|
||||||
#define copysign(x, y) __builtin_copysign(x, y)
|
#define __CLC_BODY <clc/math/copysign.inc>
|
||||||
|
#include <clc/math/gentype.inc>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE copysign(__CLC_GENTYPE a, __CLC_GENTYPE b);
|
|
@ -31,6 +31,7 @@ integer/sub_sat_impl.ll
|
||||||
integer/upsample.cl
|
integer/upsample.cl
|
||||||
math/atan.cl
|
math/atan.cl
|
||||||
math/atan2.cl
|
math/atan2.cl
|
||||||
|
math/copysign.cl
|
||||||
math/cos.cl
|
math/cos.cl
|
||||||
math/exp.cl
|
math/exp.cl
|
||||||
math/exp10.cl
|
math/exp10.cl
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include <clc/clc.h>
|
||||||
|
#include "../clcmacro.h"
|
||||||
|
|
||||||
|
_CLC_DEFINE_BINARY_BUILTIN(float, copysign, __builtin_copysignf, float, float)
|
||||||
|
|
||||||
|
#ifdef cl_khr_fp64
|
||||||
|
|
||||||
|
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
|
||||||
|
|
||||||
|
_CLC_DEFINE_BINARY_BUILTIN(double, copysign, __builtin_copysign, double, double)
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue