Commit Graph

271 Commits

Author SHA1 Message Date
Chris Lattner 9052c35479 fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC.  GCC is changing this in 
a series of their own PRs (e.g. 41323).

llvm-svn: 111637
2010-08-20 16:08:33 +00:00
Anton Yartsev 583a1cf7b5 support for predicates with bool/pixel arguments
llvm-svn: 111515
2010-08-19 11:57:49 +00:00
Anton Yartsev fc83c60755 support for the rest of AltiVec functions with bool/pixel arguments and return values (except predicates)
llvm-svn: 111511
2010-08-19 03:21:36 +00:00
Anton Yartsev 9e96898032 support for vec_perm and all dependent functions (vec_mergeh, vec_mergel, vec_pack, vec_sld, vec_splat) with bool/pixel arguments and return values
llvm-svn: 111509
2010-08-19 03:00:09 +00:00
Anton Yartsev 2cc136d4e3 support for vec_add, vec_adds, vec_and, vec_andc with bool arguments
llvm-svn: 111141
2010-08-16 16:22:12 +00:00
Anton Yartsev bfd0f96e79 first test commit
llvm-svn: 110941
2010-08-12 18:51:55 +00:00
Bruno Cardoso Lopes 8c333153e0 Fix define inserting a comma :)
llvm-svn: 110839
2010-08-11 18:45:43 +00:00
Bruno Cardoso Lopes 65954ffc69 Remove 256-bit cast built-ins and make the AVX intrinsic call llvm __builtin_shufflevector with the appropriate arguments
llvm-svn: 110771
2010-08-11 02:14:38 +00:00
Bruno Cardoso Lopes a4f1930b75 Remove 256-bit unpack built-ins and make the AVX intrinsic call llvm __builtin_shufflevector with the appropriate arguments
llvm-svn: 110768
2010-08-11 01:43:24 +00:00
Bruno Cardoso Lopes e712a135b7 Remove 256-bit shuffle built-ins and make the AVX intrinsic call llvm __builtin_shufflevector with the appropriate arguments
llvm-svn: 110766
2010-08-11 01:17:34 +00:00
Bruno Cardoso Lopes 3d3fc1d075 Make replicate intrinsics use shufflevector instead of dup builtins, also remove the dup builtins
llvm-svn: 110646
2010-08-10 02:23:54 +00:00
Chandler Carruth 42cf818be1 Fix a few more typos. Amusingly, GCC made the same mistake around version 3.2.
llvm-svn: 110546
2010-08-08 08:44:32 +00:00
Chandler Carruth 7579c008ec Fix some typos I made when adding alternate intrinsic names.
llvm-svn: 110545
2010-08-08 08:30:05 +00:00
Bruno Cardoso Lopes 3d19889ca8 Fix AVX 256-bit intrinsics headers by using the right cast type while dealing with logical ops
llvm-svn: 110389
2010-08-05 23:04:58 +00:00
Bruno Cardoso Lopes fc2320fd73 Logical AVX instrinsics can be matched directly, no need to use builtins here.
llvm-svn: 110271
2010-08-04 22:56:42 +00:00
Bruno Cardoso Lopes 7c4b513a3f Add AVX intrinsics header
llvm-svn: 110253
2010-08-04 22:03:36 +00:00
Chris Lattner 38321174e0 add a hack for visual studio, fixing PR7796
llvm-svn: 110161
2010-08-03 22:13:56 +00:00
Chandler Carruth 96f2e9e418 Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
up enough to be worth supporting properly. Fixes PR7674.

llvm-svn: 109086
2010-07-22 06:47:28 +00:00
Daniel Dunbar 43d74a3b02 build: Make sure arm_neon.h gets installed.
llvm-svn: 109073
2010-07-22 01:19:36 +00:00
Eli Friedman 07c89c6b3e PR7588: Fix the _mm_shufflehi_epi16 macro. (The issue was an oversight
involving operator precedence.)

