1 ;; DFA scheduling description for SH-5 SHmedia instructions.
2 ;; Copyright (C) 2004, 2005 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 2, 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 COPYING. If not, write to
18 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
19 ;; Boston, MA 02110-1301, USA.
21 ;; This is just a conversion of the old model using define_function_unit.
23 ;; When executing SHmedia code, the SH-5 is a fairly straightforward
24 ;; single-issue machine. It has four pipelines, the branch unit (br),
25 ;; the integer and multimedia unit (imu), the load/store unit (lsu), and
26 ;; the floating point unit (fpu).
28 (define_automaton "sh5inst_pipe, sh5fpu_pipe")
30 (define_cpu_unit "sh5issue" "sh5inst_pipe")
32 (define_cpu_unit "sh5fds" "sh5fpu_pipe")
34 ;; Every instruction on SH-5 occupies the issue resource for at least one
36 (define_insn_reservation "shmedia1" 1
37 (and (eq_attr "pipe_model" "sh5media")
38 (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"))
41 ;; Specify the various types of instruction which have latency > 1
42 (define_insn_reservation "shmedia2" 2
43 (and (eq_attr "pipe_model" "sh5media")
44 (eq_attr "type" "mcmp_media"))
47 (define_insn_reservation "shmedia3" 3
48 (and (eq_attr "pipe_model" "sh5media")
49 (eq_attr "type" "dmpy_media,load_media,fcmp_media,mac_media"))
51 ;; but see sh_adjust_cost for mac_media exception.
53 (define_insn_reservation "shmedia4" 4
54 (and (eq_attr "pipe_model" "sh5media")
55 (eq_attr "type" "fload_media,fmove_media"))
58 (define_insn_reservation "shmedia_d2mpy" 4
59 (and (eq_attr "pipe_model" "sh5media")
60 (eq_attr "type" "d2mpy_media"))
63 (define_insn_reservation "shmedia5" 5
64 (and (eq_attr "pipe_model" "sh5media")
65 (eq_attr "type" "pt_media,ptabs_media"))
68 (define_insn_reservation "shmedia6" 6
69 (and (eq_attr "pipe_model" "sh5media")
70 (eq_attr "type" "fparith_media,dfparith_media,fpconv_media,dfpconv_media"))
73 (define_insn_reservation "shmedia_invalidate" 7
74 (and (eq_attr "pipe_model" "sh5media")
75 (eq_attr "type" "invalidate_line_media"))
78 (define_insn_reservation "shmedia_dfmul" 9
79 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "dfmul_media"))
82 (define_insn_reservation "shmedia_atrans" 10
83 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "atrans_media"))
86 ;; Floating-point divide and square-root occupy an additional resource,
87 ;; which is not internally pipelined. However, other instructions
88 ;; can continue to issue.
89 (define_insn_reservation "shmedia_fdiv" 19
90 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "fdiv_media"))
91 "sh5issue+sh5fds,sh5fds*18")
93 (define_insn_reservation "shmedia_dfdiv" 35
94 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "dfdiv_media"))
95 "sh5issue+sh5fds,sh5fds*34")