annotate gcc/config/aarch64/thunderx.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Cavium ThunderX pipeline description
kono
parents:
diff changeset
2 ;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 ;;
kono
parents:
diff changeset
4 ;; Written by Andrew Pinski <apinski@cavium.com>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 ;; This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
10 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
11 ;; any later version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
16 ;; GNU General Public License for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 ;; Thunder is a dual-issue processor that can issue all instructions on
kono
parents:
diff changeset
24 ;; pipe0 and a subset on pipe1.
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 (define_automaton "thunderx_main, thunderx_mult, thunderx_divide, thunderx_simd")
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 (define_cpu_unit "thunderx_pipe0" "thunderx_main")
kono
parents:
diff changeset
30 (define_cpu_unit "thunderx_pipe1" "thunderx_main")
kono
parents:
diff changeset
31 (define_cpu_unit "thunderx_mult" "thunderx_mult")
kono
parents:
diff changeset
32 (define_cpu_unit "thunderx_divide" "thunderx_divide")
kono
parents:
diff changeset
33 (define_cpu_unit "thunderx_simd" "thunderx_simd")
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 (define_insn_reservation "thunderx_add" 1
kono
parents:
diff changeset
36 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
37 (eq_attr "type" "adc_imm,adc_reg,adr,alu_imm,alu_sreg,alus_imm,alus_sreg,extend,logic_imm,logic_reg,logics_imm,logics_reg,mov_imm,mov_reg"))
kono
parents:
diff changeset
38 "thunderx_pipe0 | thunderx_pipe1")
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 (define_insn_reservation "thunderx_shift" 1
kono
parents:
diff changeset
41 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
42 (eq_attr "type" "bfm,bfx,extend,rotate_imm,shift_imm,shift_reg,rbit,rev"))
kono
parents:
diff changeset
43 "thunderx_pipe0 | thunderx_pipe1")
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 ;; Arthimentic instructions with an extra shift or extend is two cycles.
kono
parents:
diff changeset
47 ;; FIXME: This needs more attributes on aarch64 than what is currently there;
kono
parents:
diff changeset
48 ;; this is conserative for now.
kono
parents:
diff changeset
49 ;; Except this is not correct as this is only for !(LSL && shift by 0/1/2/3)
kono
parents:
diff changeset
50 ;; Except this is not correct as this is only for !(zero extend)
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 (define_insn_reservation "thunderx_arith_shift" 2
kono
parents:
diff changeset
53 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
54 (eq_attr "type" "alu_ext,alu_shift_imm,alu_shift_reg,alus_ext,logic_shift_imm,logic_shift_reg,logics_shift_imm,logics_shift_reg,alus_shift_imm"))
kono
parents:
diff changeset
55 "thunderx_pipe0 | thunderx_pipe1")
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 (define_insn_reservation "thunderx_csel" 2
kono
parents:
diff changeset
58 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
59 (eq_attr "type" "csel"))
kono
parents:
diff changeset
60 "thunderx_pipe0 | thunderx_pipe1")
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 ;; Multiply and mulitply accumulate and count leading zeros can only happen on pipe 1
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 (define_insn_reservation "thunderx_mul" 4
kono
parents:
diff changeset
65 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
66 (eq_attr "type" "mul,muls,mla,mlas,clz,smull,umull,smlal,umlal"))
kono
parents:
diff changeset
67 "thunderx_pipe1 + thunderx_mult")
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 ;; crcb,crch,crcw is 4 cycles and can only happen on pipe 1
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 (define_insn_reservation "thunderx_crc32" 4
kono
parents:
diff changeset
72 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
73 (eq_attr "type" "crc"))
kono
parents:
diff changeset
74 "thunderx_pipe1 + thunderx_mult")
kono
parents:
diff changeset
75
kono
parents:
diff changeset
76 ;; crcx is 5 cycles and only happen on pipe 1
kono
parents:
diff changeset
77 ;(define_insn_reservation "thunderx_crc64" 5
kono
parents:
diff changeset
78 ; (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
79 ; (eq_attr "type" "crc")
kono
parents:
diff changeset
80 ; (eq_attr "mode" "DI"))
kono
parents:
diff changeset
81 ; "thunderx_pipe1 + thunderx_mult")
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 (define_insn_reservation "thunderx_div32" 22
kono
parents:
diff changeset
84 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
85 (eq_attr "type" "udiv,sdiv"))
kono
parents:
diff changeset
86 "thunderx_pipe1 + thunderx_divide, thunderx_divide * 21")
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 ;(define_insn_reservation "thunderx_div64" 38
kono
parents:
diff changeset
89 ; (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
90 ; (eq_attr "type" "udiv,sdiv")
kono
parents:
diff changeset
91 ; (eq_attr "mode" "DI"))
kono
parents:
diff changeset
92 ; "thunderx_pipe1 + thunderx_divide, thunderx_divide * 34")
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 ;; Stores take one cycle in pipe 0
kono
parents:
diff changeset
95 (define_insn_reservation "thunderx_store" 1
kono
parents:
diff changeset
96 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
97 (eq_attr "type" "store_4"))
kono
parents:
diff changeset
98 "thunderx_pipe0")
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 ;; Store pair are single issued
kono
parents:
diff changeset
101 (define_insn_reservation "thunderx_storepair" 1
kono
parents:
diff changeset
102 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
103 (eq_attr "type" "store_8,store_16"))
kono
parents:
diff changeset
104 "thunderx_pipe0 + thunderx_pipe1")
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 ;; Prefetch are single issued
kono
parents:
diff changeset
107 ;(define_insn_reservation "thunderx_prefetch" 1
kono
parents:
diff changeset
108 ; (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
109 ; (eq_attr "type" "prefetch"))
kono
parents:
diff changeset
110 ; "thunderx_pipe0 + thunderx_pipe1")
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 ;; loads (and load pairs) from L1 take 3 cycles in pipe 0
kono
parents:
diff changeset
113 (define_insn_reservation "thunderx_load" 3
kono
parents:
diff changeset
114 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
115 (eq_attr "type" "load_4, load_8, load_16"))
kono
parents:
diff changeset
116 "thunderx_pipe0")
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 (define_insn_reservation "thunderx_brj" 1
kono
parents:
diff changeset
119 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
120 (eq_attr "type" "branch,trap,call"))
kono
parents:
diff changeset
121 "thunderx_pipe1")
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 ;; FPU
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 (define_insn_reservation "thunderx_fadd" 4
kono
parents:
diff changeset
126 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
127 (eq_attr "type" "faddd,fadds"))
kono
parents:
diff changeset
128 "thunderx_pipe1")
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 (define_insn_reservation "thunderx_fconst" 1
kono
parents:
diff changeset
131 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
132 (eq_attr "type" "fconsts,fconstd"))
kono
parents:
diff changeset
133 "thunderx_pipe1")
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135 ;; Moves between fp are 2 cycles including min/max
kono
parents:
diff changeset
136 (define_insn_reservation "thunderx_fmov" 2
kono
parents:
diff changeset
137 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
138 (eq_attr "type" "fmov,f_minmaxs,f_minmaxd"))
kono
parents:
diff changeset
139 "thunderx_pipe1")
kono
parents:
diff changeset
140
kono
parents:
diff changeset
141 ;; ABS, and NEG are 1 cycle
kono
parents:
diff changeset
142 (define_insn_reservation "thunderx_fabs" 1
kono
parents:
diff changeset
143 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
144 (eq_attr "type" "ffariths,ffarithd"))
kono
parents:
diff changeset
145 "thunderx_pipe1")
kono
parents:
diff changeset
146
kono
parents:
diff changeset
147 (define_insn_reservation "thunderx_fcsel" 3
kono
parents:
diff changeset
148 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
149 (eq_attr "type" "fcsel"))
kono
parents:
diff changeset
150 "thunderx_pipe1")
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 (define_insn_reservation "thunderx_fmovgpr" 2
kono
parents:
diff changeset
153 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
154 (eq_attr "type" "f_mrc, f_mcr"))
kono
parents:
diff changeset
155 "thunderx_pipe1")
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 (define_insn_reservation "thunderx_fcmp" 3
kono
parents:
diff changeset
158 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
159 (eq_attr "type" "fcmps,fcmpd,fccmps,fccmpd"))
kono
parents:
diff changeset
160 "thunderx_pipe1")
kono
parents:
diff changeset
161
kono
parents:
diff changeset
162 (define_insn_reservation "thunderx_fmul" 6
kono
parents:
diff changeset
163 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
164 (eq_attr "type" "fmacs,fmacd,fmuls,fmuld"))
kono
parents:
diff changeset
165 "thunderx_pipe1")
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 (define_insn_reservation "thunderx_fdivs" 12
kono
parents:
diff changeset
168 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
169 (eq_attr "type" "fdivs"))
kono
parents:
diff changeset
170 "thunderx_pipe1 + thunderx_divide, thunderx_divide*8")
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 (define_insn_reservation "thunderx_fdivd" 22
kono
parents:
diff changeset
173 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
174 (eq_attr "type" "fdivd"))
kono
parents:
diff changeset
175 "thunderx_pipe1 + thunderx_divide, thunderx_divide*18")
kono
parents:
diff changeset
176
kono
parents:
diff changeset
177 (define_insn_reservation "thunderx_fsqrts" 17
kono
parents:
diff changeset
178 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
179 (eq_attr "type" "fsqrts"))
kono
parents:
diff changeset
180 "thunderx_pipe1 + thunderx_divide, thunderx_divide*13")
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182 (define_insn_reservation "thunderx_fsqrtd" 31
kono
parents:
diff changeset
183 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
184 (eq_attr "type" "fsqrtd"))
kono
parents:
diff changeset
185 "thunderx_pipe1 + thunderx_divide, thunderx_divide*27")
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 ;; The rounding conversion inside fp is 4 cycles
kono
parents:
diff changeset
188 (define_insn_reservation "thunderx_frint" 4
kono
parents:
diff changeset
189 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
190 (eq_attr "type" "f_cvt,f_rints,f_rintd"))
kono
parents:
diff changeset
191 "thunderx_pipe1")
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 ;; Float to integer with a move from int to/from float is 6 cycles
kono
parents:
diff changeset
194 (define_insn_reservation "thunderx_f_cvt" 6
kono
parents:
diff changeset
195 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
196 (eq_attr "type" "f_cvtf2i,f_cvti2f"))
kono
parents:
diff changeset
197 "thunderx_pipe1")
kono
parents:
diff changeset
198
kono
parents:
diff changeset
199 ;; FP/SIMD load/stores happen in pipe 0
kono
parents:
diff changeset
200 ;; 64bit Loads register/pairs are 4 cycles from L1
kono
parents:
diff changeset
201 (define_insn_reservation "thunderx_64simd_fp_load" 4
kono
parents:
diff changeset
202 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
203 (eq_attr "type" "f_loadd,f_loads,neon_load1_1reg,\
kono
parents:
diff changeset
204 neon_load1_1reg_q,neon_load1_2reg"))
kono
parents:
diff changeset
205 "thunderx_pipe0")
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207 ;; 128bit load pair is singled issue and 4 cycles from L1
kono
parents:
diff changeset
208 (define_insn_reservation "thunderx_128simd_pair_load" 4
kono
parents:
diff changeset
209 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
210 (eq_attr "type" "neon_load1_2reg_q"))
kono
parents:
diff changeset
211 "thunderx_pipe0+thunderx_pipe1")
kono
parents:
diff changeset
212
kono
parents:
diff changeset
213 ;; FP/SIMD Stores takes one cycle in pipe 0
kono
parents:
diff changeset
214 ;; ST1 with one registers either multiple structures or single structure is
kono
parents:
diff changeset
215 ;; also one cycle.
kono
parents:
diff changeset
216 (define_insn_reservation "thunderx_simd_fp_store" 1
kono
parents:
diff changeset
217 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
218 (eq_attr "type" "f_stored,f_stores,neon_store1_1reg,neon_store1_1reg_q, \
kono
parents:
diff changeset
219 neon_store1_one_lane, neon_store1_one_lane_q"))
kono
parents:
diff changeset
220 "thunderx_pipe0")
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 ;; 64bit neon store pairs are single issue for one cycle
kono
parents:
diff changeset
223 (define_insn_reservation "thunderx_64neon_storepair" 1
kono
parents:
diff changeset
224 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
225 (eq_attr "type" "neon_store1_2reg"))
kono
parents:
diff changeset
226 "thunderx_pipe0 + thunderx_pipe1")
kono
parents:
diff changeset
227
kono
parents:
diff changeset
228 ;; 128bit neon store pair are single issued for two cycles
kono
parents:
diff changeset
229 (define_insn_reservation "thunderx_128neon_storepair" 2
kono
parents:
diff changeset
230 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
231 (eq_attr "type" "neon_store1_2reg_q"))
kono
parents:
diff changeset
232 "(thunderx_pipe0 + thunderx_pipe1)*2")
kono
parents:
diff changeset
233
kono
parents:
diff changeset
234 ;; LD1R/LD1 (with a single struct) takes 6 cycles and issued in pipe0
kono
parents:
diff changeset
235 (define_insn_reservation "thunderx_neon_ld1" 6
kono
parents:
diff changeset
236 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
237 (eq_attr "type" "neon_load1_all_lanes"))
kono
parents:
diff changeset
238 "thunderx_pipe0")
kono
parents:
diff changeset
239
kono
parents:
diff changeset
240 ;; SIMD/NEON (q forms take an extra cycle)
kono
parents:
diff changeset
241 ;; SIMD For ThunderX is 64bit wide,
kono
parents:
diff changeset
242
kono
parents:
diff changeset
243 ;; ThunderX simd move instruction types - 2/3 cycles
kono
parents:
diff changeset
244 ;; ThunderX dup, ins is the same
kono
parents:
diff changeset
245 ;; ThunderX SIMD fabs/fneg instruction types
kono
parents:
diff changeset
246 (define_insn_reservation "thunderx_neon_move" 2
kono
parents:
diff changeset
247 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
248 (eq_attr "type" "neon_logic, neon_bsl, neon_fp_compare_s, \
kono
parents:
diff changeset
249 neon_fp_compare_d, neon_move, neon_dup, \
kono
parents:
diff changeset
250 neon_ins, neon_from_gp, neon_to_gp, \
kono
parents:
diff changeset
251 neon_abs, neon_neg, \
kono
parents:
diff changeset
252 neon_fp_neg_s, neon_fp_abs_s"))
kono
parents:
diff changeset
253 "thunderx_pipe1 + thunderx_simd")
kono
parents:
diff changeset
254
kono
parents:
diff changeset
255 (define_insn_reservation "thunderx_neon_move_q" 3
kono
parents:
diff changeset
256 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
257 (eq_attr "type" "neon_logic_q, neon_bsl_q, neon_fp_compare_s_q, \
kono
parents:
diff changeset
258 neon_fp_compare_d_q, neon_move_q, neon_dup_q, \
kono
parents:
diff changeset
259 neon_ins_q, neon_from_gp_q, neon_to_gp_q, \
kono
parents:
diff changeset
260 neon_abs_q, neon_neg_q, \
kono
parents:
diff changeset
261 neon_fp_neg_s_q, neon_fp_neg_d_q, \
kono
parents:
diff changeset
262 neon_fp_abs_s_q, neon_fp_abs_d_q"))
kono
parents:
diff changeset
263 "thunderx_pipe1 + thunderx_simd, thunderx_simd")
kono
parents:
diff changeset
264
kono
parents:
diff changeset
265 ;; ThunderX simd simple/add instruction types - 4/5 cycles
kono
parents:
diff changeset
266
kono
parents:
diff changeset
267 (define_insn_reservation "thunderx_neon_add" 4
kono
parents:
diff changeset
268 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
269 (eq_attr "type" "neon_reduc_add, neon_reduc_minmax, neon_fp_reduc_add_s, \
kono
parents:
diff changeset
270 neon_fp_reduc_add_d, neon_fp_to_int_s, neon_fp_to_int_d, \
kono
parents:
diff changeset
271 neon_add_halve, neon_sub_halve, neon_qadd, neon_compare, \
kono
parents:
diff changeset
272 neon_compare_zero, neon_minmax, neon_abd, neon_add, neon_sub, \
kono
parents:
diff changeset
273 neon_fp_minmax_s, neon_fp_minmax_d, neon_reduc_add, neon_cls, \
kono
parents:
diff changeset
274 neon_qabs, neon_qneg, neon_fp_addsub_s, neon_fp_addsub_d, \
kono
parents:
diff changeset
275 neon_arith_acc, neon_rev, neon_fp_abd_s, neon_fp_abd_d, \
kono
parents:
diff changeset
276 neon_fp_reduc_minmax_s"))
kono
parents:
diff changeset
277 "thunderx_pipe1 + thunderx_simd")
kono
parents:
diff changeset
278
kono
parents:
diff changeset
279 ;; BIG NOTE: neon_add_long/neon_sub_long don't have a q form which is incorrect
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281 (define_insn_reservation "thunderx_neon_add_q" 5
kono
parents:
diff changeset
282 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
283 (eq_attr "type" "neon_reduc_add_q, neon_reduc_minmax_q, neon_fp_reduc_add_s_q, \
kono
parents:
diff changeset
284 neon_fp_reduc_add_d_q, neon_fp_to_int_s_q, neon_fp_to_int_d_q, \
kono
parents:
diff changeset
285 neon_add_halve_q, neon_sub_halve_q, neon_qadd_q, neon_compare_q, \
kono
parents:
diff changeset
286 neon_compare_zero_q, neon_minmax_q, neon_abd_q, neon_add_q, neon_sub_q, \
kono
parents:
diff changeset
287 neon_fp_minmax_s_q, neon_fp_minmax_d_q, neon_reduc_add_q, neon_cls_q, \
kono
parents:
diff changeset
288 neon_qabs_q, neon_qneg_q, neon_fp_addsub_s_q, neon_fp_addsub_d_q, \
kono
parents:
diff changeset
289 neon_add_long, neon_sub_long, neon_fp_abd_s_q, neon_fp_abd_d_q, \
kono
parents:
diff changeset
290 neon_arith_acc_q, neon_rev_q, \
kono
parents:
diff changeset
291 neon_fp_reduc_minmax_s_q, neon_fp_reduc_minmax_d_q"))
kono
parents:
diff changeset
292 "thunderx_pipe1 + thunderx_simd, thunderx_simd")
kono
parents:
diff changeset
293
kono
parents:
diff changeset
294 ;; Multiplies (float and integer) and shifts and permutes (except for TBL) and float conversions
kono
parents:
diff changeset
295 ;; are 6/7 cycles
kono
parents:
diff changeset
296 (define_insn_reservation "thunderx_neon_mult" 6
kono
parents:
diff changeset
297 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
298 (eq_attr "type" "neon_fp_mul_s, neon_fp_mul_d, neon_fp_mla_s, neon_fp_mla_d, \
kono
parents:
diff changeset
299 neon_mla_b, neon_mla_h, neon_mla_s, \
kono
parents:
diff changeset
300 neon_mla_h_scalar, neon_mla_s_scalar, \
kono
parents:
diff changeset
301 neon_ext, neon_shift_imm, neon_permute, \
kono
parents:
diff changeset
302 neon_int_to_fp_s, neon_int_to_fp_d, neon_shift_reg, \
kono
parents:
diff changeset
303 neon_sat_shift_reg, neon_shift_acc, \
kono
parents:
diff changeset
304 neon_mul_b, neon_mul_h, neon_mul_s, \
kono
parents:
diff changeset
305 neon_mul_h_scalar, neon_mul_s_scalar, \
kono
parents:
diff changeset
306 neon_fp_mul_s_scalar, \
kono
parents:
diff changeset
307 neon_fp_mla_s_scalar"))
kono
parents:
diff changeset
308 "thunderx_pipe1 + thunderx_simd")
kono
parents:
diff changeset
309
kono
parents:
diff changeset
310 (define_insn_reservation "thunderx_neon_mult_q" 7
kono
parents:
diff changeset
311 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
312 (eq_attr "type" "neon_fp_mul_s_q, neon_fp_mul_d_q, neon_fp_mla_s_q, neon_fp_mla_d_q, \
kono
parents:
diff changeset
313 neon_mla_b_q, neon_mla_h_q, neon_mla_s_q, \
kono
parents:
diff changeset
314 neon_mla_h_scalar_q, neon_mla_s_scalar_q, \
kono
parents:
diff changeset
315 neon_ext_q, neon_shift_imm_q, neon_permute_q, \
kono
parents:
diff changeset
316 neon_int_to_fp_s_q, neon_int_to_fp_d_q, neon_shift_reg_q, \
kono
parents:
diff changeset
317 neon_sat_shift_reg_q, neon_shift_acc_q, \
kono
parents:
diff changeset
318 neon_shift_imm_long, \
kono
parents:
diff changeset
319 neon_mul_b_q, neon_mul_h_q, neon_mul_s_q, \
kono
parents:
diff changeset
320 neon_mul_h_scalar_q, neon_mul_s_scalar_q, \
kono
parents:
diff changeset
321 neon_fp_mul_s_scalar_q, neon_fp_mul_d_scalar_q, \
kono
parents:
diff changeset
322 neon_mul_b_long, neon_mul_h_long, neon_mul_s_long, \
kono
parents:
diff changeset
323 neon_shift_imm_narrow_q, neon_fp_cvt_widen_s, neon_fp_cvt_narrow_d_q, \
kono
parents:
diff changeset
324 neon_fp_mla_s_scalar_q, neon_fp_mla_d_scalar_q"))
kono
parents:
diff changeset
325 "thunderx_pipe1 + thunderx_simd, thunderx_simd")
kono
parents:
diff changeset
326
kono
parents:
diff changeset
327
kono
parents:
diff changeset
328 ;; AES[ED] is 5 cycles
kono
parents:
diff changeset
329 (define_insn_reservation "thunderx_crypto_aese" 5
kono
parents:
diff changeset
330 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
331 (eq_attr "type" "crypto_aese"))
kono
parents:
diff changeset
332 "thunderx_pipe1 + thunderx_simd, thunderx_simd")
kono
parents:
diff changeset
333
kono
parents:
diff changeset
334 ;; AES{,I}MC is 3 cycles
kono
parents:
diff changeset
335 (define_insn_reservation "thunderx_crypto_aesmc" 3
kono
parents:
diff changeset
336 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
337 (eq_attr "type" "crypto_aesmc"))
kono
parents:
diff changeset
338 "thunderx_pipe1 + thunderx_simd, thunderx_simd")
kono
parents:
diff changeset
339
kono
parents:
diff changeset
340
kono
parents:
diff changeset
341 ;; Thunder 128bit SIMD reads the upper halve in cycle 2 and writes upper halve in the last cycle
kono
parents:
diff changeset
342 (define_bypass 2 "thunderx_neon_move_q" "thunderx_neon_move_q, thunderx_neon_add_q, thunderx_neon_mult_q")
kono
parents:
diff changeset
343 (define_bypass 4 "thunderx_neon_add_q" "thunderx_neon_move_q, thunderx_neon_add_q, thunderx_neon_mult_q")
kono
parents:
diff changeset
344 (define_bypass 6 "thunderx_neon_mult_q" "thunderx_neon_move_q, thunderx_neon_add_q, thunderx_neon_mult_q")
kono
parents:
diff changeset
345
kono
parents:
diff changeset
346 ;; 64bit TBL is emulated and takes 160 cycles
kono
parents:
diff changeset
347 (define_insn_reservation "thunderx_tbl" 160
kono
parents:
diff changeset
348 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
349 (eq_attr "type" "neon_tbl1"))
kono
parents:
diff changeset
350 "(thunderx_pipe1+thunderx_pipe0)*160")
kono
parents:
diff changeset
351
kono
parents:
diff changeset
352 ;; 128bit TBL is emulated and takes 320 cycles
kono
parents:
diff changeset
353 (define_insn_reservation "thunderx_tblq" 320
kono
parents:
diff changeset
354 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
355 (eq_attr "type" "neon_tbl1_q"))
kono
parents:
diff changeset
356 "(thunderx_pipe1+thunderx_pipe0)*320")
kono
parents:
diff changeset
357
kono
parents:
diff changeset
358 ;; Assume both pipes are needed for unknown and multiple-instruction
kono
parents:
diff changeset
359 ;; patterns.
kono
parents:
diff changeset
360
kono
parents:
diff changeset
361 (define_insn_reservation "thunderx_unknown" 1
kono
parents:
diff changeset
362 (and (eq_attr "tune" "thunderx")
kono
parents:
diff changeset
363 (eq_attr "type" "untyped,multiple"))
kono
parents:
diff changeset
364 "thunderx_pipe0 + thunderx_pipe1")
kono
parents:
diff changeset
365
kono
parents:
diff changeset
366