summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib
Commit message (Collapse)AuthorAgeFilesLines
* Move unary_instrinsic.inc to private headers.Jan Vesely2019-03-138-8/+8
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356021
* trunc: Remove llvm intrinsic from the header.Jan Vesely2019-03-132-0/+11
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356018
* round: Remove llvm intrinsic from the headerJan Vesely2019-03-132-0/+11
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356017
* rint: Remove llvm intrinsic from the header.Jan Vesely2019-03-132-0/+11
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356016
* floor: Remove llvm isntrinsic from the header.Jan Vesely2019-03-132-0/+12
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356015
* fabs: Remove llvm intrinsic from the header.Jan Vesely2019-03-132-0/+12
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356014
* ceil: Remove llvm intrinsic from the header.Jan Vesely2019-03-132-0/+12
| | | | | | Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356013
* sqrt: Split function generation to a shared inc file.Jan Vesely2019-03-132-18/+26
| | | | | | | | This will be reused by other unary functions. Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356012
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-192-8/+6
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* atom: Use volatile pointers for ↵Jan Vesely2018-06-217-7/+7
| | | | | | | | | | | | | | | | cl_khr_{global,local}_int32_{base,extended}_atomics int64 versions were switched to volatile pointers in cl1.1 cl1.1 also renamed atom_ functions to atomic_ that use volatile pointers. CTS and applications use volatile pointers. Passes CTS on carrizo no return piglit tests still pass on turks. Reviewed-By: Aaron Watry <awatry@gmail.com> Tested-By: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 335280
* atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics ↵Jan Vesely2018-06-2121-148/+66
| | | | | | | | | | | | implementation These are just atomic_* wrappers. Switch inc, dec to use atomic_* wrappers as well. Reviewed-By: Aaron Watry <awatry@gmail.com> Tested-By: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 335279
* atomic: Provide function implementation of atomic_{dec,inc}Jan Vesely2018-06-213-0/+26
| | | | | | | Reviewed-By: Aaron Watry <awatry@gmail.com> Tested-By: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 335278
* math/fma: Add fp32 software implementationJan Vesely2018-06-074-0/+174
| | | | | | | | Passes CTS on carrizo (when forced to use sw fma) and turks. Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 334226
* Add initial support for half precision builtinsJan Vesely2018-05-1739-24/+420
| | | | | | | | | | | | | | v2: fix fmax implementation use consistent checks for __CLC_FP_SIZE add missing TODOs fix whitespace in definitions.h v3: undef ZERO in modf.inc Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Reviewed-by: Aaron Watry <awatry@gmail.com> Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 332677
* rootn: Use denormal path onlyJan Vesely2018-05-151-10/+1
| | | | | | | | | | | | It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs Use 0.0f explicitly intead of relying on GPU to flush it. Fixes CTS on carrizo and turks Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Acked-by: Aaron Watry <awatry@gmail.com> Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 332324
* remquo: Flush denormals if not supportedJan Vesely2018-05-031-0/+2
| | | | | | | | | | It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs. Fixes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 331435
* remquo: Port from amd builtinsJan Vesely2018-05-034-0/+279
| | | | | | | | double version passes on carrizo. float version fails on denormals. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 331434
* math: Add helper function to flush denormals if not supported.Jan Vesely2018-05-031-0/+19
| | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 331433
* log10: Use sw implementation from amd builtinsJan Vesely2018-04-235-19/+173
| | | | | | | | | | Add missing table. Fixes log10d CTS on carrizo. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Acked-by: Aaron Watry <awatry@gmail.com> Tested-by: Aaron Watry <awatry@gmail.com> llvm-svn: 330649
* powr: Use denormal path onlyJan Vesely2018-04-171-11/+1
| | | | | | | | | | It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs Fixes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 330207
* pown: Use denormal path onlyJan Vesely2018-04-171-11/+1
| | | | | | | | | | It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs Fixes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 330206
* pow: Use denormal path onlyJan Vesely2018-04-171-11/+1
| | | | | | | | | | It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs Fixes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 330205
* exp10: Port from amd builtinsJan Vesely2018-04-174-11/+153
| | | | | | | | Passes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed and Tested (on RX 580) by: Aaron Watry <awatry@gmail.com> llvm-svn: 330197
* hypot: Port from amd builtinsJan Vesely2018-04-104-4/+103
| | | | | | | | | | | v2: Fix whitespace errors Use only subnormal path. Passes CTS on carrizo and turks. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 329647
* select: simplify implementation and fix fp16Jan Vesely2018-04-061-18/+4
| | | | | | | | | | Fix half precision implementation Vector ?: operator should behave exactly as select Passes CTS on carrizo Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> llvm-svn: 329462
* fmod: Port from amd_builtinsJan Vesely2018-04-063-10/+189
| | | | | | | | | | | Uses only denormal path for fp32. Passes CTS on carrizo and turks. v2: whitespace fix Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewer: Aaron Watry <awatry@gmail.com> llvm-svn: 329433
* remainder: Port from amd builtinsJan Vesely2018-03-193-0/+226
| | | | | | | | | Mostly ported from amd_builtins, uses only denormal path for fp32. Passes CTS on carrizo and turks Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327818
* nan: ImplementJan Vesely2018-03-123-0/+27
| | | | | | | | Passes CTS on carrizo and turks Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327324
* popcount: Provide function implementation rather than intrinsic redirectJan Vesely2018-03-083-0/+12
| | | | | | | | amdgcn will need to override this Reviewer: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 327042
* lgamma_r: Move code from .inc to .cl fileJan Vesely2018-03-062-475/+496
| | | | | | Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326821
* frexp: Reuse types provided by gentype.incJan Vesely2018-03-062-78/+53
| | | | | | | | | | | v2: Use select instead of bitselect to consolidate scalar and vector versions Passes CTS on Carrizo Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326820
* select: Add vector implementationJan Vesely2018-03-063-0/+55
| | | | | | | | Passes CTS on Carrizo Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326819
* minmag: Condition variable needs to be the same bitwidth as operandsJan Vesely2018-03-062-2/+21
| | | | | | | | No changes wrt CTS Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326818
* maxmag: Condition variable needs to be the same bitwidth as operandsJan Vesely2018-03-062-2/+21
| | | | | | | | No changes wrt CTS Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326817
* Move cl_khr_fp64 exntension enablement to gentype include listsJan Vesely2018-03-0621-87/+0
| | | | | | | | This will make adding cl_khr_fp16 support easier Reviewed-by: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 326816
* Add vstore_half_rte implementationJan Vesely2018-02-061-1/+44
| | | | | | | | Passes CTS on carrizo Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324376
* Add vstore_half_rtp implementationJan Vesely2018-02-061-1/+10
| | | | | | | | Passes CTS on carrizo Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324375
* Add vstore_half_rtn implementationJan Vesely2018-02-061-1/+41
| | | | | | | | Passes CTS on carrizo Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324374
* Add vstore_half_rtz implementationJan Vesely2018-02-061-1/+34
| | | | | | | | Passes CTS on carrizo Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324373
* vstore_half: Add support for custom rounding functionsJan Vesely2018-02-061-23/+39
| | | | | | | | | Add another layer of indirection This will be used for specific rounding modes Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324371
* vstore_half: Make sure the helper function is always inlineJan Vesely2018-02-061-1/+1
| | | | | | Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 324370
* half_powr: Implement using powrJan Vesely2018-02-012-0/+7
| | | | | | | | v2: Use full precision implementation Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 323942
* math.h: Use logical operations instead of bit operations for readabilityJan Vesely2018-01-311-1/+1
| | | | | | | | Trivial. Reported-by: Roman Lebedev <lebedev.ri@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 323920
* math.h: Set HAVE_HW_FMA32 based on compiler provided macroJan Vesely2018-01-291-0/+5
| | | | | | | | | Fixes sin/cos piglits on non-FMA capable asics. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35983 Reviewer: Tom Stellard Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 323677
* tanpi: Port from amd_builtinsJan Vesely2018-01-193-0/+155
| | | | | | | | | | Passes piglit on turks and carrizo. Passes CTS on carrizo. Acked-By: Aaron Watry <awatry@gmail.com> Tested-By: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322980
* tan: Port from amd_builtinsJan Vesely2018-01-198-21/+159
| | | | | | | | | | | | v2: fixup constant precision Passes piglit on turks and carrizo. Passes CTS on carrizo Fixes half_tan to pass CTS on carrizo Acked-By: Aaron Watry <awatry@gmail.com> Tested-By: Aaron Watry <awatry@gmail.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322979
* half_divide: Implement using x/yJan Vesely2018-01-183-0/+19
| | | | | | | | | Passes CTS on carrizo v2: Use full precision implementation Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322899
* half_tan: Implement using tanJan Vesely2018-01-182-0/+7
| | | | | | | | v2: Use full precision implementation Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322898
* half_sin: Implement using sinJan Vesely2018-01-182-0/+7
| | | | | | | | | Passes CTS on carrizo v2: Use full precision implementation Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322897
* half_recip: Implement using 1/xJan Vesely2018-01-182-0/+11
| | | | | | | | | Passes CTS on carrizo v2: Use full precision implementation Reviewer: Jeroen Ketema <j.ketema@xs4all.nl> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 322896
OpenPOWER on IntegriCloud