summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/arm
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Revert "[builtins] Rounding mode support for addxf3/subxf3""Yi Kong2019-09-051-0/+59
| | | | | | | | Test failure fixed. This reverts commit e204d244badb2e9765a1020f41c773f63da208f4. llvm-svn: 371003
* [builtins] Fix assembly in arm sync-ops.hNikita Popov2019-07-121-1/+1
| | | | | | | | | This assembly is part of a macro that was reformatted in D60351. The missing space between push and { results in: Error: bad instruction `push{r4, r5,r6,lr}' llvm-svn: 365957
* builtins: correct function name for AEABISaleem Abdulrasool2019-06-031-2/+2
| | | | | | | | | | If `COMPILER_RT_ARMHF_TARGET` is set , the definition of the AEABI runtime function `__aeabi_fcmpun` is misspelt: `__aeabi_fcmpum` instead of `__aeabi_fcmpun`. Patch by Konstantin Schwarz! llvm-svn: 362424
* [builtins] Move the compare2f definition outside of the macroPetr Hosek2019-05-291-11/+19
| | | | | | | | | This should hopefully address the error we're seeing in older versions of Clang. Differential Revision: https://reviews.llvm.org/D62554 llvm-svn: 361909
* [builtins] Deduplicate __eqsf2 and __gtsf2 via macroPetr Hosek2019-05-201-77/+30
| | | | | | | | | | | The only difference between __eqsf2 and __gtsf2 is whether they return 1 or -1 on NaN. Rather than duplicating all the code, use a macro to define the function twice and use an argument to decide whether to negate the return value. Differential Revision: https://reviews.llvm.org/D61919 llvm-svn: 361207
* [builtins] Use single line C++/C99 comment stylePetr Hosek2019-04-2861-559/+535
| | | | | | | | | | | Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 llvm-svn: 359411
* [builtins] Reformat builtins with clang-formatPetr Hosek2019-04-286-67/+56
| | | | | | | | | | | Update formatting to use the LLVM style. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60351 llvm-svn: 359410
* [builtins] Add __cmpsf2 for ARM version of comparesf2Yi Kong2019-04-171-0/+5
| | | | | | | | | The generic version of comparesf2 defines __cmpsf2 alias for libgcc compatibility, but the ARM overlay is missing the alias. Differential Revision: https://reviews.llvm.org/D60805 llvm-svn: 358542
* Revert "[builtins] Rounding mode support for addxf3/subxf3"Yi Kong2019-03-271-59/+0
| | | | | | | | This reverts commit 2cabea054e40ae2837da959d0ca89ae25cf1b1f1. Test failure on buildbots. llvm-svn: 357048
* [builtins] Rounding mode support for addxf3/subxf3Yi Kong2019-03-261-0/+59
| | | | | | | | | | | | | | | | | 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
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1992-366/+276
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. 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: 351648
* [Arm builtins] Remove non-necessary IS checkKristina Brooks2018-10-022-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the instruction set check to make the msr APSR_nzcvq, ip instruction only execute if Thumb2 is used. The APSR is a subset of the bits of the CPSR (B.1.3.3 of the Arm v7 A and R ARM [1]) and is only available for A and R profiles. However in section B.9.3.11 of the same document we see that: "In the A and R profiles, APSR_nzcvq is the same as CPSR_f" "ARM recommends the APSR forms when only the N, Z, C, V, Q, and GE[3:0] bits are being written." This patch also make those files assemble for Armv8-M Mainline architecture profile. The builtins were cross-compiled for Arm, Aarch64 and Armv6-M, Armv7-M and Armv7E-M targets. Cross-compiled tests were executed for Arm target. [1]: https://developer.arm.com/docs/ddi0406/latest/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition Patch by hug-dev (Hugues de Valon). Differential Revision: https://reviews.llvm.org/D51854 llvm-svn: 343601
* ARM: wrap call to __clzsi2 so that the name is correct on MachO.Tim Northover2018-09-061-1/+1
| | | | | | | | MachO symbols are prefixed with an extra '_' (that's 3 in total for this function), so assembly calls have to go through a wrapper to insert any prefix needed. llvm-svn: 341540
* [builtins] Implement the __chkstk function for ARM for MinGWMartin Storsjo2018-07-171-0/+34
| | | | | | | | | | 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
* [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
* [builtins] ARM: Reland fix for assembling builtins in thumb state.Manoj Gupta2017-10-022-2/+8
| | | | | | | | | | | | | | | | | | | | | | 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-272-2/+2
| | | | | | | Revert r314284, r314285 and r314289 because of a reported breakage in armv7k watchos builder. llvm-svn: 314333
* [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
* [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
* [builtins][ARM] Select correct code fragments when compiling for ↵Weiming Zhao2017-08-1415-116/+58
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Allow armv{7,7s,7k,7m,7em} buildsJonathan Roelofs2017-05-2416-0/+36
| | | | llvm-svn: 303765
* 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-165-10/+8
| | | | | | | | | | | | | 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] Fix div0 error in udivsi3Weiming Zhao2017-04-061-12/+14
| | | | | | | | | | | | | | Summary: Need to save `lr` before bl to aeabi_div0 Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31716 llvm-svn: 299628
* Revert "builtins: Select correct code fragments when compiling for ↵Weiming Zhao2017-03-2413-86/+57
| | | | | | | | | Thumb1/Thum2/ARM ISA." This reverts commit c3709191b6d36c4c936173f4a9a29a734b12cb15. (commit by mistake) llvm-svn: 298715
* builtins: Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA.Weiming Zhao2017-03-2413-57/+86
| | | | | | | | | | | | | | | | | | | | | | | 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() --------- Note: This patch doesn't fix broken Thumb1 variant of __udivsi3 ! Reviewers: weimingz, rengolin, compnerd Subscribers: aemerson, dim Differential Revision: https://reviews.llvm.org/D30938 llvm-svn: 298713
* [Builtin][ARM] Fix subsf3vfp for non-HF targetWeiming Zhao2017-02-121-1/+1
| | | | | | | | | | | | Reviewers: rengolin, compnerd Reviewed By: compnerd Subscribers: hans, aemerson Differential Revision: https://reviews.llvm.org/D29869 llvm-svn: 294886
* [Builtin][ARM] Implement addsf3/__aeabi_fadd for Thumb1Weiming Zhao2017-02-061-0/+277
| | | | | | | | | | | | | | | | | | | Summary: This patch implements addsf3/__aeabi_fadd in asm for Thumb1. Compared with generic C version (lib/fp_add_impl.inc), it 1. all constants are materialized instead of loading from constant pool 2. no stack spills (C version uses 136 bytes stack space) 3. clz() is called only when necessary. (C version always calls it) Reviewers: compnerd, rengolin, asl Reviewed By: asl Subscribers: efriedma, aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29485 llvm-svn: 294172
* [Bultin][ARM] Make aeabi_uldivmod and aeabi_ldivmod be Thumb1 compatibleWeiming Zhao2017-01-302-20/+20
| | | | | | | | | | | | | | | | | | Summary: in aeabi_ldivmod and uldivmod, using r6 instead of r12 as the temp reg due to limitation of Thumb1 ISA. Now, all EABI sources are Thumb1 compatible. Also added test cases by reusing the test cases from divmodsi4_test.c, udivmodsi4_test and udivmoddi4_test.c Reviewers: rengolin, compnerd Reviewed By: rengolin Subscribers: javed.absar, aemerson, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29226 llvm-svn: 293527
* [Builtin][ARM] Add Thumb1 support for aeabi_c{f,d}cmp.S and dcmp.SWeiming Zhao2017-01-273-2/+76
| | | | | | | | | | | | Reviewers: compnerd, rengolin Reviewed By: rengolin Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28985 llvm-svn: 293247
* builtins: remove an errant ':'Saleem Abdulrasool2017-01-261-1/+1
| | | | | | Thanks to Dave Lee for pointing this out! llvm-svn: 293120
* [Bultin][ARM] Make aeabi_memset be Thumb1 compatible and other asmWeiming Zhao2017-01-214-5/+5
| | | | | | | | | | | | | | | | | | | | | syntax fix Summary: Make the asm of aeabi_memset be assembled for thumb1. Also fix some instructions to conform with the syntax of ARM reference manual. For example, muls requires the form of "Rd, Rn, Rd" and orrs requires the form of "Rd, Rm". Clang-as is benign but it may fail other assembler if not in the exact form. Reviewers: rengolin, compnerd, kubamracek Reviewed By: rengolin, compnerd Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28971 llvm-svn: 292727
* builtins: support building ARM builtins for a HF targetSaleem Abdulrasool2017-01-1135-7/+179
| | | | | | | | | | | | | | The `-target` impacts the CC for the builtins. HF targets (with either floating point ABI) always use AAPCS VFP for the builtins unless they are AEABI builtins, in which case they use AAPCS. Non-HF targets (with either floating point ABI) always use AAPCS for the builtins and AAPCS for the AEABI builtins. This introduces the thunks necessary to switch CC for the floating point operations. This is not currently enabled, and should be dependent on the target being used to build compiler-rt. However, as a stop-gap, a define can be added for ASFLAGS to get the thunks. llvm-svn: 291677
* builtins: repair __gtsf2 after SVN r291396Saleem Abdulrasool2017-01-101-0/+2
| | | | | | | The argument adjustment was accidentally removed, resulting in the use of stale register values. llvm-svn: 291591
* [Builtins] [ARM] Adding Thumb1 support for fcmpWeiming Zhao2017-01-082-9/+121
| | | | | | | | | | | | Summary: Mainly translate IT block into cmp/branch for functions in comparesf2.S Reviewers: rengolin, compnerd Subscribers: aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D28016 llvm-svn: 291396
* [builtin] Add Thumb1 implementation for idivsi3 and aeabi_idivmodWeiming Zhao2016-12-072-0/+29
| | | | | | | | | | | | | | Summary: For idivsi3, convert the Thumb2 only instruction to thumb1. For aeabi_idivmod, using __divsi3. Reviewers: rengolin, compnerd Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27472 llvm-svn: 288960
* builtins: Add ARM Thumb1 implementation for uidiv and uidivmodWeiming Zhao2016-12-062-19/+129
| | | | | | This is a resubmit of r288710 due to breakage of Darwin armv7em. llvm-svn: 288777
* Revert "builtins: Add ARM Thumb1 implementation for uidiv and uidivmod"Chris Bieneman2016-12-062-122/+22
| | | | | | | | | | | This reverts commit r288710. r288710 breaks building the builtin libraries on Darwin for armv7em. Build logs may still be avaialable here: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/12035/console llvm-svn: 288773
* builtins: Add ARM Thumb1 implementation for uidiv and uidivmodWeiming Zhao2016-12-052-22/+122
| | | | | | | | | | | | | | Summary: The current uidiv supports archs without clz. However, the asm is for thumb2/arm. For uidivmod, the existing code calls the C version of uidivmodsi4, which then calls uidiv. The extra push/pop/bl makes it less efficient. Reviewers: jmolloy, jroelofs, joerg, compnerd, rengolin Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27309 llvm-svn: 288710
* builtins: Allow building windows arm functions for mingwMartin Storsjo2016-11-194-0/+42
| | | | | | | | | | | | | | | | | When building with clang/LLVM in MSVC mode, the msvcrt libraries contain these functions. When building in a mingw environment, we need to provide them somehow, e.g. via compiler-rt. The aeabi divmod functions work in the same way as the corresponding __rt_*div* functions for windows, but their parameters are swapped. The functions for converting float to integer and vice versa are the same as their aeabi equivalents, only with different function names. Differential Revision: https://reviews.llvm.org/D26183 llvm-svn: 287465
* builtins: use thumb-2 if possible on comparesf2Saleem Abdulrasool2016-09-271-0/+3
| | | | | | | This code can be built with thumb-2 like many of the other builtin routines. Enable that here as well. llvm-svn: 282530
* Delete remaining compiler-rt makefilesChris Bieneman2016-08-231-20/+0
| | | | | | | | | | | | | | | Summary: Since we can now build the builtins without a full toolchain these files should no longer be needed. This is the last vestige of autoconf! Reviewers: compnerd, iains, jroelofs Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D23777 llvm-svn: 279539
* [RT-ARM] Syntax unified for aeabi_mem* functionsRenato Golin2016-07-133-0/+3
| | | | | | | | | | | | | Use unified syntax for builtins/arm/aeabi_mem*.S. This makes these files consistent with the others. This fixes a problem on the linker, which can fail with the message "relocation truncated to fit: R_ARM_THM_JUMP11 against symbol" Patch by Kor Nielsen. llvm-svn: 275264
* builtins: tag with noexecstackSaleem Abdulrasool2016-06-2284-0/+229
| | | | | | | | | | | | These routines do not require executable stacks. However, by default ELFish linkers may assume an executable stack on GNUish environments (and some non-GNU ones too!). The GNU extension to add a note to indicate a non-executable stack is honoured by these environments to mark the stack as non-executable (the compiler normally emits this directive on appropriate targets whenever possible). This allows normal builds from getting executable stacks due to linking to the compiler rt builtins. llvm-svn: 273500
* Implement __aeabi_c{d,f}{cmpeq,cmple,rcmple}.Josh Gao2015-08-214-0/+219
| | | | | | | | | | | | Summary: Implement more missing ARM EABI runtime functions. Reviewers: rengolin, compnerd Subscribers: pirama, srhines, danalbert, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D12089 llvm-svn: 245648
* Implement __aeabi_{f,d}rsub.Dan Albert2015-08-182-0/+38
| | | | | | | | | | | | Summary: Implement the missing ARM EABI functions _aeabi_frsub and __aeabi_drsub. Reviewers: rengolin, compnerd Subscribers: pirama, srhines, danalbert, aemerson, llvm-commits Differential Revision: http://reviews.llvm.org/D12088 llvm-svn: 245321
* builtins: rework use of DEFINE_COMPILERRT_THUMB_FUNCTIONSaleem Abdulrasool2014-10-0710-0/+40
| | | | | | | | | | | | | | | This is simply to help clarity of the code. The functions are built as thumb only if Thumb2 is available (__ARM_ARCH_ISA_THUMB == 2). Sink the selection into the location of the definition and make DEFINE_COMPILERRT_THUMB_FUNCTION always define a thumb function while DEFINE_COMPILERRT_FUNCTION always selects the default. Since the .thumb_func directive is always available (at least on Linux, Windows, and BSD), sinking the macro right into the macro works just as well. No functional change intended. llvm-svn: 219182
* Fix the armv7 thumb builtins on darwinSteven Wu2014-10-0411-12/+12
| | | | | | | | | | The arm builtins converted into thumb in r213481 are not working on darwin. On apple platforms, .thumb_func directive is required to generated correct symbols for thumb functions. <rdar://problem/18523605> llvm-svn: 219040
OpenPOWER on IntegriCloud