summaryrefslogtreecommitdiff
path: root/generic/include/clc
AgeCommit message (Collapse)AuthorFilesLines
2013-07-19Implement generic upsample()Aaron Watry2-0/+26
Reduces all vector upsamples down to its scalar components, so probably not the most efficient thing in the world, but it does what the spec says it needs to do. Another possible implementation would be to convert/cast everything as unsigned if necessary, upsample the input vectors, create the upsampled value, and then cast back to signed if required. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard at amd.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@186691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15Add integer-gentype.inc: Missing file from r185839Tom Stellard1-0/+39
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@186326 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08Implement mad24() and mul24() builtinsTom Stellard5-0/+10
Reviewed-by: Aaron Watry <awatry@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185839 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08Add __CLC_ prefix to all macro definitions in headersTom Stellard50-644/+644
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> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08Add bitselect() builtinTom Stellard2-0/+2
Reviewed-By: Aaron Watry <awatry@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185836 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Initial vstore implementationTom Stellard2-0/+37
Assumes that the target supports byte-addressable stores. Completely unoptimized. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Initial vload implementationTom Stellard2-0/+38
Should work for all targets and data types. Completely unoptimized. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185006 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Implement clz() builtinTom Stellard3-0/+4
Squashed commit of the following: commit a0df0a0e86c55c1bdc0b9c0f5a739e5adef4b056 Author: Aaron Watry <awatry@gmail.com> Date: Mon Apr 15 18:42:04 2013 -0500 libclc: Rename clz.ll to clz_if.ll to ensure it gets built. configure.py treats files that have the same name with the .cl and .ll extensions as overriding eachother. E.g. If you have clz.cl and clz.ll both specified to be built in the same SOURCES file, only the first file listed will actually be built. Since the contents of clz.ll were an interface that is implemented in clz_impl.ll, rename clz.ll to clz_if.ll to make sure that the interface is built. commit 931b62bed05c58f737de625bd415af09571a6a5a Author: Aaron Watry <awatry@gmail.com> Date: Sat Apr 13 12:32:54 2013 -0500 libclc: llvm assembly implementation of clz Untested... currently crashes in the same manner as add_sat. commit 6ef0b7b0b6d2e5584086b4b9a9243743b2e0538f Author: Aaron Watry <awatry@gmail.com> Date: Sat Mar 23 12:35:27 2013 -0500 libclc: Add stub clz builtin For scalar int/uint, attempt to use the clz llvm builtin.. for all others return 0 until an actual implementation is finished. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185004 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Add clamp(vec, scalar, scalar) and max(vec, scalar)Tom Stellard2-0/+8
For any GENTYPE that isn't scalar, we need to implement a mixed vector/scalar version of clamp/max. This depends on the min() patches I sent to the list a few minutes ago. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185003 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Implement the min(vec, scalar) version of the min builtin.Tom Stellard3-0/+35
Checks if the current GENTYPE is scalar, and if not, then defines a separate implementation of the function which casts the second arg to vector before proceeding. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: implement initial version of min()Tom Stellard3-0/+7
This doesn't handle the integer cases for min(vector, scalar). Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185001 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Simplify rotate implementation a bit..Tom Stellard1-0/+16
Much more understandable/readable as a result, and probably more efficient. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: implement rotate builtinTom Stellard4-0/+15
This implementation does a lot of bit shifting and masking. Suffice to say, this is somewhat suboptimal... but it does look to produce correct results (after the piglit tests were corrected for sign extension issues). Someone who knows LLVM better than I could re-write this more efficiently. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184996 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Move max builtin to shared/Tom Stellard6-7/+6
Max(x,y) is available for all integer/floating types. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Add clamp() builtin for integer/floating pointTom Stellard3-0/+9
Created under a new shared/ directory for functions which are available for both integer and floating point types. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184994 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26libclc: Add max() builtin functionTom Stellard5-0/+8
Adds this function for both int and floating data types. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184992 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Implement ceil() builtinTom Stellard2-0/+7
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184988 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Implement fmax() and fmin() builtinsTom Stellard5-0/+34
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184987 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Remove the static keyword from the _CLC_INLINE macroTom Stellard1-1/+1
static functions are not allowed in OpenCL C git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184986 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Fix typo in include/clc/geometric/length.incTom Stellard1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184984 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26PTX: move implementations of work-item and synchronisation functionsTom Stellard2-2/+2
to lib, and add header files in generic. Incorporates a patch by Tom Stellard! git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-26Move R600 headers into generic directoryTom Stellard2-2/+2
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Implement any() builtin. Patch by Tom Stellard!Peter Collingbourne2-0/+17
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@165386 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-08Add native_powr builtin. Patch by Tom Stellard!Peter Collingbourne2-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@165385 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Add rsqrt builtin. Based on patch by Cassie Epps!Peter Collingbourne2-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@162274 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21Add floor builtin. Patch by Cassie Epps!Peter Collingbourne2-0/+7
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@162273 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-05PTX: move implementations of work-item and synchronisation functionsPeter Collingbourne7-0/+7
to lib, and add header files in generic. Incorporates a patch by Tom Stellard! git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@161313 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-05Implement sub_sat builtin. Patch by Lei Mou!Peter Collingbourne3-0/+4
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@161312 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Add pow builtin.Peter Collingbourne3-0/+25
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157629 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Add missing dot.h include.Peter Collingbourne2-0/+2
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157615 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Define FLOAT in floatn.inc.Peter Collingbourne1-0/+10
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157614 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Add fma, hypot builtins.Peter Collingbourne5-0/+29
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157613 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Implement mad builtin.Peter Collingbourne4-0/+55
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157599 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Implement exp, exp2, log, log2, native_exp, native_exp2, native_log,Peter Collingbourne9-0/+32
native_log2. Patch by Joshua Cranmer! git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157598 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-29Fix typo in double precision case.Peter Collingbourne1-1/+1
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157597 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28Add fabs builtin.Peter Collingbourne2-0/+7
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-28Explicit conversions.Peter Collingbourne2-0/+85
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@157590 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-08Initial commit.Peter Collingbourne32-0/+768
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@147756 91177308-0d34-0410-b5e6-96231b3b80d8