annotate gcc/config/mips/xlp.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 ;; DFA-based pipeline description for the XLP.
kono
parents:
diff changeset
2 ;; Copyright (C) 2012-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 ;;
kono
parents:
diff changeset
4 ;; xlp.md Machine Description for the Broadcom XLP Microprocessor
kono
parents:
diff changeset
5 ;; This file is part of GCC.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published
kono
parents:
diff changeset
9 ;; by the Free Software Foundation; either version 3, or (at your
kono
parents:
diff changeset
10 ;; option) any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
15 ;; License for more details.
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 (define_automaton "xlp_cpu")
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 ;; CPU function units.
kono
parents:
diff changeset
24 (define_cpu_unit "xlp_ex0" "xlp_cpu")
kono
parents:
diff changeset
25 (define_cpu_unit "xlp_ex1" "xlp_cpu")
kono
parents:
diff changeset
26 (define_cpu_unit "xlp_ex2" "xlp_cpu")
kono
parents:
diff changeset
27 (define_cpu_unit "xlp_ex3" "xlp_cpu")
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 ;; Integer Multiply Unit
kono
parents:
diff changeset
30 (define_cpu_unit "xlp_div" "xlp_cpu")
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 ;; ALU2 completion port.
kono
parents:
diff changeset
33 (define_cpu_unit "xlp_ex2_wrb" "xlp_cpu")
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 (define_automaton "xlp_fpu")
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 ;; Floating-point units.
kono
parents:
diff changeset
38 (define_cpu_unit "xlp_fp" "xlp_fpu")
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 ;; Floating Point Sqrt/Divide
kono
parents:
diff changeset
41 (define_cpu_unit "xlp_divsq" "xlp_fpu")
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 ;; FPU completion port.
kono
parents:
diff changeset
44 (define_cpu_unit "xlp_fp_wrb" "xlp_fpu")
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 ;; Define reservations for common combinations.
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 ;;
kono
parents:
diff changeset
49 ;; The ordering of the instruction-execution-path/resource-usage
kono
parents:
diff changeset
50 ;; descriptions (also known as reservation RTL) is roughly ordered
kono
parents:
diff changeset
51 ;; based on the define attribute RTL for the "type" classification.
kono
parents:
diff changeset
52 ;; When modifying, remember that the first test that matches is the
kono
parents:
diff changeset
53 ;; reservation used!
kono
parents:
diff changeset
54 ;;
kono
parents:
diff changeset
55 (define_insn_reservation "ir_xlp_unknown" 1
kono
parents:
diff changeset
56 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
57 (eq_attr "type" "unknown,multi"))
kono
parents:
diff changeset
58 "xlp_ex0+xlp_ex1+xlp_ex2+xlp_ex3")
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 (define_insn_reservation "ir_xlp_branch" 1
kono
parents:
diff changeset
61 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
62 (eq_attr "type" "branch,jump,call"))
kono
parents:
diff changeset
63 "xlp_ex3")
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 (define_insn_reservation "ir_xlp_prefetch" 1
kono
parents:
diff changeset
66 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
67 (eq_attr "type" "prefetch,prefetchx"))
kono
parents:
diff changeset
68 "xlp_ex0|xlp_ex1")
kono
parents:
diff changeset
69
kono
parents:
diff changeset
70 (define_insn_reservation "ir_xlp_load" 4
kono
parents:
diff changeset
71 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
72 (eq_attr "type" "load"))
kono
parents:
diff changeset
73 "xlp_ex0|xlp_ex1")
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 (define_insn_reservation "ir_xlp_fpload" 5
kono
parents:
diff changeset
76 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
77 (eq_attr "type" "fpload,fpidxload"))
kono
parents:
diff changeset
78 "xlp_ex0|xlp_ex1")
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 (define_insn_reservation "ir_xlp_alu" 1
kono
parents:
diff changeset
81 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
82 (eq_attr "type" "const,arith,shift,slt,clz,signext,logical,move,trap,nop"))
kono
parents:
diff changeset
83 "xlp_ex0|xlp_ex1|(xlp_ex2,xlp_ex2_wrb)|xlp_ex3")
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 (define_insn_reservation "ir_xlp_condmov" 1
kono
parents:
diff changeset
86 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
87 (eq_attr "type" "condmove")
kono
parents:
diff changeset
88 (eq_attr "mode" "SI,DI"))
kono
parents:
diff changeset
89 "xlp_ex2,xlp_ex2_wrb")
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 (define_insn_reservation "ir_xlp_mul" 5
kono
parents:
diff changeset
92 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
93 (eq_attr "type" "imul,imadd"))
kono
parents:
diff changeset
94 "xlp_ex2,nothing*4,xlp_ex2_wrb")
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 (define_insn_reservation "ir_xlp_mul3" 3
kono
parents:
diff changeset
97 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
98 (eq_attr "type" "imul3"))
kono
parents:
diff changeset
99 "xlp_ex2,nothing*2,xlp_ex2_wrb")
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 (define_insn_reservation "ir_xlp_div" 24
kono
parents:
diff changeset
102 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
103 (eq_attr "mode" "SI")
kono
parents:
diff changeset
104 (eq_attr "type" "idiv"))
kono
parents:
diff changeset
105 "xlp_ex2+xlp_div,xlp_div*23,xlp_ex2_wrb")
kono
parents:
diff changeset
106
kono
parents:
diff changeset
107 (define_insn_reservation "ir_xlp_ddiv" 48
kono
parents:
diff changeset
108 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
109 (eq_attr "mode" "DI")
kono
parents:
diff changeset
110 (eq_attr "type" "idiv"))
kono
parents:
diff changeset
111 "xlp_ex2+xlp_div,xlp_div*47,xlp_ex2_wrb")
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 (define_insn_reservation "ir_xlp_store" 1
kono
parents:
diff changeset
114 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
115 (eq_attr "type" "store,fpstore,fpidxstore"))
kono
parents:
diff changeset
116 "xlp_ex0|xlp_ex1")
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 (define_insn_reservation "ir_xlp_fpmove" 2
kono
parents:
diff changeset
119 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
120 (eq_attr "type" "mfc"))
kono
parents:
diff changeset
121 "xlp_ex3,xlp_fp,xlp_fp_wrb")
kono
parents:
diff changeset
122
kono
parents:
diff changeset
123 (define_insn_reservation "ir_xlp_mfhi" 1
kono
parents:
diff changeset
124 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
125 (eq_attr "type" "mfhi"))
kono
parents:
diff changeset
126 "xlp_ex2,xlp_ex2_wrb")
kono
parents:
diff changeset
127
kono
parents:
diff changeset
128 (define_insn_reservation "ir_xlp_mflo" 1
kono
parents:
diff changeset
129 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
130 (eq_attr "type" "mflo"))
kono
parents:
diff changeset
131 "xlp_ex2,xlp_ex2_wrb")
kono
parents:
diff changeset
132
kono
parents:
diff changeset
133 (define_insn_reservation "ir_xlp_mthi" 1
kono
parents:
diff changeset
134 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
135 (eq_attr "type" "mthi"))
kono
parents:
diff changeset
136 "xlp_ex2,xlp_ex2_wrb")
kono
parents:
diff changeset
137
kono
parents:
diff changeset
138 (define_insn_reservation "ir_xlp_mtlo" 3
kono
parents:
diff changeset
139 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
140 (eq_attr "type" "mtlo"))
kono
parents:
diff changeset
141 "xlp_ex2,nothing*2,xlp_ex2_wrb")
kono
parents:
diff changeset
142
kono
parents:
diff changeset
143 (define_insn_reservation "ir_xlp_fp2" 2
kono
parents:
diff changeset
144 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
145 (eq_attr "type" "fmove,fneg,fabs,condmove"))
kono
parents:
diff changeset
146 "xlp_fp,nothing,xlp_fp_wrb")
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 (define_insn_reservation "ir_xlp_fp3" 3
kono
parents:
diff changeset
149 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
150 (eq_attr "type" "fcmp"))
kono
parents:
diff changeset
151 "xlp_fp,nothing*2,xlp_fp_wrb")
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 (define_insn_reservation "ir_xlp_fp4" 4
kono
parents:
diff changeset
154 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
155 (eq_attr "type" "fcvt"))
kono
parents:
diff changeset
156 "xlp_fp,nothing*3,xlp_fp_wrb")
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 (define_insn_reservation "ir_xlp_fp5" 5
kono
parents:
diff changeset
159 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
160 (eq_attr "mode" "SF")
kono
parents:
diff changeset
161 (eq_attr "type" "fadd,fmul"))
kono
parents:
diff changeset
162 "xlp_fp,nothing*4,xlp_fp_wrb")
kono
parents:
diff changeset
163
kono
parents:
diff changeset
164 (define_insn_reservation "ir_xlp_fp6" 6
kono
parents:
diff changeset
165 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
166 (eq_attr "mode" "DF")
kono
parents:
diff changeset
167 (eq_attr "type" "fadd,fmul"))
kono
parents:
diff changeset
168 "xlp_fp,nothing*5,xlp_fp_wrb")
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170 (define_insn_reservation "ir_xlp_fp9" 9
kono
parents:
diff changeset
171 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
172 (eq_attr "mode" "SF")
kono
parents:
diff changeset
173 (eq_attr "type" "fmadd"))
kono
parents:
diff changeset
174 "xlp_fp,nothing*3,xlp_fp,nothing*3,xlp_fp_wrb")
kono
parents:
diff changeset
175
kono
parents:
diff changeset
176 (define_insn_reservation "ir_xlp_fp11" 11
kono
parents:
diff changeset
177 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
178 (eq_attr "mode" "DF")
kono
parents:
diff changeset
179 (eq_attr "type" "fmadd"))
kono
parents:
diff changeset
180 "xlp_fp,nothing*4,xlp_fp,nothing*4,xlp_fp_wrb")
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182 (define_insn_reservation "ir_xlp_fpcomplex_s" 23
kono
parents:
diff changeset
183 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
184 (eq_attr "mode" "SF")
kono
parents:
diff changeset
185 (eq_attr "type" "fdiv,frdiv,frdiv1,frdiv2,fsqrt,frsqrt,frsqrt1,frsqrt2"))
kono
parents:
diff changeset
186 "xlp_fp+xlp_divsq,xlp_divsq*22,xlp_fp_wrb")
kono
parents:
diff changeset
187
kono
parents:
diff changeset
188 (define_insn_reservation "ir_xlp_fpcomplex_d" 38
kono
parents:
diff changeset
189 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
190 (eq_attr "mode" "DF")
kono
parents:
diff changeset
191 (eq_attr "type" "fdiv,frdiv,frdiv1,frdiv2,fsqrt,frsqrt,frsqrt1,frsqrt2"))
kono
parents:
diff changeset
192 "xlp_fp+xlp_divsq,xlp_divsq*37,xlp_fp_wrb")
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 (define_bypass 3 "ir_xlp_mul" "ir_xlp_mfhi")
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196 (define_insn_reservation "ir_xlp_atomic" 15
kono
parents:
diff changeset
197 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
198 (eq_attr "type" "atomic"))
kono
parents:
diff changeset
199 "xlp_ex0|xlp_ex1")
kono
parents:
diff changeset
200
kono
parents:
diff changeset
201 ;; Sync loop consists of (in order)
kono
parents:
diff changeset
202 ;; (1) optional sync,
kono
parents:
diff changeset
203 ;; (2) LL instruction,
kono
parents:
diff changeset
204 ;; (3) branch and 1-2 ALU instructions,
kono
parents:
diff changeset
205 ;; (4) SC instruction,
kono
parents:
diff changeset
206 ;; (5) optional sync,
kono
parents:
diff changeset
207 ;; (6) branch and ALU instruction.
kono
parents:
diff changeset
208 ;; The net result of this reservation is a big delay with flush of
kono
parents:
diff changeset
209 ;; ALU pipeline and outgoing reservations discouraging use of EX3.
kono
parents:
diff changeset
210 (define_insn_reservation "ir_xlp_sync_loop" 40
kono
parents:
diff changeset
211 (and (eq_attr "cpu" "xlp")
kono
parents:
diff changeset
212 (eq_attr "type" "syncloop"))
kono
parents:
diff changeset
213 "(xlp_ex0+xlp_ex1+xlp_ex2+xlp_ex3)*39,xlp_ex3+(xlp_ex0|xlp_ex1|(xlp_ex2,xlp_ex2_wrb))")