summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/math
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement sinpi builtinJan Vesely2015-05-061-0/+131
| | | | | | | | Ported from AMD builtin library, passes piglit on Turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236647
* math: Add ldexp implementationTom Stellard2015-05-062-0/+167
| | | | | | | | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Tom Stellard: - Add denormal handling. - Share vectorization code with r600 implementation. Patch By: Aaron Watry llvm-svn: 236639
* Fix compilation warnings without cl_khr_fp64Jan Vesely2015-04-243-6/+32
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 235762
* Implement fract builtinTom Stellard2015-04-232-0/+79
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 235620
* Implement atanh builtinTom Stellard2015-04-071-0/+113
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 234324
* Implement acosh builtinTom Stellard2015-04-071-0/+127
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 234323
* Implement atanpi builtinTom Stellard2015-04-021-0/+182
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233928
* Implement asinpi builtinTom Stellard2015-04-021-0/+170
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233927
* Implement asinh builtinTom Stellard2015-04-023-0/+416
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233926
* Implement acospi builtinTom Stellard2015-04-021-0/+172
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233925
* Implement fmax using __builtin_fmaxTom Stellard2015-03-312-4/+27
| | | | | | | | This ensures correct handling of NaNi. This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233713
* Implement fmin using __builtin_fminTom Stellard2015-03-312-4/+27
| | | | | | | | This ensures correct handling of NaN. This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233712
* Implement half_sqrt builtin v2Tom Stellard2015-03-232-0/+55
| | | | | | | | | | This is a generic implementation which just calls sqrt. Targets should override this if they want a faster implementation. v2: - Alphabetize SOURCES llvm-svn: 232965
* Add __clc_ prefix to functions in sincos_helpers.clTom Stellard2015-03-234-28/+24
| | | | | | | This will help avoid naming conflicts with functions defined in kernels linking with libclc. llvm-svn: 232960
* math: Implement erfcAaron Watry2015-03-181-0/+413
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 232674
* Move mix from math to commonAaron Watry2015-03-032-17/+0
| | | | | | | | It has been part of the common functions since 1.0 Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 231137
* libclc/math: Add cospiAaron Watry2015-02-263-0/+270
| | | | | | | | | | | | | | | | | | | Ported from the libclc/amd-builtins branch v2: Rename sincos_f_piby4 to __libclc__sincosf_piby4 Add cospi(double) implementation instead of using llvm.cos Notes: The sincosD_piby4.h file is mostly the same as the builtin implementation released by AMD. The inline attribute declaration is changed, and M_PI is used instead of a constant double. Otherwise, the only difference is that the header explicitly enables the fp64 pragma. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jeroen Ketema <j.ketema@imperial.ac.uk> CC: Tom Stellard <tom@stellard.net> CC: Matt Arsenault <Matthew.Arsenault@amd.com> llvm-svn: 230641
* Implement log10Jan Vesely2015-01-302-0/+21
| | | | | | | | v2: Use constant and multiplication instead of division v3: Use hex constants Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 227585
* Implement log1p builtinTom Stellard2014-10-074-0/+619
| | | | llvm-svn: 219230
* Implement fmodJan Vesely2014-10-051-0/+12
| | | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 219087
* math: Add tan implementationAaron Watry2014-09-102-0/+16
| | | | | | | | | | | | | | | | | Uses the algorithm: tan(x) = sin(x) / sqrt(1-sin^2(x)) An alternative is: tan(x) = sin(x) / cos(x) Which produces more verbose bitcode and longer assembly. Either way, the generated bitcode seems pretty nasty and a more optimized but still precise-enough solution is welcome. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217511
* math: Add asin implementationAaron Watry2014-09-102-0/+11
| | | | | | | | | | | | | | asin(x) = atan2(x, sqrt( 1-x^2 )) alternatively: asin(x) = PI/2 - acos(x) Use the atan2 implementation since it produces slightly shorter bitcode and R600 machine code. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217510
* math: Add acos implementationAaron Watry2014-09-102-0/+29
| | | | | | | | | | Passes the tests that were submitted to the piglit list Tested on R600 (Pitcairn) Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 217509
* Fix implementation of copysignTom Stellard2014-09-031-0/+12
| | | | | | | | | 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
* Implement sin builtin for float typesTom Stellard2014-07-231-0/+70
| | | | | | This double version still uses @llvm.sin. llvm-svn: 213762
* Implement cos builtin for float typesTom Stellard2014-07-233-0/+400
| | | | | | The double version still uses @llvm.cos. llvm-svn: 213761
* Implement atan2 builtinTom Stellard2014-07-231-0/+81
| | | | llvm-svn: 213760
* Implement atan builtinTom Stellard2014-07-232-0/+247
| | | | llvm-svn: 213759
* Add exp10Jeroen Ketema2014-06-252-0/+18
| | | | | Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211680
* Move clcmacro.h to avoid cluttering user namespace v2Jeroen Ketema2014-06-243-0/+3
| | | | | | | | | v2: - use quotes instead of <> - add include to r600/lib/math/nextafter.c changed Reviewed-by: Tom Stellard <tom@stellard.net> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 211576
* Protect functions taking double by #ifdef cl_khr_fp64Jeroen Ketema2014-06-231-2/+6
| | | | | | | Also change the order of the functions to be consistent with the order in the header files. llvm-svn: 211496
* Add pownJeroen Ketema2014-06-181-0/+9
| | | | | Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211211
* math: Implement mix builtinAaron Watry2014-06-162-0/+17
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211047
* Add files forgotten in the previous commitJeroen Ketema2014-06-132-0/+18
| | | | llvm-svn: 210896
* Add sincosTom Stellard2014-03-212-0/+19
| | | | | | | Patch by: Jeroen Ketema Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 204478
* Implement nextafter() builtinTom Stellard2013-10-102-0/+53
| | | | | | | | | | | | | | 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
* Add __CLC_ prefix to all macro definitions in headersTom Stellard2013-07-087-12/+12
| | | | | | | | | | | 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
* libclc: Move max builtin to shared/Tom Stellard2013-06-262-11/+0
| | | | | | | | Max(x,y) is available for all integer/floating types. Patch by: Aaron Watry llvm-svn: 184995
* libclc: Add max() builtin functionTom Stellard2013-06-262-0/+11
| | | | | | | | Adds this function for both int and floating data types. Patch by: Aaron Watry llvm-svn: 184992
* Implement fmax() and fmin() builtinsTom Stellard2013-06-263-0/+40
| | | | llvm-svn: 184987
* Enable cl_khr_fp64 when building the library, and fix several bugsPeter Collingbourne2012-05-291-0/+4
| | | | | | uncovered when doing so. llvm-svn: 157617
* Add fma, hypot builtins.Peter Collingbourne2012-05-292-0/+11
| | | | llvm-svn: 157613
* Implement mad builtin.Peter Collingbourne2012-05-292-0/+7
llvm-svn: 157599
OpenPOWER on IntegriCloud