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

428 Commits

Author SHA1 Message Date
Jim Grosbach
a697e32f36 More binary encoding stuff, taking advantage of the new "by name" operand
matching in tblgen to do the predicate operand.

llvm-svn: 116213
2010-10-11 18:51:51 +00:00
Jim Grosbach
3075d28c15 Implement a few more binary encoding bits. Still very early stage proof-of-
concept level stuff at this point, but it is generally working for those
instructions that know how to map the operands.

This patch fills in the register operands for add/sub/or/etc instructions
and adds the conditional execution predicate encoding.

llvm-svn: 116112
2010-10-08 21:45:55 +00:00
Jim Grosbach
1e2566c20d Allow use of the 16-bit literal move instruction in CMOVs for ARM mode.
llvm-svn: 115884
2010-10-07 00:42:42 +00:00
Jim Grosbach
de2bd8cd3f Clean up MOVi32imm and t2MOVi32imm pseudo instruction definitions.
llvm-svn: 115853
2010-10-06 22:01:26 +00:00
Jim Grosbach
4c7da8acbc Kill of the vestiges of the 'call' Modifier (no longer needed for PLT).
llvm-svn: 115845
2010-10-06 21:36:43 +00:00
Evan Cheng
6fbb6dea7c - Add TargetInstrInfo::getOperandLatency() to compute operand latencies. This
allow target to correctly compute latency for cases where static scheduling
  itineraries isn't sufficient. e.g. variable_ops instructions such as
  ARM::ldm.
  This also allows target without scheduling itineraries to compute operand
  latencies. e.g. X86 can return (approximated) latencies for high latency
  instructions such as division.
- Compute operand latencies for those defined by load multiple instructions,
  e.g. ldm and those used by store multiple instructions, e.g. stm.

llvm-svn: 115755
2010-10-06 06:27:31 +00:00
Jim Grosbach
8440cebbe9 Nuke a bunch of no-longer-needed comment-only asm strings.
llvm-svn: 115370
2010-10-01 23:09:33 +00:00
Jim Grosbach
2bf1c488de Nuke a few more unused asm strings
llvm-svn: 115193
2010-09-30 19:53:58 +00:00
Jim Grosbach
52b5709c99 The asm strings are never used at all, so just nuke 'em entirely.
llvm-svn: 115160
2010-09-30 16:56:53 +00:00
Jim Grosbach
ad67153eb3 Go ahead and jump!
Now that the MC lowering handles the expansion of the pseudos, kill the horrible
blobs of text.

llvm-svn: 115130
2010-09-30 02:18:06 +00:00
Evan Cheng
fa5d40dbff ARM instruction itinerary fixes:
1. Cortex-a9 8-bit and 16-bit loads / stores AGU cycles are 1 cycle longer than 32-bit ones.
2. Cortex-a9 is out-of-order so model all read cycles as cycle 1.
3. Lots of other random fixes for A8 and A9.

llvm-svn: 115121
2010-09-30 01:08:25 +00:00
Jim Grosbach
fd8705ab4a Add specializations of addrmode2 that allow differentiating those forms
which require the use of the shifter-operand. This will be used to split
the ldr/str instructions such that those versions needing the shifter operand
can get a different scheduling itenerary, as in some cases, the use of the
shifter can cause different scheduling than the simpler forms.

llvm-svn: 115066
2010-09-29 19:03:54 +00:00
Evan Cheng
7eb08b1ad9 Separate itinerary classes for mvn from mov; for tst / teq from cmp / cmn.
llvm-svn: 115010
2010-09-29 00:49:25 +00:00
Evan Cheng
7fffe3cf58 Assign bitwise binary instructions different itinerary classes from ALU instructions such as add / sub.
llvm-svn: 115008
2010-09-29 00:27:46 +00:00
Evan Cheng
64a24ab747 Fix zero and sign extension instructions scheduling itineraries.
llvm-svn: 114780
2010-09-25 00:49:35 +00:00
Evan Cheng
eb81dc39dc Fix scheduling itinerary for pseudo mov immediate instructions which expand into two real instructions.
llvm-svn: 114766
2010-09-24 22:03:46 +00:00
Owen Anderson
4fc55c0e02 Revert r114703 and r114702, removing the isConditionalMove flag from instructions. After further
reflection, this isn't going to achieve the purpose I intended it for.  Back to the drawing board!

