annotate gcc/config/powerpcspe/xfpu.md @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Scheduling description for the Xilinx PowerPC 405 APU Floating Point Unit.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2008-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;; Contributed by Michael Eager (eager@eagercon.com).
kono
parents:
diff changeset
4 ;;
kono
parents:
diff changeset
5 ;; This file is part of GCC.
kono
parents:
diff changeset
6 ;;
kono
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 ;; any later version.
kono
parents:
diff changeset
11 ;;
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
15 ;; GNU General Public License for more details.
kono
parents:
diff changeset
16 ;;
kono
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 ;;----------------------------------------------------
kono
parents:
diff changeset
22 ;; Xilinx APU FPU Pipeline Description
kono
parents:
diff changeset
23 ;;
kono
parents:
diff changeset
24 ;; - attr 'type' and 'fp_type' should definitely
kono
parents:
diff changeset
25 ;; be cleaned up at some point in the future.
kono
parents:
diff changeset
26 ;; ddiv,sdiv,dmul,smul etc are quite confusing.
kono
parents:
diff changeset
27 ;; Should use consistent fp* attrs. 'fp_type'
kono
parents:
diff changeset
28 ;; should also go away, leaving us only with 'fp'
kono
parents:
diff changeset
29 ;;
kono
parents:
diff changeset
30 ;;----------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 ;; -------------------------------------------------------------------------
kono
parents:
diff changeset
33 ;; Latencies
kono
parents:
diff changeset
34 ;; Latest latency figures (all in FCB cycles). PowerPC to FPU frequency ratio
kono
parents:
diff changeset
35 ;; assumed to be 1/2. (most common deployment)
kono
parents:
diff changeset
36 ;; Add 2 PPC cycles for (register file access + wb) and 2 PPC cycles
kono
parents:
diff changeset
37 ;; for issue (from PPC)
kono
parents:
diff changeset
38 ;; SP DP
kono
parents:
diff changeset
39 ;; Loads: 4 6
kono
parents:
diff changeset
40 ;; Stores: 1 2 (from availability of data)
kono
parents:
diff changeset
41 ;; Move/Abs/Neg: 1 1
kono
parents:
diff changeset
42 ;; Add/Subtract: 5 7
kono
parents:
diff changeset
43 ;; Multiply: 4 11
kono
parents:
diff changeset
44 ;; Multiply-add: 10 19
kono
parents:
diff changeset
45 ;; Convert (any): 4 6
kono
parents:
diff changeset
46 ;; Divide/Sqrt: 27 56
kono
parents:
diff changeset
47 ;; Compares: 1 2
kono
parents:
diff changeset
48 ;;
kono
parents:
diff changeset
49 ;; bypasses needed for forwarding capability of the FPU.
kono
parents:
diff changeset
50 ;; Add this at some future time.
kono
parents:
diff changeset
51 ;; -------------------------------------------------------------------------
kono
parents:
diff changeset
52 (define_automaton "Xfpu")
kono
parents:
diff changeset
53 (define_cpu_unit "Xfpu_issue,Xfpu_addsub,Xfpu_mul,Xfpu_div,Xfpu_sqrt" "Xfpu")
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 (define_insn_reservation "fp-default" 2
kono
parents:
diff changeset
57 (and (and
kono
parents:
diff changeset
58 (eq_attr "type" "fp,fpsimple")
kono
parents:
diff changeset
59 (eq_attr "fp_type" "fp_default"))
kono
parents:
diff changeset
60 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
61 "Xfpu_issue*2")
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 (define_insn_reservation "fp-compare" 6
kono
parents:
diff changeset
64 (and (eq_attr "type" "fpcompare") ;; Inconsistent naming
kono
parents:
diff changeset
65 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
66 "Xfpu_issue*2,Xfpu_addsub")
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 (define_insn_reservation "fp-addsub-s" 14
kono
parents:
diff changeset
69 (and (and
kono
parents:
diff changeset
70 (eq_attr "type" "fp,fpsimple")
kono
parents:
diff changeset
71 (eq_attr "fp_type" "fp_addsub_s"))
kono
parents:
diff changeset
72 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
73 "Xfpu_issue*2,Xfpu_addsub")
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 (define_insn_reservation "fp-addsub-d" 18
kono
parents:
diff changeset
76 (and (and
kono
parents:
diff changeset
77 (eq_attr "type" "fp,fpsimple")
kono
parents:
diff changeset
78 (eq_attr "fp_type" "fp_addsub_d"))
kono
parents:
diff changeset
79 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
80 "Xfpu_issue*2,Xfpu_addsub")
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 (define_insn_reservation "fp-mul-s" 12
kono
parents:
diff changeset
83 (and (and
kono
parents:
diff changeset
84 (eq_attr "type" "fp")
kono
parents:
diff changeset
85 (eq_attr "fp_type" "fp_mul_s"))
kono
parents:
diff changeset
86 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
87 "Xfpu_issue*2,Xfpu_mul")
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 (define_insn_reservation "fp-mul-d" 16 ;; Actually 28. Long latencies are killing the automaton formation. Need to figure out why.
kono
parents:
diff changeset
90 (and (and
kono
parents:
diff changeset
91 (eq_attr "type" "fp")
kono
parents:
diff changeset
92 (eq_attr "fp_type" "fp_mul_d"))
kono
parents:
diff changeset
93 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
94 "Xfpu_issue*2,Xfpu_mul")
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 (define_insn_reservation "fp-div-s" 24 ;; Actually 34
kono
parents:
diff changeset
97 (and (eq_attr "type" "sdiv") ;; Inconsistent attr naming
kono
parents:
diff changeset
98 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
99 "Xfpu_issue*2,Xfpu_div*10") ;; Unpipelined
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 (define_insn_reservation "fp-div-d" 34 ;; Actually 116
kono
parents:
diff changeset
102 (and (eq_attr "type" "ddiv")
kono
parents:
diff changeset
103 (eq_attr "cpu" "ppc405")) ;; Inconsistent attr naming
kono
parents:
diff changeset
104 "Xfpu_issue*2,Xfpu_div*10") ;; Unpipelined
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 (define_insn_reservation "fp-maddsub-s" 24
kono
parents:
diff changeset
107 (and (and
kono
parents:
diff changeset
108 (eq_attr "type" "fp")
kono
parents:
diff changeset
109 (eq_attr "fp_type" "fp_maddsub_s"))
kono
parents:
diff changeset
110 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
111 "Xfpu_issue*2,Xfpu_mul,nothing*7,Xfpu_addsub")
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 (define_insn_reservation "fp-maddsub-d" 34 ;; Actually 42
kono
parents:
diff changeset
114 (and (and
kono
parents:
diff changeset
115 (eq_attr "type" "dmul") ;; Inconsistent attr naming
kono
parents:
diff changeset
116 (eq_attr "fp_type" "fp_maddsub_d"))
kono
parents:
diff changeset
117 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
118 "Xfpu_issue*2,Xfpu_mul,nothing*7,Xfpu_addsub")
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 (define_insn_reservation "fp-load" 10 ;; FIXME. Is double/single precision the same ?
kono
parents:
diff changeset
121 (and (eq_attr "type" "fpload")
kono
parents:
diff changeset
122 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
123 "Xfpu_issue*10")
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 (define_insn_reservation "fp-store" 4
kono
parents:
diff changeset
126 (and (eq_attr "type" "fpstore")
kono
parents:
diff changeset
127 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
128 "Xfpu_issue*4")
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 (define_insn_reservation "fp-sqrt-s" 24 ;; Actually 56
kono
parents:
diff changeset
131 (and (eq_attr "type" "ssqrt")
kono
parents:
diff changeset
132 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
133 "Xfpu_issue*2,Xfpu_sqrt*10") ;; Unpipelined
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135
kono
parents:
diff changeset
136 (define_insn_reservation "fp-sqrt-d" 34 ;; Actually 116
kono
parents:
diff changeset
137 (and (eq_attr "type" "dsqrt")
kono
parents:
diff changeset
138 (eq_attr "cpu" "ppc405"))
kono
parents:
diff changeset
139 "Xfpu_issue*2,Xfpu_sqrt*10") ;; Unpipelined
kono
parents:
diff changeset
140