rs6000: Make all insert instructions one type
[official-gcc.git] / gcc / config / rs6000 / 7450.md
bloba6a4a1b1b49afad539603283254344d65da4173b
1 ;; Scheduling description for Motorola PowerPC 7450 processor.
2 ;;   Copyright (C) 2003-2014 Free Software Foundation, Inc.
3 ;;
4 ;; This file is part of GCC.
6 ;; GCC is free software; you can redistribute it and/or modify it
7 ;; under the terms of the GNU General Public License as published
8 ;; by the Free Software Foundation; either version 3, or (at your
9 ;; option) any later version.
11 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
12 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14 ;; 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 (define_automaton "ppc7450,ppc7450mciu,ppc7450fp,ppc7450vec")
21 (define_cpu_unit "iu1_7450,iu2_7450,iu3_7450" "ppc7450")
22 (define_cpu_unit "mciu_7450" "ppc7450mciu")
23 (define_cpu_unit "fpu_7450" "ppc7450fp")
24 (define_cpu_unit "lsu_7450,bpu_7450" "ppc7450")
25 (define_cpu_unit "du1_7450,du2_7450,du3_7450" "ppc7450")
26 (define_cpu_unit "vecsmpl_7450,veccmplx_7450,vecflt_7450,vecperm_7450" "ppc7450vec")
27 (define_cpu_unit "vdu1_7450,vdu2_7450" "ppc7450vec")
30 ;; PPC7450  32-bit 3xIU, MCIU, LSU, SRU, FPU, BPU, 4xVEC
31 ;; IU1,IU2,IU3 can perform all integer operations
32 ;; MCIU performs imul and idiv, cr logical, SPR moves
33 ;; LSU 2 stage pipelined
34 ;; FPU 3 stage pipelined
35 ;; It also has 4 vector units, one for each type of vector instruction.
36 ;; However, we can only dispatch 2 instructions per cycle. 
37 ;; Max issue 3 insns/clock cycle (includes 1 branch)
38 ;; In-order execution
40 ;; Branches go straight to the BPU.  All other insns are handled
41 ;; by a dispatch unit which can issue a max of 3 insns per cycle.
42 (define_reservation "ppc7450_du" "du1_7450|du2_7450|du3_7450")
43 (define_reservation "ppc7450_vec_du" "vdu1_7450|vdu2_7450")
45 (define_insn_reservation "ppc7450-load" 3
46   (and (eq_attr "type" "load,vecload")
47        (eq_attr "cpu" "ppc7450"))
48   "ppc7450_du,lsu_7450")
50 (define_insn_reservation "ppc7450-store" 3
51   (and (eq_attr "type" "store,vecstore")
52        (eq_attr "cpu" "ppc7450"))
53   "ppc7450_du,lsu_7450")
55 (define_insn_reservation "ppc7450-fpload" 4
56   (and (eq_attr "type" "fpload")
57        (eq_attr "cpu" "ppc7450"))
58   "ppc7450_du,lsu_7450")
60 (define_insn_reservation "ppc7450-fpstore" 3
61   (and (eq_attr "type" "fpstore")
62        (eq_attr "cpu" "ppc7450"))
63   "ppc7450_du,lsu_7450*3")
65 (define_insn_reservation "ppc7450-llsc" 3
66   (and (eq_attr "type" "load_l,store_c")
67        (eq_attr "cpu" "ppc7450"))
68   "ppc7450_du,lsu_7450")
70 (define_insn_reservation "ppc7450-sync" 35
71   (and (eq_attr "type" "sync")
72        (eq_attr "cpu" "ppc7450"))
73   "ppc7450_du,lsu_7450")
75 (define_insn_reservation "ppc7450-integer" 1
76   (and (eq_attr "type" "integer,insert,shift,\
77                         trap,var_shift_rotate,cntlz,exts,isel")
78        (eq_attr "cpu" "ppc7450"))
79   "ppc7450_du,iu1_7450|iu2_7450|iu3_7450")
81 (define_insn_reservation "ppc7450-two" 1
82   (and (eq_attr "type" "two")
83        (eq_attr "cpu" "ppc7450"))
84   "ppc7450_du,iu1_7450|iu2_7450|iu3_7450,iu1_7450|iu2_7450|iu3_7450")
86 (define_insn_reservation "ppc7450-three" 1
87   (and (eq_attr "type" "three")
88        (eq_attr "cpu" "ppc7450"))
89   "ppc7450_du,iu1_7450|iu2_7450|iu3_7450,\
90    iu1_7450|iu2_7450|iu3_7450,iu1_7450|iu2_7450|iu3_7450")
92 (define_insn_reservation "ppc7450-imul" 4
93   (and (eq_attr "type" "mul")
94        (eq_attr "size" "32")
95        (eq_attr "cpu" "ppc7450"))
96   "ppc7450_du,mciu_7450*2")
98 (define_insn_reservation "ppc7450-imul2" 3
99   (and (eq_attr "type" "mul")
100        (eq_attr "size" "8,16")
101        (eq_attr "cpu" "ppc7450"))
102   "ppc7450_du,mciu_7450")
104 (define_insn_reservation "ppc7450-idiv" 23
105   (and (eq_attr "type" "idiv")
106        (eq_attr "cpu" "ppc7450"))
107   "ppc7450_du,mciu_7450*23")
109 (define_insn_reservation "ppc7450-compare" 2
110   (and (eq_attr "type" "cmp,fast_compare,compare,delayed_compare,\
111                         var_delayed_compare")
112        (eq_attr "cpu" "ppc7450"))
113   "ppc7450_du,(iu1_7450|iu2_7450|iu3_7450)")
115 (define_insn_reservation "ppc7450-fpcompare" 5
116   (and (eq_attr "type" "fpcompare")
117        (eq_attr "cpu" "ppc7450"))
118   "ppc7450_du,fpu_7450")
120 (define_insn_reservation "ppc7450-fp" 5
121   (and (eq_attr "type" "fp,dmul")
122        (eq_attr "cpu" "ppc7450"))
123   "ppc7450_du,fpu_7450")
125 ; Divides are not pipelined
126 (define_insn_reservation "ppc7450-sdiv" 21
127   (and (eq_attr "type" "sdiv")
128        (eq_attr "cpu" "ppc7450"))
129   "ppc7450_du,fpu_7450*21")
131 (define_insn_reservation "ppc7450-ddiv" 35
132   (and (eq_attr "type" "ddiv")
133        (eq_attr "cpu" "ppc7450"))
134   "ppc7450_du,fpu_7450*35")
136 (define_insn_reservation "ppc7450-mfcr" 2
137   (and (eq_attr "type" "mfcr,mtcr")
138        (eq_attr "cpu" "ppc7450"))
139   "ppc7450_du,mciu_7450")
141 (define_insn_reservation "ppc7450-crlogical" 1
142   (and (eq_attr "type" "cr_logical,delayed_cr")
143        (eq_attr "cpu" "ppc7450"))
144   "ppc7450_du,mciu_7450")
146 (define_insn_reservation "ppc7450-mtjmpr" 2
147   (and (eq_attr "type" "mtjmpr")
148        (eq_attr "cpu" "ppc7450"))
149   "nothing,mciu_7450*2")
151 (define_insn_reservation "ppc7450-mfjmpr" 3
152   (and (eq_attr "type" "mfjmpr")
153        (eq_attr "cpu" "ppc7450"))
154   "nothing,mciu_7450*2")
156 (define_insn_reservation "ppc7450-jmpreg" 1
157   (and (eq_attr "type" "jmpreg,branch,isync")
158        (eq_attr "cpu" "ppc7450"))
159   "nothing,bpu_7450")
161 ;; Altivec
162 (define_insn_reservation "ppc7450-vecsimple" 1
163   (and (eq_attr "type" "vecsimple")
164        (eq_attr "cpu" "ppc7450"))
165   "ppc7450_du,ppc7450_vec_du,vecsmpl_7450")
167 (define_insn_reservation "ppc7450-veccomplex" 4
168   (and (eq_attr "type" "veccomplex")
169        (eq_attr "cpu" "ppc7450"))
170   "ppc7450_du,ppc7450_vec_du,veccmplx_7450")
172 (define_insn_reservation "ppc7450-veccmp" 2
173   (and (eq_attr "type" "veccmp")
174        (eq_attr "cpu" "ppc7450"))
175   "ppc7450_du,ppc7450_vec_du,veccmplx_7450")
177 (define_insn_reservation "ppc7450-vecfloat" 4
178   (and (eq_attr "type" "vecfloat")
179        (eq_attr "cpu" "ppc7450"))
180   "ppc7450_du,ppc7450_vec_du,vecflt_7450")
182 (define_insn_reservation "ppc7450-vecperm" 2
183   (and (eq_attr "type" "vecperm")
184        (eq_attr "cpu" "ppc7450"))
185   "ppc7450_du,ppc7450_vec_du,vecperm_7450")