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)
97 ; TLS relocation specifiers
102 (UNSPEC_GOTNTPOFF 504)
103 (UNSPEC_INDNTPOFF 505)
107 (UNSPEC_TLSLDM_NTPOFF 511)
108 (UNSPEC_TLS_LOAD 512)
115 ;; UNSPEC_VOLATILE usage
123 (UNSPECV_TPF_PROLOGUE 20)
124 (UNSPECV_TPF_EPILOGUE 21)
128 (UNSPECV_POOL_START 201)
129 (UNSPECV_POOL_END 202)
130 (UNSPECV_POOL_ENTRY 203)
131 (UNSPECV_MAIN_POOL 300)
138 ;; Processor type. This attribute must exactly match the processor_type
139 ;; enumeration in s390.h. The current machine description does not
140 ;; distinguish between g5 and g6, but there are differences between the two
141 ;; CPUs could in theory be modeled.
143 (define_attr "cpu" "g5,g6,z900,z990"
144 (const (symbol_ref "s390_tune")))
146 ;; Define an insn type attribute. This is used in function unit delay
149 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
150 cs,vs,store,imul,idiv,
151 branch,jsr,fsimpd,fsimps,
152 floadd,floads,fstored, fstores,
153 fmuld,fmuls,fdivd,fdivs,
154 ftoi,itof,fsqrtd,fsqrts,
156 (const_string "integer"))
158 ;; Operand type. Used to default length attribute values
160 (define_attr "op_type"
161 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
164 ;; Insn are devide in two classes:
165 ;; agen: Insn using agen
166 ;; reg: Insn not using agen
168 (define_attr "atype" "agen,reg"
169 (cond [ (eq_attr "op_type" "E") (const_string "reg")
170 (eq_attr "op_type" "RR") (const_string "reg")
171 (eq_attr "op_type" "RX") (const_string "agen")
172 (eq_attr "op_type" "RI") (const_string "reg")
173 (eq_attr "op_type" "RRE") (const_string "reg")
174 (eq_attr "op_type" "RS") (const_string "agen")
175 (eq_attr "op_type" "RSI") (const_string "agen")
176 (eq_attr "op_type" "S") (const_string "agen")
177 (eq_attr "op_type" "SI") (const_string "agen")
178 (eq_attr "op_type" "SS") (const_string "agen")
179 (eq_attr "op_type" "SSE") (const_string "agen")
180 (eq_attr "op_type" "RXE") (const_string "agen")
181 (eq_attr "op_type" "RSE") (const_string "agen")
182 (eq_attr "op_type" "RIL") (const_string "agen")
183 (eq_attr "op_type" "RXY") (const_string "agen")
184 (eq_attr "op_type" "RSY") (const_string "agen")
185 (eq_attr "op_type" "SIY") (const_string "agen")]
186 (const_string "reg")))
188 ;; Pipeline description for z900. For lack of anything better,
189 ;; this description is also used for the g5 and g6.
192 ;; Pipeline description for z990.
197 (define_attr "length" ""
198 (cond [ (eq_attr "op_type" "E") (const_int 2)
199 (eq_attr "op_type" "RR") (const_int 2)
200 (eq_attr "op_type" "RX") (const_int 4)
201 (eq_attr "op_type" "RI") (const_int 4)
202 (eq_attr "op_type" "RRE") (const_int 4)
203 (eq_attr "op_type" "RS") (const_int 4)
204 (eq_attr "op_type" "RSI") (const_int 4)
205 (eq_attr "op_type" "S") (const_int 4)
206 (eq_attr "op_type" "SI") (const_int 4)
207 (eq_attr "op_type" "SS") (const_int 6)
208 (eq_attr "op_type" "SSE") (const_int 6)
209 (eq_attr "op_type" "RXE") (const_int 6)
210 (eq_attr "op_type" "RSE") (const_int 6)
211 (eq_attr "op_type" "RIL") (const_int 6)
212 (eq_attr "op_type" "RXY") (const_int 6)
213 (eq_attr "op_type" "RSY") (const_int 6)
214 (eq_attr "op_type" "SIY") (const_int 6)]
217 ;; Define attributes for `asm' insns.
219 (define_asm_attributes [(set_attr "type" "other")
220 (set_attr "op_type" "NN")])
226 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
227 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
228 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
229 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
230 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
233 ; CCZ1 -> CCA/CCU/CCS/CCT
236 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
237 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
241 ;;- Compare instructions.
244 (define_expand "cmpdi"
246 (compare:CC (match_operand:DI 0 "register_operand" "")
247 (match_operand:DI 1 "general_operand" "")))]
250 s390_compare_op0 = operands[0];
251 s390_compare_op1 = operands[1];
255 (define_expand "cmpsi"
257 (compare:CC (match_operand:SI 0 "register_operand" "")
258 (match_operand:SI 1 "general_operand" "")))]
261 s390_compare_op0 = operands[0];
262 s390_compare_op1 = operands[1];
266 (define_expand "cmpdf"
268 (compare:CC (match_operand:DF 0 "register_operand" "")
269 (match_operand:DF 1 "general_operand" "")))]
272 s390_compare_op0 = operands[0];
273 s390_compare_op1 = operands[1];
277 (define_expand "cmpsf"
279 (compare:CC (match_operand:SF 0 "register_operand" "")
280 (match_operand:SF 1 "general_operand" "")))]
283 s390_compare_op0 = operands[0];
284 s390_compare_op1 = operands[1];
289 ; Test-under-Mask (zero_extract) instructions
291 (define_insn "*tmdi_ext"
293 (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
294 (match_operand:DI 1 "const_int_operand" "n")
295 (match_operand:DI 2 "const_int_operand" "n"))
297 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
298 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
299 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 64
300 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
301 == INTVAL (operands[2]) >> 4"
303 int part = INTVAL (operands[2]) >> 4;
304 int block = (1 << INTVAL (operands[1])) - 1;
305 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
307 operands[2] = GEN_INT (block << shift);
311 case 0: return "tmhh\t%0,%x2";
312 case 1: return "tmhl\t%0,%x2";
313 case 2: return "tmlh\t%0,%x2";
314 case 3: return "tmll\t%0,%x2";
318 [(set_attr "op_type" "RI")])
320 (define_insn "*tmsi_ext"
322 (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
323 (match_operand:SI 1 "const_int_operand" "n")
324 (match_operand:SI 2 "const_int_operand" "n"))
326 "s390_match_ccmode(insn, CCTmode)
327 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
328 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
329 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
330 == INTVAL (operands[2]) >> 4"
332 int part = INTVAL (operands[2]) >> 4;
333 int block = (1 << INTVAL (operands[1])) - 1;
334 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
336 operands[2] = GEN_INT (block << shift);
340 case 0: return "tmh\t%0,%x2";
341 case 1: return "tml\t%0,%x2";
345 [(set_attr "op_type" "RI")])
347 (define_insn "*tmqisi_ext"
349 (compare (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,S")
350 (match_operand:SI 1 "const_int_operand" "n,n")
351 (match_operand:SI 2 "const_int_operand" "n,n"))
353 "!TARGET_64BIT && s390_match_ccmode(insn, CCTmode)
354 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
355 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
357 int block = (1 << INTVAL (operands[1])) - 1;
358 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
360 operands[2] = GEN_INT (block << shift);
361 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
363 [(set_attr "op_type" "SI,SIY")])
365 (define_insn "*tmqidi_ext"
367 (compare (zero_extract:DI (match_operand:QI 0 "memory_operand" "Q,S")
368 (match_operand:SI 1 "const_int_operand" "n,n")
369 (match_operand:SI 2 "const_int_operand" "n,n"))
371 "TARGET_64BIT && s390_match_ccmode(insn, CCTmode)
372 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
373 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
375 int block = (1 << INTVAL (operands[1])) - 1;
376 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
378 operands[2] = GEN_INT (block << shift);
379 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
381 [(set_attr "op_type" "SI,SIY")])
384 ; Test-under-Mask instructions
386 (define_insn "*tmdi_mem"
388 (compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S")
389 (match_operand:DI 1 "immediate_operand" "n,n"))
390 (match_operand:DI 2 "immediate_operand" "n,n")))]
391 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
392 && s390_single_part (operands[1], DImode, QImode, 0) >= 0"
394 int part = s390_single_part (operands[1], DImode, QImode, 0);
395 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
397 operands[0] = gen_rtx_MEM (QImode,
398 plus_constant (XEXP (operands[0], 0), part));
399 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
401 [(set_attr "op_type" "SI,SIY")])
403 (define_insn "*tmsi_mem"
405 (compare (and:SI (match_operand:SI 0 "memory_operand" "Q,S")
406 (match_operand:SI 1 "immediate_operand" "n,n"))
407 (match_operand:SI 2 "immediate_operand" "n,n")))]
408 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
409 && s390_single_part (operands[1], SImode, QImode, 0) >= 0"
411 int part = s390_single_part (operands[1], SImode, QImode, 0);
412 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
414 operands[0] = gen_rtx_MEM (QImode,
415 plus_constant (XEXP (operands[0], 0), part));
416 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
418 [(set_attr "op_type" "SI")])
420 (define_insn "*tmhi_mem"
422 (compare (and:SI (subreg:SI (match_operand:HI 0 "memory_operand" "Q,S") 0)
423 (match_operand:SI 1 "immediate_operand" "n,n"))
424 (match_operand:SI 2 "immediate_operand" "n,n")))]
425 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
426 && s390_single_part (operands[1], HImode, QImode, 0) >= 0"
428 int part = s390_single_part (operands[1], HImode, QImode, 0);
429 operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
431 operands[0] = gen_rtx_MEM (QImode,
432 plus_constant (XEXP (operands[0], 0), part));
433 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
435 [(set_attr "op_type" "SI")])
437 (define_insn "*tmqi_mem"
439 (compare (and:SI (subreg:SI (match_operand:QI 0 "memory_operand" "Q,S") 0)
440 (match_operand:SI 1 "immediate_operand" "n,n"))
441 (match_operand:SI 2 "immediate_operand" "n,n")))]
442 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
446 [(set_attr "op_type" "SI,SIY")])
448 (define_insn "*tmdi_reg"
450 (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d")
451 (match_operand:DI 1 "immediate_operand"
452 "N0HD0,N1HD0,N2HD0,N3HD0"))
453 (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
455 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
456 && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
462 [(set_attr "op_type" "RI")])
464 (define_insn "*tmsi_reg"
466 (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
467 (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
468 (match_operand:SI 2 "immediate_operand" "n,n")))]
469 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
470 && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
474 [(set_attr "op_type" "RI")])
476 (define_insn "*tmhi_full"
478 (compare (match_operand:HI 0 "register_operand" "d")
479 (match_operand:HI 1 "immediate_operand" "n")))]
480 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
482 [(set_attr "op_type" "RX")])
484 (define_insn "*tmqi_full"
486 (compare (match_operand:QI 0 "register_operand" "d")
487 (match_operand:QI 1 "immediate_operand" "n")))]
488 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
490 [(set_attr "op_type" "RI")])
493 ; Load-and-Test instructions
495 (define_insn "*tstdi_sign"
497 (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
498 (const_int 32)) (const_int 32))
499 (match_operand:DI 1 "const0_operand" "")))
500 (set (match_operand:DI 2 "register_operand" "=d")
501 (sign_extend:DI (match_dup 0)))]
502 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
504 [(set_attr "op_type" "RRE")])
506 (define_insn "*tstdi"
508 (compare (match_operand:DI 0 "register_operand" "d")
509 (match_operand:DI 1 "const0_operand" "")))
510 (set (match_operand:DI 2 "register_operand" "=d")
512 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
514 [(set_attr "op_type" "RRE")])
516 (define_insn "*tstdi_cconly"
518 (compare (match_operand:DI 0 "register_operand" "d")
519 (match_operand:DI 1 "const0_operand" "")))]
520 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
522 [(set_attr "op_type" "RRE")])
524 (define_insn "*tstdi_cconly_31"
526 (compare (match_operand:DI 0 "register_operand" "d")
527 (match_operand:DI 1 "const0_operand" "")))]
528 "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
530 [(set_attr "op_type" "RS")
531 (set_attr "atype" "reg")])
534 (define_insn "*tstsi"
536 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
537 (match_operand:SI 1 "const0_operand" "")))
538 (set (match_operand:SI 2 "register_operand" "=d,d,d")
540 "s390_match_ccmode(insn, CCSmode)"
545 [(set_attr "op_type" "RR,RS,RSY")])
547 (define_insn "*tstsi_cconly"
549 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
550 (match_operand:SI 1 "const0_operand" "")))
551 (clobber (match_scratch:SI 2 "=X,d,d"))]
552 "s390_match_ccmode(insn, CCSmode)"
557 [(set_attr "op_type" "RR,RS,RSY")])
559 (define_insn "*tstsi_cconly2"
561 (compare (match_operand:SI 0 "register_operand" "d")
562 (match_operand:SI 1 "const0_operand" "")))]
563 "s390_match_ccmode(insn, CCSmode)"
565 [(set_attr "op_type" "RR")])
567 (define_insn "*tsthiCCT"
569 (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d")
570 (match_operand:HI 1 "const0_operand" "")))
571 (set (match_operand:HI 2 "register_operand" "=d,d,0")
573 "s390_match_ccmode(insn, CCTmode)"
578 [(set_attr "op_type" "RS,RSY,RI")])
580 (define_insn "*tsthiCCT_cconly"
582 (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d")
583 (match_operand:HI 1 "const0_operand" "")))
584 (clobber (match_scratch:HI 2 "=d,d,X"))]
585 "s390_match_ccmode(insn, CCTmode)"
590 [(set_attr "op_type" "RS,RSY,RI")])
592 (define_insn "*tsthi"
594 (compare (match_operand:HI 0 "s_operand" "Q,S")
595 (match_operand:HI 1 "const0_operand" "")))
596 (set (match_operand:HI 2 "register_operand" "=d,d")
598 "s390_match_ccmode(insn, CCSmode)"
602 [(set_attr "op_type" "RS,RSY")])
604 (define_insn "*tsthi_cconly"
606 (compare (match_operand:HI 0 "s_operand" "Q,S")
607 (match_operand:HI 1 "const0_operand" "")))
608 (clobber (match_scratch:HI 2 "=d,d"))]
609 "s390_match_ccmode(insn, CCSmode)"
613 [(set_attr "op_type" "RS,RSY")])
615 (define_insn "*tstqiCCT"
617 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
618 (match_operand:QI 1 "const0_operand" "")))
619 (set (match_operand:QI 2 "register_operand" "=d,d,0")
621 "s390_match_ccmode(insn, CCTmode)"
626 [(set_attr "op_type" "RS,RSY,RI")])
628 (define_insn "*tstqiCCT_cconly"
630 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
631 (match_operand:QI 1 "const0_operand" "")))]
632 "s390_match_ccmode(insn, CCTmode)"
637 [(set_attr "op_type" "SI,SIY,RI")])
639 (define_insn "*tstqi"
641 (compare (match_operand:QI 0 "s_operand" "Q,S")
642 (match_operand:QI 1 "const0_operand" "")))
643 (set (match_operand:QI 2 "register_operand" "=d,d")
645 "s390_match_ccmode(insn, CCSmode)"
649 [(set_attr "op_type" "RS,RSY")])
651 (define_insn "*tstqi_cconly"
653 (compare (match_operand:QI 0 "s_operand" "Q,S")
654 (match_operand:QI 1 "const0_operand" "")))
655 (clobber (match_scratch:QI 2 "=d,d"))]
656 "s390_match_ccmode(insn, CCSmode)"
660 [(set_attr "op_type" "RS,RSY")])
663 ; Compare (signed) instructions
665 (define_insn "*cmpdi_ccs_sign"
667 (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
668 (match_operand:DI 0 "register_operand" "d,d")))]
669 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
673 [(set_attr "op_type" "RRE,RXY")])
675 (define_insn "*cmpdi_ccs"
677 (compare (match_operand:DI 0 "register_operand" "d,d,d")
678 (match_operand:DI 1 "general_operand" "d,K,m")))]
679 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
684 [(set_attr "op_type" "RRE,RI,RXY")])
686 (define_insn "*cmpsi_ccs_sign"
688 (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
689 (match_operand:SI 0 "register_operand" "d,d")))]
690 "s390_match_ccmode(insn, CCSRmode)"
694 [(set_attr "op_type" "RX,RXY")])
696 (define_insn "*cmpsi_ccs"
698 (compare (match_operand:SI 0 "register_operand" "d,d,d,d")
699 (match_operand:SI 1 "general_operand" "d,K,R,T")))]
700 "s390_match_ccmode(insn, CCSmode)"
706 [(set_attr "op_type" "RR,RI,RX,RXY")])
709 ; Compare (unsigned) instructions
711 (define_insn "*cmpdi_ccu_zero"
713 (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
714 (match_operand:DI 0 "register_operand" "d,d")))]
715 "s390_match_ccmode(insn, CCURmode) && TARGET_64BIT"
719 [(set_attr "op_type" "RRE,RXY")])
721 (define_insn "*cmpdi_ccu"
723 (compare (match_operand:DI 0 "register_operand" "d,d")
724 (match_operand:DI 1 "general_operand" "d,m")))]
725 "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
729 [(set_attr "op_type" "RRE,RXY")])
731 (define_insn "*cmpsi_ccu"
733 (compare (match_operand:SI 0 "register_operand" "d,d,d")
734 (match_operand:SI 1 "general_operand" "d,R,T")))]
735 "s390_match_ccmode(insn, CCUmode)"
740 [(set_attr "op_type" "RR,RX,RXY")])
742 (define_insn "*cmphi_ccu"
744 (compare (match_operand:HI 0 "register_operand" "d,d")
745 (match_operand:HI 1 "s_imm_operand" "Q,S")))]
746 "s390_match_ccmode(insn, CCUmode)"
750 [(set_attr "op_type" "RS,RSY")])
752 (define_insn "*cmpqi_ccu"
754 (compare (match_operand:QI 0 "register_operand" "d,d")
755 (match_operand:QI 1 "s_imm_operand" "Q,S")))]
756 "s390_match_ccmode(insn, CCUmode)"
760 [(set_attr "op_type" "RS,RSY")])
764 (compare (match_operand:QI 0 "memory_operand" "Q,S")
765 (match_operand:QI 1 "immediate_operand" "n,n")))]
766 "s390_match_ccmode (insn, CCUmode)"
770 [(set_attr "op_type" "SI,SIY")])
772 (define_insn "*cmpdi_ccu_mem"
774 (compare (match_operand:DI 0 "s_operand" "Q")
775 (match_operand:DI 1 "s_imm_operand" "Q")))]
776 "s390_match_ccmode(insn, CCUmode)"
778 [(set_attr "op_type" "SS")])
780 (define_insn "*cmpsi_ccu_mem"
782 (compare (match_operand:SI 0 "s_operand" "Q")
783 (match_operand:SI 1 "s_imm_operand" "Q")))]
784 "s390_match_ccmode(insn, CCUmode)"
786 [(set_attr "op_type" "SS")])
788 (define_insn "*cmphi_ccu_mem"
790 (compare (match_operand:HI 0 "s_operand" "Q")
791 (match_operand:HI 1 "s_imm_operand" "Q")))]
792 "s390_match_ccmode(insn, CCUmode)"
794 [(set_attr "op_type" "SS")])
796 (define_insn "*cmpqi_ccu_mem"
798 (compare (match_operand:QI 0 "s_operand" "Q")
799 (match_operand:QI 1 "s_imm_operand" "Q")))]
800 "s390_match_ccmode(insn, CCUmode)"
802 [(set_attr "op_type" "SS")])
807 (define_insn "*cmpdf_ccs_0"
809 (compare (match_operand:DF 0 "register_operand" "f")
810 (match_operand:DF 1 "const0_operand" "")))]
811 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
813 [(set_attr "op_type" "RRE")
814 (set_attr "type" "fsimpd")])
816 (define_insn "*cmpdf_ccs_0_ibm"
818 (compare (match_operand:DF 0 "register_operand" "f")
819 (match_operand:DF 1 "const0_operand" "")))]
820 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
822 [(set_attr "op_type" "RR")
823 (set_attr "type" "fsimpd")])
825 (define_insn "*cmpdf_ccs"
827 (compare (match_operand:DF 0 "register_operand" "f,f")
828 (match_operand:DF 1 "general_operand" "f,R")))]
829 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
833 [(set_attr "op_type" "RRE,RXE")
834 (set_attr "type" "fsimpd")])
836 (define_insn "*cmpdf_ccs_ibm"
838 (compare (match_operand:DF 0 "register_operand" "f,f")
839 (match_operand:DF 1 "general_operand" "f,R")))]
840 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
844 [(set_attr "op_type" "RR,RX")
845 (set_attr "type" "fsimpd")])
850 (define_insn "*cmpsf_ccs_0"
852 (compare (match_operand:SF 0 "register_operand" "f")
853 (match_operand:SF 1 "const0_operand" "")))]
854 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
856 [(set_attr "op_type" "RRE")
857 (set_attr "type" "fsimps")])
859 (define_insn "*cmpsf_ccs_0_ibm"
861 (compare (match_operand:SF 0 "register_operand" "f")
862 (match_operand:SF 1 "const0_operand" "")))]
863 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
865 [(set_attr "op_type" "RR")
866 (set_attr "type" "fsimps")])
868 (define_insn "*cmpsf_ccs"
870 (compare (match_operand:SF 0 "register_operand" "f,f")
871 (match_operand:SF 1 "general_operand" "f,R")))]
872 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
876 [(set_attr "op_type" "RRE,RXE")
877 (set_attr "type" "fsimps")])
879 (define_insn "*cmpsf_ccs"
881 (compare (match_operand:SF 0 "register_operand" "f,f")
882 (match_operand:SF 1 "general_operand" "f,R")))]
883 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
887 [(set_attr "op_type" "RR,RX")
888 (set_attr "type" "fsimps")])
892 ;;- Move instructions.
896 ; movti instruction pattern(s).
900 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
901 (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
909 [(set_attr "op_type" "RSY,RSY,NN,NN,SS")
910 (set_attr "type" "lm,stm,*,*,cs")])
913 [(set (match_operand:TI 0 "nonimmediate_operand" "")
914 (match_operand:TI 1 "general_operand" ""))]
915 "TARGET_64BIT && reload_completed
916 && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
917 [(set (match_dup 2) (match_dup 4))
918 (set (match_dup 3) (match_dup 5))]
920 operands[2] = operand_subword (operands[0], 0, 0, TImode);
921 operands[3] = operand_subword (operands[0], 1, 0, TImode);
922 operands[4] = operand_subword (operands[1], 0, 0, TImode);
923 operands[5] = operand_subword (operands[1], 1, 0, TImode);
927 [(set (match_operand:TI 0 "nonimmediate_operand" "")
928 (match_operand:TI 1 "general_operand" ""))]
929 "TARGET_64BIT && reload_completed
930 && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
931 [(set (match_dup 2) (match_dup 4))
932 (set (match_dup 3) (match_dup 5))]
934 operands[2] = operand_subword (operands[0], 1, 0, TImode);
935 operands[3] = operand_subword (operands[0], 0, 0, TImode);
936 operands[4] = operand_subword (operands[1], 1, 0, TImode);
937 operands[5] = operand_subword (operands[1], 0, 0, TImode);
941 [(set (match_operand:TI 0 "register_operand" "")
942 (match_operand:TI 1 "memory_operand" ""))]
943 "TARGET_64BIT && reload_completed
944 && !s_operand (operands[1], VOIDmode)"
945 [(set (match_dup 0) (match_dup 1))]
947 rtx addr = operand_subword (operands[0], 1, 0, TImode);
948 s390_load_address (addr, XEXP (operands[1], 0));
949 operands[1] = replace_equiv_address (operands[1], addr);
952 (define_expand "reload_outti"
953 [(parallel [(match_operand:TI 0 "memory_operand" "")
954 (match_operand:TI 1 "register_operand" "d")
955 (match_operand:DI 2 "register_operand" "=&a")])]
958 s390_load_address (operands[2], XEXP (operands[0], 0));
959 operands[0] = replace_equiv_address (operands[0], operands[2]);
960 emit_move_insn (operands[0], operands[1]);
965 ; movdi instruction pattern(s).
968 (define_expand "movdi"
969 [(set (match_operand:DI 0 "general_operand" "")
970 (match_operand:DI 1 "general_operand" ""))]
973 /* Handle symbolic constants. */
974 if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
975 emit_symbolic_move (operands);
977 /* During and after reload, we need to force constants
978 to the literal pool ourselves, if necessary. */
979 if ((reload_in_progress || reload_completed)
980 && CONSTANT_P (operands[1])
981 && (!legitimate_reload_constant_p (operands[1])
982 || FP_REG_P (operands[0])))
983 operands[1] = force_const_mem (DImode, operands[1]);
986 (define_insn "*movdi_larl"
987 [(set (match_operand:DI 0 "register_operand" "=d")
988 (match_operand:DI 1 "larl_operand" "X"))]
990 && !FP_REG_P (operands[0])"
992 [(set_attr "op_type" "RIL")
993 (set_attr "type" "larl")])
995 (define_insn "*movdi_64"
996 [(set (match_operand:DI 0 "nonimmediate_operand"
997 "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q")
998 (match_operand:DI 1 "general_operand"
999 "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))]
1017 [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
1018 (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd,
1019 fstored,fstored,cs")])
1021 (define_insn "*movdi_31"
1022 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
1023 (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
1036 [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS")
1037 (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")])
1040 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1041 (match_operand:DI 1 "general_operand" ""))]
1042 "!TARGET_64BIT && reload_completed
1043 && s390_split_ok_p (operands[0], operands[1], DImode, 0)"
1044 [(set (match_dup 2) (match_dup 4))
1045 (set (match_dup 3) (match_dup 5))]
1047 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1048 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1049 operands[4] = operand_subword (operands[1], 0, 0, DImode);
1050 operands[5] = operand_subword (operands[1], 1, 0, DImode);
1054 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1055 (match_operand:DI 1 "general_operand" ""))]
1056 "!TARGET_64BIT && reload_completed
1057 && s390_split_ok_p (operands[0], operands[1], DImode, 1)"
1058 [(set (match_dup 2) (match_dup 4))
1059 (set (match_dup 3) (match_dup 5))]
1061 operands[2] = operand_subword (operands[0], 1, 0, DImode);
1062 operands[3] = operand_subword (operands[0], 0, 0, DImode);
1063 operands[4] = operand_subword (operands[1], 1, 0, DImode);
1064 operands[5] = operand_subword (operands[1], 0, 0, DImode);
1068 [(set (match_operand:DI 0 "register_operand" "")
1069 (match_operand:DI 1 "memory_operand" ""))]
1070 "!TARGET_64BIT && reload_completed
1071 && !FP_REG_P (operands[0])
1072 && !s_operand (operands[1], VOIDmode)"
1073 [(set (match_dup 0) (match_dup 1))]
1075 rtx addr = operand_subword (operands[0], 1, 0, DImode);
1076 s390_load_address (addr, XEXP (operands[1], 0));
1077 operands[1] = replace_equiv_address (operands[1], addr);
1080 (define_expand "reload_outdi"
1081 [(parallel [(match_operand:DI 0 "memory_operand" "")
1082 (match_operand:DI 1 "register_operand" "d")
1083 (match_operand:SI 2 "register_operand" "=&a")])]
1086 s390_load_address (operands[2], XEXP (operands[0], 0));
1087 operands[0] = replace_equiv_address (operands[0], operands[2]);
1088 emit_move_insn (operands[0], operands[1]);
1093 [(set (match_operand:DI 0 "register_operand" "")
1094 (mem:DI (match_operand 1 "address_operand" "")))]
1096 && !FP_REG_P (operands[0])
1097 && GET_CODE (operands[1]) == SYMBOL_REF
1098 && CONSTANT_POOL_ADDRESS_P (operands[1])
1099 && get_pool_mode (operands[1]) == DImode
1100 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1101 [(set (match_dup 0) (match_dup 2))]
1102 "operands[2] = get_pool_constant (operands[1]);")
1104 (define_insn "*la_64"
1105 [(set (match_operand:DI 0 "register_operand" "=d,d")
1106 (match_operand:QI 1 "address_operand" "U,W"))]
1111 [(set_attr "op_type" "RX,RXY")
1112 (set_attr "type" "la")])
1116 [(set (match_operand:DI 0 "register_operand" "")
1117 (match_operand:QI 1 "address_operand" ""))
1118 (clobber (reg:CC 33))])]
1120 && strict_memory_address_p (VOIDmode, operands[1])
1121 && preferred_la_operand_p (operands[1])"
1122 [(set (match_dup 0) (match_dup 1))]
1126 [(set (match_operand:DI 0 "register_operand" "")
1127 (match_operand:DI 1 "register_operand" ""))
1130 (plus:DI (match_dup 0)
1131 (match_operand:DI 2 "nonmemory_operand" "")))
1132 (clobber (reg:CC 33))])]
1134 && !reg_overlap_mentioned_p (operands[0], operands[2])
1135 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2]))
1136 && preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))"
1137 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
1140 (define_expand "reload_indi"
1141 [(parallel [(match_operand:DI 0 "register_operand" "=a")
1142 (match_operand:DI 1 "s390_plus_operand" "")
1143 (match_operand:DI 2 "register_operand" "=&a")])]
1146 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1151 ; movsi instruction pattern(s).
1154 (define_expand "movsi"
1155 [(set (match_operand:SI 0 "general_operand" "")
1156 (match_operand:SI 1 "general_operand" ""))]
1159 /* Handle symbolic constants. */
1160 if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1161 emit_symbolic_move (operands);
1163 /* expr.c tries to load an effective address using
1164 force_reg. This fails because we don't have a
1165 generic load_address pattern. Convert the move
1166 to a proper arithmetic operation instead, unless
1167 it is guaranteed to be OK. */
1168 if (GET_CODE (operands[1]) == PLUS
1169 && !legitimate_la_operand_p (operands[1]))
1171 operands[1] = force_operand (operands[1], operands[0]);
1172 if (operands[1] == operands[0])
1176 /* During and after reload, we need to force constants
1177 to the literal pool ourselves, if necessary. */
1178 if ((reload_in_progress || reload_completed)
1179 && CONSTANT_P (operands[1])
1180 && (!legitimate_reload_constant_p (operands[1])
1181 || FP_REG_P (operands[0])))
1182 operands[1] = force_const_mem (SImode, operands[1]);
1185 (define_insn "*movsi_larl"
1186 [(set (match_operand:SI 0 "register_operand" "=d")
1187 (match_operand:SI 1 "larl_operand" "X"))]
1188 "!TARGET_64BIT && TARGET_CPU_ZARCH
1189 && !FP_REG_P (operands[0])"
1191 [(set_attr "op_type" "RIL")
1192 (set_attr "type" "larl")])
1194 (define_insn "*movsi_zarch"
1195 [(set (match_operand:SI 0 "nonimmediate_operand"
1196 "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
1197 (match_operand:SI 1 "general_operand"
1198 "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
1216 [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1217 (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
1219 (define_insn "*movsi_esa"
1220 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q")
1221 (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))]
1232 [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS")
1233 (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")])
1236 [(set (match_operand:SI 0 "register_operand" "")
1237 (mem:SI (match_operand 1 "address_operand" "")))]
1238 "!FP_REG_P (operands[0])
1239 && GET_CODE (operands[1]) == SYMBOL_REF
1240 && CONSTANT_POOL_ADDRESS_P (operands[1])
1241 && get_pool_mode (operands[1]) == SImode
1242 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1243 [(set (match_dup 0) (match_dup 2))]
1244 "operands[2] = get_pool_constant (operands[1]);")
1246 (define_insn "*la_31"
1247 [(set (match_operand:SI 0 "register_operand" "=d,d")
1248 (match_operand:QI 1 "address_operand" "U,W"))]
1249 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
1253 [(set_attr "op_type" "RX,RXY")
1254 (set_attr "type" "la")])
1258 [(set (match_operand:SI 0 "register_operand" "")
1259 (match_operand:QI 1 "address_operand" ""))
1260 (clobber (reg:CC 33))])]
1262 && strict_memory_address_p (VOIDmode, operands[1])
1263 && preferred_la_operand_p (operands[1])"
1264 [(set (match_dup 0) (match_dup 1))]
1268 [(set (match_operand:SI 0 "register_operand" "")
1269 (match_operand:SI 1 "register_operand" ""))
1272 (plus:SI (match_dup 0)
1273 (match_operand:SI 2 "nonmemory_operand" "")))
1274 (clobber (reg:CC 33))])]
1276 && !reg_overlap_mentioned_p (operands[0], operands[2])
1277 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2]))
1278 && preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))"
1279 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
1282 (define_insn "*la_31_and"
1283 [(set (match_operand:SI 0 "register_operand" "=d,d")
1284 (and:SI (match_operand:QI 1 "address_operand" "U,W")
1285 (const_int 2147483647)))]
1290 [(set_attr "op_type" "RX,RXY")
1291 (set_attr "type" "la")])
1293 (define_insn_and_split "*la_31_and_cc"
1294 [(set (match_operand:SI 0 "register_operand" "=d")
1295 (and:SI (match_operand:QI 1 "address_operand" "p")
1296 (const_int 2147483647)))
1297 (clobber (reg:CC 33))]
1300 "&& reload_completed"
1302 (and:SI (match_dup 1) (const_int 2147483647)))]
1304 [(set_attr "op_type" "RX")
1305 (set_attr "type" "la")])
1307 (define_insn "force_la_31"
1308 [(set (match_operand:SI 0 "register_operand" "=d,d")
1309 (match_operand:QI 1 "address_operand" "U,W"))
1310 (use (const_int 0))]
1315 [(set_attr "op_type" "RX")
1316 (set_attr "type" "la")])
1318 (define_expand "reload_insi"
1319 [(parallel [(match_operand:SI 0 "register_operand" "=a")
1320 (match_operand:SI 1 "s390_plus_operand" "")
1321 (match_operand:SI 2 "register_operand" "=&a")])]
1324 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1329 ; movhi instruction pattern(s).
1332 (define_expand "movhi"
1333 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1334 (match_operand:HI 1 "general_operand" ""))]
1337 /* Make it explicit that loading a register from memory
1338 always sign-extends (at least) to SImode. */
1339 if (optimize && !no_new_pseudos
1340 && register_operand (operands[0], VOIDmode)
1341 && GET_CODE (operands[1]) == MEM
1342 && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
1344 rtx tmp = gen_reg_rtx (SImode);
1345 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1346 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1347 operands[1] = gen_lowpart (HImode, tmp);
1351 (define_insn "*movhi"
1352 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1353 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1363 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1364 (set_attr "type" "lr,*,*,*,store,store,cs")])
1367 [(set (match_operand:HI 0 "register_operand" "")
1368 (mem:HI (match_operand 1 "address_operand" "")))]
1369 "GET_CODE (operands[1]) == SYMBOL_REF
1370 && CONSTANT_POOL_ADDRESS_P (operands[1])
1371 && get_pool_mode (operands[1]) == HImode
1372 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1373 [(set (match_dup 0) (match_dup 2))]
1374 "operands[2] = get_pool_constant (operands[1]);")
1377 ; movqi instruction pattern(s).
1380 (define_expand "movqi"
1381 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1382 (match_operand:QI 1 "general_operand" ""))]
1385 /* On z/Architecture, zero-extending from memory to register
1386 is just as fast as a QImode load. */
1387 if (TARGET_ZARCH && optimize && !no_new_pseudos
1388 && register_operand (operands[0], VOIDmode)
1389 && GET_CODE (operands[1]) == MEM
1390 && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
1392 rtx tmp = gen_reg_rtx (word_mode);
1393 rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
1394 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1395 operands[1] = gen_lowpart (QImode, tmp);
1399 (define_insn "*movqi"
1400 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1401 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1413 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1414 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1417 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1418 (mem:QI (match_operand 1 "address_operand" "")))]
1419 "GET_CODE (operands[1]) == SYMBOL_REF
1420 && CONSTANT_POOL_ADDRESS_P (operands[1])
1421 && get_pool_mode (operands[1]) == QImode
1422 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1423 [(set (match_dup 0) (match_dup 2))]
1424 "operands[2] = get_pool_constant (operands[1]);")
1427 ; movstrictqi instruction pattern(s).
1430 (define_insn "*movstrictqi"
1431 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1432 (match_operand:QI 1 "memory_operand" "R,T"))]
1437 [(set_attr "op_type" "RX,RXY")])
1440 ; movstricthi instruction pattern(s).
1443 (define_insn "*movstricthi"
1444 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1445 (match_operand:HI 1 "s_imm_operand" "Q,S"))
1446 (clobber (reg:CC 33))]
1451 [(set_attr "op_type" "RS,RSY")])
1454 ; movstrictsi instruction pattern(s).
1457 (define_insn "movstrictsi"
1458 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1459 (match_operand:SI 1 "general_operand" "d,R,T"))]
1465 [(set_attr "op_type" "RR,RX,RXY")
1466 (set_attr "type" "lr,load,load")])
1469 ; movdf instruction pattern(s).
1472 (define_expand "movdf"
1473 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1474 (match_operand:DF 1 "general_operand" ""))]
1477 /* During and after reload, we need to force constants
1478 to the literal pool ourselves, if necessary. */
1479 if ((reload_in_progress || reload_completed)
1480 && CONSTANT_P (operands[1]))
1481 operands[1] = force_const_mem (DFmode, operands[1]);
1484 (define_insn "*movdf_64"
1485 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1486 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1498 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1499 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1501 (define_insn "*movdf_31"
1502 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1503 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1516 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1517 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1520 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1521 (match_operand:DF 1 "general_operand" ""))]
1522 "!TARGET_64BIT && reload_completed
1523 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1524 [(set (match_dup 2) (match_dup 4))
1525 (set (match_dup 3) (match_dup 5))]
1527 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1528 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1529 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1530 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1534 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1535 (match_operand:DF 1 "general_operand" ""))]
1536 "!TARGET_64BIT && reload_completed
1537 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1538 [(set (match_dup 2) (match_dup 4))
1539 (set (match_dup 3) (match_dup 5))]
1541 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1542 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1543 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1544 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1548 [(set (match_operand:DF 0 "register_operand" "")
1549 (match_operand:DF 1 "memory_operand" ""))]
1550 "!TARGET_64BIT && reload_completed
1551 && !FP_REG_P (operands[0])
1552 && !s_operand (operands[1], VOIDmode)"
1553 [(set (match_dup 0) (match_dup 1))]
1555 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1556 s390_load_address (addr, XEXP (operands[1], 0));
1557 operands[1] = replace_equiv_address (operands[1], addr);
1560 (define_expand "reload_outdf"
1561 [(parallel [(match_operand:DF 0 "memory_operand" "")
1562 (match_operand:DF 1 "register_operand" "d")
1563 (match_operand:SI 2 "register_operand" "=&a")])]
1566 s390_load_address (operands[2], XEXP (operands[0], 0));
1567 operands[0] = replace_equiv_address (operands[0], operands[2]);
1568 emit_move_insn (operands[0], operands[1]);
1573 ; movsf instruction pattern(s).
1576 (define_expand "movsf"
1577 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1578 (match_operand:SF 1 "general_operand" ""))]
1581 /* During and after reload, we need to force constants
1582 to the literal pool ourselves, if necessary. */
1583 if ((reload_in_progress || reload_completed)
1584 && CONSTANT_P (operands[1]))
1585 operands[1] = force_const_mem (SFmode, operands[1]);
1588 (define_insn "*movsf"
1589 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1590 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1604 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1605 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1608 ; load_multiple pattern(s).
1610 ; ??? Due to reload problems with replacing registers inside match_parallel
1611 ; we currently support load_multiple/store_multiple only after reload.
1614 (define_expand "load_multiple"
1615 [(match_par_dup 3 [(set (match_operand 0 "" "")
1616 (match_operand 1 "" ""))
1617 (use (match_operand 2 "" ""))])]
1620 enum machine_mode mode;
1626 /* Support only loading a constant number of fixed-point registers from
1627 memory and only bother with this if more than two */
1628 if (GET_CODE (operands[2]) != CONST_INT
1629 || INTVAL (operands[2]) < 2
1630 || INTVAL (operands[2]) > 16
1631 || GET_CODE (operands[1]) != MEM
1632 || GET_CODE (operands[0]) != REG
1633 || REGNO (operands[0]) >= 16)
1636 count = INTVAL (operands[2]);
1637 regno = REGNO (operands[0]);
1638 mode = GET_MODE (operands[0]);
1639 if (mode != SImode && mode != word_mode)
1642 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1645 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1647 from = XEXP (operands[1], 0);
1650 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1651 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1652 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1654 from = XEXP (XEXP (operands[1], 0), 0);
1655 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1660 if (from == frame_pointer_rtx || from == arg_pointer_rtx)
1665 from = force_reg (Pmode, XEXP (operands[1], 0));
1669 for (i = 0; i < count; i++)
1670 XVECEXP (operands[3], 0, i)
1671 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1672 change_address (operands[1], mode,
1673 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1676 (define_insn "*load_multiple_di"
1677 [(match_parallel 0 "load_multiple_operation"
1678 [(set (match_operand:DI 1 "register_operand" "=r")
1679 (match_operand:DI 2 "s_operand" "QS"))])]
1680 "reload_completed && word_mode == DImode"
1682 int words = XVECLEN (operands[0], 0);
1683 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1684 return "lmg\t%1,%0,%2";
1686 [(set_attr "op_type" "RSY")
1687 (set_attr "type" "lm")])
1689 (define_insn "*load_multiple_si"
1690 [(match_parallel 0 "load_multiple_operation"
1691 [(set (match_operand:SI 1 "register_operand" "=r,r")
1692 (match_operand:SI 2 "s_operand" "Q,S"))])]
1695 int words = XVECLEN (operands[0], 0);
1696 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1697 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1699 [(set_attr "op_type" "RS,RSY")
1700 (set_attr "type" "lm")])
1703 ; store multiple pattern(s).
1706 (define_expand "store_multiple"
1707 [(match_par_dup 3 [(set (match_operand 0 "" "")
1708 (match_operand 1 "" ""))
1709 (use (match_operand 2 "" ""))])]
1712 enum machine_mode mode;
1718 /* Support only storing a constant number of fixed-point registers to
1719 memory and only bother with this if more than two. */
1720 if (GET_CODE (operands[2]) != CONST_INT
1721 || INTVAL (operands[2]) < 2
1722 || INTVAL (operands[2]) > 16
1723 || GET_CODE (operands[0]) != MEM
1724 || GET_CODE (operands[1]) != REG
1725 || REGNO (operands[1]) >= 16)
1728 count = INTVAL (operands[2]);
1729 regno = REGNO (operands[1]);
1730 mode = GET_MODE (operands[1]);
1731 if (mode != SImode && mode != word_mode)
1734 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1738 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1740 to = XEXP (operands[0], 0);
1743 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1744 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1745 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1747 to = XEXP (XEXP (operands[0], 0), 0);
1748 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1753 if (to == frame_pointer_rtx || to == arg_pointer_rtx)
1758 to = force_reg (Pmode, XEXP (operands[0], 0));
1762 for (i = 0; i < count; i++)
1763 XVECEXP (operands[3], 0, i)
1764 = gen_rtx_SET (VOIDmode,
1765 change_address (operands[0], mode,
1766 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1767 gen_rtx_REG (mode, regno + i));
1770 (define_insn "*store_multiple_di"
1771 [(match_parallel 0 "store_multiple_operation"
1772 [(set (match_operand:DI 1 "s_operand" "=QS")
1773 (match_operand:DI 2 "register_operand" "r"))])]
1774 "reload_completed && word_mode == DImode"
1776 int words = XVECLEN (operands[0], 0);
1777 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1778 return "stmg\t%2,%0,%1";
1780 [(set_attr "op_type" "RSY")
1781 (set_attr "type" "stm")])
1784 (define_insn "*store_multiple_si"
1785 [(match_parallel 0 "store_multiple_operation"
1786 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1787 (match_operand:SI 2 "register_operand" "r,r"))])]
1790 int words = XVECLEN (operands[0], 0);
1791 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1792 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1794 [(set_attr "op_type" "RS,RSY")
1795 (set_attr "type" "stm")])
1798 ;; String instructions.
1802 ; strlenM instruction pattern(s).
1805 (define_expand "strlendi"
1806 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1809 (unspec:DI [(const_int 0)
1810 (match_operand:BLK 1 "memory_operand" "")
1812 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1813 (clobber (scratch:DI))
1814 (clobber (reg:CC 33))])
1816 [(set (match_operand:DI 0 "register_operand" "")
1817 (minus:DI (match_dup 4) (match_dup 5)))
1818 (clobber (reg:CC 33))])]
1821 operands[4] = gen_reg_rtx (DImode);
1822 operands[5] = gen_reg_rtx (DImode);
1823 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1824 operands[1] = replace_equiv_address (operands[1], operands[5]);
1827 (define_insn "*strlendi"
1828 [(set (match_operand:DI 0 "register_operand" "=a")
1829 (unspec:DI [(match_operand:DI 2 "general_operand" "0")
1830 (mem:BLK (match_operand:DI 3 "register_operand" "1"))
1832 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1833 (clobber (match_scratch:DI 1 "=a"))
1834 (clobber (reg:CC 33))]
1836 "srst\t%0,%1\;jo\t.-4"
1837 [(set_attr "op_type" "NN")
1838 (set_attr "type" "vs")
1839 (set_attr "length" "8")])
1841 (define_expand "strlensi"
1842 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1845 (unspec:SI [(const_int 0)
1846 (match_operand:BLK 1 "memory_operand" "")
1848 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1849 (clobber (scratch:SI))
1850 (clobber (reg:CC 33))])
1852 [(set (match_operand:SI 0 "register_operand" "")
1853 (minus:SI (match_dup 4) (match_dup 5)))
1854 (clobber (reg:CC 33))])]
1857 operands[4] = gen_reg_rtx (SImode);
1858 operands[5] = gen_reg_rtx (SImode);
1859 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1860 operands[1] = replace_equiv_address (operands[1], operands[5]);
1863 (define_insn "*strlensi"
1864 [(set (match_operand:SI 0 "register_operand" "=a")
1865 (unspec:SI [(match_operand:SI 2 "general_operand" "0")
1866 (mem:BLK (match_operand:SI 3 "register_operand" "1"))
1868 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1869 (clobber (match_scratch:SI 1 "=a"))
1870 (clobber (reg:CC 33))]
1872 "srst\t%0,%1\;jo\t.-4"
1873 [(set_attr "op_type" "NN")
1874 (set_attr "type" "vs")
1875 (set_attr "length" "8")])
1878 ; movstrM instruction pattern(s).
1881 (define_expand "movstrdi"
1882 [(set (match_operand:BLK 0 "memory_operand" "")
1883 (match_operand:BLK 1 "memory_operand" ""))
1884 (use (match_operand:DI 2 "general_operand" ""))
1885 (match_operand 3 "" "")]
1887 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1889 (define_expand "movstrsi"
1890 [(set (match_operand:BLK 0 "memory_operand" "")
1891 (match_operand:BLK 1 "memory_operand" ""))
1892 (use (match_operand:SI 2 "general_operand" ""))
1893 (match_operand 3 "" "")]
1895 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1897 ; Move a block that is up to 256 bytes in length.
1898 ; The block length is taken as (operands[2] % 256) + 1.
1900 (define_expand "movstr_short"
1902 [(set (match_operand:BLK 0 "memory_operand" "")
1903 (match_operand:BLK 1 "memory_operand" ""))
1904 (use (match_operand 2 "nonmemory_operand" ""))
1905 (clobber (match_dup 3))])]
1907 "operands[3] = gen_rtx_SCRATCH (Pmode);")
1909 (define_insn "*movstr_short"
1910 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1911 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1912 (use (match_operand 2 "nonmemory_operand" "n,a"))
1913 (clobber (match_scratch 3 "=X,&a"))]
1914 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
1915 && GET_MODE (operands[3]) == Pmode"
1917 switch (which_alternative)
1920 return "mvc\t%O0(%b2+1,%R0),%1";
1923 output_asm_insn ("bras\t%3,.+10", operands);
1924 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1925 return "ex\t%2,0(%3)";
1931 [(set_attr "op_type" "SS,NN")
1932 (set_attr "type" "cs,cs")
1933 (set_attr "atype" "*,agen")
1934 (set_attr "length" "*,14")])
1936 ; Move a block of arbitrary length.
1938 (define_expand "movstr_long"
1940 [(clobber (match_dup 2))
1941 (clobber (match_dup 3))
1942 (set (match_operand:BLK 0 "memory_operand" "")
1943 (match_operand:BLK 1 "memory_operand" ""))
1944 (use (match_operand 2 "general_operand" ""))
1946 (clobber (reg:CC 33))])]
1949 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1950 rtx reg0 = gen_reg_rtx (dword_mode);
1951 rtx reg1 = gen_reg_rtx (dword_mode);
1952 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1953 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
1954 rtx len0 = gen_lowpart (Pmode, reg0);
1955 rtx len1 = gen_lowpart (Pmode, reg1);
1957 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1958 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1959 emit_move_insn (len0, operands[2]);
1961 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
1962 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
1963 emit_move_insn (len1, operands[2]);
1965 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1966 operands[1] = replace_equiv_address_nv (operands[1], addr1);
1971 (define_insn "*movstr_long_64"
1972 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1973 (clobber (match_operand:TI 1 "register_operand" "=d"))
1974 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1975 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
1978 (clobber (reg:CC 33))]
1980 "mvcle\t%0,%1,0\;jo\t.-4"
1981 [(set_attr "op_type" "NN")
1982 (set_attr "type" "vs")
1983 (set_attr "length" "8")])
1985 (define_insn "*movstr_long_31"
1986 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1987 (clobber (match_operand:DI 1 "register_operand" "=d"))
1988 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
1989 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
1992 (clobber (reg:CC 33))]
1994 "mvcle\t%0,%1,0\;jo\t.-4"
1995 [(set_attr "op_type" "NN")
1996 (set_attr "type" "vs")
1997 (set_attr "length" "8")])
2000 ; clrstrM instruction pattern(s).
2003 (define_expand "clrstrdi"
2004 [(set (match_operand:BLK 0 "memory_operand" "")
2006 (use (match_operand:DI 1 "general_operand" ""))
2007 (match_operand 2 "" "")]
2009 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
2011 (define_expand "clrstrsi"
2012 [(set (match_operand:BLK 0 "memory_operand" "")
2014 (use (match_operand:SI 1 "general_operand" ""))
2015 (match_operand 2 "" "")]
2017 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
2019 ; Clear a block that is up to 256 bytes in length.
2020 ; The block length is taken as (operands[1] % 256) + 1.
2022 (define_expand "clrstr_short"
2024 [(set (match_operand:BLK 0 "memory_operand" "")
2026 (use (match_operand 1 "nonmemory_operand" ""))
2027 (clobber (match_dup 2))
2028 (clobber (reg:CC 33))])]
2030 "operands[2] = gen_rtx_SCRATCH (Pmode);")
2032 (define_insn "*clrstr_short"
2033 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
2035 (use (match_operand 1 "nonmemory_operand" "n,a"))
2036 (clobber (match_scratch 2 "=X,&a"))
2037 (clobber (reg:CC 33))]
2038 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
2039 && GET_MODE (operands[2]) == Pmode"
2041 switch (which_alternative)
2044 return "xc\t%O0(%b1+1,%R0),%0";
2047 output_asm_insn ("bras\t%2,.+10", operands);
2048 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
2049 return "ex\t%1,0(%2)";
2055 [(set_attr "op_type" "SS,NN")
2056 (set_attr "type" "cs,cs")
2057 (set_attr "atype" "*,agen")
2058 (set_attr "length" "*,14")])
2060 ; Clear a block of arbitrary length.
2062 (define_expand "clrstr_long"
2064 [(clobber (match_dup 1))
2065 (set (match_operand:BLK 0 "memory_operand" "")
2067 (use (match_operand 1 "general_operand" ""))
2069 (clobber (reg:CC 33))])]
2072 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2073 rtx reg0 = gen_reg_rtx (dword_mode);
2074 rtx reg1 = gen_reg_rtx (dword_mode);
2075 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2076 rtx len0 = gen_lowpart (Pmode, reg0);
2078 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2079 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2080 emit_move_insn (len0, operands[1]);
2082 emit_move_insn (reg1, const0_rtx);
2084 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2089 (define_insn "*clrstr_long_64"
2090 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2091 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2094 (use (match_operand:TI 1 "register_operand" "d"))
2095 (clobber (reg:CC 33))]
2097 "mvcle\t%0,%1,0\;jo\t.-4"
2098 [(set_attr "op_type" "NN")
2099 (set_attr "type" "vs")
2100 (set_attr "length" "8")])
2102 (define_insn "*clrstr_long_31"
2103 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2104 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2107 (use (match_operand:DI 1 "register_operand" "d"))
2108 (clobber (reg:CC 33))]
2110 "mvcle\t%0,%1,0\;jo\t.-4"
2111 [(set_attr "op_type" "NN")
2112 (set_attr "type" "vs")
2113 (set_attr "length" "8")])
2116 ; cmpmemM instruction pattern(s).
2119 (define_expand "cmpmemdi"
2120 [(set (match_operand:DI 0 "register_operand" "")
2121 (compare:DI (match_operand:BLK 1 "memory_operand" "")
2122 (match_operand:BLK 2 "memory_operand" "") ) )
2123 (use (match_operand:DI 3 "general_operand" ""))
2124 (use (match_operand:DI 4 "" ""))]
2126 "s390_expand_cmpmem (operands[0], operands[1],
2127 operands[2], operands[3]); DONE;")
2129 (define_expand "cmpmemsi"
2130 [(set (match_operand:SI 0 "register_operand" "")
2131 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2132 (match_operand:BLK 2 "memory_operand" "") ) )
2133 (use (match_operand:SI 3 "general_operand" ""))
2134 (use (match_operand:SI 4 "" ""))]
2136 "s390_expand_cmpmem (operands[0], operands[1],
2137 operands[2], operands[3]); DONE;")
2139 ; Compare a block that is up to 256 bytes in length.
2140 ; The block length is taken as (operands[2] % 256) + 1.
2142 (define_expand "cmpmem_short"
2145 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2146 (match_operand:BLK 1 "memory_operand" "")))
2147 (use (match_operand 2 "nonmemory_operand" ""))
2148 (clobber (match_dup 3))])]
2150 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2152 (define_insn "*cmpmem_short"
2154 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2155 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2156 (use (match_operand 2 "nonmemory_operand" "n,a"))
2157 (clobber (match_scratch 3 "=X,&a"))]
2158 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2159 && GET_MODE (operands[3]) == Pmode"
2161 switch (which_alternative)
2164 return "clc\t%O0(%b2+1,%R0),%1";
2167 output_asm_insn ("bras\t%3,.+10", operands);
2168 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2169 return "ex\t%2,0(%3)";
2175 [(set_attr "op_type" "SS,NN")
2176 (set_attr "type" "cs,cs")
2177 (set_attr "atype" "*,agen")
2178 (set_attr "length" "*,14")])
2180 ; Compare a block of arbitrary length.
2182 (define_expand "cmpmem_long"
2184 [(clobber (match_dup 2))
2185 (clobber (match_dup 3))
2187 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2188 (match_operand:BLK 1 "memory_operand" "")))
2189 (use (match_operand 2 "general_operand" ""))
2190 (use (match_dup 3))])]
2193 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2194 rtx reg0 = gen_reg_rtx (dword_mode);
2195 rtx reg1 = gen_reg_rtx (dword_mode);
2196 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2197 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2198 rtx len0 = gen_lowpart (Pmode, reg0);
2199 rtx len1 = gen_lowpart (Pmode, reg1);
2201 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2202 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2203 emit_move_insn (len0, operands[2]);
2205 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2206 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2207 emit_move_insn (len1, operands[2]);
2209 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2210 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2215 (define_insn "*cmpmem_long_64"
2216 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2217 (clobber (match_operand:TI 1 "register_operand" "=d"))
2219 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2220 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2222 (use (match_dup 3))]
2224 "clcle\t%0,%1,0\;jo\t.-4"
2225 [(set_attr "op_type" "NN")
2226 (set_attr "type" "vs")
2227 (set_attr "length" "8")])
2229 (define_insn "*cmpmem_long_31"
2230 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2231 (clobber (match_operand:DI 1 "register_operand" "=d"))
2233 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2234 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2236 (use (match_dup 3))]
2238 "clcle\t%0,%1,0\;jo\t.-4"
2239 [(set_attr "op_type" "NN")
2240 (set_attr "type" "vs")
2241 (set_attr "length" "8")])
2243 ; Convert condition code to integer in range (-1, 0, 1)
2245 (define_insn "cmpint_si"
2246 [(set (match_operand:SI 0 "register_operand" "=d")
2247 (compare:SI (reg:CCS 33) (const_int 0)))]
2250 output_asm_insn ("lhi\t%0,1", operands);
2251 output_asm_insn ("jh\t.+12", operands);
2252 output_asm_insn ("jl\t.+6", operands);
2253 output_asm_insn ("sr\t%0,%0", operands);
2254 return "lcr\t%0,%0";
2256 [(set_attr "op_type" "NN")
2257 (set_attr "length" "16")
2258 (set_attr "type" "other")])
2260 (define_insn "cmpint_di"
2261 [(set (match_operand:DI 0 "register_operand" "=d")
2262 (compare:DI (reg:CCS 33) (const_int 0)))]
2265 output_asm_insn ("lghi\t%0,1", operands);
2266 output_asm_insn ("jh\t.+16", operands);
2267 output_asm_insn ("jl\t.+8", operands);
2268 output_asm_insn ("sgr\t%0,%0", operands);
2269 return "lcgr\t%0,%0";
2271 [(set_attr "op_type" "NN")
2272 (set_attr "length" "20")
2273 (set_attr "type" "other")])
2277 ;;- Conversion instructions.
2280 (define_insn "*sethighqisi"
2281 [(set (match_operand:SI 0 "register_operand" "=d,d")
2282 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2283 (clobber (reg:CC 33))]
2288 [(set_attr "op_type" "RS,RSY")])
2290 (define_insn "*sethighhisi"
2291 [(set (match_operand:SI 0 "register_operand" "=d,d")
2292 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2293 (clobber (reg:CC 33))]
2298 [(set_attr "op_type" "RS,RSY")])
2300 (define_insn "*sethighqidi_64"
2301 [(set (match_operand:DI 0 "register_operand" "=d")
2302 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2303 (clobber (reg:CC 33))]
2306 [(set_attr "op_type" "RSY")])
2308 (define_insn "*sethighqidi_31"
2309 [(set (match_operand:DI 0 "register_operand" "=d,d")
2310 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2311 (clobber (reg:CC 33))]
2316 [(set_attr "op_type" "RS,RSY")])
2318 (define_insn_and_split "*extractqi"
2319 [(set (match_operand:SI 0 "register_operand" "=d")
2320 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2321 (match_operand 2 "const_int_operand" "n")
2323 (clobber (reg:CC 33))]
2325 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2327 "&& reload_completed"
2329 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2330 (clobber (reg:CC 33))])
2331 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2333 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2334 operands[1] = change_address (operands[1], QImode, 0);
2336 [(set_attr "atype" "agen")])
2338 (define_insn_and_split "*extracthi"
2339 [(set (match_operand:SI 0 "register_operand" "=d")
2340 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2341 (match_operand 2 "const_int_operand" "n")
2343 (clobber (reg:CC 33))]
2345 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2347 "&& reload_completed"
2349 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2350 (clobber (reg:CC 33))])
2351 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2353 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2354 operands[1] = change_address (operands[1], HImode, 0);
2356 [(set_attr "atype" "agen")])
2359 ; extendsidi2 instruction pattern(s).
2362 (define_expand "extendsidi2"
2363 [(set (match_operand:DI 0 "register_operand" "")
2364 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2370 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2371 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2372 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2373 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2379 (define_insn "*extendsidi2"
2380 [(set (match_operand:DI 0 "register_operand" "=d,d")
2381 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2386 [(set_attr "op_type" "RRE,RXY")])
2389 ; extendhidi2 instruction pattern(s).
2392 (define_expand "extendhidi2"
2393 [(set (match_operand:DI 0 "register_operand" "")
2394 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2400 rtx tmp = gen_reg_rtx (SImode);
2401 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2402 emit_insn (gen_extendsidi2 (operands[0], tmp));
2407 operands[1] = gen_lowpart (DImode, operands[1]);
2408 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2409 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2415 (define_insn "*extendhidi2"
2416 [(set (match_operand:DI 0 "register_operand" "=d")
2417 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2420 [(set_attr "op_type" "RXY")])
2423 ; extendqidi2 instruction pattern(s).
2426 (define_expand "extendqidi2"
2427 [(set (match_operand:DI 0 "register_operand" "")
2428 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2434 rtx tmp = gen_reg_rtx (SImode);
2435 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2436 emit_insn (gen_extendsidi2 (operands[0], tmp));
2441 operands[1] = gen_lowpart (DImode, operands[1]);
2442 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2443 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2449 (define_insn "*extendqidi2"
2450 [(set (match_operand:DI 0 "register_operand" "=d")
2451 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2452 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2454 [(set_attr "op_type" "RXY")])
2456 (define_insn_and_split "*extendqidi2_short_displ"
2457 [(set (match_operand:DI 0 "register_operand" "=d")
2458 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2459 (clobber (reg:CC 33))]
2460 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2462 "&& reload_completed"
2464 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2465 (clobber (reg:CC 33))])
2467 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2468 (clobber (reg:CC 33))])]
2472 ; extendhisi2 instruction pattern(s).
2475 (define_expand "extendhisi2"
2476 [(set (match_operand:SI 0 "register_operand" "")
2477 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2481 operands[1] = gen_lowpart (SImode, operands[1]);
2482 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2483 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2488 (define_insn "*extendhisi2"
2489 [(set (match_operand:SI 0 "register_operand" "=d,d")
2490 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2495 [(set_attr "op_type" "RX,RXY")])
2498 ; extendqisi2 instruction pattern(s).
2501 (define_expand "extendqisi2"
2502 [(set (match_operand:SI 0 "register_operand" "")
2503 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2507 operands[1] = gen_lowpart (SImode, operands[1]);
2508 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2509 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2514 (define_insn "*extendqisi2"
2515 [(set (match_operand:SI 0 "register_operand" "=d")
2516 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2517 "TARGET_LONG_DISPLACEMENT"
2519 [(set_attr "op_type" "RXY")])
2521 (define_insn_and_split "*extendqisi2_short_displ"
2522 [(set (match_operand:SI 0 "register_operand" "=d")
2523 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2524 (clobber (reg:CC 33))]
2525 "!TARGET_LONG_DISPLACEMENT"
2527 "&& reload_completed"
2529 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2530 (clobber (reg:CC 33))])
2532 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2533 (clobber (reg:CC 33))])]
2537 ; extendqihi2 instruction pattern(s).
2542 ; zero_extendsidi2 instruction pattern(s).
2545 (define_expand "zero_extendsidi2"
2546 [(set (match_operand:DI 0 "register_operand" "")
2547 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2553 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2554 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2555 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2561 (define_insn "*zero_extendsidi2"
2562 [(set (match_operand:DI 0 "register_operand" "=d,d")
2563 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2568 [(set_attr "op_type" "RRE,RXY")])
2571 ; zero_extendhidi2 instruction pattern(s).
2574 (define_expand "zero_extendhidi2"
2575 [(set (match_operand:DI 0 "register_operand" "")
2576 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2582 rtx tmp = gen_reg_rtx (SImode);
2583 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2584 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2589 operands[1] = gen_lowpart (DImode, operands[1]);
2590 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2591 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2597 (define_insn "*zero_extendhidi2"
2598 [(set (match_operand:DI 0 "register_operand" "=d")
2599 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2602 [(set_attr "op_type" "RXY")])
2605 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2608 (define_insn "*llgt_sisi"
2609 [(set (match_operand:SI 0 "register_operand" "=d,d")
2610 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2611 (const_int 2147483647)))]
2616 [(set_attr "op_type" "RRE,RXE")])
2619 [(set (match_operand:SI 0 "register_operand" "")
2620 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2621 (const_int 2147483647)))
2622 (clobber (reg:CC 33))]
2623 "TARGET_64BIT && reload_completed"
2625 (and:SI (match_dup 1)
2626 (const_int 2147483647)))]
2629 (define_insn "*llgt_didi"
2630 [(set (match_operand:DI 0 "register_operand" "=d,d")
2631 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2632 (const_int 2147483647)))]
2637 [(set_attr "op_type" "RRE,RXE")])
2640 [(set (match_operand:DI 0 "register_operand" "")
2641 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2642 (const_int 2147483647)))
2643 (clobber (reg:CC 33))]
2644 "TARGET_64BIT && reload_completed"
2646 (and:DI (match_dup 1)
2647 (const_int 2147483647)))]
2650 (define_insn "*llgt_sidi"
2651 [(set (match_operand:DI 0 "register_operand" "=d")
2652 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2653 (const_int 2147483647)))]
2656 [(set_attr "op_type" "RXE")])
2658 (define_insn_and_split "*llgt_sidi_split"
2659 [(set (match_operand:DI 0 "register_operand" "=d")
2660 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2661 (const_int 2147483647)))
2662 (clobber (reg:CC 33))]
2665 "&& reload_completed"
2667 (and:DI (subreg:DI (match_dup 1) 0)
2668 (const_int 2147483647)))]
2672 ; zero_extendqidi2 instruction pattern(s)
2675 (define_expand "zero_extendqidi2"
2676 [(set (match_operand:DI 0 "register_operand" "")
2677 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2683 rtx tmp = gen_reg_rtx (SImode);
2684 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2685 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2690 operands[1] = gen_lowpart (DImode, operands[1]);
2691 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2692 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2698 (define_insn "*zero_extendqidi2"
2699 [(set (match_operand:DI 0 "register_operand" "=d")
2700 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2703 [(set_attr "op_type" "RXY")])
2706 ; zero_extendhisi2 instruction pattern(s).
2709 (define_expand "zero_extendhisi2"
2710 [(set (match_operand:SI 0 "register_operand" "")
2711 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2715 operands[1] = gen_lowpart (SImode, operands[1]);
2716 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2721 (define_insn "*zero_extendhisi2_64"
2722 [(set (match_operand:SI 0 "register_operand" "=d")
2723 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2726 [(set_attr "op_type" "RXY")])
2728 (define_insn_and_split "*zero_extendhisi2_31"
2729 [(set (match_operand:SI 0 "register_operand" "=&d")
2730 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2731 (clobber (reg:CC 33))]
2734 "&& reload_completed"
2735 [(set (match_dup 0) (const_int 0))
2737 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2738 (clobber (reg:CC 33))])]
2739 "operands[2] = gen_lowpart (HImode, operands[0]);"
2740 [(set_attr "atype" "agen")])
2743 ; zero_extendqisi2 instruction pattern(s).
2746 (define_expand "zero_extendqisi2"
2747 [(set (match_operand:SI 0 "register_operand" "")
2748 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2752 operands[1] = gen_lowpart (SImode, operands[1]);
2753 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2758 (define_insn "*zero_extendqisi2_64"
2759 [(set (match_operand:SI 0 "register_operand" "=d")
2760 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2763 [(set_attr "op_type" "RXY")])
2765 (define_insn_and_split "*zero_extendqisi2_31"
2766 [(set (match_operand:SI 0 "register_operand" "=&d")
2767 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2770 "&& reload_completed"
2771 [(set (match_dup 0) (const_int 0))
2772 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2773 "operands[2] = gen_lowpart (QImode, operands[0]);"
2774 [(set_attr "atype" "agen")])
2777 ; zero_extendqihi2 instruction pattern(s).
2780 (define_expand "zero_extendqihi2"
2781 [(set (match_operand:HI 0 "register_operand" "")
2782 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2786 operands[1] = gen_lowpart (HImode, operands[1]);
2787 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2792 (define_insn "*zero_extendqihi2_64"
2793 [(set (match_operand:HI 0 "register_operand" "=d")
2794 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2797 [(set_attr "op_type" "RXY")])
2799 (define_insn_and_split "*zero_extendqihi2_31"
2800 [(set (match_operand:HI 0 "register_operand" "=&d")
2801 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2804 "&& reload_completed"
2805 [(set (match_dup 0) (const_int 0))
2806 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2807 "operands[2] = gen_lowpart (QImode, operands[0]);"
2808 [(set_attr "atype" "agen")])
2812 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2815 (define_expand "fixuns_truncdfdi2"
2816 [(set (match_operand:DI 0 "register_operand" "")
2817 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2818 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2820 rtx label1 = gen_label_rtx ();
2821 rtx label2 = gen_label_rtx ();
2822 rtx temp = gen_reg_rtx (DFmode);
2823 operands[1] = force_reg (DFmode, operands[1]);
2825 emit_insn (gen_cmpdf (operands[1],
2826 CONST_DOUBLE_FROM_REAL_VALUE (
2827 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2828 emit_jump_insn (gen_blt (label1));
2829 emit_insn (gen_subdf3 (temp, operands[1],
2830 CONST_DOUBLE_FROM_REAL_VALUE (
2831 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2832 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2835 emit_label (label1);
2836 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2837 emit_label (label2);
2841 (define_expand "fix_truncdfdi2"
2842 [(set (match_operand:DI 0 "register_operand" "")
2843 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2844 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2846 operands[1] = force_reg (DFmode, operands[1]);
2847 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2851 (define_insn "fix_truncdfdi2_ieee"
2852 [(set (match_operand:DI 0 "register_operand" "=d")
2853 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2854 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2855 (clobber (reg:CC 33))]
2856 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2858 [(set_attr "op_type" "RRE")
2859 (set_attr "type" "ftoi")])
2862 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2865 (define_expand "fixuns_truncdfsi2"
2866 [(set (match_operand:SI 0 "register_operand" "")
2867 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2868 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2870 rtx label1 = gen_label_rtx ();
2871 rtx label2 = gen_label_rtx ();
2872 rtx temp = gen_reg_rtx (DFmode);
2874 operands[1] = force_reg (DFmode,operands[1]);
2875 emit_insn (gen_cmpdf (operands[1],
2876 CONST_DOUBLE_FROM_REAL_VALUE (
2877 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2878 emit_jump_insn (gen_blt (label1));
2879 emit_insn (gen_subdf3 (temp, operands[1],
2880 CONST_DOUBLE_FROM_REAL_VALUE (
2881 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2882 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2885 emit_label (label1);
2886 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2887 emit_label (label2);
2891 (define_expand "fix_truncdfsi2"
2892 [(set (match_operand:SI 0 "register_operand" "")
2893 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2896 if (TARGET_IBM_FLOAT)
2898 /* This is the algorithm from POP chapter A.5.7.2. */
2900 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2901 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2902 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2904 operands[1] = force_reg (DFmode, operands[1]);
2905 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2906 two31r, two32, temp));
2910 operands[1] = force_reg (DFmode, operands[1]);
2911 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2917 (define_insn "fix_truncdfsi2_ieee"
2918 [(set (match_operand:SI 0 "register_operand" "=d")
2919 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2920 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2921 (clobber (reg:CC 33))]
2922 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2924 [(set_attr "op_type" "RRE")
2925 (set_attr "type" "other" )])
2927 (define_insn "fix_truncdfsi2_ibm"
2928 [(set (match_operand:SI 0 "register_operand" "=d")
2929 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2930 (use (match_operand:DI 2 "immediate_operand" "m"))
2931 (use (match_operand:DI 3 "immediate_operand" "m"))
2932 (use (match_operand:BLK 4 "memory_operand" "m"))
2933 (clobber (reg:CC 33))]
2934 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2936 output_asm_insn ("sd\t%1,%2", operands);
2937 output_asm_insn ("aw\t%1,%3", operands);
2938 output_asm_insn ("std\t%1,%4", operands);
2939 output_asm_insn ("xi\t%N4,128", operands);
2942 [(set_attr "op_type" "NN")
2943 (set_attr "type" "ftoi")
2944 (set_attr "atype" "agen")
2945 (set_attr "length" "20")])
2948 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2951 (define_expand "fixuns_truncsfdi2"
2952 [(set (match_operand:DI 0 "register_operand" "")
2953 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2954 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2956 rtx label1 = gen_label_rtx ();
2957 rtx label2 = gen_label_rtx ();
2958 rtx temp = gen_reg_rtx (SFmode);
2960 operands[1] = force_reg (SFmode, operands[1]);
2961 emit_insn (gen_cmpsf (operands[1],
2962 CONST_DOUBLE_FROM_REAL_VALUE (
2963 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2964 emit_jump_insn (gen_blt (label1));
2966 emit_insn (gen_subsf3 (temp, operands[1],
2967 CONST_DOUBLE_FROM_REAL_VALUE (
2968 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2969 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2972 emit_label (label1);
2973 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2974 emit_label (label2);
2978 (define_expand "fix_truncsfdi2"
2979 [(set (match_operand:DI 0 "register_operand" "")
2980 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2981 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2983 operands[1] = force_reg (SFmode, operands[1]);
2984 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2988 (define_insn "fix_truncsfdi2_ieee"
2989 [(set (match_operand:DI 0 "register_operand" "=d")
2990 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2991 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2992 (clobber (reg:CC 33))]
2993 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2995 [(set_attr "op_type" "RRE")
2996 (set_attr "type" "ftoi")])
2999 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
3002 (define_expand "fixuns_truncsfsi2"
3003 [(set (match_operand:SI 0 "register_operand" "")
3004 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
3005 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3007 rtx label1 = gen_label_rtx ();
3008 rtx label2 = gen_label_rtx ();
3009 rtx temp = gen_reg_rtx (SFmode);
3011 operands[1] = force_reg (SFmode, operands[1]);
3012 emit_insn (gen_cmpsf (operands[1],
3013 CONST_DOUBLE_FROM_REAL_VALUE (
3014 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
3015 emit_jump_insn (gen_blt (label1));
3016 emit_insn (gen_subsf3 (temp, operands[1],
3017 CONST_DOUBLE_FROM_REAL_VALUE (
3018 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
3019 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
3022 emit_label (label1);
3023 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3024 emit_label (label2);
3028 (define_expand "fix_truncsfsi2"
3029 [(set (match_operand:SI 0 "register_operand" "")
3030 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
3033 if (TARGET_IBM_FLOAT)
3035 /* Convert to DFmode and then use the POP algorithm. */
3036 rtx temp = gen_reg_rtx (DFmode);
3037 emit_insn (gen_extendsfdf2 (temp, operands[1]));
3038 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
3042 operands[1] = force_reg (SFmode, operands[1]);
3043 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3049 (define_insn "fix_truncsfsi2_ieee"
3050 [(set (match_operand:SI 0 "register_operand" "=d")
3051 (fix:SI (match_operand:SF 1 "register_operand" "f")))
3052 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3053 (clobber (reg:CC 33))]
3054 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3056 [(set_attr "op_type" "RRE")
3057 (set_attr "type" "ftoi")])
3060 ; floatdidf2 instruction pattern(s).
3063 (define_insn "floatdidf2"
3064 [(set (match_operand:DF 0 "register_operand" "=f")
3065 (float:DF (match_operand:DI 1 "register_operand" "d")))
3066 (clobber (reg:CC 33))]
3067 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3069 [(set_attr "op_type" "RRE")
3070 (set_attr "type" "itof" )])
3073 ; floatdisf2 instruction pattern(s).
3076 (define_insn "floatdisf2"
3077 [(set (match_operand:SF 0 "register_operand" "=f")
3078 (float:SF (match_operand:DI 1 "register_operand" "d")))
3079 (clobber (reg:CC 33))]
3080 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3082 [(set_attr "op_type" "RRE")
3083 (set_attr "type" "itof" )])
3086 ; floatsidf2 instruction pattern(s).
3089 (define_expand "floatsidf2"
3091 [(set (match_operand:DF 0 "register_operand" "")
3092 (float:DF (match_operand:SI 1 "register_operand" "")))
3093 (clobber (reg:CC 33))])]
3096 if (TARGET_IBM_FLOAT)
3098 /* This is the algorithm from POP chapter A.5.7.1. */
3100 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3101 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3103 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3108 (define_insn "floatsidf2_ieee"
3109 [(set (match_operand:DF 0 "register_operand" "=f")
3110 (float:DF (match_operand:SI 1 "register_operand" "d")))
3111 (clobber (reg:CC 33))]
3112 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3114 [(set_attr "op_type" "RRE")
3115 (set_attr "type" "itof" )])
3117 (define_insn "floatsidf2_ibm"
3118 [(set (match_operand:DF 0 "register_operand" "=f")
3119 (float:DF (match_operand:SI 1 "register_operand" "d")))
3120 (use (match_operand:DI 2 "immediate_operand" "m"))
3121 (use (match_operand:BLK 3 "memory_operand" "m"))
3122 (clobber (reg:CC 33))]
3123 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3125 output_asm_insn ("st\t%1,%N3", operands);
3126 output_asm_insn ("xi\t%N3,128", operands);
3127 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3128 output_asm_insn ("ld\t%0,%3", operands);
3131 [(set_attr "op_type" "NN")
3132 (set_attr "type" "other" )
3133 (set_attr "atype" "agen")
3134 (set_attr "length" "20")])
3137 ; floatsisf2 instruction pattern(s).
3140 (define_expand "floatsisf2"
3142 [(set (match_operand:SF 0 "register_operand" "")
3143 (float:SF (match_operand:SI 1 "register_operand" "")))
3144 (clobber (reg:CC 33))])]
3147 if (TARGET_IBM_FLOAT)
3149 /* Use the POP algorithm to convert to DFmode and then truncate. */
3150 rtx temp = gen_reg_rtx (DFmode);
3151 emit_insn (gen_floatsidf2 (temp, operands[1]));
3152 emit_insn (gen_truncdfsf2 (operands[0], temp));
3157 (define_insn "floatsisf2_ieee"
3158 [(set (match_operand:SF 0 "register_operand" "=f")
3159 (float:SF (match_operand:SI 1 "register_operand" "d")))
3160 (clobber (reg:CC 33))]
3161 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3163 [(set_attr "op_type" "RRE")
3164 (set_attr "type" "itof" )])
3167 ; truncdfsf2 instruction pattern(s).
3170 (define_expand "truncdfsf2"
3171 [(set (match_operand:SF 0 "register_operand" "")
3172 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3176 (define_insn "truncdfsf2_ieee"
3177 [(set (match_operand:SF 0 "register_operand" "=f")
3178 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3179 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3181 [(set_attr "op_type" "RRE")])
3183 (define_insn "truncdfsf2_ibm"
3184 [(set (match_operand:SF 0 "register_operand" "=f,f")
3185 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3186 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3190 [(set_attr "op_type" "RR,RX")
3191 (set_attr "type" "floads,floads")])
3194 ; extendsfdf2 instruction pattern(s).
3197 (define_expand "extendsfdf2"
3198 [(set (match_operand:DF 0 "register_operand" "")
3199 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3202 if (TARGET_IBM_FLOAT)
3204 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3209 (define_insn "extendsfdf2_ieee"
3210 [(set (match_operand:DF 0 "register_operand" "=f,f")
3211 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3212 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3216 [(set_attr "op_type" "RRE,RXE")
3217 (set_attr "type" "floads,floads")])
3219 (define_insn "extendsfdf2_ibm"
3220 [(set (match_operand:DF 0 "register_operand" "=f,f")
3221 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3222 (clobber (reg:CC 33))]
3223 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3225 sdr\t%0,%0\;ler\t%0,%1
3226 sdr\t%0,%0\;le\t%0,%1"
3227 [(set_attr "op_type" "NN,NN")
3228 (set_attr "atype" "reg,agen")
3229 (set_attr "length" "4,6")
3230 (set_attr "type" "o2,o2")])
3234 ;; ARITHMETIC OPERATIONS
3236 ; arithmetic operations set the ConditionCode,
3237 ; because of unpredictable Bits in Register for Halfword and Byte
3238 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3241 ;;- Add instructions.
3245 ; addti3 instruction pattern(s).
3248 (define_insn_and_split "addti3"
3249 [(set (match_operand:TI 0 "register_operand" "=&d")
3250 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3251 (match_operand:TI 2 "general_operand" "do") ) )
3252 (clobber (reg:CC 33))]
3255 "&& reload_completed"
3258 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3260 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3262 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3263 (ltu:DI (reg:CCL1 33) (const_int 0))))
3264 (clobber (reg:CC 33))])]
3265 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3266 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3267 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3268 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3269 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3270 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3271 [(set_attr "op_type" "NN")])
3274 ; adddi3 instruction pattern(s).
3277 (define_insn "*adddi3_sign"
3278 [(set (match_operand:DI 0 "register_operand" "=d,d")
3279 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3280 (match_operand:DI 1 "register_operand" "0,0")))
3281 (clobber (reg:CC 33))]
3286 [(set_attr "op_type" "RRE,RXY")])
3288 (define_insn "*adddi3_zero_cc"
3290 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3291 (match_operand:DI 1 "register_operand" "0,0"))
3293 (set (match_operand:DI 0 "register_operand" "=d,d")
3294 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3295 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3299 [(set_attr "op_type" "RRE,RXY")])
3301 (define_insn "*adddi3_zero_cconly"
3303 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3304 (match_operand:DI 1 "register_operand" "0,0"))
3306 (clobber (match_scratch:DI 0 "=d,d"))]
3307 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3311 [(set_attr "op_type" "RRE,RXY")])
3313 (define_insn "*adddi3_zero"
3314 [(set (match_operand:DI 0 "register_operand" "=d,d")
3315 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3316 (match_operand:DI 1 "register_operand" "0,0")))
3317 (clobber (reg:CC 33))]
3322 [(set_attr "op_type" "RRE,RXY")])
3324 (define_insn "*adddi3_imm_cc"
3326 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3327 (match_operand:DI 2 "const_int_operand" "K"))
3329 (set (match_operand:DI 0 "register_operand" "=d")
3330 (plus:DI (match_dup 1) (match_dup 2)))]
3332 && s390_match_ccmode (insn, CCAmode)
3333 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3335 [(set_attr "op_type" "RI")])
3337 (define_insn "*adddi3_carry1_cc"
3339 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3340 (match_operand:DI 2 "general_operand" "d,m"))
3342 (set (match_operand:DI 0 "register_operand" "=d,d")
3343 (plus:DI (match_dup 1) (match_dup 2)))]
3344 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3348 [(set_attr "op_type" "RRE,RXY")])
3350 (define_insn "*adddi3_carry1_cconly"
3352 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3353 (match_operand:DI 2 "general_operand" "d,m"))
3355 (clobber (match_scratch:DI 0 "=d,d"))]
3356 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3360 [(set_attr "op_type" "RRE,RXY")])
3362 (define_insn "*adddi3_carry2_cc"
3364 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3365 (match_operand:DI 2 "general_operand" "d,m"))
3367 (set (match_operand:DI 0 "register_operand" "=d,d")
3368 (plus:DI (match_dup 1) (match_dup 2)))]
3369 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3373 [(set_attr "op_type" "RRE,RXY")])
3375 (define_insn "*adddi3_carry2_cconly"
3377 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3378 (match_operand:DI 2 "general_operand" "d,m"))
3380 (clobber (match_scratch:DI 0 "=d,d"))]
3381 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3385 [(set_attr "op_type" "RRE,RXY")])
3387 (define_insn "*adddi3_cc"
3389 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3390 (match_operand:DI 2 "general_operand" "d,m"))
3392 (set (match_operand:DI 0 "register_operand" "=d,d")
3393 (plus:DI (match_dup 1) (match_dup 2)))]
3394 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3398 [(set_attr "op_type" "RRE,RXY")])
3400 (define_insn "*adddi3_cconly"
3402 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3403 (match_operand:DI 2 "general_operand" "d,m"))
3405 (clobber (match_scratch:DI 0 "=d,d"))]
3406 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3410 [(set_attr "op_type" "RRE,RXY")])
3412 (define_insn "*adddi3_cconly2"
3414 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3415 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3416 (clobber (match_scratch:DI 0 "=d,d"))]
3417 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3421 [(set_attr "op_type" "RRE,RXY")])
3423 (define_insn "*adddi3_64"
3424 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3425 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3426 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3427 (clobber (reg:CC 33))]
3433 [(set_attr "op_type" "RRE,RI,RXY")])
3435 (define_insn_and_split "*adddi3_31z"
3436 [(set (match_operand:DI 0 "register_operand" "=&d")
3437 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3438 (match_operand:DI 2 "general_operand" "do") ) )
3439 (clobber (reg:CC 33))]
3440 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3442 "&& reload_completed"
3445 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3447 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3449 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3450 (ltu:SI (reg:CCL1 33) (const_int 0))))
3451 (clobber (reg:CC 33))])]
3452 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3453 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3454 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3455 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3456 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3457 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3458 [(set_attr "op_type" "NN")])
3460 (define_insn_and_split "*adddi3_31"
3461 [(set (match_operand:DI 0 "register_operand" "=&d")
3462 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3463 (match_operand:DI 2 "general_operand" "do") ) )
3464 (clobber (reg:CC 33))]
3467 "&& reload_completed"
3469 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3470 (clobber (reg:CC 33))])
3473 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3475 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3477 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3479 (label_ref (match_dup 9))))
3481 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3482 (clobber (reg:CC 33))])
3484 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3485 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3486 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3487 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3488 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3489 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3490 operands[9] = gen_label_rtx ();"
3491 [(set_attr "op_type" "NN")])
3493 (define_expand "adddi3"
3495 [(set (match_operand:DI 0 "register_operand" "")
3496 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3497 (match_operand:DI 2 "general_operand" "")))
3498 (clobber (reg:CC 33))])]
3503 ; addsi3 instruction pattern(s).
3506 (define_insn "*addsi3_imm_cc"
3508 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3509 (match_operand:SI 2 "const_int_operand" "K"))
3511 (set (match_operand:SI 0 "register_operand" "=d")
3512 (plus:SI (match_dup 1) (match_dup 2)))]
3513 "s390_match_ccmode (insn, CCAmode)
3514 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3516 [(set_attr "op_type" "RI")])
3518 (define_insn "*addsi3_carry1_cc"
3520 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3521 (match_operand:SI 2 "general_operand" "d,R,T"))
3523 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3524 (plus:SI (match_dup 1) (match_dup 2)))]
3525 "s390_match_ccmode (insn, CCL1mode)"
3530 [(set_attr "op_type" "RR,RX,RXY")])
3532 (define_insn "*addsi3_carry1_cconly"
3534 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3535 (match_operand:SI 2 "general_operand" "d,R,T"))
3537 (clobber (match_scratch:SI 0 "=d,d,d"))]
3538 "s390_match_ccmode (insn, CCL1mode)"
3543 [(set_attr "op_type" "RR,RX,RXY")])
3545 (define_insn "*addsi3_carry2_cc"
3547 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3548 (match_operand:SI 2 "general_operand" "d,R,T"))
3550 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3551 (plus:SI (match_dup 1) (match_dup 2)))]
3552 "s390_match_ccmode (insn, CCL1mode)"
3557 [(set_attr "op_type" "RR,RX,RXY")])
3559 (define_insn "*addsi3_carry2_cconly"
3561 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3562 (match_operand:SI 2 "general_operand" "d,R,T"))
3564 (clobber (match_scratch:SI 0 "=d,d,d"))]
3565 "s390_match_ccmode (insn, CCL1mode)"
3570 [(set_attr "op_type" "RR,RX,RXY")])
3572 (define_insn "*addsi3_cc"
3574 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3575 (match_operand:SI 2 "general_operand" "d,R,T"))
3577 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3578 (plus:SI (match_dup 1) (match_dup 2)))]
3579 "s390_match_ccmode (insn, CCLmode)"
3584 [(set_attr "op_type" "RR,RX,RXY")])
3586 (define_insn "*addsi3_cconly"
3588 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3589 (match_operand:SI 2 "general_operand" "d,R,T"))
3591 (clobber (match_scratch:SI 0 "=d,d,d"))]
3592 "s390_match_ccmode (insn, CCLmode)"
3597 [(set_attr "op_type" "RR,RX,RXY")])
3599 (define_insn "*addsi3_cconly2"
3601 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3602 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3603 (clobber (match_scratch:SI 0 "=d,d,d"))]
3604 "s390_match_ccmode (insn, CCLmode)"
3609 [(set_attr "op_type" "RR,RX,RXY")])
3611 (define_insn "*addsi3_sign"
3612 [(set (match_operand:SI 0 "register_operand" "=d,d")
3613 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3614 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3615 (clobber (reg:CC 33))]
3620 [(set_attr "op_type" "RX,RXY")])
3622 (define_insn "addsi3"
3623 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3624 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3625 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3626 (clobber (reg:CC 33))]
3633 [(set_attr "op_type" "RR,RI,RX,RXY")])
3636 ; adddf3 instruction pattern(s).
3639 (define_expand "adddf3"
3641 [(set (match_operand:DF 0 "register_operand" "=f,f")
3642 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3643 (match_operand:DF 2 "general_operand" "f,R")))
3644 (clobber (reg:CC 33))])]
3648 (define_insn "*adddf3"
3649 [(set (match_operand:DF 0 "register_operand" "=f,f")
3650 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3651 (match_operand:DF 2 "general_operand" "f,R")))
3652 (clobber (reg:CC 33))]
3653 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3657 [(set_attr "op_type" "RRE,RXE")
3658 (set_attr "type" "fsimpd,fsimpd")])
3660 (define_insn "*adddf3_cc"
3662 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3663 (match_operand:DF 2 "general_operand" "f,R"))
3664 (match_operand:DF 3 "const0_operand" "")))
3665 (set (match_operand:DF 0 "register_operand" "=f,f")
3666 (plus:DF (match_dup 1) (match_dup 2)))]
3667 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3671 [(set_attr "op_type" "RRE,RXE")
3672 (set_attr "type" "fsimpd,fsimpd")])
3674 (define_insn "*adddf3_cconly"
3676 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3677 (match_operand:DF 2 "general_operand" "f,R"))
3678 (match_operand:DF 3 "const0_operand" "")))
3679 (clobber (match_scratch:DF 0 "=f,f"))]
3680 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3684 [(set_attr "op_type" "RRE,RXE")
3685 (set_attr "type" "fsimpd,fsimpd")])
3687 (define_insn "*adddf3_ibm"
3688 [(set (match_operand:DF 0 "register_operand" "=f,f")
3689 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3690 (match_operand:DF 2 "general_operand" "f,R")))
3691 (clobber (reg:CC 33))]
3692 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3696 [(set_attr "op_type" "RR,RX")
3697 (set_attr "type" "fsimpd,fsimpd")])
3700 ; addsf3 instruction pattern(s).
3703 (define_expand "addsf3"
3705 [(set (match_operand:SF 0 "register_operand" "=f,f")
3706 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3707 (match_operand:SF 2 "general_operand" "f,R")))
3708 (clobber (reg:CC 33))])]
3712 (define_insn "*addsf3"
3713 [(set (match_operand:SF 0 "register_operand" "=f,f")
3714 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3715 (match_operand:SF 2 "general_operand" "f,R")))
3716 (clobber (reg:CC 33))]
3717 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3721 [(set_attr "op_type" "RRE,RXE")
3722 (set_attr "type" "fsimps,fsimps")])
3724 (define_insn "*addsf3_cc"
3726 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3727 (match_operand:SF 2 "general_operand" "f,R"))
3728 (match_operand:SF 3 "const0_operand" "")))
3729 (set (match_operand:SF 0 "register_operand" "=f,f")
3730 (plus:SF (match_dup 1) (match_dup 2)))]
3731 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3735 [(set_attr "op_type" "RRE,RXE")
3736 (set_attr "type" "fsimps,fsimps")])
3738 (define_insn "*addsf3_cconly"
3740 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3741 (match_operand:SF 2 "general_operand" "f,R"))
3742 (match_operand:SF 3 "const0_operand" "")))
3743 (clobber (match_scratch:SF 0 "=f,f"))]
3744 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3748 [(set_attr "op_type" "RRE,RXE")
3749 (set_attr "type" "fsimps,fsimps")])
3751 (define_insn "*addsf3"
3752 [(set (match_operand:SF 0 "register_operand" "=f,f")
3753 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3754 (match_operand:SF 2 "general_operand" "f,R")))
3755 (clobber (reg:CC 33))]
3756 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3760 [(set_attr "op_type" "RR,RX")
3761 (set_attr "type" "fsimps,fsimps")])
3765 ;;- Subtract instructions.
3769 ; subti3 instruction pattern(s).
3772 (define_insn_and_split "subti3"
3773 [(set (match_operand:TI 0 "register_operand" "=&d")
3774 (minus:TI (match_operand:TI 1 "register_operand" "0")
3775 (match_operand:TI 2 "general_operand" "do") ) )
3776 (clobber (reg:CC 33))]
3779 "&& reload_completed"
3782 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3784 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3786 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3787 (gtu:DI (reg:CCL2 33) (const_int 0))))
3788 (clobber (reg:CC 33))])]
3789 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3790 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3791 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3792 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3793 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3794 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3795 [(set_attr "op_type" "NN")])
3798 ; subdi3 instruction pattern(s).
3801 (define_insn "*subdi3_sign"
3802 [(set (match_operand:DI 0 "register_operand" "=d,d")
3803 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3804 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3805 (clobber (reg:CC 33))]
3810 [(set_attr "op_type" "RRE,RXY")])
3812 (define_insn "*subdi3_zero_cc"
3814 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3815 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3817 (set (match_operand:DI 0 "register_operand" "=d,d")
3818 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3819 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3823 [(set_attr "op_type" "RRE,RXY")])
3825 (define_insn "*subdi3_zero_cconly"
3827 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3828 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3830 (clobber (match_scratch:DI 0 "=d,d"))]
3831 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3835 [(set_attr "op_type" "RRE,RXY")])
3837 (define_insn "*subdi3_zero"
3838 [(set (match_operand:DI 0 "register_operand" "=d,d")
3839 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3840 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3841 (clobber (reg:CC 33))]
3846 [(set_attr "op_type" "RRE,RXY")])
3848 (define_insn "*subdi3_borrow_cc"
3850 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3851 (match_operand:DI 2 "general_operand" "d,m"))
3853 (set (match_operand:DI 0 "register_operand" "=d,d")
3854 (minus:DI (match_dup 1) (match_dup 2)))]
3855 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3859 [(set_attr "op_type" "RRE,RXY")])
3861 (define_insn "*subdi3_borrow_cconly"
3863 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3864 (match_operand:DI 2 "general_operand" "d,m"))
3866 (clobber (match_scratch:DI 0 "=d,d"))]
3867 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3871 [(set_attr "op_type" "RRE,RXY")])
3873 (define_insn "*subdi3_cc"
3875 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3876 (match_operand:DI 2 "general_operand" "d,m"))
3878 (set (match_operand:DI 0 "register_operand" "=d,d")
3879 (minus:DI (match_dup 1) (match_dup 2)))]
3880 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3884 [(set_attr "op_type" "RRE,RXY")])
3886 (define_insn "*subdi3_cc2"
3888 (compare (match_operand:DI 1 "register_operand" "0,0")
3889 (match_operand:DI 2 "general_operand" "d,m")))
3890 (set (match_operand:DI 0 "register_operand" "=d,d")
3891 (minus:DI (match_dup 1) (match_dup 2)))]
3892 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3896 [(set_attr "op_type" "RRE,RXY")])
3898 (define_insn "*subdi3_cconly"
3900 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3901 (match_operand:DI 2 "general_operand" "d,m"))
3903 (clobber (match_scratch:DI 0 "=d,d"))]
3904 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3908 [(set_attr "op_type" "RRE,RXY")])
3910 (define_insn "*subdi3_cconly2"
3912 (compare (match_operand:DI 1 "register_operand" "0,0")
3913 (match_operand:DI 2 "general_operand" "d,m")))
3914 (clobber (match_scratch:DI 0 "=d,d"))]
3915 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3919 [(set_attr "op_type" "RRE,RXY")])
3921 (define_insn "*subdi3_64"
3922 [(set (match_operand:DI 0 "register_operand" "=d,d")
3923 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3924 (match_operand:DI 2 "general_operand" "d,m") ) )
3925 (clobber (reg:CC 33))]
3930 [(set_attr "op_type" "RRE,RRE")])
3932 (define_insn_and_split "*subdi3_31z"
3933 [(set (match_operand:DI 0 "register_operand" "=&d")
3934 (minus:DI (match_operand:DI 1 "register_operand" "0")
3935 (match_operand:DI 2 "general_operand" "do") ) )
3936 (clobber (reg:CC 33))]
3937 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3939 "&& reload_completed"
3942 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3944 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3946 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
3947 (gtu:SI (reg:CCL2 33) (const_int 0))))
3948 (clobber (reg:CC 33))])]
3949 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3950 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3951 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3952 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3953 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3954 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3955 [(set_attr "op_type" "NN")])
3957 (define_insn_and_split "*subdi3_31"
3958 [(set (match_operand:DI 0 "register_operand" "=&d")
3959 (minus:DI (match_operand:DI 1 "register_operand" "0")
3960 (match_operand:DI 2 "general_operand" "do") ) )
3961 (clobber (reg:CC 33))]
3964 "&& reload_completed"
3966 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3967 (clobber (reg:CC 33))])
3970 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3972 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3974 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3976 (label_ref (match_dup 9))))
3978 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3979 (clobber (reg:CC 33))])
3981 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3982 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3983 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3984 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3985 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3986 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3987 operands[9] = gen_label_rtx ();"
3988 [(set_attr "op_type" "NN")])
3990 (define_expand "subdi3"
3992 [(set (match_operand:DI 0 "register_operand" "")
3993 (minus:DI (match_operand:DI 1 "register_operand" "")
3994 (match_operand:DI 2 "general_operand" "")))
3995 (clobber (reg:CC 33))])]
4000 ; subsi3 instruction pattern(s).
4003 (define_insn "*subsi3_borrow_cc"
4005 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4006 (match_operand:SI 2 "general_operand" "d,R,T"))
4008 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4009 (minus:SI (match_dup 1) (match_dup 2)))]
4010 "s390_match_ccmode (insn, CCL2mode)"
4015 [(set_attr "op_type" "RR,RX,RXY")])
4017 (define_insn "*subsi3_borrow_cconly"
4019 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4020 (match_operand:SI 2 "general_operand" "d,R,T"))
4022 (clobber (match_scratch:SI 0 "=d,d,d"))]
4023 "s390_match_ccmode (insn, CCL2mode)"
4028 [(set_attr "op_type" "RR,RX,RXY")])
4030 (define_insn "*subsi3_cc"
4032 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4033 (match_operand:SI 2 "general_operand" "d,R,T"))
4035 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4036 (minus:SI (match_dup 1) (match_dup 2)))]
4037 "s390_match_ccmode (insn, CCLmode)"
4042 [(set_attr "op_type" "RR,RX,RXY")])
4044 (define_insn "*subsi3_cc2"
4046 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4047 (match_operand:SI 2 "general_operand" "d,R,T")))
4048 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4049 (minus:SI (match_dup 1) (match_dup 2)))]
4050 "s390_match_ccmode (insn, CCL3mode)"
4055 [(set_attr "op_type" "RR,RX,RXY")])
4057 (define_insn "*subsi3_cconly"
4059 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4060 (match_operand:SI 2 "general_operand" "d,R,T"))
4062 (clobber (match_scratch:SI 0 "=d,d,d"))]
4063 "s390_match_ccmode (insn, CCLmode)"
4068 [(set_attr "op_type" "RR,RX,RXY")])
4070 (define_insn "*subsi3_cconly2"
4072 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4073 (match_operand:SI 2 "general_operand" "d,R,T")))
4074 (clobber (match_scratch:SI 0 "=d,d,d"))]
4075 "s390_match_ccmode (insn, CCL3mode)"
4080 [(set_attr "op_type" "RR,RX,RXY")])
4082 (define_insn "*subsi3_sign"
4083 [(set (match_operand:SI 0 "register_operand" "=d,d")
4084 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4085 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4086 (clobber (reg:CC 33))]
4091 [(set_attr "op_type" "RX,RXY")])
4093 (define_insn "subsi3"
4094 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4095 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4096 (match_operand:SI 2 "general_operand" "d,R,T")))
4097 (clobber (reg:CC 33))]
4103 [(set_attr "op_type" "RR,RX,RXY")])
4107 ; subdf3 instruction pattern(s).
4110 (define_expand "subdf3"
4112 [(set (match_operand:DF 0 "register_operand" "=f,f")
4113 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4114 (match_operand:DF 2 "general_operand" "f,R")))
4115 (clobber (reg:CC 33))])]
4119 (define_insn "*subdf3"
4120 [(set (match_operand:DF 0 "register_operand" "=f,f")
4121 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4122 (match_operand:DF 2 "general_operand" "f,R")))
4123 (clobber (reg:CC 33))]
4124 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4128 [(set_attr "op_type" "RRE,RXE")
4129 (set_attr "type" "fsimpd,fsimpd")])
4131 (define_insn "*subdf3_cc"
4133 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4134 (match_operand:DF 2 "general_operand" "f,R"))
4135 (match_operand:DF 3 "const0_operand" "")))
4136 (set (match_operand:DF 0 "register_operand" "=f,f")
4137 (plus:DF (match_dup 1) (match_dup 2)))]
4138 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4142 [(set_attr "op_type" "RRE,RXE")
4143 (set_attr "type" "fsimpd,fsimpd")])
4145 (define_insn "*subdf3_cconly"
4147 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4148 (match_operand:DF 2 "general_operand" "f,R"))
4149 (match_operand:DF 3 "const0_operand" "")))
4150 (clobber (match_scratch:DF 0 "=f,f"))]
4151 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4155 [(set_attr "op_type" "RRE,RXE")
4156 (set_attr "type" "fsimpd,fsimpd")])
4158 (define_insn "*subdf3_ibm"
4159 [(set (match_operand:DF 0 "register_operand" "=f,f")
4160 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4161 (match_operand:DF 2 "general_operand" "f,R")))
4162 (clobber (reg:CC 33))]
4163 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4167 [(set_attr "op_type" "RR,RX")
4168 (set_attr "type" "fsimpd,fsimpd")])
4171 ; subsf3 instruction pattern(s).
4174 (define_expand "subsf3"
4176 [(set (match_operand:SF 0 "register_operand" "=f,f")
4177 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4178 (match_operand:SF 2 "general_operand" "f,R")))
4179 (clobber (reg:CC 33))])]
4183 (define_insn "*subsf3"
4184 [(set (match_operand:SF 0 "register_operand" "=f,f")
4185 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4186 (match_operand:SF 2 "general_operand" "f,R")))
4187 (clobber (reg:CC 33))]
4188 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4192 [(set_attr "op_type" "RRE,RXE")
4193 (set_attr "type" "fsimps,fsimps")])
4195 (define_insn "*subsf3_cc"
4197 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4198 (match_operand:SF 2 "general_operand" "f,R"))
4199 (match_operand:SF 3 "const0_operand" "")))
4200 (set (match_operand:SF 0 "register_operand" "=f,f")
4201 (minus:SF (match_dup 1) (match_dup 2)))]
4202 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4206 [(set_attr "op_type" "RRE,RXE")
4207 (set_attr "type" "fsimps,fsimps")])
4209 (define_insn "*subsf3_cconly"
4211 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4212 (match_operand:SF 2 "general_operand" "f,R"))
4213 (match_operand:SF 3 "const0_operand" "")))
4214 (clobber (match_scratch:SF 0 "=f,f"))]
4215 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4219 [(set_attr "op_type" "RRE,RXE")
4220 (set_attr "type" "fsimps,fsimps")])
4222 (define_insn "*subsf3_ibm"
4223 [(set (match_operand:SF 0 "register_operand" "=f,f")
4224 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4225 (match_operand:SF 2 "general_operand" "f,R")))
4226 (clobber (reg:CC 33))]
4227 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4231 [(set_attr "op_type" "RR,RX")
4232 (set_attr "type" "fsimps,fsimps")])
4236 ;;- Conditional add/subtract instructions.
4240 ; adddicc instruction pattern(s).
4243 (define_insn "*adddi3_alc_cc"
4246 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4247 (match_operand:DI 2 "general_operand" "d,m"))
4248 (match_operand:DI 3 "s390_alc_comparison" ""))
4250 (set (match_operand:DI 0 "register_operand" "=d,d")
4251 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4252 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4256 [(set_attr "op_type" "RRE,RXY")])
4258 (define_insn "*adddi3_alc"
4259 [(set (match_operand:DI 0 "register_operand" "=d,d")
4260 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4261 (match_operand:DI 2 "general_operand" "d,m"))
4262 (match_operand:DI 3 "s390_alc_comparison" "")))
4263 (clobber (reg:CC 33))]
4268 [(set_attr "op_type" "RRE,RXY")])
4270 (define_insn "*subdi3_slb_cc"
4273 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4274 (match_operand:DI 2 "general_operand" "d,m"))
4275 (match_operand:DI 3 "s390_slb_comparison" ""))
4277 (set (match_operand:DI 0 "register_operand" "=d,d")
4278 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4279 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4283 [(set_attr "op_type" "RRE,RXY")])
4285 (define_insn "*subdi3_slb"
4286 [(set (match_operand:DI 0 "register_operand" "=d,d")
4287 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4288 (match_operand:DI 2 "general_operand" "d,m"))
4289 (match_operand:DI 3 "s390_slb_comparison" "")))
4290 (clobber (reg:CC 33))]
4295 [(set_attr "op_type" "RRE,RXY")])
4297 (define_expand "adddicc"
4298 [(match_operand:DI 0 "register_operand" "")
4299 (match_operand 1 "comparison_operator" "")
4300 (match_operand:DI 2 "register_operand" "")
4301 (match_operand:DI 3 "const_int_operand" "")]
4303 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4304 s390_compare_op0, s390_compare_op1,
4305 operands[0], operands[2],
4306 operands[3])) FAIL; DONE;")
4309 ; addsicc instruction pattern(s).
4312 (define_insn "*addsi3_alc_cc"
4315 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4316 (match_operand:SI 2 "general_operand" "d,m"))
4317 (match_operand:SI 3 "s390_alc_comparison" ""))
4319 (set (match_operand:SI 0 "register_operand" "=d,d")
4320 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4321 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4325 [(set_attr "op_type" "RRE,RXY")])
4327 (define_insn "*addsi3_alc"
4328 [(set (match_operand:SI 0 "register_operand" "=d,d")
4329 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4330 (match_operand:SI 2 "general_operand" "d,m"))
4331 (match_operand:SI 3 "s390_alc_comparison" "")))
4332 (clobber (reg:CC 33))]
4337 [(set_attr "op_type" "RRE,RXY")])
4339 (define_insn "*subsi3_slb_cc"
4342 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4343 (match_operand:SI 2 "general_operand" "d,m"))
4344 (match_operand:SI 3 "s390_slb_comparison" ""))
4346 (set (match_operand:SI 0 "register_operand" "=d,d")
4347 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4348 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4352 [(set_attr "op_type" "RRE,RXY")])
4354 (define_insn "*subsi3_slb"
4355 [(set (match_operand:SI 0 "register_operand" "=d,d")
4356 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4357 (match_operand:SI 2 "general_operand" "d,m"))
4358 (match_operand:SI 3 "s390_slb_comparison" "")))
4359 (clobber (reg:CC 33))]
4364 [(set_attr "op_type" "RRE,RXY")])
4366 (define_expand "addsicc"
4367 [(match_operand:SI 0 "register_operand" "")
4368 (match_operand 1 "comparison_operator" "")
4369 (match_operand:SI 2 "register_operand" "")
4370 (match_operand:SI 3 "const_int_operand" "")]
4372 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4373 s390_compare_op0, s390_compare_op1,
4374 operands[0], operands[2],
4375 operands[3])) FAIL; DONE;")
4378 ; scond instruction pattern(s).
4381 (define_insn_and_split "*sconddi"
4382 [(set (match_operand:DI 0 "register_operand" "=&d")
4383 (match_operand:DI 1 "s390_alc_comparison" ""))
4384 (clobber (reg:CC 33))]
4387 "&& reload_completed"
4388 [(set (match_dup 0) (const_int 0))
4390 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4392 (clobber (reg:CC 33))])]
4394 [(set_attr "op_type" "NN")])
4396 (define_insn_and_split "*scondsi"
4397 [(set (match_operand:SI 0 "register_operand" "=&d")
4398 (match_operand:SI 1 "s390_alc_comparison" ""))
4399 (clobber (reg:CC 33))]
4402 "&& reload_completed"
4403 [(set (match_dup 0) (const_int 0))
4405 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4407 (clobber (reg:CC 33))])]
4409 [(set_attr "op_type" "NN")])
4411 (define_insn_and_split "*sconddi_neg"
4412 [(set (match_operand:DI 0 "register_operand" "=&d")
4413 (match_operand:DI 1 "s390_slb_comparison" ""))
4414 (clobber (reg:CC 33))]
4417 "&& reload_completed"
4418 [(set (match_dup 0) (const_int 0))
4420 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4422 (clobber (reg:CC 33))])
4424 [(set (match_dup 0) (neg:DI (match_dup 0)))
4425 (clobber (reg:CC 33))])]
4427 [(set_attr "op_type" "NN")])
4429 (define_insn_and_split "*scondsi_neg"
4430 [(set (match_operand:SI 0 "register_operand" "=&d")
4431 (match_operand:SI 1 "s390_slb_comparison" ""))
4432 (clobber (reg:CC 33))]
4435 "&& reload_completed"
4436 [(set (match_dup 0) (const_int 0))
4438 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4440 (clobber (reg:CC 33))])
4442 [(set (match_dup 0) (neg:SI (match_dup 0)))
4443 (clobber (reg:CC 33))])]
4445 [(set_attr "op_type" "NN")])
4447 (define_expand "sltu"
4448 [(match_operand:SI 0 "register_operand" "")]
4450 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4451 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4453 (define_expand "sgtu"
4454 [(match_operand:SI 0 "register_operand" "")]
4456 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4457 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4459 (define_expand "sleu"
4460 [(match_operand:SI 0 "register_operand" "")]
4462 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4463 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4465 (define_expand "sgeu"
4466 [(match_operand:SI 0 "register_operand" "")]
4468 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4469 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4473 ;;- Multiply instructions.
4477 ; muldi3 instruction pattern(s).
4480 (define_insn "*muldi3_sign"
4481 [(set (match_operand:DI 0 "register_operand" "=d,d")
4482 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4483 (match_operand:DI 1 "register_operand" "0,0")))]
4488 [(set_attr "op_type" "RRE,RXY")
4489 (set_attr "type" "imul")])
4491 (define_insn "muldi3"
4492 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4493 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4494 (match_operand:DI 2 "general_operand" "d,K,m")))]
4500 [(set_attr "op_type" "RRE,RI,RXY")
4501 (set_attr "type" "imul")])
4504 ; mulsi3 instruction pattern(s).
4507 (define_insn "*mulsi3_sign"
4508 [(set (match_operand:SI 0 "register_operand" "=d")
4509 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4510 (match_operand:SI 1 "register_operand" "0")))]
4513 [(set_attr "op_type" "RX")
4514 (set_attr "type" "imul")])
4516 (define_insn "mulsi3"
4517 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4518 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4519 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4526 [(set_attr "op_type" "RRE,RI,RX,RXY")
4527 (set_attr "type" "imul")])
4530 ; mulsidi3 instruction pattern(s).
4533 (define_insn "mulsidi3"
4534 [(set (match_operand:DI 0 "register_operand" "=d,d")
4535 (mult:DI (sign_extend:DI
4536 (match_operand:SI 1 "register_operand" "%0,0"))
4538 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4543 [(set_attr "op_type" "RR,RX")
4544 (set_attr "type" "imul")])
4547 ; umulsidi3 instruction pattern(s).
4550 (define_insn "umulsidi3"
4551 [(set (match_operand:DI 0 "register_operand" "=d,d")
4552 (mult:DI (zero_extend:DI
4553 (match_operand:SI 1 "register_operand" "%0,0"))
4555 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4556 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4560 [(set_attr "op_type" "RRE,RXY")
4561 (set_attr "type" "imul")])
4564 ; muldf3 instruction pattern(s).
4567 (define_expand "muldf3"
4568 [(set (match_operand:DF 0 "register_operand" "=f,f")
4569 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4570 (match_operand:DF 2 "general_operand" "f,R")))]
4574 (define_insn "*muldf3"
4575 [(set (match_operand:DF 0 "register_operand" "=f,f")
4576 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4577 (match_operand:DF 2 "general_operand" "f,R")))]
4578 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4582 [(set_attr "op_type" "RRE,RXE")
4583 (set_attr "type" "fmuld")])
4585 (define_insn "*muldf3_ibm"
4586 [(set (match_operand:DF 0 "register_operand" "=f,f")
4587 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4588 (match_operand:DF 2 "general_operand" "f,R")))]
4589 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4593 [(set_attr "op_type" "RR,RX")
4594 (set_attr "type" "fmuld")])
4596 (define_insn "*fmadddf"
4597 [(set (match_operand:DF 0 "register_operand" "=f,f")
4598 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4599 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4600 (match_operand:DF 3 "register_operand" "0,0")))]
4601 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4605 [(set_attr "op_type" "RRE,RXE")
4606 (set_attr "type" "fmuld")])
4608 (define_insn "*fmsubdf"
4609 [(set (match_operand:DF 0 "register_operand" "=f,f")
4610 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4611 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4612 (match_operand:DF 3 "register_operand" "0,0")))]
4613 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4617 [(set_attr "op_type" "RRE,RXE")
4618 (set_attr "type" "fmuld")])
4621 ; mulsf3 instruction pattern(s).
4624 (define_expand "mulsf3"
4625 [(set (match_operand:SF 0 "register_operand" "=f,f")
4626 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4627 (match_operand:SF 2 "general_operand" "f,R")))]
4631 (define_insn "*mulsf3"
4632 [(set (match_operand:SF 0 "register_operand" "=f,f")
4633 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4634 (match_operand:SF 2 "general_operand" "f,R")))]
4635 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4639 [(set_attr "op_type" "RRE,RXE")
4640 (set_attr "type" "fmuls")])
4642 (define_insn "*mulsf3_ibm"
4643 [(set (match_operand:SF 0 "register_operand" "=f,f")
4644 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4645 (match_operand:SF 2 "general_operand" "f,R")))]
4646 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4650 [(set_attr "op_type" "RR,RX")
4651 (set_attr "type" "fmuls")])
4653 (define_insn "*fmaddsf"
4654 [(set (match_operand:SF 0 "register_operand" "=f,f")
4655 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4656 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4657 (match_operand:SF 3 "register_operand" "0,0")))]
4658 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4662 [(set_attr "op_type" "RRE,RXE")
4663 (set_attr "type" "fmuls")])
4665 (define_insn "*fmsubsf"
4666 [(set (match_operand:SF 0 "register_operand" "=f,f")
4667 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4668 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4669 (match_operand:SF 3 "register_operand" "0,0")))]
4670 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4674 [(set_attr "op_type" "RRE,RXE")
4675 (set_attr "type" "fmuls")])
4678 ;;- Divide and modulo instructions.
4682 ; divmoddi4 instruction pattern(s).
4685 (define_expand "divmoddi4"
4686 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4687 (div:DI (match_operand:DI 1 "register_operand" "")
4688 (match_operand:DI 2 "general_operand" "")))
4689 (set (match_operand:DI 3 "general_operand" "")
4690 (mod:DI (match_dup 1) (match_dup 2)))])
4691 (clobber (match_dup 4))]
4694 rtx insn, div_equal, mod_equal;
4696 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4697 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4699 operands[4] = gen_reg_rtx(TImode);
4700 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4702 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4704 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4706 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4708 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4713 (define_insn "divmodtidi3"
4714 [(set (match_operand:TI 0 "register_operand" "=d,d")
4718 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4719 (match_operand:DI 2 "general_operand" "d,m")))
4721 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4726 [(set_attr "op_type" "RRE,RXY")
4727 (set_attr "type" "idiv")])
4729 (define_insn "divmodtisi3"
4730 [(set (match_operand:TI 0 "register_operand" "=d,d")
4734 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4736 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4739 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4744 [(set_attr "op_type" "RRE,RXY")
4745 (set_attr "type" "idiv")])
4748 ; udivmoddi4 instruction pattern(s).
4751 (define_expand "udivmoddi4"
4752 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4753 (udiv:DI (match_operand:DI 1 "general_operand" "")
4754 (match_operand:DI 2 "nonimmediate_operand" "")))
4755 (set (match_operand:DI 3 "general_operand" "")
4756 (umod:DI (match_dup 1) (match_dup 2)))])
4757 (clobber (match_dup 4))]
4760 rtx insn, div_equal, mod_equal, equal;
4762 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4763 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4764 equal = gen_rtx_IOR (TImode,
4765 gen_rtx_ASHIFT (TImode,
4766 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4768 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4770 operands[4] = gen_reg_rtx(TImode);
4771 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4772 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4773 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4774 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4776 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4778 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4780 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4782 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4784 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4789 (define_insn "udivmodtidi3"
4790 [(set (match_operand:TI 0 "register_operand" "=d,d")
4795 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4797 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4801 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4806 [(set_attr "op_type" "RRE,RXY")
4807 (set_attr "type" "idiv")])
4810 ; divmodsi4 instruction pattern(s).
4813 (define_expand "divmodsi4"
4814 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4815 (div:SI (match_operand:SI 1 "general_operand" "")
4816 (match_operand:SI 2 "nonimmediate_operand" "")))
4817 (set (match_operand:SI 3 "general_operand" "")
4818 (mod:SI (match_dup 1) (match_dup 2)))])
4819 (clobber (match_dup 4))]
4822 rtx insn, div_equal, mod_equal, equal;
4824 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4825 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4826 equal = gen_rtx_IOR (DImode,
4827 gen_rtx_ASHIFT (DImode,
4828 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4830 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4832 operands[4] = gen_reg_rtx(DImode);
4833 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4834 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4836 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4838 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4840 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4842 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4844 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4849 (define_insn "divmoddisi3"
4850 [(set (match_operand:DI 0 "register_operand" "=d,d")
4855 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4857 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4861 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4866 [(set_attr "op_type" "RR,RX")
4867 (set_attr "type" "idiv")])
4870 ; udivsi3 and umodsi3 instruction pattern(s).
4873 (define_expand "udivmodsi4"
4874 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4875 (udiv:SI (match_operand:SI 1 "general_operand" "")
4876 (match_operand:SI 2 "nonimmediate_operand" "")))
4877 (set (match_operand:SI 3 "general_operand" "")
4878 (umod:SI (match_dup 1) (match_dup 2)))])
4879 (clobber (match_dup 4))]
4880 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4882 rtx insn, div_equal, mod_equal, equal;
4884 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4885 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4886 equal = gen_rtx_IOR (DImode,
4887 gen_rtx_ASHIFT (DImode,
4888 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4890 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4892 operands[4] = gen_reg_rtx(DImode);
4893 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4894 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4895 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4896 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4898 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4900 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4902 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4904 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4906 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4911 (define_insn "udivmoddisi3"
4912 [(set (match_operand:DI 0 "register_operand" "=d,d")
4917 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
4919 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4923 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
4924 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4928 [(set_attr "op_type" "RRE,RXY")
4929 (set_attr "type" "idiv")])
4931 (define_expand "udivsi3"
4932 [(set (match_operand:SI 0 "register_operand" "=d")
4933 (udiv:SI (match_operand:SI 1 "general_operand" "")
4934 (match_operand:SI 2 "general_operand" "")))
4935 (clobber (match_dup 3))]
4936 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4938 rtx insn, udiv_equal, umod_equal, equal;
4940 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4941 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4942 equal = gen_rtx_IOR (DImode,
4943 gen_rtx_ASHIFT (DImode,
4944 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4946 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4948 operands[3] = gen_reg_rtx (DImode);
4950 if (CONSTANT_P (operands[2]))
4952 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4954 rtx label1 = gen_label_rtx ();
4956 operands[1] = make_safe_from (operands[1], operands[0]);
4957 emit_move_insn (operands[0], const0_rtx);
4958 emit_insn (gen_cmpsi (operands[1], operands[2]));
4959 emit_jump_insn (gen_bltu (label1));
4960 emit_move_insn (operands[0], const1_rtx);
4961 emit_label (label1);
4965 operands[2] = force_reg (SImode, operands[2]);
4966 operands[2] = make_safe_from (operands[2], operands[0]);
4968 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4969 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4972 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4974 insn = emit_move_insn (operands[0],
4975 gen_lowpart (SImode, operands[3]));
4977 gen_rtx_EXPR_LIST (REG_EQUAL,
4978 udiv_equal, REG_NOTES (insn));
4983 rtx label1 = gen_label_rtx ();
4984 rtx label2 = gen_label_rtx ();
4985 rtx label3 = gen_label_rtx ();
4987 operands[1] = force_reg (SImode, operands[1]);
4988 operands[1] = make_safe_from (operands[1], operands[0]);
4989 operands[2] = force_reg (SImode, operands[2]);
4990 operands[2] = make_safe_from (operands[2], operands[0]);
4992 emit_move_insn (operands[0], const0_rtx);
4993 emit_insn (gen_cmpsi (operands[2], operands[1]));
4994 emit_jump_insn (gen_bgtu (label3));
4995 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4996 emit_jump_insn (gen_blt (label2));
4997 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4998 emit_jump_insn (gen_beq (label1));
4999 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5000 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5003 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5005 insn = emit_move_insn (operands[0],
5006 gen_lowpart (SImode, operands[3]));
5008 gen_rtx_EXPR_LIST (REG_EQUAL,
5009 udiv_equal, REG_NOTES (insn));
5011 emit_label (label1);
5012 emit_move_insn (operands[0], operands[1]);
5014 emit_label (label2);
5015 emit_move_insn (operands[0], const1_rtx);
5016 emit_label (label3);
5018 emit_move_insn (operands[0], operands[0]);
5022 (define_expand "umodsi3"
5023 [(set (match_operand:SI 0 "register_operand" "=d")
5024 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
5025 (match_operand:SI 2 "nonimmediate_operand" "")))
5026 (clobber (match_dup 3))]
5027 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
5029 rtx insn, udiv_equal, umod_equal, equal;
5031 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
5032 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
5033 equal = gen_rtx_IOR (DImode,
5034 gen_rtx_ASHIFT (DImode,
5035 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
5037 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
5039 operands[3] = gen_reg_rtx (DImode);
5041 if (CONSTANT_P (operands[2]))
5043 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
5045 rtx label1 = gen_label_rtx ();
5047 operands[1] = make_safe_from (operands[1], operands[0]);
5048 emit_move_insn (operands[0], operands[1]);
5049 emit_insn (gen_cmpsi (operands[0], operands[2]));
5050 emit_jump_insn (gen_bltu (label1));
5051 emit_insn (gen_abssi2 (operands[0], operands[2]));
5052 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
5053 emit_label (label1);
5057 operands[2] = force_reg (SImode, operands[2]);
5058 operands[2] = make_safe_from (operands[2], operands[0]);
5060 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5061 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5064 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5066 insn = emit_move_insn (operands[0],
5067 gen_highpart (SImode, operands[3]));
5069 gen_rtx_EXPR_LIST (REG_EQUAL,
5070 umod_equal, REG_NOTES (insn));
5075 rtx label1 = gen_label_rtx ();
5076 rtx label2 = gen_label_rtx ();
5077 rtx label3 = gen_label_rtx ();
5079 operands[1] = force_reg (SImode, operands[1]);
5080 operands[1] = make_safe_from (operands[1], operands[0]);
5081 operands[2] = force_reg (SImode, operands[2]);
5082 operands[2] = make_safe_from (operands[2], operands[0]);
5084 emit_move_insn(operands[0], operands[1]);
5085 emit_insn (gen_cmpsi (operands[2], operands[1]));
5086 emit_jump_insn (gen_bgtu (label3));
5087 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5088 emit_jump_insn (gen_blt (label2));
5089 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5090 emit_jump_insn (gen_beq (label1));
5091 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5092 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5095 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5097 insn = emit_move_insn (operands[0],
5098 gen_highpart (SImode, operands[3]));
5100 gen_rtx_EXPR_LIST (REG_EQUAL,
5101 umod_equal, REG_NOTES (insn));
5103 emit_label (label1);
5104 emit_move_insn (operands[0], const0_rtx);
5106 emit_label (label2);
5107 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5108 emit_label (label3);
5114 ; divdf3 instruction pattern(s).
5117 (define_expand "divdf3"
5118 [(set (match_operand:DF 0 "register_operand" "=f,f")
5119 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5120 (match_operand:DF 2 "general_operand" "f,R")))]
5124 (define_insn "*divdf3"
5125 [(set (match_operand:DF 0 "register_operand" "=f,f")
5126 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5127 (match_operand:DF 2 "general_operand" "f,R")))]
5128 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5132 [(set_attr "op_type" "RRE,RXE")
5133 (set_attr "type" "fdivd")])
5135 (define_insn "*divdf3_ibm"
5136 [(set (match_operand:DF 0 "register_operand" "=f,f")
5137 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5138 (match_operand:DF 2 "general_operand" "f,R")))]
5139 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5143 [(set_attr "op_type" "RR,RX")
5144 (set_attr "type" "fdivd")])
5147 ; divsf3 instruction pattern(s).
5150 (define_expand "divsf3"
5151 [(set (match_operand:SF 0 "register_operand" "=f,f")
5152 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5153 (match_operand:SF 2 "general_operand" "f,R")))]
5157 (define_insn "*divsf3"
5158 [(set (match_operand:SF 0 "register_operand" "=f,f")
5159 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5160 (match_operand:SF 2 "general_operand" "f,R")))]
5161 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5165 [(set_attr "op_type" "RRE,RXE")
5166 (set_attr "type" "fdivs")])
5168 (define_insn "*divsf3"
5169 [(set (match_operand:SF 0 "register_operand" "=f,f")
5170 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5171 (match_operand:SF 2 "general_operand" "f,R")))]
5172 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5176 [(set_attr "op_type" "RR,RX")
5177 (set_attr "type" "fdivs")])
5181 ;;- And instructions.
5185 ; anddi3 instruction pattern(s).
5188 (define_insn "*anddi3_cc"
5190 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5191 (match_operand:DI 2 "general_operand" "d,m"))
5193 (set (match_operand:DI 0 "register_operand" "=d,d")
5194 (and:DI (match_dup 1) (match_dup 2)))]
5195 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5199 [(set_attr "op_type" "RRE,RXY")])
5201 (define_insn "*anddi3_cconly"
5203 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5204 (match_operand:DI 2 "general_operand" "d,m"))
5206 (clobber (match_scratch:DI 0 "=d,d"))]
5207 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5211 [(set_attr "op_type" "RRE,RXY")])
5213 (define_insn "anddi3"
5214 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d")
5215 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0")
5216 (match_operand:DI 2 "general_operand"
5217 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m")))
5218 (clobber (reg:CC 33))]
5229 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")])
5231 (define_insn "*anddi3_ss"
5232 [(set (match_operand:DI 0 "s_operand" "=Q")
5233 (and:DI (match_dup 0)
5234 (match_operand:DI 1 "s_imm_operand" "Q")))
5235 (clobber (reg:CC 33))]
5238 [(set_attr "op_type" "SS")])
5240 (define_insn "*anddi3_ss_inv"
5241 [(set (match_operand:DI 0 "s_operand" "=Q")
5242 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
5244 (clobber (reg:CC 33))]
5247 [(set_attr "op_type" "SS")])
5250 ; andsi3 instruction pattern(s).
5253 (define_insn "*andsi3_cc"
5255 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5256 (match_operand:SI 2 "general_operand" "d,R,T"))
5258 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5259 (and:SI (match_dup 1) (match_dup 2)))]
5260 "s390_match_ccmode(insn, CCTmode)"
5265 [(set_attr "op_type" "RR,RX,RXY")])
5267 (define_insn "*andsi3_cconly"
5269 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5270 (match_operand:SI 2 "general_operand" "d,R,T"))
5272 (clobber (match_scratch:SI 0 "=d,d,d"))]
5273 "s390_match_ccmode(insn, CCTmode)"
5278 [(set_attr "op_type" "RR,RX,RXY")])
5280 (define_expand "andsi3"
5282 [(set (match_operand:SI 0 "register_operand" "")
5283 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5284 (match_operand:SI 2 "general_operand" "")))
5285 (clobber (reg:CC 33))])]
5289 (define_insn "*andsi3_zarch"
5290 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d")
5291 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0")
5292 (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T")))
5293 (clobber (reg:CC 33))]
5303 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")])
5305 (define_insn "*andsi3_esa"
5306 [(set (match_operand:SI 0 "register_operand" "=d,d")
5307 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
5308 (match_operand:SI 2 "general_operand" "d,R")))
5309 (clobber (reg:CC 33))]
5314 [(set_attr "op_type" "RR,RX")])
5316 (define_insn "*andsi3_ss"
5317 [(set (match_operand:SI 0 "s_operand" "=Q")
5318 (and:SI (match_dup 0)
5319 (match_operand:SI 1 "s_imm_operand" "Q")))
5320 (clobber (reg:CC 33))]
5323 [(set_attr "op_type" "SS")])
5325 (define_insn "*andsi3_ss_inv"
5326 [(set (match_operand:SI 0 "s_operand" "=Q")
5327 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
5329 (clobber (reg:CC 33))]
5332 [(set_attr "op_type" "SS")])
5335 ; andhi3 instruction pattern(s).
5338 (define_insn "*andhi3_ni"
5339 [(set (match_operand:HI 0 "register_operand" "=d,d")
5340 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
5341 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5342 (clobber (reg:CC 33))]
5347 [(set_attr "op_type" "RR,RI")])
5349 (define_insn "andhi3"
5350 [(set (match_operand:HI 0 "register_operand" "=d")
5351 (and:HI (match_operand:HI 1 "register_operand" "%0")
5352 (match_operand:HI 2 "nonmemory_operand" "d")))
5353 (clobber (reg:CC 33))]
5356 [(set_attr "op_type" "RR")])
5358 (define_insn "*andhi3_ss"
5359 [(set (match_operand:HI 0 "s_operand" "=Q")
5360 (and:HI (match_dup 0)
5361 (match_operand:HI 1 "s_imm_operand" "Q")))
5362 (clobber (reg:CC 33))]
5365 [(set_attr "op_type" "SS")])
5367 (define_insn "*andhi3_ss_inv"
5368 [(set (match_operand:HI 0 "s_operand" "=Q")
5369 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
5371 (clobber (reg:CC 33))]
5374 [(set_attr "op_type" "SS")])
5377 ; andqi3 instruction pattern(s).
5380 (define_insn "*andqi3_ni"
5381 [(set (match_operand:QI 0 "register_operand" "=d,d")
5382 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
5383 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5384 (clobber (reg:CC 33))]
5389 [(set_attr "op_type" "RR,RI")])
5391 (define_insn "andqi3"
5392 [(set (match_operand:QI 0 "register_operand" "=d")
5393 (and:QI (match_operand:QI 1 "register_operand" "%0")
5394 (match_operand:QI 2 "nonmemory_operand" "d")))
5395 (clobber (reg:CC 33))]
5398 [(set_attr "op_type" "RR")])
5400 (define_insn "*andqi3_ss"
5401 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5402 (and:QI (match_dup 0)
5403 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5404 (clobber (reg:CC 33))]
5410 [(set_attr "op_type" "SI,SIY,SS")])
5412 (define_insn "*andqi3_ss_inv"
5413 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5414 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5416 (clobber (reg:CC 33))]
5422 [(set_attr "op_type" "SI,SIY,SS")])
5426 ;;- Bit set (inclusive or) instructions.
5430 ; iordi3 instruction pattern(s).
5433 (define_insn "*iordi3_cc"
5435 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5436 (match_operand:DI 2 "general_operand" "d,m"))
5438 (set (match_operand:DI 0 "register_operand" "=d,d")
5439 (ior:DI (match_dup 1) (match_dup 2)))]
5440 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5444 [(set_attr "op_type" "RRE,RXY")])
5446 (define_insn "*iordi3_cconly"
5448 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5449 (match_operand:DI 2 "general_operand" "d,m"))
5451 (clobber (match_scratch:DI 0 "=d,d"))]
5452 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5456 [(set_attr "op_type" "RRE,RXY")])
5458 (define_insn "iordi3"
5459 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d")
5460 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0")
5461 (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m")))
5462 (clobber (reg:CC 33))]
5471 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")])
5473 (define_insn "*iordi3_ss"
5474 [(set (match_operand:DI 0 "s_operand" "=Q")
5475 (ior:DI (match_dup 0)
5476 (match_operand:DI 1 "s_imm_operand" "Q")))
5477 (clobber (reg:CC 33))]
5480 [(set_attr "op_type" "SS")])
5482 (define_insn "*iordi3_ss_inv"
5483 [(set (match_operand:DI 0 "s_operand" "=Q")
5484 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
5486 (clobber (reg:CC 33))]
5489 [(set_attr "op_type" "SS")])
5492 ; iorsi3 instruction pattern(s).
5495 (define_insn "*iorsi3_cc"
5497 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5498 (match_operand:SI 2 "general_operand" "d,R,T"))
5500 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5501 (ior:SI (match_dup 1) (match_dup 2)))]
5502 "s390_match_ccmode(insn, CCTmode)"
5507 [(set_attr "op_type" "RR,RX,RXY")])
5509 (define_insn "*iorsi3_cconly"
5511 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5512 (match_operand:SI 2 "general_operand" "d,R,T"))
5514 (clobber (match_scratch:SI 0 "=d,d,d"))]
5515 "s390_match_ccmode(insn, CCTmode)"
5520 [(set_attr "op_type" "RR,RX,RXY")])
5522 (define_expand "iorsi3"
5524 [(set (match_operand:SI 0 "register_operand" "")
5525 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5526 (match_operand:SI 2 "general_operand" "")))
5527 (clobber (reg:CC 33))])]
5531 (define_insn "iorsi3_zarch"
5532 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
5533 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0")
5534 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T")))
5535 (clobber (reg:CC 33))]
5543 [(set_attr "op_type" "RI,RI,RR,RX,RXY")])
5545 (define_insn "iorsi3_esa"
5546 [(set (match_operand:SI 0 "register_operand" "=d,d")
5547 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
5548 (match_operand:SI 2 "general_operand" "d,R")))
5549 (clobber (reg:CC 33))]
5554 [(set_attr "op_type" "RR,RX")])
5556 (define_insn "*iorsi3_ss"
5557 [(set (match_operand:SI 0 "s_operand" "=Q")
5558 (ior:SI (match_dup 0)
5559 (match_operand:SI 1 "s_imm_operand" "Q")))
5560 (clobber (reg:CC 33))]
5563 [(set_attr "op_type" "SS")])
5565 (define_insn "*iorsi3_ss_inv"
5566 [(set (match_operand:SI 0 "s_operand" "=Q")
5567 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
5569 (clobber (reg:CC 33))]
5572 [(set_attr "op_type" "SS")])
5575 ; iorhi3 instruction pattern(s).
5578 (define_insn "*iorhi3_oi"
5579 [(set (match_operand:HI 0 "register_operand" "=d,d")
5580 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
5581 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5582 (clobber (reg:CC 33))]
5587 [(set_attr "op_type" "RR,RI")])
5589 (define_insn "iorhi3"
5590 [(set (match_operand:HI 0 "register_operand" "=d")
5591 (ior:HI (match_operand:HI 1 "register_operand" "%0")
5592 (match_operand:HI 2 "nonmemory_operand" "d")))
5593 (clobber (reg:CC 33))]
5596 [(set_attr "op_type" "RR")])
5598 (define_insn "*iorhi3_ss"
5599 [(set (match_operand:HI 0 "s_operand" "=Q")
5600 (ior:HI (match_dup 0)
5601 (match_operand:HI 1 "s_imm_operand" "Q")))
5602 (clobber (reg:CC 33))]
5605 [(set_attr "op_type" "SS")])
5607 (define_insn "*iorhi3_ss_inv"
5608 [(set (match_operand:HI 0 "s_operand" "=Q")
5609 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
5611 (clobber (reg:CC 33))]
5614 [(set_attr "op_type" "SS")])
5617 ; iorqi3 instruction pattern(s).
5620 (define_insn "*iorqi3_oi"
5621 [(set (match_operand:QI 0 "register_operand" "=d,d")
5622 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
5623 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5624 (clobber (reg:CC 33))]
5629 [(set_attr "op_type" "RR,RI")])
5631 (define_insn "iorqi3"
5632 [(set (match_operand:QI 0 "register_operand" "=d")
5633 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5634 (match_operand:QI 2 "nonmemory_operand" "d")))
5635 (clobber (reg:CC 33))]
5638 [(set_attr "op_type" "RR")])
5640 (define_insn "*iorqi3_ss"
5641 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5642 (ior:QI (match_dup 0)
5643 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5644 (clobber (reg:CC 33))]
5650 [(set_attr "op_type" "SI,SIY,SS")])
5652 (define_insn "*iorqi3_ss_inv"
5653 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5654 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5656 (clobber (reg:CC 33))]
5662 [(set_attr "op_type" "SI,SIY,SS")])
5666 ;;- Xor instructions.
5670 ; xordi3 instruction pattern(s).
5673 (define_insn "*xordi3_cc"
5675 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5676 (match_operand:DI 2 "general_operand" "d,m"))
5678 (set (match_operand:DI 0 "register_operand" "=d,d")
5679 (xor:DI (match_dup 1) (match_dup 2)))]
5680 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5684 [(set_attr "op_type" "RRE,RXY")])
5686 (define_insn "*xordi3_cconly"
5688 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5689 (match_operand:DI 2 "general_operand" "d,m"))
5691 (clobber (match_scratch:DI 0 "=d,d"))]
5692 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5696 [(set_attr "op_type" "RRE,RXY")])
5698 (define_insn "xordi3"
5699 [(set (match_operand:DI 0 "register_operand" "=d,d")
5700 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5701 (match_operand:DI 2 "general_operand" "d,m")))
5702 (clobber (reg:CC 33))]
5707 [(set_attr "op_type" "RRE,RXY")])
5709 (define_insn "*xordi3_ss"
5710 [(set (match_operand:DI 0 "s_operand" "=Q")
5711 (xor:DI (match_dup 0)
5712 (match_operand:DI 1 "s_imm_operand" "Q")))
5713 (clobber (reg:CC 33))]
5716 [(set_attr "op_type" "SS")])
5718 (define_insn "*xordi3_ss_inv"
5719 [(set (match_operand:DI 0 "s_operand" "=Q")
5720 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5722 (clobber (reg:CC 33))]
5725 [(set_attr "op_type" "SS")])
5728 ; xorsi3 instruction pattern(s).
5731 (define_insn "*xorsi3_cc"
5733 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5734 (match_operand:SI 2 "general_operand" "d,R,T"))
5736 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5737 (xor:SI (match_dup 1) (match_dup 2)))]
5738 "s390_match_ccmode(insn, CCTmode)"
5743 [(set_attr "op_type" "RR,RX,RXY")])
5745 (define_insn "*xorsi3_cconly"
5747 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5748 (match_operand:SI 2 "general_operand" "d,R,T"))
5750 (clobber (match_scratch:SI 0 "=d,d,d"))]
5751 "s390_match_ccmode(insn, CCTmode)"
5756 [(set_attr "op_type" "RR,RX,RXY")])
5758 (define_insn "xorsi3"
5759 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5760 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5761 (match_operand:SI 2 "general_operand" "d,R,T")))
5762 (clobber (reg:CC 33))]
5768 [(set_attr "op_type" "RR,RX,RXY")])
5770 (define_insn "*xorsi3_ss"
5771 [(set (match_operand:SI 0 "s_operand" "=Q")
5772 (xor:SI (match_dup 0)
5773 (match_operand:SI 1 "s_imm_operand" "Q")))
5774 (clobber (reg:CC 33))]
5777 [(set_attr "op_type" "SS")])
5779 (define_insn "*xorsi3_ss_inv"
5780 [(set (match_operand:SI 0 "s_operand" "=Q")
5781 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5783 (clobber (reg:CC 33))]
5786 [(set_attr "op_type" "SS")])
5789 ; xorhi3 instruction pattern(s).
5792 (define_insn "xorhi3"
5793 [(set (match_operand:HI 0 "register_operand" "=d")
5794 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5795 (match_operand:HI 2 "nonmemory_operand" "d")))
5796 (clobber (reg:CC 33))]
5799 [(set_attr "op_type" "RR")])
5801 (define_insn "*xorhi3_ss"
5802 [(set (match_operand:HI 0 "s_operand" "=Q")
5803 (xor:HI (match_dup 0)
5804 (match_operand:HI 1 "s_imm_operand" "Q")))
5805 (clobber (reg:CC 33))]
5808 [(set_attr "op_type" "SS")])
5810 (define_insn "*xorhi3_ss_inv"
5811 [(set (match_operand:HI 0 "s_operand" "=Q")
5812 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5814 (clobber (reg:CC 33))]
5817 [(set_attr "op_type" "SS")])
5820 ; xorqi3 instruction pattern(s).
5823 (define_insn "xorqi3"
5824 [(set (match_operand:QI 0 "register_operand" "=d")
5825 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5826 (match_operand:QI 2 "nonmemory_operand" "d")))
5827 (clobber (reg:CC 33))]
5830 [(set_attr "op_type" "RR")])
5832 (define_insn "*xorqi3_ss"
5833 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5834 (xor:QI (match_dup 0)
5835 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5836 (clobber (reg:CC 33))]
5842 [(set_attr "op_type" "SI,SIY,SS")])
5844 (define_insn "*xorqi3_ss_inv"
5845 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5846 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5848 (clobber (reg:CC 33))]
5854 [(set_attr "op_type" "SI,SIY,SS")])
5858 ;;- Negate instructions.
5862 ; negdi2 instruction pattern(s).
5865 (define_expand "negdi2"
5867 [(set (match_operand:DI 0 "register_operand" "=d")
5868 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5869 (clobber (reg:CC 33))])]
5873 (define_insn "*negdi2_64"
5874 [(set (match_operand:DI 0 "register_operand" "=d")
5875 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5876 (clobber (reg:CC 33))]
5879 [(set_attr "op_type" "RR")])
5881 (define_insn "*negdi2_31"
5882 [(set (match_operand:DI 0 "register_operand" "=d")
5883 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5884 (clobber (reg:CC 33))]
5888 xop[0] = gen_label_rtx ();
5889 output_asm_insn ("lcr\t%0,%1", operands);
5890 output_asm_insn ("lcr\t%N0,%N1", operands);
5891 output_asm_insn ("je\t%l0", xop);
5892 output_asm_insn ("bctr\t%0,0", operands);
5893 targetm.asm_out.internal_label (asm_out_file, "L",
5894 CODE_LABEL_NUMBER (xop[0]));
5897 [(set_attr "op_type" "NN")
5898 (set_attr "type" "other")
5899 (set_attr "length" "10")])
5902 ; negsi2 instruction pattern(s).
5905 (define_insn "negsi2"
5906 [(set (match_operand:SI 0 "register_operand" "=d")
5907 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5908 (clobber (reg:CC 33))]
5911 [(set_attr "op_type" "RR")])
5914 ; negdf2 instruction pattern(s).
5917 (define_expand "negdf2"
5919 [(set (match_operand:DF 0 "register_operand" "=f")
5920 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5921 (clobber (reg:CC 33))])]
5925 (define_insn "*negdf2"
5926 [(set (match_operand:DF 0 "register_operand" "=f")
5927 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5928 (clobber (reg:CC 33))]
5929 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5931 [(set_attr "op_type" "RRE")
5932 (set_attr "type" "fsimpd")])
5934 (define_insn "*negdf2_ibm"
5935 [(set (match_operand:DF 0 "register_operand" "=f")
5936 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5937 (clobber (reg:CC 33))]
5938 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5940 [(set_attr "op_type" "RR")
5941 (set_attr "type" "fsimpd")])
5944 ; negsf2 instruction pattern(s).
5947 (define_expand "negsf2"
5949 [(set (match_operand:SF 0 "register_operand" "=f")
5950 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5951 (clobber (reg:CC 33))])]
5955 (define_insn "*negsf2"
5956 [(set (match_operand:SF 0 "register_operand" "=f")
5957 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5958 (clobber (reg:CC 33))]
5959 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5961 [(set_attr "op_type" "RRE")
5962 (set_attr "type" "fsimps")])
5964 (define_insn "*negsf2"
5965 [(set (match_operand:SF 0 "register_operand" "=f")
5966 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5967 (clobber (reg:CC 33))]
5968 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5970 [(set_attr "op_type" "RR")
5971 (set_attr "type" "fsimps")])
5975 ;;- Absolute value instructions.
5979 ; absdi2 instruction pattern(s).
5982 (define_insn "absdi2"
5983 [(set (match_operand:DI 0 "register_operand" "=d")
5984 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5985 (clobber (reg:CC 33))]
5988 [(set_attr "op_type" "RRE")])
5991 ; abssi2 instruction pattern(s).
5994 (define_insn "abssi2"
5995 [(set (match_operand:SI 0 "register_operand" "=d")
5996 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5997 (clobber (reg:CC 33))]
6000 [(set_attr "op_type" "RR")])
6003 ; absdf2 instruction pattern(s).
6006 (define_expand "absdf2"
6008 [(set (match_operand:DF 0 "register_operand" "=f")
6009 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6010 (clobber (reg:CC 33))])]
6014 (define_insn "*absdf2"
6015 [(set (match_operand:DF 0 "register_operand" "=f")
6016 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6017 (clobber (reg:CC 33))]
6018 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6020 [(set_attr "op_type" "RRE")
6021 (set_attr "type" "fsimpd")])
6023 (define_insn "*absdf2_ibm"
6024 [(set (match_operand:DF 0 "register_operand" "=f")
6025 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6026 (clobber (reg:CC 33))]
6027 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6029 [(set_attr "op_type" "RR")
6030 (set_attr "type" "fsimpd")])
6033 ; abssf2 instruction pattern(s).
6036 (define_expand "abssf2"
6038 [(set (match_operand:SF 0 "register_operand" "=f")
6039 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6040 (clobber (reg:CC 33))])]
6044 (define_insn "*abssf2"
6045 [(set (match_operand:SF 0 "register_operand" "=f")
6046 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6047 (clobber (reg:CC 33))]
6048 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6050 [(set_attr "op_type" "RRE")
6051 (set_attr "type" "fsimps")])
6053 (define_insn "*abssf2_ibm"
6054 [(set (match_operand:SF 0 "register_operand" "=f")
6055 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6056 (clobber (reg:CC 33))]
6057 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6059 [(set_attr "op_type" "RR")
6060 (set_attr "type" "fsimps")])
6063 ;;- Negated absolute value instructions
6070 (define_insn "*negabssi2"
6071 [(set (match_operand:SI 0 "register_operand" "=d")
6072 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
6073 (clobber (reg:CC 33))]
6076 [(set_attr "op_type" "RR")])
6078 (define_insn "*negabsdi2"
6079 [(set (match_operand:DI 0 "register_operand" "=d")
6080 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
6081 (clobber (reg:CC 33))]
6084 [(set_attr "op_type" "RRE")])
6090 (define_insn "*negabssf2"
6091 [(set (match_operand:SF 0 "register_operand" "=f")
6092 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6093 (clobber (reg:CC 33))]
6094 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6096 [(set_attr "op_type" "RRE")
6097 (set_attr "type" "fsimps")])
6099 (define_insn "*negabsdf2"
6100 [(set (match_operand:DF 0 "register_operand" "=f")
6101 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6102 (clobber (reg:CC 33))]
6103 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6105 [(set_attr "op_type" "RRE")
6106 (set_attr "type" "fsimpd")])
6109 ;;- Square root instructions.
6113 ; sqrtdf2 instruction pattern(s).
6116 (define_insn "sqrtdf2"
6117 [(set (match_operand:DF 0 "register_operand" "=f,f")
6118 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6119 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6123 [(set_attr "op_type" "RRE,RXE")])
6126 ; sqrtsf2 instruction pattern(s).
6129 (define_insn "sqrtsf2"
6130 [(set (match_operand:SF 0 "register_operand" "=f,f")
6131 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6132 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6136 [(set_attr "op_type" "RRE,RXE")])
6139 ;;- One complement instructions.
6143 ; one_cmpldi2 instruction pattern(s).
6146 (define_expand "one_cmpldi2"
6148 [(set (match_operand:DI 0 "register_operand" "")
6149 (xor:DI (match_operand:DI 1 "register_operand" "")
6151 (clobber (reg:CC 33))])]
6156 ; one_cmplsi2 instruction pattern(s).
6159 (define_expand "one_cmplsi2"
6161 [(set (match_operand:SI 0 "register_operand" "")
6162 (xor:SI (match_operand:SI 1 "register_operand" "")
6164 (clobber (reg:CC 33))])]
6169 ; one_cmplhi2 instruction pattern(s).
6172 (define_expand "one_cmplhi2"
6174 [(set (match_operand:HI 0 "register_operand" "")
6175 (xor:HI (match_operand:HI 1 "register_operand" "")
6177 (clobber (reg:CC 33))])]
6182 ; one_cmplqi2 instruction pattern(s).
6185 (define_expand "one_cmplqi2"
6187 [(set (match_operand:QI 0 "register_operand" "")
6188 (xor:QI (match_operand:QI 1 "register_operand" "")
6190 (clobber (reg:CC 33))])]
6196 ;;- Rotate instructions.
6200 ; rotldi3 instruction pattern(s).
6203 (define_insn "rotldi3"
6204 [(set (match_operand:DI 0 "register_operand" "=d")
6205 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6206 (match_operand:SI 2 "shift_count_operand" "Y")))]
6209 [(set_attr "op_type" "RSE")
6210 (set_attr "atype" "reg")])
6213 ; rotlsi3 instruction pattern(s).
6216 (define_insn "rotlsi3"
6217 [(set (match_operand:SI 0 "register_operand" "=d")
6218 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6219 (match_operand:SI 2 "shift_count_operand" "Y")))]
6222 [(set_attr "op_type" "RSE")
6223 (set_attr "atype" "reg")])
6227 ;;- Arithmetic shift instructions.
6231 ; ashldi3 instruction pattern(s).
6234 (define_expand "ashldi3"
6235 [(set (match_operand:DI 0 "register_operand" "")
6236 (ashift:DI (match_operand:DI 1 "register_operand" "")
6237 (match_operand:SI 2 "shift_count_operand" "")))]
6241 (define_insn "*ashldi3_31"
6242 [(set (match_operand:DI 0 "register_operand" "=d")
6243 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6244 (match_operand:SI 2 "shift_count_operand" "Y")))]
6247 [(set_attr "op_type" "RS")
6248 (set_attr "atype" "reg")])
6250 (define_insn "*ashldi3_64"
6251 [(set (match_operand:DI 0 "register_operand" "=d")
6252 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6253 (match_operand:SI 2 "shift_count_operand" "Y")))]
6256 [(set_attr "op_type" "RSE")
6257 (set_attr "atype" "reg")])
6260 ; ashrdi3 instruction pattern(s).
6263 (define_expand "ashrdi3"
6265 [(set (match_operand:DI 0 "register_operand" "")
6266 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6267 (match_operand:SI 2 "shift_count_operand" "")))
6268 (clobber (reg:CC 33))])]
6272 (define_insn "*ashrdi3_cc_31"
6274 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6275 (match_operand:SI 2 "shift_count_operand" "Y"))
6277 (set (match_operand:DI 0 "register_operand" "=d")
6278 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6279 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6281 [(set_attr "op_type" "RS")
6282 (set_attr "atype" "reg")])
6284 (define_insn "*ashrdi3_cconly_31"
6286 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6287 (match_operand:SI 2 "shift_count_operand" "Y"))
6289 (clobber (match_scratch:DI 0 "=d"))]
6290 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6292 [(set_attr "op_type" "RS")
6293 (set_attr "atype" "reg")])
6295 (define_insn "*ashrdi3_31"
6296 [(set (match_operand:DI 0 "register_operand" "=d")
6297 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6298 (match_operand:SI 2 "shift_count_operand" "Y")))
6299 (clobber (reg:CC 33))]
6302 [(set_attr "op_type" "RS")
6303 (set_attr "atype" "reg")])
6305 (define_insn "*ashrdi3_cc_64"
6307 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6308 (match_operand:SI 2 "shift_count_operand" "Y"))
6310 (set (match_operand:DI 0 "register_operand" "=d")
6311 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6312 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6314 [(set_attr "op_type" "RSE")
6315 (set_attr "atype" "reg")])
6317 (define_insn "*ashrdi3_cconly_64"
6319 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6320 (match_operand:SI 2 "shift_count_operand" "Y"))
6322 (clobber (match_scratch:DI 0 "=d"))]
6323 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6325 [(set_attr "op_type" "RSE")
6326 (set_attr "atype" "reg")])
6328 (define_insn "*ashrdi3_64"
6329 [(set (match_operand:DI 0 "register_operand" "=d")
6330 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6331 (match_operand:SI 2 "shift_count_operand" "Y")))
6332 (clobber (reg:CC 33))]
6335 [(set_attr "op_type" "RSE")
6336 (set_attr "atype" "reg")])
6340 ; ashlsi3 instruction pattern(s).
6343 (define_insn "ashlsi3"
6344 [(set (match_operand:SI 0 "register_operand" "=d")
6345 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6346 (match_operand:SI 2 "shift_count_operand" "Y")))]
6349 [(set_attr "op_type" "RS")
6350 (set_attr "atype" "reg")])
6353 ; ashrsi3 instruction pattern(s).
6356 (define_insn "*ashrsi3_cc"
6358 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6359 (match_operand:SI 2 "shift_count_operand" "Y"))
6361 (set (match_operand:SI 0 "register_operand" "=d")
6362 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6363 "s390_match_ccmode(insn, CCSmode)"
6365 [(set_attr "op_type" "RS")
6366 (set_attr "atype" "reg")])
6369 (define_insn "*ashrsi3_cconly"
6371 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6372 (match_operand:SI 2 "shift_count_operand" "Y"))
6374 (clobber (match_scratch:SI 0 "=d"))]
6375 "s390_match_ccmode(insn, CCSmode)"
6377 [(set_attr "op_type" "RS")
6378 (set_attr "atype" "reg")])
6380 (define_insn "ashrsi3"
6381 [(set (match_operand:SI 0 "register_operand" "=d")
6382 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6383 (match_operand:SI 2 "shift_count_operand" "Y")))
6384 (clobber (reg:CC 33))]
6387 [(set_attr "op_type" "RS")
6388 (set_attr "atype" "reg")])
6392 ;;- logical shift instructions.
6396 ; lshrdi3 instruction pattern(s).
6399 (define_expand "lshrdi3"
6400 [(set (match_operand:DI 0 "register_operand" "")
6401 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6402 (match_operand:SI 2 "shift_count_operand" "")))]
6406 (define_insn "*lshrdi3_31"
6407 [(set (match_operand:DI 0 "register_operand" "=d")
6408 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6409 (match_operand:SI 2 "shift_count_operand" "Y")))]
6412 [(set_attr "op_type" "RS")
6413 (set_attr "atype" "reg")])
6415 (define_insn "*lshrdi3_64"
6416 [(set (match_operand:DI 0 "register_operand" "=d")
6417 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6418 (match_operand:SI 2 "shift_count_operand" "Y")))]
6421 [(set_attr "op_type" "RSE")
6422 (set_attr "atype" "reg")])
6425 ; lshrsi3 instruction pattern(s).
6428 (define_insn "lshrsi3"
6429 [(set (match_operand:SI 0 "register_operand" "=d")
6430 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6431 (match_operand:SI 2 "shift_count_operand" "Y")))]
6434 [(set_attr "op_type" "RS")
6435 (set_attr "atype" "reg")])
6439 ;; Branch instruction patterns.
6442 (define_expand "beq"
6443 [(match_operand 0 "" "")]
6445 "s390_emit_jump (operands[0],
6446 s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
6448 (define_expand "bne"
6449 [(match_operand 0 "" "")]
6451 "s390_emit_jump (operands[0],
6452 s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
6454 (define_expand "bgt"
6455 [(match_operand 0 "" "")]
6457 "s390_emit_jump (operands[0],
6458 s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
6460 (define_expand "bgtu"
6461 [(match_operand 0 "" "")]
6463 "s390_emit_jump (operands[0],
6464 s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
6466 (define_expand "blt"
6467 [(match_operand 0 "" "")]
6469 "s390_emit_jump (operands[0],
6470 s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
6472 (define_expand "bltu"
6473 [(match_operand 0 "" "")]
6475 "s390_emit_jump (operands[0],
6476 s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
6478 (define_expand "bge"
6479 [(match_operand 0 "" "")]
6481 "s390_emit_jump (operands[0],
6482 s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
6484 (define_expand "bgeu"
6485 [(match_operand 0 "" "")]
6487 "s390_emit_jump (operands[0],
6488 s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
6490 (define_expand "ble"
6491 [(match_operand 0 "" "")]
6493 "s390_emit_jump (operands[0],
6494 s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
6496 (define_expand "bleu"
6497 [(match_operand 0 "" "")]
6499 "s390_emit_jump (operands[0],
6500 s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
6502 (define_expand "bunordered"
6503 [(match_operand 0 "" "")]
6505 "s390_emit_jump (operands[0],
6506 s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6508 (define_expand "bordered"
6509 [(match_operand 0 "" "")]
6511 "s390_emit_jump (operands[0],
6512 s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6514 (define_expand "buneq"
6515 [(match_operand 0 "" "")]
6517 "s390_emit_jump (operands[0],
6518 s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
6520 (define_expand "bunlt"
6521 [(match_operand 0 "" "")]
6523 "s390_emit_jump (operands[0],
6524 s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
6526 (define_expand "bungt"
6527 [(match_operand 0 "" "")]
6529 "s390_emit_jump (operands[0],
6530 s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
6532 (define_expand "bunle"
6533 [(match_operand 0 "" "")]
6535 "s390_emit_jump (operands[0],
6536 s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
6538 (define_expand "bunge"
6539 [(match_operand 0 "" "")]
6541 "s390_emit_jump (operands[0],
6542 s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
6544 (define_expand "bltgt"
6545 [(match_operand 0 "" "")]
6547 "s390_emit_jump (operands[0],
6548 s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
6552 ;;- Conditional jump instructions.
6555 (define_insn "*cjump_64"
6558 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6559 (label_ref (match_operand 0 "" ""))
6563 if (get_attr_length (insn) == 4)
6566 return "jg%C1\t%l0";
6568 [(set_attr "op_type" "RI")
6569 (set_attr "type" "branch")
6570 (set (attr "length")
6571 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6572 (const_int 4) (const_int 6)))])
6574 (define_insn "*cjump_31"
6577 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6578 (label_ref (match_operand 0 "" ""))
6582 if (get_attr_length (insn) == 4)
6587 [(set_attr "op_type" "RI")
6588 (set_attr "type" "branch")
6589 (set (attr "length")
6590 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6591 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6592 (const_int 4) (const_int 6))
6593 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6594 (const_int 4) (const_int 8))))])
6596 (define_insn "*cjump_long"
6599 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6600 (match_operand 0 "address_operand" "U")
6604 if (get_attr_op_type (insn) == OP_TYPE_RR)
6609 [(set (attr "op_type")
6610 (if_then_else (match_operand 0 "register_operand" "")
6611 (const_string "RR") (const_string "RX")))
6612 (set_attr "type" "branch")
6613 (set_attr "atype" "agen")])
6617 ;;- Negated conditional jump instructions.
6620 (define_insn "*icjump_64"
6623 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6625 (label_ref (match_operand 0 "" ""))))]
6628 if (get_attr_length (insn) == 4)
6631 return "jg%D1\t%l0";
6633 [(set_attr "op_type" "RI")
6634 (set_attr "type" "branch")
6635 (set (attr "length")
6636 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6637 (const_int 4) (const_int 6)))])
6639 (define_insn "*icjump_31"
6642 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6644 (label_ref (match_operand 0 "" ""))))]
6647 if (get_attr_length (insn) == 4)
6652 [(set_attr "op_type" "RI")
6653 (set_attr "type" "branch")
6654 (set (attr "length")
6655 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6656 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6657 (const_int 4) (const_int 6))
6658 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6659 (const_int 4) (const_int 8))))])
6661 (define_insn "*icjump_long"
6664 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6666 (match_operand 0 "address_operand" "U")))]
6669 if (get_attr_op_type (insn) == OP_TYPE_RR)
6674 [(set (attr "op_type")
6675 (if_then_else (match_operand 0 "register_operand" "")
6676 (const_string "RR") (const_string "RX")))
6677 (set_attr "type" "branch")
6678 (set_attr "atype" "agen")])
6681 ;;- Trap instructions.
6685 [(trap_if (const_int 1) (const_int 0))]
6688 [(set_attr "op_type" "RI")
6689 (set_attr "type" "branch")])
6691 (define_expand "conditional_trap"
6692 [(trap_if (match_operand 0 "comparison_operator" "")
6693 (match_operand 1 "general_operand" ""))]
6696 if (operands[1] != const0_rtx) FAIL;
6697 operands[0] = s390_emit_compare (GET_CODE (operands[0]),
6698 s390_compare_op0, s390_compare_op1);
6701 (define_insn "*trap"
6702 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6706 [(set_attr "op_type" "RI")
6707 (set_attr "type" "branch")])
6710 ;;- Loop instructions.
6712 ;; This is all complicated by the fact that since this is a jump insn
6713 ;; we must handle our own output reloads.
6715 (define_expand "doloop_end"
6716 [(use (match_operand 0 "" "")) ; loop pseudo
6717 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6718 (use (match_operand 2 "" "")) ; max iterations
6719 (use (match_operand 3 "" "")) ; loop level
6720 (use (match_operand 4 "" ""))] ; label
6723 if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
6724 emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
6725 else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
6726 emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
6727 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6728 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6735 (define_insn_and_split "doloop_si64"
6738 (ne (match_operand:SI 1 "register_operand" "d,d")
6740 (label_ref (match_operand 0 "" ""))
6742 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6743 (plus:SI (match_dup 1) (const_int -1)))
6744 (clobber (match_scratch:SI 3 "=X,&d"))
6745 (clobber (reg:CC 33))]
6748 if (which_alternative != 0)
6750 else if (get_attr_length (insn) == 4)
6751 return "brct\t%1,%l0";
6753 return "ahi\t%1,-1\;jgne\t%l0";
6755 "&& reload_completed
6756 && (! REG_P (operands[2])
6757 || ! rtx_equal_p (operands[1], operands[2]))"
6758 [(set (match_dup 3) (match_dup 1))
6759 (parallel [(set (reg:CCAN 33)
6760 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6762 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6763 (set (match_dup 2) (match_dup 3))
6764 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6765 (label_ref (match_dup 0))
6768 [(set_attr "op_type" "RI")
6769 (set_attr "type" "branch")
6770 (set (attr "length")
6771 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6772 (const_int 4) (const_int 10)))])
6774 (define_insn_and_split "doloop_si31"
6777 (ne (match_operand:SI 1 "register_operand" "d,d")
6779 (label_ref (match_operand 0 "" ""))
6781 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6782 (plus:SI (match_dup 1) (const_int -1)))
6783 (clobber (match_scratch:SI 3 "=X,&d"))
6784 (clobber (reg:CC 33))]
6787 if (which_alternative != 0)
6789 else if (get_attr_length (insn) == 4)
6790 return "brct\t%1,%l0";
6794 "&& reload_completed
6795 && (! REG_P (operands[2])
6796 || ! rtx_equal_p (operands[1], operands[2]))"
6797 [(set (match_dup 3) (match_dup 1))
6798 (parallel [(set (reg:CCAN 33)
6799 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6801 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6802 (set (match_dup 2) (match_dup 3))
6803 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6804 (label_ref (match_dup 0))
6807 [(set_attr "op_type" "RI")
6808 (set_attr "type" "branch")
6809 (set (attr "length")
6810 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6811 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6812 (const_int 4) (const_int 6))
6813 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6814 (const_int 4) (const_int 8))))])
6816 (define_insn "*doloop_si_long"
6819 (ne (match_operand:SI 1 "register_operand" "d,d")
6821 (match_operand 0 "address_operand" "U,U")
6823 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6824 (plus:SI (match_dup 1) (const_int -1)))
6825 (clobber (match_scratch:SI 3 "=X,&d"))
6826 (clobber (reg:CC 33))]
6829 if (get_attr_op_type (insn) == OP_TYPE_RR)
6830 return "bctr\t%1,%0";
6832 return "bct\t%1,%a0";
6834 [(set (attr "op_type")
6835 (if_then_else (match_operand 0 "register_operand" "")
6836 (const_string "RR") (const_string "RX")))
6837 (set_attr "type" "branch")
6838 (set_attr "atype" "agen")])
6840 (define_insn_and_split "doloop_di"
6843 (ne (match_operand:DI 1 "register_operand" "d,d")
6845 (label_ref (match_operand 0 "" ""))
6847 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*r")
6848 (plus:DI (match_dup 1) (const_int -1)))
6849 (clobber (match_scratch:DI 3 "=X,&d"))
6850 (clobber (reg:CC 33))]
6853 if (which_alternative != 0)
6855 else if (get_attr_length (insn) == 4)
6856 return "brctg\t%1,%l0";
6858 return "aghi\t%1,-1\;jgne\t%l0";
6860 "&& reload_completed
6861 && (! REG_P (operands[2])
6862 || ! rtx_equal_p (operands[1], operands[2]))"
6863 [(set (match_dup 3) (match_dup 1))
6864 (parallel [(set (reg:CCAN 33)
6865 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6867 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6868 (set (match_dup 2) (match_dup 3))
6869 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6870 (label_ref (match_dup 0))
6873 [(set_attr "op_type" "RI")
6874 (set_attr "type" "branch")
6875 (set (attr "length")
6876 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6877 (const_int 4) (const_int 10)))])
6880 ;;- Unconditional jump instructions.
6884 ; jump instruction pattern(s).
6887 (define_expand "jump"
6888 [(match_operand 0 "" "")]
6890 "s390_emit_jump (operands[0], NULL_RTX); DONE;")
6892 (define_insn "*jump64"
6893 [(set (pc) (label_ref (match_operand 0 "" "")))]
6896 if (get_attr_length (insn) == 4)
6901 [(set_attr "op_type" "RI")
6902 (set_attr "type" "branch")
6903 (set (attr "length")
6904 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6905 (const_int 4) (const_int 6)))])
6907 (define_insn "*jump31"
6908 [(set (pc) (label_ref (match_operand 0 "" "")))]
6911 if (get_attr_length (insn) == 4)
6916 [(set_attr "op_type" "RI")
6917 (set_attr "type" "branch")
6918 (set (attr "length")
6919 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6920 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6921 (const_int 4) (const_int 6))
6922 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6923 (const_int 4) (const_int 8))))])
6926 ; indirect-jump instruction pattern(s).
6929 (define_insn "indirect_jump"
6930 [(set (pc) (match_operand 0 "address_operand" "U"))]
6933 if (get_attr_op_type (insn) == OP_TYPE_RR)
6938 [(set (attr "op_type")
6939 (if_then_else (match_operand 0 "register_operand" "")
6940 (const_string "RR") (const_string "RX")))
6941 (set_attr "type" "branch")
6942 (set_attr "atype" "agen")])
6945 ; casesi instruction pattern(s).
6948 (define_insn "casesi_jump"
6949 [(set (pc) (match_operand 0 "address_operand" "U"))
6950 (use (label_ref (match_operand 1 "" "")))]
6953 if (get_attr_op_type (insn) == OP_TYPE_RR)
6958 [(set (attr "op_type")
6959 (if_then_else (match_operand 0 "register_operand" "")
6960 (const_string "RR") (const_string "RX")))
6961 (set_attr "type" "branch")
6962 (set_attr "atype" "agen")])
6964 (define_expand "casesi"
6965 [(match_operand:SI 0 "general_operand" "")
6966 (match_operand:SI 1 "general_operand" "")
6967 (match_operand:SI 2 "general_operand" "")
6968 (label_ref (match_operand 3 "" ""))
6969 (label_ref (match_operand 4 "" ""))]
6972 rtx index = gen_reg_rtx (SImode);
6973 rtx base = gen_reg_rtx (Pmode);
6974 rtx target = gen_reg_rtx (Pmode);
6976 emit_move_insn (index, operands[0]);
6977 emit_insn (gen_subsi3 (index, index, operands[1]));
6978 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6981 if (Pmode != SImode)
6982 index = convert_to_mode (Pmode, index, 1);
6983 if (GET_CODE (index) != REG)
6984 index = copy_to_mode_reg (Pmode, index);
6987 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6989 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
6991 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6993 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
6994 RTX_UNCHANGING_P (index) = 1;
6995 MEM_NOTRAP_P (index) = 1;
6996 emit_move_insn (target, index);
6999 target = gen_rtx_PLUS (Pmode, base, target);
7000 emit_jump_insn (gen_casesi_jump (target, operands[3]));
7007 ;;- Jump to subroutine.
7012 ; untyped call instruction pattern(s).
7015 ;; Call subroutine returning any type.
7016 (define_expand "untyped_call"
7017 [(parallel [(call (match_operand 0 "" "")
7019 (match_operand 1 "" "")
7020 (match_operand 2 "" "")])]
7025 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
7027 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7029 rtx set = XVECEXP (operands[2], 0, i);
7030 emit_move_insn (SET_DEST (set), SET_SRC (set));
7033 /* The optimizer does not know that the call sets the function value
7034 registers we stored in the result block. We avoid problems by
7035 claiming that all hard registers are used and clobbered at this
7037 emit_insn (gen_blockage ());
7042 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7043 ;; all of memory. This blocks insns from being moved across this point.
7045 (define_insn "blockage"
7046 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7049 [(set_attr "type" "none")
7050 (set_attr "length" "0")])
7056 (define_expand "sibcall"
7057 [(call (match_operand 0 "" "")
7058 (match_operand 1 "" ""))]
7061 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
7065 (define_insn "*sibcall_br"
7066 [(call (mem:QI (reg 1))
7067 (match_operand 0 "const_int_operand" "n"))]
7068 "SIBLING_CALL_P (insn)
7069 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
7071 [(set_attr "op_type" "RR")
7072 (set_attr "type" "branch")
7073 (set_attr "atype" "agen")])
7075 (define_insn "*sibcall_brc"
7076 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7077 (match_operand 1 "const_int_operand" "n"))]
7078 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7080 [(set_attr "op_type" "RI")
7081 (set_attr "type" "branch")])
7083 (define_insn "*sibcall_brcl"
7084 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7085 (match_operand 1 "const_int_operand" "n"))]
7086 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7088 [(set_attr "op_type" "RIL")
7089 (set_attr "type" "branch")])
7092 ; sibcall_value patterns
7095 (define_expand "sibcall_value"
7096 [(set (match_operand 0 "" "")
7097 (call (match_operand 1 "" "")
7098 (match_operand 2 "" "")))]
7101 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7105 (define_insn "*sibcall_value_br"
7106 [(set (match_operand 0 "" "")
7107 (call (mem:QI (reg 1))
7108 (match_operand 1 "const_int_operand" "n")))]
7109 "SIBLING_CALL_P (insn)
7110 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7112 [(set_attr "op_type" "RR")
7113 (set_attr "type" "branch")
7114 (set_attr "atype" "agen")])
7116 (define_insn "*sibcall_value_brc"
7117 [(set (match_operand 0 "" "")
7118 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7119 (match_operand 2 "const_int_operand" "n")))]
7120 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7122 [(set_attr "op_type" "RI")
7123 (set_attr "type" "branch")])
7125 (define_insn "*sibcall_value_brcl"
7126 [(set (match_operand 0 "" "")
7127 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7128 (match_operand 2 "const_int_operand" "n")))]
7129 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7131 [(set_attr "op_type" "RIL")
7132 (set_attr "type" "branch")])
7136 ; call instruction pattern(s).
7139 (define_expand "call"
7140 [(call (match_operand 0 "" "")
7141 (match_operand 1 "" ""))
7142 (use (match_operand 2 "" ""))]
7145 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7146 gen_rtx_REG (Pmode, RETURN_REGNUM));
7150 (define_insn "*bras"
7151 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7152 (match_operand 1 "const_int_operand" "n"))
7153 (clobber (match_operand 2 "register_operand" "=r"))]
7154 "!SIBLING_CALL_P (insn)
7155 && TARGET_SMALL_EXEC
7156 && GET_MODE (operands[2]) == Pmode"
7158 [(set_attr "op_type" "RI")
7159 (set_attr "type" "jsr")])
7161 (define_insn "*brasl"
7162 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7163 (match_operand 1 "const_int_operand" "n"))
7164 (clobber (match_operand 2 "register_operand" "=r"))]
7165 "!SIBLING_CALL_P (insn)
7167 && GET_MODE (operands[2]) == Pmode"
7169 [(set_attr "op_type" "RIL")
7170 (set_attr "type" "jsr")])
7172 (define_insn "*basr"
7173 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7174 (match_operand 1 "const_int_operand" "n"))
7175 (clobber (match_operand 2 "register_operand" "=r"))]
7176 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7178 if (get_attr_op_type (insn) == OP_TYPE_RR)
7179 return "basr\t%2,%0";
7181 return "bas\t%2,%a0";
7183 [(set (attr "op_type")
7184 (if_then_else (match_operand 0 "register_operand" "")
7185 (const_string "RR") (const_string "RX")))
7186 (set_attr "type" "jsr")
7187 (set_attr "atype" "agen")])
7190 ; call_value instruction pattern(s).
7193 (define_expand "call_value"
7194 [(set (match_operand 0 "" "")
7195 (call (match_operand 1 "" "")
7196 (match_operand 2 "" "")))
7197 (use (match_operand 3 "" ""))]
7200 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7201 gen_rtx_REG (Pmode, RETURN_REGNUM));
7205 (define_insn "*bras_r"
7206 [(set (match_operand 0 "" "")
7207 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7208 (match_operand:SI 2 "const_int_operand" "n")))
7209 (clobber (match_operand 3 "register_operand" "=r"))]
7210 "!SIBLING_CALL_P (insn)
7211 && TARGET_SMALL_EXEC
7212 && GET_MODE (operands[3]) == Pmode"
7214 [(set_attr "op_type" "RI")
7215 (set_attr "type" "jsr")])
7217 (define_insn "*brasl_r"
7218 [(set (match_operand 0 "" "")
7219 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7220 (match_operand 2 "const_int_operand" "n")))
7221 (clobber (match_operand 3 "register_operand" "=r"))]
7222 "!SIBLING_CALL_P (insn)
7224 && GET_MODE (operands[3]) == Pmode"
7226 [(set_attr "op_type" "RIL")
7227 (set_attr "type" "jsr")])
7229 (define_insn "*basr_r"
7230 [(set (match_operand 0 "" "")
7231 (call (mem:QI (match_operand 1 "address_operand" "U"))
7232 (match_operand 2 "const_int_operand" "n")))
7233 (clobber (match_operand 3 "register_operand" "=r"))]
7234 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7236 if (get_attr_op_type (insn) == OP_TYPE_RR)
7237 return "basr\t%3,%1";
7239 return "bas\t%3,%a1";
7241 [(set (attr "op_type")
7242 (if_then_else (match_operand 1 "register_operand" "")
7243 (const_string "RR") (const_string "RX")))
7244 (set_attr "type" "jsr")
7245 (set_attr "atype" "agen")])
7248 ;;- Thread-local storage support.
7251 (define_insn "get_tp_64"
7252 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
7253 (unspec:DI [(const_int 0)] UNSPEC_TP))]
7256 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
7258 [(set_attr "op_type" "NN,RS")
7259 (set_attr "atype" "reg,*")
7260 (set_attr "type" "o3,*")
7261 (set_attr "length" "14,*")])
7263 (define_insn "get_tp_31"
7264 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
7265 (unspec:SI [(const_int 0)] UNSPEC_TP))]
7270 [(set_attr "op_type" "RRE,RS")])
7272 (define_insn "set_tp_64"
7273 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
7274 (clobber (match_scratch:SI 1 "=d,X"))]
7277 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
7279 [(set_attr "op_type" "NN,RS")
7280 (set_attr "atype" "reg,*")
7281 (set_attr "type" "o3,*")
7282 (set_attr "length" "14,*")])
7284 (define_insn "set_tp_31"
7285 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
7290 [(set_attr "op_type" "RRE,RS")])
7292 (define_insn "*tls_load_64"
7293 [(set (match_operand:DI 0 "register_operand" "=d")
7294 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7295 (match_operand:DI 2 "" "")]
7299 [(set_attr "op_type" "RXE")])
7301 (define_insn "*tls_load_31"
7302 [(set (match_operand:SI 0 "register_operand" "=d,d")
7303 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7304 (match_operand:SI 2 "" "")]
7310 [(set_attr "op_type" "RX,RXY")])
7312 (define_insn "*bras_tls"
7313 [(set (match_operand 0 "" "")
7314 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7315 (match_operand 2 "const_int_operand" "n")))
7316 (clobber (match_operand 3 "register_operand" "=r"))
7317 (use (match_operand 4 "" ""))]
7318 "!SIBLING_CALL_P (insn)
7319 && TARGET_SMALL_EXEC
7320 && GET_MODE (operands[3]) == Pmode"
7322 [(set_attr "op_type" "RI")
7323 (set_attr "type" "jsr")])
7325 (define_insn "*brasl_tls"
7326 [(set (match_operand 0 "" "")
7327 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7328 (match_operand 2 "const_int_operand" "n")))
7329 (clobber (match_operand 3 "register_operand" "=r"))
7330 (use (match_operand 4 "" ""))]
7331 "!SIBLING_CALL_P (insn)
7333 && GET_MODE (operands[3]) == Pmode"
7335 [(set_attr "op_type" "RIL")
7336 (set_attr "type" "jsr")])
7338 (define_insn "*basr_tls"
7339 [(set (match_operand 0 "" "")
7340 (call (mem:QI (match_operand 1 "address_operand" "U"))
7341 (match_operand 2 "const_int_operand" "n")))
7342 (clobber (match_operand 3 "register_operand" "=r"))
7343 (use (match_operand 4 "" ""))]
7344 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7346 if (get_attr_op_type (insn) == OP_TYPE_RR)
7347 return "basr\t%3,%1%J4";
7349 return "bas\t%3,%a1%J4";
7351 [(set (attr "op_type")
7352 (if_then_else (match_operand 1 "register_operand" "")
7353 (const_string "RR") (const_string "RX")))
7354 (set_attr "type" "jsr")
7355 (set_attr "atype" "agen")])
7358 ;;- Miscellaneous instructions.
7362 ; allocate stack instruction pattern(s).
7365 (define_expand "allocate_stack"
7367 (plus (reg 15) (match_operand 1 "general_operand" "")))
7368 (set (match_operand 0 "general_operand" "")
7372 rtx stack = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
7373 rtx chain = gen_rtx_MEM (Pmode, stack);
7374 rtx temp = gen_reg_rtx (Pmode);
7376 emit_move_insn (temp, chain);
7379 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7381 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7383 emit_move_insn (chain, temp);
7385 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7391 ; setjmp instruction pattern.
7394 (define_expand "builtin_setjmp_receiver"
7395 [(match_operand 0 "" "")]
7398 emit_insn (s390_load_got ());
7399 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7403 ;; These patterns say how to save and restore the stack pointer. We need not
7404 ;; save the stack pointer at function level since we are careful to
7405 ;; preserve the backchain. At block level, we have to restore the backchain
7406 ;; when we restore the stack pointer.
7408 ;; For nonlocal gotos, we must save both the stack pointer and its
7409 ;; backchain and restore both. Note that in the nonlocal case, the
7410 ;; save area is a memory location.
7412 (define_expand "save_stack_function"
7413 [(match_operand 0 "general_operand" "")
7414 (match_operand 1 "general_operand" "")]
7418 (define_expand "restore_stack_function"
7419 [(match_operand 0 "general_operand" "")
7420 (match_operand 1 "general_operand" "")]
7424 (define_expand "restore_stack_block"
7425 [(use (match_operand 0 "register_operand" ""))
7426 (set (match_dup 2) (match_dup 3))
7427 (set (match_dup 0) (match_operand 1 "register_operand" ""))
7428 (set (match_dup 3) (match_dup 2))]
7431 operands[2] = gen_reg_rtx (Pmode);
7432 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7435 (define_expand "save_stack_nonlocal"
7436 [(match_operand 0 "memory_operand" "")
7437 (match_operand 1 "register_operand" "")]
7440 rtx temp = gen_reg_rtx (Pmode);
7442 /* Copy the backchain to the first word, sp to the second and the literal pool
7443 base to the third. */
7444 emit_move_insn (operand_subword (operands[0], 2, 0,
7445 TARGET_64BIT ? OImode : TImode),
7446 gen_rtx_REG (Pmode, BASE_REGISTER));
7447 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7448 emit_move_insn (operand_subword (operands[0], 0, 0,
7449 TARGET_64BIT ? OImode : TImode),
7451 emit_move_insn (operand_subword (operands[0], 1, 0,
7452 TARGET_64BIT ? OImode : TImode),
7457 (define_expand "restore_stack_nonlocal"
7458 [(match_operand 0 "register_operand" "")
7459 (match_operand 1 "memory_operand" "")]
7462 rtx temp = gen_reg_rtx (Pmode);
7463 rtx base = gen_rtx_REG (Pmode, BASE_REGISTER);
7465 /* Restore the backchain from the first word, sp from the second and the
7466 literal pool base from the third. */
7467 emit_move_insn (temp,
7468 operand_subword (operands[1], 0, 0,
7469 TARGET_64BIT ? OImode : TImode));
7470 emit_move_insn (operands[0],
7471 operand_subword (operands[1], 1, 0,
7472 TARGET_64BIT ? OImode : TImode));
7473 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7474 emit_move_insn (base,
7475 operand_subword (operands[1], 2, 0,
7476 TARGET_64BIT ? OImode : TImode));
7477 emit_insn (gen_rtx_USE (VOIDmode, base));
7484 ; nop instruction pattern(s).
7491 [(set_attr "op_type" "RR")])
7495 ; Special literal pool access instruction pattern(s).
7498 (define_insn "*pool_entry"
7499 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7500 UNSPECV_POOL_ENTRY)]
7503 enum machine_mode mode = GET_MODE (PATTERN (insn));
7504 unsigned int align = GET_MODE_BITSIZE (mode);
7505 s390_output_pool_entry (operands[0], mode, align);
7508 [(set_attr "op_type" "NN")
7509 (set (attr "length")
7510 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7512 (define_insn "pool_start_31"
7513 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7516 [(set_attr "op_type" "NN")
7517 (set_attr "length" "2")])
7519 (define_insn "pool_end_31"
7520 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7523 [(set_attr "op_type" "NN")
7524 (set_attr "length" "2")])
7526 (define_insn "pool_start_64"
7527 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7529 ".section\t.rodata\;.align\t8"
7530 [(set_attr "op_type" "NN")
7531 (set_attr "length" "0")])
7533 (define_insn "pool_end_64"
7534 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7537 [(set_attr "op_type" "NN")
7538 (set_attr "length" "0")])
7540 (define_insn "main_base_31_small"
7541 [(set (match_operand 0 "register_operand" "=a")
7542 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7543 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7545 [(set_attr "op_type" "RR")
7546 (set_attr "type" "la")])
7548 (define_insn "main_base_31_large"
7549 [(set (match_operand 0 "register_operand" "=a")
7550 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7551 (set (pc) (label_ref (match_operand 2 "" "")))]
7552 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7554 [(set_attr "op_type" "RI")])
7556 (define_insn "main_base_64"
7557 [(set (match_operand 0 "register_operand" "=a")
7558 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7559 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7561 [(set_attr "op_type" "RIL")
7562 (set_attr "type" "larl")])
7564 (define_insn "main_pool"
7565 [(set (match_operand 0 "register_operand" "=a")
7566 (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
7567 "GET_MODE (operands[0]) == Pmode"
7569 [(set_attr "op_type" "NN")])
7571 (define_insn "reload_base_31"
7572 [(set (match_operand 0 "register_operand" "=a")
7573 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7574 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7575 "basr\t%0,0\;la\t%0,%1-.(%0)"
7576 [(set_attr "op_type" "NN")
7577 (set_attr "type" "la")
7578 (set_attr "length" "6")])
7580 (define_insn "reload_base_64"
7581 [(set (match_operand 0 "register_operand" "=a")
7582 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7583 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7585 [(set_attr "op_type" "RIL")
7586 (set_attr "type" "larl")])
7589 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7592 [(set_attr "op_type" "NN")
7593 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7596 ;; Insns related to generating the function prologue and epilogue.
7600 (define_expand "prologue"
7601 [(use (const_int 0))]
7603 "s390_emit_prologue (); DONE;")
7605 (define_insn "prologue_tpf"
7606 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7607 (clobber (reg:DI 1))]
7608 "TARGET_TPF_PROFILING"
7610 [(set_attr "type" "jsr")
7611 (set_attr "op_type" "RX")])
7613 (define_expand "epilogue"
7614 [(use (const_int 1))]
7616 "s390_emit_epilogue (false); DONE;")
7618 (define_insn "epilogue_tpf"
7619 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7620 (clobber (reg:DI 1))]
7621 "TARGET_TPF_PROFILING"
7623 [(set_attr "type" "jsr")
7624 (set_attr "op_type" "RX")])
7627 (define_expand "sibcall_epilogue"
7628 [(use (const_int 0))]
7630 "s390_emit_epilogue (true); DONE;")
7632 (define_insn "*return"
7634 (use (match_operand 0 "register_operand" "a"))]
7635 "GET_MODE (operands[0]) == Pmode"
7637 [(set_attr "op_type" "RR")
7638 (set_attr "type" "jsr")
7639 (set_attr "atype" "agen")])
7642 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7643 ;; pointer. This is used for compatibility.
7645 (define_expand "ptr_extend"
7646 [(set (match_operand:DI 0 "register_operand" "=r")
7647 (match_operand:SI 1 "register_operand" "r"))]
7650 emit_insn (gen_anddi3 (operands[0],
7651 gen_lowpart (DImode, operands[1]),
7652 GEN_INT (0x7fffffff)));