annotate lib/Target/ARM/ARMScheduleA57.td @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 3a76565eade5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //=- ARMScheduleA57.td - ARM Cortex-A57 Scheduling Defs -----*- tablegen -*-=//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 // This file defines the machine model for ARM Cortex-A57 to support
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 // instruction scheduling and other instruction cost heuristics.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 // *** Common description and scheduling model parameters taken from AArch64 ***
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 // The Cortex-A57 is a traditional superscalar microprocessor with a
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 // conservative 3-wide in-order stage for decode and dispatch. Combined with the
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 // much wider out-of-order issue stage, this produced a need to carefully
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 // schedule micro-ops so that all three decoded each cycle are successfully
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 // issued as the reservation station(s) simply don't stay occupied for long.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 // Therefore, IssueWidth is set to the narrower of the two at three, while still
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 // modeling the machine as out-of-order.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 def IsCPSRDefinedPred : SchedPredicate<[{TII->isCPSRDefined(*MI)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 def IsCPSRDefinedAndPredicatedPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 SchedPredicate<[{TII->isCPSRDefined(*MI) && TII->isPredicated(*MI)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 // Cortex A57 rev. r1p0 or later (false = r0px)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 def IsR1P0AndLaterPred : SchedPredicate<[{false}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 // If Addrmode3 contains register offset (not immediate)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 def IsLdrAm3RegOffPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 // The same predicate with operand offset 2 and 3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 def IsLdrAm3RegOffPredX2 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 2)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 def IsLdrAm3RegOffPredX3 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 SchedPredicate<[{!TII->isAddrMode3OpImm(*MI, 3)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 // If Addrmode3 contains "minus register"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 def IsLdrAm3NegRegOffPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 SchedPredicate<[{TII->isAddrMode3OpMinusReg(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 // The same predicate with operand offset 2 and 3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 def IsLdrAm3NegRegOffPredX2 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 SchedPredicate<[{TII->isAddrMode3OpMinusReg(*MI, 2)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 def IsLdrAm3NegRegOffPredX3 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 SchedPredicate<[{TII->isAddrMode3OpMinusReg(*MI, 3)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 // Load, scaled register offset, not plus LSL2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 def IsLdstsoScaledNotOptimalPredX0 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 SchedPredicate<[{TII->isLdstScaledRegNotPlusLsl2(*MI, 0)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 def IsLdstsoScaledNotOptimalPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 SchedPredicate<[{TII->isLdstScaledRegNotPlusLsl2(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 def IsLdstsoScaledNotOptimalPredX2 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 SchedPredicate<[{TII->isLdstScaledRegNotPlusLsl2(*MI, 2)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 // Load, scaled register offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 def IsLdstsoScaledPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 SchedPredicate<[{TII->isLdstScaledReg(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 def IsLdstsoScaledPredX2 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 SchedPredicate<[{TII->isLdstScaledReg(*MI, 2)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 def IsLdstsoMinusRegPredX0 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 SchedPredicate<[{TII->isLdstSoMinusReg(*MI, 0)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 def IsLdstsoMinusRegPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 SchedPredicate<[{TII->isLdstSoMinusReg(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 def IsLdstsoMinusRegPredX2 :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 SchedPredicate<[{TII->isLdstSoMinusReg(*MI, 2)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 // Load, scaled register offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 def IsLdrAm2ScaledPred :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 SchedPredicate<[{TII->isAm2ScaledReg(*MI, 1)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 // LDM, base reg in list
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 def IsLdmBaseRegInList :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 SchedPredicate<[{TII->isLDMBaseRegInList(*MI)}]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 class A57WriteLMOpsListType<list<SchedWriteRes> writes> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 list <SchedWriteRes> Writes = writes;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 SchedMachineModel SchedModel = ?;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 // *** Common description and scheduling model parameters taken from AArch64 ***
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 // (AArch64SchedA57.td)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 def CortexA57Model : SchedMachineModel {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 let IssueWidth = 3; // 3-way decode and dispatch
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 let MicroOpBufferSize = 128; // 128 micro-op re-order buffer
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88 let LoadLatency = 4; // Optimistic load latency
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 let MispredictPenalty = 16; // Fetch + Decode/Rename/Dispatch + Branch
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 // Enable partial & runtime unrolling.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 let LoopMicroOpBufferSize = 16;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 let CompleteModel = 1;
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
94
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
95 // FIXME: Remove when all errors have been fixed.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
96 let FullInstRWOverlapCheck = 0;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
97
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
98 let UnsupportedFeatures = [HasV8_1MMainline, HasMVEInt, HasMVEFloat,
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
99 HasFPRegsV8_1M];
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 // Define each kind of processor resource and number available on Cortex-A57.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 // Cortex A-57 has 8 pipelines that each has its own 8-entry queue where
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 // micro-ops wait for their operands and then issue out-of-order.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 def A57UnitB : ProcResource<1>; // Type B micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 def A57UnitI : ProcResource<2>; // Type I micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 def A57UnitM : ProcResource<1>; // Type M micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 def A57UnitL : ProcResource<1>; // Type L micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 def A57UnitS : ProcResource<1>; // Type S micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 def A57UnitX : ProcResource<1>; // Type X micro-ops (F1)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 def A57UnitW : ProcResource<1>; // Type W micro-ops (F0)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 let SchedModel = CortexA57Model in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 def A57UnitV : ProcResGroup<[A57UnitX, A57UnitW]>; // Type V micro-ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 let SchedModel = CortexA57Model in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 // Define customized scheduler read/write types specific to the Cortex-A57.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 include "ARMScheduleA57WriteRes.td"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 // To have "CompleteModel = 1", support of pseudos and special instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 def : InstRW<[WriteNoop], (instregex "(t)?BKPT$", "(t2)?CDP(2)?$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 "(t2)?CLREX$", "CONSTPOOL_ENTRY$", "COPY_STRUCT_BYVAL_I32$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130 "(t2)?CPS[123]p$", "(t2)?DBG$", "(t2)?DMB$", "(t2)?DSB$", "ERET$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 "(t2|t)?HINT$", "(t)?HLT$", "(t2)?HVC$", "(t2)?ISB$", "ITasm$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 "(t2)?RFE(DA|DB|IA|IB)", "(t)?SETEND", "(t2)?SETPAN", "(t2)?SMC", "SPACE",
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
133 "(t2)?SRS(DA|DB|IA|IB)", "SWP(B)?", "t?TRAP", "(t2|t)?UDF$", "t2DCPS", "t2SG",
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
134 "t2TT", "tCPS", "CMP_SWAP", "t?SVC", "t2IT", "CompilerBarrier",
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
135 "t__brkdiv0")>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 def : InstRW<[WriteNoop], (instregex "VMRS", "VMSR", "FMSTAT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 // Specific memory instrs
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 def : InstRW<[WriteNoop, WriteNoop], (instregex "(t2)?LDA", "(t2)?LDC", "(t2)?STC",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 "(t2)?STL", "(t2)?LDREX", "(t2)?STREX", "MEMCPY")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 // coprocessor moves
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 def : InstRW<[WriteNoop, WriteNoop], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 "(t2)?MCR(2|R|R2)?$", "(t2)?MRC(2)?$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 "(t2)?MRRC(2)?$", "(t2)?MRS(banked|sys|_AR|_M|sys_AR)?$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 "(t2)?MSR(banked|i|_AR|_M)?$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 // Deprecated instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 def : InstRW<[WriteNoop], (instregex "FLDM", "FSTM")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 // Pseudos
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 def : InstRW<[WriteNoop], (instregex "(t2)?ABS$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154 "(t)?ADJCALLSTACKDOWN$", "(t)?ADJCALLSTACKUP$", "(t2|t)?Int_eh_sjlj",
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
155 "tLDRpci_pic", "(t2)?SUBS_PC_LR",
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 "JUMPTABLE", "tInt_WIN_eh_sjlj_longjmp",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 "VLD(1|2)LN(d|q)(WB_fixed_|WB_register_)?Asm",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 "VLD(3|4)(DUP|LN)?(d|q)(WB_fixed_|WB_register_)?Asm",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 "VST(1|2)LN(d|q)(WB_fixed_|WB_register_)?Asm",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160 "VST(3|4)(DUP|LN)?(d|q)(WB_fixed_|WB_register_)?Asm",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 "WIN__CHKSTK", "WIN__DBZCHK")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 // Miscellaneous
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 // -----------------------------------------------------------------------------
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166 def : InstRW<[A57Write_1cyc_1I], (instrs COPY)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 // --- 3.2 Branch Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 // B, BX, BL, BLX (imm, reg != LR, reg == LR), CBZ, CBNZ
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 def : InstRW<[A57Write_1cyc_1B], (instregex "(t2|t)?B$", "t?BX", "(t2|t)?Bcc$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 "t?TAILJMP(d|r)", "TCRETURN(d|r)i", "tBfar", "tCBN?Z")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 def : InstRW<[A57Write_1cyc_1B_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 (instregex "t?BL$", "BL_pred$", "t?BLXi", "t?TPsoft")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 def : InstRW<[A57Write_2cyc_1B_1I], (instregex "BLX", "tBLX(NS)?r")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 // Pseudos
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 def : InstRW<[A57Write_2cyc_1B_1I], (instregex "BCCi64", "BCCZi64")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 def : InstRW<[A57Write_3cyc_1B_1I], (instregex "BR_JTadd", "t?BR_JTr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 "t2BR_JT", "t2BXJ", "(t2)?TB(B|H)(_JT)?$", "tBRIND")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180 def : InstRW<[A57Write_6cyc_1B_1L], (instregex "BR_JTm")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 // --- 3.3 Arithmetic and Logical Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 // ADD{S}, ADC{S}, ADR, AND{S}, BIC{S}, CMN, CMP, EOR{S}, ORN{S}, ORR{S},
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184 // RSB{S}, RSC{S}, SUB{S}, SBC{S}, TEQ, TST
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 def : InstRW<[A57Write_1cyc_1I], (instregex "tADDframe")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 // shift by register, conditional or unconditional
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 // TODO: according to the doc, conditional uses I0/I1, unconditional uses M
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 // Why more complex instruction uses more simple pipeline?
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 // May be an error in doc.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192 def A57WriteALUsi : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193 // lsl #2, lsl #1, or lsr #1.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 SchedVar<IsPredicatedPred, [A57Write_2cyc_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 SchedVar<NoSchedPred, [A57Write_2cyc_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197 def A57WriteALUsr : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 SchedVar<IsPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 SchedVar<NoSchedPred, [A57Write_2cyc_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 def A57WriteALUSsr : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202 SchedVar<IsPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 SchedVar<NoSchedPred, [A57Write_2cyc_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 def A57ReadALUsr : SchedReadVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206 SchedVar<IsPredicatedPred, [ReadDefault]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 SchedVar<NoSchedPred, [ReadDefault]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 def : SchedAlias<WriteALUsi, A57WriteALUsi>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 def : SchedAlias<WriteALUsr, A57WriteALUsr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 def : SchedAlias<WriteALUSsr, A57WriteALUSsr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212 def : SchedAlias<ReadALUsr, A57ReadALUsr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214 def A57WriteCMPsr : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 SchedVar<IsPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 SchedVar<NoSchedPred, [A57Write_2cyc_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218 def : SchedAlias<WriteCMP, A57Write_1cyc_1I>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 def : SchedAlias<WriteCMPsi, A57Write_2cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 def : SchedAlias<WriteCMPsr, A57WriteCMPsr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 // --- 3.4 Move and Shift Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 // Move, basic
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224 // MOV{S}, MOVW, MVN{S}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 def : InstRW<[A57Write_1cyc_1I], (instregex "MOV(r|i|i16|r_TC)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226 "(t2)?MVN(CC)?(r|i)", "BMOVPCB_CALL", "BMOVPCRX_CALL",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227 "MOVCC(r|i|i16|i32imm)", "tMOV", "tMVN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 // Move, shift by immed, setflags/no setflags
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 // (ASR, LSL, LSR, ROR, RRX)=MOVsi, MVN
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 // setflags = isCPSRDefined
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 def A57WriteMOVsi : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233 SchedVar<IsCPSRDefinedPred, [A57Write_2cyc_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 SchedVar<NoSchedPred, [A57Write_1cyc_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236 def : InstRW<[A57WriteMOVsi], (instregex "MOV(CC)?si", "MVNsi",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 "ASRi", "(t2|t)ASRri", "LSRi", "(t2|t)LSRri", "LSLi", "(t2|t)LSLri", "RORi",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 "(t2|t)RORri", "(t2)?RRX", "t2MOV", "tROR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240 // shift by register, conditional or unconditional, setflags/no setflags
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241 def A57WriteMOVsr : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 SchedVar<IsCPSRDefinedAndPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 SchedVar<IsCPSRDefinedPred, [A57Write_2cyc_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 SchedVar<IsPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245 SchedVar<NoSchedPred, [A57Write_1cyc_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247 def : InstRW<[A57WriteMOVsr], (instregex "MOV(CC)?sr", "MVNsr", "t2MVNs",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248 "ASRr", "(t2|t)ASRrr", "LSRr", "(t2|t)LSRrr", "LSLr", "(t2|t)?LSLrr", "RORr",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 "(t2|t)RORrr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 // Move, top
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 // MOVT - A57Write_2cyc_1M for r0px, A57Write_1cyc_1I for r1p0 and later
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253 def A57WriteMOVT : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 SchedVar<IsR1P0AndLaterPred, [A57Write_1cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 SchedVar<NoSchedPred, [A57Write_2cyc_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257 def : InstRW<[A57WriteMOVT], (instregex "MOVTi16")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259 def A57WriteI2pc :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260 WriteSequence<[A57Write_1cyc_1I, A57Write_1cyc_1I, A57Write_1cyc_1I]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261 def A57WriteI2ld :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262 WriteSequence<[A57Write_1cyc_1I, A57Write_1cyc_1I, A57Write_4cyc_1L]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 def : InstRW< [A57WriteI2pc], (instregex "MOV_ga_pcrel")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 def : InstRW< [A57WriteI2ld], (instregex "MOV_ga_pcrel_ldr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266 // +2cyc for branch forms
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267 def : InstRW<[A57Write_3cyc_1I], (instregex "MOVPC(LR|RX)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269 // --- 3.5 Divide and Multiply Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 // Divide: SDIV, UDIV
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271 // latency from documentration: 4 ­‐ 20, maximum taken
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 def : SchedAlias<WriteDIV, A57Write_20cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273 // Multiply: tMul not bound to common WriteRes types
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 def : InstRW<[A57Write_3cyc_1M], (instregex "tMUL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 def : SchedAlias<WriteMUL16, A57Write_3cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 def : SchedAlias<WriteMUL32, A57Write_3cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 def : ReadAdvance<ReadMUL, 0>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279 // Multiply accumulate: MLA, MLS, SMLABB, SMLABT, SMLATB, SMLATT, SMLAWB,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280 // SMLAWT, SMLAD{X}, SMLSD{X}, SMMLA{R}, SMMLS{R}
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281 // Multiply-accumulate pipelines support late-forwarding of accumulate operands
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282 // from similar μops, allowing a typical sequence of multiply-accumulate μops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 // to issue one every 1 cycle (sched advance = 2).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 def A57WriteMLA : SchedWriteRes<[A57UnitM]> { let Latency = 3; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285 def A57WriteMLAL : SchedWriteRes<[A57UnitM]> { let Latency = 4; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286 def A57ReadMLA : SchedReadAdvance<2, [A57WriteMLA, A57WriteMLAL]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
288 def : InstRW<[A57WriteMLA],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
289 (instregex "t2SMLAD", "t2SMLADX", "t2SMLSD", "t2SMLSDX")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
290
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291 def : SchedAlias<WriteMAC16, A57WriteMLA>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 def : SchedAlias<WriteMAC32, A57WriteMLA>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
293 def : SchedAlias<ReadMAC, A57ReadMLA>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
294
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
295 def : SchedAlias<WriteMAC64Lo, A57WriteMLAL>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
296 def : SchedAlias<WriteMAC64Hi, A57WriteMLAL>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
297
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
298 // Multiply long: SMULL, UMULL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
299 def : SchedAlias<WriteMUL64Lo, A57Write_4cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
300 def : SchedAlias<WriteMUL64Hi, A57Write_4cyc_1M>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
301
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
302 // --- 3.6 Saturating and Parallel Arithmetic Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
303 // Parallel arith
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
304 // SADD16, SADD8, SSUB16, SSUB8, UADD16, UADD8, USUB16, USUB8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
305 // Conditional GE-setting instructions require three extra μops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
306 // and two additional cycles to conditionally update the GE field.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
307 def A57WriteParArith : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
308 SchedVar<IsPredicatedPred, [A57Write_4cyc_1I_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
309 SchedVar<NoSchedPred, [A57Write_2cyc_1I_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
310 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
311 def : InstRW< [A57WriteParArith], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
312 "(t2)?SADD(16|8)", "(t2)?SSUB(16|8)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
313 "(t2)?UADD(16|8)", "(t2)?USUB(16|8)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
314
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
315 // Parallel arith with exchange: SASX, SSAX, UASX, USAX
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
316 def A57WriteParArithExch : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
317 SchedVar<IsPredicatedPred, [A57Write_5cyc_1I_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
318 SchedVar<NoSchedPred, [A57Write_3cyc_1I_1M]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
319 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
320 def : InstRW<[A57WriteParArithExch],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
321 (instregex "(t2)?SASX", "(t2)?SSAX", "(t2)?UASX", "(t2)?USAX")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
322
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
323 // Parallel halving arith
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
324 // SHADD16, SHADD8, SHSUB16, SHSUB8, UHADD16, UHADD8, UHSUB16, UHSUB8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
325 def : InstRW<[A57Write_2cyc_1M], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
326 "(t2)?SHADD(16|8)", "(t2)?SHSUB(16|8)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
327 "(t2)?UHADD(16|8)", "(t2)?UHSUB(16|8)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
328
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
329 // Parallel halving arith with exchange
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
330 // SHASX, SHSAX, UHASX, UHSAX
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
331 def : InstRW<[A57Write_3cyc_1I_1M], (instregex "(t2)?SHASX", "(t2)?SHSAX",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
332 "(t2)?UHASX", "(t2)?UHSAX")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
333
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
334 // Parallel saturating arith
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
335 // QADD16, QADD8, QSUB16, QSUB8, UQADD16, UQADD8, UQSUB16, UQSUB8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
336 def : InstRW<[A57Write_2cyc_1M], (instregex "QADD(16|8)", "QSUB(16|8)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
337 "UQADD(16|8)", "UQSUB(16|8)", "t2(U?)QADD", "t2(U?)QSUB")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
338
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
339 // Parallel saturating arith with exchange
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
340 // QASX, QSAX, UQASX, UQSAX
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
341 def : InstRW<[A57Write_3cyc_1I_1M], (instregex "(t2)?QASX", "(t2)?QSAX",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
342 "(t2)?UQASX", "(t2)?UQSAX")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
343
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
344 // Saturate: SSAT, SSAT16, USAT, USAT16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
345 def : InstRW<[A57Write_2cyc_1M],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
346 (instregex "(t2)?SSAT(16)?", "(t2)?USAT(16)?")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
347
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
348 // Saturating arith: QADD, QSUB
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
349 def : InstRW<[A57Write_2cyc_1M], (instregex "QADD$", "QSUB$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
350
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
351 // Saturating doubling arith: QDADD, QDSUB
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
352 def : InstRW<[A57Write_3cyc_1I_1M], (instregex "(t2)?QDADD", "(t2)?QDSUB")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
353
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
354 // --- 3.7 Miscellaneous Data-Processing Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
355 // Bit field extract: SBFX, UBFX
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
356 def : InstRW<[A57Write_1cyc_1I], (instregex "(t2)?SBFX", "(t2)?UBFX")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
357
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
358 // Bit field insert/clear: BFI, BFC
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
359 def : InstRW<[A57Write_2cyc_1M], (instregex "(t2)?BFI", "(t2)?BFC")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
360
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
361 // Select bytes, conditional/unconditional
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
362 def A57WriteSEL : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
363 SchedVar<IsPredicatedPred, [A57Write_2cyc_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
364 SchedVar<NoSchedPred, [A57Write_1cyc_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
365 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
366 def : InstRW<[A57WriteSEL], (instregex "(t2)?SEL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
367
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
368 // Sign/zero extend, normal: SXTB, SXTH, UXTB, UXTH
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
369 def : InstRW<[A57Write_1cyc_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
370 (instregex "(t2|t)?SXT(B|H)$", "(t2|t)?UXT(B|H)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
371
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
372 // Sign/zero extend and add, normal: SXTAB, SXTAH, UXTAB, UXTAH
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
373 def : InstRW<[A57Write_2cyc_1M],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
374 (instregex "(t2)?SXTA(B|H)$", "(t2)?UXTA(B|H)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
375
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
376 // Sign/zero extend and add, parallel: SXTAB16, UXTAB16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
377 def : InstRW<[A57Write_4cyc_1M], (instregex "(t2)?SXTAB16", "(t2)?UXTAB16")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
378
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
379 // Sum of absolute differences: USAD8, USADA8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
380 def : InstRW<[A57Write_3cyc_1M], (instregex "(t2)?USAD8", "(t2)?USADA8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
381
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
382 // --- 3.8 Load Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
383
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
384 // Load, immed offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
385 // LDR and LDRB have LDRi12 and LDRBi12 forms for immediate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
386 def : InstRW<[A57Write_4cyc_1L], (instregex "LDRi12", "LDRBi12",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
387 "LDRcp", "(t2|t)?LDRConstPool", "LDRLIT_ga_(pcrel|abs)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
388 "PICLDR", "tLDR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
389
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
390 def : InstRW<[A57Write_4cyc_1L],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
391 (instregex "t2LDRS?(B|H)?(pcrel|T|i8|i12|pci|pci_pic|s)?$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
392
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
393 // For "Load, register offset, minus" we need +1cyc, +1I
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
394 def A57WriteLdrAm3 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
395 SchedVar<IsLdrAm3NegRegOffPred, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
396 SchedVar<NoSchedPred, [A57Write_4cyc_1L]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
397 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
398 def : InstRW<[A57WriteLdrAm3], (instregex "LDR(H|SH|SB)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
399 def A57WriteLdrAm3X2 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
400 SchedVar<IsLdrAm3NegRegOffPredX2, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
401 SchedVar<NoSchedPred, [A57Write_4cyc_1L]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
402 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
403 def : InstRW<[A57WriteLdrAm3X2, A57WriteLdrAm3X2], (instregex "LDRD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
404 def : InstRW<[A57Write_4cyc_1L, A57Write_4cyc_1L], (instregex "t2LDRDi8")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
405
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
406 def A57WriteLdrAmLDSTSO : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
407 SchedVar<IsLdstsoScaledNotOptimalPred, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
408 SchedVar<IsLdstsoMinusRegPred, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
409 SchedVar<NoSchedPred, [A57Write_4cyc_1L]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
410 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
411 def : InstRW<[A57WriteLdrAmLDSTSO], (instregex "LDRrs", "LDRBrs")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
412
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
413 def A57WrBackOne : SchedWriteRes<[]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
414 let Latency = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
415 let NumMicroOps = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
416 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
417 def A57WrBackTwo : SchedWriteRes<[]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
418 let Latency = 2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
419 let NumMicroOps = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
420 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
421 def A57WrBackThree : SchedWriteRes<[]> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
422 let Latency = 3;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
423 let NumMicroOps = 0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
424 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
425
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
426 // --- LDR pre-indexed ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
427 // Load, immed pre-indexed (4 cyc for load result, 1 cyc for Base update)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
428 def : InstRW<[A57Write_4cyc_1L_1I, A57WrBackOne], (instregex "LDR_PRE_IMM",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
429 "LDRB_PRE_IMM", "t2LDRB_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
430
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
431 // Load, register pre-indexed (4 cyc for load result, 2 cyc for Base update)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
432 // (5 cyc load result for not-lsl2 scaled)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
433 def A57WriteLdrAmLDSTSOPre : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
434 SchedVar<IsLdstsoScaledNotOptimalPredX2, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
435 SchedVar<NoSchedPred, [A57Write_4cyc_1L_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
436 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
437 def : InstRW<[A57WriteLdrAmLDSTSOPre, A57WrBackTwo],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
438 (instregex "LDR_PRE_REG", "LDRB_PRE_REG")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
439
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
440 def A57WriteLdrAm3PreWrBack : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
441 SchedVar<IsLdrAm3RegOffPredX2, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
442 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
443 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
444 def : InstRW<[A57Write_4cyc_1L, A57WriteLdrAm3PreWrBack],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
445 (instregex "LDR(H|SH|SB)_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
446 def : InstRW<[A57Write_4cyc_1L, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
447 (instregex "t2LDR(H|SH|SB)?_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
448
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
449 // LDRD pre-indexed: 5(2) cyc for reg, 4(1) cyc for imm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
450 def A57WriteLdrDAm3Pre : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
451 SchedVar<IsLdrAm3RegOffPredX3, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
452 SchedVar<NoSchedPred, [A57Write_4cyc_1L_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
453 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
454 def A57WriteLdrDAm3PreWrBack : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
455 SchedVar<IsLdrAm3RegOffPredX3, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
456 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
457 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
458 def : InstRW<[A57WriteLdrDAm3Pre, A57WriteLdrDAm3Pre, A57WriteLdrDAm3PreWrBack],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
459 (instregex "LDRD_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
460 def : InstRW<[A57Write_4cyc_1L_1I, A57Write_4cyc_1L_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
461 (instregex "t2LDRD_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
462
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
463 // --- LDR post-indexed ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
464 def : InstRW<[A57Write_4cyc_1L_1I, A57WrBackOne], (instregex "LDR(T?)_POST_IMM",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
465 "LDRB(T?)_POST_IMM", "LDR(SB|H|SH)Ti", "t2LDRB_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
466
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
467 def A57WriteLdrAm3PostWrBack : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
468 SchedVar<IsLdrAm3RegOffPred, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
469 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
470 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
471 def : InstRW<[A57Write_4cyc_1L_1I, A57WriteLdrAm3PostWrBack],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
472 (instregex "LDR(H|SH|SB)_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
473 def : InstRW<[A57Write_4cyc_1L, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
474 (instregex "t2LDR(H|SH|SB)?_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
475
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
476 def : InstRW<[A57Write_4cyc_1L_1I, A57WrBackTwo], (instregex "LDR_POST_REG",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
477 "LDRB_POST_REG", "LDR(B?)T_POST$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
478
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
479 def A57WriteLdrTRegPost : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
480 SchedVar<IsLdrAm2ScaledPred, [A57Write_4cyc_1I_1L_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
481 SchedVar<NoSchedPred, [A57Write_4cyc_1L_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
482 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
483 def A57WriteLdrTRegPostWrBack : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
484 SchedVar<IsLdrAm2ScaledPred, [A57WrBackThree]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
485 SchedVar<NoSchedPred, [A57WrBackTwo]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
486 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
487 // 4(3) "I0/I1,L,M" for scaled register, otherwise 4(2) "I0/I1,L"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
488 def : InstRW<[A57WriteLdrTRegPost, A57WriteLdrTRegPostWrBack],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
489 (instregex "LDRT_POST_REG", "LDRBT_POST_REG")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
490
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
491 def : InstRW<[A57Write_4cyc_1L_1I, A57WrBackTwo], (instregex "LDR(SB|H|SH)Tr")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
492
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
493 def A57WriteLdrAm3PostWrBackX3 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
494 SchedVar<IsLdrAm3RegOffPredX3, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
495 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
496 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
497 // LDRD post-indexed: 4(2) cyc for reg, 4(1) cyc for imm.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
498 def : InstRW<[A57Write_4cyc_1L_1I, A57Write_4cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
499 A57WriteLdrAm3PostWrBackX3], (instregex "LDRD_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
500 def : InstRW<[A57Write_4cyc_1L_1I, A57Write_4cyc_1L_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
501 (instregex "t2LDRD_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
502
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
503 // --- Preload instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
504 // Preload, immed offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
505 def : InstRW<[A57Write_4cyc_1L], (instregex "(t2)?PLDi12", "(t2)?PLDWi12",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
506 "t2PLDW?(i8|pci|s)", "(t2)?PLI")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
507
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
508 // Preload, register offset,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
509 // 5cyc "I0/I1,L" for minus reg or scaled not plus lsl2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
510 // otherwise 4cyc "L"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
511 def A57WritePLD : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
512 SchedVar<IsLdstsoScaledNotOptimalPredX0, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
513 SchedVar<IsLdstsoMinusRegPredX0, [A57Write_5cyc_1I_1L]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
514 SchedVar<NoSchedPred, [A57Write_4cyc_1L]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
515 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
516 def : InstRW<[A57WritePLD], (instregex "PLDrs", "PLDWrs")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
517
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
518 // --- Load multiple instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
519 foreach NumAddr = 1-8 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
520 def A57LMAddrPred#NumAddr :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
521 SchedPredicate<"(TII->getLDMVariableDefsSize(*MI)+1)/2 == "#NumAddr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
522 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
523
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
524 def A57LDMOpsListNoregin : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
525 [A57Write_3cyc_1L, A57Write_3cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
526 A57Write_4cyc_1L, A57Write_4cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
527 A57Write_5cyc_1L, A57Write_5cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
528 A57Write_6cyc_1L, A57Write_6cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
529 A57Write_7cyc_1L, A57Write_7cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
530 A57Write_8cyc_1L, A57Write_8cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
531 A57Write_9cyc_1L, A57Write_9cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
532 A57Write_10cyc_1L, A57Write_10cyc_1L]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
533 def A57WriteLDMnoreginlist : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
534 SchedVar<A57LMAddrPred1, A57LDMOpsListNoregin.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
535 SchedVar<A57LMAddrPred2, A57LDMOpsListNoregin.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
536 SchedVar<A57LMAddrPred3, A57LDMOpsListNoregin.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
537 SchedVar<A57LMAddrPred4, A57LDMOpsListNoregin.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
538 SchedVar<A57LMAddrPred5, A57LDMOpsListNoregin.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
539 SchedVar<A57LMAddrPred6, A57LDMOpsListNoregin.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
540 SchedVar<A57LMAddrPred7, A57LDMOpsListNoregin.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
541 SchedVar<A57LMAddrPred8, A57LDMOpsListNoregin.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
542 SchedVar<NoSchedPred, A57LDMOpsListNoregin.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
543 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
544
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
545 def A57LDMOpsListRegin : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
546 [A57Write_4cyc_1L_1I, A57Write_4cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
547 A57Write_5cyc_1L_1I, A57Write_5cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
548 A57Write_6cyc_1L_1I, A57Write_6cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
549 A57Write_7cyc_1L_1I, A57Write_7cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
550 A57Write_8cyc_1L_1I, A57Write_8cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
551 A57Write_9cyc_1L_1I, A57Write_9cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
552 A57Write_10cyc_1L_1I, A57Write_10cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
553 A57Write_11cyc_1L_1I, A57Write_11cyc_1L_1I]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
554 def A57WriteLDMreginlist : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
555 SchedVar<A57LMAddrPred1, A57LDMOpsListRegin.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
556 SchedVar<A57LMAddrPred2, A57LDMOpsListRegin.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
557 SchedVar<A57LMAddrPred3, A57LDMOpsListRegin.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
558 SchedVar<A57LMAddrPred4, A57LDMOpsListRegin.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
559 SchedVar<A57LMAddrPred5, A57LDMOpsListRegin.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
560 SchedVar<A57LMAddrPred6, A57LDMOpsListRegin.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
561 SchedVar<A57LMAddrPred7, A57LDMOpsListRegin.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
562 SchedVar<A57LMAddrPred8, A57LDMOpsListRegin.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
563 SchedVar<NoSchedPred, A57LDMOpsListRegin.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
564 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
565
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
566 def A57LDMOpsList_Upd : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
567 [A57WrBackOne,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
568 A57Write_3cyc_1L_1I, A57Write_3cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
569 A57Write_4cyc_1L_1I, A57Write_4cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
570 A57Write_5cyc_1L_1I, A57Write_5cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
571 A57Write_6cyc_1L_1I, A57Write_6cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
572 A57Write_7cyc_1L_1I, A57Write_7cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
573 A57Write_8cyc_1L_1I, A57Write_8cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
574 A57Write_9cyc_1L_1I, A57Write_9cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
575 A57Write_10cyc_1L_1I, A57Write_10cyc_1L_1I]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
576 def A57WriteLDM_Upd : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
577 SchedVar<A57LMAddrPred1, A57LDMOpsList_Upd.Writes[0-2]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
578 SchedVar<A57LMAddrPred2, A57LDMOpsList_Upd.Writes[0-4]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
579 SchedVar<A57LMAddrPred3, A57LDMOpsList_Upd.Writes[0-6]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
580 SchedVar<A57LMAddrPred4, A57LDMOpsList_Upd.Writes[0-8]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
581 SchedVar<A57LMAddrPred5, A57LDMOpsList_Upd.Writes[0-10]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
582 SchedVar<A57LMAddrPred6, A57LDMOpsList_Upd.Writes[0-12]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
583 SchedVar<A57LMAddrPred7, A57LDMOpsList_Upd.Writes[0-14]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
584 SchedVar<A57LMAddrPred8, A57LDMOpsList_Upd.Writes[0-16]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
585 SchedVar<NoSchedPred, A57LDMOpsList_Upd.Writes[0-16]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
586 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
587
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
588 def A57WriteLDM : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
589 SchedVar<IsLdmBaseRegInList, [A57WriteLDMreginlist]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
590 SchedVar<NoSchedPred, [A57WriteLDMnoreginlist]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
591 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
592
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
593 def : InstRW<[A57WriteLDM], (instregex "(t|t2|sys)?LDM(IA|DA|DB|IB)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
594
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
595 // TODO: no writeback latency defined in documentation (implemented as 1 cyc)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
596 def : InstRW<[A57WriteLDM_Upd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
597 (instregex "(t|t2|sys)?LDM(IA_UPD|DA_UPD|DB_UPD|IB_UPD|IA_RET)", "tPOP")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
598
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
599 def : InstRW<[A57Write_5cyc_1L], (instregex "VLLDM")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
600
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
601 // --- 3.9 Store Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
602
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
603 // Store, immed offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
604 def : InstRW<[A57Write_1cyc_1S], (instregex "STRi12", "STRBi12", "PICSTR",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
605 "t2STR(B?)(T|i12|i8|s)", "t2STRDi8", "t2STRH(i12|i8|s)", "tSTR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
606
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
607 // Store, register offset
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
608 // For minus or for not plus lsl2 scaled we need 3cyc "I0/I1, S",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
609 // otherwise 1cyc S.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
610 def A57WriteStrAmLDSTSO : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
611 SchedVar<IsLdstsoScaledNotOptimalPred, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
612 SchedVar<IsLdstsoMinusRegPred, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
613 SchedVar<NoSchedPred, [A57Write_1cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
614 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
615 def : InstRW<[A57WriteStrAmLDSTSO], (instregex "STRrs", "STRBrs")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
616
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
617 // STRH,STRD: 3cyc "I0/I1, S" for minus reg, 1cyc S for imm or for plus reg.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
618 def A57WriteStrAm3 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
619 SchedVar<IsLdrAm3NegRegOffPred, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
620 SchedVar<NoSchedPred, [A57Write_1cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
621 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
622 def : InstRW<[A57WriteStrAm3], (instregex "STRH$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
623 def A57WriteStrAm3X2 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
624 SchedVar<IsLdrAm3NegRegOffPredX2, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
625 SchedVar<NoSchedPred, [A57Write_1cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
626 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
627 def : InstRW<[A57WriteStrAm3X2], (instregex "STRD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
628
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
629 // Store, immed pre-indexed (1cyc "S, I0/I1", 1cyc writeback)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
630 def : InstRW<[A57WrBackOne, A57Write_1cyc_1S_1I], (instregex "STR_PRE_IMM",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
631 "STRB_PRE_IMM", "STR(B)?(r|i)_preidx", "(t2)?STRH_(preidx|PRE)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
632 "t2STR(B?)_(PRE|preidx)", "t2STRD_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
633
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
634 // Store, register pre-indexed:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
635 // 1(1) "S, I0/I1" for plus reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
636 // 3(2) "I0/I1, S" for minus reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
637 // 1(2) "S, M" for scaled plus lsl2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
638 // 3(2) "I0/I1, S" for other scaled
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
639 def A57WriteStrAmLDSTSOPre : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
640 SchedVar<IsLdstsoScaledNotOptimalPredX2, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
641 SchedVar<IsLdstsoMinusRegPredX2, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
642 SchedVar<IsLdstsoScaledPredX2, [A57Write_1cyc_1S_1M]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
643 SchedVar<NoSchedPred, [A57Write_1cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
644 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
645 def A57WriteStrAmLDSTSOPreWrBack : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
646 SchedVar<IsLdstsoScaledPredX2, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
647 SchedVar<IsLdstsoMinusRegPredX2, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
648 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
649 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
650 def : InstRW<[A57WriteStrAmLDSTSOPreWrBack, A57WriteStrAmLDSTSOPre],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
651 (instregex "STR_PRE_REG", "STRB_PRE_REG")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
652
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
653 // pre-indexed STRH/STRD (STRH_PRE, STRD_PRE)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
654 // 1(1) "S, I0/I1" for imm or reg plus
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
655 // 3(2) "I0/I1, S" for reg minus
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
656 def A57WriteStrAm3PreX2 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
657 SchedVar<IsLdrAm3NegRegOffPredX2, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
658 SchedVar<NoSchedPred, [A57Write_1cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
659 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
660 def A57WriteStrAm3PreWrBackX2 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
661 SchedVar<IsLdrAm3NegRegOffPredX2, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
662 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
663 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
664 def : InstRW<[A57WriteStrAm3PreWrBackX2, A57WriteStrAm3PreX2],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
665 (instregex "STRH_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
666
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
667 def A57WriteStrAm3PreX3 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
668 SchedVar<IsLdrAm3NegRegOffPredX3, [A57Write_3cyc_1I_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
669 SchedVar<NoSchedPred, [A57Write_1cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
670 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
671 def A57WriteStrAm3PreWrBackX3 : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
672 SchedVar<IsLdrAm3NegRegOffPredX3, [A57WrBackTwo]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
673 SchedVar<NoSchedPred, [A57WrBackOne]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
674 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
675 def : InstRW<[A57WriteStrAm3PreWrBackX3, A57WriteStrAm3PreX3],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
676 (instregex "STRD_PRE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
677
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
678 def : InstRW<[A57WrBackOne, A57Write_1cyc_1S_1I], (instregex "STR(T?)_POST_IMM",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
679 "STRB(T?)_POST_IMM", "t2STR(B?)_POST")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
680
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
681 // 1(2) "S, M" for STR/STRB register post-indexed (both scaled or not)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
682 def : InstRW<[A57WrBackTwo, A57Write_1cyc_1S_1M], (instregex "STR(T?)_POST_REG",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
683 "STRB(T?)_POST_REG", "STR(B?)T_POST$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
684
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
685 // post-indexed STRH/STRD(STRH_POST, STRD_POST), STRHTi, STRHTr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
686 // 1(1) "S, I0/I1" both for reg or imm
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
687 def : InstRW<[A57WrBackOne, A57Write_1cyc_1S_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
688 (instregex "(t2)?STR(H|D)_POST", "STRHT(i|r)", "t2STRHT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
689
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
690 // --- Store multiple instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
691 // TODO: no writeback latency defined in documentation
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
692 def A57WriteSTM : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
693 SchedVar<A57LMAddrPred1, [A57Write_1cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
694 SchedVar<A57LMAddrPred2, [A57Write_2cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
695 SchedVar<A57LMAddrPred3, [A57Write_3cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
696 SchedVar<A57LMAddrPred4, [A57Write_4cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
697 SchedVar<A57LMAddrPred5, [A57Write_5cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
698 SchedVar<A57LMAddrPred6, [A57Write_6cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
699 SchedVar<A57LMAddrPred7, [A57Write_7cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
700 SchedVar<A57LMAddrPred8, [A57Write_8cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
701 SchedVar<NoSchedPred, [A57Write_2cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
702 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
703 def A57WriteSTM_Upd : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
704 SchedVar<A57LMAddrPred1, [A57Write_1cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
705 SchedVar<A57LMAddrPred2, [A57Write_2cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
706 SchedVar<A57LMAddrPred3, [A57Write_3cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
707 SchedVar<A57LMAddrPred4, [A57Write_4cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
708 SchedVar<A57LMAddrPred5, [A57Write_5cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
709 SchedVar<A57LMAddrPred6, [A57Write_6cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
710 SchedVar<A57LMAddrPred7, [A57Write_7cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
711 SchedVar<A57LMAddrPred8, [A57Write_8cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
712 SchedVar<NoSchedPred, [A57Write_2cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
713 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
714
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
715 def : InstRW<[A57WriteSTM], (instregex "(t2|sys|t)?STM(IA|DA|DB|IB)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
716 def : InstRW<[A57WrBackOne, A57WriteSTM_Upd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
717 (instregex "(t2|sys|t)?STM(IA_UPD|DA_UPD|DB_UPD|IB_UPD)", "tPUSH")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
718
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
719 def : InstRW<[A57Write_5cyc_1S], (instregex "VLSTM")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
720
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
721 // --- 3.10 FP Data Processing Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
722 def : SchedAlias<WriteFPALU32, A57Write_5cyc_1V>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
723 def : SchedAlias<WriteFPALU64, A57Write_5cyc_1V>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
724
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
725 def : InstRW<[A57Write_3cyc_1V], (instregex "VABS(S|D|H)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
726
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
727 // fp compare - 3cyc F1 for unconditional, 6cyc "F0/F1, F1" for conditional
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
728 def A57WriteVcmp : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
729 SchedVar<IsPredicatedPred, [A57Write_6cyc_1V_1X]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
730 SchedVar<NoSchedPred, [A57Write_3cyc_1X]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
731 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
732 def : InstRW<[A57WriteVcmp],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
733 (instregex "VCMP(D|S|H|ZD|ZS|ZH)$", "VCMPE(D|S|H|ZD|ZS|ZH)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
734
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
735 // fp convert
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
736 def : InstRW<[A57Write_5cyc_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
737 "VCVT(A|N|P|M)(SH|UH|SS|US|SD|UD)", "VCVT(BDH|THD|TDH)")>;
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
738 def : InstRW<[A57Write_5cyc_1V], (instregex "VTOSLS", "VTOUHS", "VTOULS")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
739 def : SchedAlias<WriteFPCVT, A57Write_5cyc_1V>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
740
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
741 def : InstRW<[A57Write_5cyc_1V], (instregex "VJCVT")>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
742
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
743 // FP round to integral
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
744 def : InstRW<[A57Write_5cyc_1V], (instregex "VRINT(A|N|P|M|Z|R|X)(H|S|D)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
745
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
746 // FP divide, FP square root
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
747 def : SchedAlias<WriteFPDIV32, A57Write_17cyc_1W>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
748 def : SchedAlias<WriteFPDIV64, A57Write_32cyc_1W>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
749 def : SchedAlias<WriteFPSQRT32, A57Write_17cyc_1W>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
750 def : SchedAlias<WriteFPSQRT64, A57Write_32cyc_1W>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
751
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
752 def : InstRW<[A57Write_17cyc_1W], (instregex "VSQRTH")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
753
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
754 // FP max/min
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
755 def : InstRW<[A57Write_5cyc_1V], (instregex "VMAX", "VMIN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
756
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
757 // FP multiply-accumulate pipelines support late forwarding of the result
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
758 // from FP multiply μops to the accumulate operands of an
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
759 // FP multiply-accumulate μop. The latter can potentially be issued 1 cycle
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
760 // after the FP multiply μop has been issued
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
761 // FP multiply, FZ
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
762 def A57WriteVMUL : SchedWriteRes<[A57UnitV]> { let Latency = 5; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
763
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
764 def : SchedAlias<WriteFPMUL32, A57WriteVMUL>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
765 def : SchedAlias<WriteFPMUL64, A57WriteVMUL>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
766 def : ReadAdvance<ReadFPMUL, 0>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
767
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
768 // FP multiply accumulate, FZ: 9cyc "F0/F1" or 4 cyc for sequenced accumulate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
769 // VFMA, VFMS, VFNMA, VFNMS, VMLA, VMLS, VNMLA, VNMLS
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
770 def A57WriteVFMA : SchedWriteRes<[A57UnitV]> { let Latency = 9; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
771
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
772 // VFMA takes 9 cyc for common case and 4 cyc for VFMA->VFMA chain (5 read adv.)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
773 // VMUL takes 5 cyc for common case and 1 cyc for VMUL->VFMA chain (4 read adv.)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
774 // Currently, there is no way to define different read advances for VFMA operand
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
775 // from VFMA or from VMUL, so there will be 5 read advance.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
776 // Zero latency (instead of one) for VMUL->VFMA shouldn't break something.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
777 // The same situation with ASIMD VMUL/VFMA instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
778 // def A57ReadVFMA : SchedRead;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
779 // def : ReadAdvance<A57ReadVFMA, 5, [A57WriteVFMA]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
780 // def : ReadAdvance<A57ReadVFMA, 4, [A57WriteVMUL]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
781 def A57ReadVFMA5 : SchedReadAdvance<5, [A57WriteVFMA, A57WriteVMUL]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
782
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
783 def : SchedAlias<WriteFPMAC32, A57WriteVFMA>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
784 def : SchedAlias<WriteFPMAC64, A57WriteVFMA>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
785 def : SchedAlias<ReadFPMAC, A57ReadVFMA5>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
786
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
787 // VMLAH/VMLSH are not binded to scheduling classes by default, so here custom:
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
788 def : InstRW<[A57WriteVFMA, A57ReadVFMA5, ReadFPMUL, ReadFPMUL],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
789 (instregex "VMLAH", "VMLSH", "VNMLAH", "VNMLSH")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
790
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
791 def : InstRW<[A57WriteVMUL],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
792 (instregex "VUDOTD", "VSDOTD", "VUDOTQ", "VSDOTQ")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
793
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
794 def : InstRW<[A57Write_3cyc_1V], (instregex "VNEG")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
795 def : InstRW<[A57Write_3cyc_1V], (instregex "VSEL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
796
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
797 // --- 3.11 FP Miscellaneous Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
798 // VMOV: 3cyc "F0/F1" for imm/reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
799 def : InstRW<[A57Write_3cyc_1V], (instregex "FCONST(D|S|H)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
800 def : InstRW<[A57Write_3cyc_1V], (instregex "VMOV(D|S|H)(cc)?$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
801
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
802 def : InstRW<[A57Write_3cyc_1V], (instregex "VINSH")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
803
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
804 // 5cyc L for FP transfer, vfp to core reg,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
805 // 5cyc L for FP transfer, core reg to vfp
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
806 def : SchedAlias<WriteFPMOV, A57Write_5cyc_1L>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
807 // VMOVRRS/VMOVRRD in common code declared with one WriteFPMOV (instead of 2).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
808 def : InstRW<[A57Write_5cyc_1L, A57Write_5cyc_1L], (instregex "VMOV(RRS|RRD)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
809
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
810 // 8cyc "L,F0/F1" for FP transfer, core reg to upper or lower half of vfp D-reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
811 def : InstRW<[A57Write_8cyc_1L_1I], (instregex "VMOVDRR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
812
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
813 // --- 3.12 FP Load Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
814 def : InstRW<[A57Write_5cyc_1L], (instregex "VLDR(D|S|H)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
815
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
816 def : InstRW<[A57Write_5cyc_1L], (instregex "VLDMQIA$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
817
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
818 // FP load multiple (VLDM)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
819
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
820 def A57VLDMOpsListUncond : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
821 [A57Write_5cyc_1L, A57Write_5cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
822 A57Write_6cyc_1L, A57Write_6cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
823 A57Write_7cyc_1L, A57Write_7cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
824 A57Write_8cyc_1L, A57Write_8cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
825 A57Write_9cyc_1L, A57Write_9cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
826 A57Write_10cyc_1L, A57Write_10cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
827 A57Write_11cyc_1L, A57Write_11cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
828 A57Write_12cyc_1L, A57Write_12cyc_1L]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
829 def A57WriteVLDMuncond : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
830 SchedVar<A57LMAddrPred1, A57VLDMOpsListUncond.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
831 SchedVar<A57LMAddrPred2, A57VLDMOpsListUncond.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
832 SchedVar<A57LMAddrPred3, A57VLDMOpsListUncond.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
833 SchedVar<A57LMAddrPred4, A57VLDMOpsListUncond.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
834 SchedVar<A57LMAddrPred5, A57VLDMOpsListUncond.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
835 SchedVar<A57LMAddrPred6, A57VLDMOpsListUncond.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
836 SchedVar<A57LMAddrPred7, A57VLDMOpsListUncond.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
837 SchedVar<A57LMAddrPred8, A57VLDMOpsListUncond.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
838 SchedVar<NoSchedPred, A57VLDMOpsListUncond.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
839 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
840
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
841 def A57VLDMOpsListCond : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
842 [A57Write_5cyc_1L, A57Write_6cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
843 A57Write_7cyc_1L, A57Write_8cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
844 A57Write_9cyc_1L, A57Write_10cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
845 A57Write_11cyc_1L, A57Write_12cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
846 A57Write_13cyc_1L, A57Write_14cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
847 A57Write_15cyc_1L, A57Write_16cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
848 A57Write_17cyc_1L, A57Write_18cyc_1L,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
849 A57Write_19cyc_1L, A57Write_20cyc_1L]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
850 def A57WriteVLDMcond : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
851 SchedVar<A57LMAddrPred1, A57VLDMOpsListCond.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
852 SchedVar<A57LMAddrPred2, A57VLDMOpsListCond.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
853 SchedVar<A57LMAddrPred3, A57VLDMOpsListCond.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
854 SchedVar<A57LMAddrPred4, A57VLDMOpsListCond.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
855 SchedVar<A57LMAddrPred5, A57VLDMOpsListCond.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
856 SchedVar<A57LMAddrPred6, A57VLDMOpsListCond.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
857 SchedVar<A57LMAddrPred7, A57VLDMOpsListCond.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
858 SchedVar<A57LMAddrPred8, A57VLDMOpsListCond.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
859 SchedVar<NoSchedPred, A57VLDMOpsListCond.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
860 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
861
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
862 def A57WriteVLDM : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
863 SchedVar<IsPredicatedPred, [A57WriteVLDMcond]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
864 SchedVar<NoSchedPred, [A57WriteVLDMuncond]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
865 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
866
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
867 def : InstRW<[A57WriteVLDM], (instregex "VLDM(DIA|SIA)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
868
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
869 def A57VLDMOpsListUncond_Upd : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
870 [A57Write_5cyc_1L_1I, A57Write_5cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
871 A57Write_6cyc_1L_1I, A57Write_6cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
872 A57Write_7cyc_1L_1I, A57Write_7cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
873 A57Write_8cyc_1L_1I, A57Write_8cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
874 A57Write_9cyc_1L_1I, A57Write_9cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
875 A57Write_10cyc_1L_1I, A57Write_10cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
876 A57Write_11cyc_1L_1I, A57Write_11cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
877 A57Write_12cyc_1L_1I, A57Write_12cyc_1L_1I]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
878 def A57WriteVLDMuncond_UPD : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
879 SchedVar<A57LMAddrPred1, A57VLDMOpsListUncond_Upd.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
880 SchedVar<A57LMAddrPred2, A57VLDMOpsListUncond_Upd.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
881 SchedVar<A57LMAddrPred3, A57VLDMOpsListUncond_Upd.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
882 SchedVar<A57LMAddrPred4, A57VLDMOpsListUncond_Upd.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
883 SchedVar<A57LMAddrPred5, A57VLDMOpsListUncond_Upd.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
884 SchedVar<A57LMAddrPred6, A57VLDMOpsListUncond_Upd.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
885 SchedVar<A57LMAddrPred7, A57VLDMOpsListUncond_Upd.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
886 SchedVar<A57LMAddrPred8, A57VLDMOpsListUncond_Upd.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
887 SchedVar<NoSchedPred, A57VLDMOpsListUncond_Upd.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
888 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
889
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
890 def A57VLDMOpsListCond_Upd : A57WriteLMOpsListType<
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
891 [A57Write_5cyc_1L_1I, A57Write_6cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
892 A57Write_7cyc_1L_1I, A57Write_8cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
893 A57Write_9cyc_1L_1I, A57Write_10cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
894 A57Write_11cyc_1L_1I, A57Write_12cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
895 A57Write_13cyc_1L_1I, A57Write_14cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
896 A57Write_15cyc_1L_1I, A57Write_16cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
897 A57Write_17cyc_1L_1I, A57Write_18cyc_1L_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
898 A57Write_19cyc_1L_1I, A57Write_20cyc_1L_1I]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
899 def A57WriteVLDMcond_UPD : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
900 SchedVar<A57LMAddrPred1, A57VLDMOpsListCond_Upd.Writes[0-1]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
901 SchedVar<A57LMAddrPred2, A57VLDMOpsListCond_Upd.Writes[0-3]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
902 SchedVar<A57LMAddrPred3, A57VLDMOpsListCond_Upd.Writes[0-5]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
903 SchedVar<A57LMAddrPred4, A57VLDMOpsListCond_Upd.Writes[0-7]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
904 SchedVar<A57LMAddrPred5, A57VLDMOpsListCond_Upd.Writes[0-9]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
905 SchedVar<A57LMAddrPred6, A57VLDMOpsListCond_Upd.Writes[0-11]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
906 SchedVar<A57LMAddrPred7, A57VLDMOpsListCond_Upd.Writes[0-13]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
907 SchedVar<A57LMAddrPred8, A57VLDMOpsListCond_Upd.Writes[0-15]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
908 SchedVar<NoSchedPred, A57VLDMOpsListCond_Upd.Writes[0-15]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
909 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
910
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
911 def A57WriteVLDM_UPD : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
912 SchedVar<IsPredicatedPred, [A57WriteVLDMcond_UPD]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
913 SchedVar<NoSchedPred, [A57WriteVLDMuncond_UPD]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
914 ]> { let Variadic=1; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
915
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
916 def : InstRW<[A57WrBackOne, A57WriteVLDM_UPD],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
917 (instregex "VLDM(DIA_UPD|DDB_UPD|SIA_UPD|SDB_UPD)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
918
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
919 // --- 3.13 FP Store Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
920 def : InstRW<[A57Write_1cyc_1S], (instregex "VSTR(D|S|H)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
921
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
922 def : InstRW<[A57Write_2cyc_1S], (instregex "VSTMQIA$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
923
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
924 def A57WriteVSTMs : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
925 SchedVar<A57LMAddrPred1, [A57Write_1cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
926 SchedVar<A57LMAddrPred2, [A57Write_2cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
927 SchedVar<A57LMAddrPred3, [A57Write_3cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
928 SchedVar<A57LMAddrPred4, [A57Write_4cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
929 SchedVar<A57LMAddrPred5, [A57Write_5cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
930 SchedVar<A57LMAddrPred6, [A57Write_6cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
931 SchedVar<A57LMAddrPred7, [A57Write_7cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
932 SchedVar<A57LMAddrPred8, [A57Write_8cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
933 SchedVar<NoSchedPred, [A57Write_2cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
934 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
935 def A57WriteVSTMd : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
936 SchedVar<A57LMAddrPred1, [A57Write_2cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
937 SchedVar<A57LMAddrPred2, [A57Write_4cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
938 SchedVar<A57LMAddrPred3, [A57Write_6cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
939 SchedVar<A57LMAddrPred4, [A57Write_8cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
940 SchedVar<A57LMAddrPred5, [A57Write_10cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
941 SchedVar<A57LMAddrPred6, [A57Write_12cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
942 SchedVar<A57LMAddrPred7, [A57Write_14cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
943 SchedVar<A57LMAddrPred8, [A57Write_16cyc_1S]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
944 SchedVar<NoSchedPred, [A57Write_4cyc_1S]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
945 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
946 def A57WriteVSTMs_Upd : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
947 SchedVar<A57LMAddrPred1, [A57Write_1cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
948 SchedVar<A57LMAddrPred2, [A57Write_2cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
949 SchedVar<A57LMAddrPred3, [A57Write_3cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
950 SchedVar<A57LMAddrPred4, [A57Write_4cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
951 SchedVar<A57LMAddrPred5, [A57Write_5cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
952 SchedVar<A57LMAddrPred6, [A57Write_6cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
953 SchedVar<A57LMAddrPred7, [A57Write_7cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
954 SchedVar<A57LMAddrPred8, [A57Write_8cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
955 SchedVar<NoSchedPred, [A57Write_2cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
956 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
957 def A57WriteVSTMd_Upd : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
958 SchedVar<A57LMAddrPred1, [A57Write_2cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
959 SchedVar<A57LMAddrPred2, [A57Write_4cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
960 SchedVar<A57LMAddrPred3, [A57Write_6cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
961 SchedVar<A57LMAddrPred4, [A57Write_8cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
962 SchedVar<A57LMAddrPred5, [A57Write_10cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
963 SchedVar<A57LMAddrPred6, [A57Write_12cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
964 SchedVar<A57LMAddrPred7, [A57Write_14cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
965 SchedVar<A57LMAddrPred8, [A57Write_16cyc_1S_1I]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
966 SchedVar<NoSchedPred, [A57Write_2cyc_1S_1I]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
967 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
968
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
969 def : InstRW<[A57WriteVSTMs], (instregex "VSTMSIA$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
970 def : InstRW<[A57WriteVSTMd], (instregex "VSTMDIA$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
971 def : InstRW<[A57WrBackOne, A57WriteVSTMs_Upd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
972 (instregex "VSTM(SIA_UPD|SDB_UPD)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
973 def : InstRW<[A57WrBackOne, A57WriteVSTMd_Upd],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
974 (instregex "VSTM(DIA_UPD|DDB_UPD)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
975
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
976 // --- 3.14 ASIMD Integer Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
977
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
978 // ASIMD absolute diff, 3cyc F0/F1 for integer VABD
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
979 def : InstRW<[A57Write_3cyc_1V], (instregex "VABD(s|u)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
980
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
981 // ASIMD absolute diff accum: 4(1) F1 for D-form, 5(2) F1 for Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
982 def A57WriteVABAD : SchedWriteRes<[A57UnitX]> { let Latency = 4; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
983 def A57ReadVABAD : SchedReadAdvance<3, [A57WriteVABAD]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
984 def : InstRW<[A57WriteVABAD, A57ReadVABAD],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
985 (instregex "VABA(s|u)(v8i8|v4i16|v2i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
986 def A57WriteVABAQ : SchedWriteRes<[A57UnitX]> { let Latency = 5; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
987 def A57ReadVABAQ : SchedReadAdvance<3, [A57WriteVABAQ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
988 def : InstRW<[A57WriteVABAQ, A57ReadVABAQ],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
989 (instregex "VABA(s|u)(v16i8|v8i16|v4i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
990
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
991 // ASIMD absolute diff accum long: 4(1) F1 for VABAL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
992 def A57WriteVABAL : SchedWriteRes<[A57UnitX]> { let Latency = 4; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
993 def A57ReadVABAL : SchedReadAdvance<3, [A57WriteVABAL]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
994 def : InstRW<[A57WriteVABAL, A57ReadVABAL], (instregex "VABAL(s|u)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
995
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
996 // ASIMD absolute diff long: 3cyc F0/F1 for VABDL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
997 def : InstRW<[A57Write_3cyc_1V], (instregex "VABDL(s|u)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
998
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
999 // ASIMD arith, basic
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
1000 def : InstRW<[A57Write_3cyc_1V], (instregex "VADDv", "VADDL", "VADDW",
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1001 "VNEG(s8d|s16d|s32d|s8q|s16q|s32q|d|q)",
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
1002 "VPADDi", "VPADDL", "VSUBv", "VSUBL", "VSUBW")>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1003
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1004 // ASIMD arith, complex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1005 def : InstRW<[A57Write_3cyc_1V], (instregex "VABS", "VADDHN", "VHADD", "VHSUB",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1006 "VQABS", "VQADD", "VQNEG", "VQSUB",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1007 "VRADDHN", "VRHADD", "VRSUBHN", "VSUBHN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1008
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1009 // ASIMD compare
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1010 def : InstRW<[A57Write_3cyc_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1011 (instregex "VCEQ", "VCGE", "VCGT", "VCLE", "VTST", "VCLT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1012
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1013 // ASIMD logical
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1014 def : InstRW<[A57Write_3cyc_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1015 (instregex "VAND", "VBIC", "VMVN", "VORR", "VORN", "VEOR")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1016
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1017 // ASIMD max/min
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1018 def : InstRW<[A57Write_3cyc_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1019 (instregex "(VMAX|VMIN)(s|u)", "(VPMAX|VPMIN)(s8|s16|s32|u8|u16|u32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1020
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1021 // ASIMD multiply, D-form: 5cyc F0 for r0px, 4cyc F0 for r1p0 and later
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1022 // Cortex-A57 r1p0 and later reduce the latency of ASIMD multiply
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1023 // and multiply-with-accumulate instructions relative to r0pX.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1024 def A57WriteVMULD_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1025 SchedVar<IsR1P0AndLaterPred, [A57Write_4cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1026 SchedVar<NoSchedPred, [A57Write_5cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1027 def : InstRW<[A57WriteVMULD_VecInt], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1028 "VMUL(v8i8|v4i16|v2i32|pd)", "VMULsl(v4i16|v2i32)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1029 "VQDMULH(sl)?(v4i16|v2i32)", "VQRDMULH(sl)?(v4i16|v2i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1030
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1031 // ASIMD multiply, Q-form: 6cyc F0 for r0px, 5cyc F0 for r1p0 and later
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1032 def A57WriteVMULQ_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1033 SchedVar<IsR1P0AndLaterPred, [A57Write_5cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1034 SchedVar<NoSchedPred, [A57Write_6cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1035 def : InstRW<[A57WriteVMULQ_VecInt], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1036 "VMUL(v16i8|v8i16|v4i32|pq)", "VMULsl(v8i16|v4i32)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1037 "VQDMULH(sl)?(v8i16|v4i32)", "VQRDMULH(sl)?(v8i16|v4i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1038
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1039 // ASIMD multiply accumulate, D-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1040 // 5cyc F0 for r0px, 4cyc F0 for r1p0 and later, 1cyc for accumulate sequence
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1041 // (4 or 3 ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1042 def A57WriteVMLAD_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1043 SchedVar<IsR1P0AndLaterPred, [A57Write_4cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1044 SchedVar<NoSchedPred, [A57Write_5cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1045 def A57ReadVMLAD_VecInt : SchedReadVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1046 SchedVar<IsR1P0AndLaterPred, [SchedReadAdvance<3, [A57WriteVMLAD_VecInt]>]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1047 SchedVar<NoSchedPred, [SchedReadAdvance<4, [A57WriteVMLAD_VecInt]>]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1048 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1049 def : InstRW<[A57WriteVMLAD_VecInt, A57ReadVMLAD_VecInt],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1050 (instregex "VMLA(sl)?(v8i8|v4i16|v2i32)", "VMLS(sl)?(v8i8|v4i16|v2i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1051
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1052 // ASIMD multiply accumulate, Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1053 // 6cyc F0 for r0px, 5cyc F0 for r1p0 and later, 2cyc for accumulate sequence
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1054 // (4 or 3 ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1055 def A57WriteVMLAQ_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1056 SchedVar<IsR1P0AndLaterPred, [A57Write_5cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1057 SchedVar<NoSchedPred, [A57Write_6cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1058 def A57ReadVMLAQ_VecInt : SchedReadVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1059 SchedVar<IsR1P0AndLaterPred, [SchedReadAdvance<3, [A57WriteVMLAQ_VecInt]>]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1060 SchedVar<NoSchedPred, [SchedReadAdvance<4, [A57WriteVMLAQ_VecInt]>]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1061 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1062 def : InstRW<[A57WriteVMLAQ_VecInt, A57ReadVMLAQ_VecInt],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1063 (instregex "VMLA(sl)?(v16i8|v8i16|v4i32)", "VMLS(sl)?(v16i8|v8i16|v4i32)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1064
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1065 // ASIMD multiply accumulate long
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1066 // 5cyc F0 for r0px, 4cyc F0 for r1p0 and later, 1cyc for accumulate sequence
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1067 // (4 or 3 ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1068 def A57WriteVMLAL_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1069 SchedVar<IsR1P0AndLaterPred, [A57Write_4cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1070 SchedVar<NoSchedPred, [A57Write_5cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1071 def A57ReadVMLAL_VecInt : SchedReadVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1072 SchedVar<IsR1P0AndLaterPred, [SchedReadAdvance<3, [A57WriteVMLAL_VecInt]>]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1073 SchedVar<NoSchedPred, [SchedReadAdvance<4, [A57WriteVMLAL_VecInt]>]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1074 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1075 def : InstRW<[A57WriteVMLAL_VecInt, A57ReadVMLAL_VecInt],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1076 (instregex "VMLAL(s|u)", "VMLSL(s|u)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1077
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1078 // ASIMD multiply accumulate saturating long
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1079 // 5cyc F0 for r0px, 4cyc F0 for r1p0 and later, 2cyc for accumulate sequence
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1080 // (3 or 2 ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1081 def A57WriteVQDMLAL_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1082 SchedVar<IsR1P0AndLaterPred, [A57Write_4cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1083 SchedVar<NoSchedPred, [A57Write_5cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1084 def A57ReadVQDMLAL_VecInt : SchedReadVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1085 SchedVar<IsR1P0AndLaterPred, [SchedReadAdvance<2, [A57WriteVQDMLAL_VecInt]>]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1086 SchedVar<NoSchedPred, [SchedReadAdvance<3, [A57WriteVQDMLAL_VecInt]>]>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1087 ]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1088 def : InstRW<[A57WriteVQDMLAL_VecInt, A57ReadVQDMLAL_VecInt],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1089 (instregex "VQDMLAL", "VQDMLSL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1090
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1091 // Vector Saturating Rounding Doubling Multiply Accumulate/Subtract Long
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1092 // Scheduling info from VQDMLAL/VQDMLSL
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1093 def : InstRW<[A57WriteVQDMLAL_VecInt, A57ReadVQDMLAL_VecInt],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1094 (instregex "VQRDMLAH", "VQRDMLSH")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1095
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1096 // ASIMD multiply long
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1097 // 5cyc F0 for r0px, 4cyc F0 for r1p0 and later
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1098 def A57WriteVMULL_VecInt : SchedWriteVariant<[
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1099 SchedVar<IsR1P0AndLaterPred, [A57Write_4cyc_1W]>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1100 SchedVar<NoSchedPred, [A57Write_5cyc_1W]>]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1101 def : InstRW<[A57WriteVMULL_VecInt],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1102 (instregex "VMULL(s|u|p8|sls|slu)", "VQDMULL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1103
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1104 // ASIMD pairwise add and accumulate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1105 // 4cyc F1, 1cyc for accumulate sequence (3cyc ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1106 def A57WriteVPADAL : SchedWriteRes<[A57UnitX]> { let Latency = 4; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1107 def A57ReadVPADAL : SchedReadAdvance<3, [A57WriteVPADAL]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1108 def : InstRW<[A57WriteVPADAL, A57ReadVPADAL], (instregex "VPADAL(s|u)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1109
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1110 // ASIMD shift accumulate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1111 // 4cyc F1, 1cyc for accumulate sequence (3cyc ReadAdvance)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1112 def A57WriteVSRA : SchedWriteRes<[A57UnitX]> { let Latency = 4; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1113 def A57ReadVSRA : SchedReadAdvance<3, [A57WriteVSRA]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1114 def : InstRW<[A57WriteVSRA, A57ReadVSRA], (instregex "VSRA", "VRSRA")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1115
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1116 // ASIMD shift by immed, basic
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1117 def : InstRW<[A57Write_3cyc_1X],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1118 (instregex "VMOVL", "VSHLi", "VSHLL", "VSHR(s|u)", "VSHRN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1119
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1120 // ASIMD shift by immed, complex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1121 def : InstRW<[A57Write_4cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1122 "VQRSHRN", "VQRSHRUN", "VQSHL(si|ui|su)", "VQSHRN", "VQSHRUN", "VRSHR(s|u)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1123 "VRSHRN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1124
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1125 // ASIMD shift by immed and insert, basic, D-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1126 def : InstRW<[A57Write_4cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1127 "VSLI(v8i8|v4i16|v2i32|v1i64)", "VSRI(v8i8|v4i16|v2i32|v1i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1128
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1129 // ASIMD shift by immed and insert, basic, Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1130 def : InstRW<[A57Write_5cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1131 "VSLI(v16i8|v8i16|v4i32|v2i64)", "VSRI(v16i8|v8i16|v4i32|v2i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1132
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1133 // ASIMD shift by register, basic, D-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1134 def : InstRW<[A57Write_3cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1135 "VSHL(s|u)(v8i8|v4i16|v2i32|v1i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1136
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1137 // ASIMD shift by register, basic, Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1138 def : InstRW<[A57Write_4cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1139 "VSHL(s|u)(v16i8|v8i16|v4i32|v2i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1140
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1141 // ASIMD shift by register, complex, D-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1142 // VQRSHL, VQSHL, VRSHL
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1143 def : InstRW<[A57Write_4cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1144 "VQRSHL(s|u)(v8i8|v4i16|v2i32|v1i64)", "VQSHL(s|u)(v8i8|v4i16|v2i32|v1i64)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1145 "VRSHL(s|u)(v8i8|v4i16|v2i32|v1i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1146
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1147 // ASIMD shift by register, complex, Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1148 def : InstRW<[A57Write_5cyc_1X], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1149 "VQRSHL(s|u)(v16i8|v8i16|v4i32|v2i64)", "VQSHL(s|u)(v16i8|v8i16|v4i32|v2i64)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1150 "VRSHL(s|u)(v16i8|v8i16|v4i32|v2i64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1151
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1152 // --- 3.15 ASIMD Floating-Point Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1153 // ASIMD FP absolute value
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1154 def : InstRW<[A57Write_3cyc_1V], (instregex "VABS(fd|fq|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1155
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1156 // ASIMD FP arith
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1157 def : InstRW<[A57Write_5cyc_1V], (instregex "VABD(fd|fq|hd|hq)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1158 "VADD(fd|fq|hd|hq)", "VPADD(f|h)", "VSUB(fd|fq|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1159
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1160 def : InstRW<[A57Write_5cyc_1V], (instregex "VCADD", "VCMLA")>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1161
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1162 // ASIMD FP compare
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1163 def : InstRW<[A57Write_5cyc_1V], (instregex "VAC(GE|GT|LE|LT)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1164 "VC(EQ|GE|GT|LE)(fd|fq|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1165
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1166 // ASIMD FP convert, integer
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1167 def : InstRW<[A57Write_5cyc_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1168 "VCVT(f2sd|f2ud|s2fd|u2fd|f2sq|f2uq|s2fq|u2fq|f2xsd|f2xud|xs2fd|xu2fd)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1169 "VCVT(f2xsq|f2xuq|xs2fq|xu2fq)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1170 "VCVT(AN|MN|NN|PN)(SDf|SQf|UDf|UQf|SDh|SQh|UDh|UQh)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1171
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1172 // ASIMD FP convert, half-precision: 8cyc F0/F1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1173 def : InstRW<[A57Write_8cyc_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1174 "VCVT(h2sd|h2ud|s2hd|u2hd|h2sq|h2uq|s2hq|u2hq|h2xsd|h2xud|xs2hd|xu2hd)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1175 "VCVT(h2xsq|h2xuq|xs2hq|xu2hq)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1176 "VCVT(f2h|h2f)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1177
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1178 // ASIMD FP max/min
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1179 def : InstRW<[A57Write_5cyc_1V], (instregex
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1180 "(VMAX|VMIN)(fd|fq|hd|hq)", "(VPMAX|VPMIN)(f|h)", "(NEON|VFP)_VMAXNM",
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1181 "(NEON|VFP)_VMINNM")>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1182
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1183 // ASIMD FP multiply
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1184 def A57WriteVMUL_VecFP : SchedWriteRes<[A57UnitV]> { let Latency = 5; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1185 def : InstRW<[A57WriteVMUL_VecFP], (instregex "VMUL(sl)?(fd|fq|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1186
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1187 // ASIMD FP multiply accumulate: 9cyc F0/F1, 4cyc for accumulate sequence
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1188 def A57WriteVMLA_VecFP : SchedWriteRes<[A57UnitV]> { let Latency = 9; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1189 def A57ReadVMLA_VecFP :
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1190 SchedReadAdvance<5, [A57WriteVMLA_VecFP, A57WriteVMUL_VecFP]>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1191 def : InstRW<[A57WriteVMLA_VecFP, A57ReadVMLA_VecFP],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1192 (instregex "(VMLA|VMLS)(sl)?(fd|fq|hd|hq)", "(VFMA|VFMS)(fd|fq|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1193
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1194 // ASIMD FP negate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1195 def : InstRW<[A57Write_3cyc_1V], (instregex "VNEG(fd|f32q|hd|hq)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1196
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1197 // ASIMD FP round to integral
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1198 def : InstRW<[A57Write_5cyc_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1199 "VRINT(AN|MN|NN|PN|XN|ZN)(Df|Qf|Dh|Qh)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1200
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1201 // --- 3.16 ASIMD Miscellaneous Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1202
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1203 // ASIMD bitwise insert
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1204 def : InstRW<[A57Write_3cyc_1V], (instregex "VBIF", "VBIT", "VBSL")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1205
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1206 // ASIMD count
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1207 def : InstRW<[A57Write_3cyc_1V], (instregex "VCLS", "VCLZ", "VCNT")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1208
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1209 // ASIMD duplicate, core reg: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1210 def : InstRW<[A57Write_8cyc_1L_1V], (instregex "VDUP(8|16|32)(d|q)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1211
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1212 // ASIMD duplicate, scalar: 3cyc "F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1213 def : InstRW<[A57Write_3cyc_1V], (instregex "VDUPLN(8|16|32)(d|q)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1214
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1215 // ASIMD extract
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1216 def : InstRW<[A57Write_3cyc_1V], (instregex "VEXT(d|q)(8|16|32|64)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1217
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1218 // ASIMD move, immed
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1219 def : InstRW<[A57Write_3cyc_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1220 "VMOV(v8i8|v16i8|v4i16|v8i16|v2i32|v4i32|v1i64|v2i64|v2f32|v4f32)",
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
1221 "VMOVD0", "VMOVQ0")>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1222
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1223 // ASIMD move, narrowing
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1224 def : InstRW<[A57Write_3cyc_1V], (instregex "VMOVN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1225
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1226 // ASIMD move, saturating
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1227 def : InstRW<[A57Write_4cyc_1X], (instregex "VQMOVN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1228
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1229 // ASIMD reciprocal estimate
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1230 def : InstRW<[A57Write_5cyc_1V], (instregex "VRECPE", "VRSQRTE")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1231
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1232 // ASIMD reciprocal step, FZ
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1233 def : InstRW<[A57Write_9cyc_1V], (instregex "VRECPS", "VRSQRTS")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1234
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1235 // ASIMD reverse, swap, table lookup (1-2 reg)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1236 def : InstRW<[A57Write_3cyc_1V], (instregex "VREV", "VSWP", "VTB(L|X)(1|2)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1237
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1238 // ASIMD table lookup (3-4 reg)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1239 def : InstRW<[A57Write_6cyc_1V], (instregex "VTBL(3|4)", "VTBX(3|4)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1240
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1241 // ASIMD transfer, scalar to core reg: 6cyc "L, I0/I1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1242 def : InstRW<[A57Write_6cyc_1L_1I], (instregex "VGETLN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1243
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1244 // ASIMD transfer, core reg to scalar: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1245 def : InstRW<[A57Write_8cyc_1L_1V], (instregex "VSETLN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1246
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1247 // ASIMD transpose
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1248 def : InstRW<[A57Write_3cyc_1V, A57Write_3cyc_1V], (instregex "VTRN")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1249
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1250 // ASIMD unzip/zip, D-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1251 def : InstRW<[A57Write_3cyc_1V, A57Write_3cyc_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1252 (instregex "VUZPd", "VZIPd")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1253
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1254 // ASIMD unzip/zip, Q-form
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1255 def : InstRW<[A57Write_6cyc_1V, A57Write_6cyc_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1256 (instregex "VUZPq", "VZIPq")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1257
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1258 // --- 3.17 ASIMD Load Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1259
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1260 // Overriden via InstRW for this processor.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1261 def : WriteRes<WriteVLD1, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1262 def : WriteRes<WriteVLD2, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1263 def : WriteRes<WriteVLD3, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1264 def : WriteRes<WriteVLD4, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1265 def : WriteRes<WriteVST1, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1266 def : WriteRes<WriteVST2, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1267 def : WriteRes<WriteVST3, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1268 def : WriteRes<WriteVST4, []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1269
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1270 // 1-2 reg: 5cyc L, +I for writeback, 1 cyc wb latency
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1271 def : InstRW<[A57Write_5cyc_1L], (instregex "VLD1(d|q)(8|16|32|64)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1272 def : InstRW<[A57Write_5cyc_1L_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1273 (instregex "VLD1(d|q)(8|16|32|64)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1274
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1275 // 3-4 reg: 6cyc L, +I for writeback, 1 cyc wb latency
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1276 def : InstRW<[A57Write_6cyc_1L],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1277 (instregex "VLD1(d|q)(8|16|32|64)(T|Q)$", "VLD1d64(T|Q)Pseudo")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1278
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1279 def : InstRW<[A57Write_6cyc_1L_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1280 (instregex "VLD1(d|q)(8|16|32|64)(T|Q)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1281
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1282 // ASIMD load, 1 element, one lane and all lanes: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1283 def : InstRW<[A57Write_8cyc_1L_1V], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1284 "VLD1(LN|DUP)(d|q)(8|16|32)$", "VLD1(LN|DUP)(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1285 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne], (instregex
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1286 "VLD1(LN|DUP)(d|q)(8|16|32)(wb|_UPD)", "VLD1LNq(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1287
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1288 // ASIMD load, 2 element, multiple, 2 reg: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1289 def : InstRW<[A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1290 (instregex "VLD2(d|q)(8|16|32)$", "VLD2q(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1291 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1292 (instregex "VLD2(d|q)(8|16|32)wb", "VLD2q(8|16|32)PseudoWB")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1293
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1294 // ASIMD load, 2 element, multiple, 4 reg: 9cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1295 def : InstRW<[A57Write_9cyc_1L_1V], (instregex "VLD2b(8|16|32)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1296 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1297 (instregex "VLD2b(8|16|32)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1298
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1299 // ASIMD load, 2 element, one lane and all lanes: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1300 def : InstRW<[A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1301 (instregex "VLD2(DUP|LN)(d|q)(8|16|32|8x2|16x2|32x2)$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1302 "VLD2LN(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1303 // 2 results + wb result
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1304 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1305 (instregex "VLD2LN(d|q)(8|16|32)_UPD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1306 // 1 result + wb result
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1307 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1308 (instregex "VLD2DUPd(8|16|32|8x2|16x2|32x2)wb",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1309 "VLD2LN(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1310
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1311 // ASIMD load, 3 element, multiple, 3 reg: 9cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1312 // 3 results
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1313 def : InstRW<[A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1314 (instregex "VLD3(d|q)(8|16|32)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1315 // 1 result
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1316 def : InstRW<[A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1317 (instregex "VLD3(d|q)(8|16|32)(oddP|P)seudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1318 // 3 results + wb
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1319 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1320 A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1321 (instregex "VLD3(d|q)(8|16|32)_UPD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1322 // 1 result + wb
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1323 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1324 (instregex "VLD3(d|q)(8|16|32)(oddP|P)seudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1325
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1326 // ASIMD load, 3 element, one lane, size 32: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1327 def : InstRW<[A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1328 (instregex "VLD3LN(d|q)32$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1329 "VLD3LN(d|q)32Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1330 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1331 A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1332 (instregex "VLD3LN(d|q)32_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1333 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1334 (instregex "VLD3LN(d|q)32Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1335
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1336 // ASIMD load, 3 element, one lane, size 8/16: 9cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1337 def : InstRW<[A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1338 (instregex "VLD3LN(d|q)(8|16)$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1339 "VLD3LN(d|q)(8|16)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1340 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1341 A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1342 (instregex "VLD3LN(d|q)(8|16)_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1343 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1344 (instregex "VLD3LN(d|q)(8|16)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1345
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1346 // ASIMD load, 3 element, all lanes: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1347 def : InstRW<[A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1348 (instregex "VLD3DUP(d|q)(8|16|32)$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1349 "VLD3DUP(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1350 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1351 A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1352 (instregex "VLD3DUP(d|q)(8|16|32)_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1353 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1354 (instregex "VLD3DUP(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1355
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1356 // ASIMD load, 4 element, multiple, 4 reg: 9cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1357 def : InstRW<[A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1358 A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1359 (instregex "VLD4(d|q)(8|16|32)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1360 def : InstRW<[A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1361 (instregex "VLD4(d|q)(8|16|32)(oddP|P)seudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1362 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1363 A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1364 (instregex "VLD4(d|q)(8|16|32)_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1365 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1366 (instregex "VLD4(d|q)(8|16|32)(oddP|P)seudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1367
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1368 // ASIMD load, 4 element, one lane, size 32: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1369 def : InstRW<[A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1370 A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1371 (instregex "VLD4LN(d|q)32$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1372 "VLD4LN(d|q)32Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1373 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1374 A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1375 A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1376 (instregex "VLD4LN(d|q)32_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1377 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1378 (instregex "VLD4LN(d|q)32Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1379
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1380 // ASIMD load, 4 element, one lane, size 8/16: 9cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1381 def : InstRW<[A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V, A57Write_9cyc_1L_1V,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1382 A57Write_9cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1383 (instregex "VLD4LN(d|q)(8|16)$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1384 "VLD4LN(d|q)(8|16)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1385 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1386 A57Write_9cyc_1L_1V_1I, A57Write_9cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1387 A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1388 (instregex "VLD4LN(d|q)(8|16)_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1389 def : InstRW<[A57Write_9cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1390 (instregex "VLD4LN(d|q)(8|16)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1391
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1392 // ASIMD load, 4 element, all lanes: 8cyc "L, F0/F1"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1393 def : InstRW<[A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V, A57Write_8cyc_1L_1V,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1394 A57Write_8cyc_1L_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1395 (instregex "VLD4DUP(d|q)(8|16|32)$",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1396 "VLD4DUP(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1397 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1398 A57Write_8cyc_1L_1V_1I, A57Write_8cyc_1L_1V_1I,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1399 A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1400 (instregex "VLD4DUP(d|q)(8|16|32)_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1401 def : InstRW<[A57Write_8cyc_1L_1V_1I, A57WrBackOne],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1402 (instregex "VLD4DUP(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1403
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1404 // --- 3.18 ASIMD Store Instructions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1405
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1406 // ASIMD store, 1 element, multiple, 1 reg: 1cyc S
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1407 def : InstRW<[A57Write_1cyc_1S], (instregex "VST1d(8|16|32|64)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1408 def : InstRW<[A57WrBackOne, A57Write_1cyc_1S_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1409 (instregex "VST1d(8|16|32|64)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1410 // ASIMD store, 1 element, multiple, 2 reg: 2cyc S
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1411 def : InstRW<[A57Write_2cyc_1S], (instregex "VST1q(8|16|32|64)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1412 def : InstRW<[A57WrBackOne, A57Write_2cyc_1S_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1413 (instregex "VST1q(8|16|32|64)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1414 // ASIMD store, 1 element, multiple, 3 reg: 3cyc S
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1415 def : InstRW<[A57Write_3cyc_1S],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1416 (instregex "VST1d(8|16|32|64)T$", "VST1d64TPseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1417 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1418 (instregex "VST1d(8|16|32|64)Twb", "VST1d64TPseudoWB")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1419 // ASIMD store, 1 element, multiple, 4 reg: 4cyc S
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1420 def : InstRW<[A57Write_4cyc_1S],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1421 (instregex "VST1d(8|16|32|64)(Q|QPseudo)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1422 def : InstRW<[A57WrBackOne, A57Write_4cyc_1S_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1423 (instregex "VST1d(8|16|32|64)(Qwb|QPseudoWB)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1424 // ASIMD store, 1 element, one lane: 3cyc "F0/F1, S"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1425 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1426 (instregex "VST1LNd(8|16|32)$", "VST1LNq(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1427 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1428 (instregex "VST1LNd(8|16|32)_UPD", "VST1LNq(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1429 // ASIMD store, 2 element, multiple, 2 reg: 3cyc "F0/F1, S"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1430 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1431 (instregex "VST2(d|b)(8|16|32)$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1432 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1433 (instregex "VST2(b|d)(8|16|32)wb")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1434 // ASIMD store, 2 element, multiple, 4 reg: 4cyc "F0/F1, S"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1435 def : InstRW<[A57Write_4cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1436 (instregex "VST2q(8|16|32)$", "VST2q(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1437 def : InstRW<[A57WrBackOne, A57Write_4cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1438 (instregex "VST2q(8|16|32)wb", "VST2q(8|16|32)PseudoWB")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1439 // ASIMD store, 2 element, one lane: 3cyc "F0/F1, S"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1440 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1441 (instregex "VST2LN(d|q)(8|16|32)$", "VST2LN(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1442 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1443 (instregex "VST2LN(d|q)(8|16|32)_UPD",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1444 "VST2LN(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1445 // ASIMD store, 3 element, multiple, 3 reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1446 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1447 (instregex "VST3(d|q)(8|16|32)$", "VST3(d|q)(8|16|32)(oddP|P)seudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1448 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1449 (instregex "VST3(d|q)(8|16|32)_UPD",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1450 "VST3(d|q)(8|16|32)(oddP|P)seudo_UPD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1451 // ASIMD store, 3 element, one lane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1452 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1453 (instregex "VST3LN(d|q)(8|16|32)$", "VST3LN(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1454 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1455 (instregex "VST3LN(d|q)(8|16|32)_UPD",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1456 "VST3LN(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1457 // ASIMD store, 4 element, multiple, 4 reg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1458 def : InstRW<[A57Write_4cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1459 (instregex "VST4(d|q)(8|16|32)$", "VST4(d|q)(8|16|32)(oddP|P)seudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1460 def : InstRW<[A57WrBackOne, A57Write_4cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1461 (instregex "VST4(d|q)(8|16|32)_UPD",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1462 "VST4(d|q)(8|16|32)(oddP|P)seudo_UPD$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1463 // ASIMD store, 4 element, one lane
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1464 def : InstRW<[A57Write_3cyc_1S_1V],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1465 (instregex "VST4LN(d|q)(8|16|32)$", "VST4LN(d|q)(8|16|32)Pseudo$")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1466 def : InstRW<[A57WrBackOne, A57Write_3cyc_1S_1V_1I],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1467 (instregex "VST4LN(d|q)(8|16|32)_UPD",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1468 "VST4LN(d|q)(8|16|32)Pseudo_UPD")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1469
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1470 // --- 3.19 Cryptography Extensions ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1471 // Crypto AES ops
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1472 // AESD, AESE, AESIMC, AESMC: 3cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1473 def : InstRW<[A57Write_3cyc_1W], (instregex "^AES")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1474 // Crypto polynomial (64x64) multiply long (VMULL.P64): 3cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1475 def : InstRW<[A57Write_3cyc_1W], (instregex "^VMULLp64")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1476 // Crypto SHA1 xor ops: 6cyc F0/F1
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1477 def : InstRW<[A57Write_6cyc_2V], (instregex "^SHA1SU0")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1478 // Crypto SHA1 fast ops: 3cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1479 def : InstRW<[A57Write_3cyc_1W], (instregex "^SHA1(H|SU1)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1480 // Crypto SHA1 slow ops: 6cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1481 def : InstRW<[A57Write_6cyc_2W], (instregex "^SHA1[CMP]")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1482 // Crypto SHA256 fast ops: 3cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1483 def : InstRW<[A57Write_3cyc_1W], (instregex "^SHA256SU0")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1484 // Crypto SHA256 slow ops: 6cyc F0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1485 def : InstRW<[A57Write_6cyc_2W], (instregex "^SHA256(H|H2|SU1)")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1486
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1487 // --- 3.20 CRC ---
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1488 def : InstRW<[A57Write_3cyc_1W], (instregex "^(t2)?CRC32")>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1489
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1490 // -----------------------------------------------------------------------------
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1491 // Common definitions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1492 def : WriteRes<WriteNoop, []> { let Latency = 0; let NumMicroOps = 0; }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1493 def : SchedAlias<WriteALU, A57Write_1cyc_1I>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1494
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1495 def : SchedAlias<WriteBr, A57Write_1cyc_1B>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1496 def : SchedAlias<WriteBrL, A57Write_1cyc_1B_1I>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1497 def : SchedAlias<WriteBrTbl, A57Write_1cyc_1B_1I>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1498 def : SchedAlias<WritePreLd, A57Write_4cyc_1L>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1499
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1500 def : SchedAlias<WriteLd, A57Write_4cyc_1L>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1501 def : SchedAlias<WriteST, A57Write_1cyc_1S>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1502 def : ReadAdvance<ReadALU, 0>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1503
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1504 } // SchedModel = CortexA57Model
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1505