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));
1660 from = force_reg (Pmode, XEXP (operands[1], 0));
1664 for (i = 0; i < count; i++)
1665 XVECEXP (operands[3], 0, i)
1666 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1667 change_address (operands[1], mode,
1668 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1671 (define_insn "*load_multiple_di"
1672 [(match_parallel 0 "load_multiple_operation"
1673 [(set (match_operand:DI 1 "register_operand" "=r")
1674 (match_operand:DI 2 "s_operand" "QS"))])]
1675 "reload_completed && word_mode == DImode"
1677 int words = XVECLEN (operands[0], 0);
1678 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1679 return "lmg\t%1,%0,%2";
1681 [(set_attr "op_type" "RSY")
1682 (set_attr "type" "lm")])
1684 (define_insn "*load_multiple_si"
1685 [(match_parallel 0 "load_multiple_operation"
1686 [(set (match_operand:SI 1 "register_operand" "=r,r")
1687 (match_operand:SI 2 "s_operand" "Q,S"))])]
1690 int words = XVECLEN (operands[0], 0);
1691 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1692 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1694 [(set_attr "op_type" "RS,RSY")
1695 (set_attr "type" "lm")])
1698 ; store multiple pattern(s).
1701 (define_expand "store_multiple"
1702 [(match_par_dup 3 [(set (match_operand 0 "" "")
1703 (match_operand 1 "" ""))
1704 (use (match_operand 2 "" ""))])]
1707 enum machine_mode mode;
1713 /* Support only storing a constant number of fixed-point registers to
1714 memory and only bother with this if more than two. */
1715 if (GET_CODE (operands[2]) != CONST_INT
1716 || INTVAL (operands[2]) < 2
1717 || INTVAL (operands[2]) > 16
1718 || GET_CODE (operands[0]) != MEM
1719 || GET_CODE (operands[1]) != REG
1720 || REGNO (operands[1]) >= 16)
1723 count = INTVAL (operands[2]);
1724 regno = REGNO (operands[1]);
1725 mode = GET_MODE (operands[1]);
1726 if (mode != SImode && mode != word_mode)
1729 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1733 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1735 to = XEXP (operands[0], 0);
1738 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1739 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1740 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1742 to = XEXP (XEXP (operands[0], 0), 0);
1743 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1750 to = force_reg (Pmode, XEXP (operands[0], 0));
1754 for (i = 0; i < count; i++)
1755 XVECEXP (operands[3], 0, i)
1756 = gen_rtx_SET (VOIDmode,
1757 change_address (operands[0], mode,
1758 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1759 gen_rtx_REG (mode, regno + i));
1762 (define_insn "*store_multiple_di"
1763 [(match_parallel 0 "store_multiple_operation"
1764 [(set (match_operand:DI 1 "s_operand" "=QS")
1765 (match_operand:DI 2 "register_operand" "r"))])]
1766 "reload_completed && word_mode == DImode"
1768 int words = XVECLEN (operands[0], 0);
1769 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1770 return "stmg\t%2,%0,%1";
1772 [(set_attr "op_type" "RSY")
1773 (set_attr "type" "stm")])
1776 (define_insn "*store_multiple_si"
1777 [(match_parallel 0 "store_multiple_operation"
1778 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1779 (match_operand:SI 2 "register_operand" "r,r"))])]
1782 int words = XVECLEN (operands[0], 0);
1783 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1784 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1786 [(set_attr "op_type" "RS,RSY")
1787 (set_attr "type" "stm")])
1790 ;; String instructions.
1794 ; strlenM instruction pattern(s).
1797 (define_expand "strlendi"
1798 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1801 (unspec:DI [(const_int 0)
1802 (match_operand:BLK 1 "memory_operand" "")
1804 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1805 (clobber (scratch:DI))
1806 (clobber (reg:CC 33))])
1808 [(set (match_operand:DI 0 "register_operand" "")
1809 (minus:DI (match_dup 4) (match_dup 5)))
1810 (clobber (reg:CC 33))])]
1813 operands[4] = gen_reg_rtx (DImode);
1814 operands[5] = gen_reg_rtx (DImode);
1815 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1816 operands[1] = replace_equiv_address (operands[1], operands[5]);
1819 (define_insn "*strlendi"
1820 [(set (match_operand:DI 0 "register_operand" "=a")
1821 (unspec:DI [(match_operand:DI 2 "general_operand" "0")
1822 (mem:BLK (match_operand:DI 3 "register_operand" "1"))
1824 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1825 (clobber (match_scratch:DI 1 "=a"))
1826 (clobber (reg:CC 33))]
1828 "srst\t%0,%1\;jo\t.-4"
1829 [(set_attr "op_type" "NN")
1830 (set_attr "type" "vs")
1831 (set_attr "length" "8")])
1833 (define_expand "strlensi"
1834 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1837 (unspec:SI [(const_int 0)
1838 (match_operand:BLK 1 "memory_operand" "")
1840 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1841 (clobber (scratch:SI))
1842 (clobber (reg:CC 33))])
1844 [(set (match_operand:SI 0 "register_operand" "")
1845 (minus:SI (match_dup 4) (match_dup 5)))
1846 (clobber (reg:CC 33))])]
1849 operands[4] = gen_reg_rtx (SImode);
1850 operands[5] = gen_reg_rtx (SImode);
1851 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1852 operands[1] = replace_equiv_address (operands[1], operands[5]);
1855 (define_insn "*strlensi"
1856 [(set (match_operand:SI 0 "register_operand" "=a")
1857 (unspec:SI [(match_operand:SI 2 "general_operand" "0")
1858 (mem:BLK (match_operand:SI 3 "register_operand" "1"))
1860 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1861 (clobber (match_scratch:SI 1 "=a"))
1862 (clobber (reg:CC 33))]
1864 "srst\t%0,%1\;jo\t.-4"
1865 [(set_attr "op_type" "NN")
1866 (set_attr "type" "vs")
1867 (set_attr "length" "8")])
1870 ; movmemM instruction pattern(s).
1873 (define_expand "movmemdi"
1874 [(set (match_operand:BLK 0 "memory_operand" "")
1875 (match_operand:BLK 1 "memory_operand" ""))
1876 (use (match_operand:DI 2 "general_operand" ""))
1877 (match_operand 3 "" "")]
1879 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1881 (define_expand "movmemsi"
1882 [(set (match_operand:BLK 0 "memory_operand" "")
1883 (match_operand:BLK 1 "memory_operand" ""))
1884 (use (match_operand:SI 2 "general_operand" ""))
1885 (match_operand 3 "" "")]
1887 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1889 ; Move a block that is up to 256 bytes in length.
1890 ; The block length is taken as (operands[2] % 256) + 1.
1892 (define_expand "movmem_short"
1894 [(set (match_operand:BLK 0 "memory_operand" "")
1895 (match_operand:BLK 1 "memory_operand" ""))
1896 (use (match_operand 2 "nonmemory_operand" ""))
1897 (clobber (match_dup 3))])]
1899 "operands[3] = gen_rtx_SCRATCH (Pmode);")
1901 (define_insn "*movmem_short"
1902 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1903 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1904 (use (match_operand 2 "nonmemory_operand" "n,a"))
1905 (clobber (match_scratch 3 "=X,&a"))]
1906 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
1907 && GET_MODE (operands[3]) == Pmode"
1909 switch (which_alternative)
1912 return "mvc\t%O0(%b2+1,%R0),%1";
1915 output_asm_insn ("bras\t%3,.+10", operands);
1916 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1917 return "ex\t%2,0(%3)";
1923 [(set_attr "op_type" "SS,NN")
1924 (set_attr "type" "cs,cs")
1925 (set_attr "atype" "*,agen")
1926 (set_attr "length" "*,14")])
1928 ; Move a block of arbitrary length.
1930 (define_expand "movmem_long"
1932 [(clobber (match_dup 2))
1933 (clobber (match_dup 3))
1934 (set (match_operand:BLK 0 "memory_operand" "")
1935 (match_operand:BLK 1 "memory_operand" ""))
1936 (use (match_operand 2 "general_operand" ""))
1938 (clobber (reg:CC 33))])]
1941 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1942 rtx reg0 = gen_reg_rtx (dword_mode);
1943 rtx reg1 = gen_reg_rtx (dword_mode);
1944 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1945 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
1946 rtx len0 = gen_lowpart (Pmode, reg0);
1947 rtx len1 = gen_lowpart (Pmode, reg1);
1949 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1950 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1951 emit_move_insn (len0, operands[2]);
1953 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
1954 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
1955 emit_move_insn (len1, operands[2]);
1957 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1958 operands[1] = replace_equiv_address_nv (operands[1], addr1);
1963 (define_insn "*movmem_long_64"
1964 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1965 (clobber (match_operand:TI 1 "register_operand" "=d"))
1966 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1967 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
1970 (clobber (reg:CC 33))]
1972 "mvcle\t%0,%1,0\;jo\t.-4"
1973 [(set_attr "op_type" "NN")
1974 (set_attr "type" "vs")
1975 (set_attr "length" "8")])
1977 (define_insn "*movmem_long_31"
1978 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1979 (clobber (match_operand:DI 1 "register_operand" "=d"))
1980 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
1981 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
1984 (clobber (reg:CC 33))]
1986 "mvcle\t%0,%1,0\;jo\t.-4"
1987 [(set_attr "op_type" "NN")
1988 (set_attr "type" "vs")
1989 (set_attr "length" "8")])
1992 ; clrmemM instruction pattern(s).
1995 (define_expand "clrmemdi"
1996 [(set (match_operand:BLK 0 "memory_operand" "")
1998 (use (match_operand:DI 1 "general_operand" ""))
1999 (match_operand 2 "" "")]
2001 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
2003 (define_expand "clrmemsi"
2004 [(set (match_operand:BLK 0 "memory_operand" "")
2006 (use (match_operand:SI 1 "general_operand" ""))
2007 (match_operand 2 "" "")]
2009 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
2011 ; Clear a block that is up to 256 bytes in length.
2012 ; The block length is taken as (operands[1] % 256) + 1.
2014 (define_expand "clrmem_short"
2016 [(set (match_operand:BLK 0 "memory_operand" "")
2018 (use (match_operand 1 "nonmemory_operand" ""))
2019 (clobber (match_dup 2))
2020 (clobber (reg:CC 33))])]
2022 "operands[2] = gen_rtx_SCRATCH (Pmode);")
2024 (define_insn "*clrmem_short"
2025 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
2027 (use (match_operand 1 "nonmemory_operand" "n,a"))
2028 (clobber (match_scratch 2 "=X,&a"))
2029 (clobber (reg:CC 33))]
2030 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
2031 && GET_MODE (operands[2]) == Pmode"
2033 switch (which_alternative)
2036 return "xc\t%O0(%b1+1,%R0),%0";
2039 output_asm_insn ("bras\t%2,.+10", operands);
2040 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
2041 return "ex\t%1,0(%2)";
2047 [(set_attr "op_type" "SS,NN")
2048 (set_attr "type" "cs,cs")
2049 (set_attr "atype" "*,agen")
2050 (set_attr "length" "*,14")])
2052 ; Clear a block of arbitrary length.
2054 (define_expand "clrmem_long"
2056 [(clobber (match_dup 1))
2057 (set (match_operand:BLK 0 "memory_operand" "")
2059 (use (match_operand 1 "general_operand" ""))
2061 (clobber (reg:CC 33))])]
2064 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2065 rtx reg0 = gen_reg_rtx (dword_mode);
2066 rtx reg1 = gen_reg_rtx (dword_mode);
2067 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2068 rtx len0 = gen_lowpart (Pmode, reg0);
2070 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2071 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2072 emit_move_insn (len0, operands[1]);
2074 emit_move_insn (reg1, const0_rtx);
2076 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2081 (define_insn "*clrmem_long_64"
2082 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2083 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2086 (use (match_operand:TI 1 "register_operand" "d"))
2087 (clobber (reg:CC 33))]
2089 "mvcle\t%0,%1,0\;jo\t.-4"
2090 [(set_attr "op_type" "NN")
2091 (set_attr "type" "vs")
2092 (set_attr "length" "8")])
2094 (define_insn "*clrmem_long_31"
2095 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2096 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2099 (use (match_operand:DI 1 "register_operand" "d"))
2100 (clobber (reg:CC 33))]
2102 "mvcle\t%0,%1,0\;jo\t.-4"
2103 [(set_attr "op_type" "NN")
2104 (set_attr "type" "vs")
2105 (set_attr "length" "8")])
2108 ; cmpmemM instruction pattern(s).
2111 (define_expand "cmpmemdi"
2112 [(set (match_operand:DI 0 "register_operand" "")
2113 (compare:DI (match_operand:BLK 1 "memory_operand" "")
2114 (match_operand:BLK 2 "memory_operand" "") ) )
2115 (use (match_operand:DI 3 "general_operand" ""))
2116 (use (match_operand:DI 4 "" ""))]
2118 "s390_expand_cmpmem (operands[0], operands[1],
2119 operands[2], operands[3]); DONE;")
2121 (define_expand "cmpmemsi"
2122 [(set (match_operand:SI 0 "register_operand" "")
2123 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2124 (match_operand:BLK 2 "memory_operand" "") ) )
2125 (use (match_operand:SI 3 "general_operand" ""))
2126 (use (match_operand:SI 4 "" ""))]
2128 "s390_expand_cmpmem (operands[0], operands[1],
2129 operands[2], operands[3]); DONE;")
2131 ; Compare a block that is up to 256 bytes in length.
2132 ; The block length is taken as (operands[2] % 256) + 1.
2134 (define_expand "cmpmem_short"
2137 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2138 (match_operand:BLK 1 "memory_operand" "")))
2139 (use (match_operand 2 "nonmemory_operand" ""))
2140 (clobber (match_dup 3))])]
2142 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2144 (define_insn "*cmpmem_short"
2146 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2147 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2148 (use (match_operand 2 "nonmemory_operand" "n,a"))
2149 (clobber (match_scratch 3 "=X,&a"))]
2150 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2151 && GET_MODE (operands[3]) == Pmode"
2153 switch (which_alternative)
2156 return "clc\t%O0(%b2+1,%R0),%1";
2159 output_asm_insn ("bras\t%3,.+10", operands);
2160 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2161 return "ex\t%2,0(%3)";
2167 [(set_attr "op_type" "SS,NN")
2168 (set_attr "type" "cs,cs")
2169 (set_attr "atype" "*,agen")
2170 (set_attr "length" "*,14")])
2172 ; Compare a block of arbitrary length.
2174 (define_expand "cmpmem_long"
2176 [(clobber (match_dup 2))
2177 (clobber (match_dup 3))
2179 (compare:CCS (match_operand:BLK 0 "memory_operand" "")
2180 (match_operand:BLK 1 "memory_operand" "")))
2181 (use (match_operand 2 "general_operand" ""))
2182 (use (match_dup 3))])]
2185 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2186 rtx reg0 = gen_reg_rtx (dword_mode);
2187 rtx reg1 = gen_reg_rtx (dword_mode);
2188 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2189 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2190 rtx len0 = gen_lowpart (Pmode, reg0);
2191 rtx len1 = gen_lowpart (Pmode, reg1);
2193 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2194 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2195 emit_move_insn (len0, operands[2]);
2197 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2198 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2199 emit_move_insn (len1, operands[2]);
2201 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2202 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2207 (define_insn "*cmpmem_long_64"
2208 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2209 (clobber (match_operand:TI 1 "register_operand" "=d"))
2211 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2212 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2214 (use (match_dup 3))]
2216 "clcle\t%0,%1,0\;jo\t.-4"
2217 [(set_attr "op_type" "NN")
2218 (set_attr "type" "vs")
2219 (set_attr "length" "8")])
2221 (define_insn "*cmpmem_long_31"
2222 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2223 (clobber (match_operand:DI 1 "register_operand" "=d"))
2225 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2226 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2228 (use (match_dup 3))]
2230 "clcle\t%0,%1,0\;jo\t.-4"
2231 [(set_attr "op_type" "NN")
2232 (set_attr "type" "vs")
2233 (set_attr "length" "8")])
2235 ; Convert condition code to integer in range (-1, 0, 1)
2237 (define_insn "cmpint_si"
2238 [(set (match_operand:SI 0 "register_operand" "=d")
2239 (compare:SI (reg:CCS 33) (const_int 0)))]
2242 output_asm_insn ("lhi\t%0,1", operands);
2243 output_asm_insn ("jh\t.+12", operands);
2244 output_asm_insn ("jl\t.+6", operands);
2245 output_asm_insn ("sr\t%0,%0", operands);
2246 return "lcr\t%0,%0";
2248 [(set_attr "op_type" "NN")
2249 (set_attr "length" "16")
2250 (set_attr "type" "other")])
2252 (define_insn "cmpint_di"
2253 [(set (match_operand:DI 0 "register_operand" "=d")
2254 (compare:DI (reg:CCS 33) (const_int 0)))]
2257 output_asm_insn ("lghi\t%0,1", operands);
2258 output_asm_insn ("jh\t.+16", operands);
2259 output_asm_insn ("jl\t.+8", operands);
2260 output_asm_insn ("sgr\t%0,%0", operands);
2261 return "lcgr\t%0,%0";
2263 [(set_attr "op_type" "NN")
2264 (set_attr "length" "20")
2265 (set_attr "type" "other")])
2269 ;;- Conversion instructions.
2272 (define_insn "*sethighqisi"
2273 [(set (match_operand:SI 0 "register_operand" "=d,d")
2274 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2275 (clobber (reg:CC 33))]
2280 [(set_attr "op_type" "RS,RSY")])
2282 (define_insn "*sethighhisi"
2283 [(set (match_operand:SI 0 "register_operand" "=d,d")
2284 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2285 (clobber (reg:CC 33))]
2290 [(set_attr "op_type" "RS,RSY")])
2292 (define_insn "*sethighqidi_64"
2293 [(set (match_operand:DI 0 "register_operand" "=d")
2294 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2295 (clobber (reg:CC 33))]
2298 [(set_attr "op_type" "RSY")])
2300 (define_insn "*sethighqidi_31"
2301 [(set (match_operand:DI 0 "register_operand" "=d,d")
2302 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2303 (clobber (reg:CC 33))]
2308 [(set_attr "op_type" "RS,RSY")])
2310 (define_insn_and_split "*extractqi"
2311 [(set (match_operand:SI 0 "register_operand" "=d")
2312 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2313 (match_operand 2 "const_int_operand" "n")
2315 (clobber (reg:CC 33))]
2317 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2319 "&& reload_completed"
2321 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2322 (clobber (reg:CC 33))])
2323 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2325 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2326 operands[1] = change_address (operands[1], QImode, 0);
2328 [(set_attr "atype" "agen")])
2330 (define_insn_and_split "*extracthi"
2331 [(set (match_operand:SI 0 "register_operand" "=d")
2332 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2333 (match_operand 2 "const_int_operand" "n")
2335 (clobber (reg:CC 33))]
2337 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2339 "&& reload_completed"
2341 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2342 (clobber (reg:CC 33))])
2343 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2345 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2346 operands[1] = change_address (operands[1], HImode, 0);
2348 [(set_attr "atype" "agen")])
2351 ; extendsidi2 instruction pattern(s).
2354 (define_expand "extendsidi2"
2355 [(set (match_operand:DI 0 "register_operand" "")
2356 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2362 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2363 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2364 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2365 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2371 (define_insn "*extendsidi2"
2372 [(set (match_operand:DI 0 "register_operand" "=d,d")
2373 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2378 [(set_attr "op_type" "RRE,RXY")])
2381 ; extendhidi2 instruction pattern(s).
2384 (define_expand "extendhidi2"
2385 [(set (match_operand:DI 0 "register_operand" "")
2386 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2392 rtx tmp = gen_reg_rtx (SImode);
2393 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2394 emit_insn (gen_extendsidi2 (operands[0], tmp));
2399 operands[1] = gen_lowpart (DImode, operands[1]);
2400 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2401 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2407 (define_insn "*extendhidi2"
2408 [(set (match_operand:DI 0 "register_operand" "=d")
2409 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2412 [(set_attr "op_type" "RXY")])
2415 ; extendqidi2 instruction pattern(s).
2418 (define_expand "extendqidi2"
2419 [(set (match_operand:DI 0 "register_operand" "")
2420 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2426 rtx tmp = gen_reg_rtx (SImode);
2427 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2428 emit_insn (gen_extendsidi2 (operands[0], tmp));
2433 operands[1] = gen_lowpart (DImode, operands[1]);
2434 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2435 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2441 (define_insn "*extendqidi2"
2442 [(set (match_operand:DI 0 "register_operand" "=d")
2443 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2444 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2446 [(set_attr "op_type" "RXY")])
2448 (define_insn_and_split "*extendqidi2_short_displ"
2449 [(set (match_operand:DI 0 "register_operand" "=d")
2450 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2451 (clobber (reg:CC 33))]
2452 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2454 "&& reload_completed"
2456 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2457 (clobber (reg:CC 33))])
2459 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2460 (clobber (reg:CC 33))])]
2464 ; extendhisi2 instruction pattern(s).
2467 (define_expand "extendhisi2"
2468 [(set (match_operand:SI 0 "register_operand" "")
2469 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2473 operands[1] = gen_lowpart (SImode, operands[1]);
2474 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2475 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2480 (define_insn "*extendhisi2"
2481 [(set (match_operand:SI 0 "register_operand" "=d,d")
2482 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2487 [(set_attr "op_type" "RX,RXY")])
2490 ; extendqisi2 instruction pattern(s).
2493 (define_expand "extendqisi2"
2494 [(set (match_operand:SI 0 "register_operand" "")
2495 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2499 operands[1] = gen_lowpart (SImode, operands[1]);
2500 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2501 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2506 (define_insn "*extendqisi2"
2507 [(set (match_operand:SI 0 "register_operand" "=d")
2508 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2509 "TARGET_LONG_DISPLACEMENT"
2511 [(set_attr "op_type" "RXY")])
2513 (define_insn_and_split "*extendqisi2_short_displ"
2514 [(set (match_operand:SI 0 "register_operand" "=d")
2515 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2516 (clobber (reg:CC 33))]
2517 "!TARGET_LONG_DISPLACEMENT"
2519 "&& reload_completed"
2521 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2522 (clobber (reg:CC 33))])
2524 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2525 (clobber (reg:CC 33))])]
2529 ; extendqihi2 instruction pattern(s).
2534 ; zero_extendsidi2 instruction pattern(s).
2537 (define_expand "zero_extendsidi2"
2538 [(set (match_operand:DI 0 "register_operand" "")
2539 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2545 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2546 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2547 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2553 (define_insn "*zero_extendsidi2"
2554 [(set (match_operand:DI 0 "register_operand" "=d,d")
2555 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2560 [(set_attr "op_type" "RRE,RXY")])
2563 ; zero_extendhidi2 instruction pattern(s).
2566 (define_expand "zero_extendhidi2"
2567 [(set (match_operand:DI 0 "register_operand" "")
2568 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2574 rtx tmp = gen_reg_rtx (SImode);
2575 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2576 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2581 operands[1] = gen_lowpart (DImode, operands[1]);
2582 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2583 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2589 (define_insn "*zero_extendhidi2"
2590 [(set (match_operand:DI 0 "register_operand" "=d")
2591 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2594 [(set_attr "op_type" "RXY")])
2597 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2600 (define_insn "*llgt_sisi"
2601 [(set (match_operand:SI 0 "register_operand" "=d,d")
2602 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2603 (const_int 2147483647)))]
2608 [(set_attr "op_type" "RRE,RXE")])
2611 [(set (match_operand:SI 0 "register_operand" "")
2612 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2613 (const_int 2147483647)))
2614 (clobber (reg:CC 33))]
2615 "TARGET_64BIT && reload_completed"
2617 (and:SI (match_dup 1)
2618 (const_int 2147483647)))]
2621 (define_insn "*llgt_didi"
2622 [(set (match_operand:DI 0 "register_operand" "=d,d")
2623 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2624 (const_int 2147483647)))]
2629 [(set_attr "op_type" "RRE,RXE")])
2632 [(set (match_operand:DI 0 "register_operand" "")
2633 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2634 (const_int 2147483647)))
2635 (clobber (reg:CC 33))]
2636 "TARGET_64BIT && reload_completed"
2638 (and:DI (match_dup 1)
2639 (const_int 2147483647)))]
2642 (define_insn "*llgt_sidi"
2643 [(set (match_operand:DI 0 "register_operand" "=d")
2644 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2645 (const_int 2147483647)))]
2648 [(set_attr "op_type" "RXE")])
2650 (define_insn_and_split "*llgt_sidi_split"
2651 [(set (match_operand:DI 0 "register_operand" "=d")
2652 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2653 (const_int 2147483647)))
2654 (clobber (reg:CC 33))]
2657 "&& reload_completed"
2659 (and:DI (subreg:DI (match_dup 1) 0)
2660 (const_int 2147483647)))]
2664 ; zero_extendqidi2 instruction pattern(s)
2667 (define_expand "zero_extendqidi2"
2668 [(set (match_operand:DI 0 "register_operand" "")
2669 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2675 rtx tmp = gen_reg_rtx (SImode);
2676 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2677 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2682 operands[1] = gen_lowpart (DImode, operands[1]);
2683 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2684 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2690 (define_insn "*zero_extendqidi2"
2691 [(set (match_operand:DI 0 "register_operand" "=d")
2692 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2695 [(set_attr "op_type" "RXY")])
2698 ; zero_extendhisi2 instruction pattern(s).
2701 (define_expand "zero_extendhisi2"
2702 [(set (match_operand:SI 0 "register_operand" "")
2703 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2707 operands[1] = gen_lowpart (SImode, operands[1]);
2708 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2713 (define_insn "*zero_extendhisi2_64"
2714 [(set (match_operand:SI 0 "register_operand" "=d")
2715 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2718 [(set_attr "op_type" "RXY")])
2720 (define_insn_and_split "*zero_extendhisi2_31"
2721 [(set (match_operand:SI 0 "register_operand" "=&d")
2722 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2723 (clobber (reg:CC 33))]
2726 "&& reload_completed"
2727 [(set (match_dup 0) (const_int 0))
2729 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2730 (clobber (reg:CC 33))])]
2731 "operands[2] = gen_lowpart (HImode, operands[0]);"
2732 [(set_attr "atype" "agen")])
2735 ; zero_extendqisi2 instruction pattern(s).
2738 (define_expand "zero_extendqisi2"
2739 [(set (match_operand:SI 0 "register_operand" "")
2740 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2744 operands[1] = gen_lowpart (SImode, operands[1]);
2745 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2750 (define_insn "*zero_extendqisi2_64"
2751 [(set (match_operand:SI 0 "register_operand" "=d")
2752 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2755 [(set_attr "op_type" "RXY")])
2757 (define_insn_and_split "*zero_extendqisi2_31"
2758 [(set (match_operand:SI 0 "register_operand" "=&d")
2759 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2762 "&& reload_completed"
2763 [(set (match_dup 0) (const_int 0))
2764 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2765 "operands[2] = gen_lowpart (QImode, operands[0]);"
2766 [(set_attr "atype" "agen")])
2769 ; zero_extendqihi2 instruction pattern(s).
2772 (define_expand "zero_extendqihi2"
2773 [(set (match_operand:HI 0 "register_operand" "")
2774 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2778 operands[1] = gen_lowpart (HImode, operands[1]);
2779 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2784 (define_insn "*zero_extendqihi2_64"
2785 [(set (match_operand:HI 0 "register_operand" "=d")
2786 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2789 [(set_attr "op_type" "RXY")])
2791 (define_insn_and_split "*zero_extendqihi2_31"
2792 [(set (match_operand:HI 0 "register_operand" "=&d")
2793 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2796 "&& reload_completed"
2797 [(set (match_dup 0) (const_int 0))
2798 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2799 "operands[2] = gen_lowpart (QImode, operands[0]);"
2800 [(set_attr "atype" "agen")])
2804 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2807 (define_expand "fixuns_truncdfdi2"
2808 [(set (match_operand:DI 0 "register_operand" "")
2809 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2810 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2812 rtx label1 = gen_label_rtx ();
2813 rtx label2 = gen_label_rtx ();
2814 rtx temp = gen_reg_rtx (DFmode);
2815 operands[1] = force_reg (DFmode, operands[1]);
2817 emit_insn (gen_cmpdf (operands[1],
2818 CONST_DOUBLE_FROM_REAL_VALUE (
2819 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2820 emit_jump_insn (gen_blt (label1));
2821 emit_insn (gen_subdf3 (temp, operands[1],
2822 CONST_DOUBLE_FROM_REAL_VALUE (
2823 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2824 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2827 emit_label (label1);
2828 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2829 emit_label (label2);
2833 (define_expand "fix_truncdfdi2"
2834 [(set (match_operand:DI 0 "register_operand" "")
2835 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2836 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2838 operands[1] = force_reg (DFmode, operands[1]);
2839 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2843 (define_insn "fix_truncdfdi2_ieee"
2844 [(set (match_operand:DI 0 "register_operand" "=d")
2845 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2846 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2847 (clobber (reg:CC 33))]
2848 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2850 [(set_attr "op_type" "RRE")
2851 (set_attr "type" "ftoi")])
2854 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2857 (define_expand "fixuns_truncdfsi2"
2858 [(set (match_operand:SI 0 "register_operand" "")
2859 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2860 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2862 rtx label1 = gen_label_rtx ();
2863 rtx label2 = gen_label_rtx ();
2864 rtx temp = gen_reg_rtx (DFmode);
2866 operands[1] = force_reg (DFmode,operands[1]);
2867 emit_insn (gen_cmpdf (operands[1],
2868 CONST_DOUBLE_FROM_REAL_VALUE (
2869 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2870 emit_jump_insn (gen_blt (label1));
2871 emit_insn (gen_subdf3 (temp, operands[1],
2872 CONST_DOUBLE_FROM_REAL_VALUE (
2873 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2874 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2877 emit_label (label1);
2878 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2879 emit_label (label2);
2883 (define_expand "fix_truncdfsi2"
2884 [(set (match_operand:SI 0 "register_operand" "")
2885 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2888 if (TARGET_IBM_FLOAT)
2890 /* This is the algorithm from POP chapter A.5.7.2. */
2892 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2893 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2894 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2896 operands[1] = force_reg (DFmode, operands[1]);
2897 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2898 two31r, two32, temp));
2902 operands[1] = force_reg (DFmode, operands[1]);
2903 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2909 (define_insn "fix_truncdfsi2_ieee"
2910 [(set (match_operand:SI 0 "register_operand" "=d")
2911 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2912 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2913 (clobber (reg:CC 33))]
2914 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2916 [(set_attr "op_type" "RRE")
2917 (set_attr "type" "other" )])
2919 (define_insn "fix_truncdfsi2_ibm"
2920 [(set (match_operand:SI 0 "register_operand" "=d")
2921 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2922 (use (match_operand:DI 2 "immediate_operand" "m"))
2923 (use (match_operand:DI 3 "immediate_operand" "m"))
2924 (use (match_operand:BLK 4 "memory_operand" "m"))
2925 (clobber (reg:CC 33))]
2926 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2928 output_asm_insn ("sd\t%1,%2", operands);
2929 output_asm_insn ("aw\t%1,%3", operands);
2930 output_asm_insn ("std\t%1,%4", operands);
2931 output_asm_insn ("xi\t%N4,128", operands);
2934 [(set_attr "op_type" "NN")
2935 (set_attr "type" "ftoi")
2936 (set_attr "atype" "agen")
2937 (set_attr "length" "20")])
2940 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2943 (define_expand "fixuns_truncsfdi2"
2944 [(set (match_operand:DI 0 "register_operand" "")
2945 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2946 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2948 rtx label1 = gen_label_rtx ();
2949 rtx label2 = gen_label_rtx ();
2950 rtx temp = gen_reg_rtx (SFmode);
2952 operands[1] = force_reg (SFmode, operands[1]);
2953 emit_insn (gen_cmpsf (operands[1],
2954 CONST_DOUBLE_FROM_REAL_VALUE (
2955 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2956 emit_jump_insn (gen_blt (label1));
2958 emit_insn (gen_subsf3 (temp, operands[1],
2959 CONST_DOUBLE_FROM_REAL_VALUE (
2960 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2961 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2964 emit_label (label1);
2965 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2966 emit_label (label2);
2970 (define_expand "fix_truncsfdi2"
2971 [(set (match_operand:DI 0 "register_operand" "")
2972 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2973 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2975 operands[1] = force_reg (SFmode, operands[1]);
2976 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2980 (define_insn "fix_truncsfdi2_ieee"
2981 [(set (match_operand:DI 0 "register_operand" "=d")
2982 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2983 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2984 (clobber (reg:CC 33))]
2985 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2987 [(set_attr "op_type" "RRE")
2988 (set_attr "type" "ftoi")])
2991 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2994 (define_expand "fixuns_truncsfsi2"
2995 [(set (match_operand:SI 0 "register_operand" "")
2996 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2997 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2999 rtx label1 = gen_label_rtx ();
3000 rtx label2 = gen_label_rtx ();
3001 rtx temp = gen_reg_rtx (SFmode);
3003 operands[1] = force_reg (SFmode, operands[1]);
3004 emit_insn (gen_cmpsf (operands[1],
3005 CONST_DOUBLE_FROM_REAL_VALUE (
3006 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
3007 emit_jump_insn (gen_blt (label1));
3008 emit_insn (gen_subsf3 (temp, operands[1],
3009 CONST_DOUBLE_FROM_REAL_VALUE (
3010 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
3011 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
3014 emit_label (label1);
3015 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3016 emit_label (label2);
3020 (define_expand "fix_truncsfsi2"
3021 [(set (match_operand:SI 0 "register_operand" "")
3022 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
3025 if (TARGET_IBM_FLOAT)
3027 /* Convert to DFmode and then use the POP algorithm. */
3028 rtx temp = gen_reg_rtx (DFmode);
3029 emit_insn (gen_extendsfdf2 (temp, operands[1]));
3030 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
3034 operands[1] = force_reg (SFmode, operands[1]);
3035 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
3041 (define_insn "fix_truncsfsi2_ieee"
3042 [(set (match_operand:SI 0 "register_operand" "=d")
3043 (fix:SI (match_operand:SF 1 "register_operand" "f")))
3044 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
3045 (clobber (reg:CC 33))]
3046 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3048 [(set_attr "op_type" "RRE")
3049 (set_attr "type" "ftoi")])
3052 ; floatdidf2 instruction pattern(s).
3055 (define_insn "floatdidf2"
3056 [(set (match_operand:DF 0 "register_operand" "=f")
3057 (float:DF (match_operand:DI 1 "register_operand" "d")))
3058 (clobber (reg:CC 33))]
3059 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3061 [(set_attr "op_type" "RRE")
3062 (set_attr "type" "itof" )])
3065 ; floatdisf2 instruction pattern(s).
3068 (define_insn "floatdisf2"
3069 [(set (match_operand:SF 0 "register_operand" "=f")
3070 (float:SF (match_operand:DI 1 "register_operand" "d")))
3071 (clobber (reg:CC 33))]
3072 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3074 [(set_attr "op_type" "RRE")
3075 (set_attr "type" "itof" )])
3078 ; floatsidf2 instruction pattern(s).
3081 (define_expand "floatsidf2"
3083 [(set (match_operand:DF 0 "register_operand" "")
3084 (float:DF (match_operand:SI 1 "register_operand" "")))
3085 (clobber (reg:CC 33))])]
3088 if (TARGET_IBM_FLOAT)
3090 /* This is the algorithm from POP chapter A.5.7.1. */
3092 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3093 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3095 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3100 (define_insn "floatsidf2_ieee"
3101 [(set (match_operand:DF 0 "register_operand" "=f")
3102 (float:DF (match_operand:SI 1 "register_operand" "d")))
3103 (clobber (reg:CC 33))]
3104 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3106 [(set_attr "op_type" "RRE")
3107 (set_attr "type" "itof" )])
3109 (define_insn "floatsidf2_ibm"
3110 [(set (match_operand:DF 0 "register_operand" "=f")
3111 (float:DF (match_operand:SI 1 "register_operand" "d")))
3112 (use (match_operand:DI 2 "immediate_operand" "m"))
3113 (use (match_operand:BLK 3 "memory_operand" "m"))
3114 (clobber (reg:CC 33))]
3115 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3117 output_asm_insn ("st\t%1,%N3", operands);
3118 output_asm_insn ("xi\t%N3,128", operands);
3119 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3120 output_asm_insn ("ld\t%0,%3", operands);
3123 [(set_attr "op_type" "NN")
3124 (set_attr "type" "other" )
3125 (set_attr "atype" "agen")
3126 (set_attr "length" "20")])
3129 ; floatsisf2 instruction pattern(s).
3132 (define_expand "floatsisf2"
3134 [(set (match_operand:SF 0 "register_operand" "")
3135 (float:SF (match_operand:SI 1 "register_operand" "")))
3136 (clobber (reg:CC 33))])]
3139 if (TARGET_IBM_FLOAT)
3141 /* Use the POP algorithm to convert to DFmode and then truncate. */
3142 rtx temp = gen_reg_rtx (DFmode);
3143 emit_insn (gen_floatsidf2 (temp, operands[1]));
3144 emit_insn (gen_truncdfsf2 (operands[0], temp));
3149 (define_insn "floatsisf2_ieee"
3150 [(set (match_operand:SF 0 "register_operand" "=f")
3151 (float:SF (match_operand:SI 1 "register_operand" "d")))
3152 (clobber (reg:CC 33))]
3153 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3155 [(set_attr "op_type" "RRE")
3156 (set_attr "type" "itof" )])
3159 ; truncdfsf2 instruction pattern(s).
3162 (define_expand "truncdfsf2"
3163 [(set (match_operand:SF 0 "register_operand" "")
3164 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3168 (define_insn "truncdfsf2_ieee"
3169 [(set (match_operand:SF 0 "register_operand" "=f")
3170 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3171 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3173 [(set_attr "op_type" "RRE")])
3175 (define_insn "truncdfsf2_ibm"
3176 [(set (match_operand:SF 0 "register_operand" "=f,f")
3177 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3178 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3182 [(set_attr "op_type" "RR,RX")
3183 (set_attr "type" "floads,floads")])
3186 ; extendsfdf2 instruction pattern(s).
3189 (define_expand "extendsfdf2"
3190 [(set (match_operand:DF 0 "register_operand" "")
3191 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3194 if (TARGET_IBM_FLOAT)
3196 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3201 (define_insn "extendsfdf2_ieee"
3202 [(set (match_operand:DF 0 "register_operand" "=f,f")
3203 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3204 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3208 [(set_attr "op_type" "RRE,RXE")
3209 (set_attr "type" "floads,floads")])
3211 (define_insn "extendsfdf2_ibm"
3212 [(set (match_operand:DF 0 "register_operand" "=f,f")
3213 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3214 (clobber (reg:CC 33))]
3215 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3217 sdr\t%0,%0\;ler\t%0,%1
3218 sdr\t%0,%0\;le\t%0,%1"
3219 [(set_attr "op_type" "NN,NN")
3220 (set_attr "atype" "reg,agen")
3221 (set_attr "length" "4,6")
3222 (set_attr "type" "o2,o2")])
3226 ;; ARITHMETIC OPERATIONS
3228 ; arithmetic operations set the ConditionCode,
3229 ; because of unpredictable Bits in Register for Halfword and Byte
3230 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3233 ;;- Add instructions.
3237 ; addti3 instruction pattern(s).
3240 (define_insn_and_split "addti3"
3241 [(set (match_operand:TI 0 "register_operand" "=&d")
3242 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3243 (match_operand:TI 2 "general_operand" "do") ) )
3244 (clobber (reg:CC 33))]
3247 "&& reload_completed"
3250 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3252 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3254 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3255 (ltu:DI (reg:CCL1 33) (const_int 0))))
3256 (clobber (reg:CC 33))])]
3257 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3258 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3259 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3260 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3261 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3262 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3263 [(set_attr "op_type" "NN")])
3266 ; adddi3 instruction pattern(s).
3269 (define_insn "*adddi3_sign"
3270 [(set (match_operand:DI 0 "register_operand" "=d,d")
3271 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3272 (match_operand:DI 1 "register_operand" "0,0")))
3273 (clobber (reg:CC 33))]
3278 [(set_attr "op_type" "RRE,RXY")])
3280 (define_insn "*adddi3_zero_cc"
3282 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3283 (match_operand:DI 1 "register_operand" "0,0"))
3285 (set (match_operand:DI 0 "register_operand" "=d,d")
3286 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3287 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3291 [(set_attr "op_type" "RRE,RXY")])
3293 (define_insn "*adddi3_zero_cconly"
3295 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3296 (match_operand:DI 1 "register_operand" "0,0"))
3298 (clobber (match_scratch:DI 0 "=d,d"))]
3299 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3303 [(set_attr "op_type" "RRE,RXY")])
3305 (define_insn "*adddi3_zero"
3306 [(set (match_operand:DI 0 "register_operand" "=d,d")
3307 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3308 (match_operand:DI 1 "register_operand" "0,0")))
3309 (clobber (reg:CC 33))]
3314 [(set_attr "op_type" "RRE,RXY")])
3316 (define_insn "*adddi3_imm_cc"
3318 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3319 (match_operand:DI 2 "const_int_operand" "K"))
3321 (set (match_operand:DI 0 "register_operand" "=d")
3322 (plus:DI (match_dup 1) (match_dup 2)))]
3324 && s390_match_ccmode (insn, CCAmode)
3325 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3327 [(set_attr "op_type" "RI")])
3329 (define_insn "*adddi3_carry1_cc"
3331 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3332 (match_operand:DI 2 "general_operand" "d,m"))
3334 (set (match_operand:DI 0 "register_operand" "=d,d")
3335 (plus:DI (match_dup 1) (match_dup 2)))]
3336 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3340 [(set_attr "op_type" "RRE,RXY")])
3342 (define_insn "*adddi3_carry1_cconly"
3344 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3345 (match_operand:DI 2 "general_operand" "d,m"))
3347 (clobber (match_scratch:DI 0 "=d,d"))]
3348 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3352 [(set_attr "op_type" "RRE,RXY")])
3354 (define_insn "*adddi3_carry2_cc"
3356 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3357 (match_operand:DI 2 "general_operand" "d,m"))
3359 (set (match_operand:DI 0 "register_operand" "=d,d")
3360 (plus:DI (match_dup 1) (match_dup 2)))]
3361 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3365 [(set_attr "op_type" "RRE,RXY")])
3367 (define_insn "*adddi3_carry2_cconly"
3369 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3370 (match_operand:DI 2 "general_operand" "d,m"))
3372 (clobber (match_scratch:DI 0 "=d,d"))]
3373 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3377 [(set_attr "op_type" "RRE,RXY")])
3379 (define_insn "*adddi3_cc"
3381 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3382 (match_operand:DI 2 "general_operand" "d,m"))
3384 (set (match_operand:DI 0 "register_operand" "=d,d")
3385 (plus:DI (match_dup 1) (match_dup 2)))]
3386 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3390 [(set_attr "op_type" "RRE,RXY")])
3392 (define_insn "*adddi3_cconly"
3394 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3395 (match_operand:DI 2 "general_operand" "d,m"))
3397 (clobber (match_scratch:DI 0 "=d,d"))]
3398 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3402 [(set_attr "op_type" "RRE,RXY")])
3404 (define_insn "*adddi3_cconly2"
3406 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3407 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3408 (clobber (match_scratch:DI 0 "=d,d"))]
3409 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3413 [(set_attr "op_type" "RRE,RXY")])
3415 (define_insn "*adddi3_64"
3416 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3417 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3418 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3419 (clobber (reg:CC 33))]
3425 [(set_attr "op_type" "RRE,RI,RXY")])
3427 (define_insn_and_split "*adddi3_31z"
3428 [(set (match_operand:DI 0 "register_operand" "=&d")
3429 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3430 (match_operand:DI 2 "general_operand" "do") ) )
3431 (clobber (reg:CC 33))]
3432 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3434 "&& reload_completed"
3437 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3439 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3441 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3442 (ltu:SI (reg:CCL1 33) (const_int 0))))
3443 (clobber (reg:CC 33))])]
3444 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3445 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3446 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3447 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3448 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3449 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3450 [(set_attr "op_type" "NN")])
3452 (define_insn_and_split "*adddi3_31"
3453 [(set (match_operand:DI 0 "register_operand" "=&d")
3454 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3455 (match_operand:DI 2 "general_operand" "do") ) )
3456 (clobber (reg:CC 33))]
3459 "&& reload_completed"
3461 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3462 (clobber (reg:CC 33))])
3465 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3467 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3469 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3471 (label_ref (match_dup 9))))
3473 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3474 (clobber (reg:CC 33))])
3476 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3477 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3478 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3479 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3480 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3481 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3482 operands[9] = gen_label_rtx ();"
3483 [(set_attr "op_type" "NN")])
3485 (define_expand "adddi3"
3487 [(set (match_operand:DI 0 "register_operand" "")
3488 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3489 (match_operand:DI 2 "general_operand" "")))
3490 (clobber (reg:CC 33))])]
3495 ; addsi3 instruction pattern(s).
3498 (define_insn "*addsi3_imm_cc"
3500 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3501 (match_operand:SI 2 "const_int_operand" "K"))
3503 (set (match_operand:SI 0 "register_operand" "=d")
3504 (plus:SI (match_dup 1) (match_dup 2)))]
3505 "s390_match_ccmode (insn, CCAmode)
3506 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3508 [(set_attr "op_type" "RI")])
3510 (define_insn "*addsi3_carry1_cc"
3512 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3513 (match_operand:SI 2 "general_operand" "d,R,T"))
3515 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3516 (plus:SI (match_dup 1) (match_dup 2)))]
3517 "s390_match_ccmode (insn, CCL1mode)"
3522 [(set_attr "op_type" "RR,RX,RXY")])
3524 (define_insn "*addsi3_carry1_cconly"
3526 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3527 (match_operand:SI 2 "general_operand" "d,R,T"))
3529 (clobber (match_scratch:SI 0 "=d,d,d"))]
3530 "s390_match_ccmode (insn, CCL1mode)"
3535 [(set_attr "op_type" "RR,RX,RXY")])
3537 (define_insn "*addsi3_carry2_cc"
3539 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3540 (match_operand:SI 2 "general_operand" "d,R,T"))
3542 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3543 (plus:SI (match_dup 1) (match_dup 2)))]
3544 "s390_match_ccmode (insn, CCL1mode)"
3549 [(set_attr "op_type" "RR,RX,RXY")])
3551 (define_insn "*addsi3_carry2_cconly"
3553 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3554 (match_operand:SI 2 "general_operand" "d,R,T"))
3556 (clobber (match_scratch:SI 0 "=d,d,d"))]
3557 "s390_match_ccmode (insn, CCL1mode)"
3562 [(set_attr "op_type" "RR,RX,RXY")])
3564 (define_insn "*addsi3_cc"
3566 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3567 (match_operand:SI 2 "general_operand" "d,R,T"))
3569 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3570 (plus:SI (match_dup 1) (match_dup 2)))]
3571 "s390_match_ccmode (insn, CCLmode)"
3576 [(set_attr "op_type" "RR,RX,RXY")])
3578 (define_insn "*addsi3_cconly"
3580 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3581 (match_operand:SI 2 "general_operand" "d,R,T"))
3583 (clobber (match_scratch:SI 0 "=d,d,d"))]
3584 "s390_match_ccmode (insn, CCLmode)"
3589 [(set_attr "op_type" "RR,RX,RXY")])
3591 (define_insn "*addsi3_cconly2"
3593 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3594 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3595 (clobber (match_scratch:SI 0 "=d,d,d"))]
3596 "s390_match_ccmode (insn, CCLmode)"
3601 [(set_attr "op_type" "RR,RX,RXY")])
3603 (define_insn "*addsi3_sign"
3604 [(set (match_operand:SI 0 "register_operand" "=d,d")
3605 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3606 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3607 (clobber (reg:CC 33))]
3612 [(set_attr "op_type" "RX,RXY")])
3614 (define_insn "addsi3"
3615 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3616 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3617 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3618 (clobber (reg:CC 33))]
3625 [(set_attr "op_type" "RR,RI,RX,RXY")])
3628 ; adddf3 instruction pattern(s).
3631 (define_expand "adddf3"
3633 [(set (match_operand:DF 0 "register_operand" "=f,f")
3634 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3635 (match_operand:DF 2 "general_operand" "f,R")))
3636 (clobber (reg:CC 33))])]
3640 (define_insn "*adddf3"
3641 [(set (match_operand:DF 0 "register_operand" "=f,f")
3642 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3643 (match_operand:DF 2 "general_operand" "f,R")))
3644 (clobber (reg:CC 33))]
3645 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3649 [(set_attr "op_type" "RRE,RXE")
3650 (set_attr "type" "fsimpd,fsimpd")])
3652 (define_insn "*adddf3_cc"
3654 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3655 (match_operand:DF 2 "general_operand" "f,R"))
3656 (match_operand:DF 3 "const0_operand" "")))
3657 (set (match_operand:DF 0 "register_operand" "=f,f")
3658 (plus:DF (match_dup 1) (match_dup 2)))]
3659 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3663 [(set_attr "op_type" "RRE,RXE")
3664 (set_attr "type" "fsimpd,fsimpd")])
3666 (define_insn "*adddf3_cconly"
3668 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3669 (match_operand:DF 2 "general_operand" "f,R"))
3670 (match_operand:DF 3 "const0_operand" "")))
3671 (clobber (match_scratch:DF 0 "=f,f"))]
3672 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3676 [(set_attr "op_type" "RRE,RXE")
3677 (set_attr "type" "fsimpd,fsimpd")])
3679 (define_insn "*adddf3_ibm"
3680 [(set (match_operand:DF 0 "register_operand" "=f,f")
3681 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3682 (match_operand:DF 2 "general_operand" "f,R")))
3683 (clobber (reg:CC 33))]
3684 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3688 [(set_attr "op_type" "RR,RX")
3689 (set_attr "type" "fsimpd,fsimpd")])
3692 ; addsf3 instruction pattern(s).
3695 (define_expand "addsf3"
3697 [(set (match_operand:SF 0 "register_operand" "=f,f")
3698 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3699 (match_operand:SF 2 "general_operand" "f,R")))
3700 (clobber (reg:CC 33))])]
3704 (define_insn "*addsf3"
3705 [(set (match_operand:SF 0 "register_operand" "=f,f")
3706 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3707 (match_operand:SF 2 "general_operand" "f,R")))
3708 (clobber (reg:CC 33))]
3709 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3713 [(set_attr "op_type" "RRE,RXE")
3714 (set_attr "type" "fsimps,fsimps")])
3716 (define_insn "*addsf3_cc"
3718 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3719 (match_operand:SF 2 "general_operand" "f,R"))
3720 (match_operand:SF 3 "const0_operand" "")))
3721 (set (match_operand:SF 0 "register_operand" "=f,f")
3722 (plus:SF (match_dup 1) (match_dup 2)))]
3723 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3727 [(set_attr "op_type" "RRE,RXE")
3728 (set_attr "type" "fsimps,fsimps")])
3730 (define_insn "*addsf3_cconly"
3732 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3733 (match_operand:SF 2 "general_operand" "f,R"))
3734 (match_operand:SF 3 "const0_operand" "")))
3735 (clobber (match_scratch:SF 0 "=f,f"))]
3736 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3740 [(set_attr "op_type" "RRE,RXE")
3741 (set_attr "type" "fsimps,fsimps")])
3743 (define_insn "*addsf3"
3744 [(set (match_operand:SF 0 "register_operand" "=f,f")
3745 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3746 (match_operand:SF 2 "general_operand" "f,R")))
3747 (clobber (reg:CC 33))]
3748 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3752 [(set_attr "op_type" "RR,RX")
3753 (set_attr "type" "fsimps,fsimps")])
3757 ;;- Subtract instructions.
3761 ; subti3 instruction pattern(s).
3764 (define_insn_and_split "subti3"
3765 [(set (match_operand:TI 0 "register_operand" "=&d")
3766 (minus:TI (match_operand:TI 1 "register_operand" "0")
3767 (match_operand:TI 2 "general_operand" "do") ) )
3768 (clobber (reg:CC 33))]
3771 "&& reload_completed"
3774 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3776 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3778 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3779 (gtu:DI (reg:CCL2 33) (const_int 0))))
3780 (clobber (reg:CC 33))])]
3781 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3782 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3783 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3784 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3785 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3786 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3787 [(set_attr "op_type" "NN")])
3790 ; subdi3 instruction pattern(s).
3793 (define_insn "*subdi3_sign"
3794 [(set (match_operand:DI 0 "register_operand" "=d,d")
3795 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3796 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3797 (clobber (reg:CC 33))]
3802 [(set_attr "op_type" "RRE,RXY")])
3804 (define_insn "*subdi3_zero_cc"
3806 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3807 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3809 (set (match_operand:DI 0 "register_operand" "=d,d")
3810 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3811 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3815 [(set_attr "op_type" "RRE,RXY")])
3817 (define_insn "*subdi3_zero_cconly"
3819 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3820 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3822 (clobber (match_scratch:DI 0 "=d,d"))]
3823 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3827 [(set_attr "op_type" "RRE,RXY")])
3829 (define_insn "*subdi3_zero"
3830 [(set (match_operand:DI 0 "register_operand" "=d,d")
3831 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3832 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3833 (clobber (reg:CC 33))]
3838 [(set_attr "op_type" "RRE,RXY")])
3840 (define_insn "*subdi3_borrow_cc"
3842 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3843 (match_operand:DI 2 "general_operand" "d,m"))
3845 (set (match_operand:DI 0 "register_operand" "=d,d")
3846 (minus:DI (match_dup 1) (match_dup 2)))]
3847 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3851 [(set_attr "op_type" "RRE,RXY")])
3853 (define_insn "*subdi3_borrow_cconly"
3855 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3856 (match_operand:DI 2 "general_operand" "d,m"))
3858 (clobber (match_scratch:DI 0 "=d,d"))]
3859 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3863 [(set_attr "op_type" "RRE,RXY")])
3865 (define_insn "*subdi3_cc"
3867 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3868 (match_operand:DI 2 "general_operand" "d,m"))
3870 (set (match_operand:DI 0 "register_operand" "=d,d")
3871 (minus:DI (match_dup 1) (match_dup 2)))]
3872 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3876 [(set_attr "op_type" "RRE,RXY")])
3878 (define_insn "*subdi3_cc2"
3880 (compare (match_operand:DI 1 "register_operand" "0,0")
3881 (match_operand:DI 2 "general_operand" "d,m")))
3882 (set (match_operand:DI 0 "register_operand" "=d,d")
3883 (minus:DI (match_dup 1) (match_dup 2)))]
3884 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3888 [(set_attr "op_type" "RRE,RXY")])
3890 (define_insn "*subdi3_cconly"
3892 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3893 (match_operand:DI 2 "general_operand" "d,m"))
3895 (clobber (match_scratch:DI 0 "=d,d"))]
3896 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3900 [(set_attr "op_type" "RRE,RXY")])
3902 (define_insn "*subdi3_cconly2"
3904 (compare (match_operand:DI 1 "register_operand" "0,0")
3905 (match_operand:DI 2 "general_operand" "d,m")))
3906 (clobber (match_scratch:DI 0 "=d,d"))]
3907 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3911 [(set_attr "op_type" "RRE,RXY")])
3913 (define_insn "*subdi3_64"
3914 [(set (match_operand:DI 0 "register_operand" "=d,d")
3915 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3916 (match_operand:DI 2 "general_operand" "d,m") ) )
3917 (clobber (reg:CC 33))]
3922 [(set_attr "op_type" "RRE,RRE")])
3924 (define_insn_and_split "*subdi3_31z"
3925 [(set (match_operand:DI 0 "register_operand" "=&d")
3926 (minus:DI (match_operand:DI 1 "register_operand" "0")
3927 (match_operand:DI 2 "general_operand" "do") ) )
3928 (clobber (reg:CC 33))]
3929 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3931 "&& reload_completed"
3934 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3936 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3938 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
3939 (gtu:SI (reg:CCL2 33) (const_int 0))))
3940 (clobber (reg:CC 33))])]
3941 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3942 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3943 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3944 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3945 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3946 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3947 [(set_attr "op_type" "NN")])
3949 (define_insn_and_split "*subdi3_31"
3950 [(set (match_operand:DI 0 "register_operand" "=&d")
3951 (minus:DI (match_operand:DI 1 "register_operand" "0")
3952 (match_operand:DI 2 "general_operand" "do") ) )
3953 (clobber (reg:CC 33))]
3956 "&& reload_completed"
3958 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3959 (clobber (reg:CC 33))])
3962 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3964 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3966 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3968 (label_ref (match_dup 9))))
3970 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3971 (clobber (reg:CC 33))])
3973 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3974 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3975 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3976 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3977 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3978 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3979 operands[9] = gen_label_rtx ();"
3980 [(set_attr "op_type" "NN")])
3982 (define_expand "subdi3"
3984 [(set (match_operand:DI 0 "register_operand" "")
3985 (minus:DI (match_operand:DI 1 "register_operand" "")
3986 (match_operand:DI 2 "general_operand" "")))
3987 (clobber (reg:CC 33))])]
3992 ; subsi3 instruction pattern(s).
3995 (define_insn "*subsi3_borrow_cc"
3997 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3998 (match_operand:SI 2 "general_operand" "d,R,T"))
4000 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4001 (minus:SI (match_dup 1) (match_dup 2)))]
4002 "s390_match_ccmode (insn, CCL2mode)"
4007 [(set_attr "op_type" "RR,RX,RXY")])
4009 (define_insn "*subsi3_borrow_cconly"
4011 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4012 (match_operand:SI 2 "general_operand" "d,R,T"))
4014 (clobber (match_scratch:SI 0 "=d,d,d"))]
4015 "s390_match_ccmode (insn, CCL2mode)"
4020 [(set_attr "op_type" "RR,RX,RXY")])
4022 (define_insn "*subsi3_cc"
4024 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4025 (match_operand:SI 2 "general_operand" "d,R,T"))
4027 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4028 (minus:SI (match_dup 1) (match_dup 2)))]
4029 "s390_match_ccmode (insn, CCLmode)"
4034 [(set_attr "op_type" "RR,RX,RXY")])
4036 (define_insn "*subsi3_cc2"
4038 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4039 (match_operand:SI 2 "general_operand" "d,R,T")))
4040 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4041 (minus:SI (match_dup 1) (match_dup 2)))]
4042 "s390_match_ccmode (insn, CCL3mode)"
4047 [(set_attr "op_type" "RR,RX,RXY")])
4049 (define_insn "*subsi3_cconly"
4051 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4052 (match_operand:SI 2 "general_operand" "d,R,T"))
4054 (clobber (match_scratch:SI 0 "=d,d,d"))]
4055 "s390_match_ccmode (insn, CCLmode)"
4060 [(set_attr "op_type" "RR,RX,RXY")])
4062 (define_insn "*subsi3_cconly2"
4064 (compare (match_operand:SI 1 "register_operand" "0,0,0")
4065 (match_operand:SI 2 "general_operand" "d,R,T")))
4066 (clobber (match_scratch:SI 0 "=d,d,d"))]
4067 "s390_match_ccmode (insn, CCL3mode)"
4072 [(set_attr "op_type" "RR,RX,RXY")])
4074 (define_insn "*subsi3_sign"
4075 [(set (match_operand:SI 0 "register_operand" "=d,d")
4076 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4077 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4078 (clobber (reg:CC 33))]
4083 [(set_attr "op_type" "RX,RXY")])
4085 (define_insn "subsi3"
4086 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4087 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4088 (match_operand:SI 2 "general_operand" "d,R,T")))
4089 (clobber (reg:CC 33))]
4095 [(set_attr "op_type" "RR,RX,RXY")])
4099 ; subdf3 instruction pattern(s).
4102 (define_expand "subdf3"
4104 [(set (match_operand:DF 0 "register_operand" "=f,f")
4105 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4106 (match_operand:DF 2 "general_operand" "f,R")))
4107 (clobber (reg:CC 33))])]
4111 (define_insn "*subdf3"
4112 [(set (match_operand:DF 0 "register_operand" "=f,f")
4113 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4114 (match_operand:DF 2 "general_operand" "f,R")))
4115 (clobber (reg:CC 33))]
4116 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4120 [(set_attr "op_type" "RRE,RXE")
4121 (set_attr "type" "fsimpd,fsimpd")])
4123 (define_insn "*subdf3_cc"
4125 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4126 (match_operand:DF 2 "general_operand" "f,R"))
4127 (match_operand:DF 3 "const0_operand" "")))
4128 (set (match_operand:DF 0 "register_operand" "=f,f")
4129 (plus:DF (match_dup 1) (match_dup 2)))]
4130 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4134 [(set_attr "op_type" "RRE,RXE")
4135 (set_attr "type" "fsimpd,fsimpd")])
4137 (define_insn "*subdf3_cconly"
4139 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4140 (match_operand:DF 2 "general_operand" "f,R"))
4141 (match_operand:DF 3 "const0_operand" "")))
4142 (clobber (match_scratch:DF 0 "=f,f"))]
4143 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4147 [(set_attr "op_type" "RRE,RXE")
4148 (set_attr "type" "fsimpd,fsimpd")])
4150 (define_insn "*subdf3_ibm"
4151 [(set (match_operand:DF 0 "register_operand" "=f,f")
4152 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4153 (match_operand:DF 2 "general_operand" "f,R")))
4154 (clobber (reg:CC 33))]
4155 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4159 [(set_attr "op_type" "RR,RX")
4160 (set_attr "type" "fsimpd,fsimpd")])
4163 ; subsf3 instruction pattern(s).
4166 (define_expand "subsf3"
4168 [(set (match_operand:SF 0 "register_operand" "=f,f")
4169 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4170 (match_operand:SF 2 "general_operand" "f,R")))
4171 (clobber (reg:CC 33))])]
4175 (define_insn "*subsf3"
4176 [(set (match_operand:SF 0 "register_operand" "=f,f")
4177 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4178 (match_operand:SF 2 "general_operand" "f,R")))
4179 (clobber (reg:CC 33))]
4180 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4184 [(set_attr "op_type" "RRE,RXE")
4185 (set_attr "type" "fsimps,fsimps")])
4187 (define_insn "*subsf3_cc"
4189 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4190 (match_operand:SF 2 "general_operand" "f,R"))
4191 (match_operand:SF 3 "const0_operand" "")))
4192 (set (match_operand:SF 0 "register_operand" "=f,f")
4193 (minus:SF (match_dup 1) (match_dup 2)))]
4194 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4198 [(set_attr "op_type" "RRE,RXE")
4199 (set_attr "type" "fsimps,fsimps")])
4201 (define_insn "*subsf3_cconly"
4203 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4204 (match_operand:SF 2 "general_operand" "f,R"))
4205 (match_operand:SF 3 "const0_operand" "")))
4206 (clobber (match_scratch:SF 0 "=f,f"))]
4207 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4211 [(set_attr "op_type" "RRE,RXE")
4212 (set_attr "type" "fsimps,fsimps")])
4214 (define_insn "*subsf3_ibm"
4215 [(set (match_operand:SF 0 "register_operand" "=f,f")
4216 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4217 (match_operand:SF 2 "general_operand" "f,R")))
4218 (clobber (reg:CC 33))]
4219 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4223 [(set_attr "op_type" "RR,RX")
4224 (set_attr "type" "fsimps,fsimps")])
4228 ;;- Conditional add/subtract instructions.
4232 ; adddicc instruction pattern(s).
4235 (define_insn "*adddi3_alc_cc"
4238 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4239 (match_operand:DI 2 "general_operand" "d,m"))
4240 (match_operand:DI 3 "s390_alc_comparison" ""))
4242 (set (match_operand:DI 0 "register_operand" "=d,d")
4243 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4244 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4248 [(set_attr "op_type" "RRE,RXY")])
4250 (define_insn "*adddi3_alc"
4251 [(set (match_operand:DI 0 "register_operand" "=d,d")
4252 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4253 (match_operand:DI 2 "general_operand" "d,m"))
4254 (match_operand:DI 3 "s390_alc_comparison" "")))
4255 (clobber (reg:CC 33))]
4260 [(set_attr "op_type" "RRE,RXY")])
4262 (define_insn "*subdi3_slb_cc"
4265 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4266 (match_operand:DI 2 "general_operand" "d,m"))
4267 (match_operand:DI 3 "s390_slb_comparison" ""))
4269 (set (match_operand:DI 0 "register_operand" "=d,d")
4270 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4271 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4275 [(set_attr "op_type" "RRE,RXY")])
4277 (define_insn "*subdi3_slb"
4278 [(set (match_operand:DI 0 "register_operand" "=d,d")
4279 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4280 (match_operand:DI 2 "general_operand" "d,m"))
4281 (match_operand:DI 3 "s390_slb_comparison" "")))
4282 (clobber (reg:CC 33))]
4287 [(set_attr "op_type" "RRE,RXY")])
4289 (define_expand "adddicc"
4290 [(match_operand:DI 0 "register_operand" "")
4291 (match_operand 1 "comparison_operator" "")
4292 (match_operand:DI 2 "register_operand" "")
4293 (match_operand:DI 3 "const_int_operand" "")]
4295 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4296 s390_compare_op0, s390_compare_op1,
4297 operands[0], operands[2],
4298 operands[3])) FAIL; DONE;")
4301 ; addsicc instruction pattern(s).
4304 (define_insn "*addsi3_alc_cc"
4307 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4308 (match_operand:SI 2 "general_operand" "d,m"))
4309 (match_operand:SI 3 "s390_alc_comparison" ""))
4311 (set (match_operand:SI 0 "register_operand" "=d,d")
4312 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4313 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4317 [(set_attr "op_type" "RRE,RXY")])
4319 (define_insn "*addsi3_alc"
4320 [(set (match_operand:SI 0 "register_operand" "=d,d")
4321 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4322 (match_operand:SI 2 "general_operand" "d,m"))
4323 (match_operand:SI 3 "s390_alc_comparison" "")))
4324 (clobber (reg:CC 33))]
4329 [(set_attr "op_type" "RRE,RXY")])
4331 (define_insn "*subsi3_slb_cc"
4334 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4335 (match_operand:SI 2 "general_operand" "d,m"))
4336 (match_operand:SI 3 "s390_slb_comparison" ""))
4338 (set (match_operand:SI 0 "register_operand" "=d,d")
4339 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4340 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4344 [(set_attr "op_type" "RRE,RXY")])
4346 (define_insn "*subsi3_slb"
4347 [(set (match_operand:SI 0 "register_operand" "=d,d")
4348 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4349 (match_operand:SI 2 "general_operand" "d,m"))
4350 (match_operand:SI 3 "s390_slb_comparison" "")))
4351 (clobber (reg:CC 33))]
4356 [(set_attr "op_type" "RRE,RXY")])
4358 (define_expand "addsicc"
4359 [(match_operand:SI 0 "register_operand" "")
4360 (match_operand 1 "comparison_operator" "")
4361 (match_operand:SI 2 "register_operand" "")
4362 (match_operand:SI 3 "const_int_operand" "")]
4364 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4365 s390_compare_op0, s390_compare_op1,
4366 operands[0], operands[2],
4367 operands[3])) FAIL; DONE;")
4370 ; scond instruction pattern(s).
4373 (define_insn_and_split "*sconddi"
4374 [(set (match_operand:DI 0 "register_operand" "=&d")
4375 (match_operand:DI 1 "s390_alc_comparison" ""))
4376 (clobber (reg:CC 33))]
4379 "&& reload_completed"
4380 [(set (match_dup 0) (const_int 0))
4382 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4384 (clobber (reg:CC 33))])]
4386 [(set_attr "op_type" "NN")])
4388 (define_insn_and_split "*scondsi"
4389 [(set (match_operand:SI 0 "register_operand" "=&d")
4390 (match_operand:SI 1 "s390_alc_comparison" ""))
4391 (clobber (reg:CC 33))]
4394 "&& reload_completed"
4395 [(set (match_dup 0) (const_int 0))
4397 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4399 (clobber (reg:CC 33))])]
4401 [(set_attr "op_type" "NN")])
4403 (define_insn_and_split "*sconddi_neg"
4404 [(set (match_operand:DI 0 "register_operand" "=&d")
4405 (match_operand:DI 1 "s390_slb_comparison" ""))
4406 (clobber (reg:CC 33))]
4409 "&& reload_completed"
4410 [(set (match_dup 0) (const_int 0))
4412 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4414 (clobber (reg:CC 33))])
4416 [(set (match_dup 0) (neg:DI (match_dup 0)))
4417 (clobber (reg:CC 33))])]
4419 [(set_attr "op_type" "NN")])
4421 (define_insn_and_split "*scondsi_neg"
4422 [(set (match_operand:SI 0 "register_operand" "=&d")
4423 (match_operand:SI 1 "s390_slb_comparison" ""))
4424 (clobber (reg:CC 33))]
4427 "&& reload_completed"
4428 [(set (match_dup 0) (const_int 0))
4430 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4432 (clobber (reg:CC 33))])
4434 [(set (match_dup 0) (neg:SI (match_dup 0)))
4435 (clobber (reg:CC 33))])]
4437 [(set_attr "op_type" "NN")])
4439 (define_expand "sltu"
4440 [(match_operand:SI 0 "register_operand" "")]
4442 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4443 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4445 (define_expand "sgtu"
4446 [(match_operand:SI 0 "register_operand" "")]
4448 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4449 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4451 (define_expand "sleu"
4452 [(match_operand:SI 0 "register_operand" "")]
4454 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4455 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4457 (define_expand "sgeu"
4458 [(match_operand:SI 0 "register_operand" "")]
4460 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4461 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4465 ;;- Multiply instructions.
4469 ; muldi3 instruction pattern(s).
4472 (define_insn "*muldi3_sign"
4473 [(set (match_operand:DI 0 "register_operand" "=d,d")
4474 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4475 (match_operand:DI 1 "register_operand" "0,0")))]
4480 [(set_attr "op_type" "RRE,RXY")
4481 (set_attr "type" "imul")])
4483 (define_insn "muldi3"
4484 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4485 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4486 (match_operand:DI 2 "general_operand" "d,K,m")))]
4492 [(set_attr "op_type" "RRE,RI,RXY")
4493 (set_attr "type" "imul")])
4496 ; mulsi3 instruction pattern(s).
4499 (define_insn "*mulsi3_sign"
4500 [(set (match_operand:SI 0 "register_operand" "=d")
4501 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4502 (match_operand:SI 1 "register_operand" "0")))]
4505 [(set_attr "op_type" "RX")
4506 (set_attr "type" "imul")])
4508 (define_insn "mulsi3"
4509 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4510 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4511 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4518 [(set_attr "op_type" "RRE,RI,RX,RXY")
4519 (set_attr "type" "imul")])
4522 ; mulsidi3 instruction pattern(s).
4525 (define_insn "mulsidi3"
4526 [(set (match_operand:DI 0 "register_operand" "=d,d")
4527 (mult:DI (sign_extend:DI
4528 (match_operand:SI 1 "register_operand" "%0,0"))
4530 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4535 [(set_attr "op_type" "RR,RX")
4536 (set_attr "type" "imul")])
4539 ; umulsidi3 instruction pattern(s).
4542 (define_insn "umulsidi3"
4543 [(set (match_operand:DI 0 "register_operand" "=d,d")
4544 (mult:DI (zero_extend:DI
4545 (match_operand:SI 1 "register_operand" "%0,0"))
4547 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4548 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4552 [(set_attr "op_type" "RRE,RXY")
4553 (set_attr "type" "imul")])
4556 ; muldf3 instruction pattern(s).
4559 (define_expand "muldf3"
4560 [(set (match_operand:DF 0 "register_operand" "=f,f")
4561 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4562 (match_operand:DF 2 "general_operand" "f,R")))]
4566 (define_insn "*muldf3"
4567 [(set (match_operand:DF 0 "register_operand" "=f,f")
4568 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4569 (match_operand:DF 2 "general_operand" "f,R")))]
4570 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4574 [(set_attr "op_type" "RRE,RXE")
4575 (set_attr "type" "fmuld")])
4577 (define_insn "*muldf3_ibm"
4578 [(set (match_operand:DF 0 "register_operand" "=f,f")
4579 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4580 (match_operand:DF 2 "general_operand" "f,R")))]
4581 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4585 [(set_attr "op_type" "RR,RX")
4586 (set_attr "type" "fmuld")])
4588 (define_insn "*fmadddf"
4589 [(set (match_operand:DF 0 "register_operand" "=f,f")
4590 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4591 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4592 (match_operand:DF 3 "register_operand" "0,0")))]
4593 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4597 [(set_attr "op_type" "RRE,RXE")
4598 (set_attr "type" "fmuld")])
4600 (define_insn "*fmsubdf"
4601 [(set (match_operand:DF 0 "register_operand" "=f,f")
4602 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4603 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4604 (match_operand:DF 3 "register_operand" "0,0")))]
4605 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4609 [(set_attr "op_type" "RRE,RXE")
4610 (set_attr "type" "fmuld")])
4613 ; mulsf3 instruction pattern(s).
4616 (define_expand "mulsf3"
4617 [(set (match_operand:SF 0 "register_operand" "=f,f")
4618 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4619 (match_operand:SF 2 "general_operand" "f,R")))]
4623 (define_insn "*mulsf3"
4624 [(set (match_operand:SF 0 "register_operand" "=f,f")
4625 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4626 (match_operand:SF 2 "general_operand" "f,R")))]
4627 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4631 [(set_attr "op_type" "RRE,RXE")
4632 (set_attr "type" "fmuls")])
4634 (define_insn "*mulsf3_ibm"
4635 [(set (match_operand:SF 0 "register_operand" "=f,f")
4636 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4637 (match_operand:SF 2 "general_operand" "f,R")))]
4638 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4642 [(set_attr "op_type" "RR,RX")
4643 (set_attr "type" "fmuls")])
4645 (define_insn "*fmaddsf"
4646 [(set (match_operand:SF 0 "register_operand" "=f,f")
4647 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4648 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4649 (match_operand:SF 3 "register_operand" "0,0")))]
4650 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4654 [(set_attr "op_type" "RRE,RXE")
4655 (set_attr "type" "fmuls")])
4657 (define_insn "*fmsubsf"
4658 [(set (match_operand:SF 0 "register_operand" "=f,f")
4659 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4660 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4661 (match_operand:SF 3 "register_operand" "0,0")))]
4662 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4666 [(set_attr "op_type" "RRE,RXE")
4667 (set_attr "type" "fmuls")])
4670 ;;- Divide and modulo instructions.
4674 ; divmoddi4 instruction pattern(s).
4677 (define_expand "divmoddi4"
4678 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4679 (div:DI (match_operand:DI 1 "register_operand" "")
4680 (match_operand:DI 2 "general_operand" "")))
4681 (set (match_operand:DI 3 "general_operand" "")
4682 (mod:DI (match_dup 1) (match_dup 2)))])
4683 (clobber (match_dup 4))]
4686 rtx insn, div_equal, mod_equal;
4688 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4689 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4691 operands[4] = gen_reg_rtx(TImode);
4692 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4694 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4696 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4698 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4700 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4705 (define_insn "divmodtidi3"
4706 [(set (match_operand:TI 0 "register_operand" "=d,d")
4710 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4711 (match_operand:DI 2 "general_operand" "d,m")))
4713 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4718 [(set_attr "op_type" "RRE,RXY")
4719 (set_attr "type" "idiv")])
4721 (define_insn "divmodtisi3"
4722 [(set (match_operand:TI 0 "register_operand" "=d,d")
4726 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4728 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4731 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4736 [(set_attr "op_type" "RRE,RXY")
4737 (set_attr "type" "idiv")])
4740 ; udivmoddi4 instruction pattern(s).
4743 (define_expand "udivmoddi4"
4744 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4745 (udiv:DI (match_operand:DI 1 "general_operand" "")
4746 (match_operand:DI 2 "nonimmediate_operand" "")))
4747 (set (match_operand:DI 3 "general_operand" "")
4748 (umod:DI (match_dup 1) (match_dup 2)))])
4749 (clobber (match_dup 4))]
4752 rtx insn, div_equal, mod_equal, equal;
4754 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4755 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4756 equal = gen_rtx_IOR (TImode,
4757 gen_rtx_ASHIFT (TImode,
4758 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4760 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4762 operands[4] = gen_reg_rtx(TImode);
4763 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4764 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4765 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4766 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4768 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4770 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4772 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4774 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4776 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4781 (define_insn "udivmodtidi3"
4782 [(set (match_operand:TI 0 "register_operand" "=d,d")
4787 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4789 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4793 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4798 [(set_attr "op_type" "RRE,RXY")
4799 (set_attr "type" "idiv")])
4802 ; divmodsi4 instruction pattern(s).
4805 (define_expand "divmodsi4"
4806 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4807 (div:SI (match_operand:SI 1 "general_operand" "")
4808 (match_operand:SI 2 "nonimmediate_operand" "")))
4809 (set (match_operand:SI 3 "general_operand" "")
4810 (mod:SI (match_dup 1) (match_dup 2)))])
4811 (clobber (match_dup 4))]
4814 rtx insn, div_equal, mod_equal, equal;
4816 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4817 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4818 equal = gen_rtx_IOR (DImode,
4819 gen_rtx_ASHIFT (DImode,
4820 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4822 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4824 operands[4] = gen_reg_rtx(DImode);
4825 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4826 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4828 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4830 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4832 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4834 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4836 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4841 (define_insn "divmoddisi3"
4842 [(set (match_operand:DI 0 "register_operand" "=d,d")
4847 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4849 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4853 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4858 [(set_attr "op_type" "RR,RX")
4859 (set_attr "type" "idiv")])
4862 ; udivsi3 and umodsi3 instruction pattern(s).
4865 (define_expand "udivmodsi4"
4866 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4867 (udiv:SI (match_operand:SI 1 "general_operand" "")
4868 (match_operand:SI 2 "nonimmediate_operand" "")))
4869 (set (match_operand:SI 3 "general_operand" "")
4870 (umod:SI (match_dup 1) (match_dup 2)))])
4871 (clobber (match_dup 4))]
4872 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4874 rtx insn, div_equal, mod_equal, equal;
4876 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4877 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4878 equal = gen_rtx_IOR (DImode,
4879 gen_rtx_ASHIFT (DImode,
4880 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4882 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4884 operands[4] = gen_reg_rtx(DImode);
4885 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4886 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4887 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4888 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4890 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4892 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4894 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4896 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4898 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4903 (define_insn "udivmoddisi3"
4904 [(set (match_operand:DI 0 "register_operand" "=d,d")
4909 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
4911 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4915 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
4916 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4920 [(set_attr "op_type" "RRE,RXY")
4921 (set_attr "type" "idiv")])
4923 (define_expand "udivsi3"
4924 [(set (match_operand:SI 0 "register_operand" "=d")
4925 (udiv:SI (match_operand:SI 1 "general_operand" "")
4926 (match_operand:SI 2 "general_operand" "")))
4927 (clobber (match_dup 3))]
4928 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4930 rtx insn, udiv_equal, umod_equal, equal;
4932 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4933 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4934 equal = gen_rtx_IOR (DImode,
4935 gen_rtx_ASHIFT (DImode,
4936 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4938 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4940 operands[3] = gen_reg_rtx (DImode);
4942 if (CONSTANT_P (operands[2]))
4944 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4946 rtx label1 = gen_label_rtx ();
4948 operands[1] = make_safe_from (operands[1], operands[0]);
4949 emit_move_insn (operands[0], const0_rtx);
4950 emit_insn (gen_cmpsi (operands[1], operands[2]));
4951 emit_jump_insn (gen_bltu (label1));
4952 emit_move_insn (operands[0], const1_rtx);
4953 emit_label (label1);
4957 operands[2] = force_reg (SImode, operands[2]);
4958 operands[2] = make_safe_from (operands[2], operands[0]);
4960 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4961 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4964 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4966 insn = emit_move_insn (operands[0],
4967 gen_lowpart (SImode, operands[3]));
4969 gen_rtx_EXPR_LIST (REG_EQUAL,
4970 udiv_equal, REG_NOTES (insn));
4975 rtx label1 = gen_label_rtx ();
4976 rtx label2 = gen_label_rtx ();
4977 rtx label3 = gen_label_rtx ();
4979 operands[1] = force_reg (SImode, operands[1]);
4980 operands[1] = make_safe_from (operands[1], operands[0]);
4981 operands[2] = force_reg (SImode, operands[2]);
4982 operands[2] = make_safe_from (operands[2], operands[0]);
4984 emit_move_insn (operands[0], const0_rtx);
4985 emit_insn (gen_cmpsi (operands[2], operands[1]));
4986 emit_jump_insn (gen_bgtu (label3));
4987 emit_insn (gen_cmpsi (operands[2], const0_rtx));
4988 emit_jump_insn (gen_blt (label2));
4989 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4990 emit_jump_insn (gen_beq (label1));
4991 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4992 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4995 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4997 insn = emit_move_insn (operands[0],
4998 gen_lowpart (SImode, operands[3]));
5000 gen_rtx_EXPR_LIST (REG_EQUAL,
5001 udiv_equal, REG_NOTES (insn));
5003 emit_label (label1);
5004 emit_move_insn (operands[0], operands[1]);
5006 emit_label (label2);
5007 emit_move_insn (operands[0], const1_rtx);
5008 emit_label (label3);
5010 emit_move_insn (operands[0], operands[0]);
5014 (define_expand "umodsi3"
5015 [(set (match_operand:SI 0 "register_operand" "=d")
5016 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
5017 (match_operand:SI 2 "nonimmediate_operand" "")))
5018 (clobber (match_dup 3))]
5019 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
5021 rtx insn, udiv_equal, umod_equal, equal;
5023 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
5024 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
5025 equal = gen_rtx_IOR (DImode,
5026 gen_rtx_ASHIFT (DImode,
5027 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
5029 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
5031 operands[3] = gen_reg_rtx (DImode);
5033 if (CONSTANT_P (operands[2]))
5035 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
5037 rtx label1 = gen_label_rtx ();
5039 operands[1] = make_safe_from (operands[1], operands[0]);
5040 emit_move_insn (operands[0], operands[1]);
5041 emit_insn (gen_cmpsi (operands[0], operands[2]));
5042 emit_jump_insn (gen_bltu (label1));
5043 emit_insn (gen_abssi2 (operands[0], operands[2]));
5044 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
5045 emit_label (label1);
5049 operands[2] = force_reg (SImode, operands[2]);
5050 operands[2] = make_safe_from (operands[2], operands[0]);
5052 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5053 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5056 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5058 insn = emit_move_insn (operands[0],
5059 gen_highpart (SImode, operands[3]));
5061 gen_rtx_EXPR_LIST (REG_EQUAL,
5062 umod_equal, REG_NOTES (insn));
5067 rtx label1 = gen_label_rtx ();
5068 rtx label2 = gen_label_rtx ();
5069 rtx label3 = gen_label_rtx ();
5071 operands[1] = force_reg (SImode, operands[1]);
5072 operands[1] = make_safe_from (operands[1], operands[0]);
5073 operands[2] = force_reg (SImode, operands[2]);
5074 operands[2] = make_safe_from (operands[2], operands[0]);
5076 emit_move_insn(operands[0], operands[1]);
5077 emit_insn (gen_cmpsi (operands[2], operands[1]));
5078 emit_jump_insn (gen_bgtu (label3));
5079 emit_insn (gen_cmpsi (operands[2], const0_rtx));
5080 emit_jump_insn (gen_blt (label2));
5081 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5082 emit_jump_insn (gen_beq (label1));
5083 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5084 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5087 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5089 insn = emit_move_insn (operands[0],
5090 gen_highpart (SImode, operands[3]));
5092 gen_rtx_EXPR_LIST (REG_EQUAL,
5093 umod_equal, REG_NOTES (insn));
5095 emit_label (label1);
5096 emit_move_insn (operands[0], const0_rtx);
5098 emit_label (label2);
5099 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5100 emit_label (label3);
5106 ; divdf3 instruction pattern(s).
5109 (define_expand "divdf3"
5110 [(set (match_operand:DF 0 "register_operand" "=f,f")
5111 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5112 (match_operand:DF 2 "general_operand" "f,R")))]
5116 (define_insn "*divdf3"
5117 [(set (match_operand:DF 0 "register_operand" "=f,f")
5118 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5119 (match_operand:DF 2 "general_operand" "f,R")))]
5120 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5124 [(set_attr "op_type" "RRE,RXE")
5125 (set_attr "type" "fdivd")])
5127 (define_insn "*divdf3_ibm"
5128 [(set (match_operand:DF 0 "register_operand" "=f,f")
5129 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5130 (match_operand:DF 2 "general_operand" "f,R")))]
5131 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5135 [(set_attr "op_type" "RR,RX")
5136 (set_attr "type" "fdivd")])
5139 ; divsf3 instruction pattern(s).
5142 (define_expand "divsf3"
5143 [(set (match_operand:SF 0 "register_operand" "=f,f")
5144 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5145 (match_operand:SF 2 "general_operand" "f,R")))]
5149 (define_insn "*divsf3"
5150 [(set (match_operand:SF 0 "register_operand" "=f,f")
5151 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5152 (match_operand:SF 2 "general_operand" "f,R")))]
5153 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5157 [(set_attr "op_type" "RRE,RXE")
5158 (set_attr "type" "fdivs")])
5160 (define_insn "*divsf3"
5161 [(set (match_operand:SF 0 "register_operand" "=f,f")
5162 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5163 (match_operand:SF 2 "general_operand" "f,R")))]
5164 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5168 [(set_attr "op_type" "RR,RX")
5169 (set_attr "type" "fdivs")])
5173 ;;- And instructions.
5177 ; anddi3 instruction pattern(s).
5180 (define_insn "*anddi3_cc"
5182 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5183 (match_operand:DI 2 "general_operand" "d,m"))
5185 (set (match_operand:DI 0 "register_operand" "=d,d")
5186 (and:DI (match_dup 1) (match_dup 2)))]
5187 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5191 [(set_attr "op_type" "RRE,RXY")])
5193 (define_insn "*anddi3_cconly"
5195 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5196 (match_operand:DI 2 "general_operand" "d,m"))
5198 (clobber (match_scratch:DI 0 "=d,d"))]
5199 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5203 [(set_attr "op_type" "RRE,RXY")])
5205 (define_insn "anddi3"
5206 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d")
5207 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0")
5208 (match_operand:DI 2 "general_operand"
5209 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m")))
5210 (clobber (reg:CC 33))]
5221 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")])
5223 (define_insn "*anddi3_ss"
5224 [(set (match_operand:DI 0 "s_operand" "=Q")
5225 (and:DI (match_dup 0)
5226 (match_operand:DI 1 "s_imm_operand" "Q")))
5227 (clobber (reg:CC 33))]
5230 [(set_attr "op_type" "SS")])
5232 (define_insn "*anddi3_ss_inv"
5233 [(set (match_operand:DI 0 "s_operand" "=Q")
5234 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
5236 (clobber (reg:CC 33))]
5239 [(set_attr "op_type" "SS")])
5242 ; andsi3 instruction pattern(s).
5245 (define_insn "*andsi3_cc"
5247 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5248 (match_operand:SI 2 "general_operand" "d,R,T"))
5250 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5251 (and:SI (match_dup 1) (match_dup 2)))]
5252 "s390_match_ccmode(insn, CCTmode)"
5257 [(set_attr "op_type" "RR,RX,RXY")])
5259 (define_insn "*andsi3_cconly"
5261 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5262 (match_operand:SI 2 "general_operand" "d,R,T"))
5264 (clobber (match_scratch:SI 0 "=d,d,d"))]
5265 "s390_match_ccmode(insn, CCTmode)"
5270 [(set_attr "op_type" "RR,RX,RXY")])
5272 (define_expand "andsi3"
5274 [(set (match_operand:SI 0 "register_operand" "")
5275 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5276 (match_operand:SI 2 "general_operand" "")))
5277 (clobber (reg:CC 33))])]
5281 (define_insn "*andsi3_zarch"
5282 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d")
5283 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0")
5284 (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T")))
5285 (clobber (reg:CC 33))]
5295 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")])
5297 (define_insn "*andsi3_esa"
5298 [(set (match_operand:SI 0 "register_operand" "=d,d")
5299 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
5300 (match_operand:SI 2 "general_operand" "d,R")))
5301 (clobber (reg:CC 33))]
5306 [(set_attr "op_type" "RR,RX")])
5308 (define_insn "*andsi3_ss"
5309 [(set (match_operand:SI 0 "s_operand" "=Q")
5310 (and:SI (match_dup 0)
5311 (match_operand:SI 1 "s_imm_operand" "Q")))
5312 (clobber (reg:CC 33))]
5315 [(set_attr "op_type" "SS")])
5317 (define_insn "*andsi3_ss_inv"
5318 [(set (match_operand:SI 0 "s_operand" "=Q")
5319 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
5321 (clobber (reg:CC 33))]
5324 [(set_attr "op_type" "SS")])
5327 ; andhi3 instruction pattern(s).
5330 (define_insn "*andhi3_ni"
5331 [(set (match_operand:HI 0 "register_operand" "=d,d")
5332 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
5333 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5334 (clobber (reg:CC 33))]
5339 [(set_attr "op_type" "RR,RI")])
5341 (define_insn "andhi3"
5342 [(set (match_operand:HI 0 "register_operand" "=d")
5343 (and:HI (match_operand:HI 1 "register_operand" "%0")
5344 (match_operand:HI 2 "nonmemory_operand" "d")))
5345 (clobber (reg:CC 33))]
5348 [(set_attr "op_type" "RR")])
5350 (define_insn "*andhi3_ss"
5351 [(set (match_operand:HI 0 "s_operand" "=Q")
5352 (and:HI (match_dup 0)
5353 (match_operand:HI 1 "s_imm_operand" "Q")))
5354 (clobber (reg:CC 33))]
5357 [(set_attr "op_type" "SS")])
5359 (define_insn "*andhi3_ss_inv"
5360 [(set (match_operand:HI 0 "s_operand" "=Q")
5361 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
5363 (clobber (reg:CC 33))]
5366 [(set_attr "op_type" "SS")])
5369 ; andqi3 instruction pattern(s).
5372 (define_insn "*andqi3_ni"
5373 [(set (match_operand:QI 0 "register_operand" "=d,d")
5374 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
5375 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5376 (clobber (reg:CC 33))]
5381 [(set_attr "op_type" "RR,RI")])
5383 (define_insn "andqi3"
5384 [(set (match_operand:QI 0 "register_operand" "=d")
5385 (and:QI (match_operand:QI 1 "register_operand" "%0")
5386 (match_operand:QI 2 "nonmemory_operand" "d")))
5387 (clobber (reg:CC 33))]
5390 [(set_attr "op_type" "RR")])
5392 (define_insn "*andqi3_ss"
5393 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5394 (and:QI (match_dup 0)
5395 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5396 (clobber (reg:CC 33))]
5402 [(set_attr "op_type" "SI,SIY,SS")])
5404 (define_insn "*andqi3_ss_inv"
5405 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5406 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5408 (clobber (reg:CC 33))]
5414 [(set_attr "op_type" "SI,SIY,SS")])
5418 ;;- Bit set (inclusive or) instructions.
5422 ; iordi3 instruction pattern(s).
5425 (define_insn "*iordi3_cc"
5427 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5428 (match_operand:DI 2 "general_operand" "d,m"))
5430 (set (match_operand:DI 0 "register_operand" "=d,d")
5431 (ior:DI (match_dup 1) (match_dup 2)))]
5432 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5436 [(set_attr "op_type" "RRE,RXY")])
5438 (define_insn "*iordi3_cconly"
5440 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5441 (match_operand:DI 2 "general_operand" "d,m"))
5443 (clobber (match_scratch:DI 0 "=d,d"))]
5444 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5448 [(set_attr "op_type" "RRE,RXY")])
5450 (define_insn "iordi3"
5451 [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d")
5452 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0")
5453 (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m")))
5454 (clobber (reg:CC 33))]
5463 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")])
5465 (define_insn "*iordi3_ss"
5466 [(set (match_operand:DI 0 "s_operand" "=Q")
5467 (ior:DI (match_dup 0)
5468 (match_operand:DI 1 "s_imm_operand" "Q")))
5469 (clobber (reg:CC 33))]
5472 [(set_attr "op_type" "SS")])
5474 (define_insn "*iordi3_ss_inv"
5475 [(set (match_operand:DI 0 "s_operand" "=Q")
5476 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
5478 (clobber (reg:CC 33))]
5481 [(set_attr "op_type" "SS")])
5484 ; iorsi3 instruction pattern(s).
5487 (define_insn "*iorsi3_cc"
5489 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5490 (match_operand:SI 2 "general_operand" "d,R,T"))
5492 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5493 (ior:SI (match_dup 1) (match_dup 2)))]
5494 "s390_match_ccmode(insn, CCTmode)"
5499 [(set_attr "op_type" "RR,RX,RXY")])
5501 (define_insn "*iorsi3_cconly"
5503 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5504 (match_operand:SI 2 "general_operand" "d,R,T"))
5506 (clobber (match_scratch:SI 0 "=d,d,d"))]
5507 "s390_match_ccmode(insn, CCTmode)"
5512 [(set_attr "op_type" "RR,RX,RXY")])
5514 (define_expand "iorsi3"
5516 [(set (match_operand:SI 0 "register_operand" "")
5517 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5518 (match_operand:SI 2 "general_operand" "")))
5519 (clobber (reg:CC 33))])]
5523 (define_insn "iorsi3_zarch"
5524 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
5525 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0")
5526 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T")))
5527 (clobber (reg:CC 33))]
5535 [(set_attr "op_type" "RI,RI,RR,RX,RXY")])
5537 (define_insn "iorsi3_esa"
5538 [(set (match_operand:SI 0 "register_operand" "=d,d")
5539 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
5540 (match_operand:SI 2 "general_operand" "d,R")))
5541 (clobber (reg:CC 33))]
5546 [(set_attr "op_type" "RR,RX")])
5548 (define_insn "*iorsi3_ss"
5549 [(set (match_operand:SI 0 "s_operand" "=Q")
5550 (ior:SI (match_dup 0)
5551 (match_operand:SI 1 "s_imm_operand" "Q")))
5552 (clobber (reg:CC 33))]
5555 [(set_attr "op_type" "SS")])
5557 (define_insn "*iorsi3_ss_inv"
5558 [(set (match_operand:SI 0 "s_operand" "=Q")
5559 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
5561 (clobber (reg:CC 33))]
5564 [(set_attr "op_type" "SS")])
5567 ; iorhi3 instruction pattern(s).
5570 (define_insn "*iorhi3_oi"
5571 [(set (match_operand:HI 0 "register_operand" "=d,d")
5572 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
5573 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5574 (clobber (reg:CC 33))]
5579 [(set_attr "op_type" "RR,RI")])
5581 (define_insn "iorhi3"
5582 [(set (match_operand:HI 0 "register_operand" "=d")
5583 (ior:HI (match_operand:HI 1 "register_operand" "%0")
5584 (match_operand:HI 2 "nonmemory_operand" "d")))
5585 (clobber (reg:CC 33))]
5588 [(set_attr "op_type" "RR")])
5590 (define_insn "*iorhi3_ss"
5591 [(set (match_operand:HI 0 "s_operand" "=Q")
5592 (ior:HI (match_dup 0)
5593 (match_operand:HI 1 "s_imm_operand" "Q")))
5594 (clobber (reg:CC 33))]
5597 [(set_attr "op_type" "SS")])
5599 (define_insn "*iorhi3_ss_inv"
5600 [(set (match_operand:HI 0 "s_operand" "=Q")
5601 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
5603 (clobber (reg:CC 33))]
5606 [(set_attr "op_type" "SS")])
5609 ; iorqi3 instruction pattern(s).
5612 (define_insn "*iorqi3_oi"
5613 [(set (match_operand:QI 0 "register_operand" "=d,d")
5614 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
5615 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5616 (clobber (reg:CC 33))]
5621 [(set_attr "op_type" "RR,RI")])
5623 (define_insn "iorqi3"
5624 [(set (match_operand:QI 0 "register_operand" "=d")
5625 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5626 (match_operand:QI 2 "nonmemory_operand" "d")))
5627 (clobber (reg:CC 33))]
5630 [(set_attr "op_type" "RR")])
5632 (define_insn "*iorqi3_ss"
5633 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5634 (ior:QI (match_dup 0)
5635 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5636 (clobber (reg:CC 33))]
5642 [(set_attr "op_type" "SI,SIY,SS")])
5644 (define_insn "*iorqi3_ss_inv"
5645 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5646 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5648 (clobber (reg:CC 33))]
5654 [(set_attr "op_type" "SI,SIY,SS")])
5658 ;;- Xor instructions.
5662 ; xordi3 instruction pattern(s).
5665 (define_insn "*xordi3_cc"
5667 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5668 (match_operand:DI 2 "general_operand" "d,m"))
5670 (set (match_operand:DI 0 "register_operand" "=d,d")
5671 (xor:DI (match_dup 1) (match_dup 2)))]
5672 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5676 [(set_attr "op_type" "RRE,RXY")])
5678 (define_insn "*xordi3_cconly"
5680 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5681 (match_operand:DI 2 "general_operand" "d,m"))
5683 (clobber (match_scratch:DI 0 "=d,d"))]
5684 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5688 [(set_attr "op_type" "RRE,RXY")])
5690 (define_insn "xordi3"
5691 [(set (match_operand:DI 0 "register_operand" "=d,d")
5692 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5693 (match_operand:DI 2 "general_operand" "d,m")))
5694 (clobber (reg:CC 33))]
5699 [(set_attr "op_type" "RRE,RXY")])
5701 (define_insn "*xordi3_ss"
5702 [(set (match_operand:DI 0 "s_operand" "=Q")
5703 (xor:DI (match_dup 0)
5704 (match_operand:DI 1 "s_imm_operand" "Q")))
5705 (clobber (reg:CC 33))]
5708 [(set_attr "op_type" "SS")])
5710 (define_insn "*xordi3_ss_inv"
5711 [(set (match_operand:DI 0 "s_operand" "=Q")
5712 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5714 (clobber (reg:CC 33))]
5717 [(set_attr "op_type" "SS")])
5720 ; xorsi3 instruction pattern(s).
5723 (define_insn "*xorsi3_cc"
5725 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5726 (match_operand:SI 2 "general_operand" "d,R,T"))
5728 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5729 (xor:SI (match_dup 1) (match_dup 2)))]
5730 "s390_match_ccmode(insn, CCTmode)"
5735 [(set_attr "op_type" "RR,RX,RXY")])
5737 (define_insn "*xorsi3_cconly"
5739 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5740 (match_operand:SI 2 "general_operand" "d,R,T"))
5742 (clobber (match_scratch:SI 0 "=d,d,d"))]
5743 "s390_match_ccmode(insn, CCTmode)"
5748 [(set_attr "op_type" "RR,RX,RXY")])
5750 (define_insn "xorsi3"
5751 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5752 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5753 (match_operand:SI 2 "general_operand" "d,R,T")))
5754 (clobber (reg:CC 33))]
5760 [(set_attr "op_type" "RR,RX,RXY")])
5762 (define_insn "*xorsi3_ss"
5763 [(set (match_operand:SI 0 "s_operand" "=Q")
5764 (xor:SI (match_dup 0)
5765 (match_operand:SI 1 "s_imm_operand" "Q")))
5766 (clobber (reg:CC 33))]
5769 [(set_attr "op_type" "SS")])
5771 (define_insn "*xorsi3_ss_inv"
5772 [(set (match_operand:SI 0 "s_operand" "=Q")
5773 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5775 (clobber (reg:CC 33))]
5778 [(set_attr "op_type" "SS")])
5781 ; xorhi3 instruction pattern(s).
5784 (define_insn "xorhi3"
5785 [(set (match_operand:HI 0 "register_operand" "=d")
5786 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5787 (match_operand:HI 2 "nonmemory_operand" "d")))
5788 (clobber (reg:CC 33))]
5791 [(set_attr "op_type" "RR")])
5793 (define_insn "*xorhi3_ss"
5794 [(set (match_operand:HI 0 "s_operand" "=Q")
5795 (xor:HI (match_dup 0)
5796 (match_operand:HI 1 "s_imm_operand" "Q")))
5797 (clobber (reg:CC 33))]
5800 [(set_attr "op_type" "SS")])
5802 (define_insn "*xorhi3_ss_inv"
5803 [(set (match_operand:HI 0 "s_operand" "=Q")
5804 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5806 (clobber (reg:CC 33))]
5809 [(set_attr "op_type" "SS")])
5812 ; xorqi3 instruction pattern(s).
5815 (define_insn "xorqi3"
5816 [(set (match_operand:QI 0 "register_operand" "=d")
5817 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5818 (match_operand:QI 2 "nonmemory_operand" "d")))
5819 (clobber (reg:CC 33))]
5822 [(set_attr "op_type" "RR")])
5824 (define_insn "*xorqi3_ss"
5825 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5826 (xor:QI (match_dup 0)
5827 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5828 (clobber (reg:CC 33))]
5834 [(set_attr "op_type" "SI,SIY,SS")])
5836 (define_insn "*xorqi3_ss_inv"
5837 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5838 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5840 (clobber (reg:CC 33))]
5846 [(set_attr "op_type" "SI,SIY,SS")])
5850 ;;- Negate instructions.
5854 ; negdi2 instruction pattern(s).
5857 (define_expand "negdi2"
5859 [(set (match_operand:DI 0 "register_operand" "=d")
5860 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5861 (clobber (reg:CC 33))])]
5865 (define_insn "*negdi2_64"
5866 [(set (match_operand:DI 0 "register_operand" "=d")
5867 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5868 (clobber (reg:CC 33))]
5871 [(set_attr "op_type" "RR")])
5873 (define_insn "*negdi2_31"
5874 [(set (match_operand:DI 0 "register_operand" "=d")
5875 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5876 (clobber (reg:CC 33))]
5880 xop[0] = gen_label_rtx ();
5881 output_asm_insn ("lcr\t%0,%1", operands);
5882 output_asm_insn ("lcr\t%N0,%N1", operands);
5883 output_asm_insn ("je\t%l0", xop);
5884 output_asm_insn ("bctr\t%0,0", operands);
5885 targetm.asm_out.internal_label (asm_out_file, "L",
5886 CODE_LABEL_NUMBER (xop[0]));
5889 [(set_attr "op_type" "NN")
5890 (set_attr "type" "other")
5891 (set_attr "length" "10")])
5894 ; negsi2 instruction pattern(s).
5897 (define_insn "negsi2"
5898 [(set (match_operand:SI 0 "register_operand" "=d")
5899 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5900 (clobber (reg:CC 33))]
5903 [(set_attr "op_type" "RR")])
5906 ; negdf2 instruction pattern(s).
5909 (define_expand "negdf2"
5911 [(set (match_operand:DF 0 "register_operand" "=f")
5912 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5913 (clobber (reg:CC 33))])]
5917 (define_insn "*negdf2"
5918 [(set (match_operand:DF 0 "register_operand" "=f")
5919 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5920 (clobber (reg:CC 33))]
5921 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5923 [(set_attr "op_type" "RRE")
5924 (set_attr "type" "fsimpd")])
5926 (define_insn "*negdf2_ibm"
5927 [(set (match_operand:DF 0 "register_operand" "=f")
5928 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5929 (clobber (reg:CC 33))]
5930 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5932 [(set_attr "op_type" "RR")
5933 (set_attr "type" "fsimpd")])
5936 ; negsf2 instruction pattern(s).
5939 (define_expand "negsf2"
5941 [(set (match_operand:SF 0 "register_operand" "=f")
5942 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5943 (clobber (reg:CC 33))])]
5947 (define_insn "*negsf2"
5948 [(set (match_operand:SF 0 "register_operand" "=f")
5949 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5950 (clobber (reg:CC 33))]
5951 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5953 [(set_attr "op_type" "RRE")
5954 (set_attr "type" "fsimps")])
5956 (define_insn "*negsf2"
5957 [(set (match_operand:SF 0 "register_operand" "=f")
5958 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5959 (clobber (reg:CC 33))]
5960 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5962 [(set_attr "op_type" "RR")
5963 (set_attr "type" "fsimps")])
5967 ;;- Absolute value instructions.
5971 ; absdi2 instruction pattern(s).
5974 (define_insn "absdi2"
5975 [(set (match_operand:DI 0 "register_operand" "=d")
5976 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5977 (clobber (reg:CC 33))]
5980 [(set_attr "op_type" "RRE")])
5983 ; abssi2 instruction pattern(s).
5986 (define_insn "abssi2"
5987 [(set (match_operand:SI 0 "register_operand" "=d")
5988 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5989 (clobber (reg:CC 33))]
5992 [(set_attr "op_type" "RR")])
5995 ; absdf2 instruction pattern(s).
5998 (define_expand "absdf2"
6000 [(set (match_operand:DF 0 "register_operand" "=f")
6001 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6002 (clobber (reg:CC 33))])]
6006 (define_insn "*absdf2"
6007 [(set (match_operand:DF 0 "register_operand" "=f")
6008 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6009 (clobber (reg:CC 33))]
6010 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6012 [(set_attr "op_type" "RRE")
6013 (set_attr "type" "fsimpd")])
6015 (define_insn "*absdf2_ibm"
6016 [(set (match_operand:DF 0 "register_operand" "=f")
6017 (abs:DF (match_operand:DF 1 "register_operand" "f")))
6018 (clobber (reg:CC 33))]
6019 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6021 [(set_attr "op_type" "RR")
6022 (set_attr "type" "fsimpd")])
6025 ; abssf2 instruction pattern(s).
6028 (define_expand "abssf2"
6030 [(set (match_operand:SF 0 "register_operand" "=f")
6031 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6032 (clobber (reg:CC 33))])]
6036 (define_insn "*abssf2"
6037 [(set (match_operand:SF 0 "register_operand" "=f")
6038 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6039 (clobber (reg:CC 33))]
6040 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6042 [(set_attr "op_type" "RRE")
6043 (set_attr "type" "fsimps")])
6045 (define_insn "*abssf2_ibm"
6046 [(set (match_operand:SF 0 "register_operand" "=f")
6047 (abs:SF (match_operand:SF 1 "register_operand" "f")))
6048 (clobber (reg:CC 33))]
6049 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
6051 [(set_attr "op_type" "RR")
6052 (set_attr "type" "fsimps")])
6055 ;;- Negated absolute value instructions
6062 (define_insn "*negabssi2"
6063 [(set (match_operand:SI 0 "register_operand" "=d")
6064 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
6065 (clobber (reg:CC 33))]
6068 [(set_attr "op_type" "RR")])
6070 (define_insn "*negabsdi2"
6071 [(set (match_operand:DI 0 "register_operand" "=d")
6072 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
6073 (clobber (reg:CC 33))]
6076 [(set_attr "op_type" "RRE")])
6082 (define_insn "*negabssf2"
6083 [(set (match_operand:SF 0 "register_operand" "=f")
6084 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6085 (clobber (reg:CC 33))]
6086 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6088 [(set_attr "op_type" "RRE")
6089 (set_attr "type" "fsimps")])
6091 (define_insn "*negabsdf2"
6092 [(set (match_operand:DF 0 "register_operand" "=f")
6093 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6094 (clobber (reg:CC 33))]
6095 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6097 [(set_attr "op_type" "RRE")
6098 (set_attr "type" "fsimpd")])
6101 ;;- Square root instructions.
6105 ; sqrtdf2 instruction pattern(s).
6108 (define_insn "sqrtdf2"
6109 [(set (match_operand:DF 0 "register_operand" "=f,f")
6110 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6111 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6115 [(set_attr "op_type" "RRE,RXE")])
6118 ; sqrtsf2 instruction pattern(s).
6121 (define_insn "sqrtsf2"
6122 [(set (match_operand:SF 0 "register_operand" "=f,f")
6123 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6124 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6128 [(set_attr "op_type" "RRE,RXE")])
6131 ;;- One complement instructions.
6135 ; one_cmpldi2 instruction pattern(s).
6138 (define_expand "one_cmpldi2"
6140 [(set (match_operand:DI 0 "register_operand" "")
6141 (xor:DI (match_operand:DI 1 "register_operand" "")
6143 (clobber (reg:CC 33))])]
6148 ; one_cmplsi2 instruction pattern(s).
6151 (define_expand "one_cmplsi2"
6153 [(set (match_operand:SI 0 "register_operand" "")
6154 (xor:SI (match_operand:SI 1 "register_operand" "")
6156 (clobber (reg:CC 33))])]
6161 ; one_cmplhi2 instruction pattern(s).
6164 (define_expand "one_cmplhi2"
6166 [(set (match_operand:HI 0 "register_operand" "")
6167 (xor:HI (match_operand:HI 1 "register_operand" "")
6169 (clobber (reg:CC 33))])]
6174 ; one_cmplqi2 instruction pattern(s).
6177 (define_expand "one_cmplqi2"
6179 [(set (match_operand:QI 0 "register_operand" "")
6180 (xor:QI (match_operand:QI 1 "register_operand" "")
6182 (clobber (reg:CC 33))])]
6188 ;;- Rotate instructions.
6192 ; rotldi3 instruction pattern(s).
6195 (define_insn "rotldi3"
6196 [(set (match_operand:DI 0 "register_operand" "=d")
6197 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6198 (match_operand:SI 2 "shift_count_operand" "Y")))]
6201 [(set_attr "op_type" "RSE")
6202 (set_attr "atype" "reg")])
6205 ; rotlsi3 instruction pattern(s).
6208 (define_insn "rotlsi3"
6209 [(set (match_operand:SI 0 "register_operand" "=d")
6210 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6211 (match_operand:SI 2 "shift_count_operand" "Y")))]
6214 [(set_attr "op_type" "RSE")
6215 (set_attr "atype" "reg")])
6219 ;;- Arithmetic shift instructions.
6223 ; ashldi3 instruction pattern(s).
6226 (define_expand "ashldi3"
6227 [(set (match_operand:DI 0 "register_operand" "")
6228 (ashift:DI (match_operand:DI 1 "register_operand" "")
6229 (match_operand:SI 2 "shift_count_operand" "")))]
6233 (define_insn "*ashldi3_31"
6234 [(set (match_operand:DI 0 "register_operand" "=d")
6235 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6236 (match_operand:SI 2 "shift_count_operand" "Y")))]
6239 [(set_attr "op_type" "RS")
6240 (set_attr "atype" "reg")])
6242 (define_insn "*ashldi3_64"
6243 [(set (match_operand:DI 0 "register_operand" "=d")
6244 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6245 (match_operand:SI 2 "shift_count_operand" "Y")))]
6248 [(set_attr "op_type" "RSE")
6249 (set_attr "atype" "reg")])
6252 ; ashrdi3 instruction pattern(s).
6255 (define_expand "ashrdi3"
6257 [(set (match_operand:DI 0 "register_operand" "")
6258 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6259 (match_operand:SI 2 "shift_count_operand" "")))
6260 (clobber (reg:CC 33))])]
6264 (define_insn "*ashrdi3_cc_31"
6266 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6267 (match_operand:SI 2 "shift_count_operand" "Y"))
6269 (set (match_operand:DI 0 "register_operand" "=d")
6270 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6271 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6273 [(set_attr "op_type" "RS")
6274 (set_attr "atype" "reg")])
6276 (define_insn "*ashrdi3_cconly_31"
6278 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6279 (match_operand:SI 2 "shift_count_operand" "Y"))
6281 (clobber (match_scratch:DI 0 "=d"))]
6282 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6284 [(set_attr "op_type" "RS")
6285 (set_attr "atype" "reg")])
6287 (define_insn "*ashrdi3_31"
6288 [(set (match_operand:DI 0 "register_operand" "=d")
6289 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6290 (match_operand:SI 2 "shift_count_operand" "Y")))
6291 (clobber (reg:CC 33))]
6294 [(set_attr "op_type" "RS")
6295 (set_attr "atype" "reg")])
6297 (define_insn "*ashrdi3_cc_64"
6299 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6300 (match_operand:SI 2 "shift_count_operand" "Y"))
6302 (set (match_operand:DI 0 "register_operand" "=d")
6303 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6304 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6306 [(set_attr "op_type" "RSE")
6307 (set_attr "atype" "reg")])
6309 (define_insn "*ashrdi3_cconly_64"
6311 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6312 (match_operand:SI 2 "shift_count_operand" "Y"))
6314 (clobber (match_scratch:DI 0 "=d"))]
6315 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6317 [(set_attr "op_type" "RSE")
6318 (set_attr "atype" "reg")])
6320 (define_insn "*ashrdi3_64"
6321 [(set (match_operand:DI 0 "register_operand" "=d")
6322 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6323 (match_operand:SI 2 "shift_count_operand" "Y")))
6324 (clobber (reg:CC 33))]
6327 [(set_attr "op_type" "RSE")
6328 (set_attr "atype" "reg")])
6332 ; ashlsi3 instruction pattern(s).
6335 (define_insn "ashlsi3"
6336 [(set (match_operand:SI 0 "register_operand" "=d")
6337 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6338 (match_operand:SI 2 "shift_count_operand" "Y")))]
6341 [(set_attr "op_type" "RS")
6342 (set_attr "atype" "reg")])
6345 ; ashrsi3 instruction pattern(s).
6348 (define_insn "*ashrsi3_cc"
6350 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6351 (match_operand:SI 2 "shift_count_operand" "Y"))
6353 (set (match_operand:SI 0 "register_operand" "=d")
6354 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6355 "s390_match_ccmode(insn, CCSmode)"
6357 [(set_attr "op_type" "RS")
6358 (set_attr "atype" "reg")])
6361 (define_insn "*ashrsi3_cconly"
6363 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6364 (match_operand:SI 2 "shift_count_operand" "Y"))
6366 (clobber (match_scratch:SI 0 "=d"))]
6367 "s390_match_ccmode(insn, CCSmode)"
6369 [(set_attr "op_type" "RS")
6370 (set_attr "atype" "reg")])
6372 (define_insn "ashrsi3"
6373 [(set (match_operand:SI 0 "register_operand" "=d")
6374 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6375 (match_operand:SI 2 "shift_count_operand" "Y")))
6376 (clobber (reg:CC 33))]
6379 [(set_attr "op_type" "RS")
6380 (set_attr "atype" "reg")])
6384 ;;- logical shift instructions.
6388 ; lshrdi3 instruction pattern(s).
6391 (define_expand "lshrdi3"
6392 [(set (match_operand:DI 0 "register_operand" "")
6393 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6394 (match_operand:SI 2 "shift_count_operand" "")))]
6398 (define_insn "*lshrdi3_31"
6399 [(set (match_operand:DI 0 "register_operand" "=d")
6400 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6401 (match_operand:SI 2 "shift_count_operand" "Y")))]
6404 [(set_attr "op_type" "RS")
6405 (set_attr "atype" "reg")])
6407 (define_insn "*lshrdi3_64"
6408 [(set (match_operand:DI 0 "register_operand" "=d")
6409 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6410 (match_operand:SI 2 "shift_count_operand" "Y")))]
6413 [(set_attr "op_type" "RSE")
6414 (set_attr "atype" "reg")])
6417 ; lshrsi3 instruction pattern(s).
6420 (define_insn "lshrsi3"
6421 [(set (match_operand:SI 0 "register_operand" "=d")
6422 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6423 (match_operand:SI 2 "shift_count_operand" "Y")))]
6426 [(set_attr "op_type" "RS")
6427 (set_attr "atype" "reg")])
6431 ;; Branch instruction patterns.
6434 (define_expand "beq"
6435 [(match_operand 0 "" "")]
6437 "s390_emit_jump (operands[0],
6438 s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
6440 (define_expand "bne"
6441 [(match_operand 0 "" "")]
6443 "s390_emit_jump (operands[0],
6444 s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
6446 (define_expand "bgt"
6447 [(match_operand 0 "" "")]
6449 "s390_emit_jump (operands[0],
6450 s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
6452 (define_expand "bgtu"
6453 [(match_operand 0 "" "")]
6455 "s390_emit_jump (operands[0],
6456 s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
6458 (define_expand "blt"
6459 [(match_operand 0 "" "")]
6461 "s390_emit_jump (operands[0],
6462 s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
6464 (define_expand "bltu"
6465 [(match_operand 0 "" "")]
6467 "s390_emit_jump (operands[0],
6468 s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
6470 (define_expand "bge"
6471 [(match_operand 0 "" "")]
6473 "s390_emit_jump (operands[0],
6474 s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
6476 (define_expand "bgeu"
6477 [(match_operand 0 "" "")]
6479 "s390_emit_jump (operands[0],
6480 s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
6482 (define_expand "ble"
6483 [(match_operand 0 "" "")]
6485 "s390_emit_jump (operands[0],
6486 s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
6488 (define_expand "bleu"
6489 [(match_operand 0 "" "")]
6491 "s390_emit_jump (operands[0],
6492 s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
6494 (define_expand "bunordered"
6495 [(match_operand 0 "" "")]
6497 "s390_emit_jump (operands[0],
6498 s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6500 (define_expand "bordered"
6501 [(match_operand 0 "" "")]
6503 "s390_emit_jump (operands[0],
6504 s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6506 (define_expand "buneq"
6507 [(match_operand 0 "" "")]
6509 "s390_emit_jump (operands[0],
6510 s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
6512 (define_expand "bunlt"
6513 [(match_operand 0 "" "")]
6515 "s390_emit_jump (operands[0],
6516 s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
6518 (define_expand "bungt"
6519 [(match_operand 0 "" "")]
6521 "s390_emit_jump (operands[0],
6522 s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
6524 (define_expand "bunle"
6525 [(match_operand 0 "" "")]
6527 "s390_emit_jump (operands[0],
6528 s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
6530 (define_expand "bunge"
6531 [(match_operand 0 "" "")]
6533 "s390_emit_jump (operands[0],
6534 s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
6536 (define_expand "bltgt"
6537 [(match_operand 0 "" "")]
6539 "s390_emit_jump (operands[0],
6540 s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
6544 ;;- Conditional jump instructions.
6547 (define_insn "*cjump_64"
6550 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6551 (label_ref (match_operand 0 "" ""))
6555 if (get_attr_length (insn) == 4)
6558 return "jg%C1\t%l0";
6560 [(set_attr "op_type" "RI")
6561 (set_attr "type" "branch")
6562 (set (attr "length")
6563 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6564 (const_int 4) (const_int 6)))])
6566 (define_insn "*cjump_31"
6569 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6570 (label_ref (match_operand 0 "" ""))
6574 if (get_attr_length (insn) == 4)
6579 [(set_attr "op_type" "RI")
6580 (set_attr "type" "branch")
6581 (set (attr "length")
6582 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6583 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6584 (const_int 4) (const_int 6))
6585 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6586 (const_int 4) (const_int 8))))])
6588 (define_insn "*cjump_long"
6591 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6592 (match_operand 0 "address_operand" "U")
6596 if (get_attr_op_type (insn) == OP_TYPE_RR)
6601 [(set (attr "op_type")
6602 (if_then_else (match_operand 0 "register_operand" "")
6603 (const_string "RR") (const_string "RX")))
6604 (set_attr "type" "branch")
6605 (set_attr "atype" "agen")])
6609 ;;- Negated conditional jump instructions.
6612 (define_insn "*icjump_64"
6615 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6617 (label_ref (match_operand 0 "" ""))))]
6620 if (get_attr_length (insn) == 4)
6623 return "jg%D1\t%l0";
6625 [(set_attr "op_type" "RI")
6626 (set_attr "type" "branch")
6627 (set (attr "length")
6628 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6629 (const_int 4) (const_int 6)))])
6631 (define_insn "*icjump_31"
6634 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6636 (label_ref (match_operand 0 "" ""))))]
6639 if (get_attr_length (insn) == 4)
6644 [(set_attr "op_type" "RI")
6645 (set_attr "type" "branch")
6646 (set (attr "length")
6647 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6648 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6649 (const_int 4) (const_int 6))
6650 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6651 (const_int 4) (const_int 8))))])
6653 (define_insn "*icjump_long"
6656 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6658 (match_operand 0 "address_operand" "U")))]
6661 if (get_attr_op_type (insn) == OP_TYPE_RR)
6666 [(set (attr "op_type")
6667 (if_then_else (match_operand 0 "register_operand" "")
6668 (const_string "RR") (const_string "RX")))
6669 (set_attr "type" "branch")
6670 (set_attr "atype" "agen")])
6673 ;;- Trap instructions.
6677 [(trap_if (const_int 1) (const_int 0))]
6680 [(set_attr "op_type" "RI")
6681 (set_attr "type" "branch")])
6683 (define_expand "conditional_trap"
6684 [(trap_if (match_operand 0 "comparison_operator" "")
6685 (match_operand 1 "general_operand" ""))]
6688 if (operands[1] != const0_rtx) FAIL;
6689 operands[0] = s390_emit_compare (GET_CODE (operands[0]),
6690 s390_compare_op0, s390_compare_op1);
6693 (define_insn "*trap"
6694 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6698 [(set_attr "op_type" "RI")
6699 (set_attr "type" "branch")])
6702 ;;- Loop instructions.
6704 ;; This is all complicated by the fact that since this is a jump insn
6705 ;; we must handle our own output reloads.
6707 (define_expand "doloop_end"
6708 [(use (match_operand 0 "" "")) ; loop pseudo
6709 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6710 (use (match_operand 2 "" "")) ; max iterations
6711 (use (match_operand 3 "" "")) ; loop level
6712 (use (match_operand 4 "" ""))] ; label
6715 if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
6716 emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
6717 else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
6718 emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
6719 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6720 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6727 (define_insn_and_split "doloop_si64"
6730 (ne (match_operand:SI 1 "register_operand" "d,d")
6732 (label_ref (match_operand 0 "" ""))
6734 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6735 (plus:SI (match_dup 1) (const_int -1)))
6736 (clobber (match_scratch:SI 3 "=X,&d"))
6737 (clobber (reg:CC 33))]
6740 if (which_alternative != 0)
6742 else if (get_attr_length (insn) == 4)
6743 return "brct\t%1,%l0";
6745 return "ahi\t%1,-1\;jgne\t%l0";
6747 "&& reload_completed
6748 && (! REG_P (operands[2])
6749 || ! rtx_equal_p (operands[1], operands[2]))"
6750 [(set (match_dup 3) (match_dup 1))
6751 (parallel [(set (reg:CCAN 33)
6752 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6754 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6755 (set (match_dup 2) (match_dup 3))
6756 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6757 (label_ref (match_dup 0))
6760 [(set_attr "op_type" "RI")
6761 (set_attr "type" "branch")
6762 (set (attr "length")
6763 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6764 (const_int 4) (const_int 10)))])
6766 (define_insn_and_split "doloop_si31"
6769 (ne (match_operand:SI 1 "register_operand" "d,d")
6771 (label_ref (match_operand 0 "" ""))
6773 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6774 (plus:SI (match_dup 1) (const_int -1)))
6775 (clobber (match_scratch:SI 3 "=X,&d"))
6776 (clobber (reg:CC 33))]
6779 if (which_alternative != 0)
6781 else if (get_attr_length (insn) == 4)
6782 return "brct\t%1,%l0";
6786 "&& reload_completed
6787 && (! REG_P (operands[2])
6788 || ! rtx_equal_p (operands[1], operands[2]))"
6789 [(set (match_dup 3) (match_dup 1))
6790 (parallel [(set (reg:CCAN 33)
6791 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6793 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6794 (set (match_dup 2) (match_dup 3))
6795 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6796 (label_ref (match_dup 0))
6799 [(set_attr "op_type" "RI")
6800 (set_attr "type" "branch")
6801 (set (attr "length")
6802 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6803 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6804 (const_int 4) (const_int 6))
6805 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6806 (const_int 4) (const_int 8))))])
6808 (define_insn "*doloop_si_long"
6811 (ne (match_operand:SI 1 "register_operand" "d,d")
6813 (match_operand 0 "address_operand" "U,U")
6815 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6816 (plus:SI (match_dup 1) (const_int -1)))
6817 (clobber (match_scratch:SI 3 "=X,&d"))
6818 (clobber (reg:CC 33))]
6821 if (get_attr_op_type (insn) == OP_TYPE_RR)
6822 return "bctr\t%1,%0";
6824 return "bct\t%1,%a0";
6826 [(set (attr "op_type")
6827 (if_then_else (match_operand 0 "register_operand" "")
6828 (const_string "RR") (const_string "RX")))
6829 (set_attr "type" "branch")
6830 (set_attr "atype" "agen")])
6832 (define_insn_and_split "doloop_di"
6835 (ne (match_operand:DI 1 "register_operand" "d,d")
6837 (label_ref (match_operand 0 "" ""))
6839 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*r")
6840 (plus:DI (match_dup 1) (const_int -1)))
6841 (clobber (match_scratch:DI 3 "=X,&d"))
6842 (clobber (reg:CC 33))]
6845 if (which_alternative != 0)
6847 else if (get_attr_length (insn) == 4)
6848 return "brctg\t%1,%l0";
6850 return "aghi\t%1,-1\;jgne\t%l0";
6852 "&& reload_completed
6853 && (! REG_P (operands[2])
6854 || ! rtx_equal_p (operands[1], operands[2]))"
6855 [(set (match_dup 3) (match_dup 1))
6856 (parallel [(set (reg:CCAN 33)
6857 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6859 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6860 (set (match_dup 2) (match_dup 3))
6861 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6862 (label_ref (match_dup 0))
6865 [(set_attr "op_type" "RI")
6866 (set_attr "type" "branch")
6867 (set (attr "length")
6868 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6869 (const_int 4) (const_int 10)))])
6872 ;;- Unconditional jump instructions.
6876 ; jump instruction pattern(s).
6879 (define_expand "jump"
6880 [(match_operand 0 "" "")]
6882 "s390_emit_jump (operands[0], NULL_RTX); DONE;")
6884 (define_insn "*jump64"
6885 [(set (pc) (label_ref (match_operand 0 "" "")))]
6888 if (get_attr_length (insn) == 4)
6893 [(set_attr "op_type" "RI")
6894 (set_attr "type" "branch")
6895 (set (attr "length")
6896 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6897 (const_int 4) (const_int 6)))])
6899 (define_insn "*jump31"
6900 [(set (pc) (label_ref (match_operand 0 "" "")))]
6903 if (get_attr_length (insn) == 4)
6908 [(set_attr "op_type" "RI")
6909 (set_attr "type" "branch")
6910 (set (attr "length")
6911 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6912 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6913 (const_int 4) (const_int 6))
6914 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6915 (const_int 4) (const_int 8))))])
6918 ; indirect-jump instruction pattern(s).
6921 (define_insn "indirect_jump"
6922 [(set (pc) (match_operand 0 "address_operand" "U"))]
6925 if (get_attr_op_type (insn) == OP_TYPE_RR)
6930 [(set (attr "op_type")
6931 (if_then_else (match_operand 0 "register_operand" "")
6932 (const_string "RR") (const_string "RX")))
6933 (set_attr "type" "branch")
6934 (set_attr "atype" "agen")])
6937 ; casesi instruction pattern(s).
6940 (define_insn "casesi_jump"
6941 [(set (pc) (match_operand 0 "address_operand" "U"))
6942 (use (label_ref (match_operand 1 "" "")))]
6945 if (get_attr_op_type (insn) == OP_TYPE_RR)
6950 [(set (attr "op_type")
6951 (if_then_else (match_operand 0 "register_operand" "")
6952 (const_string "RR") (const_string "RX")))
6953 (set_attr "type" "branch")
6954 (set_attr "atype" "agen")])
6956 (define_expand "casesi"
6957 [(match_operand:SI 0 "general_operand" "")
6958 (match_operand:SI 1 "general_operand" "")
6959 (match_operand:SI 2 "general_operand" "")
6960 (label_ref (match_operand 3 "" ""))
6961 (label_ref (match_operand 4 "" ""))]
6964 rtx index = gen_reg_rtx (SImode);
6965 rtx base = gen_reg_rtx (Pmode);
6966 rtx target = gen_reg_rtx (Pmode);
6968 emit_move_insn (index, operands[0]);
6969 emit_insn (gen_subsi3 (index, index, operands[1]));
6970 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6973 if (Pmode != SImode)
6974 index = convert_to_mode (Pmode, index, 1);
6975 if (GET_CODE (index) != REG)
6976 index = copy_to_mode_reg (Pmode, index);
6979 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6981 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
6983 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6985 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
6986 RTX_UNCHANGING_P (index) = 1;
6987 MEM_NOTRAP_P (index) = 1;
6988 emit_move_insn (target, index);
6991 target = gen_rtx_PLUS (Pmode, base, target);
6992 emit_jump_insn (gen_casesi_jump (target, operands[3]));
6999 ;;- Jump to subroutine.
7004 ; untyped call instruction pattern(s).
7007 ;; Call subroutine returning any type.
7008 (define_expand "untyped_call"
7009 [(parallel [(call (match_operand 0 "" "")
7011 (match_operand 1 "" "")
7012 (match_operand 2 "" "")])]
7017 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
7019 for (i = 0; i < XVECLEN (operands[2], 0); i++)
7021 rtx set = XVECEXP (operands[2], 0, i);
7022 emit_move_insn (SET_DEST (set), SET_SRC (set));
7025 /* The optimizer does not know that the call sets the function value
7026 registers we stored in the result block. We avoid problems by
7027 claiming that all hard registers are used and clobbered at this
7029 emit_insn (gen_blockage ());
7034 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
7035 ;; all of memory. This blocks insns from being moved across this point.
7037 (define_insn "blockage"
7038 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
7041 [(set_attr "type" "none")
7042 (set_attr "length" "0")])
7048 (define_expand "sibcall"
7049 [(call (match_operand 0 "" "")
7050 (match_operand 1 "" ""))]
7053 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
7057 (define_insn "*sibcall_br"
7058 [(call (mem:QI (reg 1))
7059 (match_operand 0 "const_int_operand" "n"))]
7060 "SIBLING_CALL_P (insn)
7061 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
7063 [(set_attr "op_type" "RR")
7064 (set_attr "type" "branch")
7065 (set_attr "atype" "agen")])
7067 (define_insn "*sibcall_brc"
7068 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7069 (match_operand 1 "const_int_operand" "n"))]
7070 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7072 [(set_attr "op_type" "RI")
7073 (set_attr "type" "branch")])
7075 (define_insn "*sibcall_brcl"
7076 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7077 (match_operand 1 "const_int_operand" "n"))]
7078 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7080 [(set_attr "op_type" "RIL")
7081 (set_attr "type" "branch")])
7084 ; sibcall_value patterns
7087 (define_expand "sibcall_value"
7088 [(set (match_operand 0 "" "")
7089 (call (match_operand 1 "" "")
7090 (match_operand 2 "" "")))]
7093 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7097 (define_insn "*sibcall_value_br"
7098 [(set (match_operand 0 "" "")
7099 (call (mem:QI (reg 1))
7100 (match_operand 1 "const_int_operand" "n")))]
7101 "SIBLING_CALL_P (insn)
7102 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7104 [(set_attr "op_type" "RR")
7105 (set_attr "type" "branch")
7106 (set_attr "atype" "agen")])
7108 (define_insn "*sibcall_value_brc"
7109 [(set (match_operand 0 "" "")
7110 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7111 (match_operand 2 "const_int_operand" "n")))]
7112 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7114 [(set_attr "op_type" "RI")
7115 (set_attr "type" "branch")])
7117 (define_insn "*sibcall_value_brcl"
7118 [(set (match_operand 0 "" "")
7119 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7120 (match_operand 2 "const_int_operand" "n")))]
7121 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7123 [(set_attr "op_type" "RIL")
7124 (set_attr "type" "branch")])
7128 ; call instruction pattern(s).
7131 (define_expand "call"
7132 [(call (match_operand 0 "" "")
7133 (match_operand 1 "" ""))
7134 (use (match_operand 2 "" ""))]
7137 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7138 gen_rtx_REG (Pmode, RETURN_REGNUM));
7142 (define_insn "*bras"
7143 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7144 (match_operand 1 "const_int_operand" "n"))
7145 (clobber (match_operand 2 "register_operand" "=r"))]
7146 "!SIBLING_CALL_P (insn)
7147 && TARGET_SMALL_EXEC
7148 && GET_MODE (operands[2]) == Pmode"
7150 [(set_attr "op_type" "RI")
7151 (set_attr "type" "jsr")])
7153 (define_insn "*brasl"
7154 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7155 (match_operand 1 "const_int_operand" "n"))
7156 (clobber (match_operand 2 "register_operand" "=r"))]
7157 "!SIBLING_CALL_P (insn)
7159 && GET_MODE (operands[2]) == Pmode"
7161 [(set_attr "op_type" "RIL")
7162 (set_attr "type" "jsr")])
7164 (define_insn "*basr"
7165 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7166 (match_operand 1 "const_int_operand" "n"))
7167 (clobber (match_operand 2 "register_operand" "=r"))]
7168 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7170 if (get_attr_op_type (insn) == OP_TYPE_RR)
7171 return "basr\t%2,%0";
7173 return "bas\t%2,%a0";
7175 [(set (attr "op_type")
7176 (if_then_else (match_operand 0 "register_operand" "")
7177 (const_string "RR") (const_string "RX")))
7178 (set_attr "type" "jsr")
7179 (set_attr "atype" "agen")])
7182 ; call_value instruction pattern(s).
7185 (define_expand "call_value"
7186 [(set (match_operand 0 "" "")
7187 (call (match_operand 1 "" "")
7188 (match_operand 2 "" "")))
7189 (use (match_operand 3 "" ""))]
7192 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7193 gen_rtx_REG (Pmode, RETURN_REGNUM));
7197 (define_insn "*bras_r"
7198 [(set (match_operand 0 "" "")
7199 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7200 (match_operand:SI 2 "const_int_operand" "n")))
7201 (clobber (match_operand 3 "register_operand" "=r"))]
7202 "!SIBLING_CALL_P (insn)
7203 && TARGET_SMALL_EXEC
7204 && GET_MODE (operands[3]) == Pmode"
7206 [(set_attr "op_type" "RI")
7207 (set_attr "type" "jsr")])
7209 (define_insn "*brasl_r"
7210 [(set (match_operand 0 "" "")
7211 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7212 (match_operand 2 "const_int_operand" "n")))
7213 (clobber (match_operand 3 "register_operand" "=r"))]
7214 "!SIBLING_CALL_P (insn)
7216 && GET_MODE (operands[3]) == Pmode"
7218 [(set_attr "op_type" "RIL")
7219 (set_attr "type" "jsr")])
7221 (define_insn "*basr_r"
7222 [(set (match_operand 0 "" "")
7223 (call (mem:QI (match_operand 1 "address_operand" "U"))
7224 (match_operand 2 "const_int_operand" "n")))
7225 (clobber (match_operand 3 "register_operand" "=r"))]
7226 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7228 if (get_attr_op_type (insn) == OP_TYPE_RR)
7229 return "basr\t%3,%1";
7231 return "bas\t%3,%a1";
7233 [(set (attr "op_type")
7234 (if_then_else (match_operand 1 "register_operand" "")
7235 (const_string "RR") (const_string "RX")))
7236 (set_attr "type" "jsr")
7237 (set_attr "atype" "agen")])
7240 ;;- Thread-local storage support.
7243 (define_insn "get_tp_64"
7244 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
7245 (unspec:DI [(const_int 0)] UNSPEC_TP))]
7248 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
7250 [(set_attr "op_type" "NN,RS")
7251 (set_attr "atype" "reg,*")
7252 (set_attr "type" "o3,*")
7253 (set_attr "length" "14,*")])
7255 (define_insn "get_tp_31"
7256 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
7257 (unspec:SI [(const_int 0)] UNSPEC_TP))]
7262 [(set_attr "op_type" "RRE,RS")])
7264 (define_insn "set_tp_64"
7265 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
7266 (clobber (match_scratch:SI 1 "=d,X"))]
7269 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
7271 [(set_attr "op_type" "NN,RS")
7272 (set_attr "atype" "reg,*")
7273 (set_attr "type" "o3,*")
7274 (set_attr "length" "14,*")])
7276 (define_insn "set_tp_31"
7277 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
7282 [(set_attr "op_type" "RRE,RS")])
7284 (define_insn "*tls_load_64"
7285 [(set (match_operand:DI 0 "register_operand" "=d")
7286 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7287 (match_operand:DI 2 "" "")]
7291 [(set_attr "op_type" "RXE")])
7293 (define_insn "*tls_load_31"
7294 [(set (match_operand:SI 0 "register_operand" "=d,d")
7295 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7296 (match_operand:SI 2 "" "")]
7302 [(set_attr "op_type" "RX,RXY")])
7304 (define_insn "*bras_tls"
7305 [(set (match_operand 0 "" "")
7306 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7307 (match_operand 2 "const_int_operand" "n")))
7308 (clobber (match_operand 3 "register_operand" "=r"))
7309 (use (match_operand 4 "" ""))]
7310 "!SIBLING_CALL_P (insn)
7311 && TARGET_SMALL_EXEC
7312 && GET_MODE (operands[3]) == Pmode"
7314 [(set_attr "op_type" "RI")
7315 (set_attr "type" "jsr")])
7317 (define_insn "*brasl_tls"
7318 [(set (match_operand 0 "" "")
7319 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7320 (match_operand 2 "const_int_operand" "n")))
7321 (clobber (match_operand 3 "register_operand" "=r"))
7322 (use (match_operand 4 "" ""))]
7323 "!SIBLING_CALL_P (insn)
7325 && GET_MODE (operands[3]) == Pmode"
7327 [(set_attr "op_type" "RIL")
7328 (set_attr "type" "jsr")])
7330 (define_insn "*basr_tls"
7331 [(set (match_operand 0 "" "")
7332 (call (mem:QI (match_operand 1 "address_operand" "U"))
7333 (match_operand 2 "const_int_operand" "n")))
7334 (clobber (match_operand 3 "register_operand" "=r"))
7335 (use (match_operand 4 "" ""))]
7336 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7338 if (get_attr_op_type (insn) == OP_TYPE_RR)
7339 return "basr\t%3,%1%J4";
7341 return "bas\t%3,%a1%J4";
7343 [(set (attr "op_type")
7344 (if_then_else (match_operand 1 "register_operand" "")
7345 (const_string "RR") (const_string "RX")))
7346 (set_attr "type" "jsr")
7347 (set_attr "atype" "agen")])
7350 ;;- Miscellaneous instructions.
7354 ; allocate stack instruction pattern(s).
7357 (define_expand "allocate_stack"
7359 (plus (reg 15) (match_operand 1 "general_operand" "")))
7360 (set (match_operand 0 "general_operand" "")
7364 rtx stack = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
7365 rtx chain = gen_rtx_MEM (Pmode, stack);
7366 rtx temp = gen_reg_rtx (Pmode);
7368 emit_move_insn (temp, chain);
7371 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7373 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7375 emit_move_insn (chain, temp);
7377 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7383 ; setjmp instruction pattern.
7386 (define_expand "builtin_setjmp_receiver"
7387 [(match_operand 0 "" "")]
7390 emit_insn (s390_load_got ());
7391 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7395 ;; These patterns say how to save and restore the stack pointer. We need not
7396 ;; save the stack pointer at function level since we are careful to
7397 ;; preserve the backchain. At block level, we have to restore the backchain
7398 ;; when we restore the stack pointer.
7400 ;; For nonlocal gotos, we must save both the stack pointer and its
7401 ;; backchain and restore both. Note that in the nonlocal case, the
7402 ;; save area is a memory location.
7404 (define_expand "save_stack_function"
7405 [(match_operand 0 "general_operand" "")
7406 (match_operand 1 "general_operand" "")]
7410 (define_expand "restore_stack_function"
7411 [(match_operand 0 "general_operand" "")
7412 (match_operand 1 "general_operand" "")]
7416 (define_expand "restore_stack_block"
7417 [(use (match_operand 0 "register_operand" ""))
7418 (set (match_dup 2) (match_dup 3))
7419 (set (match_dup 0) (match_operand 1 "register_operand" ""))
7420 (set (match_dup 3) (match_dup 2))]
7423 operands[2] = gen_reg_rtx (Pmode);
7424 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7427 (define_expand "save_stack_nonlocal"
7428 [(match_operand 0 "memory_operand" "")
7429 (match_operand 1 "register_operand" "")]
7432 rtx temp = gen_reg_rtx (Pmode);
7434 /* Copy the backchain to the first word, sp to the second and the literal pool
7435 base to the third. */
7436 emit_move_insn (operand_subword (operands[0], 2, 0,
7437 TARGET_64BIT ? OImode : TImode),
7438 gen_rtx_REG (Pmode, BASE_REGNUM));
7439 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7440 emit_move_insn (operand_subword (operands[0], 0, 0,
7441 TARGET_64BIT ? OImode : TImode),
7443 emit_move_insn (operand_subword (operands[0], 1, 0,
7444 TARGET_64BIT ? OImode : TImode),
7449 (define_expand "restore_stack_nonlocal"
7450 [(match_operand 0 "register_operand" "")
7451 (match_operand 1 "memory_operand" "")]
7454 rtx temp = gen_reg_rtx (Pmode);
7455 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7457 /* Restore the backchain from the first word, sp from the second and the
7458 literal pool base from the third. */
7459 emit_move_insn (temp,
7460 operand_subword (operands[1], 0, 0,
7461 TARGET_64BIT ? OImode : TImode));
7462 emit_move_insn (operands[0],
7463 operand_subword (operands[1], 1, 0,
7464 TARGET_64BIT ? OImode : TImode));
7465 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7466 emit_move_insn (base,
7467 operand_subword (operands[1], 2, 0,
7468 TARGET_64BIT ? OImode : TImode));
7469 emit_insn (gen_rtx_USE (VOIDmode, base));
7476 ; nop instruction pattern(s).
7483 [(set_attr "op_type" "RR")])
7487 ; Special literal pool access instruction pattern(s).
7490 (define_insn "*pool_entry"
7491 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7492 UNSPECV_POOL_ENTRY)]
7495 enum machine_mode mode = GET_MODE (PATTERN (insn));
7496 unsigned int align = GET_MODE_BITSIZE (mode);
7497 s390_output_pool_entry (operands[0], mode, align);
7500 [(set_attr "op_type" "NN")
7501 (set (attr "length")
7502 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7504 (define_insn "pool_start_31"
7505 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7508 [(set_attr "op_type" "NN")
7509 (set_attr "length" "2")])
7511 (define_insn "pool_end_31"
7512 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7515 [(set_attr "op_type" "NN")
7516 (set_attr "length" "2")])
7518 (define_insn "pool_start_64"
7519 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7521 ".section\t.rodata\;.align\t8"
7522 [(set_attr "op_type" "NN")
7523 (set_attr "length" "0")])
7525 (define_insn "pool_end_64"
7526 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7529 [(set_attr "op_type" "NN")
7530 (set_attr "length" "0")])
7532 (define_insn "main_base_31_small"
7533 [(set (match_operand 0 "register_operand" "=a")
7534 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7535 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7537 [(set_attr "op_type" "RR")
7538 (set_attr "type" "la")])
7540 (define_insn "main_base_31_large"
7541 [(set (match_operand 0 "register_operand" "=a")
7542 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7543 (set (pc) (label_ref (match_operand 2 "" "")))]
7544 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7546 [(set_attr "op_type" "RI")])
7548 (define_insn "main_base_64"
7549 [(set (match_operand 0 "register_operand" "=a")
7550 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7551 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7553 [(set_attr "op_type" "RIL")
7554 (set_attr "type" "larl")])
7556 (define_insn "main_pool"
7557 [(set (match_operand 0 "register_operand" "=a")
7558 (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
7559 "GET_MODE (operands[0]) == Pmode"
7561 [(set_attr "op_type" "NN")])
7563 (define_insn "reload_base_31"
7564 [(set (match_operand 0 "register_operand" "=a")
7565 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7566 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7567 "basr\t%0,0\;la\t%0,%1-.(%0)"
7568 [(set_attr "op_type" "NN")
7569 (set_attr "type" "la")
7570 (set_attr "length" "6")])
7572 (define_insn "reload_base_64"
7573 [(set (match_operand 0 "register_operand" "=a")
7574 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7575 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7577 [(set_attr "op_type" "RIL")
7578 (set_attr "type" "larl")])
7581 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7584 [(set_attr "op_type" "NN")
7585 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7588 ;; Insns related to generating the function prologue and epilogue.
7592 (define_expand "prologue"
7593 [(use (const_int 0))]
7595 "s390_emit_prologue (); DONE;")
7597 (define_insn "prologue_tpf"
7598 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7599 (clobber (reg:DI 1))]
7600 "TARGET_TPF_PROFILING"
7602 [(set_attr "type" "jsr")
7603 (set_attr "op_type" "RX")])
7605 (define_expand "epilogue"
7606 [(use (const_int 1))]
7608 "s390_emit_epilogue (false); DONE;")
7610 (define_insn "epilogue_tpf"
7611 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7612 (clobber (reg:DI 1))]
7613 "TARGET_TPF_PROFILING"
7615 [(set_attr "type" "jsr")
7616 (set_attr "op_type" "RX")])
7619 (define_expand "sibcall_epilogue"
7620 [(use (const_int 0))]
7622 "s390_emit_epilogue (true); DONE;")
7624 (define_insn "*return"
7626 (use (match_operand 0 "register_operand" "a"))]
7627 "GET_MODE (operands[0]) == Pmode"
7629 [(set_attr "op_type" "RR")
7630 (set_attr "type" "jsr")
7631 (set_attr "atype" "agen")])
7634 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7635 ;; pointer. This is used for compatibility.
7637 (define_expand "ptr_extend"
7638 [(set (match_operand:DI 0 "register_operand" "=r")
7639 (match_operand:SI 1 "register_operand" "r"))]
7642 emit_insn (gen_anddi3 (operands[0],
7643 gen_lowpart (DImode, operands[1]),
7644 GEN_INT (0x7fffffff)));