aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/compiler-rt/lib/builtins
Commit message (Collapse)AuthorAgeFilesLines
* Merge llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76eDimitry Andric2024-11-211-4/+9
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.4-0-gaadaa00de76e, a.k.a. 19.1.4 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1Dimitry Andric2024-10-233-2/+22
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-0-ga4bf6cd7cfb1, a.k.a. 19.1.0 release. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8Dimitry Andric2024-10-231-1/+9
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc3-0-g437434df21d8. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1cDimitry Andric2024-10-231-298/+0
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc2-0-gd033ae172d1c. PR: 280562 MFC after: 1 month
* Merge llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2Dimitry Andric2024-10-234-28/+91
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2. PR: 280562 MFC after: 1 month
* Merge llvm-project main llvmorg-19-init-18630-gf2ccf80136a0Dimitry Andric2024-10-2326-358/+1335
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the last commit before the upstream release/19.x branch was created. PR: 280562 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6Dimitry Andric2024-04-202-0/+84
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6. PR: 276104 MFC after: 3 days
* Merge llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879Dimitry Andric2024-04-064-19/+34
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879. PR: 276104 MFC after: 1 month
* Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967Dimitry Andric2024-04-062-4/+0
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-18359-g93248729cfaeDimitry Andric2024-04-068-21/+119
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-18359-g93248729cfae, the last commit before the upstream release/18.x branch was created. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4Dimitry Andric2024-04-063-14/+2
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-16003-gfc5f51cf5af4. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-15692-g007ed0dccd6aDimitry Andric2024-04-0615-627/+896
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15692-g007ed0dccd6a. PR: 276104 MFC after: 1 month
* Tentatively apply https://github.com/llvm/llvm-project/pull/76175Dimitry Andric2024-04-061-2/+0
| | | | | | | This fixes libsa including compiler-rt builtins. PR: 276104 MFC after: 1 month
* Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fbDimitry Andric2024-04-0672-842/+1168
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb. PR: 276104 MFC after: 1 month
* Merge llvm-project release/17.x llvmorg-17.0.0-rc4-10-g0176e8729ea4Dimitry Andric2023-12-083-5/+42
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-17.0.0-rc4-10-g0176e8729ea4. PR: 273753 MFC after: 1 month
* Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51Dimitry Andric2023-12-0859-125/+289
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. PR: 273753 MFC after: 1 month
* Merge commit 4bb2416d42eb from llvm-project (by Jessica Clarke):Jessica Clarke2023-09-041-3/+37
| | | | | | | | | | | | | | | | | | | | | | [builtins][AArch64] Implement _sync out-of-line atomics Whilst Clang does not use these, recent GCC does, and so on systems such as FreeBSD that wish to use compiler-rt as the system runtime library but also wish to support building programs with GCC these interfaces are needed. This is a light adaptation of the code committed to GCC by Sebastian Pop <spop@amazon.com>, relicensed with permission for use in compiler-rt. Fixes https://github.com/llvm/llvm-project/issues/63483 Reviewed By: sebpop, MaskRay Differential Revision: https://reviews.llvm.org/D158536 Reviewed by: dim MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41716
* Merge commit 2b0f5df7b4e0 from llvm-project (by Jessica Clarke):Dimitry Andric2023-07-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | [builtins][Mips] Un-break FreeBSD build of __clear_cache Commit 674a17e9bbe8 ("MIPS/compiler_rt: use synci to flush icache on r6") completely removed the OS-specific guards under the guise of "For pre-r6, we can use cacheflush libc function, which is same on Linux and FreeBSD." However, the code in question had guards for Linux and OpenBSD, not Linux and FreeBSD, and FreeBSD does not have a cacheflush libc function as claimed, so this was neither the statement they intended to make nor was it sufficient justification for making the code completely unconditional. Whilst the upcoming FreeBSD 14 release has dropped support for MIPS, FreeBSD 13 has support for it. Fix this by only calling cacheflush on the OSes where it was previously called, and not on other OSes where it either definitely isn't available (FreeBSD) or is unknown (any other OS than the three mentioned in this commit). This is only needed for MFC'ing, as mips has been removed from 14-CURRENT. PR: 271047 MFC after: immediately
* Merge commit 16949c5c48ab from llvm-project (by Dimitry Andric):Dimitry Andric2023-06-221-19/+19
| | | | | | | | | | | | | | | | | | | | [compiler-rt] Include system headers before optionally defining HWCAP macros In https://reviews.llvm.org/D141285 the optional definitions of `HWCAP` macros were moved to before their usage. However, they were also moved to before the inclusion of system headers which can optionally define them. If any of those system headers then actually defined any of the `HWCAP` macros, it would result in a redefinition error. Move the system header includes to just before the optional definitions, to avoid this problem. Reviewed By: ilinpv Differential Revision: https://reviews.llvm.org/D148819 PR: 271047 MFC after: 1 month
* Merge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979Dimitry Andric2023-06-221-0/+3
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-16.0.1-0-gcd89023f7979 (aka 16.0.1 release). PR: 271047 MFC after: 1 month
* Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41Dimitry Andric2023-06-228-32/+654
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-16-init-18548-gb0daacf58f41. PR: 271047 MFC after: 1 month
* Merge llvm-project release/15.x llvmorg-15.0.0-rc2-40-gfbd2950d8d0dDimitry Andric2023-02-082-2/+2
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-15.0.0-rc2-40-gfbd2950d8d0d. PR: 265425 MFC after: 2 weeks
* Merge llvm-project main llvmorg-15-init-17826-g1f8ae9d7e7e4Dimitry Andric2023-02-081-1/+1
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-15-init-17826-g1f8ae9d7e7e4, the last commit before the upstream release/16.x branch was created. PR: 265425 MFC after: 2 weeks
* Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787Dimitry Andric2023-02-0823-37/+436
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-15-init-15358-g53dc0f10787. PR: 265425 MFC after: 2 weeks
* Apply compiler-rt fix for building with earlier versions of clangDimitry Andric2022-06-011-0/+3
| | | | | | | | | | | | | | | | | | | | Merge commit 18efa420da5f from llvm git (by Brooks Davis) compiler-rt: Allow build without __c11_atomic_fetch_nand Don't build atomic fetch nand libcall functions when the required compiler builtin isn't available. Without this compiler-rt can't be built with LLVM 13 or earlier. Not building the libcall functions isn't optimal, but aligns with the usecase in FreeBSD where compiler-rt from LLVM 14 is built with an LLVM 13 clang and no LLVM 14 clang is built. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D126710 MFC after: 3 days
* Merge llvm-project main llvmorg-14-init-18294-gdb01b123d012Dimitry Andric2022-05-146-14/+14
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-18294-gdb01b123d012, the last commit before the upstream release/14.x branch was created. PR: 261742 MFC after: 2 weeks
* Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35Dimitry Andric2022-05-145-8/+14
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-17616-g024a1fab5c35. PR: 261742 MFC after: 2 weeks
* Merge llvm-project main llvmorg-14-init-13186-g0c553cc1af2eDimitry Andric2022-05-141-2/+18
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-13186-g0c553cc1af2e. PR: 261742 MFC after: 2 weeks
* Merge llvm-project main llvmorg-14-init-10186-gff7f2cfa959bDimitry Andric2022-05-1419-49/+95
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-10186-gff7f2cfa959b. PR: 261742 MFC after: 2 weeks
* powerpc: implement __clear_cachePiotr Kubaj2022-04-021-1/+4
| | | | | | | | | | | | Merge LLVM commit 81f5c6270cdfcdf80e6296df216b696a7a37c8b5. This fixes runtime of most notably pcre libraries (currently patched in ports), and probably also other ports since currently __clear_cache() just calls SIGABRT on powerpc. MFC after: 3 days Reviewed by: dim Differential Revision: https://reviews.freebsd.org/D34736
* Merge llvm-project release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23Dimitry Andric2021-11-131-1/+8
| | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13.0.0-rc3-8-g08642a395f23. PR: 258209 MFC after: 2 weeks
* Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5Dimitry Andric2021-11-1333-332/+773
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before the upstream release/13.x branch was created. PR: 258209 MFC after: 2 weeks
* compiler-rt: add aarch64 init function for LSE atomicsDimitry Andric2021-09-061-0/+6
| | | | | | | | | | | | | | | | | As reported by Ronald, adding the out-of-line LSE atomics helpers for aarch64 to compiler-rt was not sufficient to link programs using these, as they also require a __aarch64_have_lse_atomics global. This is initialized in compiler-rt's lib/builtins/cpu_model.c, roughly similar to the x86 CPU model and feature detection in that file. Since upstream does not yet have a FreeBSD specific implementation for getting the required information, add a simple one that should work for now, while I try to get it sorted with the LLVM people. Reported by: Ronald Klop <ronald-lists@klop.ws> Fixes: cc55ee8009a5 PR: 257392 MFC after: 2 weeks
* Merge llvm-project main llvmorg-12-init-17869-g8e464dd76befDimitry Andric2021-06-1341-877/+1297
| | | | | | | | | This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-12-init-17869-g8e464dd76bef, the last commit before the upstream release/12.x branch was created. PR: 255570 MFC after: 6 weeks
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-09-162-3/+3
| | | | | | | | | | release/11.x llvmorg-11.0.0-rc2-91-g6e042866c30. MFC after: 6 weeks X-MFC-With: r364284 Notes: svn path=/head/; revision=365807
* Add atomic and bswap functions to libcompiler_rtDimitry Andric2020-08-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26159 Notes: svn path=/head/; revision=364753
* r356104 | jhibbits | 2019-12-27 00:06:28 +0100 (Fri, 27 Dec 2019) | 25 linesDimitry Andric2020-08-061-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [PowerPC] enable atomic.c in compiler_rt and do not check and forces lock/lock_free decisions in compiled time Summary: Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime decision about lock/lock_free. At compiling time, if clang can't decide if atomic operation can be lock free, it emits calls to external functions like `__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and `__atomic_always_lock_free`, postponing decision to a runtime check. According to LLVM code documentation, the mechanism exists due to differences between x86_64 processors that can't be decided at runtime. On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock free, so we force the decision at compile time and avoid having to implement it in an external library. This patch was made after 32 bit users testing the PowePC32 bit ISO reported llvm could not be compiled with in-base llvm due to `__atomic_load8` not implemented. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits, dim Differential Revision: https://reviews.freebsd.org/D22549 Notes: svn path=/projects/clang1100-import/; revision=363977
* Reapply r354347 (by cem):Dimitry Andric2020-08-061-1/+16
| | | | | | | | | | | | | | | | | | | | | | Fix llvm-libunwind userspace build on ARM GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or EHABI or whatever it's called. Export the same ones from LLVM-libunwind's libgcc_s, on ARM. As part of this, convert libgcc_s from a direct Version.map to one constructed from component Symbol.map files. This allows the ARM-specific Symbol.map to be included only on ARM. Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match non-ARM definitions and ARM-specific expectations in libcxxrt / libcompiler_rt. No functional change intended for non-ARM architectures. This commit does not actually flip the switch for ARM defaults from libgcc to llvm-libunwind, but makes it possible (to compile, anyway). Notes: svn path=/projects/clang1100-import/; revision=363975
* Reapply r329859 (partially, by imp):Dimitry Andric2020-08-061-0/+4
| | | | | | | | | | | | Do not include float interfaces when using libsa. We don't support float in the boot loaders, so don't include interfaces for float or double in systems headers. In addition, take the unusual step of spiking double and float to prevent any more accidental seepage. Notes: svn path=/projects/clang1100-import/; revision=363963
* Undo r230021 again, further shrinking the diff against upstream.Dimitry Andric2020-08-031-23/+0
| | | | | | | | | | | This revision worked around an endless recursion when compiling clzdi2.c and ctzdi2.c with gcc, upstream landed a different workaround for this in https://reviews.llvm.org/rL324593, which is effective enough. Noticed by: jrtc27 Notes: svn path=/projects/clang1100-import/; revision=363803
* Reapply r326600 (by imp):Dimitry Andric2020-08-021-1/+5
| | | | | | | | | | | | Since this is contrib code, create an upstreamable version of my change. Now on FreeBSD and NetBSD if _STANDALONE is defined, we include the kernel version with alloances for the quirky differences between the two. Sponsored by: Netflix Notes: svn path=/projects/clang1100-import/; revision=363778
* Reapply r230021, r276851 and a few other commits to compiler-rtDimitry Andric2020-08-021-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reapply r230021 (by ed): Add a workaround to prevent endless recursion in compiler-rt. SPARC and MIPS CPUs don't have special instructions to count leading/trailing zeroes. The compiler-rt library provides fallback rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are implemented as simple wrappers around the compiler built-in __builtin_clz(), assuming these will expand to either 32-bit CPU instructions or calls to __clzsi2 and __ctzsi2. Unfortunately, our GCC 4.2 probably thinks that because the operand is stored in a 64-bit register, it might just be a better idea to invoke its 64-bit equivalent, simply resulting into endless recursion. Fix this by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2 explicitly. Reapply r276851: Update compiler-rt to trunk r224034. This brings a number of new builtins, and also the various sanitizers. Support for these will be added in a later commit. Notes: svn path=/projects/clang1100-import/; revision=363773
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-07-3155-565/+532
| | | | | | | | | | | | master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. Note that for now, I rolled back all our local changes to make merging easier, and I will reapply the still-relevant ones after updating to 11.0.0-rc1. Notes: svn path=/projects/clang1100-import/; revision=363742
* Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmpDimitry Andric2020-06-283-19/+46
| | | | | | | | | | | | | | | | llvmorg-10.0.1-rc2-0-g77d76b71d7d. Also add a few more llvm utilities under WITH_CLANG_EXTRAS: * llvm-dwp, a utility for merging DWARF 5 Split DWARF .dwo files into .dwp (DWARF package files) * llvm-size, a size(1) replacement * llvm-strings, a strings(1) replacement MFC after: 3 weeks Notes: svn path=/head/; revision=362719
* Merge ^/vendor/lvm-project/master up to its last change (upstream commitDimitry Andric2020-01-245-17/+122
| | | | | | | e26a78e70), and resolve conflicts. Notes: svn path=/projects/clang1000-import/; revision=357095
* Merge ^/vendor/compiler-rt/dist up to its last change, and resolve conflicts.Dimitry Andric2020-01-2224-78/+285
| | | | Notes: svn path=/projects/clang1000-import/; revision=356999
* [PowerPC] enable atomic.c in compiler_rt and do not check and forcesJustin Hibbits2019-12-261-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | lock/lock_free decisions in compiled time Summary: Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime decision about lock/lock_free. At compiling time, if clang can't decide if atomic operation can be lock free, it emits calls to external functions like `__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and `__atomic_always_lock_free`, postponing decision to a runtime check. According to LLVM code documentation, the mechanism exists due to differences between x86_64 processors that can't be decided at runtime. On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock free, so we force the decision at compile time and avoid having to implement it in an external library. This patch was made after 32 bit users testing the PowePC32 bit ISO reported llvm could not be compiled with in-base llvm due to `__atomic_load8` not implemented. Submitted by: alfredo.junior_eldorado.org.br Reviewed by: jhibbits, dim Differential Revision: https://reviews.freebsd.org/D22549 Notes: svn path=/head/; revision=356104
* Move all sources from the llvm project into contrib/llvm-project.Dimitry Andric2019-12-20354-0/+24972
This uses the new layout of the upstream repository, which was recently migrated to GitHub, and converted into a "monorepo". That is, most of the earlier separate sub-projects with their own branches and tags were consolidated into one top-level directory, and are now branched and tagged together. Updating the vendor area to match this layout is next. Notes: svn path=/head/; revision=355940