summaryrefslogtreecommitdiff
path: root/libclc
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Nico Weber2023-05-171-1/+1
| | | | | | | | | | | | | | This reverts commit 65429b9af6a2c99d340ab2dcddd41dab201f399c. Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards. Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C" This reverts commit 4072c8aee4c89c4457f4f30d01dc9bb4dfa52559. Also reverts fix attempt "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump" This reverts commit 7d47dac5f828efd1d378ba44a97559114f00fb64.
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-05-131-1/+1
| | | | | | The owner of the last two failing buildbots updated CMake. This reverts commit e8e8707b4aa6e4cc04c0cffb2de01d2de71165fc.
* libclc: clspv: fix fma, add vstore and fix inlining issuesKévin Petit2023-05-096-124/+298
| | | | | | https://reviews.llvm.org/D147773 Patch by Romaric Jodin <rjodin@google.com>
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-05-061-1/+1
| | | | | | Unfortunatly not all buildbots are updated. This reverts commit ffb807ab5375b3f78df198dc5d4302b3b552242f.
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-05-061-1/+1
| | | | | | All build bots should be updated now. This reverts commit 44d38022ab29a3156349602733b3459df5beef93.
* Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""Mark de Wever2023-04-151-1/+1
| | | | | | This reverts commit 1ef4c3c859728008cf707cad8d67f45ae5070ae1. Two buildbots still haven't been updated.
* Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-04-151-1/+1
| | | | | | This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade. Reland to see whether CIs are updated.
* Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""Mark de Wever2023-03-181-1/+1
| | | | | | This reverts commit a72165e5df59032cdd54dcb18155f2630d73abd1. Some buildbots have not been updated yet.
* Reland "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-03-181-1/+1
| | | | | | This reverts commit 92523a35a827539db8557bbc3ecab7f9ea3f6ade. Test whether all CI runners are updated.
* Revert "[CMake] Bumps minimum version to 3.20.0."Mark de Wever2023-03-041-1/+1
| | | | | | | Some build bots have not been updated to the new minimal CMake version. Reverting for now and ping the buildbot owners. This reverts commit 44c6b905f8527635e49bb3ea97dea315f92d38ec.
* [CMake] Bumps minimum version to 3.20.0.Mark de Wever2023-03-041-1/+1
| | | | | | | | | | | | | | This partly undoes D137724. This change has been discussed on discourse https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193 Note this does not remove work-arounds for older CMake versions, that will be done in followup patches. Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi Differential Revision: https://reviews.llvm.org/D144509
* libclc: add clspv to targets exempt from alwaysinlineKévin Petit2023-02-141-2/+4
| | | | | | https://reviews.llvm.org/D132362 Patch by: Aaron Greig <aaron.greig@codeplay.com>
* libclc: add generated convert.cl to clspv/clspv64 targetsKévin Petit2023-02-141-3/+3
| | | | | | https://reviews.llvm.org/D136772 Patch by: Aaron Greig <aaron.greig@codeplay.com>
* libclc: add more generic implementations to clspv SOURCESKévin Petit2023-02-141-2/+39
| | | | | | https://reviews.llvm.org/D134887 Patch by: Aaron Greig <aaron.greig@codeplay.com>
* libclc: remove sqrt/rsqrt from clspv SOURCESKévin Petit2023-02-131-3/+0
| | | | | | https://reviews.llvm.org/D134040 Patch by: Aaron Greig <aaron.greig@codeplay.com>
* libclc: Fix building against an llvm build directoryTom Stellard2023-01-271-1/+4
| | | | | | Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142718
* libclc: Set CMAKE_CXX_STANDARD to 17 to match llvmTom Stellard2023-01-271-0/+2
| | | | | | Reviewed By: thieta Differential Revision: https://reviews.llvm.org/D142720
* libclc: Add parentheses to silence warningMatt Arsenault2022-12-291-1/+1
| | | | Fixes #59209
* libclc: Use cmake files instead of llvm-configTom Stellard2022-11-222-72/+28
| | | | | | Reviewed By: mgorny Differential Revision: https://reviews.llvm.org/D137854
* [libclc] Quote addition of CLC/LLAsm flagsNikita Popov2022-08-311-2/+2
| | | | | | Otherwise cmake will insert a semicolon if flags are already set. Differential Revision: https://reviews.llvm.org/D131490
* Remove references to old mailing lists that have moved to discourse. Replace ↵tlattner2022-07-221-2/+2
| | | | | | | | with links to discourse. Reviewed By: #libc_abi, ldionne Differential Revision: https://reviews.llvm.org/D129675
* libclc: Add clspv64 targetKévin Petit2022-01-132-2/+12
| | | | | | | | | Add a variant of the clspv target that is built using spir64. This is a pre-requisite to supporting spir64 in clspv which is required to take advantage of SPV_KHR_physical_storage_buffer which in turn enables more OpenCL C programs to be compiled with clspv. https://reviews.llvm.org/D116668
* Quote some more destination paths with variablesJohn Ericson2021-12-131-6/+6
| | | | | | | | | | Just defensive CMake-ing. I pulled this from D115544 and D99484 which are blocked on some lldb CI failures I don't yet understand. Hoping to land something smaller in the meantime. Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D115566
* Revert "Revert "Revert "Use `GNUInstallDirs` to support custom installation ↵Med Ismail Bennani2021-12-101-6/+6
| | | | | | | | | | | | dirs. -- LLVM""" This reverts commit 492de35df443d5f31480173d5f1274c7835cd3d8. I tried to apply John's changes in 8d897ec91528 that were expected to fix his patch but that didn't work unfortunately. Reverting this again to fix the macOS bots and leave him more time to investigate the issue.
* Revert "Revert "Use `GNUInstallDirs` to support custom installation dirs. -- ↵John Ericson2021-12-101-6/+6
| | | | | | | | | | | | | | LLVM"" This reverts commit 797b50d4be873b4662983413a06806fca544c276. See the original D99484. @mib who noticed the original problem could not longer reproduce it, after I tried and also failed. We are threfore hoping it went away on its own! Reviewed By: mib Differential Revision: https://reviews.llvm.org/D115544
* Revert "Use `GNUInstallDirs` to support custom installation dirs. -- LLVM"Med Ismail Bennani2021-11-021-6/+6
| | | | | | | | | This reverts commit 6fd2db04d0f22ea22c5317d98ce2126aa64b6a73 since it broke GreenDragon LLDB-Incremental bot: https://green.lab.llvm.org/green/job/lldb-cmake/37560/console Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* Use `GNUInstallDirs` to support custom installation dirs. -- LLVMJohn Ericson2021-11-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new draft of D28234. I previously did the unorthodox thing of pushing to it when I wasn't the original author, but since this version - Uses `GNUInstallDirs`, rather than mimics it, as the original author was hesitant to do but others requested. - Is much broader, effecting many more projects than LLVM itself. I figured it was time to make a new revision. I am using this patch (and many back-ports) as the basis of https://github.com/NixOS/nixpkgs/pull/111487 for my distro (NixOS). It looked like people were generally on board in D28234, but I make note of this here in case extra motivation is useful. --- As pointed out in the original issue, a central tension is that LLVM already has some partial support for these sorts of things. For example `LLVM_LIBDIR_SUFFIX`, or `COMPILER_RT_INSTALL_PATH`. Because it's not quite clear yet what to do about those, we are holding off on changing libdirs and `compiler-rt`. for this initial PR. --- On the advice of @lebedev.ri, I am splitting this up a bit per subproject, starting with LLVM. To allow it to be more easily reviewed. This and the subsequent patch must be landed together, as this will not build alone. But the rest can be landed on their own. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D100810
* libclc: Fix rounding during type conversionDaniel Stone2021-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The rounding during type conversion uses multiple conversions, selecting between them to try to discover if rounding occurred. This appears to not have been tested, since it would generate code of the form: float convert_float_rtp(char x) { float r = convert_float(x); char y = convert_char(y); [...] } which will access uninitialised data. The idea appears to have been to have done a char -> float -> char roundtrip in order to discover the rounding, so do this. Discovered by inspection. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed By: jvesely Differential Revision: https://reviews.llvm.org/D81999
* libclc: Add -cl-no-stdinc to clang flags on clang >=13Jan Vesely2021-07-151-1/+9
| | | | | | | | | | | | | cf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce ("[OpenCL] Add builtin declarations by default.") switched behaviour to include "opencl-c-base.h". We don't want or need that for libclc so pass the flag to revert to old behaviour. Fixes build since cf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D99794
* Support: Stop using F_{None,Text,Append} compatibility synonyms, NFCDuncan P. N. Exon Smith2021-04-301-2/+2
| | | | | | | | Stop using the compatibility spellings of `OF_{None,Text,Append}` left behind by 1f67a3cba9b09636c56e2109d8a35ae96dc15782. A follow-up will remove them. Differential Revision: https://reviews.llvm.org/D101650
* libclc: Add clspv target to libclcAlan Baker2021-03-046-2/+352
| | | | | | | | | | | | | | | Add clspv as a new target for libclc. clspv is an open-source compiler that compiles OpenCL C to Vulkan SPIR-V. Compiles for the spir target. The clspv target differs from the the spirv target in the following ways: * fma is modified to use uint2 instead of ulong for mantissas. This results in lower performance fma, but provides a implementation that can be used on more Vulkan devices where 64-bit integer support is less common. * Use of a software implementation of nextafter because the generic implementation depends on nextafter being a defined builtin function for which clspv has no definition. * Full optimization of the library (-O3) and no conversion to SPIR-V This library is close to what would be produced by running opt -O3 < builtins.opt.spirv-mesa3d-.bc > builtins.opt.clspv--.bc and continuing the build from that point. Reviewer: jvesely Differential Revision: https://reviews.llvm.org/D94013
* libclc: Use find_package to find Python 3 and require itAaron Puchert2020-10-012-4/+2
| | | | | | | | | | | | | | | | | | | The script's shebang wants Python 3, so we use FindPython3. The original code didn't work when an unversioned python was not available. This is explicitly allowed in PEP 394. ("Distributors may choose to set the behavior of the python command as follows: python2, python3, not provide python command, allow python to be configurable by an end user or a system administrator.") Also I think it's actually required, so let the configuration fail if we can't find it. Lastly remove the shebang, since the script is only run via interpreter and doesn't have the executable bit set anyway. Reviewed By: jvesely Differential Revision: https://reviews.llvm.org/D88366
* libclc: Add a __builtin to let SPIRV targets select between SW and HW FMADaniel Stone2020-09-163-0/+13
| | | | | Reviewer: jenatali jvesely Differential Revision: https://reviews.llvm.org/D85910
* libclc/spirv: Add missing files from D85911Jan Vesely2020-09-104-0/+18
| | | | | Fixes: 060c8e083dd637866854acb6a0823c45b2ef68ef Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
* libclc/spirv: Add various functionsDaniel Stone2020-09-102-0/+12
| | | | | | | | Adds fma,fmod,ldexp. Reviewer: jenatali jvesely Differential Revision: https://reviews.llvm.org/D85911
* libclc: Add Mesa/SPIR-V targetDave Airlie2020-08-178-41/+336
| | | | | | | | | | | | | | | Add targets to emit SPIR-V targeted to Mesa's OpenCL support, using SPIR-V 1.1. Substantially based on Dave Airlie's earlier work. libclc: spirv: remove step/smoothstep apis not defined for SPIR-V libclc: disable inlines for SPIR-V builds Reviewed By: jvesely, tstellar, jenatali Differential Revision: https://reviews.llvm.org/D77589
* libclc: Make all built-ins overloadableDaniel Stone2020-08-1741-173/+191
| | | | | | | | | | | | The SPIR spec states that all OpenCL built-in functions should be overloadable and mangled, to ensure consistency. Add the overload attribute to functions which were missing them: work dimensions, memory barriers and fences, and events. Reviewed By: tstellar, jenatali Differential Revision: https://reviews.llvm.org/D82078
* libclc: Fix FP_ILOGBNAN definitionBoris Brezillon2020-08-172-3/+19
| | | | | | | | | | | | Fix FP_ILOGBNAN definition to match the opencl-c-base.h one and guarantee that FP_ILOGBNAN and FP_ILOGB0 are different. Doing that implies fixing ilogb() implementation to return the right value. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed By: jvesely Differential Revision: https://reviews.llvm.org/D83473
* [CMake] Bump CMake minimum version to 3.13.4Louis Dionne2020-07-221-1/+1
| | | | | | | | | | | This upgrade should be friction-less because we've already been ensuring that CMake >= 3.13.4 is used. This is part of the effort discussed on llvm-dev here: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140578.html Differential Revision: https://reviews.llvm.org/D78648
* libclc: update website urldavidak2020-05-291-1/+1
| | | | old link is dead
* libclc: Compile with -nostdlibMatt Arsenault2020-05-281-1/+1
| | | | | This fixes a build error when compiling for amdgcn-amd-amdhsa, which defaults to trying to link bitcode libraries.
* libclc: Pass system libraries to the linker after llvm librariesTom Stellard2020-04-291-1/+1
| | | | | | | | | | | | | | | | Summary: The llvm libraries depend on the symbols in the system libaries, so the system libraries need to be added after. Reviewers: jvesely Reviewed By: jvesely Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78535
* libclc: Use temporary files rather than a pipeDaniel Stone2020-04-141-1/+2
| | | | | | | | | | | | | | This is required for using the Ninja backend on Windows, as it passes commands directly to CreateProcess, and does not allow the shell to interpret them: https://ninja-build.org/manual.html#ref_rule_command Using the Visual Studio backend is not possible as attempting to create a static library target comprised entirely of novel languages not known to the Visual Studio backend built in to CMake's C++ source will generate nothing at all. reviewer: jvesely Differential Revision: https://reviews.llvm.org/D77165
* libclc: Don't pass linker flags to CLC/LLAsmDaniel Stone2020-04-142-2/+2
| | | | | | | | | We don't want the regular linker flags for these invocations, since we're not compiling to the target machine anyway. This fixes things like '/machine:x64' being unknown when invoked under Windows. reviewer: jvesely Differential Revision: https://reviews.llvm.org/D77164
* libclc: Use echo rather than true for try_compileDaniel Stone2020-04-142-2/+2
| | | | | | | | When providing a fake compiler, libclc currently uses 'true' which does not exist on Windows. Use echo instead as the no-op. reviewer: jvesely Differential Revision: https://reviews.llvm.org/D77163
* libclc: Fix LLVM library linking on WindowsDaniel Stone2020-04-141-1/+3
| | | | | | | | | CMake requires library lists on Windows to be split by semi-colons, rather than the spaces we get from llvm-config. Fix this by a substitution on Windows. reviewer: jvesely Differential Revision: https://reviews.llvm.org/D77162
* libclc: cmake configure should depend on file listJan Vesely2020-02-251-0/+10
| | | | | | This makes sure targets are rebuilt if a file is added or removed. Reviewer: tstellar Differential Revision: https://reviews.llvm.org/D74662
* libclc: Use acos implementation from amd_builtinsJan Vesely2020-02-202-38/+171
| | | | | | Fixes acos CTS (1 thread, scalar) on AMD Turks. Reviewer: tstellar Differential Revision: https://reviews.llvm.org/D74011
* libclc/r600: Use target specific builtins to implement rsqrt and native_rsqrtJan Vesely2020-02-093-0/+35
| | | | | | | Fixes OCL CTS rsqrt and half_rsqrt (1 thread, scalaer) tests on AMD Turks. Reviewer: awatry Differential Revision: https://reviews.llvm.org/D74016
* libclc: Move rsqrt implementation to a .cl fileJan Vesely2020-02-093-1/+31
| | | | | Reviewer: awatry Differential Revision: https://reviews.llvm.org/D74013