summaryrefslogtreecommitdiffstats
path: root/libclc/generic
Commit message (Collapse)AuthorAgeFilesLines
...
* Add missing undefsJeroen Ketema2014-06-182-3/+7
| | | | | Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211210
* Fix definition of INFINITY and add NAN/HUGE_VAL[F]Aaron Watry2014-06-162-2/+6
| | | | | | | | | | | | v3: change __builtin_nanf() to __builtin_nanf("") This doesn't work yet, but it was agreed to commit as-is with the logic that "broken" is better than "completely missing" and this should be fixed in clang. v2: use __builtin_inff() and also add nan/huge_val definitions Signed-off-by: Aaron Watry <awatry@gmail.com> llvm-svn: 211065
* Add remaining float constantsJeroen Ketema2014-06-161-0/+8
| | | | | Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 211062
* Revert "clctypes.h: Don't rely on stddef.h for size_t and ptrdiff_t"Aaron Watry2014-06-161-2/+1
| | | | | | This reverts commit 4cf021ae67b6ea8cfd42aa76ce6f5e1c329e145a. llvm-svn: 211049
* math: Implement mix builtinAaron Watry2014-06-166-0/+26
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211047
* relational: Add isequal(floatN) builtinAaron Watry2014-06-164-0/+50
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211046
* Add all(igentype) builtinAaron Watry2014-06-164-0/+47
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 211045
* clctypes.h: Don't rely on stddef.h for size_t and ptrdiff_tAaron Watry2014-06-161-1/+2
| | | | llvm-svn: 211044
* Add intptr typesJan Vesely2014-06-131-0/+12
| | | | | | | | Based on clang's stdint.h Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 210933
* Add files forgotten in the previous commitJeroen Ketema2014-06-132-0/+18
| | | | llvm-svn: 210896
* Implementations for exp(float) and exp(double) v2Jeroen Ketema2014-06-133-2/+12
| | | | | | | | | | | | Use separate implementations instead of a macro to ensure the constant multiplied with is of higher precision. v2: Use the correct formula, spotted by Dan Liew <daniel.liew@imperial.ac.uk> Reviewed-by: Aaron Warty <awatry@gmail.com> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 210891
* Add more log related float constantsJeroen Ketema2014-05-291-0/+3
| | | | llvm-svn: 209850
* Fix _F definitionsJeroen Ketema2014-05-291-2/+2
| | | | | | | | | The 'f' was missing and, hence, the values were considered to be doubles instead of floats. Reviewed by: Tom Stellard llvm-svn: 209849
* Add definition for M_PIJeroen Ketema2014-05-291-0/+1
| | | | | | Reviewed by: Tom Stellard llvm-svn: 209848
* Remove clc/gentype.incTom Stellard2014-04-301-51/+0
| | | | | | | | | This file duplicates clc/math/gentype.inc and is not actually being used. Patch by: Jeroen Ketema llvm-svn: 207684
* Introduce M_LOG2E_F and M_LOG2ETom Stellard2014-03-281-1/+4
| | | | | | Patch by: Jeroen Ketema llvm-svn: 205055
* Replace tabs by spacesTom Stellard2014-03-281-19/+19
| | | | | | Patch by: Jeroen Ketema llvm-svn: 205054
* Add definition for M_PI_F v3Tom Stellard2014-03-241-0/+2
| | | | | | | | | | v2: - Use a hexadecimal constant. v3: - Use a hexadecimal constant in floating-point notation. llvm-svn: 204666
* Add sincosTom Stellard2014-03-216-0/+31
| | | | | | | Patch by: Jeroen Ketema Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 204478
* Add cross for double3 and double4Tom Stellard2014-03-212-0/+19
| | | | | | | Patch by: Jeroen Ketema Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 204477
* Add floating-point macro definitions v2Tom Stellard2013-12-202-0/+27
| | | | | | | | v2: - Fix typo. Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 197784
* Implement trunc builtin.Tom Stellard2013-12-202-0/+10
| | | | | | | | | | | | OpenCL C lang says that trunc rounds towards zero. llvm.trunc.* intrinsic rounds to integer not larger in magnitude. These definitions are equivalent. Patch by: Jan Vesely Reviewed-by: Tom Stellard <thomas.stellard@amd.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 197769
* Fix a C&P error in r195021 (65a950abab3cb8435ccb2646ac4773986c995c81)Tom Stellard2013-11-281-2/+2
| | | | | | | Patch by: Kai Wasserbäch Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org> llvm-svn: 195898
* Implement round builtinTom Stellard2013-11-182-0/+10
| | | | llvm-svn: 195022
* Implement builtins for cl_khr_global_int32_base_atomics extensionTom Stellard2013-11-1810-1/+55
| | | | llvm-svn: 195021
* s/_CLC_DECL/_CLC_DEF/Tom Stellard2013-10-312-14/+14
| | | | | | | | | Some function definitions were using _CLC_DECL, which meant that they weren't being marked as always_inline. Reviewed-by and Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 193754
* Port pocl's gen_convert.py script to libclcTom Stellard2013-10-103-151/+399
| | | | | | | This script generates implementations for the entire set of convert_* functions, llvm-svn: 192385
* Implement sign() builtinTom Stellard2013-10-104-0/+36
| | | | llvm-svn: 192384
* Implement nextafter() builtinTom Stellard2013-10-108-0/+90
| | | | | | | | | | | | | | 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
* Implement isnan() builtinTom Stellard2013-10-105-0/+46
| | | | llvm-svn: 192382
* Add missing as_{float,double} functionsTom Stellard2013-10-101-0/+15
| | | | llvm-svn: 192381
* Parenthesize arguments for mad_hiAaron Watry2013-09-091-1/+1
| | | | | | Thanks to Jordon Rose <jordan_rose@apple.com> for pointing this out. llvm-svn: 190310
* Implement mad_hi built-inAaron Watry2013-09-062-0/+2
| | | | | | | | | We already have a working mul_hi, and the spec gives us the implementation as: Returns mul_hi(a,b)+c. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 190211
* Add atomic_sub and atomic_dec builtin functionsAaron Watry2013-09-064-0/+18
| | | | | Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 190201
* Remove unneeded semi-colonsAaron Watry2013-09-051-6/+6
| | | | | Reviewed-By: Aaron Watry <awatry@gmail.com> llvm-svn: 190059
* Add atomic_inc and atomic_add builtinsAaron Watry2013-09-056-0/+30
| | | | | Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 190058
* Add mul_hi implementation [v2]Aaron Watry2013-08-195-0/+114
| | | | | | | | | | | | | | | Everything except long/ulong is handled by just casting to the next larger type, doing the math and then shifting/casting the result. For 64-bit types, we break the high/low parts of each operand apart, and do a FOIL-based multiplication. v2: Discard the stack-overflow implementation due to copyright concerns. - The implementation is still FOIL-based, but discards the previous code. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 188684
* Add rhadd builtinAaron Watry2013-08-156-0/+15
| | | | | | | | | | | | rhadd = (x+y+1)>>1 Implemented as: (x>>1) + (y>>1) + ((x&1)|(y&1)) This prevents us having to do assembly addition and overflow detection Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 188477
* Add hadd builtinAaron Watry2013-08-156-0/+15
| | | | | | | | | | (x + y) >> 1 gets changed to: (x>>1) + (y>>1) + (x&y&1) Saves us having to do any llvm assembly and overflow checking in the addition. Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 188476
* Add intN vloadN() implementations for address spaces 3 and 4Aaron Watry2013-08-121-0/+60
| | | | | | | | Not hooked up to R600 yet due to current lack of support, at least on EG. Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 188181
* Add vload* for addrspace(2) and use as constant load for R600Aaron Watry2013-08-122-2/+34
| | | | | | Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 188179
* Add some missing convert_* functionsTom Stellard2013-08-102-41/+39
| | | | llvm-svn: 188131
* Implement generic rint()Tom Stellard2013-08-102-0/+7
| | | | llvm-svn: 188130
* Add missing integer min/max definitionsAaron Watry2013-07-262-0/+18
| | | | | | | | Found in CL 1.1 spec section 6.11.3 Signed-off-by: Aaron Watry <awatry@gmail.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 187200
* Implement generic upsample()Aaron Watry2013-07-194-0/+61
| | | | | | | | | | | | | | 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> llvm-svn: 186691
* Fix and re-enable R600 vload/vstore assemblyAaron Watry2013-07-162-56/+35
| | | | | | | | | | | | | | | | | | | The assembly optimizations were making unsafe assumptions about which address spaces had which identifiers. Also, fix vload/vstore with 64-bit pointers. This was broken previously on Radeon SI. This version still only has assembly versions of int/uint 2/4/8/16 for global loads and stores on R600, but it does it in a way that would be very easily extended to private/local/constant and could also be handled easily on other architectures. v2: 1) Leave v[load|store]_impl.ll in generic/lib 2) Remove vload_if.ll and vstore_if.ll interfaces 3) Fix address+offset calculations 3) Remove offset from assembly arg list llvm-svn: 186416
* libclc: vload/vstore disable assembly and fix offset calculationAaron Watry2013-07-165-245/+20
| | | | | | | | | | | This commit gets us back to pure CLC and fixes offset calculations. The next commit will re-enable the assembly implementation for R600, fix bugs related to 64-bit address spaces, and also fix the incorrect assumption that address space identifiers are the same in all architectures. llvm-svn: 186415
* Add integer-gentype.inc: Missing file from r185839Tom Stellard2013-07-151-0/+39
| | | | llvm-svn: 186326
* Implement mad24() and mul24() builtinsTom Stellard2013-07-0810-0/+34
| | | | | Reviewed-by: Aaron Watry <awatry@gmail.com> llvm-svn: 185839
* Add __CLC_ prefix to all macro definitions in headersTom Stellard2013-07-0875-712/+712
| | | | | | | | | | | 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
OpenPOWER on IntegriCloud