summaryrefslogtreecommitdiffstats
path: root/libclc
Commit message (Collapse)AuthorAgeFilesLines
* AMDGPU: Add aliases for all VI targetsTom Stellard2015-12-151-1/+1
| | | | llvm-svn: 255663
* AMDGPU: Add alias for tongaTom Stellard2015-12-151-1/+1
| | | | | | Patch by: Vedran Mileti llvm-svn: 255662
* integer: remove explicit casts from _MIN definitionsAaron Watry2015-10-061-3/+3
| | | | | | | | | | | | | | | The spec says (section 6.12.3, CL version 1.2): The macro names given in the following list must use the values specified. The values shall all be constant expressions suitable for use in #if preprocessing directives. This commit addresses the second part of that statement. Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> CC: Moritz Pflanzer <moritz.pflanzer14@imperial.ac.uk> CC: Serge Martin <edb+libclc@sigluy.net> llvm-svn: 249445
* Implement tanh builtinNiels Ole Salscheider2015-09-295-0/+195
| | | | | | This is a port from the AMD builtin library. llvm-svn: 248780
* Add sampler defines.Tom Stellard2015-09-211-0/+18
| | | | | | Patch by: Zoltan Gilian llvm-svn: 248163
* Add image attribute defines.Tom Stellard2015-09-212-0/+32
| | | | | | Patch by: Zoltan Gilian llvm-svn: 248162
* r600: Add image writing builtins.Tom Stellard2015-09-216-0/+90
| | | | | | Patch by: Zoltan Gilian llvm-svn: 248161
* r600: Add image reading builtins.Tom Stellard2015-09-216-0/+123
| | | | | | Patch by: Zoltan Gilian llvm-svn: 248160
* Add image attribute getter builtinsTom Stellard2015-09-2111-0/+183
| | | | | | | | | Added get_image_* OpenCL builtins to the headers. Added implementation to the r600 target. Patch by: Zoltan Gilian llvm-svn: 248159
* integer: Update integer limits to comply with specAaron Watry2015-09-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The values for the char/short/integer/long minimums were declared with their actual values, not the definitions from the CL spec (v1.1). As a result, (-2147483648) was actually being treated as a long by the compiler, not an int, which caused issues when trying to add/subtract that value from a vector. Update the definitions to use the values declared by the spec, and also add explicit casts for the char/short/int minimums so that the compiler actually treats them as shorts/chars. Without those casts, they actually end up stored as integers, and the compiler may end up storing the INT_MIN as a long. The compiler can sign extend the values if it needs to convert the char->short, short->int, or int->long v2: Add explicit cast for INT_MIN and fix some type-o's and wrapping in the commit message. Reported-by: Moritz Pflanzer <moritz.pflanzer14@imperial.ac.uk> CC: Moritz Pflanzer <moritz.pflanzer14@imperial.ac.uk> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Signed-off-by: Aaron Watry <awatry@gmail.com> llvm-svn: 247661
* Update mailing list reference.Peter Collingbourne2015-08-241-1/+1
| | | | llvm-svn: 245894
* Remove files accidentally not removed in r244310Jeroen Ketema2015-08-132-9/+0
| | | | llvm-svn: 244987
* Require LLVM >=3.7 and bump version to 0.2.0Jeroen Ketema2015-08-072-19/+8
| | | | | | | | v2: Also remove LLVM 3.6 traces from prepare-builtins.cpp Patch by: EdB llvm-svn: 244310
* Fix double implementation of logTom Stellard2015-07-244-3/+73
| | | | | | We need to use M_LOG2E instead of M_LOG2E_F. llvm-svn: 243132
* Implement accurate log2 functionTom Stellard2015-07-248-6/+517
| | | | | | | | | Use the implementation was ported from the AMD builtin library rather than LLVM Intrinsics. This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 243131
* Use llvm intrinsics for native_log and native_log2Tom Stellard2015-07-249-2/+216
| | | | llvm-svn: 243130
* R600: Implement accurate double precision sqrt v2Tom Stellard2015-07-102-0/+60
| | | | | | | v2: - Use same implementation for R600 and gcn. llvm-svn: 241907
* Fix implementation of sqrt v2Tom Stellard2015-07-108-6/+168
| | | | | | | | | | | Passing values less than 0 to the llvm.sqrt() intrinsic results in undefined behavior, so we need to check the input and return NaN if is is less than 0. v2: - Fix build failures. llvm-svn: 241906
* prepare-builtins: Fix build with LLVM 3.6Tom Stellard2015-07-101-1/+1
| | | | | | Patch by: Tomasz Borowik llvm-svn: 241905
* Properly initialize Module pointerJeroen Ketema2015-06-271-1/+1
| | | | llvm-svn: 240881
* prepare-builtins: Fix build with LLVM 3.7Tom Stellard2015-06-241-6/+19
| | | | llvm-svn: 240552
* Use a more accurate implementation for expTom Stellard2015-05-132-13/+85
| | | | | | | | | | | | Using exp2(x * M_LOG2E_F) does not give us accurate enough results for OpenCL. If you look at the new exp implementation you'll see that it does multiply the input by M_LOG2E_F, but it still uses the original input in part of the calculation. This exp implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237229
* Implement exp2 using OpenCL C rather than using an intrinsicTom Stellard2015-05-138-6/+303
| | | | | | | | | | Not all targets support the intrinsic, so it's better to have a generic implementation which does not use it. This exp2 implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237228
* Implement sin for double typesTom Stellard2015-05-121-7/+16
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237155
* Implement cos for double typesTom Stellard2015-05-125-7/+289
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237154
* Implement atan2pi builtinTom Stellard2015-05-125-0/+270
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237138
* Implement atan2 for doublesTom Stellard2015-05-123-2/+412
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 237131
* math: limit half_sqrt to single precisionJan Vesely2015-05-092-6/+4
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236941
* geometric: Limit fast_{distance,length} functions to single precisionJan Vesely2015-05-094-25/+6
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236940
* Fix ldexp fp64 build errorJan Vesely2015-05-091-1/+1
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 236939
* Implement fast_normalize builtin v4Tom Stellard2015-05-097-0/+125
| | | | | | | | | | | | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. v2: - Remove f suffix from constant in double implementations. - Consolidate implementations using the .cl/.inc approach. v3: - Use __CLC_FPSIZE instead of __CLC_FP{32,64} v4 (Jan Vesely): - Limit to single precision. llvm-svn: 236920
* Implement half_rsqrt builtin v3Tom Stellard2015-05-086-0/+88
| | | | | | | | | | | | | This is a generic implementation which just calls rsqrt. Targets should override this if they want a faster implementation. v2: - Alphabettize SOURCES v3 (Jan Vesely): Limit to single precision types. llvm-svn: 236915
* r600: Use __clc_ldexp on asics that don't implement the intructionJan Vesely2015-05-061-1/+10
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236649
* Move ldexp soft implementation to a separate fileJan Vesely2015-05-064-100/+138
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 236648
* Implement sinpi builtinJan Vesely2015-05-065-0/+137
| | | | | | | | 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-065-1/+144
| | | | | | | | | | | | 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
* Implement ldexp for R600/SITom Stellard2015-05-067-0/+142
| | | | llvm-svn: 236638
* Fix implementation of normalize builtinTom Stellard2015-05-062-6/+152
| | | | | | | The new implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 236608
* Allow compilation depending to the LLVM versionTom Stellard2015-04-293-1/+24
| | | | | | | | | It allows to keep temporary compatibilty with older version. For exemple, this can be use when change are not to large. Patch by: EdB llvm-svn: 236113
* 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-236-0/+130
| | | | | | | This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 235620
* configure: Add --enable-runtime-subnormal optionTom Stellard2015-04-207-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible for runtime implementations to disable subnormal handling at runtime. When this flag is enabled, decisions about how to handle subnormals in the library will be controlled by an external variable called __CLC_SUBNORMAL_DISABLE. Function implementations should use these new helpers for querying subnormal support: __clc_fp16_subnormals_supported(); __clc_fp32_subnormals_supported(); __clc_fp64_subnormals_supported(); In order for the library to link correctly with this feature, users will be required to either: 1. Insert this variable into the module (if using the LLVM/Clang C++/C APIs). 2. Pass either subnormal_disable.bc or subnormal_use_default.bc to the linker. These files are distributed with liblclc and installed to $(installdir). e.g.: llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_disable.bc or llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_use_default.bc If you do not supply the --enable-runtime-subnormal then the library behaves the same as it did before this commit. In addition to these changes, the patch adds helper functions that should be used when implementing library functions that need special handling for denormals: __clc_fp16_subnormals_supported(); __clc_fp32_subnormals_supported(); __clc_fp64_subnormals_supported(); llvm-svn: 235329
* Implement atanh builtinTom Stellard2015-04-075-0/+162
| | | | | | | 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-075-0/+176
| | | | | | | 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-025-0/+231
| | | | | | | 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-025-0/+219
| | | | | | | 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-027-0/+466
| | | | | | | 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-025-0/+221
| | | | | | | 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-313-8/+28
| | | | | | | | 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-313-8/+28
| | | | | | | | This ensures correct handling of NaN. This has been tested with piglit, OpenCV, and the ocl conformance tests. llvm-svn: 233712
OpenPOWER on IntegriCloud