summaryrefslogtreecommitdiffstats
path: root/libclc
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement fast_distance builtinTom Stellard2015-03-236-0/+104
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 232978
* Implement fast_length builtinTom Stellard2015-03-235-0/+109
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 232977
* Implement half_sqrt builtin v2Tom Stellard2015-03-235-0/+88
| | | | | | | | | | 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
* Implement distance builtin v2Tom Stellard2015-03-235-0/+80
| | | | | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Remove unnecessary copyright. llvm-svn: 232964
* Fix implementation of length builtin v2Tom Stellard2015-03-232-6/+82
| | | | | | | | v2: - Move common code into a macro - Use the same constant for all vector types. llvm-svn: 232963
* 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-184-0/+424
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 232674
* Fix bitselect for float/double types v2Tom Stellard2015-03-055-1/+130
| | | | | | | | | | | | | | We need to reinterpret float/double types as uint/ulong in order to perform the bitwise operations. This has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Use vector operations rather than splitting vectors into scalar components. Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 231373
* Move mix from math to commonAaron Watry2015-03-037-4/+4
| | | | | | | | 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
* Implement step builtinTom Stellard2015-03-026-0/+132
| | | | | | This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 230970
* Implement smoothstep builtin v2Tom Stellard2015-03-026-0/+133
| | | | | | | | | This has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Fix typo in smoothstep.h llvm-svn: 230969
* Implement radians builtin v2Tom Stellard2015-03-025-0/+95
| | | | | | | | | This has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Move to the common/ directory llvm-svn: 230968
* Implement degrees builtin v2Tom Stellard2015-03-025-0/+95
| | | | | | | | | This has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Move to the common/ directory llvm-svn: 230967
* libclc/math: Add cospiAaron Watry2015-02-267-0/+276
| | | | | | | | | | | | | | | | | | | 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-305-0/+32
| | | | | | | | v2: Use constant and multiplication instead of division v3: Use hex constants Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 227585
* Use amdgcn triple for SI+ GPUsTom Stellard2015-01-061-4/+7
| | | | llvm-svn: 225296
* r600: get_work_dim: Update metadata syntax for LLVM 3.6Tom Stellard2014-12-311-1/+1
| | | | llvm-svn: 225042
* Require LLVM 3.6 and bump version to 0.1.0Tom Stellard2014-12-312-54/+9
| | | | | | | | Some functions are implemented using hand-written LLVM IR, and LLVM assembly format is allowed to change between versions, so we should require a specific version of LLVM. llvm-svn: 225041
* Remove wrong semi-colonsJeroen Ketema2014-12-192-2/+2
| | | | | | Patch by Alastair Donaldson llvm-svn: 224568
* Don't include <stddef.h>Jeroen Ketema2014-11-181-2/+5
| | | | | | | | | | | | | | Including a standard or system header isn't allowed in OpenCL. The type "size_t" needs to be explicitely defined now. v2: Use __SIZE_TYPE__ instead of unsigned int. v3: Define ptrdiff_t and NULL. Patch-by: Jean-Sébastien Pédron Reviewed-by: Jeroen Ketema Reviewed-by: Jan Vesely llvm-svn: 222235
* Prune CRLF.NAKAMURA Takumi2014-10-271-1/+1
| | | | llvm-svn: 220678
* r600: Fix get_work_dim range metadataJan Vesely2014-10-221-1/+1
| | | | | | Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 220388
* r600: Use llvm intrinsic to read work dimension informationJan Vesely2014-10-153-0/+10
| | | | | | | | | | v2: Fix function declaration Add range metadata to r600 implementation v3: change prefix to AMDGPU Reviewed-by: Tom Stellard <tom@stellard.net> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 219793
* Implement log1p builtinTom Stellard2014-10-078-0/+669
| | | | llvm-svn: 219230
* Implement fmodJan Vesely2014-10-055-0/+17
| | | | | | | 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
* Implement async_work_group_copy builtin v3Tom Stellard2014-10-036-0/+48
| | | | | | | | | | | | | This is a simple implementation which just copies data synchronously. v2: - Use size_t. v3: - Fix possible race condition by splitting the copy among multiple work items. llvm-svn: 219008
* Implement async_work_group_strided_copy builtin v2Tom Stellard2014-10-036-0/+66
| | | | | | | | | This is a simple implementation which just copies data synchronously. v2: - Use size_t. llvm-svn: 219007
* Implement wait_group_events builtin v2Tom Stellard2014-10-034-0/+8
| | | | | | | | | This is a simple default implemetation which just calls barrier(). v2: - Only call barrier() once. llvm-svn: 219006
* Remove more redundant semi-colonsJeroen Ketema2014-09-181-5/+5
| | | | llvm-svn: 218039
* atomic: undef macros that are included from atomic_decl.incAaron Watry2014-09-178-0/+15
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jeroen Ketema <j.ketema@imperial.ac.uk> llvm-svn: 217958
* Remove redundant semi-colonsJeroen Ketema2014-09-171-4/+4
| | | | llvm-svn: 217954
* R600: Map Address spaces for atomic_cmpxchgAaron Watry2014-09-161-0/+19
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217925
* R600: Map address spaces for atomic_xchgAaron Watry2014-09-161-0/+1
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217924
* R600: Map address spaces for atomic_minAaron Watry2014-09-161-0/+10
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217923
* R600: Map address spaces for atomic_xorAaron Watry2014-09-161-0/+1
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217922
* R600: Map addr spaces and use atomic_maxAaron Watry2014-09-161-5/+16
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217921
* R600: Map address spaces for atomic_orAaron Watry2014-09-161-0/+1
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217920
* R600: Map atomic_and address spacesAaron Watry2014-09-161-0/+1
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217919
* atomic: Add generic atom[ic]_cmpxchgAaron Watry2014-09-168-0/+56
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217918
* atomic: Implement generic atom[ic]_xchgAaron Watry2014-09-169-0/+54
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217917
* atomic: Add generic atomic_min implementationAaron Watry2014-09-168-0/+54
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217916
* atomic: Add generic atom[ic]_xorAaron Watry2014-09-168-0/+43
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217915
* atomic: Add atom[ic]_orAaron Watry2014-09-168-0/+41
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217914
* atomics: Add generic atom[ic]_andAaron Watry2014-09-168-0/+42
| | | | | | | | Not used yet. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217913
* atomic: Add generic implementation of atom[ic]_maxAaron Watry2014-09-168-0/+58
| | | | | | | | | | Not used yet... v2: Correct int/uint behavior Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217912
* atomic: define extension functions for existing atomic implementationsAaron Watry2014-09-1610-0/+54
| | | | | | | | We were missing the local versions of the atom_* before Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 217911
* math: Add tan implementationAaron Watry2014-09-106-0/+21
| | | | | | | | | | | | | | | | | 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-106-0/+16
| | | | | | | | | | | | | | 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-106-0/+34
| | | | | | | | | | 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
* add isordered builtinJan Vesely2014-09-054-0/+34
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 217247
OpenPOWER on IntegriCloud