From 6c7b86c1061994c07c9a0dc608f979b3a10fa9da Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 10 Oct 2013 19:08:51 +0000 Subject: 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 --- libclc/generic/include/clc/math/clc_nextafter.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 libclc/generic/include/clc/math/clc_nextafter.h (limited to 'libclc/generic/include/clc/math/clc_nextafter.h') diff --git a/libclc/generic/include/clc/math/clc_nextafter.h b/libclc/generic/include/clc/math/clc_nextafter.h new file mode 100644 index 00000000000..81c8f369c3b --- /dev/null +++ b/libclc/generic/include/clc/math/clc_nextafter.h @@ -0,0 +1,11 @@ +#define __CLC_BODY + +#define __CLC_FUNCTION nextafter +#include +#undef __CLC_FUNCTION + +#define __CLC_FUNCTION __clc_nextafter +#include +#undef __CLC_FUNCTION + +#undef __CLC_BODY -- cgit v1.2.3