Commit Graph

194 Commits

Author SHA1 Message Date
Bob Wilson 160fdf49e4 Add a missing parameter, without which clang crashes for vqshlu_n intrinsics.
llvm-svn: 121188
2010-12-07 22:03:43 +00:00
Bob Wilson 7795599f4b Add support for vmul_p8 Neon intrinsic. Radar 8446141.
llvm-svn: 120812
2010-12-03 17:29:39 +00:00
Bob Wilson 4fa993fc51 Add a separate rightShift flag instead of reusing the existing "poly" variable
to distinguish vsri/vsli.

llvm-svn: 120806
2010-12-03 17:10:22 +00:00
John McCall 3a7f6926d1 Restore r117403 (fixing IR gen for bool atomics), this time being less
aggressive about the form we expect bools to be in.  I don't really have
time to fix all the sources right now.

llvm-svn: 117486
2010-10-27 20:58:56 +00:00
Rafael Espindola 9d798a07e4 Revert r117403 as it caused PR8480.
llvm-svn: 117456
2010-10-27 17:13:49 +00:00
John McCall 6bde954f47 Extract procedures to do scalar-to-memory and memory-to-scalar conversions
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics.  rdar://problem/8461234

llvm-svn: 117403
2010-10-26 22:09:15 +00:00
Argyrios Kyrtzidis 073c9cb592 Implement __builtin_ia32_vec_ext_v2si function (required by Qt).
llvm-svn: 116162
2010-10-10 03:19:11 +00:00
Bill Wendling 65b2a965fb Add target implementations for the X86 builtins:
__builtin_ia32_vec_init_v8qi
  __builtin_ia32_vec_init_v4hi
  __builtin_ia32_vec_init_v2si

They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.)
<rdar://problem/8529957>

llvm-svn: 116147
2010-10-09 08:47:25 +00:00
Chris Lattner 64d7f2a014 when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr.  In
-ftrapv mode, they are not the same.

This fixes rdar://8478728 + PR8221

llvm-svn: 115388
2010-10-02 00:09:12 +00:00
Chris Lattner 07e96866a2 tidy
llvm-svn: 115383
2010-10-01 23:43:16 +00:00
Bill Wendling 11191f11b8 Accidentally committed some temporary changes on my branch when reverting patches.
llvm-svn: 114936
2010-09-28 01:28:56 +00:00
Bill Wendling 6d8c442e08 Temporarily revert 114929 114925 114924 114921. It looked like they (or at least
one of them) was causing a series of failures:

http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/4518

svn merge -c -114929 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114929 into '.':
U    include/clang/Sema/Sema.h
U    include/clang/AST/DeclCXX.h
U    lib/Sema/SemaDeclCXX.cpp
U    lib/Sema/SemaTemplateInstantiateDecl.cpp
U    lib/Sema/SemaDecl.cpp
U    lib/Sema/SemaTemplateInstantiate.cpp
U    lib/AST/DeclCXX.cpp
svn merge -c -114925 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114925 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/AST/DeclCXX.cpp
svn merge -c -114924 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114924 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp
U    lib/AST/ASTContext.cpp
svn merge -c -114921 https://llvm.org/svn/llvm-project/cfe/trunk
--- Reverse-merging r114921 into '.':
G    include/clang/AST/DeclCXX.h
G    lib/Sema/SemaDeclCXX.cpp
G    lib/Sema/SemaDecl.cpp
G    lib/AST/DeclCXX.cpp

llvm-svn: 114933
2010-09-28 01:09:49 +00:00
Bill Wendling 1308667f18 Revert my patch changing the MMX "shift" intrinsics that take immediates into
"shift with non-immediate" intrinsics. It gets here because we they aren't
immediates anymore.

