Add assember CFI directives to millicode division and remainder routines.
[official-gcc.git] / gcc / config / arm / marvell-f-iwmmxt.md
blobfc2d23d9f2b8dec76f5a92a2422ddbde378c9b3a
1 ;; Marvell WMMX2 pipeline description
2 ;; Copyright (C) 2011-2023 Free Software Foundation, Inc.
3 ;; Written by Marvell, Inc.
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
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15 ;; 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/>.
22 (define_automaton "marvell_f_iwmmxt")
24 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 ;; Pipelines
26 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28 ;; This is a 7-stage pipelines:
30 ;;    MD | MI | ME1 | ME2 | ME3 | ME4 | MW
32 ;; There are various bypasses modelled to a greater or lesser extent.
34 ;; Latencies in this file correspond to the number of cycles after
35 ;; the issue stage that it takes for the result of the instruction to
36 ;; be computed, or for its side-effects to occur.
38 (define_cpu_unit "mf_iwmmxt_MD" "marvell_f_iwmmxt")
39 (define_cpu_unit "mf_iwmmxt_MI" "marvell_f_iwmmxt")
40 (define_cpu_unit "mf_iwmmxt_ME1" "marvell_f_iwmmxt")
41 (define_cpu_unit "mf_iwmmxt_ME2" "marvell_f_iwmmxt")
42 (define_cpu_unit "mf_iwmmxt_ME3" "marvell_f_iwmmxt")
43 (define_cpu_unit "mf_iwmmxt_ME4" "marvell_f_iwmmxt")
44 (define_cpu_unit "mf_iwmmxt_MW" "marvell_f_iwmmxt")
46 (define_reservation "mf_iwmmxt_ME"
47       "mf_iwmmxt_ME1,mf_iwmmxt_ME2,mf_iwmmxt_ME3,mf_iwmmxt_ME4"
50 (define_reservation "mf_iwmmxt_pipeline"
51       "mf_iwmmxt_MD, mf_iwmmxt_MI, mf_iwmmxt_ME, mf_iwmmxt_MW"
54 ;; An attribute to indicate whether our reservations are applicable.
55 (define_attr "marvell_f_iwmmxt" "yes,no"
56   (const (if_then_else (symbol_ref "arm_arch_iwmmxt")
57                        (const_string "yes") (const_string "no"))))
59 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
60 ;; instruction classes
61 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
63 ;; An attribute appended to instructions for classification
65 (define_attr "wmmxt_shift" "yes,no"
66   (if_then_else (eq_attr "type" "wmmx_wror, wmmx_wsll, wmmx_wsra, wmmx_wsrl")
67                 (const_string "yes") (const_string "no"))
70 (define_attr "wmmxt_pack" "yes,no"
71   (if_then_else (eq_attr "type" "wmmx_waligni, wmmx_walignr, wmmx_wmerge,\
72                                  wmmx_wpack, wmmx_wshufh, wmmx_wunpckeh,\
73                                  wmmx_wunpckih, wmmx_wunpckel, wmmx_wunpckil")
74                 (const_string "yes") (const_string "no"))
77 (define_attr "wmmxt_mult_c1" "yes,no"
78   (if_then_else (eq_attr "type" "wmmx_wmac, wmmx_wmadd, wmmx_wmiaxy,\
79                                  wmmx_wmiawxy, wmmx_wmulw, wmmx_wqmiaxy,\
80                                  wmmx_wqmulwm")
81                 (const_string "yes") (const_string "no"))
84 (define_attr "wmmxt_mult_c2" "yes,no"
85   (if_then_else (eq_attr "type" "wmmx_wmul, wmmx_wqmulm")
86                 (const_string "yes") (const_string "no"))
89 (define_attr "wmmxt_alu_c1" "yes,no"
90   (if_then_else (eq_attr "type" "wmmx_wabs, wmmx_wabsdiff, wmmx_wand,\
91                                  wmmx_wandn, wmmx_wmov, wmmx_wor, wmmx_wxor")
92                 (const_string "yes") (const_string "no"))
95 (define_attr "wmmxt_alu_c2" "yes,no"
96   (if_then_else (eq_attr "type" "wmmx_wacc, wmmx_wadd, wmmx_waddsubhx,\
97                                  wmmx_wavg2, wmmx_wavg4, wmmx_wcmpeq,\
98                                  wmmx_wcmpgt, wmmx_wmax, wmmx_wmin,\
99                                  wmmx_wsub, wmmx_waddbhus, wmmx_wsubaddhx")
100                 (const_string "yes") (const_string "no"))
103 (define_attr "wmmxt_alu_c3" "yes,no"
104   (if_then_else (eq_attr "type" "wmmx_wsad")
105                 (const_string "yes") (const_string "no"))
108 (define_attr "wmmxt_transfer_c1" "yes,no"
109   (if_then_else (eq_attr "type" "wmmx_tbcst, wmmx_tinsr,\
110                                  wmmx_tmcr, wmmx_tmcrr")
111                 (const_string "yes") (const_string "no"))
114 (define_attr "wmmxt_transfer_c2" "yes,no"
115   (if_then_else (eq_attr "type" "wmmx_textrm, wmmx_tmovmsk,\
116                                  wmmx_tmrc, wmmx_tmrrc")
117                 (const_string "yes") (const_string "no"))
120 (define_attr "wmmxt_transfer_c3" "yes,no"
121   (if_then_else (eq_attr "type" "wmmx_tmia, wmmx_tmiaph, wmmx_tmiaxy")
122                 (const_string "yes") (const_string "no"))
125 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
126 ;; Main description
127 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
129 (define_insn_reservation "marvell_f_iwmmxt_alu_c1" 1
130   (and (eq_attr "marvell_f_iwmmxt" "yes")
131        (eq_attr "wmmxt_alu_c1" "yes"))
132   "mf_iwmmxt_pipeline")
134 (define_insn_reservation "marvell_f_iwmmxt_pack" 1
135   (and (eq_attr "marvell_f_iwmmxt" "yes")
136        (eq_attr "wmmxt_pack" "yes"))
137   "mf_iwmmxt_pipeline")
139 (define_insn_reservation "marvell_f_iwmmxt_shift" 1
140   (and (eq_attr "marvell_f_iwmmxt" "yes")
141        (eq_attr "wmmxt_shift" "yes"))
142   "mf_iwmmxt_pipeline")
144 (define_insn_reservation "marvell_f_iwmmxt_transfer_c1" 1
145   (and (eq_attr "marvell_f_iwmmxt" "yes")
146        (eq_attr "wmmxt_transfer_c1" "yes"))
147   "mf_iwmmxt_pipeline")
149 (define_insn_reservation "marvell_f_iwmmxt_transfer_c2" 5
150   (and (eq_attr "marvell_f_iwmmxt" "yes")
151        (eq_attr "wmmxt_transfer_c2" "yes"))
152   "mf_iwmmxt_pipeline")
154 (define_insn_reservation "marvell_f_iwmmxt_alu_c2" 2
155   (and (eq_attr "marvell_f_iwmmxt" "yes")
156        (eq_attr "wmmxt_alu_c2" "yes"))
157   "mf_iwmmxt_pipeline")
159 (define_insn_reservation "marvell_f_iwmmxt_alu_c3" 3
160   (and (eq_attr "marvell_f_iwmmxt" "yes")
161        (eq_attr "wmmxt_alu_c3" "yes"))
162   "mf_iwmmxt_pipeline")
164 (define_insn_reservation "marvell_f_iwmmxt_transfer_c3" 4
165   (and (eq_attr "marvell_f_iwmmxt" "yes")
166        (eq_attr "wmmxt_transfer_c3" "yes"))
167   "mf_iwmmxt_pipeline")
169 (define_insn_reservation "marvell_f_iwmmxt_mult_c1" 4
170   (and (eq_attr "marvell_f_iwmmxt" "yes")
171        (eq_attr "wmmxt_mult_c1" "yes"))
172   "mf_iwmmxt_pipeline")
174 ;There is a forwarding path from ME3 stage
175 (define_insn_reservation "marvell_f_iwmmxt_mult_c2" 3
176   (and (eq_attr "marvell_f_iwmmxt" "yes")
177        (eq_attr "wmmxt_mult_c2" "yes"))
178   "mf_iwmmxt_pipeline")
180 (define_insn_reservation "marvell_f_iwmmxt_wstr" 0
181   (and (eq_attr "marvell_f_iwmmxt" "yes")
182        (eq_attr "type" "wmmx_wstr"))
183   "mf_iwmmxt_pipeline")
185 ;There is a forwarding path from MW stage
186 (define_insn_reservation "marvell_f_iwmmxt_wldr" 5
187   (and (eq_attr "marvell_f_iwmmxt" "yes")
188        (eq_attr "type" "wmmx_wldr"))
189   "mf_iwmmxt_pipeline")