1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

2102 Commits

Author SHA1 Message Date
Bob Wilson
9d8115889c 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
Jim Grosbach
ffd52cc18a Remove reference to the CMPz instruction patterns for ARM.
llvm-svn: 121180
2010-12-07 20:44:33 +00:00
Bob Wilson
8079f3377d 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
Jim Grosbach
6795da6388 Trailing whitespace.
llvm-svn: 121167
2010-12-07 19:36:07 +00:00
Jim Grosbach
142274a320 Change assert to diagnostic. Message still needs work, but it's better than
an assert, at least.

llvm-svn: 121166
2010-12-07 19:35:36 +00:00
Bob Wilson
f909f96f2b 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
6492963708 Fix whitespace.
llvm-svn: 121086
2010-12-07 01:12:19 +00:00
Jim Grosbach
2d361b9318 Add fixup for Thumb1 BL/BLX instructions.
llvm-svn: 121072
2010-12-06 23:57:07 +00:00
Bob Wilson
5917f1a762 Remove trailing whitespace.
llvm-svn: 120891
2010-12-04 04:40:15 +00:00
Bob Wilson
8015024bdf 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
Bill Wendling
01e67a2a03 I did it wrong. Don't disregard these encodings here.
llvm-svn: 120786
2010-12-03 02:25:59 +00:00
Bill Wendling
fad63b8ad2 Ignore decode table conflicts in the tMOVgpr2tgpr, tMOVgpr2gpr, and tMOVtgpr2gpr
instructions. They are handled as special moves, but encoded as a normal move.

llvm-svn: 120779
2010-12-03 01:55:30 +00:00
Bob Wilson
2e2ccbe986 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
73a62b36c6 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
a6ebc72f34 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
1410cd5668 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
1beac04144 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
59b1977d0a Add casts for splatted scalars in calls to Neon builtins.
llvm-svn: 120641
2010-12-02 01:18:23 +00:00
Bob Wilson
7680d2f36a 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
c7d49b591c Add another missing cast for Neon vcombine results.
llvm-svn: 120639
2010-12-02 01:18:18 +00:00
Bob Wilson
f01547ed73 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
d28c6da501 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
b475c5a1ff Cast scalar results of Neon macros to the correct type.
llvm-svn: 120631
2010-12-02 00:24:56 +00:00
Bob Wilson
b3f9b6c2d5 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
b2affb91cd Add some comments for TableGen's NeonEmitter.
llvm-svn: 120596
2010-12-01 19:49:56 +00:00
Bob Wilson
84b6b4c00e Cleanup: simplify checks for integers between 2 and 4.
llvm-svn: 120595
2010-12-01 19:49:51 +00:00
Jim Grosbach
b2a12afa5f 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.

llvm-svn: 120594
2010-12-01 19:47:31 +00:00
Owen Anderson
5aff471eb8 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.

llvm-svn: 120481
2010-11-30 22:45:47 +00:00
Owen Anderson
5f7b3e919b Add encoding support for Thumb2 PLD and PLI instructions.
llvm-svn: 120449
2010-11-30 19:19:31 +00:00
Jim Grosbach
7ae5c75ab7 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.

llvm-svn: 120444
2010-11-30 19:08:32 +00:00
Jim Grosbach
6a976d0827 Tidy up.
llvm-svn: 120443
2010-11-30 19:00:13 +00:00
Jim Grosbach
d79a0ce6e7 Delete a few no longer needed references to pseudos.
llvm-svn: 120441
2010-11-30 18:56:13 +00:00
Bob Wilson
f5eece615c 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.

llvm-svn: 120358
2010-11-30 00:00:42 +00:00
Jim Grosbach
89e90b7310 Pseudo-ize Thumb2 jump tables with explicit MC lowering to the raw
instructions. This simplifies instruction printing and disassembly.

llvm-svn: 120333
2010-11-29 22:37:40 +00:00
Jim Grosbach
71042b51a1 Rename t2 TBB and TBH instructions to reference that they encode the jump table
data. Next up, pseudo-izing them.

llvm-svn: 120320
2010-11-29 21:28:32 +00:00
Michael J. Spencer
4a63404543 I swear I did a make clean and make before committing all this...
llvm-svn: 120304
2010-11-29 18:47:54 +00:00
Michael J. Spencer
d5ec932c3a Merge System into Support.
llvm-svn: 120298
2010-11-29 18:16:10 +00:00
Bob Wilson
77071bcf8a Fix copy-and-paste error in exception message.
llvm-svn: 120033
2010-11-23 19:38:34 +00:00
Jason W Kim
331b7407c8 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.

llvm-svn: 119760
2010-11-18 23:37:15 +00:00
Bill Wendling
0139d909bd Give the exclamation point a name instead of a number.
llvm-svn: 119759
2010-11-18 23:36:54 +00:00
Bob Wilson
a9561a6257 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
Evan Cheng
ce610bd6b3 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

llvm-svn: 119548
2010-11-17 20:13:28 +00:00
Bill Wendling
f0a1acba8c 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.

llvm-svn: 119460
2010-11-17 04:32:08 +00:00
Bob Wilson
2f7de3aad6 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
b48fd4816a Change Neon polynomial types to be signed to match GCC.
llvm-svn: 119405
2010-11-16 23:57:03 +00:00
Bob Wilson
f2bb931c9f Refactor to new GetNumElements function.
No functional change.

llvm-svn: 119404
2010-11-16 23:57:01 +00:00
Bob Wilson
efff1285d2 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
808941eb3b 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
Bob Wilson
e1e6afe51b Revert "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
It's breaking buildbots.

llvm-svn: 119363
2010-11-16 18:43:07 +00:00
Bob Wilson
c33bc803b5 Stop using struct wrappers for Neon vector types in <arm_neon.h>.
Thanks to Nate Begeman for an earlier version of this patch.

llvm-svn: 119358
2010-11-16 18:17:03 +00:00
Bill Wendling
b450d320ec 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>

llvm-svn: 119310
2010-11-16 01:16:36 +00:00
Chris Lattner
de919e1958 pull the code to get the operand value out of the loop.
llvm-svn: 119130
2010-11-15 07:09:28 +00:00
Chris Lattner
af5f044932 split the giant encoder loop into two new helper functions.
llvm-svn: 119129
2010-11-15 06:59:17 +00:00
Chris Lattner
0812a5ee5d reduce nesting and minor cleanups, no functionality change.
llvm-svn: 119128
2010-11-15 06:42:13 +00:00
Chris Lattner
b2daeac125 add fields to the .td files unconditionally, simplifying tblgen a bit.
Switch the ARM backend to use 'let' instead of 'set' with this change.

llvm-svn: 119120
2010-11-15 05:19:05 +00:00
Jim Grosbach
cc8e5dc0c6 ARM fixup encoding for direct call instructions (BL).
llvm-svn: 118829
2010-11-11 20:05:40 +00:00
Owen Anderson
f2e9cc82db Add support for specifying a PostEncoderMethod, which can perform post-processing after the automated encoding of an instruction.
Not yet used.

llvm-svn: 118759
2010-11-11 01:19:24 +00:00
Dan Gohman
04e46fa78b Rename AccessesArguments and AccessesArgumentsReadonly, and rewrite
their comments.

llvm-svn: 118696
2010-11-10 18:30:00 +00:00
Dan Gohman
357342a9b8 Translate IntrReadArgMem to AccessesArgumentsReadonly.
llvm-svn: 118622
2010-11-09 20:07:20 +00:00
Chris Lattner
3ccd1e1530 pass literals like $$1 through to the asm matcher. This isn't right yet, but doesn't hurt.
llvm-svn: 118359
2010-11-06 22:06:03 +00:00
Chris Lattner
4834890f0a 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).

llvm-svn: 118352
2010-11-06 19:57:21 +00:00
Chris Lattner
c0e756dc47 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.

llvm-svn: 118350
2010-11-06 19:25:43 +00:00
Chris Lattner
637f4910c3 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.

llvm-svn: 118334
2010-11-06 08:20:59 +00:00
Chris Lattner
ec0ef3385d fix some bugs in the alias support, unblocking changing of "clr" aliases
from c++ hacks to proper .td InstAlias definitions.  Change them!

llvm-svn: 118330
2010-11-06 07:31:43 +00:00
Chris Lattner
5d1361e9ed 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.

llvm-svn: 118329
2010-11-06 07:14:44 +00:00
Chris Lattner
8980fe2e61 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.

llvm-svn: 118328
2010-11-06 07:06:09 +00:00
Chris Lattner
79e558f9c5 decode and validate instruction alias result definitions.
llvm-svn: 118327
2010-11-06 06:54:38 +00:00
Chris Lattner
9365c2366f simplify
llvm-svn: 118326
2010-11-06 06:45:08 +00:00
Chris Lattner
b6cc82ecd7 fix another fixme, replacing a string with a semantic pointer.
llvm-svn: 118325
2010-11-06 06:43:11 +00:00
Chris Lattner
99f3490b0c disolve a hack, having CodeGenInstAlias decode the alias in the .td
file instead of the asmmatcher.

llvm-svn: 118324
2010-11-06 06:39:47 +00:00
Duncan Sands
3bf2a701a5 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.

llvm-svn: 118245
2010-11-04 10:49:57 +00:00
Chris Lattner
a55b12911d 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.

llvm-svn: 118232
2010-11-04 02:11:18 +00:00
Chris Lattner
21179e333e pull name slicing out of BuildInstructionOperandReference so
it doesn't do any lexical stuff anymore.

