]>
Commit | Line | Data |
---|---|---|
9db1d521 | 1 | ;;- Machine description for GNU compiler -- S/390 / zSeries version. |
66647d44 | 2 | ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
c75c517d | 3 | ;; 2009, 2010 Free Software Foundation, Inc. |
9db1d521 | 4 | ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and |
963fc8d0 AK |
5 | ;; Ulrich Weigand (uweigand@de.ibm.com) and |
6 | ;; Andreas Krebbel (Andreas.Krebbel@de.ibm.com) | |
9db1d521 | 7 | |
58add37a UW |
8 | ;; This file is part of GCC. |
9 | ||
10 | ;; GCC is free software; you can redistribute it and/or modify it under | |
11 | ;; the terms of the GNU General Public License as published by the Free | |
2f83c7d6 | 12 | ;; Software Foundation; either version 3, or (at your option) any later |
58add37a UW |
13 | ;; version. |
14 | ||
15 | ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
16 | ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
17 | ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
18 | ;; for more details. | |
9db1d521 HP |
19 | |
20 | ;; You should have received a copy of the GNU General Public License | |
2f83c7d6 NC |
21 | ;; along with GCC; see the file COPYING3. If not see |
22 | ;; <http://www.gnu.org/licenses/>. | |
9db1d521 HP |
23 | |
24 | ;; | |
cd8dc1f9 | 25 | ;; See constraints.md for a description of constraints specific to s390. |
9db1d521 | 26 | ;; |
cd8dc1f9 | 27 | |
9db1d521 HP |
28 | ;; Special formats used for outputting 390 instructions. |
29 | ;; | |
f19a9af7 AK |
30 | ;; %C: print opcode suffix for branch condition. |
31 | ;; %D: print opcode suffix for inverse branch condition. | |
32 | ;; %J: print tls_load/tls_gdcall/tls_ldcall suffix | |
da48f5ec | 33 | ;; %G: print the size of the operand in bytes. |
f19a9af7 AK |
34 | ;; %O: print only the displacement of a memory reference. |
35 | ;; %R: print only the base register of a memory reference. | |
fc0ea003 | 36 | ;; %S: print S-type memory reference (base+displacement). |
f19a9af7 AK |
37 | ;; %N: print the second word of a DImode operand. |
38 | ;; %M: print the second word of a TImode operand. | |
da48f5ec | 39 | ;; %Y: print shift count operand. |
f4aa3848 | 40 | ;; |
f19a9af7 | 41 | ;; %b: print integer X as if it's an unsigned byte. |
963fc8d0 | 42 | ;; %c: print integer X as if it's an signed byte. |
da48f5ec AK |
43 | ;; %x: print integer X as if it's an unsigned halfword. |
44 | ;; %h: print integer X as if it's a signed halfword. | |
45 | ;; %i: print the first nonzero HImode part of X. | |
46 | ;; %j: print the first HImode part unequal to -1 of X. | |
47 | ;; %k: print the first nonzero SImode part of X. | |
48 | ;; %m: print the first SImode part unequal to -1 of X. | |
49 | ;; %o: print integer X as if it's an unsigned 32bit word. | |
9db1d521 HP |
50 | ;; |
51 | ;; We have a special constraint for pattern matching. | |
52 | ;; | |
53 | ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction. | |
54 | ;; | |
9db1d521 | 55 | |
fd3cd001 UW |
56 | ;; |
57 | ;; UNSPEC usage | |
58 | ;; | |
59 | ||
30a49b23 AK |
60 | (define_c_enum "unspec" [ |
61 | ; Miscellaneous | |
62 | UNSPEC_ROUND | |
63 | UNSPEC_CCU_TO_INT | |
64 | UNSPEC_CCZ_TO_INT | |
65 | UNSPEC_ICM | |
66 | UNSPEC_TIE | |
10bbf137 UW |
67 | |
68 | ; GOT/PLT and lt-relative accesses | |
30a49b23 AK |
69 | UNSPEC_LTREL_OFFSET |
70 | UNSPEC_LTREL_BASE | |
71 | UNSPEC_POOL_OFFSET | |
72 | UNSPEC_GOTENT | |
73 | UNSPEC_GOT | |
74 | UNSPEC_GOTOFF | |
75 | UNSPEC_PLT | |
76 | UNSPEC_PLTOFF | |
fd7643fb UW |
77 | |
78 | ; Literal pool | |
30a49b23 AK |
79 | UNSPEC_RELOAD_BASE |
80 | UNSPEC_MAIN_BASE | |
81 | UNSPEC_LTREF | |
82 | UNSPEC_INSN | |
83 | UNSPEC_EXECUTE | |
fd7643fb | 84 | |
1a8c13b3 | 85 | ; Atomic Support |
30a49b23 | 86 | UNSPEC_MB |
78ce265b | 87 | UNSPEC_MOVA |
1a8c13b3 | 88 | |
fd7643fb | 89 | ; TLS relocation specifiers |
30a49b23 AK |
90 | UNSPEC_TLSGD |
91 | UNSPEC_TLSLDM | |
92 | UNSPEC_NTPOFF | |
93 | UNSPEC_DTPOFF | |
94 | UNSPEC_GOTNTPOFF | |
95 | UNSPEC_INDNTPOFF | |
fd3cd001 UW |
96 | |
97 | ; TLS support | |
30a49b23 AK |
98 | UNSPEC_TLSLDM_NTPOFF |
99 | UNSPEC_TLS_LOAD | |
91d39d71 UW |
100 | |
101 | ; String Functions | |
30a49b23 AK |
102 | UNSPEC_SRST |
103 | UNSPEC_MVST | |
638e37c2 | 104 | |
7b8acc34 | 105 | ; Stack Smashing Protector |
30a49b23 AK |
106 | UNSPEC_SP_SET |
107 | UNSPEC_SP_TEST | |
85dae55a | 108 | |
638e37c2 | 109 | ; Test Data Class (TDC) |
30a49b23 | 110 | UNSPEC_TDC_INSN |
65b1d8ea AK |
111 | |
112 | ; Population Count | |
30a49b23 AK |
113 | UNSPEC_POPCNT |
114 | UNSPEC_COPYSIGN | |
fd3cd001 UW |
115 | ]) |
116 | ||
117 | ;; | |
118 | ;; UNSPEC_VOLATILE usage | |
119 | ;; | |
120 | ||
30a49b23 AK |
121 | (define_c_enum "unspecv" [ |
122 | ; Blockage | |
123 | UNSPECV_BLOCKAGE | |
10bbf137 | 124 | |
2f7e5a0d | 125 | ; TPF Support |
30a49b23 AK |
126 | UNSPECV_TPF_PROLOGUE |
127 | UNSPECV_TPF_EPILOGUE | |
2f7e5a0d | 128 | |
10bbf137 | 129 | ; Literal pool |
30a49b23 AK |
130 | UNSPECV_POOL |
131 | UNSPECV_POOL_SECTION | |
132 | UNSPECV_POOL_ALIGN | |
133 | UNSPECV_POOL_ENTRY | |
134 | UNSPECV_MAIN_POOL | |
fd7643fb UW |
135 | |
136 | ; TLS support | |
30a49b23 | 137 | UNSPECV_SET_TP |
e0374221 AS |
138 | |
139 | ; Atomic Support | |
30a49b23 AK |
140 | UNSPECV_CAS |
141 | UNSPECV_ATOMIC_OP | |
fd3cd001 UW |
142 | ]) |
143 | ||
ae156f85 AS |
144 | ;; |
145 | ;; Registers | |
146 | ;; | |
147 | ||
35dd9a0e AK |
148 | ; Registers with special meaning |
149 | ||
ae156f85 AS |
150 | (define_constants |
151 | [ | |
152 | ; Sibling call register. | |
153 | (SIBCALL_REGNUM 1) | |
154 | ; Literal pool base register. | |
155 | (BASE_REGNUM 13) | |
156 | ; Return address register. | |
157 | (RETURN_REGNUM 14) | |
158 | ; Condition code register. | |
159 | (CC_REGNUM 33) | |
f4aa3848 | 160 | ; Thread local storage pointer register. |
ae156f85 AS |
161 | (TP_REGNUM 36) |
162 | ]) | |
163 | ||
35dd9a0e AK |
164 | ; Hardware register names |
165 | ||
166 | (define_constants | |
167 | [ | |
168 | ; General purpose registers | |
169 | (GPR0_REGNUM 0) | |
170 | ; Floating point registers. | |
171 | (FPR0_REGNUM 16) | |
172 | (FPR2_REGNUM 18) | |
173 | ]) | |
174 | ||
175 | ;; | |
176 | ;; PFPO GPR0 argument format | |
177 | ;; | |
178 | ||
179 | (define_constants | |
180 | [ | |
181 | ; PFPO operation type | |
182 | (PFPO_CONVERT 0x1000000) | |
183 | ; PFPO operand types | |
184 | (PFPO_OP_TYPE_SF 0x5) | |
185 | (PFPO_OP_TYPE_DF 0x6) | |
186 | (PFPO_OP_TYPE_TF 0x7) | |
187 | (PFPO_OP_TYPE_SD 0x8) | |
188 | (PFPO_OP_TYPE_DD 0x9) | |
189 | (PFPO_OP_TYPE_TD 0xa) | |
190 | ; Bitposition of operand types | |
191 | (PFPO_OP0_TYPE_SHIFT 16) | |
192 | (PFPO_OP1_TYPE_SHIFT 8) | |
193 | ]) | |
194 | ||
fd3cd001 | 195 | |
29a74354 UW |
196 | ;; Instruction operand type as used in the Principles of Operation. |
197 | ;; Used to determine defaults for length and other attribute values. | |
1fec52be | 198 | |
29a74354 | 199 | (define_attr "op_type" |
963fc8d0 | 200 | "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY,RRF,RRR,SIL,RRS,RIS" |
b628bd8e | 201 | (const_string "NN")) |
9db1d521 | 202 | |
29a74354 | 203 | ;; Instruction type attribute used for scheduling. |
9db1d521 | 204 | |
077dab3b | 205 | (define_attr "type" "none,integer,load,lr,la,larl,lm,stm, |
e0374221 | 206 | cs,vs,store,sem,idiv, |
ed0e512a | 207 | imulhi,imulsi,imuldi, |
2cdece44 | 208 | branch,jsr,fsimptf,fsimpdf,fsimpsf,fhex, |
f61a2c7d AK |
209 | floadtf,floaddf,floadsf,fstoredf,fstoresf, |
210 | fmultf,fmuldf,fmulsf,fdivtf,fdivdf,fdivsf, | |
9381e3f1 | 211 | ftoi,fsqrttf,fsqrtdf,fsqrtsf, |
65b1d8ea | 212 | fmadddf,fmaddsf, |
9381e3f1 WG |
213 | ftrunctf,ftruncdf, ftruncsd, ftruncdd, |
214 | itoftf, itofdf, itofsf, itofdd, itoftd, | |
215 | fdivdd, fdivtd, floaddd, floadsd, fmuldd, fmultd, | |
216 | fsimpdd, fsimpsd, fsimptd, fstoredd, fstoresd, | |
217 | ftoidfp, other" | |
29a74354 UW |
218 | (cond [(eq_attr "op_type" "NN") (const_string "other") |
219 | (eq_attr "op_type" "SS") (const_string "cs")] | |
220 | (const_string "integer"))) | |
9db1d521 | 221 | |
29a74354 UW |
222 | ;; Another attribute used for scheduling purposes: |
223 | ;; agen: Instruction uses the address generation unit | |
224 | ;; reg: Instruction does not use the agen unit | |
077dab3b HP |
225 | |
226 | (define_attr "atype" "agen,reg" | |
c68e7b86 | 227 | (if_then_else (eq_attr "op_type" "E,RR,RI,RRE,RSI,RIL,RIE,RRF,RRR") |
0101708c AS |
228 | (const_string "reg") |
229 | (const_string "agen"))) | |
9db1d521 | 230 | |
9381e3f1 WG |
231 | ;; Properties concerning Z10 execution grouping and value forwarding. |
232 | ;; z10_super: instruction is superscalar. | |
233 | ;; z10_super_c: instruction is superscalar and meets the condition of z10_c. | |
234 | ;; z10_fwd: The instruction reads the value of an operand and stores it into a | |
235 | ;; target register. It can forward this value to a second instruction that reads | |
236 | ;; the same register if that second instruction is issued in the same group. | |
237 | ;; z10_rec: The instruction is in the T pipeline and reads a register. If the | |
238 | ;; instruction in the S pipe writes to the register, then the T instruction | |
239 | ;; can immediately read the new value. | |
240 | ;; z10_fr: union of Z10_fwd and z10_rec. | |
241 | ;; z10_c: second operand of instruction is a register and read with complemented bits. | |
9381e3f1 WG |
242 | ;; |
243 | ;; An additional suffix A1, A3, or E1 indicates the respective AGI bypass. | |
244 | ||
245 | ||
246 | (define_attr "z10prop" "none, | |
247 | z10_super, z10_super_E1, z10_super_A1, z10_super_c, z10_super_c_E1, | |
248 | z10_fwd, z10_fwd_A1, z10_fwd_A3, z10_fwd_E1, | |
249 | z10_rec, | |
250 | z10_fr, z10_fr_A3, z10_fr_E1, | |
e3cba5e5 | 251 | z10_c" |
9381e3f1 WG |
252 | (const_string "none")) |
253 | ||
65b1d8ea AK |
254 | ;; Properties concerning Z196 decoding |
255 | ;; z196_alone: must group alone | |
256 | ;; z196_end: ends a group | |
257 | ;; z196_cracked: instruction is cracked or expanded | |
258 | (define_attr "z196prop" "none, | |
259 | z196_alone, z196_ends, | |
260 | z196_cracked" | |
261 | (const_string "none")) | |
9381e3f1 | 262 | |
22ac2c2f AK |
263 | (define_attr "mnemonic" "unknown" (const_string "unknown")) |
264 | ||
9db1d521 HP |
265 | ;; Length in bytes. |
266 | ||
267 | (define_attr "length" "" | |
963fc8d0 AK |
268 | (cond [(eq_attr "op_type" "E,RR") (const_int 2) |
269 | (eq_attr "op_type" "RX,RI,RRE,RS,RSI,S,SI,RRF,RRR") (const_int 4)] | |
b628bd8e | 270 | (const_int 6))) |
9db1d521 | 271 | |
29a74354 UW |
272 | |
273 | ;; Processor type. This attribute must exactly match the processor_type | |
274 | ;; enumeration in s390.h. The current machine description does not | |
275 | ;; distinguish between g5 and g6, but there are differences between the two | |
276 | ;; CPUs could in theory be modeled. | |
277 | ||
22ac2c2f | 278 | (define_attr "cpu" "g5,g6,z900,z990,z9_109,z9_ec,z10,z196,zEC12" |
90c6fd8a | 279 | (const (symbol_ref "s390_tune_attr"))) |
29a74354 | 280 | |
22ac2c2f | 281 | (define_attr "cpu_facility" "standard,ieee,zarch,longdisp,extimm,dfp,z10,z196,zEC12" |
3af8e996 AK |
282 | (const_string "standard")) |
283 | ||
284 | (define_attr "enabled" "" | |
285 | (cond [(eq_attr "cpu_facility" "standard") | |
286 | (const_int 1) | |
287 | ||
288 | (and (eq_attr "cpu_facility" "ieee") | |
d7f99b2c | 289 | (match_test "TARGET_CPU_IEEE_FLOAT")) |
3af8e996 AK |
290 | (const_int 1) |
291 | ||
292 | (and (eq_attr "cpu_facility" "zarch") | |
d7f99b2c | 293 | (match_test "TARGET_ZARCH")) |
3af8e996 AK |
294 | (const_int 1) |
295 | ||
296 | (and (eq_attr "cpu_facility" "longdisp") | |
d7f99b2c | 297 | (match_test "TARGET_LONG_DISPLACEMENT")) |
3af8e996 AK |
298 | (const_int 1) |
299 | ||
300 | (and (eq_attr "cpu_facility" "extimm") | |
d7f99b2c | 301 | (match_test "TARGET_EXTIMM")) |
3af8e996 AK |
302 | (const_int 1) |
303 | ||
304 | (and (eq_attr "cpu_facility" "dfp") | |
d7f99b2c | 305 | (match_test "TARGET_DFP")) |
93538e8e AK |
306 | (const_int 1) |
307 | ||
308 | (and (eq_attr "cpu_facility" "z10") | |
d7f99b2c | 309 | (match_test "TARGET_Z10")) |
65b1d8ea AK |
310 | (const_int 1) |
311 | ||
312 | (and (eq_attr "cpu_facility" "z196") | |
d7f99b2c | 313 | (match_test "TARGET_Z196")) |
22ac2c2f AK |
314 | (const_int 1) |
315 | ||
316 | (and (eq_attr "cpu_facility" "zEC12") | |
317 | (match_test "TARGET_ZEC12")) | |
3af8e996 AK |
318 | (const_int 1)] |
319 | (const_int 0))) | |
320 | ||
29a74354 UW |
321 | ;; Pipeline description for z900. For lack of anything better, |
322 | ;; this description is also used for the g5 and g6. | |
323 | (include "2064.md") | |
324 | ||
3443392a | 325 | ;; Pipeline description for z990, z9-109 and z9-ec. |
29a74354 UW |
326 | (include "2084.md") |
327 | ||
9381e3f1 WG |
328 | ;; Pipeline description for z10 |
329 | (include "2097.md") | |
330 | ||
65b1d8ea AK |
331 | ;; Pipeline description for z196 |
332 | (include "2817.md") | |
333 | ||
22ac2c2f AK |
334 | ;; Pipeline description for zEC12 |
335 | (include "2827.md") | |
336 | ||
0bfc3f69 AS |
337 | ;; Predicates |
338 | (include "predicates.md") | |
339 | ||
cd8dc1f9 WG |
340 | ;; Constraint definitions |
341 | (include "constraints.md") | |
342 | ||
a8ba31f2 EC |
343 | ;; Other includes |
344 | (include "tpf.md") | |
f52c81dd | 345 | |
3abcb3a7 | 346 | ;; Iterators |
f52c81dd | 347 | |
3abcb3a7 | 348 | ;; These mode iterators allow floating point patterns to be generated from the |
f5905b37 | 349 | ;; same template. |
f4aa3848 | 350 | (define_mode_iterator FP_ALL [TF DF SF (TD "TARGET_HARD_DFP") (DD "TARGET_HARD_DFP") |
0387c142 | 351 | (SD "TARGET_HARD_DFP")]) |
3abcb3a7 | 352 | (define_mode_iterator FP [TF DF SF (TD "TARGET_HARD_DFP") (DD "TARGET_HARD_DFP")]) |
963fc8d0 | 353 | (define_mode_iterator FPALL [TF DF SF TD DD SD]) |
3abcb3a7 HPN |
354 | (define_mode_iterator BFP [TF DF SF]) |
355 | (define_mode_iterator DFP [TD DD]) | |
356 | (define_mode_iterator DFP_ALL [TD DD SD]) | |
357 | (define_mode_iterator DSF [DF SF]) | |
358 | (define_mode_iterator SD_SF [SF SD]) | |
359 | (define_mode_iterator DD_DF [DF DD]) | |
360 | (define_mode_iterator TD_TF [TF TD]) | |
361 | ||
3abcb3a7 | 362 | ;; These mode iterators allow 31-bit and 64-bit GPR patterns to be generated |
9db2f16d | 363 | ;; from the same template. |
9602b6a1 | 364 | (define_mode_iterator GPR [(DI "TARGET_ZARCH") SI]) |
78ce265b | 365 | (define_mode_iterator DGPR [(TI "TARGET_ZARCH") DI SI]) |
3abcb3a7 | 366 | (define_mode_iterator DSI [DI SI]) |
78ce265b | 367 | (define_mode_iterator TDI [TI DI]) |
9db2f16d | 368 | |
3abcb3a7 | 369 | ;; These mode iterators allow :P to be used for patterns that operate on |
9db2f16d | 370 | ;; pointer-sized quantities. Exactly one of the two alternatives will match. |
3abcb3a7 | 371 | (define_mode_iterator P [(DI "TARGET_64BIT") (SI "!TARGET_64BIT")]) |
9db2f16d | 372 | |
78ce265b RH |
373 | ;; These macros refer to the actual word_mode of the configuration. |
374 | ;; This is equal to Pmode except on 31-bit machines in zarch mode. | |
9602b6a1 AK |
375 | (define_mode_iterator DW [(TI "TARGET_ZARCH") (DI "!TARGET_ZARCH")]) |
376 | (define_mode_iterator W [(DI "TARGET_ZARCH") (SI "!TARGET_ZARCH")]) | |
377 | ||
6e0d70c9 AK |
378 | ;; Used by the umul pattern to express modes having half the size. |
379 | (define_mode_attr DWH [(TI "DI") (DI "SI")]) | |
380 | (define_mode_attr dwh [(TI "di") (DI "si")]) | |
381 | ||
3abcb3a7 | 382 | ;; This mode iterator allows the QI and HI patterns to be defined from |
f52c81dd | 383 | ;; the same template. |
3abcb3a7 | 384 | (define_mode_iterator HQI [HI QI]) |
f52c81dd | 385 | |
3abcb3a7 | 386 | ;; This mode iterator allows the integer patterns to be defined from the |
342cf42b | 387 | ;; same template. |
9602b6a1 | 388 | (define_mode_iterator INT [(DI "TARGET_ZARCH") SI HI QI]) |
963fc8d0 | 389 | (define_mode_iterator INTALL [TI DI SI HI QI]) |
78ce265b | 390 | (define_mode_iterator DINT [(TI "TARGET_ZARCH") DI SI HI QI]) |
342cf42b | 391 | |
3abcb3a7 | 392 | ;; This iterator allows some 'ashift' and 'lshiftrt' pattern to be defined from |
f337b930 | 393 | ;; the same template. |
3abcb3a7 | 394 | (define_code_iterator SHIFT [ashift lshiftrt]) |
f337b930 | 395 | |
3abcb3a7 HPN |
396 | ;; This iterator and attribute allow to combine most atomic operations. |
397 | (define_code_iterator ATOMIC [and ior xor plus minus mult]) | |
65b1d8ea | 398 | (define_code_iterator ATOMIC_Z196 [and ior xor plus]) |
f4aa3848 | 399 | (define_code_attr atomic [(and "and") (ior "ior") (xor "xor") |
45d18331 | 400 | (plus "add") (minus "sub") (mult "nand")]) |
65b1d8ea | 401 | (define_code_attr noxa [(and "n") (ior "o") (xor "x") (plus "a")]) |
45d18331 | 402 | |
f4aa3848 | 403 | ;; In FP templates, a string like "lt<de>br" will expand to "ltxbr" in |
609e7e80 AK |
404 | ;; TF/TDmode, "ltdbr" in DF/DDmode, and "ltebr" in SF/SDmode. |
405 | (define_mode_attr xde [(TF "x") (DF "d") (SF "e") (TD "x") (DD "d") (SD "e")]) | |
f337b930 | 406 | |
f4aa3848 AK |
407 | ;; In FP templates, a <dee> in "m<dee><bt>r" will expand to "mx<bt>r" in |
408 | ;; TF/TDmode, "md<bt>r" in DF/DDmode, "mee<bt>r" in SFmode and "me<bt>r in | |
609e7e80 AK |
409 | ;; SDmode. |
410 | (define_mode_attr xdee [(TF "x") (DF "d") (SF "ee") (TD "x") (DD "d") (SD "e")]) | |
f5905b37 | 411 | |
609e7e80 | 412 | ;; In FP templates, "<RRe>" will expand to "RRE" in TFmode and "RR" otherwise. |
f61a2c7d AK |
413 | ;; Likewise for "<RXe>". |
414 | (define_mode_attr RRe [(TF "RRE") (DF "RR") (SF "RR")]) | |
415 | (define_mode_attr RXe [(TF "RXE") (DF "RX") (SF "RX")]) | |
416 | ||
609e7e80 | 417 | ;; The decimal floating point variants of add, sub, div and mul support 3 |
3abcb3a7 | 418 | ;; fp register operands. The following attributes allow to merge the bfp and |
609e7e80 AK |
419 | ;; dfp variants in a single insn definition. |
420 | ||
3abcb3a7 | 421 | ;; This attribute is used to set op_type accordingly. |
f4aa3848 | 422 | (define_mode_attr RRer [(TF "RRE") (DF "RRE") (SF "RRE") (TD "RRR") |
609e7e80 AK |
423 | (DD "RRR") (SD "RRR")]) |
424 | ||
f4aa3848 | 425 | ;; This attribute is used in the operand constraint list in order to have the |
609e7e80 AK |
426 | ;; first and the second operand match for bfp modes. |
427 | (define_mode_attr f0 [(TF "0") (DF "0") (SF "0") (TD "f") (DD "f") (DD "f")]) | |
428 | ||
f4aa3848 | 429 | ;; This attribute is used in the operand list of the instruction to have an |
609e7e80 AK |
430 | ;; additional operand for the dfp instructions. |
431 | (define_mode_attr op1 [(TF "") (DF "") (SF "") | |
432 | (TD "%1,") (DD "%1,") (SD "%1,")]) | |
433 | ||
f5905b37 | 434 | |
85dae55a AK |
435 | ;; This attribute is used in the operand constraint list |
436 | ;; for instructions dealing with the sign bit of 32 or 64bit fp values. | |
437 | ;; TFmode values are represented by a fp register pair. Since the | |
438 | ;; sign bit instructions only handle single source and target fp registers | |
439 | ;; these instructions can only be used for TFmode values if the source and | |
440 | ;; target operand uses the same fp register. | |
441 | (define_mode_attr fT0 [(TF "0") (DF "f") (SF "f")]) | |
442 | ||
609e7e80 AK |
443 | ;; In FP templates, "<Rf>" will expand to "f" in TFmode and "R" otherwise. |
444 | ;; This is used to disable the memory alternative in TFmode patterns. | |
445 | (define_mode_attr Rf [(TF "f") (DF "R") (SF "R") (TD "f") (DD "f") (SD "f")]) | |
446 | ||
3abcb3a7 | 447 | ;; This attribute adds b for bfp instructions and t for dfp instructions and is used |
609e7e80 AK |
448 | ;; within instruction mnemonics. |
449 | (define_mode_attr bt [(TF "b") (DF "b") (SF "b") (TD "t") (DD "t") (SD "t")]) | |
450 | ||
0387c142 WG |
451 | ;; This attribute is used within instruction mnemonics. It evaluates to d for dfp |
452 | ;; modes and to an empty string for bfp modes. | |
453 | (define_mode_attr _d [(TF "") (DF "") (SF "") (TD "d") (DD "d") (SD "d")]) | |
454 | ||
1b48c8cc AS |
455 | ;; In GPR and P templates, a constraint like "<d0>" will expand to "d" in DImode |
456 | ;; and "0" in SImode. This allows to combine instructions of which the 31bit | |
457 | ;; version only operates on one register. | |
458 | (define_mode_attr d0 [(DI "d") (SI "0")]) | |
459 | ||
460 | ;; In combination with d0 this allows to combine instructions of which the 31bit | |
461 | ;; version only operates on one register. The DImode version needs an additional | |
462 | ;; register for the assembler output. | |
463 | (define_mode_attr 1 [(DI "%1,") (SI "")]) | |
9381e3f1 WG |
464 | |
465 | ;; In SHIFT templates, a string like "s<lr>dl" will expand to "sldl" in | |
f337b930 AS |
466 | ;; 'ashift' and "srdl" in 'lshiftrt'. |
467 | (define_code_attr lr [(ashift "l") (lshiftrt "r")]) | |
468 | ||
469 | ;; In SHIFT templates, this attribute holds the correct standard name for the | |
9381e3f1 | 470 | ;; pattern itself and the corresponding function calls. |
f337b930 | 471 | (define_code_attr shift [(ashift "ashl") (lshiftrt "lshr")]) |
9a91a21f AS |
472 | |
473 | ;; This attribute handles differences in the instruction 'type' and will result | |
474 | ;; in "RRE" for DImode and "RR" for SImode. | |
475 | (define_mode_attr E [(DI "E") (SI "")]) | |
476 | ||
3298c037 AK |
477 | ;; This attribute handles differences in the instruction 'type' and makes RX<Y> |
478 | ;; to result in "RXY" for DImode and "RX" for SImode. | |
479 | (define_mode_attr Y [(DI "Y") (SI "")]) | |
480 | ||
8006eaa6 AS |
481 | ;; This attribute handles differences in the instruction 'type' and will result |
482 | ;; in "RSE" for TImode and "RS" for DImode. | |
483 | (define_mode_attr TE [(TI "E") (DI "")]) | |
484 | ||
9a91a21f AS |
485 | ;; In GPR templates, a string like "lc<g>r" will expand to "lcgr" in DImode |
486 | ;; and "lcr" in SImode. | |
487 | (define_mode_attr g [(DI "g") (SI "")]) | |
f52c81dd | 488 | |
3298c037 AK |
489 | ;; In GPR templates, a string like "sl<y>" will expand to "slg" in DImode |
490 | ;; and "sly" in SImode. This is useful because on 64bit the ..g instructions | |
491 | ;; were enhanced with long displacements whereas 31bit instructions got a ..y | |
492 | ;; variant for long displacements. | |
493 | (define_mode_attr y [(DI "g") (SI "y")]) | |
494 | ||
9602b6a1 | 495 | ;; In DW templates, a string like "cds<g>" will expand to "cdsg" in TImode |
8006eaa6 AS |
496 | ;; and "cds" in DImode. |
497 | (define_mode_attr tg [(TI "g") (DI "")]) | |
498 | ||
78ce265b RH |
499 | ;; In TDI templates, a string like "c<d>sg". |
500 | (define_mode_attr td [(TI "d") (DI "")]) | |
501 | ||
2f8f8434 AS |
502 | ;; In GPR templates, a string like "c<gf>dbr" will expand to "cgdbr" in DImode |
503 | ;; and "cfdbr" in SImode. | |
504 | (define_mode_attr gf [(DI "g") (SI "f")]) | |
505 | ||
65b1d8ea AK |
506 | ;; In GPR templates, a string like sll<gk> will expand to sllg for DI |
507 | ;; and sllk for SI. This way it is possible to merge the new z196 SI | |
508 | ;; 3 operands shift instructions into the existing patterns. | |
509 | (define_mode_attr gk [(DI "g") (SI "k")]) | |
510 | ||
f52c81dd AS |
511 | ;; ICM mask required to load MODE value into the lowest subreg |
512 | ;; of a SImode register. | |
513 | (define_mode_attr icm_lo [(HI "3") (QI "1")]) | |
514 | ||
f6ee577c AS |
515 | ;; In HQI templates, a string like "llg<hc>" will expand to "llgh" in |
516 | ;; HImode and "llgc" in QImode. | |
517 | (define_mode_attr hc [(HI "h") (QI "c")]) | |
518 | ||
a1aed706 AS |
519 | ;; In P templates, the mode <DBL> will expand to "TI" in DImode and "DI" |
520 | ;; in SImode. | |
521 | (define_mode_attr DBL [(DI "TI") (SI "DI")]) | |
522 | ||
609e7e80 AK |
523 | ;; This attribute expands to DF for TFmode and to DD for TDmode . It is |
524 | ;; used for Txmode splitters splitting a Txmode copy into 2 Dxmode copies. | |
525 | (define_mode_attr HALF_TMODE [(TF "DF") (TD "DD")]) | |
526 | ||
f52c81dd AS |
527 | ;; Maximum unsigned integer that fits in MODE. |
528 | (define_mode_attr max_uint [(HI "65535") (QI "255")]) | |
529 | ||
75ca1b39 RH |
530 | ;; Start and end field computations for RISBG et al. |
531 | (define_mode_attr bfstart [(DI "s") (SI "t")]) | |
532 | (define_mode_attr bfend [(DI "e") (SI "f")]) | |
533 | ||
9db1d521 HP |
534 | ;; |
535 | ;;- Compare instructions. | |
536 | ;; | |
537 | ||
07893d4f | 538 | ; Test-under-Mask instructions |
9db1d521 | 539 | |
07893d4f | 540 | (define_insn "*tmqi_mem" |
ae156f85 | 541 | [(set (reg CC_REGNUM) |
68f9c5e2 UW |
542 | (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S") |
543 | (match_operand:QI 1 "immediate_operand" "n,n")) | |
544 | (match_operand:QI 2 "immediate_operand" "n,n")))] | |
3ed99cc9 | 545 | "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], false))" |
d3632d41 | 546 | "@ |
fc0ea003 UW |
547 | tm\t%S0,%b1 |
548 | tmy\t%S0,%b1" | |
9381e3f1 WG |
549 | [(set_attr "op_type" "SI,SIY") |
550 | (set_attr "z10prop" "z10_super,z10_super")]) | |
9db1d521 | 551 | |
05b9aaaa | 552 | (define_insn "*tmdi_reg" |
ae156f85 | 553 | [(set (reg CC_REGNUM) |
f19a9af7 | 554 | (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d") |
2f7e5a0d | 555 | (match_operand:DI 1 "immediate_operand" |
f19a9af7 AK |
556 | "N0HD0,N1HD0,N2HD0,N3HD0")) |
557 | (match_operand:DI 2 "immediate_operand" "n,n,n,n")))] | |
9602b6a1 | 558 | "TARGET_ZARCH |
3ed99cc9 | 559 | && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) |
f19a9af7 AK |
560 | && s390_single_part (operands[1], DImode, HImode, 0) >= 0" |
561 | "@ | |
562 | tmhh\t%0,%i1 | |
563 | tmhl\t%0,%i1 | |
564 | tmlh\t%0,%i1 | |
565 | tmll\t%0,%i1" | |
9381e3f1 WG |
566 | [(set_attr "op_type" "RI") |
567 | (set_attr "z10prop" "z10_super,z10_super,z10_super,z10_super")]) | |
05b9aaaa UW |
568 | |
569 | (define_insn "*tmsi_reg" | |
ae156f85 | 570 | [(set (reg CC_REGNUM) |
f19a9af7 AK |
571 | (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d") |
572 | (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0")) | |
573 | (match_operand:SI 2 "immediate_operand" "n,n")))] | |
3ed99cc9 | 574 | "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) |
f19a9af7 AK |
575 | && s390_single_part (operands[1], SImode, HImode, 0) >= 0" |
576 | "@ | |
577 | tmh\t%0,%i1 | |
578 | tml\t%0,%i1" | |
729e750f WG |
579 | [(set_attr "op_type" "RI") |
580 | (set_attr "z10prop" "z10_super,z10_super")]) | |
05b9aaaa | 581 | |
f52c81dd | 582 | (define_insn "*tm<mode>_full" |
ae156f85 | 583 | [(set (reg CC_REGNUM) |
f52c81dd AS |
584 | (compare (match_operand:HQI 0 "register_operand" "d") |
585 | (match_operand:HQI 1 "immediate_operand" "n")))] | |
3ed99cc9 | 586 | "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], true))" |
f52c81dd | 587 | "tml\t%0,<max_uint>" |
729e750f WG |
588 | [(set_attr "op_type" "RI") |
589 | (set_attr "z10prop" "z10_super")]) | |
9db1d521 | 590 | |
07893d4f | 591 | |
08a5aaa2 | 592 | ; |
07893d4f | 593 | ; Load-and-Test instructions |
08a5aaa2 AS |
594 | ; |
595 | ||
c0220ea4 | 596 | ; tst(di|si) instruction pattern(s). |
07893d4f UW |
597 | |
598 | (define_insn "*tstdi_sign" | |
ae156f85 | 599 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
600 | (compare |
601 | (ashiftrt:DI | |
602 | (ashift:DI | |
603 | (subreg:DI (match_operand:SI 0 "nonimmediate_operand" "d,RT") 0) | |
604 | (const_int 32)) (const_int 32)) | |
605 | (match_operand:DI 1 "const0_operand" ""))) | |
606 | (set (match_operand:DI 2 "register_operand" "=d,d") | |
07893d4f | 607 | (sign_extend:DI (match_dup 0)))] |
9602b6a1 | 608 | "s390_match_ccmode(insn, CCSmode) && TARGET_ZARCH" |
963fc8d0 AK |
609 | "ltgfr\t%2,%0 |
610 | ltgf\t%2,%0" | |
611 | [(set_attr "op_type" "RRE,RXY") | |
9381e3f1 WG |
612 | (set_attr "cpu_facility" "*,z10") |
613 | (set_attr "z10prop" "z10_super_E1,z10_super_E1") ]) | |
07893d4f | 614 | |
43a09b63 | 615 | ; ltr, lt, ltgr, ltg |
08a5aaa2 | 616 | (define_insn "*tst<mode>_extimm" |
ec24698e | 617 | [(set (reg CC_REGNUM) |
fb492564 | 618 | (compare (match_operand:GPR 0 "nonimmediate_operand" "d,RT") |
08a5aaa2 AS |
619 | (match_operand:GPR 1 "const0_operand" ""))) |
620 | (set (match_operand:GPR 2 "register_operand" "=d,d") | |
ec24698e | 621 | (match_dup 0))] |
08a5aaa2 | 622 | "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM" |
ec24698e | 623 | "@ |
08a5aaa2 AS |
624 | lt<g>r\t%2,%0 |
625 | lt<g>\t%2,%0" | |
9381e3f1 | 626 | [(set_attr "op_type" "RR<E>,RXY") |
729e750f | 627 | (set_attr "z10prop" "z10_fr_E1,z10_fwd_A3") ]) |
ec24698e | 628 | |
43a09b63 | 629 | ; ltr, lt, ltgr, ltg |
08a5aaa2 | 630 | (define_insn "*tst<mode>_cconly_extimm" |
ec24698e | 631 | [(set (reg CC_REGNUM) |
fb492564 | 632 | (compare (match_operand:GPR 0 "nonimmediate_operand" "d,RT") |
08a5aaa2 AS |
633 | (match_operand:GPR 1 "const0_operand" ""))) |
634 | (clobber (match_scratch:GPR 2 "=X,d"))] | |
635 | "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM" | |
ec24698e | 636 | "@ |
08a5aaa2 AS |
637 | lt<g>r\t%0,%0 |
638 | lt<g>\t%2,%0" | |
9381e3f1 | 639 | [(set_attr "op_type" "RR<E>,RXY") |
729e750f | 640 | (set_attr "z10prop" "z10_fr_E1,z10_fwd_A3")]) |
ec24698e | 641 | |
07893d4f | 642 | (define_insn "*tstdi" |
ae156f85 | 643 | [(set (reg CC_REGNUM) |
07893d4f UW |
644 | (compare (match_operand:DI 0 "register_operand" "d") |
645 | (match_operand:DI 1 "const0_operand" ""))) | |
646 | (set (match_operand:DI 2 "register_operand" "=d") | |
647 | (match_dup 0))] | |
9602b6a1 | 648 | "s390_match_ccmode(insn, CCSmode) && TARGET_ZARCH && !TARGET_EXTIMM" |
d40c829f | 649 | "ltgr\t%2,%0" |
9381e3f1 WG |
650 | [(set_attr "op_type" "RRE") |
651 | (set_attr "z10prop" "z10_fr_E1")]) | |
9db1d521 | 652 | |
07893d4f | 653 | (define_insn "*tstsi" |
ae156f85 | 654 | [(set (reg CC_REGNUM) |
d3632d41 | 655 | (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") |
07893d4f | 656 | (match_operand:SI 1 "const0_operand" ""))) |
d3632d41 | 657 | (set (match_operand:SI 2 "register_operand" "=d,d,d") |
07893d4f | 658 | (match_dup 0))] |
ec24698e | 659 | "s390_match_ccmode(insn, CCSmode) && !TARGET_EXTIMM" |
07893d4f | 660 | "@ |
d40c829f | 661 | ltr\t%2,%0 |
fc0ea003 UW |
662 | icm\t%2,15,%S0 |
663 | icmy\t%2,15,%S0" | |
9381e3f1 WG |
664 | [(set_attr "op_type" "RR,RS,RSY") |
665 | (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 666 | |
07893d4f | 667 | (define_insn "*tstsi_cconly" |
ae156f85 | 668 | [(set (reg CC_REGNUM) |
d3632d41 | 669 | (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") |
07893d4f | 670 | (match_operand:SI 1 "const0_operand" ""))) |
d3632d41 | 671 | (clobber (match_scratch:SI 2 "=X,d,d"))] |
07893d4f UW |
672 | "s390_match_ccmode(insn, CCSmode)" |
673 | "@ | |
d40c829f | 674 | ltr\t%0,%0 |
fc0ea003 UW |
675 | icm\t%2,15,%S0 |
676 | icmy\t%2,15,%S0" | |
9381e3f1 WG |
677 | [(set_attr "op_type" "RR,RS,RSY") |
678 | (set_attr "z10prop" "z10_fr_E1,z10_super_E1,z10_super_E1")]) | |
4023fb28 | 679 | |
08a5aaa2 AS |
680 | (define_insn "*tstdi_cconly_31" |
681 | [(set (reg CC_REGNUM) | |
682 | (compare (match_operand:DI 0 "register_operand" "d") | |
683 | (match_operand:DI 1 "const0_operand" "")))] | |
9602b6a1 | 684 | "s390_match_ccmode(insn, CCSmode) && !TARGET_ZARCH" |
08a5aaa2 AS |
685 | "srda\t%0,0" |
686 | [(set_attr "op_type" "RS") | |
687 | (set_attr "atype" "reg")]) | |
688 | ||
43a09b63 | 689 | ; ltr, ltgr |
08a5aaa2 | 690 | (define_insn "*tst<mode>_cconly2" |
ae156f85 | 691 | [(set (reg CC_REGNUM) |
08a5aaa2 AS |
692 | (compare (match_operand:GPR 0 "register_operand" "d") |
693 | (match_operand:GPR 1 "const0_operand" "")))] | |
07893d4f | 694 | "s390_match_ccmode(insn, CCSmode)" |
08a5aaa2 | 695 | "lt<g>r\t%0,%0" |
9381e3f1 WG |
696 | [(set_attr "op_type" "RR<E>") |
697 | (set_attr "z10prop" "z10_fr_E1")]) | |
08a5aaa2 | 698 | |
c0220ea4 | 699 | ; tst(hi|qi) instruction pattern(s). |
4023fb28 | 700 | |
f52c81dd | 701 | (define_insn "*tst<mode>CCT" |
ae156f85 | 702 | [(set (reg CC_REGNUM) |
f52c81dd AS |
703 | (compare (match_operand:HQI 0 "nonimmediate_operand" "?Q,?S,d") |
704 | (match_operand:HQI 1 "const0_operand" ""))) | |
705 | (set (match_operand:HQI 2 "register_operand" "=d,d,0") | |
3af97654 UW |
706 | (match_dup 0))] |
707 | "s390_match_ccmode(insn, CCTmode)" | |
708 | "@ | |
f52c81dd AS |
709 | icm\t%2,<icm_lo>,%S0 |
710 | icmy\t%2,<icm_lo>,%S0 | |
711 | tml\t%0,<max_uint>" | |
9381e3f1 WG |
712 | [(set_attr "op_type" "RS,RSY,RI") |
713 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")]) | |
3af97654 UW |
714 | |
715 | (define_insn "*tsthiCCT_cconly" | |
ae156f85 | 716 | [(set (reg CC_REGNUM) |
d3632d41 | 717 | (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d") |
3af97654 | 718 | (match_operand:HI 1 "const0_operand" ""))) |
d3632d41 | 719 | (clobber (match_scratch:HI 2 "=d,d,X"))] |
3af97654 UW |
720 | "s390_match_ccmode(insn, CCTmode)" |
721 | "@ | |
fc0ea003 UW |
722 | icm\t%2,3,%S0 |
723 | icmy\t%2,3,%S0 | |
d40c829f | 724 | tml\t%0,65535" |
9381e3f1 WG |
725 | [(set_attr "op_type" "RS,RSY,RI") |
726 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super")]) | |
3af97654 | 727 | |
3af97654 | 728 | (define_insn "*tstqiCCT_cconly" |
ae156f85 | 729 | [(set (reg CC_REGNUM) |
d3632d41 | 730 | (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d") |
3af97654 UW |
731 | (match_operand:QI 1 "const0_operand" "")))] |
732 | "s390_match_ccmode(insn, CCTmode)" | |
733 | "@ | |
fc0ea003 UW |
734 | cli\t%S0,0 |
735 | cliy\t%S0,0 | |
d40c829f | 736 | tml\t%0,255" |
9381e3f1 | 737 | [(set_attr "op_type" "SI,SIY,RI") |
729e750f | 738 | (set_attr "z10prop" "z10_super,z10_super,z10_super")]) |
3af97654 | 739 | |
f52c81dd | 740 | (define_insn "*tst<mode>" |
ae156f85 | 741 | [(set (reg CC_REGNUM) |
f52c81dd AS |
742 | (compare (match_operand:HQI 0 "s_operand" "Q,S") |
743 | (match_operand:HQI 1 "const0_operand" ""))) | |
744 | (set (match_operand:HQI 2 "register_operand" "=d,d") | |
07893d4f UW |
745 | (match_dup 0))] |
746 | "s390_match_ccmode(insn, CCSmode)" | |
d3632d41 | 747 | "@ |
f52c81dd AS |
748 | icm\t%2,<icm_lo>,%S0 |
749 | icmy\t%2,<icm_lo>,%S0" | |
9381e3f1 WG |
750 | [(set_attr "op_type" "RS,RSY") |
751 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
9db1d521 | 752 | |
f52c81dd | 753 | (define_insn "*tst<mode>_cconly" |
ae156f85 | 754 | [(set (reg CC_REGNUM) |
f52c81dd AS |
755 | (compare (match_operand:HQI 0 "s_operand" "Q,S") |
756 | (match_operand:HQI 1 "const0_operand" ""))) | |
757 | (clobber (match_scratch:HQI 2 "=d,d"))] | |
07893d4f | 758 | "s390_match_ccmode(insn, CCSmode)" |
d3632d41 | 759 | "@ |
f52c81dd AS |
760 | icm\t%2,<icm_lo>,%S0 |
761 | icmy\t%2,<icm_lo>,%S0" | |
9381e3f1 WG |
762 | [(set_attr "op_type" "RS,RSY") |
763 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
d3632d41 | 764 | |
9db1d521 | 765 | |
575f7c2b UW |
766 | ; Compare (equality) instructions |
767 | ||
768 | (define_insn "*cmpdi_cct" | |
ae156f85 | 769 | [(set (reg CC_REGNUM) |
ec24698e | 770 | (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,d,Q") |
fb492564 | 771 | (match_operand:DI 1 "general_operand" "d,K,Os,RT,BQ")))] |
9602b6a1 | 772 | "s390_match_ccmode (insn, CCTmode) && TARGET_ZARCH" |
575f7c2b UW |
773 | "@ |
774 | cgr\t%0,%1 | |
f4f41b4e | 775 | cghi\t%0,%h1 |
ec24698e | 776 | cgfi\t%0,%1 |
575f7c2b | 777 | cg\t%0,%1 |
19b63d8e | 778 | #" |
9381e3f1 WG |
779 | [(set_attr "op_type" "RRE,RI,RIL,RXY,SS") |
780 | (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,*")]) | |
575f7c2b UW |
781 | |
782 | (define_insn "*cmpsi_cct" | |
ae156f85 | 783 | [(set (reg CC_REGNUM) |
ec24698e UW |
784 | (compare (match_operand:SI 0 "nonimmediate_operand" "%d,d,d,d,d,Q") |
785 | (match_operand:SI 1 "general_operand" "d,K,Os,R,T,BQ")))] | |
e221ef54 | 786 | "s390_match_ccmode (insn, CCTmode)" |
575f7c2b UW |
787 | "@ |
788 | cr\t%0,%1 | |
f4f41b4e | 789 | chi\t%0,%h1 |
ec24698e | 790 | cfi\t%0,%1 |
575f7c2b UW |
791 | c\t%0,%1 |
792 | cy\t%0,%1 | |
19b63d8e | 793 | #" |
9381e3f1 | 794 | [(set_attr "op_type" "RR,RI,RIL,RX,RXY,SS") |
e3cba5e5 | 795 | (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,*")]) |
575f7c2b | 796 | |
07893d4f | 797 | ; Compare (signed) instructions |
4023fb28 | 798 | |
07893d4f | 799 | (define_insn "*cmpdi_ccs_sign" |
ae156f85 | 800 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
801 | (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" |
802 | "d,RT,b")) | |
803 | (match_operand:DI 0 "register_operand" "d, d,d")))] | |
9602b6a1 | 804 | "s390_match_ccmode(insn, CCSRmode) && TARGET_ZARCH" |
4023fb28 | 805 | "@ |
d40c829f | 806 | cgfr\t%0,%1 |
963fc8d0 AK |
807 | cgf\t%0,%1 |
808 | cgfrl\t%0,%1" | |
809 | [(set_attr "op_type" "RRE,RXY,RIL") | |
9381e3f1 | 810 | (set_attr "z10prop" "z10_c,*,*") |
963fc8d0 | 811 | (set_attr "type" "*,*,larl")]) |
4023fb28 | 812 | |
9381e3f1 WG |
813 | |
814 | ||
07893d4f | 815 | (define_insn "*cmpsi_ccs_sign" |
ae156f85 | 816 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
817 | (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T,b")) |
818 | (match_operand:SI 0 "register_operand" "d,d,d")))] | |
07893d4f | 819 | "s390_match_ccmode(insn, CCSRmode)" |
d3632d41 | 820 | "@ |
d40c829f | 821 | ch\t%0,%1 |
963fc8d0 AK |
822 | chy\t%0,%1 |
823 | chrl\t%0,%1" | |
824 | [(set_attr "op_type" "RX,RXY,RIL") | |
825 | (set_attr "cpu_facility" "*,*,z10") | |
65b1d8ea AK |
826 | (set_attr "type" "*,*,larl") |
827 | (set_attr "z196prop" "z196_cracked,z196_cracked,z196_cracked")]) | |
963fc8d0 AK |
828 | |
829 | (define_insn "*cmphi_ccs_z10" | |
830 | [(set (reg CC_REGNUM) | |
831 | (compare (match_operand:HI 0 "s_operand" "Q") | |
832 | (match_operand:HI 1 "immediate_operand" "K")))] | |
833 | "s390_match_ccmode(insn, CCSmode) && TARGET_Z10" | |
834 | "chhsi\t%0,%1" | |
65b1d8ea AK |
835 | [(set_attr "op_type" "SIL") |
836 | (set_attr "z196prop" "z196_cracked")]) | |
963fc8d0 AK |
837 | |
838 | (define_insn "*cmpdi_ccs_signhi_rl" | |
839 | [(set (reg CC_REGNUM) | |
840 | (compare (sign_extend:DI (match_operand:HI 1 "memory_operand" "RT,b")) | |
841 | (match_operand:GPR 0 "register_operand" "d,d")))] | |
842 | "s390_match_ccmode(insn, CCSRmode) && TARGET_Z10" | |
843 | "@ | |
844 | cgh\t%0,%1 | |
845 | cghrl\t%0,%1" | |
846 | [(set_attr "op_type" "RXY,RIL") | |
847 | (set_attr "type" "*,larl")]) | |
4023fb28 | 848 | |
963fc8d0 | 849 | ; cr, chi, cfi, c, cy, cgr, cghi, cgfi, cg, chsi, cghsi, crl, cgrl |
3298c037 | 850 | (define_insn "*cmp<mode>_ccs" |
ae156f85 | 851 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
852 | (compare (match_operand:GPR 0 "nonimmediate_operand" |
853 | "d,d,Q, d,d,d,d") | |
854 | (match_operand:GPR 1 "general_operand" | |
855 | "d,K,K,Os,R,T,b")))] | |
9db1d521 | 856 | "s390_match_ccmode(insn, CCSmode)" |
07893d4f | 857 | "@ |
3298c037 AK |
858 | c<g>r\t%0,%1 |
859 | c<g>hi\t%0,%h1 | |
963fc8d0 | 860 | c<g>hsi\t%0,%h1 |
3298c037 AK |
861 | c<g>fi\t%0,%1 |
862 | c<g>\t%0,%1 | |
963fc8d0 AK |
863 | c<y>\t%0,%1 |
864 | c<g>rl\t%0,%1" | |
865 | [(set_attr "op_type" "RR<E>,RI,SIL,RIL,RX<Y>,RXY,RIL") | |
866 | (set_attr "cpu_facility" "*,*,z10,extimm,*,*,z10") | |
9381e3f1 WG |
867 | (set_attr "type" "*,*,*,*,*,*,larl") |
868 | (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,z10_super")]) | |
c7453384 | 869 | |
07893d4f UW |
870 | |
871 | ; Compare (unsigned) instructions | |
9db1d521 | 872 | |
963fc8d0 AK |
873 | (define_insn "*cmpsi_ccu_zerohi_rlsi" |
874 | [(set (reg CC_REGNUM) | |
875 | (compare (zero_extend:SI (mem:HI (match_operand:SI 1 | |
876 | "larl_operand" "X"))) | |
877 | (match_operand:SI 0 "register_operand" "d")))] | |
878 | "s390_match_ccmode(insn, CCURmode) && TARGET_Z10" | |
879 | "clhrl\t%0,%1" | |
880 | [(set_attr "op_type" "RIL") | |
729e750f WG |
881 | (set_attr "type" "larl") |
882 | (set_attr "z10prop" "z10_super")]) | |
963fc8d0 AK |
883 | |
884 | ; clhrl, clghrl | |
885 | (define_insn "*cmp<GPR:mode>_ccu_zerohi_rldi" | |
886 | [(set (reg CC_REGNUM) | |
887 | (compare (zero_extend:GPR (mem:HI (match_operand:DI 1 | |
888 | "larl_operand" "X"))) | |
889 | (match_operand:GPR 0 "register_operand" "d")))] | |
890 | "s390_match_ccmode(insn, CCURmode) && TARGET_Z10" | |
891 | "cl<g>hrl\t%0,%1" | |
892 | [(set_attr "op_type" "RIL") | |
9381e3f1 WG |
893 | (set_attr "type" "larl") |
894 | (set_attr "z10prop" "z10_super")]) | |
963fc8d0 | 895 | |
07893d4f | 896 | (define_insn "*cmpdi_ccu_zero" |
ae156f85 | 897 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
898 | (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" |
899 | "d,RT,b")) | |
900 | (match_operand:DI 0 "register_operand" "d, d,d")))] | |
9602b6a1 | 901 | "s390_match_ccmode (insn, CCURmode) && TARGET_ZARCH" |
07893d4f | 902 | "@ |
d40c829f | 903 | clgfr\t%0,%1 |
963fc8d0 AK |
904 | clgf\t%0,%1 |
905 | clgfrl\t%0,%1" | |
906 | [(set_attr "op_type" "RRE,RXY,RIL") | |
907 | (set_attr "cpu_facility" "*,*,z10") | |
9381e3f1 WG |
908 | (set_attr "type" "*,*,larl") |
909 | (set_attr "z10prop" "z10_super_c,z10_super_E1,z10_super")]) | |
9db1d521 | 910 | |
07893d4f | 911 | (define_insn "*cmpdi_ccu" |
ae156f85 | 912 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
913 | (compare (match_operand:DI 0 "nonimmediate_operand" |
914 | "d, d,d,Q, d, Q,BQ") | |
915 | (match_operand:DI 1 "general_operand" | |
916 | "d,Op,b,D,RT,BQ,Q")))] | |
9602b6a1 | 917 | "s390_match_ccmode (insn, CCUmode) && TARGET_ZARCH" |
07893d4f | 918 | "@ |
d40c829f | 919 | clgr\t%0,%1 |
ec24698e | 920 | clgfi\t%0,%1 |
963fc8d0 AK |
921 | clgrl\t%0,%1 |
922 | clghsi\t%0,%x1 | |
575f7c2b | 923 | clg\t%0,%1 |
e221ef54 | 924 | # |
19b63d8e | 925 | #" |
963fc8d0 AK |
926 | [(set_attr "op_type" "RRE,RIL,RIL,SIL,RXY,SS,SS") |
927 | (set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*") | |
9381e3f1 WG |
928 | (set_attr "type" "*,*,larl,*,*,*,*") |
929 | (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,*,*")]) | |
9db1d521 | 930 | |
07893d4f | 931 | (define_insn "*cmpsi_ccu" |
ae156f85 | 932 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
933 | (compare (match_operand:SI 0 "nonimmediate_operand" "d, d,d,Q,d,d, Q,BQ") |
934 | (match_operand:SI 1 "general_operand" "d,Os,b,D,R,T,BQ, Q")))] | |
e221ef54 | 935 | "s390_match_ccmode (insn, CCUmode)" |
07893d4f | 936 | "@ |
d40c829f | 937 | clr\t%0,%1 |
ec24698e | 938 | clfi\t%0,%o1 |
963fc8d0 AK |
939 | clrl\t%0,%1 |
940 | clfhsi\t%0,%x1 | |
d40c829f | 941 | cl\t%0,%1 |
575f7c2b | 942 | cly\t%0,%1 |
e221ef54 | 943 | # |
19b63d8e | 944 | #" |
963fc8d0 AK |
945 | [(set_attr "op_type" "RR,RIL,RIL,SIL,RX,RXY,SS,SS") |
946 | (set_attr "cpu_facility" "*,extimm,z10,z10,*,*,*,*") | |
9381e3f1 WG |
947 | (set_attr "type" "*,*,larl,*,*,*,*,*") |
948 | (set_attr "z10prop" "z10_super_c,z10_super,z10_super,z10_super,z10_super,z10_super,*,*")]) | |
9db1d521 | 949 | |
07893d4f | 950 | (define_insn "*cmphi_ccu" |
ae156f85 | 951 | [(set (reg CC_REGNUM) |
963fc8d0 AK |
952 | (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,Q,BQ") |
953 | (match_operand:HI 1 "general_operand" "Q,S,D,BQ,Q")))] | |
575f7c2b | 954 | "s390_match_ccmode (insn, CCUmode) |
575f7c2b | 955 | && !register_operand (operands[1], HImode)" |
d3632d41 | 956 | "@ |
fc0ea003 UW |
957 | clm\t%0,3,%S1 |
958 | clmy\t%0,3,%S1 | |
963fc8d0 | 959 | clhhsi\t%0,%1 |
e221ef54 | 960 | # |
19b63d8e | 961 | #" |
963fc8d0 | 962 | [(set_attr "op_type" "RS,RSY,SIL,SS,SS") |
9381e3f1 WG |
963 | (set_attr "cpu_facility" "*,*,z10,*,*") |
964 | (set_attr "z10prop" "*,*,z10_super,*,*")]) | |
9db1d521 HP |
965 | |
966 | (define_insn "*cmpqi_ccu" | |
ae156f85 | 967 | [(set (reg CC_REGNUM) |
e221ef54 UW |
968 | (compare (match_operand:QI 0 "nonimmediate_operand" "d,d,Q,S,Q,BQ") |
969 | (match_operand:QI 1 "general_operand" "Q,S,n,n,BQ,Q")))] | |
575f7c2b | 970 | "s390_match_ccmode (insn, CCUmode) |
575f7c2b | 971 | && !register_operand (operands[1], QImode)" |
d3632d41 | 972 | "@ |
fc0ea003 UW |
973 | clm\t%0,1,%S1 |
974 | clmy\t%0,1,%S1 | |
975 | cli\t%S0,%b1 | |
976 | cliy\t%S0,%b1 | |
e221ef54 | 977 | # |
19b63d8e | 978 | #" |
9381e3f1 WG |
979 | [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS") |
980 | (set_attr "z10prop" "*,*,z10_super,z10_super,*,*")]) | |
9db1d521 HP |
981 | |
982 | ||
19b63d8e UW |
983 | ; Block compare (CLC) instruction patterns. |
984 | ||
985 | (define_insn "*clc" | |
ae156f85 | 986 | [(set (reg CC_REGNUM) |
d4f52f0e | 987 | (compare (match_operand:BLK 0 "memory_operand" "Q") |
19b63d8e UW |
988 | (match_operand:BLK 1 "memory_operand" "Q"))) |
989 | (use (match_operand 2 "const_int_operand" "n"))] | |
990 | "s390_match_ccmode (insn, CCUmode) | |
991 | && INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" | |
fc0ea003 | 992 | "clc\t%O0(%2,%R0),%S1" |
b628bd8e | 993 | [(set_attr "op_type" "SS")]) |
19b63d8e UW |
994 | |
995 | (define_split | |
ae156f85 | 996 | [(set (reg CC_REGNUM) |
19b63d8e UW |
997 | (compare (match_operand 0 "memory_operand" "") |
998 | (match_operand 1 "memory_operand" "")))] | |
999 | "reload_completed | |
1000 | && s390_match_ccmode (insn, CCUmode) | |
1001 | && GET_MODE (operands[0]) == GET_MODE (operands[1]) | |
1002 | && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" | |
1003 | [(parallel | |
1004 | [(set (match_dup 0) (match_dup 1)) | |
1005 | (use (match_dup 2))])] | |
1006 | { | |
1007 | operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); | |
1008 | operands[0] = adjust_address (operands[0], BLKmode, 0); | |
1009 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
1010 | ||
1011 | operands[1] = gen_rtx_COMPARE (GET_MODE (SET_DEST (PATTERN (curr_insn))), | |
1012 | operands[0], operands[1]); | |
1013 | operands[0] = SET_DEST (PATTERN (curr_insn)); | |
1014 | }) | |
1015 | ||
1016 | ||
609e7e80 | 1017 | ; (TF|DF|SF|TD|DD|SD) instructions |
9db1d521 | 1018 | |
609e7e80 | 1019 | ; ltxbr, ltdbr, ltebr, ltxtr, ltdtr |
f5905b37 | 1020 | (define_insn "*cmp<mode>_ccs_0" |
ae156f85 | 1021 | [(set (reg CC_REGNUM) |
609e7e80 AK |
1022 | (compare (match_operand:FP 0 "register_operand" "f") |
1023 | (match_operand:FP 1 "const0_operand" "")))] | |
142cd70f | 1024 | "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT" |
609e7e80 | 1025 | "lt<xde><bt>r\t%0,%0" |
077dab3b | 1026 | [(set_attr "op_type" "RRE") |
9381e3f1 | 1027 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 1028 | |
be5de7a1 | 1029 | ; cxtr, cxbr, cdtr, cdbr, cebr, cdb, ceb |
f5905b37 | 1030 | (define_insn "*cmp<mode>_ccs" |
ae156f85 | 1031 | [(set (reg CC_REGNUM) |
609e7e80 AK |
1032 | (compare (match_operand:FP 0 "register_operand" "f,f") |
1033 | (match_operand:FP 1 "general_operand" "f,<Rf>")))] | |
142cd70f | 1034 | "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT" |
9db1d521 | 1035 | "@ |
609e7e80 | 1036 | c<xde><bt>r\t%0,%1 |
f61a2c7d | 1037 | c<xde>b\t%0,%1" |
077dab3b | 1038 | [(set_attr "op_type" "RRE,RXE") |
9381e3f1 | 1039 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 1040 | |
963fc8d0 AK |
1041 | |
1042 | ; Compare and Branch instructions | |
1043 | ||
1044 | ; cij, cgij, crj, cgrj, cfi, cgfi, cr, cgr | |
9381e3f1 WG |
1045 | ; The following instructions do a complementary access of their second |
1046 | ; operand (z01 only): crj_c, cgrjc, cr, cgr | |
963fc8d0 AK |
1047 | (define_insn "*cmp_and_br_signed_<mode>" |
1048 | [(set (pc) | |
1049 | (if_then_else (match_operator 0 "s390_signed_integer_comparison" | |
1050 | [(match_operand:GPR 1 "register_operand" "d,d") | |
1051 | (match_operand:GPR 2 "nonmemory_operand" "d,C")]) | |
1052 | (label_ref (match_operand 3 "" "")) | |
1053 | (pc))) | |
1054 | (clobber (reg:CC CC_REGNUM))] | |
65b1d8ea | 1055 | "TARGET_Z10 && !TARGET_AVOID_CMP_AND_BRANCH" |
963fc8d0 AK |
1056 | { |
1057 | if (get_attr_length (insn) == 6) | |
1058 | return which_alternative ? | |
1059 | "c<g>ij%C0\t%1,%c2,%l3" : "c<g>rj%C0\t%1,%2,%l3"; | |
1060 | else | |
1061 | return which_alternative ? | |
1062 | "c<g>fi\t%1,%c2\;jg%C0\t%l3" : "c<g>r\t%1,%2\;jg%C0\t%l3"; | |
1063 | } | |
1064 | [(set_attr "op_type" "RIE") | |
1065 | (set_attr "type" "branch") | |
e3cba5e5 | 1066 | (set_attr "z10prop" "z10_super_c,z10_super") |
963fc8d0 AK |
1067 | (set (attr "length") |
1068 | (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000)) | |
1069 | (const_int 6) (const_int 12)))]) ; 8 byte for cr/jg | |
1070 | ; 10 byte for cgr/jg | |
1071 | ||
1072 | ; clij, clgij, clrj, clgrj, clfi, clgfi, clr, clgr | |
9381e3f1 WG |
1073 | ; The following instructions do a complementary access of their second |
1074 | ; operand (z10 only): clrj, clgrj, clr, clgr | |
963fc8d0 AK |
1075 | (define_insn "*cmp_and_br_unsigned_<mode>" |
1076 | [(set (pc) | |
1077 | (if_then_else (match_operator 0 "s390_unsigned_integer_comparison" | |
1078 | [(match_operand:GPR 1 "register_operand" "d,d") | |
1079 | (match_operand:GPR 2 "nonmemory_operand" "d,I")]) | |
1080 | (label_ref (match_operand 3 "" "")) | |
1081 | (pc))) | |
1082 | (clobber (reg:CC CC_REGNUM))] | |
65b1d8ea | 1083 | "TARGET_Z10 && !TARGET_AVOID_CMP_AND_BRANCH" |
963fc8d0 AK |
1084 | { |
1085 | if (get_attr_length (insn) == 6) | |
1086 | return which_alternative ? | |
1087 | "cl<g>ij%C0\t%1,%b2,%l3" : "cl<g>rj%C0\t%1,%2,%l3"; | |
1088 | else | |
1089 | return which_alternative ? | |
1090 | "cl<g>fi\t%1,%b2\;jg%C0\t%l3" : "cl<g>r\t%1,%2\;jg%C0\t%l3"; | |
1091 | } | |
1092 | [(set_attr "op_type" "RIE") | |
1093 | (set_attr "type" "branch") | |
e3cba5e5 | 1094 | (set_attr "z10prop" "z10_super_c,z10_super") |
963fc8d0 AK |
1095 | (set (attr "length") |
1096 | (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000)) | |
1097 | (const_int 6) (const_int 12)))]) ; 8 byte for clr/jg | |
1098 | ; 10 byte for clgr/jg | |
1099 | ||
b0f86a7e AK |
1100 | ; And now the same two patterns as above but with a negated CC mask. |
1101 | ||
1102 | ; cij, cgij, crj, cgrj, cfi, cgfi, cr, cgr | |
1103 | ; The following instructions do a complementary access of their second | |
1104 | ; operand (z01 only): crj_c, cgrjc, cr, cgr | |
1105 | (define_insn "*icmp_and_br_signed_<mode>" | |
1106 | [(set (pc) | |
1107 | (if_then_else (match_operator 0 "s390_signed_integer_comparison" | |
1108 | [(match_operand:GPR 1 "register_operand" "d,d") | |
1109 | (match_operand:GPR 2 "nonmemory_operand" "d,C")]) | |
1110 | (pc) | |
1111 | (label_ref (match_operand 3 "" "")))) | |
1112 | (clobber (reg:CC CC_REGNUM))] | |
65b1d8ea | 1113 | "TARGET_Z10 && !TARGET_AVOID_CMP_AND_BRANCH" |
b0f86a7e AK |
1114 | { |
1115 | if (get_attr_length (insn) == 6) | |
1116 | return which_alternative ? | |
1117 | "c<g>ij%D0\t%1,%c2,%l3" : "c<g>rj%D0\t%1,%2,%l3"; | |
1118 | else | |
1119 | return which_alternative ? | |
1120 | "c<g>fi\t%1,%c2\;jg%D0\t%l3" : "c<g>r\t%1,%2\;jg%D0\t%l3"; | |
1121 | } | |
1122 | [(set_attr "op_type" "RIE") | |
1123 | (set_attr "type" "branch") | |
1124 | (set_attr "z10prop" "z10_super_c,z10_super") | |
1125 | (set (attr "length") | |
1126 | (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000)) | |
1127 | (const_int 6) (const_int 12)))]) ; 8 byte for cr/jg | |
1128 | ; 10 byte for cgr/jg | |
1129 | ||
1130 | ; clij, clgij, clrj, clgrj, clfi, clgfi, clr, clgr | |
1131 | ; The following instructions do a complementary access of their second | |
1132 | ; operand (z10 only): clrj, clgrj, clr, clgr | |
1133 | (define_insn "*icmp_and_br_unsigned_<mode>" | |
1134 | [(set (pc) | |
1135 | (if_then_else (match_operator 0 "s390_unsigned_integer_comparison" | |
1136 | [(match_operand:GPR 1 "register_operand" "d,d") | |
1137 | (match_operand:GPR 2 "nonmemory_operand" "d,I")]) | |
1138 | (pc) | |
1139 | (label_ref (match_operand 3 "" "")))) | |
1140 | (clobber (reg:CC CC_REGNUM))] | |
65b1d8ea | 1141 | "TARGET_Z10 && !TARGET_AVOID_CMP_AND_BRANCH" |
b0f86a7e AK |
1142 | { |
1143 | if (get_attr_length (insn) == 6) | |
1144 | return which_alternative ? | |
1145 | "cl<g>ij%D0\t%1,%b2,%l3" : "cl<g>rj%D0\t%1,%2,%l3"; | |
1146 | else | |
1147 | return which_alternative ? | |
1148 | "cl<g>fi\t%1,%b2\;jg%D0\t%l3" : "cl<g>r\t%1,%2\;jg%D0\t%l3"; | |
1149 | } | |
1150 | [(set_attr "op_type" "RIE") | |
1151 | (set_attr "type" "branch") | |
1152 | (set_attr "z10prop" "z10_super_c,z10_super") | |
1153 | (set (attr "length") | |
1154 | (if_then_else (lt (abs (minus (pc) (match_dup 3))) (const_int 60000)) | |
1155 | (const_int 6) (const_int 12)))]) ; 8 byte for clr/jg | |
1156 | ; 10 byte for clgr/jg | |
1157 | ||
9db1d521 HP |
1158 | ;; |
1159 | ;;- Move instructions. | |
1160 | ;; | |
1161 | ||
1162 | ; | |
1163 | ; movti instruction pattern(s). | |
1164 | ; | |
1165 | ||
1166 | (define_insn "movti" | |
f2dc2f86 AK |
1167 | [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o") |
1168 | (match_operand:TI 1 "general_operand" "QS,d,dPRT,d"))] | |
9602b6a1 | 1169 | "TARGET_ZARCH" |
4023fb28 | 1170 | "@ |
fc0ea003 UW |
1171 | lmg\t%0,%N0,%S1 |
1172 | stmg\t%1,%N1,%S0 | |
4023fb28 | 1173 | # |
19b63d8e | 1174 | #" |
f2dc2f86 AK |
1175 | [(set_attr "op_type" "RSY,RSY,*,*") |
1176 | (set_attr "type" "lm,stm,*,*")]) | |
4023fb28 UW |
1177 | |
1178 | (define_split | |
1179 | [(set (match_operand:TI 0 "nonimmediate_operand" "") | |
1180 | (match_operand:TI 1 "general_operand" ""))] | |
9602b6a1 | 1181 | "TARGET_ZARCH && reload_completed |
dc65c307 | 1182 | && s390_split_ok_p (operands[0], operands[1], TImode, 0)" |
4023fb28 UW |
1183 | [(set (match_dup 2) (match_dup 4)) |
1184 | (set (match_dup 3) (match_dup 5))] | |
9db1d521 | 1185 | { |
dc65c307 UW |
1186 | operands[2] = operand_subword (operands[0], 0, 0, TImode); |
1187 | operands[3] = operand_subword (operands[0], 1, 0, TImode); | |
1188 | operands[4] = operand_subword (operands[1], 0, 0, TImode); | |
1189 | operands[5] = operand_subword (operands[1], 1, 0, TImode); | |
1190 | }) | |
1191 | ||
1192 | (define_split | |
1193 | [(set (match_operand:TI 0 "nonimmediate_operand" "") | |
1194 | (match_operand:TI 1 "general_operand" ""))] | |
9602b6a1 | 1195 | "TARGET_ZARCH && reload_completed |
dc65c307 UW |
1196 | && s390_split_ok_p (operands[0], operands[1], TImode, 1)" |
1197 | [(set (match_dup 2) (match_dup 4)) | |
1198 | (set (match_dup 3) (match_dup 5))] | |
1199 | { | |
1200 | operands[2] = operand_subword (operands[0], 1, 0, TImode); | |
1201 | operands[3] = operand_subword (operands[0], 0, 0, TImode); | |
1202 | operands[4] = operand_subword (operands[1], 1, 0, TImode); | |
1203 | operands[5] = operand_subword (operands[1], 0, 0, TImode); | |
1204 | }) | |
4023fb28 UW |
1205 | |
1206 | (define_split | |
1207 | [(set (match_operand:TI 0 "register_operand" "") | |
1208 | (match_operand:TI 1 "memory_operand" ""))] | |
9602b6a1 | 1209 | "TARGET_ZARCH && reload_completed |
4023fb28 | 1210 | && !s_operand (operands[1], VOIDmode)" |
a41c6c53 | 1211 | [(set (match_dup 0) (match_dup 1))] |
a41c6c53 UW |
1212 | { |
1213 | rtx addr = operand_subword (operands[0], 1, 0, TImode); | |
9602b6a1 | 1214 | addr = gen_lowpart (Pmode, addr); |
a41c6c53 UW |
1215 | s390_load_address (addr, XEXP (operands[1], 0)); |
1216 | operands[1] = replace_equiv_address (operands[1], addr); | |
dc65c307 UW |
1217 | }) |
1218 | ||
833cd70a AK |
1219 | |
1220 | ; | |
1221 | ; Patterns used for secondary reloads | |
1222 | ; | |
1223 | ||
963fc8d0 AK |
1224 | ; z10 provides move instructions accepting larl memory operands. |
1225 | ; Unfortunately there is no such variant for QI, TI and FP mode moves. | |
1226 | ; These patterns are also used for unaligned SI and DI accesses. | |
1227 | ||
1228 | (define_expand "reload<INTALL:mode><P:mode>_tomem_z10" | |
1229 | [(parallel [(match_operand:INTALL 0 "memory_operand" "") | |
1230 | (match_operand:INTALL 1 "register_operand" "=d") | |
1231 | (match_operand:P 2 "register_operand" "=&a")])] | |
1232 | "TARGET_Z10" | |
1233 | { | |
1234 | s390_reload_symref_address (operands[1], operands[0], operands[2], 1); | |
1235 | DONE; | |
1236 | }) | |
1237 | ||
1238 | (define_expand "reload<INTALL:mode><P:mode>_toreg_z10" | |
1239 | [(parallel [(match_operand:INTALL 0 "register_operand" "=d") | |
1240 | (match_operand:INTALL 1 "memory_operand" "") | |
1241 | (match_operand:P 2 "register_operand" "=a")])] | |
1242 | "TARGET_Z10" | |
1243 | { | |
1244 | s390_reload_symref_address (operands[0], operands[1], operands[2], 0); | |
1245 | DONE; | |
1246 | }) | |
1247 | ||
1248 | (define_expand "reload<FPALL:mode><P:mode>_tomem_z10" | |
1249 | [(parallel [(match_operand:FPALL 0 "memory_operand" "") | |
1250 | (match_operand:FPALL 1 "register_operand" "=d") | |
1251 | (match_operand:P 2 "register_operand" "=&a")])] | |
1252 | "TARGET_Z10" | |
1253 | { | |
1254 | s390_reload_symref_address (operands[1], operands[0], operands[2], 1); | |
1255 | DONE; | |
1256 | }) | |
1257 | ||
1258 | (define_expand "reload<FPALL:mode><P:mode>_toreg_z10" | |
1259 | [(parallel [(match_operand:FPALL 0 "register_operand" "=d") | |
1260 | (match_operand:FPALL 1 "memory_operand" "") | |
1261 | (match_operand:P 2 "register_operand" "=a")])] | |
1262 | "TARGET_Z10" | |
1263 | { | |
1264 | s390_reload_symref_address (operands[0], operands[1], operands[2], 0); | |
1265 | DONE; | |
1266 | }) | |
1267 | ||
1268 | (define_expand "reload<P:mode>_larl_odd_addend_z10" | |
1269 | [(parallel [(match_operand:P 0 "register_operand" "=d") | |
1270 | (match_operand:P 1 "larl_operand" "") | |
1271 | (match_operand:P 2 "register_operand" "=a")])] | |
1272 | "TARGET_Z10" | |
1273 | { | |
1274 | s390_reload_larl_operand (operands[0], operands[1], operands[2]); | |
1275 | DONE; | |
1276 | }) | |
1277 | ||
833cd70a AK |
1278 | ; Handles loading a PLUS (load address) expression |
1279 | ||
1280 | (define_expand "reload<mode>_plus" | |
1281 | [(parallel [(match_operand:P 0 "register_operand" "=a") | |
1282 | (match_operand:P 1 "s390_plus_operand" "") | |
1283 | (match_operand:P 2 "register_operand" "=&a")])] | |
1284 | "" | |
1285 | { | |
1286 | s390_expand_plus_operand (operands[0], operands[1], operands[2]); | |
1287 | DONE; | |
1288 | }) | |
1289 | ||
1290 | ; Handles assessing a non-offsetable memory address | |
1291 | ||
1292 | (define_expand "reload<mode>_nonoffmem_in" | |
1293 | [(parallel [(match_operand 0 "register_operand" "") | |
1294 | (match_operand 1 "" "") | |
1295 | (match_operand:P 2 "register_operand" "=&a")])] | |
1296 | "" | |
1297 | { | |
1298 | gcc_assert (MEM_P (operands[1])); | |
1299 | s390_load_address (operands[2], find_replacement (&XEXP (operands[1], 0))); | |
1300 | operands[1] = replace_equiv_address (operands[1], operands[2]); | |
1301 | emit_move_insn (operands[0], operands[1]); | |
1302 | DONE; | |
1303 | }) | |
1304 | ||
1305 | (define_expand "reload<mode>_nonoffmem_out" | |
1306 | [(parallel [(match_operand 0 "" "") | |
1307 | (match_operand 1 "register_operand" "") | |
1308 | (match_operand:P 2 "register_operand" "=&a")])] | |
1309 | "" | |
dc65c307 | 1310 | { |
9c3c3dcc | 1311 | gcc_assert (MEM_P (operands[0])); |
9c90a97e | 1312 | s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0))); |
dc65c307 UW |
1313 | operands[0] = replace_equiv_address (operands[0], operands[2]); |
1314 | emit_move_insn (operands[0], operands[1]); | |
1315 | DONE; | |
1316 | }) | |
9db1d521 | 1317 | |
1f9e1fc6 AK |
1318 | (define_expand "reload<mode>_PIC_addr" |
1319 | [(parallel [(match_operand 0 "register_operand" "=d") | |
1320 | (match_operand 1 "larl_operand" "") | |
1321 | (match_operand:P 2 "register_operand" "=a")])] | |
1322 | "" | |
1323 | { | |
0a2aaacc KG |
1324 | rtx new_rtx = legitimize_pic_address (operands[1], operands[2]); |
1325 | emit_move_insn (operands[0], new_rtx); | |
1f9e1fc6 AK |
1326 | }) |
1327 | ||
9db1d521 HP |
1328 | ; |
1329 | ; movdi instruction pattern(s). | |
1330 | ; | |
1331 | ||
9db1d521 HP |
1332 | (define_expand "movdi" |
1333 | [(set (match_operand:DI 0 "general_operand" "") | |
1334 | (match_operand:DI 1 "general_operand" ""))] | |
1335 | "" | |
9db1d521 | 1336 | { |
fd3cd001 | 1337 | /* Handle symbolic constants. */ |
e4f2cd43 AK |
1338 | if (TARGET_64BIT |
1339 | && (SYMBOLIC_CONST (operands[1]) | |
1340 | || (GET_CODE (operands[1]) == PLUS | |
1341 | && XEXP (operands[1], 0) == pic_offset_table_rtx | |
1342 | && SYMBOLIC_CONST (XEXP (operands[1], 1))))) | |
fd3cd001 | 1343 | emit_symbolic_move (operands); |
10bbf137 | 1344 | }) |
9db1d521 | 1345 | |
4023fb28 UW |
1346 | (define_insn "*movdi_larl" |
1347 | [(set (match_operand:DI 0 "register_operand" "=d") | |
1348 | (match_operand:DI 1 "larl_operand" "X"))] | |
1349 | "TARGET_64BIT | |
8e509cf9 | 1350 | && !FP_REG_P (operands[0])" |
d40c829f | 1351 | "larl\t%0,%1" |
4023fb28 | 1352 | [(set_attr "op_type" "RIL") |
9381e3f1 WG |
1353 | (set_attr "type" "larl") |
1354 | (set_attr "z10prop" "z10_super_A1")]) | |
4023fb28 | 1355 | |
3af8e996 | 1356 | (define_insn "*movdi_64" |
85dae55a | 1357 | [(set (match_operand:DI 0 "nonimmediate_operand" |
963fc8d0 | 1358 | "=d,d,d,d,d,d,d,d,f,d,d,d,d,d, |
f2dc2f86 | 1359 | RT,!*f,!*f,!*f,!R,!T,b,Q,d,t,Q,t") |
85dae55a | 1360 | (match_operand:DI 1 "general_operand" |
963fc8d0 | 1361 | "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,b,d,RT, |
f2dc2f86 | 1362 | d,*f,R,T,*f,*f,d,K,t,d,t,Q"))] |
9602b6a1 | 1363 | "TARGET_ZARCH" |
85dae55a AK |
1364 | "@ |
1365 | lghi\t%0,%h1 | |
1366 | llihh\t%0,%i1 | |
1367 | llihl\t%0,%i1 | |
1368 | llilh\t%0,%i1 | |
1369 | llill\t%0,%i1 | |
1370 | lgfi\t%0,%1 | |
1371 | llihf\t%0,%k1 | |
1372 | llilf\t%0,%k1 | |
1373 | ldgr\t%0,%1 | |
1374 | lgdr\t%0,%1 | |
1375 | lay\t%0,%a1 | |
963fc8d0 | 1376 | lgrl\t%0,%1 |
85dae55a AK |
1377 | lgr\t%0,%1 |
1378 | lg\t%0,%1 | |
1379 | stg\t%1,%0 | |
1380 | ldr\t%0,%1 | |
1381 | ld\t%0,%1 | |
1382 | ldy\t%0,%1 | |
1383 | std\t%1,%0 | |
1384 | stdy\t%1,%0 | |
963fc8d0 AK |
1385 | stgrl\t%1,%0 |
1386 | mvghi\t%0,%1 | |
85dae55a AK |
1387 | # |
1388 | # | |
1389 | stam\t%1,%N1,%S0 | |
f2dc2f86 | 1390 | lam\t%0,%N0,%S1" |
963fc8d0 | 1391 | [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RIL,RRE,RXY, |
f2dc2f86 | 1392 | RXY,RR,RX,RXY,RX,RXY,RIL,SIL,*,*,RS,RS") |
963fc8d0 AK |
1393 | (set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,larl,lr,load,store, |
1394 | floaddf,floaddf,floaddf,fstoredf,fstoredf,larl,*,*,*, | |
f2dc2f86 | 1395 | *,*") |
3af8e996 | 1396 | (set_attr "cpu_facility" "*,*,*,*,*,extimm,extimm,extimm,dfp,dfp,longdisp, |
963fc8d0 | 1397 | z10,*,*,*,*,*,longdisp,*,longdisp, |
f2dc2f86 | 1398 | z10,z10,*,*,*,*") |
9381e3f1 WG |
1399 | (set_attr "z10prop" "z10_fwd_A1, |
1400 | z10_fwd_E1, | |
1401 | z10_fwd_E1, | |
1402 | z10_fwd_E1, | |
1403 | z10_fwd_E1, | |
1404 | z10_fwd_A1, | |
1405 | z10_fwd_E1, | |
1406 | z10_fwd_E1, | |
1407 | *, | |
1408 | *, | |
1409 | z10_fwd_A1, | |
1410 | z10_fwd_A3, | |
1411 | z10_fr_E1, | |
1412 | z10_fwd_A3, | |
1413 | z10_rec, | |
1414 | *, | |
1415 | *, | |
1416 | *, | |
1417 | *, | |
1418 | *, | |
1419 | z10_rec, | |
1420 | z10_super, | |
1421 | *, | |
1422 | *, | |
1423 | *, | |
9381e3f1 WG |
1424 | *") |
1425 | ]) | |
c5aa1d12 UW |
1426 | |
1427 | (define_split | |
1428 | [(set (match_operand:DI 0 "register_operand" "") | |
1429 | (match_operand:DI 1 "register_operand" ""))] | |
9602b6a1 | 1430 | "TARGET_ZARCH && ACCESS_REG_P (operands[1])" |
c5aa1d12 UW |
1431 | [(set (match_dup 2) (match_dup 3)) |
1432 | (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 32))) | |
1433 | (set (strict_low_part (match_dup 2)) (match_dup 4))] | |
1434 | "operands[2] = gen_lowpart (SImode, operands[0]); | |
1435 | s390_split_access_reg (operands[1], &operands[4], &operands[3]);") | |
1436 | ||
1437 | (define_split | |
1438 | [(set (match_operand:DI 0 "register_operand" "") | |
1439 | (match_operand:DI 1 "register_operand" ""))] | |
9602b6a1 | 1440 | "TARGET_ZARCH && ACCESS_REG_P (operands[0]) |
c5aa1d12 UW |
1441 | && dead_or_set_p (insn, operands[1])" |
1442 | [(set (match_dup 3) (match_dup 2)) | |
1443 | (set (match_dup 1) (lshiftrt:DI (match_dup 1) (const_int 32))) | |
1444 | (set (match_dup 4) (match_dup 2))] | |
1445 | "operands[2] = gen_lowpart (SImode, operands[1]); | |
1446 | s390_split_access_reg (operands[0], &operands[3], &operands[4]);") | |
1447 | ||
1448 | (define_split | |
1449 | [(set (match_operand:DI 0 "register_operand" "") | |
1450 | (match_operand:DI 1 "register_operand" ""))] | |
9602b6a1 | 1451 | "TARGET_ZARCH && ACCESS_REG_P (operands[0]) |
c5aa1d12 UW |
1452 | && !dead_or_set_p (insn, operands[1])" |
1453 | [(set (match_dup 3) (match_dup 2)) | |
1454 | (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32))) | |
1455 | (set (match_dup 4) (match_dup 2)) | |
1456 | (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32)))] | |
1457 | "operands[2] = gen_lowpart (SImode, operands[1]); | |
1458 | s390_split_access_reg (operands[0], &operands[3], &operands[4]);") | |
9db1d521 HP |
1459 | |
1460 | (define_insn "*movdi_31" | |
963fc8d0 | 1461 | [(set (match_operand:DI 0 "nonimmediate_operand" |
f2dc2f86 | 1462 | "=d,d,Q,S,d ,o,!*f,!*f,!*f,!R,!T,d") |
963fc8d0 | 1463 | (match_operand:DI 1 "general_operand" |
f2dc2f86 | 1464 | " Q,S,d,d,dPRT,d, *f, R, T,*f,*f,b"))] |
9602b6a1 | 1465 | "!TARGET_ZARCH" |
4023fb28 | 1466 | "@ |
fc0ea003 | 1467 | lm\t%0,%N0,%S1 |
c4d50129 | 1468 | lmy\t%0,%N0,%S1 |
fc0ea003 | 1469 | stm\t%1,%N1,%S0 |
c4d50129 | 1470 | stmy\t%1,%N1,%S0 |
4023fb28 UW |
1471 | # |
1472 | # | |
d40c829f UW |
1473 | ldr\t%0,%1 |
1474 | ld\t%0,%1 | |
1475 | ldy\t%0,%1 | |
1476 | std\t%1,%0 | |
1477 | stdy\t%1,%0 | |
19b63d8e | 1478 | #" |
f2dc2f86 AK |
1479 | [(set_attr "op_type" "RS,RSY,RS,RSY,*,*,RR,RX,RXY,RX,RXY,*") |
1480 | (set_attr "type" "lm,lm,stm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*") | |
1481 | (set_attr "cpu_facility" "*,*,*,*,*,*,*,*,*,*,*,z10")]) | |
963fc8d0 AK |
1482 | |
1483 | ; For a load from a symbol ref we can use one of the target registers | |
1484 | ; together with larl to load the address. | |
1485 | (define_split | |
1486 | [(set (match_operand:DI 0 "register_operand" "") | |
1487 | (match_operand:DI 1 "memory_operand" ""))] | |
9602b6a1 | 1488 | "!TARGET_ZARCH && reload_completed && TARGET_Z10 |
963fc8d0 AK |
1489 | && larl_operand (XEXP (operands[1], 0), SImode)" |
1490 | [(set (match_dup 2) (match_dup 3)) | |
1491 | (set (match_dup 0) (match_dup 1))] | |
1492 | { | |
1493 | operands[2] = operand_subword (operands[0], 1, 0, DImode); | |
1494 | operands[3] = XEXP (operands[1], 0); | |
1495 | operands[1] = replace_equiv_address (operands[1], operands[2]); | |
1496 | }) | |
4023fb28 UW |
1497 | |
1498 | (define_split | |
1499 | [(set (match_operand:DI 0 "nonimmediate_operand" "") | |
1500 | (match_operand:DI 1 "general_operand" ""))] | |
9602b6a1 | 1501 | "!TARGET_ZARCH && reload_completed |
dc65c307 | 1502 | && s390_split_ok_p (operands[0], operands[1], DImode, 0)" |
4023fb28 UW |
1503 | [(set (match_dup 2) (match_dup 4)) |
1504 | (set (match_dup 3) (match_dup 5))] | |
9db1d521 | 1505 | { |
dc65c307 UW |
1506 | operands[2] = operand_subword (operands[0], 0, 0, DImode); |
1507 | operands[3] = operand_subword (operands[0], 1, 0, DImode); | |
1508 | operands[4] = operand_subword (operands[1], 0, 0, DImode); | |
1509 | operands[5] = operand_subword (operands[1], 1, 0, DImode); | |
1510 | }) | |
1511 | ||
1512 | (define_split | |
1513 | [(set (match_operand:DI 0 "nonimmediate_operand" "") | |
1514 | (match_operand:DI 1 "general_operand" ""))] | |
9602b6a1 | 1515 | "!TARGET_ZARCH && reload_completed |
dc65c307 UW |
1516 | && s390_split_ok_p (operands[0], operands[1], DImode, 1)" |
1517 | [(set (match_dup 2) (match_dup 4)) | |
1518 | (set (match_dup 3) (match_dup 5))] | |
1519 | { | |
1520 | operands[2] = operand_subword (operands[0], 1, 0, DImode); | |
1521 | operands[3] = operand_subword (operands[0], 0, 0, DImode); | |
1522 | operands[4] = operand_subword (operands[1], 1, 0, DImode); | |
1523 | operands[5] = operand_subword (operands[1], 0, 0, DImode); | |
1524 | }) | |
9db1d521 | 1525 | |
4023fb28 UW |
1526 | (define_split |
1527 | [(set (match_operand:DI 0 "register_operand" "") | |
1528 | (match_operand:DI 1 "memory_operand" ""))] | |
9602b6a1 | 1529 | "!TARGET_ZARCH && reload_completed |
8e509cf9 | 1530 | && !FP_REG_P (operands[0]) |
4023fb28 | 1531 | && !s_operand (operands[1], VOIDmode)" |
a41c6c53 | 1532 | [(set (match_dup 0) (match_dup 1))] |
a41c6c53 UW |
1533 | { |
1534 | rtx addr = operand_subword (operands[0], 1, 0, DImode); | |
1535 | s390_load_address (addr, XEXP (operands[1], 0)); | |
1536 | operands[1] = replace_equiv_address (operands[1], addr); | |
dc65c307 UW |
1537 | }) |
1538 | ||
84817c5d UW |
1539 | (define_peephole2 |
1540 | [(set (match_operand:DI 0 "register_operand" "") | |
1541 | (mem:DI (match_operand 1 "address_operand" "")))] | |
9602b6a1 | 1542 | "TARGET_ZARCH |
84817c5d UW |
1543 | && !FP_REG_P (operands[0]) |
1544 | && GET_CODE (operands[1]) == SYMBOL_REF | |
1545 | && CONSTANT_POOL_ADDRESS_P (operands[1]) | |
1546 | && get_pool_mode (operands[1]) == DImode | |
1547 | && legitimate_reload_constant_p (get_pool_constant (operands[1]))" | |
1548 | [(set (match_dup 0) (match_dup 2))] | |
1549 | "operands[2] = get_pool_constant (operands[1]);") | |
1550 | ||
7bdff56f UW |
1551 | (define_insn "*la_64" |
1552 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
4fe6dea8 | 1553 | (match_operand:QI 1 "address_operand" "ZQZR,ZSZT"))] |
7bdff56f UW |
1554 | "TARGET_64BIT" |
1555 | "@ | |
1556 | la\t%0,%a1 | |
1557 | lay\t%0,%a1" | |
1558 | [(set_attr "op_type" "RX,RXY") | |
9381e3f1 WG |
1559 | (set_attr "type" "la") |
1560 | (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")]) | |
7bdff56f UW |
1561 | |
1562 | (define_peephole2 | |
1563 | [(parallel | |
1564 | [(set (match_operand:DI 0 "register_operand" "") | |
1565 | (match_operand:QI 1 "address_operand" "")) | |
ae156f85 | 1566 | (clobber (reg:CC CC_REGNUM))])] |
7bdff56f | 1567 | "TARGET_64BIT |
e1d5ee28 | 1568 | && preferred_la_operand_p (operands[1], const0_rtx)" |
7bdff56f UW |
1569 | [(set (match_dup 0) (match_dup 1))] |
1570 | "") | |
1571 | ||
1572 | (define_peephole2 | |
1573 | [(set (match_operand:DI 0 "register_operand" "") | |
1574 | (match_operand:DI 1 "register_operand" "")) | |
1575 | (parallel | |
1576 | [(set (match_dup 0) | |
1577 | (plus:DI (match_dup 0) | |
1578 | (match_operand:DI 2 "nonmemory_operand" ""))) | |
ae156f85 | 1579 | (clobber (reg:CC CC_REGNUM))])] |
7bdff56f UW |
1580 | "TARGET_64BIT |
1581 | && !reg_overlap_mentioned_p (operands[0], operands[2]) | |
e1d5ee28 | 1582 | && preferred_la_operand_p (operands[1], operands[2])" |
7bdff56f UW |
1583 | [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))] |
1584 | "") | |
1585 | ||
9db1d521 HP |
1586 | ; |
1587 | ; movsi instruction pattern(s). | |
1588 | ; | |
1589 | ||
9db1d521 HP |
1590 | (define_expand "movsi" |
1591 | [(set (match_operand:SI 0 "general_operand" "") | |
1592 | (match_operand:SI 1 "general_operand" ""))] | |
1593 | "" | |
9db1d521 | 1594 | { |
fd3cd001 | 1595 | /* Handle symbolic constants. */ |
e4f2cd43 AK |
1596 | if (!TARGET_64BIT |
1597 | && (SYMBOLIC_CONST (operands[1]) | |
1598 | || (GET_CODE (operands[1]) == PLUS | |
1599 | && XEXP (operands[1], 0) == pic_offset_table_rtx | |
1600 | && SYMBOLIC_CONST (XEXP(operands[1], 1))))) | |
fd3cd001 | 1601 | emit_symbolic_move (operands); |
10bbf137 | 1602 | }) |
9db1d521 | 1603 | |
9e8327e3 UW |
1604 | (define_insn "*movsi_larl" |
1605 | [(set (match_operand:SI 0 "register_operand" "=d") | |
1606 | (match_operand:SI 1 "larl_operand" "X"))] | |
1607 | "!TARGET_64BIT && TARGET_CPU_ZARCH | |
1608 | && !FP_REG_P (operands[0])" | |
1609 | "larl\t%0,%1" | |
1610 | [(set_attr "op_type" "RIL") | |
9381e3f1 | 1611 | (set_attr "type" "larl") |
729e750f | 1612 | (set_attr "z10prop" "z10_fwd_A1")]) |
9e8327e3 | 1613 | |
f19a9af7 | 1614 | (define_insn "*movsi_zarch" |
2f7e5a0d | 1615 | [(set (match_operand:SI 0 "nonimmediate_operand" |
f2dc2f86 | 1616 | "=d,d,d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,b,Q,t") |
2f7e5a0d | 1617 | (match_operand:SI 1 "general_operand" |
f2dc2f86 | 1618 | "K,N0HS0,N1HS0,Os,L,b,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,d,K,Q"))] |
f19a9af7 | 1619 | "TARGET_ZARCH" |
9db1d521 | 1620 | "@ |
f19a9af7 AK |
1621 | lhi\t%0,%h1 |
1622 | llilh\t%0,%i1 | |
1623 | llill\t%0,%i1 | |
ec24698e | 1624 | iilf\t%0,%o1 |
f19a9af7 | 1625 | lay\t%0,%a1 |
963fc8d0 | 1626 | lrl\t%0,%1 |
d40c829f UW |
1627 | lr\t%0,%1 |
1628 | l\t%0,%1 | |
1629 | ly\t%0,%1 | |
1630 | st\t%1,%0 | |
1631 | sty\t%1,%0 | |
1632 | ler\t%0,%1 | |
1633 | le\t%0,%1 | |
1634 | ley\t%0,%1 | |
1635 | ste\t%1,%0 | |
1636 | stey\t%1,%0 | |
c5aa1d12 UW |
1637 | ear\t%0,%1 |
1638 | sar\t%0,%1 | |
1639 | stam\t%1,%1,%S0 | |
963fc8d0 AK |
1640 | strl\t%1,%0 |
1641 | mvhi\t%0,%1 | |
f2dc2f86 | 1642 | lam\t%0,%0,%S1" |
963fc8d0 | 1643 | [(set_attr "op_type" "RI,RI,RI,RIL,RXY,RIL,RR,RX,RXY,RX,RXY, |
f2dc2f86 | 1644 | RR,RX,RXY,RX,RXY,RRE,RRE,RS,RIL,SIL,RS") |
9381e3f1 WG |
1645 | (set_attr "type" "*, |
1646 | *, | |
1647 | *, | |
1648 | *, | |
1649 | la, | |
1650 | larl, | |
1651 | lr, | |
1652 | load, | |
1653 | load, | |
1654 | store, | |
1655 | store, | |
1656 | floadsf, | |
1657 | floadsf, | |
1658 | floadsf, | |
1659 | fstoresf, | |
1660 | fstoresf, | |
1661 | *, | |
1662 | *, | |
1663 | *, | |
1664 | larl, | |
1665 | *, | |
9381e3f1 | 1666 | *") |
963fc8d0 | 1667 | (set_attr "cpu_facility" "*,*,*,extimm,longdisp,z10,*,*,longdisp,*,longdisp, |
f2dc2f86 | 1668 | *,*,longdisp,*,longdisp,*,*,*,z10,z10,*") |
9381e3f1 WG |
1669 | (set_attr "z10prop" "z10_fwd_A1, |
1670 | z10_fwd_E1, | |
1671 | z10_fwd_E1, | |
1672 | z10_fwd_A1, | |
1673 | z10_fwd_A1, | |
1674 | z10_fwd_A3, | |
1675 | z10_fr_E1, | |
1676 | z10_fwd_A3, | |
1677 | z10_fwd_A3, | |
729e750f | 1678 | z10_rec, |
9381e3f1 WG |
1679 | z10_rec, |
1680 | *, | |
1681 | *, | |
1682 | *, | |
1683 | *, | |
1684 | *, | |
1685 | z10_super_E1, | |
1686 | z10_super, | |
1687 | *, | |
1688 | z10_rec, | |
1689 | z10_super, | |
9381e3f1 | 1690 | *")]) |
f19a9af7 AK |
1691 | |
1692 | (define_insn "*movsi_esa" | |
f2dc2f86 AK |
1693 | [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t") |
1694 | (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q"))] | |
f19a9af7 AK |
1695 | "!TARGET_ZARCH" |
1696 | "@ | |
1697 | lhi\t%0,%h1 | |
1698 | lr\t%0,%1 | |
1699 | l\t%0,%1 | |
1700 | st\t%1,%0 | |
1701 | ler\t%0,%1 | |
1702 | le\t%0,%1 | |
1703 | ste\t%1,%0 | |
c5aa1d12 UW |
1704 | ear\t%0,%1 |
1705 | sar\t%0,%1 | |
1706 | stam\t%1,%1,%S0 | |
f2dc2f86 AK |
1707 | lam\t%0,%0,%S1" |
1708 | [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS") | |
1709 | (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*") | |
9381e3f1 WG |
1710 | (set_attr "z10prop" "z10_fwd_A1, |
1711 | z10_fr_E1, | |
1712 | z10_fwd_A3, | |
729e750f | 1713 | z10_rec, |
9381e3f1 WG |
1714 | *, |
1715 | *, | |
1716 | *, | |
1717 | z10_super_E1, | |
1718 | z10_super, | |
1719 | *, | |
9381e3f1 WG |
1720 | *") |
1721 | ]) | |
9db1d521 | 1722 | |
84817c5d UW |
1723 | (define_peephole2 |
1724 | [(set (match_operand:SI 0 "register_operand" "") | |
1725 | (mem:SI (match_operand 1 "address_operand" "")))] | |
1726 | "!FP_REG_P (operands[0]) | |
1727 | && GET_CODE (operands[1]) == SYMBOL_REF | |
1728 | && CONSTANT_POOL_ADDRESS_P (operands[1]) | |
1729 | && get_pool_mode (operands[1]) == SImode | |
1730 | && legitimate_reload_constant_p (get_pool_constant (operands[1]))" | |
1731 | [(set (match_dup 0) (match_dup 2))] | |
1732 | "operands[2] = get_pool_constant (operands[1]);") | |
9db1d521 | 1733 | |
7bdff56f UW |
1734 | (define_insn "*la_31" |
1735 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
4fe6dea8 | 1736 | (match_operand:QI 1 "address_operand" "ZQZR,ZSZT"))] |
7bdff56f UW |
1737 | "!TARGET_64BIT && legitimate_la_operand_p (operands[1])" |
1738 | "@ | |
1739 | la\t%0,%a1 | |
1740 | lay\t%0,%a1" | |
1741 | [(set_attr "op_type" "RX,RXY") | |
9381e3f1 WG |
1742 | (set_attr "type" "la") |
1743 | (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")]) | |
7bdff56f UW |
1744 | |
1745 | (define_peephole2 | |
1746 | [(parallel | |
1747 | [(set (match_operand:SI 0 "register_operand" "") | |
1748 | (match_operand:QI 1 "address_operand" "")) | |
ae156f85 | 1749 | (clobber (reg:CC CC_REGNUM))])] |
7bdff56f | 1750 | "!TARGET_64BIT |
e1d5ee28 | 1751 | && preferred_la_operand_p (operands[1], const0_rtx)" |
7bdff56f UW |
1752 | [(set (match_dup 0) (match_dup 1))] |
1753 | "") | |
1754 | ||
1755 | (define_peephole2 | |
1756 | [(set (match_operand:SI 0 "register_operand" "") | |
1757 | (match_operand:SI 1 "register_operand" "")) | |
1758 | (parallel | |
1759 | [(set (match_dup 0) | |
1760 | (plus:SI (match_dup 0) | |
1761 | (match_operand:SI 2 "nonmemory_operand" ""))) | |
ae156f85 | 1762 | (clobber (reg:CC CC_REGNUM))])] |
7bdff56f UW |
1763 | "!TARGET_64BIT |
1764 | && !reg_overlap_mentioned_p (operands[0], operands[2]) | |
e1d5ee28 | 1765 | && preferred_la_operand_p (operands[1], operands[2])" |
7bdff56f UW |
1766 | [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))] |
1767 | "") | |
1768 | ||
1769 | (define_insn "*la_31_and" | |
1770 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
4fe6dea8 | 1771 | (and:SI (match_operand:QI 1 "address_operand" "ZQZR,ZSZT") |
7bdff56f UW |
1772 | (const_int 2147483647)))] |
1773 | "!TARGET_64BIT" | |
1774 | "@ | |
1775 | la\t%0,%a1 | |
1776 | lay\t%0,%a1" | |
1777 | [(set_attr "op_type" "RX,RXY") | |
9381e3f1 WG |
1778 | (set_attr "type" "la") |
1779 | (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")]) | |
7bdff56f UW |
1780 | |
1781 | (define_insn_and_split "*la_31_and_cc" | |
1782 | [(set (match_operand:SI 0 "register_operand" "=d") | |
1783 | (and:SI (match_operand:QI 1 "address_operand" "p") | |
1784 | (const_int 2147483647))) | |
ae156f85 | 1785 | (clobber (reg:CC CC_REGNUM))] |
7bdff56f UW |
1786 | "!TARGET_64BIT" |
1787 | "#" | |
1788 | "&& reload_completed" | |
1789 | [(set (match_dup 0) | |
1790 | (and:SI (match_dup 1) (const_int 2147483647)))] | |
1791 | "" | |
1792 | [(set_attr "op_type" "RX") | |
1793 | (set_attr "type" "la")]) | |
1794 | ||
1795 | (define_insn "force_la_31" | |
1796 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
4fe6dea8 | 1797 | (match_operand:QI 1 "address_operand" "ZQZR,ZSZT")) |
7bdff56f UW |
1798 | (use (const_int 0))] |
1799 | "!TARGET_64BIT" | |
1800 | "@ | |
1801 | la\t%0,%a1 | |
1802 | lay\t%0,%a1" | |
1803 | [(set_attr "op_type" "RX") | |
9381e3f1 WG |
1804 | (set_attr "type" "la") |
1805 | (set_attr "z10prop" "z10_fwd_A1,z10_fwd_A1")]) | |
7bdff56f | 1806 | |
9db1d521 HP |
1807 | ; |
1808 | ; movhi instruction pattern(s). | |
1809 | ; | |
1810 | ||
02ed3c5e UW |
1811 | (define_expand "movhi" |
1812 | [(set (match_operand:HI 0 "nonimmediate_operand" "") | |
1813 | (match_operand:HI 1 "general_operand" ""))] | |
1814 | "" | |
1815 | { | |
2f7e5a0d | 1816 | /* Make it explicit that loading a register from memory |
02ed3c5e | 1817 | always sign-extends (at least) to SImode. */ |
b3a13419 | 1818 | if (optimize && can_create_pseudo_p () |
02ed3c5e | 1819 | && register_operand (operands[0], VOIDmode) |
8fff4fc1 | 1820 | && GET_CODE (operands[1]) == MEM) |
02ed3c5e UW |
1821 | { |
1822 | rtx tmp = gen_reg_rtx (SImode); | |
1823 | rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]); | |
1824 | emit_insn (gen_rtx_SET (VOIDmode, tmp, ext)); | |
1825 | operands[1] = gen_lowpart (HImode, tmp); | |
1826 | } | |
1827 | }) | |
1828 | ||
1829 | (define_insn "*movhi" | |
f2dc2f86 AK |
1830 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,d,R,T,b,Q") |
1831 | (match_operand:HI 1 "general_operand" " d,n,R,T,b,d,d,d,K"))] | |
9db1d521 HP |
1832 | "" |
1833 | "@ | |
d40c829f UW |
1834 | lr\t%0,%1 |
1835 | lhi\t%0,%h1 | |
1836 | lh\t%0,%1 | |
1837 | lhy\t%0,%1 | |
963fc8d0 | 1838 | lhrl\t%0,%1 |
d40c829f UW |
1839 | sth\t%1,%0 |
1840 | sthy\t%1,%0 | |
963fc8d0 | 1841 | sthrl\t%1,%0 |
f2dc2f86 AK |
1842 | mvhhi\t%0,%1" |
1843 | [(set_attr "op_type" "RR,RI,RX,RXY,RIL,RX,RXY,RIL,SIL") | |
1844 | (set_attr "type" "lr,*,*,*,larl,store,store,store,*") | |
1845 | (set_attr "cpu_facility" "*,*,*,*,z10,*,*,z10,z10") | |
9381e3f1 WG |
1846 | (set_attr "z10prop" "z10_fr_E1, |
1847 | z10_fwd_A1, | |
1848 | z10_super_E1, | |
1849 | z10_super_E1, | |
1850 | z10_super_E1, | |
729e750f | 1851 | z10_rec, |
9381e3f1 WG |
1852 | z10_rec, |
1853 | z10_rec, | |
f2dc2f86 | 1854 | z10_super")]) |
9db1d521 | 1855 | |
84817c5d UW |
1856 | (define_peephole2 |
1857 | [(set (match_operand:HI 0 "register_operand" "") | |
1858 | (mem:HI (match_operand 1 "address_operand" "")))] | |
1859 | "GET_CODE (operands[1]) == SYMBOL_REF | |
1860 | && CONSTANT_POOL_ADDRESS_P (operands[1]) | |
1861 | && get_pool_mode (operands[1]) == HImode | |
1862 | && GET_CODE (get_pool_constant (operands[1])) == CONST_INT" | |
1863 | [(set (match_dup 0) (match_dup 2))] | |
1864 | "operands[2] = get_pool_constant (operands[1]);") | |
4023fb28 | 1865 | |
9db1d521 HP |
1866 | ; |
1867 | ; movqi instruction pattern(s). | |
1868 | ; | |
1869 | ||
02ed3c5e UW |
1870 | (define_expand "movqi" |
1871 | [(set (match_operand:QI 0 "nonimmediate_operand" "") | |
1872 | (match_operand:QI 1 "general_operand" ""))] | |
1873 | "" | |
1874 | { | |
c19ec8f9 | 1875 | /* On z/Architecture, zero-extending from memory to register |
02ed3c5e | 1876 | is just as fast as a QImode load. */ |
b3a13419 | 1877 | if (TARGET_ZARCH && optimize && can_create_pseudo_p () |
02ed3c5e | 1878 | && register_operand (operands[0], VOIDmode) |
8fff4fc1 | 1879 | && GET_CODE (operands[1]) == MEM) |
02ed3c5e | 1880 | { |
9602b6a1 AK |
1881 | rtx tmp = gen_reg_rtx (DImode); |
1882 | rtx ext = gen_rtx_ZERO_EXTEND (DImode, operands[1]); | |
02ed3c5e UW |
1883 | emit_insn (gen_rtx_SET (VOIDmode, tmp, ext)); |
1884 | operands[1] = gen_lowpart (QImode, tmp); | |
1885 | } | |
1886 | }) | |
4023fb28 | 1887 | |
02ed3c5e | 1888 | (define_insn "*movqi" |
0a88561f AK |
1889 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q") |
1890 | (match_operand:QI 1 "general_operand" " d,n,R,T,d,d,n,n,?Q"))] | |
9db1d521 HP |
1891 | "" |
1892 | "@ | |
d40c829f UW |
1893 | lr\t%0,%1 |
1894 | lhi\t%0,%b1 | |
1895 | ic\t%0,%1 | |
1896 | icy\t%0,%1 | |
1897 | stc\t%1,%0 | |
1898 | stcy\t%1,%0 | |
fc0ea003 | 1899 | mvi\t%S0,%b1 |
0a88561f | 1900 | mviy\t%S0,%b1 |
b247e88a | 1901 | #" |
0a88561f AK |
1902 | [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS") |
1903 | (set_attr "type" "lr,*,*,*,store,store,store,store,*") | |
9381e3f1 WG |
1904 | (set_attr "z10prop" "z10_fr_E1, |
1905 | z10_fwd_A1, | |
1906 | z10_super_E1, | |
1907 | z10_super_E1, | |
729e750f | 1908 | z10_rec, |
9381e3f1 WG |
1909 | z10_rec, |
1910 | z10_super, | |
0a88561f AK |
1911 | z10_super, |
1912 | *")]) | |
9db1d521 | 1913 | |
84817c5d UW |
1914 | (define_peephole2 |
1915 | [(set (match_operand:QI 0 "nonimmediate_operand" "") | |
1916 | (mem:QI (match_operand 1 "address_operand" "")))] | |
1917 | "GET_CODE (operands[1]) == SYMBOL_REF | |
1918 | && CONSTANT_POOL_ADDRESS_P (operands[1]) | |
1919 | && get_pool_mode (operands[1]) == QImode | |
1920 | && GET_CODE (get_pool_constant (operands[1])) == CONST_INT" | |
1921 | [(set (match_dup 0) (match_dup 2))] | |
1922 | "operands[2] = get_pool_constant (operands[1]);") | |
4023fb28 | 1923 | |
9db1d521 | 1924 | ; |
05b9aaaa | 1925 | ; movstrictqi instruction pattern(s). |
9db1d521 HP |
1926 | ; |
1927 | ||
1928 | (define_insn "*movstrictqi" | |
d3632d41 UW |
1929 | [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d")) |
1930 | (match_operand:QI 1 "memory_operand" "R,T"))] | |
9db1d521 | 1931 | "" |
d3632d41 | 1932 | "@ |
d40c829f UW |
1933 | ic\t%0,%1 |
1934 | icy\t%0,%1" | |
9381e3f1 | 1935 | [(set_attr "op_type" "RX,RXY") |
729e750f | 1936 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) |
9db1d521 HP |
1937 | |
1938 | ; | |
1939 | ; movstricthi instruction pattern(s). | |
1940 | ; | |
1941 | ||
1942 | (define_insn "*movstricthi" | |
d3632d41 | 1943 | [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d")) |
575f7c2b | 1944 | (match_operand:HI 1 "memory_operand" "Q,S")) |
ae156f85 | 1945 | (clobber (reg:CC CC_REGNUM))] |
9db1d521 | 1946 | "" |
d3632d41 | 1947 | "@ |
fc0ea003 UW |
1948 | icm\t%0,3,%S1 |
1949 | icmy\t%0,3,%S1" | |
9381e3f1 WG |
1950 | [(set_attr "op_type" "RS,RSY") |
1951 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
9db1d521 HP |
1952 | |
1953 | ; | |
1954 | ; movstrictsi instruction pattern(s). | |
1955 | ; | |
1956 | ||
05b9aaaa | 1957 | (define_insn "movstrictsi" |
c5aa1d12 UW |
1958 | [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d,d")) |
1959 | (match_operand:SI 1 "general_operand" "d,R,T,t"))] | |
9602b6a1 | 1960 | "TARGET_ZARCH" |
9db1d521 | 1961 | "@ |
d40c829f UW |
1962 | lr\t%0,%1 |
1963 | l\t%0,%1 | |
c5aa1d12 UW |
1964 | ly\t%0,%1 |
1965 | ear\t%0,%1" | |
1966 | [(set_attr "op_type" "RR,RX,RXY,RRE") | |
9381e3f1 WG |
1967 | (set_attr "type" "lr,load,load,*") |
1968 | (set_attr "z10prop" "z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_super_E1")]) | |
9db1d521 | 1969 | |
f61a2c7d | 1970 | ; |
609e7e80 | 1971 | ; mov(tf|td) instruction pattern(s). |
f61a2c7d AK |
1972 | ; |
1973 | ||
609e7e80 AK |
1974 | (define_expand "mov<mode>" |
1975 | [(set (match_operand:TD_TF 0 "nonimmediate_operand" "") | |
1976 | (match_operand:TD_TF 1 "general_operand" ""))] | |
f61a2c7d AK |
1977 | "" |
1978 | "") | |
1979 | ||
609e7e80 | 1980 | (define_insn "*mov<mode>_64" |
65b1d8ea AK |
1981 | [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o, d,QS, d,o") |
1982 | (match_operand:TD_TF 1 "general_operand" " G,f,o,f,QS, d,dRT,d"))] | |
9602b6a1 | 1983 | "TARGET_ZARCH" |
f61a2c7d | 1984 | "@ |
65b1d8ea | 1985 | lzxr\t%0 |
f61a2c7d AK |
1986 | lxr\t%0,%1 |
1987 | # | |
1988 | # | |
1989 | lmg\t%0,%N0,%S1 | |
1990 | stmg\t%1,%N1,%S0 | |
1991 | # | |
f61a2c7d | 1992 | #" |
65b1d8ea AK |
1993 | [(set_attr "op_type" "RRE,RRE,*,*,RSY,RSY,*,*") |
1994 | (set_attr "type" "fsimptf,fsimptf,*,*,lm,stm,*,*") | |
1995 | (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*")]) | |
f61a2c7d | 1996 | |
609e7e80 | 1997 | (define_insn "*mov<mode>_31" |
65b1d8ea AK |
1998 | [(set (match_operand:TD_TF 0 "nonimmediate_operand" "=f,f,f,o") |
1999 | (match_operand:TD_TF 1 "general_operand" " G,f,o,f"))] | |
9602b6a1 | 2000 | "!TARGET_ZARCH" |
f61a2c7d | 2001 | "@ |
65b1d8ea | 2002 | lzxr\t%0 |
f61a2c7d AK |
2003 | lxr\t%0,%1 |
2004 | # | |
f61a2c7d | 2005 | #" |
65b1d8ea AK |
2006 | [(set_attr "op_type" "RRE,RRE,*,*") |
2007 | (set_attr "type" "fsimptf,fsimptf,*,*") | |
2008 | (set_attr "cpu_facility" "z196,*,*,*")]) | |
f61a2c7d AK |
2009 | |
2010 | ; TFmode in GPRs splitters | |
2011 | ||
2012 | (define_split | |
609e7e80 AK |
2013 | [(set (match_operand:TD_TF 0 "nonimmediate_operand" "") |
2014 | (match_operand:TD_TF 1 "general_operand" ""))] | |
9602b6a1 | 2015 | "TARGET_ZARCH && reload_completed |
609e7e80 | 2016 | && s390_split_ok_p (operands[0], operands[1], <MODE>mode, 0)" |
f61a2c7d AK |
2017 | [(set (match_dup 2) (match_dup 4)) |
2018 | (set (match_dup 3) (match_dup 5))] | |
2019 | { | |
609e7e80 AK |
2020 | operands[2] = operand_subword (operands[0], 0, 0, <MODE>mode); |
2021 | operands[3] = operand_subword (operands[0], 1, 0, <MODE>mode); | |
2022 | operands[4] = operand_subword (operands[1], 0, 0, <MODE>mode); | |
2023 | operands[5] = operand_subword (operands[1], 1, 0, <MODE>mode); | |
f61a2c7d AK |
2024 | }) |
2025 | ||
2026 | (define_split | |
609e7e80 AK |
2027 | [(set (match_operand:TD_TF 0 "nonimmediate_operand" "") |
2028 | (match_operand:TD_TF 1 "general_operand" ""))] | |
9602b6a1 | 2029 | "TARGET_ZARCH && reload_completed |
609e7e80 | 2030 | && s390_split_ok_p (operands[0], operands[1], <MODE>mode, 1)" |
f61a2c7d AK |
2031 | [(set (match_dup 2) (match_dup 4)) |
2032 | (set (match_dup 3) (match_dup 5))] | |
2033 | { | |
609e7e80 AK |
2034 | operands[2] = operand_subword (operands[0], 1, 0, <MODE>mode); |
2035 | operands[3] = operand_subword (operands[0], 0, 0, <MODE>mode); | |
2036 | operands[4] = operand_subword (operands[1], 1, 0, <MODE>mode); | |
2037 | operands[5] = operand_subword (operands[1], 0, 0, <MODE>mode); | |
f61a2c7d AK |
2038 | }) |
2039 | ||
2040 | (define_split | |
609e7e80 AK |
2041 | [(set (match_operand:TD_TF 0 "register_operand" "") |
2042 | (match_operand:TD_TF 1 "memory_operand" ""))] | |
9602b6a1 | 2043 | "TARGET_ZARCH && reload_completed |
f61a2c7d AK |
2044 | && !FP_REG_P (operands[0]) |
2045 | && !s_operand (operands[1], VOIDmode)" | |
2046 | [(set (match_dup 0) (match_dup 1))] | |
2047 | { | |
609e7e80 | 2048 | rtx addr = operand_subword (operands[0], 1, 0, <MODE>mode); |
a9e6994a | 2049 | addr = gen_lowpart (Pmode, addr); |
f61a2c7d AK |
2050 | s390_load_address (addr, XEXP (operands[1], 0)); |
2051 | operands[1] = replace_equiv_address (operands[1], addr); | |
2052 | }) | |
2053 | ||
7b6baae1 | 2054 | ; TFmode in BFPs splitters |
f61a2c7d AK |
2055 | |
2056 | (define_split | |
609e7e80 AK |
2057 | [(set (match_operand:TD_TF 0 "register_operand" "") |
2058 | (match_operand:TD_TF 1 "memory_operand" ""))] | |
9381e3f1 | 2059 | "reload_completed && offsettable_memref_p (operands[1]) |
f61a2c7d AK |
2060 | && FP_REG_P (operands[0])" |
2061 | [(set (match_dup 2) (match_dup 4)) | |
2062 | (set (match_dup 3) (match_dup 5))] | |
2063 | { | |
609e7e80 AK |
2064 | operands[2] = simplify_gen_subreg (<HALF_TMODE>mode, operands[0], |
2065 | <MODE>mode, 0); | |
2066 | operands[3] = simplify_gen_subreg (<HALF_TMODE>mode, operands[0], | |
2067 | <MODE>mode, 8); | |
2068 | operands[4] = adjust_address_nv (operands[1], <HALF_TMODE>mode, 0); | |
2069 | operands[5] = adjust_address_nv (operands[1], <HALF_TMODE>mode, 8); | |
f61a2c7d AK |
2070 | }) |
2071 | ||
2072 | (define_split | |
609e7e80 AK |
2073 | [(set (match_operand:TD_TF 0 "memory_operand" "") |
2074 | (match_operand:TD_TF 1 "register_operand" ""))] | |
f61a2c7d AK |
2075 | "reload_completed && offsettable_memref_p (operands[0]) |
2076 | && FP_REG_P (operands[1])" | |
2077 | [(set (match_dup 2) (match_dup 4)) | |
2078 | (set (match_dup 3) (match_dup 5))] | |
2079 | { | |
609e7e80 AK |
2080 | operands[2] = adjust_address_nv (operands[0], <HALF_TMODE>mode, 0); |
2081 | operands[3] = adjust_address_nv (operands[0], <HALF_TMODE>mode, 8); | |
2082 | operands[4] = simplify_gen_subreg (<HALF_TMODE>mode, operands[1], | |
2083 | <MODE>mode, 0); | |
2084 | operands[5] = simplify_gen_subreg (<HALF_TMODE>mode, operands[1], | |
2085 | <MODE>mode, 8); | |
f61a2c7d AK |
2086 | }) |
2087 | ||
9db1d521 | 2088 | ; |
609e7e80 | 2089 | ; mov(df|dd) instruction pattern(s). |
9db1d521 HP |
2090 | ; |
2091 | ||
609e7e80 AK |
2092 | (define_expand "mov<mode>" |
2093 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" "") | |
2094 | (match_operand:DD_DF 1 "general_operand" ""))] | |
9db1d521 | 2095 | "" |
13c025c1 | 2096 | "") |
9db1d521 | 2097 | |
609e7e80 AK |
2098 | (define_insn "*mov<mode>_64dfp" |
2099 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" | |
65b1d8ea | 2100 | "=f,f,f,d,f,f,R,T,d,d, d,RT") |
609e7e80 | 2101 | (match_operand:DD_DF 1 "general_operand" |
65b1d8ea | 2102 | " G,f,d,f,R,T,f,f,G,d,RT, d"))] |
9602b6a1 | 2103 | "TARGET_DFP" |
85dae55a | 2104 | "@ |
65b1d8ea | 2105 | lzdr\t%0 |
85dae55a AK |
2106 | ldr\t%0,%1 |
2107 | ldgr\t%0,%1 | |
2108 | lgdr\t%0,%1 | |
2109 | ld\t%0,%1 | |
2110 | ldy\t%0,%1 | |
2111 | std\t%1,%0 | |
2112 | stdy\t%1,%0 | |
45e5214c | 2113 | lghi\t%0,0 |
85dae55a AK |
2114 | lgr\t%0,%1 |
2115 | lg\t%0,%1 | |
f2dc2f86 | 2116 | stg\t%1,%0" |
65b1d8ea AK |
2117 | [(set_attr "op_type" "RRE,RR,RRE,RRE,RX,RXY,RX,RXY,RI,RRE,RXY,RXY") |
2118 | (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,floaddf,floaddf, | |
45e5214c | 2119 | fstoredf,fstoredf,*,lr,load,store") |
65b1d8ea AK |
2120 | (set_attr "z10prop" "*,*,*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fwd_A3,z10_rec") |
2121 | (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,*,*,*,*")]) | |
85dae55a | 2122 | |
609e7e80 | 2123 | (define_insn "*mov<mode>_64" |
65b1d8ea AK |
2124 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d, d,RT") |
2125 | (match_operand:DD_DF 1 "general_operand" " G,f,R,T,f,f,G,d,RT, d"))] | |
9602b6a1 | 2126 | "TARGET_ZARCH" |
9db1d521 | 2127 | "@ |
65b1d8ea | 2128 | lzdr\t%0 |
d40c829f UW |
2129 | ldr\t%0,%1 |
2130 | ld\t%0,%1 | |
2131 | ldy\t%0,%1 | |
2132 | std\t%1,%0 | |
2133 | stdy\t%1,%0 | |
45e5214c | 2134 | lghi\t%0,0 |
d40c829f UW |
2135 | lgr\t%0,%1 |
2136 | lg\t%0,%1 | |
f2dc2f86 | 2137 | stg\t%1,%0" |
65b1d8ea AK |
2138 | [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RI,RRE,RXY,RXY") |
2139 | (set_attr "type" "fsimpdf,fload<mode>,fload<mode>,fload<mode>, | |
2140 | fstore<mode>,fstore<mode>,*,lr,load,store") | |
2141 | (set_attr "z10prop" "*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fwd_A3,z10_rec") | |
2142 | (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,*,*")]) | |
609e7e80 AK |
2143 | |
2144 | (define_insn "*mov<mode>_31" | |
2145 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" | |
65b1d8ea | 2146 | "=f,f,f,f,R,T,d,d,Q,S, d,o") |
609e7e80 | 2147 | (match_operand:DD_DF 1 "general_operand" |
65b1d8ea | 2148 | " G,f,R,T,f,f,Q,S,d,d,dPRT,d"))] |
9602b6a1 | 2149 | "!TARGET_ZARCH" |
9db1d521 | 2150 | "@ |
65b1d8ea | 2151 | lzdr\t%0 |
d40c829f UW |
2152 | ldr\t%0,%1 |
2153 | ld\t%0,%1 | |
2154 | ldy\t%0,%1 | |
2155 | std\t%1,%0 | |
2156 | stdy\t%1,%0 | |
fc0ea003 | 2157 | lm\t%0,%N0,%S1 |
c4d50129 | 2158 | lmy\t%0,%N0,%S1 |
fc0ea003 | 2159 | stm\t%1,%N1,%S0 |
c4d50129 | 2160 | stmy\t%1,%N1,%S0 |
4023fb28 | 2161 | # |
19b63d8e | 2162 | #" |
65b1d8ea AK |
2163 | [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*") |
2164 | (set_attr "type" "fsimpdf,fload<mode>,fload<mode>,fload<mode>, | |
2165 | fstore<mode>,fstore<mode>,lm,lm,stm,stm,*,*") | |
2166 | (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,*,*,*,*")]) | |
4023fb28 UW |
2167 | |
2168 | (define_split | |
609e7e80 AK |
2169 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" "") |
2170 | (match_operand:DD_DF 1 "general_operand" ""))] | |
9602b6a1 | 2171 | "!TARGET_ZARCH && reload_completed |
609e7e80 | 2172 | && s390_split_ok_p (operands[0], operands[1], <MODE>mode, 0)" |
4023fb28 UW |
2173 | [(set (match_dup 2) (match_dup 4)) |
2174 | (set (match_dup 3) (match_dup 5))] | |
9db1d521 | 2175 | { |
609e7e80 AK |
2176 | operands[2] = operand_subword (operands[0], 0, 0, <MODE>mode); |
2177 | operands[3] = operand_subword (operands[0], 1, 0, <MODE>mode); | |
2178 | operands[4] = operand_subword (operands[1], 0, 0, <MODE>mode); | |
2179 | operands[5] = operand_subword (operands[1], 1, 0, <MODE>mode); | |
dc65c307 UW |
2180 | }) |
2181 | ||
2182 | (define_split | |
609e7e80 AK |
2183 | [(set (match_operand:DD_DF 0 "nonimmediate_operand" "") |
2184 | (match_operand:DD_DF 1 "general_operand" ""))] | |
9602b6a1 | 2185 | "!TARGET_ZARCH && reload_completed |
609e7e80 | 2186 | && s390_split_ok_p (operands[0], operands[1], <MODE>mode, 1)" |
dc65c307 UW |
2187 | [(set (match_dup 2) (match_dup 4)) |
2188 | (set (match_dup 3) (match_dup 5))] | |
2189 | { | |
609e7e80 AK |
2190 | operands[2] = operand_subword (operands[0], 1, 0, <MODE>mode); |
2191 | operands[3] = operand_subword (operands[0], 0, 0, <MODE>mode); | |
2192 | operands[4] = operand_subword (operands[1], 1, 0, <MODE>mode); | |
2193 | operands[5] = operand_subword (operands[1], 0, 0, <MODE>mode); | |
dc65c307 | 2194 | }) |
9db1d521 | 2195 | |
4023fb28 | 2196 | (define_split |
609e7e80 AK |
2197 | [(set (match_operand:DD_DF 0 "register_operand" "") |
2198 | (match_operand:DD_DF 1 "memory_operand" ""))] | |
9602b6a1 | 2199 | "!TARGET_ZARCH && reload_completed |
8e509cf9 | 2200 | && !FP_REG_P (operands[0]) |
4023fb28 | 2201 | && !s_operand (operands[1], VOIDmode)" |
a41c6c53 | 2202 | [(set (match_dup 0) (match_dup 1))] |
a41c6c53 | 2203 | { |
609e7e80 | 2204 | rtx addr = operand_subword (operands[0], 1, 0, <MODE>mode); |
a41c6c53 UW |
2205 | s390_load_address (addr, XEXP (operands[1], 0)); |
2206 | operands[1] = replace_equiv_address (operands[1], addr); | |
dc65c307 UW |
2207 | }) |
2208 | ||
9db1d521 | 2209 | ; |
609e7e80 | 2210 | ; mov(sf|sd) instruction pattern(s). |
9db1d521 HP |
2211 | ; |
2212 | ||
609e7e80 AK |
2213 | (define_insn "mov<mode>" |
2214 | [(set (match_operand:SD_SF 0 "nonimmediate_operand" | |
65b1d8ea | 2215 | "=f,f,f,f,R,T,d,d,d,d,R,T") |
609e7e80 | 2216 | (match_operand:SD_SF 1 "general_operand" |
65b1d8ea | 2217 | " G,f,R,T,f,f,G,d,R,T,d,d"))] |
4023fb28 | 2218 | "" |
9db1d521 | 2219 | "@ |
65b1d8ea | 2220 | lzer\t%0 |
d40c829f UW |
2221 | ler\t%0,%1 |
2222 | le\t%0,%1 | |
2223 | ley\t%0,%1 | |
2224 | ste\t%1,%0 | |
2225 | stey\t%1,%0 | |
45e5214c | 2226 | lhi\t%0,0 |
d40c829f UW |
2227 | lr\t%0,%1 |
2228 | l\t%0,%1 | |
2229 | ly\t%0,%1 | |
2230 | st\t%1,%0 | |
f2dc2f86 | 2231 | sty\t%1,%0" |
65b1d8ea AK |
2232 | [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RI,RR,RX,RXY,RX,RXY") |
2233 | (set_attr "type" "fsimpsf,fload<mode>,fload<mode>,fload<mode>, | |
2234 | fstore<mode>,fstore<mode>,*,lr,load,load,store,store") | |
2235 | (set_attr "z10prop" "*,*,*,*,*,*,z10_fwd_A1,z10_fr_E1,z10_fwd_A3,z10_fwd_A3,z10_rec,z10_rec") | |
2236 | (set_attr "cpu_facility" "z196,*,*,*,*,*,*,*,*,*,*,*")]) | |
4023fb28 | 2237 | |
9dc62c00 AK |
2238 | ; |
2239 | ; movcc instruction pattern | |
2240 | ; | |
2241 | ||
2242 | (define_insn "movcc" | |
2243 | [(set (match_operand:CC 0 "nonimmediate_operand" "=d,c,d,d,d,R,T") | |
2244 | (match_operand:CC 1 "nonimmediate_operand" "d,d,c,R,T,d,d"))] | |
2245 | "" | |
2246 | "@ | |
2247 | lr\t%0,%1 | |
2248 | tmh\t%1,12288 | |
2249 | ipm\t%0 | |
2250 | st\t%0,%1 | |
2251 | sty\t%0,%1 | |
2252 | l\t%1,%0 | |
2253 | ly\t%1,%0" | |
8dd3b235 | 2254 | [(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY") |
9381e3f1 | 2255 | (set_attr "type" "lr,*,*,store,store,load,load") |
65b1d8ea AK |
2256 | (set_attr "z10prop" "z10_fr_E1,z10_super,*,z10_rec,z10_rec,z10_fwd_A3,z10_fwd_A3") |
2257 | (set_attr "z196prop" "*,*,z196_ends,*,*,*,*")]) | |
9dc62c00 | 2258 | |
19b63d8e UW |
2259 | ; |
2260 | ; Block move (MVC) patterns. | |
2261 | ; | |
2262 | ||
2263 | (define_insn "*mvc" | |
2264 | [(set (match_operand:BLK 0 "memory_operand" "=Q") | |
2265 | (match_operand:BLK 1 "memory_operand" "Q")) | |
2266 | (use (match_operand 2 "const_int_operand" "n"))] | |
2267 | "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" | |
fc0ea003 | 2268 | "mvc\t%O0(%2,%R0),%S1" |
b628bd8e | 2269 | [(set_attr "op_type" "SS")]) |
19b63d8e | 2270 | |
0a88561f AK |
2271 | ; This splitter converts a QI to QI mode copy into a BLK mode copy in |
2272 | ; order to have it implemented with mvc. | |
2273 | ||
2274 | (define_split | |
2275 | [(set (match_operand:QI 0 "memory_operand" "") | |
2276 | (match_operand:QI 1 "memory_operand" ""))] | |
2277 | "reload_completed" | |
2278 | [(parallel | |
2279 | [(set (match_dup 0) (match_dup 1)) | |
2280 | (use (const_int 1))])] | |
2281 | { | |
2282 | operands[0] = adjust_address (operands[0], BLKmode, 0); | |
2283 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
2284 | }) | |
2285 | ||
2286 | ||
19b63d8e UW |
2287 | (define_peephole2 |
2288 | [(parallel | |
2289 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2290 | (match_operand:BLK 1 "memory_operand" "")) | |
2291 | (use (match_operand 2 "const_int_operand" ""))]) | |
2292 | (parallel | |
2293 | [(set (match_operand:BLK 3 "memory_operand" "") | |
2294 | (match_operand:BLK 4 "memory_operand" "")) | |
2295 | (use (match_operand 5 "const_int_operand" ""))])] | |
2296 | "s390_offset_p (operands[0], operands[3], operands[2]) | |
2297 | && s390_offset_p (operands[1], operands[4], operands[2]) | |
9381e3f1 | 2298 | && !s390_overlap_p (operands[0], operands[1], |
bcf8c1cc | 2299 | INTVAL (operands[2]) + INTVAL (operands[5])) |
19b63d8e UW |
2300 | && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" |
2301 | [(parallel | |
2302 | [(set (match_dup 6) (match_dup 7)) | |
2303 | (use (match_dup 8))])] | |
2304 | "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); | |
2305 | operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); | |
2306 | operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") | |
2307 | ||
2308 | ||
9db1d521 HP |
2309 | ; |
2310 | ; load_multiple pattern(s). | |
2311 | ; | |
22ea6b4f UW |
2312 | ; ??? Due to reload problems with replacing registers inside match_parallel |
2313 | ; we currently support load_multiple/store_multiple only after reload. | |
2314 | ; | |
9db1d521 HP |
2315 | |
2316 | (define_expand "load_multiple" | |
2317 | [(match_par_dup 3 [(set (match_operand 0 "" "") | |
2318 | (match_operand 1 "" "")) | |
2319 | (use (match_operand 2 "" ""))])] | |
22ea6b4f | 2320 | "reload_completed" |
9db1d521 | 2321 | { |
c19ec8f9 | 2322 | enum machine_mode mode; |
9db1d521 HP |
2323 | int regno; |
2324 | int count; | |
2325 | rtx from; | |
4023fb28 | 2326 | int i, off; |
9db1d521 HP |
2327 | |
2328 | /* Support only loading a constant number of fixed-point registers from | |
2329 | memory and only bother with this if more than two */ | |
2330 | if (GET_CODE (operands[2]) != CONST_INT | |
4023fb28 | 2331 | || INTVAL (operands[2]) < 2 |
9db1d521 HP |
2332 | || INTVAL (operands[2]) > 16 |
2333 | || GET_CODE (operands[1]) != MEM | |
2334 | || GET_CODE (operands[0]) != REG | |
2335 | || REGNO (operands[0]) >= 16) | |
2336 | FAIL; | |
2337 | ||
2338 | count = INTVAL (operands[2]); | |
2339 | regno = REGNO (operands[0]); | |
c19ec8f9 | 2340 | mode = GET_MODE (operands[0]); |
9602b6a1 | 2341 | if (mode != SImode && (!TARGET_ZARCH || mode != DImode)) |
c19ec8f9 | 2342 | FAIL; |
9db1d521 HP |
2343 | |
2344 | operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); | |
b3a13419 | 2345 | if (!can_create_pseudo_p ()) |
4023fb28 UW |
2346 | { |
2347 | if (GET_CODE (XEXP (operands[1], 0)) == REG) | |
2348 | { | |
2349 | from = XEXP (operands[1], 0); | |
2350 | off = 0; | |
2351 | } | |
2352 | else if (GET_CODE (XEXP (operands[1], 0)) == PLUS | |
2353 | && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG | |
2354 | && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT) | |
2355 | { | |
2356 | from = XEXP (XEXP (operands[1], 0), 0); | |
2357 | off = INTVAL (XEXP (XEXP (operands[1], 0), 1)); | |
2358 | } | |
2359 | else | |
2360 | FAIL; | |
4023fb28 UW |
2361 | } |
2362 | else | |
2363 | { | |
2364 | from = force_reg (Pmode, XEXP (operands[1], 0)); | |
2365 | off = 0; | |
2366 | } | |
9db1d521 HP |
2367 | |
2368 | for (i = 0; i < count; i++) | |
2369 | XVECEXP (operands[3], 0, i) | |
c19ec8f9 UW |
2370 | = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i), |
2371 | change_address (operands[1], mode, | |
0a81f074 RS |
2372 | plus_constant (Pmode, from, |
2373 | off + i * GET_MODE_SIZE (mode)))); | |
10bbf137 | 2374 | }) |
9db1d521 HP |
2375 | |
2376 | (define_insn "*load_multiple_di" | |
2377 | [(match_parallel 0 "load_multiple_operation" | |
2378 | [(set (match_operand:DI 1 "register_operand" "=r") | |
d3632d41 | 2379 | (match_operand:DI 2 "s_operand" "QS"))])] |
9602b6a1 | 2380 | "reload_completed && TARGET_ZARCH" |
9db1d521 HP |
2381 | { |
2382 | int words = XVECLEN (operands[0], 0); | |
9db1d521 | 2383 | operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1); |
fc0ea003 | 2384 | return "lmg\t%1,%0,%S2"; |
10bbf137 | 2385 | } |
d3632d41 | 2386 | [(set_attr "op_type" "RSY") |
4023fb28 | 2387 | (set_attr "type" "lm")]) |
9db1d521 HP |
2388 | |
2389 | (define_insn "*load_multiple_si" | |
2390 | [(match_parallel 0 "load_multiple_operation" | |
d3632d41 UW |
2391 | [(set (match_operand:SI 1 "register_operand" "=r,r") |
2392 | (match_operand:SI 2 "s_operand" "Q,S"))])] | |
22ea6b4f | 2393 | "reload_completed" |
9db1d521 HP |
2394 | { |
2395 | int words = XVECLEN (operands[0], 0); | |
9db1d521 | 2396 | operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1); |
fc0ea003 | 2397 | return which_alternative == 0 ? "lm\t%1,%0,%S2" : "lmy\t%1,%0,%S2"; |
10bbf137 | 2398 | } |
d3632d41 | 2399 | [(set_attr "op_type" "RS,RSY") |
4023fb28 | 2400 | (set_attr "type" "lm")]) |
9db1d521 HP |
2401 | |
2402 | ; | |
c7453384 | 2403 | ; store multiple pattern(s). |
9db1d521 HP |
2404 | ; |
2405 | ||
2406 | (define_expand "store_multiple" | |
2407 | [(match_par_dup 3 [(set (match_operand 0 "" "") | |
2408 | (match_operand 1 "" "")) | |
2409 | (use (match_operand 2 "" ""))])] | |
22ea6b4f | 2410 | "reload_completed" |
9db1d521 | 2411 | { |
c19ec8f9 | 2412 | enum machine_mode mode; |
9db1d521 HP |
2413 | int regno; |
2414 | int count; | |
2415 | rtx to; | |
4023fb28 | 2416 | int i, off; |
9db1d521 HP |
2417 | |
2418 | /* Support only storing a constant number of fixed-point registers to | |
2419 | memory and only bother with this if more than two. */ | |
2420 | if (GET_CODE (operands[2]) != CONST_INT | |
4023fb28 | 2421 | || INTVAL (operands[2]) < 2 |
9db1d521 HP |
2422 | || INTVAL (operands[2]) > 16 |
2423 | || GET_CODE (operands[0]) != MEM | |
2424 | || GET_CODE (operands[1]) != REG | |
2425 | || REGNO (operands[1]) >= 16) | |
2426 | FAIL; | |
2427 | ||
2428 | count = INTVAL (operands[2]); | |
2429 | regno = REGNO (operands[1]); | |
c19ec8f9 | 2430 | mode = GET_MODE (operands[1]); |
9602b6a1 | 2431 | if (mode != SImode && (!TARGET_ZARCH || mode != DImode)) |
c19ec8f9 | 2432 | FAIL; |
9db1d521 HP |
2433 | |
2434 | operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); | |
4023fb28 | 2435 | |
b3a13419 | 2436 | if (!can_create_pseudo_p ()) |
4023fb28 UW |
2437 | { |
2438 | if (GET_CODE (XEXP (operands[0], 0)) == REG) | |
2439 | { | |
2440 | to = XEXP (operands[0], 0); | |
2441 | off = 0; | |
2442 | } | |
2443 | else if (GET_CODE (XEXP (operands[0], 0)) == PLUS | |
2444 | && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG | |
2445 | && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT) | |
2446 | { | |
2447 | to = XEXP (XEXP (operands[0], 0), 0); | |
2448 | off = INTVAL (XEXP (XEXP (operands[0], 0), 1)); | |
2449 | } | |
2450 | else | |
2451 | FAIL; | |
4023fb28 | 2452 | } |
c7453384 | 2453 | else |
4023fb28 UW |
2454 | { |
2455 | to = force_reg (Pmode, XEXP (operands[0], 0)); | |
2456 | off = 0; | |
2457 | } | |
9db1d521 HP |
2458 | |
2459 | for (i = 0; i < count; i++) | |
2460 | XVECEXP (operands[3], 0, i) | |
2461 | = gen_rtx_SET (VOIDmode, | |
c19ec8f9 | 2462 | change_address (operands[0], mode, |
0a81f074 RS |
2463 | plus_constant (Pmode, to, |
2464 | off + i * GET_MODE_SIZE (mode))), | |
c19ec8f9 | 2465 | gen_rtx_REG (mode, regno + i)); |
10bbf137 | 2466 | }) |
9db1d521 HP |
2467 | |
2468 | (define_insn "*store_multiple_di" | |
2469 | [(match_parallel 0 "store_multiple_operation" | |
d3632d41 | 2470 | [(set (match_operand:DI 1 "s_operand" "=QS") |
9db1d521 | 2471 | (match_operand:DI 2 "register_operand" "r"))])] |
9602b6a1 | 2472 | "reload_completed && TARGET_ZARCH" |
9db1d521 HP |
2473 | { |
2474 | int words = XVECLEN (operands[0], 0); | |
9db1d521 | 2475 | operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1); |
fc0ea003 | 2476 | return "stmg\t%2,%0,%S1"; |
10bbf137 | 2477 | } |
d3632d41 | 2478 | [(set_attr "op_type" "RSY") |
4023fb28 | 2479 | (set_attr "type" "stm")]) |
9db1d521 HP |
2480 | |
2481 | ||
2482 | (define_insn "*store_multiple_si" | |
2483 | [(match_parallel 0 "store_multiple_operation" | |
d3632d41 UW |
2484 | [(set (match_operand:SI 1 "s_operand" "=Q,S") |
2485 | (match_operand:SI 2 "register_operand" "r,r"))])] | |
22ea6b4f | 2486 | "reload_completed" |
9db1d521 HP |
2487 | { |
2488 | int words = XVECLEN (operands[0], 0); | |
9db1d521 | 2489 | operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1); |
fc0ea003 | 2490 | return which_alternative == 0 ? "stm\t%2,%0,%S1" : "stmy\t%2,%0,%S1"; |
10bbf137 | 2491 | } |
d3632d41 | 2492 | [(set_attr "op_type" "RS,RSY") |
4023fb28 | 2493 | (set_attr "type" "stm")]) |
9db1d521 HP |
2494 | |
2495 | ;; | |
2496 | ;; String instructions. | |
2497 | ;; | |
2498 | ||
963fc8d0 | 2499 | (define_insn "*execute_rl" |
2771c2f9 | 2500 | [(match_parallel 0 "execute_operation" |
963fc8d0 AK |
2501 | [(unspec [(match_operand 1 "register_operand" "a") |
2502 | (match_operand 2 "" "") | |
2503 | (match_operand:SI 3 "larl_operand" "X")] UNSPEC_EXECUTE)])] | |
2504 | "TARGET_Z10 && GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT | |
2505 | && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD" | |
2506 | "exrl\t%1,%3" | |
2507 | [(set_attr "op_type" "RIL") | |
2508 | (set_attr "type" "cs")]) | |
2509 | ||
9bb86f41 | 2510 | (define_insn "*execute" |
2771c2f9 | 2511 | [(match_parallel 0 "execute_operation" |
9bb86f41 UW |
2512 | [(unspec [(match_operand 1 "register_operand" "a") |
2513 | (match_operand:BLK 2 "memory_operand" "R") | |
2514 | (match_operand 3 "" "")] UNSPEC_EXECUTE)])] | |
2515 | "GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT | |
2516 | && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD" | |
2517 | "ex\t%1,%2" | |
29a74354 UW |
2518 | [(set_attr "op_type" "RX") |
2519 | (set_attr "type" "cs")]) | |
9bb86f41 UW |
2520 | |
2521 | ||
91d39d71 UW |
2522 | ; |
2523 | ; strlenM instruction pattern(s). | |
2524 | ; | |
2525 | ||
9db2f16d | 2526 | (define_expand "strlen<mode>" |
ccbdc0d4 | 2527 | [(set (reg:SI 0) (match_operand:SI 2 "immediate_operand" "")) |
2f7e5a0d | 2528 | (parallel |
91d39d71 | 2529 | [(set (match_dup 4) |
9db2f16d | 2530 | (unspec:P [(const_int 0) |
91d39d71 | 2531 | (match_operand:BLK 1 "memory_operand" "") |
ccbdc0d4 | 2532 | (reg:SI 0) |
91d39d71 | 2533 | (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) |
9db2f16d | 2534 | (clobber (scratch:P)) |
ae156f85 | 2535 | (clobber (reg:CC CC_REGNUM))]) |
91d39d71 | 2536 | (parallel |
9db2f16d AS |
2537 | [(set (match_operand:P 0 "register_operand" "") |
2538 | (minus:P (match_dup 4) (match_dup 5))) | |
ae156f85 | 2539 | (clobber (reg:CC CC_REGNUM))])] |
9db2f16d | 2540 | "" |
91d39d71 | 2541 | { |
9db2f16d AS |
2542 | operands[4] = gen_reg_rtx (Pmode); |
2543 | operands[5] = gen_reg_rtx (Pmode); | |
91d39d71 UW |
2544 | emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); |
2545 | operands[1] = replace_equiv_address (operands[1], operands[5]); | |
2546 | }) | |
2547 | ||
9db2f16d AS |
2548 | (define_insn "*strlen<mode>" |
2549 | [(set (match_operand:P 0 "register_operand" "=a") | |
2550 | (unspec:P [(match_operand:P 2 "general_operand" "0") | |
2551 | (mem:BLK (match_operand:P 3 "register_operand" "1")) | |
ccbdc0d4 | 2552 | (reg:SI 0) |
91d39d71 | 2553 | (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) |
9db2f16d | 2554 | (clobber (match_scratch:P 1 "=a")) |
ae156f85 | 2555 | (clobber (reg:CC CC_REGNUM))] |
9db2f16d | 2556 | "" |
91d39d71 | 2557 | "srst\t%0,%1\;jo\t.-4" |
b628bd8e UW |
2558 | [(set_attr "length" "8") |
2559 | (set_attr "type" "vs")]) | |
91d39d71 | 2560 | |
ccbdc0d4 AS |
2561 | ; |
2562 | ; cmpstrM instruction pattern(s). | |
2563 | ; | |
2564 | ||
2565 | (define_expand "cmpstrsi" | |
2566 | [(set (reg:SI 0) (const_int 0)) | |
2567 | (parallel | |
2568 | [(clobber (match_operand 3 "" "")) | |
2569 | (clobber (match_dup 4)) | |
2570 | (set (reg:CCU CC_REGNUM) | |
2571 | (compare:CCU (match_operand:BLK 1 "memory_operand" "") | |
2572 | (match_operand:BLK 2 "memory_operand" ""))) | |
2573 | (use (reg:SI 0))]) | |
2574 | (parallel | |
2575 | [(set (match_operand:SI 0 "register_operand" "=d") | |
638e37c2 | 2576 | (unspec:SI [(reg:CCU CC_REGNUM)] UNSPEC_CCU_TO_INT)) |
ccbdc0d4 AS |
2577 | (clobber (reg:CC CC_REGNUM))])] |
2578 | "" | |
2579 | { | |
2580 | /* As the result of CMPINT is inverted compared to what we need, | |
2581 | we have to swap the operands. */ | |
2582 | rtx op1 = operands[2]; | |
2583 | rtx op2 = operands[1]; | |
2584 | rtx addr1 = gen_reg_rtx (Pmode); | |
2585 | rtx addr2 = gen_reg_rtx (Pmode); | |
2586 | ||
2587 | emit_move_insn (addr1, force_operand (XEXP (op1, 0), NULL_RTX)); | |
2588 | emit_move_insn (addr2, force_operand (XEXP (op2, 0), NULL_RTX)); | |
2589 | operands[1] = replace_equiv_address_nv (op1, addr1); | |
2590 | operands[2] = replace_equiv_address_nv (op2, addr2); | |
2591 | operands[3] = addr1; | |
2592 | operands[4] = addr2; | |
2593 | }) | |
2594 | ||
2595 | (define_insn "*cmpstr<mode>" | |
2596 | [(clobber (match_operand:P 0 "register_operand" "=d")) | |
2597 | (clobber (match_operand:P 1 "register_operand" "=d")) | |
2598 | (set (reg:CCU CC_REGNUM) | |
2599 | (compare:CCU (mem:BLK (match_operand:P 2 "register_operand" "0")) | |
2600 | (mem:BLK (match_operand:P 3 "register_operand" "1")))) | |
2601 | (use (reg:SI 0))] | |
2602 | "" | |
2603 | "clst\t%0,%1\;jo\t.-4" | |
2604 | [(set_attr "length" "8") | |
2605 | (set_attr "type" "vs")]) | |
9381e3f1 | 2606 | |
742090fc AS |
2607 | ; |
2608 | ; movstr instruction pattern. | |
2609 | ; | |
2610 | ||
2611 | (define_expand "movstr" | |
2612 | [(set (reg:SI 0) (const_int 0)) | |
9381e3f1 | 2613 | (parallel |
742090fc AS |
2614 | [(clobber (match_dup 3)) |
2615 | (set (match_operand:BLK 1 "memory_operand" "") | |
2616 | (match_operand:BLK 2 "memory_operand" "")) | |
2617 | (set (match_operand 0 "register_operand" "") | |
9381e3f1 | 2618 | (unspec [(match_dup 1) |
742090fc AS |
2619 | (match_dup 2) |
2620 | (reg:SI 0)] UNSPEC_MVST)) | |
2621 | (clobber (reg:CC CC_REGNUM))])] | |
2622 | "" | |
2623 | { | |
2624 | rtx addr1 = gen_reg_rtx (Pmode); | |
2625 | rtx addr2 = gen_reg_rtx (Pmode); | |
2626 | ||
2627 | emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX)); | |
2628 | emit_move_insn (addr2, force_operand (XEXP (operands[2], 0), NULL_RTX)); | |
2629 | operands[1] = replace_equiv_address_nv (operands[1], addr1); | |
2630 | operands[2] = replace_equiv_address_nv (operands[2], addr2); | |
2631 | operands[3] = addr2; | |
2632 | }) | |
2633 | ||
2634 | (define_insn "*movstr" | |
2635 | [(clobber (match_operand:P 2 "register_operand" "=d")) | |
2636 | (set (mem:BLK (match_operand:P 1 "register_operand" "0")) | |
2637 | (mem:BLK (match_operand:P 3 "register_operand" "2"))) | |
2638 | (set (match_operand:P 0 "register_operand" "=d") | |
9381e3f1 | 2639 | (unspec [(mem:BLK (match_dup 1)) |
742090fc AS |
2640 | (mem:BLK (match_dup 3)) |
2641 | (reg:SI 0)] UNSPEC_MVST)) | |
2642 | (clobber (reg:CC CC_REGNUM))] | |
2643 | "" | |
2644 | "mvst\t%1,%2\;jo\t.-4" | |
2645 | [(set_attr "length" "8") | |
2646 | (set_attr "type" "vs")]) | |
9381e3f1 | 2647 | |
742090fc | 2648 | |
9db1d521 | 2649 | ; |
70128ad9 | 2650 | ; movmemM instruction pattern(s). |
9db1d521 HP |
2651 | ; |
2652 | ||
9db2f16d | 2653 | (define_expand "movmem<mode>" |
963fc8d0 AK |
2654 | [(set (match_operand:BLK 0 "memory_operand" "") ; destination |
2655 | (match_operand:BLK 1 "memory_operand" "")) ; source | |
2656 | (use (match_operand:GPR 2 "general_operand" "")) ; count | |
a41c6c53 UW |
2657 | (match_operand 3 "" "")] |
2658 | "" | |
367d32f3 AK |
2659 | { |
2660 | if (s390_expand_movmem (operands[0], operands[1], operands[2])) | |
2661 | DONE; | |
2662 | else | |
2663 | FAIL; | |
2664 | }) | |
9db1d521 | 2665 | |
ecbe845e UW |
2666 | ; Move a block that is up to 256 bytes in length. |
2667 | ; The block length is taken as (operands[2] % 256) + 1. | |
9db1d521 | 2668 | |
70128ad9 | 2669 | (define_expand "movmem_short" |
b9404c99 UW |
2670 | [(parallel |
2671 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2672 | (match_operand:BLK 1 "memory_operand" "")) | |
2673 | (use (match_operand 2 "nonmemory_operand" "")) | |
9bb86f41 | 2674 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) |
b9404c99 UW |
2675 | (clobber (match_dup 3))])] |
2676 | "" | |
2677 | "operands[3] = gen_rtx_SCRATCH (Pmode);") | |
ecbe845e | 2678 | |
70128ad9 | 2679 | (define_insn "*movmem_short" |
963fc8d0 AK |
2680 | [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q,Q") |
2681 | (match_operand:BLK 1 "memory_operand" "Q,Q,Q,Q")) | |
2682 | (use (match_operand 2 "nonmemory_operand" "n,a,a,a")) | |
2683 | (use (match_operand 3 "immediate_operand" "X,R,X,X")) | |
1eae36f0 AK |
2684 | (clobber (match_scratch:P 4 "=X,X,X,&a"))] |
2685 | "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)" | |
9bb86f41 | 2686 | "#" |
963fc8d0 AK |
2687 | [(set_attr "type" "cs") |
2688 | (set_attr "cpu_facility" "*,*,z10,*")]) | |
ecbe845e | 2689 | |
9bb86f41 UW |
2690 | (define_split |
2691 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2692 | (match_operand:BLK 1 "memory_operand" "")) | |
2693 | (use (match_operand 2 "const_int_operand" "")) | |
2694 | (use (match_operand 3 "immediate_operand" "")) | |
2695 | (clobber (scratch))] | |
2696 | "reload_completed" | |
2697 | [(parallel | |
2698 | [(set (match_dup 0) (match_dup 1)) | |
2699 | (use (match_dup 2))])] | |
2700 | "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);") | |
9db1d521 | 2701 | |
9bb86f41 UW |
2702 | (define_split |
2703 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2704 | (match_operand:BLK 1 "memory_operand" "")) | |
2705 | (use (match_operand 2 "register_operand" "")) | |
2706 | (use (match_operand 3 "memory_operand" "")) | |
2707 | (clobber (scratch))] | |
2708 | "reload_completed" | |
2709 | [(parallel | |
2710 | [(unspec [(match_dup 2) (match_dup 3) | |
2711 | (const_int 0)] UNSPEC_EXECUTE) | |
2712 | (set (match_dup 0) (match_dup 1)) | |
2713 | (use (const_int 1))])] | |
2714 | "") | |
2715 | ||
963fc8d0 AK |
2716 | (define_split |
2717 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2718 | (match_operand:BLK 1 "memory_operand" "")) | |
2719 | (use (match_operand 2 "register_operand" "")) | |
2720 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
2721 | (clobber (scratch))] | |
2722 | "TARGET_Z10 && reload_completed" | |
2723 | [(parallel | |
2724 | [(unspec [(match_dup 2) (const_int 0) | |
2725 | (label_ref (match_dup 3))] UNSPEC_EXECUTE) | |
2726 | (set (match_dup 0) (match_dup 1)) | |
2727 | (use (const_int 1))])] | |
2728 | "operands[3] = gen_label_rtx ();") | |
2729 | ||
9bb86f41 UW |
2730 | (define_split |
2731 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2732 | (match_operand:BLK 1 "memory_operand" "")) | |
2733 | (use (match_operand 2 "register_operand" "")) | |
2734 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
2735 | (clobber (match_operand 3 "register_operand" ""))] | |
2736 | "reload_completed && TARGET_CPU_ZARCH" | |
2737 | [(set (match_dup 3) (label_ref (match_dup 4))) | |
2738 | (parallel | |
9381e3f1 | 2739 | [(unspec [(match_dup 2) (mem:BLK (match_dup 3)) |
9bb86f41 UW |
2740 | (label_ref (match_dup 4))] UNSPEC_EXECUTE) |
2741 | (set (match_dup 0) (match_dup 1)) | |
2742 | (use (const_int 1))])] | |
2743 | "operands[4] = gen_label_rtx ();") | |
2744 | ||
a41c6c53 | 2745 | ; Move a block of arbitrary length. |
9db1d521 | 2746 | |
70128ad9 | 2747 | (define_expand "movmem_long" |
b9404c99 UW |
2748 | [(parallel |
2749 | [(clobber (match_dup 2)) | |
2750 | (clobber (match_dup 3)) | |
2751 | (set (match_operand:BLK 0 "memory_operand" "") | |
2752 | (match_operand:BLK 1 "memory_operand" "")) | |
2753 | (use (match_operand 2 "general_operand" "")) | |
2754 | (use (match_dup 3)) | |
ae156f85 | 2755 | (clobber (reg:CC CC_REGNUM))])] |
b9404c99 UW |
2756 | "" |
2757 | { | |
9602b6a1 AK |
2758 | enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; |
2759 | enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; | |
2760 | rtx reg0 = gen_reg_rtx (dreg_mode); | |
2761 | rtx reg1 = gen_reg_rtx (dreg_mode); | |
2762 | rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); | |
2763 | rtx addr1 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg1)); | |
b9404c99 UW |
2764 | rtx len0 = gen_lowpart (Pmode, reg0); |
2765 | rtx len1 = gen_lowpart (Pmode, reg1); | |
2766 | ||
c41c1387 | 2767 | emit_clobber (reg0); |
b9404c99 UW |
2768 | emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX)); |
2769 | emit_move_insn (len0, operands[2]); | |
2770 | ||
c41c1387 | 2771 | emit_clobber (reg1); |
b9404c99 UW |
2772 | emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX)); |
2773 | emit_move_insn (len1, operands[2]); | |
2774 | ||
2775 | operands[0] = replace_equiv_address_nv (operands[0], addr0); | |
2776 | operands[1] = replace_equiv_address_nv (operands[1], addr1); | |
2777 | operands[2] = reg0; | |
2778 | operands[3] = reg1; | |
2779 | }) | |
2780 | ||
a1aed706 AS |
2781 | (define_insn "*movmem_long" |
2782 | [(clobber (match_operand:<DBL> 0 "register_operand" "=d")) | |
2783 | (clobber (match_operand:<DBL> 1 "register_operand" "=d")) | |
2784 | (set (mem:BLK (subreg:P (match_operand:<DBL> 2 "register_operand" "0") 0)) | |
2785 | (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "1") 0))) | |
b9404c99 UW |
2786 | (use (match_dup 2)) |
2787 | (use (match_dup 3)) | |
ae156f85 | 2788 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 AK |
2789 | "TARGET_64BIT || !TARGET_ZARCH" |
2790 | "mvcle\t%0,%1,0\;jo\t.-4" | |
2791 | [(set_attr "length" "8") | |
2792 | (set_attr "type" "vs")]) | |
2793 | ||
2794 | (define_insn "*movmem_long_31z" | |
2795 | [(clobber (match_operand:TI 0 "register_operand" "=d")) | |
2796 | (clobber (match_operand:TI 1 "register_operand" "=d")) | |
2797 | (set (mem:BLK (subreg:SI (match_operand:TI 2 "register_operand" "0") 4)) | |
2798 | (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "1") 4))) | |
2799 | (use (match_dup 2)) | |
2800 | (use (match_dup 3)) | |
2801 | (clobber (reg:CC CC_REGNUM))] | |
2802 | "!TARGET_64BIT && TARGET_ZARCH" | |
d40c829f | 2803 | "mvcle\t%0,%1,0\;jo\t.-4" |
b628bd8e UW |
2804 | [(set_attr "length" "8") |
2805 | (set_attr "type" "vs")]) | |
9db1d521 | 2806 | |
638e37c2 WG |
2807 | |
2808 | ; | |
2809 | ; Test data class. | |
2810 | ; | |
2811 | ||
0f67fa83 WG |
2812 | (define_expand "signbit<mode>2" |
2813 | [(set (reg:CCZ CC_REGNUM) | |
9381e3f1 WG |
2814 | (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f") |
2815 | (match_dup 2)] | |
0f67fa83 WG |
2816 | UNSPEC_TDC_INSN)) |
2817 | (set (match_operand:SI 0 "register_operand" "=d") | |
2818 | (unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))] | |
2819 | "TARGET_HARD_FLOAT" | |
2820 | { | |
2821 | operands[2] = GEN_INT (S390_TDC_SIGNBIT_SET); | |
2822 | }) | |
2823 | ||
638e37c2 WG |
2824 | (define_expand "isinf<mode>2" |
2825 | [(set (reg:CCZ CC_REGNUM) | |
9381e3f1 WG |
2826 | (unspec:CCZ [(match_operand:FP_ALL 1 "register_operand" "f") |
2827 | (match_dup 2)] | |
638e37c2 WG |
2828 | UNSPEC_TDC_INSN)) |
2829 | (set (match_operand:SI 0 "register_operand" "=d") | |
2830 | (unspec:SI [(reg:CCZ CC_REGNUM)] UNSPEC_CCZ_TO_INT))] | |
142cd70f | 2831 | "TARGET_HARD_FLOAT" |
638e37c2 WG |
2832 | { |
2833 | operands[2] = GEN_INT (S390_TDC_INFINITY); | |
2834 | }) | |
2835 | ||
2836 | ; This insn is used to generate all variants of the Test Data Class | |
2837 | ; instruction, namely tcxb, tcdb, and tceb. The insn's first operand | |
2838 | ; is the register to be tested and the second one is the bit mask | |
9381e3f1 | 2839 | ; specifying the required test(s). |
638e37c2 | 2840 | ; |
be5de7a1 | 2841 | ; tcxb, tcdb, tceb, tdcxt, tdcdt, tdcet |
638e37c2 WG |
2842 | (define_insn "*TDC_insn_<mode>" |
2843 | [(set (reg:CCZ CC_REGNUM) | |
9381e3f1 | 2844 | (unspec:CCZ [(match_operand:FP_ALL 0 "register_operand" "f") |
638e37c2 | 2845 | (match_operand:SI 1 "const_int_operand")] UNSPEC_TDC_INSN))] |
142cd70f | 2846 | "TARGET_HARD_FLOAT" |
0387c142 | 2847 | "t<_d>c<xde><bt>\t%0,%1" |
638e37c2 | 2848 | [(set_attr "op_type" "RXE") |
9381e3f1 | 2849 | (set_attr "type" "fsimp<mode>")]) |
638e37c2 WG |
2850 | |
2851 | (define_insn_and_split "*ccz_to_int" | |
2852 | [(set (match_operand:SI 0 "register_operand" "=d") | |
2853 | (unspec:SI [(match_operand:CCZ 1 "register_operand" "0")] | |
2854 | UNSPEC_CCZ_TO_INT))] | |
2855 | "" | |
2856 | "#" | |
2857 | "reload_completed" | |
2858 | [(set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 28)))]) | |
2859 | ||
2860 | ||
9db1d521 | 2861 | ; |
57e84f18 | 2862 | ; setmemM instruction pattern(s). |
9db1d521 HP |
2863 | ; |
2864 | ||
57e84f18 | 2865 | (define_expand "setmem<mode>" |
a41c6c53 | 2866 | [(set (match_operand:BLK 0 "memory_operand" "") |
6d057022 | 2867 | (match_operand:QI 2 "general_operand" "")) |
9db2f16d | 2868 | (use (match_operand:GPR 1 "general_operand" "")) |
57e84f18 | 2869 | (match_operand 3 "" "")] |
a41c6c53 | 2870 | "" |
6d057022 | 2871 | "s390_expand_setmem (operands[0], operands[1], operands[2]); DONE;") |
9db1d521 | 2872 | |
a41c6c53 | 2873 | ; Clear a block that is up to 256 bytes in length. |
b9404c99 UW |
2874 | ; The block length is taken as (operands[1] % 256) + 1. |
2875 | ||
70128ad9 | 2876 | (define_expand "clrmem_short" |
b9404c99 UW |
2877 | [(parallel |
2878 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2879 | (const_int 0)) | |
2880 | (use (match_operand 1 "nonmemory_operand" "")) | |
9bb86f41 | 2881 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) |
b9404c99 | 2882 | (clobber (match_dup 2)) |
ae156f85 | 2883 | (clobber (reg:CC CC_REGNUM))])] |
b9404c99 UW |
2884 | "" |
2885 | "operands[2] = gen_rtx_SCRATCH (Pmode);") | |
9db1d521 | 2886 | |
70128ad9 | 2887 | (define_insn "*clrmem_short" |
963fc8d0 | 2888 | [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q,Q") |
a41c6c53 | 2889 | (const_int 0)) |
963fc8d0 AK |
2890 | (use (match_operand 1 "nonmemory_operand" "n,a,a,a")) |
2891 | (use (match_operand 2 "immediate_operand" "X,R,X,X")) | |
1eae36f0 | 2892 | (clobber (match_scratch:P 3 "=X,X,X,&a")) |
ae156f85 | 2893 | (clobber (reg:CC CC_REGNUM))] |
1eae36f0 | 2894 | "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)" |
9bb86f41 | 2895 | "#" |
963fc8d0 AK |
2896 | [(set_attr "type" "cs") |
2897 | (set_attr "cpu_facility" "*,*,z10,*")]) | |
9bb86f41 UW |
2898 | |
2899 | (define_split | |
2900 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2901 | (const_int 0)) | |
2902 | (use (match_operand 1 "const_int_operand" "")) | |
2903 | (use (match_operand 2 "immediate_operand" "")) | |
2904 | (clobber (scratch)) | |
ae156f85 | 2905 | (clobber (reg:CC CC_REGNUM))] |
9bb86f41 UW |
2906 | "reload_completed" |
2907 | [(parallel | |
2908 | [(set (match_dup 0) (const_int 0)) | |
2909 | (use (match_dup 1)) | |
ae156f85 | 2910 | (clobber (reg:CC CC_REGNUM))])] |
9bb86f41 | 2911 | "operands[1] = GEN_INT ((INTVAL (operands[1]) & 0xff) + 1);") |
9db1d521 | 2912 | |
9bb86f41 UW |
2913 | (define_split |
2914 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2915 | (const_int 0)) | |
2916 | (use (match_operand 1 "register_operand" "")) | |
2917 | (use (match_operand 2 "memory_operand" "")) | |
2918 | (clobber (scratch)) | |
ae156f85 | 2919 | (clobber (reg:CC CC_REGNUM))] |
9bb86f41 UW |
2920 | "reload_completed" |
2921 | [(parallel | |
2922 | [(unspec [(match_dup 1) (match_dup 2) | |
2923 | (const_int 0)] UNSPEC_EXECUTE) | |
2924 | (set (match_dup 0) (const_int 0)) | |
2925 | (use (const_int 1)) | |
ae156f85 | 2926 | (clobber (reg:CC CC_REGNUM))])] |
9bb86f41 | 2927 | "") |
9db1d521 | 2928 | |
963fc8d0 AK |
2929 | (define_split |
2930 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2931 | (const_int 0)) | |
2932 | (use (match_operand 1 "register_operand" "")) | |
2933 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
2934 | (clobber (scratch)) | |
2935 | (clobber (reg:CC CC_REGNUM))] | |
2936 | "TARGET_Z10 && reload_completed" | |
2937 | [(parallel | |
2938 | [(unspec [(match_dup 1) (const_int 0) | |
2939 | (label_ref (match_dup 3))] UNSPEC_EXECUTE) | |
2940 | (set (match_dup 0) (const_int 0)) | |
2941 | (use (const_int 1)) | |
2942 | (clobber (reg:CC CC_REGNUM))])] | |
2943 | "operands[3] = gen_label_rtx ();") | |
2944 | ||
9bb86f41 UW |
2945 | (define_split |
2946 | [(set (match_operand:BLK 0 "memory_operand" "") | |
2947 | (const_int 0)) | |
2948 | (use (match_operand 1 "register_operand" "")) | |
2949 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
2950 | (clobber (match_operand 2 "register_operand" "")) | |
ae156f85 | 2951 | (clobber (reg:CC CC_REGNUM))] |
9bb86f41 UW |
2952 | "reload_completed && TARGET_CPU_ZARCH" |
2953 | [(set (match_dup 2) (label_ref (match_dup 3))) | |
2954 | (parallel | |
9381e3f1 | 2955 | [(unspec [(match_dup 1) (mem:BLK (match_dup 2)) |
9bb86f41 UW |
2956 | (label_ref (match_dup 3))] UNSPEC_EXECUTE) |
2957 | (set (match_dup 0) (const_int 0)) | |
2958 | (use (const_int 1)) | |
ae156f85 | 2959 | (clobber (reg:CC CC_REGNUM))])] |
9bb86f41 UW |
2960 | "operands[3] = gen_label_rtx ();") |
2961 | ||
9381e3f1 | 2962 | ; Initialize a block of arbitrary length with (operands[2] % 256). |
b9404c99 | 2963 | |
6d057022 | 2964 | (define_expand "setmem_long" |
b9404c99 UW |
2965 | [(parallel |
2966 | [(clobber (match_dup 1)) | |
2967 | (set (match_operand:BLK 0 "memory_operand" "") | |
4989e88a | 2968 | (match_operand 2 "shift_count_or_setmem_operand" "")) |
b9404c99 | 2969 | (use (match_operand 1 "general_operand" "")) |
6d057022 | 2970 | (use (match_dup 3)) |
ae156f85 | 2971 | (clobber (reg:CC CC_REGNUM))])] |
b9404c99 | 2972 | "" |
a41c6c53 | 2973 | { |
9602b6a1 AK |
2974 | enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; |
2975 | enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; | |
2976 | rtx reg0 = gen_reg_rtx (dreg_mode); | |
2977 | rtx reg1 = gen_reg_rtx (dreg_mode); | |
2978 | rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); | |
b9404c99 | 2979 | rtx len0 = gen_lowpart (Pmode, reg0); |
9db1d521 | 2980 | |
c41c1387 | 2981 | emit_clobber (reg0); |
b9404c99 UW |
2982 | emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX)); |
2983 | emit_move_insn (len0, operands[1]); | |
9db1d521 | 2984 | |
b9404c99 | 2985 | emit_move_insn (reg1, const0_rtx); |
a41c6c53 | 2986 | |
b9404c99 UW |
2987 | operands[0] = replace_equiv_address_nv (operands[0], addr0); |
2988 | operands[1] = reg0; | |
6d057022 | 2989 | operands[3] = reg1; |
b9404c99 | 2990 | }) |
a41c6c53 | 2991 | |
6d057022 | 2992 | (define_insn "*setmem_long" |
a1aed706 | 2993 | [(clobber (match_operand:<DBL> 0 "register_operand" "=d")) |
6d057022 | 2994 | (set (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "0") 0)) |
4989e88a | 2995 | (match_operand 2 "shift_count_or_setmem_operand" "Y")) |
6d057022 | 2996 | (use (match_dup 3)) |
a1aed706 | 2997 | (use (match_operand:<DBL> 1 "register_operand" "d")) |
ae156f85 | 2998 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 2999 | "TARGET_64BIT || !TARGET_ZARCH" |
6d057022 | 3000 | "mvcle\t%0,%1,%Y2\;jo\t.-4" |
b628bd8e UW |
3001 | [(set_attr "length" "8") |
3002 | (set_attr "type" "vs")]) | |
9db1d521 | 3003 | |
4989e88a AK |
3004 | (define_insn "*setmem_long_and" |
3005 | [(clobber (match_operand:<DBL> 0 "register_operand" "=d")) | |
3006 | (set (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "0") 0)) | |
3007 | (and (match_operand 2 "shift_count_or_setmem_operand" "Y") | |
3008 | (match_operand 4 "const_int_operand" "n"))) | |
3009 | (use (match_dup 3)) | |
3010 | (use (match_operand:<DBL> 1 "register_operand" "d")) | |
3011 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 AK |
3012 | "(TARGET_64BIT || !TARGET_ZARCH) && |
3013 | (INTVAL (operands[4]) & 255) == 255" | |
3014 | "mvcle\t%0,%1,%Y2\;jo\t.-4" | |
3015 | [(set_attr "length" "8") | |
3016 | (set_attr "type" "vs")]) | |
3017 | ||
3018 | (define_insn "*setmem_long_31z" | |
3019 | [(clobber (match_operand:TI 0 "register_operand" "=d")) | |
3020 | (set (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "0") 4)) | |
3021 | (match_operand 2 "shift_count_or_setmem_operand" "Y")) | |
3022 | (use (match_dup 3)) | |
3023 | (use (match_operand:TI 1 "register_operand" "d")) | |
3024 | (clobber (reg:CC CC_REGNUM))] | |
3025 | "!TARGET_64BIT && TARGET_ZARCH" | |
4989e88a AK |
3026 | "mvcle\t%0,%1,%Y2\;jo\t.-4" |
3027 | [(set_attr "length" "8") | |
3028 | (set_attr "type" "vs")]) | |
9602b6a1 | 3029 | |
9db1d521 | 3030 | ; |
358b8f01 | 3031 | ; cmpmemM instruction pattern(s). |
9db1d521 HP |
3032 | ; |
3033 | ||
358b8f01 | 3034 | (define_expand "cmpmemsi" |
a41c6c53 UW |
3035 | [(set (match_operand:SI 0 "register_operand" "") |
3036 | (compare:SI (match_operand:BLK 1 "memory_operand" "") | |
3037 | (match_operand:BLK 2 "memory_operand" "") ) ) | |
3038 | (use (match_operand:SI 3 "general_operand" "")) | |
3039 | (use (match_operand:SI 4 "" ""))] | |
3040 | "" | |
367d32f3 AK |
3041 | { |
3042 | if (s390_expand_cmpmem (operands[0], operands[1], | |
3043 | operands[2], operands[3])) | |
3044 | DONE; | |
3045 | else | |
3046 | FAIL; | |
3047 | }) | |
9db1d521 | 3048 | |
a41c6c53 UW |
3049 | ; Compare a block that is up to 256 bytes in length. |
3050 | ; The block length is taken as (operands[2] % 256) + 1. | |
9db1d521 | 3051 | |
b9404c99 UW |
3052 | (define_expand "cmpmem_short" |
3053 | [(parallel | |
ae156f85 | 3054 | [(set (reg:CCU CC_REGNUM) |
5b022de5 | 3055 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") |
b9404c99 UW |
3056 | (match_operand:BLK 1 "memory_operand" ""))) |
3057 | (use (match_operand 2 "nonmemory_operand" "")) | |
9bb86f41 | 3058 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) |
b9404c99 UW |
3059 | (clobber (match_dup 3))])] |
3060 | "" | |
3061 | "operands[3] = gen_rtx_SCRATCH (Pmode);") | |
9db1d521 | 3062 | |
b9404c99 | 3063 | (define_insn "*cmpmem_short" |
ae156f85 | 3064 | [(set (reg:CCU CC_REGNUM) |
963fc8d0 AK |
3065 | (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q,Q") |
3066 | (match_operand:BLK 1 "memory_operand" "Q,Q,Q,Q"))) | |
3067 | (use (match_operand 2 "nonmemory_operand" "n,a,a,a")) | |
3068 | (use (match_operand 3 "immediate_operand" "X,R,X,X")) | |
1eae36f0 AK |
3069 | (clobber (match_scratch:P 4 "=X,X,X,&a"))] |
3070 | "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)" | |
9bb86f41 | 3071 | "#" |
963fc8d0 AK |
3072 | [(set_attr "type" "cs") |
3073 | (set_attr "cpu_facility" "*,*,z10,*")]) | |
9db1d521 | 3074 | |
9bb86f41 | 3075 | (define_split |
ae156f85 | 3076 | [(set (reg:CCU CC_REGNUM) |
9bb86f41 UW |
3077 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") |
3078 | (match_operand:BLK 1 "memory_operand" ""))) | |
3079 | (use (match_operand 2 "const_int_operand" "")) | |
3080 | (use (match_operand 3 "immediate_operand" "")) | |
3081 | (clobber (scratch))] | |
3082 | "reload_completed" | |
3083 | [(parallel | |
ae156f85 | 3084 | [(set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) |
9bb86f41 UW |
3085 | (use (match_dup 2))])] |
3086 | "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);") | |
9db1d521 | 3087 | |
9bb86f41 | 3088 | (define_split |
ae156f85 | 3089 | [(set (reg:CCU CC_REGNUM) |
9bb86f41 UW |
3090 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") |
3091 | (match_operand:BLK 1 "memory_operand" ""))) | |
3092 | (use (match_operand 2 "register_operand" "")) | |
3093 | (use (match_operand 3 "memory_operand" "")) | |
3094 | (clobber (scratch))] | |
3095 | "reload_completed" | |
3096 | [(parallel | |
3097 | [(unspec [(match_dup 2) (match_dup 3) | |
3098 | (const_int 0)] UNSPEC_EXECUTE) | |
ae156f85 | 3099 | (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) |
9bb86f41 UW |
3100 | (use (const_int 1))])] |
3101 | "") | |
3102 | ||
963fc8d0 AK |
3103 | (define_split |
3104 | [(set (reg:CCU CC_REGNUM) | |
3105 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") | |
3106 | (match_operand:BLK 1 "memory_operand" ""))) | |
3107 | (use (match_operand 2 "register_operand" "")) | |
3108 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
3109 | (clobber (scratch))] | |
3110 | "TARGET_Z10 && reload_completed" | |
3111 | [(parallel | |
3112 | [(unspec [(match_dup 2) (const_int 0) | |
3113 | (label_ref (match_dup 4))] UNSPEC_EXECUTE) | |
3114 | (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) | |
3115 | (use (const_int 1))])] | |
3116 | "operands[4] = gen_label_rtx ();") | |
3117 | ||
9bb86f41 | 3118 | (define_split |
ae156f85 | 3119 | [(set (reg:CCU CC_REGNUM) |
9bb86f41 UW |
3120 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") |
3121 | (match_operand:BLK 1 "memory_operand" ""))) | |
3122 | (use (match_operand 2 "register_operand" "")) | |
3123 | (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) | |
3124 | (clobber (match_operand 3 "register_operand" ""))] | |
3125 | "reload_completed && TARGET_CPU_ZARCH" | |
3126 | [(set (match_dup 3) (label_ref (match_dup 4))) | |
3127 | (parallel | |
9381e3f1 | 3128 | [(unspec [(match_dup 2) (mem:BLK (match_dup 3)) |
9bb86f41 | 3129 | (label_ref (match_dup 4))] UNSPEC_EXECUTE) |
ae156f85 | 3130 | (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) |
9bb86f41 UW |
3131 | (use (const_int 1))])] |
3132 | "operands[4] = gen_label_rtx ();") | |
3133 | ||
a41c6c53 | 3134 | ; Compare a block of arbitrary length. |
9db1d521 | 3135 | |
b9404c99 UW |
3136 | (define_expand "cmpmem_long" |
3137 | [(parallel | |
3138 | [(clobber (match_dup 2)) | |
3139 | (clobber (match_dup 3)) | |
ae156f85 | 3140 | (set (reg:CCU CC_REGNUM) |
5b022de5 | 3141 | (compare:CCU (match_operand:BLK 0 "memory_operand" "") |
b9404c99 UW |
3142 | (match_operand:BLK 1 "memory_operand" ""))) |
3143 | (use (match_operand 2 "general_operand" "")) | |
3144 | (use (match_dup 3))])] | |
3145 | "" | |
3146 | { | |
9602b6a1 AK |
3147 | enum machine_mode sreg_mode = TARGET_ZARCH ? DImode : SImode; |
3148 | enum machine_mode dreg_mode = TARGET_ZARCH ? TImode : DImode; | |
3149 | rtx reg0 = gen_reg_rtx (dreg_mode); | |
3150 | rtx reg1 = gen_reg_rtx (dreg_mode); | |
3151 | rtx addr0 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg0)); | |
3152 | rtx addr1 = gen_lowpart (Pmode, gen_highpart (sreg_mode, reg1)); | |
b9404c99 UW |
3153 | rtx len0 = gen_lowpart (Pmode, reg0); |
3154 | rtx len1 = gen_lowpart (Pmode, reg1); | |
3155 | ||
c41c1387 | 3156 | emit_clobber (reg0); |
b9404c99 UW |
3157 | emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX)); |
3158 | emit_move_insn (len0, operands[2]); | |
3159 | ||
c41c1387 | 3160 | emit_clobber (reg1); |
b9404c99 UW |
3161 | emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX)); |
3162 | emit_move_insn (len1, operands[2]); | |
3163 | ||
3164 | operands[0] = replace_equiv_address_nv (operands[0], addr0); | |
3165 | operands[1] = replace_equiv_address_nv (operands[1], addr1); | |
3166 | operands[2] = reg0; | |
3167 | operands[3] = reg1; | |
3168 | }) | |
3169 | ||
a1aed706 AS |
3170 | (define_insn "*cmpmem_long" |
3171 | [(clobber (match_operand:<DBL> 0 "register_operand" "=d")) | |
3172 | (clobber (match_operand:<DBL> 1 "register_operand" "=d")) | |
ae156f85 | 3173 | (set (reg:CCU CC_REGNUM) |
a1aed706 AS |
3174 | (compare:CCU (mem:BLK (subreg:P (match_operand:<DBL> 2 "register_operand" "0") 0)) |
3175 | (mem:BLK (subreg:P (match_operand:<DBL> 3 "register_operand" "1") 0)))) | |
f8766020 HP |
3176 | (use (match_dup 2)) |
3177 | (use (match_dup 3))] | |
9602b6a1 | 3178 | "TARGET_64BIT || !TARGET_ZARCH" |
287ff198 | 3179 | "clcle\t%0,%1,0\;jo\t.-4" |
b628bd8e UW |
3180 | [(set_attr "length" "8") |
3181 | (set_attr "type" "vs")]) | |
9db1d521 | 3182 | |
9602b6a1 AK |
3183 | (define_insn "*cmpmem_long_31z" |
3184 | [(clobber (match_operand:TI 0 "register_operand" "=d")) | |
3185 | (clobber (match_operand:TI 1 "register_operand" "=d")) | |
3186 | (set (reg:CCU CC_REGNUM) | |
3187 | (compare:CCU (mem:BLK (subreg:SI (match_operand:TI 2 "register_operand" "0") 4)) | |
3188 | (mem:BLK (subreg:SI (match_operand:TI 3 "register_operand" "1") 4)))) | |
3189 | (use (match_dup 2)) | |
3190 | (use (match_dup 3))] | |
3191 | "!TARGET_64BIT && TARGET_ZARCH" | |
3192 | "clcle\t%0,%1,0\;jo\t.-4" | |
3193 | [(set_attr "op_type" "NN") | |
3194 | (set_attr "type" "vs") | |
3195 | (set_attr "length" "8")]) | |
3196 | ||
02887425 UW |
3197 | ; Convert CCUmode condition code to integer. |
3198 | ; Result is zero if EQ, positive if LTU, negative if GTU. | |
9db1d521 | 3199 | |
02887425 | 3200 | (define_insn_and_split "cmpint" |
9db1d521 | 3201 | [(set (match_operand:SI 0 "register_operand" "=d") |
02887425 | 3202 | (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] |
638e37c2 | 3203 | UNSPEC_CCU_TO_INT)) |
ae156f85 | 3204 | (clobber (reg:CC CC_REGNUM))] |
9db1d521 | 3205 | "" |
02887425 UW |
3206 | "#" |
3207 | "reload_completed" | |
3208 | [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2))) | |
3209 | (parallel | |
3210 | [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30))) | |
ae156f85 | 3211 | (clobber (reg:CC CC_REGNUM))])]) |
02887425 UW |
3212 | |
3213 | (define_insn_and_split "*cmpint_cc" | |
ae156f85 | 3214 | [(set (reg CC_REGNUM) |
02887425 | 3215 | (compare (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] |
638e37c2 | 3216 | UNSPEC_CCU_TO_INT) |
02887425 UW |
3217 | (const_int 0))) |
3218 | (set (match_operand:SI 0 "register_operand" "=d") | |
638e37c2 | 3219 | (unspec:SI [(match_dup 1)] UNSPEC_CCU_TO_INT))] |
02887425 UW |
3220 | "s390_match_ccmode (insn, CCSmode)" |
3221 | "#" | |
3222 | "&& reload_completed" | |
3223 | [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2))) | |
3224 | (parallel | |
3225 | [(set (match_dup 2) (match_dup 3)) | |
3226 | (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30)))])] | |
9db1d521 | 3227 | { |
02887425 UW |
3228 | rtx result = gen_rtx_ASHIFTRT (SImode, operands[0], GEN_INT (30)); |
3229 | operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0)); | |
3230 | operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx); | |
3231 | }) | |
9db1d521 | 3232 | |
02887425 | 3233 | (define_insn_and_split "*cmpint_sign" |
9db1d521 | 3234 | [(set (match_operand:DI 0 "register_operand" "=d") |
02887425 | 3235 | (sign_extend:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] |
638e37c2 | 3236 | UNSPEC_CCU_TO_INT))) |
ae156f85 | 3237 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 3238 | "TARGET_ZARCH" |
02887425 UW |
3239 | "#" |
3240 | "&& reload_completed" | |
3241 | [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) | |
3242 | (parallel | |
3243 | [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62))) | |
ae156f85 | 3244 | (clobber (reg:CC CC_REGNUM))])]) |
02887425 UW |
3245 | |
3246 | (define_insn_and_split "*cmpint_sign_cc" | |
ae156f85 | 3247 | [(set (reg CC_REGNUM) |
9381e3f1 | 3248 | (compare (ashiftrt:DI (ashift:DI (subreg:DI |
02887425 | 3249 | (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] |
638e37c2 | 3250 | UNSPEC_CCU_TO_INT) 0) |
02887425 UW |
3251 | (const_int 32)) (const_int 32)) |
3252 | (const_int 0))) | |
3253 | (set (match_operand:DI 0 "register_operand" "=d") | |
638e37c2 | 3254 | (sign_extend:DI (unspec:SI [(match_dup 1)] UNSPEC_CCU_TO_INT)))] |
9602b6a1 | 3255 | "s390_match_ccmode (insn, CCSmode) && TARGET_ZARCH" |
02887425 UW |
3256 | "#" |
3257 | "&& reload_completed" | |
3258 | [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) | |
3259 | (parallel | |
3260 | [(set (match_dup 2) (match_dup 3)) | |
3261 | (set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62)))])] | |
9db1d521 | 3262 | { |
02887425 UW |
3263 | rtx result = gen_rtx_ASHIFTRT (DImode, operands[0], GEN_INT (62)); |
3264 | operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0)); | |
3265 | operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx); | |
3266 | }) | |
9db1d521 | 3267 | |
4023fb28 | 3268 | |
9db1d521 HP |
3269 | ;; |
3270 | ;;- Conversion instructions. | |
3271 | ;; | |
3272 | ||
6fa05db6 | 3273 | (define_insn "*sethighpartsi" |
d3632d41 | 3274 | [(set (match_operand:SI 0 "register_operand" "=d,d") |
6fa05db6 AS |
3275 | (unspec:SI [(match_operand:BLK 1 "s_operand" "Q,S") |
3276 | (match_operand 2 "const_int_operand" "n,n")] UNSPEC_ICM)) | |
ae156f85 | 3277 | (clobber (reg:CC CC_REGNUM))] |
4023fb28 | 3278 | "" |
d3632d41 | 3279 | "@ |
6fa05db6 AS |
3280 | icm\t%0,%2,%S1 |
3281 | icmy\t%0,%2,%S1" | |
9381e3f1 WG |
3282 | [(set_attr "op_type" "RS,RSY") |
3283 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
4023fb28 | 3284 | |
6fa05db6 | 3285 | (define_insn "*sethighpartdi_64" |
4023fb28 | 3286 | [(set (match_operand:DI 0 "register_operand" "=d") |
6fa05db6 AS |
3287 | (unspec:DI [(match_operand:BLK 1 "s_operand" "QS") |
3288 | (match_operand 2 "const_int_operand" "n")] UNSPEC_ICM)) | |
ae156f85 | 3289 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 3290 | "TARGET_ZARCH" |
6fa05db6 | 3291 | "icmh\t%0,%2,%S1" |
729e750f WG |
3292 | [(set_attr "op_type" "RSY") |
3293 | (set_attr "z10prop" "z10_super")]) | |
4023fb28 | 3294 | |
6fa05db6 | 3295 | (define_insn "*sethighpartdi_31" |
d3632d41 | 3296 | [(set (match_operand:DI 0 "register_operand" "=d,d") |
6fa05db6 AS |
3297 | (unspec:DI [(match_operand:BLK 1 "s_operand" "Q,S") |
3298 | (match_operand 2 "const_int_operand" "n,n")] UNSPEC_ICM)) | |
ae156f85 | 3299 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 3300 | "!TARGET_ZARCH" |
d3632d41 | 3301 | "@ |
6fa05db6 AS |
3302 | icm\t%0,%2,%S1 |
3303 | icmy\t%0,%2,%S1" | |
9381e3f1 WG |
3304 | [(set_attr "op_type" "RS,RSY") |
3305 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
3306 | ||
4023fb28 | 3307 | |
6fa05db6 AS |
3308 | (define_insn_and_split "*extzv<mode>" |
3309 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
3310 | (zero_extract:GPR (match_operand:QI 1 "s_operand" "QS") | |
3311 | (match_operand 2 "const_int_operand" "n") | |
3312 | (const_int 0))) | |
ae156f85 | 3313 | (clobber (reg:CC CC_REGNUM))] |
6fa05db6 AS |
3314 | "INTVAL (operands[2]) > 0 |
3315 | && INTVAL (operands[2]) <= GET_MODE_BITSIZE (SImode)" | |
cc7ab9b7 UW |
3316 | "#" |
3317 | "&& reload_completed" | |
4023fb28 | 3318 | [(parallel |
6fa05db6 | 3319 | [(set (match_dup 0) (unspec:GPR [(match_dup 1) (match_dup 3)] UNSPEC_ICM)) |
ae156f85 | 3320 | (clobber (reg:CC CC_REGNUM))]) |
6fa05db6 | 3321 | (set (match_dup 0) (lshiftrt:GPR (match_dup 0) (match_dup 2)))] |
4023fb28 | 3322 | { |
6fa05db6 AS |
3323 | int bitsize = INTVAL (operands[2]); |
3324 | int size = (bitsize - 1) / BITS_PER_UNIT + 1; /* round up */ | |
3325 | int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size); | |
3326 | ||
3327 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
f5541398 | 3328 | set_mem_size (operands[1], size); |
6fa05db6 AS |
3329 | operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - bitsize); |
3330 | operands[3] = GEN_INT (mask); | |
b628bd8e | 3331 | }) |
4023fb28 | 3332 | |
6fa05db6 AS |
3333 | (define_insn_and_split "*extv<mode>" |
3334 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
3335 | (sign_extract:GPR (match_operand:QI 1 "s_operand" "QS") | |
3336 | (match_operand 2 "const_int_operand" "n") | |
3337 | (const_int 0))) | |
ae156f85 | 3338 | (clobber (reg:CC CC_REGNUM))] |
6fa05db6 AS |
3339 | "INTVAL (operands[2]) > 0 |
3340 | && INTVAL (operands[2]) <= GET_MODE_BITSIZE (SImode)" | |
cc7ab9b7 UW |
3341 | "#" |
3342 | "&& reload_completed" | |
4023fb28 | 3343 | [(parallel |
6fa05db6 | 3344 | [(set (match_dup 0) (unspec:GPR [(match_dup 1) (match_dup 3)] UNSPEC_ICM)) |
ae156f85 | 3345 | (clobber (reg:CC CC_REGNUM))]) |
6fa05db6 AS |
3346 | (parallel |
3347 | [(set (match_dup 0) (ashiftrt:GPR (match_dup 0) (match_dup 2))) | |
3348 | (clobber (reg:CC CC_REGNUM))])] | |
3349 | { | |
3350 | int bitsize = INTVAL (operands[2]); | |
3351 | int size = (bitsize - 1) / BITS_PER_UNIT + 1; /* round up */ | |
3352 | int mask = ((1ul << size) - 1) << (GET_MODE_SIZE (SImode) - size); | |
3353 | ||
3354 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
f5541398 | 3355 | set_mem_size (operands[1], size); |
6fa05db6 AS |
3356 | operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - bitsize); |
3357 | operands[3] = GEN_INT (mask); | |
3358 | }) | |
3359 | ||
3360 | ; | |
3361 | ; insv instruction patterns | |
3362 | ; | |
3363 | ||
3364 | (define_expand "insv" | |
3365 | [(set (zero_extract (match_operand 0 "nonimmediate_operand" "") | |
3366 | (match_operand 1 "const_int_operand" "") | |
3367 | (match_operand 2 "const_int_operand" "")) | |
3368 | (match_operand 3 "general_operand" ""))] | |
3369 | "" | |
4023fb28 | 3370 | { |
6fa05db6 AS |
3371 | if (s390_expand_insv (operands[0], operands[1], operands[2], operands[3])) |
3372 | DONE; | |
3373 | FAIL; | |
b628bd8e | 3374 | }) |
4023fb28 | 3375 | |
22ac2c2f AK |
3376 | (define_insn "*insv<mode>_zEC12" |
3377 | [(set (zero_extract:GPR (match_operand:GPR 0 "nonimmediate_operand" "+d") | |
3378 | (match_operand 1 "const_int_operand" "I") | |
3379 | (match_operand 2 "const_int_operand" "I")) | |
3380 | (match_operand:GPR 3 "nonimmediate_operand" "d"))] | |
3381 | "TARGET_ZEC12 | |
3382 | && (INTVAL (operands[1]) + INTVAL (operands[2])) <= | |
3383 | GET_MODE_BITSIZE (<MODE>mode)" | |
3384 | { | |
3385 | int start = INTVAL (operands[2]); | |
3386 | int size = INTVAL (operands[1]); | |
3387 | int offset = 64 - GET_MODE_BITSIZE (<MODE>mode); | |
3388 | ||
3389 | operands[2] = GEN_INT (offset + start); /* start bit position */ | |
3390 | operands[1] = GEN_INT (offset + start + size - 1); /* end bit position */ | |
3391 | operands[4] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - | |
3392 | start - size); /* left shift count */ | |
3393 | ||
3394 | return "risbgn\t%0,%3,%b2,%b1,%b4"; | |
3395 | } | |
3396 | [(set_attr "op_type" "RIE")]) | |
3397 | ||
963fc8d0 AK |
3398 | (define_insn "*insv<mode>_z10" |
3399 | [(set (zero_extract:GPR (match_operand:GPR 0 "nonimmediate_operand" "+d") | |
3400 | (match_operand 1 "const_int_operand" "I") | |
3401 | (match_operand 2 "const_int_operand" "I")) | |
3402 | (match_operand:GPR 3 "nonimmediate_operand" "d")) | |
3403 | (clobber (reg:CC CC_REGNUM))] | |
3404 | "TARGET_Z10 | |
3405 | && (INTVAL (operands[1]) + INTVAL (operands[2])) <= | |
3406 | GET_MODE_BITSIZE (<MODE>mode)" | |
3407 | { | |
3408 | int start = INTVAL (operands[2]); | |
3409 | int size = INTVAL (operands[1]); | |
3410 | int offset = 64 - GET_MODE_BITSIZE (<MODE>mode); | |
3411 | ||
3412 | operands[2] = GEN_INT (offset + start); /* start bit position */ | |
3413 | operands[1] = GEN_INT (offset + start + size - 1); /* end bit position */ | |
3414 | operands[4] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) - | |
3415 | start - size); /* left shift count */ | |
3416 | ||
3417 | return "risbg\t%0,%3,%b2,%b1,%b4"; | |
3418 | } | |
9381e3f1 WG |
3419 | [(set_attr "op_type" "RIE") |
3420 | (set_attr "z10prop" "z10_super_E1")]) | |
963fc8d0 | 3421 | |
22ac2c2f AK |
3422 | ; and op1 with a mask being 1 for the selected bits and 0 for the rest |
3423 | ; and op3=op0 with a mask being 0 for the selected bits and 1 for the rest | |
3424 | (define_insn "*insv<mode>_zEC12_noshift" | |
3425 | [(set (match_operand:GPR 0 "nonimmediate_operand" "=d") | |
3426 | (ior:GPR (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "d") | |
75ca1b39 | 3427 | (match_operand:GPR 2 "contiguous_bitmask_operand" "")) |
22ac2c2f | 3428 | (and:GPR (match_operand:GPR 3 "nonimmediate_operand" "0") |
75ca1b39 RH |
3429 | (match_operand:GPR 4 "const_int_operand" ""))))] |
3430 | "TARGET_ZEC12 && INTVAL (operands[2]) == ~INTVAL (operands[4])" | |
3431 | "risbgn\t%0,%1,%<bfstart>2,%<bfend>2,0" | |
22ac2c2f AK |
3432 | [(set_attr "op_type" "RIE")]) |
3433 | ||
963fc8d0 AK |
3434 | (define_insn "*insv<mode>_z10_noshift" |
3435 | [(set (match_operand:GPR 0 "nonimmediate_operand" "=d") | |
3436 | (ior:GPR (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "d") | |
75ca1b39 | 3437 | (match_operand:GPR 2 "contiguous_bitmask_operand" "")) |
963fc8d0 | 3438 | (and:GPR (match_operand:GPR 3 "nonimmediate_operand" "0") |
75ca1b39 | 3439 | (match_operand:GPR 4 "const_int_operand" "")))) |
963fc8d0 | 3440 | (clobber (reg:CC CC_REGNUM))] |
75ca1b39 RH |
3441 | "TARGET_Z10 && INTVAL (operands[2]) == ~INTVAL (operands[4])" |
3442 | "risbg\t%0,%1,%<bfstart>2,%<bfend>2,0" | |
9381e3f1 WG |
3443 | [(set_attr "op_type" "RIE") |
3444 | (set_attr "z10prop" "z10_super_E1")]) | |
963fc8d0 AK |
3445 | |
3446 | ; and op1 with a mask being 1 for the selected bits and 0 for the rest | |
3447 | (define_insn "*insv<mode>_or_z10_noshift" | |
3448 | [(set (match_operand:GPR 0 "nonimmediate_operand" "=d") | |
3449 | (ior:GPR (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "d") | |
75ca1b39 | 3450 | (match_operand:GPR 2 "contiguous_bitmask_operand" "")) |
963fc8d0 AK |
3451 | (match_operand:GPR 3 "nonimmediate_operand" "0"))) |
3452 | (clobber (reg:CC CC_REGNUM))] | |
75ca1b39 RH |
3453 | "TARGET_Z10" |
3454 | "rosbg\t%0,%1,%<bfstart>2,%<bfend>2,0" | |
963fc8d0 AK |
3455 | [(set_attr "op_type" "RIE")]) |
3456 | ||
6fa05db6 | 3457 | (define_insn "*insv<mode>_mem_reg" |
9602b6a1 | 3458 | [(set (zero_extract:W (match_operand:QI 0 "memory_operand" "+Q,S") |
6fa05db6 AS |
3459 | (match_operand 1 "const_int_operand" "n,n") |
3460 | (const_int 0)) | |
9602b6a1 | 3461 | (match_operand:W 2 "register_operand" "d,d"))] |
6fa05db6 AS |
3462 | "INTVAL (operands[1]) > 0 |
3463 | && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) | |
3464 | && INTVAL (operands[1]) % BITS_PER_UNIT == 0" | |
3465 | { | |
3466 | int size = INTVAL (operands[1]) / BITS_PER_UNIT; | |
3467 | ||
3468 | operands[1] = GEN_INT ((1ul << size) - 1); | |
9381e3f1 | 3469 | return (which_alternative == 0) ? "stcm\t%2,%1,%S0" |
6fa05db6 AS |
3470 | : "stcmy\t%2,%1,%S0"; |
3471 | } | |
9381e3f1 WG |
3472 | [(set_attr "op_type" "RS,RSY") |
3473 | (set_attr "z10prop" "z10_super,z10_super")]) | |
6fa05db6 AS |
3474 | |
3475 | (define_insn "*insvdi_mem_reghigh" | |
3476 | [(set (zero_extract:DI (match_operand:QI 0 "memory_operand" "+QS") | |
3477 | (match_operand 1 "const_int_operand" "n") | |
3478 | (const_int 0)) | |
3479 | (lshiftrt:DI (match_operand:DI 2 "register_operand" "d") | |
3480 | (const_int 32)))] | |
9602b6a1 | 3481 | "TARGET_ZARCH |
6fa05db6 AS |
3482 | && INTVAL (operands[1]) > 0 |
3483 | && INTVAL (operands[1]) <= GET_MODE_BITSIZE (SImode) | |
3484 | && INTVAL (operands[1]) % BITS_PER_UNIT == 0" | |
3485 | { | |
3486 | int size = INTVAL (operands[1]) / BITS_PER_UNIT; | |
3487 | ||
3488 | operands[1] = GEN_INT ((1ul << size) - 1); | |
3489 | return "stcmh\t%2,%1,%S0"; | |
3490 | } | |
9381e3f1 WG |
3491 | [(set_attr "op_type" "RSY") |
3492 | (set_attr "z10prop" "z10_super")]) | |
6fa05db6 | 3493 | |
9602b6a1 AK |
3494 | (define_insn "*insvdi_reg_imm" |
3495 | [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d") | |
3496 | (const_int 16) | |
3497 | (match_operand 1 "const_int_operand" "n")) | |
3498 | (match_operand:DI 2 "const_int_operand" "n"))] | |
6fa05db6 AS |
3499 | "TARGET_ZARCH |
3500 | && INTVAL (operands[1]) >= 0 | |
3501 | && INTVAL (operands[1]) < BITS_PER_WORD | |
3502 | && INTVAL (operands[1]) % 16 == 0" | |
3503 | { | |
3504 | switch (BITS_PER_WORD - INTVAL (operands[1])) | |
3505 | { | |
3506 | case 64: return "iihh\t%0,%x2"; break; | |
3507 | case 48: return "iihl\t%0,%x2"; break; | |
3508 | case 32: return "iilh\t%0,%x2"; break; | |
3509 | case 16: return "iill\t%0,%x2"; break; | |
3510 | default: gcc_unreachable(); | |
3511 | } | |
3512 | } | |
9381e3f1 WG |
3513 | [(set_attr "op_type" "RI") |
3514 | (set_attr "z10prop" "z10_super_E1")]) | |
3515 | ||
9fec758d WG |
3516 | ; Update the left-most 32 bit of a DI. |
3517 | (define_insn "*insv_h_di_reg_extimm" | |
3518 | [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+d") | |
3519 | (const_int 32) | |
3520 | (const_int 0)) | |
3521 | (match_operand:DI 1 "const_int_operand" "n"))] | |
3522 | "TARGET_EXTIMM" | |
3523 | "iihf\t%0,%o1" | |
3524 | [(set_attr "op_type" "RIL") | |
3525 | (set_attr "z10prop" "z10_fwd_E1")]) | |
6fa05db6 | 3526 | |
9fec758d WG |
3527 | ; Update the right-most 32 bit of a DI, or the whole of a SI. |
3528 | (define_insn "*insv_l<mode>_reg_extimm" | |
6fa05db6 AS |
3529 | [(set (zero_extract:P (match_operand:P 0 "register_operand" "+d") |
3530 | (const_int 32) | |
3531 | (match_operand 1 "const_int_operand" "n")) | |
0101708c | 3532 | (match_operand:P 2 "const_int_operand" "n"))] |
6fa05db6 | 3533 | "TARGET_EXTIMM |
9fec758d WG |
3534 | && BITS_PER_WORD - INTVAL (operands[1]) == 32" |
3535 | "iilf\t%0,%o2" | |
9381e3f1 | 3536 | [(set_attr "op_type" "RIL") |
9fec758d | 3537 | (set_attr "z10prop" "z10_fwd_A1")]) |
6fa05db6 | 3538 | |
9db1d521 HP |
3539 | ; |
3540 | ; extendsidi2 instruction pattern(s). | |
3541 | ; | |
3542 | ||
4023fb28 UW |
3543 | (define_expand "extendsidi2" |
3544 | [(set (match_operand:DI 0 "register_operand" "") | |
3545 | (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] | |
3546 | "" | |
4023fb28 | 3547 | { |
9602b6a1 | 3548 | if (!TARGET_ZARCH) |
4023fb28 | 3549 | { |
c41c1387 | 3550 | emit_clobber (operands[0]); |
9f37ccb1 UW |
3551 | emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]); |
3552 | emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx); | |
3553 | emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32))); | |
4023fb28 UW |
3554 | DONE; |
3555 | } | |
ec24698e | 3556 | }) |
4023fb28 UW |
3557 | |
3558 | (define_insn "*extendsidi2" | |
963fc8d0 AK |
3559 | [(set (match_operand:DI 0 "register_operand" "=d,d,d") |
3560 | (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))] | |
9602b6a1 | 3561 | "TARGET_ZARCH" |
9db1d521 | 3562 | "@ |
d40c829f | 3563 | lgfr\t%0,%1 |
963fc8d0 AK |
3564 | lgf\t%0,%1 |
3565 | lgfrl\t%0,%1" | |
3566 | [(set_attr "op_type" "RRE,RXY,RIL") | |
3567 | (set_attr "type" "*,*,larl") | |
9381e3f1 WG |
3568 | (set_attr "cpu_facility" "*,*,z10") |
3569 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 3570 | |
9db1d521 | 3571 | ; |
56477c21 | 3572 | ; extend(hi|qi)(si|di)2 instruction pattern(s). |
9db1d521 HP |
3573 | ; |
3574 | ||
56477c21 AS |
3575 | (define_expand "extend<HQI:mode><DSI:mode>2" |
3576 | [(set (match_operand:DSI 0 "register_operand" "") | |
3577 | (sign_extend:DSI (match_operand:HQI 1 "nonimmediate_operand" "")))] | |
4023fb28 | 3578 | "" |
4023fb28 | 3579 | { |
9602b6a1 | 3580 | if (<DSI:MODE>mode == DImode && !TARGET_ZARCH) |
4023fb28 UW |
3581 | { |
3582 | rtx tmp = gen_reg_rtx (SImode); | |
56477c21 | 3583 | emit_insn (gen_extend<HQI:mode>si2 (tmp, operands[1])); |
4023fb28 UW |
3584 | emit_insn (gen_extendsidi2 (operands[0], tmp)); |
3585 | DONE; | |
3586 | } | |
ec24698e | 3587 | else if (!TARGET_EXTIMM) |
4023fb28 | 3588 | { |
56477c21 AS |
3589 | rtx bitcount = GEN_INT (GET_MODE_BITSIZE (<DSI:MODE>mode) - |
3590 | GET_MODE_BITSIZE (<HQI:MODE>mode)); | |
3591 | ||
3592 | operands[1] = gen_lowpart (<DSI:MODE>mode, operands[1]); | |
3593 | emit_insn (gen_ashl<DSI:mode>3 (operands[0], operands[1], bitcount)); | |
3594 | emit_insn (gen_ashr<DSI:mode>3 (operands[0], operands[0], bitcount)); | |
4023fb28 UW |
3595 | DONE; |
3596 | } | |
ec24698e UW |
3597 | }) |
3598 | ||
56477c21 AS |
3599 | ; |
3600 | ; extendhidi2 instruction pattern(s). | |
3601 | ; | |
3602 | ||
ec24698e | 3603 | (define_insn "*extendhidi2_extimm" |
963fc8d0 AK |
3604 | [(set (match_operand:DI 0 "register_operand" "=d,d,d") |
3605 | (sign_extend:DI (match_operand:HI 1 "general_operand" "d,RT,b")))] | |
9602b6a1 | 3606 | "TARGET_ZARCH && TARGET_EXTIMM" |
ec24698e UW |
3607 | "@ |
3608 | lghr\t%0,%1 | |
963fc8d0 AK |
3609 | lgh\t%0,%1 |
3610 | lghrl\t%0,%1" | |
3611 | [(set_attr "op_type" "RRE,RXY,RIL") | |
3612 | (set_attr "type" "*,*,larl") | |
9381e3f1 WG |
3613 | (set_attr "cpu_facility" "extimm,extimm,z10") |
3614 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1")]) | |
4023fb28 UW |
3615 | |
3616 | (define_insn "*extendhidi2" | |
9db1d521 | 3617 | [(set (match_operand:DI 0 "register_operand" "=d") |
fb492564 | 3618 | (sign_extend:DI (match_operand:HI 1 "memory_operand" "RT")))] |
9602b6a1 | 3619 | "TARGET_ZARCH" |
d40c829f | 3620 | "lgh\t%0,%1" |
9381e3f1 WG |
3621 | [(set_attr "op_type" "RXY") |
3622 | (set_attr "z10prop" "z10_super_E1")]) | |
9db1d521 | 3623 | |
9db1d521 | 3624 | ; |
56477c21 | 3625 | ; extendhisi2 instruction pattern(s). |
9db1d521 HP |
3626 | ; |
3627 | ||
ec24698e | 3628 | (define_insn "*extendhisi2_extimm" |
963fc8d0 AK |
3629 | [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") |
3630 | (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" " d,R,T,b")))] | |
ec24698e UW |
3631 | "TARGET_EXTIMM" |
3632 | "@ | |
3633 | lhr\t%0,%1 | |
3634 | lh\t%0,%1 | |
963fc8d0 AK |
3635 | lhy\t%0,%1 |
3636 | lhrl\t%0,%1" | |
3637 | [(set_attr "op_type" "RRE,RX,RXY,RIL") | |
3638 | (set_attr "type" "*,*,*,larl") | |
9381e3f1 WG |
3639 | (set_attr "cpu_facility" "extimm,extimm,extimm,z10") |
3640 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 3641 | |
4023fb28 | 3642 | (define_insn "*extendhisi2" |
d3632d41 UW |
3643 | [(set (match_operand:SI 0 "register_operand" "=d,d") |
3644 | (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))] | |
ec24698e | 3645 | "!TARGET_EXTIMM" |
d3632d41 | 3646 | "@ |
d40c829f UW |
3647 | lh\t%0,%1 |
3648 | lhy\t%0,%1" | |
9381e3f1 WG |
3649 | [(set_attr "op_type" "RX,RXY") |
3650 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
9db1d521 | 3651 | |
56477c21 AS |
3652 | ; |
3653 | ; extendqi(si|di)2 instruction pattern(s). | |
3654 | ; | |
3655 | ||
43a09b63 | 3656 | ; lbr, lgbr, lb, lgb |
56477c21 AS |
3657 | (define_insn "*extendqi<mode>2_extimm" |
3658 | [(set (match_operand:GPR 0 "register_operand" "=d,d") | |
fb492564 | 3659 | (sign_extend:GPR (match_operand:QI 1 "nonimmediate_operand" "d,RT")))] |
ec24698e UW |
3660 | "TARGET_EXTIMM" |
3661 | "@ | |
56477c21 AS |
3662 | l<g>br\t%0,%1 |
3663 | l<g>b\t%0,%1" | |
9381e3f1 WG |
3664 | [(set_attr "op_type" "RRE,RXY") |
3665 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
ec24698e | 3666 | |
43a09b63 | 3667 | ; lb, lgb |
56477c21 AS |
3668 | (define_insn "*extendqi<mode>2" |
3669 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
fb492564 | 3670 | (sign_extend:GPR (match_operand:QI 1 "memory_operand" "RT")))] |
56477c21 AS |
3671 | "!TARGET_EXTIMM && TARGET_LONG_DISPLACEMENT" |
3672 | "l<g>b\t%0,%1" | |
9381e3f1 WG |
3673 | [(set_attr "op_type" "RXY") |
3674 | (set_attr "z10prop" "z10_super_E1")]) | |
d3632d41 | 3675 | |
56477c21 AS |
3676 | (define_insn_and_split "*extendqi<mode>2_short_displ" |
3677 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
3678 | (sign_extend:GPR (match_operand:QI 1 "s_operand" "Q"))) | |
ae156f85 | 3679 | (clobber (reg:CC CC_REGNUM))] |
56477c21 | 3680 | "!TARGET_EXTIMM && !TARGET_LONG_DISPLACEMENT" |
19796784 AK |
3681 | "#" |
3682 | "&& reload_completed" | |
4023fb28 | 3683 | [(parallel |
56477c21 | 3684 | [(set (match_dup 0) (unspec:GPR [(match_dup 1) (const_int 8)] UNSPEC_ICM)) |
ae156f85 | 3685 | (clobber (reg:CC CC_REGNUM))]) |
4023fb28 | 3686 | (parallel |
56477c21 | 3687 | [(set (match_dup 0) (ashiftrt:GPR (match_dup 0) (match_dup 2))) |
ae156f85 | 3688 | (clobber (reg:CC CC_REGNUM))])] |
6fa05db6 AS |
3689 | { |
3690 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
f5541398 | 3691 | set_mem_size (operands[1], GET_MODE_SIZE (QImode)); |
56477c21 AS |
3692 | operands[2] = GEN_INT (GET_MODE_BITSIZE (<MODE>mode) |
3693 | - GET_MODE_BITSIZE (QImode)); | |
6fa05db6 | 3694 | }) |
9db1d521 | 3695 | |
9db1d521 HP |
3696 | ; |
3697 | ; zero_extendsidi2 instruction pattern(s). | |
3698 | ; | |
3699 | ||
4023fb28 UW |
3700 | (define_expand "zero_extendsidi2" |
3701 | [(set (match_operand:DI 0 "register_operand" "") | |
3702 | (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))] | |
3703 | "" | |
4023fb28 | 3704 | { |
9602b6a1 | 3705 | if (!TARGET_ZARCH) |
4023fb28 | 3706 | { |
c41c1387 | 3707 | emit_clobber (operands[0]); |
9f37ccb1 UW |
3708 | emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]); |
3709 | emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx); | |
4023fb28 UW |
3710 | DONE; |
3711 | } | |
ec24698e | 3712 | }) |
4023fb28 UW |
3713 | |
3714 | (define_insn "*zero_extendsidi2" | |
963fc8d0 AK |
3715 | [(set (match_operand:DI 0 "register_operand" "=d,d,d") |
3716 | (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,RT,b")))] | |
9602b6a1 | 3717 | "TARGET_ZARCH" |
9db1d521 | 3718 | "@ |
d40c829f | 3719 | llgfr\t%0,%1 |
963fc8d0 AK |
3720 | llgf\t%0,%1 |
3721 | llgfrl\t%0,%1" | |
3722 | [(set_attr "op_type" "RRE,RXY,RIL") | |
3723 | (set_attr "type" "*,*,larl") | |
9381e3f1 WG |
3724 | (set_attr "cpu_facility" "*,*,z10") |
3725 | (set_attr "z10prop" "z10_fwd_E1,z10_fwd_A3,z10_fwd_A3")]) | |
9db1d521 | 3726 | |
288e517f AK |
3727 | ; |
3728 | ; LLGT-type instructions (zero-extend from 31 bit to 64 bit). | |
3729 | ; | |
3730 | ||
d6083c7d UW |
3731 | (define_insn "*llgt_sidi" |
3732 | [(set (match_operand:DI 0 "register_operand" "=d") | |
fb492564 | 3733 | (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0) |
d6083c7d | 3734 | (const_int 2147483647)))] |
9602b6a1 | 3735 | "TARGET_ZARCH" |
d6083c7d | 3736 | "llgt\t%0,%1" |
9381e3f1 WG |
3737 | [(set_attr "op_type" "RXE") |
3738 | (set_attr "z10prop" "z10_super_E1")]) | |
d6083c7d UW |
3739 | |
3740 | (define_insn_and_split "*llgt_sidi_split" | |
3741 | [(set (match_operand:DI 0 "register_operand" "=d") | |
fb492564 | 3742 | (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "RT") 0) |
d6083c7d | 3743 | (const_int 2147483647))) |
ae156f85 | 3744 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 3745 | "TARGET_ZARCH" |
d6083c7d UW |
3746 | "#" |
3747 | "&& reload_completed" | |
3748 | [(set (match_dup 0) | |
3749 | (and:DI (subreg:DI (match_dup 1) 0) | |
3750 | (const_int 2147483647)))] | |
3751 | "") | |
3752 | ||
288e517f AK |
3753 | (define_insn "*llgt_sisi" |
3754 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
fb492564 | 3755 | (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,RT") |
288e517f | 3756 | (const_int 2147483647)))] |
c4d50129 | 3757 | "TARGET_ZARCH" |
288e517f AK |
3758 | "@ |
3759 | llgtr\t%0,%1 | |
3760 | llgt\t%0,%1" | |
9381e3f1 WG |
3761 | [(set_attr "op_type" "RRE,RXE") |
3762 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
288e517f | 3763 | |
288e517f AK |
3764 | (define_insn "*llgt_didi" |
3765 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
3766 | (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") | |
3767 | (const_int 2147483647)))] | |
9602b6a1 | 3768 | "TARGET_ZARCH" |
288e517f AK |
3769 | "@ |
3770 | llgtr\t%0,%1 | |
3771 | llgt\t%0,%N1" | |
9381e3f1 WG |
3772 | [(set_attr "op_type" "RRE,RXE") |
3773 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
288e517f | 3774 | |
f19a9af7 | 3775 | (define_split |
9602b6a1 AK |
3776 | [(set (match_operand:DSI 0 "register_operand" "") |
3777 | (and:DSI (match_operand:DSI 1 "nonimmediate_operand" "") | |
f6ee577c | 3778 | (const_int 2147483647))) |
ae156f85 | 3779 | (clobber (reg:CC CC_REGNUM))] |
c4d50129 | 3780 | "TARGET_ZARCH && reload_completed" |
288e517f | 3781 | [(set (match_dup 0) |
9602b6a1 | 3782 | (and:DSI (match_dup 1) |
f6ee577c | 3783 | (const_int 2147483647)))] |
288e517f AK |
3784 | "") |
3785 | ||
9db1d521 | 3786 | ; |
56477c21 | 3787 | ; zero_extend(hi|qi)(si|di)2 instruction pattern(s). |
9db1d521 HP |
3788 | ; |
3789 | ||
56477c21 AS |
3790 | (define_expand "zero_extend<mode>di2" |
3791 | [(set (match_operand:DI 0 "register_operand" "") | |
3792 | (zero_extend:DI (match_operand:HQI 1 "nonimmediate_operand" "")))] | |
3793 | "" | |
3794 | { | |
9602b6a1 | 3795 | if (!TARGET_ZARCH) |
56477c21 AS |
3796 | { |
3797 | rtx tmp = gen_reg_rtx (SImode); | |
3798 | emit_insn (gen_zero_extend<mode>si2 (tmp, operands[1])); | |
3799 | emit_insn (gen_zero_extendsidi2 (operands[0], tmp)); | |
3800 | DONE; | |
3801 | } | |
3802 | else if (!TARGET_EXTIMM) | |
3803 | { | |
9381e3f1 | 3804 | rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) - |
56477c21 AS |
3805 | GET_MODE_BITSIZE(<MODE>mode)); |
3806 | operands[1] = gen_lowpart (DImode, operands[1]); | |
3807 | emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount)); | |
3808 | emit_insn (gen_lshrdi3 (operands[0], operands[0], bitcount)); | |
3809 | DONE; | |
3810 | } | |
3811 | }) | |
3812 | ||
f6ee577c | 3813 | (define_expand "zero_extend<mode>si2" |
4023fb28 | 3814 | [(set (match_operand:SI 0 "register_operand" "") |
ec24698e | 3815 | (zero_extend:SI (match_operand:HQI 1 "nonimmediate_operand" "")))] |
9db1d521 | 3816 | "" |
4023fb28 | 3817 | { |
ec24698e UW |
3818 | if (!TARGET_EXTIMM) |
3819 | { | |
3820 | operands[1] = gen_lowpart (SImode, operands[1]); | |
9381e3f1 | 3821 | emit_insn (gen_andsi3 (operands[0], operands[1], |
ec24698e UW |
3822 | GEN_INT ((1 << GET_MODE_BITSIZE(<MODE>mode)) - 1))); |
3823 | DONE; | |
56477c21 | 3824 | } |
ec24698e UW |
3825 | }) |
3826 | ||
963fc8d0 AK |
3827 | ; llhrl, llghrl |
3828 | (define_insn "*zero_extendhi<mode>2_z10" | |
3829 | [(set (match_operand:GPR 0 "register_operand" "=d,d,d") | |
3830 | (zero_extend:GPR (match_operand:HI 1 "nonimmediate_operand" "d,RT,b")))] | |
3831 | "TARGET_Z10" | |
3832 | "@ | |
3833 | ll<g>hr\t%0,%1 | |
3834 | ll<g>h\t%0,%1 | |
3835 | ll<g>hrl\t%0,%1" | |
3836 | [(set_attr "op_type" "RXY,RRE,RIL") | |
3837 | (set_attr "type" "*,*,larl") | |
9381e3f1 | 3838 | (set_attr "cpu_facility" "*,*,z10") |
729e750f | 3839 | (set_attr "z10prop" "z10_super_E1,z10_fwd_A3,z10_fwd_A3")]) |
963fc8d0 | 3840 | |
43a09b63 | 3841 | ; llhr, llcr, llghr, llgcr, llh, llc, llgh, llgc |
56477c21 AS |
3842 | (define_insn "*zero_extend<HQI:mode><GPR:mode>2_extimm" |
3843 | [(set (match_operand:GPR 0 "register_operand" "=d,d") | |
fb492564 | 3844 | (zero_extend:GPR (match_operand:HQI 1 "nonimmediate_operand" "d,RT")))] |
ec24698e UW |
3845 | "TARGET_EXTIMM" |
3846 | "@ | |
56477c21 AS |
3847 | ll<g><hc>r\t%0,%1 |
3848 | ll<g><hc>\t%0,%1" | |
9381e3f1 WG |
3849 | [(set_attr "op_type" "RRE,RXY") |
3850 | (set_attr "z10prop" "z10_super_E1,z10_fwd_A3")]) | |
9db1d521 | 3851 | |
43a09b63 | 3852 | ; llgh, llgc |
56477c21 AS |
3853 | (define_insn "*zero_extend<HQI:mode><GPR:mode>2" |
3854 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
fb492564 | 3855 | (zero_extend:GPR (match_operand:HQI 1 "memory_operand" "RT")))] |
ec24698e | 3856 | "TARGET_ZARCH && !TARGET_EXTIMM" |
f6ee577c | 3857 | "llg<hc>\t%0,%1" |
9381e3f1 WG |
3858 | [(set_attr "op_type" "RXY") |
3859 | (set_attr "z10prop" "z10_fwd_A3")]) | |
cc7ab9b7 UW |
3860 | |
3861 | (define_insn_and_split "*zero_extendhisi2_31" | |
3862 | [(set (match_operand:SI 0 "register_operand" "=&d") | |
02ed3c5e | 3863 | (zero_extend:SI (match_operand:HI 1 "s_operand" "QS"))) |
ae156f85 | 3864 | (clobber (reg:CC CC_REGNUM))] |
f4f41b4e | 3865 | "!TARGET_ZARCH" |
cc7ab9b7 UW |
3866 | "#" |
3867 | "&& reload_completed" | |
3868 | [(set (match_dup 0) (const_int 0)) | |
3869 | (parallel | |
3870 | [(set (strict_low_part (match_dup 2)) (match_dup 1)) | |
ae156f85 | 3871 | (clobber (reg:CC CC_REGNUM))])] |
b628bd8e | 3872 | "operands[2] = gen_lowpart (HImode, operands[0]);") |
c7453384 | 3873 | |
cc7ab9b7 UW |
3874 | (define_insn_and_split "*zero_extendqisi2_31" |
3875 | [(set (match_operand:SI 0 "register_operand" "=&d") | |
fb492564 | 3876 | (zero_extend:SI (match_operand:QI 1 "memory_operand" "RT")))] |
9e8327e3 | 3877 | "!TARGET_ZARCH" |
cc7ab9b7 UW |
3878 | "#" |
3879 | "&& reload_completed" | |
3880 | [(set (match_dup 0) (const_int 0)) | |
3881 | (set (strict_low_part (match_dup 2)) (match_dup 1))] | |
b628bd8e | 3882 | "operands[2] = gen_lowpart (QImode, operands[0]);") |
c7453384 | 3883 | |
9db1d521 HP |
3884 | ; |
3885 | ; zero_extendqihi2 instruction pattern(s). | |
3886 | ; | |
3887 | ||
9db1d521 HP |
3888 | (define_expand "zero_extendqihi2" |
3889 | [(set (match_operand:HI 0 "register_operand" "") | |
4023fb28 | 3890 | (zero_extend:HI (match_operand:QI 1 "register_operand" "")))] |
ec24698e | 3891 | "TARGET_ZARCH && !TARGET_EXTIMM" |
9db1d521 | 3892 | { |
4023fb28 UW |
3893 | operands[1] = gen_lowpart (HImode, operands[1]); |
3894 | emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff))); | |
3895 | DONE; | |
ec24698e | 3896 | }) |
9db1d521 | 3897 | |
4023fb28 | 3898 | (define_insn "*zero_extendqihi2_64" |
9db1d521 | 3899 | [(set (match_operand:HI 0 "register_operand" "=d") |
fb492564 | 3900 | (zero_extend:HI (match_operand:QI 1 "memory_operand" "RT")))] |
ec24698e | 3901 | "TARGET_ZARCH && !TARGET_EXTIMM" |
d40c829f | 3902 | "llgc\t%0,%1" |
9381e3f1 WG |
3903 | [(set_attr "op_type" "RXY") |
3904 | (set_attr "z10prop" "z10_fwd_A3")]) | |
9db1d521 | 3905 | |
cc7ab9b7 UW |
3906 | (define_insn_and_split "*zero_extendqihi2_31" |
3907 | [(set (match_operand:HI 0 "register_operand" "=&d") | |
fb492564 | 3908 | (zero_extend:HI (match_operand:QI 1 "memory_operand" "RT")))] |
9e8327e3 | 3909 | "!TARGET_ZARCH" |
cc7ab9b7 UW |
3910 | "#" |
3911 | "&& reload_completed" | |
3912 | [(set (match_dup 0) (const_int 0)) | |
3913 | (set (strict_low_part (match_dup 2)) (match_dup 1))] | |
b628bd8e | 3914 | "operands[2] = gen_lowpart (QImode, operands[0]);") |
cc7ab9b7 | 3915 | |
609e7e80 AK |
3916 | ; |
3917 | ; fixuns_trunc(dd|td)di2 instruction pattern(s). | |
3918 | ; | |
3919 | ||
3920 | (define_expand "fixuns_truncdddi2" | |
3921 | [(parallel | |
3922 | [(set (match_operand:DI 0 "register_operand" "") | |
3923 | (unsigned_fix:DI (match_operand:DD 1 "register_operand" ""))) | |
65b1d8ea AK |
3924 | (unspec:DI [(const_int 5)] UNSPEC_ROUND) |
3925 | (clobber (reg:CC CC_REGNUM))])] | |
9381e3f1 | 3926 | |
fb068247 | 3927 | "TARGET_HARD_DFP" |
609e7e80 | 3928 | { |
65b1d8ea AK |
3929 | if (!TARGET_Z196) |
3930 | { | |
3931 | rtx label1 = gen_label_rtx (); | |
3932 | rtx label2 = gen_label_rtx (); | |
3933 | rtx temp = gen_reg_rtx (TDmode); | |
3934 | REAL_VALUE_TYPE cmp, sub; | |
3935 | ||
3936 | decimal_real_from_string (&cmp, "9223372036854775808.0"); /* 2^63 */ | |
3937 | decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */ | |
3938 | ||
3939 | /* 2^63 can't be represented as 64bit DFP number with full precision. The | |
3940 | solution is doing the check and the subtraction in TD mode and using a | |
3941 | TD -> DI convert afterwards. */ | |
3942 | emit_insn (gen_extendddtd2 (temp, operands[1])); | |
3943 | temp = force_reg (TDmode, temp); | |
3944 | emit_cmp_and_jump_insns (temp, | |
3945 | CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode), | |
3946 | LT, NULL_RTX, VOIDmode, 0, label1); | |
3947 | emit_insn (gen_subtd3 (temp, temp, | |
3948 | CONST_DOUBLE_FROM_REAL_VALUE (sub, TDmode))); | |
3949 | emit_insn (gen_fix_trunctddi2_dfp (operands[0], temp, GEN_INT (11))); | |
3950 | emit_jump (label2); | |
3951 | ||
3952 | emit_label (label1); | |
3953 | emit_insn (gen_fix_truncdddi2_dfp (operands[0], operands[1], GEN_INT (9))); | |
3954 | emit_label (label2); | |
3955 | DONE; | |
3956 | } | |
609e7e80 AK |
3957 | }) |
3958 | ||
3959 | (define_expand "fixuns_trunctddi2" | |
65b1d8ea AK |
3960 | [(parallel |
3961 | [(set (match_operand:DI 0 "register_operand" "") | |
3962 | (unsigned_fix:DI (match_operand:TD 1 "register_operand" ""))) | |
3963 | (unspec:DI [(const_int 5)] UNSPEC_ROUND) | |
3964 | (clobber (reg:CC CC_REGNUM))])] | |
3965 | ||
fb068247 | 3966 | "TARGET_HARD_DFP" |
609e7e80 | 3967 | { |
65b1d8ea AK |
3968 | if (!TARGET_Z196) |
3969 | { | |
3970 | rtx label1 = gen_label_rtx (); | |
3971 | rtx label2 = gen_label_rtx (); | |
3972 | rtx temp = gen_reg_rtx (TDmode); | |
3973 | REAL_VALUE_TYPE cmp, sub; | |
3974 | ||
3975 | operands[1] = force_reg (TDmode, operands[1]); | |
3976 | decimal_real_from_string (&cmp, "9223372036854775808.0"); /* 2^63 */ | |
3977 | decimal_real_from_string (&sub, "18446744073709551616.0"); /* 2^64 */ | |
3978 | ||
3979 | emit_cmp_and_jump_insns (operands[1], | |
3980 | CONST_DOUBLE_FROM_REAL_VALUE (cmp, TDmode), | |
3981 | LT, NULL_RTX, VOIDmode, 0, label1); | |
3982 | emit_insn (gen_subtd3 (temp, operands[1], | |
3983 | CONST_DOUBLE_FROM_REAL_VALUE (sub, TDmode))); | |
3984 | emit_insn (gen_fix_trunctddi2_dfp (operands[0], temp, GEN_INT (11))); | |
3985 | emit_jump (label2); | |
3986 | ||
3987 | emit_label (label1); | |
3988 | emit_insn (gen_fix_trunctddi2_dfp (operands[0], operands[1], GEN_INT (9))); | |
3989 | emit_label (label2); | |
3990 | DONE; | |
3991 | } | |
609e7e80 | 3992 | }) |
cc7ab9b7 | 3993 | |
9db1d521 | 3994 | ; |
65b1d8ea | 3995 | ; fixuns_trunc(sf|df|tf)(si|di)2 and fix_trunc(sf|df|tf)(si|di)2 |
609e7e80 | 3996 | ; instruction pattern(s). |
9db1d521 HP |
3997 | ; |
3998 | ||
7b6baae1 | 3999 | (define_expand "fixuns_trunc<BFP:mode><GPR:mode>2" |
65b1d8ea AK |
4000 | [(parallel |
4001 | [(set (match_operand:GPR 0 "register_operand" "") | |
4002 | (unsigned_fix:GPR (match_operand:BFP 1 "register_operand" ""))) | |
4003 | (unspec:GPR [(const_int 5)] UNSPEC_ROUND) | |
4004 | (clobber (reg:CC CC_REGNUM))])] | |
142cd70f | 4005 | "TARGET_HARD_FLOAT" |
9db1d521 | 4006 | { |
65b1d8ea AK |
4007 | if (!TARGET_Z196) |
4008 | { | |
4009 | rtx label1 = gen_label_rtx (); | |
4010 | rtx label2 = gen_label_rtx (); | |
4011 | rtx temp = gen_reg_rtx (<BFP:MODE>mode); | |
4012 | REAL_VALUE_TYPE cmp, sub; | |
4013 | ||
4014 | operands[1] = force_reg (<BFP:MODE>mode, operands[1]); | |
4015 | real_2expN (&cmp, GET_MODE_BITSIZE(<GPR:MODE>mode) - 1, <BFP:MODE>mode); | |
4016 | real_2expN (&sub, GET_MODE_BITSIZE(<GPR:MODE>mode), <BFP:MODE>mode); | |
4017 | ||
4018 | emit_cmp_and_jump_insns (operands[1], | |
4019 | CONST_DOUBLE_FROM_REAL_VALUE (cmp, <BFP:MODE>mode), | |
4020 | LT, NULL_RTX, VOIDmode, 0, label1); | |
4021 | emit_insn (gen_sub<BFP:mode>3 (temp, operands[1], | |
4022 | CONST_DOUBLE_FROM_REAL_VALUE (sub, <BFP:MODE>mode))); | |
4023 | emit_insn (gen_fix_trunc<BFP:mode><GPR:mode>2_bfp (operands[0], temp, | |
4024 | GEN_INT (7))); | |
4025 | emit_jump (label2); | |
4026 | ||
4027 | emit_label (label1); | |
4028 | emit_insn (gen_fix_trunc<BFP:mode><GPR:mode>2_bfp (operands[0], | |
4029 | operands[1], GEN_INT (5))); | |
4030 | emit_label (label2); | |
4031 | DONE; | |
4032 | } | |
10bbf137 | 4033 | }) |
9db1d521 | 4034 | |
65b1d8ea AK |
4035 | ; fixuns_trunc(td|dd)si2 expander |
4036 | (define_expand "fixuns_trunc<mode>si2" | |
4037 | [(parallel | |
4038 | [(set (match_operand:SI 0 "register_operand" "") | |
4039 | (unsigned_fix:SI (match_operand:DFP 1 "register_operand" ""))) | |
4040 | (unspec:SI [(const_int 5)] UNSPEC_ROUND) | |
4041 | (clobber (reg:CC CC_REGNUM))])] | |
8540e6e8 | 4042 | "TARGET_Z196 && TARGET_HARD_DFP" |
65b1d8ea AK |
4043 | "") |
4044 | ||
4045 | ; fixuns_trunc(tf|df|sf|td|dd)(di|si)2 instruction patterns. | |
4046 | ||
4047 | ; clfebr, clfdbr, clfxbr, clgebr, clgdbr, clgxbr | |
4048 | ; clfdtr, clfxtr, clgdtr, clgxtr | |
4049 | (define_insn "*fixuns_trunc<FP:mode><GPR:mode>2_z196" | |
4050 | [(set (match_operand:GPR 0 "register_operand" "=r") | |
4051 | (unsigned_fix:GPR (match_operand:FP 1 "register_operand" "f"))) | |
4052 | (unspec:GPR [(match_operand:GPR 2 "immediate_operand" "K")] UNSPEC_ROUND) | |
4053 | (clobber (reg:CC CC_REGNUM))] | |
4054 | "TARGET_Z196" | |
4055 | "cl<GPR:gf><FP:xde><FP:bt>r\t%0,%h2,%1,0" | |
4056 | [(set_attr "op_type" "RRF") | |
4057 | (set_attr "type" "ftoi")]) | |
4058 | ||
b60cb710 AK |
4059 | (define_expand "fix_trunc<DSF:mode><GPR:mode>2" |
4060 | [(set (match_operand:GPR 0 "register_operand" "") | |
4061 | (fix:GPR (match_operand:DSF 1 "register_operand" "")))] | |
4062 | "TARGET_HARD_FLOAT" | |
9db1d521 | 4063 | { |
b60cb710 AK |
4064 | emit_insn (gen_fix_trunc<DSF:mode><GPR:mode>2_bfp (operands[0], operands[1], |
4065 | GEN_INT (5))); | |
9db1d521 | 4066 | DONE; |
10bbf137 | 4067 | }) |
9db1d521 | 4068 | |
43a09b63 | 4069 | ; cgxbr, cgdbr, cgebr, cfxbr, cfdbr, cfebr |
142cd70f | 4070 | (define_insn "fix_trunc<BFP:mode><GPR:mode>2_bfp" |
2f8f8434 | 4071 | [(set (match_operand:GPR 0 "register_operand" "=d") |
7b6baae1 | 4072 | (fix:GPR (match_operand:BFP 1 "register_operand" "f"))) |
2f8f8434 | 4073 | (unspec:GPR [(match_operand:GPR 2 "immediate_operand" "K")] UNSPEC_ROUND) |
ae156f85 | 4074 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 4075 | "TARGET_HARD_FLOAT" |
7b6baae1 | 4076 | "c<GPR:gf><BFP:xde>br\t%0,%h2,%1" |
9db1d521 | 4077 | [(set_attr "op_type" "RRE") |
077dab3b | 4078 | (set_attr "type" "ftoi")]) |
9db1d521 | 4079 | |
609e7e80 AK |
4080 | |
4081 | ; | |
4082 | ; fix_trunc(td|dd)di2 instruction pattern(s). | |
4083 | ; | |
4084 | ||
99cd7dd0 AK |
4085 | (define_expand "fix_trunc<mode>di2" |
4086 | [(set (match_operand:DI 0 "register_operand" "") | |
4087 | (fix:DI (match_operand:DFP 1 "nonimmediate_operand" "")))] | |
9602b6a1 | 4088 | "TARGET_ZARCH && TARGET_HARD_DFP" |
99cd7dd0 AK |
4089 | { |
4090 | operands[1] = force_reg (<MODE>mode, operands[1]); | |
4091 | emit_insn (gen_fix_trunc<mode>di2_dfp (operands[0], operands[1], | |
4092 | GEN_INT (9))); | |
4093 | DONE; | |
4094 | }) | |
4095 | ||
609e7e80 | 4096 | ; cgxtr, cgdtr |
99cd7dd0 | 4097 | (define_insn "fix_trunc<DFP:mode>di2_dfp" |
609e7e80 AK |
4098 | [(set (match_operand:DI 0 "register_operand" "=d") |
4099 | (fix:DI (match_operand:DFP 1 "register_operand" "f"))) | |
4100 | (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) | |
4101 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 | 4102 | "TARGET_ZARCH && TARGET_HARD_DFP" |
609e7e80 AK |
4103 | "cg<DFP:xde>tr\t%0,%h2,%1" |
4104 | [(set_attr "op_type" "RRF") | |
9381e3f1 | 4105 | (set_attr "type" "ftoidfp")]) |
609e7e80 AK |
4106 | |
4107 | ||
f61a2c7d AK |
4108 | ; |
4109 | ; fix_trunctf(si|di)2 instruction pattern(s). | |
4110 | ; | |
4111 | ||
4112 | (define_expand "fix_trunctf<mode>2" | |
4113 | [(parallel [(set (match_operand:GPR 0 "register_operand" "") | |
4114 | (fix:GPR (match_operand:TF 1 "register_operand" ""))) | |
4115 | (unspec:GPR [(const_int 5)] UNSPEC_ROUND) | |
4116 | (clobber (reg:CC CC_REGNUM))])] | |
9db1d521 | 4117 | "TARGET_HARD_FLOAT" |
142cd70f | 4118 | "") |
9db1d521 | 4119 | |
9db1d521 | 4120 | |
9db1d521 | 4121 | ; |
142cd70f | 4122 | ; float(si|di)(tf|df|sf|td|dd)2 instruction pattern(s). |
9db1d521 HP |
4123 | ; |
4124 | ||
609e7e80 | 4125 | ; cxgbr, cdgbr, cegbr, cxgtr, cdgtr |
f5905b37 | 4126 | (define_insn "floatdi<mode>2" |
609e7e80 AK |
4127 | [(set (match_operand:FP 0 "register_operand" "=f") |
4128 | (float:FP (match_operand:DI 1 "register_operand" "d")))] | |
9602b6a1 | 4129 | "TARGET_ZARCH && TARGET_HARD_FLOAT" |
609e7e80 | 4130 | "c<xde>g<bt>r\t%0,%1" |
9db1d521 | 4131 | [(set_attr "op_type" "RRE") |
9381e3f1 | 4132 | (set_attr "type" "itof<mode>" )]) |
9db1d521 | 4133 | |
43a09b63 | 4134 | ; cxfbr, cdfbr, cefbr |
142cd70f | 4135 | (define_insn "floatsi<mode>2" |
7b6baae1 AK |
4136 | [(set (match_operand:BFP 0 "register_operand" "=f") |
4137 | (float:BFP (match_operand:SI 1 "register_operand" "d")))] | |
142cd70f | 4138 | "TARGET_HARD_FLOAT" |
f61a2c7d AK |
4139 | "c<xde>fbr\t%0,%1" |
4140 | [(set_attr "op_type" "RRE") | |
9381e3f1 | 4141 | (set_attr "type" "itof<mode>" )]) |
f61a2c7d | 4142 | |
65b1d8ea AK |
4143 | ; cxftr, cdftr |
4144 | (define_insn "floatsi<mode>2" | |
4145 | [(set (match_operand:DFP 0 "register_operand" "=f") | |
4146 | (float:DFP (match_operand:SI 1 "register_operand" "d")))] | |
4147 | "TARGET_Z196 && TARGET_HARD_FLOAT" | |
4148 | "c<xde>ftr\t%0,0,%1,0" | |
4149 | [(set_attr "op_type" "RRE") | |
4150 | (set_attr "type" "itof<mode>" )]) | |
4151 | ||
4152 | ; | |
4153 | ; floatuns(si|di)(tf|df|sf|td|dd)2 instruction pattern(s). | |
4154 | ; | |
4155 | ||
4156 | ; cxlgbr, cdlgbr, celgbr, cxlgtr, cdlgtr | |
4157 | ; cxlfbr, cdlfbr, celfbr, cxlftr, cdlftr | |
4158 | (define_insn "floatuns<GPR:mode><FP:mode>2" | |
4159 | [(set (match_operand:FP 0 "register_operand" "=f") | |
4160 | (unsigned_float:FP (match_operand:GPR 1 "register_operand" "d")))] | |
4161 | "TARGET_Z196 && TARGET_HARD_FLOAT" | |
4162 | "c<FP:xde>l<GPR:gf><FP:bt>r\t%0,0,%1,0" | |
4163 | [(set_attr "op_type" "RRE") | |
4164 | (set_attr "type" "itof<FP:mode>" )]) | |
f61a2c7d | 4165 | |
9db1d521 HP |
4166 | ; |
4167 | ; truncdfsf2 instruction pattern(s). | |
4168 | ; | |
4169 | ||
142cd70f | 4170 | (define_insn "truncdfsf2" |
9db1d521 | 4171 | [(set (match_operand:SF 0 "register_operand" "=f") |
a036c6f7 | 4172 | (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))] |
142cd70f | 4173 | "TARGET_HARD_FLOAT" |
d40c829f | 4174 | "ledbr\t%0,%1" |
f61a2c7d AK |
4175 | [(set_attr "op_type" "RRE") |
4176 | (set_attr "type" "ftruncdf")]) | |
9db1d521 | 4177 | |
f61a2c7d | 4178 | ; |
142cd70f | 4179 | ; trunctf(df|sf)2 instruction pattern(s). |
f61a2c7d AK |
4180 | ; |
4181 | ||
142cd70f AK |
4182 | ; ldxbr, lexbr |
4183 | (define_insn "trunctf<mode>2" | |
4184 | [(set (match_operand:DSF 0 "register_operand" "=f") | |
4185 | (float_truncate:DSF (match_operand:TF 1 "register_operand" "f"))) | |
f61a2c7d | 4186 | (clobber (match_scratch:TF 2 "=f"))] |
142cd70f AK |
4187 | "TARGET_HARD_FLOAT" |
4188 | "l<xde>xbr\t%2,%1\;l<xde>r\t%0,%2" | |
f61a2c7d | 4189 | [(set_attr "length" "6") |
9381e3f1 | 4190 | (set_attr "type" "ftrunctf")]) |
f61a2c7d | 4191 | |
609e7e80 AK |
4192 | ; |
4193 | ; trunctddd2 and truncddsd2 instruction pattern(s). | |
4194 | ; | |
4195 | ||
4196 | (define_insn "trunctddd2" | |
4197 | [(set (match_operand:DD 0 "register_operand" "=f") | |
bf259a77 AK |
4198 | (float_truncate:DD (match_operand:TD 1 "register_operand" "f"))) |
4199 | (clobber (match_scratch:TD 2 "=f"))] | |
fb068247 | 4200 | "TARGET_HARD_DFP" |
bf259a77 AK |
4201 | "ldxtr\t%2,0,%1,0\;ldr\t%0,%2" |
4202 | [(set_attr "length" "6") | |
9381e3f1 | 4203 | (set_attr "type" "ftruncdd")]) |
609e7e80 AK |
4204 | |
4205 | (define_insn "truncddsd2" | |
4206 | [(set (match_operand:SD 0 "register_operand" "=f") | |
4207 | (float_truncate:SD (match_operand:DD 1 "register_operand" "f")))] | |
fb068247 | 4208 | "TARGET_HARD_DFP" |
609e7e80 AK |
4209 | "ledtr\t%0,0,%1,0" |
4210 | [(set_attr "op_type" "RRF") | |
9381e3f1 | 4211 | (set_attr "type" "ftruncsd")]) |
609e7e80 | 4212 | |
9db1d521 | 4213 | ; |
142cd70f | 4214 | ; extend(sf|df)(df|tf)2 instruction pattern(s). |
f61a2c7d AK |
4215 | ; |
4216 | ||
142cd70f AK |
4217 | ; ldebr, ldeb, lxdbr, lxdb, lxebr, lxeb |
4218 | (define_insn "extend<DSF:mode><BFP:mode>2" | |
4219 | [(set (match_operand:BFP 0 "register_operand" "=f,f") | |
4220 | (float_extend:BFP (match_operand:DSF 1 "nonimmediate_operand" "f,R")))] | |
4221 | "TARGET_HARD_FLOAT | |
4222 | && GET_MODE_SIZE (<BFP:MODE>mode) > GET_MODE_SIZE (<DSF:MODE>mode)" | |
f61a2c7d | 4223 | "@ |
142cd70f AK |
4224 | l<BFP:xde><DSF:xde>br\t%0,%1 |
4225 | l<BFP:xde><DSF:xde>b\t%0,%1" | |
f61a2c7d | 4226 | [(set_attr "op_type" "RRE,RXE") |
142cd70f | 4227 | (set_attr "type" "fsimp<BFP:mode>, fload<BFP:mode>")]) |
f61a2c7d | 4228 | |
609e7e80 AK |
4229 | ; |
4230 | ; extendddtd2 and extendsddd2 instruction pattern(s). | |
4231 | ; | |
4232 | ||
4233 | (define_insn "extendddtd2" | |
4234 | [(set (match_operand:TD 0 "register_operand" "=f") | |
4235 | (float_extend:TD (match_operand:DD 1 "register_operand" "f")))] | |
fb068247 | 4236 | "TARGET_HARD_DFP" |
609e7e80 AK |
4237 | "lxdtr\t%0,%1,0" |
4238 | [(set_attr "op_type" "RRF") | |
4239 | (set_attr "type" "fsimptf")]) | |
4240 | ||
4241 | (define_insn "extendsddd2" | |
4242 | [(set (match_operand:DD 0 "register_operand" "=f") | |
4243 | (float_extend:DD (match_operand:SD 1 "register_operand" "f")))] | |
fb068247 | 4244 | "TARGET_HARD_DFP" |
609e7e80 AK |
4245 | "ldetr\t%0,%1,0" |
4246 | [(set_attr "op_type" "RRF") | |
4247 | (set_attr "type" "fsimptf")]) | |
9db1d521 | 4248 | |
35dd9a0e AK |
4249 | ; Binary <-> Decimal floating point trunc patterns |
4250 | ; | |
4251 | ||
4252 | (define_insn "*trunc<BFP:mode><DFP_ALL:mode>2" | |
4253 | [(set (reg:DFP_ALL FPR0_REGNUM) | |
4254 | (float_truncate:DFP_ALL (reg:BFP FPR2_REGNUM))) | |
4255 | (use (reg:SI GPR0_REGNUM)) | |
4256 | (clobber (reg:CC CC_REGNUM))] | |
fb068247 | 4257 | "TARGET_HARD_DFP" |
35dd9a0e AK |
4258 | "pfpo") |
4259 | ||
4260 | (define_insn "*trunc<DFP_ALL:mode><BFP:mode>2" | |
4261 | [(set (reg:BFP FPR0_REGNUM) | |
4262 | (float_truncate:BFP (reg:DFP_ALL FPR2_REGNUM))) | |
4263 | (use (reg:SI GPR0_REGNUM)) | |
4264 | (clobber (reg:CC CC_REGNUM))] | |
fb068247 | 4265 | "TARGET_HARD_DFP" |
35dd9a0e AK |
4266 | "pfpo") |
4267 | ||
4268 | (define_expand "trunc<BFP:mode><DFP_ALL:mode>2" | |
4269 | [(set (reg:BFP FPR2_REGNUM) (match_operand:BFP 1 "nonimmediate_operand" "")) | |
4270 | (set (reg:SI GPR0_REGNUM) (match_dup 2)) | |
4271 | (parallel | |
4272 | [(set (reg:DFP_ALL FPR0_REGNUM) | |
4273 | (float_truncate:DFP_ALL (reg:BFP FPR2_REGNUM))) | |
4274 | (use (reg:SI GPR0_REGNUM)) | |
4275 | (clobber (reg:CC CC_REGNUM))]) | |
4276 | (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "") | |
4277 | (reg:DFP_ALL FPR0_REGNUM))] | |
fb068247 | 4278 | "TARGET_HARD_DFP |
35dd9a0e AK |
4279 | && GET_MODE_SIZE (<BFP:MODE>mode) > GET_MODE_SIZE (<DFP_ALL:MODE>mode)" |
4280 | { | |
4281 | HOST_WIDE_INT flags; | |
4282 | ||
4283 | flags = (PFPO_CONVERT | | |
4284 | PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP0_TYPE_SHIFT | | |
4285 | PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP1_TYPE_SHIFT); | |
4286 | ||
4287 | operands[2] = GEN_INT (flags); | |
4288 | }) | |
4289 | ||
4290 | (define_expand "trunc<DFP_ALL:mode><BFP:mode>2" | |
4291 | [(set (reg:DFP_ALL FPR2_REGNUM) | |
4292 | (match_operand:DFP_ALL 1 "nonimmediate_operand" "")) | |
4293 | (set (reg:SI GPR0_REGNUM) (match_dup 2)) | |
4294 | (parallel | |
4295 | [(set (reg:BFP FPR0_REGNUM) (float_truncate:BFP (reg:DFP_ALL FPR2_REGNUM))) | |
4296 | (use (reg:SI GPR0_REGNUM)) | |
4297 | (clobber (reg:CC CC_REGNUM))]) | |
4298 | (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))] | |
fb068247 | 4299 | "TARGET_HARD_DFP |
35dd9a0e AK |
4300 | && GET_MODE_SIZE (<DFP_ALL:MODE>mode) >= GET_MODE_SIZE (<BFP:MODE>mode)" |
4301 | { | |
4302 | HOST_WIDE_INT flags; | |
4303 | ||
4304 | flags = (PFPO_CONVERT | | |
4305 | PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP0_TYPE_SHIFT | | |
4306 | PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP1_TYPE_SHIFT); | |
4307 | ||
4308 | operands[2] = GEN_INT (flags); | |
4309 | }) | |
4310 | ||
4311 | ; | |
4312 | ; Binary <-> Decimal floating point extend patterns | |
4313 | ; | |
4314 | ||
4315 | (define_insn "*extend<BFP:mode><DFP_ALL:mode>2" | |
4316 | [(set (reg:DFP_ALL FPR0_REGNUM) (float_extend:DFP_ALL (reg:BFP FPR2_REGNUM))) | |
4317 | (use (reg:SI GPR0_REGNUM)) | |
4318 | (clobber (reg:CC CC_REGNUM))] | |
fb068247 | 4319 | "TARGET_HARD_DFP" |
35dd9a0e AK |
4320 | "pfpo") |
4321 | ||
4322 | (define_insn "*extend<DFP_ALL:mode><BFP:mode>2" | |
4323 | [(set (reg:BFP FPR0_REGNUM) (float_extend:BFP (reg:DFP_ALL FPR2_REGNUM))) | |
4324 | (use (reg:SI GPR0_REGNUM)) | |
4325 | (clobber (reg:CC CC_REGNUM))] | |
fb068247 | 4326 | "TARGET_HARD_DFP" |
35dd9a0e AK |
4327 | "pfpo") |
4328 | ||
4329 | (define_expand "extend<BFP:mode><DFP_ALL:mode>2" | |
4330 | [(set (reg:BFP FPR2_REGNUM) (match_operand:BFP 1 "nonimmediate_operand" "")) | |
4331 | (set (reg:SI GPR0_REGNUM) (match_dup 2)) | |
4332 | (parallel | |
4333 | [(set (reg:DFP_ALL FPR0_REGNUM) | |
4334 | (float_extend:DFP_ALL (reg:BFP FPR2_REGNUM))) | |
4335 | (use (reg:SI GPR0_REGNUM)) | |
4336 | (clobber (reg:CC CC_REGNUM))]) | |
4337 | (set (match_operand:DFP_ALL 0 "nonimmediate_operand" "") | |
4338 | (reg:DFP_ALL FPR0_REGNUM))] | |
fb068247 | 4339 | "TARGET_HARD_DFP |
35dd9a0e AK |
4340 | && GET_MODE_SIZE (<BFP:MODE>mode) <= GET_MODE_SIZE (<DFP_ALL:MODE>mode)" |
4341 | { | |
4342 | HOST_WIDE_INT flags; | |
4343 | ||
4344 | flags = (PFPO_CONVERT | | |
4345 | PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP0_TYPE_SHIFT | | |
4346 | PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP1_TYPE_SHIFT); | |
4347 | ||
4348 | operands[2] = GEN_INT (flags); | |
4349 | }) | |
4350 | ||
4351 | (define_expand "extend<DFP_ALL:mode><BFP:mode>2" | |
4352 | [(set (reg:DFP_ALL FPR2_REGNUM) | |
4353 | (match_operand:DFP_ALL 1 "nonimmediate_operand" "")) | |
4354 | (set (reg:SI GPR0_REGNUM) (match_dup 2)) | |
4355 | (parallel | |
4356 | [(set (reg:BFP FPR0_REGNUM) (float_extend:BFP (reg:DFP_ALL FPR2_REGNUM))) | |
4357 | (use (reg:SI GPR0_REGNUM)) | |
4358 | (clobber (reg:CC CC_REGNUM))]) | |
4359 | (set (match_operand:BFP 0 "nonimmediate_operand" "") (reg:BFP FPR0_REGNUM))] | |
fb068247 | 4360 | "TARGET_HARD_DFP |
35dd9a0e AK |
4361 | && GET_MODE_SIZE (<DFP_ALL:MODE>mode) < GET_MODE_SIZE (<BFP:MODE>mode)" |
4362 | { | |
4363 | HOST_WIDE_INT flags; | |
4364 | ||
4365 | flags = (PFPO_CONVERT | | |
4366 | PFPO_OP_TYPE_<BFP:MODE> << PFPO_OP0_TYPE_SHIFT | | |
4367 | PFPO_OP_TYPE_<DFP_ALL:MODE> << PFPO_OP1_TYPE_SHIFT); | |
4368 | ||
4369 | operands[2] = GEN_INT (flags); | |
4370 | }) | |
4371 | ||
4372 | ||
9db1d521 | 4373 | ;; |
fae778eb | 4374 | ;; ARITHMETIC OPERATIONS |
9db1d521 | 4375 | ;; |
fae778eb | 4376 | ; arithmetic operations set the ConditionCode, |
9db1d521 HP |
4377 | ; because of unpredictable Bits in Register for Halfword and Byte |
4378 | ; the ConditionCode can be set wrong in operations for Halfword and Byte | |
4379 | ||
07893d4f UW |
4380 | ;; |
4381 | ;;- Add instructions. | |
4382 | ;; | |
4383 | ||
1c7b1b7e UW |
4384 | ; |
4385 | ; addti3 instruction pattern(s). | |
4386 | ; | |
4387 | ||
4388 | (define_insn_and_split "addti3" | |
4389 | [(set (match_operand:TI 0 "register_operand" "=&d") | |
4390 | (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0") | |
4391 | (match_operand:TI 2 "general_operand" "do") ) ) | |
ae156f85 | 4392 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4393 | "TARGET_ZARCH" |
1c7b1b7e UW |
4394 | "#" |
4395 | "&& reload_completed" | |
4396 | [(parallel | |
ae156f85 | 4397 | [(set (reg:CCL1 CC_REGNUM) |
1c7b1b7e UW |
4398 | (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8)) |
4399 | (match_dup 7))) | |
4400 | (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))]) | |
4401 | (parallel | |
a94a76a7 UW |
4402 | [(set (match_dup 3) (plus:DI |
4403 | (plus:DI (ltu:DI (reg:CCL1 CC_REGNUM) (const_int 0)) | |
4404 | (match_dup 4)) (match_dup 5))) | |
ae156f85 | 4405 | (clobber (reg:CC CC_REGNUM))])] |
1c7b1b7e UW |
4406 | "operands[3] = operand_subword (operands[0], 0, 0, TImode); |
4407 | operands[4] = operand_subword (operands[1], 0, 0, TImode); | |
4408 | operands[5] = operand_subword (operands[2], 0, 0, TImode); | |
4409 | operands[6] = operand_subword (operands[0], 1, 0, TImode); | |
4410 | operands[7] = operand_subword (operands[1], 1, 0, TImode); | |
b628bd8e | 4411 | operands[8] = operand_subword (operands[2], 1, 0, TImode);") |
1c7b1b7e | 4412 | |
07893d4f UW |
4413 | ; |
4414 | ; adddi3 instruction pattern(s). | |
4415 | ; | |
4416 | ||
3298c037 AK |
4417 | (define_expand "adddi3" |
4418 | [(parallel | |
963fc8d0 | 4419 | [(set (match_operand:DI 0 "nonimmediate_operand" "") |
3298c037 AK |
4420 | (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") |
4421 | (match_operand:DI 2 "general_operand" ""))) | |
4422 | (clobber (reg:CC CC_REGNUM))])] | |
4423 | "" | |
4424 | "") | |
4425 | ||
07893d4f UW |
4426 | (define_insn "*adddi3_sign" |
4427 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
fb492564 | 4428 | (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) |
07893d4f | 4429 | (match_operand:DI 1 "register_operand" "0,0"))) |
ae156f85 | 4430 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4431 | "TARGET_ZARCH" |
07893d4f | 4432 | "@ |
d40c829f UW |
4433 | agfr\t%0,%2 |
4434 | agf\t%0,%2" | |
65b1d8ea AK |
4435 | [(set_attr "op_type" "RRE,RXY") |
4436 | (set_attr "z196prop" "z196_cracked,z196_cracked")]) | |
07893d4f UW |
4437 | |
4438 | (define_insn "*adddi3_zero_cc" | |
ae156f85 | 4439 | [(set (reg CC_REGNUM) |
fb492564 | 4440 | (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) |
07893d4f UW |
4441 | (match_operand:DI 1 "register_operand" "0,0")) |
4442 | (const_int 0))) | |
4443 | (set (match_operand:DI 0 "register_operand" "=d,d") | |
4444 | (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))] | |
9602b6a1 | 4445 | "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" |
07893d4f | 4446 | "@ |
d40c829f UW |
4447 | algfr\t%0,%2 |
4448 | algf\t%0,%2" | |
9381e3f1 WG |
4449 | [(set_attr "op_type" "RRE,RXY") |
4450 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
07893d4f UW |
4451 | |
4452 | (define_insn "*adddi3_zero_cconly" | |
ae156f85 | 4453 | [(set (reg CC_REGNUM) |
fb492564 | 4454 | (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) |
07893d4f UW |
4455 | (match_operand:DI 1 "register_operand" "0,0")) |
4456 | (const_int 0))) | |
4457 | (clobber (match_scratch:DI 0 "=d,d"))] | |
9602b6a1 | 4458 | "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" |
07893d4f | 4459 | "@ |
d40c829f UW |
4460 | algfr\t%0,%2 |
4461 | algf\t%0,%2" | |
9381e3f1 WG |
4462 | [(set_attr "op_type" "RRE,RXY") |
4463 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
07893d4f UW |
4464 | |
4465 | (define_insn "*adddi3_zero" | |
4466 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
fb492564 | 4467 | (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) |
07893d4f | 4468 | (match_operand:DI 1 "register_operand" "0,0"))) |
ae156f85 | 4469 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4470 | "TARGET_ZARCH" |
07893d4f | 4471 | "@ |
d40c829f UW |
4472 | algfr\t%0,%2 |
4473 | algf\t%0,%2" | |
9381e3f1 WG |
4474 | [(set_attr "op_type" "RRE,RXY") |
4475 | (set_attr "z10prop" "z10_super_E1,z10_super_E1")]) | |
07893d4f | 4476 | |
e69166de | 4477 | (define_insn_and_split "*adddi3_31z" |
963fc8d0 | 4478 | [(set (match_operand:DI 0 "nonimmediate_operand" "=&d") |
e69166de UW |
4479 | (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") |
4480 | (match_operand:DI 2 "general_operand" "do") ) ) | |
ae156f85 | 4481 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4482 | "!TARGET_ZARCH && TARGET_CPU_ZARCH" |
e69166de UW |
4483 | "#" |
4484 | "&& reload_completed" | |
4485 | [(parallel | |
ae156f85 | 4486 | [(set (reg:CCL1 CC_REGNUM) |
e69166de UW |
4487 | (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) |
4488 | (match_dup 7))) | |
4489 | (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) | |
4490 | (parallel | |
a94a76a7 UW |
4491 | [(set (match_dup 3) (plus:SI |
4492 | (plus:SI (ltu:SI (reg:CCL1 CC_REGNUM) (const_int 0)) | |
4493 | (match_dup 4)) (match_dup 5))) | |
ae156f85 | 4494 | (clobber (reg:CC CC_REGNUM))])] |
e69166de UW |
4495 | "operands[3] = operand_subword (operands[0], 0, 0, DImode); |
4496 | operands[4] = operand_subword (operands[1], 0, 0, DImode); | |
4497 | operands[5] = operand_subword (operands[2], 0, 0, DImode); | |
4498 | operands[6] = operand_subword (operands[0], 1, 0, DImode); | |
4499 | operands[7] = operand_subword (operands[1], 1, 0, DImode); | |
b628bd8e | 4500 | operands[8] = operand_subword (operands[2], 1, 0, DImode);") |
e69166de | 4501 | |
07893d4f | 4502 | (define_insn_and_split "*adddi3_31" |
963fc8d0 | 4503 | [(set (match_operand:DI 0 "nonimmediate_operand" "=&d") |
96fd3851 | 4504 | (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") |
97c6f7ad | 4505 | (match_operand:DI 2 "general_operand" "do") ) ) |
ae156f85 | 4506 | (clobber (reg:CC CC_REGNUM))] |
e69166de | 4507 | "!TARGET_CPU_ZARCH" |
07893d4f UW |
4508 | "#" |
4509 | "&& reload_completed" | |
4510 | [(parallel | |
4511 | [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5))) | |
ae156f85 | 4512 | (clobber (reg:CC CC_REGNUM))]) |
07893d4f | 4513 | (parallel |
ae156f85 | 4514 | [(set (reg:CCL1 CC_REGNUM) |
07893d4f UW |
4515 | (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) |
4516 | (match_dup 7))) | |
4517 | (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) | |
4518 | (set (pc) | |
ae156f85 | 4519 | (if_then_else (ltu (reg:CCL1 CC_REGNUM) (const_int 0)) |
07893d4f UW |
4520 | (pc) |
4521 | (label_ref (match_dup 9)))) | |
4522 | (parallel | |
4523 | [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1))) | |
ae156f85 | 4524 | (clobber (reg:CC CC_REGNUM))]) |
07893d4f | 4525 | (match_dup 9)] |
97c6f7ad UW |
4526 | "operands[3] = operand_subword (operands[0], 0, 0, DImode); |
4527 | operands[4] = operand_subword (operands[1], 0, 0, DImode); | |
4528 | operands[5] = operand_subword (operands[2], 0, 0, DImode); | |
4529 | operands[6] = operand_subword (operands[0], 1, 0, DImode); | |
4530 | operands[7] = operand_subword (operands[1], 1, 0, DImode); | |
4531 | operands[8] = operand_subword (operands[2], 1, 0, DImode); | |
b628bd8e | 4532 | operands[9] = gen_label_rtx ();") |
9db1d521 | 4533 | |
3298c037 AK |
4534 | ; |
4535 | ; addsi3 instruction pattern(s). | |
4536 | ; | |
4537 | ||
4538 | (define_expand "addsi3" | |
07893d4f | 4539 | [(parallel |
963fc8d0 | 4540 | [(set (match_operand:SI 0 "nonimmediate_operand" "") |
3298c037 AK |
4541 | (plus:SI (match_operand:SI 1 "nonimmediate_operand" "") |
4542 | (match_operand:SI 2 "general_operand" ""))) | |
ae156f85 | 4543 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 | 4544 | "" |
07893d4f | 4545 | "") |
9db1d521 | 4546 | |
3298c037 AK |
4547 | (define_insn "*addsi3_sign" |
4548 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
4549 | (plus:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")) | |
4550 | (match_operand:SI 1 "register_operand" "0,0"))) | |
4551 | (clobber (reg:CC CC_REGNUM))] | |
4552 | "" | |
4553 | "@ | |
4554 | ah\t%0,%2 | |
4555 | ahy\t%0,%2" | |
65b1d8ea AK |
4556 | [(set_attr "op_type" "RX,RXY") |
4557 | (set_attr "z196prop" "z196_cracked,z196_cracked")]) | |
3298c037 | 4558 | |
9db1d521 | 4559 | ; |
3298c037 | 4560 | ; add(di|si)3 instruction pattern(s). |
9db1d521 | 4561 | ; |
9db1d521 | 4562 | |
65b1d8ea | 4563 | ; ark, agrk, ar, ahi, ahik, aghik, alfi, slfi, a, ay, agr, aghi, algfi, slgfi, ag, asi, agsi |
3298c037 | 4564 | (define_insn "*add<mode>3" |
65b1d8ea AK |
4565 | [(set (match_operand:GPR 0 "nonimmediate_operand" "=d,d,d,d, d, d,d,d,QS") |
4566 | (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d,0,d, 0, 0,0,0, 0") | |
4567 | (match_operand:GPR 2 "general_operand" " d,d,K,K,Op,On,R,T, C") ) ) | |
3298c037 AK |
4568 | (clobber (reg:CC CC_REGNUM))] |
4569 | "" | |
ec24698e | 4570 | "@ |
3298c037 | 4571 | a<g>r\t%0,%2 |
65b1d8ea | 4572 | a<g>rk\t%0,%1,%2 |
3298c037 | 4573 | a<g>hi\t%0,%h2 |
65b1d8ea | 4574 | a<g>hik\t%0,%1,%h2 |
3298c037 AK |
4575 | al<g>fi\t%0,%2 |
4576 | sl<g>fi\t%0,%n2 | |
4577 | a<g>\t%0,%2 | |
963fc8d0 AK |
4578 | a<y>\t%0,%2 |
4579 | a<g>si\t%0,%c2" | |
65b1d8ea AK |
4580 | [(set_attr "op_type" "RR<E>,RRF,RI,RIE,RIL,RIL,RX<Y>,RXY,SIY") |
4581 | (set_attr "cpu_facility" "*,z196,*,z196,extimm,extimm,*,*,z10") | |
4582 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,*,z10_super_E1,z10_super_E1, | |
4583 | z10_super_E1,z10_super_E1,z10_super_E1")]) | |
0a3bdf9d | 4584 | |
65b1d8ea | 4585 | ; alr, alfi, slfi, al, aly, alrk, alhsik, algr, algfi, slgfi, alg, alsi, algsi, algrk, alghsik |
3298c037 | 4586 | (define_insn "*add<mode>3_carry1_cc" |
ae156f85 | 4587 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4588 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d, 0, 0,d,0,0,0") |
4589 | (match_operand:GPR 2 "general_operand" " d,d,Op,On,K,R,T,C")) | |
07893d4f | 4590 | (match_dup 1))) |
65b1d8ea | 4591 | (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d, d, d,d,d,d,d") |
3298c037 | 4592 | (plus:GPR (match_dup 1) (match_dup 2)))] |
c7453384 | 4593 | "s390_match_ccmode (insn, CCL1mode)" |
07893d4f | 4594 | "@ |
3298c037 | 4595 | al<g>r\t%0,%2 |
65b1d8ea | 4596 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4597 | al<g>fi\t%0,%2 |
4598 | sl<g>fi\t%0,%n2 | |
65b1d8ea | 4599 | al<g>hsik\t%0,%1,%h2 |
3298c037 | 4600 | al<g>\t%0,%2 |
963fc8d0 AK |
4601 | al<y>\t%0,%2 |
4602 | al<g>si\t%0,%c2" | |
65b1d8ea AK |
4603 | [(set_attr "op_type" "RR<E>,RRF,RIL,RIL,RIE,RX<Y>,RXY,SIY") |
4604 | (set_attr "cpu_facility" "*,z196,extimm,extimm,z196,*,*,z10") | |
4605 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1,*, | |
4606 | z10_super_E1,z10_super_E1,z10_super_E1")]) | |
07893d4f | 4607 | |
65b1d8ea | 4608 | ; alr, al, aly, algr, alg, alrk, algrk |
3298c037 | 4609 | (define_insn "*add<mode>3_carry1_cconly" |
ae156f85 | 4610 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4611 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d,0,0") |
4612 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
07893d4f | 4613 | (match_dup 1))) |
65b1d8ea | 4614 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] |
c7453384 | 4615 | "s390_match_ccmode (insn, CCL1mode)" |
07893d4f | 4616 | "@ |
3298c037 | 4617 | al<g>r\t%0,%2 |
65b1d8ea | 4618 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4619 | al<g>\t%0,%2 |
4620 | al<y>\t%0,%2" | |
65b1d8ea AK |
4621 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
4622 | (set_attr "cpu_facility" "*,z196,*,*") | |
4623 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
07893d4f | 4624 | |
65b1d8ea | 4625 | ; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi, alrk, algrk, alhsik, alghsik |
3298c037 | 4626 | (define_insn "*add<mode>3_carry2_cc" |
ae156f85 | 4627 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4628 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d, 0, 0,d,0,0, 0") |
4629 | (match_operand:GPR 2 "general_operand" " d,d,Op,On,K,R,T, C")) | |
07893d4f | 4630 | (match_dup 2))) |
65b1d8ea | 4631 | (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d, d, d,d,d,d,RS") |
3298c037 | 4632 | (plus:GPR (match_dup 1) (match_dup 2)))] |
c7453384 | 4633 | "s390_match_ccmode (insn, CCL1mode)" |
07893d4f | 4634 | "@ |
3298c037 | 4635 | al<g>r\t%0,%2 |
65b1d8ea | 4636 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4637 | al<g>fi\t%0,%2 |
4638 | sl<g>fi\t%0,%n2 | |
65b1d8ea | 4639 | al<g>hsik\t%0,%1,%h2 |
3298c037 | 4640 | al<g>\t%0,%2 |
963fc8d0 AK |
4641 | al<y>\t%0,%2 |
4642 | al<g>si\t%0,%c2" | |
65b1d8ea AK |
4643 | [(set_attr "op_type" "RR<E>,RRF,RIL,RIL,RIE,RX<Y>,RXY,SIY") |
4644 | (set_attr "cpu_facility" "*,z196,extimm,extimm,z196,*,*,z10") | |
4645 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1,*, | |
4646 | z10_super_E1,z10_super_E1,z10_super_E1")]) | |
07893d4f | 4647 | |
65b1d8ea | 4648 | ; alr, al, aly, algr, alg, alrk, algrk |
3298c037 | 4649 | (define_insn "*add<mode>3_carry2_cconly" |
ae156f85 | 4650 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4651 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d,0,0") |
4652 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
07893d4f | 4653 | (match_dup 2))) |
65b1d8ea | 4654 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] |
c7453384 | 4655 | "s390_match_ccmode (insn, CCL1mode)" |
07893d4f | 4656 | "@ |
3298c037 | 4657 | al<g>r\t%0,%2 |
65b1d8ea | 4658 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4659 | al<g>\t%0,%2 |
4660 | al<y>\t%0,%2" | |
65b1d8ea AK |
4661 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
4662 | (set_attr "cpu_facility" "*,z196,*,*") | |
4663 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
07893d4f | 4664 | |
65b1d8ea | 4665 | ; alr, alfi, slfi, al, aly, algr, algfi, slgfi, alg, alsi, algsi, alrk, algrk, alhsik, alghsik |
3298c037 | 4666 | (define_insn "*add<mode>3_cc" |
ae156f85 | 4667 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4668 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d, 0, 0,d,0,0, 0") |
4669 | (match_operand:GPR 2 "general_operand" " d,d,Op,On,K,R,T, C")) | |
9db1d521 | 4670 | (const_int 0))) |
65b1d8ea | 4671 | (set (match_operand:GPR 0 "nonimmediate_operand" "=d,d, d, d,d,d,d,RS") |
3298c037 | 4672 | (plus:GPR (match_dup 1) (match_dup 2)))] |
c7453384 | 4673 | "s390_match_ccmode (insn, CCLmode)" |
9db1d521 | 4674 | "@ |
3298c037 | 4675 | al<g>r\t%0,%2 |
65b1d8ea | 4676 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4677 | al<g>fi\t%0,%2 |
4678 | sl<g>fi\t%0,%n2 | |
65b1d8ea | 4679 | al<g>hsik\t%0,%1,%h2 |
3298c037 | 4680 | al<g>\t%0,%2 |
963fc8d0 AK |
4681 | al<y>\t%0,%2 |
4682 | al<g>si\t%0,%c2" | |
65b1d8ea AK |
4683 | [(set_attr "op_type" "RR<E>,RRF,RIL,RIL,RIE,RX<Y>,RXY,SIY") |
4684 | (set_attr "cpu_facility" "*,z196,extimm,extimm,z196,*,*,z10") | |
4685 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1, | |
4686 | *,z10_super_E1,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 4687 | |
65b1d8ea | 4688 | ; alr, al, aly, algr, alg, alrk, algrk |
3298c037 | 4689 | (define_insn "*add<mode>3_cconly" |
ae156f85 | 4690 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4691 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,d,0,0") |
4692 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
9db1d521 | 4693 | (const_int 0))) |
65b1d8ea | 4694 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] |
c7453384 | 4695 | "s390_match_ccmode (insn, CCLmode)" |
9db1d521 | 4696 | "@ |
3298c037 | 4697 | al<g>r\t%0,%2 |
65b1d8ea | 4698 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4699 | al<g>\t%0,%2 |
4700 | al<y>\t%0,%2" | |
65b1d8ea AK |
4701 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
4702 | (set_attr "cpu_facility" "*,z196,*,*") | |
4703 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 4704 | |
65b1d8ea | 4705 | ; alr, al, aly, algr, alg, alrk, algrk |
3298c037 | 4706 | (define_insn "*add<mode>3_cconly2" |
ae156f85 | 4707 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4708 | (compare (match_operand:GPR 1 "nonimmediate_operand" "%0,d,0,0") |
4709 | (neg:GPR (match_operand:GPR 2 "general_operand" "d,d,R,T")))) | |
4710 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] | |
3298c037 | 4711 | "s390_match_ccmode(insn, CCLmode)" |
d3632d41 | 4712 | "@ |
3298c037 | 4713 | al<g>r\t%0,%2 |
65b1d8ea | 4714 | al<g>rk\t%0,%1,%2 |
3298c037 AK |
4715 | al<g>\t%0,%2 |
4716 | al<y>\t%0,%2" | |
65b1d8ea AK |
4717 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
4718 | (set_attr "cpu_facility" "*,z196,*,*") | |
4719 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
07893d4f | 4720 | |
963fc8d0 | 4721 | ; ahi, afi, aghi, agfi, asi, agsi |
3298c037 AK |
4722 | (define_insn "*add<mode>3_imm_cc" |
4723 | [(set (reg CC_REGNUM) | |
65b1d8ea AK |
4724 | (compare (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" " 0, d,0, 0") |
4725 | (match_operand:GPR 2 "const_int_operand" " K, K,Os, C")) | |
3298c037 | 4726 | (const_int 0))) |
65b1d8ea | 4727 | (set (match_operand:GPR 0 "nonimmediate_operand" "=d, d,d,QS") |
3298c037 AK |
4728 | (plus:GPR (match_dup 1) (match_dup 2)))] |
4729 | "s390_match_ccmode (insn, CCAmode) | |
4730 | && (CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\") | |
963fc8d0 AK |
4731 | || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'O', \"Os\") |
4732 | || CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'C', \"C\")) | |
3298c037 | 4733 | && INTVAL (operands[2]) != -((HOST_WIDE_INT)1 << (GET_MODE_BITSIZE(<MODE>mode) - 1))" |
9db1d521 | 4734 | "@ |
3298c037 | 4735 | a<g>hi\t%0,%h2 |
65b1d8ea | 4736 | a<g>hik\t%0,%1,%h2 |
963fc8d0 AK |
4737 | a<g>fi\t%0,%2 |
4738 | a<g>si\t%0,%c2" | |
65b1d8ea AK |
4739 | [(set_attr "op_type" "RI,RIE,RIL,SIY") |
4740 | (set_attr "cpu_facility" "*,z196,extimm,z10") | |
4741 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 4742 | |
9db1d521 | 4743 | ; |
609e7e80 | 4744 | ; add(tf|df|sf|td|dd)3 instruction pattern(s). |
9db1d521 HP |
4745 | ; |
4746 | ||
609e7e80 | 4747 | ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr |
142cd70f | 4748 | (define_insn "add<mode>3" |
609e7e80 AK |
4749 | [(set (match_operand:FP 0 "register_operand" "=f, f") |
4750 | (plus:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0") | |
4751 | (match_operand:FP 2 "general_operand" " f,<Rf>"))) | |
ae156f85 | 4752 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 4753 | "TARGET_HARD_FLOAT" |
9db1d521 | 4754 | "@ |
609e7e80 | 4755 | a<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 4756 | a<xde>b\t%0,%2" |
609e7e80 | 4757 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 4758 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 4759 | |
609e7e80 | 4760 | ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr |
f5905b37 | 4761 | (define_insn "*add<mode>3_cc" |
ae156f85 | 4762 | [(set (reg CC_REGNUM) |
609e7e80 AK |
4763 | (compare (plus:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0") |
4764 | (match_operand:FP 2 "general_operand" " f,<Rf>")) | |
4765 | (match_operand:FP 3 "const0_operand" ""))) | |
4766 | (set (match_operand:FP 0 "register_operand" "=f,f") | |
4767 | (plus:FP (match_dup 1) (match_dup 2)))] | |
142cd70f | 4768 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
3ef093a8 | 4769 | "@ |
609e7e80 | 4770 | a<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 4771 | a<xde>b\t%0,%2" |
609e7e80 | 4772 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 4773 | (set_attr "type" "fsimp<mode>")]) |
3ef093a8 | 4774 | |
609e7e80 | 4775 | ; axbr, adbr, aebr, axb, adb, aeb, adtr, axtr |
f5905b37 | 4776 | (define_insn "*add<mode>3_cconly" |
ae156f85 | 4777 | [(set (reg CC_REGNUM) |
609e7e80 AK |
4778 | (compare (plus:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0") |
4779 | (match_operand:FP 2 "general_operand" " f,<Rf>")) | |
4780 | (match_operand:FP 3 "const0_operand" ""))) | |
4781 | (clobber (match_scratch:FP 0 "=f,f"))] | |
142cd70f | 4782 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
3ef093a8 | 4783 | "@ |
609e7e80 | 4784 | a<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 4785 | a<xde>b\t%0,%2" |
609e7e80 | 4786 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 4787 | (set_attr "type" "fsimp<mode>")]) |
3ef093a8 | 4788 | |
9db1d521 HP |
4789 | |
4790 | ;; | |
4791 | ;;- Subtract instructions. | |
4792 | ;; | |
4793 | ||
1c7b1b7e UW |
4794 | ; |
4795 | ; subti3 instruction pattern(s). | |
4796 | ; | |
4797 | ||
4798 | (define_insn_and_split "subti3" | |
4799 | [(set (match_operand:TI 0 "register_operand" "=&d") | |
4800 | (minus:TI (match_operand:TI 1 "register_operand" "0") | |
4801 | (match_operand:TI 2 "general_operand" "do") ) ) | |
ae156f85 | 4802 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4803 | "TARGET_ZARCH" |
1c7b1b7e UW |
4804 | "#" |
4805 | "&& reload_completed" | |
4806 | [(parallel | |
ae156f85 | 4807 | [(set (reg:CCL2 CC_REGNUM) |
1c7b1b7e UW |
4808 | (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8)) |
4809 | (match_dup 7))) | |
4810 | (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))]) | |
4811 | (parallel | |
4812 | [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5)) | |
ae156f85 AS |
4813 | (gtu:DI (reg:CCL2 CC_REGNUM) (const_int 0)))) |
4814 | (clobber (reg:CC CC_REGNUM))])] | |
1c7b1b7e UW |
4815 | "operands[3] = operand_subword (operands[0], 0, 0, TImode); |
4816 | operands[4] = operand_subword (operands[1], 0, 0, TImode); | |
4817 | operands[5] = operand_subword (operands[2], 0, 0, TImode); | |
4818 | operands[6] = operand_subword (operands[0], 1, 0, TImode); | |
4819 | operands[7] = operand_subword (operands[1], 1, 0, TImode); | |
b628bd8e | 4820 | operands[8] = operand_subword (operands[2], 1, 0, TImode);") |
1c7b1b7e | 4821 | |
9db1d521 HP |
4822 | ; |
4823 | ; subdi3 instruction pattern(s). | |
4824 | ; | |
4825 | ||
3298c037 AK |
4826 | (define_expand "subdi3" |
4827 | [(parallel | |
4828 | [(set (match_operand:DI 0 "register_operand" "") | |
4829 | (minus:DI (match_operand:DI 1 "register_operand" "") | |
4830 | (match_operand:DI 2 "general_operand" ""))) | |
4831 | (clobber (reg:CC CC_REGNUM))])] | |
4832 | "" | |
4833 | "") | |
4834 | ||
07893d4f UW |
4835 | (define_insn "*subdi3_sign" |
4836 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
4837 | (minus:DI (match_operand:DI 1 "register_operand" "0,0") | |
fb492564 | 4838 | (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))) |
ae156f85 | 4839 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4840 | "TARGET_ZARCH" |
07893d4f | 4841 | "@ |
d40c829f UW |
4842 | sgfr\t%0,%2 |
4843 | sgf\t%0,%2" | |
9381e3f1 | 4844 | [(set_attr "op_type" "RRE,RXY") |
65b1d8ea AK |
4845 | (set_attr "z10prop" "z10_c,*") |
4846 | (set_attr "z196prop" "z196_cracked")]) | |
07893d4f UW |
4847 | |
4848 | (define_insn "*subdi3_zero_cc" | |
ae156f85 | 4849 | [(set (reg CC_REGNUM) |
07893d4f | 4850 | (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") |
fb492564 | 4851 | (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))) |
07893d4f UW |
4852 | (const_int 0))) |
4853 | (set (match_operand:DI 0 "register_operand" "=d,d") | |
4854 | (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))] | |
9602b6a1 | 4855 | "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" |
07893d4f | 4856 | "@ |
d40c829f UW |
4857 | slgfr\t%0,%2 |
4858 | slgf\t%0,%2" | |
9381e3f1 WG |
4859 | [(set_attr "op_type" "RRE,RXY") |
4860 | (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")]) | |
07893d4f UW |
4861 | |
4862 | (define_insn "*subdi3_zero_cconly" | |
ae156f85 | 4863 | [(set (reg CC_REGNUM) |
07893d4f | 4864 | (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") |
fb492564 | 4865 | (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT"))) |
07893d4f UW |
4866 | (const_int 0))) |
4867 | (clobber (match_scratch:DI 0 "=d,d"))] | |
9602b6a1 | 4868 | "s390_match_ccmode (insn, CCLmode) && TARGET_ZARCH" |
07893d4f | 4869 | "@ |
d40c829f UW |
4870 | slgfr\t%0,%2 |
4871 | slgf\t%0,%2" | |
9381e3f1 WG |
4872 | [(set_attr "op_type" "RRE,RXY") |
4873 | (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")]) | |
07893d4f UW |
4874 | |
4875 | (define_insn "*subdi3_zero" | |
4876 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
4877 | (minus:DI (match_operand:DI 1 "register_operand" "0,0") | |
fb492564 | 4878 | (zero_extend:DI (match_operand:SI 2 "general_operand" "d,RT")))) |
ae156f85 | 4879 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4880 | "TARGET_ZARCH" |
07893d4f | 4881 | "@ |
d40c829f UW |
4882 | slgfr\t%0,%2 |
4883 | slgf\t%0,%2" | |
9381e3f1 WG |
4884 | [(set_attr "op_type" "RRE,RXY") |
4885 | (set_attr "z10prop" "z10_super_c_E1,z10_super_E1")]) | |
07893d4f | 4886 | |
e69166de UW |
4887 | (define_insn_and_split "*subdi3_31z" |
4888 | [(set (match_operand:DI 0 "register_operand" "=&d") | |
4889 | (minus:DI (match_operand:DI 1 "register_operand" "0") | |
4890 | (match_operand:DI 2 "general_operand" "do") ) ) | |
ae156f85 | 4891 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 4892 | "!TARGET_ZARCH && TARGET_CPU_ZARCH" |
e69166de UW |
4893 | "#" |
4894 | "&& reload_completed" | |
4895 | [(parallel | |
ae156f85 | 4896 | [(set (reg:CCL2 CC_REGNUM) |
e69166de UW |
4897 | (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) |
4898 | (match_dup 7))) | |
4899 | (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) | |
4900 | (parallel | |
4901 | [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5)) | |
ae156f85 AS |
4902 | (gtu:SI (reg:CCL2 CC_REGNUM) (const_int 0)))) |
4903 | (clobber (reg:CC CC_REGNUM))])] | |
e69166de UW |
4904 | "operands[3] = operand_subword (operands[0], 0, 0, DImode); |
4905 | operands[4] = operand_subword (operands[1], 0, 0, DImode); | |
4906 | operands[5] = operand_subword (operands[2], 0, 0, DImode); | |
4907 | operands[6] = operand_subword (operands[0], 1, 0, DImode); | |
4908 | operands[7] = operand_subword (operands[1], 1, 0, DImode); | |
b628bd8e | 4909 | operands[8] = operand_subword (operands[2], 1, 0, DImode);") |
e69166de | 4910 | |
07893d4f UW |
4911 | (define_insn_and_split "*subdi3_31" |
4912 | [(set (match_operand:DI 0 "register_operand" "=&d") | |
4913 | (minus:DI (match_operand:DI 1 "register_operand" "0") | |
97c6f7ad | 4914 | (match_operand:DI 2 "general_operand" "do") ) ) |
ae156f85 | 4915 | (clobber (reg:CC CC_REGNUM))] |
e69166de | 4916 | "!TARGET_CPU_ZARCH" |
07893d4f UW |
4917 | "#" |
4918 | "&& reload_completed" | |
4919 | [(parallel | |
4920 | [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5))) | |
ae156f85 | 4921 | (clobber (reg:CC CC_REGNUM))]) |
07893d4f | 4922 | (parallel |
ae156f85 | 4923 | [(set (reg:CCL2 CC_REGNUM) |
07893d4f UW |
4924 | (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) |
4925 | (match_dup 7))) | |
4926 | (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) | |
4927 | (set (pc) | |
ae156f85 | 4928 | (if_then_else (gtu (reg:CCL2 CC_REGNUM) (const_int 0)) |
07893d4f UW |
4929 | (pc) |
4930 | (label_ref (match_dup 9)))) | |
4931 | (parallel | |
4932 | [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1))) | |
ae156f85 | 4933 | (clobber (reg:CC CC_REGNUM))]) |
07893d4f | 4934 | (match_dup 9)] |
97c6f7ad UW |
4935 | "operands[3] = operand_subword (operands[0], 0, 0, DImode); |
4936 | operands[4] = operand_subword (operands[1], 0, 0, DImode); | |
4937 | operands[5] = operand_subword (operands[2], 0, 0, DImode); | |
4938 | operands[6] = operand_subword (operands[0], 1, 0, DImode); | |
4939 | operands[7] = operand_subword (operands[1], 1, 0, DImode); | |
4940 | operands[8] = operand_subword (operands[2], 1, 0, DImode); | |
b628bd8e | 4941 | operands[9] = gen_label_rtx ();") |
07893d4f | 4942 | |
3298c037 AK |
4943 | ; |
4944 | ; subsi3 instruction pattern(s). | |
4945 | ; | |
4946 | ||
4947 | (define_expand "subsi3" | |
07893d4f | 4948 | [(parallel |
3298c037 AK |
4949 | [(set (match_operand:SI 0 "register_operand" "") |
4950 | (minus:SI (match_operand:SI 1 "register_operand" "") | |
4951 | (match_operand:SI 2 "general_operand" ""))) | |
ae156f85 | 4952 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 | 4953 | "" |
07893d4f | 4954 | "") |
9db1d521 | 4955 | |
3298c037 AK |
4956 | (define_insn "*subsi3_sign" |
4957 | [(set (match_operand:SI 0 "register_operand" "=d,d") | |
4958 | (minus:SI (match_operand:SI 1 "register_operand" "0,0") | |
4959 | (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")))) | |
4960 | (clobber (reg:CC CC_REGNUM))] | |
4961 | "" | |
4962 | "@ | |
4963 | sh\t%0,%2 | |
4964 | shy\t%0,%2" | |
65b1d8ea AK |
4965 | [(set_attr "op_type" "RX,RXY") |
4966 | (set_attr "z196prop" "z196_cracked,z196_cracked")]) | |
3298c037 | 4967 | |
9db1d521 | 4968 | ; |
3298c037 | 4969 | ; sub(di|si)3 instruction pattern(s). |
9db1d521 HP |
4970 | ; |
4971 | ||
65b1d8ea | 4972 | ; sr, s, sy, sgr, sg, srk, sgrk |
3298c037 | 4973 | (define_insn "*sub<mode>3" |
65b1d8ea AK |
4974 | [(set (match_operand:GPR 0 "register_operand" "=d,d,d,d") |
4975 | (minus:GPR (match_operand:GPR 1 "register_operand" "0,d,0,0") | |
4976 | (match_operand:GPR 2 "general_operand" "d,d,R,T") ) ) | |
3298c037 AK |
4977 | (clobber (reg:CC CC_REGNUM))] |
4978 | "" | |
4979 | "@ | |
4980 | s<g>r\t%0,%2 | |
65b1d8ea | 4981 | s<g>rk\t%0,%1,%2 |
3298c037 AK |
4982 | s<g>\t%0,%2 |
4983 | s<y>\t%0,%2" | |
65b1d8ea AK |
4984 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
4985 | (set_attr "cpu_facility" "*,z196,*,*") | |
4986 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
3298c037 | 4987 | |
65b1d8ea | 4988 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 4989 | (define_insn "*sub<mode>3_borrow_cc" |
ae156f85 | 4990 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
4991 | (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,d,0,0") |
4992 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
07893d4f | 4993 | (match_dup 1))) |
65b1d8ea | 4994 | (set (match_operand:GPR 0 "register_operand" "=d,d,d,d") |
3298c037 | 4995 | (minus:GPR (match_dup 1) (match_dup 2)))] |
b2ba71ca | 4996 | "s390_match_ccmode (insn, CCL2mode)" |
07893d4f | 4997 | "@ |
3298c037 | 4998 | sl<g>r\t%0,%2 |
65b1d8ea | 4999 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5000 | sl<g>\t%0,%2 |
5001 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5002 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5003 | (set_attr "cpu_facility" "*,z196,*,*") | |
5004 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
07893d4f | 5005 | |
65b1d8ea | 5006 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 5007 | (define_insn "*sub<mode>3_borrow_cconly" |
ae156f85 | 5008 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
5009 | (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,d,0,0") |
5010 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
07893d4f | 5011 | (match_dup 1))) |
65b1d8ea | 5012 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] |
b2ba71ca | 5013 | "s390_match_ccmode (insn, CCL2mode)" |
07893d4f | 5014 | "@ |
3298c037 | 5015 | sl<g>r\t%0,%2 |
65b1d8ea | 5016 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5017 | sl<g>\t%0,%2 |
5018 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5019 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5020 | (set_attr "cpu_facility" "*,z196,*,*") | |
5021 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
07893d4f | 5022 | |
65b1d8ea | 5023 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 5024 | (define_insn "*sub<mode>3_cc" |
ae156f85 | 5025 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
5026 | (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,d,0,0") |
5027 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
9db1d521 | 5028 | (const_int 0))) |
65b1d8ea | 5029 | (set (match_operand:GPR 0 "register_operand" "=d,d,d,d") |
3298c037 | 5030 | (minus:GPR (match_dup 1) (match_dup 2)))] |
b2ba71ca | 5031 | "s390_match_ccmode (insn, CCLmode)" |
9db1d521 | 5032 | "@ |
3298c037 | 5033 | sl<g>r\t%0,%2 |
65b1d8ea | 5034 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5035 | sl<g>\t%0,%2 |
5036 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5037 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5038 | (set_attr "cpu_facility" "*,z196,*,*") | |
5039 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
9db1d521 | 5040 | |
65b1d8ea | 5041 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 5042 | (define_insn "*sub<mode>3_cc2" |
ae156f85 | 5043 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
5044 | (compare (match_operand:GPR 1 "register_operand" "0,d,0,0") |
5045 | (match_operand:GPR 2 "general_operand" "d,d,R,T"))) | |
5046 | (set (match_operand:GPR 0 "register_operand" "=d,d,d,d") | |
3298c037 | 5047 | (minus:GPR (match_dup 1) (match_dup 2)))] |
5d880bd2 UW |
5048 | "s390_match_ccmode (insn, CCL3mode)" |
5049 | "@ | |
3298c037 | 5050 | sl<g>r\t%0,%2 |
65b1d8ea | 5051 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5052 | sl<g>\t%0,%2 |
5053 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5054 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5055 | (set_attr "cpu_facility" "*,z196,*,*") | |
5056 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
5d880bd2 | 5057 | |
65b1d8ea | 5058 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 5059 | (define_insn "*sub<mode>3_cconly" |
ae156f85 | 5060 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
5061 | (compare (minus:GPR (match_operand:GPR 1 "register_operand" "0,d,0,0") |
5062 | (match_operand:GPR 2 "general_operand" "d,d,R,T")) | |
9db1d521 | 5063 | (const_int 0))) |
65b1d8ea | 5064 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] |
b2ba71ca | 5065 | "s390_match_ccmode (insn, CCLmode)" |
9db1d521 | 5066 | "@ |
3298c037 | 5067 | sl<g>r\t%0,%2 |
65b1d8ea | 5068 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5069 | sl<g>\t%0,%2 |
5070 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5071 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5072 | (set_attr "cpu_facility" "*,z196,*,*") | |
5073 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
9381e3f1 | 5074 | |
9db1d521 | 5075 | |
65b1d8ea | 5076 | ; slr, sl, sly, slgr, slg, slrk, slgrk |
3298c037 | 5077 | (define_insn "*sub<mode>3_cconly2" |
ae156f85 | 5078 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
5079 | (compare (match_operand:GPR 1 "register_operand" "0,d,0,0") |
5080 | (match_operand:GPR 2 "general_operand" "d,d,R,T"))) | |
5081 | (clobber (match_scratch:GPR 0 "=d,d,d,d"))] | |
5d880bd2 UW |
5082 | "s390_match_ccmode (insn, CCL3mode)" |
5083 | "@ | |
3298c037 | 5084 | sl<g>r\t%0,%2 |
65b1d8ea | 5085 | sl<g>rk\t%0,%1,%2 |
3298c037 AK |
5086 | sl<g>\t%0,%2 |
5087 | sl<y>\t%0,%2" | |
65b1d8ea AK |
5088 | [(set_attr "op_type" "RR<E>,RRF,RX<Y>,RXY") |
5089 | (set_attr "cpu_facility" "*,z196,*,*") | |
5090 | (set_attr "z10prop" "z10_super_c_E1,*,z10_super_E1,z10_super_E1")]) | |
9381e3f1 | 5091 | |
9db1d521 HP |
5092 | |
5093 | ; | |
609e7e80 | 5094 | ; sub(tf|df|sf|td|dd)3 instruction pattern(s). |
9db1d521 HP |
5095 | ; |
5096 | ||
d46f24b6 | 5097 | ; sxbr, sdbr, sebr, sdb, seb, sxtr, sdtr |
142cd70f | 5098 | (define_insn "sub<mode>3" |
609e7e80 AK |
5099 | [(set (match_operand:FP 0 "register_operand" "=f, f") |
5100 | (minus:FP (match_operand:FP 1 "register_operand" "<f0>,0") | |
142cd70f | 5101 | (match_operand:FP 2 "general_operand" "f,<Rf>"))) |
ae156f85 | 5102 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 5103 | "TARGET_HARD_FLOAT" |
9db1d521 | 5104 | "@ |
609e7e80 | 5105 | s<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 5106 | s<xde>b\t%0,%2" |
609e7e80 | 5107 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 5108 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 5109 | |
d46f24b6 | 5110 | ; sxbr, sdbr, sebr, sdb, seb, sxtr, sdtr |
f5905b37 | 5111 | (define_insn "*sub<mode>3_cc" |
ae156f85 | 5112 | [(set (reg CC_REGNUM) |
609e7e80 | 5113 | (compare (minus:FP (match_operand:FP 1 "nonimmediate_operand" "<f0>,0") |
142cd70f | 5114 | (match_operand:FP 2 "general_operand" "f,<Rf>")) |
609e7e80 AK |
5115 | (match_operand:FP 3 "const0_operand" ""))) |
5116 | (set (match_operand:FP 0 "register_operand" "=f,f") | |
5117 | (minus:FP (match_dup 1) (match_dup 2)))] | |
142cd70f | 5118 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
3ef093a8 | 5119 | "@ |
609e7e80 | 5120 | s<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 5121 | s<xde>b\t%0,%2" |
609e7e80 | 5122 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 5123 | (set_attr "type" "fsimp<mode>")]) |
3ef093a8 | 5124 | |
d46f24b6 | 5125 | ; sxbr, sdbr, sebr, sdb, seb, sxtr, sdtr |
f5905b37 | 5126 | (define_insn "*sub<mode>3_cconly" |
ae156f85 | 5127 | [(set (reg CC_REGNUM) |
609e7e80 AK |
5128 | (compare (minus:FP (match_operand:FP 1 "nonimmediate_operand" "<f0>,0") |
5129 | (match_operand:FP 2 "general_operand" "f,<Rf>")) | |
5130 | (match_operand:FP 3 "const0_operand" ""))) | |
5131 | (clobber (match_scratch:FP 0 "=f,f"))] | |
142cd70f | 5132 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
3ef093a8 | 5133 | "@ |
609e7e80 | 5134 | s<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 5135 | s<xde>b\t%0,%2" |
609e7e80 | 5136 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 5137 | (set_attr "type" "fsimp<mode>")]) |
3ef093a8 | 5138 | |
9db1d521 | 5139 | |
e69166de UW |
5140 | ;; |
5141 | ;;- Conditional add/subtract instructions. | |
5142 | ;; | |
5143 | ||
5144 | ; | |
9a91a21f | 5145 | ; add(di|si)cc instruction pattern(s). |
e69166de UW |
5146 | ; |
5147 | ||
a996720c UW |
5148 | ; the following 4 patterns are used when the result of an add with |
5149 | ; carry is checked for an overflow condition | |
5150 | ||
5151 | ; op1 + op2 + c < op1 | |
5152 | ||
5153 | ; alcr, alc, alcgr, alcg | |
5154 | (define_insn "*add<mode>3_alc_carry1_cc" | |
5155 | [(set (reg CC_REGNUM) | |
5156 | (compare | |
5157 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") | |
5158 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5159 | (match_operand:GPR 2 "general_operand" "d,RT")) |
a996720c UW |
5160 | (match_dup 1))) |
5161 | (set (match_operand:GPR 0 "register_operand" "=d,d") | |
5162 | (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))] | |
5163 | "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH" | |
5164 | "@ | |
5165 | alc<g>r\t%0,%2 | |
5166 | alc<g>\t%0,%2" | |
65b1d8ea AK |
5167 | [(set_attr "op_type" "RRE,RXY") |
5168 | (set_attr "z196prop" "z196_alone,z196_alone")]) | |
a996720c UW |
5169 | |
5170 | ; alcr, alc, alcgr, alcg | |
5171 | (define_insn "*add<mode>3_alc_carry1_cconly" | |
5172 | [(set (reg CC_REGNUM) | |
5173 | (compare | |
5174 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") | |
5175 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5176 | (match_operand:GPR 2 "general_operand" "d,RT")) |
a996720c UW |
5177 | (match_dup 1))) |
5178 | (clobber (match_scratch:GPR 0 "=d,d"))] | |
5179 | "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH" | |
5180 | "@ | |
5181 | alc<g>r\t%0,%2 | |
5182 | alc<g>\t%0,%2" | |
65b1d8ea AK |
5183 | [(set_attr "op_type" "RRE,RXY") |
5184 | (set_attr "z196prop" "z196_alone,z196_alone")]) | |
a996720c UW |
5185 | |
5186 | ; op1 + op2 + c < op2 | |
5187 | ||
5188 | ; alcr, alc, alcgr, alcg | |
5189 | (define_insn "*add<mode>3_alc_carry2_cc" | |
5190 | [(set (reg CC_REGNUM) | |
5191 | (compare | |
5192 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") | |
5193 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5194 | (match_operand:GPR 2 "general_operand" "d,RT")) |
a996720c UW |
5195 | (match_dup 2))) |
5196 | (set (match_operand:GPR 0 "register_operand" "=d,d") | |
5197 | (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))] | |
5198 | "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH" | |
5199 | "@ | |
5200 | alc<g>r\t%0,%2 | |
5201 | alc<g>\t%0,%2" | |
5202 | [(set_attr "op_type" "RRE,RXY")]) | |
5203 | ||
5204 | ; alcr, alc, alcgr, alcg | |
5205 | (define_insn "*add<mode>3_alc_carry2_cconly" | |
5206 | [(set (reg CC_REGNUM) | |
5207 | (compare | |
5208 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") | |
5209 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5210 | (match_operand:GPR 2 "general_operand" "d,RT")) |
a996720c UW |
5211 | (match_dup 2))) |
5212 | (clobber (match_scratch:GPR 0 "=d,d"))] | |
5213 | "s390_match_ccmode (insn, CCL1mode) && TARGET_CPU_ZARCH" | |
5214 | "@ | |
5215 | alc<g>r\t%0,%2 | |
5216 | alc<g>\t%0,%2" | |
5217 | [(set_attr "op_type" "RRE,RXY")]) | |
5218 | ||
43a09b63 | 5219 | ; alcr, alc, alcgr, alcg |
9a91a21f | 5220 | (define_insn "*add<mode>3_alc_cc" |
ae156f85 | 5221 | [(set (reg CC_REGNUM) |
e69166de | 5222 | (compare |
a94a76a7 UW |
5223 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") |
5224 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5225 | (match_operand:GPR 2 "general_operand" "d,RT")) |
e69166de | 5226 | (const_int 0))) |
9a91a21f | 5227 | (set (match_operand:GPR 0 "register_operand" "=d,d") |
a94a76a7 | 5228 | (plus:GPR (plus:GPR (match_dup 3) (match_dup 1)) (match_dup 2)))] |
2f7e5a0d | 5229 | "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" |
e69166de | 5230 | "@ |
9a91a21f AS |
5231 | alc<g>r\t%0,%2 |
5232 | alc<g>\t%0,%2" | |
e69166de UW |
5233 | [(set_attr "op_type" "RRE,RXY")]) |
5234 | ||
43a09b63 | 5235 | ; alcr, alc, alcgr, alcg |
9a91a21f AS |
5236 | (define_insn "*add<mode>3_alc" |
5237 | [(set (match_operand:GPR 0 "register_operand" "=d,d") | |
a94a76a7 UW |
5238 | (plus:GPR (plus:GPR (match_operand:GPR 3 "s390_alc_comparison" "") |
5239 | (match_operand:GPR 1 "nonimmediate_operand" "%0,0")) | |
fb492564 | 5240 | (match_operand:GPR 2 "general_operand" "d,RT"))) |
ae156f85 | 5241 | (clobber (reg:CC CC_REGNUM))] |
2f7e5a0d | 5242 | "TARGET_CPU_ZARCH" |
e69166de | 5243 | "@ |
9a91a21f AS |
5244 | alc<g>r\t%0,%2 |
5245 | alc<g>\t%0,%2" | |
e69166de UW |
5246 | [(set_attr "op_type" "RRE,RXY")]) |
5247 | ||
43a09b63 | 5248 | ; slbr, slb, slbgr, slbg |
9a91a21f | 5249 | (define_insn "*sub<mode>3_slb_cc" |
ae156f85 | 5250 | [(set (reg CC_REGNUM) |
e69166de | 5251 | (compare |
9a91a21f | 5252 | (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") |
fb492564 | 5253 | (match_operand:GPR 2 "general_operand" "d,RT")) |
9a91a21f | 5254 | (match_operand:GPR 3 "s390_slb_comparison" "")) |
e69166de | 5255 | (const_int 0))) |
9a91a21f AS |
5256 | (set (match_operand:GPR 0 "register_operand" "=d,d") |
5257 | (minus:GPR (minus:GPR (match_dup 1) (match_dup 2)) (match_dup 3)))] | |
2f7e5a0d | 5258 | "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" |
e69166de | 5259 | "@ |
9a91a21f AS |
5260 | slb<g>r\t%0,%2 |
5261 | slb<g>\t%0,%2" | |
9381e3f1 WG |
5262 | [(set_attr "op_type" "RRE,RXY") |
5263 | (set_attr "z10prop" "z10_c,*")]) | |
e69166de | 5264 | |
43a09b63 | 5265 | ; slbr, slb, slbgr, slbg |
9a91a21f AS |
5266 | (define_insn "*sub<mode>3_slb" |
5267 | [(set (match_operand:GPR 0 "register_operand" "=d,d") | |
5268 | (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") | |
fb492564 | 5269 | (match_operand:GPR 2 "general_operand" "d,RT")) |
9a91a21f | 5270 | (match_operand:GPR 3 "s390_slb_comparison" ""))) |
ae156f85 | 5271 | (clobber (reg:CC CC_REGNUM))] |
2f7e5a0d | 5272 | "TARGET_CPU_ZARCH" |
e69166de | 5273 | "@ |
9a91a21f AS |
5274 | slb<g>r\t%0,%2 |
5275 | slb<g>\t%0,%2" | |
9381e3f1 WG |
5276 | [(set_attr "op_type" "RRE,RXY") |
5277 | (set_attr "z10prop" "z10_c,*")]) | |
e69166de | 5278 | |
9a91a21f AS |
5279 | (define_expand "add<mode>cc" |
5280 | [(match_operand:GPR 0 "register_operand" "") | |
5d880bd2 | 5281 | (match_operand 1 "comparison_operator" "") |
9a91a21f AS |
5282 | (match_operand:GPR 2 "register_operand" "") |
5283 | (match_operand:GPR 3 "const_int_operand" "")] | |
5d880bd2 | 5284 | "TARGET_CPU_ZARCH" |
9381e3f1 | 5285 | "if (!s390_expand_addcc (GET_CODE (operands[1]), |
f90b7a5a | 5286 | XEXP (operands[1], 0), XEXP (operands[1], 1), |
9381e3f1 | 5287 | operands[0], operands[2], |
5d880bd2 UW |
5288 | operands[3])) FAIL; DONE;") |
5289 | ||
5290 | ; | |
5291 | ; scond instruction pattern(s). | |
5292 | ; | |
5293 | ||
9a91a21f AS |
5294 | (define_insn_and_split "*scond<mode>" |
5295 | [(set (match_operand:GPR 0 "register_operand" "=&d") | |
5296 | (match_operand:GPR 1 "s390_alc_comparison" "")) | |
ae156f85 | 5297 | (clobber (reg:CC CC_REGNUM))] |
5d880bd2 UW |
5298 | "TARGET_CPU_ZARCH" |
5299 | "#" | |
5300 | "&& reload_completed" | |
5301 | [(set (match_dup 0) (const_int 0)) | |
5302 | (parallel | |
a94a76a7 UW |
5303 | [(set (match_dup 0) (plus:GPR (plus:GPR (match_dup 1) (match_dup 0)) |
5304 | (match_dup 0))) | |
ae156f85 | 5305 | (clobber (reg:CC CC_REGNUM))])] |
b628bd8e | 5306 | "") |
5d880bd2 | 5307 | |
9a91a21f AS |
5308 | (define_insn_and_split "*scond<mode>_neg" |
5309 | [(set (match_operand:GPR 0 "register_operand" "=&d") | |
5310 | (match_operand:GPR 1 "s390_slb_comparison" "")) | |
ae156f85 | 5311 | (clobber (reg:CC CC_REGNUM))] |
5d880bd2 UW |
5312 | "TARGET_CPU_ZARCH" |
5313 | "#" | |
5314 | "&& reload_completed" | |
5315 | [(set (match_dup 0) (const_int 0)) | |
5316 | (parallel | |
9a91a21f AS |
5317 | [(set (match_dup 0) (minus:GPR (minus:GPR (match_dup 0) (match_dup 0)) |
5318 | (match_dup 1))) | |
ae156f85 | 5319 | (clobber (reg:CC CC_REGNUM))]) |
5d880bd2 | 5320 | (parallel |
9a91a21f | 5321 | [(set (match_dup 0) (neg:GPR (match_dup 0))) |
ae156f85 | 5322 | (clobber (reg:CC CC_REGNUM))])] |
b628bd8e | 5323 | "") |
5d880bd2 | 5324 | |
5d880bd2 | 5325 | |
f90b7a5a | 5326 | (define_expand "cstore<mode>4" |
9a91a21f | 5327 | [(set (match_operand:SI 0 "register_operand" "") |
f90b7a5a PB |
5328 | (match_operator:SI 1 "s390_scond_operator" |
5329 | [(match_operand:GPR 2 "register_operand" "") | |
5330 | (match_operand:GPR 3 "general_operand" "")]))] | |
5d880bd2 | 5331 | "TARGET_CPU_ZARCH" |
f90b7a5a | 5332 | "if (!s390_expand_addcc (GET_CODE (operands[1]), operands[2], operands[3], |
5d880bd2 UW |
5333 | operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") |
5334 | ||
f90b7a5a | 5335 | (define_expand "cstorecc4" |
69950452 | 5336 | [(parallel |
f90b7a5a PB |
5337 | [(set (match_operand:SI 0 "register_operand" "") |
5338 | (match_operator:SI 1 "s390_eqne_operator" | |
5339 | [(match_operand:CCZ1 2 "register_operand") | |
5340 | (match_operand 3 "const0_operand")])) | |
69950452 AS |
5341 | (clobber (reg:CC CC_REGNUM))])] |
5342 | "" | |
f90b7a5a PB |
5343 | "emit_insn (gen_sne (operands[0], operands[2])); |
5344 | if (GET_CODE (operands[1]) == EQ) | |
5345 | emit_insn (gen_xorsi3 (operands[0], operands[0], const1_rtx)); | |
5346 | DONE;") | |
69950452 | 5347 | |
f90b7a5a | 5348 | (define_insn_and_split "sne" |
69950452 | 5349 | [(set (match_operand:SI 0 "register_operand" "=d") |
9381e3f1 | 5350 | (ne:SI (match_operand:CCZ1 1 "register_operand" "0") |
69950452 AS |
5351 | (const_int 0))) |
5352 | (clobber (reg:CC CC_REGNUM))] | |
5353 | "" | |
5354 | "#" | |
5355 | "reload_completed" | |
5356 | [(parallel | |
5357 | [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 28))) | |
5358 | (clobber (reg:CC CC_REGNUM))])]) | |
5359 | ||
e69166de | 5360 | |
65b1d8ea AK |
5361 | ;; |
5362 | ;; - Conditional move instructions (introduced with z196) | |
5363 | ;; | |
5364 | ||
5365 | (define_expand "mov<mode>cc" | |
5366 | [(set (match_operand:GPR 0 "nonimmediate_operand" "") | |
5367 | (if_then_else:GPR (match_operand 1 "comparison_operator" "") | |
5368 | (match_operand:GPR 2 "nonimmediate_operand" "") | |
5369 | (match_operand:GPR 3 "nonimmediate_operand" "")))] | |
5370 | "TARGET_Z196" | |
5371 | "operands[1] = s390_emit_compare (GET_CODE (operands[1]), | |
5372 | XEXP (operands[1], 0), XEXP (operands[1], 1));") | |
5373 | ||
27037b5f | 5374 | ; locr, loc, stoc, locgr, locg, stocg |
65b1d8ea AK |
5375 | (define_insn_and_split "*mov<mode>cc" |
5376 | [(set (match_operand:GPR 0 "nonimmediate_operand" "=d,d, d, d,QS,QS,&d") | |
5377 | (if_then_else:GPR | |
5378 | (match_operator 1 "s390_comparison" | |
5379 | [(match_operand 2 "cc_reg_operand" " c,c, c, c, c, c, c") | |
5380 | (const_int 0)]) | |
5381 | (match_operand:GPR 3 "nonimmediate_operand" " d,0,QS, 0, d, 0,QS") | |
5382 | (match_operand:GPR 4 "nonimmediate_operand" " 0,d, 0,QS, 0, d,QS")))] | |
5383 | "TARGET_Z196" | |
5384 | "@ | |
5385 | loc<g>r%C1\t%0,%3 | |
5386 | loc<g>r%D1\t%0,%4 | |
a6510374 AK |
5387 | loc<g>%C1\t%0,%3 |
5388 | loc<g>%D1\t%0,%4 | |
5389 | stoc<g>%C1\t%3,%0 | |
5390 | stoc<g>%D1\t%4,%0 | |
65b1d8ea AK |
5391 | #" |
5392 | "&& reload_completed | |
5393 | && MEM_P (operands[3]) && MEM_P (operands[4])" | |
5394 | [(set (match_dup 0) | |
5395 | (if_then_else:GPR | |
5396 | (match_op_dup 1 [(match_dup 2) (const_int 0)]) | |
5397 | (match_dup 3) | |
5398 | (match_dup 0))) | |
5399 | (set (match_dup 0) | |
5400 | (if_then_else:GPR | |
5401 | (match_op_dup 1 [(match_dup 2) (const_int 0)]) | |
5402 | (match_dup 0) | |
5403 | (match_dup 4)))] | |
5404 | "" | |
5405 | [(set_attr "op_type" "RRF,RRF,RSY,RSY,RSY,RSY,*")]) | |
5406 | ||
9db1d521 HP |
5407 | ;; |
5408 | ;;- Multiply instructions. | |
5409 | ;; | |
5410 | ||
4023fb28 UW |
5411 | ; |
5412 | ; muldi3 instruction pattern(s). | |
5413 | ; | |
9db1d521 | 5414 | |
07893d4f UW |
5415 | (define_insn "*muldi3_sign" |
5416 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
963fc8d0 | 5417 | (mult:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,RT")) |
07893d4f | 5418 | (match_operand:DI 1 "register_operand" "0,0")))] |
9602b6a1 | 5419 | "TARGET_ZARCH" |
07893d4f | 5420 | "@ |
d40c829f UW |
5421 | msgfr\t%0,%2 |
5422 | msgf\t%0,%2" | |
963fc8d0 AK |
5423 | [(set_attr "op_type" "RRE,RXY") |
5424 | (set_attr "type" "imuldi")]) | |
07893d4f | 5425 | |
4023fb28 | 5426 | (define_insn "muldi3" |
963fc8d0 AK |
5427 | [(set (match_operand:DI 0 "register_operand" "=d,d,d,d") |
5428 | (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0") | |
5429 | (match_operand:DI 2 "general_operand" "d,K,RT,Os")))] | |
9602b6a1 | 5430 | "TARGET_ZARCH" |
9db1d521 | 5431 | "@ |
d40c829f UW |
5432 | msgr\t%0,%2 |
5433 | mghi\t%0,%h2 | |
963fc8d0 AK |
5434 | msg\t%0,%2 |
5435 | msgfi\t%0,%2" | |
5436 | [(set_attr "op_type" "RRE,RI,RXY,RIL") | |
5437 | (set_attr "type" "imuldi") | |
5438 | (set_attr "cpu_facility" "*,*,*,z10")]) | |
f2d3c02a | 5439 | |
9db1d521 HP |
5440 | ; |
5441 | ; mulsi3 instruction pattern(s). | |
5442 | ; | |
5443 | ||
f1e77d83 | 5444 | (define_insn "*mulsi3_sign" |
963fc8d0 AK |
5445 | [(set (match_operand:SI 0 "register_operand" "=d,d") |
5446 | (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")) | |
5447 | (match_operand:SI 1 "register_operand" "0,0")))] | |
f1e77d83 | 5448 | "" |
963fc8d0 AK |
5449 | "@ |
5450 | mh\t%0,%2 | |
5451 | mhy\t%0,%2" | |
5452 | [(set_attr "op_type" "RX,RXY") | |
5453 | (set_attr "type" "imulhi") | |
5454 | (set_attr "cpu_facility" "*,z10")]) | |
f1e77d83 | 5455 | |
9db1d521 | 5456 | (define_insn "mulsi3" |
963fc8d0 AK |
5457 | [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") |
5458 | (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0") | |
5459 | (match_operand:SI 2 "general_operand" "d,K,R,T,Os")))] | |
9db1d521 HP |
5460 | "" |
5461 | "@ | |
d40c829f UW |
5462 | msr\t%0,%2 |
5463 | mhi\t%0,%h2 | |
5464 | ms\t%0,%2 | |
963fc8d0 AK |
5465 | msy\t%0,%2 |
5466 | msfi\t%0,%2" | |
5467 | [(set_attr "op_type" "RRE,RI,RX,RXY,RIL") | |
5468 | (set_attr "type" "imulsi,imulhi,imulsi,imulsi,imulsi") | |
5469 | (set_attr "cpu_facility" "*,*,*,*,z10")]) | |
9db1d521 | 5470 | |
4023fb28 UW |
5471 | ; |
5472 | ; mulsidi3 instruction pattern(s). | |
5473 | ; | |
5474 | ||
f1e77d83 | 5475 | (define_insn "mulsidi3" |
963fc8d0 | 5476 | [(set (match_operand:DI 0 "register_operand" "=d,d,d") |
f1e77d83 | 5477 | (mult:DI (sign_extend:DI |
963fc8d0 | 5478 | (match_operand:SI 1 "register_operand" "%0,0,0")) |
f1e77d83 | 5479 | (sign_extend:DI |
963fc8d0 | 5480 | (match_operand:SI 2 "nonimmediate_operand" "d,R,T"))))] |
9602b6a1 | 5481 | "!TARGET_ZARCH" |
f1e77d83 UW |
5482 | "@ |
5483 | mr\t%0,%2 | |
963fc8d0 AK |
5484 | m\t%0,%2 |
5485 | mfy\t%0,%2" | |
5486 | [(set_attr "op_type" "RR,RX,RXY") | |
5487 | (set_attr "type" "imulsi") | |
5488 | (set_attr "cpu_facility" "*,*,z10")]) | |
4023fb28 | 5489 | |
f1e77d83 | 5490 | ; |
6e0d70c9 | 5491 | ; umul instruction pattern(s). |
f1e77d83 | 5492 | ; |
c7453384 | 5493 | |
6e0d70c9 AK |
5494 | ; mlr, ml, mlgr, mlg |
5495 | (define_insn "umul<dwh><mode>3" | |
5496 | [(set (match_operand:DW 0 "register_operand" "=d, d") | |
5497 | (mult:DW (zero_extend:DW | |
5498 | (match_operand:<DWH> 1 "register_operand" "%0, 0")) | |
5499 | (zero_extend:DW | |
5500 | (match_operand:<DWH> 2 "nonimmediate_operand" " d,RT"))))] | |
5501 | "TARGET_CPU_ZARCH" | |
f1e77d83 | 5502 | "@ |
6e0d70c9 AK |
5503 | ml<tg>r\t%0,%2 |
5504 | ml<tg>\t%0,%2" | |
f1e77d83 | 5505 | [(set_attr "op_type" "RRE,RXY") |
6e0d70c9 | 5506 | (set_attr "type" "imul<dwh>")]) |
c7453384 | 5507 | |
9db1d521 | 5508 | ; |
609e7e80 | 5509 | ; mul(tf|df|sf|td|dd)3 instruction pattern(s). |
9db1d521 HP |
5510 | ; |
5511 | ||
9381e3f1 | 5512 | ; mxbr, mdbr, meebr, mxb, mxb, meeb, mdtr, mxtr |
142cd70f | 5513 | (define_insn "mul<mode>3" |
609e7e80 AK |
5514 | [(set (match_operand:FP 0 "register_operand" "=f,f") |
5515 | (mult:FP (match_operand:FP 1 "nonimmediate_operand" "%<f0>,0") | |
5516 | (match_operand:FP 2 "general_operand" "f,<Rf>")))] | |
142cd70f | 5517 | "TARGET_HARD_FLOAT" |
9db1d521 | 5518 | "@ |
609e7e80 | 5519 | m<xdee><bt>r\t%0,<op1>%2 |
f61a2c7d | 5520 | m<xdee>b\t%0,%2" |
609e7e80 | 5521 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 5522 | (set_attr "type" "fmul<mode>")]) |
9db1d521 | 5523 | |
9381e3f1 | 5524 | ; madbr, maebr, maxb, madb, maeb |
d7ecb504 | 5525 | (define_insn "fma<mode>4" |
f61a2c7d | 5526 | [(set (match_operand:DSF 0 "register_operand" "=f,f") |
d7ecb504 RH |
5527 | (fma:DSF (match_operand:DSF 1 "nonimmediate_operand" "%f,f") |
5528 | (match_operand:DSF 2 "nonimmediate_operand" "f,R") | |
f61a2c7d | 5529 | (match_operand:DSF 3 "register_operand" "0,0")))] |
d7ecb504 | 5530 | "TARGET_HARD_FLOAT" |
a1b892b5 | 5531 | "@ |
f61a2c7d AK |
5532 | ma<xde>br\t%0,%1,%2 |
5533 | ma<xde>b\t%0,%1,%2" | |
a1b892b5 | 5534 | [(set_attr "op_type" "RRE,RXE") |
65b1d8ea | 5535 | (set_attr "type" "fmadd<mode>")]) |
a1b892b5 | 5536 | |
43a09b63 | 5537 | ; msxbr, msdbr, msebr, msxb, msdb, mseb |
d7ecb504 | 5538 | (define_insn "fms<mode>4" |
f61a2c7d | 5539 | [(set (match_operand:DSF 0 "register_operand" "=f,f") |
d7ecb504 RH |
5540 | (fma:DSF (match_operand:DSF 1 "nonimmediate_operand" "%f,f") |
5541 | (match_operand:DSF 2 "nonimmediate_operand" "f,R") | |
5542 | (neg:DSF (match_operand:DSF 3 "register_operand" "0,0"))))] | |
5543 | "TARGET_HARD_FLOAT" | |
a1b892b5 | 5544 | "@ |
f61a2c7d AK |
5545 | ms<xde>br\t%0,%1,%2 |
5546 | ms<xde>b\t%0,%1,%2" | |
ce50cae8 | 5547 | [(set_attr "op_type" "RRE,RXE") |
65b1d8ea | 5548 | (set_attr "type" "fmadd<mode>")]) |
9db1d521 HP |
5549 | |
5550 | ;; | |
5551 | ;;- Divide and modulo instructions. | |
5552 | ;; | |
5553 | ||
5554 | ; | |
4023fb28 | 5555 | ; divmoddi4 instruction pattern(s). |
9db1d521 HP |
5556 | ; |
5557 | ||
4023fb28 UW |
5558 | (define_expand "divmoddi4" |
5559 | [(parallel [(set (match_operand:DI 0 "general_operand" "") | |
f1e77d83 | 5560 | (div:DI (match_operand:DI 1 "register_operand" "") |
4023fb28 UW |
5561 | (match_operand:DI 2 "general_operand" ""))) |
5562 | (set (match_operand:DI 3 "general_operand" "") | |
5563 | (mod:DI (match_dup 1) (match_dup 2)))]) | |
5564 | (clobber (match_dup 4))] | |
9602b6a1 | 5565 | "TARGET_ZARCH" |
9db1d521 | 5566 | { |
f1e77d83 | 5567 | rtx insn, div_equal, mod_equal; |
4023fb28 UW |
5568 | |
5569 | div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]); | |
5570 | mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]); | |
4023fb28 UW |
5571 | |
5572 | operands[4] = gen_reg_rtx(TImode); | |
f1e77d83 | 5573 | emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2])); |
4023fb28 UW |
5574 | |
5575 | insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4])); | |
bd94cb6e | 5576 | set_unique_reg_note (insn, REG_EQUAL, div_equal); |
4023fb28 UW |
5577 | |
5578 | insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4])); | |
bd94cb6e | 5579 | set_unique_reg_note (insn, REG_EQUAL, mod_equal); |
9db1d521 | 5580 | |
9db1d521 | 5581 | DONE; |
10bbf137 | 5582 | }) |
9db1d521 HP |
5583 | |
5584 | (define_insn "divmodtidi3" | |
4023fb28 UW |
5585 | [(set (match_operand:TI 0 "register_operand" "=d,d") |
5586 | (ior:TI | |
4023fb28 UW |
5587 | (ashift:TI |
5588 | (zero_extend:TI | |
5665e398 | 5589 | (mod:DI (match_operand:DI 1 "register_operand" "0,0") |
fb492564 | 5590 | (match_operand:DI 2 "general_operand" "d,RT"))) |
5665e398 UW |
5591 | (const_int 64)) |
5592 | (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))] | |
9602b6a1 | 5593 | "TARGET_ZARCH" |
9db1d521 | 5594 | "@ |
d40c829f UW |
5595 | dsgr\t%0,%2 |
5596 | dsg\t%0,%2" | |
d3632d41 | 5597 | [(set_attr "op_type" "RRE,RXY") |
077dab3b | 5598 | (set_attr "type" "idiv")]) |
9db1d521 | 5599 | |
4023fb28 UW |
5600 | (define_insn "divmodtisi3" |
5601 | [(set (match_operand:TI 0 "register_operand" "=d,d") | |
5602 | (ior:TI | |
4023fb28 UW |
5603 | (ashift:TI |
5604 | (zero_extend:TI | |
5665e398 | 5605 | (mod:DI (match_operand:DI 1 "register_operand" "0,0") |
2f7e5a0d | 5606 | (sign_extend:DI |
fb492564 | 5607 | (match_operand:SI 2 "nonimmediate_operand" "d,RT")))) |
5665e398 UW |
5608 | (const_int 64)) |
5609 | (zero_extend:TI | |
5610 | (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))] | |
9602b6a1 | 5611 | "TARGET_ZARCH" |
4023fb28 | 5612 | "@ |
d40c829f UW |
5613 | dsgfr\t%0,%2 |
5614 | dsgf\t%0,%2" | |
d3632d41 | 5615 | [(set_attr "op_type" "RRE,RXY") |
077dab3b | 5616 | (set_attr "type" "idiv")]) |
9db1d521 | 5617 | |
4023fb28 UW |
5618 | ; |
5619 | ; udivmoddi4 instruction pattern(s). | |
5620 | ; | |
9db1d521 | 5621 | |
4023fb28 UW |
5622 | (define_expand "udivmoddi4" |
5623 | [(parallel [(set (match_operand:DI 0 "general_operand" "") | |
5624 | (udiv:DI (match_operand:DI 1 "general_operand" "") | |
5625 | (match_operand:DI 2 "nonimmediate_operand" ""))) | |
5626 | (set (match_operand:DI 3 "general_operand" "") | |
5627 | (umod:DI (match_dup 1) (match_dup 2)))]) | |
5628 | (clobber (match_dup 4))] | |
9602b6a1 | 5629 | "TARGET_ZARCH" |
9db1d521 | 5630 | { |
4023fb28 UW |
5631 | rtx insn, div_equal, mod_equal, equal; |
5632 | ||
5633 | div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]); | |
5634 | mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]); | |
5635 | equal = gen_rtx_IOR (TImode, | |
4023fb28 UW |
5636 | gen_rtx_ASHIFT (TImode, |
5637 | gen_rtx_ZERO_EXTEND (TImode, mod_equal), | |
5665e398 UW |
5638 | GEN_INT (64)), |
5639 | gen_rtx_ZERO_EXTEND (TImode, div_equal)); | |
4023fb28 UW |
5640 | |
5641 | operands[4] = gen_reg_rtx(TImode); | |
c41c1387 | 5642 | emit_clobber (operands[4]); |
4023fb28 UW |
5643 | emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]); |
5644 | emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx); | |
bd94cb6e | 5645 | |
4023fb28 | 5646 | insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2])); |
bd94cb6e | 5647 | set_unique_reg_note (insn, REG_EQUAL, equal); |
4023fb28 UW |
5648 | |
5649 | insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4])); | |
bd94cb6e | 5650 | set_unique_reg_note (insn, REG_EQUAL, div_equal); |
4023fb28 UW |
5651 | |
5652 | insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4])); | |
bd94cb6e | 5653 | set_unique_reg_note (insn, REG_EQUAL, mod_equal); |
9db1d521 | 5654 | |
9db1d521 | 5655 | DONE; |
10bbf137 | 5656 | }) |
9db1d521 HP |
5657 | |
5658 | (define_insn "udivmodtidi3" | |
4023fb28 | 5659 | [(set (match_operand:TI 0 "register_operand" "=d,d") |
2f7e5a0d | 5660 | (ior:TI |
5665e398 UW |
5661 | (ashift:TI |
5662 | (zero_extend:TI | |
5663 | (truncate:DI | |
2f7e5a0d EC |
5664 | (umod:TI (match_operand:TI 1 "register_operand" "0,0") |
5665 | (zero_extend:TI | |
fb492564 | 5666 | (match_operand:DI 2 "nonimmediate_operand" "d,RT"))))) |
5665e398 UW |
5667 | (const_int 64)) |
5668 | (zero_extend:TI | |
5669 | (truncate:DI | |
5670 | (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))] | |
9602b6a1 | 5671 | "TARGET_ZARCH" |
9db1d521 | 5672 | "@ |
d40c829f UW |
5673 | dlgr\t%0,%2 |
5674 | dlg\t%0,%2" | |
d3632d41 | 5675 | [(set_attr "op_type" "RRE,RXY") |
077dab3b | 5676 | (set_attr "type" "idiv")]) |
9db1d521 HP |
5677 | |
5678 | ; | |
4023fb28 | 5679 | ; divmodsi4 instruction pattern(s). |
9db1d521 HP |
5680 | ; |
5681 | ||
4023fb28 UW |
5682 | (define_expand "divmodsi4" |
5683 | [(parallel [(set (match_operand:SI 0 "general_operand" "") | |
5684 | (div:SI (match_operand:SI 1 "general_operand" "") | |
5685 | (match_operand:SI 2 "nonimmediate_operand" ""))) | |
5686 | (set (match_operand:SI 3 "general_operand" "") | |
5687 | (mod:SI (match_dup 1) (match_dup 2)))]) | |
5688 | (clobber (match_dup 4))] | |
9602b6a1 | 5689 | "!TARGET_ZARCH" |
9db1d521 | 5690 | { |
4023fb28 UW |
5691 | rtx insn, div_equal, mod_equal, equal; |
5692 | ||
5693 | div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]); | |
5694 | mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]); | |
5695 | equal = gen_rtx_IOR (DImode, | |
4023fb28 UW |
5696 | gen_rtx_ASHIFT (DImode, |
5697 | gen_rtx_ZERO_EXTEND (DImode, mod_equal), | |
5665e398 UW |
5698 | GEN_INT (32)), |
5699 | gen_rtx_ZERO_EXTEND (DImode, div_equal)); | |
4023fb28 UW |
5700 | |
5701 | operands[4] = gen_reg_rtx(DImode); | |
5702 | emit_insn (gen_extendsidi2 (operands[4], operands[1])); | |
bd94cb6e | 5703 | |
4023fb28 | 5704 | insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2])); |
bd94cb6e | 5705 | set_unique_reg_note (insn, REG_EQUAL, equal); |
4023fb28 UW |
5706 | |
5707 | insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4])); | |
bd94cb6e | 5708 | set_unique_reg_note (insn, REG_EQUAL, div_equal); |
4023fb28 UW |
5709 | |
5710 | insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4])); | |
bd94cb6e | 5711 | set_unique_reg_note (insn, REG_EQUAL, mod_equal); |
9db1d521 | 5712 | |
9db1d521 | 5713 | DONE; |
10bbf137 | 5714 | }) |
9db1d521 HP |
5715 | |
5716 | (define_insn "divmoddisi3" | |
4023fb28 | 5717 | [(set (match_operand:DI 0 "register_operand" "=d,d") |
2f7e5a0d | 5718 | (ior:DI |
5665e398 UW |
5719 | (ashift:DI |
5720 | (zero_extend:DI | |
5721 | (truncate:SI | |
2f7e5a0d EC |
5722 | (mod:DI (match_operand:DI 1 "register_operand" "0,0") |
5723 | (sign_extend:DI | |
5665e398 UW |
5724 | (match_operand:SI 2 "nonimmediate_operand" "d,R"))))) |
5725 | (const_int 32)) | |
5726 | (zero_extend:DI | |
5727 | (truncate:SI | |
5728 | (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))] | |
9602b6a1 | 5729 | "!TARGET_ZARCH" |
9db1d521 | 5730 | "@ |
d40c829f UW |
5731 | dr\t%0,%2 |
5732 | d\t%0,%2" | |
9db1d521 | 5733 | [(set_attr "op_type" "RR,RX") |
077dab3b | 5734 | (set_attr "type" "idiv")]) |
9db1d521 HP |
5735 | |
5736 | ; | |
5737 | ; udivsi3 and umodsi3 instruction pattern(s). | |
5738 | ; | |
5739 | ||
f1e77d83 UW |
5740 | (define_expand "udivmodsi4" |
5741 | [(parallel [(set (match_operand:SI 0 "general_operand" "") | |
5742 | (udiv:SI (match_operand:SI 1 "general_operand" "") | |
5743 | (match_operand:SI 2 "nonimmediate_operand" ""))) | |
5744 | (set (match_operand:SI 3 "general_operand" "") | |
5745 | (umod:SI (match_dup 1) (match_dup 2)))]) | |
5746 | (clobber (match_dup 4))] | |
9602b6a1 | 5747 | "!TARGET_ZARCH && TARGET_CPU_ZARCH" |
f1e77d83 UW |
5748 | { |
5749 | rtx insn, div_equal, mod_equal, equal; | |
5750 | ||
5751 | div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); | |
5752 | mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); | |
5753 | equal = gen_rtx_IOR (DImode, | |
f1e77d83 UW |
5754 | gen_rtx_ASHIFT (DImode, |
5755 | gen_rtx_ZERO_EXTEND (DImode, mod_equal), | |
5665e398 UW |
5756 | GEN_INT (32)), |
5757 | gen_rtx_ZERO_EXTEND (DImode, div_equal)); | |
f1e77d83 UW |
5758 | |
5759 | operands[4] = gen_reg_rtx(DImode); | |
c41c1387 | 5760 | emit_clobber (operands[4]); |
f1e77d83 UW |
5761 | emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]); |
5762 | emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx); | |
bd94cb6e | 5763 | |
f1e77d83 | 5764 | insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2])); |
bd94cb6e | 5765 | set_unique_reg_note (insn, REG_EQUAL, equal); |
f1e77d83 UW |
5766 | |
5767 | insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4])); | |
bd94cb6e | 5768 | set_unique_reg_note (insn, REG_EQUAL, div_equal); |
f1e77d83 UW |
5769 | |
5770 | insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4])); | |
bd94cb6e | 5771 | set_unique_reg_note (insn, REG_EQUAL, mod_equal); |
f1e77d83 UW |
5772 | |
5773 | DONE; | |
5774 | }) | |
5775 | ||
5776 | (define_insn "udivmoddisi3" | |
5777 | [(set (match_operand:DI 0 "register_operand" "=d,d") | |
2f7e5a0d | 5778 | (ior:DI |
5665e398 UW |
5779 | (ashift:DI |
5780 | (zero_extend:DI | |
5781 | (truncate:SI | |
2f7e5a0d EC |
5782 | (umod:DI (match_operand:DI 1 "register_operand" "0,0") |
5783 | (zero_extend:DI | |
fb492564 | 5784 | (match_operand:SI 2 "nonimmediate_operand" "d,RT"))))) |
5665e398 UW |
5785 | (const_int 32)) |
5786 | (zero_extend:DI | |
5787 | (truncate:SI | |
5788 | (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))] | |
9602b6a1 | 5789 | "!TARGET_ZARCH && TARGET_CPU_ZARCH" |
f1e77d83 UW |
5790 | "@ |
5791 | dlr\t%0,%2 | |
5792 | dl\t%0,%2" | |
5793 | [(set_attr "op_type" "RRE,RXY") | |
5794 | (set_attr "type" "idiv")]) | |
4023fb28 | 5795 | |
9db1d521 HP |
5796 | (define_expand "udivsi3" |
5797 | [(set (match_operand:SI 0 "register_operand" "=d") | |
5798 | (udiv:SI (match_operand:SI 1 "general_operand" "") | |
4023fb28 UW |
5799 | (match_operand:SI 2 "general_operand" ""))) |
5800 | (clobber (match_dup 3))] | |
9602b6a1 | 5801 | "!TARGET_ZARCH && !TARGET_CPU_ZARCH" |
9db1d521 | 5802 | { |
4023fb28 UW |
5803 | rtx insn, udiv_equal, umod_equal, equal; |
5804 | ||
5805 | udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); | |
5806 | umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); | |
5807 | equal = gen_rtx_IOR (DImode, | |
4023fb28 UW |
5808 | gen_rtx_ASHIFT (DImode, |
5809 | gen_rtx_ZERO_EXTEND (DImode, umod_equal), | |
5665e398 UW |
5810 | GEN_INT (32)), |
5811 | gen_rtx_ZERO_EXTEND (DImode, udiv_equal)); | |
9db1d521 | 5812 | |
4023fb28 | 5813 | operands[3] = gen_reg_rtx (DImode); |
9db1d521 HP |
5814 | |
5815 | if (CONSTANT_P (operands[2])) | |
5816 | { | |
5817 | if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0) | |
5818 | { | |
5819 | rtx label1 = gen_label_rtx (); | |
5820 | ||
4023fb28 UW |
5821 | operands[1] = make_safe_from (operands[1], operands[0]); |
5822 | emit_move_insn (operands[0], const0_rtx); | |
f90b7a5a PB |
5823 | emit_cmp_and_jump_insns (operands[1], operands[2], LT, NULL_RTX, |
5824 | SImode, 1, label1); | |
4023fb28 | 5825 | emit_move_insn (operands[0], const1_rtx); |
9db1d521 HP |
5826 | emit_label (label1); |
5827 | } | |
5828 | else | |
5829 | { | |
c7453384 EC |
5830 | operands[2] = force_reg (SImode, operands[2]); |
5831 | operands[2] = make_safe_from (operands[2], operands[0]); | |
4023fb28 UW |
5832 | |
5833 | emit_insn (gen_zero_extendsidi2 (operands[3], operands[1])); | |
5834 | insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3], | |
5835 | operands[2])); | |
bd94cb6e | 5836 | set_unique_reg_note (insn, REG_EQUAL, equal); |
c7453384 EC |
5837 | |
5838 | insn = emit_move_insn (operands[0], | |
4023fb28 | 5839 | gen_lowpart (SImode, operands[3])); |
bd94cb6e | 5840 | set_unique_reg_note (insn, REG_EQUAL, udiv_equal); |
9db1d521 HP |
5841 | } |
5842 | } | |
5843 | else | |
c7453384 | 5844 | { |
9db1d521 HP |
5845 | rtx label1 = gen_label_rtx (); |
5846 | rtx label2 = gen_label_rtx (); | |
5847 | rtx label3 = gen_label_rtx (); | |
5848 | ||
c7453384 EC |
5849 | operands[1] = force_reg (SImode, operands[1]); |
5850 | operands[1] = make_safe_from (operands[1], operands[0]); | |
5851 | operands[2] = force_reg (SImode, operands[2]); | |
5852 | operands[2] = make_safe_from (operands[2], operands[0]); | |
4023fb28 UW |
5853 | |
5854 | emit_move_insn (operands[0], const0_rtx); | |
f90b7a5a PB |
5855 | emit_cmp_and_jump_insns (operands[2], operands[1], GT, NULL_RTX, |
5856 | SImode, 1, label3); | |
5857 | emit_cmp_and_jump_insns (operands[2], const0_rtx, LT, NULL_RTX, | |
5858 | SImode, 0, label2); | |
5859 | emit_cmp_and_jump_insns (operands[2], const1_rtx, EQ, NULL_RTX, | |
5860 | SImode, 0, label1); | |
4023fb28 UW |
5861 | emit_insn (gen_zero_extendsidi2 (operands[3], operands[1])); |
5862 | insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3], | |
5863 | operands[2])); | |
bd94cb6e | 5864 | set_unique_reg_note (insn, REG_EQUAL, equal); |
c7453384 EC |
5865 | |
5866 | insn = emit_move_insn (operands[0], | |
4023fb28 | 5867 | gen_lowpart (SImode, operands[3])); |
bd94cb6e SB |
5868 | set_unique_reg_note (insn, REG_EQUAL, udiv_equal); |
5869 | ||
f314b9b1 | 5870 | emit_jump (label3); |
9db1d521 | 5871 | emit_label (label1); |
4023fb28 | 5872 | emit_move_insn (operands[0], operands[1]); |
f314b9b1 | 5873 | emit_jump (label3); |
9db1d521 | 5874 | emit_label (label2); |
4023fb28 | 5875 | emit_move_insn (operands[0], const1_rtx); |
9db1d521 HP |
5876 | emit_label (label3); |
5877 | } | |
c7453384 | 5878 | emit_move_insn (operands[0], operands[0]); |
9db1d521 | 5879 | DONE; |
10bbf137 | 5880 | }) |
9db1d521 HP |
5881 | |
5882 | (define_expand "umodsi3" | |
5883 | [(set (match_operand:SI 0 "register_operand" "=d") | |
5884 | (umod:SI (match_operand:SI 1 "nonimmediate_operand" "") | |
4023fb28 UW |
5885 | (match_operand:SI 2 "nonimmediate_operand" ""))) |
5886 | (clobber (match_dup 3))] | |
9602b6a1 | 5887 | "!TARGET_ZARCH && !TARGET_CPU_ZARCH" |
9db1d521 | 5888 | { |
4023fb28 UW |
5889 | rtx insn, udiv_equal, umod_equal, equal; |
5890 | ||
5891 | udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]); | |
5892 | umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]); | |
5893 | equal = gen_rtx_IOR (DImode, | |
4023fb28 UW |
5894 | gen_rtx_ASHIFT (DImode, |
5895 | gen_rtx_ZERO_EXTEND (DImode, umod_equal), | |
5665e398 UW |
5896 | GEN_INT (32)), |
5897 | gen_rtx_ZERO_EXTEND (DImode, udiv_equal)); | |
9db1d521 | 5898 | |
4023fb28 | 5899 | operands[3] = gen_reg_rtx (DImode); |
9db1d521 HP |
5900 | |
5901 | if (CONSTANT_P (operands[2])) | |
5902 | { | |
5903 | if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0) | |
5904 | { | |
5905 | rtx label1 = gen_label_rtx (); | |
5906 | ||
4023fb28 UW |
5907 | operands[1] = make_safe_from (operands[1], operands[0]); |
5908 | emit_move_insn (operands[0], operands[1]); | |
f90b7a5a PB |
5909 | emit_cmp_and_jump_insns (operands[0], operands[2], LT, NULL_RTX, |
5910 | SImode, 1, label1); | |
4023fb28 UW |
5911 | emit_insn (gen_abssi2 (operands[0], operands[2])); |
5912 | emit_insn (gen_addsi3 (operands[0], operands[0], operands[1])); | |
9db1d521 HP |
5913 | emit_label (label1); |
5914 | } | |
5915 | else | |
5916 | { | |
c7453384 EC |
5917 | operands[2] = force_reg (SImode, operands[2]); |
5918 | operands[2] = make_safe_from (operands[2], operands[0]); | |
4023fb28 UW |
5919 | |
5920 | emit_insn (gen_zero_extendsidi2 (operands[3], operands[1])); | |
5921 | insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3], | |
5922 | operands[2])); | |
bd94cb6e | 5923 | set_unique_reg_note (insn, REG_EQUAL, equal); |
c7453384 EC |
5924 | |
5925 | insn = emit_move_insn (operands[0], | |
4023fb28 | 5926 | gen_highpart (SImode, operands[3])); |
bd94cb6e | 5927 | set_unique_reg_note (insn, REG_EQUAL, umod_equal); |
9db1d521 HP |
5928 | } |
5929 | } | |
5930 | else | |
5931 | { | |
5932 | rtx label1 = gen_label_rtx (); | |
5933 | rtx label2 = gen_label_rtx (); | |
5934 | rtx label3 = gen_label_rtx (); | |
5935 | ||
c7453384 EC |
5936 | operands[1] = force_reg (SImode, operands[1]); |
5937 | operands[1] = make_safe_from (operands[1], operands[0]); | |
5938 | operands[2] = force_reg (SImode, operands[2]); | |
5939 | operands[2] = make_safe_from (operands[2], operands[0]); | |
9db1d521 | 5940 | |
c7453384 | 5941 | emit_move_insn(operands[0], operands[1]); |
f90b7a5a PB |
5942 | emit_cmp_and_jump_insns (operands[2], operands[1], GT, NULL_RTX, |
5943 | SImode, 1, label3); | |
5944 | emit_cmp_and_jump_insns (operands[2], const0_rtx, LT, NULL_RTX, | |
5945 | SImode, 0, label2); | |
5946 | emit_cmp_and_jump_insns (operands[2], const1_rtx, EQ, NULL_RTX, | |
5947 | SImode, 0, label1); | |
4023fb28 UW |
5948 | emit_insn (gen_zero_extendsidi2 (operands[3], operands[1])); |
5949 | insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3], | |
5950 | operands[2])); | |
bd94cb6e | 5951 | set_unique_reg_note (insn, REG_EQUAL, equal); |
c7453384 EC |
5952 | |
5953 | insn = emit_move_insn (operands[0], | |
4023fb28 | 5954 | gen_highpart (SImode, operands[3])); |
bd94cb6e SB |
5955 | set_unique_reg_note (insn, REG_EQUAL, umod_equal); |
5956 | ||
f314b9b1 | 5957 | emit_jump (label3); |
9db1d521 | 5958 | emit_label (label1); |
4023fb28 | 5959 | emit_move_insn (operands[0], const0_rtx); |
f314b9b1 | 5960 | emit_jump (label3); |
9db1d521 | 5961 | emit_label (label2); |
4023fb28 | 5962 | emit_insn (gen_subsi3 (operands[0], operands[0], operands[2])); |
9db1d521 HP |
5963 | emit_label (label3); |
5964 | } | |
9db1d521 | 5965 | DONE; |
10bbf137 | 5966 | }) |
9db1d521 HP |
5967 | |
5968 | ; | |
f5905b37 | 5969 | ; div(df|sf)3 instruction pattern(s). |
9db1d521 HP |
5970 | ; |
5971 | ||
609e7e80 | 5972 | ; dxbr, ddbr, debr, dxb, ddb, deb, ddtr, dxtr |
142cd70f | 5973 | (define_insn "div<mode>3" |
609e7e80 AK |
5974 | [(set (match_operand:FP 0 "register_operand" "=f,f") |
5975 | (div:FP (match_operand:FP 1 "register_operand" "<f0>,0") | |
5976 | (match_operand:FP 2 "general_operand" "f,<Rf>")))] | |
142cd70f | 5977 | "TARGET_HARD_FLOAT" |
9db1d521 | 5978 | "@ |
609e7e80 | 5979 | d<xde><bt>r\t%0,<op1>%2 |
f61a2c7d | 5980 | d<xde>b\t%0,%2" |
609e7e80 | 5981 | [(set_attr "op_type" "<RRer>,RXE") |
9381e3f1 | 5982 | (set_attr "type" "fdiv<mode>")]) |
9db1d521 | 5983 | |
9db1d521 HP |
5984 | |
5985 | ;; | |
5986 | ;;- And instructions. | |
5987 | ;; | |
5988 | ||
047d35ed AS |
5989 | (define_expand "and<mode>3" |
5990 | [(set (match_operand:INT 0 "nonimmediate_operand" "") | |
5991 | (and:INT (match_operand:INT 1 "nonimmediate_operand" "") | |
5992 | (match_operand:INT 2 "general_operand" ""))) | |
5993 | (clobber (reg:CC CC_REGNUM))] | |
5994 | "" | |
5995 | "s390_expand_logical_operator (AND, <MODE>mode, operands); DONE;") | |
5996 | ||
9db1d521 HP |
5997 | ; |
5998 | ; anddi3 instruction pattern(s). | |
5999 | ; | |
6000 | ||
6001 | (define_insn "*anddi3_cc" | |
ae156f85 | 6002 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6003 | (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d, 0") |
6004 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
9db1d521 | 6005 | (const_int 0))) |
65b1d8ea | 6006 | (set (match_operand:DI 0 "register_operand" "=d,d, d") |
9db1d521 | 6007 | (and:DI (match_dup 1) (match_dup 2)))] |
9602b6a1 | 6008 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" |
9db1d521 | 6009 | "@ |
d40c829f | 6010 | ngr\t%0,%2 |
65b1d8ea | 6011 | ngrk\t%0,%1,%2 |
d40c829f | 6012 | ng\t%0,%2" |
65b1d8ea AK |
6013 | [(set_attr "op_type" "RRE,RRF,RXY") |
6014 | (set_attr "cpu_facility" "*,z196,*") | |
6015 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) | |
9db1d521 HP |
6016 | |
6017 | (define_insn "*anddi3_cconly" | |
ae156f85 | 6018 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6019 | (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d, 0") |
6020 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
9db1d521 | 6021 | (const_int 0))) |
65b1d8ea | 6022 | (clobber (match_scratch:DI 0 "=d,d, d"))] |
9602b6a1 | 6023 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH |
68f9c5e2 UW |
6024 | /* Do not steal TM patterns. */ |
6025 | && s390_single_part (operands[2], DImode, HImode, 0) < 0" | |
9db1d521 | 6026 | "@ |
d40c829f | 6027 | ngr\t%0,%2 |
65b1d8ea | 6028 | ngrk\t%0,%1,%2 |
d40c829f | 6029 | ng\t%0,%2" |
65b1d8ea AK |
6030 | [(set_attr "op_type" "RRE,RRF,RXY") |
6031 | (set_attr "cpu_facility" "*,z196,*") | |
6032 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) | |
9db1d521 | 6033 | |
3af8e996 | 6034 | (define_insn "*anddi3" |
65b1d8ea AK |
6035 | [(set (match_operand:DI 0 "nonimmediate_operand" |
6036 | "=d,d, d, d, d, d, d, d,d,d, d, AQ,Q") | |
ec24698e | 6037 | (and:DI (match_operand:DI 1 "nonimmediate_operand" |
65b1d8ea | 6038 | "%d,o, 0, 0, 0, 0, 0, 0,0,d, 0, 0,0") |
ec24698e | 6039 | (match_operand:DI 2 "general_operand" |
65b1d8ea | 6040 | "M, M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,d,RT,NxQDF,Q"))) |
ec24698e | 6041 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 6042 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
ec24698e UW |
6043 | "@ |
6044 | # | |
6045 | # | |
6046 | nihh\t%0,%j2 | |
6047 | nihl\t%0,%j2 | |
6048 | nilh\t%0,%j2 | |
6049 | nill\t%0,%j2 | |
6050 | nihf\t%0,%m2 | |
6051 | nilf\t%0,%m2 | |
6052 | ngr\t%0,%2 | |
65b1d8ea | 6053 | ngrk\t%0,%1,%2 |
ec24698e UW |
6054 | ng\t%0,%2 |
6055 | # | |
6056 | #" | |
65b1d8ea AK |
6057 | [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RRF,RXY,SI,SS") |
6058 | (set_attr "cpu_facility" "*,*,*,*,*,*,extimm,extimm,*,z196,*,*,*") | |
9381e3f1 WG |
6059 | (set_attr "z10prop" "*, |
6060 | *, | |
6061 | z10_super_E1, | |
6062 | z10_super_E1, | |
6063 | z10_super_E1, | |
6064 | z10_super_E1, | |
6065 | z10_super_E1, | |
6066 | z10_super_E1, | |
6067 | z10_super_E1, | |
65b1d8ea | 6068 | *, |
9381e3f1 WG |
6069 | z10_super_E1, |
6070 | *, | |
6071 | *")]) | |
0dfa6c5e UW |
6072 | |
6073 | (define_split | |
6074 | [(set (match_operand:DI 0 "s_operand" "") | |
6075 | (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) | |
ae156f85 | 6076 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6077 | "reload_completed" |
6078 | [(parallel | |
6079 | [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6080 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6081 | "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") |
4023fb28 | 6082 | |
9db1d521 HP |
6083 | |
6084 | ; | |
6085 | ; andsi3 instruction pattern(s). | |
6086 | ; | |
6087 | ||
6088 | (define_insn "*andsi3_cc" | |
ae156f85 | 6089 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6090 | (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6091 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
9db1d521 | 6092 | (const_int 0))) |
65b1d8ea | 6093 | (set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") |
9db1d521 HP |
6094 | (and:SI (match_dup 1) (match_dup 2)))] |
6095 | "s390_match_ccmode(insn, CCTmode)" | |
6096 | "@ | |
ec24698e | 6097 | nilf\t%0,%o2 |
d40c829f | 6098 | nr\t%0,%2 |
65b1d8ea | 6099 | nrk\t%0,%1,%2 |
d40c829f UW |
6100 | n\t%0,%2 |
6101 | ny\t%0,%2" | |
65b1d8ea AK |
6102 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6103 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6104 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
9db1d521 HP |
6105 | |
6106 | (define_insn "*andsi3_cconly" | |
ae156f85 | 6107 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6108 | (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6109 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
9db1d521 | 6110 | (const_int 0))) |
65b1d8ea | 6111 | (clobber (match_scratch:SI 0 "=d,d,d,d,d"))] |
68f9c5e2 UW |
6112 | "s390_match_ccmode(insn, CCTmode) |
6113 | /* Do not steal TM patterns. */ | |
6114 | && s390_single_part (operands[2], SImode, HImode, 0) < 0" | |
9db1d521 | 6115 | "@ |
ec24698e | 6116 | nilf\t%0,%o2 |
d40c829f | 6117 | nr\t%0,%2 |
65b1d8ea | 6118 | nrk\t%0,%1,%2 |
d40c829f UW |
6119 | n\t%0,%2 |
6120 | ny\t%0,%2" | |
65b1d8ea AK |
6121 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6122 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6123 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*, | |
6124 | z10_super_E1,z10_super_E1")]) | |
9db1d521 | 6125 | |
f19a9af7 | 6126 | (define_insn "*andsi3_zarch" |
65b1d8ea AK |
6127 | [(set (match_operand:SI 0 "nonimmediate_operand" |
6128 | "=d,d, d, d, d,d,d,d,d, AQ,Q") | |
0dfa6c5e | 6129 | (and:SI (match_operand:SI 1 "nonimmediate_operand" |
65b1d8ea | 6130 | "%d,o, 0, 0, 0,0,d,0,0, 0,0") |
0dfa6c5e | 6131 | (match_operand:SI 2 "general_operand" |
65b1d8ea | 6132 | " M,M,N0HSF,N1HSF,Os,d,d,R,T,NxQSF,Q"))) |
ae156f85 | 6133 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6134 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
9db1d521 | 6135 | "@ |
f19a9af7 AK |
6136 | # |
6137 | # | |
6138 | nilh\t%0,%j2 | |
2f7e5a0d | 6139 | nill\t%0,%j2 |
ec24698e | 6140 | nilf\t%0,%o2 |
d40c829f | 6141 | nr\t%0,%2 |
65b1d8ea | 6142 | nrk\t%0,%1,%2 |
d40c829f | 6143 | n\t%0,%2 |
8cb66696 | 6144 | ny\t%0,%2 |
0dfa6c5e | 6145 | # |
19b63d8e | 6146 | #" |
65b1d8ea AK |
6147 | [(set_attr "op_type" "RRE,RXE,RI,RI,RIL,RR,RRF,RX,RXY,SI,SS") |
6148 | (set_attr "cpu_facility" "*,*,*,*,*,*,z196,*,*,*,*") | |
9381e3f1 WG |
6149 | (set_attr "z10prop" "*, |
6150 | *, | |
6151 | z10_super_E1, | |
6152 | z10_super_E1, | |
6153 | z10_super_E1, | |
6154 | z10_super_E1, | |
65b1d8ea | 6155 | *, |
9381e3f1 WG |
6156 | z10_super_E1, |
6157 | z10_super_E1, | |
6158 | *, | |
6159 | *")]) | |
f19a9af7 AK |
6160 | |
6161 | (define_insn "*andsi3_esa" | |
65b1d8ea AK |
6162 | [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d, AQ,Q") |
6163 | (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0, 0,0") | |
6164 | (match_operand:SI 2 "general_operand" " d,R,NxQSF,Q"))) | |
ae156f85 | 6165 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6166 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
f19a9af7 AK |
6167 | "@ |
6168 | nr\t%0,%2 | |
8cb66696 | 6169 | n\t%0,%2 |
0dfa6c5e | 6170 | # |
19b63d8e | 6171 | #" |
9381e3f1 WG |
6172 | [(set_attr "op_type" "RR,RX,SI,SS") |
6173 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")]) | |
6174 | ||
0dfa6c5e UW |
6175 | |
6176 | (define_split | |
6177 | [(set (match_operand:SI 0 "s_operand" "") | |
6178 | (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) | |
ae156f85 | 6179 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6180 | "reload_completed" |
6181 | [(parallel | |
6182 | [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6183 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6184 | "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") |
4023fb28 | 6185 | |
9db1d521 HP |
6186 | ; |
6187 | ; andhi3 instruction pattern(s). | |
6188 | ; | |
6189 | ||
8cb66696 | 6190 | (define_insn "*andhi3_zarch" |
65b1d8ea AK |
6191 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d, AQ,Q") |
6192 | (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,d,0, 0,0") | |
6193 | (match_operand:HI 2 "general_operand" " d,d,n,NxQHF,Q"))) | |
ae156f85 | 6194 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6195 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
4023fb28 | 6196 | "@ |
d40c829f | 6197 | nr\t%0,%2 |
65b1d8ea | 6198 | nrk\t%0,%1,%2 |
8cb66696 | 6199 | nill\t%0,%x2 |
0dfa6c5e | 6200 | # |
19b63d8e | 6201 | #" |
65b1d8ea AK |
6202 | [(set_attr "op_type" "RR,RRF,RI,SI,SS") |
6203 | (set_attr "cpu_facility" "*,z196,*,*,*") | |
6204 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,*,*") | |
9381e3f1 | 6205 | ]) |
8cb66696 UW |
6206 | |
6207 | (define_insn "*andhi3_esa" | |
0dfa6c5e UW |
6208 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") |
6209 | (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") | |
6210 | (match_operand:HI 2 "general_operand" "d,NxQHF,Q"))) | |
ae156f85 | 6211 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 UW |
6212 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
6213 | "@ | |
6214 | nr\t%0,%2 | |
0dfa6c5e | 6215 | # |
19b63d8e | 6216 | #" |
9381e3f1 WG |
6217 | [(set_attr "op_type" "RR,SI,SS") |
6218 | (set_attr "z10prop" "z10_super_E1,*,*") | |
6219 | ]) | |
0dfa6c5e UW |
6220 | |
6221 | (define_split | |
6222 | [(set (match_operand:HI 0 "s_operand" "") | |
6223 | (and:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) | |
ae156f85 | 6224 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6225 | "reload_completed" |
6226 | [(parallel | |
6227 | [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6228 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6229 | "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") |
9db1d521 | 6230 | |
9db1d521 HP |
6231 | ; |
6232 | ; andqi3 instruction pattern(s). | |
6233 | ; | |
6234 | ||
8cb66696 | 6235 | (define_insn "*andqi3_zarch" |
65b1d8ea AK |
6236 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,Q,S,Q") |
6237 | (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,d,0,0,0,0") | |
6238 | (match_operand:QI 2 "general_operand" " d,d,n,n,n,Q"))) | |
ae156f85 | 6239 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6240 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
4023fb28 | 6241 | "@ |
d40c829f | 6242 | nr\t%0,%2 |
65b1d8ea | 6243 | nrk\t%0,%1,%2 |
8cb66696 | 6244 | nill\t%0,%b2 |
fc0ea003 UW |
6245 | ni\t%S0,%b2 |
6246 | niy\t%S0,%b2 | |
19b63d8e | 6247 | #" |
65b1d8ea AK |
6248 | [(set_attr "op_type" "RR,RRF,RI,SI,SIY,SS") |
6249 | (set_attr "cpu_facility" "*,z196,*,*,*,*") | |
6250 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,z10_super,z10_super,*")]) | |
8cb66696 UW |
6251 | |
6252 | (define_insn "*andqi3_esa" | |
6253 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") | |
6254 | (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") | |
6255 | (match_operand:QI 2 "general_operand" "d,n,Q"))) | |
ae156f85 | 6256 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6257 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
9db1d521 | 6258 | "@ |
8cb66696 | 6259 | nr\t%0,%2 |
fc0ea003 | 6260 | ni\t%S0,%b2 |
19b63d8e | 6261 | #" |
9381e3f1 WG |
6262 | [(set_attr "op_type" "RR,SI,SS") |
6263 | (set_attr "z10prop" "z10_super_E1,z10_super,*")]) | |
4023fb28 | 6264 | |
19b63d8e UW |
6265 | ; |
6266 | ; Block and (NC) patterns. | |
6267 | ; | |
6268 | ||
6269 | (define_insn "*nc" | |
6270 | [(set (match_operand:BLK 0 "memory_operand" "=Q") | |
6271 | (and:BLK (match_dup 0) | |
6272 | (match_operand:BLK 1 "memory_operand" "Q"))) | |
6273 | (use (match_operand 2 "const_int_operand" "n")) | |
ae156f85 | 6274 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e | 6275 | "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" |
fc0ea003 | 6276 | "nc\t%O0(%2,%R0),%S1" |
65b1d8ea AK |
6277 | [(set_attr "op_type" "SS") |
6278 | (set_attr "z196prop" "z196_cracked")]) | |
19b63d8e UW |
6279 | |
6280 | (define_split | |
6281 | [(set (match_operand 0 "memory_operand" "") | |
6282 | (and (match_dup 0) | |
6283 | (match_operand 1 "memory_operand" ""))) | |
ae156f85 | 6284 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e UW |
6285 | "reload_completed |
6286 | && GET_MODE (operands[0]) == GET_MODE (operands[1]) | |
6287 | && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" | |
6288 | [(parallel | |
6289 | [(set (match_dup 0) (and:BLK (match_dup 0) (match_dup 1))) | |
6290 | (use (match_dup 2)) | |
ae156f85 | 6291 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6292 | { |
6293 | operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); | |
6294 | operands[0] = adjust_address (operands[0], BLKmode, 0); | |
6295 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
6296 | }) | |
6297 | ||
6298 | (define_peephole2 | |
6299 | [(parallel | |
6300 | [(set (match_operand:BLK 0 "memory_operand" "") | |
6301 | (and:BLK (match_dup 0) | |
6302 | (match_operand:BLK 1 "memory_operand" ""))) | |
6303 | (use (match_operand 2 "const_int_operand" "")) | |
ae156f85 | 6304 | (clobber (reg:CC CC_REGNUM))]) |
19b63d8e UW |
6305 | (parallel |
6306 | [(set (match_operand:BLK 3 "memory_operand" "") | |
6307 | (and:BLK (match_dup 3) | |
6308 | (match_operand:BLK 4 "memory_operand" ""))) | |
6309 | (use (match_operand 5 "const_int_operand" "")) | |
ae156f85 | 6310 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6311 | "s390_offset_p (operands[0], operands[3], operands[2]) |
6312 | && s390_offset_p (operands[1], operands[4], operands[2]) | |
9381e3f1 | 6313 | && !s390_overlap_p (operands[0], operands[1], |
bcf8c1cc | 6314 | INTVAL (operands[2]) + INTVAL (operands[5])) |
19b63d8e UW |
6315 | && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" |
6316 | [(parallel | |
6317 | [(set (match_dup 6) (and:BLK (match_dup 6) (match_dup 7))) | |
6318 | (use (match_dup 8)) | |
ae156f85 | 6319 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6320 | "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); |
6321 | operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); | |
6322 | operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") | |
6323 | ||
9db1d521 HP |
6324 | |
6325 | ;; | |
6326 | ;;- Bit set (inclusive or) instructions. | |
6327 | ;; | |
6328 | ||
047d35ed AS |
6329 | (define_expand "ior<mode>3" |
6330 | [(set (match_operand:INT 0 "nonimmediate_operand" "") | |
6331 | (ior:INT (match_operand:INT 1 "nonimmediate_operand" "") | |
6332 | (match_operand:INT 2 "general_operand" ""))) | |
6333 | (clobber (reg:CC CC_REGNUM))] | |
6334 | "" | |
6335 | "s390_expand_logical_operator (IOR, <MODE>mode, operands); DONE;") | |
6336 | ||
9db1d521 HP |
6337 | ; |
6338 | ; iordi3 instruction pattern(s). | |
6339 | ; | |
6340 | ||
4023fb28 | 6341 | (define_insn "*iordi3_cc" |
ae156f85 | 6342 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6343 | (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d, 0") |
6344 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
4023fb28 | 6345 | (const_int 0))) |
65b1d8ea | 6346 | (set (match_operand:DI 0 "register_operand" "=d,d, d") |
4023fb28 | 6347 | (ior:DI (match_dup 1) (match_dup 2)))] |
9602b6a1 | 6348 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" |
4023fb28 | 6349 | "@ |
d40c829f | 6350 | ogr\t%0,%2 |
65b1d8ea | 6351 | ogrk\t%0,%1,%2 |
d40c829f | 6352 | og\t%0,%2" |
65b1d8ea AK |
6353 | [(set_attr "op_type" "RRE,RRF,RXY") |
6354 | (set_attr "cpu_facility" "*,z196,*") | |
6355 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) | |
4023fb28 UW |
6356 | |
6357 | (define_insn "*iordi3_cconly" | |
ae156f85 | 6358 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6359 | (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d,0") |
6360 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
4023fb28 | 6361 | (const_int 0))) |
65b1d8ea | 6362 | (clobber (match_scratch:DI 0 "=d,d,d"))] |
9602b6a1 | 6363 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" |
4023fb28 | 6364 | "@ |
d40c829f | 6365 | ogr\t%0,%2 |
65b1d8ea | 6366 | ogrk\t%0,%1,%2 |
d40c829f | 6367 | og\t%0,%2" |
65b1d8ea AK |
6368 | [(set_attr "op_type" "RRE,RRF,RXY") |
6369 | (set_attr "cpu_facility" "*,z196,*") | |
6370 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) | |
4023fb28 | 6371 | |
3af8e996 | 6372 | (define_insn "*iordi3" |
65b1d8ea AK |
6373 | [(set (match_operand:DI 0 "nonimmediate_operand" |
6374 | "=d, d, d, d, d, d,d,d, d, AQ,Q") | |
6375 | (ior:DI (match_operand:DI 1 "nonimmediate_operand" | |
6376 | " %0, 0, 0, 0, 0, 0,0,d, 0, 0,0") | |
ec24698e | 6377 | (match_operand:DI 2 "general_operand" |
65b1d8ea | 6378 | "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,d,RT,NxQD0,Q"))) |
ec24698e | 6379 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 6380 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
ec24698e UW |
6381 | "@ |
6382 | oihh\t%0,%i2 | |
6383 | oihl\t%0,%i2 | |
6384 | oilh\t%0,%i2 | |
6385 | oill\t%0,%i2 | |
6386 | oihf\t%0,%k2 | |
6387 | oilf\t%0,%k2 | |
6388 | ogr\t%0,%2 | |
65b1d8ea | 6389 | ogrk\t%0,%1,%2 |
ec24698e UW |
6390 | og\t%0,%2 |
6391 | # | |
6392 | #" | |
65b1d8ea AK |
6393 | [(set_attr "op_type" "RI,RI,RI,RI,RIL,RIL,RRE,RRF,RXY,SI,SS") |
6394 | (set_attr "cpu_facility" "*,*,*,*,extimm,extimm,*,z196,*,*,*") | |
9381e3f1 WG |
6395 | (set_attr "z10prop" "z10_super_E1, |
6396 | z10_super_E1, | |
6397 | z10_super_E1, | |
6398 | z10_super_E1, | |
6399 | z10_super_E1, | |
6400 | z10_super_E1, | |
6401 | z10_super_E1, | |
65b1d8ea | 6402 | *, |
9381e3f1 WG |
6403 | z10_super_E1, |
6404 | *, | |
6405 | *")]) | |
0dfa6c5e UW |
6406 | |
6407 | (define_split | |
6408 | [(set (match_operand:DI 0 "s_operand" "") | |
6409 | (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) | |
ae156f85 | 6410 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6411 | "reload_completed" |
6412 | [(parallel | |
6413 | [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6414 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6415 | "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") |
4023fb28 | 6416 | |
9db1d521 HP |
6417 | ; |
6418 | ; iorsi3 instruction pattern(s). | |
6419 | ; | |
6420 | ||
4023fb28 | 6421 | (define_insn "*iorsi3_cc" |
ae156f85 | 6422 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6423 | (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6424 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
4023fb28 | 6425 | (const_int 0))) |
65b1d8ea | 6426 | (set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") |
4023fb28 UW |
6427 | (ior:SI (match_dup 1) (match_dup 2)))] |
6428 | "s390_match_ccmode(insn, CCTmode)" | |
6429 | "@ | |
ec24698e | 6430 | oilf\t%0,%o2 |
d40c829f | 6431 | or\t%0,%2 |
65b1d8ea | 6432 | ork\t%0,%1,%2 |
d40c829f UW |
6433 | o\t%0,%2 |
6434 | oy\t%0,%2" | |
65b1d8ea AK |
6435 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6436 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6437 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
4023fb28 UW |
6438 | |
6439 | (define_insn "*iorsi3_cconly" | |
ae156f85 | 6440 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6441 | (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6442 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
4023fb28 | 6443 | (const_int 0))) |
65b1d8ea | 6444 | (clobber (match_scratch:SI 0 "=d,d,d,d,d"))] |
4023fb28 UW |
6445 | "s390_match_ccmode(insn, CCTmode)" |
6446 | "@ | |
ec24698e | 6447 | oilf\t%0,%o2 |
d40c829f | 6448 | or\t%0,%2 |
65b1d8ea | 6449 | ork\t%0,%1,%2 |
d40c829f UW |
6450 | o\t%0,%2 |
6451 | oy\t%0,%2" | |
65b1d8ea AK |
6452 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6453 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6454 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,z10_super_E1,z10_super_E1")]) | |
4023fb28 | 6455 | |
8cb66696 | 6456 | (define_insn "*iorsi3_zarch" |
65b1d8ea AK |
6457 | [(set (match_operand:SI 0 "nonimmediate_operand" "=d, d, d,d,d,d,d, AQ,Q") |
6458 | (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0, 0, 0,0,d,0,0, 0,0") | |
6459 | (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,Os,d,d,R,T,NxQS0,Q"))) | |
ae156f85 | 6460 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6461 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
4023fb28 | 6462 | "@ |
f19a9af7 AK |
6463 | oilh\t%0,%i2 |
6464 | oill\t%0,%i2 | |
ec24698e | 6465 | oilf\t%0,%o2 |
d40c829f | 6466 | or\t%0,%2 |
65b1d8ea | 6467 | ork\t%0,%1,%2 |
d40c829f | 6468 | o\t%0,%2 |
8cb66696 | 6469 | oy\t%0,%2 |
0dfa6c5e | 6470 | # |
19b63d8e | 6471 | #" |
65b1d8ea AK |
6472 | [(set_attr "op_type" "RI,RI,RIL,RR,RRF,RX,RXY,SI,SS") |
6473 | (set_attr "cpu_facility" "*,*,*,*,z196,*,*,*,*") | |
9381e3f1 WG |
6474 | (set_attr "z10prop" "z10_super_E1, |
6475 | z10_super_E1, | |
6476 | z10_super_E1, | |
6477 | z10_super_E1, | |
65b1d8ea | 6478 | *, |
9381e3f1 WG |
6479 | z10_super_E1, |
6480 | z10_super_E1, | |
6481 | *, | |
6482 | *")]) | |
8cb66696 UW |
6483 | |
6484 | (define_insn "*iorsi3_esa" | |
0dfa6c5e | 6485 | [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q") |
bad82153 | 6486 | (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") |
0dfa6c5e | 6487 | (match_operand:SI 2 "general_operand" "d,R,NxQS0,Q"))) |
ae156f85 | 6488 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6489 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
f19a9af7 AK |
6490 | "@ |
6491 | or\t%0,%2 | |
8cb66696 | 6492 | o\t%0,%2 |
0dfa6c5e | 6493 | # |
19b63d8e | 6494 | #" |
9381e3f1 WG |
6495 | [(set_attr "op_type" "RR,RX,SI,SS") |
6496 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*")]) | |
0dfa6c5e UW |
6497 | |
6498 | (define_split | |
6499 | [(set (match_operand:SI 0 "s_operand" "") | |
6500 | (ior:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) | |
ae156f85 | 6501 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6502 | "reload_completed" |
6503 | [(parallel | |
6504 | [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6505 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6506 | "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") |
4023fb28 | 6507 | |
4023fb28 UW |
6508 | ; |
6509 | ; iorhi3 instruction pattern(s). | |
6510 | ; | |
6511 | ||
8cb66696 | 6512 | (define_insn "*iorhi3_zarch" |
65b1d8ea AK |
6513 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d, AQ,Q") |
6514 | (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,d,0, 0,0") | |
6515 | (match_operand:HI 2 "general_operand" " d,d,n,NxQH0,Q"))) | |
ae156f85 | 6516 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6517 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
4023fb28 | 6518 | "@ |
d40c829f | 6519 | or\t%0,%2 |
65b1d8ea | 6520 | ork\t%0,%1,%2 |
8cb66696 | 6521 | oill\t%0,%x2 |
0dfa6c5e | 6522 | # |
19b63d8e | 6523 | #" |
65b1d8ea AK |
6524 | [(set_attr "op_type" "RR,RRF,RI,SI,SS") |
6525 | (set_attr "cpu_facility" "*,z196,*,*,*") | |
6526 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1,*,*")]) | |
8cb66696 UW |
6527 | |
6528 | (define_insn "*iorhi3_esa" | |
0dfa6c5e UW |
6529 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") |
6530 | (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") | |
6531 | (match_operand:HI 2 "general_operand" "d,NxQH0,Q"))) | |
ae156f85 | 6532 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 UW |
6533 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
6534 | "@ | |
6535 | or\t%0,%2 | |
0dfa6c5e | 6536 | # |
19b63d8e | 6537 | #" |
9381e3f1 WG |
6538 | [(set_attr "op_type" "RR,SI,SS") |
6539 | (set_attr "z10prop" "z10_super_E1,*,*")]) | |
0dfa6c5e UW |
6540 | |
6541 | (define_split | |
6542 | [(set (match_operand:HI 0 "s_operand" "") | |
6543 | (ior:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) | |
ae156f85 | 6544 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6545 | "reload_completed" |
6546 | [(parallel | |
6547 | [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6548 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6549 | "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") |
9db1d521 | 6550 | |
9db1d521 | 6551 | ; |
4023fb28 | 6552 | ; iorqi3 instruction pattern(s). |
9db1d521 HP |
6553 | ; |
6554 | ||
8cb66696 | 6555 | (define_insn "*iorqi3_zarch" |
65b1d8ea AK |
6556 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,Q,S,Q") |
6557 | (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,d,0,0,0,0") | |
6558 | (match_operand:QI 2 "general_operand" " d,d,n,n,n,Q"))) | |
ae156f85 | 6559 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6560 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
4023fb28 | 6561 | "@ |
d40c829f | 6562 | or\t%0,%2 |
65b1d8ea | 6563 | ork\t%0,%1,%2 |
8cb66696 | 6564 | oill\t%0,%b2 |
fc0ea003 UW |
6565 | oi\t%S0,%b2 |
6566 | oiy\t%S0,%b2 | |
19b63d8e | 6567 | #" |
65b1d8ea AK |
6568 | [(set_attr "op_type" "RR,RRF,RI,SI,SIY,SS") |
6569 | (set_attr "cpu_facility" "*,z196,*,*,*,*") | |
6570 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1, | |
6571 | z10_super,z10_super,*")]) | |
8cb66696 UW |
6572 | |
6573 | (define_insn "*iorqi3_esa" | |
6574 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") | |
6575 | (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") | |
6576 | (match_operand:QI 2 "general_operand" "d,n,Q"))) | |
ae156f85 | 6577 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6578 | "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
9db1d521 | 6579 | "@ |
8cb66696 | 6580 | or\t%0,%2 |
fc0ea003 | 6581 | oi\t%S0,%b2 |
19b63d8e | 6582 | #" |
9381e3f1 WG |
6583 | [(set_attr "op_type" "RR,SI,SS") |
6584 | (set_attr "z10prop" "z10_super_E1,z10_super,*")]) | |
9db1d521 | 6585 | |
19b63d8e UW |
6586 | ; |
6587 | ; Block inclusive or (OC) patterns. | |
6588 | ; | |
6589 | ||
6590 | (define_insn "*oc" | |
6591 | [(set (match_operand:BLK 0 "memory_operand" "=Q") | |
6592 | (ior:BLK (match_dup 0) | |
6593 | (match_operand:BLK 1 "memory_operand" "Q"))) | |
6594 | (use (match_operand 2 "const_int_operand" "n")) | |
ae156f85 | 6595 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e | 6596 | "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" |
fc0ea003 | 6597 | "oc\t%O0(%2,%R0),%S1" |
65b1d8ea AK |
6598 | [(set_attr "op_type" "SS") |
6599 | (set_attr "z196prop" "z196_cracked")]) | |
19b63d8e UW |
6600 | |
6601 | (define_split | |
6602 | [(set (match_operand 0 "memory_operand" "") | |
6603 | (ior (match_dup 0) | |
6604 | (match_operand 1 "memory_operand" ""))) | |
ae156f85 | 6605 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e UW |
6606 | "reload_completed |
6607 | && GET_MODE (operands[0]) == GET_MODE (operands[1]) | |
6608 | && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" | |
6609 | [(parallel | |
6610 | [(set (match_dup 0) (ior:BLK (match_dup 0) (match_dup 1))) | |
6611 | (use (match_dup 2)) | |
ae156f85 | 6612 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6613 | { |
6614 | operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); | |
6615 | operands[0] = adjust_address (operands[0], BLKmode, 0); | |
6616 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
6617 | }) | |
6618 | ||
6619 | (define_peephole2 | |
6620 | [(parallel | |
6621 | [(set (match_operand:BLK 0 "memory_operand" "") | |
6622 | (ior:BLK (match_dup 0) | |
6623 | (match_operand:BLK 1 "memory_operand" ""))) | |
6624 | (use (match_operand 2 "const_int_operand" "")) | |
ae156f85 | 6625 | (clobber (reg:CC CC_REGNUM))]) |
19b63d8e UW |
6626 | (parallel |
6627 | [(set (match_operand:BLK 3 "memory_operand" "") | |
6628 | (ior:BLK (match_dup 3) | |
6629 | (match_operand:BLK 4 "memory_operand" ""))) | |
6630 | (use (match_operand 5 "const_int_operand" "")) | |
ae156f85 | 6631 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6632 | "s390_offset_p (operands[0], operands[3], operands[2]) |
6633 | && s390_offset_p (operands[1], operands[4], operands[2]) | |
9381e3f1 | 6634 | && !s390_overlap_p (operands[0], operands[1], |
bcf8c1cc | 6635 | INTVAL (operands[2]) + INTVAL (operands[5])) |
19b63d8e UW |
6636 | && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" |
6637 | [(parallel | |
6638 | [(set (match_dup 6) (ior:BLK (match_dup 6) (match_dup 7))) | |
6639 | (use (match_dup 8)) | |
ae156f85 | 6640 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6641 | "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); |
6642 | operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); | |
6643 | operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") | |
6644 | ||
9db1d521 HP |
6645 | |
6646 | ;; | |
6647 | ;;- Xor instructions. | |
6648 | ;; | |
6649 | ||
047d35ed AS |
6650 | (define_expand "xor<mode>3" |
6651 | [(set (match_operand:INT 0 "nonimmediate_operand" "") | |
6652 | (xor:INT (match_operand:INT 1 "nonimmediate_operand" "") | |
6653 | (match_operand:INT 2 "general_operand" ""))) | |
6654 | (clobber (reg:CC CC_REGNUM))] | |
6655 | "" | |
6656 | "s390_expand_logical_operator (XOR, <MODE>mode, operands); DONE;") | |
6657 | ||
9db1d521 HP |
6658 | ; |
6659 | ; xordi3 instruction pattern(s). | |
6660 | ; | |
6661 | ||
4023fb28 | 6662 | (define_insn "*xordi3_cc" |
ae156f85 | 6663 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6664 | (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d, 0") |
6665 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
4023fb28 | 6666 | (const_int 0))) |
65b1d8ea | 6667 | (set (match_operand:DI 0 "register_operand" "=d,d, d") |
4023fb28 | 6668 | (xor:DI (match_dup 1) (match_dup 2)))] |
9602b6a1 | 6669 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" |
4023fb28 | 6670 | "@ |
d40c829f | 6671 | xgr\t%0,%2 |
65b1d8ea | 6672 | xgrk\t%0,%1,%2 |
d40c829f | 6673 | xg\t%0,%2" |
65b1d8ea | 6674 | [(set_attr "op_type" "RRE,RRF,RXY") |
5490de28 | 6675 | (set_attr "cpu_facility" "*,z196,*") |
65b1d8ea | 6676 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) |
4023fb28 UW |
6677 | |
6678 | (define_insn "*xordi3_cconly" | |
ae156f85 | 6679 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6680 | (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,d, 0") |
6681 | (match_operand:DI 2 "general_operand" " d,d,RT")) | |
4023fb28 | 6682 | (const_int 0))) |
65b1d8ea | 6683 | (clobber (match_scratch:DI 0 "=d,d, d"))] |
9602b6a1 | 6684 | "s390_match_ccmode(insn, CCTmode) && TARGET_ZARCH" |
4023fb28 | 6685 | "@ |
d40c829f | 6686 | xgr\t%0,%2 |
65b1d8ea | 6687 | xgrk\t%0,%1,%2 |
c7fd8cd8 | 6688 | xg\t%0,%2" |
65b1d8ea AK |
6689 | [(set_attr "op_type" "RRE,RRF,RXY") |
6690 | (set_attr "cpu_facility" "*,z196,*") | |
6691 | (set_attr "z10prop" "z10_super_E1,*,z10_super_E1")]) | |
4023fb28 | 6692 | |
3af8e996 | 6693 | (define_insn "*xordi3" |
65b1d8ea AK |
6694 | [(set (match_operand:DI 0 "nonimmediate_operand" "=d, d,d,d, d, AQ,Q") |
6695 | (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0, 0,0,d, 0, 0,0") | |
6696 | (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,d,RT,NxQD0,Q"))) | |
ec24698e | 6697 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 6698 | "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" |
ec24698e UW |
6699 | "@ |
6700 | xihf\t%0,%k2 | |
6701 | xilf\t%0,%k2 | |
6702 | xgr\t%0,%2 | |
65b1d8ea | 6703 | xgrk\t%0,%1,%2 |
ec24698e UW |
6704 | xg\t%0,%2 |
6705 | # | |
6706 | #" | |
65b1d8ea AK |
6707 | [(set_attr "op_type" "RIL,RIL,RRE,RRF,RXY,SI,SS") |
6708 | (set_attr "cpu_facility" "extimm,extimm,*,z196,*,*,*") | |
6709 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,z10_super_E1, | |
6710 | *,z10_super_E1,*,*")]) | |
0dfa6c5e UW |
6711 | |
6712 | (define_split | |
6713 | [(set (match_operand:DI 0 "s_operand" "") | |
6714 | (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) | |
ae156f85 | 6715 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6716 | "reload_completed" |
6717 | [(parallel | |
6718 | [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6719 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6720 | "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") |
4023fb28 | 6721 | |
9db1d521 HP |
6722 | ; |
6723 | ; xorsi3 instruction pattern(s). | |
6724 | ; | |
6725 | ||
4023fb28 | 6726 | (define_insn "*xorsi3_cc" |
ae156f85 | 6727 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6728 | (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6729 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
4023fb28 | 6730 | (const_int 0))) |
65b1d8ea | 6731 | (set (match_operand:SI 0 "register_operand" "=d,d,d,d,d") |
4023fb28 UW |
6732 | (xor:SI (match_dup 1) (match_dup 2)))] |
6733 | "s390_match_ccmode(insn, CCTmode)" | |
6734 | "@ | |
ec24698e | 6735 | xilf\t%0,%o2 |
d40c829f | 6736 | xr\t%0,%2 |
65b1d8ea | 6737 | xrk\t%0,%1,%2 |
d40c829f UW |
6738 | x\t%0,%2 |
6739 | xy\t%0,%2" | |
65b1d8ea AK |
6740 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6741 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6742 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*, | |
6743 | z10_super_E1,z10_super_E1")]) | |
4023fb28 UW |
6744 | |
6745 | (define_insn "*xorsi3_cconly" | |
ae156f85 | 6746 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
6747 | (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0") |
6748 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T")) | |
4023fb28 | 6749 | (const_int 0))) |
65b1d8ea | 6750 | (clobber (match_scratch:SI 0 "=d,d,d,d,d"))] |
4023fb28 UW |
6751 | "s390_match_ccmode(insn, CCTmode)" |
6752 | "@ | |
ec24698e | 6753 | xilf\t%0,%o2 |
d40c829f | 6754 | xr\t%0,%2 |
65b1d8ea | 6755 | xrk\t%0,%1,%2 |
d40c829f UW |
6756 | x\t%0,%2 |
6757 | xy\t%0,%2" | |
65b1d8ea AK |
6758 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY") |
6759 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6760 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*, | |
6761 | z10_super_E1,z10_super_E1")]) | |
9db1d521 | 6762 | |
8cb66696 | 6763 | (define_insn "*xorsi3" |
65b1d8ea AK |
6764 | [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d, AQ,Q") |
6765 | (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,d,0,0, 0,0") | |
6766 | (match_operand:SI 2 "general_operand" "Os,d,d,R,T,NxQS0,Q"))) | |
ae156f85 | 6767 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6768 | "s390_logical_operator_ok_p (operands)" |
9db1d521 | 6769 | "@ |
ec24698e | 6770 | xilf\t%0,%o2 |
d40c829f | 6771 | xr\t%0,%2 |
65b1d8ea | 6772 | xrk\t%0,%1,%2 |
d40c829f | 6773 | x\t%0,%2 |
8cb66696 | 6774 | xy\t%0,%2 |
0dfa6c5e | 6775 | # |
19b63d8e | 6776 | #" |
65b1d8ea AK |
6777 | [(set_attr "op_type" "RIL,RR,RRF,RX,RXY,SI,SS") |
6778 | (set_attr "cpu_facility" "*,*,z196,*,*,*,*") | |
6779 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*, | |
6780 | z10_super_E1,z10_super_E1,*,*")]) | |
0dfa6c5e UW |
6781 | |
6782 | (define_split | |
6783 | [(set (match_operand:SI 0 "s_operand" "") | |
6784 | (xor:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) | |
ae156f85 | 6785 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6786 | "reload_completed" |
6787 | [(parallel | |
6788 | [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6789 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6790 | "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") |
8cb66696 | 6791 | |
9db1d521 HP |
6792 | ; |
6793 | ; xorhi3 instruction pattern(s). | |
6794 | ; | |
6795 | ||
8cb66696 | 6796 | (define_insn "*xorhi3" |
65b1d8ea AK |
6797 | [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d, AQ,Q") |
6798 | (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,d, 0,0") | |
6799 | (match_operand:HI 2 "general_operand" "Os,d,d,NxQH0,Q"))) | |
ae156f85 | 6800 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 UW |
6801 | "s390_logical_operator_ok_p (operands)" |
6802 | "@ | |
ec24698e | 6803 | xilf\t%0,%x2 |
8cb66696 | 6804 | xr\t%0,%2 |
65b1d8ea | 6805 | xrk\t%0,%1,%2 |
0dfa6c5e | 6806 | # |
19b63d8e | 6807 | #" |
65b1d8ea AK |
6808 | [(set_attr "op_type" "RIL,RR,RRF,SI,SS") |
6809 | (set_attr "cpu_facility" "*,*,z196,*,*") | |
6810 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,*,*")]) | |
0dfa6c5e UW |
6811 | |
6812 | (define_split | |
6813 | [(set (match_operand:HI 0 "s_operand" "") | |
6814 | (xor:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) | |
ae156f85 | 6815 | (clobber (reg:CC CC_REGNUM))] |
0dfa6c5e UW |
6816 | "reload_completed" |
6817 | [(parallel | |
6818 | [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) | |
ae156f85 | 6819 | (clobber (reg:CC CC_REGNUM))])] |
0dfa6c5e | 6820 | "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") |
9db1d521 | 6821 | |
9db1d521 HP |
6822 | ; |
6823 | ; xorqi3 instruction pattern(s). | |
6824 | ; | |
6825 | ||
8cb66696 | 6826 | (define_insn "*xorqi3" |
65b1d8ea AK |
6827 | [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,Q,S,Q") |
6828 | (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,d,0,0,0") | |
6829 | (match_operand:QI 2 "general_operand" "Os,d,d,n,n,Q"))) | |
ae156f85 | 6830 | (clobber (reg:CC CC_REGNUM))] |
8cb66696 | 6831 | "s390_logical_operator_ok_p (operands)" |
9db1d521 | 6832 | "@ |
ec24698e | 6833 | xilf\t%0,%b2 |
8cb66696 | 6834 | xr\t%0,%2 |
65b1d8ea | 6835 | xrk\t%0,%1,%2 |
fc0ea003 UW |
6836 | xi\t%S0,%b2 |
6837 | xiy\t%S0,%b2 | |
19b63d8e | 6838 | #" |
65b1d8ea AK |
6839 | [(set_attr "op_type" "RIL,RR,RRF,SI,SIY,SS") |
6840 | (set_attr "cpu_facility" "*,*,z196,*,*,*") | |
6841 | (set_attr "z10prop" "z10_super_E1,z10_super_E1,*,z10_super,z10_super,*")]) | |
9381e3f1 | 6842 | |
4023fb28 | 6843 | |
19b63d8e UW |
6844 | ; |
6845 | ; Block exclusive or (XC) patterns. | |
6846 | ; | |
6847 | ||
6848 | (define_insn "*xc" | |
6849 | [(set (match_operand:BLK 0 "memory_operand" "=Q") | |
6850 | (xor:BLK (match_dup 0) | |
6851 | (match_operand:BLK 1 "memory_operand" "Q"))) | |
6852 | (use (match_operand 2 "const_int_operand" "n")) | |
ae156f85 | 6853 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e | 6854 | "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" |
fc0ea003 | 6855 | "xc\t%O0(%2,%R0),%S1" |
b628bd8e | 6856 | [(set_attr "op_type" "SS")]) |
19b63d8e UW |
6857 | |
6858 | (define_split | |
6859 | [(set (match_operand 0 "memory_operand" "") | |
6860 | (xor (match_dup 0) | |
6861 | (match_operand 1 "memory_operand" ""))) | |
ae156f85 | 6862 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e UW |
6863 | "reload_completed |
6864 | && GET_MODE (operands[0]) == GET_MODE (operands[1]) | |
6865 | && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" | |
6866 | [(parallel | |
6867 | [(set (match_dup 0) (xor:BLK (match_dup 0) (match_dup 1))) | |
6868 | (use (match_dup 2)) | |
ae156f85 | 6869 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6870 | { |
6871 | operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); | |
6872 | operands[0] = adjust_address (operands[0], BLKmode, 0); | |
6873 | operands[1] = adjust_address (operands[1], BLKmode, 0); | |
6874 | }) | |
6875 | ||
6876 | (define_peephole2 | |
6877 | [(parallel | |
6878 | [(set (match_operand:BLK 0 "memory_operand" "") | |
6879 | (xor:BLK (match_dup 0) | |
6880 | (match_operand:BLK 1 "memory_operand" ""))) | |
6881 | (use (match_operand 2 "const_int_operand" "")) | |
ae156f85 | 6882 | (clobber (reg:CC CC_REGNUM))]) |
19b63d8e UW |
6883 | (parallel |
6884 | [(set (match_operand:BLK 3 "memory_operand" "") | |
6885 | (xor:BLK (match_dup 3) | |
6886 | (match_operand:BLK 4 "memory_operand" ""))) | |
6887 | (use (match_operand 5 "const_int_operand" "")) | |
ae156f85 | 6888 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6889 | "s390_offset_p (operands[0], operands[3], operands[2]) |
6890 | && s390_offset_p (operands[1], operands[4], operands[2]) | |
9381e3f1 | 6891 | && !s390_overlap_p (operands[0], operands[1], |
bcf8c1cc | 6892 | INTVAL (operands[2]) + INTVAL (operands[5])) |
19b63d8e UW |
6893 | && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" |
6894 | [(parallel | |
6895 | [(set (match_dup 6) (xor:BLK (match_dup 6) (match_dup 7))) | |
6896 | (use (match_dup 8)) | |
ae156f85 | 6897 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6898 | "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); |
6899 | operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); | |
6900 | operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") | |
6901 | ||
6902 | ; | |
6903 | ; Block xor (XC) patterns with src == dest. | |
6904 | ; | |
6905 | ||
6906 | (define_insn "*xc_zero" | |
6907 | [(set (match_operand:BLK 0 "memory_operand" "=Q") | |
6908 | (const_int 0)) | |
6909 | (use (match_operand 1 "const_int_operand" "n")) | |
ae156f85 | 6910 | (clobber (reg:CC CC_REGNUM))] |
19b63d8e | 6911 | "INTVAL (operands[1]) >= 1 && INTVAL (operands[1]) <= 256" |
fc0ea003 | 6912 | "xc\t%O0(%1,%R0),%S0" |
65b1d8ea AK |
6913 | [(set_attr "op_type" "SS") |
6914 | (set_attr "z196prop" "z196_cracked")]) | |
19b63d8e UW |
6915 | |
6916 | (define_peephole2 | |
6917 | [(parallel | |
6918 | [(set (match_operand:BLK 0 "memory_operand" "") | |
6919 | (const_int 0)) | |
6920 | (use (match_operand 1 "const_int_operand" "")) | |
ae156f85 | 6921 | (clobber (reg:CC CC_REGNUM))]) |
19b63d8e UW |
6922 | (parallel |
6923 | [(set (match_operand:BLK 2 "memory_operand" "") | |
6924 | (const_int 0)) | |
6925 | (use (match_operand 3 "const_int_operand" "")) | |
ae156f85 | 6926 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6927 | "s390_offset_p (operands[0], operands[2], operands[1]) |
6928 | && INTVAL (operands[1]) + INTVAL (operands[3]) <= 256" | |
6929 | [(parallel | |
6930 | [(set (match_dup 4) (const_int 0)) | |
6931 | (use (match_dup 5)) | |
ae156f85 | 6932 | (clobber (reg:CC CC_REGNUM))])] |
19b63d8e UW |
6933 | "operands[4] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); |
6934 | operands[5] = GEN_INT (INTVAL (operands[1]) + INTVAL (operands[3]));") | |
6935 | ||
9db1d521 HP |
6936 | |
6937 | ;; | |
6938 | ;;- Negate instructions. | |
6939 | ;; | |
6940 | ||
6941 | ; | |
9a91a21f | 6942 | ; neg(di|si)2 instruction pattern(s). |
9db1d521 HP |
6943 | ; |
6944 | ||
9a91a21f | 6945 | (define_expand "neg<mode>2" |
9db1d521 | 6946 | [(parallel |
9a91a21f AS |
6947 | [(set (match_operand:DSI 0 "register_operand" "=d") |
6948 | (neg:DSI (match_operand:DSI 1 "register_operand" "d"))) | |
ae156f85 | 6949 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 HP |
6950 | "" |
6951 | "") | |
6952 | ||
26a89301 | 6953 | (define_insn "*negdi2_sign_cc" |
ae156f85 | 6954 | [(set (reg CC_REGNUM) |
26a89301 UW |
6955 | (compare (neg:DI (ashiftrt:DI (ashift:DI (subreg:DI |
6956 | (match_operand:SI 1 "register_operand" "d") 0) | |
6957 | (const_int 32)) (const_int 32))) | |
6958 | (const_int 0))) | |
6959 | (set (match_operand:DI 0 "register_operand" "=d") | |
6960 | (neg:DI (sign_extend:DI (match_dup 1))))] | |
9602b6a1 | 6961 | "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" |
26a89301 | 6962 | "lcgfr\t%0,%1" |
729e750f WG |
6963 | [(set_attr "op_type" "RRE") |
6964 | (set_attr "z10prop" "z10_c")]) | |
9381e3f1 | 6965 | |
26a89301 UW |
6966 | (define_insn "*negdi2_sign" |
6967 | [(set (match_operand:DI 0 "register_operand" "=d") | |
6968 | (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) | |
ae156f85 | 6969 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 6970 | "TARGET_ZARCH" |
26a89301 | 6971 | "lcgfr\t%0,%1" |
729e750f WG |
6972 | [(set_attr "op_type" "RRE") |
6973 | (set_attr "z10prop" "z10_c")]) | |
26a89301 | 6974 | |
43a09b63 | 6975 | ; lcr, lcgr |
9a91a21f | 6976 | (define_insn "*neg<mode>2_cc" |
ae156f85 | 6977 | [(set (reg CC_REGNUM) |
9a91a21f | 6978 | (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) |
26a89301 | 6979 | (const_int 0))) |
9a91a21f AS |
6980 | (set (match_operand:GPR 0 "register_operand" "=d") |
6981 | (neg:GPR (match_dup 1)))] | |
6982 | "s390_match_ccmode (insn, CCAmode)" | |
6983 | "lc<g>r\t%0,%1" | |
9381e3f1 WG |
6984 | [(set_attr "op_type" "RR<E>") |
6985 | (set_attr "z10prop" "z10_super_c_E1")]) | |
43a09b63 AK |
6986 | |
6987 | ; lcr, lcgr | |
9a91a21f | 6988 | (define_insn "*neg<mode>2_cconly" |
ae156f85 | 6989 | [(set (reg CC_REGNUM) |
9a91a21f | 6990 | (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) |
26a89301 | 6991 | (const_int 0))) |
9a91a21f AS |
6992 | (clobber (match_scratch:GPR 0 "=d"))] |
6993 | "s390_match_ccmode (insn, CCAmode)" | |
6994 | "lc<g>r\t%0,%1" | |
9381e3f1 WG |
6995 | [(set_attr "op_type" "RR<E>") |
6996 | (set_attr "z10prop" "z10_super_c_E1")]) | |
43a09b63 AK |
6997 | |
6998 | ; lcr, lcgr | |
9a91a21f AS |
6999 | (define_insn "*neg<mode>2" |
7000 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
7001 | (neg:GPR (match_operand:GPR 1 "register_operand" "d"))) | |
ae156f85 | 7002 | (clobber (reg:CC CC_REGNUM))] |
9a91a21f AS |
7003 | "" |
7004 | "lc<g>r\t%0,%1" | |
9381e3f1 WG |
7005 | [(set_attr "op_type" "RR<E>") |
7006 | (set_attr "z10prop" "z10_super_c_E1")]) | |
9db1d521 | 7007 | |
26a89301 | 7008 | (define_insn_and_split "*negdi2_31" |
9db1d521 HP |
7009 | [(set (match_operand:DI 0 "register_operand" "=d") |
7010 | (neg:DI (match_operand:DI 1 "register_operand" "d"))) | |
ae156f85 | 7011 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 7012 | "!TARGET_ZARCH" |
26a89301 UW |
7013 | "#" |
7014 | "&& reload_completed" | |
7015 | [(parallel | |
7016 | [(set (match_dup 2) (neg:SI (match_dup 3))) | |
ae156f85 | 7017 | (clobber (reg:CC CC_REGNUM))]) |
26a89301 | 7018 | (parallel |
ae156f85 | 7019 | [(set (reg:CCAP CC_REGNUM) |
26a89301 UW |
7020 | (compare:CCAP (neg:SI (match_dup 5)) (const_int 0))) |
7021 | (set (match_dup 4) (neg:SI (match_dup 5)))]) | |
7022 | (set (pc) | |
ae156f85 | 7023 | (if_then_else (ne (reg:CCAP CC_REGNUM) (const_int 0)) |
26a89301 UW |
7024 | (pc) |
7025 | (label_ref (match_dup 6)))) | |
7026 | (parallel | |
7027 | [(set (match_dup 2) (plus:SI (match_dup 2) (const_int -1))) | |
ae156f85 | 7028 | (clobber (reg:CC CC_REGNUM))]) |
26a89301 UW |
7029 | (match_dup 6)] |
7030 | "operands[2] = operand_subword (operands[0], 0, 0, DImode); | |
7031 | operands[3] = operand_subword (operands[1], 0, 0, DImode); | |
7032 | operands[4] = operand_subword (operands[0], 1, 0, DImode); | |
7033 | operands[5] = operand_subword (operands[1], 1, 0, DImode); | |
7034 | operands[6] = gen_label_rtx ();") | |
9db1d521 | 7035 | |
9db1d521 | 7036 | ; |
f5905b37 | 7037 | ; neg(df|sf)2 instruction pattern(s). |
9db1d521 HP |
7038 | ; |
7039 | ||
f5905b37 | 7040 | (define_expand "neg<mode>2" |
9db1d521 | 7041 | [(parallel |
7b6baae1 AK |
7042 | [(set (match_operand:BFP 0 "register_operand" "=f") |
7043 | (neg:BFP (match_operand:BFP 1 "register_operand" "f"))) | |
ae156f85 | 7044 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 HP |
7045 | "TARGET_HARD_FLOAT" |
7046 | "") | |
7047 | ||
43a09b63 | 7048 | ; lcxbr, lcdbr, lcebr |
f5905b37 | 7049 | (define_insn "*neg<mode>2_cc" |
ae156f85 | 7050 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7051 | (compare (neg:BFP (match_operand:BFP 1 "register_operand" "f")) |
7052 | (match_operand:BFP 2 "const0_operand" ""))) | |
7053 | (set (match_operand:BFP 0 "register_operand" "=f") | |
7054 | (neg:BFP (match_dup 1)))] | |
142cd70f | 7055 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7056 | "lc<xde>br\t%0,%1" |
26a89301 | 7057 | [(set_attr "op_type" "RRE") |
f5905b37 | 7058 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 AK |
7059 | |
7060 | ; lcxbr, lcdbr, lcebr | |
f5905b37 | 7061 | (define_insn "*neg<mode>2_cconly" |
ae156f85 | 7062 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7063 | (compare (neg:BFP (match_operand:BFP 1 "register_operand" "f")) |
7064 | (match_operand:BFP 2 "const0_operand" ""))) | |
7065 | (clobber (match_scratch:BFP 0 "=f"))] | |
142cd70f | 7066 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7067 | "lc<xde>br\t%0,%1" |
26a89301 | 7068 | [(set_attr "op_type" "RRE") |
f5905b37 | 7069 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 | 7070 | |
85dae55a AK |
7071 | ; lcdfr |
7072 | (define_insn "*neg<mode>2_nocc" | |
609e7e80 AK |
7073 | [(set (match_operand:FP 0 "register_operand" "=f") |
7074 | (neg:FP (match_operand:FP 1 "register_operand" "<fT0>")))] | |
fb068247 | 7075 | "TARGET_DFP" |
85dae55a AK |
7076 | "lcdfr\t%0,%1" |
7077 | [(set_attr "op_type" "RRE") | |
9381e3f1 | 7078 | (set_attr "type" "fsimp<mode>")]) |
85dae55a | 7079 | |
43a09b63 | 7080 | ; lcxbr, lcdbr, lcebr |
f5905b37 | 7081 | (define_insn "*neg<mode>2" |
7b6baae1 AK |
7082 | [(set (match_operand:BFP 0 "register_operand" "=f") |
7083 | (neg:BFP (match_operand:BFP 1 "register_operand" "f"))) | |
ae156f85 | 7084 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 7085 | "TARGET_HARD_FLOAT" |
f61a2c7d | 7086 | "lc<xde>br\t%0,%1" |
077dab3b | 7087 | [(set_attr "op_type" "RRE") |
f5905b37 | 7088 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 7089 | |
9db1d521 HP |
7090 | |
7091 | ;; | |
7092 | ;;- Absolute value instructions. | |
7093 | ;; | |
7094 | ||
7095 | ; | |
9a91a21f | 7096 | ; abs(di|si)2 instruction pattern(s). |
9db1d521 HP |
7097 | ; |
7098 | ||
26a89301 | 7099 | (define_insn "*absdi2_sign_cc" |
ae156f85 | 7100 | [(set (reg CC_REGNUM) |
26a89301 UW |
7101 | (compare (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI |
7102 | (match_operand:SI 1 "register_operand" "d") 0) | |
7103 | (const_int 32)) (const_int 32))) | |
7104 | (const_int 0))) | |
7105 | (set (match_operand:DI 0 "register_operand" "=d") | |
7106 | (abs:DI (sign_extend:DI (match_dup 1))))] | |
9602b6a1 | 7107 | "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" |
26a89301 | 7108 | "lpgfr\t%0,%1" |
729e750f WG |
7109 | [(set_attr "op_type" "RRE") |
7110 | (set_attr "z10prop" "z10_c")]) | |
26a89301 UW |
7111 | |
7112 | (define_insn "*absdi2_sign" | |
7113 | [(set (match_operand:DI 0 "register_operand" "=d") | |
7114 | (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) | |
ae156f85 | 7115 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 7116 | "TARGET_ZARCH" |
26a89301 | 7117 | "lpgfr\t%0,%1" |
729e750f WG |
7118 | [(set_attr "op_type" "RRE") |
7119 | (set_attr "z10prop" "z10_c")]) | |
26a89301 | 7120 | |
43a09b63 | 7121 | ; lpr, lpgr |
9a91a21f | 7122 | (define_insn "*abs<mode>2_cc" |
ae156f85 | 7123 | [(set (reg CC_REGNUM) |
9a91a21f | 7124 | (compare (abs:GPR (match_operand:DI 1 "register_operand" "d")) |
26a89301 | 7125 | (const_int 0))) |
9a91a21f AS |
7126 | (set (match_operand:GPR 0 "register_operand" "=d") |
7127 | (abs:GPR (match_dup 1)))] | |
26a89301 | 7128 | "s390_match_ccmode (insn, CCAmode)" |
9a91a21f | 7129 | "lp<g>r\t%0,%1" |
9381e3f1 WG |
7130 | [(set_attr "op_type" "RR<E>") |
7131 | (set_attr "z10prop" "z10_c")]) | |
43a09b63 | 7132 | |
9381e3f1 | 7133 | ; lpr, lpgr |
9a91a21f | 7134 | (define_insn "*abs<mode>2_cconly" |
ae156f85 | 7135 | [(set (reg CC_REGNUM) |
9a91a21f | 7136 | (compare (abs:GPR (match_operand:GPR 1 "register_operand" "d")) |
26a89301 | 7137 | (const_int 0))) |
9a91a21f | 7138 | (clobber (match_scratch:GPR 0 "=d"))] |
26a89301 | 7139 | "s390_match_ccmode (insn, CCAmode)" |
9a91a21f | 7140 | "lp<g>r\t%0,%1" |
9381e3f1 WG |
7141 | [(set_attr "op_type" "RR<E>") |
7142 | (set_attr "z10prop" "z10_c")]) | |
43a09b63 AK |
7143 | |
7144 | ; lpr, lpgr | |
9a91a21f AS |
7145 | (define_insn "abs<mode>2" |
7146 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
7147 | (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) | |
ae156f85 | 7148 | (clobber (reg:CC CC_REGNUM))] |
9db1d521 | 7149 | "" |
9a91a21f | 7150 | "lp<g>r\t%0,%1" |
9381e3f1 WG |
7151 | [(set_attr "op_type" "RR<E>") |
7152 | (set_attr "z10prop" "z10_c")]) | |
9db1d521 | 7153 | |
9db1d521 | 7154 | ; |
f5905b37 | 7155 | ; abs(df|sf)2 instruction pattern(s). |
9db1d521 HP |
7156 | ; |
7157 | ||
f5905b37 | 7158 | (define_expand "abs<mode>2" |
9db1d521 | 7159 | [(parallel |
7b6baae1 AK |
7160 | [(set (match_operand:BFP 0 "register_operand" "=f") |
7161 | (abs:BFP (match_operand:BFP 1 "register_operand" "f"))) | |
ae156f85 | 7162 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 HP |
7163 | "TARGET_HARD_FLOAT" |
7164 | "") | |
7165 | ||
43a09b63 | 7166 | ; lpxbr, lpdbr, lpebr |
f5905b37 | 7167 | (define_insn "*abs<mode>2_cc" |
ae156f85 | 7168 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7169 | (compare (abs:BFP (match_operand:BFP 1 "register_operand" "f")) |
7170 | (match_operand:BFP 2 "const0_operand" ""))) | |
7171 | (set (match_operand:BFP 0 "register_operand" "=f") | |
7172 | (abs:BFP (match_dup 1)))] | |
142cd70f | 7173 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7174 | "lp<xde>br\t%0,%1" |
26a89301 | 7175 | [(set_attr "op_type" "RRE") |
f5905b37 | 7176 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 AK |
7177 | |
7178 | ; lpxbr, lpdbr, lpebr | |
f5905b37 | 7179 | (define_insn "*abs<mode>2_cconly" |
ae156f85 | 7180 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7181 | (compare (abs:BFP (match_operand:BFP 1 "register_operand" "f")) |
7182 | (match_operand:BFP 2 "const0_operand" ""))) | |
7183 | (clobber (match_scratch:BFP 0 "=f"))] | |
142cd70f | 7184 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7185 | "lp<xde>br\t%0,%1" |
26a89301 | 7186 | [(set_attr "op_type" "RRE") |
f5905b37 | 7187 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 | 7188 | |
85dae55a AK |
7189 | ; lpdfr |
7190 | (define_insn "*abs<mode>2_nocc" | |
609e7e80 AK |
7191 | [(set (match_operand:FP 0 "register_operand" "=f") |
7192 | (abs:FP (match_operand:FP 1 "register_operand" "<fT0>")))] | |
fb068247 | 7193 | "TARGET_DFP" |
85dae55a AK |
7194 | "lpdfr\t%0,%1" |
7195 | [(set_attr "op_type" "RRE") | |
9381e3f1 | 7196 | (set_attr "type" "fsimp<mode>")]) |
85dae55a | 7197 | |
43a09b63 | 7198 | ; lpxbr, lpdbr, lpebr |
f5905b37 | 7199 | (define_insn "*abs<mode>2" |
7b6baae1 AK |
7200 | [(set (match_operand:BFP 0 "register_operand" "=f") |
7201 | (abs:BFP (match_operand:BFP 1 "register_operand" "f"))) | |
ae156f85 | 7202 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 7203 | "TARGET_HARD_FLOAT" |
f61a2c7d | 7204 | "lp<xde>br\t%0,%1" |
077dab3b | 7205 | [(set_attr "op_type" "RRE") |
f5905b37 | 7206 | (set_attr "type" "fsimp<mode>")]) |
9db1d521 | 7207 | |
9db1d521 | 7208 | |
3ef093a8 AK |
7209 | ;; |
7210 | ;;- Negated absolute value instructions | |
7211 | ;; | |
7212 | ||
7213 | ; | |
7214 | ; Integer | |
7215 | ; | |
7216 | ||
26a89301 | 7217 | (define_insn "*negabsdi2_sign_cc" |
ae156f85 | 7218 | [(set (reg CC_REGNUM) |
26a89301 UW |
7219 | (compare (neg:DI (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI |
7220 | (match_operand:SI 1 "register_operand" "d") 0) | |
7221 | (const_int 32)) (const_int 32)))) | |
7222 | (const_int 0))) | |
7223 | (set (match_operand:DI 0 "register_operand" "=d") | |
7224 | (neg:DI (abs:DI (sign_extend:DI (match_dup 1)))))] | |
9602b6a1 | 7225 | "TARGET_ZARCH && s390_match_ccmode (insn, CCAmode)" |
26a89301 | 7226 | "lngfr\t%0,%1" |
729e750f WG |
7227 | [(set_attr "op_type" "RRE") |
7228 | (set_attr "z10prop" "z10_c")]) | |
9381e3f1 | 7229 | |
26a89301 UW |
7230 | (define_insn "*negabsdi2_sign" |
7231 | [(set (match_operand:DI 0 "register_operand" "=d") | |
7232 | (neg:DI (abs:DI (sign_extend:DI | |
7233 | (match_operand:SI 1 "register_operand" "d"))))) | |
ae156f85 | 7234 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 7235 | "TARGET_ZARCH" |
26a89301 | 7236 | "lngfr\t%0,%1" |
729e750f WG |
7237 | [(set_attr "op_type" "RRE") |
7238 | (set_attr "z10prop" "z10_c")]) | |
3ef093a8 | 7239 | |
43a09b63 | 7240 | ; lnr, lngr |
9a91a21f | 7241 | (define_insn "*negabs<mode>2_cc" |
ae156f85 | 7242 | [(set (reg CC_REGNUM) |
9a91a21f | 7243 | (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) |
26a89301 | 7244 | (const_int 0))) |
9a91a21f AS |
7245 | (set (match_operand:GPR 0 "register_operand" "=d") |
7246 | (neg:GPR (abs:GPR (match_dup 1))))] | |
26a89301 | 7247 | "s390_match_ccmode (insn, CCAmode)" |
9a91a21f | 7248 | "ln<g>r\t%0,%1" |
9381e3f1 WG |
7249 | [(set_attr "op_type" "RR<E>") |
7250 | (set_attr "z10prop" "z10_c")]) | |
43a09b63 AK |
7251 | |
7252 | ; lnr, lngr | |
9a91a21f | 7253 | (define_insn "*negabs<mode>2_cconly" |
ae156f85 | 7254 | [(set (reg CC_REGNUM) |
9a91a21f | 7255 | (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) |
26a89301 | 7256 | (const_int 0))) |
9a91a21f | 7257 | (clobber (match_scratch:GPR 0 "=d"))] |
26a89301 | 7258 | "s390_match_ccmode (insn, CCAmode)" |
9a91a21f | 7259 | "ln<g>r\t%0,%1" |
9381e3f1 WG |
7260 | [(set_attr "op_type" "RR<E>") |
7261 | (set_attr "z10prop" "z10_c")]) | |
43a09b63 AK |
7262 | |
7263 | ; lnr, lngr | |
9a91a21f AS |
7264 | (define_insn "*negabs<mode>2" |
7265 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
7266 | (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d")))) | |
ae156f85 | 7267 | (clobber (reg:CC CC_REGNUM))] |
26a89301 | 7268 | "" |
9a91a21f | 7269 | "ln<g>r\t%0,%1" |
9381e3f1 WG |
7270 | [(set_attr "op_type" "RR<E>") |
7271 | (set_attr "z10prop" "z10_c")]) | |
26a89301 | 7272 | |
3ef093a8 AK |
7273 | ; |
7274 | ; Floating point | |
7275 | ; | |
7276 | ||
43a09b63 | 7277 | ; lnxbr, lndbr, lnebr |
f5905b37 | 7278 | (define_insn "*negabs<mode>2_cc" |
ae156f85 | 7279 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7280 | (compare (neg:BFP (abs:BFP (match_operand:BFP 1 "register_operand" "f"))) |
7281 | (match_operand:BFP 2 "const0_operand" ""))) | |
7282 | (set (match_operand:BFP 0 "register_operand" "=f") | |
7283 | (neg:BFP (abs:BFP (match_dup 1))))] | |
142cd70f | 7284 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7285 | "ln<xde>br\t%0,%1" |
26a89301 | 7286 | [(set_attr "op_type" "RRE") |
f5905b37 | 7287 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 AK |
7288 | |
7289 | ; lnxbr, lndbr, lnebr | |
f5905b37 | 7290 | (define_insn "*negabs<mode>2_cconly" |
ae156f85 | 7291 | [(set (reg CC_REGNUM) |
7b6baae1 AK |
7292 | (compare (neg:BFP (abs:BFP (match_operand:BFP 1 "register_operand" "f"))) |
7293 | (match_operand:BFP 2 "const0_operand" ""))) | |
7294 | (clobber (match_scratch:BFP 0 "=f"))] | |
142cd70f | 7295 | "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT" |
f61a2c7d | 7296 | "ln<xde>br\t%0,%1" |
26a89301 | 7297 | [(set_attr "op_type" "RRE") |
f5905b37 | 7298 | (set_attr "type" "fsimp<mode>")]) |
43a09b63 | 7299 | |
85dae55a AK |
7300 | ; lndfr |
7301 | (define_insn "*negabs<mode>2_nocc" | |
609e7e80 AK |
7302 | [(set (match_operand:FP 0 "register_operand" "=f") |
7303 | (neg:FP (abs:FP (match_operand:BFP 1 "register_operand" "<fT0>"))))] | |
fb068247 | 7304 | "TARGET_DFP" |
85dae55a AK |
7305 | "lndfr\t%0,%1" |
7306 | [(set_attr "op_type" "RRE") | |
9381e3f1 | 7307 | (set_attr "type" "fsimp<mode>")]) |
85dae55a | 7308 | |
43a09b63 | 7309 | ; lnxbr, lndbr, lnebr |
f5905b37 | 7310 | (define_insn "*negabs<mode>2" |
7b6baae1 AK |
7311 | [(set (match_operand:BFP 0 "register_operand" "=f") |
7312 | (neg:BFP (abs:BFP (match_operand:BFP 1 "register_operand" "f")))) | |
ae156f85 | 7313 | (clobber (reg:CC CC_REGNUM))] |
142cd70f | 7314 | "TARGET_HARD_FLOAT" |
f61a2c7d | 7315 | "ln<xde>br\t%0,%1" |
26a89301 | 7316 | [(set_attr "op_type" "RRE") |
f5905b37 | 7317 | (set_attr "type" "fsimp<mode>")]) |
26a89301 | 7318 | |
4023fb28 UW |
7319 | ;; |
7320 | ;;- Square root instructions. | |
7321 | ;; | |
7322 | ||
7323 | ; | |
f5905b37 | 7324 | ; sqrt(df|sf)2 instruction pattern(s). |
4023fb28 UW |
7325 | ; |
7326 | ||
9381e3f1 | 7327 | ; sqxbr, sqdbr, sqebr, sqdb, sqeb |
f5905b37 | 7328 | (define_insn "sqrt<mode>2" |
7b6baae1 AK |
7329 | [(set (match_operand:BFP 0 "register_operand" "=f,f") |
7330 | (sqrt:BFP (match_operand:BFP 1 "general_operand" "f,<Rf>")))] | |
142cd70f | 7331 | "TARGET_HARD_FLOAT" |
4023fb28 | 7332 | "@ |
f61a2c7d AK |
7333 | sq<xde>br\t%0,%1 |
7334 | sq<xde>b\t%0,%1" | |
a036c6f7 | 7335 | [(set_attr "op_type" "RRE,RXE") |
f5905b37 | 7336 | (set_attr "type" "fsqrt<mode>")]) |
4023fb28 | 7337 | |
9db1d521 HP |
7338 | |
7339 | ;; | |
7340 | ;;- One complement instructions. | |
7341 | ;; | |
7342 | ||
7343 | ; | |
342cf42b | 7344 | ; one_cmpl(di|si|hi|qi)2 instruction pattern(s). |
9db1d521 | 7345 | ; |
c7453384 | 7346 | |
342cf42b | 7347 | (define_expand "one_cmpl<mode>2" |
4023fb28 | 7348 | [(parallel |
342cf42b AS |
7349 | [(set (match_operand:INT 0 "register_operand" "") |
7350 | (xor:INT (match_operand:INT 1 "register_operand" "") | |
7351 | (const_int -1))) | |
ae156f85 | 7352 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 | 7353 | "" |
4023fb28 | 7354 | "") |
9db1d521 HP |
7355 | |
7356 | ||
ec24698e UW |
7357 | ;; |
7358 | ;; Find leftmost bit instructions. | |
7359 | ;; | |
7360 | ||
7361 | (define_expand "clzdi2" | |
7362 | [(set (match_operand:DI 0 "register_operand" "=d") | |
7363 | (clz:DI (match_operand:DI 1 "register_operand" "d")))] | |
9602b6a1 | 7364 | "TARGET_EXTIMM && TARGET_ZARCH" |
ec24698e UW |
7365 | { |
7366 | rtx insn, clz_equal; | |
7367 | rtx wide_reg = gen_reg_rtx (TImode); | |
7368 | rtx msb = gen_rtx_CONST_INT (DImode, (unsigned HOST_WIDE_INT) 1 << 63); | |
7369 | ||
7370 | clz_equal = gen_rtx_CLZ (DImode, operands[1]); | |
7371 | ||
7372 | emit_insn (gen_clztidi2 (wide_reg, operands[1], msb)); | |
7373 | ||
9381e3f1 | 7374 | insn = emit_move_insn (operands[0], gen_highpart (DImode, wide_reg)); |
bd94cb6e | 7375 | set_unique_reg_note (insn, REG_EQUAL, clz_equal); |
ec24698e UW |
7376 | |
7377 | DONE; | |
7378 | }) | |
7379 | ||
7380 | (define_insn "clztidi2" | |
7381 | [(set (match_operand:TI 0 "register_operand" "=d") | |
7382 | (ior:TI | |
9381e3f1 WG |
7383 | (ashift:TI |
7384 | (zero_extend:TI | |
ec24698e UW |
7385 | (xor:DI (match_operand:DI 1 "register_operand" "d") |
7386 | (lshiftrt (match_operand:DI 2 "const_int_operand" "") | |
7387 | (subreg:SI (clz:DI (match_dup 1)) 4)))) | |
9381e3f1 | 7388 | |
ec24698e UW |
7389 | (const_int 64)) |
7390 | (zero_extend:TI (clz:DI (match_dup 1))))) | |
7391 | (clobber (reg:CC CC_REGNUM))] | |
9381e3f1 | 7392 | "(unsigned HOST_WIDE_INT) INTVAL (operands[2]) |
ec24698e | 7393 | == (unsigned HOST_WIDE_INT) 1 << 63 |
9602b6a1 | 7394 | && TARGET_EXTIMM && TARGET_ZARCH" |
ec24698e UW |
7395 | "flogr\t%0,%1" |
7396 | [(set_attr "op_type" "RRE")]) | |
7397 | ||
7398 | ||
9db1d521 HP |
7399 | ;; |
7400 | ;;- Rotate instructions. | |
7401 | ;; | |
7402 | ||
7403 | ; | |
9a91a21f | 7404 | ; rotl(di|si)3 instruction pattern(s). |
9db1d521 HP |
7405 | ; |
7406 | ||
43a09b63 | 7407 | ; rll, rllg |
9a91a21f AS |
7408 | (define_insn "rotl<mode>3" |
7409 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
7410 | (rotate:GPR (match_operand:GPR 1 "register_operand" "d") | |
4989e88a | 7411 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] |
9e8327e3 | 7412 | "TARGET_CPU_ZARCH" |
9a91a21f | 7413 | "rll<g>\t%0,%1,%Y2" |
077dab3b | 7414 | [(set_attr "op_type" "RSE") |
9381e3f1 WG |
7415 | (set_attr "atype" "reg") |
7416 | (set_attr "z10prop" "z10_super_E1")]) | |
9db1d521 | 7417 | |
43a09b63 | 7418 | ; rll, rllg |
4989e88a AK |
7419 | (define_insn "*rotl<mode>3_and" |
7420 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
7421 | (rotate:GPR (match_operand:GPR 1 "register_operand" "d") | |
7422 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") | |
7423 | (match_operand:SI 3 "const_int_operand" "n"))))] | |
7424 | "TARGET_CPU_ZARCH && (INTVAL (operands[3]) & 63) == 63" | |
7425 | "rll<g>\t%0,%1,%Y2" | |
7426 | [(set_attr "op_type" "RSE") | |
9381e3f1 WG |
7427 | (set_attr "atype" "reg") |
7428 | (set_attr "z10prop" "z10_super_E1")]) | |
4989e88a | 7429 | |
9db1d521 HP |
7430 | |
7431 | ;; | |
f337b930 | 7432 | ;;- Shift instructions. |
9db1d521 | 7433 | ;; |
9db1d521 HP |
7434 | |
7435 | ; | |
1b48c8cc | 7436 | ; (ashl|lshr)(di|si)3 instruction pattern(s). |
65b1d8ea | 7437 | ; Left shifts and logical right shifts |
9db1d521 | 7438 | |
1b48c8cc AS |
7439 | (define_expand "<shift><mode>3" |
7440 | [(set (match_operand:DSI 0 "register_operand" "") | |
7441 | (SHIFT:DSI (match_operand:DSI 1 "register_operand" "") | |
7442 | (match_operand:SI 2 "shift_count_or_setmem_operand" "")))] | |
9db1d521 HP |
7443 | "" |
7444 | "") | |
7445 | ||
43a09b63 | 7446 | ; sldl, srdl |
f337b930 | 7447 | (define_insn "*<shift>di3_31" |
ac32b25e | 7448 | [(set (match_operand:DI 0 "register_operand" "=d") |
f337b930 | 7449 | (SHIFT:DI (match_operand:DI 1 "register_operand" "0") |
4989e88a | 7450 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")))] |
9602b6a1 | 7451 | "!TARGET_ZARCH" |
f337b930 | 7452 | "s<lr>dl\t%0,%Y2" |
077dab3b | 7453 | [(set_attr "op_type" "RS") |
65b1d8ea AK |
7454 | (set_attr "atype" "reg") |
7455 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 7456 | |
65b1d8ea | 7457 | ; sll, srl, sllg, srlg, sllk, srlk |
1b48c8cc | 7458 | (define_insn "*<shift><mode>3" |
65b1d8ea AK |
7459 | [(set (match_operand:GPR 0 "register_operand" "=d,d") |
7460 | (SHIFT:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") | |
7461 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y")))] | |
1b48c8cc | 7462 | "" |
65b1d8ea AK |
7463 | "@ |
7464 | s<lr>l<g>\t%0,<1>%Y2 | |
7465 | s<lr>l<gk>\t%0,%1,%Y2" | |
7466 | [(set_attr "op_type" "RS<E>,RSY") | |
7467 | (set_attr "atype" "reg,reg") | |
7468 | (set_attr "cpu_facility" "*,z196") | |
7469 | (set_attr "z10prop" "z10_super_E1,*")]) | |
9db1d521 | 7470 | |
43a09b63 | 7471 | ; sldl, srdl |
4989e88a AK |
7472 | (define_insn "*<shift>di3_31_and" |
7473 | [(set (match_operand:DI 0 "register_operand" "=d") | |
7474 | (SHIFT:DI (match_operand:DI 1 "register_operand" "0") | |
7475 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") | |
7476 | (match_operand:SI 3 "const_int_operand" "n"))))] | |
9602b6a1 | 7477 | "!TARGET_ZARCH && (INTVAL (operands[3]) & 63) == 63" |
4989e88a AK |
7478 | "s<lr>dl\t%0,%Y2" |
7479 | [(set_attr "op_type" "RS") | |
7480 | (set_attr "atype" "reg")]) | |
7481 | ||
65b1d8ea | 7482 | ; sll, srl, sllg, srlg, sllk, srlk |
1b48c8cc | 7483 | (define_insn "*<shift><mode>3_and" |
65b1d8ea AK |
7484 | [(set (match_operand:GPR 0 "register_operand" "=d,d") |
7485 | (SHIFT:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") | |
7486 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y") | |
7487 | (match_operand:SI 3 "const_int_operand" "n,n"))))] | |
1b48c8cc | 7488 | "(INTVAL (operands[3]) & 63) == 63" |
65b1d8ea AK |
7489 | "@ |
7490 | s<lr>l<g>\t%0,<1>%Y2 | |
7491 | s<lr>l<gk>\t%0,%1,%Y2" | |
7492 | [(set_attr "op_type" "RS<E>,RSY") | |
7493 | (set_attr "atype" "reg,reg") | |
7494 | (set_attr "cpu_facility" "*,z196") | |
7495 | (set_attr "z10prop" "z10_super_E1,*")]) | |
4989e88a | 7496 | |
9db1d521 | 7497 | ; |
1b48c8cc | 7498 | ; ashr(di|si)3 instruction pattern(s). |
65b1d8ea | 7499 | ; Arithmetic right shifts |
9db1d521 | 7500 | |
1b48c8cc | 7501 | (define_expand "ashr<mode>3" |
9db1d521 | 7502 | [(parallel |
1b48c8cc AS |
7503 | [(set (match_operand:DSI 0 "register_operand" "") |
7504 | (ashiftrt:DSI (match_operand:DSI 1 "register_operand" "") | |
7505 | (match_operand:SI 2 "shift_count_or_setmem_operand" ""))) | |
ae156f85 | 7506 | (clobber (reg:CC CC_REGNUM))])] |
9db1d521 HP |
7507 | "" |
7508 | "") | |
7509 | ||
ecbe845e | 7510 | (define_insn "*ashrdi3_cc_31" |
ae156f85 | 7511 | [(set (reg CC_REGNUM) |
ac32b25e | 7512 | (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") |
4989e88a | 7513 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) |
ecbe845e | 7514 | (const_int 0))) |
ac32b25e | 7515 | (set (match_operand:DI 0 "register_operand" "=d") |
ecbe845e | 7516 | (ashiftrt:DI (match_dup 1) (match_dup 2)))] |
9602b6a1 | 7517 | "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode)" |
ac32b25e | 7518 | "srda\t%0,%Y2" |
077dab3b HP |
7519 | [(set_attr "op_type" "RS") |
7520 | (set_attr "atype" "reg")]) | |
ecbe845e UW |
7521 | |
7522 | (define_insn "*ashrdi3_cconly_31" | |
ae156f85 | 7523 | [(set (reg CC_REGNUM) |
ac32b25e | 7524 | (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") |
4989e88a | 7525 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y")) |
ecbe845e | 7526 | (const_int 0))) |
ac32b25e | 7527 | (clobber (match_scratch:DI 0 "=d"))] |
9602b6a1 | 7528 | "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode)" |
ac32b25e | 7529 | "srda\t%0,%Y2" |
077dab3b HP |
7530 | [(set_attr "op_type" "RS") |
7531 | (set_attr "atype" "reg")]) | |
ecbe845e | 7532 | |
9db1d521 | 7533 | (define_insn "*ashrdi3_31" |
ac32b25e UW |
7534 | [(set (match_operand:DI 0 "register_operand" "=d") |
7535 | (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") | |
4989e88a | 7536 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y"))) |
ae156f85 | 7537 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 7538 | "!TARGET_ZARCH" |
ac32b25e | 7539 | "srda\t%0,%Y2" |
077dab3b HP |
7540 | [(set_attr "op_type" "RS") |
7541 | (set_attr "atype" "reg")]) | |
c7453384 | 7542 | |
65b1d8ea | 7543 | ; sra, srag, srak |
1b48c8cc | 7544 | (define_insn "*ashr<mode>3_cc" |
ae156f85 | 7545 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
7546 | (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") |
7547 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y")) | |
ecbe845e | 7548 | (const_int 0))) |
65b1d8ea | 7549 | (set (match_operand:GPR 0 "register_operand" "=d,d") |
1b48c8cc AS |
7550 | (ashiftrt:GPR (match_dup 1) (match_dup 2)))] |
7551 | "s390_match_ccmode(insn, CCSmode)" | |
65b1d8ea AK |
7552 | "@ |
7553 | sra<g>\t%0,<1>%Y2 | |
7554 | sra<gk>\t%0,%1,%Y2" | |
7555 | [(set_attr "op_type" "RS<E>,RSY") | |
7556 | (set_attr "atype" "reg,reg") | |
7557 | (set_attr "cpu_facility" "*,z196") | |
7558 | (set_attr "z10prop" "z10_super_E1,*")]) | |
ecbe845e | 7559 | |
65b1d8ea | 7560 | ; sra, srag, srak |
1b48c8cc | 7561 | (define_insn "*ashr<mode>3_cconly" |
ae156f85 | 7562 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
7563 | (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") |
7564 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y")) | |
ecbe845e | 7565 | (const_int 0))) |
65b1d8ea | 7566 | (clobber (match_scratch:GPR 0 "=d,d"))] |
1b48c8cc | 7567 | "s390_match_ccmode(insn, CCSmode)" |
65b1d8ea AK |
7568 | "@ |
7569 | sra<g>\t%0,<1>%Y2 | |
7570 | sra<gk>\t%0,%1,%Y2" | |
7571 | [(set_attr "op_type" "RS<E>,RSY") | |
7572 | (set_attr "atype" "reg,reg") | |
7573 | (set_attr "cpu_facility" "*,z196") | |
7574 | (set_attr "z10prop" "z10_super_E1,*")]) | |
ecbe845e | 7575 | |
43a09b63 | 7576 | ; sra, srag |
1b48c8cc | 7577 | (define_insn "*ashr<mode>3" |
65b1d8ea AK |
7578 | [(set (match_operand:GPR 0 "register_operand" "=d,d") |
7579 | (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") | |
7580 | (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y"))) | |
ae156f85 | 7581 | (clobber (reg:CC CC_REGNUM))] |
1b48c8cc | 7582 | "" |
65b1d8ea AK |
7583 | "@ |
7584 | sra<g>\t%0,<1>%Y2 | |
7585 | sra<gk>\t%0,%1,%Y2" | |
7586 | [(set_attr "op_type" "RS<E>,RSY") | |
7587 | (set_attr "atype" "reg,reg") | |
7588 | (set_attr "cpu_facility" "*,z196") | |
7589 | (set_attr "z10prop" "z10_super_E1,*")]) | |
077dab3b | 7590 | |
9db1d521 | 7591 | |
4989e88a AK |
7592 | ; shift pattern with implicit ANDs |
7593 | ||
7594 | (define_insn "*ashrdi3_cc_31_and" | |
7595 | [(set (reg CC_REGNUM) | |
7596 | (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") | |
7597 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") | |
7598 | (match_operand:SI 3 "const_int_operand" "n"))) | |
7599 | (const_int 0))) | |
7600 | (set (match_operand:DI 0 "register_operand" "=d") | |
7601 | (ashiftrt:DI (match_dup 1) (and:SI (match_dup 2) (match_dup 3))))] | |
9602b6a1 | 7602 | "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode) |
4989e88a AK |
7603 | && (INTVAL (operands[3]) & 63) == 63" |
7604 | "srda\t%0,%Y2" | |
7605 | [(set_attr "op_type" "RS") | |
7606 | (set_attr "atype" "reg")]) | |
7607 | ||
7608 | (define_insn "*ashrdi3_cconly_31_and" | |
7609 | [(set (reg CC_REGNUM) | |
7610 | (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") | |
7611 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") | |
7612 | (match_operand:SI 3 "const_int_operand" "n"))) | |
7613 | (const_int 0))) | |
7614 | (clobber (match_scratch:DI 0 "=d"))] | |
9602b6a1 | 7615 | "!TARGET_ZARCH && s390_match_ccmode(insn, CCSmode) |
4989e88a AK |
7616 | && (INTVAL (operands[3]) & 63) == 63" |
7617 | "srda\t%0,%Y2" | |
7618 | [(set_attr "op_type" "RS") | |
7619 | (set_attr "atype" "reg")]) | |
7620 | ||
7621 | (define_insn "*ashrdi3_31_and" | |
7622 | [(set (match_operand:DI 0 "register_operand" "=d") | |
7623 | (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") | |
7624 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y") | |
7625 | (match_operand:SI 3 "const_int_operand" "n")))) | |
7626 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 | 7627 | "!TARGET_ZARCH && (INTVAL (operands[3]) & 63) == 63" |
4989e88a AK |
7628 | "srda\t%0,%Y2" |
7629 | [(set_attr "op_type" "RS") | |
7630 | (set_attr "atype" "reg")]) | |
7631 | ||
65b1d8ea | 7632 | ; sra, srag, srak |
1b48c8cc | 7633 | (define_insn "*ashr<mode>3_cc_and" |
4989e88a | 7634 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
7635 | (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") |
7636 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y") | |
7637 | (match_operand:SI 3 "const_int_operand" "n,n"))) | |
4989e88a | 7638 | (const_int 0))) |
65b1d8ea | 7639 | (set (match_operand:GPR 0 "register_operand" "=d,d") |
1b48c8cc | 7640 | (ashiftrt:GPR (match_dup 1) (and:SI (match_dup 2) (match_dup 3))))] |
4989e88a | 7641 | "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" |
65b1d8ea AK |
7642 | "@ |
7643 | sra<g>\t%0,<1>%Y2 | |
7644 | sra<gk>\t%0,%1,%Y2" | |
7645 | [(set_attr "op_type" "RS<E>,RSY") | |
7646 | (set_attr "atype" "reg,reg") | |
7647 | (set_attr "cpu_facility" "*,z196") | |
7648 | (set_attr "z10prop" "z10_super_E1,*")]) | |
4989e88a | 7649 | |
65b1d8ea | 7650 | ; sra, srag, srak |
1b48c8cc | 7651 | (define_insn "*ashr<mode>3_cconly_and" |
4989e88a | 7652 | [(set (reg CC_REGNUM) |
65b1d8ea AK |
7653 | (compare (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") |
7654 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y") | |
7655 | (match_operand:SI 3 "const_int_operand" "n,n"))) | |
4989e88a | 7656 | (const_int 0))) |
65b1d8ea | 7657 | (clobber (match_scratch:GPR 0 "=d,d"))] |
4989e88a | 7658 | "s390_match_ccmode(insn, CCSmode) && (INTVAL (operands[3]) & 63) == 63" |
65b1d8ea AK |
7659 | "@ |
7660 | sra<g>\t%0,<1>%Y2 | |
7661 | sra<gk>\t%0,%1,%Y2" | |
7662 | [(set_attr "op_type" "RS<E>,RSY") | |
7663 | (set_attr "atype" "reg,reg") | |
7664 | (set_attr "cpu_facility" "*,z196") | |
7665 | (set_attr "z10prop" "z10_super_E1,*")]) | |
4989e88a | 7666 | |
65b1d8ea | 7667 | ; sra, srag, srak |
1b48c8cc | 7668 | (define_insn "*ashr<mode>3_and" |
65b1d8ea AK |
7669 | [(set (match_operand:GPR 0 "register_operand" "=d,d") |
7670 | (ashiftrt:GPR (match_operand:GPR 1 "register_operand" "<d0>,d") | |
7671 | (and:SI (match_operand:SI 2 "shift_count_or_setmem_operand" "Y,Y") | |
7672 | (match_operand:SI 3 "const_int_operand" "n,n")))) | |
4989e88a AK |
7673 | (clobber (reg:CC CC_REGNUM))] |
7674 | "(INTVAL (operands[3]) & 63) == 63" | |
65b1d8ea AK |
7675 | "@ |
7676 | sra<g>\t%0,<1>%Y2 | |
7677 | sra<gk>\t%0,%1,%Y2" | |
7678 | [(set_attr "op_type" "RS<E>,RSY") | |
7679 | (set_attr "atype" "reg,reg") | |
01496eca | 7680 | (set_attr "cpu_facility" "*,z196") |
65b1d8ea | 7681 | (set_attr "z10prop" "z10_super_E1,*")]) |
4989e88a | 7682 | |
9db1d521 | 7683 | |
9db1d521 HP |
7684 | ;; |
7685 | ;; Branch instruction patterns. | |
7686 | ;; | |
7687 | ||
f90b7a5a | 7688 | (define_expand "cbranch<mode>4" |
fa77b251 | 7689 | [(set (pc) |
f90b7a5a PB |
7690 | (if_then_else (match_operator 0 "comparison_operator" |
7691 | [(match_operand:GPR 1 "register_operand" "") | |
7692 | (match_operand:GPR 2 "general_operand" "")]) | |
7693 | (label_ref (match_operand 3 "" "")) | |
fa77b251 | 7694 | (pc)))] |
ba956982 | 7695 | "" |
f90b7a5a PB |
7696 | "s390_emit_jump (operands[3], |
7697 | s390_emit_compare (GET_CODE (operands[0]), operands[1], operands[2])); | |
7698 | DONE;") | |
7699 | ||
7700 | (define_expand "cbranch<mode>4" | |
7701 | [(set (pc) | |
7702 | (if_then_else (match_operator 0 "comparison_operator" | |
7703 | [(match_operand:FP 1 "register_operand" "") | |
7704 | (match_operand:FP 2 "general_operand" "")]) | |
7705 | (label_ref (match_operand 3 "" "")) | |
7706 | (pc)))] | |
7707 | "TARGET_HARD_FLOAT" | |
7708 | "s390_emit_jump (operands[3], | |
7709 | s390_emit_compare (GET_CODE (operands[0]), operands[1], operands[2])); | |
7710 | DONE;") | |
7711 | ||
7712 | (define_expand "cbranchcc4" | |
7713 | [(set (pc) | |
7714 | (if_then_else (match_operator 0 "s390_eqne_operator" | |
7715 | [(match_operand 1 "cc_reg_operand" "") | |
7716 | (match_operand 2 "const0_operand" "")]) | |
7717 | (label_ref (match_operand 3 "" "")) | |
7718 | (pc)))] | |
7719 | "TARGET_HARD_FLOAT" | |
7720 | "s390_emit_jump (operands[3], | |
7721 | s390_emit_compare (GET_CODE (operands[0]), operands[1], operands[2])); | |
7722 | DONE;") | |
7723 | ||
ba956982 | 7724 | |
9db1d521 HP |
7725 | |
7726 | ;; | |
7727 | ;;- Conditional jump instructions. | |
7728 | ;; | |
7729 | ||
6590e19a UW |
7730 | (define_insn "*cjump_64" |
7731 | [(set (pc) | |
7732 | (if_then_else | |
ae156f85 | 7733 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
6590e19a UW |
7734 | (label_ref (match_operand 0 "" "")) |
7735 | (pc)))] | |
7736 | "TARGET_CPU_ZARCH" | |
9db1d521 | 7737 | { |
13e58269 | 7738 | if (get_attr_length (insn) == 4) |
d40c829f | 7739 | return "j%C1\t%l0"; |
6590e19a | 7740 | else |
d40c829f | 7741 | return "jg%C1\t%l0"; |
6590e19a UW |
7742 | } |
7743 | [(set_attr "op_type" "RI") | |
7744 | (set_attr "type" "branch") | |
7745 | (set (attr "length") | |
7746 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
7747 | (const_int 4) (const_int 6)))]) | |
7748 | ||
7749 | (define_insn "*cjump_31" | |
7750 | [(set (pc) | |
7751 | (if_then_else | |
ae156f85 | 7752 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
6590e19a UW |
7753 | (label_ref (match_operand 0 "" "")) |
7754 | (pc)))] | |
7755 | "!TARGET_CPU_ZARCH" | |
7756 | { | |
8d933e31 AS |
7757 | gcc_assert (get_attr_length (insn) == 4); |
7758 | return "j%C1\t%l0"; | |
10bbf137 | 7759 | } |
9db1d521 | 7760 | [(set_attr "op_type" "RI") |
077dab3b | 7761 | (set_attr "type" "branch") |
13e58269 | 7762 | (set (attr "length") |
d7f99b2c | 7763 | (if_then_else (not (match_test "flag_pic")) |
6590e19a UW |
7764 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) |
7765 | (const_int 4) (const_int 6)) | |
7766 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
7767 | (const_int 4) (const_int 8))))]) | |
9db1d521 | 7768 | |
f314b9b1 | 7769 | (define_insn "*cjump_long" |
6590e19a UW |
7770 | [(set (pc) |
7771 | (if_then_else | |
ae156f85 | 7772 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
4fe6dea8 | 7773 | (match_operand 0 "address_operand" "ZQZR") |
6590e19a | 7774 | (pc)))] |
9db1d521 | 7775 | "" |
f314b9b1 UW |
7776 | { |
7777 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
d40c829f | 7778 | return "b%C1r\t%0"; |
f314b9b1 | 7779 | else |
d40c829f | 7780 | return "b%C1\t%a0"; |
10bbf137 | 7781 | } |
c7453384 | 7782 | [(set (attr "op_type") |
f314b9b1 UW |
7783 | (if_then_else (match_operand 0 "register_operand" "") |
7784 | (const_string "RR") (const_string "RX"))) | |
6590e19a | 7785 | (set_attr "type" "branch") |
077dab3b | 7786 | (set_attr "atype" "agen")]) |
9db1d521 HP |
7787 | |
7788 | ||
7789 | ;; | |
7790 | ;;- Negated conditional jump instructions. | |
7791 | ;; | |
7792 | ||
6590e19a UW |
7793 | (define_insn "*icjump_64" |
7794 | [(set (pc) | |
7795 | (if_then_else | |
ae156f85 | 7796 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
6590e19a UW |
7797 | (pc) |
7798 | (label_ref (match_operand 0 "" ""))))] | |
7799 | "TARGET_CPU_ZARCH" | |
c7453384 | 7800 | { |
13e58269 | 7801 | if (get_attr_length (insn) == 4) |
d40c829f | 7802 | return "j%D1\t%l0"; |
6590e19a | 7803 | else |
d40c829f | 7804 | return "jg%D1\t%l0"; |
6590e19a UW |
7805 | } |
7806 | [(set_attr "op_type" "RI") | |
7807 | (set_attr "type" "branch") | |
7808 | (set (attr "length") | |
7809 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
7810 | (const_int 4) (const_int 6)))]) | |
7811 | ||
7812 | (define_insn "*icjump_31" | |
7813 | [(set (pc) | |
7814 | (if_then_else | |
ae156f85 | 7815 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
6590e19a UW |
7816 | (pc) |
7817 | (label_ref (match_operand 0 "" ""))))] | |
7818 | "!TARGET_CPU_ZARCH" | |
7819 | { | |
8d933e31 AS |
7820 | gcc_assert (get_attr_length (insn) == 4); |
7821 | return "j%D1\t%l0"; | |
10bbf137 | 7822 | } |
9db1d521 | 7823 | [(set_attr "op_type" "RI") |
077dab3b | 7824 | (set_attr "type" "branch") |
13e58269 | 7825 | (set (attr "length") |
d7f99b2c | 7826 | (if_then_else (not (match_test "flag_pic")) |
6590e19a UW |
7827 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) |
7828 | (const_int 4) (const_int 6)) | |
7829 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
7830 | (const_int 4) (const_int 8))))]) | |
9db1d521 | 7831 | |
f314b9b1 | 7832 | (define_insn "*icjump_long" |
6590e19a UW |
7833 | [(set (pc) |
7834 | (if_then_else | |
ae156f85 | 7835 | (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) |
6590e19a | 7836 | (pc) |
4fe6dea8 | 7837 | (match_operand 0 "address_operand" "ZQZR")))] |
9db1d521 | 7838 | "" |
f314b9b1 UW |
7839 | { |
7840 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
d40c829f | 7841 | return "b%D1r\t%0"; |
f314b9b1 | 7842 | else |
d40c829f | 7843 | return "b%D1\t%a0"; |
10bbf137 | 7844 | } |
c7453384 | 7845 | [(set (attr "op_type") |
f314b9b1 UW |
7846 | (if_then_else (match_operand 0 "register_operand" "") |
7847 | (const_string "RR") (const_string "RX"))) | |
077dab3b HP |
7848 | (set_attr "type" "branch") |
7849 | (set_attr "atype" "agen")]) | |
9db1d521 | 7850 | |
4456530d HP |
7851 | ;; |
7852 | ;;- Trap instructions. | |
7853 | ;; | |
7854 | ||
7855 | (define_insn "trap" | |
7856 | [(trap_if (const_int 1) (const_int 0))] | |
7857 | "" | |
d40c829f | 7858 | "j\t.+2" |
6590e19a | 7859 | [(set_attr "op_type" "RI") |
077dab3b | 7860 | (set_attr "type" "branch")]) |
4456530d | 7861 | |
f90b7a5a PB |
7862 | (define_expand "ctrap<mode>4" |
7863 | [(trap_if (match_operator 0 "comparison_operator" | |
7864 | [(match_operand:GPR 1 "register_operand" "") | |
7865 | (match_operand:GPR 2 "general_operand" "")]) | |
7866 | (match_operand 3 "const0_operand" ""))] | |
4456530d | 7867 | "" |
f90b7a5a PB |
7868 | { |
7869 | rtx cond = s390_emit_compare (GET_CODE (operands[0]), | |
7870 | operands[1], operands[2]); | |
7871 | emit_insn (gen_condtrap (cond, XEXP (cond, 0))); | |
7872 | DONE; | |
7873 | }) | |
7874 | ||
7875 | (define_expand "ctrap<mode>4" | |
7876 | [(trap_if (match_operator 0 "comparison_operator" | |
7877 | [(match_operand:FP 1 "register_operand" "") | |
7878 | (match_operand:FP 2 "general_operand" "")]) | |
7879 | (match_operand 3 "const0_operand" ""))] | |
7880 | "" | |
7881 | { | |
7882 | rtx cond = s390_emit_compare (GET_CODE (operands[0]), | |
7883 | operands[1], operands[2]); | |
7884 | emit_insn (gen_condtrap (cond, XEXP (cond, 0))); | |
7885 | DONE; | |
7886 | }) | |
4456530d | 7887 | |
f90b7a5a PB |
7888 | (define_insn "condtrap" |
7889 | [(trap_if (match_operator 0 "s390_comparison" | |
7890 | [(match_operand 1 "cc_reg_operand" "c") | |
7891 | (const_int 0)]) | |
4456530d HP |
7892 | (const_int 0))] |
7893 | "" | |
d40c829f | 7894 | "j%C0\t.+2"; |
077dab3b HP |
7895 | [(set_attr "op_type" "RI") |
7896 | (set_attr "type" "branch")]) | |
9db1d521 | 7897 | |
963fc8d0 AK |
7898 | ; crt, cgrt, cit, cgit |
7899 | (define_insn "*cmp_and_trap_signed_int<mode>" | |
7900 | [(trap_if (match_operator 0 "s390_signed_integer_comparison" | |
7901 | [(match_operand:GPR 1 "register_operand" "d,d") | |
7902 | (match_operand:GPR 2 "nonmemory_operand" "d,K")]) | |
7903 | (const_int 0))] | |
7904 | "TARGET_Z10" | |
7905 | "@ | |
7906 | c<g>rt%C0\t%1,%2 | |
7907 | c<g>it%C0\t%1,%h2" | |
7908 | [(set_attr "op_type" "RRF,RIE") | |
9381e3f1 | 7909 | (set_attr "type" "branch") |
729e750f | 7910 | (set_attr "z10prop" "z10_super_c,z10_super")]) |
963fc8d0 | 7911 | |
22ac2c2f | 7912 | ; clrt, clgrt, clfit, clgit, clt, clgt |
963fc8d0 AK |
7913 | (define_insn "*cmp_and_trap_unsigned_int<mode>" |
7914 | [(trap_if (match_operator 0 "s390_unsigned_integer_comparison" | |
22ac2c2f AK |
7915 | [(match_operand:GPR 1 "register_operand" "d,d, d") |
7916 | (match_operand:GPR 2 "general_operand" "d,D,RT")]) | |
963fc8d0 AK |
7917 | (const_int 0))] |
7918 | "TARGET_Z10" | |
7919 | "@ | |
7920 | cl<g>rt%C0\t%1,%2 | |
22ac2c2f AK |
7921 | cl<gf>it%C0\t%1,%x2 |
7922 | cl<g>t%C0\t%1,%2" | |
7923 | [(set_attr "op_type" "RRF,RIE,RSY") | |
7924 | (set_attr "type" "branch") | |
7925 | (set_attr "z10prop" "z10_super_c,z10_super,*") | |
7926 | (set_attr "cpu_facility" "z10,z10,zEC12")]) | |
7927 | ||
7928 | ; lat, lgat | |
7929 | (define_insn "*load_and_trap<mode>" | |
7930 | [(trap_if (eq (match_operand:GPR 0 "memory_operand" "RT") | |
7931 | (const_int 0)) | |
7932 | (const_int 0)) | |
7933 | (set (match_operand:GPR 1 "register_operand" "=d") | |
7934 | (match_dup 0))] | |
7935 | "TARGET_ZEC12" | |
7936 | "l<g>at\t%1,%0" | |
7937 | [(set_attr "op_type" "RXY")]) | |
7938 | ||
963fc8d0 | 7939 | |
9db1d521 | 7940 | ;; |
0a3bdf9d | 7941 | ;;- Loop instructions. |
9db1d521 | 7942 | ;; |
0a3bdf9d UW |
7943 | ;; This is all complicated by the fact that since this is a jump insn |
7944 | ;; we must handle our own output reloads. | |
c7453384 | 7945 | |
f1149235 AK |
7946 | ;; branch on index |
7947 | ||
7948 | ; This splitter will be matched by combine and has to add the 2 moves | |
7949 | ; necessary to load the compare and the increment values into a | |
7950 | ; register pair as needed by brxle. | |
7951 | ||
7952 | (define_insn_and_split "*brx_stage1_<GPR:mode>" | |
7953 | [(set (pc) | |
7954 | (if_then_else | |
7955 | (match_operator 6 "s390_brx_operator" | |
7956 | [(plus:GPR (match_operand:GPR 1 "register_operand" "") | |
7957 | (match_operand:GPR 2 "general_operand" "")) | |
7958 | (match_operand:GPR 3 "register_operand" "")]) | |
7959 | (label_ref (match_operand 0 "" "")) | |
7960 | (pc))) | |
7961 | (set (match_operand:GPR 4 "nonimmediate_operand" "") | |
7962 | (plus:GPR (match_dup 1) (match_dup 2))) | |
7963 | (clobber (match_scratch:GPR 5 ""))] | |
7964 | "TARGET_CPU_ZARCH" | |
7965 | "#" | |
7966 | "!reload_completed && !reload_in_progress" | |
7967 | [(set (match_dup 7) (match_dup 2)) ; the increment | |
7968 | (set (match_dup 8) (match_dup 3)) ; the comparison value | |
7969 | (parallel [(set (pc) | |
7970 | (if_then_else | |
7971 | (match_op_dup 6 | |
7972 | [(plus:GPR (match_dup 1) (match_dup 7)) | |
7973 | (match_dup 8)]) | |
7974 | (label_ref (match_dup 0)) | |
7975 | (pc))) | |
7976 | (set (match_dup 4) | |
7977 | (plus:GPR (match_dup 1) (match_dup 7))) | |
7978 | (clobber (match_dup 5)) | |
7979 | (clobber (reg:CC CC_REGNUM))])] | |
7980 | { | |
7981 | rtx dreg = gen_reg_rtx (word_mode == DImode ? TImode : DImode); | |
7982 | operands[7] = gen_lowpart (<GPR:MODE>mode, | |
7983 | gen_highpart (word_mode, dreg)); | |
7984 | operands[8] = gen_lowpart (<GPR:MODE>mode, | |
7985 | gen_lowpart (word_mode, dreg)); | |
7986 | }) | |
7987 | ||
7988 | ; brxlg, brxhg | |
7989 | ||
7990 | (define_insn_and_split "*brxg_64bit" | |
7991 | [(set (pc) | |
7992 | (if_then_else | |
7993 | (match_operator 5 "s390_brx_operator" | |
7994 | [(plus:DI (match_operand:DI 1 "register_operand" "d,d,d") | |
7995 | (subreg:DI (match_operand:TI 2 "register_operand" "d,d,d") 0)) | |
7996 | (subreg:DI (match_dup 2) 8)]) | |
7997 | (label_ref (match_operand 0 "" "")) | |
7998 | (pc))) | |
7999 | (set (match_operand:DI 3 "nonimmediate_operand" "=1,?X,?X") | |
8000 | (plus:DI (match_dup 1) | |
8001 | (subreg:DI (match_dup 2) 0))) | |
8002 | (clobber (match_scratch:DI 4 "=X,&1,&?d")) | |
8003 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 | 8004 | "TARGET_ZARCH" |
f1149235 AK |
8005 | { |
8006 | if (which_alternative != 0) | |
8007 | return "#"; | |
8008 | else if (get_attr_length (insn) == 6) | |
8009 | return "brx%E5g\t%1,%2,%l0"; | |
8010 | else | |
8011 | return "agr\t%1,%2\;cgr\t%1,%M2\;jg%C5\t%l0"; | |
8012 | } | |
8013 | "&& reload_completed | |
8014 | && (!REG_P (operands[3]) | |
8015 | || !rtx_equal_p (operands[1], operands[3]))" | |
8016 | [(set (match_dup 4) (match_dup 1)) | |
8017 | (parallel [(set (match_dup 4) (plus:DI (match_dup 4) (subreg:DI (match_dup 2) 0))) | |
8018 | (clobber (reg:CC CC_REGNUM))]) | |
8019 | (set (reg:CCS CC_REGNUM) (compare:CCS (match_dup 4) (subreg:DI (match_dup 2) 8))) | |
8020 | (set (match_dup 3) (match_dup 4)) | |
8021 | (set (pc) (if_then_else (match_op_dup 5 [(reg:CCS CC_REGNUM) (const_int 0)]) | |
8022 | (label_ref (match_dup 0)) | |
8023 | (pc)))] | |
8024 | "" | |
8025 | [(set_attr "op_type" "RIE") | |
8026 | (set_attr "type" "branch") | |
8027 | (set (attr "length") | |
8028 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8029 | (const_int 6) (const_int 16)))]) | |
8030 | ||
8031 | ; brxle, brxh | |
8032 | ||
8033 | (define_insn_and_split "*brx_64bit" | |
8034 | [(set (pc) | |
8035 | (if_then_else | |
8036 | (match_operator 5 "s390_brx_operator" | |
8037 | [(plus:SI (match_operand:SI 1 "register_operand" "d,d,d") | |
8038 | (subreg:SI (match_operand:TI 2 "register_operand" "d,d,d") 4)) | |
8039 | (subreg:SI (match_dup 2) 12)]) | |
8040 | (label_ref (match_operand 0 "" "")) | |
8041 | (pc))) | |
8042 | (set (match_operand:SI 3 "nonimmediate_operand" "=1,?X,?X") | |
8043 | (plus:SI (match_dup 1) | |
8044 | (subreg:SI (match_dup 2) 4))) | |
8045 | (clobber (match_scratch:SI 4 "=X,&1,&?d")) | |
8046 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 | 8047 | "TARGET_ZARCH" |
f1149235 AK |
8048 | { |
8049 | if (which_alternative != 0) | |
8050 | return "#"; | |
8051 | else if (get_attr_length (insn) == 6) | |
8052 | return "brx%C5\t%1,%2,%l0"; | |
8053 | else | |
8054 | return "ar\t%1,%2\;cr\t%1,%M2\;jg%C5\t%l0"; | |
8055 | } | |
8056 | "&& reload_completed | |
8057 | && (!REG_P (operands[3]) | |
8058 | || !rtx_equal_p (operands[1], operands[3]))" | |
8059 | [(set (match_dup 4) (match_dup 1)) | |
8060 | (parallel [(set (match_dup 4) (plus:SI (match_dup 4) (subreg:SI (match_dup 2) 4))) | |
8061 | (clobber (reg:CC CC_REGNUM))]) | |
8062 | (set (reg:CCS CC_REGNUM) (compare:CCS (match_dup 4) (subreg:SI (match_dup 2) 12))) | |
8063 | (set (match_dup 3) (match_dup 4)) | |
8064 | (set (pc) (if_then_else (match_op_dup 5 [(reg:CCS CC_REGNUM) (const_int 0)]) | |
8065 | (label_ref (match_dup 0)) | |
8066 | (pc)))] | |
8067 | "" | |
8068 | [(set_attr "op_type" "RSI") | |
8069 | (set_attr "type" "branch") | |
8070 | (set (attr "length") | |
8071 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8072 | (const_int 6) (const_int 14)))]) | |
8073 | ||
8074 | ; brxle, brxh | |
8075 | ||
8076 | (define_insn_and_split "*brx_31bit" | |
8077 | [(set (pc) | |
8078 | (if_then_else | |
8079 | (match_operator 5 "s390_brx_operator" | |
8080 | [(plus:SI (match_operand:SI 1 "register_operand" "d,d,d") | |
8081 | (subreg:SI (match_operand:DI 2 "register_operand" "d,d,d") 0)) | |
8082 | (subreg:SI (match_dup 2) 4)]) | |
8083 | (label_ref (match_operand 0 "" "")) | |
8084 | (pc))) | |
8085 | (set (match_operand:SI 3 "nonimmediate_operand" "=1,?X,?X") | |
8086 | (plus:SI (match_dup 1) | |
8087 | (subreg:SI (match_dup 2) 0))) | |
8088 | (clobber (match_scratch:SI 4 "=X,&1,&?d")) | |
8089 | (clobber (reg:CC CC_REGNUM))] | |
9602b6a1 | 8090 | "!TARGET_ZARCH && TARGET_CPU_ZARCH" |
f1149235 AK |
8091 | { |
8092 | if (which_alternative != 0) | |
8093 | return "#"; | |
8094 | else if (get_attr_length (insn) == 6) | |
8095 | return "brx%C5\t%1,%2,%l0"; | |
8096 | else | |
8097 | return "ar\t%1,%2\;cr\t%1,%M2\;jg%C5\t%l0"; | |
8098 | } | |
8099 | "&& reload_completed | |
8100 | && (!REG_P (operands[3]) | |
8101 | || !rtx_equal_p (operands[1], operands[3]))" | |
8102 | [(set (match_dup 4) (match_dup 1)) | |
8103 | (parallel [(set (match_dup 4) (plus:SI (match_dup 4) (subreg:SI (match_dup 2) 0))) | |
8104 | (clobber (reg:CC CC_REGNUM))]) | |
8105 | (set (reg:CCS CC_REGNUM) (compare:CCS (match_dup 4) (subreg:SI (match_dup 2) 4))) | |
8106 | (set (match_dup 3) (match_dup 4)) | |
8107 | (set (pc) (if_then_else (match_op_dup 5 [(reg:CCS CC_REGNUM) (const_int 0)]) | |
8108 | (label_ref (match_dup 0)) | |
8109 | (pc)))] | |
8110 | "" | |
8111 | [(set_attr "op_type" "RSI") | |
8112 | (set_attr "type" "branch") | |
8113 | (set (attr "length") | |
8114 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8115 | (const_int 6) (const_int 14)))]) | |
8116 | ||
8117 | ||
8118 | ;; branch on count | |
8119 | ||
0a3bdf9d UW |
8120 | (define_expand "doloop_end" |
8121 | [(use (match_operand 0 "" "")) ; loop pseudo | |
8122 | (use (match_operand 1 "" "")) ; iterations; zero if unknown | |
8123 | (use (match_operand 2 "" "")) ; max iterations | |
8124 | (use (match_operand 3 "" "")) ; loop level | |
2407343c JR |
8125 | (use (match_operand 4 "" "")) ; label |
8126 | (use (match_operand 5 "" ""))] ; flag: 1 if loop entered at top, else 0 | |
0a3bdf9d | 8127 | "" |
0a3bdf9d | 8128 | { |
6590e19a UW |
8129 | if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH) |
8130 | emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0])); | |
8131 | else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH) | |
8132 | emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0])); | |
9602b6a1 | 8133 | else if (GET_MODE (operands[0]) == DImode && TARGET_ZARCH) |
0a3bdf9d UW |
8134 | emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0])); |
8135 | else | |
8136 | FAIL; | |
8137 | ||
8138 | DONE; | |
10bbf137 | 8139 | }) |
0a3bdf9d | 8140 | |
6590e19a | 8141 | (define_insn_and_split "doloop_si64" |
0a3bdf9d UW |
8142 | [(set (pc) |
8143 | (if_then_else | |
7e665d18 | 8144 | (ne (match_operand:SI 1 "register_operand" "d,d,d") |
0a3bdf9d UW |
8145 | (const_int 1)) |
8146 | (label_ref (match_operand 0 "" "")) | |
8147 | (pc))) | |
7e665d18 | 8148 | (set (match_operand:SI 2 "nonimmediate_operand" "=1,?X,?X") |
0a3bdf9d | 8149 | (plus:SI (match_dup 1) (const_int -1))) |
7e665d18 | 8150 | (clobber (match_scratch:SI 3 "=X,&1,&?d")) |
ae156f85 | 8151 | (clobber (reg:CC CC_REGNUM))] |
6590e19a | 8152 | "TARGET_CPU_ZARCH" |
0a3bdf9d UW |
8153 | { |
8154 | if (which_alternative != 0) | |
10bbf137 | 8155 | return "#"; |
0a3bdf9d | 8156 | else if (get_attr_length (insn) == 4) |
d40c829f | 8157 | return "brct\t%1,%l0"; |
6590e19a | 8158 | else |
545d16ff | 8159 | return "ahi\t%1,-1\;jgne\t%l0"; |
6590e19a UW |
8160 | } |
8161 | "&& reload_completed | |
8162 | && (! REG_P (operands[2]) | |
8163 | || ! rtx_equal_p (operands[1], operands[2]))" | |
7e665d18 AK |
8164 | [(set (match_dup 3) (match_dup 1)) |
8165 | (parallel [(set (reg:CCAN CC_REGNUM) | |
6590e19a UW |
8166 | (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) |
8167 | (const_int 0))) | |
8168 | (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) | |
8169 | (set (match_dup 2) (match_dup 3)) | |
ae156f85 | 8170 | (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) |
6590e19a UW |
8171 | (label_ref (match_dup 0)) |
8172 | (pc)))] | |
8173 | "" | |
8174 | [(set_attr "op_type" "RI") | |
9381e3f1 WG |
8175 | ; Strictly speaking, the z10 properties are valid for brct only, however, it does not |
8176 | ; hurt us in the (rare) case of ahi. | |
729e750f | 8177 | (set_attr "z10prop" "z10_super_E1") |
6590e19a UW |
8178 | (set_attr "type" "branch") |
8179 | (set (attr "length") | |
8180 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8181 | (const_int 4) (const_int 10)))]) | |
8182 | ||
8183 | (define_insn_and_split "doloop_si31" | |
8184 | [(set (pc) | |
8185 | (if_then_else | |
7e665d18 | 8186 | (ne (match_operand:SI 1 "register_operand" "d,d,d") |
6590e19a UW |
8187 | (const_int 1)) |
8188 | (label_ref (match_operand 0 "" "")) | |
8189 | (pc))) | |
7e665d18 | 8190 | (set (match_operand:SI 2 "nonimmediate_operand" "=1,?X,?X") |
6590e19a | 8191 | (plus:SI (match_dup 1) (const_int -1))) |
7e665d18 | 8192 | (clobber (match_scratch:SI 3 "=X,&1,&?d")) |
ae156f85 | 8193 | (clobber (reg:CC CC_REGNUM))] |
6590e19a UW |
8194 | "!TARGET_CPU_ZARCH" |
8195 | { | |
8196 | if (which_alternative != 0) | |
8197 | return "#"; | |
8198 | else if (get_attr_length (insn) == 4) | |
8199 | return "brct\t%1,%l0"; | |
0a3bdf9d | 8200 | else |
8d933e31 | 8201 | gcc_unreachable (); |
10bbf137 | 8202 | } |
6590e19a UW |
8203 | "&& reload_completed |
8204 | && (! REG_P (operands[2]) | |
8205 | || ! rtx_equal_p (operands[1], operands[2]))" | |
7e665d18 AK |
8206 | [(set (match_dup 3) (match_dup 1)) |
8207 | (parallel [(set (reg:CCAN CC_REGNUM) | |
6590e19a UW |
8208 | (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) |
8209 | (const_int 0))) | |
8210 | (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) | |
8211 | (set (match_dup 2) (match_dup 3)) | |
ae156f85 | 8212 | (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) |
6590e19a UW |
8213 | (label_ref (match_dup 0)) |
8214 | (pc)))] | |
8215 | "" | |
0a3bdf9d | 8216 | [(set_attr "op_type" "RI") |
9381e3f1 WG |
8217 | ; Strictly speaking, the z10 properties are valid for brct only, however, it does not |
8218 | ; hurt us in the (rare) case of ahi. | |
729e750f | 8219 | (set_attr "z10prop" "z10_super_E1") |
077dab3b | 8220 | (set_attr "type" "branch") |
0a3bdf9d | 8221 | (set (attr "length") |
d7f99b2c | 8222 | (if_then_else (not (match_test "flag_pic")) |
6590e19a UW |
8223 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) |
8224 | (const_int 4) (const_int 6)) | |
8225 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8226 | (const_int 4) (const_int 8))))]) | |
9db1d521 | 8227 | |
0a3bdf9d UW |
8228 | (define_insn "*doloop_si_long" |
8229 | [(set (pc) | |
8230 | (if_then_else | |
7e665d18 | 8231 | (ne (match_operand:SI 1 "register_operand" "d") |
0a3bdf9d | 8232 | (const_int 1)) |
4fe6dea8 | 8233 | (match_operand 0 "address_operand" "ZQZR") |
0a3bdf9d | 8234 | (pc))) |
7e665d18 | 8235 | (set (match_operand:SI 2 "register_operand" "=1") |
0a3bdf9d | 8236 | (plus:SI (match_dup 1) (const_int -1))) |
7e665d18 | 8237 | (clobber (match_scratch:SI 3 "=X")) |
ae156f85 | 8238 | (clobber (reg:CC CC_REGNUM))] |
6590e19a | 8239 | "!TARGET_CPU_ZARCH" |
0a3bdf9d UW |
8240 | { |
8241 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
d40c829f | 8242 | return "bctr\t%1,%0"; |
0a3bdf9d | 8243 | else |
d40c829f | 8244 | return "bct\t%1,%a0"; |
10bbf137 | 8245 | } |
c7453384 | 8246 | [(set (attr "op_type") |
0a3bdf9d UW |
8247 | (if_then_else (match_operand 0 "register_operand" "") |
8248 | (const_string "RR") (const_string "RX"))) | |
077dab3b | 8249 | (set_attr "type" "branch") |
729e750f | 8250 | (set_attr "atype" "agen") |
65b1d8ea AK |
8251 | (set_attr "z10prop" "z10_c") |
8252 | (set_attr "z196prop" "z196_cracked")]) | |
0a3bdf9d | 8253 | |
6590e19a | 8254 | (define_insn_and_split "doloop_di" |
0a3bdf9d UW |
8255 | [(set (pc) |
8256 | (if_then_else | |
7e665d18 | 8257 | (ne (match_operand:DI 1 "register_operand" "d,d,d") |
0a3bdf9d UW |
8258 | (const_int 1)) |
8259 | (label_ref (match_operand 0 "" "")) | |
8260 | (pc))) | |
7e665d18 | 8261 | (set (match_operand:DI 2 "nonimmediate_operand" "=1,?X,?X") |
0a3bdf9d | 8262 | (plus:DI (match_dup 1) (const_int -1))) |
7e665d18 | 8263 | (clobber (match_scratch:DI 3 "=X,&1,&?d")) |
ae156f85 | 8264 | (clobber (reg:CC CC_REGNUM))] |
9602b6a1 | 8265 | "TARGET_ZARCH" |
0a3bdf9d UW |
8266 | { |
8267 | if (which_alternative != 0) | |
10bbf137 | 8268 | return "#"; |
0a3bdf9d | 8269 | else if (get_attr_length (insn) == 4) |
d40c829f | 8270 | return "brctg\t%1,%l0"; |
0a3bdf9d | 8271 | else |
545d16ff | 8272 | return "aghi\t%1,-1\;jgne\t%l0"; |
10bbf137 | 8273 | } |
6590e19a | 8274 | "&& reload_completed |
0a3bdf9d UW |
8275 | && (! REG_P (operands[2]) |
8276 | || ! rtx_equal_p (operands[1], operands[2]))" | |
7e665d18 AK |
8277 | [(set (match_dup 3) (match_dup 1)) |
8278 | (parallel [(set (reg:CCAN CC_REGNUM) | |
0a3bdf9d UW |
8279 | (compare:CCAN (plus:DI (match_dup 3) (const_int -1)) |
8280 | (const_int 0))) | |
8281 | (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))]) | |
8282 | (set (match_dup 2) (match_dup 3)) | |
ae156f85 | 8283 | (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) |
6590e19a | 8284 | (label_ref (match_dup 0)) |
0a3bdf9d | 8285 | (pc)))] |
6590e19a UW |
8286 | "" |
8287 | [(set_attr "op_type" "RI") | |
9381e3f1 WG |
8288 | ; Strictly speaking, the z10 properties are valid for brct only, however, it does not |
8289 | ; hurt us in the (rare) case of ahi. | |
729e750f | 8290 | (set_attr "z10prop" "z10_super_E1") |
6590e19a UW |
8291 | (set_attr "type" "branch") |
8292 | (set (attr "length") | |
8293 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8294 | (const_int 4) (const_int 10)))]) | |
9db1d521 HP |
8295 | |
8296 | ;; | |
8297 | ;;- Unconditional jump instructions. | |
8298 | ;; | |
8299 | ||
8300 | ; | |
8301 | ; jump instruction pattern(s). | |
8302 | ; | |
8303 | ||
6590e19a UW |
8304 | (define_expand "jump" |
8305 | [(match_operand 0 "" "")] | |
9db1d521 | 8306 | "" |
6590e19a UW |
8307 | "s390_emit_jump (operands[0], NULL_RTX); DONE;") |
8308 | ||
8309 | (define_insn "*jump64" | |
8310 | [(set (pc) (label_ref (match_operand 0 "" "")))] | |
8311 | "TARGET_CPU_ZARCH" | |
9db1d521 | 8312 | { |
13e58269 | 8313 | if (get_attr_length (insn) == 4) |
d40c829f | 8314 | return "j\t%l0"; |
6590e19a | 8315 | else |
d40c829f | 8316 | return "jg\t%l0"; |
6590e19a UW |
8317 | } |
8318 | [(set_attr "op_type" "RI") | |
8319 | (set_attr "type" "branch") | |
8320 | (set (attr "length") | |
8321 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8322 | (const_int 4) (const_int 6)))]) | |
8323 | ||
8324 | (define_insn "*jump31" | |
8325 | [(set (pc) (label_ref (match_operand 0 "" "")))] | |
8326 | "!TARGET_CPU_ZARCH" | |
8327 | { | |
8d933e31 AS |
8328 | gcc_assert (get_attr_length (insn) == 4); |
8329 | return "j\t%l0"; | |
10bbf137 | 8330 | } |
9db1d521 | 8331 | [(set_attr "op_type" "RI") |
077dab3b | 8332 | (set_attr "type" "branch") |
13e58269 | 8333 | (set (attr "length") |
d7f99b2c | 8334 | (if_then_else (not (match_test "flag_pic")) |
6590e19a UW |
8335 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) |
8336 | (const_int 4) (const_int 6)) | |
8337 | (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000)) | |
8338 | (const_int 4) (const_int 8))))]) | |
9db1d521 HP |
8339 | |
8340 | ; | |
8341 | ; indirect-jump instruction pattern(s). | |
8342 | ; | |
8343 | ||
8344 | (define_insn "indirect_jump" | |
4fe6dea8 | 8345 | [(set (pc) (match_operand 0 "address_operand" "ZQZR"))] |
9db1d521 | 8346 | "" |
f314b9b1 UW |
8347 | { |
8348 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
d40c829f | 8349 | return "br\t%0"; |
f314b9b1 | 8350 | else |
d40c829f | 8351 | return "b\t%a0"; |
10bbf137 | 8352 | } |
c7453384 | 8353 | [(set (attr "op_type") |
f314b9b1 UW |
8354 | (if_then_else (match_operand 0 "register_operand" "") |
8355 | (const_string "RR") (const_string "RX"))) | |
077dab3b | 8356 | (set_attr "type" "branch") |
729e750f | 8357 | (set_attr "atype" "agen")]) |
9db1d521 HP |
8358 | |
8359 | ; | |
f314b9b1 | 8360 | ; casesi instruction pattern(s). |
9db1d521 HP |
8361 | ; |
8362 | ||
f314b9b1 | 8363 | (define_insn "casesi_jump" |
4fe6dea8 | 8364 | [(set (pc) (match_operand 0 "address_operand" "ZQZR")) |
f314b9b1 | 8365 | (use (label_ref (match_operand 1 "" "")))] |
9db1d521 | 8366 | "" |
9db1d521 | 8367 | { |
f314b9b1 | 8368 | if (get_attr_op_type (insn) == OP_TYPE_RR) |
d40c829f | 8369 | return "br\t%0"; |
f314b9b1 | 8370 | else |
d40c829f | 8371 | return "b\t%a0"; |
10bbf137 | 8372 | } |
c7453384 | 8373 | [(set (attr "op_type") |
f314b9b1 UW |
8374 | (if_then_else (match_operand 0 "register_operand" "") |
8375 | (const_string "RR") (const_string "RX"))) | |
077dab3b HP |
8376 | (set_attr "type" "branch") |
8377 | (set_attr "atype" "agen")]) | |
9db1d521 | 8378 | |
f314b9b1 UW |
8379 | (define_expand "casesi" |
8380 | [(match_operand:SI 0 "general_operand" "") | |
8381 | (match_operand:SI 1 "general_operand" "") | |
8382 | (match_operand:SI 2 "general_operand" "") | |
8383 | (label_ref (match_operand 3 "" "")) | |
8384 | (label_ref (match_operand 4 "" ""))] | |
9db1d521 | 8385 | "" |
f314b9b1 UW |
8386 | { |
8387 | rtx index = gen_reg_rtx (SImode); | |
8388 | rtx base = gen_reg_rtx (Pmode); | |
8389 | rtx target = gen_reg_rtx (Pmode); | |
8390 | ||
8391 | emit_move_insn (index, operands[0]); | |
8392 | emit_insn (gen_subsi3 (index, index, operands[1])); | |
8393 | emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1, | |
e790b36a | 8394 | operands[4]); |
f314b9b1 UW |
8395 | |
8396 | if (Pmode != SImode) | |
8397 | index = convert_to_mode (Pmode, index, 1); | |
8398 | if (GET_CODE (index) != REG) | |
8399 | index = copy_to_mode_reg (Pmode, index); | |
8400 | ||
8401 | if (TARGET_64BIT) | |
8402 | emit_insn (gen_ashldi3 (index, index, GEN_INT (3))); | |
8403 | else | |
a556fd39 | 8404 | emit_insn (gen_ashlsi3 (index, index, const2_rtx)); |
9db1d521 | 8405 | |
f314b9b1 UW |
8406 | emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3])); |
8407 | ||
542a8afa | 8408 | index = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, base, index)); |
f314b9b1 UW |
8409 | emit_move_insn (target, index); |
8410 | ||
8411 | if (flag_pic) | |
8412 | target = gen_rtx_PLUS (Pmode, base, target); | |
8413 | emit_jump_insn (gen_casesi_jump (target, operands[3])); | |
8414 | ||
8415 | DONE; | |
10bbf137 | 8416 | }) |
9db1d521 HP |
8417 | |
8418 | ||
8419 | ;; | |
8420 | ;;- Jump to subroutine. | |
8421 | ;; | |
8422 | ;; | |
8423 | ||
8424 | ; | |
8425 | ; untyped call instruction pattern(s). | |
8426 | ; | |
8427 | ||
8428 | ;; Call subroutine returning any type. | |
8429 | (define_expand "untyped_call" | |
8430 | [(parallel [(call (match_operand 0 "" "") | |
8431 | (const_int 0)) | |
8432 | (match_operand 1 "" "") | |
8433 | (match_operand 2 "" "")])] | |
8434 | "" | |
9db1d521 HP |
8435 | { |
8436 | int i; | |
8437 | ||
8438 | emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx)); | |
8439 | ||
8440 | for (i = 0; i < XVECLEN (operands[2], 0); i++) | |
8441 | { | |
8442 | rtx set = XVECEXP (operands[2], 0, i); | |
8443 | emit_move_insn (SET_DEST (set), SET_SRC (set)); | |
8444 | } | |
8445 | ||
8446 | /* The optimizer does not know that the call sets the function value | |
8447 | registers we stored in the result block. We avoid problems by | |
8448 | claiming that all hard registers are used and clobbered at this | |
8449 | point. */ | |
8450 | emit_insn (gen_blockage ()); | |
8451 | ||
8452 | DONE; | |
10bbf137 | 8453 | }) |
9db1d521 HP |
8454 | |
8455 | ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and | |
8456 | ;; all of memory. This blocks insns from being moved across this point. | |
8457 | ||
8458 | (define_insn "blockage" | |
10bbf137 | 8459 | [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)] |
9db1d521 | 8460 | "" |
4023fb28 | 8461 | "" |
d5869ca0 UW |
8462 | [(set_attr "type" "none") |
8463 | (set_attr "length" "0")]) | |
4023fb28 | 8464 | |
9db1d521 | 8465 | ; |
ed9676cf | 8466 | ; sibcall patterns |
9db1d521 HP |
8467 | ; |
8468 | ||
ed9676cf | 8469 | (define_expand "sibcall" |
44b8152b | 8470 | [(call (match_operand 0 "" "") |
ed9676cf | 8471 | (match_operand 1 "" ""))] |
9db1d521 | 8472 | "" |
9db1d521 | 8473 | { |
ed9676cf AK |
8474 | s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX); |
8475 | DONE; | |
8476 | }) | |
9db1d521 | 8477 | |
ed9676cf | 8478 | (define_insn "*sibcall_br" |
ae156f85 | 8479 | [(call (mem:QI (reg SIBCALL_REGNUM)) |
ed9676cf | 8480 | (match_operand 0 "const_int_operand" "n"))] |
2f7e5a0d | 8481 | "SIBLING_CALL_P (insn) |
ed9676cf AK |
8482 | && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode" |
8483 | "br\t%%r1" | |
8484 | [(set_attr "op_type" "RR") | |
8485 | (set_attr "type" "branch") | |
8486 | (set_attr "atype" "agen")]) | |
9db1d521 | 8487 | |
ed9676cf AK |
8488 | (define_insn "*sibcall_brc" |
8489 | [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) | |
8490 | (match_operand 1 "const_int_operand" "n"))] | |
8491 | "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC" | |
8492 | "j\t%0" | |
8493 | [(set_attr "op_type" "RI") | |
8494 | (set_attr "type" "branch")]) | |
9db1d521 | 8495 | |
ed9676cf AK |
8496 | (define_insn "*sibcall_brcl" |
8497 | [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) | |
8498 | (match_operand 1 "const_int_operand" "n"))] | |
8499 | "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH" | |
8500 | "jg\t%0" | |
8501 | [(set_attr "op_type" "RIL") | |
8502 | (set_attr "type" "branch")]) | |
44b8152b | 8503 | |
ed9676cf AK |
8504 | ; |
8505 | ; sibcall_value patterns | |
8506 | ; | |
9e8327e3 | 8507 | |
ed9676cf AK |
8508 | (define_expand "sibcall_value" |
8509 | [(set (match_operand 0 "" "") | |
8510 | (call (match_operand 1 "" "") | |
8511 | (match_operand 2 "" "")))] | |
8512 | "" | |
8513 | { | |
8514 | s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX); | |
44b8152b | 8515 | DONE; |
10bbf137 | 8516 | }) |
9db1d521 | 8517 | |
ed9676cf AK |
8518 | (define_insn "*sibcall_value_br" |
8519 | [(set (match_operand 0 "" "") | |
ae156f85 | 8520 | (call (mem:QI (reg SIBCALL_REGNUM)) |
ed9676cf | 8521 | (match_operand 1 "const_int_operand" "n")))] |
2f7e5a0d | 8522 | "SIBLING_CALL_P (insn) |
ed9676cf AK |
8523 | && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode" |
8524 | "br\t%%r1" | |
8525 | [(set_attr "op_type" "RR") | |
8526 | (set_attr "type" "branch") | |
8527 | (set_attr "atype" "agen")]) | |
8528 | ||
8529 | (define_insn "*sibcall_value_brc" | |
8530 | [(set (match_operand 0 "" "") | |
8531 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) | |
8532 | (match_operand 2 "const_int_operand" "n")))] | |
8533 | "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC" | |
8534 | "j\t%1" | |
8535 | [(set_attr "op_type" "RI") | |
8536 | (set_attr "type" "branch")]) | |
8537 | ||
8538 | (define_insn "*sibcall_value_brcl" | |
8539 | [(set (match_operand 0 "" "") | |
8540 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) | |
8541 | (match_operand 2 "const_int_operand" "n")))] | |
8542 | "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH" | |
8543 | "jg\t%1" | |
8544 | [(set_attr "op_type" "RIL") | |
8545 | (set_attr "type" "branch")]) | |
8546 | ||
8547 | ||
8548 | ; | |
8549 | ; call instruction pattern(s). | |
8550 | ; | |
8551 | ||
8552 | (define_expand "call" | |
8553 | [(call (match_operand 0 "" "") | |
8554 | (match_operand 1 "" "")) | |
8555 | (use (match_operand 2 "" ""))] | |
44b8152b | 8556 | "" |
ed9676cf | 8557 | { |
2f7e5a0d | 8558 | s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, |
ed9676cf AK |
8559 | gen_rtx_REG (Pmode, RETURN_REGNUM)); |
8560 | DONE; | |
8561 | }) | |
44b8152b | 8562 | |
9e8327e3 UW |
8563 | (define_insn "*bras" |
8564 | [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) | |
8565 | (match_operand 1 "const_int_operand" "n")) | |
8566 | (clobber (match_operand 2 "register_operand" "=r"))] | |
2f7e5a0d EC |
8567 | "!SIBLING_CALL_P (insn) |
8568 | && TARGET_SMALL_EXEC | |
ed9676cf | 8569 | && GET_MODE (operands[2]) == Pmode" |
d40c829f | 8570 | "bras\t%2,%0" |
9db1d521 | 8571 | [(set_attr "op_type" "RI") |
65b1d8ea AK |
8572 | (set_attr "type" "jsr") |
8573 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 8574 | |
9e8327e3 UW |
8575 | (define_insn "*brasl" |
8576 | [(call (mem:QI (match_operand 0 "bras_sym_operand" "X")) | |
8577 | (match_operand 1 "const_int_operand" "n")) | |
8578 | (clobber (match_operand 2 "register_operand" "=r"))] | |
2f7e5a0d EC |
8579 | "!SIBLING_CALL_P (insn) |
8580 | && TARGET_CPU_ZARCH | |
ed9676cf | 8581 | && GET_MODE (operands[2]) == Pmode" |
9e8327e3 UW |
8582 | "brasl\t%2,%0" |
8583 | [(set_attr "op_type" "RIL") | |
65b1d8ea AK |
8584 | (set_attr "type" "jsr") |
8585 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 8586 | |
9e8327e3 | 8587 | (define_insn "*basr" |
4fe6dea8 | 8588 | [(call (mem:QI (match_operand 0 "address_operand" "ZQZR")) |
9e8327e3 UW |
8589 | (match_operand 1 "const_int_operand" "n")) |
8590 | (clobber (match_operand 2 "register_operand" "=r"))] | |
ed9676cf | 8591 | "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode" |
9e8327e3 UW |
8592 | { |
8593 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
8594 | return "basr\t%2,%0"; | |
8595 | else | |
8596 | return "bas\t%2,%a0"; | |
8597 | } | |
8598 | [(set (attr "op_type") | |
8599 | (if_then_else (match_operand 0 "register_operand" "") | |
8600 | (const_string "RR") (const_string "RX"))) | |
8601 | (set_attr "type" "jsr") | |
65b1d8ea AK |
8602 | (set_attr "atype" "agen") |
8603 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 HP |
8604 | |
8605 | ; | |
8606 | ; call_value instruction pattern(s). | |
8607 | ; | |
8608 | ||
8609 | (define_expand "call_value" | |
44b8152b UW |
8610 | [(set (match_operand 0 "" "") |
8611 | (call (match_operand 1 "" "") | |
8612 | (match_operand 2 "" ""))) | |
8613 | (use (match_operand 3 "" ""))] | |
9db1d521 | 8614 | "" |
9db1d521 | 8615 | { |
2f7e5a0d | 8616 | s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], |
ed9676cf | 8617 | gen_rtx_REG (Pmode, RETURN_REGNUM)); |
44b8152b | 8618 | DONE; |
10bbf137 | 8619 | }) |
9db1d521 | 8620 | |
9e8327e3 | 8621 | (define_insn "*bras_r" |
c19ec8f9 | 8622 | [(set (match_operand 0 "" "") |
9e8327e3 | 8623 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) |
9db1d521 | 8624 | (match_operand:SI 2 "const_int_operand" "n"))) |
9e8327e3 | 8625 | (clobber (match_operand 3 "register_operand" "=r"))] |
2f7e5a0d EC |
8626 | "!SIBLING_CALL_P (insn) |
8627 | && TARGET_SMALL_EXEC | |
ed9676cf | 8628 | && GET_MODE (operands[3]) == Pmode" |
d40c829f | 8629 | "bras\t%3,%1" |
9db1d521 | 8630 | [(set_attr "op_type" "RI") |
65b1d8ea AK |
8631 | (set_attr "type" "jsr") |
8632 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 8633 | |
9e8327e3 | 8634 | (define_insn "*brasl_r" |
c19ec8f9 | 8635 | [(set (match_operand 0 "" "") |
9e8327e3 UW |
8636 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) |
8637 | (match_operand 2 "const_int_operand" "n"))) | |
8638 | (clobber (match_operand 3 "register_operand" "=r"))] | |
2f7e5a0d EC |
8639 | "!SIBLING_CALL_P (insn) |
8640 | && TARGET_CPU_ZARCH | |
ed9676cf | 8641 | && GET_MODE (operands[3]) == Pmode" |
9e8327e3 UW |
8642 | "brasl\t%3,%1" |
8643 | [(set_attr "op_type" "RIL") | |
65b1d8ea AK |
8644 | (set_attr "type" "jsr") |
8645 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 8646 | |
9e8327e3 | 8647 | (define_insn "*basr_r" |
c19ec8f9 | 8648 | [(set (match_operand 0 "" "") |
4fe6dea8 | 8649 | (call (mem:QI (match_operand 1 "address_operand" "ZQZR")) |
9e8327e3 UW |
8650 | (match_operand 2 "const_int_operand" "n"))) |
8651 | (clobber (match_operand 3 "register_operand" "=r"))] | |
ed9676cf | 8652 | "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode" |
9e8327e3 UW |
8653 | { |
8654 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
8655 | return "basr\t%3,%1"; | |
8656 | else | |
8657 | return "bas\t%3,%a1"; | |
8658 | } | |
8659 | [(set (attr "op_type") | |
8660 | (if_then_else (match_operand 1 "register_operand" "") | |
8661 | (const_string "RR") (const_string "RX"))) | |
8662 | (set_attr "type" "jsr") | |
65b1d8ea AK |
8663 | (set_attr "atype" "agen") |
8664 | (set_attr "z196prop" "z196_cracked")]) | |
9db1d521 | 8665 | |
fd3cd001 UW |
8666 | ;; |
8667 | ;;- Thread-local storage support. | |
8668 | ;; | |
8669 | ||
f959607b CLT |
8670 | (define_expand "get_thread_pointer<mode>" |
8671 | [(set (match_operand:P 0 "nonimmediate_operand" "") (reg:P TP_REGNUM))] | |
8672 | "" | |
c5aa1d12 | 8673 | "") |
fd3cd001 | 8674 | |
f959607b CLT |
8675 | (define_expand "set_thread_pointer<mode>" |
8676 | [(set (reg:P TP_REGNUM) (match_operand:P 0 "nonimmediate_operand" "")) | |
8677 | (set (reg:P TP_REGNUM) (unspec_volatile:P [(reg:P TP_REGNUM)] UNSPECV_SET_TP))] | |
8678 | "" | |
c5aa1d12 UW |
8679 | "") |
8680 | ||
8681 | (define_insn "*set_tp" | |
ae156f85 | 8682 | [(set (reg TP_REGNUM) (unspec_volatile [(reg TP_REGNUM)] UNSPECV_SET_TP))] |
c5aa1d12 UW |
8683 | "" |
8684 | "" | |
8685 | [(set_attr "type" "none") | |
8686 | (set_attr "length" "0")]) | |
c7453384 | 8687 | |
fd3cd001 UW |
8688 | (define_insn "*tls_load_64" |
8689 | [(set (match_operand:DI 0 "register_operand" "=d") | |
fb492564 | 8690 | (unspec:DI [(match_operand:DI 1 "memory_operand" "RT") |
fd3cd001 UW |
8691 | (match_operand:DI 2 "" "")] |
8692 | UNSPEC_TLS_LOAD))] | |
8693 | "TARGET_64BIT" | |
d40c829f | 8694 | "lg\t%0,%1%J2" |
9381e3f1 WG |
8695 | [(set_attr "op_type" "RXE") |
8696 | (set_attr "z10prop" "z10_fwd_A3")]) | |
fd3cd001 UW |
8697 | |
8698 | (define_insn "*tls_load_31" | |
d3632d41 UW |
8699 | [(set (match_operand:SI 0 "register_operand" "=d,d") |
8700 | (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T") | |
fd3cd001 UW |
8701 | (match_operand:SI 2 "" "")] |
8702 | UNSPEC_TLS_LOAD))] | |
8703 | "!TARGET_64BIT" | |
d3632d41 | 8704 | "@ |
d40c829f UW |
8705 | l\t%0,%1%J2 |
8706 | ly\t%0,%1%J2" | |
9381e3f1 | 8707 | [(set_attr "op_type" "RX,RXY") |
cdc15d23 | 8708 | (set_attr "type" "load") |
9381e3f1 | 8709 | (set_attr "z10prop" "z10_fwd_A3,z10_fwd_A3")]) |
fd3cd001 | 8710 | |
9e8327e3 | 8711 | (define_insn "*bras_tls" |
c19ec8f9 | 8712 | [(set (match_operand 0 "" "") |
9e8327e3 UW |
8713 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) |
8714 | (match_operand 2 "const_int_operand" "n"))) | |
8715 | (clobber (match_operand 3 "register_operand" "=r")) | |
8716 | (use (match_operand 4 "" ""))] | |
2f7e5a0d EC |
8717 | "!SIBLING_CALL_P (insn) |
8718 | && TARGET_SMALL_EXEC | |
ed9676cf | 8719 | && GET_MODE (operands[3]) == Pmode" |
d40c829f | 8720 | "bras\t%3,%1%J4" |
fd3cd001 | 8721 | [(set_attr "op_type" "RI") |
65b1d8ea AK |
8722 | (set_attr "type" "jsr") |
8723 | (set_attr "z196prop" "z196_cracked")]) | |
fd3cd001 | 8724 | |
9e8327e3 | 8725 | (define_insn "*brasl_tls" |
c19ec8f9 | 8726 | [(set (match_operand 0 "" "") |
9e8327e3 UW |
8727 | (call (mem:QI (match_operand 1 "bras_sym_operand" "X")) |
8728 | (match_operand 2 "const_int_operand" "n"))) | |
8729 | (clobber (match_operand 3 "register_operand" "=r")) | |
8730 | (use (match_operand 4 "" ""))] | |
2f7e5a0d EC |
8731 | "!SIBLING_CALL_P (insn) |
8732 | && TARGET_CPU_ZARCH | |
ed9676cf | 8733 | && GET_MODE (operands[3]) == Pmode" |
9e8327e3 UW |
8734 | "brasl\t%3,%1%J4" |
8735 | [(set_attr "op_type" "RIL") | |
65b1d8ea AK |
8736 | (set_attr "type" "jsr") |
8737 | (set_attr "z196prop" "z196_cracked")]) | |
fd3cd001 | 8738 | |
9e8327e3 | 8739 | (define_insn "*basr_tls" |
c19ec8f9 | 8740 | [(set (match_operand 0 "" "") |
4fe6dea8 | 8741 | (call (mem:QI (match_operand 1 "address_operand" "ZQZR")) |
9e8327e3 UW |
8742 | (match_operand 2 "const_int_operand" "n"))) |
8743 | (clobber (match_operand 3 "register_operand" "=r")) | |
8744 | (use (match_operand 4 "" ""))] | |
ed9676cf | 8745 | "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode" |
9e8327e3 UW |
8746 | { |
8747 | if (get_attr_op_type (insn) == OP_TYPE_RR) | |
8748 | return "basr\t%3,%1%J4"; | |
8749 | else | |
8750 | return "bas\t%3,%a1%J4"; | |
8751 | } | |
8752 | [(set (attr "op_type") | |
8753 | (if_then_else (match_operand 1 "register_operand" "") | |
8754 | (const_string "RR") (const_string "RX"))) | |
8755 | (set_attr "type" "jsr") | |
65b1d8ea AK |
8756 | (set_attr "atype" "agen") |
8757 | (set_attr "z196prop" "z196_cracked")]) | |
fd3cd001 | 8758 | |
e0374221 AS |
8759 | ;; |
8760 | ;;- Atomic operations | |
8761 | ;; | |
8762 | ||
8763 | ; | |
78ce265b | 8764 | ; memory barrier patterns. |
e0374221 AS |
8765 | ; |
8766 | ||
78ce265b RH |
8767 | (define_expand "mem_signal_fence" |
8768 | [(match_operand:SI 0 "const_int_operand")] ;; model | |
e0374221 AS |
8769 | "" |
8770 | { | |
78ce265b RH |
8771 | /* The s390 memory model is strong enough not to require any |
8772 | barrier in order to synchronize a thread with itself. */ | |
8773 | DONE; | |
8774 | }) | |
8775 | ||
8776 | (define_expand "mem_thread_fence" | |
8777 | [(match_operand:SI 0 "const_int_operand")] ;; model | |
8778 | "" | |
8779 | { | |
8780 | /* Unless this is a SEQ_CST fence, the s390 memory model is strong | |
8781 | enough not to require barriers of any kind. */ | |
8782 | if (INTVAL (operands[0]) == MEMMODEL_SEQ_CST) | |
8783 | { | |
8784 | rtx mem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); | |
8785 | MEM_VOLATILE_P (mem) = 1; | |
8786 | emit_insn (gen_mem_thread_fence_1 (mem)); | |
8787 | } | |
8788 | DONE; | |
e0374221 AS |
8789 | }) |
8790 | ||
78ce265b RH |
8791 | ; Although bcr is superscalar on Z10, this variant will never |
8792 | ; become part of an execution group. | |
8793 | (define_insn "mem_thread_fence_1" | |
e0374221 | 8794 | [(set (match_operand:BLK 0 "" "") |
1a8c13b3 | 8795 | (unspec:BLK [(match_dup 0)] UNSPEC_MB))] |
e0374221 AS |
8796 | "" |
8797 | "bcr\t15,0" | |
8798 | [(set_attr "op_type" "RR")]) | |
1a8c13b3 | 8799 | |
78ce265b RH |
8800 | ; |
8801 | ; atomic load/store operations | |
8802 | ; | |
8803 | ||
8804 | ; Atomic loads need not examine the memory model at all. | |
8805 | (define_expand "atomic_load<mode>" | |
8806 | [(match_operand:DINT 0 "register_operand") ;; output | |
8807 | (match_operand:DINT 1 "memory_operand") ;; memory | |
8808 | (match_operand:SI 2 "const_int_operand")] ;; model | |
8809 | "" | |
8810 | { | |
8811 | if (<MODE>mode == TImode) | |
8812 | emit_insn (gen_atomic_loadti_1 (operands[0], operands[1])); | |
8813 | else if (<MODE>mode == DImode && !TARGET_ZARCH) | |
8814 | emit_insn (gen_atomic_loaddi_1 (operands[0], operands[1])); | |
8815 | else | |
8816 | emit_move_insn (operands[0], operands[1]); | |
8817 | DONE; | |
8818 | }) | |
8819 | ||
8820 | ; Different from movdi_31 in that we want no splitters. | |
8821 | (define_insn "atomic_loaddi_1" | |
8822 | [(set (match_operand:DI 0 "register_operand" "=d,d,!*f,!*f") | |
8823 | (unspec:DI [(match_operand:DI 1 "memory_operand" "Q,S,R,T")] | |
8824 | UNSPEC_MOVA))] | |
8825 | "!TARGET_ZARCH" | |
8826 | "@ | |
8827 | lm\t%0,%M0,%S1 | |
8828 | lmy\t%0,%M0,%S1 | |
8829 | ld\t%0,%1 | |
8830 | ldy\t%0,%1" | |
8831 | [(set_attr "op_type" "RS,RSY,RS,RSY") | |
8832 | (set_attr "type" "lm,lm,floaddf,floaddf")]) | |
8833 | ||
8834 | (define_insn "atomic_loadti_1" | |
8835 | [(set (match_operand:TI 0 "register_operand" "=r") | |
8836 | (unspec:TI [(match_operand:TI 1 "memory_operand" "RT")] | |
8837 | UNSPEC_MOVA))] | |
8838 | "TARGET_ZARCH" | |
8839 | "lpq\t%0,%1" | |
8840 | [(set_attr "op_type" "RXY") | |
8841 | (set_attr "type" "other")]) | |
8842 | ||
8843 | ; Atomic stores must(?) enforce sequential consistency. | |
8844 | (define_expand "atomic_store<mode>" | |
8845 | [(match_operand:DINT 0 "memory_operand") ;; memory | |
8846 | (match_operand:DINT 1 "register_operand") ;; input | |
8847 | (match_operand:SI 2 "const_int_operand")] ;; model | |
8848 | "" | |
8849 | { | |
8850 | enum memmodel model = (enum memmodel) INTVAL (operands[2]); | |
8851 | ||
8852 | if (<MODE>mode == TImode) | |
8853 | emit_insn (gen_atomic_storeti_1 (operands[0], operands[1])); | |
8854 | else if (<MODE>mode == DImode && !TARGET_ZARCH) | |
8855 | emit_insn (gen_atomic_storedi_1 (operands[0], operands[1])); | |
8856 | else | |
8857 | emit_move_insn (operands[0], operands[1]); | |
8858 | if (model == MEMMODEL_SEQ_CST) | |
8859 | emit_insn (gen_mem_thread_fence (operands[2])); | |
8860 | DONE; | |
8861 | }) | |
8862 | ||
8863 | ; Different from movdi_31 in that we want no splitters. | |
8864 | (define_insn "atomic_storedi_1" | |
8865 | [(set (match_operand:DI 0 "memory_operand" "=Q,S,R,T") | |
8866 | (unspec:DI [(match_operand:DI 1 "register_operand" "d,d,!*f,!*f")] | |
8867 | UNSPEC_MOVA))] | |
8868 | "!TARGET_ZARCH" | |
8869 | "@ | |
8870 | stm\t%1,%N1,%S0 | |
8871 | stmy\t%1,%N1,%S0 | |
8872 | std %1,%0 | |
8873 | stdy %1,%0" | |
8874 | [(set_attr "op_type" "RS,RSY,RS,RSY") | |
8875 | (set_attr "type" "stm,stm,fstoredf,fstoredf")]) | |
8876 | ||
8877 | (define_insn "atomic_storeti_1" | |
8878 | [(set (match_operand:TI 0 "memory_operand" "=RT") | |
8879 | (unspec:TI [(match_operand:TI 1 "register_operand" "r")] | |
8880 | UNSPEC_MOVA))] | |
8881 | "TARGET_ZARCH" | |
8882 | "stpq\t%1,%0" | |
8883 | [(set_attr "op_type" "RXY") | |
8884 | (set_attr "type" "other")]) | |
e0374221 AS |
8885 | |
8886 | ; | |
8887 | ; compare and swap patterns. | |
8888 | ; | |
8889 | ||
78ce265b RH |
8890 | (define_expand "atomic_compare_and_swap<mode>" |
8891 | [(match_operand:SI 0 "register_operand") ;; bool success output | |
215770ad | 8892 | (match_operand:DGPR 1 "nonimmediate_operand");; oldval output |
78ce265b RH |
8893 | (match_operand:DGPR 2 "memory_operand") ;; memory |
8894 | (match_operand:DGPR 3 "register_operand") ;; expected intput | |
8895 | (match_operand:DGPR 4 "register_operand") ;; newval intput | |
8896 | (match_operand:SI 5 "const_int_operand") ;; is_weak | |
8897 | (match_operand:SI 6 "const_int_operand") ;; success model | |
8898 | (match_operand:SI 7 "const_int_operand")] ;; failure model | |
8899 | "" | |
8900 | { | |
215770ad UW |
8901 | rtx cc, cmp, output = operands[1]; |
8902 | ||
8903 | if (!register_operand (output, <MODE>mode)) | |
8904 | output = gen_reg_rtx (<MODE>mode); | |
8905 | ||
78ce265b | 8906 | emit_insn (gen_atomic_compare_and_swap<mode>_internal |
215770ad UW |
8907 | (output, operands[2], operands[3], operands[4])); |
8908 | ||
8909 | /* We deliberately accept non-register operands in the predicate | |
8910 | to ensure the write back to the output operand happens *before* | |
8911 | the store-flags code below. This makes it easier for combine | |
8912 | to merge the store-flags code with a potential test-and-branch | |
8913 | pattern following (immediately!) afterwards. */ | |
8914 | if (output != operands[1]) | |
8915 | emit_move_insn (operands[1], output); | |
8916 | ||
78ce265b RH |
8917 | cc = gen_rtx_REG (CCZ1mode, CC_REGNUM); |
8918 | cmp = gen_rtx_EQ (SImode, cc, const0_rtx); | |
8919 | emit_insn (gen_cstorecc4 (operands[0], cmp, cc, const0_rtx)); | |
8920 | DONE; | |
8921 | }) | |
e0374221 | 8922 | |
78ce265b RH |
8923 | (define_expand "atomic_compare_and_swap<mode>" |
8924 | [(match_operand:SI 0 "register_operand") ;; bool success output | |
215770ad | 8925 | (match_operand:HQI 1 "nonimmediate_operand") ;; oldval output |
78ce265b RH |
8926 | (match_operand:HQI 2 "memory_operand") ;; memory |
8927 | (match_operand:HQI 3 "general_operand") ;; expected intput | |
8928 | (match_operand:HQI 4 "general_operand") ;; newval intput | |
8929 | (match_operand:SI 5 "const_int_operand") ;; is_weak | |
8930 | (match_operand:SI 6 "const_int_operand") ;; success model | |
8931 | (match_operand:SI 7 "const_int_operand")] ;; failure model | |
3093f076 | 8932 | "" |
78ce265b RH |
8933 | { |
8934 | s390_expand_cs_hqi (<MODE>mode, operands[0], operands[1], operands[2], | |
8935 | operands[3], operands[4], INTVAL (operands[5])); | |
8936 | DONE; | |
8937 | }) | |
3093f076 | 8938 | |
78ce265b RH |
8939 | (define_expand "atomic_compare_and_swap<mode>_internal" |
8940 | [(parallel | |
8941 | [(set (match_operand:DGPR 0 "register_operand") | |
8942 | (match_operand:DGPR 1 "memory_operand")) | |
8943 | (set (match_dup 1) | |
8944 | (unspec_volatile:DGPR | |
8945 | [(match_dup 1) | |
8946 | (match_operand:DGPR 2 "register_operand") | |
8947 | (match_operand:DGPR 3 "register_operand")] | |
8948 | UNSPECV_CAS)) | |
8949 | (set (reg:CCZ1 CC_REGNUM) | |
8950 | (compare:CCZ1 (match_dup 1) (match_dup 2)))])] | |
8951 | "") | |
8952 | ||
8953 | ; cdsg, csg | |
8954 | (define_insn "*atomic_compare_and_swap<mode>_1" | |
8955 | [(set (match_operand:TDI 0 "register_operand" "=r") | |
8956 | (match_operand:TDI 1 "memory_operand" "+QS")) | |
8006eaa6 | 8957 | (set (match_dup 1) |
78ce265b | 8958 | (unspec_volatile:TDI |
8006eaa6 | 8959 | [(match_dup 1) |
78ce265b RH |
8960 | (match_operand:TDI 2 "register_operand" "0") |
8961 | (match_operand:TDI 3 "register_operand" "r")] | |
8006eaa6 AS |
8962 | UNSPECV_CAS)) |
8963 | (set (reg:CCZ1 CC_REGNUM) | |
8964 | (compare:CCZ1 (match_dup 1) (match_dup 2)))] | |
78ce265b RH |
8965 | "TARGET_ZARCH" |
8966 | "c<td>sg\t%0,%3,%S1" | |
8967 | [(set_attr "op_type" "RSY") | |
8006eaa6 AS |
8968 | (set_attr "type" "sem")]) |
8969 | ||
78ce265b RH |
8970 | ; cds, cdsy |
8971 | (define_insn "*atomic_compare_and_swapdi_2" | |
8972 | [(set (match_operand:DI 0 "register_operand" "=r,r") | |
8973 | (match_operand:DI 1 "memory_operand" "+Q,S")) | |
e0374221 | 8974 | (set (match_dup 1) |
78ce265b RH |
8975 | (unspec_volatile:DI |
8976 | [(match_dup 1) | |
8977 | (match_operand:DI 2 "register_operand" "0,0") | |
8978 | (match_operand:DI 3 "register_operand" "r,r")] | |
8979 | UNSPECV_CAS)) | |
8980 | (set (reg:CCZ1 CC_REGNUM) | |
8981 | (compare:CCZ1 (match_dup 1) (match_dup 2)))] | |
8982 | "!TARGET_ZARCH" | |
8983 | "@ | |
8984 | cds\t%0,%3,%S1 | |
8985 | cdsy\t%0,%3,%S1" | |
8986 | [(set_attr "op_type" "RS,RSY") | |
8987 | (set_attr "type" "sem")]) | |
8988 | ||
8989 | ; cs, csy | |
8990 | (define_insn "*atomic_compare_and_swapsi_3" | |
8991 | [(set (match_operand:SI 0 "register_operand" "=r,r") | |
8992 | (match_operand:SI 1 "memory_operand" "+Q,S")) | |
8993 | (set (match_dup 1) | |
8994 | (unspec_volatile:SI | |
e0374221 | 8995 | [(match_dup 1) |
78ce265b RH |
8996 | (match_operand:SI 2 "register_operand" "0,0") |
8997 | (match_operand:SI 3 "register_operand" "r,r")] | |
e0374221 | 8998 | UNSPECV_CAS)) |
69950452 AS |
8999 | (set (reg:CCZ1 CC_REGNUM) |
9000 | (compare:CCZ1 (match_dup 1) (match_dup 2)))] | |
9381e3f1 | 9001 | "" |
78ce265b RH |
9002 | "@ |
9003 | cs\t%0,%3,%S1 | |
9004 | csy\t%0,%3,%S1" | |
9005 | [(set_attr "op_type" "RS,RSY") | |
e0374221 AS |
9006 | (set_attr "type" "sem")]) |
9007 | ||
45d18331 AS |
9008 | ; |
9009 | ; Other atomic instruction patterns. | |
9010 | ; | |
9011 | ||
65b1d8ea AK |
9012 | ; z196 load and add, xor, or and and instructions |
9013 | ||
78ce265b RH |
9014 | (define_expand "atomic_fetch_<atomic><mode>" |
9015 | [(match_operand:GPR 0 "register_operand") ;; val out | |
9016 | (ATOMIC_Z196:GPR | |
9017 | (match_operand:GPR 1 "memory_operand") ;; memory | |
9018 | (match_operand:GPR 2 "register_operand")) ;; val in | |
9019 | (match_operand:SI 3 "const_int_operand")] ;; model | |
65b1d8ea | 9020 | "TARGET_Z196" |
78ce265b RH |
9021 | { |
9022 | emit_insn (gen_atomic_fetch_<atomic><mode>_iaf | |
9023 | (operands[0], operands[1], operands[2])); | |
9024 | DONE; | |
9025 | }) | |
65b1d8ea AK |
9026 | |
9027 | ; lan, lang, lao, laog, lax, laxg, laa, laag | |
78ce265b RH |
9028 | (define_insn "atomic_fetch_<atomic><mode>_iaf" |
9029 | [(set (match_operand:GPR 0 "register_operand" "=d") | |
9030 | (match_operand:GPR 1 "memory_operand" "+QS")) | |
9031 | (set (match_dup 1) | |
9032 | (unspec_volatile:GPR | |
9033 | [(ATOMIC_Z196:GPR (match_dup 1) | |
9034 | (match_operand:GPR 2 "general_operand" "d"))] | |
9035 | UNSPECV_ATOMIC_OP)) | |
9036 | (clobber (reg:CC CC_REGNUM))] | |
65b1d8ea | 9037 | "TARGET_Z196" |
78ce265b RH |
9038 | "la<noxa><g>\t%0,%2,%1" |
9039 | [(set_attr "op_type" "RSY") | |
9040 | (set_attr "type" "sem")]) | |
65b1d8ea | 9041 | |
78ce265b RH |
9042 | ;; For SImode and larger, the optabs.c code will do just fine in |
9043 | ;; expanding a compare-and-swap loop. For QI/HImode, we can do | |
9044 | ;; better by expanding our own loop. | |
65b1d8ea | 9045 | |
78ce265b RH |
9046 | (define_expand "atomic_<atomic><mode>" |
9047 | [(ATOMIC:HQI | |
9048 | (match_operand:HQI 0 "memory_operand") ;; memory | |
9049 | (match_operand:HQI 1 "general_operand")) ;; val in | |
9050 | (match_operand:SI 2 "const_int_operand")] ;; model | |
45d18331 | 9051 | "" |
78ce265b RH |
9052 | { |
9053 | s390_expand_atomic (<MODE>mode, <CODE>, NULL_RTX, operands[0], | |
9054 | operands[1], false); | |
9055 | DONE; | |
9056 | }) | |
45d18331 | 9057 | |
78ce265b RH |
9058 | (define_expand "atomic_fetch_<atomic><mode>" |
9059 | [(match_operand:HQI 0 "register_operand") ;; val out | |
9060 | (ATOMIC:HQI | |
9061 | (match_operand:HQI 1 "memory_operand") ;; memory | |
9062 | (match_operand:HQI 2 "general_operand")) ;; val in | |
9063 | (match_operand:SI 3 "const_int_operand")] ;; model | |
45d18331 | 9064 | "" |
78ce265b RH |
9065 | { |
9066 | s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1], | |
9067 | operands[2], false); | |
9068 | DONE; | |
9069 | }) | |
9070 | ||
9071 | (define_expand "atomic_<atomic>_fetch<mode>" | |
9072 | [(match_operand:HQI 0 "register_operand") ;; val out | |
9073 | (ATOMIC:HQI | |
9074 | (match_operand:HQI 1 "memory_operand") ;; memory | |
9075 | (match_operand:HQI 2 "general_operand")) ;; val in | |
9076 | (match_operand:SI 3 "const_int_operand")] ;; model | |
9077 | "" | |
9078 | { | |
9079 | s390_expand_atomic (<MODE>mode, <CODE>, operands[0], operands[1], | |
9080 | operands[2], true); | |
9081 | DONE; | |
9082 | }) | |
9083 | ||
9084 | (define_expand "atomic_exchange<mode>" | |
9085 | [(match_operand:HQI 0 "register_operand") ;; val out | |
9086 | (match_operand:HQI 1 "memory_operand") ;; memory | |
9087 | (match_operand:HQI 2 "general_operand") ;; val in | |
9088 | (match_operand:SI 3 "const_int_operand")] ;; model | |
45d18331 | 9089 | "" |
78ce265b RH |
9090 | { |
9091 | s390_expand_atomic (<MODE>mode, SET, operands[0], operands[1], | |
9092 | operands[2], false); | |
9093 | DONE; | |
9094 | }) | |
45d18331 | 9095 | |
9db1d521 HP |
9096 | ;; |
9097 | ;;- Miscellaneous instructions. | |
9098 | ;; | |
9099 | ||
9100 | ; | |
9101 | ; allocate stack instruction pattern(s). | |
9102 | ; | |
9103 | ||
9104 | (define_expand "allocate_stack" | |
ef44a6ff UW |
9105 | [(match_operand 0 "general_operand" "") |
9106 | (match_operand 1 "general_operand" "")] | |
b3d31392 | 9107 | "TARGET_BACKCHAIN" |
9db1d521 | 9108 | { |
ef44a6ff | 9109 | rtx temp = gen_reg_rtx (Pmode); |
9db1d521 | 9110 | |
ef44a6ff UW |
9111 | emit_move_insn (temp, s390_back_chain_rtx ()); |
9112 | anti_adjust_stack (operands[1]); | |
9113 | emit_move_insn (s390_back_chain_rtx (), temp); | |
9db1d521 | 9114 | |
ef44a6ff UW |
9115 | emit_move_insn (operands[0], virtual_stack_dynamic_rtx); |
9116 | DONE; | |
10bbf137 | 9117 | }) |
9db1d521 HP |
9118 | |
9119 | ||
9120 | ; | |
43ab026f | 9121 | ; setjmp instruction pattern. |
9db1d521 HP |
9122 | ; |
9123 | ||
9db1d521 | 9124 | (define_expand "builtin_setjmp_receiver" |
fd7643fb | 9125 | [(match_operand 0 "" "")] |
f314b9b1 | 9126 | "flag_pic" |
9db1d521 | 9127 | { |
585539a1 | 9128 | emit_insn (s390_load_got ()); |
c41c1387 | 9129 | emit_use (pic_offset_table_rtx); |
9db1d521 | 9130 | DONE; |
fd7643fb | 9131 | }) |
9db1d521 | 9132 | |
9db1d521 HP |
9133 | ;; These patterns say how to save and restore the stack pointer. We need not |
9134 | ;; save the stack pointer at function level since we are careful to | |
9135 | ;; preserve the backchain. At block level, we have to restore the backchain | |
9136 | ;; when we restore the stack pointer. | |
9137 | ;; | |
9138 | ;; For nonlocal gotos, we must save both the stack pointer and its | |
9139 | ;; backchain and restore both. Note that in the nonlocal case, the | |
9140 | ;; save area is a memory location. | |
9141 | ||
9142 | (define_expand "save_stack_function" | |
9143 | [(match_operand 0 "general_operand" "") | |
9144 | (match_operand 1 "general_operand" "")] | |
9145 | "" | |
9146 | "DONE;") | |
9147 | ||
9148 | (define_expand "restore_stack_function" | |
9149 | [(match_operand 0 "general_operand" "") | |
9150 | (match_operand 1 "general_operand" "")] | |
9151 | "" | |
9152 | "DONE;") | |
9153 | ||
9154 | (define_expand "restore_stack_block" | |
ef44a6ff UW |
9155 | [(match_operand 0 "register_operand" "") |
9156 | (match_operand 1 "register_operand" "")] | |
b3d31392 | 9157 | "TARGET_BACKCHAIN" |
9db1d521 | 9158 | { |
ef44a6ff UW |
9159 | rtx temp = gen_reg_rtx (Pmode); |
9160 | ||
9161 | emit_move_insn (temp, s390_back_chain_rtx ()); | |
9162 | emit_move_insn (operands[0], operands[1]); | |
9163 | emit_move_insn (s390_back_chain_rtx (), temp); | |
9164 | ||
9165 | DONE; | |
10bbf137 | 9166 | }) |
9db1d521 HP |
9167 | |
9168 | (define_expand "save_stack_nonlocal" | |
9169 | [(match_operand 0 "memory_operand" "") | |
9170 | (match_operand 1 "register_operand" "")] | |
9171 | "" | |
9db1d521 | 9172 | { |
ef44a6ff UW |
9173 | rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); |
9174 | ||
9175 | /* Copy the backchain to the first word, sp to the second and the | |
9176 | literal pool base to the third. */ | |
9177 | ||
9602b6a1 AK |
9178 | rtx save_bc = adjust_address (operands[0], Pmode, 0); |
9179 | rtx save_sp = adjust_address (operands[0], Pmode, GET_MODE_SIZE (Pmode)); | |
9180 | rtx save_bp = adjust_address (operands[0], Pmode, 2 * GET_MODE_SIZE (Pmode)); | |
9181 | ||
b3d31392 | 9182 | if (TARGET_BACKCHAIN) |
9602b6a1 | 9183 | emit_move_insn (save_bc, force_reg (Pmode, s390_back_chain_rtx ())); |
ef44a6ff | 9184 | |
9602b6a1 AK |
9185 | emit_move_insn (save_sp, operands[1]); |
9186 | emit_move_insn (save_bp, base); | |
9db1d521 | 9187 | |
9db1d521 | 9188 | DONE; |
10bbf137 | 9189 | }) |
9db1d521 HP |
9190 | |
9191 | (define_expand "restore_stack_nonlocal" | |
9192 | [(match_operand 0 "register_operand" "") | |
9193 | (match_operand 1 "memory_operand" "")] | |
9194 | "" | |
9db1d521 | 9195 | { |
490ceeb4 | 9196 | rtx base = gen_rtx_REG (Pmode, BASE_REGNUM); |
ef44a6ff | 9197 | rtx temp = NULL_RTX; |
9db1d521 | 9198 | |
43ab026f | 9199 | /* Restore the backchain from the first word, sp from the second and the |
ff482c8d | 9200 | literal pool base from the third. */ |
43ab026f | 9201 | |
9602b6a1 AK |
9202 | rtx save_bc = adjust_address (operands[1], Pmode, 0); |
9203 | rtx save_sp = adjust_address (operands[1], Pmode, GET_MODE_SIZE (Pmode)); | |
9204 | rtx save_bp = adjust_address (operands[1], Pmode, 2 * GET_MODE_SIZE (Pmode)); | |
9205 | ||
b3d31392 | 9206 | if (TARGET_BACKCHAIN) |
9602b6a1 | 9207 | temp = force_reg (Pmode, save_bc); |
9381e3f1 | 9208 | |
9602b6a1 AK |
9209 | emit_move_insn (base, save_bp); |
9210 | emit_move_insn (operands[0], save_sp); | |
ef44a6ff UW |
9211 | |
9212 | if (temp) | |
9213 | emit_move_insn (s390_back_chain_rtx (), temp); | |
9214 | ||
c41c1387 | 9215 | emit_use (base); |
9db1d521 | 9216 | DONE; |
10bbf137 | 9217 | }) |
9db1d521 | 9218 | |
7bcebb25 AK |
9219 | (define_expand "exception_receiver" |
9220 | [(const_int 0)] | |
9221 | "" | |
9222 | { | |
9223 | s390_set_has_landing_pad_p (true); | |
9224 | DONE; | |
9225 | }) | |
9db1d521 HP |
9226 | |
9227 | ; | |
9228 | ; nop instruction pattern(s). | |
9229 | ; | |
9230 | ||
9231 | (define_insn "nop" | |
9232 | [(const_int 0)] | |
9233 | "" | |
d40c829f | 9234 | "lr\t0,0" |
729e750f WG |
9235 | [(set_attr "op_type" "RR") |
9236 | (set_attr "z10prop" "z10_fr_E1")]) | |
9db1d521 | 9237 | |
d277db6b WG |
9238 | (define_insn "nop1" |
9239 | [(const_int 1)] | |
9240 | "" | |
9241 | "lr\t1,1" | |
9242 | [(set_attr "op_type" "RR")]) | |
9243 | ||
9db1d521 HP |
9244 | |
9245 | ; | |
9246 | ; Special literal pool access instruction pattern(s). | |
9247 | ; | |
9248 | ||
416cf582 UW |
9249 | (define_insn "*pool_entry" |
9250 | [(unspec_volatile [(match_operand 0 "consttable_operand" "X")] | |
9251 | UNSPECV_POOL_ENTRY)] | |
9db1d521 | 9252 | "" |
9db1d521 | 9253 | { |
416cf582 UW |
9254 | enum machine_mode mode = GET_MODE (PATTERN (insn)); |
9255 | unsigned int align = GET_MODE_BITSIZE (mode); | |
faeb9bb6 | 9256 | s390_output_pool_entry (operands[0], mode, align); |
fd7643fb UW |
9257 | return ""; |
9258 | } | |
b628bd8e | 9259 | [(set (attr "length") |
416cf582 | 9260 | (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))]) |
b2ccb744 | 9261 | |
9bb86f41 UW |
9262 | (define_insn "pool_align" |
9263 | [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] | |
9264 | UNSPECV_POOL_ALIGN)] | |
9265 | "" | |
9266 | ".align\t%0" | |
b628bd8e | 9267 | [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) |
b2ccb744 | 9268 | |
9bb86f41 UW |
9269 | (define_insn "pool_section_start" |
9270 | [(unspec_volatile [(const_int 1)] UNSPECV_POOL_SECTION)] | |
9271 | "" | |
9272 | ".section\t.rodata" | |
b628bd8e | 9273 | [(set_attr "length" "0")]) |
b2ccb744 | 9274 | |
9bb86f41 UW |
9275 | (define_insn "pool_section_end" |
9276 | [(unspec_volatile [(const_int 0)] UNSPECV_POOL_SECTION)] | |
9277 | "" | |
b2ccb744 | 9278 | ".previous" |
b628bd8e | 9279 | [(set_attr "length" "0")]) |
b2ccb744 | 9280 | |
5af2f3d3 | 9281 | (define_insn "main_base_31_small" |
9e8327e3 UW |
9282 | [(set (match_operand 0 "register_operand" "=a") |
9283 | (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))] | |
9284 | "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" | |
5af2f3d3 UW |
9285 | "basr\t%0,0" |
9286 | [(set_attr "op_type" "RR") | |
65b1d8ea AK |
9287 | (set_attr "type" "la") |
9288 | (set_attr "z196prop" "z196_cracked")]) | |
5af2f3d3 UW |
9289 | |
9290 | (define_insn "main_base_31_large" | |
9e8327e3 UW |
9291 | [(set (match_operand 0 "register_operand" "=a") |
9292 | (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE)) | |
5af2f3d3 | 9293 | (set (pc) (label_ref (match_operand 2 "" "")))] |
9e8327e3 | 9294 | "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" |
5af2f3d3 | 9295 | "bras\t%0,%2" |
65b1d8ea AK |
9296 | [(set_attr "op_type" "RI") |
9297 | (set_attr "z196prop" "z196_cracked")]) | |
5af2f3d3 UW |
9298 | |
9299 | (define_insn "main_base_64" | |
9e8327e3 UW |
9300 | [(set (match_operand 0 "register_operand" "=a") |
9301 | (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))] | |
9302 | "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" | |
5af2f3d3 UW |
9303 | "larl\t%0,%1" |
9304 | [(set_attr "op_type" "RIL") | |
9381e3f1 | 9305 | (set_attr "type" "larl") |
729e750f | 9306 | (set_attr "z10prop" "z10_fwd_A1")]) |
5af2f3d3 UW |
9307 | |
9308 | (define_insn "main_pool" | |
585539a1 UW |
9309 | [(set (match_operand 0 "register_operand" "=a") |
9310 | (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))] | |
9311 | "GET_MODE (operands[0]) == Pmode" | |
8d933e31 AS |
9312 | { |
9313 | gcc_unreachable (); | |
9314 | } | |
9381e3f1 | 9315 | [(set (attr "type") |
d7f99b2c | 9316 | (if_then_else (match_test "TARGET_CPU_ZARCH") |
ea77e738 | 9317 | (const_string "larl") (const_string "la")))]) |
5af2f3d3 | 9318 | |
aee4e0db | 9319 | (define_insn "reload_base_31" |
9e8327e3 UW |
9320 | [(set (match_operand 0 "register_operand" "=a") |
9321 | (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))] | |
9322 | "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" | |
d40c829f | 9323 | "basr\t%0,0\;la\t%0,%1-.(%0)" |
b628bd8e | 9324 | [(set_attr "length" "6") |
65b1d8ea AK |
9325 | (set_attr "type" "la") |
9326 | (set_attr "z196prop" "z196_cracked")]) | |
b2ccb744 | 9327 | |
aee4e0db | 9328 | (define_insn "reload_base_64" |
9e8327e3 UW |
9329 | [(set (match_operand 0 "register_operand" "=a") |
9330 | (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))] | |
9331 | "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode" | |
d40c829f | 9332 | "larl\t%0,%1" |
aee4e0db | 9333 | [(set_attr "op_type" "RIL") |
9381e3f1 | 9334 | (set_attr "type" "larl") |
729e750f | 9335 | (set_attr "z10prop" "z10_fwd_A1")]) |
aee4e0db | 9336 | |
aee4e0db | 9337 | (define_insn "pool" |
fd7643fb | 9338 | [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)] |
aee4e0db | 9339 | "" |
8d933e31 AS |
9340 | { |
9341 | gcc_unreachable (); | |
9342 | } | |
b628bd8e | 9343 | [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) |
9db1d521 | 9344 | |
4023fb28 UW |
9345 | ;; |
9346 | ;; Insns related to generating the function prologue and epilogue. | |
9347 | ;; | |
9348 | ||
9349 | ||
9350 | (define_expand "prologue" | |
9351 | [(use (const_int 0))] | |
9352 | "" | |
10bbf137 | 9353 | "s390_emit_prologue (); DONE;") |
4023fb28 UW |
9354 | |
9355 | (define_expand "epilogue" | |
9356 | [(use (const_int 1))] | |
9357 | "" | |
ed9676cf AK |
9358 | "s390_emit_epilogue (false); DONE;") |
9359 | ||
9360 | (define_expand "sibcall_epilogue" | |
9361 | [(use (const_int 0))] | |
9362 | "" | |
9363 | "s390_emit_epilogue (true); DONE;") | |
4023fb28 | 9364 | |
9e8327e3 | 9365 | (define_insn "*return" |
4023fb28 | 9366 | [(return) |
9e8327e3 UW |
9367 | (use (match_operand 0 "register_operand" "a"))] |
9368 | "GET_MODE (operands[0]) == Pmode" | |
d40c829f | 9369 | "br\t%0" |
4023fb28 | 9370 | [(set_attr "op_type" "RR") |
c7453384 | 9371 | (set_attr "type" "jsr") |
077dab3b | 9372 | (set_attr "atype" "agen")]) |
4023fb28 | 9373 | |
4023fb28 | 9374 | |
c7453384 | 9375 | ;; Instruction definition to extend a 31-bit pointer into a 64-bit |
839a4992 | 9376 | ;; pointer. This is used for compatibility. |
c7453384 EC |
9377 | |
9378 | (define_expand "ptr_extend" | |
9379 | [(set (match_operand:DI 0 "register_operand" "=r") | |
9380 | (match_operand:SI 1 "register_operand" "r"))] | |
9e8327e3 | 9381 | "TARGET_64BIT" |
c7453384 | 9382 | { |
c7453384 EC |
9383 | emit_insn (gen_anddi3 (operands[0], |
9384 | gen_lowpart (DImode, operands[1]), | |
9385 | GEN_INT (0x7fffffff))); | |
c7453384 | 9386 | DONE; |
10bbf137 | 9387 | }) |
4798630c D |
9388 | |
9389 | ;; Instruction definition to expand eh_return macro to support | |
9390 | ;; swapping in special linkage return addresses. | |
9391 | ||
9392 | (define_expand "eh_return" | |
9393 | [(use (match_operand 0 "register_operand" ""))] | |
9394 | "TARGET_TPF" | |
9395 | { | |
9396 | s390_emit_tpf_eh_return (operands[0]); | |
9397 | DONE; | |
9398 | }) | |
9399 | ||
7b8acc34 AK |
9400 | ; |
9401 | ; Stack Protector Patterns | |
9402 | ; | |
9403 | ||
9404 | (define_expand "stack_protect_set" | |
9405 | [(set (match_operand 0 "memory_operand" "") | |
9406 | (match_operand 1 "memory_operand" ""))] | |
9407 | "" | |
9408 | { | |
9409 | #ifdef TARGET_THREAD_SSP_OFFSET | |
9410 | operands[1] | |
9411 | = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), | |
9412 | GEN_INT (TARGET_THREAD_SSP_OFFSET))); | |
9413 | #endif | |
9414 | if (TARGET_64BIT) | |
9415 | emit_insn (gen_stack_protect_setdi (operands[0], operands[1])); | |
9416 | else | |
9417 | emit_insn (gen_stack_protect_setsi (operands[0], operands[1])); | |
9418 | ||
9419 | DONE; | |
9420 | }) | |
9421 | ||
9422 | (define_insn "stack_protect_set<mode>" | |
9423 | [(set (match_operand:DSI 0 "memory_operand" "=Q") | |
9424 | (unspec:DSI [(match_operand:DSI 1 "memory_operand" "Q")] UNSPEC_SP_SET))] | |
9425 | "" | |
9426 | "mvc\t%O0(%G0,%R0),%S1" | |
9427 | [(set_attr "op_type" "SS")]) | |
9428 | ||
9429 | (define_expand "stack_protect_test" | |
9430 | [(set (reg:CC CC_REGNUM) | |
9431 | (compare (match_operand 0 "memory_operand" "") | |
9432 | (match_operand 1 "memory_operand" ""))) | |
9433 | (match_operand 2 "" "")] | |
9434 | "" | |
9435 | { | |
f90b7a5a | 9436 | rtx cc_reg, test; |
7b8acc34 AK |
9437 | #ifdef TARGET_THREAD_SSP_OFFSET |
9438 | operands[1] | |
9439 | = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, s390_get_thread_pointer (), | |
9440 | GEN_INT (TARGET_THREAD_SSP_OFFSET))); | |
9441 | #endif | |
7b8acc34 AK |
9442 | if (TARGET_64BIT) |
9443 | emit_insn (gen_stack_protect_testdi (operands[0], operands[1])); | |
9444 | else | |
9445 | emit_insn (gen_stack_protect_testsi (operands[0], operands[1])); | |
9446 | ||
f90b7a5a PB |
9447 | cc_reg = gen_rtx_REG (CCZmode, CC_REGNUM); |
9448 | test = gen_rtx_EQ (VOIDmode, cc_reg, const0_rtx); | |
9449 | emit_jump_insn (gen_cbranchcc4 (test, cc_reg, const0_rtx, operands[2])); | |
7b8acc34 AK |
9450 | DONE; |
9451 | }) | |
9452 | ||
9453 | (define_insn "stack_protect_test<mode>" | |
9454 | [(set (reg:CCZ CC_REGNUM) | |
9455 | (unspec:CCZ [(match_operand:DSI 0 "memory_operand" "Q") | |
9456 | (match_operand:DSI 1 "memory_operand" "Q")] UNSPEC_SP_TEST))] | |
9457 | "" | |
9458 | "clc\t%O0(%G0,%R0),%S1" | |
9459 | [(set_attr "op_type" "SS")]) | |
12959abe AK |
9460 | |
9461 | ; This is used in s390_emit_prologue in order to prevent insns | |
9462 | ; adjusting the stack pointer to be moved over insns writing stack | |
9463 | ; slots using a copy of the stack pointer in a different register. | |
9464 | (define_insn "stack_tie" | |
9465 | [(set (match_operand:BLK 0 "memory_operand" "+m") | |
9466 | (unspec:BLK [(match_dup 0)] UNSPEC_TIE))] | |
9467 | "" | |
9468 | "" | |
9469 | [(set_attr "length" "0")]) | |
963fc8d0 AK |
9470 | |
9471 | ||
9472 | ; | |
9473 | ; Data prefetch patterns | |
9474 | ; | |
9475 | ||
9476 | (define_insn "prefetch" | |
22d72dbc AK |
9477 | [(prefetch (match_operand 0 "address_operand" "ZQZRZSZT,X") |
9478 | (match_operand:SI 1 "const_int_operand" " n,n") | |
9479 | (match_operand:SI 2 "const_int_operand" " n,n"))] | |
9480 | "TARGET_Z10" | |
963fc8d0 | 9481 | { |
4fe6dea8 AK |
9482 | switch (which_alternative) |
9483 | { | |
9484 | case 0: | |
4fe6dea8 | 9485 | return INTVAL (operands[1]) == 1 ? "pfd\t2,%a0" : "pfd\t1,%a0"; |
22d72dbc | 9486 | case 1: |
4fe6dea8 AK |
9487 | if (larl_operand (operands[0], Pmode)) |
9488 | return INTVAL (operands[1]) == 1 ? "pfdrl\t2,%a0" : "pfdrl\t1,%a0"; | |
9489 | default: | |
9490 | ||
9491 | /* This might be reached for symbolic operands with an odd | |
9492 | addend. We simply omit the prefetch for such rare cases. */ | |
9493 | ||
9494 | return ""; | |
9495 | } | |
9381e3f1 | 9496 | } |
22d72dbc AK |
9497 | [(set_attr "type" "load,larl") |
9498 | (set_attr "op_type" "RXY,RIL") | |
65b1d8ea AK |
9499 | (set_attr "z10prop" "z10_super") |
9500 | (set_attr "z196prop" "z196_alone")]) | |
07da44ab AK |
9501 | |
9502 | ||
9503 | ; | |
9504 | ; Byte swap instructions | |
9505 | ; | |
9506 | ||
9507 | (define_insn "bswap<mode>2" | |
9508 | [(set (match_operand:GPR 0 "register_operand" "=d, d") | |
9509 | (bswap:GPR (match_operand:GPR 1 "nonimmediate_operand" " d,RT")))] | |
677fbff4 | 9510 | "TARGET_CPU_ZARCH" |
07da44ab AK |
9511 | "@ |
9512 | lrv<g>r\t%0,%1 | |
9513 | lrv<g>\t%0,%1" | |
9514 | [(set_attr "type" "*,load") | |
9515 | (set_attr "op_type" "RRE,RXY") | |
9516 | (set_attr "z10prop" "z10_super")]) | |
65b1d8ea AK |
9517 | |
9518 | ||
9519 | ; | |
9520 | ; Population count instruction | |
9521 | ; | |
9522 | ||
9523 | ; The S/390 popcount instruction counts the bits of op1 in 8 byte | |
9524 | ; portions and stores the result in the corresponding bytes in op0. | |
9525 | (define_insn "*popcount<mode>" | |
9526 | [(set (match_operand:INT 0 "register_operand" "=d") | |
9527 | (unspec:INT [(match_operand:INT 1 "register_operand" "d")] UNSPEC_POPCNT)) | |
9528 | (clobber (reg:CC CC_REGNUM))] | |
9529 | "TARGET_Z196" | |
9530 | "popcnt\t%0,%1" | |
9531 | [(set_attr "op_type" "RRE")]) | |
9532 | ||
9533 | (define_expand "popcountdi2" | |
9534 | [; popcnt op0, op1 | |
9535 | (parallel [(set (match_operand:DI 0 "register_operand" "") | |
9536 | (unspec:DI [(match_operand:DI 1 "register_operand")] | |
9537 | UNSPEC_POPCNT)) | |
9538 | (clobber (reg:CC CC_REGNUM))]) | |
9539 | ; sllg op2, op0, 32 | |
9540 | (set (match_dup 2) (ashift:DI (match_dup 0) (const_int 32))) | |
9541 | ; agr op0, op2 | |
9542 | (parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2))) | |
9543 | (clobber (reg:CC CC_REGNUM))]) | |
9544 | ; sllg op2, op0, 16 | |
17465c6e | 9545 | (set (match_dup 2) |
65b1d8ea AK |
9546 | (ashift:DI (match_dup 0) (const_int 16))) |
9547 | ; agr op0, op2 | |
9548 | (parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2))) | |
9549 | (clobber (reg:CC CC_REGNUM))]) | |
9550 | ; sllg op2, op0, 8 | |
9551 | (set (match_dup 2) (ashift:DI (match_dup 0) (const_int 8))) | |
9552 | ; agr op0, op2 | |
9553 | (parallel [(set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2))) | |
9554 | (clobber (reg:CC CC_REGNUM))]) | |
9555 | ; srlg op0, op0, 56 | |
9556 | (set (match_dup 0) (lshiftrt:DI (match_dup 0) (const_int 56)))] | |
9557 | "TARGET_Z196 && TARGET_64BIT" | |
9558 | "operands[2] = gen_reg_rtx (DImode);") | |
9559 | ||
9560 | (define_expand "popcountsi2" | |
9561 | [; popcnt op0, op1 | |
9562 | (parallel [(set (match_operand:SI 0 "register_operand" "") | |
9563 | (unspec:SI [(match_operand:SI 1 "register_operand")] | |
9564 | UNSPEC_POPCNT)) | |
9565 | (clobber (reg:CC CC_REGNUM))]) | |
9566 | ; sllk op2, op0, 16 | |
17465c6e | 9567 | (set (match_dup 2) |
65b1d8ea AK |
9568 | (ashift:SI (match_dup 0) (const_int 16))) |
9569 | ; ar op0, op2 | |
9570 | (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2))) | |
9571 | (clobber (reg:CC CC_REGNUM))]) | |
9572 | ; sllk op2, op0, 8 | |
9573 | (set (match_dup 2) (ashift:SI (match_dup 0) (const_int 8))) | |
9574 | ; ar op0, op2 | |
9575 | (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2))) | |
9576 | (clobber (reg:CC CC_REGNUM))]) | |
9577 | ; srl op0, op0, 24 | |
9578 | (set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 24)))] | |
9579 | "TARGET_Z196" | |
9580 | "operands[2] = gen_reg_rtx (SImode);") | |
9581 | ||
9582 | (define_expand "popcounthi2" | |
9583 | [; popcnt op0, op1 | |
9584 | (parallel [(set (match_operand:HI 0 "register_operand" "") | |
9585 | (unspec:HI [(match_operand:HI 1 "register_operand")] | |
9586 | UNSPEC_POPCNT)) | |
9587 | (clobber (reg:CC CC_REGNUM))]) | |
9588 | ; sllk op2, op0, 8 | |
17465c6e | 9589 | (set (match_dup 2) |
65b1d8ea AK |
9590 | (ashift:SI (match_dup 0) (const_int 8))) |
9591 | ; ar op0, op2 | |
9592 | (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2))) | |
9593 | (clobber (reg:CC CC_REGNUM))]) | |
9594 | ; srl op0, op0, 8 | |
9595 | (set (match_dup 0) (lshiftrt:HI (match_dup 0) (const_int 8)))] | |
9596 | "TARGET_Z196" | |
9597 | "operands[2] = gen_reg_rtx (SImode);") | |
9598 | ||
9599 | (define_expand "popcountqi2" | |
9600 | [; popcnt op0, op1 | |
9601 | (parallel [(set (match_operand:QI 0 "register_operand" "") | |
9602 | (unspec:QI [(match_operand:QI 1 "register_operand")] | |
9603 | UNSPEC_POPCNT)) | |
9604 | (clobber (reg:CC CC_REGNUM))])] | |
9605 | "TARGET_Z196" | |
9606 | "") | |
9607 | ||
9608 | ;; | |
9609 | ;;- Copy sign instructions | |
9610 | ;; | |
9611 | ||
9612 | (define_insn "copysign<mode>3" | |
9613 | [(set (match_operand:FP 0 "register_operand" "=f") | |
9614 | (unspec:FP [(match_operand:FP 1 "register_operand" "<fT0>") | |
9615 | (match_operand:FP 2 "register_operand" "f")] | |
9616 | UNSPEC_COPYSIGN))] | |
9617 | "TARGET_Z196" | |
9618 | "cpsdr\t%0,%2,%1" | |
9619 | [(set_attr "op_type" "RRF") | |
9620 | (set_attr "type" "fsimp<mode>")]) |