Commit Graph

8 Commits

Author SHA1 Message Date
Tom Stellard 6c7b86c106 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
2013-10-10 19:08:51 +00:00
Tom Stellard d768ac0395 Add __CLC_ prefix to all macro definitions in headers
libclc was defining and undefing GENTYPE and several other macros with
common names in its header files.  This was preventing applications from
defining macros with identical names as command line arguments to the
compiler, because the definitions in the header files were masking the
macros defined as compiler arguements.

Reviewed-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 185838
2013-07-08 17:27:02 +00:00
Tom Stellard cb133c9322 libclc: Move max builtin to shared/
Max(x,y) is available for all integer/floating types.

Patch by: Aaron Watry

llvm-svn: 184995
2013-06-26 18:21:06 +00:00
Tom Stellard ec87fb0b0c libclc: Add max() builtin function
Adds this function for both int and floating data types.

Patch by: Aaron Watry

llvm-svn: 184992
2013-06-26 18:20:46 +00:00
Tom Stellard 509b3b2104 Implement fmax() and fmin() builtins
llvm-svn: 184987
2013-06-26 18:20:25 +00:00
Peter Collingbourne 9acfba3322 Enable cl_khr_fp64 when building the library, and fix several bugs
uncovered when doing so.

llvm-svn: 157617
2012-05-29 13:35:54 +00:00
Peter Collingbourne de7227e5bd Add fma, hypot builtins.
llvm-svn: 157613
2012-05-29 13:35:28 +00:00
Peter Collingbourne b7fdecd2ec Implement mad builtin.
llvm-svn: 157599
2012-05-29 00:42:38 +00:00