llvm-svn: 107902
2010-07-08 20:09:45 +00:00
Daniel Dunbar 540e8b1dcd Headers: Change [u]intmax_t to be defined in terms of __[U]INTMAX_TYPE__, instead of intN_t.
llvm-svn: 107254
2010-06-30 06:30:50 +00:00
Bob Wilson f11a38dcce Add a missing dependency to try to fix a buildbot failure.
It complained with:

llvm[5]: Building Clang arm_neon.h.inc with tblgen
cp: cannot create regular file `/build/buildbot-llvm/clang-x86_64-linux-selfhost-rel/llvm.obj.2/Release/lib/clang/2.0/include/arm_neon.h': No such file or directory

llvm-svn: 106922
2010-06-26 00:03:23 +00:00
Daniel Dunbar 283fe3d07a build: Get CLANG_VERSION from Version.inc instead of depending on VER file directly.
llvm-svn: 106864
2010-06-25 17:33:49 +00:00
Anton Korobeynikov cc50b7d7d5 More AltiVec support.
Patch by Anton Yartsev!

llvm-svn: 106387
2010-06-19 09:47:18 +00:00
Douglas Gregor 0552291859 Update CMake build system for ARM NEON generation.
llvm-svn: 106220
2010-06-17 15:17:41 +00:00
Nate Begeman 35f4c1c6b1 Generate arm_neon.inc in include/clang/Basic, which provides:
1. builtins definitions for BuiltinsARM.def
2. intrinsic validation code for SemaChecking

Unsure as to whether this is the best way to handle the make dependencies or not.

llvm-svn: 106208
2010-06-17 04:17:01 +00:00
Alexis Hunt 0684e33ba5 MinGW requires that wint_t be defined in stddef.h. In order to accomodate, we
won't define it unless specifically requested via the use of __need_wint_t.

llvm-svn: 105985
2010-06-15 02:36:48 +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 dd715805ab vbsl, vrev* is implemented via arm_neon.h
llvm-svn: 105875
2010-06-12 03:11:41 +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 5548309fa7 Implement transpose/zip/unzip & table lookup.
Test out some basic constant-checking.

llvm-svn: 105667
2010-06-09 01:10:23 +00:00
Daniel Dunbar e6c1daa8fd Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

llvm-svn: 105637
2010-06-08 20:34:18 +00:00
Nate Begeman 16372afeab Implement ARM NEON up through vcvt, alphabetically.
llvm-svn: 105590
2010-06-08 00:17:19 +00:00
Nate Begeman 6736cc89d0 Initial support for ARM NEON builtins, codegen up next
llvm-svn: 105489
2010-06-04 21:36:27 +00:00
Nate Begeman 821079d42d Classify NEON intrinsics by overloading-type for codegen
Add a few missing instructions

llvm-svn: 105417
2010-06-03 21:36:23 +00:00
Daniel Dunbar f5e075d392 Headers: Fix quoting of macro arguments in a couple more places.
llvm-svn: 105331
2010-06-02 16:35:01 +00:00
Nate Begeman 661ba6d847 Fix vget_lane/vset_lane
llvm-svn: 105317
2010-06-02 07:15:01 +00:00
Nate Begeman 464d280b3c Checkpoint arm_neon.h generation with tablegen
llvm-svn: 105306
2010-06-02 00:34:41 +00:00
Nick Lewycky 71eac6e114 Make macro safe in the face of users who pass "addr+64". Addition of void* is
invalid.

llvm-svn: 105172
2010-05-30 18:26:21 +00:00
Nate Begeman b9ed185e33 Implement remaining items in neon td file. Still need to modify emitter to generate a proper header.
llvm-svn: 105058
2010-05-28 23:15:59 +00:00
Douglas Gregor 1f1be08645 Add CMake goop to get arm_neon.h generated
llvm-svn: 104934
2010-05-28 04:22:06 +00:00
Nate Begeman 07f9b0c784 Convert arm_neon.h into arm_neon.td, from which arm_neon.h will be built
Add Makefile support for building arm_neon.h from arm_neon.td
Need to figure out an appropriate cmake rule for this.

llvm-svn: 104928
2010-05-28 02:20:47 +00:00
Chris Lattner 8b3b145342 fix _mm_shuffle_pd too, thanks to Joel Falcou for pointing this out.
llvm-svn: 103873
2010-05-15 16:54:46 +00:00
Chris Lattner 6625c7028e add type casts to _mm_shuffle_ps so the front-end applies
implicit conversions where needed.  This fixes an error reported
on cfe-dev, not really worth a testcase though.

llvm-svn: 103864
2010-05-15 05:53:53 +00:00
Nate Begeman 4a623eed26 logical ops, unary ops, pairwise ops
llvm-svn: 102681
2010-04-30 00:46:57 +00:00
Nate Begeman 723169d8ec Comparisons.
llvm-svn: 102669
2010-04-29 23:36:09 +00:00
Nate Begeman 23a2f2ff79 Start stamping out the __builtin_neon stuff.
llvm-svn: 102638
2010-04-29 17:37:19 +00:00
Nate Begeman a8a9d6a1f0 A bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.
llvm-svn: 102549
2010-04-28 22:37:01 +00:00
Nate Begeman cb2563f0c3 Stub out NEON support, more to come.
llvm-svn: 102512
2010-04-28 18:37:32 +00:00
Daniel Dunbar cfc12ddb0a Headers: Hide intptr_t and uintptr_t definitions behind _INTPTR_T and _UINTPTR_T
defines, for increased compatibility with Darwin gcc.
 - This is a bit of a hack, since platform compatibility issues don't belong
   here, but I don't think this hurts anyone either.

llvm-svn: 102264
2010-04-24 20:32:12 +00:00
Eric Christopher 1bbc7086ff Rewrite handling of 64-bit palignr intrinsics to be vector shuffles.
Stop multiplying constant by 8 accordingly in the header and change
intrinsic definition for what types we expect.

Add to existing palignr test to check that we're emitting the correct things.

llvm-svn: 101332
2010-04-15 01:43:08 +00:00
Chris Lattner dd6697b4fa improve altivec c++ support by adding casts, patch by
Anton Yartsev!

llvm-svn: 101281
2010-04-14 20:35:39 +00:00
Chris Lattner dad4062b4d implement altivec.h and a bunch of support code, patch by Anton Yartsev!
llvm-svn: 101215
2010-04-14 03:54:58 +00:00
Chris Lattner 4b73cfabac rename llvm::llvm_report_error -> llvm::report_fatal_error
llvm-svn: 100708
2010-04-07 22:58:06 +00:00
Eric Christopher 2fbd4050e9 Fix typo.
llvm-svn: 100079
2010-04-01 03:07:20 +00:00
Eric Christopher 5464e5ae00 First start at wmmintrin.h file with Intel AES-NI instructions.
llvm-svn: 100077
2010-04-01 03:03:35 +00:00
Daniel Dunbar 6a6199de67 Fix 80 col violations.
llvm-svn: 99648
2010-03-26 20:17:17 +00:00
Eric Christopher bd9a3aecd6 This is just a simple v4si * v4si, make it so.
llvm-svn: 99587
2010-03-26 00:51:28 +00:00
Anders Carlsson 91e18c93c4 Make the license header in smmintrin.h match the other SSE headers.
llvm-svn: 99384
2010-03-24 05:31:31 +00:00
Chris Lattner 7eac805bb0 fix PR6658: inline isn't a keyword in C89 mode, use __inline__ instead.
llvm-svn: 99190
2010-03-22 18:14:12 +00:00
Eric Christopher 08f135274d Add sse4.2 header and builtin support.
llvm-svn: 99051
2010-03-20 07:43:28 +00:00
Eric Christopher 86af0bae8a Add a newline at the end of the file.
llvm-svn: 99026
2010-03-20 01:19:04 +00:00
Eric Christopher 6ed351ab2d For legacy compatibility add a varargs.h header.
llvm-svn: 99025
2010-03-20 01:18:30 +00:00
Eric Christopher 33124e20c7 Migrate typedefs to the top level of xmmintrin.h and remove the same
one from emmintrin.h.

llvm-svn: 99020
2010-03-20 01:08:47 +00:00
Eric Christopher 8c6f61394f Add remaining sse4.1 intrinsics and builtins.
llvm-svn: 98587
2010-03-15 23:22:58 +00:00
Eric Christopher 6932b2e8b7 Add SSE4 packed integer comparisons and corresponding intrinsics.
llvm-svn: 98323
2010-03-12 01:22:33 +00:00
Eric Christopher e486f68b59 Integer array extraction for sse4.1.
llvm-svn: 98305
2010-03-11 23:50:18 +00:00
Eric Christopher e7594305bc Add packed integer array insertion.
llvm-svn: 98299
2010-03-11 23:36:29 +00:00
Eric Christopher 1dca62055a Add insert/extract_ps and related random macros.
llvm-svn: 98114
2010-03-10 00:50:58 +00:00
Ted Kremenek 0a4a8326c1 Add preprocessor guards to the definitions of size_t and wchar_t, and #undef NULL before defining it.
This addresses potential issues with system headers reported in <rdar://problem/7727159>.

llvm-svn: 98006
2010-03-08 23:23:45 +00:00
Ted Kremenek 4c9862ca1d Place the definition of 'va_list' within a preprocessor guard. This matches the behavior of GCC, and avoids potential conflicts with system headers (e.g., stdio.h). Fixes <rdar://problem/7727145>.
llvm-svn: 98003
2010-03-08 23:13:05 +00:00
Eric Christopher 4c70358296 Add sse4.1 packed min and max intrinsics.
llvm-svn: 97907
2010-03-07 07:00:42 +00:00
Eric Christopher 7288890b51 Add load hint instruction intrinsic.
llvm-svn: 97904
2010-03-07 06:29:09 +00:00
Eric Christopher 87990fe5df Add in support for dword multiply and fp dot product intrinsics.
llvm-svn: 97902
2010-03-07 06:17:19 +00:00
Eric Christopher b0759be4d0 Fix _MM_FROUND_NEARBYINT and move rounding intrinsics to macros.
llvm-svn: 97874
2010-03-06 10:31:44 +00:00
Eric Christopher 94567c04bb First start on smmintrin.h, rounding and blending.
llvm-svn: 97717
2010-03-04 02:56:19 +00:00
Chris Lattner e983eae273 add two aliases for SSE functions we already have, fixing PR6316.
llvm-svn: 96363
2010-02-16 18:21:25 +00:00
Chris Lattner b18093e467 fix PR6187: various load functions in xmmintrin.h were missing 'const'.
emmintrin looks ok.

llvm-svn: 94998
2010-02-01 20:14:14 +00:00
Chris Lattner 0afd3a23cd fix a bug in the _MM_TRANSPOSE4_PS definition, patch by Brian Sumner from
PR6138

llvm-svn: 94669
2010-01-27 07:54:50 +00:00
Chris Lattner 4debb32fdd _mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
but this one is wrong.  Thanks to Tanya for noticing this.

llvm-svn: 92881
2010-01-07 00:36:41 +00:00
Nate Begeman 67dfd4236a Revert mmx palignr to use an intrinsic, since mmx shuffle patterns are missing.
llvm-svn: 91269
2009-12-14 05:15:02 +00:00
Nate Begeman 72ec6bc6f4 Support x86's PALIGNR instruction without the use of a palignr intrinsic.
llvm-svn: 91264
2009-12-14 04:57:03 +00:00
Chris Lattner 399df12fb1 minimal fix for PR5743
llvm-svn: 91032
2009-12-10 01:38:15 +00:00
Douglas Gregor df72af5935 Pick up MB_LEN_MAX as defined by the system <limits.h>, when it's provided there
llvm-svn: 90879
2009-12-08 21:35:00 +00:00
Ken Dyck f540ae5ab3 Define SIG_ATOMIC_MIN and SIG_ATOMIC_MAX in terms of __SIG_ATOMIC_WIDTH__.
llvm-svn: 89598
2009-11-22 15:47:12 +00:00
Ken Dyck 33211d9658 Avoid unwanted expansion in macros that paste together INT<n>_C(v) and
UINT<n>_C(v) macros. 

llvm-svn: 89461
2009-11-20 16:49:10 +00:00
Ken Dyck 8dcc21420b Avoid unwanted expansion in macros that paste together INT<n>_MIN, INT<n>_MAX,
and UINT<n>_MAX defintions.

llvm-svn: 89460
2009-11-20 16:44:38 +00:00
Ken Dyck 764a5f3881 Avoid unwanted macro expansion in macros that paste together int<n>_t and
uint<n>_t definitions.

llvm-svn: 89459
2009-11-20 16:37:35 +00:00
Ken Dyck aff01ceb95 Define WCHAR_MIN and WCHAR_MAX in terms of __WCHAR_WIDTH__ for consistency with
other limit macros.

llvm-svn: 89355
2009-11-19 15:53:08 +00:00
Ken Dyck f0b343f5b7 Parameterize WINT_MIN and WINT_MAX with __WINT_WIDTH__ to support arbitrary
widths. This corrects the values of these definitions for MSP430 and PIC16.

llvm-svn: 89350
2009-11-19 14:35:19 +00:00
Ken Dyck 279ed5189c Construct definition of SIZE_MAX from __SIZE_WIDTH__ to support targets of
arbitrary widths.

llvm-svn: 89347
2009-11-19 14:03:24 +00:00
Ken Dyck 8af6035ac9 Construct the macro body of PTRDIFF_MAX and PTRDIFF_MIN from __PTRDIFF_WIDTH__.
llvm-svn: 89343
2009-11-19 12:33:01 +00:00
Ken Dyck 68fa5afada Construct INTPTR_MIN, INTPTR_MAX, and UINTPTR_MAX from the exact-width limit
macros corresponding to __INTPTR_WIDTH__.

llvm-svn: 89239
2009-11-18 20:36:29 +00:00
Ken Dyck 2d4371d666 Define intptr_t and uintptr_t in terms of their equivalent exact-width types.
llvm-svn: 89237
2009-11-18 20:24:13 +00:00
Ken Dyck ac11b7b625 Define INTMAX_C and UINTMAX_C in terms of the corresponding exact-width
INTn_C and UINTn_C macros.

llvm-svn: 89226
2009-11-18 19:42:57 +00:00
Ken Dyck 63c8ef8256 Define INTMAX_MIN, INTMAX_MAX, and UINTMAX_MAX in terms of the limit macros for
their corresponding exact-width type. 

llvm-svn: 89224
2009-11-18 19:22:15 +00:00
Ken Dyck 47181584f1 Define intmax_t and uintmax_t as the [u]intN_t type corresponding to
__INTMAX_WIDTH__.

llvm-svn: 89221
2009-11-18 18:57:04 +00:00
Ken Dyck 19ac306c2c Replace (-INT8_C(128)), which uses an illegally out-of-range argument for
INT8_C, with (-INT8_C(127)-1) in the definition of INT8_MIN. Apply similar
changes to the definitions of INT16_MIN and INT24_MIN.

llvm-svn: 89120
2009-11-17 18:29:12 +00:00
Ken Dyck f78dc738a5 Use the INTn_C integer constant macros to generate limit constants with correct
suffixes. This corrects the suffixes for the limit constants of the 32-bit
types on MSP430 and PIC16, and the 64-bit types on PPC64, SystemZ, X86_64.

llvm-svn: 89101
2009-11-17 16:26:27 +00:00