aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/RuntimeLibcalls.h
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-0/+4
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-0/+14
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Fix filename in header commentDuncan P. N. Exon Smith2013-11-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194924 91177308-0d34-0410-b5e6-96231b3b80d8
* LegalizeDAG: allow libcalls for max/min atomic operationsTim Northover2013-10-251-0/+20
| | | | | | | | | | | ARM processors without ldrex/strex need to be able to make libcalls for all atomic operations, including the newer min/max versions. The alternative would probably be expanding these operations in terms of cmpxchg (as x86 does always), but in the configurations where this matters code-size tends to be paramount so the libcall is more desirable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193398 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Emit a libcall if the target doesn't support 16-byte wide atomicsDavid Majnemer2013-10-181-0/+8
| | | | | | | | | | | There are targets that support i128 sized scalars but cannot emit instructions that modify them directly. The proper thing to do is to emit a libcall. This fixes PR17481. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192957 91177308-0d34-0410-b5e6-96231b3b80d8
* [stackprotector] Add in the stackprotector libcall.Michael Gottesman2013-08-121-0/+3
| | | | | | | We support this libcall on all platforms except for OpenBSD (See lib/Codegen/StackProtector.cpp). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188193 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ISD::FROUND for libm round()Hal Finkel2013-08-071-0/+5
| | | | | | | | | | | | | | | All libm floating-point rounding functions, except for round(), had their own ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm adding ISD::FROUND so that round() can be custom lowered as well. For the most part, this is straightforward. I've added an intrinsic and a matching ISD node just like those for nearbyint() and friends. The SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed fround). This will be used by the PowerPC backend in a follow-up commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187926 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach SDISel to combine fsin / fcos into a fsincos node if the followingEvan Cheng2013-01-291-0/+5
| | | | | | | | | | | | | | | | | | | conditions are met: 1. They share the same operand and are in the same BB. 2. Both outputs are used. 3. The target has a native instruction that maps to ISD::FSINCOS node or the target provides a sincos library call. Implemented the generic optimization in sdisel and enabled it for Mac OSX. Also added an additional optimization for x86_64 Mac OSX by using an alternative entry point __sincos_stret which returns the two results in xmm0 / xmm1. rdar://13087969 PR13204 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173755 91177308-0d34-0410-b5e6-96231b3b80d8
* Add fp128 rtlib function names to LLVMTim Northover2013-01-081-0/+46
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171867 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an intrinsic and codegen support for fused multiply-accumulate. The intentCameron Zwarich2011-07-081-0/+4
| | | | | | is to use this for architectures that have a native FMA instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134742 91177308-0d34-0410-b5e6-96231b3b80d8
* Lower multiply with overflow checking to __mulo<mode>Eric Christopher2011-06-171-1/+4
| | | | | | | | | | calls if we haven't been able to lower them any other way. Fixes rdar://9090077 and rdar://9210061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133288 91177308-0d34-0410-b5e6-96231b3b80d8
* Issue libcalls __udivmod*i4 / __divmod*i4 for div / rem pairs.Evan Cheng2011-04-011-0/+10
| | | | | | | rdar://8911343 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128696 91177308-0d34-0410-b5e6-96231b3b80d8
* back-end libcall handling for ATOMIC_SWAP (__sync_lock_test_and_set)Jim Grosbach2010-06-181-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106342 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Expand-to-libcall support for additional atomics. This covers the usualJim Grosbach2010-06-181-0/+30
| | | | | | | | | | | | entries used by llvm-gcc. *_[U]MIN and such can be added later if needed. This enables the front ends to simplify handling of the atomic intrinsics by removing the target-specific decision about which targets can handle the intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106321 91177308-0d34-0410-b5e6-96231b3b80d8
* Add few missed libcalls and correct names for others.Anton Korobeynikov2010-03-261-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99656 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn calls to copysignl into an FCOPYSIGN node. Handle FCOPYSIGN nodesDuncan Sands2010-03-141-0/+4
| | | | | | | | with ppc_f128 type by having the type legalizer turn these back into a call to copysignl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98514 91177308-0d34-0410-b5e6-96231b3b80d8
* Make default expansion for FP16 <-> FP32 nodes into libcallsAnton Korobeynikov2010-03-141-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98501 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 8 bit libcalls and make use of them for msp430Anton Korobeynikov2009-11-071-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86384 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-101-6/+6
| | | | | | own struct type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78610 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow targets to define libcall names for mem(cpy,set,move) intrinsics, ↵Sanjiv Gupta2009-07-301-0/+5
| | | | | | rather than hardcoding them in DAG lowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77586 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed names of libcalls checked in r73480.Sanjiv Gupta2009-06-161-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73483 91177308-0d34-0410-b5e6-96231b3b80d8
* Added required libcalls for PIC16 (mostly floating points to integer casting ↵Sanjiv Gupta2009-06-161-0/+8
| | | | | | operations). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73480 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new codegen pass that normalizes dwarf exception handlingDuncan Sands2009-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code in preparation for code generation. The main thing it does is handle the case when eh.exception calls (and, in a future patch, eh.selector calls) are far away from landing pads. Right now in practice you only find eh.exception calls close to landing pads: either in a landing pad (the common case) or in a landing pad successor, due to loop passes shifting them about. However future exception handling improvements will result in calls far from landing pads: (1) Inlining of rewinds. Consider the following case: In function @f: ... invoke @g to label %normal unwind label %unwinds ... unwinds: %ex = call i8* @llvm.eh.exception() ... In function @g: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... "rethrow exception" Now inline @g into @f. Currently this is turned into: In function @f: ... invoke @something to label %continue unwind label %handler ... handler: %ex = call i8* @llvm.eh.exception() ... perform cleanups ... invoke "rethrow exception" to label %normal unwind label %unwinds unwinds: %ex = call i8* @llvm.eh.exception() ... However we would like to simplify invoke of "rethrow exception" into a branch to the %unwinds label. Then %unwinds is no longer a landing pad, and the eh.exception call there is then far away from any landing pads. (2) Using the unwind instruction for cleanups. It would be nice to have codegen handle the following case: invoke @something to label %continue unwind label %run_cleanups ... handler: ... perform cleanups ... unwind This requires turning "unwind" into a library call, which necessarily takes a pointer to the exception as an argument (this patch also does this unwind lowering). But that means you are using eh.exception again far from a landing pad. (3) Bugpoint simplifications. When bugpoint is simplifying exception handling code it often generates eh.exception calls far from a landing pad, which then causes codegen to assert. Bugpoint then latches on to this assertion and loses sight of the original problem. Note that it is currently rare for this pass to actually do anything. And in fact it normally shouldn't do anything at all given the code coming out of llvm-gcc! But it does fire a few times in the testsuite. As far as I can see this is almost always due to the LoopStrengthReduce codegen pass introducing pointless loop preheader blocks which are landing pads and only contain a branch to another block. This other block contains an eh.exception call. So probably by tweaking LoopStrengthReduce a bit this can be avoided. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72276 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly handle sdiv / udiv / srem / urem libcallsAnton Korobeynikov2009-05-031-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70764 91177308-0d34-0410-b5e6-96231b3b80d8
* Few targets like PIC16 wants libcall generation for illegal type i16.Sanjiv Gupta2009-01-181-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62467 91177308-0d34-0410-b5e6-96231b3b80d8
* Add intrinsics for log, log2, log10, exp, exp2.Dale Johannesen2008-09-041-0/+20
| | | | | | | | No functional change (and no FE change to generate them). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55753 91177308-0d34-0410-b5e6-96231b3b80d8
* Add libcalls for the new rounding opcodes.Dan Gohman2008-08-211-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55133 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the remaining fp_round libcalls:Bruno Cardoso Lopes2008-08-071-0/+4
| | | | | | | | | | | | | | FPROUND_F80_F32, FPROUND_PPCF128_F32, FPROUND_F80_F64, FPROUND_PPCF128_F64 Support for soften float fp_round operands is added, Mips needs this to round f64->f32. Also added support to soften float FABS result, Mips doesn't support double fabs results while in 'single float only' mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54484 91177308-0d34-0410-b5e6-96231b3b80d8
* Factorize some code for determining which libcall to use.Duncan Sands2008-07-171-1/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53713 91177308-0d34-0410-b5e6-96231b3b80d8
* It is pointless to turn a UINT_TO_FP into anDuncan Sands2008-07-111-0/+8
| | | | | | | | | | SINT_TO_FP libcall plus additional operations: it might as well be a direct UINT_TO_FP libcall. So only turn it into an SINT_TO_FP if the target has special handling for SINT_TO_FP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53461 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two missing SINT_TO_FP libcalls.Duncan Sands2008-07-111-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53460 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for 128 bit shifts and 32 bit shiftsDuncan Sands2008-07-111-0/+3
| | | | | | | on 16 bit machines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53458 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for 128 bit multiplicative operations.Duncan Sands2008-07-101-0/+5
| | | | | | | | | | Lack of these caused a bootstrap failure with Fortran on x86-64 with LegalizeTypes turned on. While there, be nice to 16 bit machines and support expansion of i32 too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53408 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a mysteriously missing libcall, FPTOSINT_F80_I32.Duncan Sands2008-07-101-0/+1
| | | | | | | | Be nice to 16 bit machines by supporting FP_TO_XINT expansion for these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53407 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for expanding PPC 128 bit floats.Duncan Sands2008-06-251-0/+2
| | | | | | | | | | | | | | | | | | | | | For this it is convenient to permit floats to be used with EXTRACT_ELEMENT, so I tweaked things to allow that. I also added libcalls for ppcf128 to i32 forms of FP_TO_XINT, since they exist in libgcc and this case can certainly occur (and does occur in the testsuite) - before the i64 libcall was being used. Also, the XINT_TO_FP result seemed to be wrong when the argument is an i128: the wrong fudge factor was added (the i32 and i64 cases were handled directly, but the i128 code fell through to some generic softening code which seemed to think it was i64 to f32!). So I fixed it by adding a fudge factor that I found in my breakfast cereal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52739 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement more support for fp-to-i128 and i128-to-fp conversions. Dan Gohman2008-03-101-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48189 91177308-0d34-0410-b5e6-96231b3b80d8
* Codegen support for i128 SINT_TO_FP.Dan Gohman2008-03-051-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47928 91177308-0d34-0410-b5e6-96231b3b80d8
* Output sinl for a long double FSIN node, not sin.Duncan Sands2008-01-101-2/+9
| | | | | | | | | Likewise fix up a bunch of other libcalls. While there I remove NEG_F32 and NEG_F64 since they are not used anywhere. This fixes 9 Ada ACATS failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45833 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* More ppcf128 issues (maybe the last)?Dale Johannesen2007-10-191-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43160 91177308-0d34-0410-b5e6-96231b3b80d8
* Add runtime library names for pow.Dan Gohman2007-10-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42880 91177308-0d34-0410-b5e6-96231b3b80d8
* First round of ppc long double. call/return andDale Johannesen2007-10-051-9/+18
| | | | | | | | | | basic arithmetic works. Rename RTLIB long double functions to distinguish different flavors of long double; the lib functions have different names, alas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42644 91177308-0d34-0410-b5e6-96231b3b80d8
* Add sqrt and powi intrinsics for long double.Dale Johannesen2007-09-281-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42423 91177308-0d34-0410-b5e6-96231b3b80d8
* More long double fixes. x86_64 should build now.Dale Johannesen2007-09-191-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42155 91177308-0d34-0410-b5e6-96231b3b80d8
* Added O_F32 and O_64 in addition to UO_F32 and UO_64 even though byEvan Cheng2007-01-311-0/+2
| | | | | | | | default they call the same libgcc routine. The result of the calls are "tested" differently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33700 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move RTLIB::Libcall enum to a separate file.Evan Cheng2007-01-121-0/+107
- Code clean up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33148 91177308-0d34-0410-b5e6-96231b3b80d8