summaryrefslogtreecommitdiffstats
path: root/libclc/generic/include/math
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-10-10 19:08:51 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-10-10 19:08:51 +0000
commit6c7b86c1061994c07c9a0dc608f979b3a10fa9da (patch)
tree0bc0ed8b6dc5ef1ef103b73fb3ad5369f2384b79 /libclc/generic/include/math
parente36e9dec65626dcf54eb0ec2ac1bef6fd605a8f0 (diff)
downloadbcm5719-llvm-6c7b86c1061994c07c9a0dc608f979b3a10fa9da.tar.gz
bcm5719-llvm-6c7b86c1061994c07c9a0dc608f979b3a10fa9da.zip
Implement nextafter() builtin
There are two implementations of nextafter(): 1. Using clang's __builtin_nextafter. Clang replaces this builtin with a call to nextafter which is part of libm. Therefore, this implementation will only work for targets with an implementation of libm (e.g. most CPU targets). 2. The other implementation is written in OpenCL C. This function is known internally as __clc_nextafter and can be used by targets that don't have access to libm. llvm-svn: 192383
Diffstat (limited to 'libclc/generic/include/math')
-rw-r--r--libclc/generic/include/math/clc_nextafter.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libclc/generic/include/math/clc_nextafter.h b/libclc/generic/include/math/clc_nextafter.h
new file mode 100644
index 00000000000..2b674b70795
--- /dev/null
+++ b/libclc/generic/include/math/clc_nextafter.h
@@ -0,0 +1,7 @@
+#define __CLC_BODY <clc/math/binary_decl.inc>
+#define __CLC_FUNCTION __clc_nextafter
+
+#include <clc/math/gentype.inc>
+
+#undef __CLC_BODY
+#undef __CLC_FUNCTION
OpenPOWER on IntegriCloud