llvm-svn: 114710
2010-09-23 23:45:25 +00:00
Jim Grosbach
c6efcc192d #+4 --> #4 for consistency with other asm output
llvm-svn: 114706
2010-09-23 23:32:38 +00:00
Jim Grosbach
7bd79eb9e8 Fix formatting of output .s code
llvm-svn: 114705
2010-09-23 23:03:26 +00:00
Owen Anderson
15c6948d29 Add isConditionalMove bits to X86 and ARM instructions.
llvm-svn: 114703
2010-09-23 22:57:01 +00:00
Jim Grosbach
bcafcce601 Clean up the 'trap' instruction printing a bit. Non-Darwin assemblers don't
(yet) recognize the 'trap' mnemonic, so we use .short/.long to emit the
opcode directly. On Darwin, however, we do want the mnemonic for more
readable assembly code and better disassembly.

Adjust the .td file to use the 'trap' mnemonic and handle using the binutils
workaround in the assembly printer. Also tweak the formatting of the opcode
values to make them consistent between the MC printer and the old printer.

llvm-svn: 114679
2010-09-23 18:05:37 +00:00
Chris Lattner
55043ef46a fix a long standing wart: all the ComplexPattern's were being
passed the root of the match, even though only a few patterns
actually needed this (one in X86, several in ARM [which should
be refactored anyway], and some in CellSPU that I don't feel 
like detangling).   Instead of requiring all ComplexPatterns to
take the dead root, have targets opt into getting the root by
putting SDNPWantRoot on the ComplexPattern.

llvm-svn: 114471
2010-09-21 20:31:19 +00:00
Bill Wendling
6cc7baa725 Reword since this may not be a bug but intended behavior.
llvm-svn: 113584
2010-09-10 10:31:11 +00:00
Evan Cheng
b87520ca74 Fix LDM_RET schedule itinery.
llvm-svn: 113435
2010-09-08 22:57:08 +00:00
Chris Lattner
b74759a9fa temporarily revert r112664, it is causing a decoding conflict, and
the testcases should be merged.

llvm-svn: 112711
2010-09-01 16:00:50 +00:00
Bill Wendling
bb6052cfd6 We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!

llvm-svn: 112664
2010-08-31 22:41:22 +00:00
Bill Wendling
4a52e8fec0 And ANDS pattern to match the t2ANDS pattern.
llvm-svn: 112654
2010-08-31 22:05:37 +00:00
Jim Grosbach
674b25ce31 Make ARM add rN, sp, #imm instructions rematerializable. That's how the address of locals is calculated, so this should
help relieve register pressure a bit. Recalculating the local address is
almost always going to be better than spilling.

llvm-svn: 112503
2010-08-30 19:49:58 +00:00
Bill Wendling
8a7258d771 Fix whitespaces. No functionality changes.
llvm-svn: 112421
2010-08-29 11:31:07 +00:00
Bill Wendling
6e586677a7 File missing from last commit.
llvm-svn: 112394
2010-08-29 03:02:28 +00:00
Bill Wendling
c76a3e317c Reapply r112176 without removing the other CMN patterns (that was unintentional).
llvm-svn: 112206
2010-08-26 18:33:51 +00:00
Jakob Stoklund Olesen
20dbe1681b Don't call tablegen'ed Predicate_* functions in the ARM target.
llvm-svn: 111277
2010-08-17 20:39:04 +00:00
Jim Grosbach
1d9631950f 80 column cleanup.
llvm-svn: 111266
2010-08-17 18:39:16 +00:00
Bob Wilson
e382fce916 Change ARM PKHTB and PKHBT instructions to use a shift_imm operand to avoid
printing "lsl #0".  This fixes the remaining parts of pr7792.  Make
corresponding changes for encoding/decoding these instructions.

