FSF GCC merge 02/23/03
[official-gcc.git] / gcc / config / mips / 5400.md
blob3b8002cb2852c5fc6e2ef0acaf173dc4b1c58507
1 ;; DFA-based pipeline description for 5400
2 (define_automaton "vr54")
3 (define_cpu_unit "vr54_dp0"     "vr54")
4 (define_cpu_unit "vr54_dp1"     "vr54")
5 (define_cpu_unit "vr54_mem"     "vr54")
6 (define_cpu_unit "vr54_mac"     "vr54")
8 ;;
9 ;; The ordering of the instruction-execution-path/resource-usage
10 ;; descriptions (also known as reservation RTL) is roughly ordered
11 ;; based on the define attribute RTL for the "type" classification.
12 ;; When modifying, remember that the first test that matches is the
13 ;; reservation used!
16 (define_insn_reservation "ir_vr54_unknown" 1
17   (and (eq_attr "cpu" "r5400")
18        (eq_attr "type" "unknown"))
19   "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")
21 ;; Assume prediction fails.
22 (define_insn_reservation "ir_vr54_branch" 3
23   (and (eq_attr "cpu" "r5400")
24        (eq_attr "type" "branch,jump,call"))
25   "vr54_dp0|vr54_dp1")
27 (define_insn_reservation "ir_vr54_load" 2
28   (and (eq_attr "cpu" "r5400")
29        (and (eq_attr "type" "load")
30             (eq_attr "mode" "!SF,DF,FPSW")))
31   "vr54_mem")
33 (define_insn_reservation "ir_vr54_store" 1
34   (and (eq_attr "cpu" "r5400")
35        (and (eq_attr "type" "store")
36             (eq_attr "mode" "!SF,DF,FPSW")))
37   "vr54_mem")
39 (define_insn_reservation "ir_vr54_fstore" 1
40   (and (eq_attr "cpu" "r5400")
41        (and (eq_attr "type" "store")
42             (eq_attr "mode" "SF,DF")))
43   "vr54_mem")
46 ;; This reservation is for conditional move based on integer
47 ;; or floating point CC.  This could probably use some refinement
48 ;; as "move" type attr seems to be overloaded in rtl.
49 (define_insn_reservation "ir_vr54_move" 4
50   (and (eq_attr "cpu" "r5400")
51        (eq_attr "type" "move"))
52   "vr54_dp0|vr54_dp1")
54 ;; Move to/from FPU registers
55 (define_insn_reservation "ir_vr54_xfer" 2
56   (and (eq_attr "cpu" "r5400")
57        (eq_attr "type" "xfer"))
58   "vr54_dp0|vr54_dp1")
60 (define_insn_reservation "ir_vr54_hilo" 1
61   (and (eq_attr "cpu" "r5400")
62        (eq_attr "type" "hilo"))
63   "vr54_dp0|vr54_dp1")
65 (define_insn_reservation "ir_vr54_arith" 1
66   (and (eq_attr "cpu" "r5400")
67        (eq_attr "type" "arith,darith,icmp,nop"))
68   "vr54_dp0|vr54_dp1")
70 (define_insn_reservation "ir_vr54_imul_si" 3
71   (and (eq_attr "cpu" "r5400")
72        (and (eq_attr "type" "imul")
73             (eq_attr "mode" "SI")))
74   "vr54_dp0|vr54_dp1")
76 (define_insn_reservation "ir_vr54_imul_di" 4
77   (and (eq_attr "cpu" "r5400")
78        (and (eq_attr "type" "imul")
79             (eq_attr "mode" "DI")))
80   "vr54_dp0|vr54_dp1")
82 (define_insn_reservation "ir_vr54_imadd_si" 3
83   (and (eq_attr "cpu" "r5400")
84        (eq_attr "type" "imul"))
85   "vr54_mac")
87 (define_insn_reservation "ir_vr54_idiv_si" 42
88   (and (eq_attr "cpu" "r5400")
89        (and (eq_attr "type" "idiv")
90             (eq_attr "mode" "SI")))
91   "vr54_dp0|vr54_dp1")
93 (define_insn_reservation "ir_vr54_idiv_di" 74
94   (and (eq_attr "cpu" "r5400")
95        (and (eq_attr "type" "idiv")
96             (eq_attr "mode" "DI")))
97   "vr54_dp0|vr54_dp1")
99 (define_insn_reservation "ir_vr54_fadd" 4
100   (and (eq_attr "cpu" "r5400")
101        (eq_attr "type" "fadd"))
102   "vr54_dp0|vr54_dp1")
104 (define_insn_reservation "ir_vr54_fmul_sf" 5
105   (and (eq_attr "cpu" "r5400")
106        (and (eq_attr "type" "fmul")
107             (eq_attr "mode" "SF")))
108   "vr54_dp0|vr54_dp1")
110 (define_insn_reservation "ir_vr54_fmul_df" 6
111   (and (eq_attr "cpu" "r5400")
112        (and (eq_attr "type" "fmul")
113             (eq_attr "mode" "DF")))
114   "vr54_dp0|vr54_dp1")
116 (define_insn_reservation "ir_vr54_fmadd_sf" 9
117   (and (eq_attr "cpu" "r5400")
118        (and (eq_attr "type" "fmadd")
119             (eq_attr "mode" "SF")))
120   "vr54_dp0|vr54_dp1")
122 (define_insn_reservation "ir_vr54_fmadd_df" 10
123   (and (eq_attr "cpu" "r5400")
124        (and (eq_attr "type" "fmadd")
125             (eq_attr "mode" "DF")))
126   "vr54_dp0|vr54_dp1")
128 (define_insn_reservation "ir_vr54_fdiv_sf" 42
129   (and (eq_attr "cpu" "r5400")
130        (and (eq_attr "type" "fdiv,fsqrt")
131             (eq_attr "mode" "SF")))
132   "vr54_dp0|vr54_dp1")
134 (define_insn_reservation "ir_vr54_fdiv_df" 72
135   (and (eq_attr "cpu" "r5400")
136        (and (eq_attr "type" "fdiv,fsqrt")
137             (eq_attr "mode" "DF")))
138   "vr54_dp0|vr54_dp1")
140 (define_insn_reservation "ir_vr54_fabs" 2
141   (and (eq_attr "cpu" "r5400")
142        (eq_attr "type" "fabs,fneg"))
143   "vr54_dp0|vr54_dp1")
145 (define_insn_reservation "ir_vr54_fcmp" 2
146   (and (eq_attr "cpu" "r5400")
147        (eq_attr "type" "fcmp"))
148   "vr54_dp0|vr54_dp1")
150 (define_insn_reservation "ir_vr54_fcvt" 6
151   (and (eq_attr "cpu" "r5400")
152        (eq_attr "type" "fcvt"))
153   "vr54_dp0|vr54_dp1")
155 (define_insn_reservation "ir_vr54_frsqrt_sf" 61
156   (and (eq_attr "cpu" "r5400")
157        (and (eq_attr "type" "frsqrt")
158             (eq_attr "mode" "SF")))
159   "vr54_dp0|vr54_dp1")
161 (define_insn_reservation "ir_vr54_frsqrt_df" 121
162   (and (eq_attr "cpu" "r5400")
163        (and (eq_attr "type" "frsqrt")
164             (eq_attr "mode" "DF")))
165   "vr54_dp0|vr54_dp1")
167 (define_insn_reservation "ir_vr54_multi" 1
168   (and (eq_attr "cpu" "r5400")
169        (eq_attr "type" "multi"))
170   "vr54_dp0+vr54_dp1+vr54_mem+vr54_mac")