diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2014-09-03 15:55:38 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2014-09-03 15:55:38 +0000 |
commit | d8a73abfc3f53c9c2f8dc9e97e935cf18f8f093c (patch) | |
tree | f8b107a46c2f12e8f101e04449100947c2407c5b /libclc/generic/lib/math | |
parent | 2a9b6aae9a435d31c6eefc4c2ebf7d717d0d7c2b (diff) | |
download | bcm5719-llvm-d8a73abfc3f53c9c2f8dc9e97e935cf18f8f093c.tar.gz bcm5719-llvm-d8a73abfc3f53c9c2f8dc9e97e935cf18f8f093c.zip |
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
Diffstat (limited to 'libclc/generic/lib/math')
-rw-r--r-- | libclc/generic/lib/math/copysign.cl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libclc/generic/lib/math/copysign.cl b/libclc/generic/lib/math/copysign.cl new file mode 100644 index 00000000000..4e0c51b0937 --- /dev/null +++ b/libclc/generic/lib/math/copysign.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 |