llvm-svn: 111251
2010-08-17 17:23:19 +00:00
Bob Wilson
d662e8cd02 Generalize a pattern for PKHTB: an SRL of 16-31 bits will guarantee
that the high halfword is zero.  The shift need not be exactly 16 bits.

llvm-svn: 111196
2010-08-16 22:26:55 +00:00
Bob Wilson
985dab611d Rename sat_shift operand to shift_imm, in preparation for using it for other
instructions besides saturate instructions.  No functional changes.

llvm-svn: 111168
2010-08-16 18:27:34 +00:00
Bob Wilson
98641e5a51 Remove unused code.
llvm-svn: 111154
2010-08-16 17:06:03 +00:00
Johnny Chen
78345b1dfe Cleaned up the for-disassembly-only entries in the arm instruction table so that
the memory barrier variants (other than 'SY' full system domain read and write)
are treated as one instruction with option operand.

llvm-svn: 110951
2010-08-12 20:46:17 +00:00
Johnny Chen
9a37d16281 Changed the format of DMBsy, DSBsy, and friends from Pseudo to MiscFrm.
Added two test cases to arm-tests.txt.

llvm-svn: 110880
2010-08-11 23:35:12 +00:00
Bob Wilson
3582107cf8 Move the ARM SSAT and USAT optional shift amount operand out of the
instruction opcode.  This also fixes part of PR7792.

llvm-svn: 110875
2010-08-11 23:10:46 +00:00
Evan Cheng
e67c4c3723 Really control isel of barrier instructions with cpu feature.
llvm-svn: 110787
2010-08-11 06:36:31 +00:00
Evan Cheng
5fca4ca5f9 - Add subtarget feature -mattr=+db which determine whether an ARM cpu has the
memory and synchronization barrier dmb and dsb instructions.
- Change instruction names to something more sensible (matching name of actual
  instructions).
- Added tests for memory barrier codegen.

llvm-svn: 110785
2010-08-11 06:22:01 +00:00
Bill Wendling
735305d4d8 Mark ARM compare instructions as isCompare.
llvm-svn: 110761
2010-08-11 00:22:27 +00:00
Bob Wilson
0650cceb38 Add a separate ARM instruction format for Saturate instructions.
(I discovered 2 more copies of the ARM instruction format list, bringing the
total to 4!!  Two of them were already out of sync.  I haven't yet gotten into
the disassembler enough to know the best way to fix this, but something needs
to be done.)  Add support for encoding these instructions.

llvm-svn: 110754
2010-08-11 00:01:18 +00:00
Bob Wilson
fbce203f20 Fix indentation.
llvm-svn: 110363
2010-08-05 19:00:21 +00:00
Bob Wilson
4ba3c0a5e1 Add an ARM RSCrr instruction for disassembly only.
Partial fix for PR7792.

llvm-svn: 110361
2010-08-05 18:59:36 +00:00
Bob Wilson
9fbaea3765 Add an ARM RSBrr instruction for disassembly only.
Partial fix for PR7792.

llvm-svn: 110358
2010-08-05 18:23:43 +00:00
Bob Wilson
58c8a5da9e Move newlines before inline jumptables from the asm strings in .td files to
the jtblock_operand print methods.  This avoids extra newlines in the
disassembler's output.  PR7757.

llvm-svn: 109948
2010-07-31 06:28:10 +00:00
Nate Begeman
0b0f838c32 Add builtins for ssat/usat, similar to RealView's __ssat and __usat intrinsics.
llvm-svn: 109813
2010-07-29 22:48:09 +00:00
Nate Begeman
b24fa8b8ae Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions.
Behave identically to __qadd & __qsub RealView instruction intrinsics.

llvm-svn: 109770
2010-07-29 17:56:55 +00:00