1 ;; Copyright (C) 2002-2018 Free Software Foundation, Inc.
3 ;; This file is part of GCC.
5 ;; GCC is free software; you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation; either version 3, or (at your option)
10 ;; GCC is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;; GNU General Public License for more details.
15 ;; You should have received a copy of the GNU General Public License
16 ;; along with GCC; see the file COPYING3. If not see
17 ;; <http://www.gnu.org/licenses/>.
19 ;; DFA-based pipeline description for 5400
20 (define_automaton "vr54")
21 (define_cpu_unit "vr54_dp0" "vr54")
22 (define_cpu_unit "vr54_dp1" "vr54")
23 (define_cpu_unit "vr54_mem" "vr54")
24 (define_cpu_unit "vr54_mac" "vr54")
27 ;; The ordering of the instruction-execution-path/resource-usage
28 ;; descriptions (also known as reservation RTL) is roughly ordered
29 ;; based on the define attribute RTL for the "type" classification.
30 ;; When modifying, remember that the first test that matches is the
34 (define_insn_reservation "ir_vr54_unknown" 1
35 (and (eq_attr "cpu" "r5400")
36 (eq_attr "type" "unknown,atomic,syncloop"))
37 "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")
39 ;; Assume prediction fails.
40 (define_insn_reservation "ir_vr54_branch" 3
41 (and (eq_attr "cpu" "r5400")
42 (eq_attr "type" "branch,jump,call"))
45 (define_insn_reservation "ir_vr54_load" 2
46 (and (eq_attr "cpu" "r5400")
47 (eq_attr "type" "load,fpload,fpidxload"))
50 (define_insn_reservation "ir_vr54_store" 1
51 (and (eq_attr "cpu" "r5400")
52 (eq_attr "type" "store"))
55 (define_insn_reservation "ir_vr54_fstore" 1
56 (and (eq_attr "cpu" "r5400")
57 (eq_attr "type" "fpstore,fpidxstore"))
61 ;; This reservation is for conditional move based on integer
62 ;; or floating point CC.
63 (define_insn_reservation "ir_vr54_condmove" 4
64 (and (eq_attr "cpu" "r5400")
65 (eq_attr "type" "condmove"))
68 ;; Move to/from FPU registers
69 (define_insn_reservation "ir_vr54_xfer" 2
70 (and (eq_attr "cpu" "r5400")
71 (eq_attr "type" "mfc,mtc"))
74 (define_insn_reservation "ir_vr54_hilo" 1
75 (and (eq_attr "cpu" "r5400")
76 (eq_attr "type" "mthi,mtlo,mfhi,mflo"))
79 (define_insn_reservation "ir_vr54_arith" 1
80 (and (eq_attr "cpu" "r5400")
81 (eq_attr "type" "arith,shift,signext,slt,clz,const,logical,move,nop,trap"))
84 (define_insn_reservation "ir_vr54_imul_si" 3
85 (and (eq_attr "cpu" "r5400")
86 (and (eq_attr "type" "imul,imul3")
87 (eq_attr "mode" "SI")))
90 (define_insn_reservation "ir_vr54_imul_di" 4
91 (and (eq_attr "cpu" "r5400")
92 (and (eq_attr "type" "imul,imul3")
93 (eq_attr "mode" "DI")))
96 (define_insn_reservation "ir_vr54_imadd_si" 3
97 (and (eq_attr "cpu" "r5400")
98 (eq_attr "type" "imul,imul3"))
101 (define_insn_reservation "ir_vr54_idiv_si" 42
102 (and (eq_attr "cpu" "r5400")
103 (and (eq_attr "type" "idiv")
104 (eq_attr "mode" "SI")))
107 (define_insn_reservation "ir_vr54_idiv_di" 74
108 (and (eq_attr "cpu" "r5400")
109 (and (eq_attr "type" "idiv")
110 (eq_attr "mode" "DI")))
113 (define_insn_reservation "ir_vr54_fadd" 4
114 (and (eq_attr "cpu" "r5400")
115 (eq_attr "type" "fadd"))
118 (define_insn_reservation "ir_vr54_fmul_sf" 5
119 (and (eq_attr "cpu" "r5400")
120 (and (eq_attr "type" "fmul")
121 (eq_attr "mode" "SF")))
124 (define_insn_reservation "ir_vr54_fmul_df" 6
125 (and (eq_attr "cpu" "r5400")
126 (and (eq_attr "type" "fmul")
127 (eq_attr "mode" "DF")))
130 (define_insn_reservation "ir_vr54_fmadd_sf" 9
131 (and (eq_attr "cpu" "r5400")
132 (and (eq_attr "type" "fmadd")
133 (eq_attr "mode" "SF")))
136 (define_insn_reservation "ir_vr54_fmadd_df" 10
137 (and (eq_attr "cpu" "r5400")
138 (and (eq_attr "type" "fmadd")
139 (eq_attr "mode" "DF")))
142 (define_insn_reservation "ir_vr54_fdiv_sf" 42
143 (and (eq_attr "cpu" "r5400")
144 (and (eq_attr "type" "fdiv,frdiv,fsqrt")
145 (eq_attr "mode" "SF")))
148 (define_insn_reservation "ir_vr54_fdiv_df" 72
149 (and (eq_attr "cpu" "r5400")
150 (and (eq_attr "type" "fdiv,frdiv,fsqrt")
151 (eq_attr "mode" "DF")))
154 (define_insn_reservation "ir_vr54_fabs" 2
155 (and (eq_attr "cpu" "r5400")
156 (eq_attr "type" "fabs,fneg,fmove"))
159 (define_insn_reservation "ir_vr54_fcmp" 2
160 (and (eq_attr "cpu" "r5400")
161 (eq_attr "type" "fcmp"))
164 (define_insn_reservation "ir_vr54_fcvt" 6
165 (and (eq_attr "cpu" "r5400")
166 (eq_attr "type" "fcvt"))
169 (define_insn_reservation "ir_vr54_frsqrt_sf" 61
170 (and (eq_attr "cpu" "r5400")
171 (and (eq_attr "type" "frsqrt")
172 (eq_attr "mode" "SF")))
175 (define_insn_reservation "ir_vr54_frsqrt_df" 121
176 (and (eq_attr "cpu" "r5400")
177 (and (eq_attr "type" "frsqrt")
178 (eq_attr "mode" "DF")))
181 (define_insn_reservation "ir_vr54_multi" 1
182 (and (eq_attr "cpu" "r5400")
183 (eq_attr "type" "multi"))
184 "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")