1;; Scheduling description for TI C6X.
2;; Copyright (C) 2010-2020 Free Software Foundation, Inc.
3;; Contributed by Bernd Schmidt <bernds@codesourcery.com>
4;; Contributed by CodeSourcery.
5;;
6;; This file is part of GCC.
7;;
8;; GCC is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation; either version 3, or (at your option)
11;; any later version.
12;;
13;; GCC is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16;; GNU General Public License for more details.
17;;
18;; You should have received a copy of the GNU General Public License
19;; along with GCC; see the file COPYING3.  If not see
20;; <http://www.gnu.org/licenses/>.
21
22;; Input file for gensched.sh We process this file multiple times,
23;; replacing _N_ with either 1 or 2 for each of the sides of the
24;; machine, and _RF_ correspondingly with "a" or "b".  _CROSS_ and
25;; _CUNIT_ are replaced with yes/no and the appropriate reservation.
26
27(define_insn_reservation "load_d_N__CROSS_" 5
28  (and (eq_attr "type" "load")
29       (and (eq_attr "cross" "_CROSS_")
30	    (and (eq_attr "units" "d_addr")
31		 (eq_attr "addr_regfile" "_RF_"))))
32  "d_N_+t_NX_")
33
34(define_insn_reservation "store_d_N__CROSS_" 1
35  (and (eq_attr "type" "store")
36       (and (eq_attr "cross" "_CROSS_")
37	    (and (eq_attr "units" "d_addr")
38		 (eq_attr "addr_regfile" "_RF_"))))
39  "d_N_+t_NX_")
40
41(define_insn_reservation "loadn_d_N__CROSS_" 5
42  (and (eq_attr "type" "loadn")
43       (and (eq_attr "cross" "_CROSS_")
44	    (and (eq_attr "units" "d_addr")
45		 (eq_attr "addr_regfile" "_RF_"))))
46  "d_N_+t1+t2")
47
48(define_insn_reservation "storen_d_N__CROSS_" 1
49  (and (eq_attr "type" "storen")
50       (and (eq_attr "cross" "_CROSS_")
51	    (and (eq_attr "units" "d_addr")
52		 (eq_attr "addr_regfile" "_RF_"))))
53  "d_N_+t1+t2")
54
55(define_insn_reservation "single_d_N__CROSS_" 1
56  (and (eq_attr "type" "single")
57       (and (eq_attr "cross" "_CROSS_")
58	    (and (eq_attr "units" "d")
59		 (eq_attr "dest_regfile" "_RF_"))))
60  "d_N__CUNIT_")
61
62(define_insn_reservation "single_l_N__CROSS_" 1
63  (and (eq_attr "type" "single")
64       (and (eq_attr "cross" "_CROSS_")
65	    (and (eq_attr "units" "l")
66		 (eq_attr "dest_regfile" "_RF_"))))
67  "l_N_+l_N_w_CUNIT_")
68
69(define_insn_reservation "fp4_l_N__CROSS_" 4
70  (and (eq_attr "type" "fp4")
71       (and (eq_attr "cross" "_CROSS_")
72	    (and (eq_attr "units" "l")
73		 (eq_attr "dest_regfile" "_RF_"))))
74  "l_N__CUNIT_,nothing*2,l_N_w")
75
76(define_insn_reservation "intdp_l_N__CROSS_" 5
77  (and (eq_attr "type" "intdp")
78       (and (eq_attr "cross" "_CROSS_")
79	    (and (eq_attr "units" "l")
80		 (eq_attr "dest_regfile" "_RF_"))))
81  "l_N__CUNIT_,nothing*2,l_N_w*2")
82
83(define_insn_reservation "adddp_l_N__CROSS_" 7
84  (and (eq_attr "type" "adddp")
85       (and (eq_attr "cross" "_CROSS_")
86	    (and (eq_attr "units" "l")
87		 (eq_attr "dest_regfile" "_RF_"))))
88  "(l_N__CUNIT_)*2,nothing*3,l_N_w*2")
89
90(define_insn_reservation "branch_s_N__CROSS_" 6
91  (and (eq_attr "type" "branch")
92       (and (eq_attr "cross" "_CROSS_")
93	    (and (eq_attr "units" "s")
94		 (eq_attr "dest_regfile" "_RF_"))))
95  "(s_N_+s_N_w)_CUNIT_+br1")
96
97(define_insn_reservation "call_addkpc_s_N__CROSS_" 6
98  (and (eq_attr "type" "call")
99       (and (ne (symbol_ref "TARGET_INSNS_64") (const_int 0))
100	    (and (eq_attr "cross" "_CROSS_")
101		 (and (eq_attr "units" "s")
102		      (eq_attr "dest_regfile" "_RF_")))))
103  "(s_N_+s_N_w)_CUNIT_+br1,s2+br0+br1")
104
105(define_insn_reservation "call_mvk_s_N__CROSS_" 6
106  (and (eq_attr "type" "call")
107       (and (eq (symbol_ref "TARGET_INSNS_64") (const_int 0))
108	    (and (eq_attr "cross" "_CROSS_")
109		 (and (eq_attr "units" "s")
110		      (eq_attr "dest_regfile" "_RF_")))))
111  "(s_N_+s_N_w)_CUNIT_+br1,s2,s2")
112
113(define_insn_reservation "single_s_N__CROSS_" 1
114  (and (eq_attr "type" "single")
115       (and (eq_attr "cross" "_CROSS_")
116	    (and (eq_attr "units" "s")
117		 (eq_attr "dest_regfile" "_RF_"))))
118  "(s_N_+s_N_w)_CUNIT_")
119
120(define_insn_reservation "cmpdp_s_N__CROSS_" 2
121  (and (eq_attr "type" "cmpdp")
122       (and (eq_attr "cross" "_CROSS_")
123	    (and (eq_attr "units" "s")
124		 (eq_attr "dest_regfile" "_RF_"))))
125  "s_N__CUNIT_,(s_N__CUNIT_)+s_N_w")
126
127(define_insn_reservation "dp2_s_N__CROSS_" 2
128  (and (eq_attr "type" "dp2")
129       (and (eq_attr "cross" "_CROSS_")
130	    (and (eq_attr "units" "s")
131		 (eq_attr "dest_regfile" "_RF_"))))
132  "s_N_+s_N_w_CUNIT_,s_N_w")
133
134(define_insn_reservation "fp4_s_N__CROSS_" 4
135  (and (eq_attr "type" "fp4")
136       (and (eq_attr "cross" "_CROSS_")
137	    (and (eq_attr "units" "s")
138		 (eq_attr "dest_regfile" "_RF_"))))
139  "s_N__CUNIT_,nothing*2,s_N_w")
140
141(define_insn_reservation "mvilc4_s_N__CROSS_" 4
142  (and (eq_attr "type" "mvilc")
143       (and (eq_attr "cross" "_CROSS_")
144	    (and (eq_attr "units" "s")
145		 (eq_attr "dest_regfile" "_RF_"))))
146  "(s_N_+s_N_w)_CUNIT_")
147
148(define_insn_reservation "single_dl_N__CROSS_" 1
149  (and (eq_attr "type" "single")
150       (and (eq_attr "cross" "_CROSS_")
151	    (and (eq_attr "units" "dl")
152		 (eq_attr "dest_regfile" "_RF_"))))
153  "(d_N_|(l_N_+l_N_w))_CUNIT_")
154
155(define_insn_reservation "single_ds_N__CROSS_" 1
156  (and (eq_attr "type" "single")
157       (and (eq_attr "cross" "_CROSS_")
158	    (and (eq_attr "units" "ds")
159		 (eq_attr "dest_regfile" "_RF_"))))
160  "(d_N_|(s_N_+s_N_w))_CUNIT_")
161
162(define_insn_reservation "single_ls_N__CROSS_" 1
163  (and (eq_attr "type" "single")
164       (and (eq_attr "cross" "_CROSS_")
165	    (and (eq_attr "units" "ls")
166		 (eq_attr "dest_regfile" "_RF_"))))
167  "((l_N_+l_N_w)|(s_N_+s_N_w))_CUNIT_")
168
169(define_insn_reservation "dp2_l_N__CROSS_" 2
170  (and (eq_attr "type" "dp2")
171       (and (eq_attr "cross" "_CROSS_")
172	    (and (eq_attr "units" "l")
173		 (eq_attr "dest_regfile" "_RF_"))))
174  "l_N_+l_N_w_CUNIT_,l_N_w")
175
176(define_insn_reservation "fp4_ls_N__CROSS_" 4
177  (and (eq_attr "type" "fp4")
178       (and (eq_attr "cross" "_CROSS_")
179	    (and (eq_attr "units" "ls")
180		 (eq_attr "dest_regfile" "_RF_"))))
181  "(fps_N_+s_N__CUNIT_,nothing*2,s_N_w)|(fpl_N_+l_N__CUNIT_,nothing*2,l_N_w)")
182
183(define_insn_reservation "adddp_ls_N__CROSS_" 7
184  (and (eq_attr "type" "adddp")
185       (and (eq_attr "cross" "_CROSS_")
186	    (and (eq_attr "units" "ls")
187		 (eq_attr "dest_regfile" "_RF_"))))
188  "(adddps_N_+(s_N__CUNIT_)*2,nothing*3,s_N_w*2)|(adddpl_N_+(l_N__CUNIT_)*2,nothing*3,l_N_w*2)")
189
190(define_insn_reservation "single_dls_N__CROSS_" 1
191  (and (eq_attr "type" "single")
192       (and (eq_attr "cross" "_CROSS_")
193	    (and (eq_attr "units" "dls")
194		 (eq_attr "dest_regfile" "_RF_"))))
195  "(d_N_|(l_N_+l_N_w)|(s_N_+s_N_w))_CUNIT_")
196
197(define_insn_reservation "mpy2_m_N__CROSS_" 2
198  (and (eq_attr "type" "mpy2")
199       (and (eq_attr "cross" "_CROSS_")
200	    (and (eq_attr "units" "m")
201		 (eq_attr "dest_regfile" "_RF_"))))
202  "m_N__CUNIT_,m_N_w")
203
204(define_insn_reservation "mpy4_m_N__CROSS_" 4
205  (and (eq_attr "type" "mpy4")
206       (and (eq_attr "cross" "_CROSS_")
207	    (and (eq_attr "units" "m")
208		 (eq_attr "dest_regfile" "_RF_"))))
209  "m_N__CUNIT_,nothing,nothing,m_N_w")
210
211(define_insn_reservation "mpydp_m_N__CROSS_" 10
212  (and (eq_attr "type" "mpydp")
213       (and (eq_attr "cross" "_CROSS_")
214	    (and (eq_attr "units" "m")
215		 (eq_attr "dest_regfile" "_RF_"))))
216  "(m_N__CUNIT_)*4,nothing*4,m_N_w*2")
217
218(define_insn_reservation "mpyspdp_m_N__CROSS_" 7
219  (and (eq_attr "type" "mpyspdp")
220       (and (eq_attr "cross" "_CROSS_")
221	    (and (eq_attr "units" "m")
222		 (eq_attr "dest_regfile" "_RF_"))))
223  "(m_N__CUNIT_)*2,nothing*3,m_N_w*2")
224
225(define_insn_reservation "mpysp2dp_m_N__CROSS_" 5
226  (and (eq_attr "type" "mpysp2dp")
227       (and (eq_attr "cross" "_CROSS_")
228	    (and (eq_attr "units" "m")
229		 (eq_attr "dest_regfile" "_RF_"))))
230  "m_N__CUNIT_,nothing*2,m_N_w*2")
231