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

199 Commits

Author SHA1 Message Date
Jim Grosbach
13b7ab7527 ARM optional size suffix for VLDR/VSTR syntax.
llvm-svn: 144427
2011-11-11 23:34:43 +00:00
Jim Grosbach
f38874e79e ARM assembly parsing and encoding for VMOV immediate.
llvm-svn: 141046
2011-10-03 23:38:36 +00:00
Jim Grosbach
21a9f8f50f ARM assembly parsing and encoding for VMRS/FMSTAT.
llvm-svn: 141025
2011-10-03 21:12:43 +00:00
Jim Grosbach
d94ffffc87 ARM fix encoding of VMOV.f32 and VMOV.f64 immediates.
Encode the immediate into its 8-bit form as part of isel rather than later,
which simplifies things for mapping the encoding bits, allows the removal
of the custom disassembler decoding hook, makes the operand printer trivial,
and prepares things more cleanly for handling these in the asm parser.

rdar://10211428

llvm-svn: 140834
2011-09-30 00:50:06 +00:00
Owen Anderson
4bd28c69c4 Add missing encoding information for some of the GPR<->FP register moves.
llvm-svn: 138780
2011-08-29 23:15:25 +00:00
Owen Anderson
a2231fad2e Provide operand encoding information for half-precision VCVT instructions. Found by randomized testing.
llvm-svn: 138273
2011-08-22 21:34:00 +00:00
Owen Anderson
39d3f234f7 Fix decoding of VMOVSRR and VMOVRRS, which account for the overwhelming majority of decoder crashes detected by randomized testing.
llvm-svn: 138269
2011-08-22 20:27:12 +00:00
Owen Anderson
48156a8b45 Fix the broken encodings for the VFP vmov.f32 and vmov.f64 instructions, as well as the comments that explain them incorrectly.
llvm-svn: 136707
2011-08-02 18:30:00 +00:00
Owen Anderson
c68f12ff30 Add a target-indepedent entry to MCInstrDesc to describe the encoded size of an opcode. Switch ARM over to using that rather than its own special MCInstrDesc bits.
llvm-svn: 135106
2011-07-13 23:22:26 +00:00
Cameron Zwarich
10c7a9fd7b The VMLA instruction and its friends are not actually fused; they're plain old
multiply-accumulate instructions with separate rounding steps.

llvm-svn: 134609
2011-07-07 08:28:52 +00:00
Jim Grosbach
7157b0228f ARM assembler support for vpush/vpop.
Add aliases for the vpush/vpop mnemonics to the VFP load/store multiple
writeback instructions w/ SP as the base pointer.

rdar://9683231

llvm-svn: 133932
2011-06-27 20:00:07 +00:00
Jim Grosbach
eff8e5d153 Clean up a few 80 column violations.
llvm-svn: 132946
2011-06-13 22:54:22 +00:00
Bob Wilson
48d5451029 Some single-precision VFP instructions can execute in either the VPF or Neon
pipelines, at least on Cortex-A9.

llvm-svn: 129771
2011-04-19 18:11:38 +00:00
Owen Anderson
d73041e884 Get rid of the non-writeback versions VLDMDB and VSTMDB, which don't actually exist.
llvm-svn: 128461
2011-03-29 16:45:53 +00:00
Jim Grosbach
009af69d6d Pseudo-ize VMOVDcc and VMOVScc.
llvm-svn: 127506
2011-03-11 23:09:50 +00:00
Bob Wilson
1497601a7b Remove unused conditional negate operations.
llvm-svn: 127090
2011-03-05 16:54:31 +00:00
Evan Cheng
f540b0e0f6 VFP single precision arith instructions can go down to NEON pipeline, but on Cortex-A8 only.
llvm-svn: 126238
2011-02-22 19:53:14 +00:00
Evan Cheng
d3928a2c3a Some single precision VFP instructions may be executed on NEON pipeline, but not double precision ones.
llvm-svn: 125624
2011-02-16 00:35:02 +00:00
Bruno Cardoso Lopes
e0f8fee637 Create two new generic classes to represent the following VMRS/VMSR variations:
vmrs  reg, fpexc
vmrs  reg, fpsid
vmsr  fpexc, reg
vmsr  fpsid, reg

