summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [Builtins] Do not use tailcall for Thumb1Weiming Zhao2017-11-094-0/+30
| | | | | | | | | | | | | | | | Summary: The `b` instruction in Thumb1 has limited range, which may cause link-time errors if the jump target is far away. This patch guards the tailcalls for non-Thumb1 Reviewers: peter.smith, compnerd, rengolin, eli.friedman Reviewed By: rengolin Subscribers: joerg, dalias, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D39700 llvm-svn: 317814
* [WebAssembly] Include GENERIC_TF_SOURCES in wasm buildsSam Clegg2017-11-071-2/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D39748 llvm-svn: 317601
* [X86] Add Knights Mill CPU to cpu_indicator support to match libgcc.Craig Topper2017-10-111-0/+5
| | | | llvm-svn: 315505
* [compiler-rt] Add back ARM EABI aliases where legal.Eli Friedman2017-10-0340-82/+145
| | | | | | | | | | | | | | r303188 removed all the uses of aliases for EABI functions from compiler-rt, because some of them had mismatched calling conventions. Obviously, we can't use aliases for functions which don't have the same calling convention, but that's only an issue for floating-point functions with the hardfloat ABI. In other cases, the stubs increase size and reduce performance for no benefit. This patch adds back the aliases, with appropriate checks to make sure they're only used in cases where the calling convention matches. llvm-svn: 314851
* [builtins] ARM: Reland fix for assembling builtins in thumb state.Manoj Gupta2017-10-023-4/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: clang does not assemble files in thumb mode unless .thumb declaration is present. Add .thumb/.arm decl to _FUNCTION macros to ensure that files are assembled correctly. Also add a fix to ensure that armv7k-watchos can assemble the aeabi_c{f|d}cmp.S files. Fixes PR 34715. Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin, efriedma, t.p.northover, fjricci Reviewed By: compnerd Subscribers: aemerson, javed.absar, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D38390 llvm-svn: 314718
* [builtins] ARM: Revert r314284, r314285 and r314289Manoj Gupta2017-09-273-9/+4
| | | | | | | Revert r314284, r314285 and r314289 because of a reported breakage in armv7k watchos builder. llvm-svn: 314333
* [ARM] builtins: Replace abort by assert in clear_cache.Manoj Gupta2017-09-271-3/+2
| | | | | | | | | | | | | | | | | | | | Summary: __builtion___clear_cache maps to clear_cache function. On Linux, clear_cache functions makes a syscall and does an abort if syscall fails. Replace the abort by an assert so that non-debug builds do not abort if the syscall fails. Fixes PR34588. Reviewers: rengolin, compnerd, srhines, peter.smith, joerg Reviewed By: rengolin Subscribers: aemerson, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D37788 llvm-svn: 314322
* [builtins] fix build error on non-ARM for r314285.Manoj Gupta2017-09-271-0/+1
| | | | llvm-svn: 314289
* [Builtins] ARM: Fix assembling files in thumb mode.Manoj Gupta2017-09-271-2/+6
| | | | | | | | | | | | | | | | | | | Summary: clang does not assemble files in thumb mode unless .thumb declaration is present. Add .thumb/.arm decl to _FUNCTION macros to ensure that files are assembled correctly. Fixes PR 34715. Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin Reviewed By: compnerd Subscribers: aemerson, javed.absar, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D38227 llvm-svn: 314285
* [Builtins] ARM: Fix msr assembly instruction use for Thumb2.Manoj Gupta2017-09-272-2/+2
| | | | | | | | | | | | | | | | | | Summary: MSR instruction in Thumb2 does not support immediate operand. Fix this by moving the condition for V7-M to Thumb2 since V7-M support Thumb2 only. With this change, aeabi_cfcmp.s and aeabi_cdcmp.S files can be assembled in Thumb2 mode. (This is split out from the review D38227). Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin, kristof.beyls Reviewed By: compnerd Subscribers: aemerson, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D38268 llvm-svn: 314284
* [Builtins] Use 4 byte alignment for __aeabi_memclr.Manoj Gupta2017-09-261-0/+1
| | | | | | | | | | | | | | | | | Summary: Align __aeabi_memclr to 4 bytes. All other ARM functions are already aligned to 4-bytes in compiler-rt. (Split off from review D38227) Reviewers: compnerd, peter.smith, srhines, weimingz, rengolin, kristof.beyls Reviewed By: compnerd Subscribers: aemerson, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D38271 llvm-svn: 314255
* [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
* [ARM][Compiler-rt] Fix AEABI builtins to correctly pass arguments to ↵Oleg Ranevskyy2017-08-232-0/+18
| | | | | | | | | | | | | | | | | | | non-AEABI functions on HF targets Summary: This is a patch for PR34167. On HF targets functions like `__{eq,lt,le,ge,gt}df2` and `__{eq,lt,le,ge,gt}sf2` expect their arguments to be passed in d/s registers, while some of the AEABI builtins pass them in r registers. Reviewers: compnerd, peter.smith, asl Reviewed By: peter.smith, asl Subscribers: peter.smith, aemerson, dberris, javed.absar, llvm-commits, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D36675 llvm-svn: 311555
* Revert "builtins: erase `struct` modifier for EH personality"Saleem Abdulrasool2017-08-221-25/+17
| | | | | | | | This reverts SVN r311425 which broke one of the buildbots. It is unclear what header is being used there. Revert it until that can be handled properly. llvm-svn: 311426
* builtins: erase `struct` modifier for EH personalitySaleem Abdulrasool2017-08-221-17/+25
| | | | | | | | | On ARM, the `_Unwind_Exception` is an alias for `struct _Unwind_Control_Block`. The extra `struct` modifier causes a warning due to the locally scoped type. Special case this to avoid the warning. NFC. llvm-svn: 311425
* [builtins] fix build error on non-ARM for r310884Weiming Zhao2017-08-141-0/+2
| | | | llvm-svn: 310890
* [builtins][ARM] Select correct code fragments when compiling for ↵Weiming Zhao2017-08-1416-128/+95
| | | | | | | | | | | | | | | | | | | | | | | | | Thumb1/Thum2/ARM ISA Summary: Value of __ARM_ARCH_ISA_THUMB isn't based on the actual compilation mode (-mthumb, -marm), it reflect's capability of given CPU. Due to this: •use tbumb and thumb2 insteand of __ARM_ARCH_ISA_THUMB •use '.thumb' directive consistently in all affected files •decorate all thumb functions using DEFINE_COMPILERRT_THUMB_FUNCTION() (This is based off Michal's patch https://reviews.llvm.org/D30938) Reviewers: dim, rengolin, compnerd, strejda Reviewed By: compnerd Subscribers: peter.smith, kubamracek, mgorny, javed.absar, kristof.beyls, jamesduley, aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D31220 llvm-svn: 310884
* [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
* [builtins] Use Interlocked* intrinsics for atomics on MSVCMartin Storsjo2017-08-031-8/+6
| | | | | | | | | | | | Tested on MSVC 2013, 2015 and 2017 targeting X86, X64 and ARM. This fixes building emutls.c for Windows for ARM (both with clang which don't need these atomics fallbacks at all, but just failed due to the immintrin.h include before, and with MSVC). Differential Revision: https://reviews.llvm.org/D36071 llvm-svn: 309974
* This ppc64 implementation of clear_cache works for both big and little endian.Sterling Augustine2017-08-021-1/+1
| | | | llvm-svn: 309848
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-012-15/+1
| | | | llvm-svn: 309704
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-312-1/+15
| | | | | | | | | | | | | | 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] Fix mingw-w64 cross compilationMartin Storsjo2017-07-311-1/+1
| | | | | | | | | Lowercase the Windows.h include in enable_execute_stack.c, just as in emutls.c in SVN r302340. Differential Revision: https://reviews.llvm.org/D36066 llvm-svn: 309537
* Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.Sterling Augustine2017-07-281-1/+15
| | | | llvm-svn: 309423
* [mips] Switch asm to __asm__ for non-GNU compiles.Stephen Hines2017-07-241-1/+1
| | | | | | | | | | | | | | | | | Summary: Using asm works fine for gnu11, but fails if the compiler uses C11. Switch to the more consistent __asm__, since that is what the rest of the source is using. Reviewers: petarj Reviewed By: petarj Subscribers: llvm-commits, sdardis, arichardson, pirama Differential Revision: https://reviews.llvm.org/D35756 llvm-svn: 308922
* Remove Bitrig: CompilerRT ChangesErich Keane2017-07-212-4/+4
| | | | | | | | Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned. Differential Revision: https://reviews.llvm.org/D35709 llvm-svn: 308798
* [X86][builtins] Sync getX86CpuIDAndInfoEx with llvm's Host.cpp again.Craig Topper2017-07-191-29/+10
| | | | | | We now use __cpuidex intrinsics intead of inline asm on 32-bit Windows. We already used it on 64-bit. llvm-svn: 308420
* [compiler-rt][X86] Match the detection of cpu's for __cpu_model to the ↵Craig Topper2017-07-131-309/+109
| | | | | | | | | | | | | | | | | | | | | latest version of gcc Summary: We were missing many feature flags that newer gcc supports and we had our own set of feature flags that gcc didnt' support that were overlapping. Clang's implementation assumes gcc's features list so a mismatch here is problematic. I've also matched the cpu type/subtype lists with gcc and removed all the cpus that gcc doesn't support. I've also removed the fallback autodetection logic that was taken from Host.cpp. It was the main reason we had extra feature flags relative to gcc. I don't think gcc does this in libgcc. Once this support is in place we can consider implementing __builtin_cpu_is in clang. This could also be needed for function dispatching that Erich Keane is working on. Reviewers: echristo, asbirlea, RKSimon, erichkeane, zvi Reviewed By: asbirlea Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D35214 llvm-svn: 307878
* [builtins] Better Fuchsia supportPetr Hosek2017-07-122-4/+19
| | | | | | | | | 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
* [X86] Sync a few more things from llvm's Host.cpp to cpu_model.Craig Topper2017-07-101-42/+32
| | | | | | This syncs the cpuid functions and adds breaks to the appropriate spots in the CPU decoding switches. Also a few formatting tweaks. llvm-svn: 307561
* [X86] Resync cpu_model.c with llvm's Host.cpp in preparation for making it ↵Craig Topper2017-07-101-34/+55
| | | | | | compatible with newer gcc. llvm-svn: 307558
* Add generic __bswap[ds]i2 implementationsDimitry Andric2017-05-254-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow armv{7,7s,7k,7m,7em} buildsJonathan Roelofs2017-05-2417-0/+38
| | | | llvm-svn: 303765
* builtins: fix guard __AEABI__ -> __ARM_EABI__Saleem Abdulrasool2017-05-161-1/+1
| | | | llvm-svn: 303207
* builtins: one more case of a missing headerSaleem Abdulrasool2017-05-161-0/+2
| | | | llvm-svn: 303195
* builtins: add missing includesSaleem Abdulrasool2017-05-162-0/+2
| | | | | | | | This inclusion is needed to fix the ARM build. The int_lib.h include is slightly ugly, but allows us to use the `AEABI_RTABI` macro to decorate the CC for the functions. llvm-svn: 303190
* builtins: expand out the AEABI function stubsSaleem Abdulrasool2017-05-1645-90/+300
| | | | | | | | | | | | | These actually may change calling conventions. We cannot simply provide function aliases as the aliased function may have a different calling convention. Provide a forwarding function instead to permit the compiler to synthesize the calling convention adjustment thunk. Remove the `ARM_EABI_FNALIAS` macro as that is not safe to use. Resolves PR33030! llvm-svn: 303188
* builtins: use reserved spelling (NFC)Saleem Abdulrasool2017-05-161-1/+1
| | | | llvm-svn: 303138
* Fix executable stack directive on Linux.Manoj Gupta2017-05-151-1/+2
| | | | | | | | | | | | | | Summary: Use __linux__ to check for Linux and bring back the check for __GNU__. Reviewers: echristo, krytarowski, compnerd, rengolin Reviewed By: krytarowski Subscribers: phosek, llvm-commits, srhines Differential Revision: https://reviews.llvm.org/D33219 llvm-svn: 303131
* [builtins] Fix a check from __GNU__ to __GNUC__ for disabling executable stack.Manoj Gupta2017-05-151-1/+1
| | | | | | | | | | | | | Summary: Neither GCC nor Clang define __GNU__. Instead use __GNUC__ for the check. Reviewers: echristo, rengolin, compnerd Subscribers: srhines, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D33211 llvm-svn: 303112
* 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-062-2/+3
| | | | | | | | | | | | | 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-042-23/+26
| | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud