1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

3237 Commits

Author SHA1 Message Date
Jim Grosbach
1ba77f9624 Tidy out asm matcher .inc output.
llvm-svn: 125408
2011-02-11 21:31:55 +00:00
NAKAMURA Takumi
80343d0f2a lit/TestFormats.py: Unittests may be found with suffix .exe also on Cygwin.
llvm-svn: 125273
2011-02-10 09:11:57 +00:00
NAKAMURA Takumi
ce0e9c3c13 lit/Util.py: On Cygwin, 'PATHEXT' may exist but it should not be used.
llvm-svn: 125272
2011-02-10 09:11:48 +00:00
Bill Wendling
bbb31e6663 Don't return before calling the post-processing function(s).
llvm-svn: 125256
2011-02-10 01:28:26 +00:00
Jim Grosbach
48e8554772 Do AsmMatcher operand classification per-opcode.
When matching operands for a candidate opcode match in the auto-generated
AsmMatcher, check each operand against the expected operand match class.
Previously, operands were classified independently of the opcode being
handled, which led to difficulties when operand match classes were
more complicated than simple subclass relationships.

llvm-svn: 125245
2011-02-10 00:08:28 +00:00
Chris Lattner
d24d190214 emit a specific error when the input file is empty. This fixes
an annoyance of mine when working on tests: if the input .ll file
is broken, opt outputs an error and generates an empty file.  FileCheck
then emits its "ooh I couldn't find the first CHECK line, scanning
from ..." which obfuscates the actual problem.

llvm-svn: 125193
2011-02-09 16:46:02 +00:00
NAKAMURA Takumi
658e08c7e9 lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).
It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane.

It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools).

llvm-svn: 125175
2011-02-09 04:19:15 +00:00
NAKAMURA Takumi
1235bd96fb lit/Util.py: Add two functions, checkToolsPath(dir,tools) and whichTools(tools,paths).
checkToolsPath(dir,tools):
return True if "dir" contains all "tools".

whichTools(tools,paths):
return a directory that contains all "tools" in "paths".
Or return None when all "tools" were not met.

