summaryrefslogtreecommitdiff
path: root/gcc/config/arm/cortex-a17.md
blob: 25a52dc0f13cebccb74ea1fbd9208f5ac5e1a79d (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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
;; ARM Cortex-A17 pipeline description
;; Copyright (C) 2014-2016 Free Software Foundation, Inc.
;;
;; Contributed by ARM Ltd.
;;
;; 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/>.


(define_automaton "cortex_a17")

(define_cpu_unit "ca17_ls0, ca17_ls1" "cortex_a17")
(define_cpu_unit "ca17_alu0, ca17_alu1" "cortex_a17")
(define_cpu_unit "ca17_mac" "cortex_a17")
(define_cpu_unit "ca17_idiv" "cortex_a17")
(define_cpu_unit "ca17_bx" "cortex_a17")

(define_reservation "ca17_alu" "(ca17_alu0|ca17_alu1)")



;; Simple Execution Unit:
;;
;; Simple ALU
(define_insn_reservation "cortex_a17_alu" 1
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "alu_imm,alus_imm,logic_imm,logics_imm,\
                        alu_sreg,alus_sreg,logic_reg,logics_reg,\
                        adc_imm,adcs_imm,adc_reg,adcs_reg,\
                        adr, mov_imm,mov_reg,\
                        mvn_imm,mvn_reg,extend,\
                        mrs,multiple,no_insn"))
  "ca17_alu")

(define_insn_reservation "cortex_a17_alu_shiftimm" 2
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "bfm,clz,rev,rbit, alu_shift_imm, alus_shift_imm,
                        logic_shift_imm,alu_dsp_reg, logics_shift_imm,shift_imm,\
                        shift_reg, mov_shift,mvn_shift"))
  "ca17_alu")


;; ALU ops with register controlled shift.
(define_insn_reservation "cortex_a17_alu_shift_reg" 2
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "alu_shift_reg,alus_shift_reg,\
                        logic_shift_reg,logics_shift_reg"))
  "ca17_alu0")


;; Multiply Execution Unit:

;; 32-bit multiplies
(define_insn_reservation "cortex_a17_mult32" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "mul,muls,smmul,smmulr"))
  "ca17_alu0+ca17_mac")

(define_insn_reservation "cortex_a17_mac32" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "mla,mlas,smmla"))
  "ca17_alu0+ca17_mac,ca17_mac")

(define_insn_reservation "cortex_a17_mac32_other" 3
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "smlad,smladx,smlsd,smlsdx,smuad,smuadx,smusd,smusdx"))
  "ca17_alu0+ca17_mac,ca17_mac")

;; 64-bit multiplies
(define_insn_reservation "cortex_a17_mac64" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "smlal,smlals,umaal,umlal,umlals"))
  "ca17_alu0+ca17_mac,ca17_mac")

(define_insn_reservation "cortex_a17_mac64_other" 3
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "smlald,smlalxy,smlsld"))
  "ca17_alu0+ca17_mac,ca17_mac")

(define_insn_reservation "cortex_a17_mult64" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "smull,smulls,umull,umulls"))
  "ca17_alu0+ca17_mac,ca17_mac")


(define_bypass 2 "cortex_a17_mult*, cortex_a17_mac*"
                 "cortex_a17_mult*, cortex_a17_mac*"
                 "arm_mac_accumulator_is_result")

;; Integer divide
(define_insn_reservation "cortex_a17_udiv" 19
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "udiv"))
  "ca17_alu1+ca17_idiv*10")

(define_insn_reservation "cortex_a17_sdiv" 20
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "sdiv"))
  "ca17_alu1+ca17_idiv*11")



;; Branch execution Unit
;;
;; Branches take one issue slot.
;; No latency as there is no result
(define_insn_reservation "cortex_a17_branch" 0
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "branch"))
  "ca17_bx")

;; Load-store execution Unit
;;
;; Loads of up to two words.
(define_insn_reservation "cortex_a17_load1" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "load_byte,load1,load2"))
  "ca17_ls0|ca17_ls1")

;; Loads of three words.
(define_insn_reservation "cortex_a17_load3" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "load3"))
  "ca17_ls0+ca17_ls1")

;; Loads of four words.
(define_insn_reservation "cortex_a17_load4" 4
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "load4"))
  "ca17_ls0+ca17_ls1")

;; Stores of up to two words.
(define_insn_reservation "cortex_a17_store1" 0
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "store1,store2"))
  "ca17_ls0|ca17_ls1")

;; Stores of three words
(define_insn_reservation "cortex_a17_store3" 0
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "store3"))
  "ca17_ls0+ca17_ls1")

;; Stores of four words.
(define_insn_reservation "cortex_a17_store4" 0
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "store4"))
  "ca17_ls0+ca17_ls1")

(define_insn_reservation "cortex_a17_call" 0
  (and (eq_attr "tune" "cortexa17")
       (eq_attr "type" "call"))
  "ca17_bx")


(include "../arm/cortex-a17-neon.md")