1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

588 Commits

Author SHA1 Message Date
Chris Lattner
01e8c46349 Flag -> Glue, the ongoing saga
llvm-svn: 122513
2010-12-23 18:28:41 +00:00
Bob Wilson
438a9a1367 Add Neon VCVT instructions for f32 <-> f16 conversions.
Clang is now providing intrinsics for these and so we need to support them
in the backend.  Radar 8068427.

llvm-svn: 121902
2010-12-15 22:14:12 +00:00
Owen Anderson
4ec912b842 In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or
as a "long" direct branch.  While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches.  Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.

llvm-svn: 121710
2010-12-13 19:31:11 +00:00
Evan Cheng
b6773d7e1f (or (and (shl A, #shamt), mask), B) => ARMbfi B, A, ~mask where lsb(mask) == #shamt. rdar://8752056
llvm-svn: 121606
2010-12-11 04:11:38 +00:00
Jim Grosbach
467e860805 More trivial cleanup. No need to define the EncoderMethod property type. Can
just assign to it.

llvm-svn: 121523
2010-12-10 20:53:44 +00:00
Jason W Kim
2e6e50c1b0 ARM/MC/ELF TPsoft is now a proper pseudo inst.
Added test to check bl __aeabi_read_tp gets emitted properly for ELF/ASM
as well as ELF/OBJ (including fixup)

Also added support for ELF::R_ARM_TLS_IE32

llvm-svn: 121312
2010-12-08 23:14:44 +00:00
Jim Grosbach
1aa6a676cf Refactor the ARM CMPz* patterns to just use the normal CMP instructions when
possible. They were duplicates for everything exception the source pattern
before.

llvm-svn: 121179
2010-12-07 20:41:06 +00:00
Evan Cheng
fc78767730 Making use of VFP / NEON floating point multiply-accumulate / subtraction is
difficult on current ARM implementations for a few reasons.
1. Even though a single vmla has latency that is one cycle shorter than a pair
   of vmul + vadd, a RAW hazard during the first (4? on Cortex-a8) can cause
   additional pipeline stall. So it's frequently better to single codegen
   vmul + vadd.
2. A vmla folowed by a vmul, vmadd, or vsub causes the second fp instruction to
   stall for 4 cycles. We need to schedule them apart.
3. A vmla followed vmla is a special case. Obvious issuing back to back RAW
   vmla + vmla is very bad. But this isn't ideal either:
     vmul
     vadd
     vmla
   Instead, we want to expand the second vmla:
     vmla
     vmul
     vadd
   Even with the 4 cycle vmul stall, the second sequence is still 2 cycles
   faster.

Up to now, isel simply avoid codegen'ing fp vmla / vmls. This works well enough
but it isn't the optimial solution. This patch attempts to make it possible to
use vmla / vmls in cases where it is profitable.

A. Add missing isel predicates which cause vmla to be codegen'ed.
B. Make sure the fmul in (fadd (fmul)) has a single use. We don't want to
   compute a fmul and a fmla.
C. Add additional isel checks for vmla, avoid cases where vmla is feeding into
   fp instructions (except for the #3 exceptional case).
D. Add ARM hazard recognizer to model the vmla / vmls hazards.
E. Add a special pre-regalloc case to expand vmla / vmls when it's likely the
   vmla / vmls will trigger one of the special hazards.

Work in progress, only A+B are enabled.

llvm-svn: 120960
2010-12-05 22:04:16 +00:00
Jim Grosbach
0e71db6919 Add support for binary encoding of ARM 'adr' instructions referencing constant
pool entries (LEApcrel pseudo). Ongoing saga of rdar://8542291.

llvm-svn: 120635
2010-12-02 00:28:45 +00:00
Jim Grosbach
b2a12afa5f Refactor LEApcrelJT as a pseudo-instructionlowered to a cannonical ADR
instruction at MC lowering. Add binary encoding information for the ADR,
including fixup data for the label operand.

llvm-svn: 120594
2010-12-01 19:47:31 +00:00
Jim Grosbach
a3e6ffffe5 Elaborate on FIXME.
llvm-svn: 120552
2010-12-01 04:01:17 +00:00
Jim Grosbach
532d63789b Add FIXME
llvm-svn: 120451
2010-11-30 19:25:56 +00:00
Jim Grosbach
aa96c057be Pseudo-ize ARM MOVPCRX
llvm-svn: 120442
2010-11-30 18:56:36 +00:00
Jim Grosbach
cb8193b99e Pseudo-ize BX_CALL and friends. Remove dead instruction format classes.
rdar://8685712

llvm-svn: 120438
2010-11-30 18:30:19 +00:00
Jim Grosbach
6c0221e3ae Rename BX/BRIND/etc patterns to clarify which is actually the BX instruction
and which are pseudos.

llvm-svn: 120366
2010-11-30 00:24:05 +00:00
Jim Grosbach
5f2a3880a8 Make a few more ARM pseudo instructions actually use the PseudoInst base class.
llvm-svn: 120362
2010-11-30 00:09:06 +00:00
Bill Wendling
9859e95ca2 Predicate encoding should be withing {}s. And general cleanup.
llvm-svn: 120361
2010-11-30 00:08:20 +00:00
Bob Wilson
f5eece615c Fix the encoding of VLD4-dup alignment.
The only reasonable way I could find to do this is to provide an alternate
version of the addrmode6 operand with a different encoding function.  Use it
for all the VLD-dup instructions for the sake of consistency.

llvm-svn: 120358
2010-11-30 00:00:42 +00:00
Jim Grosbach
58e4c01d0d Simplify definitions of the ARM eh.sjlj.*jmp pseudo instructions.
llvm-svn: 120354
2010-11-29 23:51:31 +00:00
Jim Grosbach
b796df67e9 Parameterize ARMPseudoInst size property.
llvm-svn: 120353
2010-11-29 23:48:41 +00:00
Evan Cheng
78baa6f30d Mark Darwin call instructions as using "r7" to prevent the frame-register
assignment instructions from being moved below / above calls.
rdar://8690640

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

llvm-svn: 120333
2010-11-29 22:37:40 +00:00
Jim Grosbach
3e84f9d6cb ARM Pseudo-ize tBR_JTr.
llvm-svn: 120310
2010-11-29 19:32:47 +00:00
Jim Grosbach
0d235c0c37 The ARM BR_JT* pseudos don't need to use the printer jtblock_operand node to
get the pretty-printer. That's handled explicityly by the MC lowering now.

llvm-svn: 120305
2010-11-29 18:53:24 +00:00
Jim Grosbach
9e2ed21ad0 Switch ARM BR_JTm and BR_JTr instructions to be MC-expanded pseudos.
llvm-svn: 120303
2010-11-29 18:37:44 +00:00
Eric Christopher
662ad8ba93 Pseudos default to 4byte size, let the instruction size field notice
that branch tables are special.

llvm-svn: 119954
2010-11-21 23:38:19 +00:00
Bill Wendling
a472e7be70 Add encoding for ARM "trap" instruction.
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Jim Grosbach
1476bfec1e BR_JTadd is ARM-only, so use the proper pseudo class to get the predicate.
llvm-svn: 119918
2010-11-21 01:26:01 +00:00
Jim Grosbach
b2b99c9b64 Fix ARM LDR* post-indexed operand encoding.
llvm-svn: 119869
2010-11-19 23:14:43 +00:00
Jim Grosbach
0a0b2ed163 Fix encoding for ARM MLS instruction.
llvm-svn: 119855
2010-11-19 22:22:37 +00:00
Jim Grosbach
a7213faf85 Add ARM encoding information for STRD.
llvm-svn: 119852
2010-11-19 22:14:31 +00:00
Jim Grosbach
bd80b3fe98 Shuffle things around a bit to keep like things together. Tidy up formatting.
llvm-svn: 119851
2010-11-19 22:06:57 +00:00
Jim Grosbach
33930ff560 Factor out operand encoding bits for ARM addressing mode 2 store instructions.
llvm-svn: 119846
2010-11-19 21:35:06 +00:00
Jim Grosbach
edef95dc56 Refactor PICSTR* instructions to really be pseudos. Nuke dead classes.
llvm-svn: 119841
2010-11-19 21:14:02 +00:00
Jim Grosbach
a57ac3e282 Rename ARM .td class AIldst1 to AI2ldst for consistency with the other classes.
llvm-svn: 119840
2010-11-19 21:07:51 +00:00
Jim Grosbach
9e50b14e34 Add ARM binary encoding information for the rest of the indexed loads.
llvm-svn: 119821
2010-11-19 19:41:26 +00:00
Jim Grosbach
c2ac477e54 ARM LDRD binary encoding.
llvm-svn: 119812
2010-11-19 18:16:46 +00:00
Jim Grosbach
941d812765 Minor cleanups to a few llvm_unreachable() calls.
llvm-svn: 119767
2010-11-19 00:27:09 +00:00
Jason W Kim
331b7407c8 Fix .o emission of ARM movt/movw. MCSymbolRefExpr::VK_ARM_(HI||LO)16 for the .o path now works for ARM.
Note: lo16AllZero remains in ARMInstrInfo.td - It can be factored out when Thumb movt is repaired.
Existing tests cover this update.

llvm-svn: 119760
2010-11-18 23:37:15 +00:00
Jim Grosbach
6d88154077 ARM Encoding information for UXTAH and friends.
llvm-svn: 119753
2010-11-18 23:24:22 +00:00
Jim Grosbach
2f9a2efb3c ARM PseudoInst instructions don't need or use an assembler string. Get rid of
the operand to the pattern.

llvm-svn: 119607
2010-11-18 01:38:26 +00:00
Jim Grosbach
a42e2b0fcb Refactor the ARM PICADD and PICLDR* instructions to really be pseudos and not
just pretend to be.

llvm-svn: 119602
2010-11-18 01:15:56 +00:00
Jim Grosbach
42d103250b Refactor a few ARM load instructions to better parameterize things and re-use
common encoding information.

llvm-svn: 119598
2010-11-18 00:46:58 +00:00
Jim Grosbach
5d9d8356fa Clean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
it as such. Add some encoding information.

llvm-svn: 119588
2010-11-17 23:33:14 +00:00
Jim Grosbach
37233d0ea6 Make the ARM BR_JTadd instruction an explicit pseudo and lower it properly
in the MC lowering process.

llvm-svn: 119559
2010-11-17 21:05:55 +00:00
Evan Cheng
ce610bd6b3 Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

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

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

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

rdar://8663787, rdar://8241368

llvm-svn: 119548
2010-11-17 20:13:28 +00:00
Jim Grosbach
b640b6a7b4 More ARM encoding bits. LDRH now encodes properly.
llvm-svn: 119529
2010-11-17 18:11:11 +00:00
Bill Wendling
f0a1acba8c Proper encoding for VLDM and VSTM instructions. The register lists for these
instructions have to distinguish between lists of single- and double-precision
registers in order for the ASM matcher to do a proper job. In all other
respects, a list of single- or double-precision registers are the same as a list
of GPR registers.

llvm-svn: 119460
2010-11-17 04:32:08 +00:00
Bill Wendling
d2da6dff5e Use the correct variable names so that the encodings will be correct.
llvm-svn: 119403
2010-11-16 23:44:49 +00:00
Jim Grosbach
1b1636f0cb ARM conditional mov encoding fix.
llvm-svn: 119354
2010-11-16 18:13:42 +00:00