Bob Wilson
aecb7501ad
Avoid evaluating Neon macro arguments more than once by disabling type checks.
...
It turns out that the use of "__extension__" in these macros was disabling
the expected "incompatible pointer" warnings, so these type checks were not
doing anything anyway. They introduced a serious bug by evaluating some
macro arguments twice, which is a big problem for arguments with side effects.
I'll have to find another way to get the right type checking. Radar 9947657.
llvm-svn: 137680
2011-08-15 23:22:56 +00:00
Bob Wilson
d2a4a871a9
Revert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."
...
Sorry, this was a bad idea. Within clang these builtins are in a separate
"ARM" namespace, but the actual builtin names should clearly distinguish that
they are target specific.
llvm-svn: 133832
2011-06-24 22:13:17 +00:00
Bob Wilson
4f728fd0de
Shorten some ARM builtin names by removing unnecessary "neon" prefix.
...
llvm-svn: 133825
2011-06-24 21:32:40 +00:00
Jim Grosbach
797cff0504
Consolidate some TableGen diagnostic helper functions.
...
TableGen had diagnostic printers sprinkled about in a few places. Pull them
together into a single location in Error.cpp.
llvm-svn: 133568
2011-06-21 22:55:50 +00:00
Bob Wilson
6b03ec7581
Add special-case range checking for VCVT_N intrinsic immediate operands.
...
Radar 9558930.
llvm-svn: 132782
2011-06-09 16:57:29 +00:00
Bob Wilson
23c28ee17e
Define Neon load/store intrinsics for Clang as macros instead of functions.
...
This is needed so the front-end can see "aligned" attributes on the type
for the pointer arguments. Radar 9311427.
llvm-svn: 129964
2011-04-22 00:37:01 +00:00
Bob Wilson
271efda884
Use intrinsics for Neon vmull operations. Radar 9208957.
...
llvm-svn: 128591
2011-03-31 00:09:35 +00:00
Bob Wilson
006089b761
Use __builtin_shufflevector to implement vget_low and vget_high intrinsics.
...
This was suggested by Edmund Grimley Evans in pr8411.
llvm-svn: 123043
2011-01-07 23:40:49 +00:00
Bob Wilson
def12f3be1
Neon intrinsic tests need to be compiled for Cortex-A9 for f16 support.
...
llvm-svn: 122015
2010-12-17 01:21:03 +00:00
Bob Wilson
d7f8bd1c14
Teach the Neon intrinsic generator to widen half-precision float types.
...
This isn't currently used for anything but I ran into it when experimenting
with some changes, and it might be useful in the future.
llvm-svn: 121911
2010-12-15 23:16:25 +00:00
Bob Wilson
9168a4f1c2
Add a Neon intrinsic test generator.
...
This is still a WIP. It's already good enough to expose a few bugs, though.
llvm-svn: 121868
2010-12-15 16:58:45 +00:00
Bob Wilson
276f1ca897
Fix Neon intrinsic immediate range checking for some double-register operands.
...
Some quad-register intrinsics with lane operands only take a double-register
operand for the vector containing the lane. The valid range of lane numbers
is then half as big as you would expect from the quad-register type.
Note: This currently has no effect because those intrinsics are now handled
entirely in the header file using __builtin_shufflevector, which does its own
range checking, but I want to use this for generating tests.
llvm-svn: 121867
2010-12-15 16:58:42 +00:00
Bob Wilson
4959014850
The Neon vqdmlsl_lane and vqdmlal_lane intrinsics have 4 arguments, not 3.
...
llvm-svn: 121469
2010-12-10 06:37:53 +00:00
Bob Wilson
47206b840b
80-column fixes.
...
llvm-svn: 121395
2010-12-09 18:43:35 +00:00
Bob Wilson
38c3ca78e6
Add a license comment to the generated arm_neon.h header.
...
Remove the previous header. I don't think we need to expose to end users
that we use TableGen to produce our version of arm_neon.h, and that header
was also using doubleslash comments which could be a problem when using it
in strict C89 compilations.
llvm-svn: 121390
2010-12-09 18:31:01 +00:00
Bob Wilson
4868ba0619
Add operators for "_lane" variants of some saturating Neon multiply intrinsics
...
so they can be implemented without separate clang builtins.
llvm-svn: 121299
2010-12-08 22:36:08 +00:00
Bob Wilson
dbe9e7e3dd
Add operators for vabdl and vabal so they can be implemented without builtins.
...
llvm-svn: 121287
2010-12-08 21:39:04 +00:00
Bob Wilson
bf74755e62
Remove unused function parameter.
...
llvm-svn: 121286
2010-12-08 21:39:00 +00:00
Bob Wilson
194ad82666
Add an operator for vaba so it can be implemented using vabd.
...
llvm-svn: 121276
2010-12-08 20:09:10 +00:00
Bob Wilson
97b44b5b4a
Add operators for vadd[lw] and vsub[lw]
...
so they can be implemented without clang builtins.
llvm-svn: 121213
2010-12-08 00:14:04 +00:00
Bob Wilson
c40935fa0c
Add operators for vmlal{_n,_lane} and vmlsl{_n,_lane}
...
so they can be implemented without clang builtins.
llvm-svn: 121209
2010-12-07 23:53:37 +00:00
Bob Wilson
7a36c68748
Emit vmovl intrinsics first in the arm_neon.h header
...
so they can be used in the implementations of other intrinsics.
llvm-svn: 121208
2010-12-07 23:53:32 +00:00
Bob Wilson
361afe4ef2
Add an operator for vdup_lane so it can be implemented without a clang builtin.
...
llvm-svn: 121190
2010-12-07 22:39:24 +00:00
Bob Wilson
17a233c0e5
Add an operator for vmull_lane so it can be implemented without a clang builtin.
...
llvm-svn: 121187
2010-12-07 22:02:48 +00:00
Bob Wilson
192336b865
Add new built-in operations for vmull and vmull_n
...
so they can be implemented without requiring clang builtins.
Radar 8446238.
llvm-svn: 121173
2010-12-07 20:02:45 +00:00
Bob Wilson
654db47903
Add an OpReinterpret operation to TableGen's NeonEmitter.
...
An OpReinterpret entry is handled by translating it to OpCast intrinsics for
all combinations of source and destination types with the same total size.
This will be used to generate all the vreinterpret intrinsics.
llvm-svn: 121087
2010-12-07 01:12:23 +00:00
Bob Wilson
b87116e30a
Fix whitespace.
...
llvm-svn: 121086
2010-12-07 01:12:19 +00:00
Bob Wilson
236ba8d862
Remove trailing whitespace.
...
llvm-svn: 120891
2010-12-04 04:40:15 +00:00
Bob Wilson
074436b090
Get Neon intrinsic names from the new "Name" field in the tblgen records
...
instead of just converting the record name to lowercase.
llvm-svn: 120809
2010-12-03 17:19:39 +00:00
Bob Wilson
e6b421ccb5
Add support for "_lane" variants of VMUL, VMLA, and VMLS Neon intrinsics.
...
llvm-svn: 120764
2010-12-03 00:34:12 +00:00
Bob Wilson
791934e122
Support using macros for Neon intrinsics implemented without builtins.
...
Intrinsics implemented with Clang builtins could already be implemented as
either inline functions or macros, but intrinsics implemented directly
(without builtins) could only be inline functions.
llvm-svn: 120763
2010-12-03 00:34:09 +00:00
Bob Wilson
4375586bd9
Simplify code in Neon intrinsics. No functional changes intended.
...
For most intrinsics, there is no need to allocate a temporary to hold the
result value; just return it directly.
llvm-svn: 120695
2010-12-02 07:44:23 +00:00
Bob Wilson
79026235e6
Assign arguments of Neon intrinsic macros to local temporaries.
...
Since we're casting them for the calls to the builtins, we need this to
make sure their types get checked in the same way they would if the intrinsics
were implemented as inline functions.
llvm-svn: 120693
2010-12-02 07:10:39 +00:00
Bob Wilson
014fe01ac8
Use statement expressions in Neon intrinsics defined as macros.
...
This is in preparation for adding assignments to temporaries to ensure
that the proper type checking is done.
llvm-svn: 120649
2010-12-02 02:42:51 +00:00
Bob Wilson
492de6da40
Add casts for splatted scalars in calls to Neon builtins.
...
llvm-svn: 120641
2010-12-02 01:18:23 +00:00
Bob Wilson
ec626b09cb
Add a missing cast for Neon vsbl results.
...
The bitwise operations are always done with unsigned values, but the result may
be signed.
llvm-svn: 120640
2010-12-02 01:18:20 +00:00
Bob Wilson
c08944fd5a
Add another missing cast for Neon vcombine results.
...
llvm-svn: 120639
2010-12-02 01:18:18 +00:00
Bob Wilson
a9ea9ef840
Add casts in arm_neon.h for result values in inline functions as well as macros.
...
We should not rely on lax-vector-conversions for these intrinsics to work.
llvm-svn: 120638
2010-12-02 01:18:15 +00:00
Bob Wilson
743eeae937
Avoid "char" for Neon vector elements; make it explicitly signed (or unsigned).
...
llvm-svn: 120632
2010-12-02 00:24:59 +00:00
Bob Wilson
be764f0cd1
Cast scalar results of Neon macros to the correct type.
...
llvm-svn: 120631
2010-12-02 00:24:56 +00:00
Bob Wilson
3e8f3f94ef
Add explicit casts for vector arguments to Neon builtins.
...
This avoids warnings with -Wvector-conversions. Radar 8228022.
llvm-svn: 120597
2010-12-01 19:49:58 +00:00
Bob Wilson
fa5207595e
Add some comments for TableGen's NeonEmitter.
...
llvm-svn: 120596
2010-12-01 19:49:56 +00:00
Bob Wilson
65a96d082a
Cleanup: simplify checks for integers between 2 and 4.
...
llvm-svn: 120595
2010-12-01 19:49:51 +00:00
Bob Wilson
b91ae1ac52
Fix copy-and-paste error in exception message.
...
llvm-svn: 120033
2010-11-23 19:38:34 +00:00
Bob Wilson
4e22a38759
Change the 'x' type modifier for Neon intrinsics to force a signed integer.
...
This makes it symmetric with the 'u' modifier that forces an unsigned type.
This is needed for unsigned vector shifts, where the shift amount still needs
to be signed. PR8482 (Radar 8603521).
llvm-svn: 119742
2010-11-18 21:43:22 +00:00
Bob Wilson
712f07de0e
Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.
...
llvm-svn: 119406
2010-11-16 23:57:06 +00:00
Bob Wilson
789e015ce7
Change Neon polynomial types to be signed to match GCC.
...
llvm-svn: 119405
2010-11-16 23:57:03 +00:00
Bob Wilson
0045702afe
Refactor to new GetNumElements function.
...
No functional change.
llvm-svn: 119404
2010-11-16 23:57:01 +00:00
Bob Wilson
dfac58bed1
Tidy up some things in <arm_neon.h>.
...
Stop defining types with "__neon_" prefixes and then using typedefs without
the prefix; there's no reason to do that anymore. Remove types that combine
multiple Neon vectors and treat them as a single long vector; they are not
used.
llvm-svn: 119369
2010-11-16 19:39:14 +00:00
Bob Wilson
2880185194
Reapply "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
...
I've temporarily disabled the failing clang test.
llvm-svn: 119367
2010-11-16 19:16:06 +00:00