* config/alpha/alpha.md, arm/arm.c, darwin.c, frv/frv.md,
[official-gcc.git] / gcc / config / rs6000 / rios2.md
blobbaaab892ac22c067795347a4cf7a5f29c4a3749f
1 ;; Scheduling description for IBM Power2 processor.
2 ;;   Copyright (C) 2003, 2004 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 2, 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 COPYING.  If not, write to the
18 ;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
19 ;; MA 02110-1301, USA.
21 (define_automaton "rios2,rios2fp")
22 (define_cpu_unit "iu1_rios2,iu2_rios2" "rios2")
23 (define_cpu_unit "fpu1_rios2,fpu2_rios2" "rios2fp")
24 (define_cpu_unit "bpu_rios2" "rios2")
26 ;; RIOS2 32-bit 2xIU, 2xFPU, BPU
27 ;; IU1 can perform all integer operations
28 ;; IU2 can perform all integer operations except imul and idiv
30 (define_insn_reservation "rios2-load" 2
31   (and (eq_attr "type" "load,load_ext,load_ext_u,load_ext_ux,\
32                         load_ux,load_u,fpload,fpload_ux,fpload_u,\
33                         load_l,store_c,sync")
34        (eq_attr "cpu" "rios2"))
35   "iu1_rios2|iu2_rios2")
37 (define_insn_reservation "rios2-store" 2
38   (and (eq_attr "type" "store,store_ux,store_u,fpstore,fpstore_ux,fpstore_u")
39        (eq_attr "cpu" "rios2"))
40   "iu1_rios2|iu2_rios2")
42 (define_insn_reservation "rios2-integer" 1
43   (and (eq_attr "type" "integer,insert_word,insert_dword,shift,trap,\
44                          var_shift_rotate,cntlz,exts")
45        (eq_attr "cpu" "rios2"))
46   "iu1_rios2|iu2_rios2")
48 (define_insn_reservation "rios2-two" 1
49   (and (eq_attr "type" "two")
50        (eq_attr "cpu" "rios2"))
51   "iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2")
53 (define_insn_reservation "rios2-three" 1
54   (and (eq_attr "type" "three")
55        (eq_attr "cpu" "rios2"))
56   "iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2,iu1_rios2|iu2_rios2")
58 (define_insn_reservation "rios2-imul" 2
59   (and (eq_attr "type" "imul,imul2,imul3,imul_compare")
60        (eq_attr "cpu" "rios2"))
61   "iu1_rios2*2")
63 (define_insn_reservation "rios2-idiv" 13
64   (and (eq_attr "type" "idiv")
65        (eq_attr "cpu" "rios2"))
66   "iu1_rios2*13")
68 ; compare executes on integer unit, but feeds insns which
69 ; execute on the branch unit.
70 (define_insn_reservation "rios2-compare" 3
71   (and (eq_attr "type" "cmp,fast_compare,compare,delayed_compare,\
72                         var_delayed_compare")
73        (eq_attr "cpu" "rios2"))
74   "(iu1_rios2|iu2_rios2),nothing,bpu_rios2")
76 (define_insn_reservation "rios2-fp" 2
77   (and (eq_attr "type" "fp")
78        (eq_attr "cpu" "rios2"))
79   "fpu1_rios2|fpu2_rios2")
81 (define_insn_reservation "rios2-fpcompare" 5
82   (and (eq_attr "type" "fpcompare")
83        (eq_attr "cpu" "rios2"))
84   "(fpu1_rios2|fpu2_rios2),nothing*3,bpu_rios2")
86 (define_insn_reservation "rios2-dmul" 2
87   (and (eq_attr "type" "dmul")
88        (eq_attr "cpu" "rios2"))
89   "fpu1_rios2|fpu2_rios2")
91 (define_insn_reservation "rios2-sdiv" 17
92   (and (eq_attr "type" "sdiv,ddiv")
93        (eq_attr "cpu" "rios2"))
94   "(fpu1_rios2*17)|(fpu2_rios2*17)")
96 (define_insn_reservation "rios2-ssqrt" 26
97   (and (eq_attr "type" "ssqrt,dsqrt")
98        (eq_attr "cpu" "rios2"))
99   "(fpu1_rios2*26)|(fpu2_rios2*26)")
101 (define_insn_reservation "rios2-mfcr" 2
102   (and (eq_attr "type" "mfcr")
103        (eq_attr "cpu" "rios2"))
104   "iu1_rios2,bpu_rios2")
106 (define_insn_reservation "rios2-mtcr" 3
107   (and (eq_attr "type" "mtcr")
108        (eq_attr "cpu" "rios2"))
109   "iu1_rios2,bpu_rios2")
111 (define_insn_reservation "rios2-crlogical" 3
112   (and (eq_attr "type" "cr_logical,delayed_cr")
113        (eq_attr "cpu" "rios2"))
114   "bpu_rios2")
116 (define_insn_reservation "rios2-mtjmpr" 5
117   (and (eq_attr "type" "mtjmpr")
118        (eq_attr "cpu" "rios2"))
119   "iu1_rios2,bpu_rios2")
121 (define_insn_reservation "rios2-mfjmpr" 2
122   (and (eq_attr "type" "mfjmpr")
123        (eq_attr "cpu" "rios2"))
124   "iu1_rios2,bpu_rios2")
126 (define_insn_reservation "rios2-branch" 1
127   (and (eq_attr "type" "jmpreg,branch,isync")
128        (eq_attr "cpu" "rios2"))
129   "bpu_rios2")