summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-27tgsi: Add get_work_dim implementationHEADmasterHans de Goede2-0/+9
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-27tgsi: Add get_group_id / get_local_size / get_num_groups supportHans de Goede4-0/+57
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-27Add initial tgsi support to libclcHans de Goede4-1/+21
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2016-06-17configure: Remove device specific definesJan Vesely1-25/+11
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@273044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-17nvptx: Drop feature defines.Jan Vesely1-6/+4
This is now handled by clang Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@273043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-1764 bit integers are legal in full profile without an extensionJan Vesely2-6/+12
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@273042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17math: Use single precision fmax in sp pathJan Vesely1-1/+1
Fixes fdim piglit on Turks v2: use CL fmax instead of __builtin Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@269807 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06math: Add erf ported from amd-builtinsJan Vesely4-0/+413
The scalar float/double function bodies are a direct copy/paste, aside from the removed (optional) code in float function body that requires subnormals. reviewers: jvesely Patch by: Vedran Miletić <rivanvx@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@268766 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06math: Add fdim implementationAaron Watry6-0/+86
Based on the amd-builtin, but explicitly vectorized for all sizes (not just float4), and includes a vectorized double implementation. Passes piglit (float) tests on pitcairn. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@268708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-15prepare-builtins: Remove call to getGlobalContext()Tom Stellard1-1/+1
This function has been removed from LLVM. Patch By: Laurent Carlier git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@266430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-07[AMDGPU] Implement get_local_size for amdgcn--amdhsa tripleKonstantin Zhuravlyov5-1/+41
Differential Revision: http://reviews.llvm.org/D18284 git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@265713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-30Update copyright year to 2016.Paul Robinson1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@264949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-24math: Fix ilogb(double) return typeAaron Watry1-1/+1
Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@261714 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23math: Add ilogb ported from amd-builtinsAaron Watry6-0/+68
The scalar float/double function bodies are a direct copy/paste with usage of the CLC wrappers to vectorize them. This commit also adds in the FP_ILOGB0 and FP_ILOGBNAN macros which are equal to the results of ilogb(0.0f) and ilogb(float nan) respectively. v2: Add FP_ILOGB0 and FP_ILOGBNAN definitions Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> v1 Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@261639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17Add .gitignore for build directoriesMatt Arsenault1-0/+13
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@261043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17amdgcn: Use new workitem intrinsicsMatt Arsenault9-38/+124
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@261042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13Update page to list supported targetsMatt Arsenault1-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13Split sources for amdgcn and r600Matt Arsenault34-38/+75
Most files remain in a common amdgpu directory. Also switches barriers to to use convergent, and use llvm.amdgcn.s.barrier. This now requires 3.9/trunk to build amdgcn. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09configure: Remove llvm 3.6 definesJan Vesely1-3/+3
we require llvm 3.7 reviewer: tstellard Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09configure: Remove cl_khr_fp64 for device that don't support doublesJan Vesely1-5/+5
Also remove definitions if provided by clang (3.7+) This halves the size of builtin.opt.{cedar,barts}.bc reviewer: tstellard Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09configure: Introduce per device definesJan Vesely1-11/+24
Make cl_khr_fp64 define per-device. This patch does not change the generated Makefile (for llvm 3.6, 3.7) v2: Make the device defines per LLVM version, 'all' for all versions reviewer: tstellard Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09math: Fix log2 vectorization on non-fp64 hwJan Vesely1-0/+2
reviewer: tstellard Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-08math: Add frexp ported from amd-builtinsAaron Watry7-0/+151
The float implementation is almost a direct port from the amd-builtins, but instead of just having a scalar and float4 implementation, it has a scalar and arbitrary width vector implementation. The double scalar is also a direct port from AMD's builtin release. The double vector implementation copies the logic in the float vector implementation using the values from the double scalar version. Both have been tested in piglit using tests sent to that project's mailing list. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@260114 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27Implement modf math builtinTom Stellard6-0/+120
V2: use the reference implementation as suggested by Matt Arsenault Patch By: Pavel Ondračka git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@258933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27Add _CLC_V_V_VP_VECTORIZE macroTom Stellard1-0/+22
Patch by: Pavel Ondračka git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@258932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15AMDGPU: Add aliases for all VI targetsTom Stellard1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@255663 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15AMDGPU: Add alias for tongaTom Stellard1-1/+1
Patch by: Vedran Mileti git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@255662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06integer: remove explicit casts from _MIN definitionsAaron Watry1-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> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@249445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-29Implement tanh builtinNiels Ole Salscheider5-0/+195
This is a port from the AMD builtin library. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248780 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21Add sampler defines.Tom Stellard1-0/+18
Patch by: Zoltan Gilian git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21Add image attribute defines.Tom Stellard2-0/+32
Patch by: Zoltan Gilian git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248162 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21r600: Add image writing builtins.Tom Stellard6-0/+90
Patch by: Zoltan Gilian git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248161 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21r600: Add image reading builtins.Tom Stellard6-0/+123
Patch by: Zoltan Gilian git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-21Add image attribute getter builtinsTom Stellard11-0/+183
Added get_image_* OpenCL builtins to the headers. Added implementation to the r600 target. Patch by: Zoltan Gilian git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@248159 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15integer: Update integer limits to comply with specAaron Watry1-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> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@247661 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24Update mailing list reference.Peter Collingbourne1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@245894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13Remove files accidentally not removed in r244310Jeroen Ketema2-9/+0
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@244987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07Require LLVM >=3.7 and bump version to 0.2.0Jeroen Ketema2-19/+8
v2: Also remove LLVM 3.6 traces from prepare-builtins.cpp Patch by: EdB git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@244310 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24Fix double implementation of logTom Stellard4-3/+73
We need to use M_LOG2E instead of M_LOG2E_F. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@243132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24Implement accurate log2 functionTom Stellard8-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. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@243131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-24Use llvm intrinsics for native_log and native_log2Tom Stellard9-2/+216
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@243130 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10R600: Implement accurate double precision sqrt v2Tom Stellard2-0/+60
v2: - Use same implementation for R600 and gcn. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@241907 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10Fix implementation of sqrt v2Tom Stellard8-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. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@241906 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10prepare-builtins: Fix build with LLVM 3.6Tom Stellard1-1/+1
Patch by: Tomasz Borowik git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@241905 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-27Properly initialize Module pointerJeroen Ketema1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@240881 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24prepare-builtins: Fix build with LLVM 3.7Tom Stellard1-6/+19
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@240552 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13Use a more accurate implementation for expTom Stellard2-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. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@237229 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-13Implement exp2 using OpenCL C rather than using an intrinsicTom Stellard8-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. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@237228 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12Implement sin for double typesTom Stellard1-7/+16
This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@237155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12Implement cos for double typesTom Stellard5-7/+289
This implementation was ported from the AMD builtin library and has been tested with piglit, OpenCV, and the ocl conformance tests. git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@237154 91177308-0d34-0410-b5e6-96231b3b80d8