OSDN Git Service

* config/alpha/alpha.c (alpha_adjust_cost): Remove everything but
[pf3gnuchains/gcc-fork.git] / gcc / config / alpha / ev4.md
1 ;; Scheduling description for Alpha EV4.
2 ;;   Copyright (C) 2002 Free Software Foundation, Inc.
3 ;;
4 ;; This file is part of GNU CC.
5 ;;
6 ;; GNU CC 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)
9 ;; any later version.
10 ;;
11 ;; GNU CC 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.
15 ;;
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with GNU CC; see the file COPYING.  If not, write to
18 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
19 ;; Boston, MA 02111-1307, USA.
20
21 ; On EV4 there are two classes of resources to consider: resources needed
22 ; to issue, and resources needed to execute.  IBUS[01] are in the first
23 ; category.  ABOX, BBOX, EBOX, FBOX, IMUL & FDIV make up the second.
24 ; (There are a few other register-like resources, but ...)
25
26 (define_automaton "ev4_0,ev4_1,ev4_2")
27 (define_cpu_unit "ev4_ib0,ev4_ib1,ev4_abox,ev4_bbox" "ev4_0")
28 (define_cpu_unit "ev4_ebox,ev4_imul" "ev4_1")
29 (define_cpu_unit "ev4_fbox,ev4_fdiv" "ev4_2")
30 (define_reservation "ev4_ib01" "ev4_ib0|ev4_ib1")
31
32 ; Assume type "multi" single issues.
33 (define_insn_reservation "ev4_multi" 1
34   (and (eq_attr "cpu" "ev4")
35        (eq_attr "type" "multi"))
36   "ev4_ib0+ev4_ib1")
37
38 ; Loads from L0 completes in three cycles.  adjust_cost still factors
39 ; in user-specified memory latency, so return 1 here.
40 (define_insn_reservation "ev4_ld" 1
41   (and (eq_attr "cpu" "ev4")
42        (eq_attr "type" "ild,fld,ldsym"))
43   "ev4_ib01+ev4_abox")
44
45 ; Stores can issue before the data (but not address) is ready.
46 (define_insn_reservation "ev4_ist" 1
47   (and (eq_attr "cpu" "ev4")
48        (eq_attr "type" "ist"))
49   "ev4_ib1+ev4_abox")
50
51 (define_insn_reservation "ev4_fst" 1
52   (and (eq_attr "cpu" "ev4")
53        (eq_attr "type" "fst"))
54   "ev4_ib0+ev4_abox")
55
56 ; Branches have no delay cost, but do tie up the unit for two cycles.
57 (define_insn_reservation "ev4_ibr" 2
58   (and (eq_attr "cpu" "ev4")
59        (eq_attr "type" "ibr,jsr"))
60   "ev4_ib1+ev4_bbox,ev4_bbox")
61
62 (define_insn_reservation "ev4_fbr" 2
63   (and (eq_attr "cpu" "ev4")
64        (eq_attr "type" "fbr"))
65   "ev4_ib0+ev4_bbox,ev4_bbox")
66
67 ; Arithmetic insns are normally have their results available after
68 ; two cycles.  There are a number of exceptions.
69
70 (define_insn_reservation "ev4_iaddlog" 2
71   (and (eq_attr "cpu" "ev4")
72        (eq_attr "type" "iadd,ilog"))
73   "ev4_ib0+ev4_ebox")
74
75 (define_bypass 1
76   "ev4_iaddlog"
77   "ev4_ibr,ev4_iaddlog,ev4_shiftcm,ev4_icmp,ev4_imulsi,ev4_imuldi")
78
79 (define_insn_reservation "ev4_shiftcm" 2
80   (and (eq_attr "cpu" "ev4")
81        (eq_attr "type" "shift,icmov"))
82   "ev4_ib0+ev4_ebox")
83
84 (define_insn_reservation "ev4_icmp" 2
85   (and (eq_attr "cpu" "ev4")
86        (eq_attr "type" "icmp"))
87   "ev4_ib0+ev4_ebox")
88
89 (define_bypass 1 "ev4_icmp" "ev4_ibr")
90
91 (define_bypass 0
92   "ev4_iaddlog,ev4_shiftcm,ev4_icmp"
93   "ev4_ist"
94   "store_data_bypass_p")
95
96 ; Multiplies use a non-piplined imul unit.  Also, "no [ebox] insn can
97 ; be issued exactly three cycles before an integer multiply completes".
98
99 (define_insn_reservation "ev4_imulsi" 21
100   (and (eq_attr "cpu" "ev4")
101        (and (eq_attr "type" "imul")
102             (eq_attr "opsize" "si")))
103   "ev4_ib0+ev4_imul,ev4_imul*18,ev4_ebox")
104
105 (define_bypass 20 "ev4_imulsi" "ev4_ist" "store_data_bypass_p")
106
107 (define_insn_reservation "ev4_imuldi" 23
108   (and (eq_attr "cpu" "ev4")
109        (and (eq_attr "type" "imul")
110             (eq_attr "opsize" "!si")))
111   "ev4_ib0+ev4_imul,ev4_imul*20,ev4_ebox")
112
113 (define_bypass 22 "ev4_imuldi" "ev4_ist" "store_data_bypass_p")
114
115 ; Most FP insns have a 6 cycle latency, but with a 4 cycle bypass back in.
116 (define_insn_reservation "ev4_fpop" 6
117   (and (eq_attr "cpu" "ev4")
118        (eq_attr "type" "fadd,fmul,fcpys,fcmov"))
119   "ev4_ib1+ev4_fbox")
120
121 (define_bypass 4 "ev4_fpop" "ev4_fpop")
122
123 ; The floating point divider is not pipelined.  Also, "no FPOP insn can be
124 ; issued exactly five or exactly six cycles before an fdiv insn completes".
125
126 (define_insn_reservation "ev4_fdivsf" 34
127   (and (eq_attr "cpu" "ev4")
128        (and (eq_attr "type" "fdiv")
129             (eq_attr "opsize" "si")))
130   "ev4_ib1+ev4_fdiv,ev4_fdiv*28,ev4_fdiv+ev4_fbox,ev4_fbox")
131
132 (define_insn_reservation "ev4_fdivdf" 63
133   (and (eq_attr "cpu" "ev4")
134        (and (eq_attr "type" "fdiv")
135             (eq_attr "opsize" "di")))
136   "ev4_ib1+ev4_fdiv,ev4_fdiv*57,ev4_fdiv+ev4_fbox,ev4_fbox")
137
138 ; Traps don't consume or produce data.
139 (define_insn_reservation "ev4_misc" 1
140   (and (eq_attr "cpu" "ev4")
141        (eq_attr "type" "misc"))
142   "ev4_ib1")