summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/assembly.h
Commit message (Collapse)AuthorAgeFilesLines
* [builtins] Use single line C++/C99 comment stylePetr Hosek2019-04-281-19/+16
| | | | | | | | | | | 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
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | 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
* [builtins] ARM: Reland fix for assembling builtins in thumb state.Manoj Gupta2017-10-021-2/+7
| | | | | | | | | | | | | | | | | | | | | | 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-271-7/+2
| | | | | | | Revert r314284, r314285 and r314289 because of a reported breakage in armv7k watchos builder. llvm-svn: 314333
* [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] 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-141-12/+37
| | | | | | | | | | | | | | | | | | | | | | | | | 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-241-0/+2
| | | | llvm-svn: 303765
* 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
* Cleanup previous test commit.Sterling Augustine2017-05-011-1/+0
| | | | llvm-svn: 301820
* Add a blank line as a test-commit.Sterling Augustine2017-05-011-0/+1
| | | | | | Per http://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access llvm-svn: 301818
* Revert "builtins: Select correct code fragments when compiling for ↵Weiming Zhao2017-03-241-22/+7
| | | | | | | | | 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-241-7/+22
| | | | | | | | | | | | | | | | | | | | | | | 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] for the condition for check __ARM_FEATURE_CLZWeiming Zhao2016-12-071-3/+2
| | | | | | | | | | | | Summary: Since CLZ is not available for Thumb1, we use __ARM_ARCH_ISA_THUMB != 1 as one of the conditions. Reviewers: rnk, compnerd, rengolin Subscribers: aemerson, rengolin, llvm-commits Differential Revision: https://reviews.llvm.org/D27530 llvm-svn: 288954
* builtins: Add ARM Thumb1 implementation for uidiv and uidivmodWeiming Zhao2016-12-061-1/+2
| | | | | | 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-061-2/+1
| | | | | | | | | | | 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-051-1/+2
| | | | | | | | | | | | | | 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
* build: give aliases the same visibilitySaleem Abdulrasool2016-10-281-0/+1
| | | | | | | ARM EABI also uses function aliases. Ensure that those aliased functions are given proper visibility annotations. llvm-svn: 285478
* builtins: tag with noexecstackSaleem Abdulrasool2016-06-221-0/+10
| | | | | | | | | | | | 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-211-0/+9
| | | | | | | | | | | | 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
* builtins: cleanup constant data section selectionSaleem Abdulrasool2014-12-101-1/+4
| | | | | | | | | | Each of the object formats use a different directive for selecting the constant section. Use a macro to avoid the duplication across a number of files. Also correct a small macro mismatch on the Windows case (HIDDEN_DIRECTIVE -> HIDDEN). Patch by Vadim Chugunov! llvm-svn: 223910
* builtins: add missed change from previous commitSaleem Abdulrasool2014-10-071-1/+1
| | | | | | | The macro rework was missing a trailing SEPARATOR for the .thumb_func, resulting in assembly failures. llvm-svn: 219183
* builtins: rework use of DEFINE_COMPILERRT_THUMB_FUNCTIONSaleem Abdulrasool2014-10-071-8/+4
| | | | | | | | | | | | | | | 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
* Try harder to fix ARM/Linux after r219040.Bob Wilson2014-10-041-1/+6
| | | | llvm-svn: 219066
* Attempt to fix ARM/Linux after r219040.Bob Wilson2014-10-041-1/+1
| | | | llvm-svn: 219064
* Fix the armv7 thumb builtins on darwinSteven Wu2014-10-041-0/+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
* builtins: remove definition of __ARM_ARCHSaleem Abdulrasool2014-09-191-27/+0
| | | | | | | | __ARM_ARCH is part of the ACLE specification. At least clang and GCC have supported this part of the ACLE for some time now. Let the compiler provide the proper definition for the macro rather than try to guess it. llvm-svn: 218095
* builtins: make ARM compilation with GAS work againSaleem Abdulrasool2014-07-271-0/+6
| | | | | | | | | | The LLVM IAS seems to accept wide instructions for add and sub in ARM mode even though it is not permitted. This uses a macro to ensure that the wide modifier is only applied when building in THUMB mode. This repairs building with GCC/GAS in ARM mode. llvm-svn: 214046
* builtins: move macro definitions into assembly.hSaleem Abdulrasool2014-07-271-0/+8
| | | | | | | The macro definitions are shared across multiple files. Define them once in the assembly.h header rather than redefining it in each file. llvm-svn: 214045
* Revert r213467, it breaks non-thumb mode.Joerg Sonnenberger2014-07-201-13/+1
| | | | llvm-svn: 213479
* ARM: fix division in some casesSaleem Abdulrasool2014-07-201-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | For ARM cores that are ARMv6T2+ but not ARMv7ve or ARMv7-r and not an updated ARMv7-a that has the idiv extension (chips with clz but not idiv), an incorrect jump would be calculated due to the preference to thumb instructions over ARM. Rather than computing the target at runtime, use a jumptable instead. This trades a bit of storage for performance. The overhead is 32-bytes for each of the three routines, but avoid the calculation of the offset. Because clz was introduced in ARMv6T2 and idiv in certain versions of ARMv7, the non-clz, non-idiv case implies a target which does not support Thumb-2, and thus we cannot use Thumb on those targets (as it is unlikely that the assembly will assemble). Take the opportunity to refactor the IT block macros into assembly.h rather than redefining them in the TUs where they are used. Existing tests cover the full change already, so no new tests are added. This effectively reverts SVN r213309. llvm-svn: 213467
* builtins: assembly routines are not staticSaleem Abdulrasool2014-06-211-1/+1
| | | | | | | | | Storage Class 3 is static storage. These symbols need to be marked as external (storage class 2) so that they can be referenced. Note that this external is not the same as ELF "external" visibility, which is indicated by DLL Storage Class (i.e. __declspec(dllexport) or __declspec(dllimport)). llvm-svn: 211428
* assembly: support symbol definitions for COFFSaleem Abdulrasool2014-05-181-1/+10
| | | | | | | | | Extend the function definition macros further to support COFF object emission. The function definition in COFF includes the type and storage class in the symbol definition context. This is needed to make the assembly routines possible to be built for COFF environments (i.e. Windows). llvm-svn: 209095
* assembly: rework HIDDEN_DIRECTIVE to accomodate COFFSaleem Abdulrasool2014-05-181-5/+5
| | | | | | | | Rename the HIDDEN_DIRECTIVE macro to HIDDEN and give it a parameter providing the name of the symbol to be given hidden visibility. This makes the macros more amenable to COFF. llvm-svn: 209094
* clang-format assembly.hSaleem Abdulrasool2014-05-161-75/+74
| | | | | | Reformat assembly.h with clang-format. NFC. llvm-svn: 208950
* Move .subsections_via_symbols directives into DEFINE_COMPILERRT_PRIVATE_FUNCTIONJonathan Roelofs2014-05-121-0/+2
| | | | llvm-svn: 208603
* Move original compiler-rt functions (libgcc replacement) to lib/builtins ↵Alexey Samsonov2014-02-141-0/+136
directory llvm-svn: 201393
OpenPOWER on IntegriCloud