llvm-svn: 114890
2010-09-27 21:22:25 +00:00
Chris Lattner b2f659b7a0 fix the rest of rdar://8461279 - clang miscompiles address-space qualified atomics
llvm-svn: 114503
2010-09-21 23:40:48 +00:00
Chris Lattner c9066d3072 same bug as before, this time with __sync_val_compare_and_swap.
llvm-svn: 114502
2010-09-21 23:35:30 +00:00
Chris Lattner 7cf46bfda0 fix __sync_bool_compare_and_swap to work with address-space qualified types.
llvm-svn: 114498
2010-09-21 23:24:52 +00:00
Bill Wendling d632616f86 The MMX shift-with-immediate builtins require the equivalent
shift-with-immediate LLVM intrinsics.

llvm-svn: 114239
2010-09-17 23:46:16 +00:00
Bob Wilson 6061b05d51 Translate NEON vabdl, vaba, and vabal builtins to be implemented using the
vabd intrinsic combined with zext and add operations.

llvm-svn: 112937
2010-09-03 01:27:09 +00:00
Bob Wilson 5b4904f7a3 Add a bunch of missing bitcasts for clang NEON builtin expansions.
Radar 8388233

llvm-svn: 112890
2010-09-02 22:37:30 +00:00
Bob Wilson 1b87c9a646 Translate NEON vmull, vmlal, and vmlsl builtins to llvm multiply-add/sub
with zext/sext operations, instead of to llvm intrinsics.  I have a plan to
avoid the clang builtins for these, but it is going to take a little longer
and I want to get the NEON intrinsics updated before the 2.8 release.

llvm-svn: 112764
2010-09-01 23:20:27 +00:00
Bob Wilson b9225f7f85 Translate NEON vmovn builtin to a vector truncation instead of using an llvm
intrinsic.

llvm-svn: 112504
2010-08-30 19:57:13 +00:00
Bob Wilson 0e7a398936 Translate NEON vaddl, vaddw, vsubl, and vsubw builtins to llvm add/sub
with zext/sext operations, instead of to llvm intrinsics.  (We can also
get rid of the clang builtins and handle these entirely in the arm_neon.h
header if there is a way to express vector sext/zext in C.)

llvm-svn: 112413
2010-08-29 05:14:28 +00:00
Bob Wilson 7b0d032d0c Add the new alignment arguments for NEON load/store intrinsics, based on the
types of the pointer address expressions used with those intrinsics.

llvm-svn: 112272
2010-08-27 17:14:29 +00:00
Daniel Dunbar e3d87d21f3 IRgen/NEON: Fix codegen of vzip and vzipq.
- Will be adding an executable test case to test-suite repo.

llvm-svn: 112126
2010-08-26 00:55:57 +00:00
Bob Wilson b02244969d Translate NEON vmovl intrinsics to zero/sign-extend operations.
llvm-svn: 111612
2010-08-20 03:36:08 +00:00
Nate Begeman ad5dd42817 vdup_lane was missing
<rdar://problem/8278732>

llvm-svn: 110420
2010-08-06 01:24:57 +00:00
Nate Begeman f568b074db Add support for VFP status & control operations for ARM.
llvm-svn: 110153
2010-08-03 21:32:34 +00:00
Nate Begeman 1194bd2bd8 Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.
llvm-svn: 109814
2010-07-29 22:48:34 +00:00
Fariborz Jahanian 0ebca28f1d 2nd argument of __builtin_expect must be evaluated
if it hs side-effect to matchgcc's behaviour.
Addresses radar 8172109.

llvm-svn: 109467
2010-07-26 23:11:03 +00:00
Chandler Carruth bc8cab16c5 Improve the representation of the atomic builtins in a few ways. First, we make
their call expressions synthetically have the "deduced" types based on their
first argument. We only insert conversions in the AST for arguments whose
values require conversion to match the value type expected. This keeps PR7600
closed by maintaining the return type, but avoids assertions due to unexpected
implicit casts making the type unsigned (test case added from Daniel).

The magic is moved into the codegen for the atomic builtin which inserts the
casts as needed at the IR level to raise the type to an integer suitable for
the LLVM intrinsic. This shouldn't cause any real change in functionality, but
now we can make the builtin be more truly polymorphic.

