summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Support MIPS DSP Rev1 intrinsics. Simon Atanasyan2012-06-281-0/+298
| | | | | | This patch was reviewed in the llvm-commits list by Jim Grosbach. llvm-svn: 159366
* If the first argument of __builtin_object_size can be folded to a constantRichard Smith2012-05-231-0/+4
| | | | | | | | pointer, but such folding encounters side-effects, ignore the side-effects rather than performing them at runtime: CodeGen generates wrong code for __builtin_object_size in that case. llvm-svn: 157310
* revert the usage of the objectsize intrinsic with 3 parameters (to match ↵Nuno Lopes2012-05-221-4/+1
| | | | | | LLVM r157255) llvm-svn: 157256
* Hexagon V5 intrinsics support in clang.Sirish Pande2012-05-111-155/+751
| | | | llvm-svn: 156630
* update calls to objectsize intrinsic to match LLVM r156473Nuno Lopes2012-05-091-2/+3
| | | | | | add a test for -fbounds-checking code generation llvm-svn: 156474
* Convert AVX non-temporal store builtins to LLVM-native IR. This was ↵Craig Topper2012-05-071-0/+3
| | | | | | previously done for SSE builtins. llvm-svn: 156296
* Revert r155363, due to the underlying patches in LLVM causing regressionChandler Carruth2012-04-231-749/+155
| | | | | | test suite failures. llvm-svn: 155371
* Hexagon V5 (floating point) support in cfe.Sirish Pande2012-04-231-155/+749
| | | | llvm-svn: 155363
* Revert some Hexagon builtin commits to match reverts done to LLVM inChandler Carruth2012-04-181-749/+155
| | | | | | | | | | | | | | | | | | | r155047. See the LLVM log for the primary motivation: http://llvm.org/viewvc/llvm-project?rev=155047&view=rev Primary commit r154828: - Several issues were raised in review, and fixed in subsequent commits. - Follow-up commits also reverted, and which should be folded into the original before reposting: - r154837: Re-add the 'undef BUILTIN' thing to fix the build. - r154928: Fix build warnings, re-add (and correct) header and license - r154937: Typo fix. Please resubmit this patch with the relevant LLVM resubmission. llvm-svn: 155048
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-161-155/+749
| | | | llvm-svn: 154828
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-131-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | __atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. llvm-svn: 154640
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-111-2/+5
| | | | | | | | | <stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. llvm-svn: 154513
* Don't try to create "store atomic" instructions of non-integer types; they ↵Eli Friedman2012-03-161-4/+5
| | | | | | aren't supported at the moment. PR12040. llvm-svn: 152891
* Fix codegen for vld{3,4}_dup intrinsics.James Molloy2012-03-151-4/+4
| | | | | | Patch by Silviu Baranga! llvm-svn: 152788
* add a testcase for PR12094 and fix a crash on pointer to incomplete type,Chris Lattner2012-03-041-3/+7
| | | | | | reported by Richard Smith. llvm-svn: 151993
* PR12094: Set the alignment of memory intrinsic instructions based on theJay Foad2012-03-021-29/+47
| | | | | | types of the pointer arguments. llvm-svn: 151927
* Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151150
* Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ toChandler Carruth2012-02-201-0/+2
| | | | | | | | | | | | | | | | match the behavior of GCC. Also add a test for these intrinsics, which apparently have *zero* tests. =[ Not surprisingly, Clang crashed when compiling these. Fix the bug in CodeGen where we failed to bitcast the argument type to x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the new 3dnow-builtins.c test. This is one issue impacting the efforts to get Clang to emulate the Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made available there. llvm-svn: 150948
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-19/+17
| | | | | | CodeGenModule. llvm-svn: 149943
* Preserve alignment for Neon vld1_lane/dup and vst1_lane intrinsics.Bob Wilson2012-02-041-7/+17
| | | | | | | | We had been generating load/store instructions with the default alignment for the vector element type, even when the pointer argument had less alignment. <rdar://problem/10538555> llvm-svn: 149794
* Remove long dead code for handling vector shift by immediate builtins.Craig Topper2012-01-301-107/+0
| | | | llvm-svn: 149237
* Remove custom handling for cmpsd/cmpss/cmppd/cmpps builtins. The builtins ↵Craig Topper2012-01-301-16/+0
| | | | | | are now in IntrinsicsX86.td. llvm-svn: 149235
* Cleanup 3dnow builtin handling. Most of them were already handled by LLVM ↵Craig Topper2012-01-301-117/+1
| | | | | | connecting intrinsics and builtins in IntrinsicsX86.td. llvm-svn: 149233
* Make the __builtin_c[lt]zs builtins target independent.Benjamin Kramer2012-01-281-26/+2
| | | | | | | | | There is really no reason to have these only available on x86. It's just __builtin_c[tl]z for shorts. Modernize the test while at it. llvm-svn: 149183
* Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455Bob Wilson2012-01-261-2/+4
| | | | | | | | | | | | | | | | ARM supports clz and ctz directly and both operations have well-defined results for zero. There is no disadvantage in performance to using the defined-at-zero versions of llvm.ctlz/cttz intrinsics. We're running into ARM-specific code written with the assumption that __builtin_clz(0) == 32, even though that value is technically undefined. The code is failing now because of llvm optimizations that are taking advantage of the undef behavior (specifically svn r147255). There's nothing wrong with that optimization on x86 where any incorrect assumptions about __builtin_clz(0) will quickly be exposed. For ARM, though, optimizations based on that undef behavior are likely to cause subtle bugs. Other targets with defined-at-zero clz/ctz support may want to override the default behavior as well. llvm-svn: 149086
* reapply r148902:Chris Lattner2012-01-251-11/+7
| | | | | | | | | | "use the new ConstantVector::getSplat method where it makes sense." Also simplify a bunch of code to use the Builder->getInt32 instead of doing it the hard and ugly way. Much more progress could be made here, but I don't plan to do it. llvm-svn: 148926
* Revert 148902 which was part of 148901 which was reverted in r148906.Argyrios Kyrtzidis2012-01-251-7/+11
| | | | | | | Original log: use the new ConstantVector::getSplat method where it makes sense. llvm-svn: 148907
* use the new ConstantVector::getSplat method where it makes sense.Chris Lattner2012-01-251-11/+7
| | | | llvm-svn: 148902
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148577
* Add __builtin_labs and __builtin_llabs, to complete the set of ↵Eli Friedman2012-01-171-1/+3
| | | | | | __builtin_*abs. Patch by Ruben Van Boxem. llvm-svn: 148340
* Remove unnecessary default cases in switches over enums.David Blaikie2012-01-171-3/+2
| | | | | | This allows -Wswitch-enum to find switches that need updating when these enums are modified. llvm-svn: 148281
* Revert r147655; it's breaking the compiler_rt build on OSX.Eli Friedman2012-01-061-2/+1
| | | | llvm-svn: 147677
* If we are compiling with -fno-builtin then don't do constant folding ofDavid Chisnall2012-01-061-1/+2
| | | | | | | | builtins. This fixes PR11711. llvm-svn: 147655
* Small refactoring and simplification of constant evaluation and some of itsRichard Smith2011-12-281-1/+0
| | | | | | clients. No functionality change. llvm-svn: 147318
* Add intrinsics for lzcnt and tzcnt instructions.Craig Topper2011-12-251-0/+26
| | | | llvm-svn: 147263
* More AVX2 intrinsic support including saturating add/sub and palignr.Craig Topper2011-12-191-0/+38
| | | | llvm-svn: 146857
* Hexagon backend supportTony Linthicum2011-12-121-0/+1989
| | | | llvm-svn: 146413
* Update Clang to emit the new form of llvm.cttz and llvm.ctlz intrinsics,Chandler Carruth2011-12-121-3/+4
| | | | | | | | | setting the is_zero_undef flag appropriately to true as that matches the semantics of these GCC builtins. This is the Clang side of r146357 in LLVM. llvm-svn: 146358
* lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.NAKAMURA Takumi2011-11-081-3/+3
| | | | llvm-svn: 144065
* Clean up type flags for overloaded Neon builtins. No functional change.Bob Wilson2011-11-081-29/+46
| | | | | | | | | This patch just adds a simple NeonTypeFlags class to replace the various hardcoded constants that had been used until now. Unfortunately I couldn't figure out a good way to avoid duplicating that class between clang and TableGen, but since it's small and rarely changes, that's not so bad. llvm-svn: 144054
* Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith2011-10-291-1/+1
| | | | | | | | implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+66
| | | | llvm-svn: 141632
* Constant expression evaluation refactoring:Richard Smith2011-10-101-12/+9
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* llvm.memory.barrier is going away; remove the wrapper intrinsic ↵Eli Friedman2011-10-061-12/+0
| | | | | | | | __builtin_llvm_memory_barrier. __atomic_thread_fence will be landing soon as a replacement, wrapping around the new fence instruction. llvm-svn: 141332
* de-tmpify clang.Benjamin Kramer2011-09-271-25/+22
| | | | llvm-svn: 140637
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-9/+9
| | | | llvm-svn: 140367
* Fix comment.Eli Friedman2011-09-141-1/+1
| | | | llvm-svn: 139678
* Correctly generate IR for casted "builtin" functions, whereJohn McCall2011-09-131-7/+41
| | | | | | | the builtin is really just a predefined declaration. These are totally valid to cast. llvm-svn: 139657
* Re-commit r139643.Eli Friedman2011-09-131-5/+6
| | | | | | Make clang use Acquire loads and Release stores where necessary. llvm-svn: 139650
* Revert r139643 while I look into it; it's breaking selfhost.Eli Friedman2011-09-131-6/+5
| | | | llvm-svn: 139648
OpenPOWER on IntegriCloud