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)
1343 rtx tmp = gen_reg_rtx (SImode);
1344 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1345 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1346 operands[1] = gen_lowpart (HImode, tmp);
1350 (define_insn "*movhi"
1351 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1352 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1362 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1363 (set_attr "type" "lr,*,*,*,store,store,cs")])
1366 [(set (match_operand:HI 0 "register_operand" "")
1367 (mem:HI (match_operand 1 "address_operand" "")))]
1368 "GET_CODE (operands[1]) == SYMBOL_REF
1369 && CONSTANT_POOL_ADDRESS_P (operands[1])
1370 && get_pool_mode (operands[1]) == HImode
1371 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1372 [(set (match_dup 0) (match_dup 2))]
1373 "operands[2] = get_pool_constant (operands[1]);")
1376 ; movqi instruction pattern(s).
1379 (define_expand "movqi"
1380 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1381 (match_operand:QI 1 "general_operand" ""))]
1384 /* On z/Architecture, zero-extending from memory to register
1385 is just as fast as a QImode load. */
1386 if (TARGET_ZARCH && optimize && !no_new_pseudos
1387 && register_operand (operands[0], VOIDmode)
1388 && GET_CODE (operands[1]) == MEM)
1390 rtx tmp = gen_reg_rtx (word_mode);
1391 rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
1392 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1393 operands[1] = gen_lowpart (QImode, tmp);
1397 (define_insn "*movqi"
1398 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1399 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1411 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1412 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1415 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1416 (mem:QI (match_operand 1 "address_operand" "")))]
1417 "GET_CODE (operands[1]) == SYMBOL_REF
1418 && CONSTANT_POOL_ADDRESS_P (operands[1])
1419 && get_pool_mode (operands[1]) == QImode
1420 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1421 [(set (match_dup 0) (match_dup 2))]
1422 "operands[2] = get_pool_constant (operands[1]);")
1425 ; movstrictqi instruction pattern(s).
1428 (define_insn "*movstrictqi"
1429 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1430 (match_operand:QI 1 "memory_operand" "R,T"))]
1435 [(set_attr "op_type" "RX,RXY")])
1438 ; movstricthi instruction pattern(s).
1441 (define_insn "*movstricthi"
1442 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1443 (match_operand:HI 1 "s_imm_operand" "Q,S"))
1444 (clobber (reg:CC 33))]
1449 [(set_attr "op_type" "RS,RSY")])
1452 ; movstrictsi instruction pattern(s).
1455 (define_insn "movstrictsi"
1456 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1457 (match_operand:SI 1 "general_operand" "d,R,T"))]
1463 [(set_attr "op_type" "RR,RX,RXY")
1464 (set_attr "type" "lr,load,load")])
1467 ; movdf instruction pattern(s).
1470 (define_expand "movdf"
1471 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1472 (match_operand:DF 1 "general_operand" ""))]
1475 /* During and after reload, we need to force constants
1476 to the literal pool ourselves, if necessary. */
1477 if ((reload_in_progress || reload_completed)
1478 && CONSTANT_P (operands[1]))
1479 operands[1] = force_const_mem (DFmode, operands[1]);
1482 (define_insn "*movdf_64"
1483 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1484 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1496 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1497 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1499 (define_insn "*movdf_31"
1500 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1501 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1514 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1515 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1518 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1519 (match_operand:DF 1 "general_operand" ""))]
1520 "!TARGET_64BIT && reload_completed
1521 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1522 [(set (match_dup 2) (match_dup 4))
1523 (set (match_dup 3) (match_dup 5))]
1525 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1526 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1527 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1528 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1532 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1533 (match_operand:DF 1 "general_operand" ""))]
1534 "!TARGET_64BIT && reload_completed
1535 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1536 [(set (match_dup 2) (match_dup 4))
1537 (set (match_dup 3) (match_dup 5))]
1539 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1540 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1541 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1542 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1546 [(set (match_operand:DF 0 "register_operand" "")
1547 (match_operand:DF 1 "memory_operand" ""))]
1548 "!TARGET_64BIT && reload_completed
1549 && !FP_REG_P (operands[0])
1550 && !s_operand (operands[1], VOIDmode)"
1551 [(set (match_dup 0) (match_dup 1))]
1553 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1554 s390_load_address (addr, XEXP (operands[1], 0));
1555 operands[1] = replace_equiv_address (operands[1], addr);
1558 (define_expand "reload_outdf"
1559 [(parallel [(match_operand:DF 0 "memory_operand" "")
1560 (match_operand:DF 1 "register_operand" "d")
1561 (match_operand:SI 2 "register_operand" "=&a")])]
1564 s390_load_address (operands[2], XEXP (operands[0], 0));
1565 operands[0] = replace_equiv_address (operands[0], operands[2]);
1566 emit_move_insn (operands[0], operands[1]);
1571 ; movsf instruction pattern(s).
1574 (define_expand "movsf"
1575 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1576 (match_operand:SF 1 "general_operand" ""))]
1579 /* During and after reload, we need to force constants
1580 to the literal pool ourselves, if necessary. */
1581 if ((reload_in_progress || reload_completed)
1582 && CONSTANT_P (operands[1]))
1583 operands[1] = force_const_mem (SFmode, operands[1]);
1586 (define_insn "*movsf"
1587 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1588 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1602 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1603 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1606 ; load_multiple pattern(s).
1608 ; ??? Due to reload problems with replacing registers inside match_parallel
1609 ; we currently support load_multiple/store_multiple only after reload.
1612 (define_expand "load_multiple"
1613 [(match_par_dup 3 [(set (match_operand 0 "" "")
1614 (match_operand 1 "" ""))
1615 (use (match_operand 2 "" ""))])]
1618 enum machine_mode mode;
1624 /* Support only loading a constant number of fixed-point registers from
1625 memory and only bother with this if more than two */
1626 if (GET_CODE (operands[2]) != CONST_INT
1627 || INTVAL (operands[2]) < 2
1628 || INTVAL (operands[2]) > 16
1629 || GET_CODE (operands[1]) != MEM
1630 || GET_CODE (operands[0]) != REG
1631 || REGNO (operands[0]) >= 16)
1634 count = INTVAL (operands[2]);
1635 regno = REGNO (operands[0]);
1636 mode = GET_MODE (operands[0]);
1637 if (mode != SImode && mode != word_mode)
1640 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1643 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1645 from = XEXP (operands[1], 0);
1648 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1649 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1650 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1652 from = XEXP (XEXP (operands[1], 0), 0);
1653 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1658 if (from == frame_pointer_rtx || from == arg_pointer_rtx)
1663 from = force_reg (Pmode, XEXP (operands[1], 0));
1667 for (i = 0; i < count; i++)
1668 XVECEXP (operands[3], 0, i)
1669 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1670 change_address (operands[1], mode,
1671 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1674 (define_insn "*load_multiple_di"
1675 [(match_parallel 0 "load_multiple_operation"
1676 [(set (match_operand:DI 1 "register_operand" "=r")
1677 (match_operand:DI 2 "s_operand" "QS"))])]
1678 "reload_completed && word_mode == DImode"
1680 int words = XVECLEN (operands[0], 0);
1681 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1682 return "lmg\t%1,%0,%2";
1684 [(set_attr "op_type" "RSY")
1685 (set_attr "type" "lm")])
1687 (define_insn "*load_multiple_si"
1688 [(match_parallel 0 "load_multiple_operation"
1689 [(set (match_operand:SI 1 "register_operand" "=r,r")
1690 (match_operand:SI 2 "s_operand" "Q,S"))])]
1693 int words = XVECLEN (operands[0], 0);
1694 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1695 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1697 [(set_attr "op_type" "RS,RSY")
1698 (set_attr "type" "lm")])
1701 ; store multiple pattern(s).
1704 (define_expand "store_multiple"
1705 [(match_par_dup 3 [(set (match_operand 0 "" "")
1706 (match_operand 1 "" ""))
1707 (use (match_operand 2 "" ""))])]
1710 enum machine_mode mode;
1716 /* Support only storing a constant number of fixed-point registers to
1717 memory and only bother with this if more than two. */
1718 if (GET_CODE (operands[2]) != CONST_INT
1719 || INTVAL (operands[2]) < 2
1720 || INTVAL (operands[2]) > 16
1721 || GET_CODE (operands[0]) != MEM
1722 || GET_CODE (operands[1]) != REG
1723 || REGNO (operands[1]) >= 16)
1726 count = INTVAL (operands[2]);
1727 regno = REGNO (operands[1]);
1728 mode = GET_MODE (operands[1]);
1729 if (mode != SImode && mode != word_mode)
1732 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1736 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1738 to = XEXP (operands[0], 0);
1741 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1742 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1743 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1745 to = XEXP (XEXP (operands[0], 0), 0);
1746 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1751 if (to == frame_pointer_rtx || to == arg_pointer_rtx)
1756 to = force_reg (Pmode, XEXP (operands[0], 0));
1760 for (i = 0; i < count; i++)
1761 XVECEXP (operands[3], 0, i)
1762 = gen_rtx_SET (VOIDmode,
1763 change_address (operands[0], mode,
1764 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1765 gen_rtx_REG (mode, regno + i));
1768 (define_insn "*store_multiple_di"
1769 [(match_parallel 0 "store_multiple_operation"
1770 [(set (match_operand:DI 1 "s_operand" "=QS")
1771 (match_operand:DI 2 "register_operand" "r"))])]
1772 "reload_completed && word_mode == DImode"
1774 int words = XVECLEN (operands[0], 0);
1775 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1776 return "stmg\t%2,%0,%1";
1778 [(set_attr "op_type" "RSY")
1779 (set_attr "type" "stm")])
1782 (define_insn "*store_multiple_si"
1783 [(match_parallel 0 "store_multiple_operation"
1784 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1785 (match_operand:SI 2 "register_operand" "r,r"))])]
1788 int words = XVECLEN (operands[0], 0);
1789 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1790 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1792 [(set_attr "op_type" "RS,RSY")
1793 (set_attr "type" "stm")])
1796 ;; String instructions.
1800 ; strlenM instruction pattern(s).
1803 (define_expand "strlendi"
1804 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1807 (unspec:DI [(const_int 0)
1808 (match_operand:BLK 1 "memory_operand" "")
1810 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1811 (clobber (scratch:DI))
1812 (clobber (reg:CC 33))])
1814 [(set (match_operand:DI 0 "register_operand" "")
1815 (minus:DI (match_dup 4) (match_dup 5)))
1816 (clobber (reg:CC 33))])]
1819 operands[4] = gen_reg_rtx (DImode);
1820 operands[5] = gen_reg_rtx (DImode);
1821 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1822 operands[1] = replace_equiv_address (operands[1], operands[5]);
1825 (define_insn "*strlendi"
1826 [(set (match_operand:DI 0 "register_operand" "=a")
1827 (unspec:DI [(match_operand:DI 2 "general_operand" "0")
1828 (mem:BLK (match_operand:DI 3 "register_operand" "1"))
1830 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1831 (clobber (match_scratch:DI 1 "=a"))
1832 (clobber (reg:CC 33))]
1834 "srst\t%0,%1\;jo\t.-4"
1835 [(set_attr "op_type" "NN")
1836 (set_attr "type" "vs")
1837 (set_attr "length" "8")])
1839 (define_expand "strlensi"
1840 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1843 (unspec:SI [(const_int 0)
1844 (match_operand:BLK 1 "memory_operand" "")
1846 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1847 (clobber (scratch:SI))
1848 (clobber (reg:CC 33))])
1850 [(set (match_operand:SI 0 "register_operand" "")
1851 (minus:SI (match_dup 4) (match_dup 5)))
1852 (clobber (reg:CC 33))])]
1855 operands[4] = gen_reg_rtx (SImode);
1856 operands[5] = gen_reg_rtx (SImode);
1857 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1858 operands[1] = replace_equiv_address (operands[1], operands[5]);
1861 (define_insn "*strlensi"
1862 [(set (match_operand:SI 0 "register_operand" "=a")
1863 (unspec:SI [(match_operand:SI 2 "general_operand" "0")
1864 (mem:BLK (match_operand:SI 3 "register_operand" "1"))
1866 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1867 (clobber (match_scratch:SI 1 "=a"))
1868 (clobber (reg:CC 33))]
1870 "srst\t%0,%1\;jo\t.-4"
1871 [(set_attr "op_type" "NN")
1872 (set_attr "type" "vs")
1873 (set_attr "length" "8")])
1876 ; movmemM instruction pattern(s).
1879 (define_expand "movmemdi"
1880 [(set (match_operand:BLK 0 "memory_operand" "")
1881 (match_operand:BLK 1 "memory_operand" ""))
1882 (use (match_operand:DI 2 "general_operand" ""))
1883 (match_operand 3 "" "")]
1885 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1887 (define_expand "movmemsi"
1888 [(set (match_operand:BLK 0 "memory_operand" "")
1889 (match_operand:BLK 1 "memory_operand" ""))
1890 (use (match_operand:SI 2 "general_operand" ""))
1891 (match_operand 3 "" "")]
1893 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1895 ; Move a block that is up to 256 bytes in length.
1896 ; The block length is taken as (operands[2] % 256) + 1.
1898 (define_expand "movmem_short"
1900 [(set (match_operand:BLK 0 "memory_operand" "")
1901 (match_operand:BLK 1 "memory_operand" ""))
1902 (use (match_operand 2 "nonmemory_operand" ""))
1903 (clobber (match_dup 3))])]
1905 "operands[3] = gen_rtx_SCRATCH (Pmode);")
1907 (define_insn "*movmem_short"
1908 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1909 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1910 (use (match_operand 2 "nonmemory_operand" "n,a"))
1911 (clobber (match_scratch 3 "=X,&a"))]
1912 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
1913 && GET_MODE (operands[3]) == Pmode"
1915 switch (which_alternative)
1918 return "mvc\t%O0(%b2+1,%R0),%1";
1921 output_asm_insn ("bras\t%3,.+10", operands);
1922 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1923 return "ex\t%2,0(%3)";
1929 [(set_attr "op_type" "SS,NN")
1930 (set_attr "type" "cs,cs")
1931 (set_attr "atype" "*,agen")
1932 (set_attr "length" "*,14")])
1934 ; Move a block of arbitrary length.
1936 (define_expand "movmem_long"
1938 [(clobber (match_dup 2))
1939 (clobber (match_dup 3))
1940 (set (match_operand:BLK 0 "memory_operand" "")
1941 (match_operand:BLK 1 "memory_operand" ""))
1942 (use (match_operand 2 "general_operand" ""))
1944 (clobber (reg:CC 33))])]
1947 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1948 rtx reg0 = gen_reg_rtx (dword_mode);
1949 rtx reg1 = gen_reg_rtx (dword_mode);
1950 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1951 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
1952 rtx len0 = gen_lowpart (Pmode, reg0);
1953 rtx len1 = gen_lowpart (Pmode, reg1);
1955 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1956 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1957 emit_move_insn (len0, operands[2]);
1959 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
1960 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
1961 emit_move_insn (len1, operands[2]);
1963 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1964 operands[1] = replace_equiv_address_nv (operands[1], addr1);
1969 (define_insn "*movmem_long_64"
1970 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1971 (clobber (match_operand:TI 1 "register_operand" "=d"))
1972 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1973 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
1976 (clobber (reg:CC 33))]
1978 "mvcle\t%0,%1,0\;jo\t.-4"
1979 [(set_attr "op_type" "NN")
1980 (set_attr "type" "vs")
1981 (set_attr "length" "8")])
1983 (define_insn "*movmem_long_31"
1984 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1985 (clobber (match_operand:DI 1 "register_operand" "=d"))
1986 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
1987 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
1990 (clobber (reg:CC 33))]
1992 "mvcle\t%0,%1,0\;jo\t.-4"
1993 [(set_attr "op_type" "NN")
1994 (set_attr "type" "vs")
1995 (set_attr "length" "8")])
1998 ; clrmemM instruction pattern(s).
2001 (define_expand "clrmemdi"
2002 [(set (match_operand:BLK 0 "memory_operand" "")
2004 (use (match_operand:DI 1 "general_operand" ""))
2005 (match_operand 2 "" "")]
2007 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
2009 (define_expand "clrmemsi"
2010 [(set (match_operand:BLK 0 "memory_operand" "")
2012 (use (match_operand:SI 1 "general_operand" ""))
2013 (match_operand 2 "" "")]
2015 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
2017 ; Clear a block that is up to 256 bytes in length.
2018 ; The block length is taken as (operands[1] % 256) + 1.
2020 (define_expand "clrmem_short"
2022 [(set (match_operand:BLK 0 "memory_operand" "")
2024 (use (match_operand 1 "nonmemory_operand" ""))
2025 (clobber (match_dup 2))
2026 (clobber (reg:CC 33))])]
2028 "operands[2] = gen_rtx_SCRATCH (Pmode);")
2030 (define_insn "*clrmem_short"
2031 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
2033 (use (match_operand 1 "nonmemory_operand" "n,a"))
2034 (clobber (match_scratch 2 "=X,&a"))
2035 (clobber (reg:CC 33))]
2036 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
2037 && GET_MODE (operands[2]) == Pmode"
2039 switch (which_alternative)
2042 return "xc\t%O0(%b1+1,%R0),%0";
2045 output_asm_insn ("bras\t%2,.+10", operands);
2046 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
2047 return "ex\t%1,0(%2)";
2053 [(set_attr "op_type" "SS,NN")
2054 (set_attr "type" "cs,cs")
2055 (set_attr "atype" "*,agen")
2056 (set_attr "length" "*,14")])
2058 ; Clear a block of arbitrary length.
2060 (define_expand "clrmem_long"
2062 [(clobber (match_dup 1))
2063 (set (match_operand:BLK 0 "memory_operand" "")
2065 (use (match_operand 1 "general_operand" ""))
2067 (clobber (reg:CC 33))])]
2070 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2071 rtx reg0 = gen_reg_rtx (dword_mode);
2072 rtx reg1 = gen_reg_rtx (dword_mode);
2073 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2074 rtx len0 = gen_lowpart (Pmode, reg0);
2076 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2077 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2078 emit_move_insn (len0, operands[1]);
2080 emit_move_insn (reg1, const0_rtx);
2082 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2087 (define_insn "*clrmem_long_64"
2088 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2089 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2092 (use (match_operand:TI 1 "register_operand" "d"))
2093 (clobber (reg:CC 33))]
2095 "mvcle\t%0,%1,0\;jo\t.-4"
2096 [(set_attr "op_type" "NN")
2097 (set_attr "type" "vs")
2098 (set_attr "length" "8")])
2100 (define_insn "*clrmem_long_31"
2101 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2102 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2105 (use (match_operand:DI 1 "register_operand" "d"))
2106 (clobber (reg:CC 33))]
2108 "mvcle\t%0,%1,0\;jo\t.-4"
2109 [(set_attr "op_type" "NN")
2110 (set_attr "type" "vs")
2111 (set_attr "length" "8")])
2114 ; cmpmemM instruction pattern(s).
2117 (define_expand "cmpmemdi"
2118 [(set (match_operand:DI 0 "register_operand" "")
2119 (compare:DI (match_operand:BLK 1 "memory_operand" "")
2120 (match_operand:BLK 2 "memory_operand" "") ) )
2121 (use (match_operand:DI 3 "general_operand" ""))
2122 (use (match_operand:DI 4 "" ""))]
2124 "s390_expand_cmpmem (operands[0], operands[1],
2125 operands[2], operands[3]); DONE;")
2127 (define_expand "cmpmemsi"
2128 [(set (match_operand:SI 0 "register_operand" "")
2129 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2130 (match_operand:BLK 2 "memory_operand" "") ) )
2131 (use (match_operand:SI 3 "general_operand" ""))
2132 (use (match_operand:SI 4 "" ""))]
2134 "s390_expand_cmpmem (operands[0], operands[1],
2135 operands[2], operands[3]); DONE;")
2137 ; Compare a block that is up to 256 bytes in length.
2138 ; The block length is taken as (operands[2] % 256) + 1.
2140 (define_expand "cmpmem_short"
2143 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2144 (match_operand:BLK 1 "memory_operand" "")))
2145 (use (match_operand 2 "nonmemory_operand" ""))
2146 (clobber (match_dup 3))])]
2148 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2150 (define_insn "*cmpmem_short"
2152 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2153 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2154 (use (match_operand 2 "nonmemory_operand" "n,a"))
2155 (clobber (match_scratch 3 "=X,&a"))]
2156 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2157 && GET_MODE (operands[3]) == Pmode"
2159 switch (which_alternative)
2162 return "clc\t%O0(%b2+1,%R0),%1";
2165 output_asm_insn ("bras\t%3,.+10", operands);
2166 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2167 return "ex\t%2,0(%3)";
2173 [(set_attr "op_type" "SS,NN")
2174 (set_attr "type" "cs,cs")
2175 (set_attr "atype" "*,agen")
2176 (set_attr "length" "*,14")])
2178 ; Compare a block of arbitrary length.
2180 (define_expand "cmpmem_long"
2182 [(clobber (match_dup 2))
2183 (clobber (match_dup 3))
2185 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2186 (match_operand:BLK 1 "memory_operand" "")))
2187 (use (match_operand 2 "general_operand" ""))
2188 (use (match_dup 3))])]
2191 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2192 rtx reg0 = gen_reg_rtx (dword_mode);
2193 rtx reg1 = gen_reg_rtx (dword_mode);
2194 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2195 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2196 rtx len0 = gen_lowpart (Pmode, reg0);
2197 rtx len1 = gen_lowpart (Pmode, reg1);
2199 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2200 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2201 emit_move_insn (len0, operands[2]);
2203 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2204 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2205 emit_move_insn (len1, operands[2]);
2207 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2208 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2213 (define_insn "*cmpmem_long_64"
2214 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2215 (clobber (match_operand:TI 1 "register_operand" "=d"))
2217 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2218 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2220 (use (match_dup 3))]
2222 "clcle\t%0,%1,0\;jo\t.-4"
2223 [(set_attr "op_type" "NN")
2224 (set_attr "type" "vs")
2225 (set_attr "length" "8")])
2227 (define_insn "*cmpmem_long_31"
2228 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2229 (clobber (match_operand:DI 1 "register_operand" "=d"))
2231 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2232 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2234 (use (match_dup 3))]
2236 "clcle\t%0,%1,0\;jo\t.-4"
2237 [(set_attr "op_type" "NN")
2238 (set_attr "type" "vs")
2239 (set_attr "length" "8")])
2241 ; Convert condition code to integer in range (-1, 0, 1)
2243 (define_insn "cmpint_si"
2244 [(set (match_operand:SI 0 "register_operand" "=d")
2245 (compare:SI (reg:CCS 33) (const_int 0)))]
2248 output_asm_insn ("lhi\t%0,1", operands);
2249 output_asm_insn ("jh\t.+12", operands);
2250 output_asm_insn ("jl\t.+6", operands);
2251 output_asm_insn ("sr\t%0,%0", operands);
2252 return "lcr\t%0,%0";
2254 [(set_attr "op_type" "NN")
2255 (set_attr "length" "16")
2256 (set_attr "type" "other")])
2258 (define_insn "cmpint_di"
2259 [(set (match_operand:DI 0 "register_operand" "=d")
2260 (compare:DI (reg:CCS 33) (const_int 0)))]
2263 output_asm_insn ("lghi\t%0,1", operands);
2264 output_asm_insn ("jh\t.+16", operands);
2265 output_asm_insn ("jl\t.+8", operands);
2266 output_asm_insn ("sgr\t%0,%0", operands);
2267 return "lcgr\t%0,%0";
2269 [(set_attr "op_type" "NN")
2270 (set_attr "length" "20")
2271 (set_attr "type" "other")])
2275 ;;- Conversion instructions.
2278 (define_insn "*sethighqisi"
2279 [(set (match_operand:SI 0 "register_operand" "=d,d")
2280 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2281 (clobber (reg:CC 33))]
2286 [(set_attr "op_type" "RS,RSY")])
2288 (define_insn "*sethighhisi"
2289 [(set (match_operand:SI 0 "register_operand" "=d,d")
2290 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2291 (clobber (reg:CC 33))]
2296 [(set_attr "op_type" "RS,RSY")])
2298 (define_insn "*sethighqidi_64"
2299 [(set (match_operand:DI 0 "register_operand" "=d")
2300 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2301 (clobber (reg:CC 33))]
2304 [(set_attr "op_type" "RSY")])
2306 (define_insn "*sethighqidi_31"
2307 [(set (match_operand:DI 0 "register_operand" "=d,d")
2308 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2309 (clobber (reg:CC 33))]
2314 [(set_attr "op_type" "RS,RSY")])
2316 (define_insn_and_split "*extractqi"
2317 [(set (match_operand:SI 0 "register_operand" "=d")
2318 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2319 (match_operand 2 "const_int_operand" "n")
2321 (clobber (reg:CC 33))]
2323 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2325 "&& reload_completed"
2327 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2328 (clobber (reg:CC 33))])
2329 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2331 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2332 operands[1] = change_address (operands[1], QImode, 0);
2334 [(set_attr "atype" "agen")])
2336 (define_insn_and_split "*extracthi"
2337 [(set (match_operand:SI 0 "register_operand" "=d")
2338 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2339 (match_operand 2 "const_int_operand" "n")
2341 (clobber (reg:CC 33))]
2343 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2345 "&& reload_completed"
2347 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2348 (clobber (reg:CC 33))])
2349 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2351 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2352 operands[1] = change_address (operands[1], HImode, 0);
2354 [(set_attr "atype" "agen")])
2357 ; extendsidi2 instruction pattern(s).
2360 (define_expand "extendsidi2"
2361 [(set (match_operand:DI 0 "register_operand" "")
2362 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2368 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2369 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2370 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2371 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2377 (define_insn "*extendsidi2"
2378 [(set (match_operand:DI 0 "register_operand" "=d,d")
2379 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2384 [(set_attr "op_type" "RRE,RXY")])
2387 ; extendhidi2 instruction pattern(s).
2390 (define_expand "extendhidi2"
2391 [(set (match_operand:DI 0 "register_operand" "")
2392 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2398 rtx tmp = gen_reg_rtx (SImode);
2399 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2400 emit_insn (gen_extendsidi2 (operands[0], tmp));
2405 operands[1] = gen_lowpart (DImode, operands[1]);
2406 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2407 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2413 (define_insn "*extendhidi2"
2414 [(set (match_operand:DI 0 "register_operand" "=d")
2415 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2418 [(set_attr "op_type" "RXY")])
2421 ; extendqidi2 instruction pattern(s).
2424 (define_expand "extendqidi2"
2425 [(set (match_operand:DI 0 "register_operand" "")
2426 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2432 rtx tmp = gen_reg_rtx (SImode);
2433 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2434 emit_insn (gen_extendsidi2 (operands[0], tmp));
2439 operands[1] = gen_lowpart (DImode, operands[1]);
2440 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2441 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2447 (define_insn "*extendqidi2"
2448 [(set (match_operand:DI 0 "register_operand" "=d")
2449 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2450 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2452 [(set_attr "op_type" "RXY")])
2454 (define_insn_and_split "*extendqidi2_short_displ"
2455 [(set (match_operand:DI 0 "register_operand" "=d")
2456 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2457 (clobber (reg:CC 33))]
2458 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2460 "&& reload_completed"
2462 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2463 (clobber (reg:CC 33))])
2465 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2466 (clobber (reg:CC 33))])]
2470 ; extendhisi2 instruction pattern(s).
2473 (define_expand "extendhisi2"
2474 [(set (match_operand:SI 0 "register_operand" "")
2475 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2479 operands[1] = gen_lowpart (SImode, operands[1]);
2480 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2481 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2486 (define_insn "*extendhisi2"
2487 [(set (match_operand:SI 0 "register_operand" "=d,d")
2488 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2493 [(set_attr "op_type" "RX,RXY")])
2496 ; extendqisi2 instruction pattern(s).
2499 (define_expand "extendqisi2"
2500 [(set (match_operand:SI 0 "register_operand" "")
2501 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2505 operands[1] = gen_lowpart (SImode, operands[1]);
2506 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2507 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2512 (define_insn "*extendqisi2"
2513 [(set (match_operand:SI 0 "register_operand" "=d")
2514 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2515 "TARGET_LONG_DISPLACEMENT"
2517 [(set_attr "op_type" "RXY")])
2519 (define_insn_and_split "*extendqisi2_short_displ"
2520 [(set (match_operand:SI 0 "register_operand" "=d")
2521 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2522 (clobber (reg:CC 33))]
2523 "!TARGET_LONG_DISPLACEMENT"
2525 "&& reload_completed"
2527 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2528 (clobber (reg:CC 33))])
2530 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2531 (clobber (reg:CC 33))])]
2535 ; extendqihi2 instruction pattern(s).
2540 ; zero_extendsidi2 instruction pattern(s).
2543 (define_expand "zero_extendsidi2"
2544 [(set (match_operand:DI 0 "register_operand" "")
2545 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2551 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2552 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2553 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2559 (define_insn "*zero_extendsidi2"
2560 [(set (match_operand:DI 0 "register_operand" "=d,d")
2561 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2566 [(set_attr "op_type" "RRE,RXY")])
2569 ; zero_extendhidi2 instruction pattern(s).
2572 (define_expand "zero_extendhidi2"
2573 [(set (match_operand:DI 0 "register_operand" "")
2574 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2580 rtx tmp = gen_reg_rtx (SImode);
2581 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2582 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2587 operands[1] = gen_lowpart (DImode, operands[1]);
2588 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2589 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2595 (define_insn "*zero_extendhidi2"
2596 [(set (match_operand:DI 0 "register_operand" "=d")
2597 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2600 [(set_attr "op_type" "RXY")])
2603 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2606 (define_insn "*llgt_sisi"
2607 [(set (match_operand:SI 0 "register_operand" "=d,d")
2608 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2609 (const_int 2147483647)))]
2614 [(set_attr "op_type" "RRE,RXE")])
2617 [(set (match_operand:SI 0 "register_operand" "")
2618 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2619 (const_int 2147483647)))
2620 (clobber (reg:CC 33))]
2621 "TARGET_64BIT && reload_completed"
2623 (and:SI (match_dup 1)
2624 (const_int 2147483647)))]
2627 (define_insn "*llgt_didi"
2628 [(set (match_operand:DI 0 "register_operand" "=d,d")
2629 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2630 (const_int 2147483647)))]
2635 [(set_attr "op_type" "RRE,RXE")])
2638 [(set (match_operand:DI 0 "register_operand" "")
2639 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2640 (const_int 2147483647)))
2641 (clobber (reg:CC 33))]
2642 "TARGET_64BIT && reload_completed"
2644 (and:DI (match_dup 1)
2645 (const_int 2147483647)))]
2648 (define_insn "*llgt_sidi"
2649 [(set (match_operand:DI 0 "register_operand" "=d")
2650 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2651 (const_int 2147483647)))]
2654 [(set_attr "op_type" "RXE")])
2656 (define_insn_and_split "*llgt_sidi_split"
2657 [(set (match_operand:DI 0 "register_operand" "=d")
2658 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2659 (const_int 2147483647)))
2660 (clobber (reg:CC 33))]
2663 "&& reload_completed"
2665 (and:DI (subreg:DI (match_dup 1) 0)
2666 (const_int 2147483647)))]
2670 ; zero_extendqidi2 instruction pattern(s)
2673 (define_expand "zero_extendqidi2"
2674 [(set (match_operand:DI 0 "register_operand" "")
2675 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2681 rtx tmp = gen_reg_rtx (SImode);
2682 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2683 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2688 operands[1] = gen_lowpart (DImode, operands[1]);
2689 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2690 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2696 (define_insn "*zero_extendqidi2"
2697 [(set (match_operand:DI 0 "register_operand" "=d")
2698 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2701 [(set_attr "op_type" "RXY")])
2704 ; zero_extendhisi2 instruction pattern(s).
2707 (define_expand "zero_extendhisi2"
2708 [(set (match_operand:SI 0 "register_operand" "")
2709 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2713 operands[1] = gen_lowpart (SImode, operands[1]);
2714 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2719 (define_insn "*zero_extendhisi2_64"
2720 [(set (match_operand:SI 0 "register_operand" "=d")
2721 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2724 [(set_attr "op_type" "RXY")])
2726 (define_insn_and_split "*zero_extendhisi2_31"
2727 [(set (match_operand:SI 0 "register_operand" "=&d")
2728 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2729 (clobber (reg:CC 33))]
2732 "&& reload_completed"
2733 [(set (match_dup 0) (const_int 0))
2735 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2736 (clobber (reg:CC 33))])]
2737 "operands[2] = gen_lowpart (HImode, operands[0]);"
2738 [(set_attr "atype" "agen")])
2741 ; zero_extendqisi2 instruction pattern(s).
2744 (define_expand "zero_extendqisi2"
2745 [(set (match_operand:SI 0 "register_operand" "")
2746 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2750 operands[1] = gen_lowpart (SImode, operands[1]);
2751 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2756 (define_insn "*zero_extendqisi2_64"
2757 [(set (match_operand:SI 0 "register_operand" "=d")
2758 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2761 [(set_attr "op_type" "RXY")])
2763 (define_insn_and_split "*zero_extendqisi2_31"
2764 [(set (match_operand:SI 0 "register_operand" "=&d")
2765 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2768 "&& reload_completed"
2769 [(set (match_dup 0) (const_int 0))
2770 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2771 "operands[2] = gen_lowpart (QImode, operands[0]);"
2772 [(set_attr "atype" "agen")])
2775 ; zero_extendqihi2 instruction pattern(s).
2778 (define_expand "zero_extendqihi2"
2779 [(set (match_operand:HI 0 "register_operand" "")
2780 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2784 operands[1] = gen_lowpart (HImode, operands[1]);
2785 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2790 (define_insn "*zero_extendqihi2_64"
2791 [(set (match_operand:HI 0 "register_operand" "=d")
2792 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2795 [(set_attr "op_type" "RXY")])
2797 (define_insn_and_split "*zero_extendqihi2_31"
2798 [(set (match_operand:HI 0 "register_operand" "=&d")
2799 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2802 "&& reload_completed"
2803 [(set (match_dup 0) (const_int 0))
2804 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2805 "operands[2] = gen_lowpart (QImode, operands[0]);"
2806 [(set_attr "atype" "agen")])
2810 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2813 (define_expand "fixuns_truncdfdi2"
2814 [(set (match_operand:DI 0 "register_operand" "")
2815 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2816 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2818 rtx label1 = gen_label_rtx ();
2819 rtx label2 = gen_label_rtx ();
2820 rtx temp = gen_reg_rtx (DFmode);
2821 operands[1] = force_reg (DFmode, operands[1]);
2823 emit_insn (gen_cmpdf (operands[1],
2824 CONST_DOUBLE_FROM_REAL_VALUE (
2825 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2826 emit_jump_insn (gen_blt (label1));
2827 emit_insn (gen_subdf3 (temp, operands[1],
2828 CONST_DOUBLE_FROM_REAL_VALUE (
2829 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2830 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2833 emit_label (label1);
2834 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2835 emit_label (label2);
2839 (define_expand "fix_truncdfdi2"
2840 [(set (match_operand:DI 0 "register_operand" "")
2841 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2842 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2844 operands[1] = force_reg (DFmode, operands[1]);
2845 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2849 (define_insn "fix_truncdfdi2_ieee"
2850 [(set (match_operand:DI 0 "register_operand" "=d")
2851 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2852 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2853 (clobber (reg:CC 33))]
2854 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2856 [(set_attr "op_type" "RRE")
2857 (set_attr "type" "ftoi")])
2860 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2863 (define_expand "fixuns_truncdfsi2"
2864 [(set (match_operand:SI 0 "register_operand" "")
2865 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2866 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2868 rtx label1 = gen_label_rtx ();
2869 rtx label2 = gen_label_rtx ();
2870 rtx temp = gen_reg_rtx (DFmode);
2872 operands[1] = force_reg (DFmode,operands[1]);
2873 emit_insn (gen_cmpdf (operands[1],
2874 CONST_DOUBLE_FROM_REAL_VALUE (
2875 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2876 emit_jump_insn (gen_blt (label1));
2877 emit_insn (gen_subdf3 (temp, operands[1],
2878 CONST_DOUBLE_FROM_REAL_VALUE (
2879 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2880 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2883 emit_label (label1);
2884 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2885 emit_label (label2);
2889 (define_expand "fix_truncdfsi2"
2890 [(set (match_operand:SI 0 "register_operand" "")
2891 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2894 if (TARGET_IBM_FLOAT)
2896 /* This is the algorithm from POP chapter A.5.7.2. */
2898 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2899 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2900 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2902 operands[1] = force_reg (DFmode, operands[1]);
2903 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2904 two31r, two32, temp));
2908 operands[1] = force_reg (DFmode, operands[1]);
2909 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2915 (define_insn "fix_truncdfsi2_ieee"
2916 [(set (match_operand:SI 0 "register_operand" "=d")
2917 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2918 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2919 (clobber (reg:CC 33))]
2920 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2922 [(set_attr "op_type" "RRE")
2923 (set_attr "type" "other" )])
2925 (define_insn "fix_truncdfsi2_ibm"
2926 [(set (match_operand:SI 0 "register_operand" "=d")
2927 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2928 (use (match_operand:DI 2 "immediate_operand" "m"))
2929 (use (match_operand:DI 3 "immediate_operand" "m"))
2930 (use (match_operand:BLK 4 "memory_operand" "m"))
2931 (clobber (reg:CC 33))]
2932 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2934 output_asm_insn ("sd\t%1,%2", operands);
2935 output_asm_insn ("aw\t%1,%3", operands);
2936 output_asm_insn ("std\t%1,%4", operands);
2937 output_asm_insn ("xi\t%N4,128", operands);
2940 [(set_attr "op_type" "NN")
2941 (set_attr "type" "ftoi")
2942 (set_attr "atype" "agen")
2943 (set_attr "length" "20")])
2946 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2949 (define_expand "fixuns_truncsfdi2"
2950 [(set (match_operand:DI 0 "register_operand" "")
2951 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2952 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2954 rtx label1 = gen_label_rtx ();
2955 rtx label2 = gen_label_rtx ();
2956 rtx temp = gen_reg_rtx (SFmode);
2958 operands[1] = force_reg (SFmode, operands[1]);
2959 emit_insn (gen_cmpsf (operands[1],
2960 CONST_DOUBLE_FROM_REAL_VALUE (
2961 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2962 emit_jump_insn (gen_blt (label1));
2964 emit_insn (gen_subsf3 (temp, operands[1],
2965 CONST_DOUBLE_FROM_REAL_VALUE (
2966 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2967 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2970 emit_label (label1);
2971 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2972 emit_label (label2);
2976 (define_expand "fix_truncsfdi2"
2977 [(set (match_operand:DI 0 "register_operand" "")
2978 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2979 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2981 operands[1] = force_reg (SFmode, operands[1]);
2982 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2986 (define_insn "fix_truncsfdi2_ieee"
2987 [(set (match_operand:DI 0 "register_operand" "=d")
2988 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2989 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2990 (clobber (reg:CC 33))]
2991 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2993 [(set_attr "op_type" "RRE")
2994 (set_attr "type" "ftoi")])
2997 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
3000 (define_expand "fixuns_truncsfsi2"
3001 [(set (match_operand:SI 0 "register_operand" "")
3002 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
3003 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3005 rtx label1 = gen_label_rtx ();
3006 rtx label2 = gen_label_rtx ();
3007 rtx temp = gen_reg_rtx (SFmode);
3009 operands[1] = force_reg (SFmode, operands[1]);
3010 emit_insn (gen_cmpsf (operands[1],
3011 CONST_DOUBLE_FROM_REAL_VALUE (
3012 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
3013 emit_jump_insn (gen_blt (label1));
3014 emit_insn (gen_subsf3 (temp, operands[1],
3015 CONST_DOUBLE_FROM_REAL_VALUE (
3016 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
3017 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
3020 emit_label (label1);
3021 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3022 emit_label (label2);
3026 (define_expand "fix_truncsfsi2"
3027 [(set (match_operand:SI 0 "register_operand" "")
3028 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
3031 if (TARGET_IBM_FLOAT)
3033 /* Convert to DFmode and then use the POP algorithm. */
3034 rtx temp = gen_reg_rtx (DFmode);
3035 emit_insn (gen_extendsfdf2 (temp, operands[1]));
3036 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
3040 operands[1] = force_reg (SFmode, operands[1]);
3041 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3047 (define_insn "fix_truncsfsi2_ieee"
3048 [(set (match_operand:SI 0 "register_operand" "=d")
3049 (fix:SI (match_operand:SF 1 "register_operand" "f")))
3050 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3051 (clobber (reg:CC 33))]
3052 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3054 [(set_attr "op_type" "RRE")
3055 (set_attr "type" "ftoi")])
3058 ; floatdidf2 instruction pattern(s).
3061 (define_insn "floatdidf2"
3062 [(set (match_operand:DF 0 "register_operand" "=f")
3063 (float:DF (match_operand:DI 1 "register_operand" "d")))
3064 (clobber (reg:CC 33))]
3065 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3067 [(set_attr "op_type" "RRE")
3068 (set_attr "type" "itof" )])
3071 ; floatdisf2 instruction pattern(s).
3074 (define_insn "floatdisf2"
3075 [(set (match_operand:SF 0 "register_operand" "=f")
3076 (float:SF (match_operand:DI 1 "register_operand" "d")))
3077 (clobber (reg:CC 33))]
3078 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3080 [(set_attr "op_type" "RRE")
3081 (set_attr "type" "itof" )])
3084 ; floatsidf2 instruction pattern(s).
3087 (define_expand "floatsidf2"
3089 [(set (match_operand:DF 0 "register_operand" "")
3090 (float:DF (match_operand:SI 1 "register_operand" "")))
3091 (clobber (reg:CC 33))])]
3094 if (TARGET_IBM_FLOAT)
3096 /* This is the algorithm from POP chapter A.5.7.1. */
3098 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3099 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3101 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3106 (define_insn "floatsidf2_ieee"
3107 [(set (match_operand:DF 0 "register_operand" "=f")
3108 (float:DF (match_operand:SI 1 "register_operand" "d")))
3109 (clobber (reg:CC 33))]
3110 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3112 [(set_attr "op_type" "RRE")
3113 (set_attr "type" "itof" )])
3115 (define_insn "floatsidf2_ibm"
3116 [(set (match_operand:DF 0 "register_operand" "=f")
3117 (float:DF (match_operand:SI 1 "register_operand" "d")))
3118 (use (match_operand:DI 2 "immediate_operand" "m"))
3119 (use (match_operand:BLK 3 "memory_operand" "m"))
3120 (clobber (reg:CC 33))]
3121 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3123 output_asm_insn ("st\t%1,%N3", operands);
3124 output_asm_insn ("xi\t%N3,128", operands);
3125 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3126 output_asm_insn ("ld\t%0,%3", operands);
3129 [(set_attr "op_type" "NN")
3130 (set_attr "type" "other" )
3131 (set_attr "atype" "agen")
3132 (set_attr "length" "20")])
3135 ; floatsisf2 instruction pattern(s).
3138 (define_expand "floatsisf2"
3140 [(set (match_operand:SF 0 "register_operand" "")
3141 (float:SF (match_operand:SI 1 "register_operand" "")))
3142 (clobber (reg:CC 33))])]
3145 if (TARGET_IBM_FLOAT)
3147 /* Use the POP algorithm to convert to DFmode and then truncate. */
3148 rtx temp = gen_reg_rtx (DFmode);
3149 emit_insn (gen_floatsidf2 (temp, operands[1]));
3150 emit_insn (gen_truncdfsf2 (operands[0], temp));
3155 (define_insn "floatsisf2_ieee"
3156 [(set (match_operand:SF 0 "register_operand" "=f")
3157 (float:SF (match_operand:SI 1 "register_operand" "d")))
3158 (clobber (reg:CC 33))]
3159 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3161 [(set_attr "op_type" "RRE")
3162 (set_attr "type" "itof" )])
3165 ; truncdfsf2 instruction pattern(s).
3168 (define_expand "truncdfsf2"
3169 [(set (match_operand:SF 0 "register_operand" "")
3170 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3174 (define_insn "truncdfsf2_ieee"
3175 [(set (match_operand:SF 0 "register_operand" "=f")
3176 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3177 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3179 [(set_attr "op_type" "RRE")])
3181 (define_insn "truncdfsf2_ibm"
3182 [(set (match_operand:SF 0 "register_operand" "=f,f")
3183 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3184 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3188 [(set_attr "op_type" "RR,RX")
3189 (set_attr "type" "floads,floads")])
3192 ; extendsfdf2 instruction pattern(s).
3195 (define_expand "extendsfdf2"
3196 [(set (match_operand:DF 0 "register_operand" "")
3197 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3200 if (TARGET_IBM_FLOAT)
3202 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3207 (define_insn "extendsfdf2_ieee"
3208 [(set (match_operand:DF 0 "register_operand" "=f,f")
3209 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3210 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3214 [(set_attr "op_type" "RRE,RXE")
3215 (set_attr "type" "floads,floads")])
3217 (define_insn "extendsfdf2_ibm"
3218 [(set (match_operand:DF 0 "register_operand" "=f,f")
3219 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3220 (clobber (reg:CC 33))]
3221 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3223 sdr\t%0,%0\;ler\t%0,%1
3224 sdr\t%0,%0\;le\t%0,%1"
3225 [(set_attr "op_type" "NN,NN")
3226 (set_attr "atype" "reg,agen")
3227 (set_attr "length" "4,6")
3228 (set_attr "type" "o2,o2")])
3232 ;; ARITHMETIC OPERATIONS
3234 ; arithmetic operations set the ConditionCode,
3235 ; because of unpredictable Bits in Register for Halfword and Byte
3236 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3239 ;;- Add instructions.
3243 ; addti3 instruction pattern(s).
3246 (define_insn_and_split "addti3"
3247 [(set (match_operand:TI 0 "register_operand" "=&d")
3248 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3249 (match_operand:TI 2 "general_operand" "do") ) )
3250 (clobber (reg:CC 33))]
3253 "&& reload_completed"
3256 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3258 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3260 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3261 (ltu:DI (reg:CCL1 33) (const_int 0))))
3262 (clobber (reg:CC 33))])]
3263 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3264 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3265 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3266 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3267 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3268 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3269 [(set_attr "op_type" "NN")])
3272 ; adddi3 instruction pattern(s).
3275 (define_insn "*adddi3_sign"
3276 [(set (match_operand:DI 0 "register_operand" "=d,d")
3277 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3278 (match_operand:DI 1 "register_operand" "0,0")))
3279 (clobber (reg:CC 33))]
3284 [(set_attr "op_type" "RRE,RXY")])
3286 (define_insn "*adddi3_zero_cc"
3288 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3289 (match_operand:DI 1 "register_operand" "0,0"))
3291 (set (match_operand:DI 0 "register_operand" "=d,d")
3292 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3293 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3297 [(set_attr "op_type" "RRE,RXY")])
3299 (define_insn "*adddi3_zero_cconly"
3301 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3302 (match_operand:DI 1 "register_operand" "0,0"))
3304 (clobber (match_scratch:DI 0 "=d,d"))]
3305 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3309 [(set_attr "op_type" "RRE,RXY")])
3311 (define_insn "*adddi3_zero"
3312 [(set (match_operand:DI 0 "register_operand" "=d,d")
3313 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3314 (match_operand:DI 1 "register_operand" "0,0")))
3315 (clobber (reg:CC 33))]
3320 [(set_attr "op_type" "RRE,RXY")])
3322 (define_insn "*adddi3_imm_cc"
3324 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3325 (match_operand:DI 2 "const_int_operand" "K"))
3327 (set (match_operand:DI 0 "register_operand" "=d")
3328 (plus:DI (match_dup 1) (match_dup 2)))]
3330 && s390_match_ccmode (insn, CCAmode)
3331 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3333 [(set_attr "op_type" "RI")])
3335 (define_insn "*adddi3_carry1_cc"
3337 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3338 (match_operand:DI 2 "general_operand" "d,m"))
3340 (set (match_operand:DI 0 "register_operand" "=d,d")
3341 (plus:DI (match_dup 1) (match_dup 2)))]
3342 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3346 [(set_attr "op_type" "RRE,RXY")])
3348 (define_insn "*adddi3_carry1_cconly"
3350 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3351 (match_operand:DI 2 "general_operand" "d,m"))
3353 (clobber (match_scratch:DI 0 "=d,d"))]
3354 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3358 [(set_attr "op_type" "RRE,RXY")])
3360 (define_insn "*adddi3_carry2_cc"
3362 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3363 (match_operand:DI 2 "general_operand" "d,m"))
3365 (set (match_operand:DI 0 "register_operand" "=d,d")
3366 (plus:DI (match_dup 1) (match_dup 2)))]
3367 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3371 [(set_attr "op_type" "RRE,RXY")])
3373 (define_insn "*adddi3_carry2_cconly"
3375 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3376 (match_operand:DI 2 "general_operand" "d,m"))
3378 (clobber (match_scratch:DI 0 "=d,d"))]
3379 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3383 [(set_attr "op_type" "RRE,RXY")])
3385 (define_insn "*adddi3_cc"
3387 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3388 (match_operand:DI 2 "general_operand" "d,m"))
3390 (set (match_operand:DI 0 "register_operand" "=d,d")
3391 (plus:DI (match_dup 1) (match_dup 2)))]
3392 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3396 [(set_attr "op_type" "RRE,RXY")])
3398 (define_insn "*adddi3_cconly"
3400 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3401 (match_operand:DI 2 "general_operand" "d,m"))
3403 (clobber (match_scratch:DI 0 "=d,d"))]
3404 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3408 [(set_attr "op_type" "RRE,RXY")])
3410 (define_insn "*adddi3_cconly2"
3412 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3413 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3414 (clobber (match_scratch:DI 0 "=d,d"))]
3415 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3419 [(set_attr "op_type" "RRE,RXY")])
3421 (define_insn "*adddi3_64"
3422 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3423 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3424 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3425 (clobber (reg:CC 33))]
3431 [(set_attr "op_type" "RRE,RI,RXY")])
3433 (define_insn_and_split "*adddi3_31z"
3434 [(set (match_operand:DI 0 "register_operand" "=&d")
3435 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3436 (match_operand:DI 2 "general_operand" "do") ) )
3437 (clobber (reg:CC 33))]
3438 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3440 "&& reload_completed"
3443 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3445 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3447 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3448 (ltu:SI (reg:CCL1 33) (const_int 0))))
3449 (clobber (reg:CC 33))])]
3450 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3451 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3452 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3453 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3454 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3455 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3456 [(set_attr "op_type" "NN")])
3458 (define_insn_and_split "*adddi3_31"
3459 [(set (match_operand:DI 0 "register_operand" "=&d")
3460 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3461 (match_operand:DI 2 "general_operand" "do") ) )
3462 (clobber (reg:CC 33))]
3465 "&& reload_completed"
3467 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3468 (clobber (reg:CC 33))])
3471 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3473 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3475 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3477 (label_ref (match_dup 9))))
3479 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3480 (clobber (reg:CC 33))])
3482 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3483 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3484 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3485 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3486 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3487 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3488 operands[9] = gen_label_rtx ();"
3489 [(set_attr "op_type" "NN")])
3491 (define_expand "adddi3"
3493 [(set (match_operand:DI 0 "register_operand" "")
3494 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3495 (match_operand:DI 2 "general_operand" "")))
3496 (clobber (reg:CC 33))])]
3501 ; addsi3 instruction pattern(s).
3504 (define_insn "*addsi3_imm_cc"
3506 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3507 (match_operand:SI 2 "const_int_operand" "K"))
3509 (set (match_operand:SI 0 "register_operand" "=d")
3510 (plus:SI (match_dup 1) (match_dup 2)))]
3511 "s390_match_ccmode (insn, CCAmode)
3512 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3514 [(set_attr "op_type" "RI")])
3516 (define_insn "*addsi3_carry1_cc"
3518 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3519 (match_operand:SI 2 "general_operand" "d,R,T"))
3521 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3522 (plus:SI (match_dup 1) (match_dup 2)))]
3523 "s390_match_ccmode (insn, CCL1mode)"
3528 [(set_attr "op_type" "RR,RX,RXY")])
3530 (define_insn "*addsi3_carry1_cconly"
3532 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3533 (match_operand:SI 2 "general_operand" "d,R,T"))
3535 (clobber (match_scratch:SI 0 "=d,d,d"))]
3536 "s390_match_ccmode (insn, CCL1mode)"
3541 [(set_attr "op_type" "RR,RX,RXY")])
3543 (define_insn "*addsi3_carry2_cc"
3545 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3546 (match_operand:SI 2 "general_operand" "d,R,T"))
3548 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3549 (plus:SI (match_dup 1) (match_dup 2)))]
3550 "s390_match_ccmode (insn, CCL1mode)"
3555 [(set_attr "op_type" "RR,RX,RXY")])
3557 (define_insn "*addsi3_carry2_cconly"
3559 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3560 (match_operand:SI 2 "general_operand" "d,R,T"))
3562 (clobber (match_scratch:SI 0 "=d,d,d"))]
3563 "s390_match_ccmode (insn, CCL1mode)"
3568 [(set_attr "op_type" "RR,RX,RXY")])
3570 (define_insn "*addsi3_cc"
3572 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3573 (match_operand:SI 2 "general_operand" "d,R,T"))
3575 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3576 (plus:SI (match_dup 1) (match_dup 2)))]
3577 "s390_match_ccmode (insn, CCLmode)"
3582 [(set_attr "op_type" "RR,RX,RXY")])
3584 (define_insn "*addsi3_cconly"
3586 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3587 (match_operand:SI 2 "general_operand" "d,R,T"))
3589 (clobber (match_scratch:SI 0 "=d,d,d"))]
3590 "s390_match_ccmode (insn, CCLmode)"
3595 [(set_attr "op_type" "RR,RX,RXY")])
3597 (define_insn "*addsi3_cconly2"
3599 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3600 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3601 (clobber (match_scratch:SI 0 "=d,d,d"))]
3602 "s390_match_ccmode (insn, CCLmode)"
3607 [(set_attr "op_type" "RR,RX,RXY")])
3609 (define_insn "*addsi3_sign"
3610 [(set (match_operand:SI 0 "register_operand" "=d,d")
3611 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3612 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3613 (clobber (reg:CC 33))]
3618 [(set_attr "op_type" "RX,RXY")])
3620 (define_insn "addsi3"
3621 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3622 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3623 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3624 (clobber (reg:CC 33))]
3631 [(set_attr "op_type" "RR,RI,RX,RXY")])
3634 ; adddf3 instruction pattern(s).
3637 (define_expand "adddf3"
3639 [(set (match_operand:DF 0 "register_operand" "=f,f")
3640 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3641 (match_operand:DF 2 "general_operand" "f,R")))
3642 (clobber (reg:CC 33))])]
3646 (define_insn "*adddf3"
3647 [(set (match_operand:DF 0 "register_operand" "=f,f")
3648 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3649 (match_operand:DF 2 "general_operand" "f,R")))
3650 (clobber (reg:CC 33))]
3651 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3655 [(set_attr "op_type" "RRE,RXE")
3656 (set_attr "type" "fsimpd,fsimpd")])
3658 (define_insn "*adddf3_cc"
3660 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3661 (match_operand:DF 2 "general_operand" "f,R"))
3662 (match_operand:DF 3 "const0_operand" "")))
3663 (set (match_operand:DF 0 "register_operand" "=f,f")
3664 (plus:DF (match_dup 1) (match_dup 2)))]
3665 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3669 [(set_attr "op_type" "RRE,RXE")
3670 (set_attr "type" "fsimpd,fsimpd")])
3672 (define_insn "*adddf3_cconly"
3674 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3675 (match_operand:DF 2 "general_operand" "f,R"))
3676 (match_operand:DF 3 "const0_operand" "")))
3677 (clobber (match_scratch:DF 0 "=f,f"))]
3678 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3682 [(set_attr "op_type" "RRE,RXE")
3683 (set_attr "type" "fsimpd,fsimpd")])
3685 (define_insn "*adddf3_ibm"
3686 [(set (match_operand:DF 0 "register_operand" "=f,f")
3687 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3688 (match_operand:DF 2 "general_operand" "f,R")))
3689 (clobber (reg:CC 33))]
3690 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3694 [(set_attr "op_type" "RR,RX")
3695 (set_attr "type" "fsimpd,fsimpd")])
3698 ; addsf3 instruction pattern(s).
3701 (define_expand "addsf3"
3703 [(set (match_operand:SF 0 "register_operand" "=f,f")
3704 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3705 (match_operand:SF 2 "general_operand" "f,R")))
3706 (clobber (reg:CC 33))])]
3710 (define_insn "*addsf3"
3711 [(set (match_operand:SF 0 "register_operand" "=f,f")
3712 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3713 (match_operand:SF 2 "general_operand" "f,R")))
3714 (clobber (reg:CC 33))]
3715 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3719 [(set_attr "op_type" "RRE,RXE")
3720 (set_attr "type" "fsimps,fsimps")])
3722 (define_insn "*addsf3_cc"
3724 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3725 (match_operand:SF 2 "general_operand" "f,R"))
3726 (match_operand:SF 3 "const0_operand" "")))
3727 (set (match_operand:SF 0 "register_operand" "=f,f")
3728 (plus:SF (match_dup 1) (match_dup 2)))]
3729 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3733 [(set_attr "op_type" "RRE,RXE")
3734 (set_attr "type" "fsimps,fsimps")])
3736 (define_insn "*addsf3_cconly"
3738 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3739 (match_operand:SF 2 "general_operand" "f,R"))
3740 (match_operand:SF 3 "const0_operand" "")))
3741 (clobber (match_scratch:SF 0 "=f,f"))]
3742 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3746 [(set_attr "op_type" "RRE,RXE")
3747 (set_attr "type" "fsimps,fsimps")])
3749 (define_insn "*addsf3"
3750 [(set (match_operand:SF 0 "register_operand" "=f,f")
3751 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3752 (match_operand:SF 2 "general_operand" "f,R")))
3753 (clobber (reg:CC 33))]
3754 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3758 [(set_attr "op_type" "RR,RX")
3759 (set_attr "type" "fsimps,fsimps")])
3763 ;;- Subtract instructions.
3767 ; subti3 instruction pattern(s).
3770 (define_insn_and_split "subti3"
3771 [(set (match_operand:TI 0 "register_operand" "=&d")
3772 (minus:TI (match_operand:TI 1 "register_operand" "0")
3773 (match_operand:TI 2 "general_operand" "do") ) )
3774 (clobber (reg:CC 33))]
3777 "&& reload_completed"
3780 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3782 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3784 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3785 (gtu:DI (reg:CCL2 33) (const_int 0))))
3786 (clobber (reg:CC 33))])]
3787 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3788 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3789 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3790 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3791 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3792 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3793 [(set_attr "op_type" "NN")])
3796 ; subdi3 instruction pattern(s).
3799 (define_insn "*subdi3_sign"
3800 [(set (match_operand:DI 0 "register_operand" "=d,d")
3801 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3802 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3803 (clobber (reg:CC 33))]
3808 [(set_attr "op_type" "RRE,RXY")])
3810 (define_insn "*subdi3_zero_cc"
3812 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3813 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3815 (set (match_operand:DI 0 "register_operand" "=d,d")
3816 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3817 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3821 [(set_attr "op_type" "RRE,RXY")])
3823 (define_insn "*subdi3_zero_cconly"
3825 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3826 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3828 (clobber (match_scratch:DI 0 "=d,d"))]
3829 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3833 [(set_attr "op_type" "RRE,RXY")])
3835 (define_insn "*subdi3_zero"
3836 [(set (match_operand:DI 0 "register_operand" "=d,d")
3837 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3838 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3839 (clobber (reg:CC 33))]
3844 [(set_attr "op_type" "RRE,RXY")])
3846 (define_insn "*subdi3_borrow_cc"
3848 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3849 (match_operand:DI 2 "general_operand" "d,m"))
3851 (set (match_operand:DI 0 "register_operand" "=d,d")
3852 (minus:DI (match_dup 1) (match_dup 2)))]
3853 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3857 [(set_attr "op_type" "RRE,RXY")])
3859 (define_insn "*subdi3_borrow_cconly"
3861 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3862 (match_operand:DI 2 "general_operand" "d,m"))
3864 (clobber (match_scratch:DI 0 "=d,d"))]
3865 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3869 [(set_attr "op_type" "RRE,RXY")])
3871 (define_insn "*subdi3_cc"
3873 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3874 (match_operand:DI 2 "general_operand" "d,m"))
3876 (set (match_operand:DI 0 "register_operand" "=d,d")
3877 (minus:DI (match_dup 1) (match_dup 2)))]
3878 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3882 [(set_attr "op_type" "RRE,RXY")])
3884 (define_insn "*subdi3_cc2"
3886 (compare (match_operand:DI 1 "register_operand" "0,0")
3887 (match_operand:DI 2 "general_operand" "d,m")))
3888 (set (match_operand:DI 0 "register_operand" "=d,d")
3889 (minus:DI (match_dup 1) (match_dup 2)))]
3890 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3894 [(set_attr "op_type" "RRE,RXY")])
3896 (define_insn "*subdi3_cconly"
3898 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3899 (match_operand:DI 2 "general_operand" "d,m"))
3901 (clobber (match_scratch:DI 0 "=d,d"))]
3902 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3906 [(set_attr "op_type" "RRE,RXY")])
3908 (define_insn "*subdi3_cconly2"
3910 (compare (match_operand:DI 1 "register_operand" "0,0")
3911 (match_operand:DI 2 "general_operand" "d,m")))
3912 (clobber (match_scratch:DI 0 "=d,d"))]
3913 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3917 [(set_attr "op_type" "RRE,RXY")])
3919 (define_insn "*subdi3_64"
3920 [(set (match_operand:DI 0 "register_operand" "=d,d")
3921 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3922 (match_operand:DI 2 "general_operand" "d,m") ) )
3923 (clobber (reg:CC 33))]
3928 [(set_attr "op_type" "RRE,RRE")])
3930 (define_insn_and_split "*subdi3_31z"
3931 [(set (match_operand:DI 0 "register_operand" "=&d")
3932 (minus:DI (match_operand:DI 1 "register_operand" "0")
3933 (match_operand:DI 2 "general_operand" "do") ) )
3934 (clobber (reg:CC 33))]
3935 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3937 "&& reload_completed"
3940 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3942 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3944 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
3945 (gtu:SI (reg:CCL2 33) (const_int 0))))
3946 (clobber (reg:CC 33))])]
3947 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3948 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3949 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3950 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3951 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3952 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3953 [(set_attr "op_type" "NN")])
3955 (define_insn_and_split "*subdi3_31"
3956 [(set (match_operand:DI 0 "register_operand" "=&d")
3957 (minus:DI (match_operand:DI 1 "register_operand" "0")
3958 (match_operand:DI 2 "general_operand" "do") ) )
3959 (clobber (reg:CC 33))]
3962 "&& reload_completed"
3964 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3965 (clobber (reg:CC 33))])
3968 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3970 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3972 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3974 (label_ref (match_dup 9))))
3976 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3977 (clobber (reg:CC 33))])
3979 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3980 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3981 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3982 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3983 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3984 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3985 operands[9] = gen_label_rtx ();"
3986 [(set_attr "op_type" "NN")])
3988 (define_expand "subdi3"
3990 [(set (match_operand:DI 0 "register_operand" "")
3991 (minus:DI (match_operand:DI 1 "register_operand" "")
3992 (match_operand:DI 2 "general_operand" "")))
3993 (clobber (reg:CC 33))])]
3998 ; subsi3 instruction pattern(s).
4001 (define_insn "*subsi3_borrow_cc"
4003 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4004 (match_operand:SI 2 "general_operand" "d,R,T"))
4006 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4007 (minus:SI (match_dup 1) (match_dup 2)))]
4008 "s390_match_ccmode (insn, CCL2mode)"
4013 [(set_attr "op_type" "RR,RX,RXY")])
4015 (define_insn "*subsi3_borrow_cconly"
4017 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4018 (match_operand:SI 2 "general_operand" "d,R,T"))
4020 (clobber (match_scratch:SI 0 "=d,d,d"))]
4021 "s390_match_ccmode (insn, CCL2mode)"
4026 [(set_attr "op_type" "RR,RX,RXY")])
4028 (define_insn "*subsi3_cc"
4030 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4031 (match_operand:SI 2 "general_operand" "d,R,T"))
4033 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4034 (minus:SI (match_dup 1) (match_dup 2)))]
4035 "s390_match_ccmode (insn, CCLmode)"
4040 [(set_attr "op_type" "RR,RX,RXY")])
4042 (define_insn "*subsi3_cc2"
4044 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4045 (match_operand:SI 2 "general_operand" "d,R,T")))
4046 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4047 (minus:SI (match_dup 1) (match_dup 2)))]
4048 "s390_match_ccmode (insn, CCL3mode)"
4053 [(set_attr "op_type" "RR,RX,RXY")])
4055 (define_insn "*subsi3_cconly"
4057 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4058 (match_operand:SI 2 "general_operand" "d,R,T"))
4060 (clobber (match_scratch:SI 0 "=d,d,d"))]
4061 "s390_match_ccmode (insn, CCLmode)"
4066 [(set_attr "op_type" "RR,RX,RXY")])
4068 (define_insn "*subsi3_cconly2"
4070 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4071 (match_operand:SI 2 "general_operand" "d,R,T")))
4072 (clobber (match_scratch:SI 0 "=d,d,d"))]
4073 "s390_match_ccmode (insn, CCL3mode)"
4078 [(set_attr "op_type" "RR,RX,RXY")])
4080 (define_insn "*subsi3_sign"
4081 [(set (match_operand:SI 0 "register_operand" "=d,d")
4082 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4083 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4084 (clobber (reg:CC 33))]
4089 [(set_attr "op_type" "RX,RXY")])
4091 (define_insn "subsi3"
4092 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4093 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4094 (match_operand:SI 2 "general_operand" "d,R,T")))
4095 (clobber (reg:CC 33))]
4101 [(set_attr "op_type" "RR,RX,RXY")])
4105 ; subdf3 instruction pattern(s).
4108 (define_expand "subdf3"
4110 [(set (match_operand:DF 0 "register_operand" "=f,f")
4111 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4112 (match_operand:DF 2 "general_operand" "f,R")))
4113 (clobber (reg:CC 33))])]
4117 (define_insn "*subdf3"
4118 [(set (match_operand:DF 0 "register_operand" "=f,f")
4119 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4120 (match_operand:DF 2 "general_operand" "f,R")))
4121 (clobber (reg:CC 33))]
4122 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4126 [(set_attr "op_type" "RRE,RXE")
4127 (set_attr "type" "fsimpd,fsimpd")])
4129 (define_insn "*subdf3_cc"
4131 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4132 (match_operand:DF 2 "general_operand" "f,R"))
4133 (match_operand:DF 3 "const0_operand" "")))
4134 (set (match_operand:DF 0 "register_operand" "=f,f")
4135 (plus:DF (match_dup 1) (match_dup 2)))]
4136 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4140 [(set_attr "op_type" "RRE,RXE")
4141 (set_attr "type" "fsimpd,fsimpd")])
4143 (define_insn "*subdf3_cconly"
4145 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4146 (match_operand:DF 2 "general_operand" "f,R"))
4147 (match_operand:DF 3 "const0_operand" "")))
4148 (clobber (match_scratch:DF 0 "=f,f"))]
4149 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4153 [(set_attr "op_type" "RRE,RXE")
4154 (set_attr "type" "fsimpd,fsimpd")])
4156 (define_insn "*subdf3_ibm"
4157 [(set (match_operand:DF 0 "register_operand" "=f,f")
4158 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4159 (match_operand:DF 2 "general_operand" "f,R")))
4160 (clobber (reg:CC 33))]
4161 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4165 [(set_attr "op_type" "RR,RX")
4166 (set_attr "type" "fsimpd,fsimpd")])
4169 ; subsf3 instruction pattern(s).
4172 (define_expand "subsf3"
4174 [(set (match_operand:SF 0 "register_operand" "=f,f")
4175 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4176 (match_operand:SF 2 "general_operand" "f,R")))
4177 (clobber (reg:CC 33))])]
4181 (define_insn "*subsf3"
4182 [(set (match_operand:SF 0 "register_operand" "=f,f")
4183 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4184 (match_operand:SF 2 "general_operand" "f,R")))
4185 (clobber (reg:CC 33))]
4186 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4190 [(set_attr "op_type" "RRE,RXE")
4191 (set_attr "type" "fsimps,fsimps")])
4193 (define_insn "*subsf3_cc"
4195 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4196 (match_operand:SF 2 "general_operand" "f,R"))
4197 (match_operand:SF 3 "const0_operand" "")))
4198 (set (match_operand:SF 0 "register_operand" "=f,f")
4199 (minus:SF (match_dup 1) (match_dup 2)))]
4200 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4204 [(set_attr "op_type" "RRE,RXE")
4205 (set_attr "type" "fsimps,fsimps")])
4207 (define_insn "*subsf3_cconly"
4209 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4210 (match_operand:SF 2 "general_operand" "f,R"))
4211 (match_operand:SF 3 "const0_operand" "")))
4212 (clobber (match_scratch:SF 0 "=f,f"))]
4213 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4217 [(set_attr "op_type" "RRE,RXE")
4218 (set_attr "type" "fsimps,fsimps")])
4220 (define_insn "*subsf3_ibm"
4221 [(set (match_operand:SF 0 "register_operand" "=f,f")
4222 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4223 (match_operand:SF 2 "general_operand" "f,R")))
4224 (clobber (reg:CC 33))]
4225 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4229 [(set_attr "op_type" "RR,RX")
4230 (set_attr "type" "fsimps,fsimps")])
4234 ;;- Conditional add/subtract instructions.
4238 ; adddicc instruction pattern(s).
4241 (define_insn "*adddi3_alc_cc"
4244 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4245 (match_operand:DI 2 "general_operand" "d,m"))
4246 (match_operand:DI 3 "s390_alc_comparison" ""))
4248 (set (match_operand:DI 0 "register_operand" "=d,d")
4249 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4250 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4254 [(set_attr "op_type" "RRE,RXY")])
4256 (define_insn "*adddi3_alc"
4257 [(set (match_operand:DI 0 "register_operand" "=d,d")
4258 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4259 (match_operand:DI 2 "general_operand" "d,m"))
4260 (match_operand:DI 3 "s390_alc_comparison" "")))
4261 (clobber (reg:CC 33))]
4266 [(set_attr "op_type" "RRE,RXY")])
4268 (define_insn "*subdi3_slb_cc"
4271 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4272 (match_operand:DI 2 "general_operand" "d,m"))
4273 (match_operand:DI 3 "s390_slb_comparison" ""))
4275 (set (match_operand:DI 0 "register_operand" "=d,d")
4276 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4277 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4281 [(set_attr "op_type" "RRE,RXY")])
4283 (define_insn "*subdi3_slb"
4284 [(set (match_operand:DI 0 "register_operand" "=d,d")
4285 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4286 (match_operand:DI 2 "general_operand" "d,m"))
4287 (match_operand:DI 3 "s390_slb_comparison" "")))
4288 (clobber (reg:CC 33))]
4293 [(set_attr "op_type" "RRE,RXY")])
4295 (define_expand "adddicc"
4296 [(match_operand:DI 0 "register_operand" "")
4297 (match_operand 1 "comparison_operator" "")
4298 (match_operand:DI 2 "register_operand" "")
4299 (match_operand:DI 3 "const_int_operand" "")]
4301 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4302 s390_compare_op0, s390_compare_op1,
4303 operands[0], operands[2],
4304 operands[3])) FAIL; DONE;")
4307 ; addsicc instruction pattern(s).
4310 (define_insn "*addsi3_alc_cc"
4313 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4314 (match_operand:SI 2 "general_operand" "d,m"))
4315 (match_operand:SI 3 "s390_alc_comparison" ""))
4317 (set (match_operand:SI 0 "register_operand" "=d,d")
4318 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4319 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4323 [(set_attr "op_type" "RRE,RXY")])
4325 (define_insn "*addsi3_alc"
4326 [(set (match_operand:SI 0 "register_operand" "=d,d")
4327 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4328 (match_operand:SI 2 "general_operand" "d,m"))
4329 (match_operand:SI 3 "s390_alc_comparison" "")))
4330 (clobber (reg:CC 33))]
4335 [(set_attr "op_type" "RRE,RXY")])
4337 (define_insn "*subsi3_slb_cc"
4340 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4341 (match_operand:SI 2 "general_operand" "d,m"))
4342 (match_operand:SI 3 "s390_slb_comparison" ""))
4344 (set (match_operand:SI 0 "register_operand" "=d,d")
4345 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4346 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4350 [(set_attr "op_type" "RRE,RXY")])
4352 (define_insn "*subsi3_slb"
4353 [(set (match_operand:SI 0 "register_operand" "=d,d")
4354 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4355 (match_operand:SI 2 "general_operand" "d,m"))
4356 (match_operand:SI 3 "s390_slb_comparison" "")))
4357 (clobber (reg:CC 33))]
4362 [(set_attr "op_type" "RRE,RXY")])
4364 (define_expand "addsicc"
4365 [(match_operand:SI 0 "register_operand" "")
4366 (match_operand 1 "comparison_operator" "")
4367 (match_operand:SI 2 "register_operand" "")
4368 (match_operand:SI 3 "const_int_operand" "")]
4370 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4371 s390_compare_op0, s390_compare_op1,
4372 operands[0], operands[2],
4373 operands[3])) FAIL; DONE;")
4376 ; scond instruction pattern(s).
4379 (define_insn_and_split "*sconddi"
4380 [(set (match_operand:DI 0 "register_operand" "=&d")
4381 (match_operand:DI 1 "s390_alc_comparison" ""))
4382 (clobber (reg:CC 33))]
4385 "&& reload_completed"
4386 [(set (match_dup 0) (const_int 0))
4388 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4390 (clobber (reg:CC 33))])]
4392 [(set_attr "op_type" "NN")])
4394 (define_insn_and_split "*scondsi"
4395 [(set (match_operand:SI 0 "register_operand" "=&d")
4396 (match_operand:SI 1 "s390_alc_comparison" ""))
4397 (clobber (reg:CC 33))]
4400 "&& reload_completed"
4401 [(set (match_dup 0) (const_int 0))
4403 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4405 (clobber (reg:CC 33))])]
4407 [(set_attr "op_type" "NN")])
4409 (define_insn_and_split "*sconddi_neg"
4410 [(set (match_operand:DI 0 "register_operand" "=&d")
4411 (match_operand:DI 1 "s390_slb_comparison" ""))
4412 (clobber (reg:CC 33))]
4415 "&& reload_completed"
4416 [(set (match_dup 0) (const_int 0))
4418 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4420 (clobber (reg:CC 33))])
4422 [(set (match_dup 0) (neg:DI (match_dup 0)))
4423 (clobber (reg:CC 33))])]
4425 [(set_attr "op_type" "NN")])
4427 (define_insn_and_split "*scondsi_neg"
4428 [(set (match_operand:SI 0 "register_operand" "=&d")
4429 (match_operand:SI 1 "s390_slb_comparison" ""))
4430 (clobber (reg:CC 33))]
4433 "&& reload_completed"
4434 [(set (match_dup 0) (const_int 0))
4436 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4438 (clobber (reg:CC 33))])
4440 [(set (match_dup 0) (neg:SI (match_dup 0)))
4441 (clobber (reg:CC 33))])]
4443 [(set_attr "op_type" "NN")])
4445 (define_expand "sltu"
4446 [(match_operand:SI 0 "register_operand" "")]
4448 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4449 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4451 (define_expand "sgtu"
4452 [(match_operand:SI 0 "register_operand" "")]
4454 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4455 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4457 (define_expand "sleu"
4458 [(match_operand:SI 0 "register_operand" "")]
4460 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4461 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4463 (define_expand "sgeu"
4464 [(match_operand:SI 0 "register_operand" "")]
4466 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4467 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4471 ;;- Multiply instructions.
4475 ; muldi3 instruction pattern(s).
4478 (define_insn "*muldi3_sign"
4479 [(set (match_operand:DI 0 "register_operand" "=d,d")
4480 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4481 (match_operand:DI 1 "register_operand" "0,0")))]
4486 [(set_attr "op_type" "RRE,RXY")
4487 (set_attr "type" "imul")])
4489 (define_insn "muldi3"
4490 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4491 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4492 (match_operand:DI 2 "general_operand" "d,K,m")))]
4498 [(set_attr "op_type" "RRE,RI,RXY")
4499 (set_attr "type" "imul")])
4502 ; mulsi3 instruction pattern(s).
4505 (define_insn "*mulsi3_sign"
4506 [(set (match_operand:SI 0 "register_operand" "=d")
4507 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4508 (match_operand:SI 1 "register_operand" "0")))]
4511 [(set_attr "op_type" "RX")
4512 (set_attr "type" "imul")])
4514 (define_insn "mulsi3"
4515 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4516 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4517 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4524 [(set_attr "op_type" "RRE,RI,RX,RXY")
4525 (set_attr "type" "imul")])
4528 ; mulsidi3 instruction pattern(s).
4531 (define_insn "mulsidi3"
4532 [(set (match_operand:DI 0 "register_operand" "=d,d")
4533 (mult:DI (sign_extend:DI
4534 (match_operand:SI 1 "register_operand" "%0,0"))
4536 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4541 [(set_attr "op_type" "RR,RX")
4542 (set_attr "type" "imul")])
4545 ; umulsidi3 instruction pattern(s).
4548 (define_insn "umulsidi3"
4549 [(set (match_operand:DI 0 "register_operand" "=d,d")
4550 (mult:DI (zero_extend:DI
4551 (match_operand:SI 1 "register_operand" "%0,0"))
4553 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4554 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4558 [(set_attr "op_type" "RRE,RXY")
4559 (set_attr "type" "imul")])
4562 ; muldf3 instruction pattern(s).
4565 (define_expand "muldf3"
4566 [(set (match_operand:DF 0 "register_operand" "=f,f")
4567 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4568 (match_operand:DF 2 "general_operand" "f,R")))]
4572 (define_insn "*muldf3"
4573 [(set (match_operand:DF 0 "register_operand" "=f,f")
4574 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4575 (match_operand:DF 2 "general_operand" "f,R")))]
4576 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4580 [(set_attr "op_type" "RRE,RXE")
4581 (set_attr "type" "fmuld")])
4583 (define_insn "*muldf3_ibm"
4584 [(set (match_operand:DF 0 "register_operand" "=f,f")
4585 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4586 (match_operand:DF 2 "general_operand" "f,R")))]
4587 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4591 [(set_attr "op_type" "RR,RX")
4592 (set_attr "type" "fmuld")])
4594 (define_insn "*fmadddf"
4595 [(set (match_operand:DF 0 "register_operand" "=f,f")
4596 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4597 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4598 (match_operand:DF 3 "register_operand" "0,0")))]
4599 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4603 [(set_attr "op_type" "RRE,RXE")
4604 (set_attr "type" "fmuld")])
4606 (define_insn "*fmsubdf"
4607 [(set (match_operand:DF 0 "register_operand" "=f,f")
4608 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4609 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4610 (match_operand:DF 3 "register_operand" "0,0")))]
4611 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4615 [(set_attr "op_type" "RRE,RXE")
4616 (set_attr "type" "fmuld")])
4619 ; mulsf3 instruction pattern(s).
4622 (define_expand "mulsf3"
4623 [(set (match_operand:SF 0 "register_operand" "=f,f")
4624 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4625 (match_operand:SF 2 "general_operand" "f,R")))]
4629 (define_insn "*mulsf3"
4630 [(set (match_operand:SF 0 "register_operand" "=f,f")
4631 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4632 (match_operand:SF 2 "general_operand" "f,R")))]
4633 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4637 [(set_attr "op_type" "RRE,RXE")
4638 (set_attr "type" "fmuls")])
4640 (define_insn "*mulsf3_ibm"
4641 [(set (match_operand:SF 0 "register_operand" "=f,f")
4642 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4643 (match_operand:SF 2 "general_operand" "f,R")))]
4644 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4648 [(set_attr "op_type" "RR,RX")
4649 (set_attr "type" "fmuls")])
4651 (define_insn "*fmaddsf"
4652 [(set (match_operand:SF 0 "register_operand" "=f,f")
4653 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4654 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4655 (match_operand:SF 3 "register_operand" "0,0")))]
4656 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4660 [(set_attr "op_type" "RRE,RXE")
4661 (set_attr "type" "fmuls")])
4663 (define_insn "*fmsubsf"
4664 [(set (match_operand:SF 0 "register_operand" "=f,f")
4665 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4666 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4667 (match_operand:SF 3 "register_operand" "0,0")))]
4668 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4672 [(set_attr "op_type" "RRE,RXE")
4673 (set_attr "type" "fmuls")])
4676 ;;- Divide and modulo instructions.
4680 ; divmoddi4 instruction pattern(s).
4683 (define_expand "divmoddi4"
4684 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4685 (div:DI (match_operand:DI 1 "register_operand" "")
4686 (match_operand:DI 2 "general_operand" "")))
4687 (set (match_operand:DI 3 "general_operand" "")
4688 (mod:DI (match_dup 1) (match_dup 2)))])
4689 (clobber (match_dup 4))]
4692 rtx insn, div_equal, mod_equal;
4694 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4695 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4697 operands[4] = gen_reg_rtx(TImode);
4698 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4700 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4702 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4704 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4706 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4711 (define_insn "divmodtidi3"
4712 [(set (match_operand:TI 0 "register_operand" "=d,d")
4716 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4717 (match_operand:DI 2 "general_operand" "d,m")))
4719 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4724 [(set_attr "op_type" "RRE,RXY")
4725 (set_attr "type" "idiv")])
4727 (define_insn "divmodtisi3"
4728 [(set (match_operand:TI 0 "register_operand" "=d,d")
4732 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4734 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4737 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4742 [(set_attr "op_type" "RRE,RXY")
4743 (set_attr "type" "idiv")])
4746 ; udivmoddi4 instruction pattern(s).
4749 (define_expand "udivmoddi4"
4750 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4751 (udiv:DI (match_operand:DI 1 "general_operand" "")
4752 (match_operand:DI 2 "nonimmediate_operand" "")))
4753 (set (match_operand:DI 3 "general_operand" "")
4754 (umod:DI (match_dup 1) (match_dup 2)))])
4755 (clobber (match_dup 4))]
4758 rtx insn, div_equal, mod_equal, equal;
4760 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4761 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4762 equal = gen_rtx_IOR (TImode,
4763 gen_rtx_ASHIFT (TImode,
4764 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4766 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4768 operands[4] = gen_reg_rtx(TImode);
4769 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4770 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4771 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4772 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4774 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4776 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4778 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4780 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4782 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4787 (define_insn "udivmodtidi3"
4788 [(set (match_operand:TI 0 "register_operand" "=d,d")
4793 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4795 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4799 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4804 [(set_attr "op_type" "RRE,RXY")
4805 (set_attr "type" "idiv")])
4808 ; divmodsi4 instruction pattern(s).
4811 (define_expand "divmodsi4"
4812 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4813 (div:SI (match_operand:SI 1 "general_operand" "")
4814 (match_operand:SI 2 "nonimmediate_operand" "")))
4815 (set (match_operand:SI 3 "general_operand" "")
4816 (mod:SI (match_dup 1) (match_dup 2)))])
4817 (clobber (match_dup 4))]
4820 rtx insn, div_equal, mod_equal, equal;
4822 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4823 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4824 equal = gen_rtx_IOR (DImode,
4825 gen_rtx_ASHIFT (DImode,
4826 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4828 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4830 operands[4] = gen_reg_rtx(DImode);
4831 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4832 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4834 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4836 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4838 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4840 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4842 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4847 (define_insn "divmoddisi3"
4848 [(set (match_operand:DI 0 "register_operand" "=d,d")
4853 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4855 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4859 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4864 [(set_attr "op_type" "RR,RX")
4865 (set_attr "type" "idiv")])
4868 ; udivsi3 and umodsi3 instruction pattern(s).
4871 (define_expand "udivmodsi4"
4872 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4873 (udiv:SI (match_operand:SI 1 "general_operand" "")
4874 (match_operand:SI 2 "nonimmediate_operand" "")))
4875 (set (match_operand:SI 3 "general_operand" "")
4876 (umod:SI (match_dup 1) (match_dup 2)))])
4877 (clobber (match_dup 4))]
4878 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4880 rtx insn, div_equal, mod_equal, equal;
4882 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4883 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4884 equal = gen_rtx_IOR (DImode,
4885 gen_rtx_ASHIFT (DImode,
4886 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4888 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4890 operands[4] = gen_reg_rtx(DImode);
4891 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4892 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4893 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4894 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4896 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4898 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4900 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4902 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4904 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4909 (define_insn "udivmoddisi3"
4910 [(set (match_operand:DI 0 "register_operand" "=d,d")
4915 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
4917 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4921 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
4922 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4926 [(set_attr "op_type" "RRE,RXY")
4927 (set_attr "type" "idiv")])
4929 (define_expand "udivsi3"
4930 [(set (match_operand:SI 0 "register_operand" "=d")
4931 (udiv:SI (match_operand:SI 1 "general_operand" "")
4932 (match_operand:SI 2 "general_operand" "")))
4933 (clobber (match_dup 3))]
4934 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4936 rtx insn, udiv_equal, umod_equal, equal;
4938 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4939 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4940 equal = gen_rtx_IOR (DImode,
4941 gen_rtx_ASHIFT (DImode,
4942 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4944 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4946 operands[3] = gen_reg_rtx (DImode);
4948 if (CONSTANT_P (operands[2]))
4950 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4952 rtx label1 = gen_label_rtx ();
4954 operands[1] = make_safe_from (operands[1], operands[0]);
4955 emit_move_insn (operands[0], const0_rtx);
4956 emit_insn (gen_cmpsi (operands[1], operands[2]));
4957 emit_jump_insn (gen_bltu (label1));
4958 emit_move_insn (operands[0], const1_rtx);
4959 emit_label (label1);
4963 operands[2] = force_reg (SImode, operands[2]);
4964 operands[2] = make_safe_from (operands[2], operands[0]);
4966 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4967 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4970 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4972 insn = emit_move_insn (operands[0],
4973 gen_lowpart (SImode, operands[3]));
4975 gen_rtx_EXPR_LIST (REG_EQUAL,
4976 udiv_equal, REG_NOTES (insn));
4981 rtx label1 = gen_label_rtx ();
4982 rtx label2 = gen_label_rtx ();
4983 rtx label3 = gen_label_rtx ();
4985 operands[1] = force_reg (SImode, operands[1]);
4986 operands[1] = make_safe_from (operands[1], operands[0]);
4987 operands[2] = force_reg (SImode, operands[2]);
4988 operands[2] = make_safe_from (operands[2], operands[0]);
4990 emit_move_insn (operands[0], const0_rtx);
4991 emit_insn (gen_cmpsi (operands[2], operands[1]));
4992 emit_jump_insn (gen_bgtu (label3));
4993 emit_insn (gen_cmpsi (operands[2], const0_rtx));
4994 emit_jump_insn (gen_blt (label2));
4995 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4996 emit_jump_insn (gen_beq (label1));
4997 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4998 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5001 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5003 insn = emit_move_insn (operands[0],
5004 gen_lowpart (SImode, operands[3]));
5006 gen_rtx_EXPR_LIST (REG_EQUAL,
5007 udiv_equal, REG_NOTES (insn));
5009 emit_label (label1);
5010 emit_move_insn (operands[0], operands[1]);
5012 emit_label (label2);
5013 emit_move_insn (operands[0], const1_rtx);
5014 emit_label (label3);
5016 emit_move_insn (operands[0], operands[0]);
5020 (define_expand "umodsi3"
5021 [(set (match_operand:SI 0 "register_operand" "=d")
5022 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
5023 (match_operand:SI 2 "nonimmediate_operand" "")))
5024 (clobber (match_dup 3))]
5025 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
5027 rtx insn, udiv_equal, umod_equal, equal;
5029 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
5030 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
5031 equal = gen_rtx_IOR (DImode,
5032 gen_rtx_ASHIFT (DImode,
5033 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
5035 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
5037 operands[3] = gen_reg_rtx (DImode);
5039 if (CONSTANT_P (operands[2]))
5041 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
5043 rtx label1 = gen_label_rtx ();
5045 operands[1] = make_safe_from (operands[1], operands[0]);
5046 emit_move_insn (operands[0], operands[1]);
5047 emit_insn (gen_cmpsi (operands[0], operands[2]));
5048 emit_jump_insn (gen_bltu (label1));
5049 emit_insn (gen_abssi2 (operands[0], operands[2]));
5050 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
5051 emit_label (label1);
5055 operands[2] = force_reg (SImode, operands[2]);
5056 operands[2] = make_safe_from (operands[2], operands[0]);
5058 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5059 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5062 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5064 insn = emit_move_insn (operands[0],
5065 gen_highpart (SImode, operands[3]));
5067 gen_rtx_EXPR_LIST (REG_EQUAL,
5068 umod_equal, REG_NOTES (insn));
5073 rtx label1 = gen_label_rtx ();
5074 rtx label2 = gen_label_rtx ();
5075 rtx label3 = gen_label_rtx ();
5077 operands[1] = force_reg (SImode, operands[1]);
5078 operands[1] = make_safe_from (operands[1], operands[0]);
5079 operands[2] = force_reg (SImode, operands[2]);
5080 operands[2] = make_safe_from (operands[2], operands[0]);
5082 emit_move_insn(operands[0], operands[1]);
5083 emit_insn (gen_cmpsi (operands[2], operands[1]));
5084 emit_jump_insn (gen_bgtu (label3));
5085 emit_insn (gen_cmpsi (operands[2], const0_rtx));
5086 emit_jump_insn (gen_blt (label2));
5087 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5088 emit_jump_insn (gen_beq (label1));
5089 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5090 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5093 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5095 insn = emit_move_insn (operands[0],
5096 gen_highpart (SImode, operands[3]));
5098 gen_rtx_EXPR_LIST (REG_EQUAL,
5099 umod_equal, REG_NOTES (insn));
5101 emit_label (label1);
5102 emit_move_insn (operands[0], const0_rtx);
5104 emit_label (label2);
5105 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5106 emit_label (label3);
5112 ; divdf3 instruction pattern(s).
5115 (define_expand "divdf3"
5116 [(set (match_operand:DF 0 "register_operand" "=f,f")
5117 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5118 (match_operand:DF 2 "general_operand" "f,R")))]
5122 (define_insn "*divdf3"
5123 [(set (match_operand:DF 0 "register_operand" "=f,f")
5124 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5125 (match_operand:DF 2 "general_operand" "f,R")))]
5126 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5130 [(set_attr "op_type" "RRE,RXE")
5131 (set_attr "type" "fdivd")])
5133 (define_insn "*divdf3_ibm"
5134 [(set (match_operand:DF 0 "register_operand" "=f,f")
5135 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5136 (match_operand:DF 2 "general_operand" "f,R")))]
5137 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5141 [(set_attr "op_type" "RR,RX")
5142 (set_attr "type" "fdivd")])
5145 ; divsf3 instruction pattern(s).
5148 (define_expand "divsf3"
5149 [(set (match_operand:SF 0 "register_operand" "=f,f")
5150 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5151 (match_operand:SF 2 "general_operand" "f,R")))]
5155 (define_insn "*divsf3"
5156 [(set (match_operand:SF 0 "register_operand" "=f,f")
5157 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5158 (match_operand:SF 2 "general_operand" "f,R")))]
5159 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5163 [(set_attr "op_type" "RRE,RXE")
5164 (set_attr "type" "fdivs")])
5166 (define_insn "*divsf3"
5167 [(set (match_operand:SF 0 "register_operand" "=f,f")
5168 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5169 (match_operand:SF 2 "general_operand" "f,R")))]
5170 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5174 [(set_attr "op_type" "RR,RX")
5175 (set_attr "type" "fdivs")])
5179 ;;- And instructions.
5183 ; anddi3 instruction pattern(s).
5186 (define_insn "*anddi3_cc"
5188 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5189 (match_operand:DI 2 "general_operand" "d,m"))
5191 (set (match_operand:DI 0 "register_operand" "=d,d")
5192 (and:DI (match_dup 1) (match_dup 2)))]
5193 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5197 [(set_attr "op_type" "RRE,RXY")])
5199 (define_insn "*anddi3_cconly"
5201 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5202 (match_operand:DI 2 "general_operand" "d,m"))
5204 (clobber (match_scratch:DI 0 "=d,d"))]
5205 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5209 [(set_attr "op_type" "RRE,RXY")])
5211 (define_insn "anddi3"
5212 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d")
5213 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0")
5214 (match_operand:DI 2 "general_operand"
5215 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m")))
5216 (clobber (reg:CC 33))]
5227 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")])
5229 (define_insn "*anddi3_ss"
5230 [(set (match_operand:DI 0 "s_operand" "=Q")
5231 (and:DI (match_dup 0)
5232 (match_operand:DI 1 "s_imm_operand" "Q")))
5233 (clobber (reg:CC 33))]
5236 [(set_attr "op_type" "SS")])
5238 (define_insn "*anddi3_ss_inv"
5239 [(set (match_operand:DI 0 "s_operand" "=Q")
5240 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
5242 (clobber (reg:CC 33))]
5245 [(set_attr "op_type" "SS")])
5248 ; andsi3 instruction pattern(s).
5251 (define_insn "*andsi3_cc"
5253 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5254 (match_operand:SI 2 "general_operand" "d,R,T"))
5256 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5257 (and:SI (match_dup 1) (match_dup 2)))]
5258 "s390_match_ccmode(insn, CCTmode)"
5263 [(set_attr "op_type" "RR,RX,RXY")])
5265 (define_insn "*andsi3_cconly"
5267 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5268 (match_operand:SI 2 "general_operand" "d,R,T"))
5270 (clobber (match_scratch:SI 0 "=d,d,d"))]
5271 "s390_match_ccmode(insn, CCTmode)"
5276 [(set_attr "op_type" "RR,RX,RXY")])
5278 (define_expand "andsi3"
5280 [(set (match_operand:SI 0 "register_operand" "")
5281 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5282 (match_operand:SI 2 "general_operand" "")))
5283 (clobber (reg:CC 33))])]
5287 (define_insn "*andsi3_zarch"
5288 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d")
5289 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0")
5290 (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T")))
5291 (clobber (reg:CC 33))]
5301 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")])
5303 (define_insn "*andsi3_esa"
5304 [(set (match_operand:SI 0 "register_operand" "=d,d")
5305 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
5306 (match_operand:SI 2 "general_operand" "d,R")))
5307 (clobber (reg:CC 33))]
5312 [(set_attr "op_type" "RR,RX")])
5314 (define_insn "*andsi3_ss"
5315 [(set (match_operand:SI 0 "s_operand" "=Q")
5316 (and:SI (match_dup 0)
5317 (match_operand:SI 1 "s_imm_operand" "Q")))
5318 (clobber (reg:CC 33))]
5321 [(set_attr "op_type" "SS")])
5323 (define_insn "*andsi3_ss_inv"
5324 [(set (match_operand:SI 0 "s_operand" "=Q")
5325 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
5327 (clobber (reg:CC 33))]
5330 [(set_attr "op_type" "SS")])
5333 ; andhi3 instruction pattern(s).
5336 (define_insn "*andhi3_ni"
5337 [(set (match_operand:HI 0 "register_operand" "=d,d")
5338 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
5339 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5340 (clobber (reg:CC 33))]
5345 [(set_attr "op_type" "RR,RI")])
5347 (define_insn "andhi3"
5348 [(set (match_operand:HI 0 "register_operand" "=d")
5349 (and:HI (match_operand:HI 1 "register_operand" "%0")
5350 (match_operand:HI 2 "nonmemory_operand" "d")))
5351 (clobber (reg:CC 33))]
5354 [(set_attr "op_type" "RR")])
5356 (define_insn "*andhi3_ss"
5357 [(set (match_operand:HI 0 "s_operand" "=Q")
5358 (and:HI (match_dup 0)
5359 (match_operand:HI 1 "s_imm_operand" "Q")))
5360 (clobber (reg:CC 33))]
5363 [(set_attr "op_type" "SS")])
5365 (define_insn "*andhi3_ss_inv"
5366 [(set (match_operand:HI 0 "s_operand" "=Q")
5367 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
5369 (clobber (reg:CC 33))]
5372 [(set_attr "op_type" "SS")])
5375 ; andqi3 instruction pattern(s).
5378 (define_insn "*andqi3_ni"
5379 [(set (match_operand:QI 0 "register_operand" "=d,d")
5380 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
5381 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5382 (clobber (reg:CC 33))]
5387 [(set_attr "op_type" "RR,RI")])
5389 (define_insn "andqi3"
5390 [(set (match_operand:QI 0 "register_operand" "=d")
5391 (and:QI (match_operand:QI 1 "register_operand" "%0")
5392 (match_operand:QI 2 "nonmemory_operand" "d")))
5393 (clobber (reg:CC 33))]
5396 [(set_attr "op_type" "RR")])
5398 (define_insn "*andqi3_ss"
5399 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5400 (and:QI (match_dup 0)
5401 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5402 (clobber (reg:CC 33))]
5408 [(set_attr "op_type" "SI,SIY,SS")])
5410 (define_insn "*andqi3_ss_inv"
5411 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5412 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5414 (clobber (reg:CC 33))]
5420 [(set_attr "op_type" "SI,SIY,SS")])
5424 ;;- Bit set (inclusive or) instructions.
5428 ; iordi3 instruction pattern(s).
5431 (define_insn "*iordi3_cc"
5433 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5434 (match_operand:DI 2 "general_operand" "d,m"))
5436 (set (match_operand:DI 0 "register_operand" "=d,d")
5437 (ior:DI (match_dup 1) (match_dup 2)))]
5438 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5442 [(set_attr "op_type" "RRE,RXY")])
5444 (define_insn "*iordi3_cconly"
5446 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5447 (match_operand:DI 2 "general_operand" "d,m"))
5449 (clobber (match_scratch:DI 0 "=d,d"))]
5450 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5454 [(set_attr "op_type" "RRE,RXY")])
5456 (define_insn "iordi3"
5457 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d")
5458 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0")
5459 (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m")))
5460 (clobber (reg:CC 33))]
5469 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")])
5471 (define_insn "*iordi3_ss"
5472 [(set (match_operand:DI 0 "s_operand" "=Q")
5473 (ior:DI (match_dup 0)
5474 (match_operand:DI 1 "s_imm_operand" "Q")))
5475 (clobber (reg:CC 33))]
5478 [(set_attr "op_type" "SS")])
5480 (define_insn "*iordi3_ss_inv"
5481 [(set (match_operand:DI 0 "s_operand" "=Q")
5482 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
5484 (clobber (reg:CC 33))]
5487 [(set_attr "op_type" "SS")])
5490 ; iorsi3 instruction pattern(s).
5493 (define_insn "*iorsi3_cc"
5495 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5496 (match_operand:SI 2 "general_operand" "d,R,T"))
5498 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5499 (ior:SI (match_dup 1) (match_dup 2)))]
5500 "s390_match_ccmode(insn, CCTmode)"
5505 [(set_attr "op_type" "RR,RX,RXY")])
5507 (define_insn "*iorsi3_cconly"
5509 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5510 (match_operand:SI 2 "general_operand" "d,R,T"))
5512 (clobber (match_scratch:SI 0 "=d,d,d"))]
5513 "s390_match_ccmode(insn, CCTmode)"
5518 [(set_attr "op_type" "RR,RX,RXY")])
5520 (define_expand "iorsi3"
5522 [(set (match_operand:SI 0 "register_operand" "")
5523 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5524 (match_operand:SI 2 "general_operand" "")))
5525 (clobber (reg:CC 33))])]
5529 (define_insn "iorsi3_zarch"
5530 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
5531 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0")
5532 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T")))
5533 (clobber (reg:CC 33))]
5541 [(set_attr "op_type" "RI,RI,RR,RX,RXY")])
5543 (define_insn "iorsi3_esa"
5544 [(set (match_operand:SI 0 "register_operand" "=d,d")
5545 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
5546 (match_operand:SI 2 "general_operand" "d,R")))
5547 (clobber (reg:CC 33))]
5552 [(set_attr "op_type" "RR,RX")])
5554 (define_insn "*iorsi3_ss"
5555 [(set (match_operand:SI 0 "s_operand" "=Q")
5556 (ior:SI (match_dup 0)
5557 (match_operand:SI 1 "s_imm_operand" "Q")))
5558 (clobber (reg:CC 33))]
5561 [(set_attr "op_type" "SS")])
5563 (define_insn "*iorsi3_ss_inv"
5564 [(set (match_operand:SI 0 "s_operand" "=Q")
5565 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
5567 (clobber (reg:CC 33))]
5570 [(set_attr "op_type" "SS")])
5573 ; iorhi3 instruction pattern(s).
5576 (define_insn "*iorhi3_oi"
5577 [(set (match_operand:HI 0 "register_operand" "=d,d")
5578 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
5579 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5580 (clobber (reg:CC 33))]
5585 [(set_attr "op_type" "RR,RI")])
5587 (define_insn "iorhi3"
5588 [(set (match_operand:HI 0 "register_operand" "=d")
5589 (ior:HI (match_operand:HI 1 "register_operand" "%0")
5590 (match_operand:HI 2 "nonmemory_operand" "d")))
5591 (clobber (reg:CC 33))]
5594 [(set_attr "op_type" "RR")])
5596 (define_insn "*iorhi3_ss"
5597 [(set (match_operand:HI 0 "s_operand" "=Q")
5598 (ior:HI (match_dup 0)
5599 (match_operand:HI 1 "s_imm_operand" "Q")))
5600 (clobber (reg:CC 33))]
5603 [(set_attr "op_type" "SS")])
5605 (define_insn "*iorhi3_ss_inv"
5606 [(set (match_operand:HI 0 "s_operand" "=Q")
5607 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
5609 (clobber (reg:CC 33))]
5612 [(set_attr "op_type" "SS")])
5615 ; iorqi3 instruction pattern(s).
5618 (define_insn "*iorqi3_oi"
5619 [(set (match_operand:QI 0 "register_operand" "=d,d")
5620 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
5621 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5622 (clobber (reg:CC 33))]
5627 [(set_attr "op_type" "RR,RI")])
5629 (define_insn "iorqi3"
5630 [(set (match_operand:QI 0 "register_operand" "=d")
5631 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5632 (match_operand:QI 2 "nonmemory_operand" "d")))
5633 (clobber (reg:CC 33))]
5636 [(set_attr "op_type" "RR")])
5638 (define_insn "*iorqi3_ss"
5639 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5640 (ior:QI (match_dup 0)
5641 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5642 (clobber (reg:CC 33))]
5648 [(set_attr "op_type" "SI,SIY,SS")])
5650 (define_insn "*iorqi3_ss_inv"
5651 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5652 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5654 (clobber (reg:CC 33))]
5660 [(set_attr "op_type" "SI,SIY,SS")])
5664 ;;- Xor instructions.
5668 ; xordi3 instruction pattern(s).
5671 (define_insn "*xordi3_cc"
5673 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5674 (match_operand:DI 2 "general_operand" "d,m"))
5676 (set (match_operand:DI 0 "register_operand" "=d,d")
5677 (xor:DI (match_dup 1) (match_dup 2)))]
5678 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5682 [(set_attr "op_type" "RRE,RXY")])
5684 (define_insn "*xordi3_cconly"
5686 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5687 (match_operand:DI 2 "general_operand" "d,m"))
5689 (clobber (match_scratch:DI 0 "=d,d"))]
5690 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5694 [(set_attr "op_type" "RRE,RXY")])
5696 (define_insn "xordi3"
5697 [(set (match_operand:DI 0 "register_operand" "=d,d")
5698 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5699 (match_operand:DI 2 "general_operand" "d,m")))
5700 (clobber (reg:CC 33))]
5705 [(set_attr "op_type" "RRE,RXY")])
5707 (define_insn "*xordi3_ss"
5708 [(set (match_operand:DI 0 "s_operand" "=Q")
5709 (xor:DI (match_dup 0)
5710 (match_operand:DI 1 "s_imm_operand" "Q")))
5711 (clobber (reg:CC 33))]
5714 [(set_attr "op_type" "SS")])
5716 (define_insn "*xordi3_ss_inv"
5717 [(set (match_operand:DI 0 "s_operand" "=Q")
5718 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5720 (clobber (reg:CC 33))]
5723 [(set_attr "op_type" "SS")])
5726 ; xorsi3 instruction pattern(s).
5729 (define_insn "*xorsi3_cc"
5731 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5732 (match_operand:SI 2 "general_operand" "d,R,T"))
5734 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5735 (xor:SI (match_dup 1) (match_dup 2)))]
5736 "s390_match_ccmode(insn, CCTmode)"
5741 [(set_attr "op_type" "RR,RX,RXY")])
5743 (define_insn "*xorsi3_cconly"
5745 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5746 (match_operand:SI 2 "general_operand" "d,R,T"))
5748 (clobber (match_scratch:SI 0 "=d,d,d"))]
5749 "s390_match_ccmode(insn, CCTmode)"
5754 [(set_attr "op_type" "RR,RX,RXY")])
5756 (define_insn "xorsi3"
5757 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5758 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5759 (match_operand:SI 2 "general_operand" "d,R,T")))
5760 (clobber (reg:CC 33))]
5766 [(set_attr "op_type" "RR,RX,RXY")])
5768 (define_insn "*xorsi3_ss"
5769 [(set (match_operand:SI 0 "s_operand" "=Q")
5770 (xor:SI (match_dup 0)
5771 (match_operand:SI 1 "s_imm_operand" "Q")))
5772 (clobber (reg:CC 33))]
5775 [(set_attr "op_type" "SS")])
5777 (define_insn "*xorsi3_ss_inv"
5778 [(set (match_operand:SI 0 "s_operand" "=Q")
5779 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5781 (clobber (reg:CC 33))]
5784 [(set_attr "op_type" "SS")])
5787 ; xorhi3 instruction pattern(s).
5790 (define_insn "xorhi3"
5791 [(set (match_operand:HI 0 "register_operand" "=d")
5792 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5793 (match_operand:HI 2 "nonmemory_operand" "d")))
5794 (clobber (reg:CC 33))]
5797 [(set_attr "op_type" "RR")])
5799 (define_insn "*xorhi3_ss"
5800 [(set (match_operand:HI 0 "s_operand" "=Q")
5801 (xor:HI (match_dup 0)
5802 (match_operand:HI 1 "s_imm_operand" "Q")))
5803 (clobber (reg:CC 33))]
5806 [(set_attr "op_type" "SS")])
5808 (define_insn "*xorhi3_ss_inv"
5809 [(set (match_operand:HI 0 "s_operand" "=Q")
5810 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5812 (clobber (reg:CC 33))]
5815 [(set_attr "op_type" "SS")])
5818 ; xorqi3 instruction pattern(s).
5821 (define_insn "xorqi3"
5822 [(set (match_operand:QI 0 "register_operand" "=d")
5823 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5824 (match_operand:QI 2 "nonmemory_operand" "d")))
5825 (clobber (reg:CC 33))]
5828 [(set_attr "op_type" "RR")])
5830 (define_insn "*xorqi3_ss"
5831 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5832 (xor:QI (match_dup 0)
5833 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5834 (clobber (reg:CC 33))]
5840 [(set_attr "op_type" "SI,SIY,SS")])
5842 (define_insn "*xorqi3_ss_inv"
5843 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5844 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5846 (clobber (reg:CC 33))]
5852 [(set_attr "op_type" "SI,SIY,SS")])
5856 ;;- Negate instructions.
5860 ; negdi2 instruction pattern(s).
5863 (define_expand "negdi2"
5865 [(set (match_operand:DI 0 "register_operand" "=d")
5866 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5867 (clobber (reg:CC 33))])]
5871 (define_insn "*negdi2_64"
5872 [(set (match_operand:DI 0 "register_operand" "=d")
5873 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5874 (clobber (reg:CC 33))]
5877 [(set_attr "op_type" "RR")])
5879 (define_insn "*negdi2_31"
5880 [(set (match_operand:DI 0 "register_operand" "=d")
5881 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5882 (clobber (reg:CC 33))]
5886 xop[0] = gen_label_rtx ();
5887 output_asm_insn ("lcr\t%0,%1", operands);
5888 output_asm_insn ("lcr\t%N0,%N1", operands);
5889 output_asm_insn ("je\t%l0", xop);
5890 output_asm_insn ("bctr\t%0,0", operands);
5891 targetm.asm_out.internal_label (asm_out_file, "L",
5892 CODE_LABEL_NUMBER (xop[0]));
5895 [(set_attr "op_type" "NN")
5896 (set_attr "type" "other")
5897 (set_attr "length" "10")])
5900 ; negsi2 instruction pattern(s).
5903 (define_insn "negsi2"
5904 [(set (match_operand:SI 0 "register_operand" "=d")
5905 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5906 (clobber (reg:CC 33))]
5909 [(set_attr "op_type" "RR")])
5912 ; negdf2 instruction pattern(s).
5915 (define_expand "negdf2"
5917 [(set (match_operand:DF 0 "register_operand" "=f")
5918 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5919 (clobber (reg:CC 33))])]
5923 (define_insn "*negdf2"
5924 [(set (match_operand:DF 0 "register_operand" "=f")
5925 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5926 (clobber (reg:CC 33))]
5927 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5929 [(set_attr "op_type" "RRE")
5930 (set_attr "type" "fsimpd")])
5932 (define_insn "*negdf2_ibm"
5933 [(set (match_operand:DF 0 "register_operand" "=f")
5934 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5935 (clobber (reg:CC 33))]
5936 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5938 [(set_attr "op_type" "RR")
5939 (set_attr "type" "fsimpd")])
5942 ; negsf2 instruction pattern(s).
5945 (define_expand "negsf2"
5947 [(set (match_operand:SF 0 "register_operand" "=f")
5948 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5949 (clobber (reg:CC 33))])]
5953 (define_insn "*negsf2"
5954 [(set (match_operand:SF 0 "register_operand" "=f")
5955 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5956 (clobber (reg:CC 33))]
5957 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5959 [(set_attr "op_type" "RRE")
5960 (set_attr "type" "fsimps")])
5962 (define_insn "*negsf2"
5963 [(set (match_operand:SF 0 "register_operand" "=f")
5964 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5965 (clobber (reg:CC 33))]
5966 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5968 [(set_attr "op_type" "RR")
5969 (set_attr "type" "fsimps")])
5973 ;;- Absolute value instructions.
5977 ; absdi2 instruction pattern(s).
5980 (define_insn "absdi2"
5981 [(set (match_operand:DI 0 "register_operand" "=d")
5982 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5983 (clobber (reg:CC 33))]
5986 [(set_attr "op_type" "RRE")])
5989 ; abssi2 instruction pattern(s).
5992 (define_insn "abssi2"
5993 [(set (match_operand:SI 0 "register_operand" "=d")
5994 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5995 (clobber (reg:CC 33))]
5998 [(set_attr "op_type" "RR")])
6001 ; absdf2 instruction pattern(s).
6004 (define_expand "absdf2"
6006 [(set (match_operand:DF 0 "register_operand" "=f")
6007 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6008 (clobber (reg:CC 33))])]
6012 (define_insn "*absdf2"
6013 [(set (match_operand:DF 0 "register_operand" "=f")
6014 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6015 (clobber (reg:CC 33))]
6016 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6018 [(set_attr "op_type" "RRE")
6019 (set_attr "type" "fsimpd")])
6021 (define_insn "*absdf2_ibm"
6022 [(set (match_operand:DF 0 "register_operand" "=f")
6023 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6024 (clobber (reg:CC 33))]
6025 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6027 [(set_attr "op_type" "RR")
6028 (set_attr "type" "fsimpd")])
6031 ; abssf2 instruction pattern(s).
6034 (define_expand "abssf2"
6036 [(set (match_operand:SF 0 "register_operand" "=f")
6037 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6038 (clobber (reg:CC 33))])]
6042 (define_insn "*abssf2"
6043 [(set (match_operand:SF 0 "register_operand" "=f")
6044 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6045 (clobber (reg:CC 33))]
6046 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6048 [(set_attr "op_type" "RRE")
6049 (set_attr "type" "fsimps")])
6051 (define_insn "*abssf2_ibm"
6052 [(set (match_operand:SF 0 "register_operand" "=f")
6053 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6054 (clobber (reg:CC 33))]
6055 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6057 [(set_attr "op_type" "RR")
6058 (set_attr "type" "fsimps")])
6061 ;;- Negated absolute value instructions
6068 (define_insn "*negabssi2"
6069 [(set (match_operand:SI 0 "register_operand" "=d")
6070 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
6071 (clobber (reg:CC 33))]
6074 [(set_attr "op_type" "RR")])
6076 (define_insn "*negabsdi2"
6077 [(set (match_operand:DI 0 "register_operand" "=d")
6078 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
6079 (clobber (reg:CC 33))]
6082 [(set_attr "op_type" "RRE")])
6088 (define_insn "*negabssf2"
6089 [(set (match_operand:SF 0 "register_operand" "=f")
6090 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6091 (clobber (reg:CC 33))]
6092 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6094 [(set_attr "op_type" "RRE")
6095 (set_attr "type" "fsimps")])
6097 (define_insn "*negabsdf2"
6098 [(set (match_operand:DF 0 "register_operand" "=f")
6099 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6100 (clobber (reg:CC 33))]
6101 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6103 [(set_attr "op_type" "RRE")
6104 (set_attr "type" "fsimpd")])
6107 ;;- Square root instructions.
6111 ; sqrtdf2 instruction pattern(s).
6114 (define_insn "sqrtdf2"
6115 [(set (match_operand:DF 0 "register_operand" "=f,f")
6116 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6117 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6121 [(set_attr "op_type" "RRE,RXE")])
6124 ; sqrtsf2 instruction pattern(s).
6127 (define_insn "sqrtsf2"
6128 [(set (match_operand:SF 0 "register_operand" "=f,f")
6129 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6130 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6134 [(set_attr "op_type" "RRE,RXE")])
6137 ;;- One complement instructions.
6141 ; one_cmpldi2 instruction pattern(s).
6144 (define_expand "one_cmpldi2"
6146 [(set (match_operand:DI 0 "register_operand" "")
6147 (xor:DI (match_operand:DI 1 "register_operand" "")
6149 (clobber (reg:CC 33))])]
6154 ; one_cmplsi2 instruction pattern(s).
6157 (define_expand "one_cmplsi2"
6159 [(set (match_operand:SI 0 "register_operand" "")
6160 (xor:SI (match_operand:SI 1 "register_operand" "")
6162 (clobber (reg:CC 33))])]
6167 ; one_cmplhi2 instruction pattern(s).
6170 (define_expand "one_cmplhi2"
6172 [(set (match_operand:HI 0 "register_operand" "")
6173 (xor:HI (match_operand:HI 1 "register_operand" "")
6175 (clobber (reg:CC 33))])]
6180 ; one_cmplqi2 instruction pattern(s).
6183 (define_expand "one_cmplqi2"
6185 [(set (match_operand:QI 0 "register_operand" "")
6186 (xor:QI (match_operand:QI 1 "register_operand" "")
6188 (clobber (reg:CC 33))])]
6194 ;;- Rotate instructions.
6198 ; rotldi3 instruction pattern(s).
6201 (define_insn "rotldi3"
6202 [(set (match_operand:DI 0 "register_operand" "=d")
6203 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6204 (match_operand:SI 2 "shift_count_operand" "Y")))]
6207 [(set_attr "op_type" "RSE")
6208 (set_attr "atype" "reg")])
6211 ; rotlsi3 instruction pattern(s).
6214 (define_insn "rotlsi3"
6215 [(set (match_operand:SI 0 "register_operand" "=d")
6216 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6217 (match_operand:SI 2 "shift_count_operand" "Y")))]
6220 [(set_attr "op_type" "RSE")
6221 (set_attr "atype" "reg")])
6225 ;;- Arithmetic shift instructions.
6229 ; ashldi3 instruction pattern(s).
6232 (define_expand "ashldi3"
6233 [(set (match_operand:DI 0 "register_operand" "")
6234 (ashift:DI (match_operand:DI 1 "register_operand" "")
6235 (match_operand:SI 2 "shift_count_operand" "")))]
6239 (define_insn "*ashldi3_31"
6240 [(set (match_operand:DI 0 "register_operand" "=d")
6241 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6242 (match_operand:SI 2 "shift_count_operand" "Y")))]
6245 [(set_attr "op_type" "RS")
6246 (set_attr "atype" "reg")])
6248 (define_insn "*ashldi3_64"
6249 [(set (match_operand:DI 0 "register_operand" "=d")
6250 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6251 (match_operand:SI 2 "shift_count_operand" "Y")))]
6254 [(set_attr "op_type" "RSE")
6255 (set_attr "atype" "reg")])
6258 ; ashrdi3 instruction pattern(s).
6261 (define_expand "ashrdi3"
6263 [(set (match_operand:DI 0 "register_operand" "")
6264 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6265 (match_operand:SI 2 "shift_count_operand" "")))
6266 (clobber (reg:CC 33))])]
6270 (define_insn "*ashrdi3_cc_31"
6272 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6273 (match_operand:SI 2 "shift_count_operand" "Y"))
6275 (set (match_operand:DI 0 "register_operand" "=d")
6276 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6277 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6279 [(set_attr "op_type" "RS")
6280 (set_attr "atype" "reg")])
6282 (define_insn "*ashrdi3_cconly_31"
6284 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6285 (match_operand:SI 2 "shift_count_operand" "Y"))
6287 (clobber (match_scratch:DI 0 "=d"))]
6288 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6290 [(set_attr "op_type" "RS")
6291 (set_attr "atype" "reg")])
6293 (define_insn "*ashrdi3_31"
6294 [(set (match_operand:DI 0 "register_operand" "=d")
6295 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6296 (match_operand:SI 2 "shift_count_operand" "Y")))
6297 (clobber (reg:CC 33))]
6300 [(set_attr "op_type" "RS")
6301 (set_attr "atype" "reg")])
6303 (define_insn "*ashrdi3_cc_64"
6305 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6306 (match_operand:SI 2 "shift_count_operand" "Y"))
6308 (set (match_operand:DI 0 "register_operand" "=d")
6309 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6310 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6312 [(set_attr "op_type" "RSE")
6313 (set_attr "atype" "reg")])
6315 (define_insn "*ashrdi3_cconly_64"
6317 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6318 (match_operand:SI 2 "shift_count_operand" "Y"))
6320 (clobber (match_scratch:DI 0 "=d"))]
6321 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6323 [(set_attr "op_type" "RSE")
6324 (set_attr "atype" "reg")])
6326 (define_insn "*ashrdi3_64"
6327 [(set (match_operand:DI 0 "register_operand" "=d")
6328 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6329 (match_operand:SI 2 "shift_count_operand" "Y")))
6330 (clobber (reg:CC 33))]
6333 [(set_attr "op_type" "RSE")
6334 (set_attr "atype" "reg")])
6338 ; ashlsi3 instruction pattern(s).
6341 (define_insn "ashlsi3"
6342 [(set (match_operand:SI 0 "register_operand" "=d")
6343 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6344 (match_operand:SI 2 "shift_count_operand" "Y")))]
6347 [(set_attr "op_type" "RS")
6348 (set_attr "atype" "reg")])
6351 ; ashrsi3 instruction pattern(s).
6354 (define_insn "*ashrsi3_cc"
6356 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6357 (match_operand:SI 2 "shift_count_operand" "Y"))
6359 (set (match_operand:SI 0 "register_operand" "=d")
6360 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6361 "s390_match_ccmode(insn, CCSmode)"
6363 [(set_attr "op_type" "RS")
6364 (set_attr "atype" "reg")])
6367 (define_insn "*ashrsi3_cconly"
6369 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6370 (match_operand:SI 2 "shift_count_operand" "Y"))
6372 (clobber (match_scratch:SI 0 "=d"))]
6373 "s390_match_ccmode(insn, CCSmode)"
6375 [(set_attr "op_type" "RS")
6376 (set_attr "atype" "reg")])
6378 (define_insn "ashrsi3"
6379 [(set (match_operand:SI 0 "register_operand" "=d")
6380 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6381 (match_operand:SI 2 "shift_count_operand" "Y")))
6382 (clobber (reg:CC 33))]
6385 [(set_attr "op_type" "RS")
6386 (set_attr "atype" "reg")])
6390 ;;- logical shift instructions.
6394 ; lshrdi3 instruction pattern(s).
6397 (define_expand "lshrdi3"
6398 [(set (match_operand:DI 0 "register_operand" "")
6399 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6400 (match_operand:SI 2 "shift_count_operand" "")))]
6404 (define_insn "*lshrdi3_31"
6405 [(set (match_operand:DI 0 "register_operand" "=d")
6406 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6407 (match_operand:SI 2 "shift_count_operand" "Y")))]
6410 [(set_attr "op_type" "RS")
6411 (set_attr "atype" "reg")])
6413 (define_insn "*lshrdi3_64"
6414 [(set (match_operand:DI 0 "register_operand" "=d")
6415 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6416 (match_operand:SI 2 "shift_count_operand" "Y")))]
6419 [(set_attr "op_type" "RSE")
6420 (set_attr "atype" "reg")])
6423 ; lshrsi3 instruction pattern(s).
6426 (define_insn "lshrsi3"
6427 [(set (match_operand:SI 0 "register_operand" "=d")
6428 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6429 (match_operand:SI 2 "shift_count_operand" "Y")))]
6432 [(set_attr "op_type" "RS")
6433 (set_attr "atype" "reg")])
6437 ;; Branch instruction patterns.
6440 (define_expand "beq"
6441 [(match_operand 0 "" "")]
6443 "s390_emit_jump (operands[0],
6444 s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
6446 (define_expand "bne"
6447 [(match_operand 0 "" "")]
6449 "s390_emit_jump (operands[0],
6450 s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
6452 (define_expand "bgt"
6453 [(match_operand 0 "" "")]
6455 "s390_emit_jump (operands[0],
6456 s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
6458 (define_expand "bgtu"
6459 [(match_operand 0 "" "")]
6461 "s390_emit_jump (operands[0],
6462 s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
6464 (define_expand "blt"
6465 [(match_operand 0 "" "")]
6467 "s390_emit_jump (operands[0],
6468 s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
6470 (define_expand "bltu"
6471 [(match_operand 0 "" "")]
6473 "s390_emit_jump (operands[0],
6474 s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
6476 (define_expand "bge"
6477 [(match_operand 0 "" "")]
6479 "s390_emit_jump (operands[0],
6480 s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
6482 (define_expand "bgeu"
6483 [(match_operand 0 "" "")]
6485 "s390_emit_jump (operands[0],
6486 s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
6488 (define_expand "ble"
6489 [(match_operand 0 "" "")]
6491 "s390_emit_jump (operands[0],
6492 s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
6494 (define_expand "bleu"
6495 [(match_operand 0 "" "")]
6497 "s390_emit_jump (operands[0],
6498 s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
6500 (define_expand "bunordered"
6501 [(match_operand 0 "" "")]
6503 "s390_emit_jump (operands[0],
6504 s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6506 (define_expand "bordered"
6507 [(match_operand 0 "" "")]
6509 "s390_emit_jump (operands[0],
6510 s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6512 (define_expand "buneq"
6513 [(match_operand 0 "" "")]
6515 "s390_emit_jump (operands[0],
6516 s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
6518 (define_expand "bunlt"
6519 [(match_operand 0 "" "")]
6521 "s390_emit_jump (operands[0],
6522 s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
6524 (define_expand "bungt"
6525 [(match_operand 0 "" "")]
6527 "s390_emit_jump (operands[0],
6528 s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
6530 (define_expand "bunle"
6531 [(match_operand 0 "" "")]
6533 "s390_emit_jump (operands[0],
6534 s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
6536 (define_expand "bunge"
6537 [(match_operand 0 "" "")]
6539 "s390_emit_jump (operands[0],
6540 s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
6542 (define_expand "bltgt"
6543 [(match_operand 0 "" "")]
6545 "s390_emit_jump (operands[0],
6546 s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
6550 ;;- Conditional jump instructions.
6553 (define_insn "*cjump_64"
6556 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6557 (label_ref (match_operand 0 "" ""))
6561 if (get_attr_length (insn) == 4)
6564 return "jg%C1\t%l0";
6566 [(set_attr "op_type" "RI")
6567 (set_attr "type" "branch")
6568 (set (attr "length")
6569 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6570 (const_int 4) (const_int 6)))])
6572 (define_insn "*cjump_31"
6575 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6576 (label_ref (match_operand 0 "" ""))
6580 if (get_attr_length (insn) == 4)
6585 [(set_attr "op_type" "RI")
6586 (set_attr "type" "branch")
6587 (set (attr "length")
6588 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6589 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6590 (const_int 4) (const_int 6))
6591 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6592 (const_int 4) (const_int 8))))])
6594 (define_insn "*cjump_long"
6597 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6598 (match_operand 0 "address_operand" "U")
6602 if (get_attr_op_type (insn) == OP_TYPE_RR)
6607 [(set (attr "op_type")
6608 (if_then_else (match_operand 0 "register_operand" "")
6609 (const_string "RR") (const_string "RX")))
6610 (set_attr "type" "branch")
6611 (set_attr "atype" "agen")])
6615 ;;- Negated conditional jump instructions.
6618 (define_insn "*icjump_64"
6621 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6623 (label_ref (match_operand 0 "" ""))))]
6626 if (get_attr_length (insn) == 4)
6629 return "jg%D1\t%l0";
6631 [(set_attr "op_type" "RI")
6632 (set_attr "type" "branch")
6633 (set (attr "length")
6634 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6635 (const_int 4) (const_int 6)))])
6637 (define_insn "*icjump_31"
6640 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6642 (label_ref (match_operand 0 "" ""))))]
6645 if (get_attr_length (insn) == 4)
6650 [(set_attr "op_type" "RI")
6651 (set_attr "type" "branch")
6652 (set (attr "length")
6653 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6654 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6655 (const_int 4) (const_int 6))
6656 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6657 (const_int 4) (const_int 8))))])
6659 (define_insn "*icjump_long"
6662 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6664 (match_operand 0 "address_operand" "U")))]
6667 if (get_attr_op_type (insn) == OP_TYPE_RR)
6672 [(set (attr "op_type")
6673 (if_then_else (match_operand 0 "register_operand" "")
6674 (const_string "RR") (const_string "RX")))
6675 (set_attr "type" "branch")
6676 (set_attr "atype" "agen")])
6679 ;;- Trap instructions.
6683 [(trap_if (const_int 1) (const_int 0))]
6686 [(set_attr "op_type" "RI")
6687 (set_attr "type" "branch")])
6689 (define_expand "conditional_trap"
6690 [(trap_if (match_operand 0 "comparison_operator" "")
6691 (match_operand 1 "general_operand" ""))]
6694 if (operands[1] != const0_rtx) FAIL;
6695 operands[0] = s390_emit_compare (GET_CODE (operands[0]),
6696 s390_compare_op0, s390_compare_op1);
6699 (define_insn "*trap"
6700 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6704 [(set_attr "op_type" "RI")
6705 (set_attr "type" "branch")])
6708 ;;- Loop instructions.
6710 ;; This is all complicated by the fact that since this is a jump insn
6711 ;; we must handle our own output reloads.
6713 (define_expand "doloop_end"
6714 [(use (match_operand 0 "" "")) ; loop pseudo
6715 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6716 (use (match_operand 2 "" "")) ; max iterations
6717 (use (match_operand 3 "" "")) ; loop level
6718 (use (match_operand 4 "" ""))] ; label
6721 if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
6722 emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
6723 else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
6724 emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
6725 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6726 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6733 (define_insn_and_split "doloop_si64"
6736 (ne (match_operand:SI 1 "register_operand" "d,d")
6738 (label_ref (match_operand 0 "" ""))
6740 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6741 (plus:SI (match_dup 1) (const_int -1)))
6742 (clobber (match_scratch:SI 3 "=X,&d"))
6743 (clobber (reg:CC 33))]
6746 if (which_alternative != 0)
6748 else if (get_attr_length (insn) == 4)
6749 return "brct\t%1,%l0";
6751 return "ahi\t%1,-1\;jgne\t%l0";
6753 "&& reload_completed
6754 && (! REG_P (operands[2])
6755 || ! rtx_equal_p (operands[1], operands[2]))"
6756 [(set (match_dup 3) (match_dup 1))
6757 (parallel [(set (reg:CCAN 33)
6758 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6760 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6761 (set (match_dup 2) (match_dup 3))
6762 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6763 (label_ref (match_dup 0))
6766 [(set_attr "op_type" "RI")
6767 (set_attr "type" "branch")
6768 (set (attr "length")
6769 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6770 (const_int 4) (const_int 10)))])
6772 (define_insn_and_split "doloop_si31"
6775 (ne (match_operand:SI 1 "register_operand" "d,d")
6777 (label_ref (match_operand 0 "" ""))
6779 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6780 (plus:SI (match_dup 1) (const_int -1)))
6781 (clobber (match_scratch:SI 3 "=X,&d"))
6782 (clobber (reg:CC 33))]
6785 if (which_alternative != 0)
6787 else if (get_attr_length (insn) == 4)
6788 return "brct\t%1,%l0";
6792 "&& reload_completed
6793 && (! REG_P (operands[2])
6794 || ! rtx_equal_p (operands[1], operands[2]))"
6795 [(set (match_dup 3) (match_dup 1))
6796 (parallel [(set (reg:CCAN 33)
6797 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6799 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6800 (set (match_dup 2) (match_dup 3))
6801 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6802 (label_ref (match_dup 0))
6805 [(set_attr "op_type" "RI")
6806 (set_attr "type" "branch")
6807 (set (attr "length")
6808 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6809 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6810 (const_int 4) (const_int 6))
6811 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6812 (const_int 4) (const_int 8))))])
6814 (define_insn "*doloop_si_long"
6817 (ne (match_operand:SI 1 "register_operand" "d,d")
6819 (match_operand 0 "address_operand" "U,U")
6821 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6822 (plus:SI (match_dup 1) (const_int -1)))
6823 (clobber (match_scratch:SI 3 "=X,&d"))
6824 (clobber (reg:CC 33))]
6827 if (get_attr_op_type (insn) == OP_TYPE_RR)
6828 return "bctr\t%1,%0";
6830 return "bct\t%1,%a0";
6832 [(set (attr "op_type")
6833 (if_then_else (match_operand 0 "register_operand" "")
6834 (const_string "RR") (const_string "RX")))
6835 (set_attr "type" "branch")
6836 (set_attr "atype" "agen")])
6838 (define_insn_and_split "doloop_di"
6841 (ne (match_operand:DI 1 "register_operand" "d,d")
6843 (label_ref (match_operand 0 "" ""))
6845 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*r")
6846 (plus:DI (match_dup 1) (const_int -1)))
6847 (clobber (match_scratch:DI 3 "=X,&d"))
6848 (clobber (reg:CC 33))]
6851 if (which_alternative != 0)
6853 else if (get_attr_length (insn) == 4)
6854 return "brctg\t%1,%l0";
6856 return "aghi\t%1,-1\;jgne\t%l0";
6858 "&& reload_completed
6859 && (! REG_P (operands[2])
6860 || ! rtx_equal_p (operands[1], operands[2]))"
6861 [(set (match_dup 3) (match_dup 1))
6862 (parallel [(set (reg:CCAN 33)
6863 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6865 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6866 (set (match_dup 2) (match_dup 3))
6867 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6868 (label_ref (match_dup 0))
6871 [(set_attr "op_type" "RI")
6872 (set_attr "type" "branch")
6873 (set (attr "length")
6874 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6875 (const_int 4) (const_int 10)))])
6878 ;;- Unconditional jump instructions.
6882 ; jump instruction pattern(s).
6885 (define_expand "jump"
6886 [(match_operand 0 "" "")]
6888 "s390_emit_jump (operands[0], NULL_RTX); DONE;")
6890 (define_insn "*jump64"
6891 [(set (pc) (label_ref (match_operand 0 "" "")))]
6894 if (get_attr_length (insn) == 4)
6899 [(set_attr "op_type" "RI")
6900 (set_attr "type" "branch")
6901 (set (attr "length")
6902 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6903 (const_int 4) (const_int 6)))])
6905 (define_insn "*jump31"
6906 [(set (pc) (label_ref (match_operand 0 "" "")))]
6909 if (get_attr_length (insn) == 4)
6914 [(set_attr "op_type" "RI")
6915 (set_attr "type" "branch")
6916 (set (attr "length")
6917 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6918 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6919 (const_int 4) (const_int 6))
6920 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6921 (const_int 4) (const_int 8))))])
6924 ; indirect-jump instruction pattern(s).
6927 (define_insn "indirect_jump"
6928 [(set (pc) (match_operand 0 "address_operand" "U"))]
6931 if (get_attr_op_type (insn) == OP_TYPE_RR)
6936 [(set (attr "op_type")
6937 (if_then_else (match_operand 0 "register_operand" "")
6938 (const_string "RR") (const_string "RX")))
6939 (set_attr "type" "branch")
6940 (set_attr "atype" "agen")])
6943 ; casesi instruction pattern(s).
6946 (define_insn "casesi_jump"
6947 [(set (pc) (match_operand 0 "address_operand" "U"))
6948 (use (label_ref (match_operand 1 "" "")))]
6951 if (get_attr_op_type (insn) == OP_TYPE_RR)
6956 [(set (attr "op_type")
6957 (if_then_else (match_operand 0 "register_operand" "")
6958 (const_string "RR") (const_string "RX")))
6959 (set_attr "type" "branch")
6960 (set_attr "atype" "agen")])
6962 (define_expand "casesi"
6963 [(match_operand:SI 0 "general_operand" "")
6964 (match_operand:SI 1 "general_operand" "")
6965 (match_operand:SI 2 "general_operand" "")
6966 (label_ref (match_operand 3 "" ""))
6967 (label_ref (match_operand 4 "" ""))]
6970 rtx index = gen_reg_rtx (SImode);
6971 rtx base = gen_reg_rtx (Pmode);
6972 rtx target = gen_reg_rtx (Pmode);
6974 emit_move_insn (index, operands[0]);
6975 emit_insn (gen_subsi3 (index, index, operands[1]));
6976 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6979 if (Pmode != SImode)
6980 index = convert_to_mode (Pmode, index, 1);
6981 if (GET_CODE (index) != REG)
6982 index = copy_to_mode_reg (Pmode, index);
6985 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6987 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
6989 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6991 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
6992 RTX_UNCHANGING_P (index) = 1;
6993 MEM_NOTRAP_P (index) = 1;
6994 emit_move_insn (target, index);
6997 target = gen_rtx_PLUS (Pmode, base, target);
6998 emit_jump_insn (gen_casesi_jump (target, operands[3]));
7005 ;;- Jump to subroutine.
7010 ; untyped call instruction pattern(s).
7013 ;; Call subroutine returning any type.
7014 (define_expand "untyped_call"
7015 [(parallel [(call (match_operand 0 "" "")
7017 (match_operand 1 "" "")
7018 (match_operand 2 "" "")])]
7023 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
7025 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7027 rtx set = XVECEXP (operands[2], 0, i);
7028 emit_move_insn (SET_DEST (set), SET_SRC (set));
7031 /* The optimizer does not know that the call sets the function value
7032 registers we stored in the result block. We avoid problems by
7033 claiming that all hard registers are used and clobbered at this
7035 emit_insn (gen_blockage ());
7040 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7041 ;; all of memory. This blocks insns from being moved across this point.
7043 (define_insn "blockage"
7044 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7047 [(set_attr "type" "none")
7048 (set_attr "length" "0")])
7054 (define_expand "sibcall"
7055 [(call (match_operand 0 "" "")
7056 (match_operand 1 "" ""))]
7059 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
7063 (define_insn "*sibcall_br"
7064 [(call (mem:QI (reg 1))
7065 (match_operand 0 "const_int_operand" "n"))]
7066 "SIBLING_CALL_P (insn)
7067 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
7069 [(set_attr "op_type" "RR")
7070 (set_attr "type" "branch")
7071 (set_attr "atype" "agen")])
7073 (define_insn "*sibcall_brc"
7074 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7075 (match_operand 1 "const_int_operand" "n"))]
7076 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7078 [(set_attr "op_type" "RI")
7079 (set_attr "type" "branch")])
7081 (define_insn "*sibcall_brcl"
7082 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7083 (match_operand 1 "const_int_operand" "n"))]
7084 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7086 [(set_attr "op_type" "RIL")
7087 (set_attr "type" "branch")])
7090 ; sibcall_value patterns
7093 (define_expand "sibcall_value"
7094 [(set (match_operand 0 "" "")
7095 (call (match_operand 1 "" "")
7096 (match_operand 2 "" "")))]
7099 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7103 (define_insn "*sibcall_value_br"
7104 [(set (match_operand 0 "" "")
7105 (call (mem:QI (reg 1))
7106 (match_operand 1 "const_int_operand" "n")))]
7107 "SIBLING_CALL_P (insn)
7108 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7110 [(set_attr "op_type" "RR")
7111 (set_attr "type" "branch")
7112 (set_attr "atype" "agen")])
7114 (define_insn "*sibcall_value_brc"
7115 [(set (match_operand 0 "" "")
7116 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7117 (match_operand 2 "const_int_operand" "n")))]
7118 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7120 [(set_attr "op_type" "RI")
7121 (set_attr "type" "branch")])
7123 (define_insn "*sibcall_value_brcl"
7124 [(set (match_operand 0 "" "")
7125 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7126 (match_operand 2 "const_int_operand" "n")))]
7127 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7129 [(set_attr "op_type" "RIL")
7130 (set_attr "type" "branch")])
7134 ; call instruction pattern(s).
7137 (define_expand "call"
7138 [(call (match_operand 0 "" "")
7139 (match_operand 1 "" ""))
7140 (use (match_operand 2 "" ""))]
7143 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7144 gen_rtx_REG (Pmode, RETURN_REGNUM));
7148 (define_insn "*bras"
7149 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7150 (match_operand 1 "const_int_operand" "n"))
7151 (clobber (match_operand 2 "register_operand" "=r"))]
7152 "!SIBLING_CALL_P (insn)
7153 && TARGET_SMALL_EXEC
7154 && GET_MODE (operands[2]) == Pmode"
7156 [(set_attr "op_type" "RI")
7157 (set_attr "type" "jsr")])
7159 (define_insn "*brasl"
7160 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7161 (match_operand 1 "const_int_operand" "n"))
7162 (clobber (match_operand 2 "register_operand" "=r"))]
7163 "!SIBLING_CALL_P (insn)
7165 && GET_MODE (operands[2]) == Pmode"
7167 [(set_attr "op_type" "RIL")
7168 (set_attr "type" "jsr")])
7170 (define_insn "*basr"
7171 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7172 (match_operand 1 "const_int_operand" "n"))
7173 (clobber (match_operand 2 "register_operand" "=r"))]
7174 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7176 if (get_attr_op_type (insn) == OP_TYPE_RR)
7177 return "basr\t%2,%0";
7179 return "bas\t%2,%a0";
7181 [(set (attr "op_type")
7182 (if_then_else (match_operand 0 "register_operand" "")
7183 (const_string "RR") (const_string "RX")))
7184 (set_attr "type" "jsr")
7185 (set_attr "atype" "agen")])
7188 ; call_value instruction pattern(s).
7191 (define_expand "call_value"
7192 [(set (match_operand 0 "" "")
7193 (call (match_operand 1 "" "")
7194 (match_operand 2 "" "")))
7195 (use (match_operand 3 "" ""))]
7198 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7199 gen_rtx_REG (Pmode, RETURN_REGNUM));
7203 (define_insn "*bras_r"
7204 [(set (match_operand 0 "" "")
7205 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7206 (match_operand:SI 2 "const_int_operand" "n")))
7207 (clobber (match_operand 3 "register_operand" "=r"))]
7208 "!SIBLING_CALL_P (insn)
7209 && TARGET_SMALL_EXEC
7210 && GET_MODE (operands[3]) == Pmode"
7212 [(set_attr "op_type" "RI")
7213 (set_attr "type" "jsr")])
7215 (define_insn "*brasl_r"
7216 [(set (match_operand 0 "" "")
7217 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7218 (match_operand 2 "const_int_operand" "n")))
7219 (clobber (match_operand 3 "register_operand" "=r"))]
7220 "!SIBLING_CALL_P (insn)
7222 && GET_MODE (operands[3]) == Pmode"
7224 [(set_attr "op_type" "RIL")
7225 (set_attr "type" "jsr")])
7227 (define_insn "*basr_r"
7228 [(set (match_operand 0 "" "")
7229 (call (mem:QI (match_operand 1 "address_operand" "U"))
7230 (match_operand 2 "const_int_operand" "n")))
7231 (clobber (match_operand 3 "register_operand" "=r"))]
7232 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7234 if (get_attr_op_type (insn) == OP_TYPE_RR)
7235 return "basr\t%3,%1";
7237 return "bas\t%3,%a1";
7239 [(set (attr "op_type")
7240 (if_then_else (match_operand 1 "register_operand" "")
7241 (const_string "RR") (const_string "RX")))
7242 (set_attr "type" "jsr")
7243 (set_attr "atype" "agen")])
7246 ;;- Thread-local storage support.
7249 (define_insn "get_tp_64"
7250 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
7251 (unspec:DI [(const_int 0)] UNSPEC_TP))]
7254 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
7256 [(set_attr "op_type" "NN,RS")
7257 (set_attr "atype" "reg,*")
7258 (set_attr "type" "o3,*")
7259 (set_attr "length" "14,*")])
7261 (define_insn "get_tp_31"
7262 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
7263 (unspec:SI [(const_int 0)] UNSPEC_TP))]
7268 [(set_attr "op_type" "RRE,RS")])
7270 (define_insn "set_tp_64"
7271 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
7272 (clobber (match_scratch:SI 1 "=d,X"))]
7275 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
7277 [(set_attr "op_type" "NN,RS")
7278 (set_attr "atype" "reg,*")
7279 (set_attr "type" "o3,*")
7280 (set_attr "length" "14,*")])
7282 (define_insn "set_tp_31"
7283 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
7288 [(set_attr "op_type" "RRE,RS")])
7290 (define_insn "*tls_load_64"
7291 [(set (match_operand:DI 0 "register_operand" "=d")
7292 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7293 (match_operand:DI 2 "" "")]
7297 [(set_attr "op_type" "RXE")])
7299 (define_insn "*tls_load_31"
7300 [(set (match_operand:SI 0 "register_operand" "=d,d")
7301 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7302 (match_operand:SI 2 "" "")]
7308 [(set_attr "op_type" "RX,RXY")])
7310 (define_insn "*bras_tls"
7311 [(set (match_operand 0 "" "")
7312 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7313 (match_operand 2 "const_int_operand" "n")))
7314 (clobber (match_operand 3 "register_operand" "=r"))
7315 (use (match_operand 4 "" ""))]
7316 "!SIBLING_CALL_P (insn)
7317 && TARGET_SMALL_EXEC
7318 && GET_MODE (operands[3]) == Pmode"
7320 [(set_attr "op_type" "RI")
7321 (set_attr "type" "jsr")])
7323 (define_insn "*brasl_tls"
7324 [(set (match_operand 0 "" "")
7325 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7326 (match_operand 2 "const_int_operand" "n")))
7327 (clobber (match_operand 3 "register_operand" "=r"))
7328 (use (match_operand 4 "" ""))]
7329 "!SIBLING_CALL_P (insn)
7331 && GET_MODE (operands[3]) == Pmode"
7333 [(set_attr "op_type" "RIL")
7334 (set_attr "type" "jsr")])
7336 (define_insn "*basr_tls"
7337 [(set (match_operand 0 "" "")
7338 (call (mem:QI (match_operand 1 "address_operand" "U"))
7339 (match_operand 2 "const_int_operand" "n")))
7340 (clobber (match_operand 3 "register_operand" "=r"))
7341 (use (match_operand 4 "" ""))]
7342 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7344 if (get_attr_op_type (insn) == OP_TYPE_RR)
7345 return "basr\t%3,%1%J4";
7347 return "bas\t%3,%a1%J4";
7349 [(set (attr "op_type")
7350 (if_then_else (match_operand 1 "register_operand" "")
7351 (const_string "RR") (const_string "RX")))
7352 (set_attr "type" "jsr")
7353 (set_attr "atype" "agen")])
7356 ;;- Miscellaneous instructions.
7360 ; allocate stack instruction pattern(s).
7363 (define_expand "allocate_stack"
7365 (plus (reg 15) (match_operand 1 "general_operand" "")))
7366 (set (match_operand 0 "general_operand" "")
7370 rtx stack = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
7371 rtx chain = gen_rtx_MEM (Pmode, stack);
7372 rtx temp = gen_reg_rtx (Pmode);
7374 emit_move_insn (temp, chain);
7377 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7379 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7381 emit_move_insn (chain, temp);
7383 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7389 ; setjmp instruction pattern.
7392 (define_expand "builtin_setjmp_receiver"
7393 [(match_operand 0 "" "")]
7396 emit_insn (s390_load_got ());
7397 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7401 ;; These patterns say how to save and restore the stack pointer. We need not
7402 ;; save the stack pointer at function level since we are careful to
7403 ;; preserve the backchain. At block level, we have to restore the backchain
7404 ;; when we restore the stack pointer.
7406 ;; For nonlocal gotos, we must save both the stack pointer and its
7407 ;; backchain and restore both. Note that in the nonlocal case, the
7408 ;; save area is a memory location.
7410 (define_expand "save_stack_function"
7411 [(match_operand 0 "general_operand" "")
7412 (match_operand 1 "general_operand" "")]
7416 (define_expand "restore_stack_function"
7417 [(match_operand 0 "general_operand" "")
7418 (match_operand 1 "general_operand" "")]
7422 (define_expand "restore_stack_block"
7423 [(use (match_operand 0 "register_operand" ""))
7424 (set (match_dup 2) (match_dup 3))
7425 (set (match_dup 0) (match_operand 1 "register_operand" ""))
7426 (set (match_dup 3) (match_dup 2))]
7429 operands[2] = gen_reg_rtx (Pmode);
7430 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7433 (define_expand "save_stack_nonlocal"
7434 [(match_operand 0 "memory_operand" "")
7435 (match_operand 1 "register_operand" "")]
7438 rtx temp = gen_reg_rtx (Pmode);
7440 /* Copy the backchain to the first word, sp to the second and the literal pool
7441 base to the third. */
7442 emit_move_insn (operand_subword (operands[0], 2, 0,
7443 TARGET_64BIT ? OImode : TImode),
7444 gen_rtx_REG (Pmode, BASE_REGNUM));
7445 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7446 emit_move_insn (operand_subword (operands[0], 0, 0,
7447 TARGET_64BIT ? OImode : TImode),
7449 emit_move_insn (operand_subword (operands[0], 1, 0,
7450 TARGET_64BIT ? OImode : TImode),
7455 (define_expand "restore_stack_nonlocal"
7456 [(match_operand 0 "register_operand" "")
7457 (match_operand 1 "memory_operand" "")]
7460 rtx temp = gen_reg_rtx (Pmode);
7461 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7463 /* Restore the backchain from the first word, sp from the second and the
7464 literal pool base from the third. */
7465 emit_move_insn (temp,
7466 operand_subword (operands[1], 0, 0,
7467 TARGET_64BIT ? OImode : TImode));
7468 emit_move_insn (operands[0],
7469 operand_subword (operands[1], 1, 0,
7470 TARGET_64BIT ? OImode : TImode));
7471 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7472 emit_move_insn (base,
7473 operand_subword (operands[1], 2, 0,
7474 TARGET_64BIT ? OImode : TImode));
7475 emit_insn (gen_rtx_USE (VOIDmode, base));
7482 ; nop instruction pattern(s).
7489 [(set_attr "op_type" "RR")])
7493 ; Special literal pool access instruction pattern(s).
7496 (define_insn "*pool_entry"
7497 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7498 UNSPECV_POOL_ENTRY)]
7501 enum machine_mode mode = GET_MODE (PATTERN (insn));
7502 unsigned int align = GET_MODE_BITSIZE (mode);
7503 s390_output_pool_entry (operands[0], mode, align);
7506 [(set_attr "op_type" "NN")
7507 (set (attr "length")
7508 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7510 (define_insn "pool_start_31"
7511 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7514 [(set_attr "op_type" "NN")
7515 (set_attr "length" "2")])
7517 (define_insn "pool_end_31"
7518 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7521 [(set_attr "op_type" "NN")
7522 (set_attr "length" "2")])
7524 (define_insn "pool_start_64"
7525 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7527 ".section\t.rodata\;.align\t8"
7528 [(set_attr "op_type" "NN")
7529 (set_attr "length" "0")])
7531 (define_insn "pool_end_64"
7532 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7535 [(set_attr "op_type" "NN")
7536 (set_attr "length" "0")])
7538 (define_insn "main_base_31_small"
7539 [(set (match_operand 0 "register_operand" "=a")
7540 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7541 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7543 [(set_attr "op_type" "RR")
7544 (set_attr "type" "la")])
7546 (define_insn "main_base_31_large"
7547 [(set (match_operand 0 "register_operand" "=a")
7548 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7549 (set (pc) (label_ref (match_operand 2 "" "")))]
7550 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7552 [(set_attr "op_type" "RI")])
7554 (define_insn "main_base_64"
7555 [(set (match_operand 0 "register_operand" "=a")
7556 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7557 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7559 [(set_attr "op_type" "RIL")
7560 (set_attr "type" "larl")])
7562 (define_insn "main_pool"
7563 [(set (match_operand 0 "register_operand" "=a")
7564 (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
7565 "GET_MODE (operands[0]) == Pmode"
7567 [(set_attr "op_type" "NN")])
7569 (define_insn "reload_base_31"
7570 [(set (match_operand 0 "register_operand" "=a")
7571 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7572 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7573 "basr\t%0,0\;la\t%0,%1-.(%0)"
7574 [(set_attr "op_type" "NN")
7575 (set_attr "type" "la")
7576 (set_attr "length" "6")])
7578 (define_insn "reload_base_64"
7579 [(set (match_operand 0 "register_operand" "=a")
7580 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7581 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7583 [(set_attr "op_type" "RIL")
7584 (set_attr "type" "larl")])
7587 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7590 [(set_attr "op_type" "NN")
7591 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7594 ;; Insns related to generating the function prologue and epilogue.
7598 (define_expand "prologue"
7599 [(use (const_int 0))]
7601 "s390_emit_prologue (); DONE;")
7603 (define_insn "prologue_tpf"
7604 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7605 (clobber (reg:DI 1))]
7606 "TARGET_TPF_PROFILING"
7608 [(set_attr "type" "jsr")
7609 (set_attr "op_type" "RX")])
7611 (define_expand "epilogue"
7612 [(use (const_int 1))]
7614 "s390_emit_epilogue (false); DONE;")
7616 (define_insn "epilogue_tpf"
7617 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7618 (clobber (reg:DI 1))]
7619 "TARGET_TPF_PROFILING"
7621 [(set_attr "type" "jsr")
7622 (set_attr "op_type" "RX")])
7625 (define_expand "sibcall_epilogue"
7626 [(use (const_int 0))]
7628 "s390_emit_epilogue (true); DONE;")
7630 (define_insn "*return"
7632 (use (match_operand 0 "register_operand" "a"))]
7633 "GET_MODE (operands[0]) == Pmode"
7635 [(set_attr "op_type" "RR")
7636 (set_attr "type" "jsr")
7637 (set_attr "atype" "agen")])
7640 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7641 ;; pointer. This is used for compatibility.
7643 (define_expand "ptr_extend"
7644 [(set (match_operand:DI 0 "register_operand" "=r")
7645 (match_operand:SI 1 "register_operand" "r"))]
7648 emit_insn (gen_anddi3 (operands[0],
7649 gen_lowpart (DImode, operands[1]),
7650 GEN_INT (0x7fffffff)));