1 ;; Machine description for AppliedMicro xgene1 core.
2 ;; Copyright (C) 2012-2016 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")
25 (define_cpu_unit "xgene1_decode_out0" "xgene1")
26 (define_cpu_unit "xgene1_decode_out1" "xgene1")
27 (define_cpu_unit "xgene1_decode_out2" "xgene1")
28 (define_cpu_unit "xgene1_decode_out3" "xgene1")
30 (define_cpu_unit "xgene1_divide" "xgene1")
31 (define_cpu_unit "xgene1_fp_divide" "xgene1")
32 (define_cpu_unit "xgene1_fsu" "xgene1")
33 (define_cpu_unit "xgene1_fcmp" "xgene1")
35 (define_reservation "xgene1_decode1op"
36 "( xgene1_decode_out0 )
37 |( xgene1_decode_out1 )
38 |( xgene1_decode_out2 )
39 |( xgene1_decode_out3 )"
41 (define_reservation "xgene1_decode2op"
42 "( xgene1_decode_out0 + xgene1_decode_out1 )
43 |( xgene1_decode_out0 + xgene1_decode_out2 )
44 |( xgene1_decode_out0 + xgene1_decode_out3 )
45 |( xgene1_decode_out1 + xgene1_decode_out2 )
46 |( xgene1_decode_out1 + xgene1_decode_out3 )
47 |( xgene1_decode_out2 + xgene1_decode_out3 )"
49 (define_reservation "xgene1_decodeIsolated"
50 "( xgene1_decode_out0 + xgene1_decode_out1 + xgene1_decode_out2 + xgene1_decode_out3 )"
53 (define_insn_reservation "xgene1_branch" 1
54 (and (eq_attr "tune" "xgene1")
55 (eq_attr "type" "branch"))
58 (define_insn_reservation "xgene1_nop" 1
59 (and (eq_attr "tune" "xgene1")
60 (eq_attr "type" "no_insn"))
63 (define_insn_reservation "xgene1_call" 1
64 (and (eq_attr "tune" "xgene1")
65 (eq_attr "type" "call"))
68 (define_insn_reservation "xgene1_f_load" 10
69 (and (eq_attr "tune" "xgene1")
70 (eq_attr "type" "f_loadd,f_loads"))
73 (define_insn_reservation "xgene1_f_store" 4
74 (and (eq_attr "tune" "xgene1")
75 (eq_attr "type" "f_stored,f_stores"))
78 (define_insn_reservation "xgene1_fmov" 2
79 (and (eq_attr "tune" "xgene1")
80 (eq_attr "type" "fmov,fconsts,fconstd"))
83 (define_insn_reservation "xgene1_f_mcr" 10
84 (and (eq_attr "tune" "xgene1")
85 (eq_attr "type" "f_mcr"))
86 "xgene1_decodeIsolated")
88 (define_insn_reservation "xgene1_f_mrc" 4
89 (and (eq_attr "tune" "xgene1")
90 (eq_attr "type" "f_mrc"))
93 (define_insn_reservation "xgene1_load_pair" 6
94 (and (eq_attr "tune" "xgene1")
95 (eq_attr "type" "load2"))
96 "xgene1_decodeIsolated")
98 (define_insn_reservation "xgene1_store_pair" 2
99 (and (eq_attr "tune" "xgene1")
100 (eq_attr "type" "store2"))
101 "xgene1_decodeIsolated")
103 (define_insn_reservation "xgene1_fp_load1" 10
104 (and (eq_attr "tune" "xgene1")
105 (eq_attr "type" "load1")
106 (eq_attr "fp" "yes"))
109 (define_insn_reservation "xgene1_load1" 5
110 (and (eq_attr "tune" "xgene1")
111 (eq_attr "type" "load1"))
114 (define_insn_reservation "xgene1_store1" 2
115 (and (eq_attr "tune" "xgene1")
116 (eq_attr "type" "store1"))
119 (define_insn_reservation "xgene1_move" 1
120 (and (eq_attr "tune" "xgene1")
121 (eq_attr "type" "mov_reg,mov_imm,mrs"))
124 (define_insn_reservation "xgene1_alu" 1
125 (and (eq_attr "tune" "xgene1")
126 (eq_attr "type" "alu_imm,alu_sreg,alu_shift_imm,\
127 alu_ext,adc_reg,csel,logic_imm,\
128 logic_reg,logic_shift_imm,clz,\
129 rbit,shift_reg,adr,mov_reg,\
133 (define_insn_reservation "xgene1_simd" 1
134 (and (eq_attr "tune" "xgene1")
135 (eq_attr "type" "rev"))
138 (define_insn_reservation "xgene1_alus" 1
139 (and (eq_attr "tune" "xgene1")
140 (eq_attr "type" "alus_imm,alu_sreg,alus_shift_imm,\
141 alus_ext,logics_imm,logics_reg,\
145 (define_insn_reservation "xgene1_mul" 6
146 (and (eq_attr "tune" "xgene1")
147 (eq_attr "type" "mul,mla,smull,umull,smlal,umlal"))
150 (define_insn_reservation "xgene1_div" 34
151 (and (eq_attr "tune" "xgene1")
152 (eq_attr "type" "sdiv,udiv"))
153 "xgene1_decode1op,xgene1_divide*7")
155 (define_insn_reservation "xgene1_fcmp" 10
156 (and (eq_attr "tune" "xgene1")
157 (eq_attr "type" "fcmpd,fcmps,fccmpd,fccmps"))
158 "xgene1_decode1op,xgene1_fsu+xgene1_fcmp*3")
160 (define_insn_reservation "xgene1_fcsel" 3
161 (and (eq_attr "tune" "xgene1")
162 (eq_attr "type" "fcsel"))
163 "xgene1_decode1op,xgene1_fsu")
165 (define_insn_reservation "xgene1_bfm" 2
166 (and (eq_attr "tune" "xgene1")
167 (eq_attr "type" "bfm"))
168 "xgene1_decode1op,xgene1_fsu")
170 (define_insn_reservation "xgene1_f_rint" 5
171 (and (eq_attr "tune" "xgene1")
172 (eq_attr "type" "f_rintd,f_rints"))
173 "xgene1_decode1op,xgene1_fsu")
175 (define_insn_reservation "xgene1_f_cvt" 3
176 (and (eq_attr "tune" "xgene1")
177 (eq_attr "type" "f_cvt"))
178 "xgene1_decode1op,xgene1_fsu")
180 (define_insn_reservation "xgene1_f_cvtf2i" 11
181 (and (eq_attr "tune" "xgene1")
182 (eq_attr "type" "f_cvtf2i"))
183 "xgene1_decodeIsolated,xgene1_fsu")
185 (define_insn_reservation "xgene1_f_cvti2f" 14
186 (and (eq_attr "tune" "xgene1")
187 (eq_attr "type" "f_cvti2f"))
188 "xgene1_decodeIsolated,xgene1_fsu")
190 (define_insn_reservation "xgene1_f_add" 5
191 (and (eq_attr "tune" "xgene1")
192 (eq_attr "type" "faddd,fadds,fmuld,fmuls"))
193 "xgene1_decode1op,xgene1_fsu")
195 (define_insn_reservation "xgene1_f_divs" 22
196 (and (eq_attr "tune" "xgene1")
197 (eq_attr "type" "fdivs,fsqrts"))
198 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*8,xgene1_fp_divide*14")
200 (define_insn_reservation "xgene1_f_divd" 28
201 (and (eq_attr "tune" "xgene1")
202 (eq_attr "type" "fdivd"))
203 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*11,xgene1_fp_divide*17")
205 (define_insn_reservation "xgene1_f_sqrtd" 28
206 (and (eq_attr "tune" "xgene1")
207 (eq_attr "type" "fsqrtd"))
208 "xgene1_decode1op,(xgene1_fp_divide+xgene1_fsu)*17,xgene1_fp_divide*11")
210 (define_insn_reservation "xgene1_f_arith" 2
211 (and (eq_attr "tune" "xgene1")
212 (eq_attr "type" "ffarithd,ffariths"))
213 "xgene1_decode1op,xgene1_fsu")
215 (define_insn_reservation "xgene1_f_select" 3
216 (and (eq_attr "tune" "xgene1")
217 (eq_attr "type" "f_minmaxd,f_minmaxs"))
218 "xgene1_decode1op,xgene1_fsu")
220 (define_insn_reservation "xgene1_neon_dup" 3
221 (and (eq_attr "tune" "xgene1")
222 (eq_attr "type" "neon_dup,neon_dup_q"))
223 "xgene1_decode1op,xgene1_fsu")
225 (define_insn_reservation "xgene1_neon_load1" 11
226 (and (eq_attr "tune" "xgene1")
227 (eq_attr "type" "neon_load1_1reg, neon_load1_1reg_q"))
228 "xgene1_decode2op,xgene1_fsu")
230 (define_insn_reservation "xgene1_neon_store1" 5
231 (and (eq_attr "tune" "xgene1")
232 (eq_attr "type" "neon_store1_1reg, neon_store1_1reg_q"))
233 "xgene1_decode2op,xgene1_fsu")
235 (define_insn_reservation "xgene1_neon_logic" 2
236 (and (eq_attr "tune" "xgene1")
237 (eq_attr "type" "neon_logic,\
244 "xgene1_decode1op,xgene1_fsu")
246 (define_insn_reservation "xgene1_neon_umov" 7
247 (and (eq_attr "tune" "xgene1")
248 (eq_attr "type" "neon_to_gp, neon_to_gp_q"))
249 "xgene1_decodeIsolated")
251 (define_insn_reservation "xgene1_neon_ins" 14
252 (and (eq_attr "tune" "xgene1")
253 (eq_attr "type" "neon_from_gp,\
258 "xgene1_decodeIsolated,xgene1_fsu")
260 (define_insn_reservation "xgene1_neon_shift" 3
261 (and (eq_attr "tune" "xgene1")
262 (eq_attr "type" "neon_shift_imm,\
266 neon_shift_imm_long,\
268 neon_sat_shift_imm_q,\
269 neon_sat_shift_imm_narrow_q,\
271 neon_sat_shift_reg_q,\
272 neon_shift_imm_narrow_q,\
274 "xgene1_decode1op,xgene1_fsu")
276 (define_insn_reservation "xgene1_neon_arith" 3
277 (and (eq_attr "tune" "xgene1")
278 (eq_attr "type" "neon_add,\
300 neon_compare_zero_q,\
304 "xgene1_decode1op,xgene1_fsu")
306 (define_insn_reservation "xgene1_neon_abs_diff" 6
307 (and (eq_attr "tune" "xgene1")
308 (eq_attr "type" "neon_arith_acc,neon_arith_acc_q"))
309 "xgene1_decode2op,xgene1_fsu*2")
311 (define_insn_reservation "xgene1_neon_mul" 5
312 (and (eq_attr "tune" "xgene1")
313 (eq_attr "type" "neon_mul_b,\
319 neon_fp_mul_s_scalar,\
320 neon_fp_mul_s_scalar_q,\
321 neon_fp_mul_d_scalar_q,\
322 neon_mla_b,neon_mla_b_q,\
323 neon_mla_h,neon_mla_h_q,\
324 neon_mla_s,neon_mla_s_q,\
326 neon_mla_h_scalar_q,\
328 neon_mla_s_scalar_q,\
340 neon_fp_mla_s_scalar,\
341 neon_fp_mla_s_scalar_q,\
342 neon_fp_mla_d_scalar_q,\
349 neon_sat_mul_h_scalar,\
350 neon_sat_mul_h_scalar_q,\
351 neon_sat_mul_s_scalar,\
352 neon_sat_mul_s_scalar_q,\
353 neon_sat_mul_h_scalar_long,\
354 neon_sat_mul_s_scalar_long,\
355 neon_sat_mla_b_long,\
356 neon_sat_mla_h_long,\
357 neon_sat_mla_s_long,\
358 neon_sat_mla_h_scalar_long,\
359 neon_sat_mla_s_scalar_long,\
361 "xgene1_decode2op,xgene1_fsu*2")
363 (define_insn_reservation "xgene1_fp_abd_diff" 5
364 (and (eq_attr "tune" "xgene1")
365 (eq_attr "type" "neon_fp_abd_s,\
370 "xgene1_decode1op,xgene1_fsu")
372 (define_insn_reservation "xgene1_neon_f_add" 5
373 (and (eq_attr "tune" "xgene1")
374 (eq_attr "type" "neon_fp_addsub_s,\
381 (define_insn_reservation "xgene1_neon_f_div" 2
382 (and (eq_attr "tune" "xgene1")
383 (eq_attr "type" "neon_fp_div_s,\
388 "xgene1_decode1op,(xgene1_fsu+xgene1_fp_divide)")
390 (define_insn_reservation "xgene1_neon_f_neg" 2
391 (and (eq_attr "tune" "xgene1")
392 (eq_attr "type" "neon_fp_neg_s,\
403 (define_insn_reservation "xgene1_neon_f_round" 5
404 (and (eq_attr "tune" "xgene1")
405 (eq_attr "type" "neon_fp_round_s,\
412 (define_insn_reservation "xgene1_neon_f_cvt" 5
413 (and (eq_attr "tune" "xgene1")
414 (eq_attr "type" "neon_int_to_fp_s,\
418 neon_fp_cvt_widen_s,\
419 neon_fp_cvt_narrow_s_q,\
420 neon_fp_cvt_narrow_d_q,\
424 (define_insn_reservation "xgene1_neon_f_reduc" 5
425 (and (eq_attr "tune" "xgene1")
426 (eq_attr "type" "neon_fp_reduc_add_s,\
427 neon_fp_reduc_add_s_q,\
428 neon_fp_reduc_add_d,\
429 neon_fp_reduc_add_d_q,\
433 (define_insn_reservation "xgene1_neon_cls" 2
434 (and (eq_attr "tune" "xgene1")
435 (eq_attr "type" "neon_cls,neon_cls_q"))
438 (define_insn_reservation "xgene1_neon_st1" 4
439 (and (eq_attr "tune" "xgene1")
440 (eq_attr "type" "neon_store1_one_lane,\
441 neon_store1_one_lane_q,\
445 (define_insn_reservation "xgene1_neon_halve_narrow" 6
446 (and (eq_attr "tune" "xgene1")
447 (eq_attr "type" "neon_sub_halve_narrow_q,\
448 neon_add_halve_narrow_q,\
450 "xgene1_decodeIsolated")
452 (define_insn_reservation "xgene1_neon_shift_acc" 6
453 (and (eq_attr "tune" "xgene1")
454 (eq_attr "type" "neon_shift_acc,\
459 (define_insn_reservation "xgene1_neon_fp_compare" 3
460 (and (eq_attr "tune" "xgene1")
461 (eq_attr "type" "neon_fp_compare_s,\
462 neon_fp_compare_s_q,\
464 neon_fp_compare_d_q,\
468 (define_insn_reservation "xgene1_neon_fp_sqrt" 2
469 (and (eq_attr "tune" "xgene1")
470 (eq_attr "type" "neon_fp_sqrt_s,\
475 "xgene1_decode1op,(xgene1_fsu+xgene1_fp_divide)")
477 (define_insn_reservation "xgene1_neon_tbl1" 4
478 (and (eq_attr "tune" "xgene1")
479 (eq_attr "type" "neon_tbl1,\
484 (define_insn_reservation "xgene1_neon_tbl2" 8
485 (and (eq_attr "tune" "xgene1")
486 (eq_attr "type" "neon_tbl2,\
489 "xgene1_decodeIsolated")
491 (define_insn_reservation "xgene1_neon_permute" 3
492 (and (eq_attr "tune" "xgene1")
493 (eq_attr "type" "neon_permute,\
498 (define_insn_reservation "xgene1_neon_ld1r" 10
499 (and (eq_attr "tune" "xgene1")
500 (eq_attr "type" "neon_load1_all_lanes,\
504 (define_insn_reservation "xgene1_neon_fp_recp" 3
505 (and (eq_attr "tune" "xgene1")
506 (eq_attr "type" "neon_fp_recpe_s,\
518 (define_insn_reservation "xgene1_neon_fp_recp_s" 5
519 (and (eq_attr "tune" "xgene1")
520 (eq_attr "type" "neon_fp_recps_s,\
527 (define_insn_reservation "xgene1_neon_pmull" 5
528 (and (eq_attr "tune" "xgene1")
529 (eq_attr "type" "neon_mul_d_long,\