llvm-svn: 123783
2011-01-18 21:58:20 +00:00
Bob Wilson
63547ae69e Fix a comment: We now have intrinsics for vcvtr.
llvm-svn: 123246
2011-01-11 17:56:41 +00:00
Chris Lattner
01e8c46349 Flag -> Glue, the ongoing saga
llvm-svn: 122513
2010-12-23 18:28:41 +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
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
64cb4dd72d vldm and vstm are mnemonics for vldmia and vstmia resp.
llvm-svn: 119321
2010-11-16 02:00:24 +00:00
Bill Wendling
b450d320ec Encode the multi-load/store instructions with their respective modes ('ia',
'db', 'ib', 'da') instead of having that mode as a separate field in the
instruction. It's more convenient for the asm parser and much more readable for
humans.
<rdar://problem/8654088>

llvm-svn: 119310
2010-11-16 01:16:36 +00:00
Bill Wendling
fadcb3cded Add uses of the *_ldst_multi multiclasses. These aren't used yet.
llvm-svn: 118999
2010-11-13 10:57:02 +00:00
Bill Wendling
184bc1368d Convert the modes to lower case.
llvm-svn: 118998
2010-11-13 10:43:34 +00:00
Bill Wendling
aa9ca6fcca Add *_ldst_mult multiclasses to the ARM back-end. These will be used in the
future to separate out the ia, ib, da, db variants of the load/store multiple
instructions.

