summaryrefslogtreecommitdiff
path: root/lib/builtins
AgeCommit message (Collapse)Author
2016-04-20builtins: fix -Werror,-Wunused-variable warningSaleem Abdulrasool
This removes the unused variable `flags`. NFC git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20builtins: remove use of __attribute__((pcs("aapcs"))) on WindowsSaleem Abdulrasool
Windows does not honour the __attribute__((pcs)) on ARM. Although this will result in ABI mismatches, compiler-rt should largely be unneeded for resolving dependencies as we generate MS ABI compliant library calls now for the most part. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14Fix StaticAnalyzer complaints. NFC.George Burgess IV
Clang's StaticAnalyzer seems to (correctly) complain about code like: T *p = calloc(sizeof(U), N); ...Where T and U are different types. This patch removes some instances of this pattern from compiler-rt. Patch by Apelete Seketeli. Differential Revision: http://reviews.llvm.org/D19085 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.Chris Bieneman
This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264751 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Remove multi3 from the exclude list.Chris Bieneman
This addresses PR27077. For some historical reason Darwin wasn't shipping multi3 in the compiler builtin library or in the OS builtin library. This caused building ffmpeg to fail because Polly was generating calls to multi3. It is easy enough to just add the builtin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264750 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-29[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFCChris Bieneman
This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@264749 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18builtins: make __clear_cache work on Linux-ARMSaleem Abdulrasool
__clear_cache on Android is identical to the version on Linux. Use __linux__ instead of __ANDROID__ as __linux__ is defined for Linux and Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263833 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18builtins: port __clear_cache to Windows ARMSaleem Abdulrasool
Support __clear_cache on Windows on ARM using the `FlushInstructionCache` library call. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09Add ARM EHABI support to gcc_personality_v0.Logan Chien
Until now the only exception APIs supported by gcc_personality_v0 are DWARF EH and SJLJ. This adds support for ARM EHABI as well. This is achieved by a) changing the function signature on ARM EHABI, b) unwinding the stack before returning _URC_CONTINUE_UNWIND. See "Exception Handling ABI for the ARM Architecture" for details (http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf). Patch by Timon Van Overveldt. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@263010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25builtins: adjust the clobbers list for android __clear_cacheSaleem Abdulrasool
Adjust the clobbers list. This use to work with older versions of gcc, but now will error on newer versions (tested against 5.3) (as well as clang). Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20[CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.Andrey Turetskiy
This enables MSVC build of complex number arithmetic compiler-rt builtins. Differential Revision: http://reviews.llvm.org/D17452 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@261432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04builtins: Fix struct __emutls_control to match GCCChih-Hung Hsieh
The type of size and align in struct __emutls_control must be typedef unsigned int gcc_word __attribute__((mode(word))); to match GCC. When gcc_word is larger than size_t, which is the case for x32, the upper extra bits are all zeros. We can use variables of size_t to operate on size and align. Fix one trivial C99 warning about mixed declaration and code. Differential Revision: http://reviews.llvm.org/D16886 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02[asan] Add iOS support.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@259451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] Enable the builtins library for WebAssembly.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] clang supports int128_t on wasm32 in addition to wasm64.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-22fix a gcc warningNico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256256 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01builtins: Fix the sysroot's reference to si_int in int_types.hSumanth Gundapaneni
si_int is already defined in sysroot's siginfo.h emutls.c includes pthread.h which includes asm/siginfo.h which in turn includes asm-generic/siginfo.h and that defines si_int. si_int is also defined in builtin's int_types.h and this leads to errors. This patch fixes the issue by undefining the si_int in int_types.h Differential Revision: http://reviews.llvm.org/D15086 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01builtins: Build emutls.c on MINGW buildsSumanth Gundapaneni
Differential Revision: http://reviews.llvm.org/D15083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22Add a generic version of __divtc3.c for long double complex division.Joerg Sonnenberger
Mark the unit test as applying to all platforms. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22Move prototypes for the double-double helpers into the common header.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-22Don't use implementation namespace for include guard. Fix spacing.Joerg Sonnenberger
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253827 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20Silence "unrecognised -std=c99" warning on MSVC.George Burgess IV
Thanks to angelsl for the patch! Differential Revision: http://reviews.llvm.org/D13692 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@253646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] [Darwin] [Builitins] Removing muloti4 from the blacklists for arm.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] [Darwin] [Builtins] Sorting and uniquing blacklists. NFC.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] [builtins] Removing a few non-source files from the arm list.Chris Bieneman
I was a little too aggressive about adding sources from the arm subdirectory. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] Actually adding the TODO comment I mentioned in r252927.Chris Bieneman
Turns out you need to save before committing. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[CMake] [builtins] Adding missing architecture-specific builtins.Chris Bieneman
Also added a TODO comment to make the build system throw an error if the CMakeLists gets out of sync again. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05[compiler-rt][aarch64] New tests for 128-bit floating-point builtins, fixes ↵Sergey Dmitrouk
of tests and __fixuint Summary: The following tests for 128-bit floating-point type behaved in a strange way, thought it were bugs, but seem to be mistakes in tests: * `fixtfsi` test checked for `0x80000001` as a value returned for number less than can be represented, while `LONG_MIN` should be returned on saturation; * `fixunstfdi` wasn't enabled for AArch64, only for PPC, but there is nothing PPC specific in that test; * `multf3` tried to underflow multiplication by producing result with 16383 exponent, while there are still 112 bits of fraction plus implicit bit, so resultant exponent should be 16497. Tests for some other builtins didn't exist: * `fixtfdi` * `fixtfti` * `fixunstfti` They were made by copying similar files and adjusting for wider types and adding/removing some reasonable/extra checks. Also `__fixuint` seems to have off by one error, updated tests to catch this case. Reviewers: rengolin, zatrazz, howard.hinnant, t.p.northover, jmolloy, enefaim Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14187 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03Fix r251928 build errorMartell Malone
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03Support for 32-bit mingw-w64 in compiler-rt.Martell Malone
Add chkstk/alloca for gcc objects. Replace or instructions with test, the latter should be marginally more efficent, as it does not write to memory. Differential Revision: http://reviews.llvm.org/D14044 Patch by vadimcn git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@251928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15builtins: Expand out floating point exponents for MSVCSaleem Abdulrasool
MSVC 2013 doesnt support C99 fully, including the hexidecimal floating point representation. Use the expanded value to permit building with it. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250365 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15builtins: use C implementation on MSVCSaleem Abdulrasool
The assembly implementations use GNU syntax which MSVC doesn't handle. Rather than duplicate the code in a second syntax, use the C implementations. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250360 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-15builtins: __builtin_clzll for x86 on MSVCSaleem Abdulrasool
Add an implementation for __builtin_clzll on MSVC even when _BitScanForward4 is unavailable. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250359 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool
Revert once more. This seems to fail to build on the buildbots which build with ninja rather than MSBuild/Visual Studio. This requires further build infrastructure changes to deal with the assembly routines. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11Revert "Revert "builtins: enable builtins build for MSVC""Saleem Abdulrasool
Previous changes should now permit building on MSVC 2013 in addition to MSVC 2015. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@250000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11builtins: define and use ALWAYS_INLINESaleem Abdulrasool
Abstract out the always inline spelling similar to ASAN. NFC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249986 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-11builtins: use NORETURN macroSaleem Abdulrasool
Now that we have the NORETURN macro, use that to mark the function as noreturn, rather than the GNU __attribute__. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249985 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10builtins: spell inline as __inlineSaleem Abdulrasool
__inline is a vendor specific spelling for inline. clang and gcc treat it the same as inline, and is available in MSVC 2013 which does not implement C99 (VS2015 supports the inline keyword though). This will allow us to build the builtins using MSVC. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249953 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool
Seems to break on the sanitizer buildbot. Revert until it can be fixed properly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249950 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10builtins: silence a MSVC warningSaleem Abdulrasool
_BitReverse64 is only available on ARM and x64. Guard it accordingly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249949 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-10builtins: enable builtins build for MSVCSaleem Abdulrasool
Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249948 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] [macho_embedded] [builtins] Need to also drop the bswap builtins.Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249914 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] hand tuning the macho_embedded export lists to match the current ↵Chris Bieneman
Xcode distribution. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249912 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-09[CMake] Hand tuning the exclude lists for libclang_rt.10.4.aChris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07Add ARM RTABI aliases for half-precision conversionsOliver Stannard
The ARM RTABI defines these functions as __aeabi_h2f, __aeabi_f2h and __aeabi_d2h, so we need aliases for them. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249559 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07builtins: fix buildSaleem Abdulrasool
__GNUC__ indicates the GNU compiler, not __GNU__. This got through due to building with clang rather than gcc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07builtins: implement instrinics for clSaleem Abdulrasool
cl does not support the same intrinsics as clang. Provide implementations for the intrinsics using MSVC builtins. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249515 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07builtins: emulate _Complex for clSaleem Abdulrasool
cl does not support C99 completely as of VS2015. Emulate _Complex to allow building with MSVC. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-07builtins: use MSVC intrinsics with clSaleem Abdulrasool
Use MSVCRT functions for floating-point builtins unavailable on MSVC. Patch by Tee Hao Wei! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-06[builtins] Enable building of the builtins library for MIPS targets.Vasileios Kalintiris
Reviewers: howard.hinnant, samsonov Subscribers: samsonov, dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D13098 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@249382 91177308-0d34-0410-b5e6-96231b3b80d8