Commit Graph

3347 Commits

Author SHA1 Message Date
Mikhail Glushenkov
87685e8e8f llvmc: make switch options ZeroOrMore by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 01:21:59 +00:00
Jakob Stoklund Olesen
b83ff84193 Introduce TargetRegisterInfo::getOverlaps(Reg), returning a list of all
registers that alias Reg, including itself. This is almost the same as the
existing getAliasSet() method, except for the inclusion of Reg.

The name matches the reflexive TRI::regsOverlap(x, y) relation.

It is very common to do stuff to a register and all its aliases:

  stuff(Reg)
  for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias)
    stuff(*Alias);

That can now be written as the simpler:

  for (const unsigned *Alias = TRI->getOverlaps(Reg); *Alias; ++Alias)
    stuff(*Alias);

This change requires a bit more constant space for the alias lists because Reg
is included and because the empty alias list cannot be shared any longer.

If the getAliasSet method is eventually removed, this space can be reclaimed by
sharing overlap lists. For instance, %rax and %eax have identical overlap sets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 23:03:42 +00:00
Jim Grosbach
d40963c406 Add support for MC-ized encoding of tLEApcrel and tLEApcrelJT. rdar://8755755
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 22:28:03 +00:00
Bill Wendling
f4caf69720 The tLDR et al instructions were emitting either a reg/reg or reg/imm
instruction based on the t_addrmode_s# mode and what it returned. There is some
obvious badness to this. In particular, it's hard to do MC-encoding when the
instruction may change out from underneath you after the t_addrmode_s# variable
is finally resolved.

The solution is to revert a long-ago change that merged the reg/reg and reg/imm
versions. There is the addition of several new addressing modes. They no longer
have extraneous operands associated with them. I.e., if it's reg/reg we don't
have to have a dummy zero immediate tacked on to the SDNode.

