1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
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 ;; d -- Any register from 0 to 15.
29 ;; I -- An 8-bit constant (0..255).
30 ;; J -- A 12-bit constant (0..4095).
31 ;; K -- A 16-bit constant (-32768..32767).
32 ;; L -- Value appropriate as displacement.
33 ;; (0..4095) for short displacement
34 ;; (-524288..524287) for long displacement
35 ;; M -- Constant integer with a value of 0x7fffffff.
36 ;; N -- Multiple letter constraint followed by 4 parameter letters.
37 ;; 0..9: number of the part counting from most to least significant
38 ;; H,Q: mode of the part
39 ;; D,S,H: mode of the containing operand
40 ;; 0,F: value of the other parts (F - all bits set)
42 ;; The constraint matches if the specified part of a constant
43 ;; has a value different from its other parts.
44 ;; Q -- Memory reference without index register and with short displacement.
45 ;; R -- Memory reference with index register and short displacement.
46 ;; S -- Memory reference without index register but with long displacement.
47 ;; T -- Memory reference with index register and long displacement.
48 ;; U -- Pointer with short displacement.
49 ;; W -- Pointer with long displacement.
50 ;; Y -- Shift count operand.
52 ;; Special formats used for outputting 390 instructions.
54 ;; %C: print opcode suffix for branch condition.
55 ;; %D: print opcode suffix for inverse branch condition.
56 ;; %J: print tls_load/tls_gdcall/tls_ldcall suffix
57 ;; %O: print only the displacement of a memory reference.
58 ;; %R: print only the base register of a memory reference.
59 ;; %N: print the second word of a DImode operand.
60 ;; %M: print the second word of a TImode operand.
62 ;; %b: print integer X as if it's an unsigned byte.
63 ;; %x: print integer X as if it's an unsigned word.
64 ;; %h: print integer X as if it's a signed word.
65 ;; %i: print the first nonzero HImode part of X
66 ;; %j: print the first HImode part unequal to 0xffff of X
69 ;; We have a special constraint for pattern matching.
71 ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
83 ; GOT/PLT and lt-relative accesses
84 (UNSPEC_LTREL_OFFSET 100)
85 (UNSPEC_LTREL_BASE 101)
93 (UNSPEC_RELOAD_BASE 210)
94 (UNSPEC_MAIN_BASE 211)
96 ; TLS relocation specifiers
101 (UNSPEC_GOTNTPOFF 504)
102 (UNSPEC_INDNTPOFF 505)
106 (UNSPEC_TLSLDM_NTPOFF 511)
107 (UNSPEC_TLS_LOAD 512)
114 ;; UNSPEC_VOLATILE usage
122 (UNSPECV_TPF_PROLOGUE 20)
123 (UNSPECV_TPF_EPILOGUE 21)
127 (UNSPECV_POOL_START 201)
128 (UNSPECV_POOL_END 202)
129 (UNSPECV_POOL_ENTRY 203)
130 (UNSPECV_MAIN_POOL 300)
137 ;; Processor type. This attribute must exactly match the processor_type
138 ;; enumeration in s390.h.
140 (define_attr "cpu" "g5,g6,z900,z990"
141 (const (symbol_ref "s390_tune")))
143 ;; Define an insn type attribute. This is used in function unit delay
146 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
147 cs,vs,store,imul,idiv,
148 branch,jsr,fsimpd,fsimps,
149 floadd,floads,fstored, fstores,
150 fmuld,fmuls,fdivd,fdivs,
151 ftoi,itof,fsqrtd,fsqrts,
153 (const_string "integer"))
155 ;; Operand type. Used to default length attribute values
157 (define_attr "op_type"
158 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
161 ;; Insn are devide in two classes:
162 ;; agen: Insn using agen
163 ;; reg: Insn not using agen
165 (define_attr "atype" "agen,reg"
166 (cond [ (eq_attr "op_type" "E") (const_string "reg")
167 (eq_attr "op_type" "RR") (const_string "reg")
168 (eq_attr "op_type" "RX") (const_string "agen")
169 (eq_attr "op_type" "RI") (const_string "reg")
170 (eq_attr "op_type" "RRE") (const_string "reg")
171 (eq_attr "op_type" "RS") (const_string "agen")
172 (eq_attr "op_type" "RSI") (const_string "agen")
173 (eq_attr "op_type" "S") (const_string "agen")
174 (eq_attr "op_type" "SI") (const_string "agen")
175 (eq_attr "op_type" "SS") (const_string "agen")
176 (eq_attr "op_type" "SSE") (const_string "agen")
177 (eq_attr "op_type" "RXE") (const_string "agen")
178 (eq_attr "op_type" "RSE") (const_string "agen")
179 (eq_attr "op_type" "RIL") (const_string "agen")
180 (eq_attr "op_type" "RXY") (const_string "agen")
181 (eq_attr "op_type" "RSY") (const_string "agen")
182 (eq_attr "op_type" "SIY") (const_string "agen")]
183 (const_string "reg")))
185 ;; Generic pipeline function unit.
187 (define_function_unit "integer" 1 0
188 (eq_attr "type" "none") 0 0)
190 (define_function_unit "integer" 1 0
191 (eq_attr "type" "integer") 1 1)
193 (define_function_unit "integer" 1 0
194 (eq_attr "type" "fsimpd") 1 1)
196 (define_function_unit "integer" 1 0
197 (eq_attr "type" "fsimps") 1 1)
199 (define_function_unit "integer" 1 0
200 (eq_attr "type" "load") 1 1)
202 (define_function_unit "integer" 1 0
203 (eq_attr "type" "floadd") 1 1)
205 (define_function_unit "integer" 1 0
206 (eq_attr "type" "floads") 1 1)
208 (define_function_unit "integer" 1 0
209 (eq_attr "type" "la") 1 1)
211 (define_function_unit "integer" 1 0
212 (eq_attr "type" "larl") 1 1)
214 (define_function_unit "integer" 1 0
215 (eq_attr "type" "lr") 1 1)
217 (define_function_unit "integer" 1 0
218 (eq_attr "type" "branch") 1 1)
220 (define_function_unit "integer" 1 0
221 (eq_attr "type" "store") 1 1)
223 (define_function_unit "integer" 1 0
224 (eq_attr "type" "fstored") 1 1)
226 (define_function_unit "integer" 1 0
227 (eq_attr "type" "fstores") 1 1)
229 (define_function_unit "integer" 1 0
230 (eq_attr "type" "lm") 2 2)
232 (define_function_unit "integer" 1 0
233 (eq_attr "type" "stm") 2 2)
235 (define_function_unit "integer" 1 0
236 (eq_attr "type" "cs") 5 5)
238 (define_function_unit "integer" 1 0
239 (eq_attr "type" "vs") 30 30)
241 (define_function_unit "integer" 1 0
242 (eq_attr "type" "jsr") 5 5)
244 (define_function_unit "integer" 1 0
245 (eq_attr "type" "imul") 7 7)
247 (define_function_unit "integer" 1 0
248 (eq_attr "type" "fmuld") 6 6)
250 (define_function_unit "integer" 1 0
251 (eq_attr "type" "fmuls") 6 6)
253 (define_function_unit "integer" 1 0
254 (eq_attr "type" "idiv") 33 33)
256 (define_function_unit "integer" 1 0
257 (eq_attr "type" "fdivd") 33 33)
259 (define_function_unit "integer" 1 0
260 (eq_attr "type" "fdivs") 33 33)
262 (define_function_unit "integer" 1 0
263 (eq_attr "type" "fsqrtd") 30 30)
265 (define_function_unit "integer" 1 0
266 (eq_attr "type" "fsqrts") 30 30)
268 (define_function_unit "integer" 1 0
269 (eq_attr "type" "ftoi") 2 2)
271 (define_function_unit "integer" 1 0
272 (eq_attr "type" "itof") 2 2)
274 (define_function_unit "integer" 1 0
275 (eq_attr "type" "o2") 2 2)
277 (define_function_unit "integer" 1 0
278 (eq_attr "type" "o3") 3 3)
280 (define_function_unit "integer" 1 0
281 (eq_attr "type" "other") 5 5)
283 ;; Pipeline description for z900
290 (define_attr "length" ""
291 (cond [ (eq_attr "op_type" "E") (const_int 2)
292 (eq_attr "op_type" "RR") (const_int 2)
293 (eq_attr "op_type" "RX") (const_int 4)
294 (eq_attr "op_type" "RI") (const_int 4)
295 (eq_attr "op_type" "RRE") (const_int 4)
296 (eq_attr "op_type" "RS") (const_int 4)
297 (eq_attr "op_type" "RSI") (const_int 4)
298 (eq_attr "op_type" "S") (const_int 4)
299 (eq_attr "op_type" "SI") (const_int 4)
300 (eq_attr "op_type" "SS") (const_int 6)
301 (eq_attr "op_type" "SSE") (const_int 6)
302 (eq_attr "op_type" "RXE") (const_int 6)
303 (eq_attr "op_type" "RSE") (const_int 6)
304 (eq_attr "op_type" "RIL") (const_int 6)
305 (eq_attr "op_type" "RXY") (const_int 6)
306 (eq_attr "op_type" "RSY") (const_int 6)
307 (eq_attr "op_type" "SIY") (const_int 6)]
310 ;; Define attributes for `asm' insns.
312 (define_asm_attributes [(set_attr "type" "other")
313 (set_attr "op_type" "NN")])
319 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
320 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
321 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
322 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
323 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
326 ; CCZ1 -> CCA/CCU/CCS/CCT
329 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
330 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
334 ;;- Compare instructions.
337 (define_expand "cmpdi"
339 (compare:CC (match_operand:DI 0 "register_operand" "")
340 (match_operand:DI 1 "general_operand" "")))]
343 s390_compare_op0 = operands[0];
344 s390_compare_op1 = operands[1];
348 (define_expand "cmpsi"
350 (compare:CC (match_operand:SI 0 "register_operand" "")
351 (match_operand:SI 1 "general_operand" "")))]
354 s390_compare_op0 = operands[0];
355 s390_compare_op1 = operands[1];
359 (define_expand "cmpdf"
361 (compare:CC (match_operand:DF 0 "register_operand" "")
362 (match_operand:DF 1 "general_operand" "")))]
365 s390_compare_op0 = operands[0];
366 s390_compare_op1 = operands[1];
370 (define_expand "cmpsf"
372 (compare:CC (match_operand:SF 0 "register_operand" "")
373 (match_operand:SF 1 "general_operand" "")))]
376 s390_compare_op0 = operands[0];
377 s390_compare_op1 = operands[1];
382 ; Test-under-Mask (zero_extract) instructions
384 (define_insn "*tmdi_ext"
386 (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
387 (match_operand:DI 1 "const_int_operand" "n")
388 (match_operand:DI 2 "const_int_operand" "n"))
390 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
391 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
392 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 64
393 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
394 == INTVAL (operands[2]) >> 4"
396 int part = INTVAL (operands[2]) >> 4;
397 int block = (1 << INTVAL (operands[1])) - 1;
398 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
400 operands[2] = GEN_INT (block << shift);
404 case 0: return "tmhh\t%0,%x2";
405 case 1: return "tmhl\t%0,%x2";
406 case 2: return "tmlh\t%0,%x2";
407 case 3: return "tmll\t%0,%x2";
411 [(set_attr "op_type" "RI")])
413 (define_insn "*tmsi_ext"
415 (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
416 (match_operand:SI 1 "const_int_operand" "n")
417 (match_operand:SI 2 "const_int_operand" "n"))
419 "s390_match_ccmode(insn, CCTmode)
420 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
421 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
422 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
423 == INTVAL (operands[2]) >> 4"
425 int part = INTVAL (operands[2]) >> 4;
426 int block = (1 << INTVAL (operands[1])) - 1;
427 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
429 operands[2] = GEN_INT (block << shift);
433 case 0: return "tmh\t%0,%x2";
434 case 1: return "tml\t%0,%x2";
438 [(set_attr "op_type" "RI")])
440 (define_insn "*tmqisi_ext"
442 (compare (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,S")
443 (match_operand:SI 1 "const_int_operand" "n,n")
444 (match_operand:SI 2 "const_int_operand" "n,n"))
446 "!TARGET_64BIT && s390_match_ccmode(insn, CCTmode)
447 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
448 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
450 int block = (1 << INTVAL (operands[1])) - 1;
451 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
453 operands[2] = GEN_INT (block << shift);
454 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
456 [(set_attr "op_type" "SI,SIY")])
458 (define_insn "*tmqidi_ext"
460 (compare (zero_extract:DI (match_operand:QI 0 "memory_operand" "Q,S")
461 (match_operand:SI 1 "const_int_operand" "n,n")
462 (match_operand:SI 2 "const_int_operand" "n,n"))
464 "TARGET_64BIT && s390_match_ccmode(insn, CCTmode)
465 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
466 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
468 int block = (1 << INTVAL (operands[1])) - 1;
469 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
471 operands[2] = GEN_INT (block << shift);
472 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
474 [(set_attr "op_type" "SI,SIY")])
477 ; Test-under-Mask instructions
479 (define_insn "*tmdi_mem"
481 (compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S")
482 (match_operand:DI 1 "immediate_operand" "n,n"))
483 (match_operand:DI 2 "immediate_operand" "n,n")))]
484 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
485 && s390_single_part (operands[1], DImode, QImode, 0) >= 0"
487 int part = s390_single_part (operands[1], DImode, QImode, 0);
488 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
490 operands[0] = gen_rtx_MEM (QImode,
491 plus_constant (XEXP (operands[0], 0), part));
492 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
494 [(set_attr "op_type" "SI,SIY")])
496 (define_insn "*tmsi_mem"
498 (compare (and:SI (match_operand:SI 0 "memory_operand" "Q,S")
499 (match_operand:SI 1 "immediate_operand" "n,n"))
500 (match_operand:SI 2 "immediate_operand" "n,n")))]
501 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
502 && s390_single_part (operands[1], SImode, QImode, 0) >= 0"
504 int part = s390_single_part (operands[1], SImode, QImode, 0);
505 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
507 operands[0] = gen_rtx_MEM (QImode,
508 plus_constant (XEXP (operands[0], 0), part));
509 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
511 [(set_attr "op_type" "SI")])
513 (define_insn "*tmhi_mem"
515 (compare (and:SI (subreg:SI (match_operand:HI 0 "memory_operand" "Q,S") 0)
516 (match_operand:SI 1 "immediate_operand" "n,n"))
517 (match_operand:SI 2 "immediate_operand" "n,n")))]
518 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
519 && s390_single_part (operands[1], HImode, QImode, 0) >= 0"
521 int part = s390_single_part (operands[1], HImode, QImode, 0);
522 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
524 operands[0] = gen_rtx_MEM (QImode,
525 plus_constant (XEXP (operands[0], 0), part));
526 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
528 [(set_attr "op_type" "SI")])
530 (define_insn "*tmqi_mem"
532 (compare (and:SI (subreg:SI (match_operand:QI 0 "memory_operand" "Q,S") 0)
533 (match_operand:SI 1 "immediate_operand" "n,n"))
534 (match_operand:SI 2 "immediate_operand" "n,n")))]
535 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
539 [(set_attr "op_type" "SI,SIY")])
541 (define_insn "*tmdi_reg"
543 (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d")
544 (match_operand:DI 1 "immediate_operand"
545 "N0HD0,N1HD0,N2HD0,N3HD0"))
546 (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
548 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
549 && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
555 [(set_attr "op_type" "RI")])
557 (define_insn "*tmsi_reg"
559 (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
560 (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
561 (match_operand:SI 2 "immediate_operand" "n,n")))]
562 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
563 && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
567 [(set_attr "op_type" "RI")])
569 (define_insn "*tmhi_full"
571 (compare (match_operand:HI 0 "register_operand" "d")
572 (match_operand:HI 1 "immediate_operand" "n")))]
573 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
575 [(set_attr "op_type" "RX")])
577 (define_insn "*tmqi_full"
579 (compare (match_operand:QI 0 "register_operand" "d")
580 (match_operand:QI 1 "immediate_operand" "n")))]
581 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
583 [(set_attr "op_type" "RI")])
586 ; Load-and-Test instructions
588 (define_insn "*tstdi_sign"
590 (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
591 (const_int 32)) (const_int 32))
592 (match_operand:DI 1 "const0_operand" "")))
593 (set (match_operand:DI 2 "register_operand" "=d")
594 (sign_extend:DI (match_dup 0)))]
595 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
597 [(set_attr "op_type" "RRE")])
599 (define_insn "*tstdi"
601 (compare (match_operand:DI 0 "register_operand" "d")
602 (match_operand:DI 1 "const0_operand" "")))
603 (set (match_operand:DI 2 "register_operand" "=d")
605 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
607 [(set_attr "op_type" "RRE")])
609 (define_insn "*tstdi_cconly"
611 (compare (match_operand:DI 0 "register_operand" "d")
612 (match_operand:DI 1 "const0_operand" "")))]
613 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
615 [(set_attr "op_type" "RRE")])
617 (define_insn "*tstdi_cconly_31"
619 (compare (match_operand:DI 0 "register_operand" "d")
620 (match_operand:DI 1 "const0_operand" "")))]
621 "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
623 [(set_attr "op_type" "RS")
624 (set_attr "atype" "reg")])
627 (define_insn "*tstsi"
629 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
630 (match_operand:SI 1 "const0_operand" "")))
631 (set (match_operand:SI 2 "register_operand" "=d,d,d")
633 "s390_match_ccmode(insn, CCSmode)"
638 [(set_attr "op_type" "RR,RS,RSY")])
640 (define_insn "*tstsi_cconly"
642 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
643 (match_operand:SI 1 "const0_operand" "")))
644 (clobber (match_scratch:SI 2 "=X,d,d"))]
645 "s390_match_ccmode(insn, CCSmode)"
650 [(set_attr "op_type" "RR,RS,RSY")])
652 (define_insn "*tstsi_cconly2"
654 (compare (match_operand:SI 0 "register_operand" "d")
655 (match_operand:SI 1 "const0_operand" "")))]
656 "s390_match_ccmode(insn, CCSmode)"
658 [(set_attr "op_type" "RR")])
660 (define_insn "*tsthiCCT"
662 (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d")
663 (match_operand:HI 1 "const0_operand" "")))
664 (set (match_operand:HI 2 "register_operand" "=d,d,0")
666 "s390_match_ccmode(insn, CCTmode)"
671 [(set_attr "op_type" "RS,RSY,RI")])
673 (define_insn "*tsthiCCT_cconly"
675 (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d")
676 (match_operand:HI 1 "const0_operand" "")))
677 (clobber (match_scratch:HI 2 "=d,d,X"))]
678 "s390_match_ccmode(insn, CCTmode)"
683 [(set_attr "op_type" "RS,RSY,RI")])
685 (define_insn "*tsthi"
687 (compare (match_operand:HI 0 "s_operand" "Q,S")
688 (match_operand:HI 1 "const0_operand" "")))
689 (set (match_operand:HI 2 "register_operand" "=d,d")
691 "s390_match_ccmode(insn, CCSmode)"
695 [(set_attr "op_type" "RS,RSY")])
697 (define_insn "*tsthi_cconly"
699 (compare (match_operand:HI 0 "s_operand" "Q,S")
700 (match_operand:HI 1 "const0_operand" "")))
701 (clobber (match_scratch:HI 2 "=d,d"))]
702 "s390_match_ccmode(insn, CCSmode)"
706 [(set_attr "op_type" "RS,RSY")])
708 (define_insn "*tstqiCCT"
710 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
711 (match_operand:QI 1 "const0_operand" "")))
712 (set (match_operand:QI 2 "register_operand" "=d,d,0")
714 "s390_match_ccmode(insn, CCTmode)"
719 [(set_attr "op_type" "RS,RSY,RI")])
721 (define_insn "*tstqiCCT_cconly"
723 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
724 (match_operand:QI 1 "const0_operand" "")))]
725 "s390_match_ccmode(insn, CCTmode)"
730 [(set_attr "op_type" "SI,SIY,RI")])
732 (define_insn "*tstqi"
734 (compare (match_operand:QI 0 "s_operand" "Q,S")
735 (match_operand:QI 1 "const0_operand" "")))
736 (set (match_operand:QI 2 "register_operand" "=d,d")
738 "s390_match_ccmode(insn, CCSmode)"
742 [(set_attr "op_type" "RS,RSY")])
744 (define_insn "*tstqi_cconly"
746 (compare (match_operand:QI 0 "s_operand" "Q,S")
747 (match_operand:QI 1 "const0_operand" "")))
748 (clobber (match_scratch:QI 2 "=d,d"))]
749 "s390_match_ccmode(insn, CCSmode)"
753 [(set_attr "op_type" "RS,RSY")])
756 ; Compare (signed) instructions
758 (define_insn "*cmpdi_ccs_sign"
760 (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
761 (match_operand:DI 0 "register_operand" "d,d")))]
762 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
766 [(set_attr "op_type" "RRE,RXY")])
768 (define_insn "*cmpdi_ccs"
770 (compare (match_operand:DI 0 "register_operand" "d,d,d")
771 (match_operand:DI 1 "general_operand" "d,K,m")))]
772 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
777 [(set_attr "op_type" "RRE,RI,RXY")])
779 (define_insn "*cmpsi_ccs_sign"
781 (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
782 (match_operand:SI 0 "register_operand" "d,d")))]
783 "s390_match_ccmode(insn, CCSRmode)"
787 [(set_attr "op_type" "RX,RXY")])
789 (define_insn "*cmpsi_ccs"
791 (compare (match_operand:SI 0 "register_operand" "d,d,d,d")
792 (match_operand:SI 1 "general_operand" "d,K,R,T")))]
793 "s390_match_ccmode(insn, CCSmode)"
799 [(set_attr "op_type" "RR,RI,RX,RXY")])
802 ; Compare (unsigned) instructions
804 (define_insn "*cmpdi_ccu_zero"
806 (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
807 (match_operand:DI 0 "register_operand" "d,d")))]
808 "s390_match_ccmode(insn, CCURmode) && TARGET_64BIT"
812 [(set_attr "op_type" "RRE,RXY")])
814 (define_insn "*cmpdi_ccu"
816 (compare (match_operand:DI 0 "register_operand" "d,d")
817 (match_operand:DI 1 "general_operand" "d,m")))]
818 "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
822 [(set_attr "op_type" "RRE,RXY")])
824 (define_insn "*cmpsi_ccu"
826 (compare (match_operand:SI 0 "register_operand" "d,d,d")
827 (match_operand:SI 1 "general_operand" "d,R,T")))]
828 "s390_match_ccmode(insn, CCUmode)"
833 [(set_attr "op_type" "RR,RX,RXY")])
835 (define_insn "*cmphi_ccu"
837 (compare (match_operand:HI 0 "register_operand" "d,d")
838 (match_operand:HI 1 "s_imm_operand" "Q,S")))]
839 "s390_match_ccmode(insn, CCUmode)"
843 [(set_attr "op_type" "RS,RSY")])
845 (define_insn "*cmpqi_ccu"
847 (compare (match_operand:QI 0 "register_operand" "d,d")
848 (match_operand:QI 1 "s_imm_operand" "Q,S")))]
849 "s390_match_ccmode(insn, CCUmode)"
853 [(set_attr "op_type" "RS,RSY")])
857 (compare (match_operand:QI 0 "memory_operand" "Q,S")
858 (match_operand:QI 1 "immediate_operand" "n,n")))]
859 "s390_match_ccmode (insn, CCUmode)"
863 [(set_attr "op_type" "SI,SIY")])
865 (define_insn "*cmpdi_ccu_mem"
867 (compare (match_operand:DI 0 "s_operand" "Q")
868 (match_operand:DI 1 "s_imm_operand" "Q")))]
869 "s390_match_ccmode(insn, CCUmode)"
871 [(set_attr "op_type" "SS")])
873 (define_insn "*cmpsi_ccu_mem"
875 (compare (match_operand:SI 0 "s_operand" "Q")
876 (match_operand:SI 1 "s_imm_operand" "Q")))]
877 "s390_match_ccmode(insn, CCUmode)"
879 [(set_attr "op_type" "SS")])
881 (define_insn "*cmphi_ccu_mem"
883 (compare (match_operand:HI 0 "s_operand" "Q")
884 (match_operand:HI 1 "s_imm_operand" "Q")))]
885 "s390_match_ccmode(insn, CCUmode)"
887 [(set_attr "op_type" "SS")])
889 (define_insn "*cmpqi_ccu_mem"
891 (compare (match_operand:QI 0 "s_operand" "Q")
892 (match_operand:QI 1 "s_imm_operand" "Q")))]
893 "s390_match_ccmode(insn, CCUmode)"
895 [(set_attr "op_type" "SS")])
900 (define_insn "*cmpdf_ccs_0"
902 (compare (match_operand:DF 0 "register_operand" "f")
903 (match_operand:DF 1 "const0_operand" "")))]
904 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
906 [(set_attr "op_type" "RRE")
907 (set_attr "type" "fsimpd")])
909 (define_insn "*cmpdf_ccs_0_ibm"
911 (compare (match_operand:DF 0 "register_operand" "f")
912 (match_operand:DF 1 "const0_operand" "")))]
913 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
915 [(set_attr "op_type" "RR")
916 (set_attr "type" "fsimpd")])
918 (define_insn "*cmpdf_ccs"
920 (compare (match_operand:DF 0 "register_operand" "f,f")
921 (match_operand:DF 1 "general_operand" "f,R")))]
922 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
926 [(set_attr "op_type" "RRE,RXE")
927 (set_attr "type" "fsimpd")])
929 (define_insn "*cmpdf_ccs_ibm"
931 (compare (match_operand:DF 0 "register_operand" "f,f")
932 (match_operand:DF 1 "general_operand" "f,R")))]
933 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
937 [(set_attr "op_type" "RR,RX")
938 (set_attr "type" "fsimpd")])
943 (define_insn "*cmpsf_ccs_0"
945 (compare (match_operand:SF 0 "register_operand" "f")
946 (match_operand:SF 1 "const0_operand" "")))]
947 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
949 [(set_attr "op_type" "RRE")
950 (set_attr "type" "fsimps")])
952 (define_insn "*cmpsf_ccs_0_ibm"
954 (compare (match_operand:SF 0 "register_operand" "f")
955 (match_operand:SF 1 "const0_operand" "")))]
956 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
958 [(set_attr "op_type" "RR")
959 (set_attr "type" "fsimps")])
961 (define_insn "*cmpsf_ccs"
963 (compare (match_operand:SF 0 "register_operand" "f,f")
964 (match_operand:SF 1 "general_operand" "f,R")))]
965 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
969 [(set_attr "op_type" "RRE,RXE")
970 (set_attr "type" "fsimps")])
972 (define_insn "*cmpsf_ccs"
974 (compare (match_operand:SF 0 "register_operand" "f,f")
975 (match_operand:SF 1 "general_operand" "f,R")))]
976 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
980 [(set_attr "op_type" "RR,RX")
981 (set_attr "type" "fsimps")])
985 ;;- Move instructions.
989 ; movti instruction pattern(s).
993 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
994 (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
1001 mvc\t%O0(16,%R0),%1"
1002 [(set_attr "op_type" "RSY,RSY,NN,NN,SS")
1003 (set_attr "type" "lm,stm,*,*,cs")])
1006 [(set (match_operand:TI 0 "nonimmediate_operand" "")
1007 (match_operand:TI 1 "general_operand" ""))]
1008 "TARGET_64BIT && reload_completed
1009 && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
1010 [(set (match_dup 2) (match_dup 4))
1011 (set (match_dup 3) (match_dup 5))]
1013 operands[2] = operand_subword (operands[0], 0, 0, TImode);
1014 operands[3] = operand_subword (operands[0], 1, 0, TImode);
1015 operands[4] = operand_subword (operands[1], 0, 0, TImode);
1016 operands[5] = operand_subword (operands[1], 1, 0, TImode);
1020 [(set (match_operand:TI 0 "nonimmediate_operand" "")
1021 (match_operand:TI 1 "general_operand" ""))]
1022 "TARGET_64BIT && reload_completed
1023 && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
1024 [(set (match_dup 2) (match_dup 4))
1025 (set (match_dup 3) (match_dup 5))]
1027 operands[2] = operand_subword (operands[0], 1, 0, TImode);
1028 operands[3] = operand_subword (operands[0], 0, 0, TImode);
1029 operands[4] = operand_subword (operands[1], 1, 0, TImode);
1030 operands[5] = operand_subword (operands[1], 0, 0, TImode);
1034 [(set (match_operand:TI 0 "register_operand" "")
1035 (match_operand:TI 1 "memory_operand" ""))]
1036 "TARGET_64BIT && reload_completed
1037 && !s_operand (operands[1], VOIDmode)"
1038 [(set (match_dup 0) (match_dup 1))]
1040 rtx addr = operand_subword (operands[0], 1, 0, TImode);
1041 s390_load_address (addr, XEXP (operands[1], 0));
1042 operands[1] = replace_equiv_address (operands[1], addr);
1045 (define_expand "reload_outti"
1046 [(parallel [(match_operand:TI 0 "memory_operand" "")
1047 (match_operand:TI 1 "register_operand" "d")
1048 (match_operand:DI 2 "register_operand" "=&a")])]
1051 s390_load_address (operands[2], XEXP (operands[0], 0));
1052 operands[0] = replace_equiv_address (operands[0], operands[2]);
1053 emit_move_insn (operands[0], operands[1]);
1058 ; movdi instruction pattern(s).
1061 (define_expand "movdi"
1062 [(set (match_operand:DI 0 "general_operand" "")
1063 (match_operand:DI 1 "general_operand" ""))]
1066 /* Handle symbolic constants. */
1067 if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1068 emit_symbolic_move (operands);
1070 /* During and after reload, we need to force constants
1071 to the literal pool ourselves, if necessary. */
1072 if ((reload_in_progress || reload_completed)
1073 && CONSTANT_P (operands[1])
1074 && (!legitimate_reload_constant_p (operands[1])
1075 || FP_REG_P (operands[0])))
1076 operands[1] = force_const_mem (DImode, operands[1]);
1079 (define_insn "*movdi_larl"
1080 [(set (match_operand:DI 0 "register_operand" "=d")
1081 (match_operand:DI 1 "larl_operand" "X"))]
1083 && !FP_REG_P (operands[0])"
1085 [(set_attr "op_type" "RIL")
1086 (set_attr "type" "larl")])
1088 (define_insn "*movdi_64"
1089 [(set (match_operand:DI 0 "nonimmediate_operand"
1090 "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q")
1091 (match_operand:DI 1 "general_operand"
1092 "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))]
1110 [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
1111 (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd,
1112 fstored,fstored,cs")])
1114 (define_insn "*movdi_31"
1115 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
1116 (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
1129 [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS")
1130 (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")])
1133 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1134 (match_operand:DI 1 "general_operand" ""))]
1135 "!TARGET_64BIT && reload_completed
1136 && s390_split_ok_p (operands[0], operands[1], DImode, 0)"
1137 [(set (match_dup 2) (match_dup 4))
1138 (set (match_dup 3) (match_dup 5))]
1140 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1141 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1142 operands[4] = operand_subword (operands[1], 0, 0, DImode);
1143 operands[5] = operand_subword (operands[1], 1, 0, DImode);
1147 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1148 (match_operand:DI 1 "general_operand" ""))]
1149 "!TARGET_64BIT && reload_completed
1150 && s390_split_ok_p (operands[0], operands[1], DImode, 1)"
1151 [(set (match_dup 2) (match_dup 4))
1152 (set (match_dup 3) (match_dup 5))]
1154 operands[2] = operand_subword (operands[0], 1, 0, DImode);
1155 operands[3] = operand_subword (operands[0], 0, 0, DImode);
1156 operands[4] = operand_subword (operands[1], 1, 0, DImode);
1157 operands[5] = operand_subword (operands[1], 0, 0, DImode);
1161 [(set (match_operand:DI 0 "register_operand" "")
1162 (match_operand:DI 1 "memory_operand" ""))]
1163 "!TARGET_64BIT && reload_completed
1164 && !FP_REG_P (operands[0])
1165 && !s_operand (operands[1], VOIDmode)"
1166 [(set (match_dup 0) (match_dup 1))]
1168 rtx addr = operand_subword (operands[0], 1, 0, DImode);
1169 s390_load_address (addr, XEXP (operands[1], 0));
1170 operands[1] = replace_equiv_address (operands[1], addr);
1173 (define_expand "reload_outdi"
1174 [(parallel [(match_operand:DI 0 "memory_operand" "")
1175 (match_operand:DI 1 "register_operand" "d")
1176 (match_operand:SI 2 "register_operand" "=&a")])]
1179 s390_load_address (operands[2], XEXP (operands[0], 0));
1180 operands[0] = replace_equiv_address (operands[0], operands[2]);
1181 emit_move_insn (operands[0], operands[1]);
1186 [(set (match_operand:DI 0 "register_operand" "")
1187 (mem:DI (match_operand 1 "address_operand" "")))]
1189 && !FP_REG_P (operands[0])
1190 && GET_CODE (operands[1]) == SYMBOL_REF
1191 && CONSTANT_POOL_ADDRESS_P (operands[1])
1192 && get_pool_mode (operands[1]) == DImode
1193 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1194 [(set (match_dup 0) (match_dup 2))]
1195 "operands[2] = get_pool_constant (operands[1]);")
1197 (define_insn "*la_64"
1198 [(set (match_operand:DI 0 "register_operand" "=d,d")
1199 (match_operand:QI 1 "address_operand" "U,W"))]
1204 [(set_attr "op_type" "RX,RXY")
1205 (set_attr "type" "la")])
1209 [(set (match_operand:DI 0 "register_operand" "")
1210 (match_operand:QI 1 "address_operand" ""))
1211 (clobber (reg:CC 33))])]
1213 && strict_memory_address_p (VOIDmode, operands[1])
1214 && preferred_la_operand_p (operands[1])"
1215 [(set (match_dup 0) (match_dup 1))]
1219 [(set (match_operand:DI 0 "register_operand" "")
1220 (match_operand:DI 1 "register_operand" ""))
1223 (plus:DI (match_dup 0)
1224 (match_operand:DI 2 "nonmemory_operand" "")))
1225 (clobber (reg:CC 33))])]
1227 && !reg_overlap_mentioned_p (operands[0], operands[2])
1228 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2]))
1229 && preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))"
1230 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
1233 (define_expand "reload_indi"
1234 [(parallel [(match_operand:DI 0 "register_operand" "=a")
1235 (match_operand:DI 1 "s390_plus_operand" "")
1236 (match_operand:DI 2 "register_operand" "=&a")])]
1239 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1244 ; movsi instruction pattern(s).
1247 (define_expand "movsi"
1248 [(set (match_operand:SI 0 "general_operand" "")
1249 (match_operand:SI 1 "general_operand" ""))]
1252 /* Handle symbolic constants. */
1253 if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1254 emit_symbolic_move (operands);
1256 /* expr.c tries to load an effective address using
1257 force_reg. This fails because we don't have a
1258 generic load_address pattern. Convert the move
1259 to a proper arithmetic operation instead, unless
1260 it is guaranteed to be OK. */
1261 if (GET_CODE (operands[1]) == PLUS
1262 && !legitimate_la_operand_p (operands[1]))
1264 operands[1] = force_operand (operands[1], operands[0]);
1265 if (operands[1] == operands[0])
1269 /* During and after reload, we need to force constants
1270 to the literal pool ourselves, if necessary. */
1271 if ((reload_in_progress || reload_completed)
1272 && CONSTANT_P (operands[1])
1273 && (!legitimate_reload_constant_p (operands[1])
1274 || FP_REG_P (operands[0])))
1275 operands[1] = force_const_mem (SImode, operands[1]);
1278 (define_insn "*movsi_larl"
1279 [(set (match_operand:SI 0 "register_operand" "=d")
1280 (match_operand:SI 1 "larl_operand" "X"))]
1281 "!TARGET_64BIT && TARGET_CPU_ZARCH
1282 && !FP_REG_P (operands[0])"
1284 [(set_attr "op_type" "RIL")
1285 (set_attr "type" "larl")])
1287 (define_insn "*movsi_zarch"
1288 [(set (match_operand:SI 0 "nonimmediate_operand"
1289 "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
1290 (match_operand:SI 1 "general_operand"
1291 "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
1309 [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1310 (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
1312 (define_insn "*movsi_esa"
1313 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q")
1314 (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))]
1325 [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS")
1326 (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")])
1329 [(set (match_operand:SI 0 "register_operand" "")
1330 (mem:SI (match_operand 1 "address_operand" "")))]
1331 "!FP_REG_P (operands[0])
1332 && GET_CODE (operands[1]) == SYMBOL_REF
1333 && CONSTANT_POOL_ADDRESS_P (operands[1])
1334 && get_pool_mode (operands[1]) == SImode
1335 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1336 [(set (match_dup 0) (match_dup 2))]
1337 "operands[2] = get_pool_constant (operands[1]);")
1339 (define_insn "*la_31"
1340 [(set (match_operand:SI 0 "register_operand" "=d,d")
1341 (match_operand:QI 1 "address_operand" "U,W"))]
1342 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
1346 [(set_attr "op_type" "RX,RXY")
1347 (set_attr "type" "la")])
1351 [(set (match_operand:SI 0 "register_operand" "")
1352 (match_operand:QI 1 "address_operand" ""))
1353 (clobber (reg:CC 33))])]
1355 && strict_memory_address_p (VOIDmode, operands[1])
1356 && preferred_la_operand_p (operands[1])"
1357 [(set (match_dup 0) (match_dup 1))]
1361 [(set (match_operand:SI 0 "register_operand" "")
1362 (match_operand:SI 1 "register_operand" ""))
1365 (plus:SI (match_dup 0)
1366 (match_operand:SI 2 "nonmemory_operand" "")))
1367 (clobber (reg:CC 33))])]
1369 && !reg_overlap_mentioned_p (operands[0], operands[2])
1370 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2]))
1371 && preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))"
1372 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
1375 (define_insn "*la_31_and"
1376 [(set (match_operand:SI 0 "register_operand" "=d,d")
1377 (and:SI (match_operand:QI 1 "address_operand" "U,W")
1378 (const_int 2147483647)))]
1383 [(set_attr "op_type" "RX,RXY")
1384 (set_attr "type" "la")])
1386 (define_insn_and_split "*la_31_and_cc"
1387 [(set (match_operand:SI 0 "register_operand" "=d")
1388 (and:SI (match_operand:QI 1 "address_operand" "p")
1389 (const_int 2147483647)))
1390 (clobber (reg:CC 33))]
1393 "&& reload_completed"
1395 (and:SI (match_dup 1) (const_int 2147483647)))]
1397 [(set_attr "op_type" "RX")
1398 (set_attr "type" "la")])
1400 (define_insn "force_la_31"
1401 [(set (match_operand:SI 0 "register_operand" "=d,d")
1402 (match_operand:QI 1 "address_operand" "U,W"))
1403 (use (const_int 0))]
1408 [(set_attr "op_type" "RX")
1409 (set_attr "type" "la")])
1411 (define_expand "reload_insi"
1412 [(parallel [(match_operand:SI 0 "register_operand" "=a")
1413 (match_operand:SI 1 "s390_plus_operand" "")
1414 (match_operand:SI 2 "register_operand" "=&a")])]
1417 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1422 ; movhi instruction pattern(s).
1425 (define_expand "movhi"
1426 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1427 (match_operand:HI 1 "general_operand" ""))]
1430 /* Make it explicit that loading a register from memory
1431 always sign-extends (at least) to SImode. */
1432 if (optimize && !no_new_pseudos
1433 && register_operand (operands[0], VOIDmode)
1434 && GET_CODE (operands[1]) == MEM
1435 && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
1437 rtx tmp = gen_reg_rtx (SImode);
1438 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1439 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1440 operands[1] = gen_lowpart (HImode, tmp);
1444 (define_insn "*movhi"
1445 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1446 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1456 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1457 (set_attr "type" "lr,*,*,*,store,store,cs")])
1460 [(set (match_operand:HI 0 "register_operand" "")
1461 (mem:HI (match_operand 1 "address_operand" "")))]
1462 "GET_CODE (operands[1]) == SYMBOL_REF
1463 && CONSTANT_POOL_ADDRESS_P (operands[1])
1464 && get_pool_mode (operands[1]) == HImode
1465 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1466 [(set (match_dup 0) (match_dup 2))]
1467 "operands[2] = get_pool_constant (operands[1]);")
1470 ; movqi instruction pattern(s).
1473 (define_expand "movqi"
1474 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1475 (match_operand:QI 1 "general_operand" ""))]
1478 /* On z/Architecture, zero-extending from memory to register
1479 is just as fast as a QImode load. */
1480 if (TARGET_ZARCH && optimize && !no_new_pseudos
1481 && register_operand (operands[0], VOIDmode)
1482 && GET_CODE (operands[1]) == MEM
1483 && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
1485 rtx tmp = gen_reg_rtx (word_mode);
1486 rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
1487 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1488 operands[1] = gen_lowpart (QImode, tmp);
1492 (define_insn "*movqi"
1493 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1494 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1506 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1507 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1510 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1511 (mem:QI (match_operand 1 "address_operand" "")))]
1512 "GET_CODE (operands[1]) == SYMBOL_REF
1513 && CONSTANT_POOL_ADDRESS_P (operands[1])
1514 && get_pool_mode (operands[1]) == QImode
1515 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1516 [(set (match_dup 0) (match_dup 2))]
1517 "operands[2] = get_pool_constant (operands[1]);")
1520 ; movstrictqi instruction pattern(s).
1523 (define_insn "*movstrictqi"
1524 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1525 (match_operand:QI 1 "memory_operand" "R,T"))]
1530 [(set_attr "op_type" "RX,RXY")])
1533 ; movstricthi instruction pattern(s).
1536 (define_insn "*movstricthi"
1537 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1538 (match_operand:HI 1 "s_imm_operand" "Q,S"))
1539 (clobber (reg:CC 33))]
1544 [(set_attr "op_type" "RS,RSY")])
1547 ; movstrictsi instruction pattern(s).
1550 (define_insn "movstrictsi"
1551 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1552 (match_operand:SI 1 "general_operand" "d,R,T"))]
1558 [(set_attr "op_type" "RR,RX,RXY")
1559 (set_attr "type" "lr,load,load")])
1562 ; movdf instruction pattern(s).
1565 (define_expand "movdf"
1566 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1567 (match_operand:DF 1 "general_operand" ""))]
1570 /* During and after reload, we need to force constants
1571 to the literal pool ourselves, if necessary. */
1572 if ((reload_in_progress || reload_completed)
1573 && CONSTANT_P (operands[1]))
1574 operands[1] = force_const_mem (DFmode, operands[1]);
1577 (define_insn "*movdf_64"
1578 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1579 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1591 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1592 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1594 (define_insn "*movdf_31"
1595 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1596 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1609 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1610 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1613 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1614 (match_operand:DF 1 "general_operand" ""))]
1615 "!TARGET_64BIT && reload_completed
1616 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1617 [(set (match_dup 2) (match_dup 4))
1618 (set (match_dup 3) (match_dup 5))]
1620 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1621 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1622 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1623 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1627 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1628 (match_operand:DF 1 "general_operand" ""))]
1629 "!TARGET_64BIT && reload_completed
1630 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1631 [(set (match_dup 2) (match_dup 4))
1632 (set (match_dup 3) (match_dup 5))]
1634 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1635 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1636 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1637 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1641 [(set (match_operand:DF 0 "register_operand" "")
1642 (match_operand:DF 1 "memory_operand" ""))]
1643 "!TARGET_64BIT && reload_completed
1644 && !FP_REG_P (operands[0])
1645 && !s_operand (operands[1], VOIDmode)"
1646 [(set (match_dup 0) (match_dup 1))]
1648 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1649 s390_load_address (addr, XEXP (operands[1], 0));
1650 operands[1] = replace_equiv_address (operands[1], addr);
1653 (define_expand "reload_outdf"
1654 [(parallel [(match_operand:DF 0 "memory_operand" "")
1655 (match_operand:DF 1 "register_operand" "d")
1656 (match_operand:SI 2 "register_operand" "=&a")])]
1659 s390_load_address (operands[2], XEXP (operands[0], 0));
1660 operands[0] = replace_equiv_address (operands[0], operands[2]);
1661 emit_move_insn (operands[0], operands[1]);
1666 ; movsf instruction pattern(s).
1669 (define_expand "movsf"
1670 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1671 (match_operand:SF 1 "general_operand" ""))]
1674 /* During and after reload, we need to force constants
1675 to the literal pool ourselves, if necessary. */
1676 if ((reload_in_progress || reload_completed)
1677 && CONSTANT_P (operands[1]))
1678 operands[1] = force_const_mem (SFmode, operands[1]);
1681 (define_insn "*movsf"
1682 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1683 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1697 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1698 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1701 ; load_multiple pattern(s).
1703 ; ??? Due to reload problems with replacing registers inside match_parallel
1704 ; we currently support load_multiple/store_multiple only after reload.
1707 (define_expand "load_multiple"
1708 [(match_par_dup 3 [(set (match_operand 0 "" "")
1709 (match_operand 1 "" ""))
1710 (use (match_operand 2 "" ""))])]
1713 enum machine_mode mode;
1719 /* Support only loading a constant number of fixed-point registers from
1720 memory and only bother with this if more than two */
1721 if (GET_CODE (operands[2]) != CONST_INT
1722 || INTVAL (operands[2]) < 2
1723 || INTVAL (operands[2]) > 16
1724 || GET_CODE (operands[1]) != MEM
1725 || GET_CODE (operands[0]) != REG
1726 || REGNO (operands[0]) >= 16)
1729 count = INTVAL (operands[2]);
1730 regno = REGNO (operands[0]);
1731 mode = GET_MODE (operands[0]);
1732 if (mode != SImode && mode != word_mode)
1735 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1738 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1740 from = XEXP (operands[1], 0);
1743 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1744 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1745 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1747 from = XEXP (XEXP (operands[1], 0), 0);
1748 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1753 if (from == frame_pointer_rtx || from == arg_pointer_rtx)
1758 from = force_reg (Pmode, XEXP (operands[1], 0));
1762 for (i = 0; i < count; i++)
1763 XVECEXP (operands[3], 0, i)
1764 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1765 change_address (operands[1], mode,
1766 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1769 (define_insn "*load_multiple_di"
1770 [(match_parallel 0 "load_multiple_operation"
1771 [(set (match_operand:DI 1 "register_operand" "=r")
1772 (match_operand:DI 2 "s_operand" "QS"))])]
1773 "reload_completed && word_mode == DImode"
1775 int words = XVECLEN (operands[0], 0);
1776 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1777 return "lmg\t%1,%0,%2";
1779 [(set_attr "op_type" "RSY")
1780 (set_attr "type" "lm")])
1782 (define_insn "*load_multiple_si"
1783 [(match_parallel 0 "load_multiple_operation"
1784 [(set (match_operand:SI 1 "register_operand" "=r,r")
1785 (match_operand:SI 2 "s_operand" "Q,S"))])]
1788 int words = XVECLEN (operands[0], 0);
1789 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1790 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1792 [(set_attr "op_type" "RS,RSY")
1793 (set_attr "type" "lm")])
1796 ; store multiple pattern(s).
1799 (define_expand "store_multiple"
1800 [(match_par_dup 3 [(set (match_operand 0 "" "")
1801 (match_operand 1 "" ""))
1802 (use (match_operand 2 "" ""))])]
1805 enum machine_mode mode;
1811 /* Support only storing a constant number of fixed-point registers to
1812 memory and only bother with this if more than two. */
1813 if (GET_CODE (operands[2]) != CONST_INT
1814 || INTVAL (operands[2]) < 2
1815 || INTVAL (operands[2]) > 16
1816 || GET_CODE (operands[0]) != MEM
1817 || GET_CODE (operands[1]) != REG
1818 || REGNO (operands[1]) >= 16)
1821 count = INTVAL (operands[2]);
1822 regno = REGNO (operands[1]);
1823 mode = GET_MODE (operands[1]);
1824 if (mode != SImode && mode != word_mode)
1827 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1831 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1833 to = XEXP (operands[0], 0);
1836 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1837 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1838 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1840 to = XEXP (XEXP (operands[0], 0), 0);
1841 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1846 if (to == frame_pointer_rtx || to == arg_pointer_rtx)
1851 to = force_reg (Pmode, XEXP (operands[0], 0));
1855 for (i = 0; i < count; i++)
1856 XVECEXP (operands[3], 0, i)
1857 = gen_rtx_SET (VOIDmode,
1858 change_address (operands[0], mode,
1859 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1860 gen_rtx_REG (mode, regno + i));
1863 (define_insn "*store_multiple_di"
1864 [(match_parallel 0 "store_multiple_operation"
1865 [(set (match_operand:DI 1 "s_operand" "=QS")
1866 (match_operand:DI 2 "register_operand" "r"))])]
1867 "reload_completed && word_mode == DImode"
1869 int words = XVECLEN (operands[0], 0);
1870 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1871 return "stmg\t%2,%0,%1";
1873 [(set_attr "op_type" "RSY")
1874 (set_attr "type" "stm")])
1877 (define_insn "*store_multiple_si"
1878 [(match_parallel 0 "store_multiple_operation"
1879 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1880 (match_operand:SI 2 "register_operand" "r,r"))])]
1883 int words = XVECLEN (operands[0], 0);
1884 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1885 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1887 [(set_attr "op_type" "RS,RSY")
1888 (set_attr "type" "stm")])
1891 ;; String instructions.
1895 ; strlenM instruction pattern(s).
1898 (define_expand "strlendi"
1899 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1902 (unspec:DI [(const_int 0)
1903 (match_operand:BLK 1 "memory_operand" "")
1905 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1906 (clobber (scratch:DI))
1907 (clobber (reg:CC 33))])
1909 [(set (match_operand:DI 0 "register_operand" "")
1910 (minus:DI (match_dup 4) (match_dup 5)))
1911 (clobber (reg:CC 33))])]
1914 operands[4] = gen_reg_rtx (DImode);
1915 operands[5] = gen_reg_rtx (DImode);
1916 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1917 operands[1] = replace_equiv_address (operands[1], operands[5]);
1920 (define_insn "*strlendi"
1921 [(set (match_operand:DI 0 "register_operand" "=a")
1922 (unspec:DI [(match_operand:DI 2 "general_operand" "0")
1923 (mem:BLK (match_operand:DI 3 "register_operand" "1"))
1925 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1926 (clobber (match_scratch:DI 1 "=a"))
1927 (clobber (reg:CC 33))]
1929 "srst\t%0,%1\;jo\t.-4"
1930 [(set_attr "op_type" "NN")
1931 (set_attr "type" "vs")
1932 (set_attr "length" "8")])
1934 (define_expand "strlensi"
1935 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1938 (unspec:SI [(const_int 0)
1939 (match_operand:BLK 1 "memory_operand" "")
1941 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1942 (clobber (scratch:SI))
1943 (clobber (reg:CC 33))])
1945 [(set (match_operand:SI 0 "register_operand" "")
1946 (minus:SI (match_dup 4) (match_dup 5)))
1947 (clobber (reg:CC 33))])]
1950 operands[4] = gen_reg_rtx (SImode);
1951 operands[5] = gen_reg_rtx (SImode);
1952 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1953 operands[1] = replace_equiv_address (operands[1], operands[5]);
1956 (define_insn "*strlensi"
1957 [(set (match_operand:SI 0 "register_operand" "=a")
1958 (unspec:SI [(match_operand:SI 2 "general_operand" "0")
1959 (mem:BLK (match_operand:SI 3 "register_operand" "1"))
1961 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1962 (clobber (match_scratch:SI 1 "=a"))
1963 (clobber (reg:CC 33))]
1965 "srst\t%0,%1\;jo\t.-4"
1966 [(set_attr "op_type" "NN")
1967 (set_attr "type" "vs")
1968 (set_attr "length" "8")])
1971 ; movstrM instruction pattern(s).
1974 (define_expand "movstrdi"
1975 [(set (match_operand:BLK 0 "memory_operand" "")
1976 (match_operand:BLK 1 "memory_operand" ""))
1977 (use (match_operand:DI 2 "general_operand" ""))
1978 (match_operand 3 "" "")]
1980 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1982 (define_expand "movstrsi"
1983 [(set (match_operand:BLK 0 "memory_operand" "")
1984 (match_operand:BLK 1 "memory_operand" ""))
1985 (use (match_operand:SI 2 "general_operand" ""))
1986 (match_operand 3 "" "")]
1988 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1990 ; Move a block that is up to 256 bytes in length.
1991 ; The block length is taken as (operands[2] % 256) + 1.
1993 (define_expand "movstr_short"
1995 [(set (match_operand:BLK 0 "memory_operand" "")
1996 (match_operand:BLK 1 "memory_operand" ""))
1997 (use (match_operand 2 "nonmemory_operand" ""))
1998 (clobber (match_dup 3))])]
2000 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2002 (define_insn "*movstr_short"
2003 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
2004 (match_operand:BLK 1 "memory_operand" "Q,Q"))
2005 (use (match_operand 2 "nonmemory_operand" "n,a"))
2006 (clobber (match_scratch 3 "=X,&a"))]
2007 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2008 && GET_MODE (operands[3]) == Pmode"
2010 switch (which_alternative)
2013 return "mvc\t%O0(%b2+1,%R0),%1";
2016 output_asm_insn ("bras\t%3,.+10", operands);
2017 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
2018 return "ex\t%2,0(%3)";
2024 [(set_attr "op_type" "SS,NN")
2025 (set_attr "type" "cs,cs")
2026 (set_attr "atype" "*,agen")
2027 (set_attr "length" "*,14")])
2029 ; Move a block of arbitrary length.
2031 (define_expand "movstr_long"
2033 [(clobber (match_dup 2))
2034 (clobber (match_dup 3))
2035 (set (match_operand:BLK 0 "memory_operand" "")
2036 (match_operand:BLK 1 "memory_operand" ""))
2037 (use (match_operand 2 "general_operand" ""))
2039 (clobber (reg:CC 33))])]
2042 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2043 rtx reg0 = gen_reg_rtx (dword_mode);
2044 rtx reg1 = gen_reg_rtx (dword_mode);
2045 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2046 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2047 rtx len0 = gen_lowpart (Pmode, reg0);
2048 rtx len1 = gen_lowpart (Pmode, reg1);
2050 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2051 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2052 emit_move_insn (len0, operands[2]);
2054 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2055 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2056 emit_move_insn (len1, operands[2]);
2058 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2059 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2064 (define_insn "*movstr_long_64"
2065 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2066 (clobber (match_operand:TI 1 "register_operand" "=d"))
2067 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2068 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
2071 (clobber (reg:CC 33))]
2073 "mvcle\t%0,%1,0\;jo\t.-4"
2074 [(set_attr "op_type" "NN")
2075 (set_attr "type" "vs")
2076 (set_attr "length" "8")])
2078 (define_insn "*movstr_long_31"
2079 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2080 (clobber (match_operand:DI 1 "register_operand" "=d"))
2081 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2082 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
2085 (clobber (reg:CC 33))]
2087 "mvcle\t%0,%1,0\;jo\t.-4"
2088 [(set_attr "op_type" "NN")
2089 (set_attr "type" "vs")
2090 (set_attr "length" "8")])
2093 ; clrstrM instruction pattern(s).
2096 (define_expand "clrstrdi"
2097 [(set (match_operand:BLK 0 "memory_operand" "")
2099 (use (match_operand:DI 1 "general_operand" ""))
2100 (match_operand 2 "" "")]
2102 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
2104 (define_expand "clrstrsi"
2105 [(set (match_operand:BLK 0 "memory_operand" "")
2107 (use (match_operand:SI 1 "general_operand" ""))
2108 (match_operand 2 "" "")]
2110 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
2112 ; Clear a block that is up to 256 bytes in length.
2113 ; The block length is taken as (operands[1] % 256) + 1.
2115 (define_expand "clrstr_short"
2117 [(set (match_operand:BLK 0 "memory_operand" "")
2119 (use (match_operand 1 "nonmemory_operand" ""))
2120 (clobber (match_dup 2))
2121 (clobber (reg:CC 33))])]
2123 "operands[2] = gen_rtx_SCRATCH (Pmode);")
2125 (define_insn "*clrstr_short"
2126 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
2128 (use (match_operand 1 "nonmemory_operand" "n,a"))
2129 (clobber (match_scratch 2 "=X,&a"))
2130 (clobber (reg:CC 33))]
2131 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
2132 && GET_MODE (operands[2]) == Pmode"
2134 switch (which_alternative)
2137 return "xc\t%O0(%b1+1,%R0),%0";
2140 output_asm_insn ("bras\t%2,.+10", operands);
2141 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
2142 return "ex\t%1,0(%2)";
2148 [(set_attr "op_type" "SS,NN")
2149 (set_attr "type" "cs,cs")
2150 (set_attr "atype" "*,agen")
2151 (set_attr "length" "*,14")])
2153 ; Clear a block of arbitrary length.
2155 (define_expand "clrstr_long"
2157 [(clobber (match_dup 1))
2158 (set (match_operand:BLK 0 "memory_operand" "")
2160 (use (match_operand 1 "general_operand" ""))
2162 (clobber (reg:CC 33))])]
2165 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2166 rtx reg0 = gen_reg_rtx (dword_mode);
2167 rtx reg1 = gen_reg_rtx (dword_mode);
2168 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2169 rtx len0 = gen_lowpart (Pmode, reg0);
2171 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2172 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2173 emit_move_insn (len0, operands[1]);
2175 emit_move_insn (reg1, const0_rtx);
2177 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2182 (define_insn "*clrstr_long_64"
2183 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2184 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2187 (use (match_operand:TI 1 "register_operand" "d"))
2188 (clobber (reg:CC 33))]
2190 "mvcle\t%0,%1,0\;jo\t.-4"
2191 [(set_attr "op_type" "NN")
2192 (set_attr "type" "vs")
2193 (set_attr "length" "8")])
2195 (define_insn "*clrstr_long_31"
2196 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2197 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2200 (use (match_operand:DI 1 "register_operand" "d"))
2201 (clobber (reg:CC 33))]
2203 "mvcle\t%0,%1,0\;jo\t.-4"
2204 [(set_attr "op_type" "NN")
2205 (set_attr "type" "vs")
2206 (set_attr "length" "8")])
2209 ; cmpmemM instruction pattern(s).
2212 (define_expand "cmpmemdi"
2213 [(set (match_operand:DI 0 "register_operand" "")
2214 (compare:DI (match_operand:BLK 1 "memory_operand" "")
2215 (match_operand:BLK 2 "memory_operand" "") ) )
2216 (use (match_operand:DI 3 "general_operand" ""))
2217 (use (match_operand:DI 4 "" ""))]
2219 "s390_expand_cmpmem (operands[0], operands[1],
2220 operands[2], operands[3]); DONE;")
2222 (define_expand "cmpmemsi"
2223 [(set (match_operand:SI 0 "register_operand" "")
2224 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2225 (match_operand:BLK 2 "memory_operand" "") ) )
2226 (use (match_operand:SI 3 "general_operand" ""))
2227 (use (match_operand:SI 4 "" ""))]
2229 "s390_expand_cmpmem (operands[0], operands[1],
2230 operands[2], operands[3]); DONE;")
2232 ; Compare a block that is up to 256 bytes in length.
2233 ; The block length is taken as (operands[2] % 256) + 1.
2235 (define_expand "cmpmem_short"
2238 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2239 (match_operand:BLK 1 "memory_operand" "")))
2240 (use (match_operand 2 "nonmemory_operand" ""))
2241 (clobber (match_dup 3))])]
2243 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2245 (define_insn "*cmpmem_short"
2247 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2248 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2249 (use (match_operand 2 "nonmemory_operand" "n,a"))
2250 (clobber (match_scratch 3 "=X,&a"))]
2251 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2252 && GET_MODE (operands[3]) == Pmode"
2254 switch (which_alternative)
2257 return "clc\t%O0(%b2+1,%R0),%1";
2260 output_asm_insn ("bras\t%3,.+10", operands);
2261 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2262 return "ex\t%2,0(%3)";
2268 [(set_attr "op_type" "SS,NN")
2269 (set_attr "type" "cs,cs")
2270 (set_attr "atype" "*,agen")
2271 (set_attr "length" "*,14")])
2273 ; Compare a block of arbitrary length.
2275 (define_expand "cmpmem_long"
2277 [(clobber (match_dup 2))
2278 (clobber (match_dup 3))
2280 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2281 (match_operand:BLK 1 "memory_operand" "")))
2282 (use (match_operand 2 "general_operand" ""))
2283 (use (match_dup 3))])]
2286 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2287 rtx reg0 = gen_reg_rtx (dword_mode);
2288 rtx reg1 = gen_reg_rtx (dword_mode);
2289 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2290 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2291 rtx len0 = gen_lowpart (Pmode, reg0);
2292 rtx len1 = gen_lowpart (Pmode, reg1);
2294 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2295 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2296 emit_move_insn (len0, operands[2]);
2298 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2299 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2300 emit_move_insn (len1, operands[2]);
2302 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2303 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2308 (define_insn "*cmpmem_long_64"
2309 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2310 (clobber (match_operand:TI 1 "register_operand" "=d"))
2312 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2313 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2315 (use (match_dup 3))]
2317 "clcle\t%0,%1,0\;jo\t.-4"
2318 [(set_attr "op_type" "NN")
2319 (set_attr "type" "vs")
2320 (set_attr "length" "8")])
2322 (define_insn "*cmpmem_long_31"
2323 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2324 (clobber (match_operand:DI 1 "register_operand" "=d"))
2326 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2327 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2329 (use (match_dup 3))]
2331 "clcle\t%0,%1,0\;jo\t.-4"
2332 [(set_attr "op_type" "NN")
2333 (set_attr "type" "vs")
2334 (set_attr "length" "8")])
2336 ; Convert condition code to integer in range (-1, 0, 1)
2338 (define_insn "cmpint_si"
2339 [(set (match_operand:SI 0 "register_operand" "=d")
2340 (compare:SI (reg:CCS 33) (const_int 0)))]
2343 output_asm_insn ("lhi\t%0,1", operands);
2344 output_asm_insn ("jh\t.+12", operands);
2345 output_asm_insn ("jl\t.+6", operands);
2346 output_asm_insn ("sr\t%0,%0", operands);
2347 return "lcr\t%0,%0";
2349 [(set_attr "op_type" "NN")
2350 (set_attr "length" "16")
2351 (set_attr "type" "other")])
2353 (define_insn "cmpint_di"
2354 [(set (match_operand:DI 0 "register_operand" "=d")
2355 (compare:DI (reg:CCS 33) (const_int 0)))]
2358 output_asm_insn ("lghi\t%0,1", operands);
2359 output_asm_insn ("jh\t.+16", operands);
2360 output_asm_insn ("jl\t.+8", operands);
2361 output_asm_insn ("sgr\t%0,%0", operands);
2362 return "lcgr\t%0,%0";
2364 [(set_attr "op_type" "NN")
2365 (set_attr "length" "20")
2366 (set_attr "type" "other")])
2370 ;;- Conversion instructions.
2373 (define_insn "*sethighqisi"
2374 [(set (match_operand:SI 0 "register_operand" "=d,d")
2375 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2376 (clobber (reg:CC 33))]
2381 [(set_attr "op_type" "RS,RSY")])
2383 (define_insn "*sethighhisi"
2384 [(set (match_operand:SI 0 "register_operand" "=d,d")
2385 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2386 (clobber (reg:CC 33))]
2391 [(set_attr "op_type" "RS,RSY")])
2393 (define_insn "*sethighqidi_64"
2394 [(set (match_operand:DI 0 "register_operand" "=d")
2395 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2396 (clobber (reg:CC 33))]
2399 [(set_attr "op_type" "RSY")])
2401 (define_insn "*sethighqidi_31"
2402 [(set (match_operand:DI 0 "register_operand" "=d,d")
2403 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2404 (clobber (reg:CC 33))]
2409 [(set_attr "op_type" "RS,RSY")])
2411 (define_insn_and_split "*extractqi"
2412 [(set (match_operand:SI 0 "register_operand" "=d")
2413 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2414 (match_operand 2 "const_int_operand" "n")
2416 (clobber (reg:CC 33))]
2418 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2420 "&& reload_completed"
2422 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2423 (clobber (reg:CC 33))])
2424 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2426 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2427 operands[1] = change_address (operands[1], QImode, 0);
2429 [(set_attr "atype" "agen")])
2431 (define_insn_and_split "*extracthi"
2432 [(set (match_operand:SI 0 "register_operand" "=d")
2433 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2434 (match_operand 2 "const_int_operand" "n")
2436 (clobber (reg:CC 33))]
2438 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2440 "&& reload_completed"
2442 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2443 (clobber (reg:CC 33))])
2444 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2446 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2447 operands[1] = change_address (operands[1], HImode, 0);
2449 [(set_attr "atype" "agen")])
2452 ; extendsidi2 instruction pattern(s).
2455 (define_expand "extendsidi2"
2456 [(set (match_operand:DI 0 "register_operand" "")
2457 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2463 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2464 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2465 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2466 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2472 (define_insn "*extendsidi2"
2473 [(set (match_operand:DI 0 "register_operand" "=d,d")
2474 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2479 [(set_attr "op_type" "RRE,RXY")])
2482 ; extendhidi2 instruction pattern(s).
2485 (define_expand "extendhidi2"
2486 [(set (match_operand:DI 0 "register_operand" "")
2487 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2493 rtx tmp = gen_reg_rtx (SImode);
2494 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2495 emit_insn (gen_extendsidi2 (operands[0], tmp));
2500 operands[1] = gen_lowpart (DImode, operands[1]);
2501 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2502 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2508 (define_insn "*extendhidi2"
2509 [(set (match_operand:DI 0 "register_operand" "=d")
2510 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2513 [(set_attr "op_type" "RXY")])
2516 ; extendqidi2 instruction pattern(s).
2519 (define_expand "extendqidi2"
2520 [(set (match_operand:DI 0 "register_operand" "")
2521 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2527 rtx tmp = gen_reg_rtx (SImode);
2528 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2529 emit_insn (gen_extendsidi2 (operands[0], tmp));
2534 operands[1] = gen_lowpart (DImode, operands[1]);
2535 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2536 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2542 (define_insn "*extendqidi2"
2543 [(set (match_operand:DI 0 "register_operand" "=d")
2544 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2545 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2547 [(set_attr "op_type" "RXY")])
2549 (define_insn_and_split "*extendqidi2_short_displ"
2550 [(set (match_operand:DI 0 "register_operand" "=d")
2551 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2552 (clobber (reg:CC 33))]
2553 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2555 "&& reload_completed"
2557 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2558 (clobber (reg:CC 33))])
2560 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2561 (clobber (reg:CC 33))])]
2565 ; extendhisi2 instruction pattern(s).
2568 (define_expand "extendhisi2"
2569 [(set (match_operand:SI 0 "register_operand" "")
2570 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2574 operands[1] = gen_lowpart (SImode, operands[1]);
2575 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2576 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2581 (define_insn "*extendhisi2"
2582 [(set (match_operand:SI 0 "register_operand" "=d,d")
2583 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2588 [(set_attr "op_type" "RX,RXY")])
2591 ; extendqisi2 instruction pattern(s).
2594 (define_expand "extendqisi2"
2595 [(set (match_operand:SI 0 "register_operand" "")
2596 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2600 operands[1] = gen_lowpart (SImode, operands[1]);
2601 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2602 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2607 (define_insn "*extendqisi2"
2608 [(set (match_operand:SI 0 "register_operand" "=d")
2609 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2610 "TARGET_LONG_DISPLACEMENT"
2612 [(set_attr "op_type" "RXY")])
2614 (define_insn_and_split "*extendqisi2_short_displ"
2615 [(set (match_operand:SI 0 "register_operand" "=d")
2616 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2617 (clobber (reg:CC 33))]
2618 "!TARGET_LONG_DISPLACEMENT"
2620 "&& reload_completed"
2622 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2623 (clobber (reg:CC 33))])
2625 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2626 (clobber (reg:CC 33))])]
2630 ; extendqihi2 instruction pattern(s).
2635 ; zero_extendsidi2 instruction pattern(s).
2638 (define_expand "zero_extendsidi2"
2639 [(set (match_operand:DI 0 "register_operand" "")
2640 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2646 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2647 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2648 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2654 (define_insn "*zero_extendsidi2"
2655 [(set (match_operand:DI 0 "register_operand" "=d,d")
2656 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2661 [(set_attr "op_type" "RRE,RXY")])
2664 ; zero_extendhidi2 instruction pattern(s).
2667 (define_expand "zero_extendhidi2"
2668 [(set (match_operand:DI 0 "register_operand" "")
2669 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2675 rtx tmp = gen_reg_rtx (SImode);
2676 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2677 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2682 operands[1] = gen_lowpart (DImode, operands[1]);
2683 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2684 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2690 (define_insn "*zero_extendhidi2"
2691 [(set (match_operand:DI 0 "register_operand" "=d")
2692 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2695 [(set_attr "op_type" "RXY")])
2698 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2701 (define_insn "*llgt_sisi"
2702 [(set (match_operand:SI 0 "register_operand" "=d,d")
2703 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2704 (const_int 2147483647)))]
2709 [(set_attr "op_type" "RRE,RXE")])
2712 [(set (match_operand:SI 0 "register_operand" "")
2713 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2714 (const_int 2147483647)))
2715 (clobber (reg:CC 33))]
2716 "TARGET_64BIT && reload_completed"
2718 (and:SI (match_dup 1)
2719 (const_int 2147483647)))]
2722 (define_insn "*llgt_didi"
2723 [(set (match_operand:DI 0 "register_operand" "=d,d")
2724 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2725 (const_int 2147483647)))]
2730 [(set_attr "op_type" "RRE,RXE")])
2733 [(set (match_operand:DI 0 "register_operand" "")
2734 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2735 (const_int 2147483647)))
2736 (clobber (reg:CC 33))]
2737 "TARGET_64BIT && reload_completed"
2739 (and:DI (match_dup 1)
2740 (const_int 2147483647)))]
2743 (define_insn "*llgt_sidi"
2744 [(set (match_operand:DI 0 "register_operand" "=d")
2745 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2746 (const_int 2147483647)))]
2749 [(set_attr "op_type" "RXE")])
2751 (define_insn_and_split "*llgt_sidi_split"
2752 [(set (match_operand:DI 0 "register_operand" "=d")
2753 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2754 (const_int 2147483647)))
2755 (clobber (reg:CC 33))]
2758 "&& reload_completed"
2760 (and:DI (subreg:DI (match_dup 1) 0)
2761 (const_int 2147483647)))]
2765 ; zero_extendqidi2 instruction pattern(s)
2768 (define_expand "zero_extendqidi2"
2769 [(set (match_operand:DI 0 "register_operand" "")
2770 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2776 rtx tmp = gen_reg_rtx (SImode);
2777 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2778 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2783 operands[1] = gen_lowpart (DImode, operands[1]);
2784 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2785 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2791 (define_insn "*zero_extendqidi2"
2792 [(set (match_operand:DI 0 "register_operand" "=d")
2793 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2796 [(set_attr "op_type" "RXY")])
2799 ; zero_extendhisi2 instruction pattern(s).
2802 (define_expand "zero_extendhisi2"
2803 [(set (match_operand:SI 0 "register_operand" "")
2804 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2808 operands[1] = gen_lowpart (SImode, operands[1]);
2809 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2814 (define_insn "*zero_extendhisi2_64"
2815 [(set (match_operand:SI 0 "register_operand" "=d")
2816 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2819 [(set_attr "op_type" "RXY")])
2821 (define_insn_and_split "*zero_extendhisi2_31"
2822 [(set (match_operand:SI 0 "register_operand" "=&d")
2823 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2824 (clobber (reg:CC 33))]
2827 "&& reload_completed"
2828 [(set (match_dup 0) (const_int 0))
2830 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2831 (clobber (reg:CC 33))])]
2832 "operands[2] = gen_lowpart (HImode, operands[0]);"
2833 [(set_attr "atype" "agen")])
2836 ; zero_extendqisi2 instruction pattern(s).
2839 (define_expand "zero_extendqisi2"
2840 [(set (match_operand:SI 0 "register_operand" "")
2841 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2845 operands[1] = gen_lowpart (SImode, operands[1]);
2846 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2851 (define_insn "*zero_extendqisi2_64"
2852 [(set (match_operand:SI 0 "register_operand" "=d")
2853 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2856 [(set_attr "op_type" "RXY")])
2858 (define_insn_and_split "*zero_extendqisi2_31"
2859 [(set (match_operand:SI 0 "register_operand" "=&d")
2860 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2863 "&& reload_completed"
2864 [(set (match_dup 0) (const_int 0))
2865 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2866 "operands[2] = gen_lowpart (QImode, operands[0]);"
2867 [(set_attr "atype" "agen")])
2870 ; zero_extendqihi2 instruction pattern(s).
2873 (define_expand "zero_extendqihi2"
2874 [(set (match_operand:HI 0 "register_operand" "")
2875 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2879 operands[1] = gen_lowpart (HImode, operands[1]);
2880 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2885 (define_insn "*zero_extendqihi2_64"
2886 [(set (match_operand:HI 0 "register_operand" "=d")
2887 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2890 [(set_attr "op_type" "RXY")])
2892 (define_insn_and_split "*zero_extendqihi2_31"
2893 [(set (match_operand:HI 0 "register_operand" "=&d")
2894 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2897 "&& reload_completed"
2898 [(set (match_dup 0) (const_int 0))
2899 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2900 "operands[2] = gen_lowpart (QImode, operands[0]);"
2901 [(set_attr "atype" "agen")])
2905 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2908 (define_expand "fixuns_truncdfdi2"
2909 [(set (match_operand:DI 0 "register_operand" "")
2910 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2911 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2913 rtx label1 = gen_label_rtx ();
2914 rtx label2 = gen_label_rtx ();
2915 rtx temp = gen_reg_rtx (DFmode);
2916 operands[1] = force_reg (DFmode, operands[1]);
2918 emit_insn (gen_cmpdf (operands[1],
2919 CONST_DOUBLE_FROM_REAL_VALUE (
2920 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2921 emit_jump_insn (gen_blt (label1));
2922 emit_insn (gen_subdf3 (temp, operands[1],
2923 CONST_DOUBLE_FROM_REAL_VALUE (
2924 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2925 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2928 emit_label (label1);
2929 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2930 emit_label (label2);
2934 (define_expand "fix_truncdfdi2"
2935 [(set (match_operand:DI 0 "register_operand" "")
2936 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2937 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2939 operands[1] = force_reg (DFmode, operands[1]);
2940 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2944 (define_insn "fix_truncdfdi2_ieee"
2945 [(set (match_operand:DI 0 "register_operand" "=d")
2946 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2947 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2948 (clobber (reg:CC 33))]
2949 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2951 [(set_attr "op_type" "RRE")
2952 (set_attr "type" "ftoi")])
2955 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2958 (define_expand "fixuns_truncdfsi2"
2959 [(set (match_operand:SI 0 "register_operand" "")
2960 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2961 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2963 rtx label1 = gen_label_rtx ();
2964 rtx label2 = gen_label_rtx ();
2965 rtx temp = gen_reg_rtx (DFmode);
2967 operands[1] = force_reg (DFmode,operands[1]);
2968 emit_insn (gen_cmpdf (operands[1],
2969 CONST_DOUBLE_FROM_REAL_VALUE (
2970 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2971 emit_jump_insn (gen_blt (label1));
2972 emit_insn (gen_subdf3 (temp, operands[1],
2973 CONST_DOUBLE_FROM_REAL_VALUE (
2974 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2975 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2978 emit_label (label1);
2979 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2980 emit_label (label2);
2984 (define_expand "fix_truncdfsi2"
2985 [(set (match_operand:SI 0 "register_operand" "")
2986 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2989 if (TARGET_IBM_FLOAT)
2991 /* This is the algorithm from POP chapter A.5.7.2. */
2993 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2994 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2995 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2997 operands[1] = force_reg (DFmode, operands[1]);
2998 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2999 two31r, two32, temp));
3003 operands[1] = force_reg (DFmode, operands[1]);
3004 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3010 (define_insn "fix_truncdfsi2_ieee"
3011 [(set (match_operand:SI 0 "register_operand" "=d")
3012 (fix:SI (match_operand:DF 1 "register_operand" "f")))
3013 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3014 (clobber (reg:CC 33))]
3015 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3017 [(set_attr "op_type" "RRE")
3018 (set_attr "type" "other" )])
3020 (define_insn "fix_truncdfsi2_ibm"
3021 [(set (match_operand:SI 0 "register_operand" "=d")
3022 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
3023 (use (match_operand:DI 2 "immediate_operand" "m"))
3024 (use (match_operand:DI 3 "immediate_operand" "m"))
3025 (use (match_operand:BLK 4 "memory_operand" "m"))
3026 (clobber (reg:CC 33))]
3027 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3029 output_asm_insn ("sd\t%1,%2", operands);
3030 output_asm_insn ("aw\t%1,%3", operands);
3031 output_asm_insn ("std\t%1,%4", operands);
3032 output_asm_insn ("xi\t%N4,128", operands);
3035 [(set_attr "op_type" "NN")
3036 (set_attr "type" "ftoi")
3037 (set_attr "atype" "agen")
3038 (set_attr "length" "20")])
3041 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
3044 (define_expand "fixuns_truncsfdi2"
3045 [(set (match_operand:DI 0 "register_operand" "")
3046 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
3047 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3049 rtx label1 = gen_label_rtx ();
3050 rtx label2 = gen_label_rtx ();
3051 rtx temp = gen_reg_rtx (SFmode);
3053 operands[1] = force_reg (SFmode, operands[1]);
3054 emit_insn (gen_cmpsf (operands[1],
3055 CONST_DOUBLE_FROM_REAL_VALUE (
3056 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
3057 emit_jump_insn (gen_blt (label1));
3059 emit_insn (gen_subsf3 (temp, operands[1],
3060 CONST_DOUBLE_FROM_REAL_VALUE (
3061 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
3062 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
3065 emit_label (label1);
3066 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
3067 emit_label (label2);
3071 (define_expand "fix_truncsfdi2"
3072 [(set (match_operand:DI 0 "register_operand" "")
3073 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
3074 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3076 operands[1] = force_reg (SFmode, operands[1]);
3077 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
3081 (define_insn "fix_truncsfdi2_ieee"
3082 [(set (match_operand:DI 0 "register_operand" "=d")
3083 (fix:DI (match_operand:SF 1 "register_operand" "f")))
3084 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3085 (clobber (reg:CC 33))]
3086 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3088 [(set_attr "op_type" "RRE")
3089 (set_attr "type" "ftoi")])
3092 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
3095 (define_expand "fixuns_truncsfsi2"
3096 [(set (match_operand:SI 0 "register_operand" "")
3097 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
3098 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3100 rtx label1 = gen_label_rtx ();
3101 rtx label2 = gen_label_rtx ();
3102 rtx temp = gen_reg_rtx (SFmode);
3104 operands[1] = force_reg (SFmode, operands[1]);
3105 emit_insn (gen_cmpsf (operands[1],
3106 CONST_DOUBLE_FROM_REAL_VALUE (
3107 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
3108 emit_jump_insn (gen_blt (label1));
3109 emit_insn (gen_subsf3 (temp, operands[1],
3110 CONST_DOUBLE_FROM_REAL_VALUE (
3111 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
3112 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
3115 emit_label (label1);
3116 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3117 emit_label (label2);
3121 (define_expand "fix_truncsfsi2"
3122 [(set (match_operand:SI 0 "register_operand" "")
3123 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
3126 if (TARGET_IBM_FLOAT)
3128 /* Convert to DFmode and then use the POP algorithm. */
3129 rtx temp = gen_reg_rtx (DFmode);
3130 emit_insn (gen_extendsfdf2 (temp, operands[1]));
3131 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
3135 operands[1] = force_reg (SFmode, operands[1]);
3136 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3142 (define_insn "fix_truncsfsi2_ieee"
3143 [(set (match_operand:SI 0 "register_operand" "=d")
3144 (fix:SI (match_operand:SF 1 "register_operand" "f")))
3145 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3146 (clobber (reg:CC 33))]
3147 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3149 [(set_attr "op_type" "RRE")
3150 (set_attr "type" "ftoi")])
3153 ; floatdidf2 instruction pattern(s).
3156 (define_insn "floatdidf2"
3157 [(set (match_operand:DF 0 "register_operand" "=f")
3158 (float:DF (match_operand:DI 1 "register_operand" "d")))
3159 (clobber (reg:CC 33))]
3160 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3162 [(set_attr "op_type" "RRE")
3163 (set_attr "type" "itof" )])
3166 ; floatdisf2 instruction pattern(s).
3169 (define_insn "floatdisf2"
3170 [(set (match_operand:SF 0 "register_operand" "=f")
3171 (float:SF (match_operand:DI 1 "register_operand" "d")))
3172 (clobber (reg:CC 33))]
3173 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3175 [(set_attr "op_type" "RRE")
3176 (set_attr "type" "itof" )])
3179 ; floatsidf2 instruction pattern(s).
3182 (define_expand "floatsidf2"
3184 [(set (match_operand:DF 0 "register_operand" "")
3185 (float:DF (match_operand:SI 1 "register_operand" "")))
3186 (clobber (reg:CC 33))])]
3189 if (TARGET_IBM_FLOAT)
3191 /* This is the algorithm from POP chapter A.5.7.1. */
3193 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3194 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3196 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3201 (define_insn "floatsidf2_ieee"
3202 [(set (match_operand:DF 0 "register_operand" "=f")
3203 (float:DF (match_operand:SI 1 "register_operand" "d")))
3204 (clobber (reg:CC 33))]
3205 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3207 [(set_attr "op_type" "RRE")
3208 (set_attr "type" "itof" )])
3210 (define_insn "floatsidf2_ibm"
3211 [(set (match_operand:DF 0 "register_operand" "=f")
3212 (float:DF (match_operand:SI 1 "register_operand" "d")))
3213 (use (match_operand:DI 2 "immediate_operand" "m"))
3214 (use (match_operand:BLK 3 "memory_operand" "m"))
3215 (clobber (reg:CC 33))]
3216 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3218 output_asm_insn ("st\t%1,%N3", operands);
3219 output_asm_insn ("xi\t%N3,128", operands);
3220 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3221 output_asm_insn ("ld\t%0,%3", operands);
3224 [(set_attr "op_type" "NN")
3225 (set_attr "type" "other" )
3226 (set_attr "atype" "agen")
3227 (set_attr "length" "20")])
3230 ; floatsisf2 instruction pattern(s).
3233 (define_expand "floatsisf2"
3235 [(set (match_operand:SF 0 "register_operand" "")
3236 (float:SF (match_operand:SI 1 "register_operand" "")))
3237 (clobber (reg:CC 33))])]
3240 if (TARGET_IBM_FLOAT)
3242 /* Use the POP algorithm to convert to DFmode and then truncate. */
3243 rtx temp = gen_reg_rtx (DFmode);
3244 emit_insn (gen_floatsidf2 (temp, operands[1]));
3245 emit_insn (gen_truncdfsf2 (operands[0], temp));
3250 (define_insn "floatsisf2_ieee"
3251 [(set (match_operand:SF 0 "register_operand" "=f")
3252 (float:SF (match_operand:SI 1 "register_operand" "d")))
3253 (clobber (reg:CC 33))]
3254 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3256 [(set_attr "op_type" "RRE")
3257 (set_attr "type" "itof" )])
3260 ; truncdfsf2 instruction pattern(s).
3263 (define_expand "truncdfsf2"
3264 [(set (match_operand:SF 0 "register_operand" "")
3265 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3269 (define_insn "truncdfsf2_ieee"
3270 [(set (match_operand:SF 0 "register_operand" "=f")
3271 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3272 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3274 [(set_attr "op_type" "RRE")])
3276 (define_insn "truncdfsf2_ibm"
3277 [(set (match_operand:SF 0 "register_operand" "=f,f")
3278 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3279 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3283 [(set_attr "op_type" "RR,RX")
3284 (set_attr "type" "floads,floads")])
3287 ; extendsfdf2 instruction pattern(s).
3290 (define_expand "extendsfdf2"
3291 [(set (match_operand:DF 0 "register_operand" "")
3292 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3295 if (TARGET_IBM_FLOAT)
3297 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3302 (define_insn "extendsfdf2_ieee"
3303 [(set (match_operand:DF 0 "register_operand" "=f,f")
3304 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3305 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3309 [(set_attr "op_type" "RRE,RXE")
3310 (set_attr "type" "floads,floads")])
3312 (define_insn "extendsfdf2_ibm"
3313 [(set (match_operand:DF 0 "register_operand" "=f,f")
3314 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3315 (clobber (reg:CC 33))]
3316 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3318 sdr\t%0,%0\;ler\t%0,%1
3319 sdr\t%0,%0\;le\t%0,%1"
3320 [(set_attr "op_type" "NN,NN")
3321 (set_attr "atype" "reg,agen")
3322 (set_attr "length" "4,6")
3323 (set_attr "type" "o2,o2")])
3327 ;; ARITHMETIC OPERATIONS
3329 ; arithmetic operations set the ConditionCode,
3330 ; because of unpredictable Bits in Register for Halfword and Byte
3331 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3334 ;;- Add instructions.
3338 ; addti3 instruction pattern(s).
3341 (define_insn_and_split "addti3"
3342 [(set (match_operand:TI 0 "register_operand" "=&d")
3343 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3344 (match_operand:TI 2 "general_operand" "do") ) )
3345 (clobber (reg:CC 33))]
3348 "&& reload_completed"
3351 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3353 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3355 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3356 (ltu:DI (reg:CCL1 33) (const_int 0))))
3357 (clobber (reg:CC 33))])]
3358 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3359 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3360 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3361 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3362 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3363 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3364 [(set_attr "op_type" "NN")])
3367 ; adddi3 instruction pattern(s).
3370 (define_insn "*adddi3_sign"
3371 [(set (match_operand:DI 0 "register_operand" "=d,d")
3372 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3373 (match_operand:DI 1 "register_operand" "0,0")))
3374 (clobber (reg:CC 33))]
3379 [(set_attr "op_type" "RRE,RXY")])
3381 (define_insn "*adddi3_zero_cc"
3383 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3384 (match_operand:DI 1 "register_operand" "0,0"))
3386 (set (match_operand:DI 0 "register_operand" "=d,d")
3387 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3388 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3392 [(set_attr "op_type" "RRE,RXY")])
3394 (define_insn "*adddi3_zero_cconly"
3396 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3397 (match_operand:DI 1 "register_operand" "0,0"))
3399 (clobber (match_scratch:DI 0 "=d,d"))]
3400 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3404 [(set_attr "op_type" "RRE,RXY")])
3406 (define_insn "*adddi3_zero"
3407 [(set (match_operand:DI 0 "register_operand" "=d,d")
3408 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3409 (match_operand:DI 1 "register_operand" "0,0")))
3410 (clobber (reg:CC 33))]
3415 [(set_attr "op_type" "RRE,RXY")])
3417 (define_insn "*adddi3_imm_cc"
3419 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3420 (match_operand:DI 2 "const_int_operand" "K"))
3422 (set (match_operand:DI 0 "register_operand" "=d")
3423 (plus:DI (match_dup 1) (match_dup 2)))]
3425 && s390_match_ccmode (insn, CCAmode)
3426 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3428 [(set_attr "op_type" "RI")])
3430 (define_insn "*adddi3_carry1_cc"
3432 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3433 (match_operand:DI 2 "general_operand" "d,m"))
3435 (set (match_operand:DI 0 "register_operand" "=d,d")
3436 (plus:DI (match_dup 1) (match_dup 2)))]
3437 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3441 [(set_attr "op_type" "RRE,RXY")])
3443 (define_insn "*adddi3_carry1_cconly"
3445 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3446 (match_operand:DI 2 "general_operand" "d,m"))
3448 (clobber (match_scratch:DI 0 "=d,d"))]
3449 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3453 [(set_attr "op_type" "RRE,RXY")])
3455 (define_insn "*adddi3_carry2_cc"
3457 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3458 (match_operand:DI 2 "general_operand" "d,m"))
3460 (set (match_operand:DI 0 "register_operand" "=d,d")
3461 (plus:DI (match_dup 1) (match_dup 2)))]
3462 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3466 [(set_attr "op_type" "RRE,RXY")])
3468 (define_insn "*adddi3_carry2_cconly"
3470 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3471 (match_operand:DI 2 "general_operand" "d,m"))
3473 (clobber (match_scratch:DI 0 "=d,d"))]
3474 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3478 [(set_attr "op_type" "RRE,RXY")])
3480 (define_insn "*adddi3_cc"
3482 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3483 (match_operand:DI 2 "general_operand" "d,m"))
3485 (set (match_operand:DI 0 "register_operand" "=d,d")
3486 (plus:DI (match_dup 1) (match_dup 2)))]
3487 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3491 [(set_attr "op_type" "RRE,RXY")])
3493 (define_insn "*adddi3_cconly"
3495 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3496 (match_operand:DI 2 "general_operand" "d,m"))
3498 (clobber (match_scratch:DI 0 "=d,d"))]
3499 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3503 [(set_attr "op_type" "RRE,RXY")])
3505 (define_insn "*adddi3_cconly2"
3507 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3508 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3509 (clobber (match_scratch:DI 0 "=d,d"))]
3510 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3514 [(set_attr "op_type" "RRE,RXY")])
3516 (define_insn "*adddi3_64"
3517 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3518 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3519 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3520 (clobber (reg:CC 33))]
3526 [(set_attr "op_type" "RRE,RI,RXY")])
3528 (define_insn_and_split "*adddi3_31z"
3529 [(set (match_operand:DI 0 "register_operand" "=&d")
3530 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3531 (match_operand:DI 2 "general_operand" "do") ) )
3532 (clobber (reg:CC 33))]
3533 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3535 "&& reload_completed"
3538 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3540 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3542 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3543 (ltu:SI (reg:CCL1 33) (const_int 0))))
3544 (clobber (reg:CC 33))])]
3545 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3546 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3547 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3548 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3549 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3550 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3551 [(set_attr "op_type" "NN")])
3553 (define_insn_and_split "*adddi3_31"
3554 [(set (match_operand:DI 0 "register_operand" "=&d")
3555 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3556 (match_operand:DI 2 "general_operand" "do") ) )
3557 (clobber (reg:CC 33))]
3560 "&& reload_completed"
3562 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3563 (clobber (reg:CC 33))])
3566 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3568 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3570 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3572 (label_ref (match_dup 9))))
3574 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3575 (clobber (reg:CC 33))])
3577 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3578 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3579 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3580 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3581 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3582 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3583 operands[9] = gen_label_rtx ();"
3584 [(set_attr "op_type" "NN")])
3586 (define_expand "adddi3"
3588 [(set (match_operand:DI 0 "register_operand" "")
3589 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3590 (match_operand:DI 2 "general_operand" "")))
3591 (clobber (reg:CC 33))])]
3596 ; addsi3 instruction pattern(s).
3599 (define_insn "*addsi3_imm_cc"
3601 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3602 (match_operand:SI 2 "const_int_operand" "K"))
3604 (set (match_operand:SI 0 "register_operand" "=d")
3605 (plus:SI (match_dup 1) (match_dup 2)))]
3606 "s390_match_ccmode (insn, CCAmode)
3607 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3609 [(set_attr "op_type" "RI")])
3611 (define_insn "*addsi3_carry1_cc"
3613 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3614 (match_operand:SI 2 "general_operand" "d,R,T"))
3616 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3617 (plus:SI (match_dup 1) (match_dup 2)))]
3618 "s390_match_ccmode (insn, CCL1mode)"
3623 [(set_attr "op_type" "RR,RX,RXY")])
3625 (define_insn "*addsi3_carry1_cconly"
3627 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3628 (match_operand:SI 2 "general_operand" "d,R,T"))
3630 (clobber (match_scratch:SI 0 "=d,d,d"))]
3631 "s390_match_ccmode (insn, CCL1mode)"
3636 [(set_attr "op_type" "RR,RX,RXY")])
3638 (define_insn "*addsi3_carry2_cc"
3640 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3641 (match_operand:SI 2 "general_operand" "d,R,T"))
3643 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3644 (plus:SI (match_dup 1) (match_dup 2)))]
3645 "s390_match_ccmode (insn, CCL1mode)"
3650 [(set_attr "op_type" "RR,RX,RXY")])
3652 (define_insn "*addsi3_carry2_cconly"
3654 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3655 (match_operand:SI 2 "general_operand" "d,R,T"))
3657 (clobber (match_scratch:SI 0 "=d,d,d"))]
3658 "s390_match_ccmode (insn, CCL1mode)"
3663 [(set_attr "op_type" "RR,RX,RXY")])
3665 (define_insn "*addsi3_cc"
3667 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3668 (match_operand:SI 2 "general_operand" "d,R,T"))
3670 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3671 (plus:SI (match_dup 1) (match_dup 2)))]
3672 "s390_match_ccmode (insn, CCLmode)"
3677 [(set_attr "op_type" "RR,RX,RXY")])
3679 (define_insn "*addsi3_cconly"
3681 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3682 (match_operand:SI 2 "general_operand" "d,R,T"))
3684 (clobber (match_scratch:SI 0 "=d,d,d"))]
3685 "s390_match_ccmode (insn, CCLmode)"
3690 [(set_attr "op_type" "RR,RX,RXY")])
3692 (define_insn "*addsi3_cconly2"
3694 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3695 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3696 (clobber (match_scratch:SI 0 "=d,d,d"))]
3697 "s390_match_ccmode (insn, CCLmode)"
3702 [(set_attr "op_type" "RR,RX,RXY")])
3704 (define_insn "*addsi3_sign"
3705 [(set (match_operand:SI 0 "register_operand" "=d,d")
3706 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3707 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3708 (clobber (reg:CC 33))]
3713 [(set_attr "op_type" "RX,RXY")])
3715 (define_insn "addsi3"
3716 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3717 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3718 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3719 (clobber (reg:CC 33))]
3726 [(set_attr "op_type" "RR,RI,RX,RXY")])
3729 ; adddf3 instruction pattern(s).
3732 (define_expand "adddf3"
3734 [(set (match_operand:DF 0 "register_operand" "=f,f")
3735 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3736 (match_operand:DF 2 "general_operand" "f,R")))
3737 (clobber (reg:CC 33))])]
3741 (define_insn "*adddf3"
3742 [(set (match_operand:DF 0 "register_operand" "=f,f")
3743 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3744 (match_operand:DF 2 "general_operand" "f,R")))
3745 (clobber (reg:CC 33))]
3746 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3750 [(set_attr "op_type" "RRE,RXE")
3751 (set_attr "type" "fsimpd,fsimpd")])
3753 (define_insn "*adddf3_cc"
3755 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3756 (match_operand:DF 2 "general_operand" "f,R"))
3757 (match_operand:DF 3 "const0_operand" "")))
3758 (set (match_operand:DF 0 "register_operand" "=f,f")
3759 (plus:DF (match_dup 1) (match_dup 2)))]
3760 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3764 [(set_attr "op_type" "RRE,RXE")
3765 (set_attr "type" "fsimpd,fsimpd")])
3767 (define_insn "*adddf3_cconly"
3769 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3770 (match_operand:DF 2 "general_operand" "f,R"))
3771 (match_operand:DF 3 "const0_operand" "")))
3772 (clobber (match_scratch:DF 0 "=f,f"))]
3773 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3777 [(set_attr "op_type" "RRE,RXE")
3778 (set_attr "type" "fsimpd,fsimpd")])
3780 (define_insn "*adddf3_ibm"
3781 [(set (match_operand:DF 0 "register_operand" "=f,f")
3782 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3783 (match_operand:DF 2 "general_operand" "f,R")))
3784 (clobber (reg:CC 33))]
3785 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3789 [(set_attr "op_type" "RR,RX")
3790 (set_attr "type" "fsimpd,fsimpd")])
3793 ; addsf3 instruction pattern(s).
3796 (define_expand "addsf3"
3798 [(set (match_operand:SF 0 "register_operand" "=f,f")
3799 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3800 (match_operand:SF 2 "general_operand" "f,R")))
3801 (clobber (reg:CC 33))])]
3805 (define_insn "*addsf3"
3806 [(set (match_operand:SF 0 "register_operand" "=f,f")
3807 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3808 (match_operand:SF 2 "general_operand" "f,R")))
3809 (clobber (reg:CC 33))]
3810 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3814 [(set_attr "op_type" "RRE,RXE")
3815 (set_attr "type" "fsimps,fsimps")])
3817 (define_insn "*addsf3_cc"
3819 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3820 (match_operand:SF 2 "general_operand" "f,R"))
3821 (match_operand:SF 3 "const0_operand" "")))
3822 (set (match_operand:SF 0 "register_operand" "=f,f")
3823 (plus:SF (match_dup 1) (match_dup 2)))]
3824 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3828 [(set_attr "op_type" "RRE,RXE")
3829 (set_attr "type" "fsimps,fsimps")])
3831 (define_insn "*addsf3_cconly"
3833 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3834 (match_operand:SF 2 "general_operand" "f,R"))
3835 (match_operand:SF 3 "const0_operand" "")))
3836 (clobber (match_scratch:SF 0 "=f,f"))]
3837 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3841 [(set_attr "op_type" "RRE,RXE")
3842 (set_attr "type" "fsimps,fsimps")])
3844 (define_insn "*addsf3"
3845 [(set (match_operand:SF 0 "register_operand" "=f,f")
3846 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3847 (match_operand:SF 2 "general_operand" "f,R")))
3848 (clobber (reg:CC 33))]
3849 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3853 [(set_attr "op_type" "RR,RX")
3854 (set_attr "type" "fsimps,fsimps")])
3858 ;;- Subtract instructions.
3862 ; subti3 instruction pattern(s).
3865 (define_insn_and_split "subti3"
3866 [(set (match_operand:TI 0 "register_operand" "=&d")
3867 (minus:TI (match_operand:TI 1 "register_operand" "0")
3868 (match_operand:TI 2 "general_operand" "do") ) )
3869 (clobber (reg:CC 33))]
3872 "&& reload_completed"
3875 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3877 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3879 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3880 (gtu:DI (reg:CCL2 33) (const_int 0))))
3881 (clobber (reg:CC 33))])]
3882 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3883 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3884 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3885 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3886 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3887 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3888 [(set_attr "op_type" "NN")])
3891 ; subdi3 instruction pattern(s).
3894 (define_insn "*subdi3_sign"
3895 [(set (match_operand:DI 0 "register_operand" "=d,d")
3896 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3897 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3898 (clobber (reg:CC 33))]
3903 [(set_attr "op_type" "RRE,RXY")])
3905 (define_insn "*subdi3_zero_cc"
3907 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3908 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3910 (set (match_operand:DI 0 "register_operand" "=d,d")
3911 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3912 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3916 [(set_attr "op_type" "RRE,RXY")])
3918 (define_insn "*subdi3_zero_cconly"
3920 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3921 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3923 (clobber (match_scratch:DI 0 "=d,d"))]
3924 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3928 [(set_attr "op_type" "RRE,RXY")])
3930 (define_insn "*subdi3_zero"
3931 [(set (match_operand:DI 0 "register_operand" "=d,d")
3932 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3933 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3934 (clobber (reg:CC 33))]
3939 [(set_attr "op_type" "RRE,RXY")])
3941 (define_insn "*subdi3_borrow_cc"
3943 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3944 (match_operand:DI 2 "general_operand" "d,m"))
3946 (set (match_operand:DI 0 "register_operand" "=d,d")
3947 (minus:DI (match_dup 1) (match_dup 2)))]
3948 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3952 [(set_attr "op_type" "RRE,RXY")])
3954 (define_insn "*subdi3_borrow_cconly"
3956 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3957 (match_operand:DI 2 "general_operand" "d,m"))
3959 (clobber (match_scratch:DI 0 "=d,d"))]
3960 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3964 [(set_attr "op_type" "RRE,RXY")])
3966 (define_insn "*subdi3_cc"
3968 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3969 (match_operand:DI 2 "general_operand" "d,m"))
3971 (set (match_operand:DI 0 "register_operand" "=d,d")
3972 (minus:DI (match_dup 1) (match_dup 2)))]
3973 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3977 [(set_attr "op_type" "RRE,RXY")])
3979 (define_insn "*subdi3_cc2"
3981 (compare (match_operand:DI 1 "register_operand" "0,0")
3982 (match_operand:DI 2 "general_operand" "d,m")))
3983 (set (match_operand:DI 0 "register_operand" "=d,d")
3984 (minus:DI (match_dup 1) (match_dup 2)))]
3985 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3989 [(set_attr "op_type" "RRE,RXY")])
3991 (define_insn "*subdi3_cconly"
3993 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3994 (match_operand:DI 2 "general_operand" "d,m"))
3996 (clobber (match_scratch:DI 0 "=d,d"))]
3997 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4001 [(set_attr "op_type" "RRE,RXY")])
4003 (define_insn "*subdi3_cconly2"
4005 (compare (match_operand:DI 1 "register_operand" "0,0")
4006 (match_operand:DI 2 "general_operand" "d,m")))
4007 (clobber (match_scratch:DI 0 "=d,d"))]
4008 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
4012 [(set_attr "op_type" "RRE,RXY")])
4014 (define_insn "*subdi3_64"
4015 [(set (match_operand:DI 0 "register_operand" "=d,d")
4016 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
4017 (match_operand:DI 2 "general_operand" "d,m") ) )
4018 (clobber (reg:CC 33))]
4023 [(set_attr "op_type" "RRE,RRE")])
4025 (define_insn_and_split "*subdi3_31z"
4026 [(set (match_operand:DI 0 "register_operand" "=&d")
4027 (minus:DI (match_operand:DI 1 "register_operand" "0")
4028 (match_operand:DI 2 "general_operand" "do") ) )
4029 (clobber (reg:CC 33))]
4030 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4032 "&& reload_completed"
4035 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
4037 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
4039 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
4040 (gtu:SI (reg:CCL2 33) (const_int 0))))
4041 (clobber (reg:CC 33))])]
4042 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
4043 operands[4] = operand_subword (operands[1], 0, 0, DImode);
4044 operands[5] = operand_subword (operands[2], 0, 0, DImode);
4045 operands[6] = operand_subword (operands[0], 1, 0, DImode);
4046 operands[7] = operand_subword (operands[1], 1, 0, DImode);
4047 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
4048 [(set_attr "op_type" "NN")])
4050 (define_insn_and_split "*subdi3_31"
4051 [(set (match_operand:DI 0 "register_operand" "=&d")
4052 (minus:DI (match_operand:DI 1 "register_operand" "0")
4053 (match_operand:DI 2 "general_operand" "do") ) )
4054 (clobber (reg:CC 33))]
4057 "&& reload_completed"
4059 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
4060 (clobber (reg:CC 33))])
4063 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
4065 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
4067 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
4069 (label_ref (match_dup 9))))
4071 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
4072 (clobber (reg:CC 33))])
4074 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
4075 operands[4] = operand_subword (operands[1], 0, 0, DImode);
4076 operands[5] = operand_subword (operands[2], 0, 0, DImode);
4077 operands[6] = operand_subword (operands[0], 1, 0, DImode);
4078 operands[7] = operand_subword (operands[1], 1, 0, DImode);
4079 operands[8] = operand_subword (operands[2], 1, 0, DImode);
4080 operands[9] = gen_label_rtx ();"
4081 [(set_attr "op_type" "NN")])
4083 (define_expand "subdi3"
4085 [(set (match_operand:DI 0 "register_operand" "")
4086 (minus:DI (match_operand:DI 1 "register_operand" "")
4087 (match_operand:DI 2 "general_operand" "")))
4088 (clobber (reg:CC 33))])]
4093 ; subsi3 instruction pattern(s).
4096 (define_insn "*subsi3_borrow_cc"
4098 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4099 (match_operand:SI 2 "general_operand" "d,R,T"))
4101 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4102 (minus:SI (match_dup 1) (match_dup 2)))]
4103 "s390_match_ccmode (insn, CCL2mode)"
4108 [(set_attr "op_type" "RR,RX,RXY")])
4110 (define_insn "*subsi3_borrow_cconly"
4112 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4113 (match_operand:SI 2 "general_operand" "d,R,T"))
4115 (clobber (match_scratch:SI 0 "=d,d,d"))]
4116 "s390_match_ccmode (insn, CCL2mode)"
4121 [(set_attr "op_type" "RR,RX,RXY")])
4123 (define_insn "*subsi3_cc"
4125 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4126 (match_operand:SI 2 "general_operand" "d,R,T"))
4128 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4129 (minus:SI (match_dup 1) (match_dup 2)))]
4130 "s390_match_ccmode (insn, CCLmode)"
4135 [(set_attr "op_type" "RR,RX,RXY")])
4137 (define_insn "*subsi3_cc2"
4139 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4140 (match_operand:SI 2 "general_operand" "d,R,T")))
4141 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4142 (minus:SI (match_dup 1) (match_dup 2)))]
4143 "s390_match_ccmode (insn, CCL3mode)"
4148 [(set_attr "op_type" "RR,RX,RXY")])
4150 (define_insn "*subsi3_cconly"
4152 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4153 (match_operand:SI 2 "general_operand" "d,R,T"))
4155 (clobber (match_scratch:SI 0 "=d,d,d"))]
4156 "s390_match_ccmode (insn, CCLmode)"
4161 [(set_attr "op_type" "RR,RX,RXY")])
4163 (define_insn "*subsi3_cconly2"
4165 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4166 (match_operand:SI 2 "general_operand" "d,R,T")))
4167 (clobber (match_scratch:SI 0 "=d,d,d"))]
4168 "s390_match_ccmode (insn, CCL3mode)"
4173 [(set_attr "op_type" "RR,RX,RXY")])
4175 (define_insn "*subsi3_sign"
4176 [(set (match_operand:SI 0 "register_operand" "=d,d")
4177 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4178 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4179 (clobber (reg:CC 33))]
4184 [(set_attr "op_type" "RX,RXY")])
4186 (define_insn "subsi3"
4187 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4188 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4189 (match_operand:SI 2 "general_operand" "d,R,T")))
4190 (clobber (reg:CC 33))]
4196 [(set_attr "op_type" "RR,RX,RXY")])
4200 ; subdf3 instruction pattern(s).
4203 (define_expand "subdf3"
4205 [(set (match_operand:DF 0 "register_operand" "=f,f")
4206 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4207 (match_operand:DF 2 "general_operand" "f,R")))
4208 (clobber (reg:CC 33))])]
4212 (define_insn "*subdf3"
4213 [(set (match_operand:DF 0 "register_operand" "=f,f")
4214 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4215 (match_operand:DF 2 "general_operand" "f,R")))
4216 (clobber (reg:CC 33))]
4217 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4221 [(set_attr "op_type" "RRE,RXE")
4222 (set_attr "type" "fsimpd,fsimpd")])
4224 (define_insn "*subdf3_cc"
4226 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4227 (match_operand:DF 2 "general_operand" "f,R"))
4228 (match_operand:DF 3 "const0_operand" "")))
4229 (set (match_operand:DF 0 "register_operand" "=f,f")
4230 (plus:DF (match_dup 1) (match_dup 2)))]
4231 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4235 [(set_attr "op_type" "RRE,RXE")
4236 (set_attr "type" "fsimpd,fsimpd")])
4238 (define_insn "*subdf3_cconly"
4240 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4241 (match_operand:DF 2 "general_operand" "f,R"))
4242 (match_operand:DF 3 "const0_operand" "")))
4243 (clobber (match_scratch:DF 0 "=f,f"))]
4244 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4248 [(set_attr "op_type" "RRE,RXE")
4249 (set_attr "type" "fsimpd,fsimpd")])
4251 (define_insn "*subdf3_ibm"
4252 [(set (match_operand:DF 0 "register_operand" "=f,f")
4253 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4254 (match_operand:DF 2 "general_operand" "f,R")))
4255 (clobber (reg:CC 33))]
4256 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4260 [(set_attr "op_type" "RR,RX")
4261 (set_attr "type" "fsimpd,fsimpd")])
4264 ; subsf3 instruction pattern(s).
4267 (define_expand "subsf3"
4269 [(set (match_operand:SF 0 "register_operand" "=f,f")
4270 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4271 (match_operand:SF 2 "general_operand" "f,R")))
4272 (clobber (reg:CC 33))])]
4276 (define_insn "*subsf3"
4277 [(set (match_operand:SF 0 "register_operand" "=f,f")
4278 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4279 (match_operand:SF 2 "general_operand" "f,R")))
4280 (clobber (reg:CC 33))]
4281 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4285 [(set_attr "op_type" "RRE,RXE")
4286 (set_attr "type" "fsimps,fsimps")])
4288 (define_insn "*subsf3_cc"
4290 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4291 (match_operand:SF 2 "general_operand" "f,R"))
4292 (match_operand:SF 3 "const0_operand" "")))
4293 (set (match_operand:SF 0 "register_operand" "=f,f")
4294 (minus:SF (match_dup 1) (match_dup 2)))]
4295 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4299 [(set_attr "op_type" "RRE,RXE")
4300 (set_attr "type" "fsimps,fsimps")])
4302 (define_insn "*subsf3_cconly"
4304 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4305 (match_operand:SF 2 "general_operand" "f,R"))
4306 (match_operand:SF 3 "const0_operand" "")))
4307 (clobber (match_scratch:SF 0 "=f,f"))]
4308 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4312 [(set_attr "op_type" "RRE,RXE")
4313 (set_attr "type" "fsimps,fsimps")])
4315 (define_insn "*subsf3_ibm"
4316 [(set (match_operand:SF 0 "register_operand" "=f,f")
4317 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4318 (match_operand:SF 2 "general_operand" "f,R")))
4319 (clobber (reg:CC 33))]
4320 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4324 [(set_attr "op_type" "RR,RX")
4325 (set_attr "type" "fsimps,fsimps")])
4329 ;;- Conditional add/subtract instructions.
4333 ; adddicc instruction pattern(s).
4336 (define_insn "*adddi3_alc_cc"
4339 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4340 (match_operand:DI 2 "general_operand" "d,m"))
4341 (match_operand:DI 3 "s390_alc_comparison" ""))
4343 (set (match_operand:DI 0 "register_operand" "=d,d")
4344 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4345 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4349 [(set_attr "op_type" "RRE,RXY")])
4351 (define_insn "*adddi3_alc"
4352 [(set (match_operand:DI 0 "register_operand" "=d,d")
4353 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4354 (match_operand:DI 2 "general_operand" "d,m"))
4355 (match_operand:DI 3 "s390_alc_comparison" "")))
4356 (clobber (reg:CC 33))]
4361 [(set_attr "op_type" "RRE,RXY")])
4363 (define_insn "*subdi3_slb_cc"
4366 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4367 (match_operand:DI 2 "general_operand" "d,m"))
4368 (match_operand:DI 3 "s390_slb_comparison" ""))
4370 (set (match_operand:DI 0 "register_operand" "=d,d")
4371 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4372 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4376 [(set_attr "op_type" "RRE,RXY")])
4378 (define_insn "*subdi3_slb"
4379 [(set (match_operand:DI 0 "register_operand" "=d,d")
4380 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4381 (match_operand:DI 2 "general_operand" "d,m"))
4382 (match_operand:DI 3 "s390_slb_comparison" "")))
4383 (clobber (reg:CC 33))]
4388 [(set_attr "op_type" "RRE,RXY")])
4390 (define_expand "adddicc"
4391 [(match_operand:DI 0 "register_operand" "")
4392 (match_operand 1 "comparison_operator" "")
4393 (match_operand:DI 2 "register_operand" "")
4394 (match_operand:DI 3 "const_int_operand" "")]
4396 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4397 s390_compare_op0, s390_compare_op1,
4398 operands[0], operands[2],
4399 operands[3])) FAIL; DONE;")
4402 ; addsicc instruction pattern(s).
4405 (define_insn "*addsi3_alc_cc"
4408 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4409 (match_operand:SI 2 "general_operand" "d,m"))
4410 (match_operand:SI 3 "s390_alc_comparison" ""))
4412 (set (match_operand:SI 0 "register_operand" "=d,d")
4413 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4414 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4418 [(set_attr "op_type" "RRE,RXY")])
4420 (define_insn "*addsi3_alc"
4421 [(set (match_operand:SI 0 "register_operand" "=d,d")
4422 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4423 (match_operand:SI 2 "general_operand" "d,m"))
4424 (match_operand:SI 3 "s390_alc_comparison" "")))
4425 (clobber (reg:CC 33))]
4430 [(set_attr "op_type" "RRE,RXY")])
4432 (define_insn "*subsi3_slb_cc"
4435 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4436 (match_operand:SI 2 "general_operand" "d,m"))
4437 (match_operand:SI 3 "s390_slb_comparison" ""))
4439 (set (match_operand:SI 0 "register_operand" "=d,d")
4440 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4441 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4445 [(set_attr "op_type" "RRE,RXY")])
4447 (define_insn "*subsi3_slb"
4448 [(set (match_operand:SI 0 "register_operand" "=d,d")
4449 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4450 (match_operand:SI 2 "general_operand" "d,m"))
4451 (match_operand:SI 3 "s390_slb_comparison" "")))
4452 (clobber (reg:CC 33))]
4457 [(set_attr "op_type" "RRE,RXY")])
4459 (define_expand "addsicc"
4460 [(match_operand:SI 0 "register_operand" "")
4461 (match_operand 1 "comparison_operator" "")
4462 (match_operand:SI 2 "register_operand" "")
4463 (match_operand:SI 3 "const_int_operand" "")]
4465 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4466 s390_compare_op0, s390_compare_op1,
4467 operands[0], operands[2],
4468 operands[3])) FAIL; DONE;")
4471 ; scond instruction pattern(s).
4474 (define_insn_and_split "*sconddi"
4475 [(set (match_operand:DI 0 "register_operand" "=&d")
4476 (match_operand:DI 1 "s390_alc_comparison" ""))
4477 (clobber (reg:CC 33))]
4480 "&& reload_completed"
4481 [(set (match_dup 0) (const_int 0))
4483 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4485 (clobber (reg:CC 33))])]
4487 [(set_attr "op_type" "NN")])
4489 (define_insn_and_split "*scondsi"
4490 [(set (match_operand:SI 0 "register_operand" "=&d")
4491 (match_operand:SI 1 "s390_alc_comparison" ""))
4492 (clobber (reg:CC 33))]
4495 "&& reload_completed"
4496 [(set (match_dup 0) (const_int 0))
4498 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4500 (clobber (reg:CC 33))])]
4502 [(set_attr "op_type" "NN")])
4504 (define_insn_and_split "*sconddi_neg"
4505 [(set (match_operand:DI 0 "register_operand" "=&d")
4506 (match_operand:DI 1 "s390_slb_comparison" ""))
4507 (clobber (reg:CC 33))]
4510 "&& reload_completed"
4511 [(set (match_dup 0) (const_int 0))
4513 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4515 (clobber (reg:CC 33))])
4517 [(set (match_dup 0) (neg:DI (match_dup 0)))
4518 (clobber (reg:CC 33))])]
4520 [(set_attr "op_type" "NN")])
4522 (define_insn_and_split "*scondsi_neg"
4523 [(set (match_operand:SI 0 "register_operand" "=&d")
4524 (match_operand:SI 1 "s390_slb_comparison" ""))
4525 (clobber (reg:CC 33))]
4528 "&& reload_completed"
4529 [(set (match_dup 0) (const_int 0))
4531 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4533 (clobber (reg:CC 33))])
4535 [(set (match_dup 0) (neg:SI (match_dup 0)))
4536 (clobber (reg:CC 33))])]
4538 [(set_attr "op_type" "NN")])
4540 (define_expand "sltu"
4541 [(match_operand:SI 0 "register_operand" "")]
4543 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4544 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4546 (define_expand "sgtu"
4547 [(match_operand:SI 0 "register_operand" "")]
4549 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4550 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4552 (define_expand "sleu"
4553 [(match_operand:SI 0 "register_operand" "")]
4555 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4556 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4558 (define_expand "sgeu"
4559 [(match_operand:SI 0 "register_operand" "")]
4561 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4562 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4566 ;;- Multiply instructions.
4570 ; muldi3 instruction pattern(s).
4573 (define_insn "*muldi3_sign"
4574 [(set (match_operand:DI 0 "register_operand" "=d,d")
4575 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4576 (match_operand:DI 1 "register_operand" "0,0")))]
4581 [(set_attr "op_type" "RRE,RXY")
4582 (set_attr "type" "imul")])
4584 (define_insn "muldi3"
4585 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4586 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4587 (match_operand:DI 2 "general_operand" "d,K,m")))]
4593 [(set_attr "op_type" "RRE,RI,RXY")
4594 (set_attr "type" "imul")])
4597 ; mulsi3 instruction pattern(s).
4600 (define_insn "*mulsi3_sign"
4601 [(set (match_operand:SI 0 "register_operand" "=d")
4602 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4603 (match_operand:SI 1 "register_operand" "0")))]
4606 [(set_attr "op_type" "RX")
4607 (set_attr "type" "imul")])
4609 (define_insn "mulsi3"
4610 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4611 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4612 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4619 [(set_attr "op_type" "RRE,RI,RX,RXY")
4620 (set_attr "type" "imul")])
4623 ; mulsidi3 instruction pattern(s).
4626 (define_insn "mulsidi3"
4627 [(set (match_operand:DI 0 "register_operand" "=d,d")
4628 (mult:DI (sign_extend:DI
4629 (match_operand:SI 1 "register_operand" "%0,0"))
4631 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4636 [(set_attr "op_type" "RR,RX")
4637 (set_attr "type" "imul")])
4640 ; umulsidi3 instruction pattern(s).
4643 (define_insn "umulsidi3"
4644 [(set (match_operand:DI 0 "register_operand" "=d,d")
4645 (mult:DI (zero_extend:DI
4646 (match_operand:SI 1 "register_operand" "%0,0"))
4648 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4649 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4653 [(set_attr "op_type" "RRE,RXY")
4654 (set_attr "type" "imul")])
4657 ; muldf3 instruction pattern(s).
4660 (define_expand "muldf3"
4661 [(set (match_operand:DF 0 "register_operand" "=f,f")
4662 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4663 (match_operand:DF 2 "general_operand" "f,R")))]
4667 (define_insn "*muldf3"
4668 [(set (match_operand:DF 0 "register_operand" "=f,f")
4669 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4670 (match_operand:DF 2 "general_operand" "f,R")))]
4671 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4675 [(set_attr "op_type" "RRE,RXE")
4676 (set_attr "type" "fmuld")])
4678 (define_insn "*muldf3_ibm"
4679 [(set (match_operand:DF 0 "register_operand" "=f,f")
4680 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4681 (match_operand:DF 2 "general_operand" "f,R")))]
4682 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4686 [(set_attr "op_type" "RR,RX")
4687 (set_attr "type" "fmuld")])
4689 (define_insn "*fmadddf"
4690 [(set (match_operand:DF 0 "register_operand" "=f,f")
4691 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4692 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4693 (match_operand:DF 3 "register_operand" "0,0")))]
4694 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4698 [(set_attr "op_type" "RRE,RXE")
4699 (set_attr "type" "fmuld")])
4701 (define_insn "*fmsubdf"
4702 [(set (match_operand:DF 0 "register_operand" "=f,f")
4703 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4704 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4705 (match_operand:DF 3 "register_operand" "0,0")))]
4706 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4710 [(set_attr "op_type" "RRE,RXE")
4711 (set_attr "type" "fmuld")])
4714 ; mulsf3 instruction pattern(s).
4717 (define_expand "mulsf3"
4718 [(set (match_operand:SF 0 "register_operand" "=f,f")
4719 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4720 (match_operand:SF 2 "general_operand" "f,R")))]
4724 (define_insn "*mulsf3"
4725 [(set (match_operand:SF 0 "register_operand" "=f,f")
4726 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4727 (match_operand:SF 2 "general_operand" "f,R")))]
4728 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4732 [(set_attr "op_type" "RRE,RXE")
4733 (set_attr "type" "fmuls")])
4735 (define_insn "*mulsf3_ibm"
4736 [(set (match_operand:SF 0 "register_operand" "=f,f")
4737 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4738 (match_operand:SF 2 "general_operand" "f,R")))]
4739 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4743 [(set_attr "op_type" "RR,RX")
4744 (set_attr "type" "fmuls")])
4746 (define_insn "*fmaddsf"
4747 [(set (match_operand:SF 0 "register_operand" "=f,f")
4748 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4749 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4750 (match_operand:SF 3 "register_operand" "0,0")))]
4751 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4755 [(set_attr "op_type" "RRE,RXE")
4756 (set_attr "type" "fmuls")])
4758 (define_insn "*fmsubsf"
4759 [(set (match_operand:SF 0 "register_operand" "=f,f")
4760 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4761 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4762 (match_operand:SF 3 "register_operand" "0,0")))]
4763 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4767 [(set_attr "op_type" "RRE,RXE")
4768 (set_attr "type" "fmuls")])
4771 ;;- Divide and modulo instructions.
4775 ; divmoddi4 instruction pattern(s).
4778 (define_expand "divmoddi4"
4779 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4780 (div:DI (match_operand:DI 1 "register_operand" "")
4781 (match_operand:DI 2 "general_operand" "")))
4782 (set (match_operand:DI 3 "general_operand" "")
4783 (mod:DI (match_dup 1) (match_dup 2)))])
4784 (clobber (match_dup 4))]
4787 rtx insn, div_equal, mod_equal;
4789 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4790 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4792 operands[4] = gen_reg_rtx(TImode);
4793 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4795 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4797 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4799 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4801 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4806 (define_insn "divmodtidi3"
4807 [(set (match_operand:TI 0 "register_operand" "=d,d")
4811 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4812 (match_operand:DI 2 "general_operand" "d,m")))
4814 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4819 [(set_attr "op_type" "RRE,RXY")
4820 (set_attr "type" "idiv")])
4822 (define_insn "divmodtisi3"
4823 [(set (match_operand:TI 0 "register_operand" "=d,d")
4827 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4829 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4832 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4837 [(set_attr "op_type" "RRE,RXY")
4838 (set_attr "type" "idiv")])
4841 ; udivmoddi4 instruction pattern(s).
4844 (define_expand "udivmoddi4"
4845 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4846 (udiv:DI (match_operand:DI 1 "general_operand" "")
4847 (match_operand:DI 2 "nonimmediate_operand" "")))
4848 (set (match_operand:DI 3 "general_operand" "")
4849 (umod:DI (match_dup 1) (match_dup 2)))])
4850 (clobber (match_dup 4))]
4853 rtx insn, div_equal, mod_equal, equal;
4855 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4856 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4857 equal = gen_rtx_IOR (TImode,
4858 gen_rtx_ASHIFT (TImode,
4859 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4861 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4863 operands[4] = gen_reg_rtx(TImode);
4864 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4865 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4866 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4867 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4869 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4871 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4873 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4875 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4877 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4882 (define_insn "udivmodtidi3"
4883 [(set (match_operand:TI 0 "register_operand" "=d,d")
4888 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4890 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4894 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4899 [(set_attr "op_type" "RRE,RXY")
4900 (set_attr "type" "idiv")])
4903 ; divmodsi4 instruction pattern(s).
4906 (define_expand "divmodsi4"
4907 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4908 (div:SI (match_operand:SI 1 "general_operand" "")
4909 (match_operand:SI 2 "nonimmediate_operand" "")))
4910 (set (match_operand:SI 3 "general_operand" "")
4911 (mod:SI (match_dup 1) (match_dup 2)))])
4912 (clobber (match_dup 4))]
4915 rtx insn, div_equal, mod_equal, equal;
4917 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4918 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4919 equal = gen_rtx_IOR (DImode,
4920 gen_rtx_ASHIFT (DImode,
4921 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4923 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4925 operands[4] = gen_reg_rtx(DImode);
4926 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4927 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4929 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4931 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4933 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4935 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4937 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4942 (define_insn "divmoddisi3"
4943 [(set (match_operand:DI 0 "register_operand" "=d,d")
4948 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4950 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4954 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4959 [(set_attr "op_type" "RR,RX")
4960 (set_attr "type" "idiv")])
4963 ; udivsi3 and umodsi3 instruction pattern(s).
4966 (define_expand "udivmodsi4"
4967 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4968 (udiv:SI (match_operand:SI 1 "general_operand" "")
4969 (match_operand:SI 2 "nonimmediate_operand" "")))
4970 (set (match_operand:SI 3 "general_operand" "")
4971 (umod:SI (match_dup 1) (match_dup 2)))])
4972 (clobber (match_dup 4))]
4973 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4975 rtx insn, div_equal, mod_equal, equal;
4977 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4978 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4979 equal = gen_rtx_IOR (DImode,
4980 gen_rtx_ASHIFT (DImode,
4981 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4983 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4985 operands[4] = gen_reg_rtx(DImode);
4986 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4987 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4988 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4989 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4991 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4993 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4995 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4997 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4999 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
5004 (define_insn "udivmoddisi3"
5005 [(set (match_operand:DI 0 "register_operand" "=d,d")
5010 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
5012 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
5016 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
5017 "!TARGET_64BIT && TARGET_CPU_ZARCH"
5021 [(set_attr "op_type" "RRE,RXY")
5022 (set_attr "type" "idiv")])
5024 (define_expand "udivsi3"
5025 [(set (match_operand:SI 0 "register_operand" "=d")
5026 (udiv:SI (match_operand:SI 1 "general_operand" "")
5027 (match_operand:SI 2 "general_operand" "")))
5028 (clobber (match_dup 3))]
5029 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
5031 rtx insn, udiv_equal, umod_equal, equal;
5033 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
5034 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
5035 equal = gen_rtx_IOR (DImode,
5036 gen_rtx_ASHIFT (DImode,
5037 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
5039 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
5041 operands[3] = gen_reg_rtx (DImode);
5043 if (CONSTANT_P (operands[2]))
5045 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
5047 rtx label1 = gen_label_rtx ();
5049 operands[1] = make_safe_from (operands[1], operands[0]);
5050 emit_move_insn (operands[0], const0_rtx);
5051 emit_insn (gen_cmpsi (operands[1], operands[2]));
5052 emit_jump_insn (gen_bltu (label1));
5053 emit_move_insn (operands[0], const1_rtx);
5054 emit_label (label1);
5058 operands[2] = force_reg (SImode, operands[2]);
5059 operands[2] = make_safe_from (operands[2], operands[0]);
5061 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5062 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5065 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5067 insn = emit_move_insn (operands[0],
5068 gen_lowpart (SImode, operands[3]));
5070 gen_rtx_EXPR_LIST (REG_EQUAL,
5071 udiv_equal, REG_NOTES (insn));
5076 rtx label1 = gen_label_rtx ();
5077 rtx label2 = gen_label_rtx ();
5078 rtx label3 = gen_label_rtx ();
5080 operands[1] = force_reg (SImode, operands[1]);
5081 operands[1] = make_safe_from (operands[1], operands[0]);
5082 operands[2] = force_reg (SImode, operands[2]);
5083 operands[2] = make_safe_from (operands[2], operands[0]);
5085 emit_move_insn (operands[0], const0_rtx);
5086 emit_insn (gen_cmpsi (operands[2], operands[1]));
5087 emit_jump_insn (gen_bgtu (label3));
5088 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5089 emit_jump_insn (gen_blt (label2));
5090 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5091 emit_jump_insn (gen_beq (label1));
5092 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5093 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5096 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5098 insn = emit_move_insn (operands[0],
5099 gen_lowpart (SImode, operands[3]));
5101 gen_rtx_EXPR_LIST (REG_EQUAL,
5102 udiv_equal, REG_NOTES (insn));
5104 emit_label (label1);
5105 emit_move_insn (operands[0], operands[1]);
5107 emit_label (label2);
5108 emit_move_insn (operands[0], const1_rtx);
5109 emit_label (label3);
5111 emit_move_insn (operands[0], operands[0]);
5115 (define_expand "umodsi3"
5116 [(set (match_operand:SI 0 "register_operand" "=d")
5117 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
5118 (match_operand:SI 2 "nonimmediate_operand" "")))
5119 (clobber (match_dup 3))]
5120 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
5122 rtx insn, udiv_equal, umod_equal, equal;
5124 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
5125 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
5126 equal = gen_rtx_IOR (DImode,
5127 gen_rtx_ASHIFT (DImode,
5128 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
5130 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
5132 operands[3] = gen_reg_rtx (DImode);
5134 if (CONSTANT_P (operands[2]))
5136 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
5138 rtx label1 = gen_label_rtx ();
5140 operands[1] = make_safe_from (operands[1], operands[0]);
5141 emit_move_insn (operands[0], operands[1]);
5142 emit_insn (gen_cmpsi (operands[0], operands[2]));
5143 emit_jump_insn (gen_bltu (label1));
5144 emit_insn (gen_abssi2 (operands[0], operands[2]));
5145 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
5146 emit_label (label1);
5150 operands[2] = force_reg (SImode, operands[2]);
5151 operands[2] = make_safe_from (operands[2], operands[0]);
5153 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5154 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5157 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5159 insn = emit_move_insn (operands[0],
5160 gen_highpart (SImode, operands[3]));
5162 gen_rtx_EXPR_LIST (REG_EQUAL,
5163 umod_equal, REG_NOTES (insn));
5168 rtx label1 = gen_label_rtx ();
5169 rtx label2 = gen_label_rtx ();
5170 rtx label3 = gen_label_rtx ();
5172 operands[1] = force_reg (SImode, operands[1]);
5173 operands[1] = make_safe_from (operands[1], operands[0]);
5174 operands[2] = force_reg (SImode, operands[2]);
5175 operands[2] = make_safe_from (operands[2], operands[0]);
5177 emit_move_insn(operands[0], operands[1]);
5178 emit_insn (gen_cmpsi (operands[2], operands[1]));
5179 emit_jump_insn (gen_bgtu (label3));
5180 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5181 emit_jump_insn (gen_blt (label2));
5182 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5183 emit_jump_insn (gen_beq (label1));
5184 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5185 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5188 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5190 insn = emit_move_insn (operands[0],
5191 gen_highpart (SImode, operands[3]));
5193 gen_rtx_EXPR_LIST (REG_EQUAL,
5194 umod_equal, REG_NOTES (insn));
5196 emit_label (label1);
5197 emit_move_insn (operands[0], const0_rtx);
5199 emit_label (label2);
5200 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5201 emit_label (label3);
5207 ; divdf3 instruction pattern(s).
5210 (define_expand "divdf3"
5211 [(set (match_operand:DF 0 "register_operand" "=f,f")
5212 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5213 (match_operand:DF 2 "general_operand" "f,R")))]
5217 (define_insn "*divdf3"
5218 [(set (match_operand:DF 0 "register_operand" "=f,f")
5219 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5220 (match_operand:DF 2 "general_operand" "f,R")))]
5221 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5225 [(set_attr "op_type" "RRE,RXE")
5226 (set_attr "type" "fdivd")])
5228 (define_insn "*divdf3_ibm"
5229 [(set (match_operand:DF 0 "register_operand" "=f,f")
5230 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5231 (match_operand:DF 2 "general_operand" "f,R")))]
5232 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5236 [(set_attr "op_type" "RR,RX")
5237 (set_attr "type" "fdivd")])
5240 ; divsf3 instruction pattern(s).
5243 (define_expand "divsf3"
5244 [(set (match_operand:SF 0 "register_operand" "=f,f")
5245 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5246 (match_operand:SF 2 "general_operand" "f,R")))]
5250 (define_insn "*divsf3"
5251 [(set (match_operand:SF 0 "register_operand" "=f,f")
5252 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5253 (match_operand:SF 2 "general_operand" "f,R")))]
5254 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5258 [(set_attr "op_type" "RRE,RXE")
5259 (set_attr "type" "fdivs")])
5261 (define_insn "*divsf3"
5262 [(set (match_operand:SF 0 "register_operand" "=f,f")
5263 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5264 (match_operand:SF 2 "general_operand" "f,R")))]
5265 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5269 [(set_attr "op_type" "RR,RX")
5270 (set_attr "type" "fdivs")])
5274 ;;- And instructions.
5278 ; anddi3 instruction pattern(s).
5281 (define_insn "*anddi3_cc"
5283 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5284 (match_operand:DI 2 "general_operand" "d,m"))
5286 (set (match_operand:DI 0 "register_operand" "=d,d")
5287 (and:DI (match_dup 1) (match_dup 2)))]
5288 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5292 [(set_attr "op_type" "RRE,RXY")])
5294 (define_insn "*anddi3_cconly"
5296 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5297 (match_operand:DI 2 "general_operand" "d,m"))
5299 (clobber (match_scratch:DI 0 "=d,d"))]
5300 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5304 [(set_attr "op_type" "RRE,RXY")])
5306 (define_insn "anddi3"
5307 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d")
5308 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0")
5309 (match_operand:DI 2 "general_operand"
5310 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m")))
5311 (clobber (reg:CC 33))]
5322 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")])
5324 (define_insn "*anddi3_ss"
5325 [(set (match_operand:DI 0 "s_operand" "=Q")
5326 (and:DI (match_dup 0)
5327 (match_operand:DI 1 "s_imm_operand" "Q")))
5328 (clobber (reg:CC 33))]
5331 [(set_attr "op_type" "SS")])
5333 (define_insn "*anddi3_ss_inv"
5334 [(set (match_operand:DI 0 "s_operand" "=Q")
5335 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
5337 (clobber (reg:CC 33))]
5340 [(set_attr "op_type" "SS")])
5343 ; andsi3 instruction pattern(s).
5346 (define_insn "*andsi3_cc"
5348 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5349 (match_operand:SI 2 "general_operand" "d,R,T"))
5351 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5352 (and:SI (match_dup 1) (match_dup 2)))]
5353 "s390_match_ccmode(insn, CCTmode)"
5358 [(set_attr "op_type" "RR,RX,RXY")])
5360 (define_insn "*andsi3_cconly"
5362 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5363 (match_operand:SI 2 "general_operand" "d,R,T"))
5365 (clobber (match_scratch:SI 0 "=d,d,d"))]
5366 "s390_match_ccmode(insn, CCTmode)"
5371 [(set_attr "op_type" "RR,RX,RXY")])
5373 (define_expand "andsi3"
5375 [(set (match_operand:SI 0 "register_operand" "")
5376 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5377 (match_operand:SI 2 "general_operand" "")))
5378 (clobber (reg:CC 33))])]
5382 (define_insn "*andsi3_zarch"
5383 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d")
5384 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0")
5385 (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T")))
5386 (clobber (reg:CC 33))]
5396 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")])
5398 (define_insn "*andsi3_esa"
5399 [(set (match_operand:SI 0 "register_operand" "=d,d")
5400 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
5401 (match_operand:SI 2 "general_operand" "d,R")))
5402 (clobber (reg:CC 33))]
5407 [(set_attr "op_type" "RR,RX")])
5409 (define_insn "*andsi3_ss"
5410 [(set (match_operand:SI 0 "s_operand" "=Q")
5411 (and:SI (match_dup 0)
5412 (match_operand:SI 1 "s_imm_operand" "Q")))
5413 (clobber (reg:CC 33))]
5416 [(set_attr "op_type" "SS")])
5418 (define_insn "*andsi3_ss_inv"
5419 [(set (match_operand:SI 0 "s_operand" "=Q")
5420 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
5422 (clobber (reg:CC 33))]
5425 [(set_attr "op_type" "SS")])
5428 ; andhi3 instruction pattern(s).
5431 (define_insn "*andhi3_ni"
5432 [(set (match_operand:HI 0 "register_operand" "=d,d")
5433 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
5434 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5435 (clobber (reg:CC 33))]
5440 [(set_attr "op_type" "RR,RI")])
5442 (define_insn "andhi3"
5443 [(set (match_operand:HI 0 "register_operand" "=d")
5444 (and:HI (match_operand:HI 1 "register_operand" "%0")
5445 (match_operand:HI 2 "nonmemory_operand" "d")))
5446 (clobber (reg:CC 33))]
5449 [(set_attr "op_type" "RR")])
5451 (define_insn "*andhi3_ss"
5452 [(set (match_operand:HI 0 "s_operand" "=Q")
5453 (and:HI (match_dup 0)
5454 (match_operand:HI 1 "s_imm_operand" "Q")))
5455 (clobber (reg:CC 33))]
5458 [(set_attr "op_type" "SS")])
5460 (define_insn "*andhi3_ss_inv"
5461 [(set (match_operand:HI 0 "s_operand" "=Q")
5462 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
5464 (clobber (reg:CC 33))]
5467 [(set_attr "op_type" "SS")])
5470 ; andqi3 instruction pattern(s).
5473 (define_insn "*andqi3_ni"
5474 [(set (match_operand:QI 0 "register_operand" "=d,d")
5475 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
5476 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5477 (clobber (reg:CC 33))]
5482 [(set_attr "op_type" "RR,RI")])
5484 (define_insn "andqi3"
5485 [(set (match_operand:QI 0 "register_operand" "=d")
5486 (and:QI (match_operand:QI 1 "register_operand" "%0")
5487 (match_operand:QI 2 "nonmemory_operand" "d")))
5488 (clobber (reg:CC 33))]
5491 [(set_attr "op_type" "RR")])
5493 (define_insn "*andqi3_ss"
5494 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5495 (and:QI (match_dup 0)
5496 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5497 (clobber (reg:CC 33))]
5503 [(set_attr "op_type" "SI,SIY,SS")])
5505 (define_insn "*andqi3_ss_inv"
5506 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5507 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5509 (clobber (reg:CC 33))]
5515 [(set_attr "op_type" "SI,SIY,SS")])
5519 ;;- Bit set (inclusive or) instructions.
5523 ; iordi3 instruction pattern(s).
5526 (define_insn "*iordi3_cc"
5528 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5529 (match_operand:DI 2 "general_operand" "d,m"))
5531 (set (match_operand:DI 0 "register_operand" "=d,d")
5532 (ior:DI (match_dup 1) (match_dup 2)))]
5533 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5537 [(set_attr "op_type" "RRE,RXY")])
5539 (define_insn "*iordi3_cconly"
5541 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5542 (match_operand:DI 2 "general_operand" "d,m"))
5544 (clobber (match_scratch:DI 0 "=d,d"))]
5545 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5549 [(set_attr "op_type" "RRE,RXY")])
5551 (define_insn "iordi3"
5552 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d")
5553 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0")
5554 (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m")))
5555 (clobber (reg:CC 33))]
5564 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")])
5566 (define_insn "*iordi3_ss"
5567 [(set (match_operand:DI 0 "s_operand" "=Q")
5568 (ior:DI (match_dup 0)
5569 (match_operand:DI 1 "s_imm_operand" "Q")))
5570 (clobber (reg:CC 33))]
5573 [(set_attr "op_type" "SS")])
5575 (define_insn "*iordi3_ss_inv"
5576 [(set (match_operand:DI 0 "s_operand" "=Q")
5577 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
5579 (clobber (reg:CC 33))]
5582 [(set_attr "op_type" "SS")])
5585 ; iorsi3 instruction pattern(s).
5588 (define_insn "*iorsi3_cc"
5590 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5591 (match_operand:SI 2 "general_operand" "d,R,T"))
5593 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5594 (ior:SI (match_dup 1) (match_dup 2)))]
5595 "s390_match_ccmode(insn, CCTmode)"
5600 [(set_attr "op_type" "RR,RX,RXY")])
5602 (define_insn "*iorsi3_cconly"
5604 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5605 (match_operand:SI 2 "general_operand" "d,R,T"))
5607 (clobber (match_scratch:SI 0 "=d,d,d"))]
5608 "s390_match_ccmode(insn, CCTmode)"
5613 [(set_attr "op_type" "RR,RX,RXY")])
5615 (define_expand "iorsi3"
5617 [(set (match_operand:SI 0 "register_operand" "")
5618 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5619 (match_operand:SI 2 "general_operand" "")))
5620 (clobber (reg:CC 33))])]
5624 (define_insn "iorsi3_zarch"
5625 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
5626 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0")
5627 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T")))
5628 (clobber (reg:CC 33))]
5636 [(set_attr "op_type" "RI,RI,RR,RX,RXY")])
5638 (define_insn "iorsi3_esa"
5639 [(set (match_operand:SI 0 "register_operand" "=d,d")
5640 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
5641 (match_operand:SI 2 "general_operand" "d,R")))
5642 (clobber (reg:CC 33))]
5647 [(set_attr "op_type" "RR,RX")])
5649 (define_insn "*iorsi3_ss"
5650 [(set (match_operand:SI 0 "s_operand" "=Q")
5651 (ior:SI (match_dup 0)
5652 (match_operand:SI 1 "s_imm_operand" "Q")))
5653 (clobber (reg:CC 33))]
5656 [(set_attr "op_type" "SS")])
5658 (define_insn "*iorsi3_ss_inv"
5659 [(set (match_operand:SI 0 "s_operand" "=Q")
5660 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
5662 (clobber (reg:CC 33))]
5665 [(set_attr "op_type" "SS")])
5668 ; iorhi3 instruction pattern(s).
5671 (define_insn "*iorhi3_oi"
5672 [(set (match_operand:HI 0 "register_operand" "=d,d")
5673 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
5674 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5675 (clobber (reg:CC 33))]
5680 [(set_attr "op_type" "RR,RI")])
5682 (define_insn "iorhi3"
5683 [(set (match_operand:HI 0 "register_operand" "=d")
5684 (ior:HI (match_operand:HI 1 "register_operand" "%0")
5685 (match_operand:HI 2 "nonmemory_operand" "d")))
5686 (clobber (reg:CC 33))]
5689 [(set_attr "op_type" "RR")])
5691 (define_insn "*iorhi3_ss"
5692 [(set (match_operand:HI 0 "s_operand" "=Q")
5693 (ior:HI (match_dup 0)
5694 (match_operand:HI 1 "s_imm_operand" "Q")))
5695 (clobber (reg:CC 33))]
5698 [(set_attr "op_type" "SS")])
5700 (define_insn "*iorhi3_ss_inv"
5701 [(set (match_operand:HI 0 "s_operand" "=Q")
5702 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
5704 (clobber (reg:CC 33))]
5707 [(set_attr "op_type" "SS")])
5710 ; iorqi3 instruction pattern(s).
5713 (define_insn "*iorqi3_oi"
5714 [(set (match_operand:QI 0 "register_operand" "=d,d")
5715 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
5716 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5717 (clobber (reg:CC 33))]
5722 [(set_attr "op_type" "RR,RI")])
5724 (define_insn "iorqi3"
5725 [(set (match_operand:QI 0 "register_operand" "=d")
5726 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5727 (match_operand:QI 2 "nonmemory_operand" "d")))
5728 (clobber (reg:CC 33))]
5731 [(set_attr "op_type" "RR")])
5733 (define_insn "*iorqi3_ss"
5734 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5735 (ior:QI (match_dup 0)
5736 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5737 (clobber (reg:CC 33))]
5743 [(set_attr "op_type" "SI,SIY,SS")])
5745 (define_insn "*iorqi3_ss_inv"
5746 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5747 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5749 (clobber (reg:CC 33))]
5755 [(set_attr "op_type" "SI,SIY,SS")])
5759 ;;- Xor instructions.
5763 ; xordi3 instruction pattern(s).
5766 (define_insn "*xordi3_cc"
5768 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5769 (match_operand:DI 2 "general_operand" "d,m"))
5771 (set (match_operand:DI 0 "register_operand" "=d,d")
5772 (xor:DI (match_dup 1) (match_dup 2)))]
5773 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5777 [(set_attr "op_type" "RRE,RXY")])
5779 (define_insn "*xordi3_cconly"
5781 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5782 (match_operand:DI 2 "general_operand" "d,m"))
5784 (clobber (match_scratch:DI 0 "=d,d"))]
5785 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5789 [(set_attr "op_type" "RRE,RXY")])
5791 (define_insn "xordi3"
5792 [(set (match_operand:DI 0 "register_operand" "=d,d")
5793 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5794 (match_operand:DI 2 "general_operand" "d,m")))
5795 (clobber (reg:CC 33))]
5800 [(set_attr "op_type" "RRE,RXY")])
5802 (define_insn "*xordi3_ss"
5803 [(set (match_operand:DI 0 "s_operand" "=Q")
5804 (xor:DI (match_dup 0)
5805 (match_operand:DI 1 "s_imm_operand" "Q")))
5806 (clobber (reg:CC 33))]
5809 [(set_attr "op_type" "SS")])
5811 (define_insn "*xordi3_ss_inv"
5812 [(set (match_operand:DI 0 "s_operand" "=Q")
5813 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5815 (clobber (reg:CC 33))]
5818 [(set_attr "op_type" "SS")])
5821 ; xorsi3 instruction pattern(s).
5824 (define_insn "*xorsi3_cc"
5826 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5827 (match_operand:SI 2 "general_operand" "d,R,T"))
5829 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5830 (xor:SI (match_dup 1) (match_dup 2)))]
5831 "s390_match_ccmode(insn, CCTmode)"
5836 [(set_attr "op_type" "RR,RX,RXY")])
5838 (define_insn "*xorsi3_cconly"
5840 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5841 (match_operand:SI 2 "general_operand" "d,R,T"))
5843 (clobber (match_scratch:SI 0 "=d,d,d"))]
5844 "s390_match_ccmode(insn, CCTmode)"
5849 [(set_attr "op_type" "RR,RX,RXY")])
5851 (define_insn "xorsi3"
5852 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5853 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5854 (match_operand:SI 2 "general_operand" "d,R,T")))
5855 (clobber (reg:CC 33))]
5861 [(set_attr "op_type" "RR,RX,RXY")])
5863 (define_insn "*xorsi3_ss"
5864 [(set (match_operand:SI 0 "s_operand" "=Q")
5865 (xor:SI (match_dup 0)
5866 (match_operand:SI 1 "s_imm_operand" "Q")))
5867 (clobber (reg:CC 33))]
5870 [(set_attr "op_type" "SS")])
5872 (define_insn "*xorsi3_ss_inv"
5873 [(set (match_operand:SI 0 "s_operand" "=Q")
5874 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5876 (clobber (reg:CC 33))]
5879 [(set_attr "op_type" "SS")])
5882 ; xorhi3 instruction pattern(s).
5885 (define_insn "xorhi3"
5886 [(set (match_operand:HI 0 "register_operand" "=d")
5887 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5888 (match_operand:HI 2 "nonmemory_operand" "d")))
5889 (clobber (reg:CC 33))]
5892 [(set_attr "op_type" "RR")])
5894 (define_insn "*xorhi3_ss"
5895 [(set (match_operand:HI 0 "s_operand" "=Q")
5896 (xor:HI (match_dup 0)
5897 (match_operand:HI 1 "s_imm_operand" "Q")))
5898 (clobber (reg:CC 33))]
5901 [(set_attr "op_type" "SS")])
5903 (define_insn "*xorhi3_ss_inv"
5904 [(set (match_operand:HI 0 "s_operand" "=Q")
5905 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5907 (clobber (reg:CC 33))]
5910 [(set_attr "op_type" "SS")])
5913 ; xorqi3 instruction pattern(s).
5916 (define_insn "xorqi3"
5917 [(set (match_operand:QI 0 "register_operand" "=d")
5918 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5919 (match_operand:QI 2 "nonmemory_operand" "d")))
5920 (clobber (reg:CC 33))]
5923 [(set_attr "op_type" "RR")])
5925 (define_insn "*xorqi3_ss"
5926 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5927 (xor:QI (match_dup 0)
5928 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5929 (clobber (reg:CC 33))]
5935 [(set_attr "op_type" "SI,SIY,SS")])
5937 (define_insn "*xorqi3_ss_inv"
5938 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5939 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5941 (clobber (reg:CC 33))]
5947 [(set_attr "op_type" "SI,SIY,SS")])
5951 ;;- Negate instructions.
5955 ; negdi2 instruction pattern(s).
5958 (define_expand "negdi2"
5960 [(set (match_operand:DI 0 "register_operand" "=d")
5961 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5962 (clobber (reg:CC 33))])]
5966 (define_insn "*negdi2_64"
5967 [(set (match_operand:DI 0 "register_operand" "=d")
5968 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5969 (clobber (reg:CC 33))]
5972 [(set_attr "op_type" "RR")])
5974 (define_insn "*negdi2_31"
5975 [(set (match_operand:DI 0 "register_operand" "=d")
5976 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5977 (clobber (reg:CC 33))]
5981 xop[0] = gen_label_rtx ();
5982 output_asm_insn ("lcr\t%0,%1", operands);
5983 output_asm_insn ("lcr\t%N0,%N1", operands);
5984 output_asm_insn ("je\t%l0", xop);
5985 output_asm_insn ("bctr\t%0,0", operands);
5986 targetm.asm_out.internal_label (asm_out_file, "L",
5987 CODE_LABEL_NUMBER (xop[0]));
5990 [(set_attr "op_type" "NN")
5991 (set_attr "type" "other")
5992 (set_attr "length" "10")])
5995 ; negsi2 instruction pattern(s).
5998 (define_insn "negsi2"
5999 [(set (match_operand:SI 0 "register_operand" "=d")
6000 (neg:SI (match_operand:SI 1 "register_operand" "d")))
6001 (clobber (reg:CC 33))]
6004 [(set_attr "op_type" "RR")])
6007 ; negdf2 instruction pattern(s).
6010 (define_expand "negdf2"
6012 [(set (match_operand:DF 0 "register_operand" "=f")
6013 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6014 (clobber (reg:CC 33))])]
6018 (define_insn "*negdf2"
6019 [(set (match_operand:DF 0 "register_operand" "=f")
6020 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6021 (clobber (reg:CC 33))]
6022 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6024 [(set_attr "op_type" "RRE")
6025 (set_attr "type" "fsimpd")])
6027 (define_insn "*negdf2_ibm"
6028 [(set (match_operand:DF 0 "register_operand" "=f")
6029 (neg:DF (match_operand:DF 1 "register_operand" "f")))
6030 (clobber (reg:CC 33))]
6031 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6033 [(set_attr "op_type" "RR")
6034 (set_attr "type" "fsimpd")])
6037 ; negsf2 instruction pattern(s).
6040 (define_expand "negsf2"
6042 [(set (match_operand:SF 0 "register_operand" "=f")
6043 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6044 (clobber (reg:CC 33))])]
6048 (define_insn "*negsf2"
6049 [(set (match_operand:SF 0 "register_operand" "=f")
6050 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6051 (clobber (reg:CC 33))]
6052 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6054 [(set_attr "op_type" "RRE")
6055 (set_attr "type" "fsimps")])
6057 (define_insn "*negsf2"
6058 [(set (match_operand:SF 0 "register_operand" "=f")
6059 (neg:SF (match_operand:SF 1 "register_operand" "f")))
6060 (clobber (reg:CC 33))]
6061 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6063 [(set_attr "op_type" "RR")
6064 (set_attr "type" "fsimps")])
6068 ;;- Absolute value instructions.
6072 ; absdi2 instruction pattern(s).
6075 (define_insn "absdi2"
6076 [(set (match_operand:DI 0 "register_operand" "=d")
6077 (abs:DI (match_operand:DI 1 "register_operand" "d")))
6078 (clobber (reg:CC 33))]
6081 [(set_attr "op_type" "RRE")])
6084 ; abssi2 instruction pattern(s).
6087 (define_insn "abssi2"
6088 [(set (match_operand:SI 0 "register_operand" "=d")
6089 (abs:SI (match_operand:SI 1 "register_operand" "d")))
6090 (clobber (reg:CC 33))]
6093 [(set_attr "op_type" "RR")])
6096 ; absdf2 instruction pattern(s).
6099 (define_expand "absdf2"
6101 [(set (match_operand:DF 0 "register_operand" "=f")
6102 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6103 (clobber (reg:CC 33))])]
6107 (define_insn "*absdf2"
6108 [(set (match_operand:DF 0 "register_operand" "=f")
6109 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6110 (clobber (reg:CC 33))]
6111 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6113 [(set_attr "op_type" "RRE")
6114 (set_attr "type" "fsimpd")])
6116 (define_insn "*absdf2_ibm"
6117 [(set (match_operand:DF 0 "register_operand" "=f")
6118 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6119 (clobber (reg:CC 33))]
6120 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6122 [(set_attr "op_type" "RR")
6123 (set_attr "type" "fsimpd")])
6126 ; abssf2 instruction pattern(s).
6129 (define_expand "abssf2"
6131 [(set (match_operand:SF 0 "register_operand" "=f")
6132 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6133 (clobber (reg:CC 33))])]
6137 (define_insn "*abssf2"
6138 [(set (match_operand:SF 0 "register_operand" "=f")
6139 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6140 (clobber (reg:CC 33))]
6141 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6143 [(set_attr "op_type" "RRE")
6144 (set_attr "type" "fsimps")])
6146 (define_insn "*abssf2_ibm"
6147 [(set (match_operand:SF 0 "register_operand" "=f")
6148 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6149 (clobber (reg:CC 33))]
6150 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6152 [(set_attr "op_type" "RR")
6153 (set_attr "type" "fsimps")])
6156 ;;- Negated absolute value instructions
6163 (define_insn "*negabssi2"
6164 [(set (match_operand:SI 0 "register_operand" "=d")
6165 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
6166 (clobber (reg:CC 33))]
6169 [(set_attr "op_type" "RR")])
6171 (define_insn "*negabsdi2"
6172 [(set (match_operand:DI 0 "register_operand" "=d")
6173 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
6174 (clobber (reg:CC 33))]
6177 [(set_attr "op_type" "RRE")])
6183 (define_insn "*negabssf2"
6184 [(set (match_operand:SF 0 "register_operand" "=f")
6185 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6186 (clobber (reg:CC 33))]
6187 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6189 [(set_attr "op_type" "RRE")
6190 (set_attr "type" "fsimps")])
6192 (define_insn "*negabsdf2"
6193 [(set (match_operand:DF 0 "register_operand" "=f")
6194 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6195 (clobber (reg:CC 33))]
6196 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6198 [(set_attr "op_type" "RRE")
6199 (set_attr "type" "fsimpd")])
6202 ;;- Square root instructions.
6206 ; sqrtdf2 instruction pattern(s).
6209 (define_insn "sqrtdf2"
6210 [(set (match_operand:DF 0 "register_operand" "=f,f")
6211 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6212 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6216 [(set_attr "op_type" "RRE,RXE")])
6219 ; sqrtsf2 instruction pattern(s).
6222 (define_insn "sqrtsf2"
6223 [(set (match_operand:SF 0 "register_operand" "=f,f")
6224 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6225 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6229 [(set_attr "op_type" "RRE,RXE")])
6232 ;;- One complement instructions.
6236 ; one_cmpldi2 instruction pattern(s).
6239 (define_expand "one_cmpldi2"
6241 [(set (match_operand:DI 0 "register_operand" "")
6242 (xor:DI (match_operand:DI 1 "register_operand" "")
6244 (clobber (reg:CC 33))])]
6249 ; one_cmplsi2 instruction pattern(s).
6252 (define_expand "one_cmplsi2"
6254 [(set (match_operand:SI 0 "register_operand" "")
6255 (xor:SI (match_operand:SI 1 "register_operand" "")
6257 (clobber (reg:CC 33))])]
6262 ; one_cmplhi2 instruction pattern(s).
6265 (define_expand "one_cmplhi2"
6267 [(set (match_operand:HI 0 "register_operand" "")
6268 (xor:HI (match_operand:HI 1 "register_operand" "")
6270 (clobber (reg:CC 33))])]
6275 ; one_cmplqi2 instruction pattern(s).
6278 (define_expand "one_cmplqi2"
6280 [(set (match_operand:QI 0 "register_operand" "")
6281 (xor:QI (match_operand:QI 1 "register_operand" "")
6283 (clobber (reg:CC 33))])]
6289 ;;- Rotate instructions.
6293 ; rotldi3 instruction pattern(s).
6296 (define_insn "rotldi3"
6297 [(set (match_operand:DI 0 "register_operand" "=d")
6298 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6299 (match_operand:SI 2 "shift_count_operand" "Y")))]
6302 [(set_attr "op_type" "RSE")
6303 (set_attr "atype" "reg")])
6306 ; rotlsi3 instruction pattern(s).
6309 (define_insn "rotlsi3"
6310 [(set (match_operand:SI 0 "register_operand" "=d")
6311 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6312 (match_operand:SI 2 "shift_count_operand" "Y")))]
6315 [(set_attr "op_type" "RSE")
6316 (set_attr "atype" "reg")])
6320 ;;- Arithmetic shift instructions.
6324 ; ashldi3 instruction pattern(s).
6327 (define_expand "ashldi3"
6328 [(set (match_operand:DI 0 "register_operand" "")
6329 (ashift:DI (match_operand:DI 1 "register_operand" "")
6330 (match_operand:SI 2 "shift_count_operand" "")))]
6334 (define_insn "*ashldi3_31"
6335 [(set (match_operand:DI 0 "register_operand" "=d")
6336 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6337 (match_operand:SI 2 "shift_count_operand" "Y")))]
6340 [(set_attr "op_type" "RS")
6341 (set_attr "atype" "reg")])
6343 (define_insn "*ashldi3_64"
6344 [(set (match_operand:DI 0 "register_operand" "=d")
6345 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6346 (match_operand:SI 2 "shift_count_operand" "Y")))]
6349 [(set_attr "op_type" "RSE")
6350 (set_attr "atype" "reg")])
6353 ; ashrdi3 instruction pattern(s).
6356 (define_expand "ashrdi3"
6358 [(set (match_operand:DI 0 "register_operand" "")
6359 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6360 (match_operand:SI 2 "shift_count_operand" "")))
6361 (clobber (reg:CC 33))])]
6365 (define_insn "*ashrdi3_cc_31"
6367 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6368 (match_operand:SI 2 "shift_count_operand" "Y"))
6370 (set (match_operand:DI 0 "register_operand" "=d")
6371 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6372 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6374 [(set_attr "op_type" "RS")
6375 (set_attr "atype" "reg")])
6377 (define_insn "*ashrdi3_cconly_31"
6379 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6380 (match_operand:SI 2 "shift_count_operand" "Y"))
6382 (clobber (match_scratch:DI 0 "=d"))]
6383 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6385 [(set_attr "op_type" "RS")
6386 (set_attr "atype" "reg")])
6388 (define_insn "*ashrdi3_31"
6389 [(set (match_operand:DI 0 "register_operand" "=d")
6390 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6391 (match_operand:SI 2 "shift_count_operand" "Y")))
6392 (clobber (reg:CC 33))]
6395 [(set_attr "op_type" "RS")
6396 (set_attr "atype" "reg")])
6398 (define_insn "*ashrdi3_cc_64"
6400 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6401 (match_operand:SI 2 "shift_count_operand" "Y"))
6403 (set (match_operand:DI 0 "register_operand" "=d")
6404 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6405 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6407 [(set_attr "op_type" "RSE")
6408 (set_attr "atype" "reg")])
6410 (define_insn "*ashrdi3_cconly_64"
6412 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6413 (match_operand:SI 2 "shift_count_operand" "Y"))
6415 (clobber (match_scratch:DI 0 "=d"))]
6416 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6418 [(set_attr "op_type" "RSE")
6419 (set_attr "atype" "reg")])
6421 (define_insn "*ashrdi3_64"
6422 [(set (match_operand:DI 0 "register_operand" "=d")
6423 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6424 (match_operand:SI 2 "shift_count_operand" "Y")))
6425 (clobber (reg:CC 33))]
6428 [(set_attr "op_type" "RSE")
6429 (set_attr "atype" "reg")])
6433 ; ashlsi3 instruction pattern(s).
6436 (define_insn "ashlsi3"
6437 [(set (match_operand:SI 0 "register_operand" "=d")
6438 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6439 (match_operand:SI 2 "shift_count_operand" "Y")))]
6442 [(set_attr "op_type" "RS")
6443 (set_attr "atype" "reg")])
6446 ; ashrsi3 instruction pattern(s).
6449 (define_insn "*ashrsi3_cc"
6451 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6452 (match_operand:SI 2 "shift_count_operand" "Y"))
6454 (set (match_operand:SI 0 "register_operand" "=d")
6455 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6456 "s390_match_ccmode(insn, CCSmode)"
6458 [(set_attr "op_type" "RS")
6459 (set_attr "atype" "reg")])
6462 (define_insn "*ashrsi3_cconly"
6464 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6465 (match_operand:SI 2 "shift_count_operand" "Y"))
6467 (clobber (match_scratch:SI 0 "=d"))]
6468 "s390_match_ccmode(insn, CCSmode)"
6470 [(set_attr "op_type" "RS")
6471 (set_attr "atype" "reg")])
6473 (define_insn "ashrsi3"
6474 [(set (match_operand:SI 0 "register_operand" "=d")
6475 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6476 (match_operand:SI 2 "shift_count_operand" "Y")))
6477 (clobber (reg:CC 33))]
6480 [(set_attr "op_type" "RS")
6481 (set_attr "atype" "reg")])
6485 ;;- logical shift instructions.
6489 ; lshrdi3 instruction pattern(s).
6492 (define_expand "lshrdi3"
6493 [(set (match_operand:DI 0 "register_operand" "")
6494 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6495 (match_operand:SI 2 "shift_count_operand" "")))]
6499 (define_insn "*lshrdi3_31"
6500 [(set (match_operand:DI 0 "register_operand" "=d")
6501 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6502 (match_operand:SI 2 "shift_count_operand" "Y")))]
6505 [(set_attr "op_type" "RS")
6506 (set_attr "atype" "reg")])
6508 (define_insn "*lshrdi3_64"
6509 [(set (match_operand:DI 0 "register_operand" "=d")
6510 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6511 (match_operand:SI 2 "shift_count_operand" "Y")))]
6514 [(set_attr "op_type" "RSE")
6515 (set_attr "atype" "reg")])
6518 ; lshrsi3 instruction pattern(s).
6521 (define_insn "lshrsi3"
6522 [(set (match_operand:SI 0 "register_operand" "=d")
6523 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6524 (match_operand:SI 2 "shift_count_operand" "Y")))]
6527 [(set_attr "op_type" "RS")
6528 (set_attr "atype" "reg")])
6532 ;; Branch instruction patterns.
6535 (define_expand "beq"
6536 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
6538 (if_then_else (eq (reg:CCZ 33) (const_int 0))
6539 (label_ref (match_operand 0 "" ""))
6542 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6544 (define_expand "bne"
6545 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
6547 (if_then_else (ne (reg:CCZ 33) (const_int 0))
6548 (label_ref (match_operand 0 "" ""))
6551 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6553 (define_expand "bgt"
6554 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6556 (if_then_else (gt (reg:CCS 33) (const_int 0))
6557 (label_ref (match_operand 0 "" ""))
6560 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6562 (define_expand "bgtu"
6563 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6565 (if_then_else (gtu (reg:CCU 33) (const_int 0))
6566 (label_ref (match_operand 0 "" ""))
6569 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6571 (define_expand "blt"
6572 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6574 (if_then_else (lt (reg:CCS 33) (const_int 0))
6575 (label_ref (match_operand 0 "" ""))
6578 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6580 (define_expand "bltu"
6581 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6583 (if_then_else (ltu (reg:CCU 33) (const_int 0))
6584 (label_ref (match_operand 0 "" ""))
6587 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6589 (define_expand "bge"
6590 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6592 (if_then_else (ge (reg:CCS 33) (const_int 0))
6593 (label_ref (match_operand 0 "" ""))
6596 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6598 (define_expand "bgeu"
6599 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6601 (if_then_else (geu (reg:CCU 33) (const_int 0))
6602 (label_ref (match_operand 0 "" ""))
6605 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6607 (define_expand "ble"
6608 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6610 (if_then_else (le (reg:CCS 33) (const_int 0))
6611 (label_ref (match_operand 0 "" ""))
6614 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6616 (define_expand "bleu"
6617 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6619 (if_then_else (leu (reg:CCU 33) (const_int 0))
6620 (label_ref (match_operand 0 "" ""))
6623 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6625 (define_expand "bunordered"
6626 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6628 (if_then_else (unordered (reg:CCS 33) (const_int 0))
6629 (label_ref (match_operand 0 "" ""))
6632 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6634 (define_expand "bordered"
6635 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6637 (if_then_else (ordered (reg:CCS 33) (const_int 0))
6638 (label_ref (match_operand 0 "" ""))
6641 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6643 (define_expand "buneq"
6644 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6646 (if_then_else (uneq (reg:CCS 33) (const_int 0))
6647 (label_ref (match_operand 0 "" ""))
6650 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6652 (define_expand "bungt"
6653 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6655 (if_then_else (ungt (reg:CCS 33) (const_int 0))
6656 (label_ref (match_operand 0 "" ""))
6659 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6661 (define_expand "bunlt"
6662 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6664 (if_then_else (unlt (reg:CCS 33) (const_int 0))
6665 (label_ref (match_operand 0 "" ""))
6668 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6670 (define_expand "bunge"
6671 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6673 (if_then_else (unge (reg:CCS 33) (const_int 0))
6674 (label_ref (match_operand 0 "" ""))
6677 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6679 (define_expand "bunle"
6680 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6682 (if_then_else (unle (reg:CCS 33) (const_int 0))
6683 (label_ref (match_operand 0 "" ""))
6686 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6688 (define_expand "bltgt"
6689 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6691 (if_then_else (ltgt (reg:CCS 33) (const_int 0))
6692 (label_ref (match_operand 0 "" ""))
6695 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6699 ;;- Conditional jump instructions.
6702 (define_insn "cjump"
6705 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6706 (label_ref (match_operand 0 "" ""))
6710 if (get_attr_length (insn) == 4)
6712 else if (TARGET_CPU_ZARCH)
6713 return "jg%C1\t%l0";
6717 [(set_attr "op_type" "RI")
6718 (set_attr "type" "branch")
6719 (set (attr "length")
6720 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6722 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6724 (eq (symbol_ref "flag_pic") (const_int 0))
6725 (const_int 6)] (const_int 8)))])
6727 (define_insn "*cjump_long"
6730 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6731 (match_operand 0 "address_operand" "U")
6735 if (get_attr_op_type (insn) == OP_TYPE_RR)
6740 [(set (attr "op_type")
6741 (if_then_else (match_operand 0 "register_operand" "")
6742 (const_string "RR") (const_string "RX")))
6743 (set_attr "type" "branch")
6744 (set_attr "atype" "agen")])
6748 ;;- Negated conditional jump instructions.
6751 (define_insn "icjump"
6754 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6756 (label_ref (match_operand 0 "" ""))))]
6759 if (get_attr_length (insn) == 4)
6761 else if (TARGET_CPU_ZARCH)
6762 return "jg%D1\t%l0";
6766 [(set_attr "op_type" "RI")
6767 (set_attr "type" "branch")
6768 (set (attr "length")
6769 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6771 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6773 (eq (symbol_ref "flag_pic") (const_int 0))
6774 (const_int 6)] (const_int 8)))])
6776 (define_insn "*icjump_long"
6779 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6781 (match_operand 0 "address_operand" "U")))]
6784 if (get_attr_op_type (insn) == OP_TYPE_RR)
6789 [(set (attr "op_type")
6790 (if_then_else (match_operand 0 "register_operand" "")
6791 (const_string "RR") (const_string "RX")))
6792 (set_attr "type" "branch")
6793 (set_attr "atype" "agen")])
6796 ;;- Trap instructions.
6800 [(trap_if (const_int 1) (const_int 0))]
6803 [(set_attr "op_type" "RX")
6804 (set_attr "type" "branch")])
6806 (define_expand "conditional_trap"
6807 [(set (match_dup 2) (match_dup 3))
6808 (trap_if (match_operator 0 "comparison_operator"
6809 [(match_dup 2) (const_int 0)])
6810 (match_operand:SI 1 "general_operand" ""))]
6813 enum machine_mode ccmode;
6815 if (operands[1] != const0_rtx) FAIL;
6817 ccmode = s390_select_ccmode (GET_CODE (operands[0]),
6818 s390_compare_op0, s390_compare_op1);
6819 operands[2] = gen_rtx_REG (ccmode, 33);
6820 operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
6823 (define_insn "*trap"
6824 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6828 [(set_attr "op_type" "RI")
6829 (set_attr "type" "branch")])
6832 ;;- Loop instructions.
6834 ;; This is all complicated by the fact that since this is a jump insn
6835 ;; we must handle our own output reloads.
6837 (define_expand "doloop_end"
6838 [(use (match_operand 0 "" "")) ; loop pseudo
6839 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6840 (use (match_operand 2 "" "")) ; max iterations
6841 (use (match_operand 3 "" "")) ; loop level
6842 (use (match_operand 4 "" ""))] ; label
6845 if (GET_MODE (operands[0]) == SImode)
6846 emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0]));
6847 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6848 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6855 (define_insn "doloop_si"
6858 (ne (match_operand:SI 1 "register_operand" "d,d")
6860 (label_ref (match_operand 0 "" ""))
6862 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6863 (plus:SI (match_dup 1) (const_int -1)))
6864 (clobber (match_scratch:SI 3 "=X,&d"))
6865 (clobber (reg:CC 33))]
6868 if (which_alternative != 0)
6870 else if (get_attr_length (insn) == 4)
6871 return "brct\t%1,%l0";
6872 else if (TARGET_CPU_ZARCH)
6873 return "ahi\t%1,-1\;jgne\t%l0";
6877 [(set_attr "op_type" "RI")
6878 (set_attr "type" "branch")
6879 (set (attr "length")
6880 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6882 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6884 (eq (symbol_ref "flag_pic") (const_int 0))
6885 (const_int 6)] (const_int 8)))])
6887 (define_insn "*doloop_si_long"
6890 (ne (match_operand:SI 1 "register_operand" "d,d")
6892 (match_operand 0 "address_operand" "U,U")
6894 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6895 (plus:SI (match_dup 1) (const_int -1)))
6896 (clobber (match_scratch:SI 3 "=X,&d"))
6897 (clobber (reg:CC 33))]
6900 if (get_attr_op_type (insn) == OP_TYPE_RR)
6901 return "bctr\t%1,%0";
6903 return "bct\t%1,%a0";
6905 [(set (attr "op_type")
6906 (if_then_else (match_operand 0 "register_operand" "")
6907 (const_string "RR") (const_string "RX")))
6908 (set_attr "type" "branch")
6909 (set_attr "atype" "agen")])
6913 (if_then_else (ne (match_operand:SI 1 "register_operand" "")
6915 (match_operand 0 "" "")
6917 (set (match_operand:SI 2 "nonimmediate_operand" "")
6918 (plus:SI (match_dup 1) (const_int -1)))
6919 (clobber (match_scratch:SI 3 ""))
6920 (clobber (reg:CC 33))]
6922 && (! REG_P (operands[2])
6923 || ! rtx_equal_p (operands[1], operands[2]))"
6924 [(set (match_dup 3) (match_dup 1))
6925 (parallel [(set (reg:CCAN 33)
6926 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6928 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6929 (set (match_dup 2) (match_dup 3))
6930 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6935 (define_insn "doloop_di"
6938 (ne (match_operand:DI 1 "register_operand" "d,d")
6940 (label_ref (match_operand 0 "" ""))
6942 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*r")
6943 (plus:DI (match_dup 1) (const_int -1)))
6944 (clobber (match_scratch:DI 3 "=X,&d"))
6945 (clobber (reg:CC 33))]
6948 if (which_alternative != 0)
6950 else if (get_attr_length (insn) == 4)
6951 return "brctg\t%1,%l0";
6953 return "aghi\t%1,-1\;jgne\t%l0";
6955 [(set_attr "op_type" "RI")
6956 (set_attr "type" "branch")
6957 (set (attr "length")
6958 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6959 (const_int 4) (const_int 10)))])
6963 (if_then_else (ne (match_operand:DI 1 "register_operand" "")
6965 (match_operand 0 "" "")
6967 (set (match_operand:DI 2 "nonimmediate_operand" "")
6968 (plus:DI (match_dup 1) (const_int -1)))
6969 (clobber (match_scratch:DI 3 ""))
6970 (clobber (reg:CC 33))]
6972 && (! REG_P (operands[2])
6973 || ! rtx_equal_p (operands[1], operands[2]))"
6974 [(set (match_dup 3) (match_dup 1))
6975 (parallel [(set (reg:CCAN 33)
6976 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6978 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6979 (set (match_dup 2) (match_dup 3))
6980 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6986 ;;- Unconditional jump instructions.
6990 ; jump instruction pattern(s).
6994 [(set (pc) (label_ref (match_operand 0 "" "")))]
6997 if (get_attr_length (insn) == 4)
6999 else if (TARGET_CPU_ZARCH)
7004 [(set_attr "op_type" "RI")
7005 (set_attr "type" "branch")
7006 (set (attr "length")
7007 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
7009 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
7011 (eq (symbol_ref "flag_pic") (const_int 0))
7012 (const_int 6)] (const_int 8)))])
7015 ; indirect-jump instruction pattern(s).
7018 (define_insn "indirect_jump"
7019 [(set (pc) (match_operand 0 "address_operand" "U"))]
7022 if (get_attr_op_type (insn) == OP_TYPE_RR)
7027 [(set (attr "op_type")
7028 (if_then_else (match_operand 0 "register_operand" "")
7029 (const_string "RR") (const_string "RX")))
7030 (set_attr "type" "branch")
7031 (set_attr "atype" "agen")])
7034 ; casesi instruction pattern(s).
7037 (define_insn "casesi_jump"
7038 [(set (pc) (match_operand 0 "address_operand" "U"))
7039 (use (label_ref (match_operand 1 "" "")))]
7042 if (get_attr_op_type (insn) == OP_TYPE_RR)
7047 [(set (attr "op_type")
7048 (if_then_else (match_operand 0 "register_operand" "")
7049 (const_string "RR") (const_string "RX")))
7050 (set_attr "type" "branch")
7051 (set_attr "atype" "agen")])
7053 (define_expand "casesi"
7054 [(match_operand:SI 0 "general_operand" "")
7055 (match_operand:SI 1 "general_operand" "")
7056 (match_operand:SI 2 "general_operand" "")
7057 (label_ref (match_operand 3 "" ""))
7058 (label_ref (match_operand 4 "" ""))]
7061 rtx index = gen_reg_rtx (SImode);
7062 rtx base = gen_reg_rtx (Pmode);
7063 rtx target = gen_reg_rtx (Pmode);
7065 emit_move_insn (index, operands[0]);
7066 emit_insn (gen_subsi3 (index, index, operands[1]));
7067 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
7070 if (Pmode != SImode)
7071 index = convert_to_mode (Pmode, index, 1);
7072 if (GET_CODE (index) != REG)
7073 index = copy_to_mode_reg (Pmode, index);
7076 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
7078 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
7080 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
7082 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
7083 RTX_UNCHANGING_P (index) = 1;
7084 MEM_NOTRAP_P (index) = 1;
7085 emit_move_insn (target, index);
7088 target = gen_rtx_PLUS (Pmode, base, target);
7089 emit_jump_insn (gen_casesi_jump (target, operands[3]));
7096 ;;- Jump to subroutine.
7101 ; untyped call instruction pattern(s).
7104 ;; Call subroutine returning any type.
7105 (define_expand "untyped_call"
7106 [(parallel [(call (match_operand 0 "" "")
7108 (match_operand 1 "" "")
7109 (match_operand 2 "" "")])]
7114 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
7116 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7118 rtx set = XVECEXP (operands[2], 0, i);
7119 emit_move_insn (SET_DEST (set), SET_SRC (set));
7122 /* The optimizer does not know that the call sets the function value
7123 registers we stored in the result block. We avoid problems by
7124 claiming that all hard registers are used and clobbered at this
7126 emit_insn (gen_blockage ());
7131 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7132 ;; all of memory. This blocks insns from being moved across this point.
7134 (define_insn "blockage"
7135 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7138 [(set_attr "type" "none")
7139 (set_attr "length" "0")])
7145 (define_expand "sibcall"
7146 [(call (match_operand 0 "" "")
7147 (match_operand 1 "" ""))]
7150 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
7154 (define_insn "*sibcall_br"
7155 [(call (mem:QI (reg 1))
7156 (match_operand 0 "const_int_operand" "n"))]
7157 "SIBLING_CALL_P (insn)
7158 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
7160 [(set_attr "op_type" "RR")
7161 (set_attr "type" "branch")
7162 (set_attr "atype" "agen")])
7164 (define_insn "*sibcall_brc"
7165 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7166 (match_operand 1 "const_int_operand" "n"))]
7167 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7169 [(set_attr "op_type" "RI")
7170 (set_attr "type" "branch")])
7172 (define_insn "*sibcall_brcl"
7173 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7174 (match_operand 1 "const_int_operand" "n"))]
7175 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7177 [(set_attr "op_type" "RIL")
7178 (set_attr "type" "branch")])
7181 ; sibcall_value patterns
7184 (define_expand "sibcall_value"
7185 [(set (match_operand 0 "" "")
7186 (call (match_operand 1 "" "")
7187 (match_operand 2 "" "")))]
7190 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7194 (define_insn "*sibcall_value_br"
7195 [(set (match_operand 0 "" "")
7196 (call (mem:QI (reg 1))
7197 (match_operand 1 "const_int_operand" "n")))]
7198 "SIBLING_CALL_P (insn)
7199 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7201 [(set_attr "op_type" "RR")
7202 (set_attr "type" "branch")
7203 (set_attr "atype" "agen")])
7205 (define_insn "*sibcall_value_brc"
7206 [(set (match_operand 0 "" "")
7207 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7208 (match_operand 2 "const_int_operand" "n")))]
7209 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7211 [(set_attr "op_type" "RI")
7212 (set_attr "type" "branch")])
7214 (define_insn "*sibcall_value_brcl"
7215 [(set (match_operand 0 "" "")
7216 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7217 (match_operand 2 "const_int_operand" "n")))]
7218 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7220 [(set_attr "op_type" "RIL")
7221 (set_attr "type" "branch")])
7225 ; call instruction pattern(s).
7228 (define_expand "call"
7229 [(call (match_operand 0 "" "")
7230 (match_operand 1 "" ""))
7231 (use (match_operand 2 "" ""))]
7234 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7235 gen_rtx_REG (Pmode, RETURN_REGNUM));
7239 (define_insn "*bras"
7240 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7241 (match_operand 1 "const_int_operand" "n"))
7242 (clobber (match_operand 2 "register_operand" "=r"))]
7243 "!SIBLING_CALL_P (insn)
7244 && TARGET_SMALL_EXEC
7245 && GET_MODE (operands[2]) == Pmode"
7247 [(set_attr "op_type" "RI")
7248 (set_attr "type" "jsr")])
7250 (define_insn "*brasl"
7251 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7252 (match_operand 1 "const_int_operand" "n"))
7253 (clobber (match_operand 2 "register_operand" "=r"))]
7254 "!SIBLING_CALL_P (insn)
7256 && GET_MODE (operands[2]) == Pmode"
7258 [(set_attr "op_type" "RIL")
7259 (set_attr "type" "jsr")])
7261 (define_insn "*basr"
7262 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7263 (match_operand 1 "const_int_operand" "n"))
7264 (clobber (match_operand 2 "register_operand" "=r"))]
7265 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7267 if (get_attr_op_type (insn) == OP_TYPE_RR)
7268 return "basr\t%2,%0";
7270 return "bas\t%2,%a0";
7272 [(set (attr "op_type")
7273 (if_then_else (match_operand 0 "register_operand" "")
7274 (const_string "RR") (const_string "RX")))
7275 (set_attr "type" "jsr")
7276 (set_attr "atype" "agen")])
7279 ; call_value instruction pattern(s).
7282 (define_expand "call_value"
7283 [(set (match_operand 0 "" "")
7284 (call (match_operand 1 "" "")
7285 (match_operand 2 "" "")))
7286 (use (match_operand 3 "" ""))]
7289 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7290 gen_rtx_REG (Pmode, RETURN_REGNUM));
7294 (define_insn "*bras_r"
7295 [(set (match_operand 0 "" "")
7296 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7297 (match_operand:SI 2 "const_int_operand" "n")))
7298 (clobber (match_operand 3 "register_operand" "=r"))]
7299 "!SIBLING_CALL_P (insn)
7300 && TARGET_SMALL_EXEC
7301 && GET_MODE (operands[3]) == Pmode"
7303 [(set_attr "op_type" "RI")
7304 (set_attr "type" "jsr")])
7306 (define_insn "*brasl_r"
7307 [(set (match_operand 0 "" "")
7308 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7309 (match_operand 2 "const_int_operand" "n")))
7310 (clobber (match_operand 3 "register_operand" "=r"))]
7311 "!SIBLING_CALL_P (insn)
7313 && GET_MODE (operands[3]) == Pmode"
7315 [(set_attr "op_type" "RIL")
7316 (set_attr "type" "jsr")])
7318 (define_insn "*basr_r"
7319 [(set (match_operand 0 "" "")
7320 (call (mem:QI (match_operand 1 "address_operand" "U"))
7321 (match_operand 2 "const_int_operand" "n")))
7322 (clobber (match_operand 3 "register_operand" "=r"))]
7323 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7325 if (get_attr_op_type (insn) == OP_TYPE_RR)
7326 return "basr\t%3,%1";
7328 return "bas\t%3,%a1";
7330 [(set (attr "op_type")
7331 (if_then_else (match_operand 1 "register_operand" "")
7332 (const_string "RR") (const_string "RX")))
7333 (set_attr "type" "jsr")
7334 (set_attr "atype" "agen")])
7337 ;;- Thread-local storage support.
7340 (define_insn "get_tp_64"
7341 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
7342 (unspec:DI [(const_int 0)] UNSPEC_TP))]
7345 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
7347 [(set_attr "op_type" "NN,RS")
7348 (set_attr "atype" "reg,*")
7349 (set_attr "type" "o3,*")
7350 (set_attr "length" "14,*")])
7352 (define_insn "get_tp_31"
7353 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
7354 (unspec:SI [(const_int 0)] UNSPEC_TP))]
7359 [(set_attr "op_type" "RRE,RS")])
7361 (define_insn "set_tp_64"
7362 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
7363 (clobber (match_scratch:SI 1 "=d,X"))]
7366 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
7368 [(set_attr "op_type" "NN,RS")
7369 (set_attr "atype" "reg,*")
7370 (set_attr "type" "o3,*")
7371 (set_attr "length" "14,*")])
7373 (define_insn "set_tp_31"
7374 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
7379 [(set_attr "op_type" "RRE,RS")])
7381 (define_insn "*tls_load_64"
7382 [(set (match_operand:DI 0 "register_operand" "=d")
7383 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7384 (match_operand:DI 2 "" "")]
7388 [(set_attr "op_type" "RXE")])
7390 (define_insn "*tls_load_31"
7391 [(set (match_operand:SI 0 "register_operand" "=d,d")
7392 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7393 (match_operand:SI 2 "" "")]
7399 [(set_attr "op_type" "RX,RXY")])
7401 (define_insn "*bras_tls"
7402 [(set (match_operand 0 "" "")
7403 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7404 (match_operand 2 "const_int_operand" "n")))
7405 (clobber (match_operand 3 "register_operand" "=r"))
7406 (use (match_operand 4 "" ""))]
7407 "!SIBLING_CALL_P (insn)
7408 && TARGET_SMALL_EXEC
7409 && GET_MODE (operands[3]) == Pmode"
7411 [(set_attr "op_type" "RI")
7412 (set_attr "type" "jsr")])
7414 (define_insn "*brasl_tls"
7415 [(set (match_operand 0 "" "")
7416 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7417 (match_operand 2 "const_int_operand" "n")))
7418 (clobber (match_operand 3 "register_operand" "=r"))
7419 (use (match_operand 4 "" ""))]
7420 "!SIBLING_CALL_P (insn)
7422 && GET_MODE (operands[3]) == Pmode"
7424 [(set_attr "op_type" "RIL")
7425 (set_attr "type" "jsr")])
7427 (define_insn "*basr_tls"
7428 [(set (match_operand 0 "" "")
7429 (call (mem:QI (match_operand 1 "address_operand" "U"))
7430 (match_operand 2 "const_int_operand" "n")))
7431 (clobber (match_operand 3 "register_operand" "=r"))
7432 (use (match_operand 4 "" ""))]
7433 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7435 if (get_attr_op_type (insn) == OP_TYPE_RR)
7436 return "basr\t%3,%1%J4";
7438 return "bas\t%3,%a1%J4";
7440 [(set (attr "op_type")
7441 (if_then_else (match_operand 1 "register_operand" "")
7442 (const_string "RR") (const_string "RX")))
7443 (set_attr "type" "jsr")
7444 (set_attr "atype" "agen")])
7447 ;;- Miscellaneous instructions.
7451 ; allocate stack instruction pattern(s).
7454 (define_expand "allocate_stack"
7456 (plus (reg 15) (match_operand 1 "general_operand" "")))
7457 (set (match_operand 0 "general_operand" "")
7461 rtx stack = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
7462 rtx chain = gen_rtx_MEM (Pmode, stack);
7463 rtx temp = gen_reg_rtx (Pmode);
7465 emit_move_insn (temp, chain);
7468 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7470 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7472 emit_move_insn (chain, temp);
7474 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7480 ; setjmp instruction pattern.
7483 (define_expand "builtin_setjmp_receiver"
7484 [(match_operand 0 "" "")]
7487 s390_load_got (false);
7488 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7492 ;; These patterns say how to save and restore the stack pointer. We need not
7493 ;; save the stack pointer at function level since we are careful to
7494 ;; preserve the backchain. At block level, we have to restore the backchain
7495 ;; when we restore the stack pointer.
7497 ;; For nonlocal gotos, we must save both the stack pointer and its
7498 ;; backchain and restore both. Note that in the nonlocal case, the
7499 ;; save area is a memory location.
7501 (define_expand "save_stack_function"
7502 [(match_operand 0 "general_operand" "")
7503 (match_operand 1 "general_operand" "")]
7507 (define_expand "restore_stack_function"
7508 [(match_operand 0 "general_operand" "")
7509 (match_operand 1 "general_operand" "")]
7513 (define_expand "restore_stack_block"
7514 [(use (match_operand 0 "register_operand" ""))
7515 (set (match_dup 2) (match_dup 3))
7516 (set (match_dup 0) (match_operand 1 "register_operand" ""))
7517 (set (match_dup 3) (match_dup 2))]
7520 operands[2] = gen_reg_rtx (Pmode);
7521 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7524 (define_expand "save_stack_nonlocal"
7525 [(match_operand 0 "memory_operand" "")
7526 (match_operand 1 "register_operand" "")]
7529 rtx temp = gen_reg_rtx (Pmode);
7531 /* Copy the backchain to the first word, sp to the second and the literal pool
7532 base to the third. */
7533 emit_move_insn (operand_subword (operands[0], 2, 0,
7534 TARGET_64BIT ? OImode : TImode),
7535 gen_rtx_REG (Pmode, BASE_REGISTER));
7536 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7537 emit_move_insn (operand_subword (operands[0], 0, 0,
7538 TARGET_64BIT ? OImode : TImode),
7540 emit_move_insn (operand_subword (operands[0], 1, 0,
7541 TARGET_64BIT ? OImode : TImode),
7546 (define_expand "restore_stack_nonlocal"
7547 [(match_operand 0 "register_operand" "")
7548 (match_operand 1 "memory_operand" "")]
7551 rtx temp = gen_reg_rtx (Pmode);
7552 rtx base = gen_rtx_REG (Pmode, BASE_REGISTER);
7554 /* Restore the backchain from the first word, sp from the second and the
7555 literal pool base from the third. */
7556 emit_move_insn (temp,
7557 operand_subword (operands[1], 0, 0,
7558 TARGET_64BIT ? OImode : TImode));
7559 emit_move_insn (operands[0],
7560 operand_subword (operands[1], 1, 0,
7561 TARGET_64BIT ? OImode : TImode));
7562 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7563 emit_move_insn (base,
7564 operand_subword (operands[1], 2, 0,
7565 TARGET_64BIT ? OImode : TImode));
7566 emit_insn (gen_rtx_USE (VOIDmode, base));
7573 ; nop instruction pattern(s).
7580 [(set_attr "op_type" "RR")])
7584 ; Special literal pool access instruction pattern(s).
7587 (define_insn "*pool_entry"
7588 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7589 UNSPECV_POOL_ENTRY)]
7592 enum machine_mode mode = GET_MODE (PATTERN (insn));
7593 unsigned int align = GET_MODE_BITSIZE (mode);
7594 s390_output_pool_entry (operands[0], mode, align);
7597 [(set_attr "op_type" "NN")
7598 (set (attr "length")
7599 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7601 (define_insn "pool_start_31"
7602 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7605 [(set_attr "op_type" "NN")
7606 (set_attr "length" "2")])
7608 (define_insn "pool_end_31"
7609 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7612 [(set_attr "op_type" "NN")
7613 (set_attr "length" "2")])
7615 (define_insn "pool_start_64"
7616 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7618 ".section\t.rodata\;.align\t8"
7619 [(set_attr "op_type" "NN")
7620 (set_attr "length" "0")])
7622 (define_insn "pool_end_64"
7623 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7626 [(set_attr "op_type" "NN")
7627 (set_attr "length" "0")])
7629 (define_insn "main_base_31_small"
7630 [(set (match_operand 0 "register_operand" "=a")
7631 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7632 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7634 [(set_attr "op_type" "RR")
7635 (set_attr "type" "la")])
7637 (define_insn "main_base_31_large"
7638 [(set (match_operand 0 "register_operand" "=a")
7639 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7640 (set (pc) (label_ref (match_operand 2 "" "")))]
7641 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7643 [(set_attr "op_type" "RI")])
7645 (define_insn "main_base_64"
7646 [(set (match_operand 0 "register_operand" "=a")
7647 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7648 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7650 [(set_attr "op_type" "RIL")
7651 (set_attr "type" "larl")])
7653 (define_insn "main_pool"
7654 [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)]
7657 [(set_attr "op_type" "NN")])
7659 (define_insn "reload_base_31"
7660 [(set (match_operand 0 "register_operand" "=a")
7661 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7662 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7663 "basr\t%0,0\;la\t%0,%1-.(%0)"
7664 [(set_attr "op_type" "NN")
7665 (set_attr "type" "la")
7666 (set_attr "length" "6")])
7668 (define_insn "reload_base_64"
7669 [(set (match_operand 0 "register_operand" "=a")
7670 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7671 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7673 [(set_attr "op_type" "RIL")
7674 (set_attr "type" "larl")])
7677 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7680 [(set_attr "op_type" "NN")
7681 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7684 ;; Insns related to generating the function prologue and epilogue.
7688 (define_expand "prologue"
7689 [(use (const_int 0))]
7691 "s390_emit_prologue (); DONE;")
7693 (define_insn "prologue_tpf"
7694 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7695 (clobber (reg:DI 1))]
7696 "TARGET_TPF_PROFILING"
7698 [(set_attr "type" "jsr")
7699 (set_attr "op_type" "RX")])
7701 (define_expand "epilogue"
7702 [(use (const_int 1))]
7704 "s390_emit_epilogue (false); DONE;")
7706 (define_insn "epilogue_tpf"
7707 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7708 (clobber (reg:DI 1))]
7709 "TARGET_TPF_PROFILING"
7711 [(set_attr "type" "jsr")
7712 (set_attr "op_type" "RX")])
7715 (define_expand "sibcall_epilogue"
7716 [(use (const_int 0))]
7718 "s390_emit_epilogue (true); DONE;")
7720 (define_insn "*return"
7722 (use (match_operand 0 "register_operand" "a"))]
7723 "GET_MODE (operands[0]) == Pmode"
7725 [(set_attr "op_type" "RR")
7726 (set_attr "type" "jsr")
7727 (set_attr "atype" "agen")])
7730 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7731 ;; pointer. This is used for compatibility.
7733 (define_expand "ptr_extend"
7734 [(set (match_operand:DI 0 "register_operand" "=r")
7735 (match_operand:SI 1 "register_operand" "r"))]
7738 emit_insn (gen_anddi3 (operands[0],
7739 gen_lowpart (DImode, operands[1]),
7740 GEN_INT (0x7fffffff)));