summaryrefslogtreecommitdiff
path: root/gcc/config/i386/geode.md
blob: c063e58b9cce8c3c0e8673fe0d6f35869a96fb2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
;; Geode Scheduling
;; Copyright (C) 2006, 2007
;; Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3.  If not see
;; <http://www.gnu.org/licenses/>.
;;
;; The Geode architecture is one insn issue processor.
;;
;; This description is based on data from the following documents:
;;
;;    "AMD Geode GX Processor Data Book"
;;    Advanced Micro Devices, Inc., Aug 2005.
;;
;;    "AMD Geode LX Processor Data Book"
;;    Advanced Micro Devices, Inc., Jan 2006.
;;
;;
;; CPU execution units of the Geode:
;;
;; issue	describes the issue pipeline.
;; alu		describes the Integer unit
;; fpu		describes the FP unit
;;
;; The fp unit is out of order execution unit with register renaming.
;; There is also memory management unit and execution pipeline for
;; load/store operations.  We ignore it and difference between insns
;; using memory and registers.

(define_automaton "geode")

(define_cpu_unit "geode_issue,geode_alu,geode_fpu" "geode")

(define_insn_reservation "alu" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "alu,alu1,negnot,icmp,lea,test,imov,imovx,icmov,incdec,setcc"))
			 "geode_issue,geode_alu")

(define_insn_reservation "shift" 2
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "ishift,ishift1,rotate,rotate1"))
			 "geode_issue,geode_alu*2")

(define_insn_reservation "imul" 7
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "imul"))
			 "geode_issue,geode_alu*7")

(define_insn_reservation "idiv" 40
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "idiv"))
			 "geode_issue,geode_alu*40")

;; The branch unit.
(define_insn_reservation "call" 2
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "call,callv"))
			 "geode_issue,geode_alu*2")

(define_insn_reservation "geode_branch" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "ibr"))
			 "geode_issue,geode_alu")

(define_insn_reservation "geode_pop_push" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "pop,push"))
			 "geode_issue,geode_alu")

(define_insn_reservation "geode_leave" 2
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "leave"))
			 "geode_issue,geode_alu*2")

(define_insn_reservation "geode_load_str" 4
			 (and (eq_attr "cpu" "geode")
			      (and (eq_attr "type" "str")
				   (eq_attr "memory" "load,both")))
			 "geode_issue,geode_alu*4")

(define_insn_reservation "geode_store_str" 2
			 (and (eq_attr "cpu" "geode")
			      (and (eq_attr "type" "str")
				   (eq_attr "memory" "store")))
			 "geode_issue,geode_alu*2")

;; Be optimistic
(define_insn_reservation "geode_unknown" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "multi,other"))
			 "geode_issue,geode_alu")

;; FPU

(define_insn_reservation "geode_fop" 6
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fop,fcmp"))
			 "geode_issue,geode_fpu*6")

(define_insn_reservation "geode_fsimple" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fmov,fcmov,fsgn,fxch"))
			 "geode_issue,geode_fpu")

(define_insn_reservation "geode_fist" 4
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fistp,fisttp"))
			 "geode_issue,geode_fpu*4")

(define_insn_reservation "geode_fmul" 10
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fmul"))
			 "geode_issue,geode_fpu*10")

(define_insn_reservation "geode_fdiv" 47
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fdiv"))
			 "geode_issue,geode_fpu*47")

;; We use minimal latency (fsin) here
(define_insn_reservation "geode_fpspc" 54
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "fpspc"))
			 "geode_issue,geode_fpu*54")

(define_insn_reservation "geode_frndint" 12
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "frndint"))
			 "geode_issue,geode_fpu*12")

(define_insn_reservation "geode_mmxmov" 1
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "mmxmov"))
			 "geode_issue,geode_fpu")

(define_insn_reservation "geode_mmx" 2
			 (and (eq_attr "cpu" "geode")
			      (eq_attr "type" "mmx,mmxadd,mmxmul,mmxcmp,mmxcvt,mmxshft"))
			 "geode_issue,geode_fpu*2")