llvm-svn: 125174
2011-02-09 04:19:06 +00:00
NAKAMURA Takumi
5f6161ad2c llvm-lit may be available with CMake.
llvm-svn: 125168
2011-02-09 04:18:02 +00:00
NAKAMURA Takumi
7edb109ae3 llvm-lit may be able to invoke clang tests.
llvm-svn: 125167
2011-02-09 04:17:54 +00:00
Bruno Cardoso Lopes
6ad8313c84 Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
 /* Mnemonic, Operand List Mask, Operand Class, Features */
 { "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
 { "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

 case MCK_Coproc:
   return TryParseCoprocessorOperandName(Operands);

llvm-svn: 125030
2011-02-07 19:38:32 +00:00
Daniel Dunbar
5fb9f9c756 MC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
implicitly allows custom conversions to be member functions.

llvm-svn: 124908
2011-02-04 23:17:40 +00:00
Jason W Kim
10c1a81736 Teach ARM/MC/ELF to handle R_ARM_JUMP24 relocation type for conditional jumps.
(yes, this is different from R_ARM_CALL)

- Adds a new method getARMBranchTargetOpValue() which handles the
  necessary distinction between the conditional and unconditional br/bl
  needed for ARM/ELF

At least for ARM mode, the needed fixup for conditional versus unconditional
br/bl is identical, but the ARM docs and existing ARM tools expect this
reloc type...

Added a few FIXME's for future naming fixups in ARMInstrInfo.td

llvm-svn: 124895
2011-02-04 19:47:15 +00:00
Daniel Dunbar
622bb34af8 MC/AsmParser: Add support for allowing the conversion process to fail (via
custom conversion functions).

llvm-svn: 124872
2011-02-04 17:12:23 +00:00
Daniel Dunbar
c89a150d94 MC/AsmMatcher: Add support for custom conversion functions.
llvm-svn: 124870
2011-02-04 17:12:15 +00:00
David Greene
21bfdb7527 Silence uninitialized value warnings.
llvm-svn: 124869
2011-02-04 17:01:53 +00:00
NAKAMURA Takumi
872c15ce42 Make Win32's header file name lower for cross build on case-sensitive filesystem.
llvm-svn: 124864
2011-02-04 12:53:04 +00:00
Jim Grosbach
431e5539ed Tidy up a bit.
llvm-svn: 124832
2011-02-03 23:26:36 +00:00
Oscar Fuentes
51a072b7d8 Changes for building Clang and others using LLVM as an external
library.

Installs tblgen (required by Clang).

Translates handling of user settings and platform-dependant options to
its own file, where it can included by another project.

Installs the .cmake files required by projects like Clang.

llvm-svn: 124816
2011-02-03 20:57:36 +00:00
Kevin Enderby
6c73ff04e4 Changed the TableGen created MatchInstructionImpl() setting of ErrorInfo.
The algorithm for identifying which operand is invalid will now always point to
some operand and not the mnemonic sometimes.  The change is now that ErrorInfo
is the index of the highest operand that does not match for any of the matching
mnemonics records.  And no longer the ~0U value when the mnemonic matches and
not every record with a matching mnemonic has the same mismatching operand
index.

llvm-svn: 124734
2011-02-02 18:20:55 +00:00
Devang Patel
ee65f3c2c3 Update to match changes in lldb interface.
llvm-svn: 124687
2011-02-01 21:47:35 +00:00
David Greene
e563b14e41 [AVX] Implement EnforceSmallerThan for mixed int/fp type lists. This
makes type checking for extract_subvector and insert_subvector more
robust and will allow stricter typechecking of more patterns in the
future.

This change handles int and fp as disjoint sets so that it will
enforce integer types to be smaller than the largest integer type and
fp types to be smaller than the largest fp type.  There is no attempt
to check type sizes across the int/fp sets.

llvm-svn: 124672
2011-02-01 19:12:32 +00:00
Devang Patel
3ff5f6ad2d Tidy up.
llvm-svn: 124605
2011-01-31 21:16:37 +00:00
Devang Patel
bf57c32e2e Focus on arguments for now.
llvm-svn: 124604
2011-01-31 21:15:39 +00:00
Bob Wilson
0b0692bd8d Fix a comment typo.
llvm-svn: 124450
2011-01-27 23:08:52 +00:00
Douglas Gregor
8d44712818 Clang: separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior.
llvm-svn: 124440
2011-01-27 21:06:17 +00:00
Bob Wilson
e93c1add9e Add a MnemonicIsValid method to the asm matcher.
Patch by Bill Wendling.

llvm-svn: 124328
2011-01-26 21:43:46 +00:00
Bob Wilson
6675dea05d Fix spelling of CouldMatchAmbiguouslyWith method name.
llvm-svn: 124324
2011-01-26 21:26:21 +00:00
Bob Wilson
397316f33a Whitespace and 80-column fixes.
llvm-svn: 124323
2011-01-26 21:26:19 +00:00
Bob Wilson
6850ea9790 Improve the AsmMatcher's ability to handle suboperands.
When an operand class is defined with MIOperandInfo set to a list of
suboperands, the AsmMatcher has so far required that operand to also define
a custom ParserMatchClass, and InstAlias patterns have not been able to
set the individual suboperands separately.  This patch removes both of those
restrictions.  If a "compound" operand does not override the default
ParserMatchClass, then the AsmMatcher will now parse its suboperands
separately.  If an InstAlias operand has the same class as the corresponding
compound operand, then it will be handled as before; but if that check fails,
TableGen will now try to match up a sequence of InstAlias operands with the
corresponding suboperands.

llvm-svn: 124314
2011-01-26 19:44:55 +00:00
Devang Patel
fab4616981 - Do not try to print nameless variable's info.
- Print a summary of breakpoints in the beginning.

llvm-svn: 124308
2011-01-26 19:14:14 +00:00
NAKAMURA Takumi
a2cf7854a1 TableGen: PointerLikeRegClass can be accepted to operand.
llvm-svn: 124271
2011-01-26 02:03:48 +00:00
NAKAMURA Takumi
066378440a Fix whitespace.
llvm-svn: 124270
2011-01-26 02:03:37 +00:00
Daniel Dunbar
c07888ef8d tblgen/AsmMatcherEmitter: Fix alias handling to honor -match-prefix.
llvm-svn: 124154
2011-01-24 23:26:31 +00:00
David Greene
1c4fa5e643 [AVX] Add type checking support for vector/subvector type constraints.
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode.  INSERT_SUBVECTOR in turn is very useful for
matching to VINSERTF128 instructions and complements the already
existing EXTRACT_SUBVECTOR SDNode.

llvm-svn: 124145
2011-01-24 20:53:18 +00:00
Bill Wendling
85fb50d56c ARM uses '.' in their tokens. Give it a name instead of a numeric value.
llvm-svn: 124026
2011-01-22 09:44:32 +00:00
Peter Collingbourne
0f816f75d0 tblgen: Add support for non-inheritable attributes
This patch makes the necessary changes to TableGen to support
non-inheritable attributes.

llvm-svn: 123958
2011-01-21 02:08:26 +00:00
Bob Wilson
959aad8197 Move InstAlias check of argument types to a separate loop.
llvm-svn: 123934
2011-01-20 18:38:10 +00:00
Bob Wilson
7c1ca31c1d Tidy comment.
llvm-svn: 123933
2011-01-20 18:38:07 +00:00
Bob Wilson
d178f6d009 Fix broken check for InstAlias argument used with different types.
llvm-svn: 123932
2011-01-20 18:38:05 +00:00
Bob Wilson
a234847b58 Precompute InstAlias operand mapping to result instruction operand indices.
There should be no functional change from this, but I think it's simpler this
way.

llvm-svn: 123931
2011-01-20 18:38:02 +00:00
Douglas Gregor
8a1c4fd8ce Fix comment for gen-clang-decl-nodes tblgen backend, from Michael Han
llvm-svn: 123833
2011-01-19 15:57:47 +00:00
Owen Anderson
ed4acd59cb When matching asm operands, always try to match the most restricted type first.
Unfortunately, while this is the "right" thing to do, it breaks some ARM
asm parsing tests because MemMode5 and ThumbMemModeReg are ambiguous.  This
is tricky to resolve since neither is a subset of the other.

XFAIL the test for now.  The old way was broken in other ways, just ways
we didn't happen to be testing, and our ARM asm parsing is going to require
significant revisiting at a later point anyways.

llvm-svn: 123786
2011-01-18 23:01:21 +00:00
Bruno Cardoso Lopes
94247155c4 Add support for parsing and encoding ARM's official syntax for the BFI instruction
llvm-svn: 123770
2011-01-18 20:45:56 +00:00
Daniel Dunbar
b8debfe450 Formatting tweak.
llvm-svn: 123718
2011-01-18 01:59:30 +00:00
Bob Wilson
8ca3bc94ca Fix some tablegen issues to allow using zero_reg for InstAlias definitions.
This is needed to allow an InstAlias for an instruction with an "OptionalDef"
result register (like ARM's cc_out) where you want to set the optional register
to reg0.

llvm-svn: 123490
2011-01-14 22:58:09 +00:00
Owen Anderson
18dfab2332 Add support to the ARM MC infrastructure to support mcr and friends. This requires supporting
the symbolic immediate names used for these instructions, fixing their pretty-printers, and
adding proper encoding information for them.

With this, we can properly pretty-print and encode assembly like:
	mrc p15, #0, r3, c13, c0, #3

Fixes <rdar://problem/8857858>.

llvm-svn: 123404
2011-01-13 21:46:02 +00:00
Evan Cheng
cc474b4864 Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a step
in the right direction. It eliminated some hacks and will unblock codegen
work. But it's far from being done. It doesn't reject illegal expressions,
e.g. (FOO - :lower16:BAR). It also doesn't work in Thumb2 mode at all.

llvm-svn: 123369
2011-01-13 07:58:56 +00:00
Daniel Dunbar
f14e43062c McARM: Write a silly Python script to compute some hard coded info from the
generated ARM match table, which is substantially more efficient than dealing
with tblgen.

llvm-svn: 123252
2011-01-11 19:06:26 +00:00
Daniel Dunbar
719295c2e2 MC/AsmMatcher: Fix indirect 80-col viola.
llvm-svn: 123174
2011-01-10 15:26:11 +00:00
Francois Pichet
2094592a6f On Windows, replace each occurrence of '\' by '\\' on the replacement string. This is necessary to prevent re.sub from replacing escape sequences occurring in path.
For example:

llvm\tools\clang\test
was replaced by
llvm <tab> ools\clang <tab> est

llvm-svn: 123070
2011-01-08 18:09:48 +00:00
Eric Christopher
4580fc9a0d I don't think I could find a 10.2.x box if I tried.
llvm-svn: 123051
2011-01-08 01:52:20 +00:00
Bob Wilson
4e879f0f00 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
David Greene
e9b2fb7e0d Rename lisp-like functions as suggested by Gabor Greif as loooong time
ago.  This is both easier to learn and easier to read.

llvm-svn: 123001
2011-01-07 17:05:37 +00:00
Francois Pichet
7b62eeaf56 Disable r122754 on Windows: was causing all lit tests to fail.
llvm-svn: 122808
2011-01-04 10:23:42 +00:00
David Greene
124695aed0 Reapply 122341 to fix PR8199 now that clang changes are in.
llvm-svn: 122754
2011-01-03 17:30:25 +00:00
Jim Grosbach
ad1b872c44 Trailing whitespace.
llvm-svn: 122542
2010-12-24 05:06:32 +00:00
Chris Lattner
01e8c46349 Flag -> Glue, the ongoing saga
llvm-svn: 122513
2010-12-23 18:28:41 +00:00
Chris Lattner
b607e7deda flags -> glue for selectiondag
llvm-svn: 122509
2010-12-23 17:24:32 +00:00
Chris Lattner
fb9ff7a4ff sdisel flag -> glue.
llvm-svn: 122507
2010-12-23 17:13:18 +00:00
Chris Lattner
15e8133b87 continue renaming flag -> glue.
llvm-svn: 122506
2010-12-23 17:03:20 +00:00
Jeffrey Yasskin
a199652a3e Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.

llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Bill Wendling
f897a6bb16 Default to armv7 instead of armv6.
llvm-svn: 122457
2010-12-23 00:49:18 +00:00
David Greene
33a91c0c9a Revert 122341. It breaks some darwin tests.
llvm-svn: 122346
2010-12-21 17:25:43 +00:00
David Greene
28140b5288 Fix PR 8199. This patch prepends the build tool dir to LLVM programs
being tested.  This ensures that we test the tools just built and not
some random tools that might happen to be in the user's PATH.  This
makes LLVM testing much more stable and predictable.

llvm-svn: 122341
2010-12-21 16:55:53 +00:00
Jim Grosbach
fda5c187d6 Tidy up a bit. Trailing whitespace, hard tabs and 80-columns.
llvm-svn: 122337
2010-12-21 16:16:00 +00:00
Chris Lattner
65c5243bd6 rename MVT::Flag to MVT::Glue. "Flag" is a terrible name for
something that just glues two nodes together, even if it is
sometimes used for flags.

llvm-svn: 122310
2010-12-21 02:38:05 +00:00
Michael J. Spencer
4701f704be Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
llvm-svn: 122157
2010-12-18 22:23:07 +00:00
Owen Anderson
7103acd18e Revert r122143 through r122140, which collectively broke the LLVMC tests on
the buildbots.

llvm-svn: 122149
2010-12-18 07:37:18 +00:00
Michael J. Spencer
6d64a36ced Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
llvm-svn: 122141
2010-12-18 04:13:36 +00:00
Bob Wilson
8d93d7b4fd Neon intrinsic tests need to be compiled for Cortex-A9 for f16 support.
llvm-svn: 122015
2010-12-17 01:21:03 +00:00
Michael J. Spencer
86f6a9ac6e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
2010-12-16 03:29:14 +00:00
Bob Wilson
7e64a19960 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
3e4aa8ec69 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
114df2f88a 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
Chris Lattner
e1ee3c537d various cleanups to tblgen, patch by Garrison Venn!
llvm-svn: 121837
2010-12-15 04:48:22 +00:00
Mikhail Glushenkov
2e471b81da llvmc: make switch options ZeroOrMore by default.
llvm-svn: 121822
2010-12-15 01:21:59 +00:00
Jakob Stoklund Olesen
22ff831572 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.

llvm-svn: 121800
2010-12-14 23:03:42 +00:00
Jim Grosbach
1e943cc60d Add support for MC-ized encoding of tLEApcrel and tLEApcrelJT. rdar://8755755
llvm-svn: 121798
2010-12-14 22:28:03 +00:00
Bill Wendling
61720b79f9 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.

llvm-svn: 121747
2010-12-14 03:36:38 +00:00
Owen Anderson
c84f8c23b3 Second attempt at make Thumb2 LEAs pseudos. This time, perform the lowering much later, which makes the entire
process cleaner.

llvm-svn: 121735
2010-12-14 00:36:49 +00:00
Bob Wilson
33e5e902b0 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.

llvm-svn: 121730
2010-12-13 23:02:37 +00:00
Owen Anderson
af1dde2673 Revert r121721, which broke buildbots.
llvm-svn: 121726
2010-12-13 22:51:08 +00:00
Owen Anderson
c298c8ed4d 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.

llvm-svn: 121721
2010-12-13 22:29:52 +00:00
Owen Anderson
4ec912b842 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.

llvm-svn: 121710
2010-12-13 19:31:11 +00:00
Bill Wendling
16e7d7bf2f 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'.

llvm-svn: 121666
2010-12-13 01:46:19 +00:00
Bill Wendling
ea9c4c1e11 Move <map> include out of .h and into .cpp.
llvm-svn: 121661
2010-12-13 01:05:54 +00:00
Bill Wendling
1b8163a33e Merge DEBUG statements.
llvm-svn: 121660
2010-12-13 01:03:49 +00:00
Chris Lattner
8e4bbafeb3 eliminate the Records global variable, patch by Garrison Venn!
llvm-svn: 121659
2010-12-13 00:23:57 +00:00
Chris Lattner
5e7e7c817c clean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!
llvm-svn: 121658
2010-12-13 00:20:52 +00:00
Bill Wendling
59f4c83400 Get rid of ellipses.
llvm-svn: 121589
2010-12-10 22:54:30 +00:00
Jim Grosbach
a378c43eae Thumb unconditional branch binary encoding. rdar://8754994
llvm-svn: 121496
2010-12-10 18:21:33 +00:00
Jim Grosbach
905301a7d8 Thumb conditional branch binary encodings. rdar://8745367
llvm-svn: 121493
2010-12-10 17:13:40 +00:00
Bob Wilson
f99cd09e3f The Neon vqdmlsl_lane and vqdmlal_lane intrinsics have 4 arguments, not 3.
llvm-svn: 121469
2010-12-10 06:37:53 +00:00
Devang Patel
769b99c4a5 Add initial support to measure local variables.
llvm-svn: 121428
2010-12-09 23:18:58 +00:00
Jim Grosbach
57d420438a Thumb needs a few different encoding schemes for branch targets. Rename
t_brtarget to be more specific.

llvm-svn: 121398
2010-12-09 19:01:46 +00:00
Bob Wilson
3c35e2ab2f 80-column fixes.
llvm-svn: 121395
2010-12-09 18:43:35 +00:00
Bob Wilson
bd5b0c9ec6 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
Michael J. Spencer
b38d1766d6 Missed FileUpdate because CMake doesn't build it yet :(.
llvm-svn: 121385
2010-12-09 17:48:55 +00:00
Michael J. Spencer
15483143ec Support/MemoryBuffer: Replace all uses of std::string *ErrMsg with error_code &ec. And fix clients.
llvm-svn: 121379
2010-12-09 17:36:48 +00:00
Bill Wendling
cd8fdfd65f 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.

llvm-svn: 121336
2010-12-09 00:39:08 +00:00
Bill Wendling
9756f7c7b0 Support the "target" encodings for the CB[N]Z instructions.
llvm-svn: 121308
2010-12-08 23:01:43 +00:00
Bob Wilson
8c693a934a 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
b258f6e80b 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
368438b3ac Remove unused function parameter.
llvm-svn: 121286
2010-12-08 21:39:00 +00:00
Bob Wilson
9cb69260e2 Add an operator for vaba so it can be implemented using vabd.
llvm-svn: 121276
2010-12-08 20:09:10 +00:00
Bill Wendling
24e6d5a4f2 Use this new fangled StringSwitch technology.
llvm-svn: 121273
2010-12-08 20:02:49 +00:00
Bill Wendling
3e1be94d7e Cleanup table a bit.
llvm-svn: 121250
2010-12-08 13:03:15 +00:00
Bill Wendling
dac1f24d98 Add support for loading from a constant pool.
llvm-svn: 121226
2010-12-08 01:57:09 +00:00
Bob Wilson
dd1d9cf3b6 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
937fe73ee2 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
8182bc40cd 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
Jim Grosbach
f3557afc0f Add source Record* reference to PatternToMatch. Allows better diagnostics.
llvm-svn: 121196
2010-12-07 23:05:49 +00:00
Bob Wilson
93b8add7dd 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
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
Devang Patel
3d49ec3ae7 Handle recursive values. Add comments.
llvm-svn: 121184
2010-12-07 21:12:05 +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
NAKAMURA Takumi
0413f5e1cb utils/lit/lit/TestFormats.py: [PR8438] unittests: Seek *Tests (not BUILD_MODE/*Tests) under whole unittests/ if BUILD_MODE == '.'
llvm-svn: 121118
2010-12-07 07:41:32 +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
Devang Patel
7a95053a98 Add python scripts to extract debug info using LLDB and do comparison.
llvm-svn: 121079
2010-12-07 00:34:59 +00:00
Jim Grosbach
2d361b9318 Add fixup for Thumb1 BL/BLX instructions.
llvm-svn: 121072
2010-12-06 23:57:07 +00:00
Michael J. Spencer
68b70b5024 KillTheDoctor: Cleanup error_code usage.
llvm-svn: 120986
2010-12-06 04:28:01 +00:00
Michael J. Spencer
51890f109f KillTheDoctor: Fix spelling.
llvm-svn: 120985
2010-12-06 04:27:52 +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