1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3 ;; Free Software Foundation, Inc.
4 ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and
5 ;; Ulrich Weigand (uweigand@de.ibm.com).
7 ;; This file is part of GCC.
9 ;; GCC is free software; you can redistribute it and/or modify it under
10 ;; the terms of the GNU General Public License as published by the Free
11 ;; Software Foundation; either version 2, or (at your option) any later
14 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GCC; see the file COPYING. If not, write to the Free
21 ;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 ;; Special constraints for s/390 machine description:
27 ;; a -- Any address register from 1 to 15.
28 ;; c -- Condition code register 33.
29 ;; d -- Any register from 0 to 15.
30 ;; I -- An 8-bit constant (0..255).
31 ;; J -- A 12-bit constant (0..4095).
32 ;; K -- A 16-bit constant (-32768..32767).
33 ;; L -- Value appropriate as displacement.
34 ;; (0..4095) for short displacement
35 ;; (-524288..524287) for long displacement
36 ;; M -- Constant integer with a value of 0x7fffffff.
37 ;; N -- Multiple letter constraint followed by 4 parameter letters.
38 ;; 0..9,x: number of the part counting from most to least significant
39 ;; H,Q: mode of the part
40 ;; D,S,H: mode of the containing operand
41 ;; 0,F: value of the other parts (F - all bits set)
43 ;; The constraint matches if the specified part of a constant
44 ;; has a value different from its other parts. If the letter x
45 ;; is specified instead of a part number, the constraint matches
46 ;; if there is any single part with non-default value.
47 ;; Q -- Memory reference without index register and with short displacement.
48 ;; R -- Memory reference with index register and short displacement.
49 ;; S -- Memory reference without index register but with long displacement.
50 ;; T -- Memory reference with index register and long displacement.
51 ;; A -- Multiple letter constraint followed by Q, R, S, or T:
52 ;; Offsettable memory reference of type specified by second letter.
53 ;; B -- Multiple letter constraint followed by Q, R, S, or T:
54 ;; Memory reference of the type specified by second letter that
55 ;; does *not* refer to a literal pool entry.
56 ;; U -- Pointer with short displacement.
57 ;; W -- Pointer with long displacement.
58 ;; Y -- Shift count operand.
60 ;; Special formats used for outputting 390 instructions.
62 ;; %C: print opcode suffix for branch condition.
63 ;; %D: print opcode suffix for inverse branch condition.
64 ;; %J: print tls_load/tls_gdcall/tls_ldcall suffix
65 ;; %O: print only the displacement of a memory reference.
66 ;; %R: print only the base register of a memory reference.
67 ;; %S: print S-type memory reference (base+displacement).
68 ;; %N: print the second word of a DImode operand.
69 ;; %M: print the second word of a TImode operand.
71 ;; %b: print integer X as if it's an unsigned byte.
72 ;; %x: print integer X as if it's an unsigned word.
73 ;; %h: print integer X as if it's a signed word.
74 ;; %i: print the first nonzero HImode part of X
75 ;; %j: print the first HImode part unequal to 0xffff of X
78 ;; We have a special constraint for pattern matching.
80 ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
93 ; GOT/PLT and lt-relative accesses
94 (UNSPEC_LTREL_OFFSET 100)
95 (UNSPEC_LTREL_BASE 101)
103 (UNSPEC_RELOAD_BASE 210)
104 (UNSPEC_MAIN_BASE 211)
109 ; TLS relocation specifiers
114 (UNSPEC_GOTNTPOFF 504)
115 (UNSPEC_INDNTPOFF 505)
118 (UNSPEC_TLSLDM_NTPOFF 511)
119 (UNSPEC_TLS_LOAD 512)
126 ;; UNSPEC_VOLATILE usage
134 (UNSPECV_TPF_PROLOGUE 20)
135 (UNSPECV_TPF_EPILOGUE 21)
139 (UNSPECV_POOL_SECTION 201)
140 (UNSPECV_POOL_ALIGN 202)
141 (UNSPECV_POOL_ENTRY 203)
142 (UNSPECV_MAIN_POOL 300)
149 ;; Instruction operand type as used in the Principles of Operation.
150 ;; Used to determine defaults for length and other attribute values.
152 (define_attr "op_type"
153 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
156 ;; Instruction type attribute used for scheduling.
158 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
160 imulhi,imulsi,imuldi,
161 branch,jsr,fsimpd,fsimps,
162 floadd,floads,fstored, fstores,
163 fmuld,fmuls,fdivd,fdivs,
164 ftoi,itof,fsqrtd,fsqrts,
166 (cond [(eq_attr "op_type" "NN") (const_string "other")
167 (eq_attr "op_type" "SS") (const_string "cs")]
168 (const_string "integer")))
170 ;; Another attribute used for scheduling purposes:
171 ;; agen: Instruction uses the address generation unit
172 ;; reg: Instruction does not use the agen unit
174 (define_attr "atype" "agen,reg"
175 (cond [(eq_attr "op_type" "E") (const_string "reg")
176 (eq_attr "op_type" "RR") (const_string "reg")
177 (eq_attr "op_type" "RX") (const_string "agen")
178 (eq_attr "op_type" "RI") (const_string "reg")
179 (eq_attr "op_type" "RRE") (const_string "reg")
180 (eq_attr "op_type" "RS") (const_string "agen")
181 (eq_attr "op_type" "RSI") (const_string "agen")
182 (eq_attr "op_type" "S") (const_string "agen")
183 (eq_attr "op_type" "SI") (const_string "agen")
184 (eq_attr "op_type" "SS") (const_string "agen")
185 (eq_attr "op_type" "SSE") (const_string "agen")
186 (eq_attr "op_type" "RXE") (const_string "agen")
187 (eq_attr "op_type" "RSE") (const_string "agen")
188 (eq_attr "op_type" "RIL") (const_string "agen")
189 (eq_attr "op_type" "RXY") (const_string "agen")
190 (eq_attr "op_type" "RSY") (const_string "agen")
191 (eq_attr "op_type" "SIY") (const_string "agen")]
192 (const_string "agen")))
196 (define_attr "length" ""
197 (cond [(eq_attr "op_type" "E") (const_int 2)
198 (eq_attr "op_type" "RR") (const_int 2)
199 (eq_attr "op_type" "RX") (const_int 4)
200 (eq_attr "op_type" "RI") (const_int 4)
201 (eq_attr "op_type" "RRE") (const_int 4)
202 (eq_attr "op_type" "RS") (const_int 4)
203 (eq_attr "op_type" "RSI") (const_int 4)
204 (eq_attr "op_type" "S") (const_int 4)
205 (eq_attr "op_type" "SI") (const_int 4)
206 (eq_attr "op_type" "SS") (const_int 6)
207 (eq_attr "op_type" "SSE") (const_int 6)
208 (eq_attr "op_type" "RXE") (const_int 6)
209 (eq_attr "op_type" "RSE") (const_int 6)
210 (eq_attr "op_type" "RIL") (const_int 6)
211 (eq_attr "op_type" "RXY") (const_int 6)
212 (eq_attr "op_type" "RSY") (const_int 6)
213 (eq_attr "op_type" "SIY") (const_int 6)]
217 ;; Processor type. This attribute must exactly match the processor_type
218 ;; enumeration in s390.h. The current machine description does not
219 ;; distinguish between g5 and g6, but there are differences between the two
220 ;; CPUs could in theory be modeled.
222 (define_attr "cpu" "g5,g6,z900,z990"
223 (const (symbol_ref "s390_tune")))
225 ;; Pipeline description for z900. For lack of anything better,
226 ;; this description is also used for the g5 and g6.
229 ;; Pipeline description for z990.
233 (include "predicates.md")
238 ;; This mode macro allows 31-bit and 64-bit GPR patterns to be generated
239 ;; from the same template.
240 (define_mode_macro GPR [(DI "TARGET_64BIT") SI])
242 ;; This mode macro allows :P to be used for patterns that operate on
243 ;; pointer-sized quantities. Exactly one of the two alternatives will match.
244 (define_mode_macro P [(DI "TARGET_64BIT") (SI "!TARGET_64BIT")])
246 ;; This mode macro allows the QI and HI patterns to be defined from
247 ;; the same template.
248 (define_mode_macro HQI [HI QI])
250 ;; This mode macro allows the integer patterns to be defined from the
252 (define_mode_macro INT [(DI "TARGET_64BIT") SI HI QI])
254 ;; This macro allows to unify all 'bCOND' expander patterns.
255 (define_code_macro COMPARE [eq ne gt gtu lt ltu ge geu le leu unordered
256 ordered uneq unlt ungt unle unge ltgt])
259 ;; ICM mask required to load MODE value into the highest subreg
260 ;; of a SImode register.
261 (define_mode_attr icm_hi [(HI "12") (QI "8")])
263 ;; ICM mask required to load MODE value into the lowest subreg
264 ;; of a SImode register.
265 (define_mode_attr icm_lo [(HI "3") (QI "1")])
267 ;; Maximum unsigned integer that fits in MODE.
268 (define_mode_attr max_uint [(HI "65535") (QI "255")])
272 ;;- Compare instructions.
275 (define_expand "cmp<mode>"
277 (compare:CC (match_operand:GPR 0 "register_operand" "")
278 (match_operand:GPR 1 "general_operand" "")))]
281 s390_compare_op0 = operands[0];
282 s390_compare_op1 = operands[1];
286 (define_expand "cmpdf"
288 (compare:CC (match_operand:DF 0 "register_operand" "")
289 (match_operand:DF 1 "general_operand" "")))]
292 s390_compare_op0 = operands[0];
293 s390_compare_op1 = operands[1];
297 (define_expand "cmpsf"
299 (compare:CC (match_operand:SF 0 "register_operand" "")
300 (match_operand:SF 1 "general_operand" "")))]
303 s390_compare_op0 = operands[0];
304 s390_compare_op1 = operands[1];
309 ; Test-under-Mask instructions
311 (define_insn "*tmqi_mem"
313 (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S")
314 (match_operand:QI 1 "immediate_operand" "n,n"))
315 (match_operand:QI 2 "immediate_operand" "n,n")))]
316 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
320 [(set_attr "op_type" "SI,SIY")])
322 (define_insn "*tmdi_reg"
324 (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d")
325 (match_operand:DI 1 "immediate_operand"
326 "N0HD0,N1HD0,N2HD0,N3HD0"))
327 (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
329 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
330 && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
336 [(set_attr "op_type" "RI")])
338 (define_insn "*tmsi_reg"
340 (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
341 (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
342 (match_operand:SI 2 "immediate_operand" "n,n")))]
343 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
344 && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
348 [(set_attr "op_type" "RI")])
350 (define_insn "*tm<mode>_full"
352 (compare (match_operand:HQI 0 "register_operand" "d")
353 (match_operand:HQI 1 "immediate_operand" "n")))]
354 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
356 [(set_attr "op_type" "RI")])
359 ; Load-and-Test instructions
361 (define_insn "*tstdi_sign"
363 (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
364 (const_int 32)) (const_int 32))
365 (match_operand:DI 1 "const0_operand" "")))
366 (set (match_operand:DI 2 "register_operand" "=d")
367 (sign_extend:DI (match_dup 0)))]
368 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
370 [(set_attr "op_type" "RRE")])
372 (define_insn "*tstdi"
374 (compare (match_operand:DI 0 "register_operand" "d")
375 (match_operand:DI 1 "const0_operand" "")))
376 (set (match_operand:DI 2 "register_operand" "=d")
378 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
380 [(set_attr "op_type" "RRE")])
382 (define_insn "*tstdi_cconly"
384 (compare (match_operand:DI 0 "register_operand" "d")
385 (match_operand:DI 1 "const0_operand" "")))]
386 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
388 [(set_attr "op_type" "RRE")])
390 (define_insn "*tstdi_cconly_31"
392 (compare (match_operand:DI 0 "register_operand" "d")
393 (match_operand:DI 1 "const0_operand" "")))]
394 "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
396 [(set_attr "op_type" "RS")
397 (set_attr "atype" "reg")])
400 (define_insn "*tstsi"
402 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
403 (match_operand:SI 1 "const0_operand" "")))
404 (set (match_operand:SI 2 "register_operand" "=d,d,d")
406 "s390_match_ccmode(insn, CCSmode)"
411 [(set_attr "op_type" "RR,RS,RSY")])
413 (define_insn "*tstsi_cconly"
415 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
416 (match_operand:SI 1 "const0_operand" "")))
417 (clobber (match_scratch:SI 2 "=X,d,d"))]
418 "s390_match_ccmode(insn, CCSmode)"
423 [(set_attr "op_type" "RR,RS,RSY")])
425 (define_insn "*tstsi_cconly2"
427 (compare (match_operand:SI 0 "register_operand" "d")
428 (match_operand:SI 1 "const0_operand" "")))]
429 "s390_match_ccmode(insn, CCSmode)"
431 [(set_attr "op_type" "RR")])
433 (define_insn "*tst<mode>CCT"
435 (compare (match_operand:HQI 0 "nonimmediate_operand" "?Q,?S,d")
436 (match_operand:HQI 1 "const0_operand" "")))
437 (set (match_operand:HQI 2 "register_operand" "=d,d,0")
439 "s390_match_ccmode(insn, CCTmode)"
442 icmy\t%2,<icm_lo>,%S0
444 [(set_attr "op_type" "RS,RSY,RI")])
446 (define_insn "*tsthiCCT_cconly"
448 (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d")
449 (match_operand:HI 1 "const0_operand" "")))
450 (clobber (match_scratch:HI 2 "=d,d,X"))]
451 "s390_match_ccmode(insn, CCTmode)"
456 [(set_attr "op_type" "RS,RSY,RI")])
458 (define_insn "*tstqiCCT_cconly"
460 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
461 (match_operand:QI 1 "const0_operand" "")))]
462 "s390_match_ccmode(insn, CCTmode)"
467 [(set_attr "op_type" "SI,SIY,RI")])
469 (define_insn "*tst<mode>"
471 (compare (match_operand:HQI 0 "s_operand" "Q,S")
472 (match_operand:HQI 1 "const0_operand" "")))
473 (set (match_operand:HQI 2 "register_operand" "=d,d")
475 "s390_match_ccmode(insn, CCSmode)"
478 icmy\t%2,<icm_lo>,%S0"
479 [(set_attr "op_type" "RS,RSY")])
481 (define_insn "*tst<mode>_cconly"
483 (compare (match_operand:HQI 0 "s_operand" "Q,S")
484 (match_operand:HQI 1 "const0_operand" "")))
485 (clobber (match_scratch:HQI 2 "=d,d"))]
486 "s390_match_ccmode(insn, CCSmode)"
489 icmy\t%2,<icm_lo>,%S0"
490 [(set_attr "op_type" "RS,RSY")])
493 ; Compare (equality) instructions
495 (define_insn "*cmpdi_cct"
497 (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,Q")
498 (match_operand:DI 1 "general_operand" "d,K,m,BQ")))]
499 "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT"
505 [(set_attr "op_type" "RRE,RI,RXY,SS")])
507 (define_insn "*cmpsi_cct"
509 (compare (match_operand:SI 0 "nonimmediate_operand" "%d,d,d,d,Q")
510 (match_operand:SI 1 "general_operand" "d,K,R,T,BQ")))]
511 "s390_match_ccmode (insn, CCTmode)"
518 [(set_attr "op_type" "RR,RI,RX,RXY,SS")])
521 ; Compare (signed) instructions
523 (define_insn "*cmpdi_ccs_sign"
525 (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
526 (match_operand:DI 0 "register_operand" "d,d")))]
527 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
531 [(set_attr "op_type" "RRE,RXY")])
533 (define_insn "*cmpdi_ccs"
535 (compare (match_operand:DI 0 "register_operand" "d,d,d")
536 (match_operand:DI 1 "general_operand" "d,K,m")))]
537 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
542 [(set_attr "op_type" "RRE,RI,RXY")])
544 (define_insn "*cmpsi_ccs_sign"
546 (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
547 (match_operand:SI 0 "register_operand" "d,d")))]
548 "s390_match_ccmode(insn, CCSRmode)"
552 [(set_attr "op_type" "RX,RXY")])
554 (define_insn "*cmpsi_ccs"
556 (compare (match_operand:SI 0 "register_operand" "d,d,d,d")
557 (match_operand:SI 1 "general_operand" "d,K,R,T")))]
558 "s390_match_ccmode(insn, CCSmode)"
564 [(set_attr "op_type" "RR,RI,RX,RXY")])
567 ; Compare (unsigned) instructions
569 (define_insn "*cmpdi_ccu_zero"
571 (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
572 (match_operand:DI 0 "register_operand" "d,d")))]
573 "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT"
577 [(set_attr "op_type" "RRE,RXY")])
579 (define_insn "*cmpdi_ccu"
581 (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,Q,BQ")
582 (match_operand:DI 1 "general_operand" "d,m,BQ,Q")))]
583 "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT"
589 [(set_attr "op_type" "RRE,RXY,SS,SS")])
591 (define_insn "*cmpsi_ccu"
593 (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,Q,BQ")
594 (match_operand:SI 1 "general_operand" "d,R,T,BQ,Q")))]
595 "s390_match_ccmode (insn, CCUmode)"
602 [(set_attr "op_type" "RR,RX,RXY,SS,SS")])
604 (define_insn "*cmphi_ccu"
606 (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,BQ")
607 (match_operand:HI 1 "general_operand" "Q,S,BQ,Q")))]
608 "s390_match_ccmode (insn, CCUmode)
609 && !register_operand (operands[1], HImode)"
615 [(set_attr "op_type" "RS,RSY,SS,SS")])
617 (define_insn "*cmpqi_ccu"
619 (compare (match_operand:QI 0 "nonimmediate_operand" "d,d,Q,S,Q,BQ")
620 (match_operand:QI 1 "general_operand" "Q,S,n,n,BQ,Q")))]
621 "s390_match_ccmode (insn, CCUmode)
622 && !register_operand (operands[1], QImode)"
630 [(set_attr "op_type" "RS,RSY,SI,SIY,SS,SS")])
633 ; Block compare (CLC) instruction patterns.
637 (compare (match_operand:BLK 0 "memory_operand" "Q")
638 (match_operand:BLK 1 "memory_operand" "Q")))
639 (use (match_operand 2 "const_int_operand" "n"))]
640 "s390_match_ccmode (insn, CCUmode)
641 && INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256"
642 "clc\t%O0(%2,%R0),%S1"
643 [(set_attr "op_type" "SS")])
647 (compare (match_operand 0 "memory_operand" "")
648 (match_operand 1 "memory_operand" "")))]
650 && s390_match_ccmode (insn, CCUmode)
651 && GET_MODE (operands[0]) == GET_MODE (operands[1])
652 && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
654 [(set (match_dup 0) (match_dup 1))
655 (use (match_dup 2))])]
657 operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
658 operands[0] = adjust_address (operands[0], BLKmode, 0);
659 operands[1] = adjust_address (operands[1], BLKmode, 0);
661 operands[1] = gen_rtx_COMPARE (GET_MODE (SET_DEST (PATTERN (curr_insn))),
662 operands[0], operands[1]);
663 operands[0] = SET_DEST (PATTERN (curr_insn));
669 (define_insn "*cmpdf_ccs_0"
671 (compare (match_operand:DF 0 "register_operand" "f")
672 (match_operand:DF 1 "const0_operand" "")))]
673 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
675 [(set_attr "op_type" "RRE")
676 (set_attr "type" "fsimpd")])
678 (define_insn "*cmpdf_ccs_0_ibm"
680 (compare (match_operand:DF 0 "register_operand" "f")
681 (match_operand:DF 1 "const0_operand" "")))]
682 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
684 [(set_attr "op_type" "RR")
685 (set_attr "type" "fsimpd")])
687 (define_insn "*cmpdf_ccs"
689 (compare (match_operand:DF 0 "register_operand" "f,f")
690 (match_operand:DF 1 "general_operand" "f,R")))]
691 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
695 [(set_attr "op_type" "RRE,RXE")
696 (set_attr "type" "fsimpd")])
698 (define_insn "*cmpdf_ccs_ibm"
700 (compare (match_operand:DF 0 "register_operand" "f,f")
701 (match_operand:DF 1 "general_operand" "f,R")))]
702 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
706 [(set_attr "op_type" "RR,RX")
707 (set_attr "type" "fsimpd")])
712 (define_insn "*cmpsf_ccs_0"
714 (compare (match_operand:SF 0 "register_operand" "f")
715 (match_operand:SF 1 "const0_operand" "")))]
716 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
718 [(set_attr "op_type" "RRE")
719 (set_attr "type" "fsimps")])
721 (define_insn "*cmpsf_ccs_0_ibm"
723 (compare (match_operand:SF 0 "register_operand" "f")
724 (match_operand:SF 1 "const0_operand" "")))]
725 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
727 [(set_attr "op_type" "RR")
728 (set_attr "type" "fsimps")])
730 (define_insn "*cmpsf_ccs"
732 (compare (match_operand:SF 0 "register_operand" "f,f")
733 (match_operand:SF 1 "general_operand" "f,R")))]
734 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
738 [(set_attr "op_type" "RRE,RXE")
739 (set_attr "type" "fsimps")])
741 (define_insn "*cmpsf_ccs"
743 (compare (match_operand:SF 0 "register_operand" "f,f")
744 (match_operand:SF 1 "general_operand" "f,R")))]
745 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
749 [(set_attr "op_type" "RR,RX")
750 (set_attr "type" "fsimps")])
754 ;;- Move instructions.
758 ; movti instruction pattern(s).
762 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
763 (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
771 [(set_attr "op_type" "RSY,RSY,*,*,SS")
772 (set_attr "type" "lm,stm,*,*,*")])
775 [(set (match_operand:TI 0 "nonimmediate_operand" "")
776 (match_operand:TI 1 "general_operand" ""))]
777 "TARGET_64BIT && reload_completed
778 && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
779 [(set (match_dup 2) (match_dup 4))
780 (set (match_dup 3) (match_dup 5))]
782 operands[2] = operand_subword (operands[0], 0, 0, TImode);
783 operands[3] = operand_subword (operands[0], 1, 0, TImode);
784 operands[4] = operand_subword (operands[1], 0, 0, TImode);
785 operands[5] = operand_subword (operands[1], 1, 0, TImode);
789 [(set (match_operand:TI 0 "nonimmediate_operand" "")
790 (match_operand:TI 1 "general_operand" ""))]
791 "TARGET_64BIT && reload_completed
792 && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
793 [(set (match_dup 2) (match_dup 4))
794 (set (match_dup 3) (match_dup 5))]
796 operands[2] = operand_subword (operands[0], 1, 0, TImode);
797 operands[3] = operand_subword (operands[0], 0, 0, TImode);
798 operands[4] = operand_subword (operands[1], 1, 0, TImode);
799 operands[5] = operand_subword (operands[1], 0, 0, TImode);
803 [(set (match_operand:TI 0 "register_operand" "")
804 (match_operand:TI 1 "memory_operand" ""))]
805 "TARGET_64BIT && reload_completed
806 && !s_operand (operands[1], VOIDmode)"
807 [(set (match_dup 0) (match_dup 1))]
809 rtx addr = operand_subword (operands[0], 1, 0, TImode);
810 s390_load_address (addr, XEXP (operands[1], 0));
811 operands[1] = replace_equiv_address (operands[1], addr);
814 (define_expand "reload_outti"
815 [(parallel [(match_operand:TI 0 "" "")
816 (match_operand:TI 1 "register_operand" "d")
817 (match_operand:DI 2 "register_operand" "=&a")])]
820 gcc_assert (MEM_P (operands[0]));
821 s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0)));
822 operands[0] = replace_equiv_address (operands[0], operands[2]);
823 emit_move_insn (operands[0], operands[1]);
828 ; movdi instruction pattern(s).
831 (define_expand "movdi"
832 [(set (match_operand:DI 0 "general_operand" "")
833 (match_operand:DI 1 "general_operand" ""))]
836 /* Handle symbolic constants. */
837 if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
838 emit_symbolic_move (operands);
841 (define_insn "*movdi_larl"
842 [(set (match_operand:DI 0 "register_operand" "=d")
843 (match_operand:DI 1 "larl_operand" "X"))]
845 && !FP_REG_P (operands[0])"
847 [(set_attr "op_type" "RIL")
848 (set_attr "type" "larl")])
850 (define_insn "*movdi_64"
851 [(set (match_operand:DI 0 "nonimmediate_operand"
852 "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
853 (match_operand:DI 1 "general_operand"
854 "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
876 [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,
877 RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
878 (set_attr "type" "*,*,*,*,*,la,lr,load,store,
879 floadd,floadd,floadd,fstored,fstored,*,*,*,*,*")])
882 [(set (match_operand:DI 0 "register_operand" "")
883 (match_operand:DI 1 "register_operand" ""))]
884 "TARGET_64BIT && ACCESS_REG_P (operands[1])"
885 [(set (match_dup 2) (match_dup 3))
886 (set (match_dup 0) (ashift:DI (match_dup 0) (const_int 32)))
887 (set (strict_low_part (match_dup 2)) (match_dup 4))]
888 "operands[2] = gen_lowpart (SImode, operands[0]);
889 s390_split_access_reg (operands[1], &operands[4], &operands[3]);")
892 [(set (match_operand:DI 0 "register_operand" "")
893 (match_operand:DI 1 "register_operand" ""))]
894 "TARGET_64BIT && ACCESS_REG_P (operands[0])
895 && dead_or_set_p (insn, operands[1])"
896 [(set (match_dup 3) (match_dup 2))
897 (set (match_dup 1) (lshiftrt:DI (match_dup 1) (const_int 32)))
898 (set (match_dup 4) (match_dup 2))]
899 "operands[2] = gen_lowpart (SImode, operands[1]);
900 s390_split_access_reg (operands[0], &operands[3], &operands[4]);")
903 [(set (match_operand:DI 0 "register_operand" "")
904 (match_operand:DI 1 "register_operand" ""))]
905 "TARGET_64BIT && ACCESS_REG_P (operands[0])
906 && !dead_or_set_p (insn, operands[1])"
907 [(set (match_dup 3) (match_dup 2))
908 (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32)))
909 (set (match_dup 4) (match_dup 2))
910 (set (match_dup 1) (rotate:DI (match_dup 1) (const_int 32)))]
911 "operands[2] = gen_lowpart (SImode, operands[1]);
912 s390_split_access_reg (operands[0], &operands[3], &operands[4]);")
914 (define_insn "*movdi_31"
915 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
916 (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
929 [(set_attr "op_type" "RS,RS,*,*,RR,RX,RXY,RX,RXY,SS")
930 (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,*")])
933 [(set (match_operand:DI 0 "nonimmediate_operand" "")
934 (match_operand:DI 1 "general_operand" ""))]
935 "!TARGET_64BIT && reload_completed
936 && s390_split_ok_p (operands[0], operands[1], DImode, 0)"
937 [(set (match_dup 2) (match_dup 4))
938 (set (match_dup 3) (match_dup 5))]
940 operands[2] = operand_subword (operands[0], 0, 0, DImode);
941 operands[3] = operand_subword (operands[0], 1, 0, DImode);
942 operands[4] = operand_subword (operands[1], 0, 0, DImode);
943 operands[5] = operand_subword (operands[1], 1, 0, DImode);
947 [(set (match_operand:DI 0 "nonimmediate_operand" "")
948 (match_operand:DI 1 "general_operand" ""))]
949 "!TARGET_64BIT && reload_completed
950 && s390_split_ok_p (operands[0], operands[1], DImode, 1)"
951 [(set (match_dup 2) (match_dup 4))
952 (set (match_dup 3) (match_dup 5))]
954 operands[2] = operand_subword (operands[0], 1, 0, DImode);
955 operands[3] = operand_subword (operands[0], 0, 0, DImode);
956 operands[4] = operand_subword (operands[1], 1, 0, DImode);
957 operands[5] = operand_subword (operands[1], 0, 0, DImode);
961 [(set (match_operand:DI 0 "register_operand" "")
962 (match_operand:DI 1 "memory_operand" ""))]
963 "!TARGET_64BIT && reload_completed
964 && !FP_REG_P (operands[0])
965 && !s_operand (operands[1], VOIDmode)"
966 [(set (match_dup 0) (match_dup 1))]
968 rtx addr = operand_subword (operands[0], 1, 0, DImode);
969 s390_load_address (addr, XEXP (operands[1], 0));
970 operands[1] = replace_equiv_address (operands[1], addr);
973 (define_expand "reload_outdi"
974 [(parallel [(match_operand:DI 0 "" "")
975 (match_operand:DI 1 "register_operand" "d")
976 (match_operand:SI 2 "register_operand" "=&a")])]
979 gcc_assert (MEM_P (operands[0]));
980 s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0)));
981 operands[0] = replace_equiv_address (operands[0], operands[2]);
982 emit_move_insn (operands[0], operands[1]);
987 [(set (match_operand:DI 0 "register_operand" "")
988 (mem:DI (match_operand 1 "address_operand" "")))]
990 && !FP_REG_P (operands[0])
991 && GET_CODE (operands[1]) == SYMBOL_REF
992 && CONSTANT_POOL_ADDRESS_P (operands[1])
993 && get_pool_mode (operands[1]) == DImode
994 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
995 [(set (match_dup 0) (match_dup 2))]
996 "operands[2] = get_pool_constant (operands[1]);")
998 (define_insn "*la_64"
999 [(set (match_operand:DI 0 "register_operand" "=d,d")
1000 (match_operand:QI 1 "address_operand" "U,W"))]
1005 [(set_attr "op_type" "RX,RXY")
1006 (set_attr "type" "la")])
1010 [(set (match_operand:DI 0 "register_operand" "")
1011 (match_operand:QI 1 "address_operand" ""))
1012 (clobber (reg:CC 33))])]
1014 && preferred_la_operand_p (operands[1], const0_rtx)"
1015 [(set (match_dup 0) (match_dup 1))]
1019 [(set (match_operand:DI 0 "register_operand" "")
1020 (match_operand:DI 1 "register_operand" ""))
1023 (plus:DI (match_dup 0)
1024 (match_operand:DI 2 "nonmemory_operand" "")))
1025 (clobber (reg:CC 33))])]
1027 && !reg_overlap_mentioned_p (operands[0], operands[2])
1028 && preferred_la_operand_p (operands[1], operands[2])"
1029 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
1032 (define_expand "reload_indi"
1033 [(parallel [(match_operand:DI 0 "register_operand" "=a")
1034 (match_operand:DI 1 "s390_plus_operand" "")
1035 (match_operand:DI 2 "register_operand" "=&a")])]
1038 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1043 ; movsi instruction pattern(s).
1046 (define_expand "movsi"
1047 [(set (match_operand:SI 0 "general_operand" "")
1048 (match_operand:SI 1 "general_operand" ""))]
1051 /* Handle symbolic constants. */
1052 if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1053 emit_symbolic_move (operands);
1056 (define_insn "*movsi_larl"
1057 [(set (match_operand:SI 0 "register_operand" "=d")
1058 (match_operand:SI 1 "larl_operand" "X"))]
1059 "!TARGET_64BIT && TARGET_CPU_ZARCH
1060 && !FP_REG_P (operands[0])"
1062 [(set_attr "op_type" "RIL")
1063 (set_attr "type" "larl")])
1065 (define_insn "*movsi_zarch"
1066 [(set (match_operand:SI 0 "nonimmediate_operand"
1067 "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
1068 (match_operand:SI 1 "general_operand"
1069 "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
1091 [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,
1092 RR,RX,RXY,RX,RXY,RRE,RRE,RS,RS,SS")
1093 (set_attr "type" "*,*,*,la,lr,load,load,store,store,
1094 floads,floads,floads,fstores,fstores,*,*,*,*,*")])
1096 (define_insn "*movsi_esa"
1097 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q")
1098 (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,t,d,t,Q,?Q"))]
1113 [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS")
1114 (set_attr "type" "*,lr,load,store,floads,floads,fstores,*,*,*,*,*")])
1117 [(set (match_operand:SI 0 "register_operand" "")
1118 (mem:SI (match_operand 1 "address_operand" "")))]
1119 "!FP_REG_P (operands[0])
1120 && GET_CODE (operands[1]) == SYMBOL_REF
1121 && CONSTANT_POOL_ADDRESS_P (operands[1])
1122 && get_pool_mode (operands[1]) == SImode
1123 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1124 [(set (match_dup 0) (match_dup 2))]
1125 "operands[2] = get_pool_constant (operands[1]);")
1127 (define_insn "*la_31"
1128 [(set (match_operand:SI 0 "register_operand" "=d,d")
1129 (match_operand:QI 1 "address_operand" "U,W"))]
1130 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
1134 [(set_attr "op_type" "RX,RXY")
1135 (set_attr "type" "la")])
1139 [(set (match_operand:SI 0 "register_operand" "")
1140 (match_operand:QI 1 "address_operand" ""))
1141 (clobber (reg:CC 33))])]
1143 && preferred_la_operand_p (operands[1], const0_rtx)"
1144 [(set (match_dup 0) (match_dup 1))]
1148 [(set (match_operand:SI 0 "register_operand" "")
1149 (match_operand:SI 1 "register_operand" ""))
1152 (plus:SI (match_dup 0)
1153 (match_operand:SI 2 "nonmemory_operand" "")))
1154 (clobber (reg:CC 33))])]
1156 && !reg_overlap_mentioned_p (operands[0], operands[2])
1157 && preferred_la_operand_p (operands[1], operands[2])"
1158 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
1161 (define_insn "*la_31_and"
1162 [(set (match_operand:SI 0 "register_operand" "=d,d")
1163 (and:SI (match_operand:QI 1 "address_operand" "U,W")
1164 (const_int 2147483647)))]
1169 [(set_attr "op_type" "RX,RXY")
1170 (set_attr "type" "la")])
1172 (define_insn_and_split "*la_31_and_cc"
1173 [(set (match_operand:SI 0 "register_operand" "=d")
1174 (and:SI (match_operand:QI 1 "address_operand" "p")
1175 (const_int 2147483647)))
1176 (clobber (reg:CC 33))]
1179 "&& reload_completed"
1181 (and:SI (match_dup 1) (const_int 2147483647)))]
1183 [(set_attr "op_type" "RX")
1184 (set_attr "type" "la")])
1186 (define_insn "force_la_31"
1187 [(set (match_operand:SI 0 "register_operand" "=d,d")
1188 (match_operand:QI 1 "address_operand" "U,W"))
1189 (use (const_int 0))]
1194 [(set_attr "op_type" "RX")
1195 (set_attr "type" "la")])
1197 (define_expand "reload_insi"
1198 [(parallel [(match_operand:SI 0 "register_operand" "=a")
1199 (match_operand:SI 1 "s390_plus_operand" "")
1200 (match_operand:SI 2 "register_operand" "=&a")])]
1203 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1208 ; movhi instruction pattern(s).
1211 (define_expand "movhi"
1212 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1213 (match_operand:HI 1 "general_operand" ""))]
1216 /* Make it explicit that loading a register from memory
1217 always sign-extends (at least) to SImode. */
1218 if (optimize && !no_new_pseudos
1219 && register_operand (operands[0], VOIDmode)
1220 && GET_CODE (operands[1]) == MEM)
1222 rtx tmp = gen_reg_rtx (SImode);
1223 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1224 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1225 operands[1] = gen_lowpart (HImode, tmp);
1229 (define_insn "*movhi"
1230 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1231 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1241 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1242 (set_attr "type" "lr,*,*,*,store,store,*")])
1245 [(set (match_operand:HI 0 "register_operand" "")
1246 (mem:HI (match_operand 1 "address_operand" "")))]
1247 "GET_CODE (operands[1]) == SYMBOL_REF
1248 && CONSTANT_POOL_ADDRESS_P (operands[1])
1249 && get_pool_mode (operands[1]) == HImode
1250 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1251 [(set (match_dup 0) (match_dup 2))]
1252 "operands[2] = get_pool_constant (operands[1]);")
1255 ; movqi instruction pattern(s).
1258 (define_expand "movqi"
1259 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1260 (match_operand:QI 1 "general_operand" ""))]
1263 /* On z/Architecture, zero-extending from memory to register
1264 is just as fast as a QImode load. */
1265 if (TARGET_ZARCH && optimize && !no_new_pseudos
1266 && register_operand (operands[0], VOIDmode)
1267 && GET_CODE (operands[1]) == MEM)
1269 rtx tmp = gen_reg_rtx (word_mode);
1270 rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
1271 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1272 operands[1] = gen_lowpart (QImode, tmp);
1276 (define_insn "*movqi"
1277 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1278 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1290 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1291 (set_attr "type" "lr,*,*,*,store,store,store,store,*")])
1294 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1295 (mem:QI (match_operand 1 "address_operand" "")))]
1296 "GET_CODE (operands[1]) == SYMBOL_REF
1297 && CONSTANT_POOL_ADDRESS_P (operands[1])
1298 && get_pool_mode (operands[1]) == QImode
1299 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1300 [(set (match_dup 0) (match_dup 2))]
1301 "operands[2] = get_pool_constant (operands[1]);")
1304 ; movstrictqi instruction pattern(s).
1307 (define_insn "*movstrictqi"
1308 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1309 (match_operand:QI 1 "memory_operand" "R,T"))]
1314 [(set_attr "op_type" "RX,RXY")])
1317 ; movstricthi instruction pattern(s).
1320 (define_insn "*movstricthi"
1321 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1322 (match_operand:HI 1 "memory_operand" "Q,S"))
1323 (clobber (reg:CC 33))]
1328 [(set_attr "op_type" "RS,RSY")])
1331 ; movstrictsi instruction pattern(s).
1334 (define_insn "movstrictsi"
1335 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d,d"))
1336 (match_operand:SI 1 "general_operand" "d,R,T,t"))]
1343 [(set_attr "op_type" "RR,RX,RXY,RRE")
1344 (set_attr "type" "lr,load,load,*")])
1347 ; movdf instruction pattern(s).
1350 (define_expand "movdf"
1351 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1352 (match_operand:DF 1 "general_operand" ""))]
1356 (define_insn "*movdf_64"
1357 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1358 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1370 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1371 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,*")])
1373 (define_insn "*movdf_31"
1374 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1375 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1388 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,*,*,SS")
1389 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,*")])
1392 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1393 (match_operand:DF 1 "general_operand" ""))]
1394 "!TARGET_64BIT && reload_completed
1395 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1396 [(set (match_dup 2) (match_dup 4))
1397 (set (match_dup 3) (match_dup 5))]
1399 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1400 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1401 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1402 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1406 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1407 (match_operand:DF 1 "general_operand" ""))]
1408 "!TARGET_64BIT && reload_completed
1409 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1410 [(set (match_dup 2) (match_dup 4))
1411 (set (match_dup 3) (match_dup 5))]
1413 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1414 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1415 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1416 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1420 [(set (match_operand:DF 0 "register_operand" "")
1421 (match_operand:DF 1 "memory_operand" ""))]
1422 "!TARGET_64BIT && reload_completed
1423 && !FP_REG_P (operands[0])
1424 && !s_operand (operands[1], VOIDmode)"
1425 [(set (match_dup 0) (match_dup 1))]
1427 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1428 s390_load_address (addr, XEXP (operands[1], 0));
1429 operands[1] = replace_equiv_address (operands[1], addr);
1432 (define_expand "reload_outdf"
1433 [(parallel [(match_operand:DF 0 "" "")
1434 (match_operand:DF 1 "register_operand" "d")
1435 (match_operand:SI 2 "register_operand" "=&a")])]
1438 gcc_assert (MEM_P (operands[0]));
1439 s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0)));
1440 operands[0] = replace_equiv_address (operands[0], operands[2]);
1441 emit_move_insn (operands[0], operands[1]);
1446 ; movsf instruction pattern(s).
1449 (define_insn "movsf"
1450 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1451 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1465 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1466 (set_attr "type" "floads,floads,floads,fstores,fstores,
1467 lr,load,load,store,store,*")])
1470 ; movcc instruction pattern
1473 (define_insn "movcc"
1474 [(set (match_operand:CC 0 "nonimmediate_operand" "=d,c,d,d,d,R,T")
1475 (match_operand:CC 1 "nonimmediate_operand" "d,d,c,R,T,d,d"))]
1485 [(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY")
1486 (set_attr "type" "lr,*,*,store,store,load,load")])
1489 ; Block move (MVC) patterns.
1493 [(set (match_operand:BLK 0 "memory_operand" "=Q")
1494 (match_operand:BLK 1 "memory_operand" "Q"))
1495 (use (match_operand 2 "const_int_operand" "n"))]
1496 "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256"
1497 "mvc\t%O0(%2,%R0),%S1"
1498 [(set_attr "op_type" "SS")])
1501 [(set (match_operand 0 "memory_operand" "")
1502 (match_operand 1 "memory_operand" ""))]
1504 && GET_MODE (operands[0]) == GET_MODE (operands[1])
1505 && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
1507 [(set (match_dup 0) (match_dup 1))
1508 (use (match_dup 2))])]
1510 operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
1511 operands[0] = adjust_address (operands[0], BLKmode, 0);
1512 operands[1] = adjust_address (operands[1], BLKmode, 0);
1517 [(set (match_operand:BLK 0 "memory_operand" "")
1518 (match_operand:BLK 1 "memory_operand" ""))
1519 (use (match_operand 2 "const_int_operand" ""))])
1521 [(set (match_operand:BLK 3 "memory_operand" "")
1522 (match_operand:BLK 4 "memory_operand" ""))
1523 (use (match_operand 5 "const_int_operand" ""))])]
1524 "s390_offset_p (operands[0], operands[3], operands[2])
1525 && s390_offset_p (operands[1], operands[4], operands[2])
1526 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
1528 [(set (match_dup 6) (match_dup 7))
1529 (use (match_dup 8))])]
1530 "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0));
1531 operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0));
1532 operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));")
1536 ; load_multiple pattern(s).
1538 ; ??? Due to reload problems with replacing registers inside match_parallel
1539 ; we currently support load_multiple/store_multiple only after reload.
1542 (define_expand "load_multiple"
1543 [(match_par_dup 3 [(set (match_operand 0 "" "")
1544 (match_operand 1 "" ""))
1545 (use (match_operand 2 "" ""))])]
1548 enum machine_mode mode;
1554 /* Support only loading a constant number of fixed-point registers from
1555 memory and only bother with this if more than two */
1556 if (GET_CODE (operands[2]) != CONST_INT
1557 || INTVAL (operands[2]) < 2
1558 || INTVAL (operands[2]) > 16
1559 || GET_CODE (operands[1]) != MEM
1560 || GET_CODE (operands[0]) != REG
1561 || REGNO (operands[0]) >= 16)
1564 count = INTVAL (operands[2]);
1565 regno = REGNO (operands[0]);
1566 mode = GET_MODE (operands[0]);
1567 if (mode != SImode && mode != word_mode)
1570 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1573 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1575 from = XEXP (operands[1], 0);
1578 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1579 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1580 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1582 from = XEXP (XEXP (operands[1], 0), 0);
1583 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1590 from = force_reg (Pmode, XEXP (operands[1], 0));
1594 for (i = 0; i < count; i++)
1595 XVECEXP (operands[3], 0, i)
1596 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1597 change_address (operands[1], mode,
1598 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1601 (define_insn "*load_multiple_di"
1602 [(match_parallel 0 "load_multiple_operation"
1603 [(set (match_operand:DI 1 "register_operand" "=r")
1604 (match_operand:DI 2 "s_operand" "QS"))])]
1605 "reload_completed && word_mode == DImode"
1607 int words = XVECLEN (operands[0], 0);
1608 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1609 return "lmg\t%1,%0,%S2";
1611 [(set_attr "op_type" "RSY")
1612 (set_attr "type" "lm")])
1614 (define_insn "*load_multiple_si"
1615 [(match_parallel 0 "load_multiple_operation"
1616 [(set (match_operand:SI 1 "register_operand" "=r,r")
1617 (match_operand:SI 2 "s_operand" "Q,S"))])]
1620 int words = XVECLEN (operands[0], 0);
1621 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1622 return which_alternative == 0 ? "lm\t%1,%0,%S2" : "lmy\t%1,%0,%S2";
1624 [(set_attr "op_type" "RS,RSY")
1625 (set_attr "type" "lm")])
1628 ; store multiple pattern(s).
1631 (define_expand "store_multiple"
1632 [(match_par_dup 3 [(set (match_operand 0 "" "")
1633 (match_operand 1 "" ""))
1634 (use (match_operand 2 "" ""))])]
1637 enum machine_mode mode;
1643 /* Support only storing a constant number of fixed-point registers to
1644 memory and only bother with this if more than two. */
1645 if (GET_CODE (operands[2]) != CONST_INT
1646 || INTVAL (operands[2]) < 2
1647 || INTVAL (operands[2]) > 16
1648 || GET_CODE (operands[0]) != MEM
1649 || GET_CODE (operands[1]) != REG
1650 || REGNO (operands[1]) >= 16)
1653 count = INTVAL (operands[2]);
1654 regno = REGNO (operands[1]);
1655 mode = GET_MODE (operands[1]);
1656 if (mode != SImode && mode != word_mode)
1659 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1663 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1665 to = XEXP (operands[0], 0);
1668 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1669 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1670 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1672 to = XEXP (XEXP (operands[0], 0), 0);
1673 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1680 to = force_reg (Pmode, XEXP (operands[0], 0));
1684 for (i = 0; i < count; i++)
1685 XVECEXP (operands[3], 0, i)
1686 = gen_rtx_SET (VOIDmode,
1687 change_address (operands[0], mode,
1688 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1689 gen_rtx_REG (mode, regno + i));
1692 (define_insn "*store_multiple_di"
1693 [(match_parallel 0 "store_multiple_operation"
1694 [(set (match_operand:DI 1 "s_operand" "=QS")
1695 (match_operand:DI 2 "register_operand" "r"))])]
1696 "reload_completed && word_mode == DImode"
1698 int words = XVECLEN (operands[0], 0);
1699 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1700 return "stmg\t%2,%0,%S1";
1702 [(set_attr "op_type" "RSY")
1703 (set_attr "type" "stm")])
1706 (define_insn "*store_multiple_si"
1707 [(match_parallel 0 "store_multiple_operation"
1708 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1709 (match_operand:SI 2 "register_operand" "r,r"))])]
1712 int words = XVECLEN (operands[0], 0);
1713 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1714 return which_alternative == 0 ? "stm\t%2,%0,%S1" : "stmy\t%2,%0,%S1";
1716 [(set_attr "op_type" "RS,RSY")
1717 (set_attr "type" "stm")])
1720 ;; String instructions.
1723 (define_insn "*execute"
1724 [(match_parallel 0 ""
1725 [(unspec [(match_operand 1 "register_operand" "a")
1726 (match_operand:BLK 2 "memory_operand" "R")
1727 (match_operand 3 "" "")] UNSPEC_EXECUTE)])]
1728 "GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT
1729 && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD"
1731 [(set_attr "op_type" "RX")
1732 (set_attr "type" "cs")])
1736 ; strlenM instruction pattern(s).
1739 (define_expand "strlen<mode>"
1740 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1743 (unspec:P [(const_int 0)
1744 (match_operand:BLK 1 "memory_operand" "")
1746 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1747 (clobber (scratch:P))
1748 (clobber (reg:CC 33))])
1750 [(set (match_operand:P 0 "register_operand" "")
1751 (minus:P (match_dup 4) (match_dup 5)))
1752 (clobber (reg:CC 33))])]
1755 operands[4] = gen_reg_rtx (Pmode);
1756 operands[5] = gen_reg_rtx (Pmode);
1757 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1758 operands[1] = replace_equiv_address (operands[1], operands[5]);
1761 (define_insn "*strlen<mode>"
1762 [(set (match_operand:P 0 "register_operand" "=a")
1763 (unspec:P [(match_operand:P 2 "general_operand" "0")
1764 (mem:BLK (match_operand:P 3 "register_operand" "1"))
1766 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1767 (clobber (match_scratch:P 1 "=a"))
1768 (clobber (reg:CC 33))]
1770 "srst\t%0,%1\;jo\t.-4"
1771 [(set_attr "length" "8")
1772 (set_attr "type" "vs")])
1775 ; movmemM instruction pattern(s).
1778 (define_expand "movmem<mode>"
1779 [(set (match_operand:BLK 0 "memory_operand" "")
1780 (match_operand:BLK 1 "memory_operand" ""))
1781 (use (match_operand:GPR 2 "general_operand" ""))
1782 (match_operand 3 "" "")]
1784 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1786 ; Move a block that is up to 256 bytes in length.
1787 ; The block length is taken as (operands[2] % 256) + 1.
1789 (define_expand "movmem_short"
1791 [(set (match_operand:BLK 0 "memory_operand" "")
1792 (match_operand:BLK 1 "memory_operand" ""))
1793 (use (match_operand 2 "nonmemory_operand" ""))
1794 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1795 (clobber (match_dup 3))])]
1797 "operands[3] = gen_rtx_SCRATCH (Pmode);")
1799 (define_insn "*movmem_short"
1800 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
1801 (match_operand:BLK 1 "memory_operand" "Q,Q,Q"))
1802 (use (match_operand 2 "nonmemory_operand" "n,a,a"))
1803 (use (match_operand 3 "immediate_operand" "X,R,X"))
1804 (clobber (match_scratch 4 "=X,X,&a"))]
1805 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
1806 && GET_MODE (operands[4]) == Pmode"
1808 [(set_attr "type" "cs")])
1811 [(set (match_operand:BLK 0 "memory_operand" "")
1812 (match_operand:BLK 1 "memory_operand" ""))
1813 (use (match_operand 2 "const_int_operand" ""))
1814 (use (match_operand 3 "immediate_operand" ""))
1815 (clobber (scratch))]
1818 [(set (match_dup 0) (match_dup 1))
1819 (use (match_dup 2))])]
1820 "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);")
1823 [(set (match_operand:BLK 0 "memory_operand" "")
1824 (match_operand:BLK 1 "memory_operand" ""))
1825 (use (match_operand 2 "register_operand" ""))
1826 (use (match_operand 3 "memory_operand" ""))
1827 (clobber (scratch))]
1830 [(unspec [(match_dup 2) (match_dup 3)
1831 (const_int 0)] UNSPEC_EXECUTE)
1832 (set (match_dup 0) (match_dup 1))
1833 (use (const_int 1))])]
1837 [(set (match_operand:BLK 0 "memory_operand" "")
1838 (match_operand:BLK 1 "memory_operand" ""))
1839 (use (match_operand 2 "register_operand" ""))
1840 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1841 (clobber (match_operand 3 "register_operand" ""))]
1842 "reload_completed && TARGET_CPU_ZARCH"
1843 [(set (match_dup 3) (label_ref (match_dup 4)))
1845 [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
1846 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
1847 (set (match_dup 0) (match_dup 1))
1848 (use (const_int 1))])]
1849 "operands[4] = gen_label_rtx ();")
1851 ; Move a block of arbitrary length.
1853 (define_expand "movmem_long"
1855 [(clobber (match_dup 2))
1856 (clobber (match_dup 3))
1857 (set (match_operand:BLK 0 "memory_operand" "")
1858 (match_operand:BLK 1 "memory_operand" ""))
1859 (use (match_operand 2 "general_operand" ""))
1861 (clobber (reg:CC 33))])]
1864 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1865 rtx reg0 = gen_reg_rtx (dword_mode);
1866 rtx reg1 = gen_reg_rtx (dword_mode);
1867 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1868 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
1869 rtx len0 = gen_lowpart (Pmode, reg0);
1870 rtx len1 = gen_lowpart (Pmode, reg1);
1872 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1873 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1874 emit_move_insn (len0, operands[2]);
1876 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
1877 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
1878 emit_move_insn (len1, operands[2]);
1880 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1881 operands[1] = replace_equiv_address_nv (operands[1], addr1);
1886 (define_insn "*movmem_long_64"
1887 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1888 (clobber (match_operand:TI 1 "register_operand" "=d"))
1889 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1890 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
1893 (clobber (reg:CC 33))]
1895 "mvcle\t%0,%1,0\;jo\t.-4"
1896 [(set_attr "length" "8")
1897 (set_attr "type" "vs")])
1899 (define_insn "*movmem_long_31"
1900 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1901 (clobber (match_operand:DI 1 "register_operand" "=d"))
1902 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
1903 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
1906 (clobber (reg:CC 33))]
1908 "mvcle\t%0,%1,0\;jo\t.-4"
1909 [(set_attr "length" "8")
1910 (set_attr "type" "vs")])
1913 ; clrmemM instruction pattern(s).
1916 (define_expand "clrmem<mode>"
1917 [(set (match_operand:BLK 0 "memory_operand" "")
1919 (use (match_operand:GPR 1 "general_operand" ""))
1920 (match_operand 2 "" "")]
1922 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
1924 ; Clear a block that is up to 256 bytes in length.
1925 ; The block length is taken as (operands[1] % 256) + 1.
1927 (define_expand "clrmem_short"
1929 [(set (match_operand:BLK 0 "memory_operand" "")
1931 (use (match_operand 1 "nonmemory_operand" ""))
1932 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1933 (clobber (match_dup 2))
1934 (clobber (reg:CC 33))])]
1936 "operands[2] = gen_rtx_SCRATCH (Pmode);")
1938 (define_insn "*clrmem_short"
1939 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
1941 (use (match_operand 1 "nonmemory_operand" "n,a,a"))
1942 (use (match_operand 2 "immediate_operand" "X,R,X"))
1943 (clobber (match_scratch 3 "=X,X,&a"))
1944 (clobber (reg:CC 33))]
1945 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
1946 && GET_MODE (operands[3]) == Pmode"
1948 [(set_attr "type" "cs")])
1951 [(set (match_operand:BLK 0 "memory_operand" "")
1953 (use (match_operand 1 "const_int_operand" ""))
1954 (use (match_operand 2 "immediate_operand" ""))
1956 (clobber (reg:CC 33))]
1959 [(set (match_dup 0) (const_int 0))
1961 (clobber (reg:CC 33))])]
1962 "operands[1] = GEN_INT ((INTVAL (operands[1]) & 0xff) + 1);")
1965 [(set (match_operand:BLK 0 "memory_operand" "")
1967 (use (match_operand 1 "register_operand" ""))
1968 (use (match_operand 2 "memory_operand" ""))
1970 (clobber (reg:CC 33))]
1973 [(unspec [(match_dup 1) (match_dup 2)
1974 (const_int 0)] UNSPEC_EXECUTE)
1975 (set (match_dup 0) (const_int 0))
1977 (clobber (reg:CC 33))])]
1981 [(set (match_operand:BLK 0 "memory_operand" "")
1983 (use (match_operand 1 "register_operand" ""))
1984 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1985 (clobber (match_operand 2 "register_operand" ""))
1986 (clobber (reg:CC 33))]
1987 "reload_completed && TARGET_CPU_ZARCH"
1988 [(set (match_dup 2) (label_ref (match_dup 3)))
1990 [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
1991 (label_ref (match_dup 3))] UNSPEC_EXECUTE)
1992 (set (match_dup 0) (const_int 0))
1994 (clobber (reg:CC 33))])]
1995 "operands[3] = gen_label_rtx ();")
1997 ; Clear a block of arbitrary length.
1999 (define_expand "clrmem_long"
2001 [(clobber (match_dup 1))
2002 (set (match_operand:BLK 0 "memory_operand" "")
2004 (use (match_operand 1 "general_operand" ""))
2006 (clobber (reg:CC 33))])]
2009 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2010 rtx reg0 = gen_reg_rtx (dword_mode);
2011 rtx reg1 = gen_reg_rtx (dword_mode);
2012 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2013 rtx len0 = gen_lowpart (Pmode, reg0);
2015 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2016 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2017 emit_move_insn (len0, operands[1]);
2019 emit_move_insn (reg1, const0_rtx);
2021 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2026 (define_insn "*clrmem_long_64"
2027 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2028 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2031 (use (match_operand:TI 1 "register_operand" "d"))
2032 (clobber (reg:CC 33))]
2034 "mvcle\t%0,%1,0\;jo\t.-4"
2035 [(set_attr "length" "8")
2036 (set_attr "type" "vs")])
2038 (define_insn "*clrmem_long_31"
2039 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2040 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2043 (use (match_operand:DI 1 "register_operand" "d"))
2044 (clobber (reg:CC 33))]
2046 "mvcle\t%0,%1,0\;jo\t.-4"
2047 [(set_attr "length" "8")
2048 (set_attr "type" "vs")])
2051 ; cmpmemM instruction pattern(s).
2054 (define_expand "cmpmemsi"
2055 [(set (match_operand:SI 0 "register_operand" "")
2056 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2057 (match_operand:BLK 2 "memory_operand" "") ) )
2058 (use (match_operand:SI 3 "general_operand" ""))
2059 (use (match_operand:SI 4 "" ""))]
2061 "s390_expand_cmpmem (operands[0], operands[1],
2062 operands[2], operands[3]); DONE;")
2064 ; Compare a block that is up to 256 bytes in length.
2065 ; The block length is taken as (operands[2] % 256) + 1.
2067 (define_expand "cmpmem_short"
2070 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2071 (match_operand:BLK 1 "memory_operand" "")))
2072 (use (match_operand 2 "nonmemory_operand" ""))
2073 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
2074 (clobber (match_dup 3))])]
2076 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2078 (define_insn "*cmpmem_short"
2080 (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q")
2081 (match_operand:BLK 1 "memory_operand" "Q,Q,Q")))
2082 (use (match_operand 2 "nonmemory_operand" "n,a,a"))
2083 (use (match_operand 3 "immediate_operand" "X,R,X"))
2084 (clobber (match_scratch 4 "=X,X,&a"))]
2085 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2086 && GET_MODE (operands[4]) == Pmode"
2088 [(set_attr "type" "cs")])
2092 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2093 (match_operand:BLK 1 "memory_operand" "")))
2094 (use (match_operand 2 "const_int_operand" ""))
2095 (use (match_operand 3 "immediate_operand" ""))
2096 (clobber (scratch))]
2099 [(set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2100 (use (match_dup 2))])]
2101 "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);")
2105 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2106 (match_operand:BLK 1 "memory_operand" "")))
2107 (use (match_operand 2 "register_operand" ""))
2108 (use (match_operand 3 "memory_operand" ""))
2109 (clobber (scratch))]
2112 [(unspec [(match_dup 2) (match_dup 3)
2113 (const_int 0)] UNSPEC_EXECUTE)
2114 (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2115 (use (const_int 1))])]
2120 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2121 (match_operand:BLK 1 "memory_operand" "")))
2122 (use (match_operand 2 "register_operand" ""))
2123 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
2124 (clobber (match_operand 3 "register_operand" ""))]
2125 "reload_completed && TARGET_CPU_ZARCH"
2126 [(set (match_dup 3) (label_ref (match_dup 4)))
2128 [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
2129 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
2130 (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2131 (use (const_int 1))])]
2132 "operands[4] = gen_label_rtx ();")
2134 ; Compare a block of arbitrary length.
2136 (define_expand "cmpmem_long"
2138 [(clobber (match_dup 2))
2139 (clobber (match_dup 3))
2141 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2142 (match_operand:BLK 1 "memory_operand" "")))
2143 (use (match_operand 2 "general_operand" ""))
2144 (use (match_dup 3))])]
2147 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2148 rtx reg0 = gen_reg_rtx (dword_mode);
2149 rtx reg1 = gen_reg_rtx (dword_mode);
2150 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2151 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2152 rtx len0 = gen_lowpart (Pmode, reg0);
2153 rtx len1 = gen_lowpart (Pmode, reg1);
2155 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2156 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2157 emit_move_insn (len0, operands[2]);
2159 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2160 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2161 emit_move_insn (len1, operands[2]);
2163 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2164 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2169 (define_insn "*cmpmem_long_64"
2170 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2171 (clobber (match_operand:TI 1 "register_operand" "=d"))
2173 (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2174 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2176 (use (match_dup 3))]
2178 "clcle\t%0,%1,0\;jo\t.-4"
2179 [(set_attr "length" "8")
2180 (set_attr "type" "vs")])
2182 (define_insn "*cmpmem_long_31"
2183 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2184 (clobber (match_operand:DI 1 "register_operand" "=d"))
2186 (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2187 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2189 (use (match_dup 3))]
2191 "clcle\t%0,%1,0\;jo\t.-4"
2192 [(set_attr "length" "8")
2193 (set_attr "type" "vs")])
2195 ; Convert CCUmode condition code to integer.
2196 ; Result is zero if EQ, positive if LTU, negative if GTU.
2198 (define_insn_and_split "cmpint"
2199 [(set (match_operand:SI 0 "register_operand" "=d")
2200 (unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
2202 (clobber (reg:CC 33))]
2206 [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2)))
2208 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30)))
2209 (clobber (reg:CC 33))])])
2211 (define_insn_and_split "*cmpint_cc"
2213 (compare (unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
2216 (set (match_operand:SI 0 "register_operand" "=d")
2217 (unspec:SI [(match_dup 1)] UNSPEC_CMPINT))]
2218 "s390_match_ccmode (insn, CCSmode)"
2220 "&& reload_completed"
2221 [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2)))
2223 [(set (match_dup 2) (match_dup 3))
2224 (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30)))])]
2226 rtx result = gen_rtx_ASHIFTRT (SImode, operands[0], GEN_INT (30));
2227 operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0));
2228 operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx);
2231 (define_insn_and_split "*cmpint_sign"
2232 [(set (match_operand:DI 0 "register_operand" "=d")
2233 (sign_extend:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
2235 (clobber (reg:CC 33))]
2238 "&& reload_completed"
2239 [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34)))
2241 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62)))
2242 (clobber (reg:CC 33))])])
2244 (define_insn_and_split "*cmpint_sign_cc"
2246 (compare (ashiftrt:DI (ashift:DI (subreg:DI
2247 (unspec:SI [(match_operand:CCU 1 "register_operand" "0")]
2249 (const_int 32)) (const_int 32))
2251 (set (match_operand:DI 0 "register_operand" "=d")
2252 (sign_extend:DI (unspec:SI [(match_dup 1)] UNSPEC_CMPINT)))]
2253 "s390_match_ccmode (insn, CCSmode) && TARGET_64BIT"
2255 "&& reload_completed"
2256 [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34)))
2258 [(set (match_dup 2) (match_dup 3))
2259 (set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62)))])]
2261 rtx result = gen_rtx_ASHIFTRT (DImode, operands[0], GEN_INT (62));
2262 operands[2] = SET_DEST (XVECEXP (PATTERN (curr_insn), 0, 0));
2263 operands[3] = gen_rtx_COMPARE (GET_MODE (operands[2]), result, const0_rtx);
2268 ;;- Conversion instructions.
2272 (define_insn "*sethigh<mode>si"
2273 [(set (match_operand:SI 0 "register_operand" "=d,d")
2274 (unspec:SI [(match_operand:HQI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2275 (clobber (reg:CC 33))]
2278 icm\t%0,<icm_hi>,%S1
2279 icmy\t%0,<icm_hi>,%S1"
2280 [(set_attr "op_type" "RS,RSY")])
2282 (define_insn "*sethighqidi_64"
2283 [(set (match_operand:DI 0 "register_operand" "=d")
2284 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2285 (clobber (reg:CC 33))]
2288 [(set_attr "op_type" "RSY")])
2290 (define_insn "*sethighqidi_31"
2291 [(set (match_operand:DI 0 "register_operand" "=d,d")
2292 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2293 (clobber (reg:CC 33))]
2298 [(set_attr "op_type" "RS,RSY")])
2300 (define_insn_and_split "*extractqi"
2301 [(set (match_operand:SI 0 "register_operand" "=d")
2302 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2303 (match_operand 2 "const_int_operand" "n")
2305 (clobber (reg:CC 33))]
2307 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2309 "&& reload_completed"
2311 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2312 (clobber (reg:CC 33))])
2313 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2315 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2316 operands[1] = change_address (operands[1], QImode, 0);
2319 (define_insn_and_split "*extracthi"
2320 [(set (match_operand:SI 0 "register_operand" "=d")
2321 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2322 (match_operand 2 "const_int_operand" "n")
2324 (clobber (reg:CC 33))]
2326 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2328 "&& reload_completed"
2330 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2331 (clobber (reg:CC 33))])
2332 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2334 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2335 operands[1] = change_address (operands[1], HImode, 0);
2339 ; extendsidi2 instruction pattern(s).
2342 (define_expand "extendsidi2"
2343 [(set (match_operand:DI 0 "register_operand" "")
2344 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2350 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2351 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2352 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2353 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2359 (define_insn "*extendsidi2"
2360 [(set (match_operand:DI 0 "register_operand" "=d,d")
2361 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2366 [(set_attr "op_type" "RRE,RXY")])
2369 ; extendhidi2 instruction pattern(s).
2372 (define_expand "extendhidi2"
2373 [(set (match_operand:DI 0 "register_operand" "")
2374 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2380 rtx tmp = gen_reg_rtx (SImode);
2381 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2382 emit_insn (gen_extendsidi2 (operands[0], tmp));
2387 operands[1] = gen_lowpart (DImode, operands[1]);
2388 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2389 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2395 (define_insn "*extendhidi2"
2396 [(set (match_operand:DI 0 "register_operand" "=d")
2397 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2400 [(set_attr "op_type" "RXY")])
2403 ; extendqidi2 instruction pattern(s).
2406 (define_expand "extendqidi2"
2407 [(set (match_operand:DI 0 "register_operand" "")
2408 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2414 rtx tmp = gen_reg_rtx (SImode);
2415 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2416 emit_insn (gen_extendsidi2 (operands[0], tmp));
2421 operands[1] = gen_lowpart (DImode, operands[1]);
2422 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2423 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2429 (define_insn "*extendqidi2"
2430 [(set (match_operand:DI 0 "register_operand" "=d")
2431 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2432 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2434 [(set_attr "op_type" "RXY")])
2436 (define_insn_and_split "*extendqidi2_short_displ"
2437 [(set (match_operand:DI 0 "register_operand" "=d")
2438 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2439 (clobber (reg:CC 33))]
2440 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2442 "&& reload_completed"
2444 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2445 (clobber (reg:CC 33))])
2447 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2448 (clobber (reg:CC 33))])]
2452 ; extendhisi2 instruction pattern(s).
2455 (define_expand "extendhisi2"
2456 [(set (match_operand:SI 0 "register_operand" "")
2457 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2461 operands[1] = gen_lowpart (SImode, operands[1]);
2462 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2463 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2468 (define_insn "*extendhisi2"
2469 [(set (match_operand:SI 0 "register_operand" "=d,d")
2470 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2475 [(set_attr "op_type" "RX,RXY")])
2478 ; extendqisi2 instruction pattern(s).
2481 (define_expand "extendqisi2"
2482 [(set (match_operand:SI 0 "register_operand" "")
2483 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2487 operands[1] = gen_lowpart (SImode, operands[1]);
2488 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2489 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2494 (define_insn "*extendqisi2"
2495 [(set (match_operand:SI 0 "register_operand" "=d")
2496 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2497 "TARGET_LONG_DISPLACEMENT"
2499 [(set_attr "op_type" "RXY")])
2501 (define_insn_and_split "*extendqisi2_short_displ"
2502 [(set (match_operand:SI 0 "register_operand" "=d")
2503 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2504 (clobber (reg:CC 33))]
2505 "!TARGET_LONG_DISPLACEMENT"
2507 "&& reload_completed"
2509 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2510 (clobber (reg:CC 33))])
2512 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2513 (clobber (reg:CC 33))])]
2517 ; extendqihi2 instruction pattern(s).
2522 ; zero_extendsidi2 instruction pattern(s).
2525 (define_expand "zero_extendsidi2"
2526 [(set (match_operand:DI 0 "register_operand" "")
2527 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2533 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2534 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2535 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2541 (define_insn "*zero_extendsidi2"
2542 [(set (match_operand:DI 0 "register_operand" "=d,d")
2543 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2548 [(set_attr "op_type" "RRE,RXY")])
2551 ; zero_extendhidi2 instruction pattern(s).
2554 (define_expand "zero_extendhidi2"
2555 [(set (match_operand:DI 0 "register_operand" "")
2556 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2562 rtx tmp = gen_reg_rtx (SImode);
2563 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2564 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2569 operands[1] = gen_lowpart (DImode, operands[1]);
2570 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2571 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2577 (define_insn "*zero_extendhidi2"
2578 [(set (match_operand:DI 0 "register_operand" "=d")
2579 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2582 [(set_attr "op_type" "RXY")])
2585 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2588 (define_insn "*llgt_sidi"
2589 [(set (match_operand:DI 0 "register_operand" "=d")
2590 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2591 (const_int 2147483647)))]
2594 [(set_attr "op_type" "RXE")])
2596 (define_insn_and_split "*llgt_sidi_split"
2597 [(set (match_operand:DI 0 "register_operand" "=d")
2598 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2599 (const_int 2147483647)))
2600 (clobber (reg:CC 33))]
2603 "&& reload_completed"
2605 (and:DI (subreg:DI (match_dup 1) 0)
2606 (const_int 2147483647)))]
2609 (define_insn "*llgt_sisi"
2610 [(set (match_operand:SI 0 "register_operand" "=d,d")
2611 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2612 (const_int 2147483647)))]
2617 [(set_attr "op_type" "RRE,RXE")])
2620 [(set (match_operand:SI 0 "register_operand" "")
2621 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2622 (const_int 2147483647)))
2623 (clobber (reg:CC 33))]
2624 "TARGET_64BIT && reload_completed"
2626 (and:SI (match_dup 1)
2627 (const_int 2147483647)))]
2630 (define_insn "*llgt_didi"
2631 [(set (match_operand:DI 0 "register_operand" "=d,d")
2632 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2633 (const_int 2147483647)))]
2638 [(set_attr "op_type" "RRE,RXE")])
2641 [(set (match_operand:DI 0 "register_operand" "")
2642 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2643 (const_int 2147483647)))
2644 (clobber (reg:CC 33))]
2645 "TARGET_64BIT && reload_completed"
2647 (and:DI (match_dup 1)
2648 (const_int 2147483647)))]
2652 ; zero_extendqidi2 instruction pattern(s)
2655 (define_expand "zero_extendqidi2"
2656 [(set (match_operand:DI 0 "register_operand" "")
2657 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2663 rtx tmp = gen_reg_rtx (SImode);
2664 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2665 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2670 operands[1] = gen_lowpart (DImode, operands[1]);
2671 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2672 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2678 (define_insn "*zero_extendqidi2"
2679 [(set (match_operand:DI 0 "register_operand" "=d")
2680 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2683 [(set_attr "op_type" "RXY")])
2686 ; zero_extendhisi2 instruction pattern(s).
2689 (define_expand "zero_extendhisi2"
2690 [(set (match_operand:SI 0 "register_operand" "")
2691 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2695 operands[1] = gen_lowpart (SImode, operands[1]);
2696 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2701 (define_insn "*zero_extendhisi2_64"
2702 [(set (match_operand:SI 0 "register_operand" "=d")
2703 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2706 [(set_attr "op_type" "RXY")])
2708 (define_insn_and_split "*zero_extendhisi2_31"
2709 [(set (match_operand:SI 0 "register_operand" "=&d")
2710 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2711 (clobber (reg:CC 33))]
2714 "&& reload_completed"
2715 [(set (match_dup 0) (const_int 0))
2717 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2718 (clobber (reg:CC 33))])]
2719 "operands[2] = gen_lowpart (HImode, operands[0]);")
2722 ; zero_extendqisi2 instruction pattern(s).
2725 (define_expand "zero_extendqisi2"
2726 [(set (match_operand:SI 0 "register_operand" "")
2727 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2731 operands[1] = gen_lowpart (SImode, operands[1]);
2732 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2737 (define_insn "*zero_extendqisi2_64"
2738 [(set (match_operand:SI 0 "register_operand" "=d")
2739 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2742 [(set_attr "op_type" "RXY")])
2744 (define_insn_and_split "*zero_extendqisi2_31"
2745 [(set (match_operand:SI 0 "register_operand" "=&d")
2746 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2749 "&& reload_completed"
2750 [(set (match_dup 0) (const_int 0))
2751 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2752 "operands[2] = gen_lowpart (QImode, operands[0]);")
2755 ; zero_extendqihi2 instruction pattern(s).
2758 (define_expand "zero_extendqihi2"
2759 [(set (match_operand:HI 0 "register_operand" "")
2760 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2764 operands[1] = gen_lowpart (HImode, operands[1]);
2765 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2770 (define_insn "*zero_extendqihi2_64"
2771 [(set (match_operand:HI 0 "register_operand" "=d")
2772 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2775 [(set_attr "op_type" "RXY")])
2777 (define_insn_and_split "*zero_extendqihi2_31"
2778 [(set (match_operand:HI 0 "register_operand" "=&d")
2779 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2782 "&& reload_completed"
2783 [(set (match_dup 0) (const_int 0))
2784 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2785 "operands[2] = gen_lowpart (QImode, operands[0]);")
2789 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2792 (define_expand "fixuns_truncdfdi2"
2793 [(set (match_operand:DI 0 "register_operand" "")
2794 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2795 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2797 rtx label1 = gen_label_rtx ();
2798 rtx label2 = gen_label_rtx ();
2799 rtx temp = gen_reg_rtx (DFmode);
2800 operands[1] = force_reg (DFmode, operands[1]);
2802 emit_insn (gen_cmpdf (operands[1],
2803 CONST_DOUBLE_FROM_REAL_VALUE (
2804 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2805 emit_jump_insn (gen_blt (label1));
2806 emit_insn (gen_subdf3 (temp, operands[1],
2807 CONST_DOUBLE_FROM_REAL_VALUE (
2808 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2809 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2812 emit_label (label1);
2813 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2814 emit_label (label2);
2818 (define_expand "fix_truncdfdi2"
2819 [(set (match_operand:DI 0 "register_operand" "")
2820 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2821 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2823 operands[1] = force_reg (DFmode, operands[1]);
2824 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2828 (define_insn "fix_truncdfdi2_ieee"
2829 [(set (match_operand:DI 0 "register_operand" "=d")
2830 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2831 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2832 (clobber (reg:CC 33))]
2833 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2835 [(set_attr "op_type" "RRE")
2836 (set_attr "type" "ftoi")])
2839 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2842 (define_expand "fixuns_truncdfsi2"
2843 [(set (match_operand:SI 0 "register_operand" "")
2844 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2845 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2847 rtx label1 = gen_label_rtx ();
2848 rtx label2 = gen_label_rtx ();
2849 rtx temp = gen_reg_rtx (DFmode);
2851 operands[1] = force_reg (DFmode,operands[1]);
2852 emit_insn (gen_cmpdf (operands[1],
2853 CONST_DOUBLE_FROM_REAL_VALUE (
2854 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2855 emit_jump_insn (gen_blt (label1));
2856 emit_insn (gen_subdf3 (temp, operands[1],
2857 CONST_DOUBLE_FROM_REAL_VALUE (
2858 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2859 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2862 emit_label (label1);
2863 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2864 emit_label (label2);
2868 (define_expand "fix_truncdfsi2"
2869 [(set (match_operand:SI 0 "register_operand" "")
2870 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2873 if (TARGET_IBM_FLOAT)
2875 /* This is the algorithm from POP chapter A.5.7.2. */
2877 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2878 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2879 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2881 operands[1] = force_reg (DFmode, operands[1]);
2882 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2883 two31r, two32, temp));
2887 operands[1] = force_reg (DFmode, operands[1]);
2888 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2894 (define_insn "fix_truncdfsi2_ieee"
2895 [(set (match_operand:SI 0 "register_operand" "=d")
2896 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2897 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2898 (clobber (reg:CC 33))]
2899 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2901 [(set_attr "op_type" "RRE")
2902 (set_attr "type" "ftoi")])
2904 (define_insn "fix_truncdfsi2_ibm"
2905 [(set (match_operand:SI 0 "register_operand" "=d")
2906 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2907 (use (match_operand:DI 2 "immediate_operand" "m"))
2908 (use (match_operand:DI 3 "immediate_operand" "m"))
2909 (use (match_operand:BLK 4 "memory_operand" "m"))
2910 (clobber (reg:CC 33))]
2911 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2913 output_asm_insn ("sd\t%1,%2", operands);
2914 output_asm_insn ("aw\t%1,%3", operands);
2915 output_asm_insn ("std\t%1,%4", operands);
2916 output_asm_insn ("xi\t%N4,128", operands);
2919 [(set_attr "length" "20")])
2922 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2925 (define_expand "fixuns_truncsfdi2"
2926 [(set (match_operand:DI 0 "register_operand" "")
2927 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2928 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2930 rtx label1 = gen_label_rtx ();
2931 rtx label2 = gen_label_rtx ();
2932 rtx temp = gen_reg_rtx (SFmode);
2934 operands[1] = force_reg (SFmode, operands[1]);
2935 emit_insn (gen_cmpsf (operands[1],
2936 CONST_DOUBLE_FROM_REAL_VALUE (
2937 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2938 emit_jump_insn (gen_blt (label1));
2940 emit_insn (gen_subsf3 (temp, operands[1],
2941 CONST_DOUBLE_FROM_REAL_VALUE (
2942 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2943 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2946 emit_label (label1);
2947 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2948 emit_label (label2);
2952 (define_expand "fix_truncsfdi2"
2953 [(set (match_operand:DI 0 "register_operand" "")
2954 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2955 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2957 operands[1] = force_reg (SFmode, operands[1]);
2958 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2962 (define_insn "fix_truncsfdi2_ieee"
2963 [(set (match_operand:DI 0 "register_operand" "=d")
2964 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2965 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2966 (clobber (reg:CC 33))]
2967 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2969 [(set_attr "op_type" "RRE")
2970 (set_attr "type" "ftoi")])
2973 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2976 (define_expand "fixuns_truncsfsi2"
2977 [(set (match_operand:SI 0 "register_operand" "")
2978 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2979 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2981 rtx label1 = gen_label_rtx ();
2982 rtx label2 = gen_label_rtx ();
2983 rtx temp = gen_reg_rtx (SFmode);
2985 operands[1] = force_reg (SFmode, operands[1]);
2986 emit_insn (gen_cmpsf (operands[1],
2987 CONST_DOUBLE_FROM_REAL_VALUE (
2988 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
2989 emit_jump_insn (gen_blt (label1));
2990 emit_insn (gen_subsf3 (temp, operands[1],
2991 CONST_DOUBLE_FROM_REAL_VALUE (
2992 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
2993 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
2996 emit_label (label1);
2997 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2998 emit_label (label2);
3002 (define_expand "fix_truncsfsi2"
3003 [(set (match_operand:SI 0 "register_operand" "")
3004 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
3007 if (TARGET_IBM_FLOAT)
3009 /* Convert to DFmode and then use the POP algorithm. */
3010 rtx temp = gen_reg_rtx (DFmode);
3011 emit_insn (gen_extendsfdf2 (temp, operands[1]));
3012 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
3016 operands[1] = force_reg (SFmode, operands[1]);
3017 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3023 (define_insn "fix_truncsfsi2_ieee"
3024 [(set (match_operand:SI 0 "register_operand" "=d")
3025 (fix:SI (match_operand:SF 1 "register_operand" "f")))
3026 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3027 (clobber (reg:CC 33))]
3028 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3030 [(set_attr "op_type" "RRE")
3031 (set_attr "type" "ftoi")])
3034 ; floatdidf2 instruction pattern(s).
3037 (define_insn "floatdidf2"
3038 [(set (match_operand:DF 0 "register_operand" "=f")
3039 (float:DF (match_operand:DI 1 "register_operand" "d")))]
3040 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3042 [(set_attr "op_type" "RRE")
3043 (set_attr "type" "itof" )])
3046 ; floatdisf2 instruction pattern(s).
3049 (define_insn "floatdisf2"
3050 [(set (match_operand:SF 0 "register_operand" "=f")
3051 (float:SF (match_operand:DI 1 "register_operand" "d")))]
3052 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3054 [(set_attr "op_type" "RRE")
3055 (set_attr "type" "itof" )])
3058 ; floatsidf2 instruction pattern(s).
3061 (define_expand "floatsidf2"
3062 [(set (match_operand:DF 0 "register_operand" "")
3063 (float:DF (match_operand:SI 1 "register_operand" "")))]
3066 if (TARGET_IBM_FLOAT)
3068 /* This is the algorithm from POP chapter A.5.7.1. */
3070 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3071 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3073 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3078 (define_insn "floatsidf2_ieee"
3079 [(set (match_operand:DF 0 "register_operand" "=f")
3080 (float:DF (match_operand:SI 1 "register_operand" "d")))]
3081 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3083 [(set_attr "op_type" "RRE")
3084 (set_attr "type" "itof" )])
3086 (define_insn "floatsidf2_ibm"
3087 [(set (match_operand:DF 0 "register_operand" "=f")
3088 (float:DF (match_operand:SI 1 "register_operand" "d")))
3089 (use (match_operand:DI 2 "immediate_operand" "m"))
3090 (use (match_operand:BLK 3 "memory_operand" "m"))
3091 (clobber (reg:CC 33))]
3092 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3094 output_asm_insn ("st\t%1,%N3", operands);
3095 output_asm_insn ("xi\t%N3,128", operands);
3096 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3097 output_asm_insn ("ld\t%0,%3", operands);
3100 [(set_attr "length" "20")])
3103 ; floatsisf2 instruction pattern(s).
3106 (define_expand "floatsisf2"
3107 [(set (match_operand:SF 0 "register_operand" "")
3108 (float:SF (match_operand:SI 1 "register_operand" "")))]
3111 if (TARGET_IBM_FLOAT)
3113 /* Use the POP algorithm to convert to DFmode and then truncate. */
3114 rtx temp = gen_reg_rtx (DFmode);
3115 emit_insn (gen_floatsidf2 (temp, operands[1]));
3116 emit_insn (gen_truncdfsf2 (operands[0], temp));
3121 (define_insn "floatsisf2_ieee"
3122 [(set (match_operand:SF 0 "register_operand" "=f")
3123 (float:SF (match_operand:SI 1 "register_operand" "d")))]
3124 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3126 [(set_attr "op_type" "RRE")
3127 (set_attr "type" "itof" )])
3130 ; truncdfsf2 instruction pattern(s).
3133 (define_expand "truncdfsf2"
3134 [(set (match_operand:SF 0 "register_operand" "")
3135 (float_truncate:SF (match_operand:DF 1 "register_operand" "")))]
3139 (define_insn "truncdfsf2_ieee"
3140 [(set (match_operand:SF 0 "register_operand" "=f")
3141 (float_truncate:SF (match_operand:DF 1 "register_operand" "f")))]
3142 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3144 [(set_attr "op_type" "RRE")])
3146 (define_insn "truncdfsf2_ibm"
3147 [(set (match_operand:SF 0 "register_operand" "=f,f")
3148 (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f,R")))]
3149 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3153 [(set_attr "op_type" "RR,RX")
3154 (set_attr "type" "floads,floads")])
3157 ; extendsfdf2 instruction pattern(s).
3160 (define_expand "extendsfdf2"
3161 [(set (match_operand:DF 0 "register_operand" "")
3162 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3165 if (TARGET_IBM_FLOAT)
3167 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3172 (define_insn "extendsfdf2_ieee"
3173 [(set (match_operand:DF 0 "register_operand" "=f,f")
3174 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3175 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3179 [(set_attr "op_type" "RRE,RXE")
3180 (set_attr "type" "floads,floads")])
3182 (define_insn "extendsfdf2_ibm"
3183 [(set (match_operand:DF 0 "register_operand" "=f,f")
3184 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3185 (clobber (reg:CC 33))]
3186 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3188 sdr\t%0,%0\;ler\t%0,%1
3189 sdr\t%0,%0\;le\t%0,%1"
3190 [(set_attr "length" "4,6")
3191 (set_attr "type" "floads,floads")])
3195 ;; ARITHMETIC OPERATIONS
3197 ; arithmetic operations set the ConditionCode,
3198 ; because of unpredictable Bits in Register for Halfword and Byte
3199 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3202 ;;- Add instructions.
3206 ; addti3 instruction pattern(s).
3209 (define_insn_and_split "addti3"
3210 [(set (match_operand:TI 0 "register_operand" "=&d")
3211 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3212 (match_operand:TI 2 "general_operand" "do") ) )
3213 (clobber (reg:CC 33))]
3216 "&& reload_completed"
3219 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3221 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3223 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3224 (ltu:DI (reg:CCL1 33) (const_int 0))))
3225 (clobber (reg:CC 33))])]
3226 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3227 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3228 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3229 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3230 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3231 operands[8] = operand_subword (operands[2], 1, 0, TImode);")
3234 ; adddi3 instruction pattern(s).
3237 (define_insn "*adddi3_sign"
3238 [(set (match_operand:DI 0 "register_operand" "=d,d")
3239 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3240 (match_operand:DI 1 "register_operand" "0,0")))
3241 (clobber (reg:CC 33))]
3246 [(set_attr "op_type" "RRE,RXY")])
3248 (define_insn "*adddi3_zero_cc"
3250 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3251 (match_operand:DI 1 "register_operand" "0,0"))
3253 (set (match_operand:DI 0 "register_operand" "=d,d")
3254 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3255 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3259 [(set_attr "op_type" "RRE,RXY")])
3261 (define_insn "*adddi3_zero_cconly"
3263 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3264 (match_operand:DI 1 "register_operand" "0,0"))
3266 (clobber (match_scratch:DI 0 "=d,d"))]
3267 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3271 [(set_attr "op_type" "RRE,RXY")])
3273 (define_insn "*adddi3_zero"
3274 [(set (match_operand:DI 0 "register_operand" "=d,d")
3275 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3276 (match_operand:DI 1 "register_operand" "0,0")))
3277 (clobber (reg:CC 33))]
3282 [(set_attr "op_type" "RRE,RXY")])
3284 (define_insn "*adddi3_imm_cc"
3286 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3287 (match_operand:DI 2 "const_int_operand" "K"))
3289 (set (match_operand:DI 0 "register_operand" "=d")
3290 (plus:DI (match_dup 1) (match_dup 2)))]
3292 && s390_match_ccmode (insn, CCAmode)
3293 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3295 [(set_attr "op_type" "RI")])
3297 (define_insn "*adddi3_carry1_cc"
3299 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3300 (match_operand:DI 2 "general_operand" "d,m"))
3302 (set (match_operand:DI 0 "register_operand" "=d,d")
3303 (plus:DI (match_dup 1) (match_dup 2)))]
3304 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3308 [(set_attr "op_type" "RRE,RXY")])
3310 (define_insn "*adddi3_carry1_cconly"
3312 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3313 (match_operand:DI 2 "general_operand" "d,m"))
3315 (clobber (match_scratch:DI 0 "=d,d"))]
3316 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3320 [(set_attr "op_type" "RRE,RXY")])
3322 (define_insn "*adddi3_carry2_cc"
3324 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3325 (match_operand:DI 2 "general_operand" "d,m"))
3327 (set (match_operand:DI 0 "register_operand" "=d,d")
3328 (plus:DI (match_dup 1) (match_dup 2)))]
3329 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3333 [(set_attr "op_type" "RRE,RXY")])
3335 (define_insn "*adddi3_carry2_cconly"
3337 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3338 (match_operand:DI 2 "general_operand" "d,m"))
3340 (clobber (match_scratch:DI 0 "=d,d"))]
3341 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3345 [(set_attr "op_type" "RRE,RXY")])
3347 (define_insn "*adddi3_cc"
3349 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3350 (match_operand:DI 2 "general_operand" "d,m"))
3352 (set (match_operand:DI 0 "register_operand" "=d,d")
3353 (plus:DI (match_dup 1) (match_dup 2)))]
3354 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3358 [(set_attr "op_type" "RRE,RXY")])
3360 (define_insn "*adddi3_cconly"
3362 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3363 (match_operand:DI 2 "general_operand" "d,m"))
3365 (clobber (match_scratch:DI 0 "=d,d"))]
3366 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3370 [(set_attr "op_type" "RRE,RXY")])
3372 (define_insn "*adddi3_cconly2"
3374 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3375 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3376 (clobber (match_scratch:DI 0 "=d,d"))]
3377 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3381 [(set_attr "op_type" "RRE,RXY")])
3383 (define_insn "*adddi3_64"
3384 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3385 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3386 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3387 (clobber (reg:CC 33))]
3393 [(set_attr "op_type" "RRE,RI,RXY")])
3395 (define_insn_and_split "*adddi3_31z"
3396 [(set (match_operand:DI 0 "register_operand" "=&d")
3397 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3398 (match_operand:DI 2 "general_operand" "do") ) )
3399 (clobber (reg:CC 33))]
3400 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3402 "&& reload_completed"
3405 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3407 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3409 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3410 (ltu:SI (reg:CCL1 33) (const_int 0))))
3411 (clobber (reg:CC 33))])]
3412 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3413 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3414 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3415 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3416 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3417 operands[8] = operand_subword (operands[2], 1, 0, DImode);")
3419 (define_insn_and_split "*adddi3_31"
3420 [(set (match_operand:DI 0 "register_operand" "=&d")
3421 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3422 (match_operand:DI 2 "general_operand" "do") ) )
3423 (clobber (reg:CC 33))]
3426 "&& reload_completed"
3428 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3429 (clobber (reg:CC 33))])
3432 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3434 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3436 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3438 (label_ref (match_dup 9))))
3440 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3441 (clobber (reg:CC 33))])
3443 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3444 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3445 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3446 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3447 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3448 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3449 operands[9] = gen_label_rtx ();")
3451 (define_expand "adddi3"
3453 [(set (match_operand:DI 0 "register_operand" "")
3454 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3455 (match_operand:DI 2 "general_operand" "")))
3456 (clobber (reg:CC 33))])]
3461 ; addsi3 instruction pattern(s).
3464 (define_insn "*addsi3_imm_cc"
3466 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3467 (match_operand:SI 2 "const_int_operand" "K"))
3469 (set (match_operand:SI 0 "register_operand" "=d")
3470 (plus:SI (match_dup 1) (match_dup 2)))]
3471 "s390_match_ccmode (insn, CCAmode)
3472 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3474 [(set_attr "op_type" "RI")])
3476 (define_insn "*addsi3_carry1_cc"
3478 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3479 (match_operand:SI 2 "general_operand" "d,R,T"))
3481 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3482 (plus:SI (match_dup 1) (match_dup 2)))]
3483 "s390_match_ccmode (insn, CCL1mode)"
3488 [(set_attr "op_type" "RR,RX,RXY")])
3490 (define_insn "*addsi3_carry1_cconly"
3492 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3493 (match_operand:SI 2 "general_operand" "d,R,T"))
3495 (clobber (match_scratch:SI 0 "=d,d,d"))]
3496 "s390_match_ccmode (insn, CCL1mode)"
3501 [(set_attr "op_type" "RR,RX,RXY")])
3503 (define_insn "*addsi3_carry2_cc"
3505 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3506 (match_operand:SI 2 "general_operand" "d,R,T"))
3508 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3509 (plus:SI (match_dup 1) (match_dup 2)))]
3510 "s390_match_ccmode (insn, CCL1mode)"
3515 [(set_attr "op_type" "RR,RX,RXY")])
3517 (define_insn "*addsi3_carry2_cconly"
3519 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3520 (match_operand:SI 2 "general_operand" "d,R,T"))
3522 (clobber (match_scratch:SI 0 "=d,d,d"))]
3523 "s390_match_ccmode (insn, CCL1mode)"
3528 [(set_attr "op_type" "RR,RX,RXY")])
3530 (define_insn "*addsi3_cc"
3532 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3533 (match_operand:SI 2 "general_operand" "d,R,T"))
3535 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3536 (plus:SI (match_dup 1) (match_dup 2)))]
3537 "s390_match_ccmode (insn, CCLmode)"
3542 [(set_attr "op_type" "RR,RX,RXY")])
3544 (define_insn "*addsi3_cconly"
3546 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3547 (match_operand:SI 2 "general_operand" "d,R,T"))
3549 (clobber (match_scratch:SI 0 "=d,d,d"))]
3550 "s390_match_ccmode (insn, CCLmode)"
3555 [(set_attr "op_type" "RR,RX,RXY")])
3557 (define_insn "*addsi3_cconly2"
3559 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3560 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3561 (clobber (match_scratch:SI 0 "=d,d,d"))]
3562 "s390_match_ccmode (insn, CCLmode)"
3567 [(set_attr "op_type" "RR,RX,RXY")])
3569 (define_insn "*addsi3_sign"
3570 [(set (match_operand:SI 0 "register_operand" "=d,d")
3571 (plus:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))
3572 (match_operand:SI 1 "register_operand" "0,0")))
3573 (clobber (reg:CC 33))]
3578 [(set_attr "op_type" "RX,RXY")])
3580 (define_insn "addsi3"
3581 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3582 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3583 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3584 (clobber (reg:CC 33))]
3591 [(set_attr "op_type" "RR,RI,RX,RXY")])
3594 ; adddf3 instruction pattern(s).
3597 (define_expand "adddf3"
3599 [(set (match_operand:DF 0 "register_operand" "=f,f")
3600 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3601 (match_operand:DF 2 "general_operand" "f,R")))
3602 (clobber (reg:CC 33))])]
3606 (define_insn "*adddf3"
3607 [(set (match_operand:DF 0 "register_operand" "=f,f")
3608 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3609 (match_operand:DF 2 "general_operand" "f,R")))
3610 (clobber (reg:CC 33))]
3611 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3615 [(set_attr "op_type" "RRE,RXE")
3616 (set_attr "type" "fsimpd,fsimpd")])
3618 (define_insn "*adddf3_cc"
3620 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3621 (match_operand:DF 2 "general_operand" "f,R"))
3622 (match_operand:DF 3 "const0_operand" "")))
3623 (set (match_operand:DF 0 "register_operand" "=f,f")
3624 (plus:DF (match_dup 1) (match_dup 2)))]
3625 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3629 [(set_attr "op_type" "RRE,RXE")
3630 (set_attr "type" "fsimpd,fsimpd")])
3632 (define_insn "*adddf3_cconly"
3634 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3635 (match_operand:DF 2 "general_operand" "f,R"))
3636 (match_operand:DF 3 "const0_operand" "")))
3637 (clobber (match_scratch:DF 0 "=f,f"))]
3638 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3642 [(set_attr "op_type" "RRE,RXE")
3643 (set_attr "type" "fsimpd,fsimpd")])
3645 (define_insn "*adddf3_ibm"
3646 [(set (match_operand:DF 0 "register_operand" "=f,f")
3647 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3648 (match_operand:DF 2 "general_operand" "f,R")))
3649 (clobber (reg:CC 33))]
3650 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3654 [(set_attr "op_type" "RR,RX")
3655 (set_attr "type" "fsimpd,fsimpd")])
3658 ; addsf3 instruction pattern(s).
3661 (define_expand "addsf3"
3663 [(set (match_operand:SF 0 "register_operand" "=f,f")
3664 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3665 (match_operand:SF 2 "general_operand" "f,R")))
3666 (clobber (reg:CC 33))])]
3670 (define_insn "*addsf3"
3671 [(set (match_operand:SF 0 "register_operand" "=f,f")
3672 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3673 (match_operand:SF 2 "general_operand" "f,R")))
3674 (clobber (reg:CC 33))]
3675 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3679 [(set_attr "op_type" "RRE,RXE")
3680 (set_attr "type" "fsimps,fsimps")])
3682 (define_insn "*addsf3_cc"
3684 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3685 (match_operand:SF 2 "general_operand" "f,R"))
3686 (match_operand:SF 3 "const0_operand" "")))
3687 (set (match_operand:SF 0 "register_operand" "=f,f")
3688 (plus:SF (match_dup 1) (match_dup 2)))]
3689 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3693 [(set_attr "op_type" "RRE,RXE")
3694 (set_attr "type" "fsimps,fsimps")])
3696 (define_insn "*addsf3_cconly"
3698 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3699 (match_operand:SF 2 "general_operand" "f,R"))
3700 (match_operand:SF 3 "const0_operand" "")))
3701 (clobber (match_scratch:SF 0 "=f,f"))]
3702 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3706 [(set_attr "op_type" "RRE,RXE")
3707 (set_attr "type" "fsimps,fsimps")])
3709 (define_insn "*addsf3"
3710 [(set (match_operand:SF 0 "register_operand" "=f,f")
3711 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3712 (match_operand:SF 2 "general_operand" "f,R")))
3713 (clobber (reg:CC 33))]
3714 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3718 [(set_attr "op_type" "RR,RX")
3719 (set_attr "type" "fsimps,fsimps")])
3723 ;;- Subtract instructions.
3727 ; subti3 instruction pattern(s).
3730 (define_insn_and_split "subti3"
3731 [(set (match_operand:TI 0 "register_operand" "=&d")
3732 (minus:TI (match_operand:TI 1 "register_operand" "0")
3733 (match_operand:TI 2 "general_operand" "do") ) )
3734 (clobber (reg:CC 33))]
3737 "&& reload_completed"
3740 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3742 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3744 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3745 (gtu:DI (reg:CCL2 33) (const_int 0))))
3746 (clobber (reg:CC 33))])]
3747 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3748 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3749 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3750 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3751 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3752 operands[8] = operand_subword (operands[2], 1, 0, TImode);")
3755 ; subdi3 instruction pattern(s).
3758 (define_insn "*subdi3_sign"
3759 [(set (match_operand:DI 0 "register_operand" "=d,d")
3760 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3761 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3762 (clobber (reg:CC 33))]
3767 [(set_attr "op_type" "RRE,RXY")])
3769 (define_insn "*subdi3_zero_cc"
3771 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3772 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3774 (set (match_operand:DI 0 "register_operand" "=d,d")
3775 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3776 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3780 [(set_attr "op_type" "RRE,RXY")])
3782 (define_insn "*subdi3_zero_cconly"
3784 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3785 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3787 (clobber (match_scratch:DI 0 "=d,d"))]
3788 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3792 [(set_attr "op_type" "RRE,RXY")])
3794 (define_insn "*subdi3_zero"
3795 [(set (match_operand:DI 0 "register_operand" "=d,d")
3796 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3797 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3798 (clobber (reg:CC 33))]
3803 [(set_attr "op_type" "RRE,RXY")])
3805 (define_insn "*subdi3_borrow_cc"
3807 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3808 (match_operand:DI 2 "general_operand" "d,m"))
3810 (set (match_operand:DI 0 "register_operand" "=d,d")
3811 (minus:DI (match_dup 1) (match_dup 2)))]
3812 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3816 [(set_attr "op_type" "RRE,RXY")])
3818 (define_insn "*subdi3_borrow_cconly"
3820 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3821 (match_operand:DI 2 "general_operand" "d,m"))
3823 (clobber (match_scratch:DI 0 "=d,d"))]
3824 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3828 [(set_attr "op_type" "RRE,RXY")])
3830 (define_insn "*subdi3_cc"
3832 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3833 (match_operand:DI 2 "general_operand" "d,m"))
3835 (set (match_operand:DI 0 "register_operand" "=d,d")
3836 (minus:DI (match_dup 1) (match_dup 2)))]
3837 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3841 [(set_attr "op_type" "RRE,RXY")])
3843 (define_insn "*subdi3_cc2"
3845 (compare (match_operand:DI 1 "register_operand" "0,0")
3846 (match_operand:DI 2 "general_operand" "d,m")))
3847 (set (match_operand:DI 0 "register_operand" "=d,d")
3848 (minus:DI (match_dup 1) (match_dup 2)))]
3849 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3853 [(set_attr "op_type" "RRE,RXY")])
3855 (define_insn "*subdi3_cconly"
3857 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3858 (match_operand:DI 2 "general_operand" "d,m"))
3860 (clobber (match_scratch:DI 0 "=d,d"))]
3861 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3865 [(set_attr "op_type" "RRE,RXY")])
3867 (define_insn "*subdi3_cconly2"
3869 (compare (match_operand:DI 1 "register_operand" "0,0")
3870 (match_operand:DI 2 "general_operand" "d,m")))
3871 (clobber (match_scratch:DI 0 "=d,d"))]
3872 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3876 [(set_attr "op_type" "RRE,RXY")])
3878 (define_insn "*subdi3_64"
3879 [(set (match_operand:DI 0 "register_operand" "=d,d")
3880 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3881 (match_operand:DI 2 "general_operand" "d,m") ) )
3882 (clobber (reg:CC 33))]
3887 [(set_attr "op_type" "RRE,RRE")])
3889 (define_insn_and_split "*subdi3_31z"
3890 [(set (match_operand:DI 0 "register_operand" "=&d")
3891 (minus:DI (match_operand:DI 1 "register_operand" "0")
3892 (match_operand:DI 2 "general_operand" "do") ) )
3893 (clobber (reg:CC 33))]
3894 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3896 "&& reload_completed"
3899 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3901 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3903 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
3904 (gtu:SI (reg:CCL2 33) (const_int 0))))
3905 (clobber (reg:CC 33))])]
3906 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3907 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3908 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3909 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3910 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3911 operands[8] = operand_subword (operands[2], 1, 0, DImode);")
3913 (define_insn_and_split "*subdi3_31"
3914 [(set (match_operand:DI 0 "register_operand" "=&d")
3915 (minus:DI (match_operand:DI 1 "register_operand" "0")
3916 (match_operand:DI 2 "general_operand" "do") ) )
3917 (clobber (reg:CC 33))]
3920 "&& reload_completed"
3922 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3923 (clobber (reg:CC 33))])
3926 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3928 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3930 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3932 (label_ref (match_dup 9))))
3934 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3935 (clobber (reg:CC 33))])
3937 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3938 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3939 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3940 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3941 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3942 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3943 operands[9] = gen_label_rtx ();")
3945 (define_expand "subdi3"
3947 [(set (match_operand:DI 0 "register_operand" "")
3948 (minus:DI (match_operand:DI 1 "register_operand" "")
3949 (match_operand:DI 2 "general_operand" "")))
3950 (clobber (reg:CC 33))])]
3955 ; subsi3 instruction pattern(s).
3958 (define_insn "*subsi3_borrow_cc"
3960 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3961 (match_operand:SI 2 "general_operand" "d,R,T"))
3963 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3964 (minus:SI (match_dup 1) (match_dup 2)))]
3965 "s390_match_ccmode (insn, CCL2mode)"
3970 [(set_attr "op_type" "RR,RX,RXY")])
3972 (define_insn "*subsi3_borrow_cconly"
3974 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3975 (match_operand:SI 2 "general_operand" "d,R,T"))
3977 (clobber (match_scratch:SI 0 "=d,d,d"))]
3978 "s390_match_ccmode (insn, CCL2mode)"
3983 [(set_attr "op_type" "RR,RX,RXY")])
3985 (define_insn "*subsi3_cc"
3987 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3988 (match_operand:SI 2 "general_operand" "d,R,T"))
3990 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3991 (minus:SI (match_dup 1) (match_dup 2)))]
3992 "s390_match_ccmode (insn, CCLmode)"
3997 [(set_attr "op_type" "RR,RX,RXY")])
3999 (define_insn "*subsi3_cc2"
4001 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4002 (match_operand:SI 2 "general_operand" "d,R,T")))
4003 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4004 (minus:SI (match_dup 1) (match_dup 2)))]
4005 "s390_match_ccmode (insn, CCL3mode)"
4010 [(set_attr "op_type" "RR,RX,RXY")])
4012 (define_insn "*subsi3_cconly"
4014 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4015 (match_operand:SI 2 "general_operand" "d,R,T"))
4017 (clobber (match_scratch:SI 0 "=d,d,d"))]
4018 "s390_match_ccmode (insn, CCLmode)"
4023 [(set_attr "op_type" "RR,RX,RXY")])
4025 (define_insn "*subsi3_cconly2"
4027 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4028 (match_operand:SI 2 "general_operand" "d,R,T")))
4029 (clobber (match_scratch:SI 0 "=d,d,d"))]
4030 "s390_match_ccmode (insn, CCL3mode)"
4035 [(set_attr "op_type" "RR,RX,RXY")])
4037 (define_insn "*subsi3_sign"
4038 [(set (match_operand:SI 0 "register_operand" "=d,d")
4039 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4040 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4041 (clobber (reg:CC 33))]
4046 [(set_attr "op_type" "RX,RXY")])
4048 (define_insn "subsi3"
4049 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4050 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4051 (match_operand:SI 2 "general_operand" "d,R,T")))
4052 (clobber (reg:CC 33))]
4058 [(set_attr "op_type" "RR,RX,RXY")])
4062 ; subdf3 instruction pattern(s).
4065 (define_expand "subdf3"
4067 [(set (match_operand:DF 0 "register_operand" "=f,f")
4068 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4069 (match_operand:DF 2 "general_operand" "f,R")))
4070 (clobber (reg:CC 33))])]
4074 (define_insn "*subdf3"
4075 [(set (match_operand:DF 0 "register_operand" "=f,f")
4076 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4077 (match_operand:DF 2 "general_operand" "f,R")))
4078 (clobber (reg:CC 33))]
4079 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4083 [(set_attr "op_type" "RRE,RXE")
4084 (set_attr "type" "fsimpd,fsimpd")])
4086 (define_insn "*subdf3_cc"
4088 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4089 (match_operand:DF 2 "general_operand" "f,R"))
4090 (match_operand:DF 3 "const0_operand" "")))
4091 (set (match_operand:DF 0 "register_operand" "=f,f")
4092 (minus:DF (match_dup 1) (match_dup 2)))]
4093 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4097 [(set_attr "op_type" "RRE,RXE")
4098 (set_attr "type" "fsimpd,fsimpd")])
4100 (define_insn "*subdf3_cconly"
4102 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4103 (match_operand:DF 2 "general_operand" "f,R"))
4104 (match_operand:DF 3 "const0_operand" "")))
4105 (clobber (match_scratch:DF 0 "=f,f"))]
4106 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4110 [(set_attr "op_type" "RRE,RXE")
4111 (set_attr "type" "fsimpd,fsimpd")])
4113 (define_insn "*subdf3_ibm"
4114 [(set (match_operand:DF 0 "register_operand" "=f,f")
4115 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4116 (match_operand:DF 2 "general_operand" "f,R")))
4117 (clobber (reg:CC 33))]
4118 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4122 [(set_attr "op_type" "RR,RX")
4123 (set_attr "type" "fsimpd,fsimpd")])
4126 ; subsf3 instruction pattern(s).
4129 (define_expand "subsf3"
4131 [(set (match_operand:SF 0 "register_operand" "=f,f")
4132 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4133 (match_operand:SF 2 "general_operand" "f,R")))
4134 (clobber (reg:CC 33))])]
4138 (define_insn "*subsf3"
4139 [(set (match_operand:SF 0 "register_operand" "=f,f")
4140 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4141 (match_operand:SF 2 "general_operand" "f,R")))
4142 (clobber (reg:CC 33))]
4143 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4147 [(set_attr "op_type" "RRE,RXE")
4148 (set_attr "type" "fsimps,fsimps")])
4150 (define_insn "*subsf3_cc"
4152 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4153 (match_operand:SF 2 "general_operand" "f,R"))
4154 (match_operand:SF 3 "const0_operand" "")))
4155 (set (match_operand:SF 0 "register_operand" "=f,f")
4156 (minus:SF (match_dup 1) (match_dup 2)))]
4157 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4161 [(set_attr "op_type" "RRE,RXE")
4162 (set_attr "type" "fsimps,fsimps")])
4164 (define_insn "*subsf3_cconly"
4166 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4167 (match_operand:SF 2 "general_operand" "f,R"))
4168 (match_operand:SF 3 "const0_operand" "")))
4169 (clobber (match_scratch:SF 0 "=f,f"))]
4170 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4174 [(set_attr "op_type" "RRE,RXE")
4175 (set_attr "type" "fsimps,fsimps")])
4177 (define_insn "*subsf3_ibm"
4178 [(set (match_operand:SF 0 "register_operand" "=f,f")
4179 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4180 (match_operand:SF 2 "general_operand" "f,R")))
4181 (clobber (reg:CC 33))]
4182 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4186 [(set_attr "op_type" "RR,RX")
4187 (set_attr "type" "fsimps,fsimps")])
4191 ;;- Conditional add/subtract instructions.
4195 ; adddicc instruction pattern(s).
4198 (define_insn "*adddi3_alc_cc"
4201 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4202 (match_operand:DI 2 "general_operand" "d,m"))
4203 (match_operand:DI 3 "s390_alc_comparison" ""))
4205 (set (match_operand:DI 0 "register_operand" "=d,d")
4206 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4207 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4211 [(set_attr "op_type" "RRE,RXY")])
4213 (define_insn "*adddi3_alc"
4214 [(set (match_operand:DI 0 "register_operand" "=d,d")
4215 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4216 (match_operand:DI 2 "general_operand" "d,m"))
4217 (match_operand:DI 3 "s390_alc_comparison" "")))
4218 (clobber (reg:CC 33))]
4223 [(set_attr "op_type" "RRE,RXY")])
4225 (define_insn "*subdi3_slb_cc"
4228 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4229 (match_operand:DI 2 "general_operand" "d,m"))
4230 (match_operand:DI 3 "s390_slb_comparison" ""))
4232 (set (match_operand:DI 0 "register_operand" "=d,d")
4233 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4234 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4238 [(set_attr "op_type" "RRE,RXY")])
4240 (define_insn "*subdi3_slb"
4241 [(set (match_operand:DI 0 "register_operand" "=d,d")
4242 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4243 (match_operand:DI 2 "general_operand" "d,m"))
4244 (match_operand:DI 3 "s390_slb_comparison" "")))
4245 (clobber (reg:CC 33))]
4250 [(set_attr "op_type" "RRE,RXY")])
4252 (define_expand "adddicc"
4253 [(match_operand:DI 0 "register_operand" "")
4254 (match_operand 1 "comparison_operator" "")
4255 (match_operand:DI 2 "register_operand" "")
4256 (match_operand:DI 3 "const_int_operand" "")]
4258 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4259 s390_compare_op0, s390_compare_op1,
4260 operands[0], operands[2],
4261 operands[3])) FAIL; DONE;")
4264 ; addsicc instruction pattern(s).
4267 (define_insn "*addsi3_alc_cc"
4270 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4271 (match_operand:SI 2 "general_operand" "d,m"))
4272 (match_operand:SI 3 "s390_alc_comparison" ""))
4274 (set (match_operand:SI 0 "register_operand" "=d,d")
4275 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4276 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4280 [(set_attr "op_type" "RRE,RXY")])
4282 (define_insn "*addsi3_alc"
4283 [(set (match_operand:SI 0 "register_operand" "=d,d")
4284 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4285 (match_operand:SI 2 "general_operand" "d,m"))
4286 (match_operand:SI 3 "s390_alc_comparison" "")))
4287 (clobber (reg:CC 33))]
4292 [(set_attr "op_type" "RRE,RXY")])
4294 (define_insn "*subsi3_slb_cc"
4297 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4298 (match_operand:SI 2 "general_operand" "d,m"))
4299 (match_operand:SI 3 "s390_slb_comparison" ""))
4301 (set (match_operand:SI 0 "register_operand" "=d,d")
4302 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4303 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4307 [(set_attr "op_type" "RRE,RXY")])
4309 (define_insn "*subsi3_slb"
4310 [(set (match_operand:SI 0 "register_operand" "=d,d")
4311 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4312 (match_operand:SI 2 "general_operand" "d,m"))
4313 (match_operand:SI 3 "s390_slb_comparison" "")))
4314 (clobber (reg:CC 33))]
4319 [(set_attr "op_type" "RRE,RXY")])
4321 (define_expand "addsicc"
4322 [(match_operand:SI 0 "register_operand" "")
4323 (match_operand 1 "comparison_operator" "")
4324 (match_operand:SI 2 "register_operand" "")
4325 (match_operand:SI 3 "const_int_operand" "")]
4327 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4328 s390_compare_op0, s390_compare_op1,
4329 operands[0], operands[2],
4330 operands[3])) FAIL; DONE;")
4333 ; scond instruction pattern(s).
4336 (define_insn_and_split "*sconddi"
4337 [(set (match_operand:DI 0 "register_operand" "=&d")
4338 (match_operand:DI 1 "s390_alc_comparison" ""))
4339 (clobber (reg:CC 33))]
4342 "&& reload_completed"
4343 [(set (match_dup 0) (const_int 0))
4345 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4347 (clobber (reg:CC 33))])]
4350 (define_insn_and_split "*scondsi"
4351 [(set (match_operand:SI 0 "register_operand" "=&d")
4352 (match_operand:SI 1 "s390_alc_comparison" ""))
4353 (clobber (reg:CC 33))]
4356 "&& reload_completed"
4357 [(set (match_dup 0) (const_int 0))
4359 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4361 (clobber (reg:CC 33))])]
4364 (define_insn_and_split "*sconddi_neg"
4365 [(set (match_operand:DI 0 "register_operand" "=&d")
4366 (match_operand:DI 1 "s390_slb_comparison" ""))
4367 (clobber (reg:CC 33))]
4370 "&& reload_completed"
4371 [(set (match_dup 0) (const_int 0))
4373 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4375 (clobber (reg:CC 33))])
4377 [(set (match_dup 0) (neg:DI (match_dup 0)))
4378 (clobber (reg:CC 33))])]
4381 (define_insn_and_split "*scondsi_neg"
4382 [(set (match_operand:SI 0 "register_operand" "=&d")
4383 (match_operand:SI 1 "s390_slb_comparison" ""))
4384 (clobber (reg:CC 33))]
4387 "&& reload_completed"
4388 [(set (match_dup 0) (const_int 0))
4390 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4392 (clobber (reg:CC 33))])
4394 [(set (match_dup 0) (neg:SI (match_dup 0)))
4395 (clobber (reg:CC 33))])]
4398 (define_expand "sltu"
4399 [(match_operand:SI 0 "register_operand" "")]
4401 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4402 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4404 (define_expand "sgtu"
4405 [(match_operand:SI 0 "register_operand" "")]
4407 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4408 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4410 (define_expand "sleu"
4411 [(match_operand:SI 0 "register_operand" "")]
4413 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4414 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4416 (define_expand "sgeu"
4417 [(match_operand:SI 0 "register_operand" "")]
4419 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4420 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4424 ;;- Multiply instructions.
4428 ; muldi3 instruction pattern(s).
4431 (define_insn "*muldi3_sign"
4432 [(set (match_operand:DI 0 "register_operand" "=d,d")
4433 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4434 (match_operand:DI 1 "register_operand" "0,0")))]
4439 [(set_attr "op_type" "RRE,RXY")
4440 (set_attr "type" "imuldi")])
4442 (define_insn "muldi3"
4443 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4444 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4445 (match_operand:DI 2 "general_operand" "d,K,m")))]
4451 [(set_attr "op_type" "RRE,RI,RXY")
4452 (set_attr "type" "imuldi")])
4455 ; mulsi3 instruction pattern(s).
4458 (define_insn "*mulsi3_sign"
4459 [(set (match_operand:SI 0 "register_operand" "=d")
4460 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4461 (match_operand:SI 1 "register_operand" "0")))]
4464 [(set_attr "op_type" "RX")
4465 (set_attr "type" "imulhi")])
4467 (define_insn "mulsi3"
4468 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4469 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4470 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4477 [(set_attr "op_type" "RRE,RI,RX,RXY")
4478 (set_attr "type" "imulsi,imulhi,imulsi,imulsi")])
4481 ; mulsidi3 instruction pattern(s).
4484 (define_insn "mulsidi3"
4485 [(set (match_operand:DI 0 "register_operand" "=d,d")
4486 (mult:DI (sign_extend:DI
4487 (match_operand:SI 1 "register_operand" "%0,0"))
4489 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4494 [(set_attr "op_type" "RR,RX")
4495 (set_attr "type" "imulsi")])
4498 ; umulsidi3 instruction pattern(s).
4501 (define_insn "umulsidi3"
4502 [(set (match_operand:DI 0 "register_operand" "=d,d")
4503 (mult:DI (zero_extend:DI
4504 (match_operand:SI 1 "register_operand" "%0,0"))
4506 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4507 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4511 [(set_attr "op_type" "RRE,RXY")
4512 (set_attr "type" "imulsi")])
4515 ; muldf3 instruction pattern(s).
4518 (define_expand "muldf3"
4519 [(set (match_operand:DF 0 "register_operand" "=f,f")
4520 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4521 (match_operand:DF 2 "general_operand" "f,R")))]
4525 (define_insn "*muldf3"
4526 [(set (match_operand:DF 0 "register_operand" "=f,f")
4527 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4528 (match_operand:DF 2 "general_operand" "f,R")))]
4529 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4533 [(set_attr "op_type" "RRE,RXE")
4534 (set_attr "type" "fmuld")])
4536 (define_insn "*muldf3_ibm"
4537 [(set (match_operand:DF 0 "register_operand" "=f,f")
4538 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4539 (match_operand:DF 2 "general_operand" "f,R")))]
4540 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4544 [(set_attr "op_type" "RR,RX")
4545 (set_attr "type" "fmuld")])
4547 (define_insn "*fmadddf"
4548 [(set (match_operand:DF 0 "register_operand" "=f,f")
4549 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4550 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4551 (match_operand:DF 3 "register_operand" "0,0")))]
4552 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4556 [(set_attr "op_type" "RRE,RXE")
4557 (set_attr "type" "fmuld")])
4559 (define_insn "*fmsubdf"
4560 [(set (match_operand:DF 0 "register_operand" "=f,f")
4561 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4562 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4563 (match_operand:DF 3 "register_operand" "0,0")))]
4564 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4568 [(set_attr "op_type" "RRE,RXE")
4569 (set_attr "type" "fmuld")])
4572 ; mulsf3 instruction pattern(s).
4575 (define_expand "mulsf3"
4576 [(set (match_operand:SF 0 "register_operand" "=f,f")
4577 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4578 (match_operand:SF 2 "general_operand" "f,R")))]
4582 (define_insn "*mulsf3"
4583 [(set (match_operand:SF 0 "register_operand" "=f,f")
4584 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4585 (match_operand:SF 2 "general_operand" "f,R")))]
4586 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4590 [(set_attr "op_type" "RRE,RXE")
4591 (set_attr "type" "fmuls")])
4593 (define_insn "*mulsf3_ibm"
4594 [(set (match_operand:SF 0 "register_operand" "=f,f")
4595 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4596 (match_operand:SF 2 "general_operand" "f,R")))]
4597 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4601 [(set_attr "op_type" "RR,RX")
4602 (set_attr "type" "fmuls")])
4604 (define_insn "*fmaddsf"
4605 [(set (match_operand:SF 0 "register_operand" "=f,f")
4606 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4607 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4608 (match_operand:SF 3 "register_operand" "0,0")))]
4609 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4613 [(set_attr "op_type" "RRE,RXE")
4614 (set_attr "type" "fmuls")])
4616 (define_insn "*fmsubsf"
4617 [(set (match_operand:SF 0 "register_operand" "=f,f")
4618 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4619 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4620 (match_operand:SF 3 "register_operand" "0,0")))]
4621 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4625 [(set_attr "op_type" "RRE,RXE")
4626 (set_attr "type" "fmuls")])
4629 ;;- Divide and modulo instructions.
4633 ; divmoddi4 instruction pattern(s).
4636 (define_expand "divmoddi4"
4637 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4638 (div:DI (match_operand:DI 1 "register_operand" "")
4639 (match_operand:DI 2 "general_operand" "")))
4640 (set (match_operand:DI 3 "general_operand" "")
4641 (mod:DI (match_dup 1) (match_dup 2)))])
4642 (clobber (match_dup 4))]
4645 rtx insn, div_equal, mod_equal;
4647 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4648 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4650 operands[4] = gen_reg_rtx(TImode);
4651 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4653 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4655 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4657 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4659 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4664 (define_insn "divmodtidi3"
4665 [(set (match_operand:TI 0 "register_operand" "=d,d")
4669 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4670 (match_operand:DI 2 "general_operand" "d,m")))
4672 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4677 [(set_attr "op_type" "RRE,RXY")
4678 (set_attr "type" "idiv")])
4680 (define_insn "divmodtisi3"
4681 [(set (match_operand:TI 0 "register_operand" "=d,d")
4685 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4687 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4690 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4695 [(set_attr "op_type" "RRE,RXY")
4696 (set_attr "type" "idiv")])
4699 ; udivmoddi4 instruction pattern(s).
4702 (define_expand "udivmoddi4"
4703 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4704 (udiv:DI (match_operand:DI 1 "general_operand" "")
4705 (match_operand:DI 2 "nonimmediate_operand" "")))
4706 (set (match_operand:DI 3 "general_operand" "")
4707 (umod:DI (match_dup 1) (match_dup 2)))])
4708 (clobber (match_dup 4))]
4711 rtx insn, div_equal, mod_equal, equal;
4713 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4714 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4715 equal = gen_rtx_IOR (TImode,
4716 gen_rtx_ASHIFT (TImode,
4717 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4719 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4721 operands[4] = gen_reg_rtx(TImode);
4722 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4723 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4724 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4725 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4727 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4729 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4731 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4733 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4735 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4740 (define_insn "udivmodtidi3"
4741 [(set (match_operand:TI 0 "register_operand" "=d,d")
4746 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4748 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4752 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4757 [(set_attr "op_type" "RRE,RXY")
4758 (set_attr "type" "idiv")])
4761 ; divmodsi4 instruction pattern(s).
4764 (define_expand "divmodsi4"
4765 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4766 (div:SI (match_operand:SI 1 "general_operand" "")
4767 (match_operand:SI 2 "nonimmediate_operand" "")))
4768 (set (match_operand:SI 3 "general_operand" "")
4769 (mod:SI (match_dup 1) (match_dup 2)))])
4770 (clobber (match_dup 4))]
4773 rtx insn, div_equal, mod_equal, equal;
4775 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4776 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4777 equal = gen_rtx_IOR (DImode,
4778 gen_rtx_ASHIFT (DImode,
4779 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4781 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4783 operands[4] = gen_reg_rtx(DImode);
4784 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4785 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4787 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4789 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4791 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4793 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4795 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4800 (define_insn "divmoddisi3"
4801 [(set (match_operand:DI 0 "register_operand" "=d,d")
4806 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4808 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4812 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4817 [(set_attr "op_type" "RR,RX")
4818 (set_attr "type" "idiv")])
4821 ; udivsi3 and umodsi3 instruction pattern(s).
4824 (define_expand "udivmodsi4"
4825 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4826 (udiv:SI (match_operand:SI 1 "general_operand" "")
4827 (match_operand:SI 2 "nonimmediate_operand" "")))
4828 (set (match_operand:SI 3 "general_operand" "")
4829 (umod:SI (match_dup 1) (match_dup 2)))])
4830 (clobber (match_dup 4))]
4831 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4833 rtx insn, div_equal, mod_equal, equal;
4835 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4836 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4837 equal = gen_rtx_IOR (DImode,
4838 gen_rtx_ASHIFT (DImode,
4839 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4841 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4843 operands[4] = gen_reg_rtx(DImode);
4844 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4845 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4846 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4847 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4849 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4851 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4853 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4855 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4857 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4862 (define_insn "udivmoddisi3"
4863 [(set (match_operand:DI 0 "register_operand" "=d,d")
4868 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
4870 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4874 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
4875 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4879 [(set_attr "op_type" "RRE,RXY")
4880 (set_attr "type" "idiv")])
4882 (define_expand "udivsi3"
4883 [(set (match_operand:SI 0 "register_operand" "=d")
4884 (udiv:SI (match_operand:SI 1 "general_operand" "")
4885 (match_operand:SI 2 "general_operand" "")))
4886 (clobber (match_dup 3))]
4887 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4889 rtx insn, udiv_equal, umod_equal, equal;
4891 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4892 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4893 equal = gen_rtx_IOR (DImode,
4894 gen_rtx_ASHIFT (DImode,
4895 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4897 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4899 operands[3] = gen_reg_rtx (DImode);
4901 if (CONSTANT_P (operands[2]))
4903 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4905 rtx label1 = gen_label_rtx ();
4907 operands[1] = make_safe_from (operands[1], operands[0]);
4908 emit_move_insn (operands[0], const0_rtx);
4909 emit_insn (gen_cmpsi (operands[1], operands[2]));
4910 emit_jump_insn (gen_bltu (label1));
4911 emit_move_insn (operands[0], const1_rtx);
4912 emit_label (label1);
4916 operands[2] = force_reg (SImode, operands[2]);
4917 operands[2] = make_safe_from (operands[2], operands[0]);
4919 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4920 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4923 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4925 insn = emit_move_insn (operands[0],
4926 gen_lowpart (SImode, operands[3]));
4928 gen_rtx_EXPR_LIST (REG_EQUAL,
4929 udiv_equal, REG_NOTES (insn));
4934 rtx label1 = gen_label_rtx ();
4935 rtx label2 = gen_label_rtx ();
4936 rtx label3 = gen_label_rtx ();
4938 operands[1] = force_reg (SImode, operands[1]);
4939 operands[1] = make_safe_from (operands[1], operands[0]);
4940 operands[2] = force_reg (SImode, operands[2]);
4941 operands[2] = make_safe_from (operands[2], operands[0]);
4943 emit_move_insn (operands[0], const0_rtx);
4944 emit_insn (gen_cmpsi (operands[2], operands[1]));
4945 emit_jump_insn (gen_bgtu (label3));
4946 emit_insn (gen_cmpsi (operands[2], const0_rtx));
4947 emit_jump_insn (gen_blt (label2));
4948 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4949 emit_jump_insn (gen_beq (label1));
4950 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4951 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4954 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4956 insn = emit_move_insn (operands[0],
4957 gen_lowpart (SImode, operands[3]));
4959 gen_rtx_EXPR_LIST (REG_EQUAL,
4960 udiv_equal, REG_NOTES (insn));
4962 emit_label (label1);
4963 emit_move_insn (operands[0], operands[1]);
4965 emit_label (label2);
4966 emit_move_insn (operands[0], const1_rtx);
4967 emit_label (label3);
4969 emit_move_insn (operands[0], operands[0]);
4973 (define_expand "umodsi3"
4974 [(set (match_operand:SI 0 "register_operand" "=d")
4975 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
4976 (match_operand:SI 2 "nonimmediate_operand" "")))
4977 (clobber (match_dup 3))]
4978 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4980 rtx insn, udiv_equal, umod_equal, equal;
4982 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4983 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4984 equal = gen_rtx_IOR (DImode,
4985 gen_rtx_ASHIFT (DImode,
4986 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4988 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4990 operands[3] = gen_reg_rtx (DImode);
4992 if (CONSTANT_P (operands[2]))
4994 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
4996 rtx label1 = gen_label_rtx ();
4998 operands[1] = make_safe_from (operands[1], operands[0]);
4999 emit_move_insn (operands[0], operands[1]);
5000 emit_insn (gen_cmpsi (operands[0], operands[2]));
5001 emit_jump_insn (gen_bltu (label1));
5002 emit_insn (gen_abssi2 (operands[0], operands[2]));
5003 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
5004 emit_label (label1);
5008 operands[2] = force_reg (SImode, operands[2]);
5009 operands[2] = make_safe_from (operands[2], operands[0]);
5011 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5012 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5015 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5017 insn = emit_move_insn (operands[0],
5018 gen_highpart (SImode, operands[3]));
5020 gen_rtx_EXPR_LIST (REG_EQUAL,
5021 umod_equal, REG_NOTES (insn));
5026 rtx label1 = gen_label_rtx ();
5027 rtx label2 = gen_label_rtx ();
5028 rtx label3 = gen_label_rtx ();
5030 operands[1] = force_reg (SImode, operands[1]);
5031 operands[1] = make_safe_from (operands[1], operands[0]);
5032 operands[2] = force_reg (SImode, operands[2]);
5033 operands[2] = make_safe_from (operands[2], operands[0]);
5035 emit_move_insn(operands[0], operands[1]);
5036 emit_insn (gen_cmpsi (operands[2], operands[1]));
5037 emit_jump_insn (gen_bgtu (label3));
5038 emit_insn (gen_cmpsi (operands[2], const0_rtx));
5039 emit_jump_insn (gen_blt (label2));
5040 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5041 emit_jump_insn (gen_beq (label1));
5042 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5043 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5046 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5048 insn = emit_move_insn (operands[0],
5049 gen_highpart (SImode, operands[3]));
5051 gen_rtx_EXPR_LIST (REG_EQUAL,
5052 umod_equal, REG_NOTES (insn));
5054 emit_label (label1);
5055 emit_move_insn (operands[0], const0_rtx);
5057 emit_label (label2);
5058 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5059 emit_label (label3);
5065 ; divdf3 instruction pattern(s).
5068 (define_expand "divdf3"
5069 [(set (match_operand:DF 0 "register_operand" "=f,f")
5070 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5071 (match_operand:DF 2 "general_operand" "f,R")))]
5075 (define_insn "*divdf3"
5076 [(set (match_operand:DF 0 "register_operand" "=f,f")
5077 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5078 (match_operand:DF 2 "general_operand" "f,R")))]
5079 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5083 [(set_attr "op_type" "RRE,RXE")
5084 (set_attr "type" "fdivd")])
5086 (define_insn "*divdf3_ibm"
5087 [(set (match_operand:DF 0 "register_operand" "=f,f")
5088 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5089 (match_operand:DF 2 "general_operand" "f,R")))]
5090 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5094 [(set_attr "op_type" "RR,RX")
5095 (set_attr "type" "fdivd")])
5098 ; divsf3 instruction pattern(s).
5101 (define_expand "divsf3"
5102 [(set (match_operand:SF 0 "register_operand" "=f,f")
5103 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5104 (match_operand:SF 2 "general_operand" "f,R")))]
5108 (define_insn "*divsf3"
5109 [(set (match_operand:SF 0 "register_operand" "=f,f")
5110 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5111 (match_operand:SF 2 "general_operand" "f,R")))]
5112 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5116 [(set_attr "op_type" "RRE,RXE")
5117 (set_attr "type" "fdivs")])
5119 (define_insn "*divsf3"
5120 [(set (match_operand:SF 0 "register_operand" "=f,f")
5121 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5122 (match_operand:SF 2 "general_operand" "f,R")))]
5123 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5127 [(set_attr "op_type" "RR,RX")
5128 (set_attr "type" "fdivs")])
5132 ;;- And instructions.
5136 ; anddi3 instruction pattern(s).
5139 (define_insn "*anddi3_cc"
5141 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5142 (match_operand:DI 2 "general_operand" "d,m"))
5144 (set (match_operand:DI 0 "register_operand" "=d,d")
5145 (and:DI (match_dup 1) (match_dup 2)))]
5146 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5150 [(set_attr "op_type" "RRE,RXY")])
5152 (define_insn "*anddi3_cconly"
5154 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5155 (match_operand:DI 2 "general_operand" "d,m"))
5157 (clobber (match_scratch:DI 0 "=d,d"))]
5158 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
5159 /* Do not steal TM patterns. */
5160 && s390_single_part (operands[2], DImode, HImode, 0) < 0"
5164 [(set_attr "op_type" "RRE,RXY")])
5166 (define_insn "*anddi3"
5167 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
5168 (and:DI (match_operand:DI 1 "nonimmediate_operand"
5169 "%d,o,0,0,0,0,0,0,0,0")
5170 (match_operand:DI 2 "general_operand"
5171 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q")))
5172 (clobber (reg:CC 33))]
5173 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5185 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY,SI,SS")])
5188 [(set (match_operand:DI 0 "s_operand" "")
5189 (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5190 (clobber (reg:CC 33))]
5193 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5194 (clobber (reg:CC 33))])]
5195 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5197 (define_expand "anddi3"
5198 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5199 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
5200 (match_operand:DI 2 "general_operand" "")))
5201 (clobber (reg:CC 33))]
5203 "s390_expand_logical_operator (AND, DImode, operands); DONE;")
5206 ; andsi3 instruction pattern(s).
5209 (define_insn "*andsi3_cc"
5211 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5212 (match_operand:SI 2 "general_operand" "d,R,T"))
5214 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5215 (and:SI (match_dup 1) (match_dup 2)))]
5216 "s390_match_ccmode(insn, CCTmode)"
5221 [(set_attr "op_type" "RR,RX,RXY")])
5223 (define_insn "*andsi3_cconly"
5225 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5226 (match_operand:SI 2 "general_operand" "d,R,T"))
5228 (clobber (match_scratch:SI 0 "=d,d,d"))]
5229 "s390_match_ccmode(insn, CCTmode)
5230 /* Do not steal TM patterns. */
5231 && s390_single_part (operands[2], SImode, HImode, 0) < 0"
5236 [(set_attr "op_type" "RR,RX,RXY")])
5238 (define_insn "*andsi3_zarch"
5239 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,AQ,Q")
5240 (and:SI (match_operand:SI 1 "nonimmediate_operand"
5241 "%d,o,0,0,0,0,0,0,0")
5242 (match_operand:SI 2 "general_operand"
5243 "M,M,N0HSF,N1HSF,d,R,T,NxQSF,Q")))
5244 (clobber (reg:CC 33))]
5245 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5256 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY,SI,SS")])
5258 (define_insn "*andsi3_esa"
5259 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5260 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
5261 (match_operand:SI 2 "general_operand" "d,R,NxQSF,Q")))
5262 (clobber (reg:CC 33))]
5263 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5269 [(set_attr "op_type" "RR,RX,SI,SS")])
5272 [(set (match_operand:SI 0 "s_operand" "")
5273 (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5274 (clobber (reg:CC 33))]
5277 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5278 (clobber (reg:CC 33))])]
5279 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5281 (define_expand "andsi3"
5282 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5283 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5284 (match_operand:SI 2 "general_operand" "")))
5285 (clobber (reg:CC 33))]
5287 "s390_expand_logical_operator (AND, SImode, operands); DONE;")
5290 ; andhi3 instruction pattern(s).
5293 (define_insn "*andhi3_zarch"
5294 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5295 (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0")
5296 (match_operand:HI 2 "general_operand" "d,n,NxQHF,Q")))
5297 (clobber (reg:CC 33))]
5298 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5304 [(set_attr "op_type" "RR,RI,SI,SS")])
5306 (define_insn "*andhi3_esa"
5307 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5308 (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5309 (match_operand:HI 2 "general_operand" "d,NxQHF,Q")))
5310 (clobber (reg:CC 33))]
5311 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5316 [(set_attr "op_type" "RR,SI,SS")])
5319 [(set (match_operand:HI 0 "s_operand" "")
5320 (and:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5321 (clobber (reg:CC 33))]
5324 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5325 (clobber (reg:CC 33))])]
5326 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5328 (define_expand "andhi3"
5329 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5330 (and:HI (match_operand:HI 1 "nonimmediate_operand" "")
5331 (match_operand:HI 2 "general_operand" "")))
5332 (clobber (reg:CC 33))]
5334 "s390_expand_logical_operator (AND, HImode, operands); DONE;")
5337 ; andqi3 instruction pattern(s).
5340 (define_insn "*andqi3_zarch"
5341 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q")
5342 (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0")
5343 (match_operand:QI 2 "general_operand" "d,n,n,n,Q")))
5344 (clobber (reg:CC 33))]
5345 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5352 [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5354 (define_insn "*andqi3_esa"
5355 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5356 (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
5357 (match_operand:QI 2 "general_operand" "d,n,Q")))
5358 (clobber (reg:CC 33))]
5359 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5364 [(set_attr "op_type" "RR,SI,SS")])
5366 (define_expand "andqi3"
5367 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5368 (and:QI (match_operand:QI 1 "nonimmediate_operand" "")
5369 (match_operand:QI 2 "general_operand" "")))
5370 (clobber (reg:CC 33))]
5372 "s390_expand_logical_operator (AND, QImode, operands); DONE;")
5375 ; Block and (NC) patterns.
5379 [(set (match_operand:BLK 0 "memory_operand" "=Q")
5380 (and:BLK (match_dup 0)
5381 (match_operand:BLK 1 "memory_operand" "Q")))
5382 (use (match_operand 2 "const_int_operand" "n"))
5383 (clobber (reg:CC 33))]
5384 "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256"
5385 "nc\t%O0(%2,%R0),%S1"
5386 [(set_attr "op_type" "SS")])
5389 [(set (match_operand 0 "memory_operand" "")
5391 (match_operand 1 "memory_operand" "")))
5392 (clobber (reg:CC 33))]
5394 && GET_MODE (operands[0]) == GET_MODE (operands[1])
5395 && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
5397 [(set (match_dup 0) (and:BLK (match_dup 0) (match_dup 1)))
5399 (clobber (reg:CC 33))])]
5401 operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
5402 operands[0] = adjust_address (operands[0], BLKmode, 0);
5403 operands[1] = adjust_address (operands[1], BLKmode, 0);
5408 [(set (match_operand:BLK 0 "memory_operand" "")
5409 (and:BLK (match_dup 0)
5410 (match_operand:BLK 1 "memory_operand" "")))
5411 (use (match_operand 2 "const_int_operand" ""))
5412 (clobber (reg:CC 33))])
5414 [(set (match_operand:BLK 3 "memory_operand" "")
5415 (and:BLK (match_dup 3)
5416 (match_operand:BLK 4 "memory_operand" "")))
5417 (use (match_operand 5 "const_int_operand" ""))
5418 (clobber (reg:CC 33))])]
5419 "s390_offset_p (operands[0], operands[3], operands[2])
5420 && s390_offset_p (operands[1], operands[4], operands[2])
5421 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5423 [(set (match_dup 6) (and:BLK (match_dup 6) (match_dup 7)))
5425 (clobber (reg:CC 33))])]
5426 "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0));
5427 operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0));
5428 operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));")
5432 ;;- Bit set (inclusive or) instructions.
5436 ; iordi3 instruction pattern(s).
5439 (define_insn "*iordi3_cc"
5441 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5442 (match_operand:DI 2 "general_operand" "d,m"))
5444 (set (match_operand:DI 0 "register_operand" "=d,d")
5445 (ior:DI (match_dup 1) (match_dup 2)))]
5446 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5450 [(set_attr "op_type" "RRE,RXY")])
5452 (define_insn "*iordi3_cconly"
5454 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5455 (match_operand:DI 2 "general_operand" "d,m"))
5457 (clobber (match_scratch:DI 0 "=d,d"))]
5458 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5462 [(set_attr "op_type" "RRE,RXY")])
5464 (define_insn "*iordi3"
5465 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
5466 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0")
5467 (match_operand:DI 2 "general_operand"
5468 "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q")))
5469 (clobber (reg:CC 33))]
5470 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5480 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY,SI,SS")])
5483 [(set (match_operand:DI 0 "s_operand" "")
5484 (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5485 (clobber (reg:CC 33))]
5488 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5489 (clobber (reg:CC 33))])]
5490 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5492 (define_expand "iordi3"
5493 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5494 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "")
5495 (match_operand:DI 2 "general_operand" "")))
5496 (clobber (reg:CC 33))]
5498 "s390_expand_logical_operator (IOR, DImode, operands); DONE;")
5501 ; iorsi3 instruction pattern(s).
5504 (define_insn "*iorsi3_cc"
5506 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5507 (match_operand:SI 2 "general_operand" "d,R,T"))
5509 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5510 (ior:SI (match_dup 1) (match_dup 2)))]
5511 "s390_match_ccmode(insn, CCTmode)"
5516 [(set_attr "op_type" "RR,RX,RXY")])
5518 (define_insn "*iorsi3_cconly"
5520 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5521 (match_operand:SI 2 "general_operand" "d,R,T"))
5523 (clobber (match_scratch:SI 0 "=d,d,d"))]
5524 "s390_match_ccmode(insn, CCTmode)"
5529 [(set_attr "op_type" "RR,RX,RXY")])
5531 (define_insn "*iorsi3_zarch"
5532 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,AQ,Q")
5533 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0")
5534 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T,NxQS0,Q")))
5535 (clobber (reg:CC 33))]
5536 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5545 [(set_attr "op_type" "RI,RI,RR,RX,RXY,SI,SS")])
5547 (define_insn "*iorsi3_esa"
5548 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5549 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
5550 (match_operand:SI 2 "general_operand" "d,R,NxQS0,Q")))
5551 (clobber (reg:CC 33))]
5552 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5558 [(set_attr "op_type" "RR,RX,SI,SS")])
5561 [(set (match_operand:SI 0 "s_operand" "")
5562 (ior:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5563 (clobber (reg:CC 33))]
5566 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5567 (clobber (reg:CC 33))])]
5568 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5570 (define_expand "iorsi3"
5571 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5572 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5573 (match_operand:SI 2 "general_operand" "")))
5574 (clobber (reg:CC 33))]
5576 "s390_expand_logical_operator (IOR, SImode, operands); DONE;")
5579 ; iorhi3 instruction pattern(s).
5582 (define_insn "*iorhi3_zarch"
5583 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5584 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0")
5585 (match_operand:HI 2 "general_operand" "d,n,NxQH0,Q")))
5586 (clobber (reg:CC 33))]
5587 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5593 [(set_attr "op_type" "RR,RI,SI,SS")])
5595 (define_insn "*iorhi3_esa"
5596 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5597 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5598 (match_operand:HI 2 "general_operand" "d,NxQH0,Q")))
5599 (clobber (reg:CC 33))]
5600 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5605 [(set_attr "op_type" "RR,SI,SS")])
5608 [(set (match_operand:HI 0 "s_operand" "")
5609 (ior:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5610 (clobber (reg:CC 33))]
5613 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5614 (clobber (reg:CC 33))])]
5615 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5617 (define_expand "iorhi3"
5618 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5619 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "")
5620 (match_operand:HI 2 "general_operand" "")))
5621 (clobber (reg:CC 33))]
5623 "s390_expand_logical_operator (IOR, HImode, operands); DONE;")
5626 ; iorqi3 instruction pattern(s).
5629 (define_insn "*iorqi3_zarch"
5630 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q")
5631 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0")
5632 (match_operand:QI 2 "general_operand" "d,n,n,n,Q")))
5633 (clobber (reg:CC 33))]
5634 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5641 [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5643 (define_insn "*iorqi3_esa"
5644 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5645 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
5646 (match_operand:QI 2 "general_operand" "d,n,Q")))
5647 (clobber (reg:CC 33))]
5648 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5653 [(set_attr "op_type" "RR,SI,SS")])
5655 (define_expand "iorqi3"
5656 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5657 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "")
5658 (match_operand:QI 2 "general_operand" "")))
5659 (clobber (reg:CC 33))]
5661 "s390_expand_logical_operator (IOR, QImode, operands); DONE;")
5664 ; Block inclusive or (OC) patterns.
5668 [(set (match_operand:BLK 0 "memory_operand" "=Q")
5669 (ior:BLK (match_dup 0)
5670 (match_operand:BLK 1 "memory_operand" "Q")))
5671 (use (match_operand 2 "const_int_operand" "n"))
5672 (clobber (reg:CC 33))]
5673 "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256"
5674 "oc\t%O0(%2,%R0),%S1"
5675 [(set_attr "op_type" "SS")])
5678 [(set (match_operand 0 "memory_operand" "")
5680 (match_operand 1 "memory_operand" "")))
5681 (clobber (reg:CC 33))]
5683 && GET_MODE (operands[0]) == GET_MODE (operands[1])
5684 && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
5686 [(set (match_dup 0) (ior:BLK (match_dup 0) (match_dup 1)))
5688 (clobber (reg:CC 33))])]
5690 operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
5691 operands[0] = adjust_address (operands[0], BLKmode, 0);
5692 operands[1] = adjust_address (operands[1], BLKmode, 0);
5697 [(set (match_operand:BLK 0 "memory_operand" "")
5698 (ior:BLK (match_dup 0)
5699 (match_operand:BLK 1 "memory_operand" "")))
5700 (use (match_operand 2 "const_int_operand" ""))
5701 (clobber (reg:CC 33))])
5703 [(set (match_operand:BLK 3 "memory_operand" "")
5704 (ior:BLK (match_dup 3)
5705 (match_operand:BLK 4 "memory_operand" "")))
5706 (use (match_operand 5 "const_int_operand" ""))
5707 (clobber (reg:CC 33))])]
5708 "s390_offset_p (operands[0], operands[3], operands[2])
5709 && s390_offset_p (operands[1], operands[4], operands[2])
5710 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5712 [(set (match_dup 6) (ior:BLK (match_dup 6) (match_dup 7)))
5714 (clobber (reg:CC 33))])]
5715 "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0));
5716 operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0));
5717 operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));")
5721 ;;- Xor instructions.
5725 ; xordi3 instruction pattern(s).
5728 (define_insn "*xordi3_cc"
5730 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5731 (match_operand:DI 2 "general_operand" "d,m"))
5733 (set (match_operand:DI 0 "register_operand" "=d,d")
5734 (xor:DI (match_dup 1) (match_dup 2)))]
5735 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5739 [(set_attr "op_type" "RRE,RXY")])
5741 (define_insn "*xordi3_cconly"
5743 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5744 (match_operand:DI 2 "general_operand" "d,m"))
5746 (clobber (match_scratch:DI 0 "=d,d"))]
5747 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5751 [(set_attr "op_type" "RRE,RXY")])
5753 (define_insn "*xordi3"
5754 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5755 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0")
5756 (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q")))
5757 (clobber (reg:CC 33))]
5758 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5764 [(set_attr "op_type" "RRE,RXY,SI,SS")])
5767 [(set (match_operand:DI 0 "s_operand" "")
5768 (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5769 (clobber (reg:CC 33))]
5772 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5773 (clobber (reg:CC 33))])]
5774 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5776 (define_expand "xordi3"
5777 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5778 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "")
5779 (match_operand:DI 2 "general_operand" "")))
5780 (clobber (reg:CC 33))]
5782 "s390_expand_logical_operator (XOR, DImode, operands); DONE;")
5785 ; xorsi3 instruction pattern(s).
5788 (define_insn "*xorsi3_cc"
5790 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5791 (match_operand:SI 2 "general_operand" "d,R,T"))
5793 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5794 (xor:SI (match_dup 1) (match_dup 2)))]
5795 "s390_match_ccmode(insn, CCTmode)"
5800 [(set_attr "op_type" "RR,RX,RXY")])
5802 (define_insn "*xorsi3_cconly"
5804 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5805 (match_operand:SI 2 "general_operand" "d,R,T"))
5807 (clobber (match_scratch:SI 0 "=d,d,d"))]
5808 "s390_match_ccmode(insn, CCTmode)"
5813 [(set_attr "op_type" "RR,RX,RXY")])
5815 (define_insn "*xorsi3"
5816 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,AQ,Q")
5817 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0")
5818 (match_operand:SI 2 "general_operand" "d,R,T,NxQS0,Q")))
5819 (clobber (reg:CC 33))]
5820 "s390_logical_operator_ok_p (operands)"
5827 [(set_attr "op_type" "RR,RX,RXY,SI,SS")])
5830 [(set (match_operand:SI 0 "s_operand" "")
5831 (xor:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5832 (clobber (reg:CC 33))]
5835 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5836 (clobber (reg:CC 33))])]
5837 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5839 (define_expand "xorsi3"
5840 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5841 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "")
5842 (match_operand:SI 2 "general_operand" "")))
5843 (clobber (reg:CC 33))]
5845 "s390_expand_logical_operator (XOR, SImode, operands); DONE;")
5848 ; xorhi3 instruction pattern(s).
5851 (define_insn "*xorhi3"
5852 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5853 (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5854 (match_operand:HI 2 "general_operand" "d,NxQH0,Q")))
5855 (clobber (reg:CC 33))]
5856 "s390_logical_operator_ok_p (operands)"
5861 [(set_attr "op_type" "RR,SI,SS")])
5864 [(set (match_operand:HI 0 "s_operand" "")
5865 (xor:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5866 (clobber (reg:CC 33))]
5869 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5870 (clobber (reg:CC 33))])]
5871 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5873 (define_expand "xorhi3"
5874 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5875 (xor:HI (match_operand:HI 1 "nonimmediate_operand" "")
5876 (match_operand:HI 2 "general_operand" "")))
5877 (clobber (reg:CC 33))]
5879 "s390_expand_logical_operator (XOR, HImode, operands); DONE;")
5882 ; xorqi3 instruction pattern(s).
5885 (define_insn "*xorqi3"
5886 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,S,Q")
5887 (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0")
5888 (match_operand:QI 2 "general_operand" "d,n,n,Q")))
5889 (clobber (reg:CC 33))]
5890 "s390_logical_operator_ok_p (operands)"
5896 [(set_attr "op_type" "RR,SI,SIY,SS")])
5898 (define_expand "xorqi3"
5899 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5900 (xor:QI (match_operand:QI 1 "nonimmediate_operand" "")
5901 (match_operand:QI 2 "general_operand" "")))
5902 (clobber (reg:CC 33))]
5904 "s390_expand_logical_operator (XOR, QImode, operands); DONE;")
5907 ; Block exclusive or (XC) patterns.
5911 [(set (match_operand:BLK 0 "memory_operand" "=Q")
5912 (xor:BLK (match_dup 0)
5913 (match_operand:BLK 1 "memory_operand" "Q")))
5914 (use (match_operand 2 "const_int_operand" "n"))
5915 (clobber (reg:CC 33))]
5916 "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256"
5917 "xc\t%O0(%2,%R0),%S1"
5918 [(set_attr "op_type" "SS")])
5921 [(set (match_operand 0 "memory_operand" "")
5923 (match_operand 1 "memory_operand" "")))
5924 (clobber (reg:CC 33))]
5926 && GET_MODE (operands[0]) == GET_MODE (operands[1])
5927 && GET_MODE_SIZE (GET_MODE (operands[0])) > 0"
5929 [(set (match_dup 0) (xor:BLK (match_dup 0) (match_dup 1)))
5931 (clobber (reg:CC 33))])]
5933 operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])));
5934 operands[0] = adjust_address (operands[0], BLKmode, 0);
5935 operands[1] = adjust_address (operands[1], BLKmode, 0);
5940 [(set (match_operand:BLK 0 "memory_operand" "")
5941 (xor:BLK (match_dup 0)
5942 (match_operand:BLK 1 "memory_operand" "")))
5943 (use (match_operand 2 "const_int_operand" ""))
5944 (clobber (reg:CC 33))])
5946 [(set (match_operand:BLK 3 "memory_operand" "")
5947 (xor:BLK (match_dup 3)
5948 (match_operand:BLK 4 "memory_operand" "")))
5949 (use (match_operand 5 "const_int_operand" ""))
5950 (clobber (reg:CC 33))])]
5951 "s390_offset_p (operands[0], operands[3], operands[2])
5952 && s390_offset_p (operands[1], operands[4], operands[2])
5953 && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256"
5955 [(set (match_dup 6) (xor:BLK (match_dup 6) (match_dup 7)))
5957 (clobber (reg:CC 33))])]
5958 "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0));
5959 operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0));
5960 operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));")
5963 ; Block xor (XC) patterns with src == dest.
5966 (define_insn "*xc_zero"
5967 [(set (match_operand:BLK 0 "memory_operand" "=Q")
5969 (use (match_operand 1 "const_int_operand" "n"))
5970 (clobber (reg:CC 33))]
5971 "INTVAL (operands[1]) >= 1 && INTVAL (operands[1]) <= 256"
5972 "xc\t%O0(%1,%R0),%S0"
5973 [(set_attr "op_type" "SS")])
5977 [(set (match_operand:BLK 0 "memory_operand" "")
5979 (use (match_operand 1 "const_int_operand" ""))
5980 (clobber (reg:CC 33))])
5982 [(set (match_operand:BLK 2 "memory_operand" "")
5984 (use (match_operand 3 "const_int_operand" ""))
5985 (clobber (reg:CC 33))])]
5986 "s390_offset_p (operands[0], operands[2], operands[1])
5987 && INTVAL (operands[1]) + INTVAL (operands[3]) <= 256"
5989 [(set (match_dup 4) (const_int 0))
5991 (clobber (reg:CC 33))])]
5992 "operands[4] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0));
5993 operands[5] = GEN_INT (INTVAL (operands[1]) + INTVAL (operands[3]));")
5997 ;;- Negate instructions.
6001 ; negdi2 instruction pattern(s).
6004 (define_expand "negdi2"
6006 [(set (match_operand:DI 0 "register_operand" "=d")
6007 (neg:DI (match_operand:DI 1 "register_operand" "d")))
6008 (clobber (reg:CC 33))])]
6012 (define_insn "*negdi2_sign_cc"
6014 (compare (neg:DI (ashiftrt:DI (ashift:DI (subreg:DI
6015 (match_operand:SI 1 "register_operand" "d") 0)
6016 (const_int 32)) (const_int 32)))
6018 (set (match_operand:DI 0 "register_operand" "=d")
6019 (neg:DI (sign_extend:DI (match_dup 1))))]
6020 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6022 [(set_attr "op_type" "RRE")])
6024 (define_insn "*negdi2_sign"
6025 [(set (match_operand:DI 0 "register_operand" "=d")
6026 (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))
6027 (clobber (reg:CC 33))]
6030 [(set_attr "op_type" "RRE")])
6032 (define_insn "*negdi2_cc"
6034 (compare (neg:DI (match_operand:DI 1 "register_operand" "d"))
6036 (set (match_operand:DI 0 "register_operand" "=d")
6037 (neg:DI (match_dup 1)))]
6038 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6040 [(set_attr "op_type" "RRE")])
6042 (define_insn "*negdi2_cconly"
6044 (compare (neg:DI (match_operand:DI 1 "register_operand" "d"))
6046 (clobber (match_scratch:DI 0 "=d"))]
6047 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6049 [(set_attr "op_type" "RRE")])
6051 (define_insn "*negdi2_64"
6052 [(set (match_operand:DI 0 "register_operand" "=d")
6053 (neg:DI (match_operand:DI 1 "register_operand" "d")))
6054 (clobber (reg:CC 33))]
6057 [(set_attr "op_type" "RRE")])
6059 (define_insn_and_split "*negdi2_31"
6060 [(set (match_operand:DI 0 "register_operand" "=d")
6061 (neg:DI (match_operand:DI 1 "register_operand" "d")))
6062 (clobber (reg:CC 33))]
6065 "&& reload_completed"
6067 [(set (match_dup 2) (neg:SI (match_dup 3)))
6068 (clobber (reg:CC 33))])
6071 (compare:CCAP (neg:SI (match_dup 5)) (const_int 0)))
6072 (set (match_dup 4) (neg:SI (match_dup 5)))])
6074 (if_then_else (ne (reg:CCAP 33) (const_int 0))
6076 (label_ref (match_dup 6))))
6078 [(set (match_dup 2) (plus:SI (match_dup 2) (const_int -1)))
6079 (clobber (reg:CC 33))])
6081 "operands[2] = operand_subword (operands[0], 0, 0, DImode);
6082 operands[3] = operand_subword (operands[1], 0, 0, DImode);
6083 operands[4] = operand_subword (operands[0], 1, 0, DImode);
6084 operands[5] = operand_subword (operands[1], 1, 0, DImode);
6085 operands[6] = gen_label_rtx ();")
6088 ; negsi2 instruction pattern(s).
6091 (define_insn "*negsi2_cc"
6093 (compare (neg:SI (match_operand:SI 1 "register_operand" "d"))
6095 (set (match_operand:SI 0 "register_operand" "=d")
6096 (neg:SI (match_dup 1)))]
6097 "s390_match_ccmode (insn, CCAmode)"
6099 [(set_attr "op_type" "RR")])
6101 (define_insn "*negsi2_cconly"
6103 (compare (neg:SI (match_operand:SI 1 "register_operand" "d"))
6105 (clobber (match_scratch:SI 0 "=d"))]
6106 "s390_match_ccmode (insn, CCAmode)"
6108 [(set_attr "op_type" "RR")])
6110 (define_insn "negsi2"
6111 [(set (match_operand:SI 0 "register_operand" "=d")
6112 (neg:SI (match_operand:SI 1 "register_operand" "d")))
6113 (clobber (reg:CC 33))]
6116 [(set_attr "op_type" "RR")])
6119 ; negdf2 instruction pattern(s).
6122 (define_expand "negdf2"
6124 [(set (match_operand:DF 0 "register_operand" "=f")
6125 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6126 (clobber (reg:CC 33))])]
6130 (define_insn "*negdf2_cc"
6132 (compare (neg:DF (match_operand:DF 1 "register_operand" "f"))
6133 (match_operand:DF 2 "const0_operand" "")))
6134 (set (match_operand:DF 0 "register_operand" "=f")
6135 (neg:DF (match_dup 1)))]
6136 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6138 [(set_attr "op_type" "RRE")
6139 (set_attr "type" "fsimpd")])
6141 (define_insn "*negdf2_cconly"
6143 (compare (neg:DF (match_operand:DF 1 "register_operand" "f"))
6144 (match_operand:DF 2 "const0_operand" "")))
6145 (clobber (match_scratch:DF 0 "=f"))]
6146 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6148 [(set_attr "op_type" "RRE")
6149 (set_attr "type" "fsimpd")])
6151 (define_insn "*negdf2"
6152 [(set (match_operand:DF 0 "register_operand" "=f")
6153 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6154 (clobber (reg:CC 33))]
6155 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6157 [(set_attr "op_type" "RRE")
6158 (set_attr "type" "fsimpd")])
6160 (define_insn "*negdf2_ibm"
6161 [(set (match_operand:DF 0 "register_operand" "=f")
6162 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6163 (clobber (reg:CC 33))]
6164 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6166 [(set_attr "op_type" "RR")
6167 (set_attr "type" "fsimpd")])
6170 ; negsf2 instruction pattern(s).
6173 (define_expand "negsf2"
6175 [(set (match_operand:SF 0 "register_operand" "=f")
6176 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6177 (clobber (reg:CC 33))])]
6181 (define_insn "*negsf2_cc"
6183 (compare (neg:SF (match_operand:SF 1 "register_operand" "f"))
6184 (match_operand:SF 2 "const0_operand" "")))
6185 (set (match_operand:SF 0 "register_operand" "=f")
6186 (neg:SF (match_dup 1)))]
6187 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6189 [(set_attr "op_type" "RRE")
6190 (set_attr "type" "fsimps")])
6192 (define_insn "*negsf2_cconly"
6194 (compare (neg:SF (match_operand:SF 1 "register_operand" "f"))
6195 (match_operand:SF 2 "const0_operand" "")))
6196 (clobber (match_scratch:SF 0 "=f"))]
6197 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6199 [(set_attr "op_type" "RRE")
6200 (set_attr "type" "fsimps")])
6202 (define_insn "*negsf2"
6203 [(set (match_operand:SF 0 "register_operand" "=f")
6204 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6205 (clobber (reg:CC 33))]
6206 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6208 [(set_attr "op_type" "RRE")
6209 (set_attr "type" "fsimps")])
6211 (define_insn "*negsf2"
6212 [(set (match_operand:SF 0 "register_operand" "=f")
6213 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6214 (clobber (reg:CC 33))]
6215 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6217 [(set_attr "op_type" "RR")
6218 (set_attr "type" "fsimps")])
6222 ;;- Absolute value instructions.
6226 ; absdi2 instruction pattern(s).
6229 (define_insn "*absdi2_sign_cc"
6231 (compare (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI
6232 (match_operand:SI 1 "register_operand" "d") 0)
6233 (const_int 32)) (const_int 32)))
6235 (set (match_operand:DI 0 "register_operand" "=d")
6236 (abs:DI (sign_extend:DI (match_dup 1))))]
6237 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6239 [(set_attr "op_type" "RRE")])
6241 (define_insn "*absdi2_sign"
6242 [(set (match_operand:DI 0 "register_operand" "=d")
6243 (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))
6244 (clobber (reg:CC 33))]
6247 [(set_attr "op_type" "RRE")])
6249 (define_insn "*absdi2_cc"
6251 (compare (abs:DI (match_operand:DI 1 "register_operand" "d"))
6253 (set (match_operand:DI 0 "register_operand" "=d")
6254 (abs:DI (match_dup 1)))]
6255 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6257 [(set_attr "op_type" "RRE")])
6259 (define_insn "*absdi2_cconly"
6261 (compare (abs:DI (match_operand:DI 1 "register_operand" "d"))
6263 (clobber (match_scratch:DI 0 "=d"))]
6264 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6266 [(set_attr "op_type" "RRE")])
6268 (define_insn "absdi2"
6269 [(set (match_operand:DI 0 "register_operand" "=d")
6270 (abs:DI (match_operand:DI 1 "register_operand" "d")))
6271 (clobber (reg:CC 33))]
6274 [(set_attr "op_type" "RRE")])
6277 ; abssi2 instruction pattern(s).
6280 (define_insn "*abssi2_cc"
6282 (compare (abs:SI (match_operand:SI 1 "register_operand" "d"))
6284 (set (match_operand:SI 0 "register_operand" "=d")
6285 (abs:SI (match_dup 1)))]
6286 "s390_match_ccmode (insn, CCAmode)"
6288 [(set_attr "op_type" "RR")])
6290 (define_insn "*abssi2_cconly"
6292 (compare (abs:SI (match_operand:SI 1 "register_operand" "d"))
6294 (clobber (match_scratch:SI 0 "=d"))]
6295 "s390_match_ccmode (insn, CCAmode)"
6297 [(set_attr "op_type" "RR")])
6299 (define_insn "abssi2"
6300 [(set (match_operand:SI 0 "register_operand" "=d")
6301 (abs:SI (match_operand:SI 1 "register_operand" "d")))
6302 (clobber (reg:CC 33))]
6305 [(set_attr "op_type" "RR")])
6308 ; absdf2 instruction pattern(s).
6311 (define_expand "absdf2"
6313 [(set (match_operand:DF 0 "register_operand" "=f")
6314 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6315 (clobber (reg:CC 33))])]
6319 (define_insn "*absdf2_cc"
6321 (compare (abs:DF (match_operand:DF 1 "register_operand" "f"))
6322 (match_operand:DF 2 "const0_operand" "")))
6323 (set (match_operand:DF 0 "register_operand" "=f")
6324 (abs:DF (match_dup 1)))]
6325 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6327 [(set_attr "op_type" "RRE")
6328 (set_attr "type" "fsimpd")])
6330 (define_insn "*absdf2_cconly"
6332 (compare (abs:DF (match_operand:DF 1 "register_operand" "f"))
6333 (match_operand:DF 2 "const0_operand" "")))
6334 (clobber (match_scratch:DF 0 "=f"))]
6335 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6337 [(set_attr "op_type" "RRE")
6338 (set_attr "type" "fsimpd")])
6340 (define_insn "*absdf2"
6341 [(set (match_operand:DF 0 "register_operand" "=f")
6342 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6343 (clobber (reg:CC 33))]
6344 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6346 [(set_attr "op_type" "RRE")
6347 (set_attr "type" "fsimpd")])
6349 (define_insn "*absdf2_ibm"
6350 [(set (match_operand:DF 0 "register_operand" "=f")
6351 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6352 (clobber (reg:CC 33))]
6353 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6355 [(set_attr "op_type" "RR")
6356 (set_attr "type" "fsimpd")])
6359 ; abssf2 instruction pattern(s).
6362 (define_expand "abssf2"
6364 [(set (match_operand:SF 0 "register_operand" "=f")
6365 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6366 (clobber (reg:CC 33))])]
6370 (define_insn "*abssf2_cc"
6372 (compare (abs:SF (match_operand:SF 1 "register_operand" "f"))
6373 (match_operand:SF 2 "const0_operand" "")))
6374 (set (match_operand:SF 0 "register_operand" "=f")
6375 (abs:SF (match_dup 1)))]
6376 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6378 [(set_attr "op_type" "RRE")
6379 (set_attr "type" "fsimps")])
6381 (define_insn "*abssf2_cconly"
6383 (compare (abs:SF (match_operand:SF 1 "register_operand" "f"))
6384 (match_operand:SF 2 "const0_operand" "")))
6385 (clobber (match_scratch:SF 0 "=f"))]
6386 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6388 [(set_attr "op_type" "RRE")
6389 (set_attr "type" "fsimps")])
6391 (define_insn "*abssf2"
6392 [(set (match_operand:SF 0 "register_operand" "=f")
6393 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6394 (clobber (reg:CC 33))]
6395 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6397 [(set_attr "op_type" "RRE")
6398 (set_attr "type" "fsimps")])
6400 (define_insn "*abssf2_ibm"
6401 [(set (match_operand:SF 0 "register_operand" "=f")
6402 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6403 (clobber (reg:CC 33))]
6404 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6406 [(set_attr "op_type" "RR")
6407 (set_attr "type" "fsimps")])
6410 ;;- Negated absolute value instructions
6417 (define_insn "*negabsdi2_sign_cc"
6419 (compare (neg:DI (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI
6420 (match_operand:SI 1 "register_operand" "d") 0)
6421 (const_int 32)) (const_int 32))))
6423 (set (match_operand:DI 0 "register_operand" "=d")
6424 (neg:DI (abs:DI (sign_extend:DI (match_dup 1)))))]
6425 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6427 [(set_attr "op_type" "RRE")])
6429 (define_insn "*negabsdi2_sign"
6430 [(set (match_operand:DI 0 "register_operand" "=d")
6431 (neg:DI (abs:DI (sign_extend:DI
6432 (match_operand:SI 1 "register_operand" "d")))))
6433 (clobber (reg:CC 33))]
6436 [(set_attr "op_type" "RRE")])
6438 (define_insn "*negabsdi2_cc"
6440 (compare (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d")))
6442 (set (match_operand:DI 0 "register_operand" "=d")
6443 (neg:DI (abs:DI (match_dup 1))))]
6444 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6446 [(set_attr "op_type" "RRE")])
6448 (define_insn "*negabsdi2_cconly"
6450 (compare (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d")))
6452 (clobber (match_scratch:DI 0 "=d"))]
6453 "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)"
6455 [(set_attr "op_type" "RRE")])
6457 (define_insn "*negabsdi2"
6458 [(set (match_operand:DI 0 "register_operand" "=d")
6459 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
6460 (clobber (reg:CC 33))]
6463 [(set_attr "op_type" "RRE")])
6465 (define_insn "*negabssi2_cc"
6467 (compare (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d")))
6469 (set (match_operand:SI 0 "register_operand" "=d")
6470 (neg:SI (abs:SI (match_dup 1))))]
6471 "s390_match_ccmode (insn, CCAmode)"
6473 [(set_attr "op_type" "RR")])
6475 (define_insn "*negabssi2_cconly"
6477 (compare (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d")))
6479 (clobber (match_scratch:SI 0 "=d"))]
6480 "s390_match_ccmode (insn, CCAmode)"
6482 [(set_attr "op_type" "RR")])
6484 (define_insn "*negabssi2"
6485 [(set (match_operand:SI 0 "register_operand" "=d")
6486 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
6487 (clobber (reg:CC 33))]
6490 [(set_attr "op_type" "RR")])
6496 (define_insn "*negabsdf2_cc"
6498 (compare (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f")))
6499 (match_operand:DF 2 "const0_operand" "")))
6500 (set (match_operand:DF 0 "register_operand" "=f")
6501 (neg:DF (abs:DF (match_dup 1))))]
6502 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6504 [(set_attr "op_type" "RRE")
6505 (set_attr "type" "fsimpd")])
6507 (define_insn "*negabsdf2_cconly"
6509 (compare (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f")))
6510 (match_operand:DF 2 "const0_operand" "")))
6511 (clobber (match_scratch:DF 0 "=f"))]
6512 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6514 [(set_attr "op_type" "RRE")
6515 (set_attr "type" "fsimpd")])
6517 (define_insn "*negabsdf2"
6518 [(set (match_operand:DF 0 "register_operand" "=f")
6519 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6520 (clobber (reg:CC 33))]
6521 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6523 [(set_attr "op_type" "RRE")
6524 (set_attr "type" "fsimpd")])
6526 (define_insn "*negabssf2_cc"
6528 (compare (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f")))
6529 (match_operand:SF 2 "const0_operand" "")))
6530 (set (match_operand:SF 0 "register_operand" "=f")
6531 (neg:SF (abs:SF (match_dup 1))))]
6532 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6534 [(set_attr "op_type" "RRE")
6535 (set_attr "type" "fsimps")])
6537 (define_insn "*negabssf2_cconly"
6539 (compare (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f")))
6540 (match_operand:SF 2 "const0_operand" "")))
6541 (clobber (match_scratch:SF 0 "=f"))]
6542 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6544 [(set_attr "op_type" "RRE")
6545 (set_attr "type" "fsimps")])
6547 (define_insn "*negabssf2"
6548 [(set (match_operand:SF 0 "register_operand" "=f")
6549 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6550 (clobber (reg:CC 33))]
6551 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6553 [(set_attr "op_type" "RRE")
6554 (set_attr "type" "fsimps")])
6557 ;;- Square root instructions.
6561 ; sqrtdf2 instruction pattern(s).
6564 (define_insn "sqrtdf2"
6565 [(set (match_operand:DF 0 "register_operand" "=f,f")
6566 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6567 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6571 [(set_attr "op_type" "RRE,RXE")
6572 (set_attr "type" "fsqrtd")])
6575 ; sqrtsf2 instruction pattern(s).
6578 (define_insn "sqrtsf2"
6579 [(set (match_operand:SF 0 "register_operand" "=f,f")
6580 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6581 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6585 [(set_attr "op_type" "RRE,RXE")
6586 (set_attr "type" "fsqrts")])
6589 ;;- One complement instructions.
6593 ; one_cmpl(di|si|hi|qi)2 instruction pattern(s).
6596 (define_expand "one_cmpl<mode>2"
6598 [(set (match_operand:INT 0 "register_operand" "")
6599 (xor:INT (match_operand:INT 1 "register_operand" "")
6601 (clobber (reg:CC 33))])]
6607 ;;- Rotate instructions.
6611 ; rotldi3 instruction pattern(s).
6614 (define_insn "rotldi3"
6615 [(set (match_operand:DI 0 "register_operand" "=d")
6616 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6617 (match_operand:SI 2 "shift_count_operand" "Y")))]
6620 [(set_attr "op_type" "RSE")
6621 (set_attr "atype" "reg")])
6624 ; rotlsi3 instruction pattern(s).
6627 (define_insn "rotlsi3"
6628 [(set (match_operand:SI 0 "register_operand" "=d")
6629 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6630 (match_operand:SI 2 "shift_count_operand" "Y")))]
6633 [(set_attr "op_type" "RSE")
6634 (set_attr "atype" "reg")])
6638 ;;- Arithmetic shift instructions.
6642 ; ashldi3 instruction pattern(s).
6645 (define_expand "ashldi3"
6646 [(set (match_operand:DI 0 "register_operand" "")
6647 (ashift:DI (match_operand:DI 1 "register_operand" "")
6648 (match_operand:SI 2 "shift_count_operand" "")))]
6652 (define_insn "*ashldi3_31"
6653 [(set (match_operand:DI 0 "register_operand" "=d")
6654 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6655 (match_operand:SI 2 "shift_count_operand" "Y")))]
6658 [(set_attr "op_type" "RS")
6659 (set_attr "atype" "reg")])
6661 (define_insn "*ashldi3_64"
6662 [(set (match_operand:DI 0 "register_operand" "=d")
6663 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6664 (match_operand:SI 2 "shift_count_operand" "Y")))]
6667 [(set_attr "op_type" "RSE")
6668 (set_attr "atype" "reg")])
6671 ; ashrdi3 instruction pattern(s).
6674 (define_expand "ashrdi3"
6676 [(set (match_operand:DI 0 "register_operand" "")
6677 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6678 (match_operand:SI 2 "shift_count_operand" "")))
6679 (clobber (reg:CC 33))])]
6683 (define_insn "*ashrdi3_cc_31"
6685 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6686 (match_operand:SI 2 "shift_count_operand" "Y"))
6688 (set (match_operand:DI 0 "register_operand" "=d")
6689 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6690 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6692 [(set_attr "op_type" "RS")
6693 (set_attr "atype" "reg")])
6695 (define_insn "*ashrdi3_cconly_31"
6697 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6698 (match_operand:SI 2 "shift_count_operand" "Y"))
6700 (clobber (match_scratch:DI 0 "=d"))]
6701 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6703 [(set_attr "op_type" "RS")
6704 (set_attr "atype" "reg")])
6706 (define_insn "*ashrdi3_31"
6707 [(set (match_operand:DI 0 "register_operand" "=d")
6708 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6709 (match_operand:SI 2 "shift_count_operand" "Y")))
6710 (clobber (reg:CC 33))]
6713 [(set_attr "op_type" "RS")
6714 (set_attr "atype" "reg")])
6716 (define_insn "*ashrdi3_cc_64"
6718 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6719 (match_operand:SI 2 "shift_count_operand" "Y"))
6721 (set (match_operand:DI 0 "register_operand" "=d")
6722 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6723 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6725 [(set_attr "op_type" "RSE")
6726 (set_attr "atype" "reg")])
6728 (define_insn "*ashrdi3_cconly_64"
6730 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6731 (match_operand:SI 2 "shift_count_operand" "Y"))
6733 (clobber (match_scratch:DI 0 "=d"))]
6734 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6736 [(set_attr "op_type" "RSE")
6737 (set_attr "atype" "reg")])
6739 (define_insn "*ashrdi3_64"
6740 [(set (match_operand:DI 0 "register_operand" "=d")
6741 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6742 (match_operand:SI 2 "shift_count_operand" "Y")))
6743 (clobber (reg:CC 33))]
6746 [(set_attr "op_type" "RSE")
6747 (set_attr "atype" "reg")])
6751 ; ashlsi3 instruction pattern(s).
6754 (define_insn "ashlsi3"
6755 [(set (match_operand:SI 0 "register_operand" "=d")
6756 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6757 (match_operand:SI 2 "shift_count_operand" "Y")))]
6760 [(set_attr "op_type" "RS")
6761 (set_attr "atype" "reg")])
6764 ; ashrsi3 instruction pattern(s).
6767 (define_insn "*ashrsi3_cc"
6769 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6770 (match_operand:SI 2 "shift_count_operand" "Y"))
6772 (set (match_operand:SI 0 "register_operand" "=d")
6773 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6774 "s390_match_ccmode(insn, CCSmode)"
6776 [(set_attr "op_type" "RS")
6777 (set_attr "atype" "reg")])
6780 (define_insn "*ashrsi3_cconly"
6782 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6783 (match_operand:SI 2 "shift_count_operand" "Y"))
6785 (clobber (match_scratch:SI 0 "=d"))]
6786 "s390_match_ccmode(insn, CCSmode)"
6788 [(set_attr "op_type" "RS")
6789 (set_attr "atype" "reg")])
6791 (define_insn "ashrsi3"
6792 [(set (match_operand:SI 0 "register_operand" "=d")
6793 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6794 (match_operand:SI 2 "shift_count_operand" "Y")))
6795 (clobber (reg:CC 33))]
6798 [(set_attr "op_type" "RS")
6799 (set_attr "atype" "reg")])
6803 ;;- logical shift instructions.
6807 ; lshrdi3 instruction pattern(s).
6810 (define_expand "lshrdi3"
6811 [(set (match_operand:DI 0 "register_operand" "")
6812 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6813 (match_operand:SI 2 "shift_count_operand" "")))]
6817 (define_insn "*lshrdi3_31"
6818 [(set (match_operand:DI 0 "register_operand" "=d")
6819 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6820 (match_operand:SI 2 "shift_count_operand" "Y")))]
6823 [(set_attr "op_type" "RS")
6824 (set_attr "atype" "reg")])
6826 (define_insn "*lshrdi3_64"
6827 [(set (match_operand:DI 0 "register_operand" "=d")
6828 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6829 (match_operand:SI 2 "shift_count_operand" "Y")))]
6832 [(set_attr "op_type" "RSE")
6833 (set_attr "atype" "reg")])
6836 ; lshrsi3 instruction pattern(s).
6839 (define_insn "lshrsi3"
6840 [(set (match_operand:SI 0 "register_operand" "=d")
6841 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6842 (match_operand:SI 2 "shift_count_operand" "Y")))]
6845 [(set_attr "op_type" "RS")
6846 (set_attr "atype" "reg")])
6850 ;; Branch instruction patterns.
6853 (define_expand "b<code>"
6855 (if_then_else (COMPARE (match_operand 0 "" "")
6860 "s390_emit_jump (operands[0],
6861 s390_emit_compare (<CODE>, s390_compare_op0, s390_compare_op1)); DONE;")
6865 ;;- Conditional jump instructions.
6868 (define_insn "*cjump_64"
6871 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6872 (label_ref (match_operand 0 "" ""))
6876 if (get_attr_length (insn) == 4)
6879 return "jg%C1\t%l0";
6881 [(set_attr "op_type" "RI")
6882 (set_attr "type" "branch")
6883 (set (attr "length")
6884 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6885 (const_int 4) (const_int 6)))])
6887 (define_insn "*cjump_31"
6890 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6891 (label_ref (match_operand 0 "" ""))
6895 if (get_attr_length (insn) == 4)
6900 [(set_attr "op_type" "RI")
6901 (set_attr "type" "branch")
6902 (set (attr "length")
6903 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6904 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6905 (const_int 4) (const_int 6))
6906 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6907 (const_int 4) (const_int 8))))])
6909 (define_insn "*cjump_long"
6912 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6913 (match_operand 0 "address_operand" "U")
6917 if (get_attr_op_type (insn) == OP_TYPE_RR)
6922 [(set (attr "op_type")
6923 (if_then_else (match_operand 0 "register_operand" "")
6924 (const_string "RR") (const_string "RX")))
6925 (set_attr "type" "branch")
6926 (set_attr "atype" "agen")])
6930 ;;- Negated conditional jump instructions.
6933 (define_insn "*icjump_64"
6936 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6938 (label_ref (match_operand 0 "" ""))))]
6941 if (get_attr_length (insn) == 4)
6944 return "jg%D1\t%l0";
6946 [(set_attr "op_type" "RI")
6947 (set_attr "type" "branch")
6948 (set (attr "length")
6949 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6950 (const_int 4) (const_int 6)))])
6952 (define_insn "*icjump_31"
6955 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6957 (label_ref (match_operand 0 "" ""))))]
6960 if (get_attr_length (insn) == 4)
6965 [(set_attr "op_type" "RI")
6966 (set_attr "type" "branch")
6967 (set (attr "length")
6968 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6969 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6970 (const_int 4) (const_int 6))
6971 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6972 (const_int 4) (const_int 8))))])
6974 (define_insn "*icjump_long"
6977 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6979 (match_operand 0 "address_operand" "U")))]
6982 if (get_attr_op_type (insn) == OP_TYPE_RR)
6987 [(set (attr "op_type")
6988 (if_then_else (match_operand 0 "register_operand" "")
6989 (const_string "RR") (const_string "RX")))
6990 (set_attr "type" "branch")
6991 (set_attr "atype" "agen")])
6994 ;;- Trap instructions.
6998 [(trap_if (const_int 1) (const_int 0))]
7001 [(set_attr "op_type" "RI")
7002 (set_attr "type" "branch")])
7004 (define_expand "conditional_trap"
7005 [(trap_if (match_operand 0 "comparison_operator" "")
7006 (match_operand 1 "general_operand" ""))]
7009 if (operands[1] != const0_rtx) FAIL;
7010 operands[0] = s390_emit_compare (GET_CODE (operands[0]),
7011 s390_compare_op0, s390_compare_op1);
7014 (define_insn "*trap"
7015 [(trap_if (match_operator 0 "s390_comparison" [(reg 33) (const_int 0)])
7019 [(set_attr "op_type" "RI")
7020 (set_attr "type" "branch")])
7023 ;;- Loop instructions.
7025 ;; This is all complicated by the fact that since this is a jump insn
7026 ;; we must handle our own output reloads.
7028 (define_expand "doloop_end"
7029 [(use (match_operand 0 "" "")) ; loop pseudo
7030 (use (match_operand 1 "" "")) ; iterations; zero if unknown
7031 (use (match_operand 2 "" "")) ; max iterations
7032 (use (match_operand 3 "" "")) ; loop level
7033 (use (match_operand 4 "" ""))] ; label
7036 if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
7037 emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
7038 else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
7039 emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
7040 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
7041 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
7048 (define_insn_and_split "doloop_si64"
7051 (ne (match_operand:SI 1 "register_operand" "d,d")
7053 (label_ref (match_operand 0 "" ""))
7055 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
7056 (plus:SI (match_dup 1) (const_int -1)))
7057 (clobber (match_scratch:SI 3 "=X,&1"))
7058 (clobber (reg:CC 33))]
7061 if (which_alternative != 0)
7063 else if (get_attr_length (insn) == 4)
7064 return "brct\t%1,%l0";
7066 return "ahi\t%1,-1\;jgne\t%l0";
7068 "&& reload_completed
7069 && (! REG_P (operands[2])
7070 || ! rtx_equal_p (operands[1], operands[2]))"
7071 [(parallel [(set (reg:CCAN 33)
7072 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
7074 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
7075 (set (match_dup 2) (match_dup 3))
7076 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
7077 (label_ref (match_dup 0))
7080 [(set_attr "op_type" "RI")
7081 (set_attr "type" "branch")
7082 (set (attr "length")
7083 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7084 (const_int 4) (const_int 10)))])
7086 (define_insn_and_split "doloop_si31"
7089 (ne (match_operand:SI 1 "register_operand" "d,d")
7091 (label_ref (match_operand 0 "" ""))
7093 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
7094 (plus:SI (match_dup 1) (const_int -1)))
7095 (clobber (match_scratch:SI 3 "=X,&1"))
7096 (clobber (reg:CC 33))]
7099 if (which_alternative != 0)
7101 else if (get_attr_length (insn) == 4)
7102 return "brct\t%1,%l0";
7106 "&& reload_completed
7107 && (! REG_P (operands[2])
7108 || ! rtx_equal_p (operands[1], operands[2]))"
7109 [(parallel [(set (reg:CCAN 33)
7110 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
7112 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
7113 (set (match_dup 2) (match_dup 3))
7114 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
7115 (label_ref (match_dup 0))
7118 [(set_attr "op_type" "RI")
7119 (set_attr "type" "branch")
7120 (set (attr "length")
7121 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
7122 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7123 (const_int 4) (const_int 6))
7124 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7125 (const_int 4) (const_int 8))))])
7127 (define_insn "*doloop_si_long"
7130 (ne (match_operand:SI 1 "register_operand" "d,d")
7132 (match_operand 0 "address_operand" "U,U")
7134 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
7135 (plus:SI (match_dup 1) (const_int -1)))
7136 (clobber (match_scratch:SI 3 "=X,&1"))
7137 (clobber (reg:CC 33))]
7140 if (get_attr_op_type (insn) == OP_TYPE_RR)
7141 return "bctr\t%1,%0";
7143 return "bct\t%1,%a0";
7145 [(set (attr "op_type")
7146 (if_then_else (match_operand 0 "register_operand" "")
7147 (const_string "RR") (const_string "RX")))
7148 (set_attr "type" "branch")
7149 (set_attr "atype" "agen")])
7151 (define_insn_and_split "doloop_di"
7154 (ne (match_operand:DI 1 "register_operand" "d,d")
7156 (label_ref (match_operand 0 "" ""))
7158 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*d")
7159 (plus:DI (match_dup 1) (const_int -1)))
7160 (clobber (match_scratch:DI 3 "=X,&1"))
7161 (clobber (reg:CC 33))]
7164 if (which_alternative != 0)
7166 else if (get_attr_length (insn) == 4)
7167 return "brctg\t%1,%l0";
7169 return "aghi\t%1,-1\;jgne\t%l0";
7171 "&& reload_completed
7172 && (! REG_P (operands[2])
7173 || ! rtx_equal_p (operands[1], operands[2]))"
7174 [(parallel [(set (reg:CCAN 33)
7175 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
7177 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
7178 (set (match_dup 2) (match_dup 3))
7179 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
7180 (label_ref (match_dup 0))
7183 [(set_attr "op_type" "RI")
7184 (set_attr "type" "branch")
7185 (set (attr "length")
7186 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7187 (const_int 4) (const_int 10)))])
7190 ;;- Unconditional jump instructions.
7194 ; jump instruction pattern(s).
7197 (define_expand "jump"
7198 [(match_operand 0 "" "")]
7200 "s390_emit_jump (operands[0], NULL_RTX); DONE;")
7202 (define_insn "*jump64"
7203 [(set (pc) (label_ref (match_operand 0 "" "")))]
7206 if (get_attr_length (insn) == 4)
7211 [(set_attr "op_type" "RI")
7212 (set_attr "type" "branch")
7213 (set (attr "length")
7214 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7215 (const_int 4) (const_int 6)))])
7217 (define_insn "*jump31"
7218 [(set (pc) (label_ref (match_operand 0 "" "")))]
7221 if (get_attr_length (insn) == 4)
7226 [(set_attr "op_type" "RI")
7227 (set_attr "type" "branch")
7228 (set (attr "length")
7229 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
7230 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7231 (const_int 4) (const_int 6))
7232 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7233 (const_int 4) (const_int 8))))])
7236 ; indirect-jump instruction pattern(s).
7239 (define_insn "indirect_jump"
7240 [(set (pc) (match_operand 0 "address_operand" "U"))]
7243 if (get_attr_op_type (insn) == OP_TYPE_RR)
7248 [(set (attr "op_type")
7249 (if_then_else (match_operand 0 "register_operand" "")
7250 (const_string "RR") (const_string "RX")))
7251 (set_attr "type" "branch")
7252 (set_attr "atype" "agen")])
7255 ; casesi instruction pattern(s).
7258 (define_insn "casesi_jump"
7259 [(set (pc) (match_operand 0 "address_operand" "U"))
7260 (use (label_ref (match_operand 1 "" "")))]
7263 if (get_attr_op_type (insn) == OP_TYPE_RR)
7268 [(set (attr "op_type")
7269 (if_then_else (match_operand 0 "register_operand" "")
7270 (const_string "RR") (const_string "RX")))
7271 (set_attr "type" "branch")
7272 (set_attr "atype" "agen")])
7274 (define_expand "casesi"
7275 [(match_operand:SI 0 "general_operand" "")
7276 (match_operand:SI 1 "general_operand" "")
7277 (match_operand:SI 2 "general_operand" "")
7278 (label_ref (match_operand 3 "" ""))
7279 (label_ref (match_operand 4 "" ""))]
7282 rtx index = gen_reg_rtx (SImode);
7283 rtx base = gen_reg_rtx (Pmode);
7284 rtx target = gen_reg_rtx (Pmode);
7286 emit_move_insn (index, operands[0]);
7287 emit_insn (gen_subsi3 (index, index, operands[1]));
7288 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
7291 if (Pmode != SImode)
7292 index = convert_to_mode (Pmode, index, 1);
7293 if (GET_CODE (index) != REG)
7294 index = copy_to_mode_reg (Pmode, index);
7297 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
7299 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
7301 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
7303 index = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, base, index));
7304 emit_move_insn (target, index);
7307 target = gen_rtx_PLUS (Pmode, base, target);
7308 emit_jump_insn (gen_casesi_jump (target, operands[3]));
7315 ;;- Jump to subroutine.
7320 ; untyped call instruction pattern(s).
7323 ;; Call subroutine returning any type.
7324 (define_expand "untyped_call"
7325 [(parallel [(call (match_operand 0 "" "")
7327 (match_operand 1 "" "")
7328 (match_operand 2 "" "")])]
7333 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
7335 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7337 rtx set = XVECEXP (operands[2], 0, i);
7338 emit_move_insn (SET_DEST (set), SET_SRC (set));
7341 /* The optimizer does not know that the call sets the function value
7342 registers we stored in the result block. We avoid problems by
7343 claiming that all hard registers are used and clobbered at this
7345 emit_insn (gen_blockage ());
7350 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7351 ;; all of memory. This blocks insns from being moved across this point.
7353 (define_insn "blockage"
7354 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7357 [(set_attr "type" "none")
7358 (set_attr "length" "0")])
7364 (define_expand "sibcall"
7365 [(call (match_operand 0 "" "")
7366 (match_operand 1 "" ""))]
7369 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
7373 (define_insn "*sibcall_br"
7374 [(call (mem:QI (reg 1))
7375 (match_operand 0 "const_int_operand" "n"))]
7376 "SIBLING_CALL_P (insn)
7377 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
7379 [(set_attr "op_type" "RR")
7380 (set_attr "type" "branch")
7381 (set_attr "atype" "agen")])
7383 (define_insn "*sibcall_brc"
7384 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7385 (match_operand 1 "const_int_operand" "n"))]
7386 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7388 [(set_attr "op_type" "RI")
7389 (set_attr "type" "branch")])
7391 (define_insn "*sibcall_brcl"
7392 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7393 (match_operand 1 "const_int_operand" "n"))]
7394 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7396 [(set_attr "op_type" "RIL")
7397 (set_attr "type" "branch")])
7400 ; sibcall_value patterns
7403 (define_expand "sibcall_value"
7404 [(set (match_operand 0 "" "")
7405 (call (match_operand 1 "" "")
7406 (match_operand 2 "" "")))]
7409 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7413 (define_insn "*sibcall_value_br"
7414 [(set (match_operand 0 "" "")
7415 (call (mem:QI (reg 1))
7416 (match_operand 1 "const_int_operand" "n")))]
7417 "SIBLING_CALL_P (insn)
7418 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7420 [(set_attr "op_type" "RR")
7421 (set_attr "type" "branch")
7422 (set_attr "atype" "agen")])
7424 (define_insn "*sibcall_value_brc"
7425 [(set (match_operand 0 "" "")
7426 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7427 (match_operand 2 "const_int_operand" "n")))]
7428 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7430 [(set_attr "op_type" "RI")
7431 (set_attr "type" "branch")])
7433 (define_insn "*sibcall_value_brcl"
7434 [(set (match_operand 0 "" "")
7435 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7436 (match_operand 2 "const_int_operand" "n")))]
7437 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7439 [(set_attr "op_type" "RIL")
7440 (set_attr "type" "branch")])
7444 ; call instruction pattern(s).
7447 (define_expand "call"
7448 [(call (match_operand 0 "" "")
7449 (match_operand 1 "" ""))
7450 (use (match_operand 2 "" ""))]
7453 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7454 gen_rtx_REG (Pmode, RETURN_REGNUM));
7458 (define_insn "*bras"
7459 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7460 (match_operand 1 "const_int_operand" "n"))
7461 (clobber (match_operand 2 "register_operand" "=r"))]
7462 "!SIBLING_CALL_P (insn)
7463 && TARGET_SMALL_EXEC
7464 && GET_MODE (operands[2]) == Pmode"
7466 [(set_attr "op_type" "RI")
7467 (set_attr "type" "jsr")])
7469 (define_insn "*brasl"
7470 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7471 (match_operand 1 "const_int_operand" "n"))
7472 (clobber (match_operand 2 "register_operand" "=r"))]
7473 "!SIBLING_CALL_P (insn)
7475 && GET_MODE (operands[2]) == Pmode"
7477 [(set_attr "op_type" "RIL")
7478 (set_attr "type" "jsr")])
7480 (define_insn "*basr"
7481 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7482 (match_operand 1 "const_int_operand" "n"))
7483 (clobber (match_operand 2 "register_operand" "=r"))]
7484 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7486 if (get_attr_op_type (insn) == OP_TYPE_RR)
7487 return "basr\t%2,%0";
7489 return "bas\t%2,%a0";
7491 [(set (attr "op_type")
7492 (if_then_else (match_operand 0 "register_operand" "")
7493 (const_string "RR") (const_string "RX")))
7494 (set_attr "type" "jsr")
7495 (set_attr "atype" "agen")])
7498 ; call_value instruction pattern(s).
7501 (define_expand "call_value"
7502 [(set (match_operand 0 "" "")
7503 (call (match_operand 1 "" "")
7504 (match_operand 2 "" "")))
7505 (use (match_operand 3 "" ""))]
7508 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7509 gen_rtx_REG (Pmode, RETURN_REGNUM));
7513 (define_insn "*bras_r"
7514 [(set (match_operand 0 "" "")
7515 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7516 (match_operand:SI 2 "const_int_operand" "n")))
7517 (clobber (match_operand 3 "register_operand" "=r"))]
7518 "!SIBLING_CALL_P (insn)
7519 && TARGET_SMALL_EXEC
7520 && GET_MODE (operands[3]) == Pmode"
7522 [(set_attr "op_type" "RI")
7523 (set_attr "type" "jsr")])
7525 (define_insn "*brasl_r"
7526 [(set (match_operand 0 "" "")
7527 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7528 (match_operand 2 "const_int_operand" "n")))
7529 (clobber (match_operand 3 "register_operand" "=r"))]
7530 "!SIBLING_CALL_P (insn)
7532 && GET_MODE (operands[3]) == Pmode"
7534 [(set_attr "op_type" "RIL")
7535 (set_attr "type" "jsr")])
7537 (define_insn "*basr_r"
7538 [(set (match_operand 0 "" "")
7539 (call (mem:QI (match_operand 1 "address_operand" "U"))
7540 (match_operand 2 "const_int_operand" "n")))
7541 (clobber (match_operand 3 "register_operand" "=r"))]
7542 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7544 if (get_attr_op_type (insn) == OP_TYPE_RR)
7545 return "basr\t%3,%1";
7547 return "bas\t%3,%a1";
7549 [(set (attr "op_type")
7550 (if_then_else (match_operand 1 "register_operand" "")
7551 (const_string "RR") (const_string "RX")))
7552 (set_attr "type" "jsr")
7553 (set_attr "atype" "agen")])
7556 ;;- Thread-local storage support.
7559 (define_expand "get_tp_64"
7560 [(set (match_operand:DI 0 "nonimmediate_operand" "") (reg:DI 36))]
7564 (define_expand "get_tp_31"
7565 [(set (match_operand:SI 0 "nonimmediate_operand" "") (reg:SI 36))]
7569 (define_expand "set_tp_64"
7570 [(set (reg:DI 36) (match_operand:DI 0 "nonimmediate_operand" ""))
7571 (set (reg:DI 36) (unspec_volatile:DI [(reg:DI 36)] UNSPECV_SET_TP))]
7575 (define_expand "set_tp_31"
7576 [(set (reg:SI 36) (match_operand:SI 0 "nonimmediate_operand" ""))
7577 (set (reg:SI 36) (unspec_volatile:SI [(reg:SI 36)] UNSPECV_SET_TP))]
7581 (define_insn "*set_tp"
7582 [(set (reg 36) (unspec_volatile [(reg 36)] UNSPECV_SET_TP))]
7585 [(set_attr "type" "none")
7586 (set_attr "length" "0")])
7588 (define_insn "*tls_load_64"
7589 [(set (match_operand:DI 0 "register_operand" "=d")
7590 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7591 (match_operand:DI 2 "" "")]
7595 [(set_attr "op_type" "RXE")])
7597 (define_insn "*tls_load_31"
7598 [(set (match_operand:SI 0 "register_operand" "=d,d")
7599 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7600 (match_operand:SI 2 "" "")]
7606 [(set_attr "op_type" "RX,RXY")])
7608 (define_insn "*bras_tls"
7609 [(set (match_operand 0 "" "")
7610 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7611 (match_operand 2 "const_int_operand" "n")))
7612 (clobber (match_operand 3 "register_operand" "=r"))
7613 (use (match_operand 4 "" ""))]
7614 "!SIBLING_CALL_P (insn)
7615 && TARGET_SMALL_EXEC
7616 && GET_MODE (operands[3]) == Pmode"
7618 [(set_attr "op_type" "RI")
7619 (set_attr "type" "jsr")])
7621 (define_insn "*brasl_tls"
7622 [(set (match_operand 0 "" "")
7623 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7624 (match_operand 2 "const_int_operand" "n")))
7625 (clobber (match_operand 3 "register_operand" "=r"))
7626 (use (match_operand 4 "" ""))]
7627 "!SIBLING_CALL_P (insn)
7629 && GET_MODE (operands[3]) == Pmode"
7631 [(set_attr "op_type" "RIL")
7632 (set_attr "type" "jsr")])
7634 (define_insn "*basr_tls"
7635 [(set (match_operand 0 "" "")
7636 (call (mem:QI (match_operand 1 "address_operand" "U"))
7637 (match_operand 2 "const_int_operand" "n")))
7638 (clobber (match_operand 3 "register_operand" "=r"))
7639 (use (match_operand 4 "" ""))]
7640 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7642 if (get_attr_op_type (insn) == OP_TYPE_RR)
7643 return "basr\t%3,%1%J4";
7645 return "bas\t%3,%a1%J4";
7647 [(set (attr "op_type")
7648 (if_then_else (match_operand 1 "register_operand" "")
7649 (const_string "RR") (const_string "RX")))
7650 (set_attr "type" "jsr")
7651 (set_attr "atype" "agen")])
7654 ;;- Miscellaneous instructions.
7658 ; allocate stack instruction pattern(s).
7661 (define_expand "allocate_stack"
7662 [(match_operand 0 "general_operand" "")
7663 (match_operand 1 "general_operand" "")]
7666 rtx temp = gen_reg_rtx (Pmode);
7668 emit_move_insn (temp, s390_back_chain_rtx ());
7669 anti_adjust_stack (operands[1]);
7670 emit_move_insn (s390_back_chain_rtx (), temp);
7672 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7678 ; setjmp instruction pattern.
7681 (define_expand "builtin_setjmp_receiver"
7682 [(match_operand 0 "" "")]
7685 emit_insn (s390_load_got ());
7686 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7690 ;; These patterns say how to save and restore the stack pointer. We need not
7691 ;; save the stack pointer at function level since we are careful to
7692 ;; preserve the backchain. At block level, we have to restore the backchain
7693 ;; when we restore the stack pointer.
7695 ;; For nonlocal gotos, we must save both the stack pointer and its
7696 ;; backchain and restore both. Note that in the nonlocal case, the
7697 ;; save area is a memory location.
7699 (define_expand "save_stack_function"
7700 [(match_operand 0 "general_operand" "")
7701 (match_operand 1 "general_operand" "")]
7705 (define_expand "restore_stack_function"
7706 [(match_operand 0 "general_operand" "")
7707 (match_operand 1 "general_operand" "")]
7711 (define_expand "restore_stack_block"
7712 [(match_operand 0 "register_operand" "")
7713 (match_operand 1 "register_operand" "")]
7716 rtx temp = gen_reg_rtx (Pmode);
7718 emit_move_insn (temp, s390_back_chain_rtx ());
7719 emit_move_insn (operands[0], operands[1]);
7720 emit_move_insn (s390_back_chain_rtx (), temp);
7725 (define_expand "save_stack_nonlocal"
7726 [(match_operand 0 "memory_operand" "")
7727 (match_operand 1 "register_operand" "")]
7730 enum machine_mode mode = TARGET_64BIT ? OImode : TImode;
7731 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7733 /* Copy the backchain to the first word, sp to the second and the
7734 literal pool base to the third. */
7736 if (TARGET_BACKCHAIN)
7738 rtx temp = force_reg (Pmode, s390_back_chain_rtx ());
7739 emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp);
7742 emit_move_insn (operand_subword (operands[0], 1, 0, mode), operands[1]);
7743 emit_move_insn (operand_subword (operands[0], 2, 0, mode), base);
7748 (define_expand "restore_stack_nonlocal"
7749 [(match_operand 0 "register_operand" "")
7750 (match_operand 1 "memory_operand" "")]
7753 enum machine_mode mode = TARGET_64BIT ? OImode : TImode;
7754 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7755 rtx temp = NULL_RTX;
7757 /* Restore the backchain from the first word, sp from the second and the
7758 literal pool base from the third. */
7760 if (TARGET_BACKCHAIN)
7761 temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode));
7763 emit_move_insn (base, operand_subword (operands[1], 2, 0, mode));
7764 emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode));
7767 emit_move_insn (s390_back_chain_rtx (), temp);
7769 emit_insn (gen_rtx_USE (VOIDmode, base));
7775 ; nop instruction pattern(s).
7782 [(set_attr "op_type" "RR")])
7786 ; Special literal pool access instruction pattern(s).
7789 (define_insn "*pool_entry"
7790 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7791 UNSPECV_POOL_ENTRY)]
7794 enum machine_mode mode = GET_MODE (PATTERN (insn));
7795 unsigned int align = GET_MODE_BITSIZE (mode);
7796 s390_output_pool_entry (operands[0], mode, align);
7799 [(set (attr "length")
7800 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7802 (define_insn "pool_align"
7803 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")]
7804 UNSPECV_POOL_ALIGN)]
7807 [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7809 (define_insn "pool_section_start"
7810 [(unspec_volatile [(const_int 1)] UNSPECV_POOL_SECTION)]
7813 [(set_attr "length" "0")])
7815 (define_insn "pool_section_end"
7816 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_SECTION)]
7819 [(set_attr "length" "0")])
7821 (define_insn "main_base_31_small"
7822 [(set (match_operand 0 "register_operand" "=a")
7823 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7824 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7826 [(set_attr "op_type" "RR")
7827 (set_attr "type" "la")])
7829 (define_insn "main_base_31_large"
7830 [(set (match_operand 0 "register_operand" "=a")
7831 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7832 (set (pc) (label_ref (match_operand 2 "" "")))]
7833 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7835 [(set_attr "op_type" "RI")])
7837 (define_insn "main_base_64"
7838 [(set (match_operand 0 "register_operand" "=a")
7839 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7840 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7842 [(set_attr "op_type" "RIL")
7843 (set_attr "type" "larl")])
7845 (define_insn "main_pool"
7846 [(set (match_operand 0 "register_operand" "=a")
7847 (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
7848 "GET_MODE (operands[0]) == Pmode"
7851 (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
7852 (const_string "larl") (const_string "la")))])
7854 (define_insn "reload_base_31"
7855 [(set (match_operand 0 "register_operand" "=a")
7856 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7857 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7858 "basr\t%0,0\;la\t%0,%1-.(%0)"
7859 [(set_attr "length" "6")
7860 (set_attr "type" "la")])
7862 (define_insn "reload_base_64"
7863 [(set (match_operand 0 "register_operand" "=a")
7864 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7865 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7867 [(set_attr "op_type" "RIL")
7868 (set_attr "type" "larl")])
7871 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7874 [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7877 ;; Insns related to generating the function prologue and epilogue.
7881 (define_expand "prologue"
7882 [(use (const_int 0))]
7884 "s390_emit_prologue (); DONE;")
7886 (define_insn "prologue_tpf"
7887 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7888 (clobber (reg:DI 1))]
7889 "TARGET_TPF_PROFILING"
7890 "larl\t%%r1,.+14\;tm\t4065,255\;bnz\t4064"
7891 [(set_attr "length" "14")])
7893 (define_expand "epilogue"
7894 [(use (const_int 1))]
7896 "s390_emit_epilogue (false); DONE;")
7898 (define_insn "epilogue_tpf"
7899 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7900 (clobber (reg:DI 1))]
7901 "TARGET_TPF_PROFILING"
7902 "larl\t%%r1,.+14\;tm\t4071,255\;bnz\t4070"
7903 [(set_attr "length" "14")])
7905 (define_expand "sibcall_epilogue"
7906 [(use (const_int 0))]
7908 "s390_emit_epilogue (true); DONE;")
7910 (define_insn "*return"
7912 (use (match_operand 0 "register_operand" "a"))]
7913 "GET_MODE (operands[0]) == Pmode"
7915 [(set_attr "op_type" "RR")
7916 (set_attr "type" "jsr")
7917 (set_attr "atype" "agen")])
7920 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7921 ;; pointer. This is used for compatibility.
7923 (define_expand "ptr_extend"
7924 [(set (match_operand:DI 0 "register_operand" "=r")
7925 (match_operand:SI 1 "register_operand" "r"))]
7928 emit_insn (gen_anddi3 (operands[0],
7929 gen_lowpart (DImode, operands[1]),
7930 GEN_INT (0x7fffffff)));
7934 ;; Instruction definition to expand eh_return macro to support
7935 ;; swapping in special linkage return addresses.
7937 (define_expand "eh_return"
7938 [(use (match_operand 0 "register_operand" ""))]
7941 s390_emit_tpf_eh_return (operands[0]);