Commit Graph

3688 Commits

Author SHA1 Message Date
Eric Christopher
721ef66d17 Invert the meaning of printAliasInstr's return value. It now returns
true on success and false on failure. Update callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129722 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 21:28:11 +00:00
Owen Anderson
57557155c9 Enhance the fixed-length disassembler to support the callbacks necessary for symbolic disassembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 18:42:26 +00:00
Chris Lattner
202a7a1e3f Add a new bit that ImmLeaf's can opt into, which allows them to duck out of
the generated FastISel.  X86 doesn't need to generate code to match ADD16ri8 
since ADD16ri will do just fine.  This is a small codesize win in the generated
instruction selector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129692 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 06:36:55 +00:00
Chris Lattner
1518afddea Implement major new fastisel functionality: the matcher can now handle immediates with
value constraints on them (when defined as ImmLeaf's).  This is particularly important
for X86-64, where almost all reg/imm instructions take a i64immSExt32 immediate operand,
which has a value constraint.  Before this patch we ended up iseling the examples into
such amazing code as:

	movabsq	$7, %rax
	imulq	%rax, %rdi
	movq	%rdi, %rax
	ret

now we produce:

	imulq	$7, %rdi, %rax
	ret

This dramatically shrinks the generated code at -O0 on x86-64.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129691 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 06:22:33 +00:00
Chris Lattner
9bfd5f3b22 introduce a new OpKind abstraction which wraps up operand flavors in a tidy little wrapper.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 23:29:05 +00:00
Chris Lattner
a90dbc133f change OperandsSignature to use SmallVector<char> instead of std::vector<string>
since the strings are always exactly one character, and there are usually only 2-3 operands.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129678 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 22:24:13 +00:00
Chris Lattner
4447d6506c since the VT is fixed for a ImmLeaf, there is no reason to expose it to the matching code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129677 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 22:17:27 +00:00
Chris Lattner
7ed1391ff6 now that predicates have a decent abstraction layer on them, introduce a new
kind of predicate: one that is specific to imm nodes.  The predicate function
specified here just checks an int64_t directly instead of messing around with
SDNode's.  The virtue of this is that it means that fastisel and other things
can reason about these predicates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129675 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 22:05:17 +00:00
Chris Lattner
543790673c Rework our internal representation of node predicates to expose more
structure and fix some fixmes.  We now have a TreePredicateFn class
that handles all of the decoding of these things.  This is an internal
cleanup that has no impact on the code generated by tblgen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 21:38:24 +00:00
Chris Lattner
461cd70311 remove some debugging code I added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 21:36:19 +00:00
Chris Lattner
602fc06817 1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.ll
2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts
3. teach tblgen to handle shift immediates that are different sizes than the 
   shifted operands, eliminating some code from the X86 fast isel backend.
4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function
   instead of FastEmit_ri to simplify code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-17 20:23:29 +00:00
Douglas Gregor
4954e9f2d9 Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129613 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 22:04:07 +00:00
Evan Cheng
b6a638898a Increase SubtargetFeatureKV Value and Implies fields to 64 bits since some targets are getting very close to 32 subtarget features. Also teach tablegen to error when there are more than 64 features to guard against undefined behavior. rdar://9282332
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 19:35:46 +00:00
Chris Lattner
7a2bdde0a0 Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-15 05:18:47 +00:00
Bill Wendling
eef965f04b Add an option to not print the alias of an instruction. It defaults to "print
the alias".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13 23:36:21 +00:00
Johnny Chen
de16508955 Thumb disassembler was erroneously rejecting "blx sp" instruction.
rdar://problem/9267838


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 23:33:30 +00:00
NAKAMURA Takumi
bd2907356d TableGen: Keep the order of DECL_CONTEXT() for DeclNodes.td. RecordVector may be used instead of RecordSet.
The result of DeclNodes.inc was unstable on msys, Windows 7 x64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129317 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 23:20:28 +00:00
Daniel Dunbar
58194307c1 build: Add support for a SHOW_DIAGNOSTICS build variable.
If enabled, this will attempt to use the CC_LOG_DIAGNOSTICS feature I dropped
into Clang to print a log of all the diagnostics generated during an individual
build (from the top-level). Not sure if this will actually be useful, but for
now it is handy for testing the option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-11 22:37:39 +00:00
Chris Lattner
42e31dfd4f fix PR9629 - We were lowering regexes like a{{b|c}}d into ab|cd, which
is substantially different than a(b|c)d.  Form the latter regex instead.
This found a few problems in the testsuite, which serves as its test.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129196 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:37:03 +00:00
Chris Lattner
13a38c4cb4 various cleanups, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129192 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-09 06:18:02 +00:00
Bill Wendling
dd099e1e55 Only emit the AvailableFeatures variable if it's used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 04:08:57 +00:00
Bill Wendling
44dcfd3625 Replace the old algorithm that emitted the "print the alias for an instruction"
with the newer, cleaner model. It uses the IAPrinter class to hold the
information that is needed to match an instruction with its alias. This also
takes into account the available features of the platform.

There is one bit of ugliness. The way the logic determines if a pattern is
unique is O(N**2), which is gross. But in reality, the number of items it's
checking against isn't large. So while it's N**2, it shouldn't be a massive time
sink.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-07 21:20:06 +00:00
Joerg Sonnenberger
4a8ac8de1d Add support for the VIA PadLock instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128826 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 16:58:13 +00:00
Joerg Sonnenberger
39d7caea69 Use array_lengthof
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128823 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 16:25:38 +00:00
Joerg Sonnenberger
db37e40723 Change loops to derive the number of tables automatically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128818 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 14:42:22 +00:00
Daniel Dunbar
27b83d4ff2 tlbgen/MC: StringRef's to temporary objects considered harmful.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128735 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 20:23:52 +00:00
Andrew Trick
234823297e Add annotations to tablegen-generated processor itineraries, or replace them with something meaningful. I want to be able to read and debug the generated tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128703 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 02:22:47 +00:00
Andrew Trick
da96cf2029 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128701 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-01 01:56:55 +00:00
Nick Lewycky
9cdf388d26 Fix typo in generated HTML.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128594 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 00:23:57 +00:00
Bob Wilson
bbe7c65390 Use intrinsics for Neon vmull operations. Radar 9208957.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128591 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-31 00:09:35 +00:00
Argyrios Kyrtzidis
4e082a934b ClangSAEmClangSACheckersEmitter, emit info about groups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-30 00:22:00 +00:00
Matt Beaumont-Gay
471232884a Quiet a gcc warning about changed name lookup rules
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128497 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 22:25:36 +00:00
Argyrios Kyrtzidis
3d09055851 In ClangSACheckersEmitter:
- Also emit a list of packages and groups sorted by name
  - Avoid iterating over DenseSet so that the output of the arrays is deterministic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 21:16:19 +00:00
Argyrios Kyrtzidis
9993a38583 For ClangSACheckersEmitter, allow a package to belong to checker group, in which all its checkers will go into the group.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-29 18:53:00 +00:00
Devang Patel
e4f3ca4a66 Remove scripts used by TEST=dbg from here. They now live inside llvm test suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128425 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-28 20:28:30 +00:00
Duncan Sands
f0bf9dfc1f Partially revert commit 127155: I think it is much more convenient
to have structured log files rather than one big file produced by
piping output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-27 13:52:32 +00:00
Douglas Gregor
32ce3f944d Extend Clang's TableGen emitter for attributes to support bool arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-26 03:40:01 +00:00
Duncan Sands
067e2e2adb Useful script for finding regressions in the nightly testsuite.
I think it was written by Pawel Worach.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-25 07:17:44 +00:00
Johnny Chen
ef74e9ab40 delegate the disassembly of t2ADR to the more generic t2ADDri12/t2SUBri12 instructions, and add a test case for that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128249 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-25 00:17:42 +00:00
Johnny Chen
8c13335c9a The opcode names ("tLDM", "tLDM_UPD") used for conflict resolution have been stale since
the change to ("tLDMIA", "tLDMIA_UPD").  Update the conflict resolution code and add
test cases for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128247 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 23:42:31 +00:00
Johnny Chen
1090d7711b The ARM disassembler was confused with the 16-bit tSTMIA instruction.
According to A8.6.189 STM/STMIA/STMEA (Encoding T1), there's only tSTMIA_UPD available.
Ignore tSTMIA for the decoder emitter and add a test case for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 23:21:14 +00:00
Bruno Cardoso Lopes
505f3cd296 Add asm parsing support w/ testcases for strex/ldrex family of instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 21:04:58 +00:00
Johnny Chen
e6d69e7dbe ADR was added with the wrong encoding for inst{24-21}, and the ARM decoder was fooled.
Set the encoding bits to {0,?,?,0}, not 0.  Plus delegate the disassembly of ADR to
the more generic ADDri/SUBri instructions, and add a test case for that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128234 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-24 20:42:48 +00:00
Douglas Gregor
095a3f3d30 Update the Clang attribute emitter to handle attributes of 'version'
kind, and fix serialization/deserialization of IdentifierInfo
attributes. These are requires for the new 'availability' attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 01:05:46 +00:00
Bill Wendling
8a77af8eac Call static functions so that they aren't left unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128020 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 21:08:27 +00:00
Bill Wendling
3ce1b7d514 A WIP commit of the InstAlias printing cleanup. This code will soon replace the
code below it. Even though it looks very similar, it will match more precisely
and geneate better functions in the long run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127991 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 08:59:17 +00:00
Bill Wendling
4962e61431 Add the IAPrinter class.
This is a helper class that will make it easier to say which InstAliases can be
printed and which cannot (because of ambiguity).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 08:40:31 +00:00
Bill Wendling
2cf6fc6857 * Add classes that support the "feature" information.
* Move the code that emits the reg in reg class matching into its own function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 08:31:53 +00:00
Owen Anderson
c9bd496aa2 Thumb2 PC-relative loads require a fixup rather than just an immediate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127888 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 17:42:55 +00:00
NAKAMURA Takumi
d4f4e6ee2c raw_ostream: [PR6745] Tweak formatting (double)%e for Windows hosts.
On MSVCRT and compatible, output of %e is incompatible to Posix by default. Number of exponent digits should be at least 2. "%+03d"

FIXME: Implement our formatter in future!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127872 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-18 09:30:10 +00:00
NAKAMURA Takumi
8ea2649fda lit/ProgressBar.py: [PR7919] Improve line wrap for XN-incapable terminals.
On Win32 console, emitting char to col#79 causes linefeed, and the cursor will not return to col#79 upper line with backspace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127696 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-15 21:07:44 +00:00
Evan Cheng
0f040a258f - Add "Bitcast" target instruction property for instructions which perform
nothing more than a bitcast.
- Teach tablegen to automatically infer "Bitcast" property.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-15 05:09:26 +00:00
Sean Callanan
a21e2eae3d X86 table-generator and disassembler support for the AVX
instruction set.  This code adds support for the VEX prefix
and for the YMM registers accessible on AVX-enabled
architectures.  Instruction table support that enables AVX
instructions for the disassembler is in an upcoming patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-15 01:23:15 +00:00
Owen Anderson
4dd27ebcc2 Ignore isCodeGenOnly instructions when generating diassembly tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-14 20:58:49 +00:00
Jim Grosbach
0c4d44aa7a Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127592 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-14 17:32:49 +00:00
Francois Pichet
606957fdd6 Correct small comment order typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127575 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-14 02:30:32 +00:00
Jim Grosbach
7d3a16a6f8 Remove no-longer-correct special case for disasm of ARM BL instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127517 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-12 01:05:29 +00:00
Jim Grosbach
72422d38ba Pseudo-ize the ARM 'B' instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 23:24:15 +00:00
Jim Grosbach
3c5edaaf59 Remove dead code. These ARM instruction definitions no longer exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127509 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 23:15:02 +00:00
Jim Grosbach
5380bbf606 Remove dead code. These ARM instruction definitions no longer exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127508 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 23:11:41 +00:00
Jim Grosbach
f219f3135d Pseudo-ize VMOVDcc and VMOVScc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127506 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 23:09:50 +00:00
Jim Grosbach
b9cf5f8763 Remove dead code. These ARM instruction definitions don't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127491 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:51:07 +00:00
Jim Grosbach
958108ad14 ARM VDUPfd and VDUPfq can just be patterns. The instruction is the same
as for VDUP32d and VDUP32q, respectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:44:08 +00:00
Jim Grosbach
81bb6551e6 Remove dead code. These ARM instruction definitions don't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127488 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:38:18 +00:00
Jim Grosbach
8b8515c225 ARM VDUPLNfq and VDUPLNfd definitions can just be Pat<>s for VDUPLN32q
and VDUPLN32d, respectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127486 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:31:17 +00:00
Jim Grosbach
1558df79b4 ARM VREV64df and VREV64qf can just be patterns. The instruction is the same
as for VREV64d32 and VREV64q32, respectively.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127485 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 20:18:05 +00:00
Jim Grosbach
6a44adade2 Add missing 'return on failure'. Previously we'd crash after emitting
the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127480 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 19:52:52 +00:00
Jim Grosbach
4a6d735105 Teach TableGen to pre-calculate register enum values when creating the
CodeGenRegister entries. Use this information to more intelligently build
the literal register entires in the DAGISel matcher table. Specifically,
use a single-byte OPC_EmitRegister entry for registers with a value of
less than 256 and OPC_EmitRegister2 entry for registers with a larger value.

rdar://9066491



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127456 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 02:19:02 +00:00
Jim Grosbach
17fad045cc Make the register enum value part of the CodeGenRegister struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127448 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 01:33:54 +00:00
Jim Grosbach
510207cb1e Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127447 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 01:27:24 +00:00
Jim Grosbach
5d4314ef72 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 01:19:05 +00:00
Jim Grosbach
7e0e82dcd5 Tidy up since ARM MOVCCi and MOVCCi16 are now pseudos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127445 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-11 01:16:49 +00:00
Jim Grosbach
d4a16ad85d Properly pseudo-ize MOVCCr and MOVCCs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127434 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 23:56:09 +00:00
Jim Grosbach
5e97338c8d Memory barrier instructions don't need special handling in tblgen anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127419 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-10 19:05:48 +00:00
Stuart Hastings
4cdcb36289 Stop building PPC parts on OSX. Radar 8637926.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127262 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 19:28:28 +00:00
NAKAMURA Takumi
78a8295146 Use $(ECHOPATH) to make llvm-lit from llvm-lit.in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127240 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 12:25:19 +00:00
Bill Wendling
38e1f88db4 Don't show commands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127224 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-08 08:34:49 +00:00
Bill Wendling
3116dce338 Rename the narrow shift right immediate operands to "shr_imm*" operands. Also
expand the testing of the narrowing shift right instructions.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-07 23:38:41 +00:00
Bill Wendling
e7e9a60df6 Don't keep the log files around. Just pipe to a log file instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-07 07:37:37 +00:00
Jakob Stoklund Olesen
7cefa640de Revert r127073: "Introduce $(ECHOPATH) to print DOSish path string on MSYS bash for alternative of $(ECHO)."
It broke the llvm-gcc-native-mingw32 buildbot, and we need all of them to be green for the 2.9 branch.

Takumi, please reapply after we branch, preferably with a fix ;-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 18:55:06 +00:00
NAKAMURA Takumi
9869c2f717 utils/lit/lit/TestRunner.py: bash is available with MSYS on Python/W32. Then we can execute "bash tests".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127074 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 09:46:53 +00:00
NAKAMURA Takumi
0c3ed6b046 Introduce $(ECHOPATH) to print DOSish path string on MSYS bash for alternative of $(ECHO).
On mingw and python/w32, lit would not be expected to understand MSYS-style path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 09:46:45 +00:00
NAKAMURA Takumi
2f017cb7f3 On Windows hosts, Python scripts in test/Scripts did not accept binary files from stdin. The environment variable "PYTHONUNBUFFERED" makes stdin as binary. Thanks to Danil Malyshev!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 09:46:36 +00:00
David Greene
b1939d5db6 Fix the case where the number of jobs is less than the
number of threads.  In that case make the number of threads
equal to the number of jobs and launch one jobs on each
thread.  This makes things work like make -j.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-04 23:02:52 +00:00
Bob Wilson
1473f35c47 TableGen should not ignore BX instructions for the ARM disassembler. pr9368.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 07:19:52 +00:00
Bob Wilson
181d3fe727 pr9367: Add missing predicated BLX instructions.
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-03 01:41:01 +00:00
John McCall
9977e521a6 Teach the clang attribute emitter about InheritableParamAttr.
Intended to be atomic with clang r126828.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 04:00:52 +00:00
Oscar Fuentes
9bf9aa5106 Fixes warnings emitted by Visual Studio 2010 compiler.
Patch by Erik Olofsson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 23:11:57 +00:00
Jim Grosbach
9d40193d79 trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126733 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:39:05 +00:00
Jim Grosbach
2d76c84514 Generalize the register matching code in DAGISel a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126731 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:37:19 +00:00
Bill Wendling
a656b63ee4 Narrow right shifts need to encode their immediates differently from a normal
shift.

   16-bit: imm6<5:3> = '001', 8 - <imm> is encded in imm6<2:0>
   32-bit: imm6<5:4> = '01',16 - <imm> is encded in imm6<3:0>
   64-bit: imm6<5> = '1', 32 - <imm> is encded in imm6<4:0>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126723 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 01:00:59 +00:00
NAKAMURA Takumi
ec58f20df3 Don't install libUnitTestMain.a. It might be useless without gtest headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126632 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 05:18:07 +00:00
Bill Wendling
7520e3a2b5 A new TableGen feature! (Not turned on just yet.)
InstAlias<{alias}, {aliasee}>;

The InstAlias instruction should be able to go from the MCInst to the
{alias}. All of the information is there to match the MCInst with the
{aliasee}. From there, it's a simple matter to emit the {alias}, with the
correct operands from the {aliasee}.

The code this patch generates can be used by the InstPrinter to automatically
print out the alias without having to write special C++ code to handle the
situation.

This is a WIP, and therefore are several limitations. For instance, it cannot
handle AsmOperands at the moment. It also doesn't know what to do when two
{alias}es match the same {aliasee}. (Currently, it just ignores those two cases
and allows the printInstruction method to handle them.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126538 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-26 03:09:12 +00:00
Bob Wilson
e1b5aa7d86 Removed unnecessary dylibs from Apple builds, with or without "lib" prefix.
Radar 9056686

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126534 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-26 00:22:17 +00:00
Bob Wilson
005c51ddc7 Add a new "Embedded" makefile target for Apple-style builds.
This one just installs the default build into a different destination directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126533 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 23:42:03 +00:00
Stuart Hastings
186e2509fd Fix bad comment marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 22:47:58 +00:00
David Greene
14a129a3cf Add some options for building LLVM in different environments:
--force-configure to force running configure before building.

--extra-llvm-config-flags
--extra-llvm-gcc-config-flags
--extra-gcc-config-flags

Pass additional argument to the various configure invocations.

This also eliminates a default build flavor because explicitly
specifying builds could result in build flavors being run repeatedly.

Finally, turn off fortran builds for the moment because install
appears to be broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126510 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 20:51:27 +00:00
Stuart Hastings
539f817e34 Omit lto.h from the llvmCore result; henceforth, this will be supplied
by clang.  Radar 9042056.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126507 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 20:42:39 +00:00
Argyrios Kyrtzidis
8bef800aaa In utils/TableGen/ClangSACheckersEmitter.cpp, set the 'Hidden' bit for checkers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:33:49 +00:00
David Greene
8b890c2f7d Fix Builder::execute() to more properly pass the desired environment
to tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 23:30:45 +00:00
Cameron Zwarich
43dd06ad20 Eliminate valgrind warnings from Python on the 32-bit as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 01:00:10 +00:00
Rafael Espindola
87ca0e077d Implement xgetbv and xsetbv.
Patch by Jai Menon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:35:18 +00:00
David Greene
8b8b4af404 Add a convenience tool for doing comparison builds of the LLVM
ecosystem.  This is a handy utility for checking changes before
committing them to the repository.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126136 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 19:23:22 +00:00
Oscar Fuentes
0b85d07d46 Put targets on folders, if the IDE supports the feature.
Requires CMake 2.8.3 or newer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 22:06:10 +00:00
Cameron Zwarich
17dce36774 Try to fix the MC/AsmParser/section.s failure on the llvm-x86_64-linux-vg_leak
bot. I am not sure if this is valid Valgrind exclusion file syntax, but the
Internet seems to think so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126051 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 21:44:35 +00:00
Oscar Fuentes
9a89894537 CMake: updated list of tblgen source files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 22:06:23 +00:00
Owen Anderson
d8c87888a7 Add FixedLenDecoderEmitter, the skeleton of a new disassembler emitter for fixed-length instruction encodings.
A major part of its (eventual) goal is to support a much cleaner separation between disassembly callbacks
provided by the target and the disassembler emitter itself, i.e. not requiring hardcoding of knowledge in tblgen
like the existing disassembly emitters do.

The hope is that some day this will allow us to replace the existing non-Thumb ARM disassembler and remove
some of the hacks the old one introduced to tblgen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 21:51:29 +00:00
Joerg Sonnenberger
6ef6ceda68 Check that MnemonicAlias doesn't map back to the same string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:22:19 +00:00
NAKAMURA Takumi
214c920818 lit/TestingConfig.py: Add the environment variable PRINTF_EXPONENT_DIGITS as workaround [PR6745] for mingw's tests. Danil Malyshev suggested this.
FIXME: It does not improve MSVC's issue.

[Danil Malyshev] Defining PRINTF_EXPONENT_DIGITS env is the suggested way to make MinGW ANSI/POSIX compatible. This is not only about the case we are discussing, but in general, I'd like to have explicitly defined compatibility mode for all the tests running on MinGW.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125725 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 05:56:41 +00:00
Sean Hunt
c85094f909 Add serialization for Expr* arguments for attributes to clang tablegen files.
Patch thanks to Zach Anderson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 03:30:09 +00:00
Argyrios Kyrtzidis
ab8f3fd2e1 When tablegen'ing the clang analyzer checkers:
-Use the tablegen class name for the checker class name.
-Mark checker packages as hidden/not hidden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125558 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-15 07:42:16 +00:00
Argyrios Kyrtzidis
50a47e93ce Add the ClangSACheckersEmitter tablegen backend which will be used for the clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125493 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 17:58:52 +00:00
Bruno Cardoso Lopes
a2b6e4151b Fix encoding and add parsing support for the arm/thumb CPS instruction:
- Add custom operand matching for imod and iflags.
- Rename SplitMnemonicAndCC to SplitMnemonic since it splits more than CC
  from mnemonic.
- While adding ".w" as an operand, don't change "Head" to avoid passing the
  wrong mnemonic to ParseOperand.
- Add asm parser tests.
- Add disassembler tests just to make sure it can catch all cps versions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125489 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14 13:09:44 +00:00
Argyrios Kyrtzidis
d91ef79c43 Wrap the struct in an anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125452 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 07:51:19 +00:00
Jim Grosbach
f922c47143 AsmMatcher custom operand parser failure enhancements.
Teach the AsmMatcher handling to distinguish between an error custom-parsing
an operand and a failure to match. The former should propogate the error
upwards, while the latter should continue attempting to parse with
alternative matchers.

Update the ARM asm parser accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125426 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-12 01:34:40 +00:00
Jim Grosbach
84cb033bf3 Tidy out asm matcher .inc output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11 21:31:55 +00:00
NAKAMURA Takumi
7805cdcab5 lit/TestFormats.py: Unittests may be found with suffix .exe also on Cygwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 09:11:57 +00:00
NAKAMURA Takumi
f5201bcd3b lit/Util.py: On Cygwin, 'PATHEXT' may exist but it should not be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 09:11:48 +00:00
Bill Wendling
b45c7c270c Don't return before calling the post-processing function(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125256 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 01:28:26 +00:00
Jim Grosbach
b9db0c50d8 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 00:08:28 +00:00
Chris Lattner
1aac1864cf 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125193 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 16:46:02 +00:00
NAKAMURA Takumi
302b169323 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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125175 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:15 +00:00
NAKAMURA Takumi
df944f1f83 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:19:06 +00:00
NAKAMURA Takumi
4203b7116a llvm-lit may be available with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:02 +00:00
NAKAMURA Takumi
ce83025ad1 llvm-lit may be able to invoke clang tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:17:54 +00:00
Bruno Cardoso Lopes
e7a54520b3 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);




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 19:38:32 +00:00
Daniel Dunbar
5c228a945f MC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
implicitly allows custom conversions to be member functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 23:17:40 +00:00
Jason W Kim
685c350ae7 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124895 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 19:47:15 +00:00
Daniel Dunbar
b412915ff6 MC/AsmParser: Add support for allowing the conversion process to fail (via
custom conversion functions).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124872 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 17:12:23 +00:00
Daniel Dunbar
cf12067ae0 MC/AsmMatcher: Add support for custom conversion functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124870 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 17:12:15 +00:00
David Greene
c83e203757 Silence uninitialized value warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124869 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 17:01:53 +00:00
NAKAMURA Takumi
6d600da734 Make Win32's header file name lower for cross build on case-sensitive filesystem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124864 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 12:53:04 +00:00
Jim Grosbach
0ed92f2de3 Tidy up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 23:26:36 +00:00
Oscar Fuentes
d538e24922 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124816 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 20:57:36 +00:00
Kevin Enderby
79fcb6dec3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 18:20:55 +00:00
Devang Patel
a3138424cf Update to match changes in lldb interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 21:47:35 +00:00
David Greene
9d7f011110 [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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 19:12:32 +00:00
Devang Patel
1531511b2c Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 21:16:37 +00:00
Devang Patel
e3373b0227 Focus on arguments for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 21:15:39 +00:00
Bob Wilson
9b8c3530cc Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124450 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 23:08:52 +00:00
Douglas Gregor
75f6e89ea9 Clang: separate the access-control diagnostics from other diagnostics that do not have SFINAE behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124440 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 21:06:17 +00:00
Bob Wilson
1fe3aa15e9 Add a MnemonicIsValid method to the asm matcher.
Patch by Bill Wendling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124328 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 21:43:46 +00:00
Bob Wilson
1f64ac4035 Fix spelling of CouldMatchAmbiguouslyWith method name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124324 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 21:26:21 +00:00
Bob Wilson
828295bb30 Whitespace and 80-column fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124323 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 21:26:19 +00:00
Bob Wilson
a49c7dfb36 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124314 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 19:44:55 +00:00
Devang Patel
a3722e67d9 - Do not try to print nameless variable's info.
- Print a summary of breakpoints in the beginning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124308 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 19:14:14 +00:00
NAKAMURA Takumi
36c3bc431b TableGen: PointerLikeRegClass can be accepted to operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 02:03:48 +00:00
NAKAMURA Takumi
e5fffe9c3f Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 02:03:37 +00:00
Daniel Dunbar
c0a7007d3a tblgen/AsmMatcherEmitter: Fix alias handling to honor -match-prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 23:26:31 +00:00
David Greene
6032269837 [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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 20:53:18 +00:00
Bill Wendling
0ef755d905 ARM uses '.' in their tokens. Give it a name instead of a numeric value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-22 09:44:32 +00:00
Peter Collingbourne
be111ef182 tblgen: Add support for non-inheritable attributes
This patch makes the necessary changes to TableGen to support
non-inheritable attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-21 02:08:26 +00:00
Bob Wilson
55931ab992 Move InstAlias check of argument types to a separate loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123934 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 18:38:10 +00:00
Bob Wilson
906bc368bc Tidy comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 18:38:07 +00:00
Bob Wilson
47c90a70ba Fix broken check for InstAlias argument used with different types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123932 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 18:38:05 +00:00
Bob Wilson
5e8f2a65ca 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123931 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-20 18:38:02 +00:00
Douglas Gregor
348c975cb8 Fix comment for gen-clang-decl-nodes tblgen backend, from Michael Han
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-19 15:57:47 +00:00
Owen Anderson
6cd0b17ba7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 23:01:21 +00:00
Bruno Cardoso Lopes
a461d42228 Add support for parsing and encoding ARM's official syntax for the BFI instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 20:45:56 +00:00
Daniel Dunbar
55b5e85643 Formatting tweak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123718 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 01:59:30 +00:00
Bob Wilson
dc1a2bd3aa 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123490 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 22:58:09 +00:00
Owen Anderson
e4e5e2aae7 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>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123404 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 21:46:02 +00:00
Evan Cheng
7597212abc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 07:58:56 +00:00
Daniel Dunbar
e6e5fbb671 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123252 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 19:06:26 +00:00
Daniel Dunbar
083203dde8 MC/AsmMatcher: Fix indirect 80-col viola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 15:26:11 +00:00
Francois Pichet
7a0be17c08 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123070 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 18:09:48 +00:00
Eric Christopher
da7a32c07d I don't think I could find a 10.2.x box if I tried.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123051 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 01:52:20 +00:00
Bob Wilson
067a16c974 Use __builtin_shufflevector to implement vget_low and vget_high intrinsics.
This was suggested by Edmund Grimley Evans in pr8411.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123043 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 23:40:49 +00:00
David Greene
1434f66b2e Rename lisp-like functions as suggested by Gabor Greif as loooong time
ago.  This is both easier to learn and easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123001 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 17:05:37 +00:00
Francois Pichet
ba69d3f6d4 Disable r122754 on Windows: was causing all lit tests to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-04 10:23:42 +00:00
David Greene
18d4987753 Reapply 122341 to fix PR8199 now that clang changes are in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122754 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03 17:30:25 +00:00
Jim Grosbach
398abb4a9a Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24 05:06:32 +00:00
Chris Lattner
036609bd7d Flag -> Glue, the ongoing saga
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122513 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 18:28:41 +00:00
Chris Lattner
29d8f0cae4 flags -> glue for selectiondag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 17:24:32 +00:00
Chris Lattner
a4359be032 sdisel flag -> glue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 17:13:18 +00:00
Chris Lattner
8950bcaa5a continue renaming flag -> glue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 17:03:20 +00:00
Jeffrey Yasskin
8e68c38735 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 00:58:24 +00:00
Bill Wendling
65e43a259f Default to armv7 instead of armv6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-23 00:49:18 +00:00
David Greene
234da6832f Revert 122341. It breaks some darwin tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122346 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 17:25:43 +00:00
David Greene
4d75d80d62 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:55:53 +00:00
Jim Grosbach
fbadcd0826 Tidy up a bit. Trailing whitespace, hard tabs and 80-columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:16:00 +00:00
Chris Lattner
f1b4eafbfe 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 02:38:05 +00:00
Michael J. Spencer
7385509101 Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 22:23:07 +00:00
Owen Anderson
fffa863536 Revert r122143 through r122140, which collectively broke the LLVMC tests on
the buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 07:37:18 +00:00
Michael J. Spencer
b9c767cce5 Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-18 04:13:36 +00:00
Bob Wilson
14595d967f Neon intrinsic tests need to be compiled for Cortex-A9 for f16 support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 01:21:03 +00:00
Michael J. Spencer
3ff9563c3e MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16 03:29:14 +00:00
Bob Wilson
ae6be764f9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 23:16:25 +00:00
Bob Wilson
333f5194cb Add a Neon intrinsic test generator.
This is still a WIP.  It's already good enough to expose a few bugs, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 16:58:45 +00:00
Bob Wilson
06b04aaf5c 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 16:58:42 +00:00
Chris Lattner
9c6b60eb28 various cleanups to tblgen, patch by Garrison Venn!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 04:48:22 +00:00
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