1 ;; DFA scheduling description for SH-5 SHmedia instructions.
2 ;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 3, or (at your option)
11 ;; GCC is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GCC; see the file COPYING3. If not see
18 ;; <http://www.gnu.org/licenses/>.
20 ;; This is just a conversion of the old model using define_function_unit.
22 ;; When executing SHmedia code, the SH-5 is a fairly straightforward
23 ;; single-issue machine. It has four pipelines, the branch unit (br),
24 ;; the integer and multimedia unit (imu), the load/store unit (lsu), and
25 ;; the floating point unit (fpu).
27 (define_automaton "sh5inst_pipe, sh5fpu_pipe")
29 (define_cpu_unit "sh5issue" "sh5inst_pipe")
31 (define_cpu_unit "sh5fds" "sh5fpu_pipe")
33 ;; Every instruction on SH-5 occupies the issue resource for at least one
35 (define_insn_reservation "shmedia1" 1
36 (and (eq_attr "pipe_model" "sh5media")
37 (eq_attr "type" "!pt_media,ptabs_media,invalidate_line_media,dmpy_media,load_media,fload_media,fcmp_media,fmove_media,fparith_media,dfparith_media,fpconv_media,dfpconv_media,dfmul_media,store_media,fstore_media,mcmp_media,mac_media,d2mpy_media,atrans_media,ustore_media"))
40 ;; Specify the various types of instruction which have latency > 1
41 (define_insn_reservation "shmedia2" 2
42 (and (eq_attr "pipe_model" "sh5media")
43 (eq_attr "type" "mcmp_media"))
46 (define_insn_reservation "shmedia3" 3
47 (and (eq_attr "pipe_model" "sh5media")
48 (eq_attr "type" "dmpy_media,load_media,fcmp_media,mac_media"))
50 ;; but see sh_adjust_cost for mac_media exception.
52 (define_insn_reservation "shmedia4" 4
53 (and (eq_attr "pipe_model" "sh5media")
54 (eq_attr "type" "fload_media,fmove_media"))
57 (define_insn_reservation "shmedia_d2mpy" 4
58 (and (eq_attr "pipe_model" "sh5media")
59 (eq_attr "type" "d2mpy_media"))
62 (define_insn_reservation "shmedia5" 5
63 (and (eq_attr "pipe_model" "sh5media")
64 (eq_attr "type" "pt_media,ptabs_media"))
67 (define_insn_reservation "shmedia6" 6
68 (and (eq_attr "pipe_model" "sh5media")
69 (eq_attr "type" "fparith_media,dfparith_media,fpconv_media,dfpconv_media"))
72 (define_insn_reservation "shmedia_invalidate" 7
73 (and (eq_attr "pipe_model" "sh5media")
74 (eq_attr "type" "invalidate_line_media"))
77 (define_insn_reservation "shmedia_dfmul" 9
78 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "dfmul_media"))
81 (define_insn_reservation "shmedia_atrans" 10
82 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "atrans_media"))
85 ;; Floating-point divide and square-root occupy an additional resource,
86 ;; which is not internally pipelined. However, other instructions
87 ;; can continue to issue.
88 (define_insn_reservation "shmedia_fdiv" 19
89 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "fdiv_media"))
90 "sh5issue+sh5fds,sh5fds*18")
92 (define_insn_reservation "shmedia_dfdiv" 35
93 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "dfdiv_media"))
94 "sh5issue+sh5fds,sh5fds*34")