summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert 1689ad27af5 "[builtins] Implement rounding mode support for ↵Yi Kong2019-11-271-0/+7
| | | | | | | | | i386/x86_64"" Don't build specilised fp_mode.c on MSVC since it does not support inline ASM on x86_64. This reverts commit a19f0eec94e195cac676d0d473882b48f4fded90.
* [PowerPC][compiler-rt][builtins]Add __fixtfti builtin on PowerPCLei Huang2019-11-251-0/+1
| | | | | | | | | | | | Implements __fixtfti builtin for PowerPC. This builtin converts a long double (IBM double-double) to a signed int128. The conversion relies on the unsigned conversion of the absolute value of the long double. Tests included for both positive and negative long doubles. Patch By: Baptiste Saleil Differential Revision: https://reviews.llvm.org/D69730
* Revert 1689ad27af5 "[builtins] Implement rounding mode support for i386/x86_64"Hans Wennborg2019-11-191-1/+0
| | | | | | | | It broke the build with MSVC: fp_mode.c(20): error C2065: '__asm__': undeclared identifier > Differential Revision: https://reviews.llvm.org/D69870
* [builtins] Implement rounding mode support for i386/x86_64Yi Kong2019-11-181-0/+1
| | | | Differential Revision: https://reviews.llvm.org/D69870
* [Builtins] Fix bug where powerpc builtins specializations didn't remove ↵Dan Liew2019-10-301-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | generic implementations. Summary: Previously the CMake code looked for filepaths of the form `<arch>/<filename>` as an indication that `<arch>/<filename>` provided a specialization of a top-level file `<filename>`. For powerpc there was a bug because the powerpc specialized implementations lived in `ppc/` but the architectures were `powerpc64` and `powerpc64le` which meant that CMake was looking for files at `powerpc64/<filename>` and `powerpc64le/<filename>`. The result of this is that for powerpc the builtins library contained a duplicate symbol for `divtc3` because it had the generic implementation and the specialized version in the built static library. Although we could just add similar code to what there is for arm (i.e. compute `${_arch}`) to fix this, this is extremely error prone (until r375150 no error was raised). Instead this patch takes a different approach that removes looking for the architecture name entirely. Instead this patch uses the convention that a source file in a sub-directory might be a specialization of a generic implementation and if a source file of the same name (ignoring extension) exists at the top-level then it is the corresponding generic implementation. This approach is much simpler because it doesn't require keeping track of different architecture names. This convention already existed in repository but previously it was implicit. This change makes it explicit. This patch is motivated by wanting to revert r375162 which worked around the powerpc bug found when r375150 landed. Once it lands we should revert r375162. Reviewers: phosek, beanz, compnerd, shiva0217, amyk, rupprecht, kongyi, mstorsjo, t.p.northover, weimingz, jroelofs, joerg, sidneym Subscribers: nemanjai, mgorny, kristof.beyls, jsji, shchenz, steven.zhang, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D69189
* Revert "Revert "[builtins] Rounding mode support for addxf3/subxf3""Yi Kong2019-09-051-0/+3
| | | | | | | | Test failure fixed. This reverts commit e204d244badb2e9765a1020f41c773f63da208f4. llvm-svn: 371003
* gn build: Fix redundant object files in builtin lib.Nico Weber2019-07-311-18/+0
| | | | | | | | | | | | | | | | | | | | | | compiler-rt's builtin library has generic implementations of many functions, and then per-arch optimized implementations of some. In the CMake build, both filter_builtin_sources() and an explicit loop at the end of the build file (see D37166) filter out the generic versions if a per-arch file is present. The GN build wasn't doing this filtering. Just do the filtering manually and explicitly, instead of being clever. While here, also remove files from the mingw/arm build that are redundantly listed after D39938 / r318139 (both from the CMake and the GN build). While here, also fix a target_os -> target_cpu typo. Differential Revision: https://reviews.llvm.org/D65512 llvm-svn: 367448
* Enable compiler-rt on SPARCRainer Orth2019-07-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward: - Add 32 and 64-bit sparc to compiler-rt - lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc) There's one issue of note: many asan tests fail to compile on Solaris/SPARC: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc, which doesn't have the problem above and works just fine. With this patch, sparcv9-sun-solaris2.11 test results are pretty good: Failing Tests (9): Builtins-sparc-sunos :: divtc3_test.c Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c Builtins-sparcv9-sunos :: divtc3_test.c [...] UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal patches either currently in review or about to be submitted. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D40943 llvm-svn: 365880
* [builtins] Use libtool for builtins when building for Apple platformPetr Hosek2019-06-041-0/+3
| | | | | | | | | | | | compiler-rt already uses libtool instead of ar when building for Apple platform, but that's not being used when builtins are being built separately e.g. as part of the runtimes build. This change extracts the logic setting up libtool into a separate file and uses it from both the compiler-rt and standalone builtins build. Differential Revision: https://reviews.llvm.org/D62820 llvm-svn: 362466
* [builtins] Build x86_64 with GENERIC_TF_SOURCESYi Kong2019-04-181-0/+1
| | | | llvm-svn: 358706
* [gn] Support for building compiler-rt builtinsPetr Hosek2019-04-051-81/+111
| | | | | | | | | | | | | | | | This is support for building compiler-rt builtins, The library build should be complete for a subset of supported platforms, but not all CMake options have been replicated in GN. We always use the just built compiler to build all the runtimes, which is equivalent to the CMake runtimes build. This simplifies the build configuration because we don't need to support arbitrary host compiler and can always assume the latest Clang. With GN's toolchain support, this is significantly more efficient than the CMake runtimes build. Differential Revision: https://reviews.llvm.org/D60331 llvm-svn: 357821
* Revert "[builtins] Rounding mode support for addxf3/subxf3"Yi Kong2019-03-271-4/+1
| | | | | | | | This reverts commit 2cabea054e40ae2837da959d0ca89ae25cf1b1f1. Test failure on buildbots. llvm-svn: 357048
* [builtins] Rounding mode support for addxf3/subxf3Yi Kong2019-03-261-1/+4
| | | | | | | | | | | | | | | | | Implement rounding mode support for addxf3/subxf3. On architectures that implemented the support, this will access the corresponding floating point environment register to apply the correct rounding. For other architectures, it will keep the current behaviour and use IEEE-754 default rounding mode (to nearest, ties to even). ARM32/AArch64 support implemented in this change. i386 and AMD64 will be added in a follow up change. Differential Revision: https://reviews.llvm.org/D57143 llvm-svn: 357035
* [builtins] Do not set hidden attribute on AndroidYi Kong2019-01-231-2/+6
| | | | | | | | | | Bionic libc relies on an old libgcc behaviour which does not set hidden visibility attribute. Keep exporting these symbols on Android for compatibility. Differential Revision: https://reviews.llvm.org/D56977 llvm-svn: 351915
* [compiler-rt][builtins][PowerPC] Implemented __floattitf builtin on PowerPCAmy Kwan2019-01-101-0/+1
| | | | | | | | | | | | | This patch implements the long double __floattitf (int128_t) method for PowerPC -- specifically to convert a 128 bit integer into a long double (IBM double-double). To invoke this method, one can do so by linking against compiler-rt, via the --rtlib=compiler-rt command line option supplied to clang. Differential Revision: https://reviews.llvm.org/D54313/ llvm-svn: 350818
* [compiler-rt][builtins][PowerPC] Implemented __fixunstfti builtin on PowerPCAmy Kwan2019-01-101-0/+1
| | | | | | | | | | | | | | | | | | This patch implements the __uint128_t __fixunstfti (long double) method for PowerPC -- specifically to convert a long double (IBM double-double) to an unsigned 128 bit integer. The general approach of this algorithm is to convert the high and low doubles of the long double and add them together if the doubles fit within 64 bits. However, additional adjustments and scaling is performed when the high or low double does not fit within a 64 bit integer. To invoke this method, one can do so by linking against compiler-rt, via the --rtlib=compiler-rt command line option supplied to clang. Differential Revision: https://reviews.llvm.org/D54911 llvm-svn: 350815
* [cmake] [ARM] Exclude any VFP builtins if VFP is not supportedAzharuddin Mohammed2018-07-301-0/+9
| | | | | | | | | | | | | | | | | | | | Summary: rL325492 disables FPU features when using soft floating point (-mfloat-abi=soft), which is used internally when building for arm. This causes errors with builtins that utililize VFP instructions. With this change we check if VFP is enabled (by checking if the preprocessor macro __VFP_FP__ is defined), and exclude such builtins if it is not enabled. Reviewers: rengolin, samsonov, compnerd, smeenai, javed.absar, peter.smith Reviewed By: peter.smith Subscribers: delcypher, peter.smith, mgorny, kristof.beyls, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D47217 llvm-svn: 338284
* [builtins] Implement the __chkstk function for ARM for MinGWMartin Storsjo2018-07-171-0/+1
| | | | | | | | | | This function is available for linking in from kernel32.dll, but it's not allowed to link that function from there in Windows Store apps. Differential Revision: https://reviews.llvm.org/D49055 llvm-svn: 337313
* [compiler-rt] [builtins] Don't build __atomic_* by default.Eli Friedman2018-06-141-2/+2
| | | | | | | | | | | The locks need to be implemented in a shared library to work correctly, so they shouldn't be part of libclang_rt.builtins.a, except in specialized scenarios where the user can prove it will only be linked once. Differential Revision: https://reviews.llvm.org/D47606 llvm-svn: 334779
* Revert "[cmake] [ARM] Check if VFP is supported before including any VFP ↵Azharuddin Mohammed2018-05-241-14/+5
| | | | | | | | builtins" This reverts commit 2a10f5da5acb1b51d0a2ecf13dca0bf1de859db2. llvm-svn: 333232
* [cmake] [ARM] Check if VFP is supported before including any VFP builtinsAzharuddin Mohammed2018-05-241-5/+14
| | | | | | | | | | | | | | | | | | | Summary: rL325492 disables FPU features when using soft floating point (-mfloat-abi=soft), which is used internally when building for armv7. This causes errors with builtins that utililize VFP instructions. With this change we first check if VFP is enabled (by checking if the preprocessor macro __VFP_FP__ is defined) before including such builtins. Reviewers: rengolin, samsonov, compnerd, smeenai, javed.absar, peter.smith Reviewed By: peter.smith Subscribers: peter.smith, mgorny, kristof.beyls, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D47217 llvm-svn: 333216
* Add basic compiler-rt builtins support for hexagon.Sid Manning2018-05-091-0/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D46364 llvm-svn: 331881
* [PATCH] [compiler-rt, RISCV] Support builtins for RISC-VShiva Chen2018-03-011-0/+6
| | | | | | | | | | | Summary: Support builtins for RISC-V, RV32 and RV64. Reviewers: asb, apazos, mgrang Differential Revision: https://reviews.llvm.org/D42958 llvm-svn: 326420
* [RISCV] Force enable int128 for compiling long double routinesMandeep Singh Grang2018-02-281-0/+6
| | | | | | | | | | | | | | | | | Summary: For RISCV32, we must force enable int128 for compiling long double routines using the flag -fforce-enable-int128. Related clang patch: https://reviews.llvm.org/D43105 Reviewers: asb, kito-cheng, apazos, compnerd, howard.hinnant Reviewed By: kito-cheng Subscribers: shiva0217, efriedma, mgorny, hintonda, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43106 llvm-svn: 326346
* Fix PR35739: chkstk and chkst2 should only be built for WindowsDimitry Andric2017-12-241-4/+0
| | | | | | | | | | | | | | | | | | | | As reported in PR35739, rL252927 added the Windows specific chkstk and chkstk2 sources unconditionally, and since these are assembly without a NO_EXEC_STACK_DIRECTIVE at the end, automated vulnerability scanners warned about the objects having an executable stack. Avoid the problem by only including these files when Windows is targeted. Reviewers: compnerd, rnk, martell Reviewed By: martell Subscribers: mstorsjo, mgorny, martell, javed.absar, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41567 llvm-svn: 321431
* [builtins] Implement __chkstk for arm64 windowsMartin Storsjo2017-12-201-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D41134 llvm-svn: 321151
* Fix more inconsistent line endings. NFC.Dimitry Andric2017-12-181-1/+1
| | | | llvm-svn: 321016
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-11-301-0/+14
| | | | | | | | Now that we have disabled the run-forever tests, and cleaned up the intel 80-bit float based tests, we should be able to enable testing compiler-rt for powerpc64. llvm-svn: 319474
* Move x86-specific sources to x86-specific source lists.Sterling Augustine2017-11-301-13/+22
| | | | llvm-svn: 319464
* [builtins] Include GENERIC_SOURCES in arm_SOURCES for MinGWMartin Storsjo2017-11-141-0/+1
| | | | | | | | | It is included in the built sources for all other arches supported for MinGW currently, except for arm. Differential Revision: https://reviews.llvm.org/D39938 llvm-svn: 318139
* [WebAssembly] Include GENERIC_TF_SOURCES in wasm buildsSam Clegg2017-11-071-2/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D39748 llvm-svn: 317601
* [builtins] Prevent duplicate definitions for overridden functionsFrancis Ricci2017-08-301-6/+6
| | | | | | | | | | | | | | | Summary: Some architecture-specific function overrides (for example, i386/ashrdi3.S) duplicate generic functions (in that case, ashrdi3.c). Prevent duplicate definitions by filtering out the generic files before compiling. Reviewers: compnerd, beanz Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D37166 llvm-svn: 312140
* Reland r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-281-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311924
* Revert r311842 - [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-1/+7
| | | | | | | The required change in clang is being reverted because of the Android build bot failure. llvm-svn: 311859
* [cmake] Remove i686 target that is duplicate to i386Michal Gorny2017-08-271-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the explicit i686 target that is completely duplicate to the i386 target, with the latter being used more commonly. 1. The runtime built for i686 will be identical to the one built for i386. 2. Supporting both -i386 and -i686 suffixes causes unnecessary confusion on the clang end which has to expect either of them. 3. The checks are based on wrong assumption that __i686__ is defined for all newer x86 CPUs. In fact, it is only declared when -march=i686 is explicitly used. It is not available when a more specific (or newer) -march is used. Curious enough, if CFLAGS contain -march=i686, the runtime will be built both for i386 and i686. For any other value, only i386 variant will be built. Differential Revision: https://reviews.llvm.org/D26764 llvm-svn: 311842
* [compiler-rt][ARM] Fix filtering of ARM targetsOleg Ranevskyy2017-08-101-2/+6
| | | | | | | | | | | | | | | | | Summary: Similarly to i686, the ARM build target has multiple names, such as armhf, armv7 and so on. Currently we get duplicated symbol definitions for these targets while compiling the library. Each duplicated definition has its generic version from `lib/builtins` and an ARM-specialized version from `lib/builtins/arm`. This patch fixes filtering for ARM to ignore the generic definitions if they have their ARM specializations. Reviewers: compnerd Reviewed By: compnerd Subscribers: aemerson, dberris, llvm-commits, mgorny, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D35336 llvm-svn: 310588
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-011-14/+0
| | | | llvm-svn: 309704
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-311-0/+14
| | | | | | | | | | | | | | Summary: Add powerpc64 to compiler-rt build infrastructure. Reviewers: timshen Reviewed By: timshen Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36108 llvm-svn: 309634
* [builtins] Better Fuchsia supportPetr Hosek2017-07-121-4/+9
| | | | | | | | | Add Fuchsia support to some builtings and avoid building builtins that are not and will never be used on Fuchsia. Differential Revision: https://reviews.llvm.org/D34075 llvm-svn: 307832
* Add generic __bswap[ds]i2 implementationsDimitry Andric2017-05-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: In FreeBSD we needed to add generic implementations for `__bswapdi2` and `__bswapsi2`, since gcc 6.x for mips is emitting calls to these. See: https://reviews.freebsd.org/D10838 and https://reviews.freebsd.org/rS318601 The actual mips code generated for these generic C versions is pretty OK, as can be seen in the (FreeBSD) review. I checked over gcc sources, and it seems that it can emit these calls on more architectures, so maybe it's best to simply always add them to the compiler-rt builtins library. Reviewers: howard.hinnant, compnerd, petarj, emaste Reviewed By: compnerd, emaste Subscribers: mgorny, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D33516 llvm-svn: 303866
* [cmake] Disable building emutls.c for baremetal targets.Catherine Moore2017-05-251-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D33199 llvm-svn: 303865
* builtins: fix filtering aliased targetsSaleem Abdulrasool2017-05-151-1/+8
| | | | | | | | | Some build targets (e.g. i686) have aliased names (e.g. i386). We would get multiple definitions previously and have the linker arbitrarily select a definition on those aliased targets. Make this more deterministic by checking those aliases. llvm-svn: 303103
* [cmake] Disable building enable_execute_stack.c for baremetal targets.Catherine Moore2017-05-101-1/+6
| | | | | | | | | Disable building enable_execute_stack.c for targets that do not have support for mprotect(). Differential Revision: https://reviews.llvm.org/D33018 llvm-svn: 302680
* [builtins] Fixup emulated TLS for mingw.Martell Malone2017-05-061-1/+2
| | | | | | | | | | | | | Enabled emulated TLS on WOA for mingw Fix <windows.h> include for mingw Reviewed By: chapuni, mstorsjo Subscribers: compnerd, llvm-commits Differential Revision: https://reviews.llvm.org/D32681 llvm-svn: 302340
* [compiler-rt][mips] Add support for quad precision builtins for mips64Simon Dardis2017-05-041-20/+25
| | | | | | | | | | | | | | Match the builtins that GCC provides for IEEE754 quad precision on MIPS64. Also, enable building them with clang as PR20098 is resolved. Disable tests for xf and xc modes as MIPS doesn't support that mode in hardware or software. Reviewers: slthakur Differential Revision: https://reviews.llvm.org/D32794 llvm-svn: 302147
* Roll back r301831 to fix broken powerpc64le tests.Sterling Augustine2017-05-021-14/+0
| | | | | | http://lab.llvm.org:8011/builders/clang-ppc64le-linux/builds/5941 llvm-svn: 301935
* Add powerpc64 and powerpc64le to build infrastructure.Sterling Augustine2017-05-011-0/+14
| | | | | | From Phab D32031. llvm-svn: 301831
* [builtins] Implement emulated TLS on Windows.Frederich Munch2017-04-251-7/+2
| | | | | | | | | | | | | | | Summary: LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. Reviewers: chh, howard.hinnant Reviewed By: chh Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30787 llvm-svn: 301350
* Revert r301089 "[builtins] Implement emulated TLS on Windows."Hans Wennborg2017-04-241-2/+7
| | | | | | | | | | | | | | | | | | | | | This broke the self-host build on Windows (PR32777). Original commit message: > [builtins] Implement emulated TLS on Windows. > > Summary: > LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. > > Reviewers: chh, howard.hinnant > > Reviewed By: chh > > Subscribers: mgorny, llvm-commits > > Differential Revision: https://reviews.llvm.org/D30787 llvm-svn: 301274
* [builtins] Implement emulated TLS on Windows.Frederich Munch2017-04-221-7/+2
| | | | | | | | | | | | | | | Summary: LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows. Reviewers: chh, howard.hinnant Reviewed By: chh Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30787 llvm-svn: 301089
OpenPOWER on IntegriCloud