1 ;; Machine description for AppliedMicro xgene1 core.
2 ;; Copyright (C) 2012-2018 Free Software Foundation, Inc.
3 ;; Contributed by Theobroma Systems Design und Consulting GmbH.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; GCC is distributed in the hope that it will be useful, but
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ;; General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
21 ;; Pipeline description for the xgene1 micro-architecture
23 (define_automaton "xgene1_main, xgene1_decoder, xgene1_div, xgene1_simd")
25 (define_cpu_unit "xgene1_decode_out0" "xgene1_decoder")
26 (define_cpu_unit "xgene1_decode_out1" "xgene1_decoder")
27 (define_cpu_unit "xgene1_decode_out2" "xgene1_decoder")
28 (define_cpu_unit "xgene1_decode_out3" "xgene1_decoder")
30 (define_cpu_unit "xgene1_IXA" "xgene1_main")
31 (define_cpu_unit "xgene1_IXB" "xgene1_main")
32 (define_cpu_unit "xgene1_IXB_compl" "xgene1_main")
34 (define_reservation "xgene1_IXn" "(xgene1_IXA | xgene1_IXB)")
36 (define_cpu_unit "xgene1_multiply" "xgene1_main")
37 (define_cpu_unit "xgene1_divide" "xgene1_div")
38 (define_cpu_unit "xgene1_fp_divide" "xgene1_div")
39 (define_cpu_unit "xgene1_fsu" "xgene1_simd")
40 (define_cpu_unit "xgene1_fcmp" "xgene1_simd")
41 (define_cpu_unit "xgene1_ld" "xgene1_main")
42 (define_cpu_unit "xgene1_st" "xgene1_main")
44 (define_reservation "xgene1_decode1op"
45 "( xgene1_decode_out0 )
46 |( xgene1_decode_out1 )
47 |( xgene1_decode_out2 )
48 |( xgene1_decode_out3 )"
50 (define_reservation "xgene1_decode2op"
51 "( xgene1_decode_out0 + xgene1_decode_out1 )
52 |( xgene1_decode_out0 + xgene1_decode_out2 )
53 |( xgene1_decode_out0 + xgene1_decode_out3 )
54 |( xgene1_decode_out1 + xgene1_decode_out2 )
55 |( xgene1_decode_out1 + xgene1_decode_out3 )
56 |( xgene1_decode_out2 + xgene1_decode_out3 )"
58 (define_reservation "xgene1_decodeIsolated"
59 "( xgene1_decode_out0 + xgene1_decode_out1 + xgene1_decode_out2 + xgene1_decode_out3 )"
62 (define_insn_reservation "xgene1_branch" 1
63 (and (eq_attr "tune" "xgene1")
64 (eq_attr "type" "branch"))
67 (define_insn_reservation "xgene1_nop" 1
68 (and (eq_attr "tune" "xgene1")
69 (eq_attr "type" "no_insn"))
72 (define_insn_reservation "xgene1_call" 1
73 (and (eq_attr "tune" "xgene1")
74 (eq_attr "type" "call"))
77 (define_insn_reservation "xgene1_f_load" 10
78 (and (eq_attr "tune" "xgene1")
79 (eq_attr "type" "f_loadd,f_loads"))
80 "xgene1_decode2op, xgene1_ld")
82 (define_insn_reservation "xgene1_f_store" 4
83 (and (eq_attr "tune" "xgene1")
84 (eq_attr "type" "f_stored,f_stores"))
85 "xgene1_decode2op, xgene1_st")
87 (define_insn_reservation "xgene1_fmov" 2
88 (and (eq_attr "tune" "xgene1")
89 (eq_attr "type" "fmov,fconsts,fconstd"))
92 (define_insn_reservation "xgene1_f_mcr" 10
93 (and (eq_attr "tune" "xgene1")
94 (eq_attr "type" "f_mcr"))
95 "xgene1_decodeIsolated")
97 (define_insn_reservation "xgene1_f_mrc" 4
98 (and (eq_attr "tune" "xgene1")
99 (eq_attr "type" "f_mrc"))
102 (define_insn_reservation "xgene1_load_pair" 6
103 (and (eq_attr "tune" "xgene1")
104 (eq_attr "type" "load_16"))
105 "xgene1_decodeIsolated, xgene1_ld*2")
107 (define_insn_reservation "xgene1_store_pair" 2
108 (and (eq_attr "tune" "xgene1")
109 (eq_attr "type" "store_16"))
110 "xgene1_decodeIsolated, xgene1_st*2")
112 (define_insn_reservation "xgene1_fp_load1" 10
113 (and (eq_attr "tune" "xgene1")
114 (eq_attr "type" "load_4, load_8")
115 (eq_attr "fp" "yes"))
116 "xgene1_decode1op, xgene1_ld")
118 (define_insn_reservation "xgene1_load1" 5
119 (and (eq_attr "tune" "xgene1")
120 (eq_attr "type" "load_4, load_8"))
121 "xgene1_decode1op, xgene1_ld")
123 (define_insn_reservation "xgene1_store1" 1
124 (and (eq_attr "tune" "xgene1")
125 (eq_attr "type" "store_4, store_8"))
126 "xgene1_decode1op, xgene1_st")
128 (define_insn_reservation "xgene1_move" 1
129 (and (eq_attr "tune" "xgene1")
130 (eq_attr "type" "mov_reg,mov_imm,mrs"))
131 "xgene1_decode1op, xgene1_IXn")
133 (define_insn_reservation "xgene1_alu_cond" 1
134 (and (eq_attr "tune" "xgene1")
135 (eq_attr "type" "csel"))
136 "xgene1_decode1op, xgene1_IXn")
138 (define_insn_reservation "xgene1_alu" 1
139 (and (eq_attr "tune" "xgene1")
140 (eq_attr "type" "alu_imm,alu_sreg,alu_shift_imm,\
141 alu_ext,adc_reg,logic_imm,\
142 logic_reg,logic_shift_imm,clz,\
143 rbit,adr,mov_reg,shift_imm,\
144 mov_imm,extend,multiple"))
145 "xgene1_decode1op, xgene1_IXn")
147 (define_insn_reservation "xgene1_shift_rotate" 2
148 (and (eq_attr "tune" "xgene1")
149 (eq_attr "type" "shift_reg"))
150 "xgene1_decode1op, xgene1_IXB, xgene1_IXB_compl")
152 (define_insn_reservation "xgene1_simd" 2
153 (and (eq_attr "tune" "xgene1")
154 (eq_attr "type" "rev"))
155 "xgene1_decode1op, xgene1_IXB, xgene1_IXB_compl")
157 (define_insn_reservation "xgene1_alus" 1
158 (and (eq_attr "tune" "xgene1")
159 (eq_attr "type" "alus_imm,alus_sreg,alus_shift_imm,\
160 alus_ext,logics_imm,logics_reg,\
162 "xgene1_decode1op, xgene1_IXB, xgene1_IXB_compl")
164 (define_bypass 2 "xgene1_alus"
165 "xgene1_alu_cond, xgene1_branch")
167 (define_insn_reservation "xgene1_mul32" 4
168 (and (eq_attr "tune" "xgene1")
169 (eq_attr "mul32" "yes"))
170 "xgene1_decode2op, xgene1_IXB + xgene1_multiply, xgene1_multiply, nothing, xgene1_IXB_compl")
172 (define_insn_reservation "xgene1_mul64" 5
173 (and (eq_attr "tune" "xgene1")
174 (eq_attr "mul64" "yes"))
175 "xgene1_decode2op, xgene1_IXB + xgene1_multiply, xgene1_multiply, nothing*2, xgene1_IXB_compl")
177 (define_insn_reservation "xgene1_div" 34
178 (and (eq_attr "tune" "xgene1")
179 (eq_attr "type" "sdiv,udiv"))
180 "xgene1_decode1op, xgene1_IXB + xgene1_divide*7")
182 (define_insn_reservation "xgene1_fcmp" 10
183 (and (eq_attr "tune" "xgene1")
184 (eq_attr "type" "fcmpd,fcmps,fccmpd,fccmps"))
185 "xgene1_decode1op, xgene1_fsu + xgene1_fcmp*3")
187 (define_insn_reservation "xgene1_fcsel" 3
188 (and (eq_attr "tune" "xgene1")
189 (eq_attr "type" "fcsel"))
190 "xgene1_decode1op, xgene1_fsu")
192 (define_insn_reservation "xgene1_bfx" 1
193 (and (eq_attr "tune" "xgene1")
194 (eq_attr "type" "bfx"))
195 "xgene1_decode1op, xgene1_IXn")
197 (define_insn_reservation "xgene1_bfm" 2
198 (and (eq_attr "tune" "xgene1")
199 (eq_attr "type" "bfm"))
200 "xgene1_decode1op, xgene1_IXB, xgene1_IXB_compl")
202 (define_insn_reservation "xgene1_f_rint" 5
203 (and (eq_attr "tune" "xgene1")
204 (eq_attr "type" "f_rintd,f_rints"))
205 "xgene1_decode1op, xgene1_fsu")
207 (define_insn_reservation "xgene1_f_cvt" 3
208 (and (eq_attr "tune" "xgene1")
209 (eq_attr "type" "f_cvt"))
210 "xgene1_decode1op,xgene1_fsu")
212 (define_insn_reservation "xgene1_f_cvtf2i" 11
213 (and (eq_attr "tune" "xgene1")
214 (eq_attr "type" "f_cvtf2i"))
215 "xgene1_decodeIsolated,xgene1_fsu")
217 (define_insn_reservation "xgene1_f_cvti2f" 14
218 (and (eq_attr "tune" "xgene1")
219 (eq_attr "type" "f_cvti2f"))
220 "xgene1_decodeIsolated,xgene1_fsu")
222 (define_insn_reservation "xgene1_f_add" 5
223 (and (eq_attr "tune" "xgene1")
224 (eq_attr "type" "faddd,fadds,fmuld,fmuls"))
225 "xgene1_decode1op,xgene1_fsu")
227 (define_insn_reservation "xgene1_f_divs" 22
228 (and (eq_attr "tune" "xgene1")
229 (eq_attr "type" "fdivs,fsqrts"))
230 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*8,xgene1_fp_divide*14")
232 (define_insn_reservation "xgene1_f_divd" 28
233 (and (eq_attr "tune" "xgene1")
234 (eq_attr "type" "fdivd"))
235 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*11,xgene1_fp_divide*17")
237 (define_insn_reservation "xgene1_f_sqrtd" 28
238 (and (eq_attr "tune" "xgene1")
239 (eq_attr "type" "fsqrtd"))
240 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*17,xgene1_fp_divide*11")
242 (define_insn_reservation "xgene1_f_arith" 2
243 (and (eq_attr "tune" "xgene1")
244 (eq_attr "type" "ffarithd,ffariths"))
245 "xgene1_decode1op,xgene1_fsu")
247 (define_insn_reservation "xgene1_f_select" 3
248 (and (eq_attr "tune" "xgene1")
249 (eq_attr "type" "f_minmaxd,f_minmaxs"))
250 "xgene1_decode1op,xgene1_fsu")
252 (define_insn_reservation "xgene1_neon_dup" 3
253 (and (eq_attr "tune" "xgene1")
254 (eq_attr "type" "neon_dup,neon_dup_q"))
255 "xgene1_decode1op,xgene1_fsu")
257 (define_insn_reservation "xgene1_neon_load1" 11
258 (and (eq_attr "tune" "xgene1")
259 (eq_attr "type" "neon_load1_1reg, neon_load1_1reg_q"))
260 "xgene1_decode2op, xgene1_ld")
262 (define_insn_reservation "xgene1_neon_store1" 5
263 (and (eq_attr "tune" "xgene1")
264 (eq_attr "type" "neon_store1_1reg, neon_store1_1reg_q"))
265 "xgene1_decode2op, xgene1_st")
267 (define_insn_reservation "xgene1_neon_logic" 2
268 (and (eq_attr "tune" "xgene1")
269 (eq_attr "type" "neon_logic,\
276 "xgene1_decode1op,xgene1_fsu")
278 (define_insn_reservation "xgene1_neon_umov" 7
279 (and (eq_attr "tune" "xgene1")
280 (eq_attr "type" "neon_to_gp, neon_to_gp_q"))
281 "xgene1_decodeIsolated")
283 (define_insn_reservation "xgene1_neon_ins" 14
284 (and (eq_attr "tune" "xgene1")
285 (eq_attr "type" "neon_from_gp,\
290 "xgene1_decodeIsolated,xgene1_fsu")
292 (define_insn_reservation "xgene1_neon_shift" 3
293 (and (eq_attr "tune" "xgene1")
294 (eq_attr "type" "neon_shift_imm,\
298 neon_shift_imm_long,\
300 neon_sat_shift_imm_q,\
301 neon_sat_shift_imm_narrow_q,\
303 neon_sat_shift_reg_q,\
304 neon_shift_imm_narrow_q,\
306 "xgene1_decode1op,xgene1_fsu")
308 (define_insn_reservation "xgene1_neon_arith" 3
309 (and (eq_attr "tune" "xgene1")
310 (eq_attr "type" "neon_add,\
332 neon_compare_zero_q,\
338 "xgene1_decode1op,xgene1_fsu")
340 (define_insn_reservation "xgene1_neon_abs_diff" 6
341 (and (eq_attr "tune" "xgene1")
342 (eq_attr "type" "neon_arith_acc,neon_arith_acc_q"))
343 "xgene1_decode2op,xgene1_fsu*2")
345 (define_insn_reservation "xgene1_neon_mul" 5
346 (and (eq_attr "tune" "xgene1")
347 (eq_attr "type" "neon_mul_b,\
353 neon_fp_mul_s_scalar,\
354 neon_fp_mul_s_scalar_q,\
355 neon_fp_mul_d_scalar_q,\
356 neon_mla_b,neon_mla_b_q,\
357 neon_mla_h,neon_mla_h_q,\
358 neon_mla_s,neon_mla_s_q,\
360 neon_mla_h_scalar_q,\
362 neon_mla_s_scalar_q,\
374 neon_fp_mla_s_scalar,\
375 neon_fp_mla_s_scalar_q,\
376 neon_fp_mla_d_scalar_q,\
383 neon_sat_mul_h_scalar,\
384 neon_sat_mul_h_scalar_q,\
385 neon_sat_mul_s_scalar,\
386 neon_sat_mul_s_scalar_q,\
387 neon_sat_mul_h_scalar_long,\
388 neon_sat_mul_s_scalar_long,\
389 neon_sat_mla_b_long,\
390 neon_sat_mla_h_long,\
391 neon_sat_mla_s_long,\
392 neon_sat_mla_h_scalar_long,\
393 neon_sat_mla_s_scalar_long,\
395 "xgene1_decode2op,xgene1_fsu*2")
397 (define_insn_reservation "xgene1_fp_abd_diff" 5
398 (and (eq_attr "tune" "xgene1")
399 (eq_attr "type" "neon_fp_abd_s,\
404 "xgene1_decode1op,xgene1_fsu")
406 (define_insn_reservation "xgene1_neon_f_add" 5
407 (and (eq_attr "tune" "xgene1")
408 (eq_attr "type" "neon_fp_addsub_s,\
415 (define_insn_reservation "xgene1_neon_f_div" 2
416 (and (eq_attr "tune" "xgene1")
417 (eq_attr "type" "neon_fp_div_s,\
422 "xgene1_decode1op,(xgene1_fsu+xgene1_fp_divide)")
424 (define_insn_reservation "xgene1_neon_f_neg" 2
425 (and (eq_attr "tune" "xgene1")
426 (eq_attr "type" "neon_fp_neg_s,\
437 (define_insn_reservation "xgene1_neon_f_round" 5
438 (and (eq_attr "tune" "xgene1")
439 (eq_attr "type" "neon_fp_round_s,\
446 (define_insn_reservation "xgene1_neon_f_cvt" 5
447 (and (eq_attr "tune" "xgene1")
448 (eq_attr "type" "neon_int_to_fp_s,\
452 neon_fp_cvt_widen_s,\
453 neon_fp_cvt_narrow_s_q,\
454 neon_fp_cvt_narrow_d_q,\
458 (define_insn_reservation "xgene1_neon_f_reduc" 5
459 (and (eq_attr "tune" "xgene1")
460 (eq_attr "type" "neon_fp_reduc_add_s,\
461 neon_fp_reduc_add_s_q,\
462 neon_fp_reduc_add_d,\
463 neon_fp_reduc_add_d_q,\
467 (define_insn_reservation "xgene1_neon_cls" 2
468 (and (eq_attr "tune" "xgene1")
469 (eq_attr "type" "neon_cls,neon_cls_q"))
472 (define_insn_reservation "xgene1_neon_st1" 4
473 (and (eq_attr "tune" "xgene1")
474 (eq_attr "type" "neon_store1_one_lane,\
475 neon_store1_one_lane_q,\
479 "xgene1_decodeIsolated, xgene1_st")
481 (define_insn_reservation "xgene1_neon_halve_narrow" 6
482 (and (eq_attr "tune" "xgene1")
483 (eq_attr "type" "neon_sub_halve_narrow_q,\
484 neon_add_halve_narrow_q,\
486 "xgene1_decodeIsolated")
488 (define_insn_reservation "xgene1_neon_shift_acc" 6
489 (and (eq_attr "tune" "xgene1")
490 (eq_attr "type" "neon_shift_acc,\
495 (define_insn_reservation "xgene1_neon_fp_compare" 3
496 (and (eq_attr "tune" "xgene1")
497 (eq_attr "type" "neon_fp_compare_s,\
498 neon_fp_compare_s_q,\
500 neon_fp_compare_d_q,\
504 (define_insn_reservation "xgene1_neon_fp_sqrt" 2
505 (and (eq_attr "tune" "xgene1")
506 (eq_attr "type" "neon_fp_sqrt_s,\
511 "xgene1_decode1op,(xgene1_fsu+xgene1_fp_divide)")
513 (define_insn_reservation "xgene1_neon_tbl1" 4
514 (and (eq_attr "tune" "xgene1")
515 (eq_attr "type" "neon_tbl1,\
520 (define_insn_reservation "xgene1_neon_tbl2" 8
521 (and (eq_attr "tune" "xgene1")
522 (eq_attr "type" "neon_tbl2,\
525 "xgene1_decodeIsolated")
527 (define_insn_reservation "xgene1_neon_permute" 3
528 (and (eq_attr "tune" "xgene1")
529 (eq_attr "type" "neon_permute,\
534 (define_insn_reservation "xgene1_neon_ld1r" 10
535 (and (eq_attr "tune" "xgene1")
536 (eq_attr "type" "neon_load1_all_lanes,\
538 "xgene1_decode1op, xgene1_ld")
540 (define_insn_reservation "xgene1_neon_fp_recp" 3
541 (and (eq_attr "tune" "xgene1")
542 (eq_attr "type" "neon_fp_recpe_s,\
554 (define_insn_reservation "xgene1_neon_fp_recp_s" 5
555 (and (eq_attr "tune" "xgene1")
556 (eq_attr "type" "neon_fp_recps_s,\
563 (define_insn_reservation "xgene1_neon_pmull" 5
564 (and (eq_attr "tune" "xgene1")
565 (eq_attr "type" "neon_mul_d_long,\