llvm-svn: 108638
2010-07-18 07:23:17 +00:00
Chris Lattner 5e016ae983 finally get around to doing a significant cleanup to irgen:
have CGF create and make accessible standard int32,int64 and 
intptr types.  This fixes a ton of 80 column violations 
introduced by LLVMContextification and cleans up stuff a lot.

llvm-svn: 106977
2010-06-27 07:15:29 +00:00
Nate Begeman ed48c857dc Implement remaining codegen for NEON, all operations should now work.
llvm-svn: 106407
2010-06-20 23:05:28 +00:00
Anton Korobeynikov cc50b7d7d5 More AltiVec support.
Patch by Anton Yartsev!

llvm-svn: 106387
2010-06-19 09:47:18 +00:00
Nate Begeman dbafec1f3e Remove last of the bool shifts for MS VC++, patch by dimitry andric
llvm-svn: 106206
2010-06-17 02:26:59 +00:00
Fariborz Jahanian 4a30307840 Fixed conflict between objc_memmove_collectable builtin
decl. and one ddefined in darwin header file.

llvm-svn: 106107
2010-06-16 16:22:04 +00:00
Fariborz Jahanian 021510e96f Patch adds support for copying of those
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772). 

llvm-svn: 106061
2010-06-15 22:44:06 +00:00
Benjamin Kramer 7039fcbc5d An implementation of __builtin__fpclassify the way Chris Lattner described by Jörg Blank.
llvm-svn: 105936
2010-06-14 10:30:41 +00:00
Nate Begeman 91e1feab7a Add some missing shifts
Fix multiplies by scalar
Add SemaChecking code for all immediates
Add SemaChecking-gen support to arm_neon.td

llvm-svn: 105930
2010-06-14 05:21:25 +00:00
Nate Begeman d773fe67dd Most of NEON sema checking & fix to polynomial type detection
llvm-svn: 105908
2010-06-13 04:47:52 +00:00
Nate Begeman c6ac0ce89f Shifts complete. Only vld & sema checking of constants remain.
llvm-svn: 105879
2010-06-12 06:06:07 +00:00
Nate Begeman dd715805ab vbsl, vrev* is implemented via arm_neon.h
llvm-svn: 105875
2010-06-12 03:11:41 +00:00
Nate Begeman 8ed060b95a Most of remaining builtins, 2 generics, vld, and rounding shfits remain.
llvm-svn: 105848
2010-06-11 22:57:12 +00:00
Nate Begeman e0935ffa50 Multiplies, some shifts, set_lane
llvm-svn: 105793
2010-06-10 18:11:55 +00:00
Nate Begeman 4a04b467d9 support _lane ops, and multiplies by scalar.
llvm-svn: 105770
2010-06-10 00:17:56 +00:00
Nate Begeman d90aa43bdf Implement codegen for hadd, hsub, max, min, mlal, movl, movn, padal, mov_n
Make note about how to handle the dozen or so multiply by scalar ops.

llvm-svn: 105734
2010-06-09 18:04:15 +00:00
Nate Begeman 4307a25545 More accurate BuiltinsARM.def
vget_lane support

llvm-svn: 105684
2010-06-09 05:30:26 +00:00
Rafael Espindola 6bb986d530 Simplify the code a bit and avoid a gcc waring about uninitialized variables.
llvm-svn: 105676
2010-06-09 03:48:40 +00:00
Nate Begeman 5548309fa7 Implement transpose/zip/unzip & table lookup.
Test out some basic constant-checking.

llvm-svn: 105667
2010-06-09 01:10:23 +00:00
Nate Begeman ae6b1d8010 Fix NEON intrinsic argument passing, support vext. Most now successfully make it through codegen to the .s file
llvm-svn: 105599
2010-06-08 06:03:01 +00:00
Rafael Espindola 895e51de4a Fix what looks like a merge problem that broke __clear_cache.
llvm-svn: 105595
2010-06-08 03:52:53 +00:00