annotate gcc/config/arm/cortex-m7.md @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; ARM Cortex-M7 pipeline description
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 ;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;;
kono
parents:
diff changeset
4 ;; This file is part of GCC.
kono
parents:
diff changeset
5 ;;
kono
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
7 ;; under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 ;; any later version.
kono
parents:
diff changeset
10 ;;
kono
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful, but
kono
parents:
diff changeset
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
kono
parents:
diff changeset
14 ;; General Public License for more details.
kono
parents:
diff changeset
15 ;;
kono
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 (define_automaton "cortex_m7")
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 ;; We model the dual-issue constraints of this core with
kono
parents:
diff changeset
23 ;; following units.
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 (define_cpu_unit "cm7_i0, cm7_i1" "cortex_m7")
kono
parents:
diff changeset
26 (define_cpu_unit "cm7_a0, cm7_a1" "cortex_m7")
kono
parents:
diff changeset
27 (define_cpu_unit "cm7_branch,cm7_wb,cm7_ext,cm7_shf" "cortex_m7")
kono
parents:
diff changeset
28 (define_cpu_unit "cm7_lsu" "cortex_m7")
kono
parents:
diff changeset
29 (define_cpu_unit "cm7_mac" "cortex_m7")
kono
parents:
diff changeset
30 (define_cpu_unit "cm7_fpu" "cortex_m7")
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 (define_reservation "cm7_all_units"
kono
parents:
diff changeset
33 "cm7_i0+cm7_i1+cm7_a0+cm7_a1+cm7_branch\
kono
parents:
diff changeset
34 +cm7_wb+cm7_ext+cm7_shf+cm7_lsu+cm7_mac\
kono
parents:
diff changeset
35 +cm7_fpu")
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 ;; Simple alu instruction without inline shift operation.
kono
parents:
diff changeset
38 (define_insn_reservation "cortex_m7_alu_simple" 2
kono
parents:
diff changeset
39 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
40 (eq_attr "type" "alu_imm,alus_imm,logic_imm,logics_imm,\
kono
parents:
diff changeset
41 alu_sreg,alus_sreg,logic_reg,logics_reg,\
kono
parents:
diff changeset
42 adc_imm,adcs_imm,adc_reg,adcs_reg,\
kono
parents:
diff changeset
43 adr,bfm,rev,\
kono
parents:
diff changeset
44 shift_imm,shift_reg,\
kono
parents:
diff changeset
45 mov_imm,mov_reg,mvn_imm,mvn_reg,\
kono
parents:
diff changeset
46 mov_shift_reg,mov_shift,\
kono
parents:
diff changeset
47 mvn_shift,mvn_shift_reg,\
kono
parents:
diff changeset
48 logic_shift_imm,logics_shift_imm,\
kono
parents:
diff changeset
49 alu_shift_reg,alus_shift_reg,\
kono
parents:
diff changeset
50 logic_shift_reg,logics_shift_reg,\
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
51 mrs,clz,f_mcr,f_mrc,multiple"))
111
kono
parents:
diff changeset
52 "cm7_i0|cm7_i1,cm7_a0|cm7_a1")
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 ;; Simple alu with inline shift operation.
kono
parents:
diff changeset
55 (define_insn_reservation "cortex_m7_alu_shift" 2
kono
parents:
diff changeset
56 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
57 (eq_attr "type" "alu_shift_imm,alus_shift_imm"))
kono
parents:
diff changeset
58 "cm7_i0|cm7_i1,(cm7_a0|cm7_a1)+cm7_shf+cm7_branch")
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 ;; Only one ALU can be used for DSP instructions.
kono
parents:
diff changeset
61 (define_insn_reservation "cortex_m7_dsp" 2
kono
parents:
diff changeset
62 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
63 (eq_attr "type" "alu_dsp_reg,smlaxy,smlalxy,smulxy"))
kono
parents:
diff changeset
64 "cm7_i0|cm7_i1,cm7_a0")
kono
parents:
diff changeset
65
kono
parents:
diff changeset
66 ;; The multiply instructions.
kono
parents:
diff changeset
67 (define_insn_reservation "cortex_m7_multiply" 2
kono
parents:
diff changeset
68 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
69 (eq_attr "type" "mul,muls,umull,smull"))
kono
parents:
diff changeset
70 "cm7_i0|cm7_i1,(cm7_a0|cm7_a1)+cm7_wb")
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 (define_insn_reservation "cortex_m7_idiv" 4
kono
parents:
diff changeset
73 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
74 (eq_attr "type" "sdiv,udiv"))
kono
parents:
diff changeset
75 "cm7_all_units*4")
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 (define_insn_reservation "cortex_m7_alu_extend" 2
kono
parents:
diff changeset
78 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
79 (eq_attr "type" "extend"))
kono
parents:
diff changeset
80 "cm7_i0|cm7_i1,(cm7_a0|cm7_a1)+cm7_ext+cm7_branch")
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 (define_insn_reservation "cortex_m7_mac" 2
kono
parents:
diff changeset
83 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
84 (eq_attr "type" "mla,mlas"))
kono
parents:
diff changeset
85 "cm7_i0|cm7_i1,cm7_mac+cm7_wb")
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 ;; The branch instructions.
kono
parents:
diff changeset
88 (define_insn_reservation "cortex_m7_branch" 0
kono
parents:
diff changeset
89 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
90 (eq_attr "type" "branch,call"))
kono
parents:
diff changeset
91 "cm7_i0|cm7_i1,cm7_branch")
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 ;; The load instructions.
kono
parents:
diff changeset
94 (define_insn_reservation "cortex_m7_load1" 2
kono
parents:
diff changeset
95 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
96 (eq_attr "type" "load_byte, load_4"))
kono
parents:
diff changeset
97 "cm7_i0|cm7_i1,cm7_lsu")
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 (define_insn_reservation "cortex_m7_load2" 2
kono
parents:
diff changeset
100 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
101 (eq_attr "type" "load_8"))
kono
parents:
diff changeset
102 "cm7_all_units")
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 (define_insn_reservation "cortex_m7_loadm" 2
kono
parents:
diff changeset
105 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
106 (eq_attr "type" "load_12,load_16"))
kono
parents:
diff changeset
107 "cm7_all_units*2")
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 ;; The store instructions.
kono
parents:
diff changeset
110 (define_insn_reservation "cortex_m7_store1" 0
kono
parents:
diff changeset
111 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
112 (eq_attr "type" "store_4"))
kono
parents:
diff changeset
113 "cm7_i0|cm7_i1,cm7_lsu+cm7_wb")
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 (define_insn_reservation "cortex_m7_store2" 0
kono
parents:
diff changeset
116 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
117 (eq_attr "type" "store_8"))
kono
parents:
diff changeset
118 "cm7_all_units")
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 (define_insn_reservation "cortex_m7_storem" 0
kono
parents:
diff changeset
121 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
122 (eq_attr "type" "store_12,store_16"))
kono
parents:
diff changeset
123 "cm7_all_units*2")
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 ;; The FPU instructions.
kono
parents:
diff changeset
126 (define_insn_reservation "cortex_m7_fpalu" 3
kono
parents:
diff changeset
127 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
128 (eq_attr "type" "ffariths,ffarithd,fadds,faddd,fmov,fconsts,\
kono
parents:
diff changeset
129 fconstd,fcmpd,f_cvt,f_cvtf2i,f_cvti2f, fcmps,\
kono
parents:
diff changeset
130 fmuls,f_flag"))
kono
parents:
diff changeset
131 "cm7_i0|cm7_i1,cm7_fpu")
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 (define_insn_reservation "cortex_m7_fmacs" 6
kono
parents:
diff changeset
134 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
135 (eq_attr "type" "fmacs,ffmas"))
kono
parents:
diff changeset
136 "cm7_i0|cm7_i1,cm7_fpu")
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 (define_insn_reservation "cortex_m7_fdivs" 16
kono
parents:
diff changeset
139 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
140 (eq_attr "type" "fdivs, fsqrts"))
kono
parents:
diff changeset
141 "cm7_i0|cm7_i1, cm7_fpu*5")
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 (define_insn_reservation "cortex_m7_f_loads" 2
kono
parents:
diff changeset
144 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
145 (eq_attr "type" "f_loads"))
kono
parents:
diff changeset
146 "cm7_i0|cm7_i1, cm7_lsu")
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 (define_insn_reservation "cortex_m7_f_stores" 0
kono
parents:
diff changeset
149 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
150 (eq_attr "type" "f_stores"))
kono
parents:
diff changeset
151 "cm7_i0|cm7_i1, cm7_lsu+cm7_wb")
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 (define_insn_reservation "cortex_m7_fmuld" 6
kono
parents:
diff changeset
154 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
155 (eq_attr "type" "fmuld"))
kono
parents:
diff changeset
156 "cm7_i0|cm7_i1,cm7_fpu*3")
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 (define_insn_reservation "cortex_m7_fmacd" 10
kono
parents:
diff changeset
159 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
160 (eq_attr "type" "fmacd,ffmad"))
kono
parents:
diff changeset
161 "cm7_i0|cm7_i1,cm7_fpu*4")
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 (define_insn_reservation "cortex_m7_fdivd" 31
kono
parents:
diff changeset
164 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
165 (eq_attr "type" "fdivd,fsqrtd"))
kono
parents:
diff changeset
166 "cm7_i0|cm7_i1,cm7_fpu*4")
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 (define_insn_reservation "cortex_m7_f_loadd" 3
kono
parents:
diff changeset
169 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
170 (eq_attr "type" "f_loadd"))
kono
parents:
diff changeset
171 "cm7_all_units")
kono
parents:
diff changeset
172
kono
parents:
diff changeset
173 (define_insn_reservation "cortex_m7_f_stored" 0
kono
parents:
diff changeset
174 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
175 (eq_attr "type" "f_stored"))
kono
parents:
diff changeset
176 "cm7_all_units")
kono
parents:
diff changeset
177
kono
parents:
diff changeset
178 (define_insn_reservation "cortex_m7_f_mcr" 1
kono
parents:
diff changeset
179 (and (eq_attr "tune" "cortexm7")
kono
parents:
diff changeset
180 (eq_attr "type" "f_mcrr,f_mrrc"))
kono
parents:
diff changeset
181 "cm7_all_units")