annotate gcc/config/powerpcspe/htm.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Hardware Transactional Memory (HTM) patterns.
kono
parents:
diff changeset
2 ;; Copyright (C) 2013-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 ;; Contributed by Peter Bergner <bergner@vnet.ibm.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 it
kono
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published
kono
parents:
diff changeset
9 ;; by the Free Software Foundation; either version 3, or (at your
kono
parents:
diff changeset
10 ;; option) any later version.
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
15 ;; 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 (define_constants
kono
parents:
diff changeset
22 [(TFHAR_SPR 128)
kono
parents:
diff changeset
23 (TFIAR_SPR 129)
kono
parents:
diff changeset
24 (TEXASR_SPR 130)
kono
parents:
diff changeset
25 (TEXASRU_SPR 131)
kono
parents:
diff changeset
26 (MAX_HTM_OPERANDS 4)
kono
parents:
diff changeset
27 ])
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 ;;
kono
parents:
diff changeset
30 ;; UNSPEC usage
kono
parents:
diff changeset
31 ;;
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 (define_c_enum "unspec"
kono
parents:
diff changeset
34 [UNSPEC_HTM_FENCE
kono
parents:
diff changeset
35 ])
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 ;;
kono
parents:
diff changeset
38 ;; UNSPEC_VOLATILE usage
kono
parents:
diff changeset
39 ;;
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 (define_c_enum "unspecv"
kono
parents:
diff changeset
42 [UNSPECV_HTM_TABORT
kono
parents:
diff changeset
43 UNSPECV_HTM_TABORTXC
kono
parents:
diff changeset
44 UNSPECV_HTM_TABORTXCI
kono
parents:
diff changeset
45 UNSPECV_HTM_TBEGIN
kono
parents:
diff changeset
46 UNSPECV_HTM_TCHECK
kono
parents:
diff changeset
47 UNSPECV_HTM_TEND
kono
parents:
diff changeset
48 UNSPECV_HTM_TRECHKPT
kono
parents:
diff changeset
49 UNSPECV_HTM_TRECLAIM
kono
parents:
diff changeset
50 UNSPECV_HTM_TSR
kono
parents:
diff changeset
51 UNSPECV_HTM_TTEST
kono
parents:
diff changeset
52 UNSPECV_HTM_MFSPR
kono
parents:
diff changeset
53 UNSPECV_HTM_MTSPR
kono
parents:
diff changeset
54 ])
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 (define_expand "tabort"
kono
parents:
diff changeset
57 [(parallel
kono
parents:
diff changeset
58 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
59 (unspec_volatile:CC [(match_operand:SI 0 "base_reg_operand" "b")]
kono
parents:
diff changeset
60 UNSPECV_HTM_TABORT))
kono
parents:
diff changeset
61 (set (match_dup 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
62 "TARGET_HTM"
kono
parents:
diff changeset
63 {
kono
parents:
diff changeset
64 operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
65 MEM_VOLATILE_P (operands[2]) = 1;
kono
parents:
diff changeset
66 })
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 (define_insn "*tabort"
kono
parents:
diff changeset
69 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
70 (unspec_volatile:CC [(match_operand:SI 0 "base_reg_operand" "b")]
kono
parents:
diff changeset
71 UNSPECV_HTM_TABORT))
kono
parents:
diff changeset
72 (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
73 "TARGET_HTM"
kono
parents:
diff changeset
74 "tabort. %0"
kono
parents:
diff changeset
75 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
76 (set_attr "length" "4")])
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 (define_expand "tabort<wd>c"
kono
parents:
diff changeset
79 [(parallel
kono
parents:
diff changeset
80 [(set (match_operand:CC 3 "cc_reg_operand" "=x")
kono
parents:
diff changeset
81 (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n")
kono
parents:
diff changeset
82 (match_operand:GPR 1 "gpc_reg_operand" "r")
kono
parents:
diff changeset
83 (match_operand:GPR 2 "gpc_reg_operand" "r")]
kono
parents:
diff changeset
84 UNSPECV_HTM_TABORTXC))
kono
parents:
diff changeset
85 (set (match_dup 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
86 "TARGET_HTM"
kono
parents:
diff changeset
87 {
kono
parents:
diff changeset
88 operands[4] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
89 MEM_VOLATILE_P (operands[4]) = 1;
kono
parents:
diff changeset
90 })
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 (define_insn "*tabort<wd>c"
kono
parents:
diff changeset
93 [(set (match_operand:CC 3 "cc_reg_operand" "=x")
kono
parents:
diff changeset
94 (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n")
kono
parents:
diff changeset
95 (match_operand:GPR 1 "gpc_reg_operand" "r")
kono
parents:
diff changeset
96 (match_operand:GPR 2 "gpc_reg_operand" "r")]
kono
parents:
diff changeset
97 UNSPECV_HTM_TABORTXC))
kono
parents:
diff changeset
98 (set (match_operand:BLK 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
99 "TARGET_HTM"
kono
parents:
diff changeset
100 "tabort<wd>c. %0,%1,%2"
kono
parents:
diff changeset
101 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
102 (set_attr "length" "4")])
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 (define_expand "tabort<wd>ci"
kono
parents:
diff changeset
105 [(parallel
kono
parents:
diff changeset
106 [(set (match_operand:CC 3 "cc_reg_operand" "=x")
kono
parents:
diff changeset
107 (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n")
kono
parents:
diff changeset
108 (match_operand:GPR 1 "gpc_reg_operand" "r")
kono
parents:
diff changeset
109 (match_operand 2 "s5bit_cint_operand" "n")]
kono
parents:
diff changeset
110 UNSPECV_HTM_TABORTXCI))
kono
parents:
diff changeset
111 (set (match_dup 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
112 "TARGET_HTM"
kono
parents:
diff changeset
113 {
kono
parents:
diff changeset
114 operands[4] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
115 MEM_VOLATILE_P (operands[4]) = 1;
kono
parents:
diff changeset
116 })
kono
parents:
diff changeset
117
kono
parents:
diff changeset
118 (define_insn "*tabort<wd>ci"
kono
parents:
diff changeset
119 [(set (match_operand:CC 3 "cc_reg_operand" "=x")
kono
parents:
diff changeset
120 (unspec_volatile:CC [(match_operand 0 "u5bit_cint_operand" "n")
kono
parents:
diff changeset
121 (match_operand:GPR 1 "gpc_reg_operand" "r")
kono
parents:
diff changeset
122 (match_operand 2 "s5bit_cint_operand" "n")]
kono
parents:
diff changeset
123 UNSPECV_HTM_TABORTXCI))
kono
parents:
diff changeset
124 (set (match_operand:BLK 4) (unspec:BLK [(match_dup 4)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
125 "TARGET_HTM"
kono
parents:
diff changeset
126 "tabort<wd>ci. %0,%1,%2"
kono
parents:
diff changeset
127 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
128 (set_attr "length" "4")])
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 (define_expand "tbegin"
kono
parents:
diff changeset
131 [(parallel
kono
parents:
diff changeset
132 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
133 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
134 UNSPECV_HTM_TBEGIN))
kono
parents:
diff changeset
135 (set (match_dup 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
136 "TARGET_HTM"
kono
parents:
diff changeset
137 {
kono
parents:
diff changeset
138 operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
139 MEM_VOLATILE_P (operands[2]) = 1;
kono
parents:
diff changeset
140 })
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 (define_insn "*tbegin"
kono
parents:
diff changeset
143 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
144 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
145 UNSPECV_HTM_TBEGIN))
kono
parents:
diff changeset
146 (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
147 "TARGET_HTM"
kono
parents:
diff changeset
148 "tbegin. %0"
kono
parents:
diff changeset
149 [(set_attr "type" "htm")
kono
parents:
diff changeset
150 (set_attr "length" "4")])
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 (define_expand "tcheck"
kono
parents:
diff changeset
153 [(parallel
kono
parents:
diff changeset
154 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
kono
parents:
diff changeset
155 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TCHECK))
kono
parents:
diff changeset
156 (set (match_dup 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
157 "TARGET_HTM"
kono
parents:
diff changeset
158 {
kono
parents:
diff changeset
159 operands[1] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
160 MEM_VOLATILE_P (operands[1]) = 1;
kono
parents:
diff changeset
161 })
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 (define_insn "*tcheck"
kono
parents:
diff changeset
164 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
kono
parents:
diff changeset
165 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TCHECK))
kono
parents:
diff changeset
166 (set (match_operand:BLK 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
167 "TARGET_HTM"
kono
parents:
diff changeset
168 "tcheck %0"
kono
parents:
diff changeset
169 [(set_attr "type" "htm")
kono
parents:
diff changeset
170 (set_attr "length" "4")])
kono
parents:
diff changeset
171
kono
parents:
diff changeset
172 (define_expand "tend"
kono
parents:
diff changeset
173 [(parallel
kono
parents:
diff changeset
174 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
175 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
176 UNSPECV_HTM_TEND))
kono
parents:
diff changeset
177 (set (match_dup 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
178 "TARGET_HTM"
kono
parents:
diff changeset
179 {
kono
parents:
diff changeset
180 operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
181 MEM_VOLATILE_P (operands[2]) = 1;
kono
parents:
diff changeset
182 })
kono
parents:
diff changeset
183
kono
parents:
diff changeset
184 (define_insn "*tend"
kono
parents:
diff changeset
185 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
186 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
187 UNSPECV_HTM_TEND))
kono
parents:
diff changeset
188 (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
189 "TARGET_HTM"
kono
parents:
diff changeset
190 "tend. %0"
kono
parents:
diff changeset
191 [(set_attr "type" "htm")
kono
parents:
diff changeset
192 (set_attr "length" "4")])
kono
parents:
diff changeset
193
kono
parents:
diff changeset
194 (define_expand "trechkpt"
kono
parents:
diff changeset
195 [(parallel
kono
parents:
diff changeset
196 [(set (match_operand:CC 0 "cc_reg_operand" "=x")
kono
parents:
diff changeset
197 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TRECHKPT))
kono
parents:
diff changeset
198 (set (match_dup 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
199 "TARGET_HTM"
kono
parents:
diff changeset
200 {
kono
parents:
diff changeset
201 operands[1] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
202 MEM_VOLATILE_P (operands[1]) = 1;
kono
parents:
diff changeset
203 })
kono
parents:
diff changeset
204
kono
parents:
diff changeset
205 (define_insn "*trechkpt"
kono
parents:
diff changeset
206 [(set (match_operand:CC 0 "cc_reg_operand" "=x")
kono
parents:
diff changeset
207 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TRECHKPT))
kono
parents:
diff changeset
208 (set (match_operand:BLK 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
209 "TARGET_HTM"
kono
parents:
diff changeset
210 "trechkpt."
kono
parents:
diff changeset
211 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
212 (set_attr "length" "4")])
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 (define_expand "treclaim"
kono
parents:
diff changeset
215 [(parallel
kono
parents:
diff changeset
216 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
217 (unspec_volatile:CC [(match_operand:SI 0 "gpc_reg_operand" "r")]
kono
parents:
diff changeset
218 UNSPECV_HTM_TRECLAIM))
kono
parents:
diff changeset
219 (set (match_dup 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
220 "TARGET_HTM"
kono
parents:
diff changeset
221 {
kono
parents:
diff changeset
222 operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
223 MEM_VOLATILE_P (operands[2]) = 1;
kono
parents:
diff changeset
224 })
kono
parents:
diff changeset
225
kono
parents:
diff changeset
226 (define_insn "*treclaim"
kono
parents:
diff changeset
227 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
228 (unspec_volatile:CC [(match_operand:SI 0 "gpc_reg_operand" "r")]
kono
parents:
diff changeset
229 UNSPECV_HTM_TRECLAIM))
kono
parents:
diff changeset
230 (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
231 "TARGET_HTM"
kono
parents:
diff changeset
232 "treclaim. %0"
kono
parents:
diff changeset
233 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
234 (set_attr "length" "4")])
kono
parents:
diff changeset
235
kono
parents:
diff changeset
236 (define_expand "tsr"
kono
parents:
diff changeset
237 [(parallel
kono
parents:
diff changeset
238 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
239 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
240 UNSPECV_HTM_TSR))
kono
parents:
diff changeset
241 (set (match_dup 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
242 "TARGET_HTM"
kono
parents:
diff changeset
243 {
kono
parents:
diff changeset
244 operands[2] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
245 MEM_VOLATILE_P (operands[2]) = 1;
kono
parents:
diff changeset
246 })
kono
parents:
diff changeset
247
kono
parents:
diff changeset
248 (define_insn "*tsr"
kono
parents:
diff changeset
249 [(set (match_operand:CC 1 "cc_reg_operand" "=x")
kono
parents:
diff changeset
250 (unspec_volatile:CC [(match_operand 0 "const_0_to_1_operand" "n")]
kono
parents:
diff changeset
251 UNSPECV_HTM_TSR))
kono
parents:
diff changeset
252 (set (match_operand:BLK 2) (unspec:BLK [(match_dup 2)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
253 "TARGET_HTM"
kono
parents:
diff changeset
254 "tsr. %0"
kono
parents:
diff changeset
255 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
256 (set_attr "length" "4")])
kono
parents:
diff changeset
257
kono
parents:
diff changeset
258 (define_expand "ttest"
kono
parents:
diff changeset
259 [(parallel
kono
parents:
diff changeset
260 [(set (match_operand:CC 0 "cc_reg_operand" "=x")
kono
parents:
diff changeset
261 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TTEST))
kono
parents:
diff changeset
262 (set (match_dup 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))])]
kono
parents:
diff changeset
263 "TARGET_HTM"
kono
parents:
diff changeset
264 {
kono
parents:
diff changeset
265 operands[1] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
kono
parents:
diff changeset
266 MEM_VOLATILE_P (operands[1]) = 1;
kono
parents:
diff changeset
267 })
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 (define_insn "*ttest"
kono
parents:
diff changeset
270 [(set (match_operand:CC 0 "cc_reg_operand" "=x")
kono
parents:
diff changeset
271 (unspec_volatile:CC [(const_int 0)] UNSPECV_HTM_TTEST))
kono
parents:
diff changeset
272 (set (match_operand:BLK 1) (unspec:BLK [(match_dup 1)] UNSPEC_HTM_FENCE))]
kono
parents:
diff changeset
273 "TARGET_HTM"
kono
parents:
diff changeset
274 "tabortwci. 0,1,0"
kono
parents:
diff changeset
275 [(set_attr "type" "htmsimple")
kono
parents:
diff changeset
276 (set_attr "length" "4")])
kono
parents:
diff changeset
277
kono
parents:
diff changeset
278 (define_insn "htm_mfspr_<mode>"
kono
parents:
diff changeset
279 [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
kono
parents:
diff changeset
280 (unspec_volatile:GPR [(match_operand 1 "u10bit_cint_operand" "n")
kono
parents:
diff changeset
281 (match_operand:GPR 2 "htm_spr_reg_operand" "")]
kono
parents:
diff changeset
282 UNSPECV_HTM_MFSPR))]
kono
parents:
diff changeset
283 "TARGET_HTM"
kono
parents:
diff changeset
284 "mfspr %0,%1";
kono
parents:
diff changeset
285 [(set_attr "type" "htm")
kono
parents:
diff changeset
286 (set_attr "length" "4")])
kono
parents:
diff changeset
287
kono
parents:
diff changeset
288 (define_insn "htm_mtspr_<mode>"
kono
parents:
diff changeset
289 [(set (match_operand:GPR 2 "htm_spr_reg_operand" "")
kono
parents:
diff changeset
290 (unspec_volatile:GPR [(match_operand:GPR 0 "gpc_reg_operand" "r")
kono
parents:
diff changeset
291 (match_operand 1 "u10bit_cint_operand" "n")]
kono
parents:
diff changeset
292 UNSPECV_HTM_MTSPR))]
kono
parents:
diff changeset
293 "TARGET_HTM"
kono
parents:
diff changeset
294 "mtspr %1,%0";
kono
parents:
diff changeset
295 [(set_attr "type" "htm")
kono
parents:
diff changeset
296 (set_attr "length" "4")])