llvm-svn: 118995
2010-11-13 09:09:38 +00:00
Evan Cheng
b565d1acf9 Add some missing isel predicates on def : pat patterns to avoid generating VFP vmla / vmls (they cause stalls). Disabling them in isel is properly not a right solution, I'll look into a proper solution next.
llvm-svn: 118922
2010-11-12 20:32:20 +00:00
Bill Wendling
3e6eee5c35 Add "write back" bit encoding.
llvm-svn: 118446
2010-11-08 21:28:03 +00:00
Bill Wendling
990c247994 Add encoding for VSTR.
llvm-svn: 118220
2010-11-04 00:59:42 +00:00
Bill Wendling
34599f4aa8 The MC code couldn't handle ARM LDR instructions with negative offsets:
vldr.64 d1, [r0, #-32]

The problem was with how the addressing mode 5 encodes the offsets. This change
makes sure that the way offsets are handled in addressing mode 5 is consistent
throughout the MC code. It involves re-refactoring the "getAddrModeImmOpValue"
method into an "Imm12" and "addressing mode 5" version. But not to worry! The
majority of the duplicated code has been unified.

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

llvm-svn: 118137
2010-11-03 01:01:43 +00:00
Bill Wendling
1546322a9c Rename getAddrModeImm12OpValue to getAddrModeImmOpValue and expand it to work
with immediates up to 16-bits in size. The same logic is applied to other LDR
encodings, e.g. VLDR, but which use a different immediate bit width (8-bits in
VLDR's case). Removing the "12" allows it to be more generic.

llvm-svn: 118094
2010-11-02 22:31:46 +00:00
Bill Wendling
dd4216420a Missed reverting this bit.
llvm-svn: 117971
2010-11-01 23:17:54 +00:00
Bill Wendling
37c9af176d Minor cleanup.
llvm-svn: 117969
2010-11-01 23:11:22 +00:00
Bill Wendling
69e7c09c32 Move the machine operand MC encoding patterns to the parent classes.
llvm-svn: 117956
2010-11-01 21:17:06 +00:00
Bill Wendling
da3d0ce7b5 Move instruction encoding bits into the parent class and remove the temporary
*_Encode classes. These instructions are the only ones which use those classes,
so a subclass isn't necessary.

llvm-svn: 117906
2010-11-01 06:00:39 +00:00
Chris Lattner
01acd65875 reapply r117858 with apparent editor malfunction fixed (somehow I
got a dulicated line).

llvm-svn: 117860
2010-10-31 19:10:56 +00:00
Chris Lattner
8132a182e7 revert r117858 while I check out a failure I missed.
llvm-svn: 117859
2010-10-31 19:05:32 +00:00
Chris Lattner
70b05a5b88 the asm matcher can't handle operands with modifiers (like ${foo:bar}).
Instead of silently ignoring these instructions, emit a hard error and
force the target author to either refactor the target or mark the 
instruction 'isCodeGenOnly'.

Mark a few instructions in ARM and MBlaze as isCodeGenOnly the are 
doing this.

llvm-svn: 117858
2010-10-31 18:48:12 +00:00
Jim Grosbach
b6c76a2662 Add FIXME.
llvm-svn: 117787
2010-10-30 14:54:23 +00:00
Bill Wendling
c7ef66fcf2 Add encoding for moving a value between two ARM core registers and a doublework
extension register.

llvm-svn: 116970
2010-10-20 23:37:40 +00:00
Bill Wendling
0f96ff63b3 Add encodings for movement between ARM core registers and single-precision
registers.

llvm-svn: 116961
2010-10-20 22:44:54 +00:00
Bill Wendling
64d2bf006c Reformatting. No functionalogicality changes.
llvm-svn: 116625
2010-10-15 21:50:45 +00:00
Bill Wendling
2c335d364c Add support for vmov.f64/.f32 encoding. There's a bit of a hack going on
here. The f32 in FCONSTS is handled as a double instead of a float in the
code. So the encoding of the immediate into the instruction isn't exactly in
line with the documentation in that regard. But given that we know it's handled
as a double, it doesn't cause any harm.

llvm-svn: 116471
2010-10-14 02:33:26 +00:00
Bill Wendling
33a2ecd5e4 Add encoding for 'fmstat'.
llvm-svn: 116466
2010-10-14 01:19:34 +00:00
Bill Wendling
cd41f22ec1 - Add encodings for multiply add/subtract instructions in all their glory.
- Add missing patterns for some multiply add/subtract instructions.
- Add encodings for VMRS and VMSR.

llvm-svn: 116464
2010-10-14 01:02:08 +00:00
Bill Wendling
bf63d6eb63 Add MC encodings for VCVT* instrunctions.
llvm-svn: 116431
2010-10-13 20:58:46 +00:00
Bill Wendling
6d8a23c978 Add encodings for VNEG and VSQRT. Also add encodings for VMOV, but not a test
just yet.

llvm-svn: 116386
2010-10-13 01:17:33 +00:00
Bill Wendling
ea062d454d Add encodings for VCVT instructions.
llvm-svn: 116385
2010-10-13 00:56:35 +00:00
Bill Wendling
e6c2fdebbd Add VCMPZ and VABS.
llvm-svn: 116383
2010-10-13 00:38:07 +00:00
Bill Wendling
fddde4cc72 Refactor VCMP instructions.
llvm-svn: 116379
2010-10-13 00:04:29 +00:00
Bill Wendling
47155cfddd Add encodings for VNMUL[SD].
llvm-svn: 116375
2010-10-12 23:47:37 +00:00
Bill Wendling
185b548b07 Add encodings for VDIV and VMUL.
llvm-svn: 116370
2010-10-12 23:22:27 +00:00
Bill Wendling
d1f06024ce Refactor some of the encoding logic into a base class. This keeps us from having
to add 10+ lines to every instruction.

It may turn out that we can move this base class into it's parent class.

llvm-svn: 116362
2010-10-12 23:06:54 +00:00
Bill Wendling
cd3cb8da45 Add encoding for VSUB and VCMP.
Fear not! I'm going to try a refactoring right now. :)

llvm-svn: 116359
2010-10-12 22:55:35 +00:00
Bill Wendling
33a26354c1 Encoding for VADDD. Plus a test for the VFP instructions.
llvm-svn: 116348
2010-10-12 22:08:41 +00:00
Jim Grosbach
58ee6f3972 Encoding for ARM-mode VADD.F32 instruction.
llvm-svn: 116338
2010-10-12 21:22:40 +00:00
Evan Cheng
1ce29574c2 Model operand cycles of vldm / vstm; also fixes scheduling itineraries of vldr / vstr, etc.
llvm-svn: 115898
2010-10-07 01:50:48 +00:00
Eric Christopher
7d87a75fa4 Fix typo.
llvm-svn: 114931
2010-09-28 00:35:33 +00:00
Jim Grosbach
27a5b1fd3b VFP/NEON load/store multiple instructions are addrmode4, not 5.
llvm-svn: 113322
2010-09-08 00:25:50 +00:00
Bob Wilson
31d487d235 Change ARM VFP VLDM/VSTM instructions to use addressing mode #4, just like
all the other LDM/STM instructions.  This fixes asm printer crashes when
compiling with -O0.  I've changed one of the NEON tests (vst3.ll) to run
with -O0 to check this in the future.

Prior to this change VLDM/VSTM used addressing mode #5, but not really.
The offset field was used to hold a count of the number of registers being
loaded or stored, and the AM5 opcode field was expanded to specify the IA
or DB mode, instead of the standard ADD/SUB specifier.  Much of the backend
was not aware of these special cases.  The crashes occured when rewriting
a frameindex caused the AM5 offset field to be changed so that it did not
have a valid submode.  I don't know exactly what changed to expose this now.
Maybe we've never done much with -O0 and NEON.  Regardless, there's no longer
any reason to keep a count of the VLDM/VSTM registers, so we can use
addressing mode #4 and clean things up in a lot of places.

llvm-svn: 112322
2010-08-27 23:18:17 +00:00
Daniel Dunbar
8311cf950b ARM: Mark some disassembler only instructions as not available for matching --
for some reason they have a very odd MCInst form where the operands overlap, but
I haven't dug in to find out why yet.

llvm-svn: 110781
2010-08-11 04:46:13 +00:00
Nate Begeman
b506e13a32 Add support for getting & setting the FPSCR application register on ARM when VFP is enabled.
Add support for using the FPSCR in conjunction with the vcvtr instruction, for controlling fp to int rounding.
Add support for the FLT_ROUNDS_ node now that the FPSCR is exposed.

llvm-svn: 110152
2010-08-03 21:31:55 +00:00
Jim Grosbach
f3bd81ce11 Clean up 80 column violations. No functional change.
llvm-svn: 105350
2010-06-02 21:53:11 +00:00
Evan Cheng
0aa58d5b69 Mark pattern-less mayLoad / mayStore instructions neverHasSideEffects. These do not have other un-modeled side effects.
llvm-svn: 104111
2010-05-19 06:07:03 +00:00
Evan Cheng
533ffa237e Mark some pattern-less instructions as neverHasSideEffects.
llvm-svn: 103683
2010-05-13 00:16:46 +00:00
Anton Korobeynikov
7339733c80 Define new itin classes for ARM <-> VFP reg moves to distinguish from NEON ops. Define proper scheduling itinerary for them on A9. A8 TRM does not specify latency for them at all :(
llvm-svn: 100650
2010-04-07 18:20:02 +00:00
Anton Korobeynikov
5ab38590b2 FCONST{S,D} behaves the same way as FP unary instructions. This is true for both A8 and A9.
llvm-svn: 100649
2010-04-07 18:19:56 +00:00
Anton Korobeynikov
5954edc79b Add new itin classes for FP16 <-> FP32 conversions and make uise of them for A9.
llvm-svn: 100647
2010-04-07 18:19:46 +00:00
Jim Grosbach
d285f71b9a Make the use of the vmla and vmls VFP instructions controllable via cmd line.
Preliminary testing shows significant performance wins by not using these
instructions.

llvm-svn: 99436
2010-03-24 22:31:46 +00:00
Bob Wilson
3d0c2e0424 Revert the rest of 98679.
--- Reverse-merging r98679 into 'lib/Target/ARM/ARMInstrVFP.td':
U    lib/Target/ARM/ARMInstrVFP.td

llvm-svn: 99049
2010-03-20 06:34:02 +00:00
Bob Wilson
9501c478f7 Revert this change, since it was causing ARM performance regressions.
--- Reverse-merging r98889 into '.':
U    lib/Target/ARM/ARMInstrNEON.td
U    lib/Target/ARM/ARMISelLowering.h
U    lib/Target/ARM/ARMInstrInfo.td
U    lib/Target/ARM/ARMInstrVFP.td
U    lib/Target/ARM/ARMISelLowering.cpp
U    lib/Target/ARM/ARMInstrFormats.td

llvm-svn: 99010
2010-03-19 22:51:32 +00:00
Anton Korobeynikov
eeae840ed7 Get rid of target-specific fp <-> int nodes when still I'm here.
llvm-svn: 98889
2010-03-18 22:35:45 +00:00
Anton Korobeynikov
23c07f492e Get rid of target-specific nodes for fp16 <-> fp32 conversion.
llvm-svn: 98888
2010-03-18 22:35:37 +00:00
Johnny Chen
54bb1efbe0 Disambiguate the *_UPD and * variants by specifying the writeback flag as 1.
This is for the disassembly work.

There are cases where this is not possible, for example, A8.6.53 LDM Encoding T1.
In such case, we'll use an adhoc approach to deduce the Opcode programmatically.

llvm-svn: 98679
2010-03-16 21:25:05 +00:00
Bob Wilson
aee6e76a7d Remove redundant writeback flag in ARM addressing mode 5.
llvm-svn: 98648
2010-03-16 18:38:09 +00:00
Anton Korobeynikov
48357cdc62 Add codegen support for FP16 on ARM
llvm-svn: 98502
2010-03-14 18:42:31 +00:00
Bob Wilson
163aa28fa1 Attempt to appease the arm-linux buildbot by fixing the JIT encodings for new
base register updating load/store-multiple instructions.

llvm-svn: 98427
2010-03-13 07:34:35 +00:00
Bob Wilson
0e8a3d7a13 Change ARM ld/st multiple instructions to have variant instructions for
writebacks to the address register.  This gets rid of the hack that the
first register on the list was the magic writeback register operand.  There
was an implicit constraint that if that operand was not reg0 it had to match
the base register operand.  The post-RA scheduler's antidependency breaker
did not understand that constraint and sometimes changed one without the
other.  This also fixes Radar 7495976 and should help the verifier work
better for ARM code.

There are now new ld/st instructions explicit writeback operands and explicit
constraints that tie those registers together.

llvm-svn: 98409
2010-03-13 01:08:20 +00:00
Chris Lattner
49ef2cd57b fix a bunch of partially ambiguous patterns on ARM. As an
example, this:

(set DPR:$dst, (fsub (fneg (fmul DPR:$a, DPR:$b)), DPR:$dstin))

is ambiguous because DPR contains both f64 and v2f32.  tblgen
currently accidentally picks f64 because it's first in the 
regclass.

llvm-svn: 97955
2010-03-08 18:51:21 +00:00
Dan Gohman
99c6bcbc13 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +00:00
Johnny Chen
7c088ab119 Added VCVT (between floating-point and fixed-point, VFP) for disassembly.
A8.6.297

llvm-svn: 95885
2010-02-11 18:17:16 +00:00
Johnny Chen
15da54da55 Added VMRS/VMSR for disassembly only.
A8.6.335 & A8.6.336

llvm-svn: 95703
2010-02-09 22:35:38 +00:00
Johnny Chen
de3621cfa8 Added vcvtb/vcvtt (between half-precision and single-precision, VFP).
For disassembly only.

A8.6.300

llvm-svn: 95669
2010-02-09 17:21:56 +00:00
Johnny Chen
396391964d Add VCVTR (between floating-point and integer, VFP) for disassembly purpose.
The 'R' suffix means the to-integer operations use the rounding mode specified
by the FPSCR, encoded as Inst{7} = 0.

A8.6.295

llvm-svn: 95584
2010-02-08 22:02:41 +00:00
Johnny Chen
7092ebb040 Add VCMP (VFP floating-point compare without 'E' bit set) for disassembly purpose.
llvm-svn: 95560
2010-02-08 19:41:48 +00:00
Johnny Chen
92ec9f2887 Added VMOVRRS/VMOVSRR to ARMInstrVFP.td for disassembly purpose.
A8.6.331 VMOV (between two ARM core registers and two single-precision registers)

llvm-svn: 95548
2010-02-08 17:26:09 +00:00
Johnny Chen
0b398e3919 VMOVRRD and VMOVDRR both have Inst{7-6} = 0b00.
llvm-svn: 95397
2010-02-05 18:04:58 +00:00
Johnny Chen
377da9a33c Modified encoding bits specification for VFP instructions. In particular, the D
bit (Inst{22}) and the M bit (Inst{5}) should be left unspecified.  For binary
format instructions, Inst{6} and Inst{4} need to specified for proper decodings.

llvm-svn: 94855
2010-01-29 23:21:10 +00:00
Evan Cheng
179a11776c Data type suffix must come after predicate.
llvm-svn: 89723
2009-11-24 01:05:23 +00:00
Jim Grosbach
76b545e988 move fconst[sd] to UAL. <rdar://7414913>
llvm-svn: 89700
2009-11-23 21:08:25 +00:00
Evan Cheng
9f57c4916e Remat VLDRD from constpool. Clean up some instruction property specifications.
llvm-svn: 89478
2009-11-20 19:57:15 +00:00
Jim Grosbach
85faa3cff1 use lower case for readability
llvm-svn: 87054
2009-11-13 01:17:22 +00:00
Evan Cheng
2c0fc2e713 Add a comment.
llvm-svn: 86706
2009-11-10 19:44:56 +00:00
Jim Grosbach
5b33ce12e3 Work around assembler not recognizing #0.0 form immediate for vmcp
llvm-svn: 86548
2009-11-09 15:27:51 +00:00
Jim Grosbach
ea6c9c17f5 Use Unified Assembly Syntax for the ARM backend.
llvm-svn: 86494
2009-11-09 00:11:35 +00:00
Evan Cheng
519b231883 fconsts and fconstd are obviously re-materializable.
llvm-svn: 85410
2009-10-28 18:19:56 +00:00
Evan Cheng
1babe43881 Use fconsts and fconstd to materialize small fp constants.
llvm-svn: 85362
2009-10-28 01:44:26 +00:00