llvm-svn: 118230
2010-11-04 01:58:23 +00:00
Chris Lattner
c30032c0c0 cleanups.
llvm-svn: 118228
2010-11-04 01:55:23 +00:00
Chris Lattner
fcdb263fa4 replace SrcOpNum with SrcOpName, eliminating a numering dependency
on the incoming operand list.  This also makes the code simpler.

llvm-svn: 118225
2010-11-04 01:42:59 +00:00
Chris Lattner
b0b3157619 strength reduce some code, resolving a fixme.
llvm-svn: 118219
2010-11-04 00:57:06 +00:00
Chris Lattner
9ae6cce0fe 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.

llvm-svn: 118217
2010-11-04 00:43:46 +00:00
Jim Grosbach
7426448b7c 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.

llvm-svn: 118206
2010-11-03 23:38:14 +00:00
Chris Lattner
5280a84fef rename Operand -> AsmOperand for clarity.
llvm-svn: 118190
2010-11-03 19:47:34 +00:00
Duncan Sands
f6e5e02c9b 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.

llvm-svn: 118167
2010-11-03 11:35:31 +00:00
Jim Grosbach
c10d3f3d4b Break ARM addrmode4 (load/store multiple base address) into its constituent
parts. Represent the operation mode as an optional operand instead.
rdar://8614429

llvm-svn: 118137
2010-11-03 01:01:43 +00:00
Chris Lattner
d3f7a5d3bd 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).

llvm-svn: 118119
2010-11-02 23:40:41 +00:00
Chris Lattner
76b970b846 make MatchableInfo::Validate reject instructions (like LDR_PRE in ARM)
that have complicated tying going on.

llvm-svn: 118112
2010-11-02 23:18:43 +00:00
Chris Lattner
db83b4f486 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.

llvm-svn: 118104
2010-11-02 22:55:03 +00:00
Chris Lattner
bba7ee13c0 merge two large parallel loops in EmitConvertToMCInst, no change
in the generated .inc files.

llvm-svn: 118083
2010-11-02 21:49:44 +00:00
Chris Lattner
8759d96b7a a bunch of random cleanup, move a helper to CGT where it belongs.
llvm-svn: 118031
2010-11-02 18:10:06 +00:00
Jim Grosbach
d6df785c6d Revert r114340 (improvements in Darwin function prologue/epilogue), as it broke
assumptions about stack layout. Specifically, LR must be saved next to FP.

llvm-svn: 118026
2010-11-02 17:35:25 +00:00
Chris Lattner
0ee95ca723 add and update comments.
llvm-svn: 118025
2010-11-02 17:34:28 +00:00
Chris Lattner
6f1fec971e 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.

llvm-svn: 118024
2010-11-02 17:30:52 +00:00
Chris Lattner
13ad624c70 rename operands -> asmoperands to be more descriptive.
llvm-svn: 117993
2010-11-02 01:03:43 +00:00
Jim Grosbach
0b563b9b72 Tidy up.
llvm-svn: 117987
2010-11-02 00:16:39 +00:00
Chris Lattner
032b91c666 fix computation of ambiguous instructions to not ignore the mnemonic.
FWIW, X86 has 254 ambiguous instructions.

llvm-svn: 117979
2010-11-01 23:57:23 +00:00
Chris Lattner
1bdba218ef give MatchableInfo::Operand a constructor
llvm-svn: 117968
2010-11-01 23:08:02 +00:00
Chris Lattner
81d051481e 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.

llvm-svn: 117901
2010-11-01 05:34:34 +00:00
Chris Lattner
c211fb27e2 rename InstructionInfo -> MatchableInfo since it now
represents InstAliases as well.  Rename 
isAssemblerInstruction -> Validate since that is what
it does (modulo the ARM $lane hack).

llvm-svn: 117899
2010-11-01 05:06:45 +00:00
Chris Lattner
8105d0ff81 refactor initialization of InstructionInfo to be sharable between
instructions and InstAliases.  Start creating InstructionInfo's
for Aliases.

llvm-svn: 117898
2010-11-01 04:53:48 +00:00
Chris Lattner
0a4807eefc 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.

llvm-svn: 117897
2010-11-01 04:44:29 +00:00
Chris Lattner
87c0d54fed refactor InstructionInfo to not have a pointer to CodeGenInstruction
member, and make isAssemblerInstruction() a method (pushing some code
around inside it).

llvm-svn: 117895
2010-11-01 04:34:44 +00:00
Chris Lattner
c746d18c42 define a new CodeGenInstAlias. It has an asmstring and operand list for now,
todo: the result field.

llvm-svn: 117894
2010-11-01 04:05:41 +00:00
Chris Lattner
45b1a1649c factor the operand list (and related fields/operations) out of
CodeGenInstruction into its own helper class.  No functionality change.

llvm-svn: 117893
2010-11-01 04:03:32 +00:00