There are some obvious cleanups here, which will happen shortly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121747 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 03:36:38 +00:00
Owen Anderson
a838a25d59 Second attempt at make Thumb2 LEAs pseudos. This time, perform the lowering much later, which makes the entire
process cleaner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-14 00:36:49 +00:00
Bob Wilson
4711d5cda3 Remove the rest of the *_sfp Neon instruction patterns.
Use the same COPY_TO_REGCLASS approach as for the 2-register *_sfp instructions.
This change made a big difference in the code generated for the
CodeGen/Thumb2/cross-rc-coalescing-2.ll test: The coalescer is still doing
a fine job, but some instructions that were previously moved outside the loop
are not moved now.  It's using fewer VFP registers now, which is generally
a good thing, so I think the estimates for register pressure changed and that
affected the LICM behavior.  Since that isn't obviously wrong, I've just
changed the test file.  This completes the work for Radar 8711675.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 23:02:37 +00:00
Owen Anderson
6b8719fd7d Revert r121721, which broke buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 22:51:08 +00:00
Owen Anderson
e8d02539d7 Make Thumb2 LEA-like instruction into pseudos, which map down to ADR. Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 22:29:52 +00:00
Owen Anderson
c266600bec In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or
as a "long" direct branch.  While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches.  Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121710 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 19:31:11 +00:00
Bill Wendling
548f5a0b75 Add support for using the `!if' operator when initializing variables:
class A<bit a, bits<3> x, bits<3> y> {
    bits<3> z;
    let z = !if(a, x, y);
  }

The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 01:46:19 +00:00
Bill Wendling
eac8f35da8 Move <map> include out of .h and into .cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 01:05:54 +00:00
Bill Wendling
6a97ed34ed Merge DEBUG statements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121660 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 01:03:49 +00:00
Chris Lattner
67db883487 eliminate the Records global variable, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 00:23:57 +00:00
Chris Lattner
9d6250f52b clean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121658 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-13 00:20:52 +00:00
Bill Wendling
ab7837c269 Get rid of ellipses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 22:54:30 +00:00
Jim Grosbach
e246717c3a Thumb unconditional branch binary encoding. rdar://8754994
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 18:21:33 +00:00
Jim Grosbach
0108645139 Thumb conditional branch binary encodings. rdar://8745367
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 17:13:40 +00:00
Bob Wilson
c2ef828616 The Neon vqdmlsl_lane and vqdmlal_lane intrinsics have 4 arguments, not 3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121469 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 06:37:53 +00:00
Devang Patel
7dddad562f Add initial support to measure local variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121428 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 23:18:58 +00:00
Jim Grosbach
cf6220a9de Thumb needs a few different encoding schemes for branch targets. Rename
t_brtarget to be more specific.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121398 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 19:01:46 +00:00
Bob Wilson
b78558c0e1 80-column fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 18:43:35 +00:00
Bob Wilson
0e1fb7afcc 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 18:31:01 +00:00
Michael J. Spencer
7a8aab3997 Missed FileUpdate because CMake doesn't build it yet :(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:48:55 +00:00
Michael J. Spencer
333fb04506 Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 17:36:48 +00:00
Bill Wendling
09aa3f0ef3 The BLX instruction is encoded differently than the BL, because why not? In
particular, the immediate has 20-bits of value instead of 21. And bit 0 is '0'
always. Going through the BL fixup encoding was trashing the "bit 0 is '0'"
invariant.

Attempt to get the encoding at slightly more correct with this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 00:39:08 +00:00
Bill Wendling
dff2f7151f Support the "target" encodings for the CB[N]Z instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 23:01:43 +00:00
Bob Wilson
7441089c9b Add operators for "_lane" variants of some saturating Neon multiply intrinsics
so they can be implemented without separate clang builtins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 22:36:08 +00:00
Bob Wilson
b4504308ce Add operators for vabdl and vabal so they can be implemented without builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:39:04 +00:00
Bob Wilson
b1e9df3b72 Remove unused function parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121286 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 21:39:00 +00:00
Bob Wilson
f4f39d35cd Add an operator for vaba so it can be implemented using vabd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121276 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:09:10 +00:00
Bill Wendling
cd466f582a Use this new fangled StringSwitch technology.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121273 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 20:02:49 +00:00
Bill Wendling
dd2b6cbb62 Cleanup table a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 13:03:15 +00:00
Bill Wendling
b8958b031e Add support for loading from a constant pool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 01:57:09 +00:00
Bob Wilson
e113ae56d9 Add operators for vadd[lw] and vsub[lw]
so they can be implemented without clang builtins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121213 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-08 00:14:04 +00:00
Bob Wilson
0584316dfb Add operators for vmlal{_n,_lane} and vmlsl{_n,_lane}
so they can be implemented without clang builtins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:53:37 +00:00
Bob Wilson
da1d3dc9a5 Emit vmovl intrinsics first in the arm_neon.h header
so they can be used in the implementations of other intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121208 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:53:32 +00:00
Jim Grosbach
997759ac22 Add source Record* reference to PatternToMatch. Allows better diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 23:05:49 +00:00
Bob Wilson
2196caab82 Add an operator for vdup_lane so it can be implemented without a clang builtin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 22:39:24 +00:00
Bob Wilson
3467cd0d03 Add an operator for vmull_lane so it can be implemented without a clang builtin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 22:02:48 +00:00
Devang Patel
f57c2d3a3f Handle recursive values. Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 21:12:05 +00:00
Jim Grosbach
bf149c75b3 Remove reference to the CMPz instruction patterns for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:44:33 +00:00
Bob Wilson
c4ba09da60 Add new built-in operations for vmull and vmull_n
so they can be implemented without requiring clang builtins.
Radar 8446238.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121173 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 20:02:45 +00:00
Jim Grosbach
45258f5708 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:36:07 +00:00
Jim Grosbach
76612b549f Change assert to diagnostic. Message still needs work, but it's better than
an assert, at least.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 19:35:36 +00:00
NAKAMURA Takumi
280423558d utils/lit/lit/TestFormats.py: [PR8438] unittests: Seek *Tests (not BUILD_MODE/*Tests) under whole unittests/ if BUILD_MODE == '.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121118 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 07:41:32 +00:00
Bob Wilson
3890e397c3 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:12:23 +00:00
Bob Wilson
d8b847066e Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 01:12:19 +00:00
Devang Patel
8802f0b2d0 Add python scripts to extract debug info using LLDB and do comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121079 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07 00:34:59 +00:00
Jim Grosbach
662a816e89 Add fixup for Thumb1 BL/BLX instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 23:57:07 +00:00
Michael J. Spencer
93e5ec2cba KillTheDoctor: Cleanup error_code usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120986 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:28:01 +00:00
Michael J. Spencer
a1d942fb70 KillTheDoctor: Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 04:27:52 +00:00
Bob Wilson
7f76218720 Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-04 04:40:15 +00:00
Bob Wilson
ce0bb5479a Get Neon intrinsic names from the new "Name" field in the tblgen records
instead of just converting the record name to lowercase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 17:19:39 +00:00
Bill Wendling
6cfab3748c I did it wrong. Don't disregard these encodings here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:25:59 +00:00
Bill Wendling
b40a90597b Ignore decode table conflicts in the tMOVgpr2tgpr, tMOVgpr2gpr, and tMOVtgpr2gpr
instructions. They are handled as special moves, but encoded as a normal move.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:55:30 +00:00
Bob Wilson
b0d98692a6 Add support for "_lane" variants of VMUL, VMLA, and VMLS Neon intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:34:12 +00:00
Bob Wilson
194aa58066 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:34:09 +00:00
Bob Wilson
37a0b54fb5 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120695 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 07:44:23 +00:00
Bob Wilson
377296e301 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 07:10:39 +00:00
Bob Wilson
052008bc3d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 02:42:51 +00:00
Bob Wilson
4a6c7fc872 Add casts for splatted scalars in calls to Neon builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:18:23 +00:00
Bob Wilson
1dbfa91671 Add a missing cast for Neon vsbl results.
The bitwise operations are always done with unsigned values, but the result may
be signed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:18:20 +00:00
Bob Wilson
b322fc2ece Add another missing cast for Neon vcombine results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:18:18 +00:00
Bob Wilson
c79528a112 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 01:18:15 +00:00
Bob Wilson
317bafb82c Avoid "char" for Neon vector elements; make it explicitly signed (or unsigned).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120632 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:24:59 +00:00
Bob Wilson
e106bc17a3 Cast scalar results of Neon macros to the correct type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02 00:24:56 +00:00
Bob Wilson
f00140c8e1 Add explicit casts for vector arguments to Neon builtins.
This avoids warnings with -Wvector-conversions.  Radar 8228022.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:49:58 +00:00
Bob Wilson
95148ad023 Add some comments for TableGen's NeonEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120596 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:49:56 +00:00
Bob Wilson
5b7fe5920d Cleanup: simplify checks for integers between 2 and 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:49:51 +00:00
Jim Grosbach
5d14f9be7b Refactor LEApcrelJT as a pseudo-instructionlowered to a cannonical ADR
instruction at MC lowering. Add binary encoding information for the ADR,
including fixup data for the label operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-01 19:47:31 +00:00
Owen Anderson
80dd3e0612 Simplify the encoding of reg+/-imm12 values that allow PC-relative encoding. This allows the
Thumb2 encoding to share code with the ARM encoding, which gets use fixup support for free.
It also allows us to fold away at least one codegen-only pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 22:45:47 +00:00
Owen Anderson
0e1bcdf4f7 Add encoding support for Thumb2 PLD and PLI instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120449 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 19:19:31 +00:00
Jim Grosbach
12822af16a The VLDMQ/VSTMQ instructions are reprented as true Pseudo-insts now (i.e.,
no extra encoding information), so we no longer need to special case them
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 19:08:32 +00:00
Jim Grosbach
37cc2f121d Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 19:00:13 +00:00
Jim Grosbach
b6e1e67b80 Delete a few no longer needed references to pseudos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 18:56:13 +00:00
Bob Wilson
8e0c7b5287 Fix the encoding of VLD4-dup alignment.
The only reasonable way I could find to do this is to provide an alternate
version of the addrmode6 operand with a different encoding function.  Use it
for all the VLD-dup instructions for the sake of consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-30 00:00:42 +00:00
Jim Grosbach
5ca66696e7 Pseudo-ize Thumb2 jump tables with explicit MC lowering to the raw
instructions. This simplifies instruction printing and disassembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120333 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 22:37:40 +00:00
Jim Grosbach
d092a87ba3 Rename t2 TBB and TBH instructions to reference that they encode the jump table
data. Next up, pseudo-izing them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120320 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 21:28:32 +00:00
Michael J. Spencer
3cc52ea33c I swear I did a make clean and make before committing all this...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:47:54 +00:00
Michael J. Spencer
5fae2f1dbb Missed another one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120302 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:33:08 +00:00
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Bob Wilson
b055f740bd Fix copy-and-paste error in exception message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 19:38:34 +00:00
NAKAMURA Takumi
fb4d9816e7 lit.GoogleTest: On case-insensitive filesystem, matching should be case-insensitive when directory name is checked with test_sub_dir.
On MSVS8, ${CMAKE_CFG_INTDIR}, aka $(OutDir), has capitalized name(eg. Debug), although $(OutDir) is made with lower case(eg. debug).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 03:19:26 +00:00
Jason W Kim
837caa9313 Fix .o emission of ARM movt/movw. MCSymbolRefExpr::VK_ARM_(HI||LO)16 for the .o path now works for ARM.
Note: lo16AllZero remains in ARMInstrInfo.td - It can be factored out when Thumb movt is repaired.
Existing tests cover this update.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119760 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 23:37:15 +00:00
Bill Wendling
bd9c77bc9a Give the exclamation point a name instead of a number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 23:36:54 +00:00
Bob Wilson
181b76d503 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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 21:43:22 +00:00
Evan Cheng
c4af4638df Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

Instead, let peephole optimization pass recognize registers that are defined by
immediates and the ARM target hook will fold the immediates in.

Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ
instructions if there are multiple uses. This happens when the 'and' is live
out, machine sink would have sinked the computation and that ends up pessimizing
code. The peephole pass would recognize situations where the 'and' can be
toggled to define CPSR and eliminate the comparison anyway.

2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking
important optimizations.

rdar://8663787, rdar://8241368


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119548 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 20:13:28 +00:00
Bill Wendling
0f63075613 Proper encoding for VLDM and VSTM instructions. The register lists for these
instructions have to distinguish between lists of single- and double-precision
registers in order for the ASM matcher to do a proper job. In all other
respects, a list of single- or double-precision registers are the same as a list
of GPR registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 04:32:08 +00:00
Bob Wilson
6a8aceb50b Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 23:57:06 +00:00
Bob Wilson
4fbf63845f Change Neon polynomial types to be signed to match GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 23:57:03 +00:00
Bob Wilson
b308b62e6a Refactor to new GetNumElements function.
No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 23:57:01 +00:00
Bob Wilson
6904d7af1c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 19:39:14 +00:00
Bob Wilson
f18dfec0f7 Reapply "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
I've temporarily disabled the failing clang test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 19:16:06 +00:00
Bob Wilson
1ce588c970 Revert "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
It's breaking buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 18:43:07 +00:00
Michael J. Spencer
fae76d0734 This is the first step in adding sane error handling support to LLVMSystem.
The system API's will be shifted over to returning an error_code, and returning
other return values as out parameters to the function.

Code that needs to check error conditions will use the errc enum values which
are the same as the posix_errno defines (EBADF, E2BIG, etc...), and are
compatable with the error codes in WinError.h due to some magic in system_error.

An example would be:

if (error_code ec = KillEvil("Java")) { // error_code can be converted to bool.
  handle_error(ec);
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119360 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 18:31:52 +00:00
Bob Wilson
f93cbbd72e Stop using struct wrappers for Neon vector types in <arm_neon.h>.
Thanks to Nate Begeman for an earlier version of this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 18:17:03 +00:00
Bill Wendling
73fe34a3ee Encode the multi-load/store instructions with their respective modes ('ia',
'db', 'ib', 'da') instead of having that mode as a separate field in the
instruction. It's more convenient for the asm parser and much more readable for
humans.
<rdar://problem/8654088>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 01:16:36 +00:00
Chris Lattner
8ae082bf19 pull the code to get the operand value out of the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 07:09:28 +00:00
Chris Lattner
1620117f76 split the giant encoder loop into two new helper functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119129 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 06:59:17 +00:00
Chris Lattner
98e969ae20 reduce nesting and minor cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 06:42:13 +00:00
Chris Lattner
2ac190238e add fields to the .td files unconditionally, simplifying tblgen a bit.
Switch the ARM backend to use 'let' instead of 'set' with this change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 05:19:05 +00:00
NAKAMURA Takumi
9f6e03fa1e FileCheck: Eliminate DOSish \r from input file.
It can pass two tests below on Win32.
  - Clang :: CodeGenCXX/dyncast.cpp
  - LLVM :: CodeGen/ARM/globals.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 03:28:22 +00:00
Jim Grosbach
d1d5a39cad ARM fixup encoding for direct call instructions (BL).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118829 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 20:05:40 +00:00
Owen Anderson
336b8b4244 Add support for specifying a PostEncoderMethod, which can perform post-processing after the automated encoding of an instruction.
Not yet used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 01:19:24 +00:00
Dan Gohman
e88ccb545d Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite
their comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 18:30:00 +00:00
Dan Gohman
9423f63365 Translate IntrReadArgMem to AccessesArgumentsReadonly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 20:07:20 +00:00
Chris Lattner
7ad3147f98 pass literals like $$1 through to the asm matcher. This isn't right yet, but doesn't hurt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118359 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 22:06:03 +00:00
Chris Lattner
90fd797dc7 add (and document) the ability for alias results to have
fixed physical registers.  Start moving fp comparison
aliases to the .td file (which default to using %st1 if
nothing is specified).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118352 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 19:57:21 +00:00
Chris Lattner
98c870f87b generalize alias support to allow the result of an alias to
add fixed immediate values.  Move the aad and aam aliases to
use this, and document it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 19:25:43 +00:00
Chris Lattner
5bde734598 fix a bug where we had an implicit assumption that the
result instruction operand numbering matched the result pattern.

Fixing this allows us to move the xchg/test aliases to the .td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 08:20:59 +00:00
Chris Lattner
414098571b fix some bugs in the alias support, unblocking changing of "clr" aliases
from c++ hacks to proper .td InstAlias definitions.  Change them!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 07:31:43 +00:00
Chris Lattner
662e5a30e8 Reimplement BuildResultOperands to be in terms of the result instruction's
operand list instead of the operand list redundantly declared on the alias
or instruction.

With this change, we finally remove the ins/outs list on the alias.  Before:
  def : InstAlias<(outs GR16:$dst), (ins GR8 :$src),
                  "movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;
After:
  def : InstAlias<"movsx $src, $dst",
                  (MOVSX16rr8W GR16:$dst, GR8:$src)>;

This also makes the alias mechanism more general and powerful, which will
be exploited in subsequent patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 07:14:44 +00:00
Chris Lattner
3f2c8e474b implement more checking to reject things like:
(someinst GR16:$foo, GR32:$foo)

Reimplement BuildAliasOperandReference to be correctly
based on the names of operands in the result pattern,
instead of on the instruction operand definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 07:06:09 +00:00
Chris Lattner
d0f225cafc decode and validate instruction alias result definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 06:54:38 +00:00
Chris Lattner
9cdf428589 simplify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118326 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 06:45:08 +00:00
Chris Lattner
5abd1ebcb3 fix another fixme, replacing a string with a semantic pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 06:43:11 +00:00
Chris Lattner
225549f775 disolve a hack, having CodeGenInstAlias decode the alias in the .td
file instead of the asmmatcher.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06 06:39:47 +00:00
Duncan Sands
1e96bab329 In the calling convention logic, ValVT is always a legal type,
and as such can be represented by an MVT - the more complicated
EVT is not needed.  Use MVT for ValVT everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 10:49:57 +00:00
Chris Lattner
c07bd40a64 partition operand processing between aliases and instructions.
Right now the code is partitioned but the behavior is the same.
This should be improved in the near future.   This removes some
uses of TheOperandList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118232 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 02:11:18 +00:00
Chris Lattner
5f4280cd2d pull name slicing out of BuildInstructionOperandReference so
it doesn't do any lexical stuff anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 01:58:23 +00:00
Chris Lattner
ba3b5b6382 cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118228 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 01:55:23 +00:00
Chris Lattner
567820c1e0 replace SrcOpNum with SrcOpName, eliminating a numering dependency
on the incoming operand list.  This also makes the code simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 01:42:59 +00:00
Chris Lattner
0bb780c0e0 strength reduce some code, resolving a fixme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 00:57:06 +00:00
Chris Lattner
1d13bda737 take a big step to making aliases more general and less of a hack:
now matchables contain an explicit list of how to populate each
operand in the result instruction instead of having them somehow
magically be correlated to the input inst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118217 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 00:43:46 +00:00
Jim Grosbach
60aaa76196 Support generating an MC'ized CodeEmitter directly. Maintain a reference to the
Fixups list for the instruction so the operand encoders can add to it as
needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 23:38:14 +00:00
Chris Lattner
c0b14a250b rename Operand -> AsmOperand for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 19:47:34 +00:00
Duncan Sands
1440e8b918 Inside the calling convention logic LocVT is always a simple
value type, so there is no point in passing it around using
an EVT.  Use the simpler MVT everywhere.  Rather than trying
to propagate this information maximally in all the code that
using the calling convention stuff, I chose to do a mainly
low impact change instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118167 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 11:35:31 +00:00
Jim Grosbach
e6913600c7 Break ARM addrmode4 (load/store multiple base address) into its constituent
parts. Represent the operation mode as an optional operand instead.
rdar://8614429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03 01:01:43 +00:00
Chris Lattner
a1ca91af4e Completely reject instructions that have an operand in their
ins/outs list that isn't specified by their asmstring.  Previously
the asmmatcher would just force a 0 register into it, which clearly
isn't right.  Mark a bunch of ARM instructions that use this as 
isCodeGenOnly.  Some of them are clearly pseudo instructions (like
t2TBB) others use a weird hasExtraSrcRegAllocReq thing that will
either need to be removed or the asmmatcher will need to be taught
about it (someday).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 23:40:41 +00:00
Chris Lattner
d51257a436 make MatchableInfo::Validate reject instructions (like LDR_PRE in ARM)
that have complicated tying going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118112 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 23:18:43 +00:00
Chris Lattner
9b0d4bfca0 rewrite EmitConvertToMCInst to iterate over the MCInst operands,
filling them in one at a time.  Previously this iterated over the
asmoperands, which left the problem of "holes".  The new approach
simplifies things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 22:55:03 +00:00
Chris Lattner
dda855de8b merge two large parallel loops in EmitConvertToMCInst, no change
in the generated .inc files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 21:49:44 +00:00
Chris Lattner
ec6f096c36 a bunch of random cleanup, move a helper to CGT where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118031 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 18:10:06 +00:00
Jim Grosbach
ab3d00e535 Revert r114340 (improvements in Darwin function prologue/epilogue), as it broke
assumptions about stack layout. Specifically, LR must be saved next to FP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118026 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:35:25 +00:00
Chris Lattner
3b5aec67ef add and update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118025 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:34:28 +00:00
Chris Lattner
d19ec05e07 refactor/cleanup MatchableInfo by eliminating the Tokens array,
merging it into a Token field in Operand, and moving the first
token to an explicit mnemonic field.  These were parallel
arrays before (except for the mnemonic) which kept confusing me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:30:52 +00:00
Chris Lattner
3116fef7b9 rename operands -> asmoperands to be more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 01:03:43 +00:00
Jim Grosbach
cd5391965f Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 00:16:39 +00:00
Chris Lattner
e66b7ebfb4 fix computation of ambiguous instructions to not ignore the mnemonic.
FWIW, X86 has 254 ambiguous instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117979 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 23:57:23 +00:00
Chris Lattner
4c9f4e4002 give MatchableInfo::Operand a constructor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 23:08:02 +00:00
Chris Lattner
b501d4f673 Implement enough of the missing instalias support to get
aliases installed and working.  They now work when the
matched pattern and the result instruction have exactly
the same operand list.

This is now enough for us to define proper aliases for
movzx and movsx, implementing rdar://8017633 and PR7459.

Note that we do not accept instructions like:
  movzx 0(%rsp), %rsi

GAS accepts this instruction, but it doesn't make any
sense because we don't know the size of the memory
operand.  It could be 8/16/32 bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117901 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 05:34:34 +00:00
Chris Lattner
22bc5c4184 rename InstructionInfo -> MatchableInfo since it now
represents InstAliases as well.  Rename 
isAssemblerInstruction -> Validate since that is what
it does (modulo the ARM $lane hack).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 05:06:45 +00:00
Chris Lattner
c2d67bbf80 refactor initialization of InstructionInfo to be sharable between
instructions and InstAliases.  Start creating InstructionInfo's
for Aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 04:53:48 +00:00
Chris Lattner
4164f6bbbf make the asm matcher emitter reject instructions that have comments
in their asmstring.  Fix the two x86 "NOREX" instructions that have them.
If these comments are important, the instlowering stuff can print them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 04:44:29 +00:00
Chris Lattner
5bc9387806 refactor InstructionInfo to not have a pointer to CodeGenInstruction
member, and make isAssemblerInstruction() a method (pushing some code
around inside it).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 04:34:44 +00:00
Chris Lattner
c76e80ded7 define a new CodeGenInstAlias. It has an asmstring and operand list for now,
todo: the result field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 04:05:41 +00:00
Chris Lattner
c240bb0ede factor the operand list (and related fields/operations) out of
CodeGenInstruction into its own helper class.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 04:03:32 +00:00
Chris Lattner
79b3cddfa2 avoid needless throw/catch/rethrow, stringref'ize some simple stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 03:19:09 +00:00
Chris Lattner
f780811456 eliminate the old InstFormatName which is always "AsmString",
simplify CodeGenInstruction. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117891 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 02:15:23 +00:00
Chris Lattner
4a74ee7203 all predicates on an MnemonicAlias must be AssemblerPredicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 02:09:21 +00:00