summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtins.c
Commit message (Collapse)AuthorAgeFilesLines
* make __builtin_isfinite more efficient (PR27145)Sanjay Patel2016-04-071-3/+1
| | | | | | | | | | | | | | isinf (is infinite) and isfinite should be implemented with the same function except we change the comparison operator. See PR27145 for more details: https://llvm.org/bugs/show_bug.cgi?id=27145 Ref: forked off of the discussion in D18513. Differential Revision: http://reviews.llvm.org/D18648 llvm-svn: 265675
* Add missing __builtin_bitreverse8Matt Arsenault2016-03-231-0/+2
| | | | | | Also add documentation for bitreverse builtins llvm-svn: 264203
* Add __builtin_canonicalizeMatt Arsenault2016-02-271-0/+7
| | | | llvm-svn: 262122
* Add builtins for bitreverse intrinsicMatt Arsenault2016-02-031-0/+8
| | | | | | | Follow the naming convention that bswap uses since it's a similar sort of operation. llvm-svn: 259671
* [Modules] Implement __builtin_isinf_sign in Clang.Chandler Carruth2015-03-191-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow, we never managed to implement this fully. We could constant fold it like crazy, including constant folding complex arguments, etc. But if you actually needed to generate code for it, error. I've implemented it using the somewhat obvious lowering. Happy for suggestions on a more clever way to lower this. Now, what you might ask does this have to do with modules? Fun story. So it turns out that libstdc++ actually uses __builtin_isinf_sign to implement std::isinf when in C++98 mode, but only inside of a template. So if we're lucky, and we never instantiate that, everything is good. But once we try to instantiate that template function, we need this builtin. All of my customers at least are using C++11 and so they never hit this code path. But what does that have to do with modules? Fun story. So it turns out that with modules we actually observe a bunch of bugs in libstdc++ where their <cmath> header clobbers things exposed by <math.h>. To fix these, we have to provide global function definitions to replace the macros that C99 would have used. And it turns out that ::isinf needs to be implemented using the exact semantics used by the C++98 variant of std::isinf. And so I started to fix this bug in libstdc++ and ceased to be able to compile libstdc++ with Clang. The yaks are legion. llvm-svn: 232778
* Fix test/CodeGen/builtins.c for platforms that don't lower sjljReid Kleckner2015-03-041-0/+3
| | | | | | | | Opt in Win64 to supporting sjlj lowering. We have the backend lowering, so I think this was just an oversight because WinX86_64TargetCodeGenInfo doesn't inherit from X86_64TargetCodeGenInfo. llvm-svn: 231280
* Lower __builtin_fabs* to @llvm.fabs.*Reid Kleckner2014-11-031-0/+7
| | | | | | | | | mingw64's headers implement fabs by calling __builtin_fabs, so using the library call results in an infinite loop. If the backend legalizes @llvm.fabs as a call to fabs later, things should work out, as the crt provides a definition. llvm-svn: 221206
* CGBuiltin: Use frem instruction rather than libcall to implement fmodJan Vesely2014-09-261-0/+16
| | | | | | | | AFAICT the semantics of frem match libm's fmod. Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <tom@stellard.net> llvm-svn: 218488
* CGBuiltin: Use @llvm.fabs rather than fabs libcall when emitting builtinsTom Stellard2014-09-031-5/+5
| | | | | | | | | | | Using the intrinsic allows the SelectionDAGBuilder to turn this call into the FABS Node and also the intrinsic is something the vectorizer knows how to vectorize. This patch also sets the readnone attribute on this call, which should enable additional optmizations. llvm-svn: 217042
* CHECK-LABEL-ify some code gen tests to improve diagnostic experience when ↵Stephen Lin2013-08-151-4/+4
| | | | | | tests fail. llvm-svn: 188447
* Expose __builtin_bswap16.Benjamin Kramer2012-10-061-0/+1
| | | | | | | GCC has always supported this on PowerPC and 4.8 supports it on all platforms, so it's a good idea to expose it in clang too. LLVM supports this on all targets. llvm-svn: 165362
* Add __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() ↵Hal Finkel2012-08-051-0/+6
| | | | | | intrinsic. llvm-svn: 161310
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Enable basic testing of __builtin_fpclassify.Benjamin Kramer2010-06-141-2/+3
| | | | llvm-svn: 105937
* Enable the implementation of __builtin_setjmp and __builtin_longjmp. Not allJohn McCall2010-05-271-0/+7
| | | | | | LLVM backends support these yet. llvm-svn: 104867
* Implement codegen for __builtin_isnormal.Benjamin Kramer2010-05-191-0/+8
| | | | llvm-svn: 104118
* implement codegen support for __builtin_isfinite, part of PR6083Chris Lattner2010-05-061-2/+8
| | | | llvm-svn: 103168
* optimize builtin_isnan/isinf to not do an extraneous extension fromChris Lattner2010-05-061-0/+18
| | | | | | | float -> double (which happens because they are modelled as int(...) functions), and add a testcase for isinf. llvm-svn: 103167
* PR6515: Implement __builtin_signbit and friends.Eli Friedman2010-03-061-0/+1
| | | | | | | I'm reasonably sure my implementation is correct, but it would be nice if someone could double-check. llvm-svn: 97864
* Revert changes r97693, r97700, and r97718.John McCall2010-03-041-7/+0
| | | | | | Our testing framework can't deal with disabled targets yet. llvm-svn: 97719
* Implement __builtin_dwarf_sp_column().John McCall2010-03-041-0/+7
| | | | llvm-svn: 97700
* Support constant-evaluation of __builtin_nans* as well as the correct constantJohn McCall2010-02-281-3/+42
| | | | | | | | evaluation of __builtin_nan*. Most of the work to make this work is in LLVM. Fixes <rdar://problem/7696712> and part of PR 5255. llvm-svn: 97383
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Don't #include <stdio.h> when tests don't need it, or use clang instead of ↵Daniel Dunbar2009-11-171-1/+1
| | | | | | clang-cc when they do. llvm-svn: 89070
* Eliminate &&s in tests.Daniel Dunbar2009-11-081-1/+1
| | | | | | - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. llvm-svn: 86430
* Sorry! Accidentally checked in experimental change.John Thompson2009-10-151-1/+1
| | | | llvm-svn: 84183
* Make this at least compile.Mike Stump2009-10-151-1/+1
| | | | llvm-svn: 84167
* Removed math.h include, as Windows math.h has a compile error.John Thompson2009-10-151-2/+1
| | | | llvm-svn: 84160
* PR4836, part 2: CodeGen for __builtin_isnan.Eli Friedman2009-09-011-0/+2
| | | | llvm-svn: 80655
* PR4134: Implement __builtin_extract_return_addr.Eli Friedman2009-05-031-0/+1
| | | | llvm-svn: 70794
* Add more builtin definitions, including strcmp.Daniel Dunbar2009-04-091-0/+1
| | | | | | - PR3964. llvm-svn: 68710
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* switch getBuiltinLibFunction to use the new GetOrCreateLLVMFunction Chris Lattner2009-03-221-0/+8
| | | | | | | | functionality, fixing a crash on the attached testcase. Eliminate the BuiltinFunctions cache, as it can contain dangling pointers. This fixes a bunch of valgrind errors on test/CodeGen/builtins.c llvm-svn: 67484
* Add some stdlib builtinsDaniel Dunbar2009-02-201-1/+9
| | | | llvm-svn: 65115
* Add some builtins to codegen test case.Daniel Dunbar2008-10-051-6/+17
| | | | llvm-svn: 57101
* Add two test cases for builtins (mostly related to object sizeDaniel Dunbar2008-09-031-0/+95
builtins). llvm-svn: 55736
OpenPOWER on IntegriCloud