1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
3 ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and
4 ;; Ulrich Weigand (uweigand@de.ibm.com).
5 ;; This file is part of GNU CC.
7 ;; GNU CC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; GNU CC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU CC; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
23 ;; Special constraints for s/390 machine description:
25 ;; a -- Any address register from 1 to 15.
26 ;; d -- Any register from 0 to 15.
27 ;; I -- An 8-bit constant (0..255).
28 ;; J -- A 12-bit constant (0..4095).
29 ;; K -- A 16-bit constant (-32768..32767).
30 ;; Q -- A memory reference without index-register.
31 ;; S -- Valid operand for the LARL instruction.
33 ;; Special formats used for outputting 390 instructions.
35 ;; %b -- Print a constant byte integer. xy
36 ;; %h -- Print a signed 16-bit. wxyz
37 ;; %N -- Print next register (second word of a DImode reg) or next word.
38 ;; %M -- Print next register (second word of a TImode reg) or next word.
39 ;; %O -- Print the offset of a memory reference (PLUS (REG) (CONST_INT)).
40 ;; %R -- Print the register of a memory reference (PLUS (REG) (CONST_INT)).
42 ;; We have a special constraint for pattern matching.
44 ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
46 ;; r_or_s_operand -- Matches a register or a valid S operand in a RS, SI
47 ;; or SS type instruction or a register
50 ;; Insn type. Used to default other attribute values.
53 ;; Define an insn type attribute. This is used in function unit delay
56 (define_attr "type" "integer,load,lr,la,store,imul,lmul,fmul,idiv,ldiv,fdiv,branch,jsr,other,o2,o3"
57 (const_string "integer"))
59 ;; Insn are devide in two classes:
60 ;; mem: Insn accesssing memory
61 ;; reg: Insn operands all in registers
63 (define_attr "atype" "reg,mem"
66 ;; Generic pipeline function unit.
68 (define_function_unit "integer" 1 0
69 (eq_attr "type" "integer") 1 1)
71 (define_function_unit "integer" 1 0
72 (eq_attr "type" "load") 1 1)
74 (define_function_unit "integer" 1 0
75 (eq_attr "type" "la") 1 1)
77 (define_function_unit "integer" 1 0
78 (eq_attr "type" "lr") 1 1)
80 (define_function_unit "integer" 1 0
81 (eq_attr "type" "store") 1 1)
83 (define_function_unit "integer" 1 0
84 (eq_attr "type" "jsr") 5 5)
86 (define_function_unit "integer" 1 0
87 (eq_attr "type" "imul") 7 7)
89 (define_function_unit "integer" 1 0
90 (eq_attr "type" "fmul") 6 6)
92 (define_function_unit "integer" 1 0
93 (eq_attr "type" "idiv") 33 33)
95 (define_function_unit "integer" 1 0
96 (eq_attr "type" "fdiv") 33 33)
98 (define_function_unit "integer" 1 0
99 (eq_attr "type" "o2") 2 2)
101 (define_function_unit "integer" 1 0
102 (eq_attr "type" "o3") 3 3)
104 (define_function_unit "integer" 1 0
105 (eq_attr "type" "other") 5 5)
107 ;; Operand type. Used to default length attribute values
109 (define_attr "op_type"
110 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE"
115 (define_attr "length" ""
116 (cond [ (eq_attr "op_type" "E") (const_int 2)
117 (eq_attr "op_type" "RR") (const_int 2)
118 (eq_attr "op_type" "RX") (const_int 4)
119 (eq_attr "op_type" "RI") (const_int 4)
120 (eq_attr "op_type" "RRE") (const_int 4)
121 (eq_attr "op_type" "RS") (const_int 4)
122 (eq_attr "op_type" "RSI") (const_int 4)
123 (eq_attr "op_type" "RX") (const_int 4)
124 (eq_attr "op_type" "S") (const_int 4)
125 (eq_attr "op_type" "SI") (const_int 4)
126 (eq_attr "op_type" "SS") (const_int 6)
127 (eq_attr "op_type" "SSE") (const_int 6)
128 (eq_attr "op_type" "RXE") (const_int 6)
129 (eq_attr "op_type" "RSE") (const_int 6)
130 (eq_attr "op_type" "RIL") (const_int 6)]
133 ;; Define attributes for `asm' insns.
135 (define_asm_attributes [(set_attr "type" "other")
136 (set_attr "op_type" "NN")])
142 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
143 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
144 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
145 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
146 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
149 ; CCZ1 -> CCA/CCU/CCS/CCT
152 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
153 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
157 ;;- Compare instructions.
160 (define_expand "cmpdi"
162 (compare:CC (match_operand:DI 0 "register_operand" "")
163 (match_operand:DI 1 "general_operand" "")))]
167 s390_compare_op0 = operands[0];
168 s390_compare_op1 = operands[1];
172 (define_expand "cmpsi"
174 (compare:CC (match_operand:SI 0 "register_operand" "")
175 (match_operand:SI 1 "general_operand" "")))]
179 s390_compare_op0 = operands[0];
180 s390_compare_op1 = operands[1];
184 ;(define_expand "cmphi"
186 ; (compare:CC (match_operand:HI 0 "register_operand" "")
187 ; (match_operand:HI 1 "general_operand" "")))]
191 ; s390_compare_op0 = operands[0];
192 ; s390_compare_op1 = operands[1];
196 ;(define_expand "cmpqi"
198 ; (compare:CC (match_operand:QI 0 "register_operand" "")
199 ; (match_operand:QI 1 "general_operand" "")))]
203 ; s390_compare_op0 = operands[0];
204 ; s390_compare_op1 = operands[1];
208 (define_expand "cmpdf"
210 (compare:CC (match_operand:DF 0 "register_operand" "")
211 (match_operand:DF 1 "general_operand" "")))]
215 s390_compare_op0 = operands[0];
216 s390_compare_op1 = operands[1];
220 (define_expand "cmpsf"
222 (compare:CC (match_operand:SF 0 "register_operand" "")
223 (match_operand:SF 1 "general_operand" "")))]
227 s390_compare_op0 = operands[0];
228 s390_compare_op1 = operands[1];
235 (define_insn "*cmpdi_tm2"
237 (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
238 (match_operand:DI 1 "const1_operand" "")
239 (match_operand:DI 2 "immediate_operand" "I"))
241 "s390_match_ccmode(insn, CCTmode) &&
242 INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 64"
245 if (INTVAL (operands[2]) > 47)
247 operands[1] = GEN_INT (1 << (63 - INTVAL(operands[2])));
248 return \"tmll\\t%0,%x1\";
250 else if (INTVAL (operands[2]) > 31)
252 operands[1] = GEN_INT (1 << (47 - INTVAL(operands[2])));
253 return \"tmlh\\t%0,%x1\";
255 else if (INTVAL (operands[2]) > 15)
257 operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2])));
258 return \"tmhl\\t%0,%x1\";
260 operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2])));
261 return \"tmhh\\t%0,%x1\";
263 [(set_attr "op_type" "RX")
264 (set_attr "type" "integer")])
267 (define_insn "*cmpdi_tm"
269 (compare (and:DI (match_operand:DI 0 "register_operand" "%d")
270 (match_operand:DI 1 "tmxx_operand" "Lm"))
272 "s390_match_ccmode(insn, CCTmode)"
275 unsigned HOST_WIDEST_INT i;
276 if (GET_CODE (operands[1]) == MEM &&
277 GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF &&
278 CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0)))
280 operands[1] = get_pool_constant (XEXP (operands[1],0));
283 i = (unsigned HOST_WIDEST_INT) INTVAL (operands[1]);
285 if (i >= 0x1000000000000ULL)
287 operands[1] = GEN_INT (i >> 48);
288 return \"tmhh\\t%0,%x1\";
290 else if (i > 0x100000000ULL)
292 operands[1] = GEN_INT (i >> 32);
293 return \"tmhl\\t%0,%x1\";
295 else if (i >= 0x10000ULL)
297 operands[1] = GEN_INT (i >> 16);
298 return \"tmlh\\t%0,%x1\";
301 return \"tmll\\t%0,%x1\";
303 [(set_attr "op_type" "RX")
304 (set_attr "type" "integer")])
309 (compare (match_operand:DI 0 "register_operand" "d")
310 (match_operand:DI 1 "const0_operand" "")))
311 (set (match_operand:DI 2 "register_operand" "=d")
313 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
315 [(set_attr "op_type" "RRE")
316 (set_attr "type" "integer")])
318 (define_insn "*cmpdi_ccs_0_64"
320 (compare (match_operand:DI 0 "register_operand" "d")
321 (match_operand:DI 1 "const0_operand" "")))]
322 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
324 [(set_attr "op_type" "RRE")
325 (set_attr "type" "integer")])
327 (define_insn "*cmpdi_ccs_0_31"
329 (compare (match_operand:DI 0 "register_operand" "d")
330 (match_operand:DI 1 "const0_operand" "")))]
331 "s390_match_ccmode(insn, CCSmode)"
333 [(set_attr "op_type" "RS")
334 (set_attr "type" "integer")])
336 (define_insn "*cmpdi_ccs"
338 (compare (match_operand:DI 0 "register_operand" "d,d,d")
339 (match_operand:DI 1 "general_operand" "d,K,m")))]
340 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
345 [(set_attr "op_type" "RRE,RI,RXE")
346 (set_attr "atype" "reg,reg,mem")])
348 (define_insn "*cmpdi_ccu"
350 (compare (match_operand:DI 0 "register_operand" "d,d")
351 (match_operand:DI 1 "general_operand" "d,m")))]
352 "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
356 [(set_attr "op_type" "RRE,RXE")
357 (set_attr "atype" "reg,mem")])
359 (define_insn "*cmpdi_ccu_mem"
361 (compare (match_operand:DI 0 "s_operand" "oQ")
362 (match_operand:DI 1 "s_operand" "oQ")))]
363 "s390_match_ccmode(insn, CCUmode)"
364 "clc\\t%O0(8,%R0),%1"
365 [(set_attr "op_type" "SS")
366 (set_attr "atype" "mem")])
370 (define_insn "*cmpsi_cct"
372 (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
373 (match_operand:SI 1 "const1_operand" "")
374 (match_operand:SI 2 "immediate_operand" "I"))
376 "s390_match_ccmode(insn, CCTmode) &&
377 INTVAL(operands[2]) >= 0 && INTVAL(operands[2]) < 32"
380 if (INTVAL (operands[2]) > 15)
382 operands[1] = GEN_INT (1 << (31 - INTVAL(operands[2])));
383 return \"tml\\t%0,%x1\";
385 operands[1] = GEN_INT (1 << (15 - INTVAL(operands[2])));
386 return \"tmh\\t%0,%x1\";
388 [(set_attr "op_type" "RI")])
390 (define_insn "*cmpsi_tm"
392 (compare (and:SI (match_operand:SI 0 "register_operand" "%d")
393 (match_operand:SI 1 "tmxx_operand" "Lm"))
395 "s390_match_ccmode(insn, CCTmode)"
399 if (GET_CODE (operands[1]) == MEM &&
400 GET_CODE (XEXP (operands[1],0)) == SYMBOL_REF &&
401 CONSTANT_POOL_ADDRESS_P (XEXP (operands[1],0)))
403 operands[1] = get_pool_constant (XEXP (operands[1],0));
406 i = (unsigned long) INTVAL (operands[1]);
409 operands[1] = GEN_INT (i / 0x10000);
410 return \"tmh\\t%0,%x1\";
412 return \"tml\\t%0,%x1\";
414 [(set_attr "op_type" "RX")])
418 (compare (match_operand:SI 0 "register_operand" "d")
419 (match_operand:SI 1 "const0_operand" "")))
420 (set (match_operand:SI 2 "register_operand" "=d")
422 "s390_match_ccmode(insn, CCSmode)"
424 [(set_attr "op_type" "RR")])
426 (define_insn "*icm15"
428 (compare (match_operand:SI 0 "s_operand" "Qo")
429 (match_operand:SI 1 "const0_operand" "")))
430 (set (match_operand:SI 2 "register_operand" "=d")
432 "s390_match_ccmode(insn, CCSmode)"
434 [(set_attr "op_type" "RS")
435 (set_attr "atype" "mem")])
437 (define_insn "*icm15_cconly"
439 (compare (match_operand:SI 0 "s_operand" "Qo")
440 (match_operand:SI 1 "const0_operand" "")))
441 (clobber (match_scratch:SI 2 "=d"))]
442 "s390_match_ccmode(insn, CCSmode)"
444 [(set_attr "op_type" "RS")
445 (set_attr "atype" "mem")])
447 (define_insn "*cmpsi_ccs_0"
449 (compare (match_operand:SI 0 "register_operand" "d")
450 (match_operand:SI 1 "const0_operand" "")))]
451 "s390_match_ccmode(insn, CCSmode)"
453 [(set_attr "op_type" "RR")])
455 (define_insn "*cmpsidi_ccs"
457 (compare (match_operand:SI 0 "register_operand" "d")
458 (sign_extend:SI (match_operand:HI 1 "memory_operand" "m"))))]
459 "s390_match_ccmode(insn, CCSmode)"
461 [(set_attr "op_type" "RR")
462 (set_attr "atype" "mem")])
464 (define_insn "*cmpsi_ccs"
466 (compare (match_operand:SI 0 "register_operand" "d,d,d")
467 (match_operand:SI 1 "general_operand" "d,K,m")))]
468 "s390_match_ccmode(insn, CCSmode)"
473 [(set_attr "op_type" "RR,RI,RX")
474 (set_attr "atype" "reg,reg,mem")])
476 (define_insn "*cmpsi_ccu"
478 (compare (match_operand:SI 0 "register_operand" "d,d")
479 (match_operand:SI 1 "general_operand" "d,m")))]
480 "s390_match_ccmode(insn, CCUmode)"
484 [(set_attr "op_type" "RR,RX")
485 (set_attr "atype" "reg,mem")])
487 (define_insn "*cmpsi_ccu_mem"
489 (compare (match_operand:SI 0 "s_operand" "oQ")
490 (match_operand:SI 1 "s_operand" "oQ")))]
491 "s390_match_ccmode(insn, CCUmode)"
492 "clc\\t%O0(4,%R0),%1"
493 [(set_attr "op_type" "SS")
494 (set_attr "atype" "mem")])
500 (compare (match_operand:HI 0 "s_operand" "Qo")
501 (match_operand:HI 1 "const0_operand" "")))
502 (set (match_operand:HI 2 "register_operand" "=d")
504 "s390_match_ccmode(insn, CCSmode)"
506 [(set_attr "op_type" "RS")
507 (set_attr "atype" "mem")])
509 (define_insn "*cmphi_cct_0"
511 (compare (match_operand:HI 0 "register_operand" "d")
512 (match_operand:HI 1 "const0_operand" "")))]
513 "s390_match_ccmode(insn, CCTmode)"
515 [(set_attr "op_type" "RX")])
517 (define_insn "*cmphi_ccs_0"
519 (compare (match_operand:HI 0 "s_operand" "Qo")
520 (match_operand:HI 1 "const0_operand" "")))
521 (clobber (match_scratch:HI 2 "=d"))]
522 "s390_match_ccmode(insn, CCSmode)"
524 [(set_attr "op_type" "RS")
525 (set_attr "atype" "mem")])
527 (define_insn "*cmphi_ccu"
529 (compare (match_operand:HI 0 "register_operand" "d")
530 (match_operand:HI 1 "s_operand" "Qo")))]
531 "s390_match_ccmode(insn, CCUmode)"
533 [(set_attr "op_type" "RS")
534 (set_attr "atype" "mem")])
536 (define_insn "*cmphi_ccu_mem"
538 (compare (match_operand:HI 0 "s_operand" "oQ")
539 (match_operand:HI 1 "s_operand" "oQ")))]
540 "s390_match_ccmode(insn, CCUmode)"
541 "clc\\t%O0(2,%R0),%1"
542 [(set_attr "op_type" "SS")
543 (set_attr "atype" "mem")])
550 (compare (match_operand:QI 0 "s_operand" "Qo")
551 (match_operand:QI 1 "const0_operand" "")))
552 (set (match_operand:QI 2 "register_operand" "=d")
554 "s390_match_ccmode(insn, CCSmode)"
556 [(set_attr "op_type" "RS")
557 (set_attr "atype" "mem")])
561 (compare (zero_extend:SI (and:QI (match_operand:QI 0 "s_operand" "Qo")
562 (match_operand:QI 1 "immediate_operand" "")))
564 "s390_match_ccmode(insn, CCTmode) &&
565 INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256"
567 [(set_attr "op_type" "RI")
568 (set_attr "atype" "mem")])
570 (define_insn "*cmpqi_cct_0"
572 (compare (match_operand:QI 0 "register_operand" "d")
573 (match_operand:QI 1 "const0_operand" "")))]
574 "s390_match_ccmode(insn, CCTmode)"
576 [(set_attr "op_type" "RI")])
578 (define_insn "*cmpqi_ccs_0"
580 (compare (match_operand:QI 0 "s_operand" "Qo")
581 (match_operand:QI 1 "const0_operand" "")))
582 (clobber (match_scratch:QI 2 "=d"))]
583 "s390_match_ccmode(insn, CCSmode)"
585 [(set_attr "op_type" "RS")])
587 (define_insn "*cmpqi_ccu_0"
589 (compare (match_operand:QI 0 "s_operand" "Qo")
590 (match_operand:QI 1 "const0_operand" "")))]
591 "s390_match_ccmode(insn, CCUmode)"
593 [(set_attr "op_type" "SI")
594 (set_attr "atype" "mem")])
596 (define_insn "*cmpqi_ccu"
598 (compare (match_operand:QI 0 "register_operand" "d")
599 (match_operand:QI 1 "s_operand" "Qo")))]
600 "s390_match_ccmode(insn, CCUmode)"
602 [(set_attr "op_type" "RS")
603 (set_attr "atype" "mem")])
605 (define_insn "*cmpqi_ccu_immed"
607 (compare (match_operand:QI 0 "s_operand" "Qo")
608 (match_operand:QI 1 "immediate_operand" "")))]
609 "s390_match_ccmode(insn, CCUmode) &&
610 INTVAL(operands[1]) >= 0 && INTVAL(operands[1]) < 256"
612 [(set_attr "op_type" "SI")
613 (set_attr "atype" "mem")])
615 (define_insn "*cmpqi_ccu_mem"
617 (compare (match_operand:QI 0 "s_operand" "oQ")
618 (match_operand:QI 1 "s_operand" "oQ")))]
619 "s390_match_ccmode(insn, CCUmode)"
620 "clc\\t%O0(1,%R0),%1"
621 [(set_attr "op_type" "SS")
622 (set_attr "atype" "mem")])
627 (define_insn "*cmpdf_ccs_0"
629 (compare (match_operand:DF 0 "register_operand" "f")
630 (match_operand:DF 1 "const0_operand" "")))]
631 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
633 [(set_attr "op_type" "RR")])
635 (define_insn "*cmpdf_ccs_0_ibm"
637 (compare (match_operand:DF 0 "register_operand" "f")
638 (match_operand:DF 1 "const0_operand" "")))]
639 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
641 [(set_attr "op_type" "RR")])
643 (define_insn "*cmpdf_ccs"
645 (compare (match_operand:DF 0 "register_operand" "f,f")
646 (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
647 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
651 [(set_attr "op_type" "RR,RX")
652 (set_attr "atype" "reg,mem")])
654 (define_insn "*cmpdf_ccs_ibm"
656 (compare (match_operand:DF 0 "register_operand" "f,f")
657 (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
658 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
662 [(set_attr "op_type" "RR,RX")
663 (set_attr "atype" "reg,mem")])
668 (define_insn "*cmpsf_ccs_0"
670 (compare (match_operand:SF 0 "register_operand" "f")
671 (match_operand:SF 1 "const0_operand" "")))]
672 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
674 [(set_attr "op_type" "RR")])
676 (define_insn "*cmpsf_ccs_0_ibm"
678 (compare (match_operand:SF 0 "register_operand" "f")
679 (match_operand:SF 1 "const0_operand" "")))]
680 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
682 [(set_attr "op_type" "RR")])
684 (define_insn "*cmpsf_ccs"
686 (compare (match_operand:SF 0 "register_operand" "f,f")
687 (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
688 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
692 [(set_attr "op_type" "RR,RX")
693 (set_attr "atype" "reg,mem")])
695 (define_insn "*cmpsf_ccs"
697 (compare (match_operand:SF 0 "register_operand" "f,f")
698 (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
699 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
703 [(set_attr "op_type" "RR,RX")
704 (set_attr "atype" "reg,mem")])
708 ;;- Move instructions.
712 ; movti instruction pattern(s).
716 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,d,d,m,Q")
717 (match_operand:TI 1 "general_operand" "d,K,m,d,Q"))]
721 switch (which_alternative)
724 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
725 return \"lgr\\t%M0,%M1\;lgr\\t%0,%1\";
727 return \"lgr\\t%0,%1\;lgr\\t%M0,%M1\";
730 if (INTVAL(operands[1]) < 0)
731 return \"lghi\\t%0,-1\;lghi\\t%M0,%h1\";
733 return \"lghi\\t%0,0\;lghi\\t%M0,%h1\";
736 if (s_operand (operands[1], GET_MODE (operands[1])))
737 return \"lmg\\t%0,%M0,%1\";
739 return \"la\\t%M0,%1\;lmg\\t%0,%M0,0(%M0)\";
742 if (!s_operand (operands[0], GET_MODE (operands[0])))
743 return \"stg\\t%1,%0\;stg\\t%M1,%M0\";
745 return \"stmg\\t%1,%M1,%0\";
748 return \"mvc\\t%O0(16,%R0),%1\";
754 [(set_attr "op_type" "NN,NN,RS,RS,SS")
755 (set_attr "atype" "reg,reg,mem,mem,mem")
756 (set_attr "type" "o2")
757 (set_attr "length" "12,8,10,10,*")])
760 ; movdi instruction pattern(s).
763 ;; If generating PIC code and operands[1] is a symbolic CONST, emit a
764 ;; move to get the address of the symbolic object from the GOT.
766 (define_expand "movdi"
767 [(set (match_operand:DI 0 "general_operand" "")
768 (match_operand:DI 1 "general_operand" ""))]
772 if (CONSTANT_P (operands[1])
773 && !LEGITIMATE_CONSTANT_P (operands[1]))
774 operands[1] = force_const_mem (DImode, operands[1]);
776 if (TARGET_64BIT && flag_pic && SYMBOLIC_CONST (operands[1]))
777 emit_pic_move (operands, DImode);
780 (define_insn "*movdi_64"
781 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,m,Q")
782 (match_operand:DI 1 "general_operand" "d,K,S,m,d,Q"))]
791 [(set_attr "op_type" "RRE,RI,RIL,RXE,RXE,SS")
792 (set_attr "type" "integer,integer,la,integer,integer,integer")
793 (set_attr "atype" "reg,reg,reg,mem,mem,mem")])
795 (define_insn "*movdi_31"
796 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,m,Q")
797 (match_operand:DI 1 "general_operand" "d,K,m,d,Q"))]
801 switch (which_alternative)
804 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
805 return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
807 return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
810 if (INTVAL (operands[1]) < 0)
811 return \"lhi\\t%0,-1\;lhi\\t%N0,%h1\";
813 return \"lhi\\t%0,0\;lhi\\t%N0,%h1\";
816 if (s_operand (operands[1], GET_MODE (operands[1])))
817 return \"lm\\t%0,%N0,%1\";
819 return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
822 if (s_operand (operands[0], GET_MODE (operands[0])))
823 return \"stm\\t%1,%N1,%0\";
825 return \"st\\t%1,%0\;st\\t%N1,%N0\";
828 return \"mvc\\t%O0(8,%R0),%1\";
834 [(set_attr "op_type" "NN,NN,RS,RS,SS")
835 (set_attr "atype" "reg,reg,mem,mem,mem")
836 (set_attr "type" "o2")
837 (set_attr "length" "4,8,8,8,*")])
841 ; movsi instruction pattern(s).
844 ;; If generating PIC code and operands[1] is a symbolic CONST, emit a
845 ;; move to get the address of the symbolic object from the GOT.
847 (define_expand "movsi"
848 [(set (match_operand:SI 0 "general_operand" "")
849 (match_operand:SI 1 "general_operand" ""))]
853 if (CONSTANT_P (operands[1])
854 && !LEGITIMATE_CONSTANT_P (operands[1]))
855 operands[1] = force_const_mem (SImode, operands[1]);
857 if (flag_pic && SYMBOLIC_CONST (operands[1]))
858 emit_pic_move (operands, SImode);
860 /* expr.c tries to load an effective address using
861 force_reg. This fails because we don't have a
862 generic load_address pattern. Convert the move
863 to a proper arithmetic operation instead, unless
864 it is guaranteed to be OK. */
865 if (GET_CODE (operands[1]) == PLUS
866 && !legitimate_la_operand_p (operands[1]))
868 operands[1] = force_operand (operands[1], operands[0]);
869 if (operands[1] == operands[0])
874 (define_insn "*movsi"
875 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,m,Q")
876 (match_operand:SI 1 "general_operand" "d,K,m,d,Q"))]
884 [(set_attr "op_type" "RR,RI,RX,RX,SS")
885 (set_attr "type" "lr,*,load,store,store")
886 (set_attr "atype" "reg,reg,mem,mem,mem")])
890 ; movhi instruction pattern(s).
894 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,m")
895 (match_operand:HI 1 "r_or_x_or_im16_operand" "d,K,m,d"))]
902 [(set_attr "op_type" "RR,RI,RX,RX")
903 (set_attr "atype" "reg,reg,mem,mem")])
906 ; movqi instruction pattern(s).
909 (define_insn "movqi_64"
910 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
911 (match_operand:QI 1 "general_operand" "d,K,m,d,n"))]
919 [(set_attr "op_type" "RR,RI,RXE,RX,SI")
920 (set_attr "atype" "reg,reg,mem,mem,mem")])
923 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,m,Q")
924 (match_operand:QI 1 "r_or_x_or_im16_operand" "d,n,m,d,n"))]
932 [(set_attr "op_type" "RR,RX,RX,RX,SI")
933 (set_attr "atype" "reg,reg,mem,mem,mem")])
936 ; moveqstrictqi instruction pattern(s).
939 (define_insn "*movstrictqi"
940 [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+d,m"))
941 (match_operand:QI 1 "nonimmediate_operand" "m,d"))]
946 [(set_attr "op_type" "RX,RX")
947 (set_attr "atype" "mem,mem")])
951 ; movstricthi instruction pattern(s).
954 (define_insn "*movstricthi"
955 [(set (strict_low_part (match_operand:HI 0 "r_or_s_operand" "+d,Q"))
956 (match_operand:HI 1 "r_or_s_operand" "Q,d"))
957 (clobber (reg:CC 33))]
962 [(set_attr "op_type" "RS,RS")
963 (set_attr "atype" "mem")])
967 ; movstrictsi instruction pattern(s).
970 (define_insn "movestrictsi"
971 [(set (strict_low_part (match_operand:SI 0 "nonimmediate_operand" "+d,d,m"))
972 (match_operand:SI 1 "nonimmediate_operand" "d,m,d"))]
978 [(set_attr "op_type" "RR,RS,RS")
979 (set_attr "atype" "reg,mem,mem")])
983 ; movdf instruction pattern(s).
986 (define_expand "movdf"
987 [(set (match_operand:DF 0 "nonimmediate_operand" "")
988 (match_operand:DF 1 "general_operand" ""))]
992 if (GET_CODE (operands[1]) == CONST_DOUBLE)
993 operands[1] = force_const_mem (DFmode, operands[1]);
996 (define_insn "*movdf_64"
997 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
998 (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))]
999 "TARGET_64BIT && TARGET_HARD_FLOAT"
1007 mvc\\t%O0(8,%R0),%1"
1008 [(set_attr "op_type" "RR,RX,RX,RXE,RXE,RR,SS")
1009 (set_attr "atype" "reg,mem,mem,mem,mem,mem,mem")])
1011 (define_insn "*movdf_31"
1012 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
1013 (match_operand:DF 1 "general_operand" "f,m,f,m,d,d,Q"))]
1017 switch (which_alternative)
1019 case 0: /* f <- f */
1020 return \"ldr\\t%0,%1\";
1022 case 1: /* f <- m */
1023 return \"ld\\t%0,%1\";
1025 case 2: /* m <- f */
1026 return \"std\\t%1,%0\";
1028 case 3: /* d <- m */
1029 if (s_operand (operands[1], GET_MODE (operands[1])))
1030 return \"lm\\t%0,%N0,%1\";
1032 return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
1034 case 4: /* m <- d */
1035 if (s_operand (operands[0], GET_MODE (operands[0])))
1036 return \"stm\\t%1,%N1,%0\";
1038 return \"st\\t%1,%0\;st\\t%N1,%N0\";
1040 case 5: /* d <- d */
1041 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
1042 return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
1044 return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
1046 case 6: /* m <- m */
1047 return \"mvc\\t%O0(8,%R0),%1\";
1053 [(set_attr "op_type" "RR,RX,RX,RS,RS,NN,SS")
1054 (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")
1055 (set_attr "length" "*,*,*,*,*,4,*")])
1057 (define_insn "*movdf_soft_64"
1058 [(set (match_operand:DF 0 "nonimmediate_operand" "=d,m,d,Q")
1059 (match_operand:DF 1 "general_operand" "m,d,d,Q"))]
1060 "TARGET_64BIT && TARGET_SOFT_FLOAT"
1065 mvc\\t%O0(8,%R0),%1"
1066 [(set_attr "op_type" "RXE,RXE,RR,SS")
1067 (set_attr "atype" "mem,mem,mem,mem")])
1069 (define_insn "*movdf_soft_31"
1070 [(set (match_operand:DF 0 "nonimmediate_operand" "=!d,d,m,Q")
1071 (match_operand:DF 1 "general_operand" "!d,m,d,Q"))]
1075 switch (which_alternative)
1077 case 0: /* d <- d */
1078 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
1079 return \"lr\\t%N0,%N1\;lr\\t%0,%1\";
1081 return \"lr\\t%0,%1\;lr\\t%N0,%N1\";
1083 case 1: /* d <- m */
1084 if (s_operand (operands[1], GET_MODE (operands[1])))
1085 return \"lm\\t%0,%N0,%1\";
1087 return \"la\\t%N0,%1\;lm\\t%0,%N0,0(%N0)\";
1089 case 2: /* m <- d */
1090 if (s_operand (operands[0], GET_MODE (operands[0])))
1091 return \"stm\\t%1,%N1,%0\";
1093 return \"st\\t%1,%0\;st\\t%N1,%N0\";
1095 case 3: /* m <- m */
1096 return \"mvc\\t%O0(8,%R0),%1\";
1102 [(set_attr "op_type" "NN,RS,RS,SS")
1103 (set_attr "atype" "reg,mem,mem,mem")
1104 (set_attr "length" "8,*,*,*")])
1108 ; movsf instruction pattern(s).
1111 (define_expand "movsf"
1112 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1113 (match_operand:SF 1 "general_operand" ""))]
1117 if (GET_CODE (operands[1]) == CONST_DOUBLE)
1118 operands[1] = force_const_mem (SFmode, operands[1]);
1121 (define_insn "*movsf_64"
1122 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
1123 (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))]
1124 "TARGET_64BIT && TARGET_HARD_FLOAT"
1132 mvc\\t%O0(4,%R0),%1"
1133 [(set_attr "op_type" "RR,RX,RX,RXE,RX,RR,SS")
1134 (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")])
1136 (define_insn "*movsf_31"
1137 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,m,d,m,d,Q")
1138 (match_operand:SF 1 "general_operand" "f,m,f,m,d,d,Q"))]
1147 mvc\\t%O0(4,%R0),%1"
1148 [(set_attr "op_type" "RR,RX,RX,RX,RX,RR,SS")
1149 (set_attr "atype" "reg,mem,mem,mem,mem,reg,mem")])
1151 (define_insn "*movsf_soft"
1152 [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,m,Q")
1153 (match_operand:SF 1 "general_operand" "d,m,d,Q"))]
1159 mvc\\t%O0(4,%R0),%1"
1160 [(set_attr "op_type" "RR,RX,RX,SS")
1161 (set_attr "atype" "reg,mem,mem,mem")])
1163 ; load_multiple pattern(s).
1166 (define_expand "load_multiple"
1167 [(match_par_dup 3 [(set (match_operand 0 "" "")
1168 (match_operand 1 "" ""))
1169 (use (match_operand 2 "" ""))])]
1178 /* Support only loading a constant number of fixed-point registers from
1179 memory and only bother with this if more than two */
1180 if (GET_CODE (operands[2]) != CONST_INT
1181 || INTVAL (operands[2]) <= 2
1182 || INTVAL (operands[2]) > 16
1183 || GET_CODE (operands[1]) != MEM
1184 || GET_CODE (operands[0]) != REG
1185 || REGNO (operands[0]) >= 16)
1188 count = INTVAL (operands[2]);
1189 regno = REGNO (operands[0]);
1191 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1192 from = force_reg (Pmode, XEXP (operands[1], 0));
1194 for (i = 0; i < count; i++)
1195 XVECEXP (operands[3], 0, i)
1196 = gen_rtx_SET (VOIDmode, gen_rtx_REG (Pmode, regno + i),
1197 change_address (operands[1], Pmode,
1198 plus_constant (from, i * 4)));
1201 (define_insn "*load_multiple_di"
1202 [(match_parallel 0 "load_multiple_operation"
1203 [(set (match_operand:DI 1 "register_operand" "=r")
1204 (match_operand:DI 2 "s_operand" "oQ"))])]
1208 int words = XVECLEN (operands[0], 0);
1210 if (XVECLEN (operands[0], 0) == 1)
1211 return \"lg\\t%1,0(%2)\";
1213 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1214 return \"lmg\\t%1,%0,%2\";
1216 [(set_attr "op_type" "RXE")
1217 (set_attr "atype" "mem")])
1219 (define_insn "*load_multiple_si"
1220 [(match_parallel 0 "load_multiple_operation"
1221 [(set (match_operand:SI 1 "register_operand" "=r")
1222 (match_operand:SI 2 "s_operand" "oQ"))])]
1226 int words = XVECLEN (operands[0], 0);
1228 if (XVECLEN (operands[0], 0) == 1)
1229 return \"l\\t%1,0(%2)\";
1231 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1232 return \"lm\\t%1,%0,%2\";
1234 [(set_attr "op_type" "RXE")
1235 (set_attr "atype" "mem")])
1238 ; store multiple pattern(s).
1241 (define_expand "store_multiple"
1242 [(match_par_dup 3 [(set (match_operand 0 "" "")
1243 (match_operand 1 "" ""))
1244 (use (match_operand 2 "" ""))])]
1253 /* Support only storing a constant number of fixed-point registers to
1254 memory and only bother with this if more than two. */
1255 if (GET_CODE (operands[2]) != CONST_INT
1256 || INTVAL (operands[2]) <= 2
1257 || INTVAL (operands[2]) > 16
1258 || GET_CODE (operands[0]) != MEM
1259 || GET_CODE (operands[1]) != REG
1260 || REGNO (operands[1]) >= 16)
1263 count = INTVAL (operands[2]);
1264 regno = REGNO (operands[1]);
1266 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1267 to = force_reg (Pmode, XEXP (operands[0], 0));
1269 for (i = 0; i < count; i++)
1270 XVECEXP (operands[3], 0, i)
1271 = gen_rtx_SET (VOIDmode,
1272 change_address (operands[0], Pmode,
1273 plus_constant (to, i * 4)),
1274 gen_rtx_REG (Pmode, regno + i));
1277 (define_insn "*store_multiple_di"
1278 [(match_parallel 0 "store_multiple_operation"
1279 [(set (match_operand:DI 1 "s_operand" "=oQ")
1280 (match_operand:DI 2 "register_operand" "r"))])]
1284 int words = XVECLEN (operands[0], 0);
1286 if (XVECLEN (operands[0], 0) == 1)
1287 return \"stg\\t%1,0(%2)\";
1289 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1290 return \"stmg\\t%2,%0,%1\";
1292 [(set_attr "op_type" "RXE")
1293 (set_attr "atype" "mem")
1294 (set_attr "type" "other")])
1297 (define_insn "*store_multiple_si"
1298 [(match_parallel 0 "store_multiple_operation"
1299 [(set (match_operand:SI 1 "s_operand" "=oQ")
1300 (match_operand:SI 2 "register_operand" "r"))])]
1304 int words = XVECLEN (operands[0], 0);
1306 if (XVECLEN (operands[0], 0) == 1)
1307 return \"st\\t%1,0(%2)\";
1309 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1310 return \"stm\\t%2,%0,%1\";
1312 [(set_attr "op_type" "RXE")
1313 (set_attr "atype" "mem")
1314 (set_attr "type" "other")])
1317 ;; String instructions.
1321 ; movstrdi instruction pattern(s).
1324 (define_expand "movstrdi"
1325 [(set (match_operand:BLK 0 "general_operand" "")
1326 (match_operand:BLK 1 "general_operand" ""))
1327 (use (match_operand:DI 2 "general_operand" ""))
1328 (match_operand 3 "" "")]
1334 addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX);
1335 addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX);
1337 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256)
1339 operands[0] = change_address (operands[0], VOIDmode, addr0);
1340 operands[1] = change_address (operands[1], VOIDmode, addr1);
1341 operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
1343 emit_insn (gen_movstrsico (operands[0], operands[1], operands[2]));
1350 /* implementation suggested by Richard Henderson <rth@cygnus.com> */
1351 rtx reg0 = gen_reg_rtx (TImode);
1352 rtx reg1 = gen_reg_rtx (TImode);
1353 rtx len = operands[2];
1355 if (! CONSTANT_P (len))
1356 len = force_reg (DImode, len);
1358 /* Load up the address+length pairs. */
1360 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0);
1361 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 8), len);
1363 emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1);
1364 emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 8), len);
1367 emit_insn (gen_movstrdi_64 (reg0, reg1));
1372 rtx label = gen_label_rtx ();
1373 rtx reg0, reg1, len;
1375 reg0 = gen_reg_rtx (DImode);
1376 reg1 = gen_reg_rtx (DImode);
1377 len = gen_reg_rtx (DImode);
1379 emit_move_insn (len, operands[2]);
1380 emit_insn (gen_cmpdi (len, const0_rtx));
1381 emit_jump_insn (gen_beq (label));
1382 emit_move_insn (reg0, addr0);
1383 emit_move_insn (reg1, addr1);
1384 emit_insn (gen_adddi3 (len, len, constm1_rtx));
1385 emit_insn (gen_movstrdix_64 (reg0, reg1, len));
1393 ; movstrsi instruction pattern(s).
1396 (define_expand "movstrsi"
1397 [(set (match_operand:BLK 0 "general_operand" "")
1398 (match_operand:BLK 1 "general_operand" ""))
1399 (use (match_operand:SI 2 "general_operand" ""))
1400 (match_operand 3 "" "")]
1404 rtx addr0 = force_operand (XEXP (operands[0], 0), NULL_RTX);
1405 rtx addr1 = force_operand (XEXP (operands[1], 0), NULL_RTX);
1407 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 256)
1409 operands[0] = change_address (operands[0], VOIDmode, addr0);
1410 operands[1] = change_address (operands[1], VOIDmode, addr1);
1411 operands[2] = GEN_INT (INTVAL (operands[2]) - 1);
1413 emit_insn (gen_movstrsico (operands[0], operands[1], operands[2]));
1423 /* implementation suggested by Richard Henderson <rth@cygnus.com> */
1424 rtx reg0 = gen_reg_rtx (DImode);
1425 rtx reg1 = gen_reg_rtx (DImode);
1426 rtx len = operands[2];
1429 if (! CONSTANT_P (len))
1430 len = force_reg (SImode, len);
1432 /* Load up the address+length pairs. */
1434 emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr0);
1435 emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 4), len);
1437 emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 0), addr1);
1438 emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 4), len);
1441 emit_insn (gen_movstrsi_31 (reg0, reg1));
1446 rtx label = gen_label_rtx ();
1447 rtx reg0, reg1, len;
1449 reg0 = gen_reg_rtx (SImode);
1450 reg1 = gen_reg_rtx (SImode);
1451 len = gen_reg_rtx (SImode);
1453 emit_move_insn (len, operands[2]);
1454 emit_insn (gen_cmpsi (len, const0_rtx));
1455 emit_jump_insn (gen_beq (label));
1456 emit_move_insn (reg0, addr0);
1457 emit_move_insn (reg1, addr1);
1458 emit_insn (gen_addsi3 (len, len, constm1_rtx));
1459 emit_insn (gen_movstrsix_31 (reg0, reg1, len));
1466 ; Move a block that is less than 256 bytes in length.
1468 (define_insn "movstrsico"
1469 [(set (match_operand:BLK 0 "s_operand" "=oQ")
1470 (match_operand:BLK 1 "s_operand" "oQ"))
1471 (use (match_operand 2 "const_int_operand" "I"))]
1472 "((unsigned) INTVAL (operands[2]) < 256)"
1473 "mvc\\t%O0(%c2+1,%R0),%1"
1474 [(set_attr "op_type" "SS")
1475 (set_attr "atype" "mem")])
1477 ; Move a block that is more than 256 bytes in lenght or length in register
1479 (define_insn "movstrdix_64"
1480 [(set (mem:BLK (match_operand:DI 0 "register_operand" "a"))
1481 (mem:BLK (match_operand:DI 1 "register_operand" "a")))
1482 (use (match_operand:DI 2 "register_operand" "a"))
1483 (clobber (match_dup 0))
1484 (clobber (match_dup 1))
1485 (clobber (match_scratch:DI 3 "=&a"))
1486 (clobber (reg:CC 33))]
1491 xop[0] = gen_label_rtx ();
1492 xop[1] = gen_label_rtx ();
1493 xop[2] = gen_label_rtx ();
1494 xop[3] = operands[3];
1495 output_asm_insn (\"srag\\t%3,%2,8\",operands);
1496 output_asm_insn (\"jz\\t%l1\",xop);
1497 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1498 CODE_LABEL_NUMBER (xop[0]));
1499 output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands);
1500 output_asm_insn (\"la\\t%0,256(%0)\",operands);
1501 output_asm_insn (\"la\\t%1,256(%1)\",operands);
1502 xop[3] = operands[3];
1503 output_asm_insn (\"brct\\t%3,%l0\",xop);
1504 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1505 CODE_LABEL_NUMBER (xop[1]));
1506 xop[3] = operands[3];
1507 output_asm_insn (\"bras\\t%3,%l2\",xop);
1508 output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands);
1509 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1510 CODE_LABEL_NUMBER (xop[2]));
1511 return \"ex\\t%2,0(%3)\";
1513 [(set_attr "op_type" "NN")
1514 (set_attr "atype" "mem")
1515 (set_attr "length" "44")])
1517 (define_insn "movstrsix_31"
1518 [(set (mem:BLK (match_operand:SI 0 "register_operand" "a"))
1519 (mem:BLK (match_operand:SI 1 "register_operand" "a")))
1520 (use (match_operand:SI 2 "register_operand" "a"))
1521 (clobber (match_dup 0))
1522 (clobber (match_dup 1))
1523 (clobber (match_scratch:SI 3 "=&a"))
1524 (clobber (reg:CC 33))]
1529 xop[0] = gen_label_rtx ();
1530 xop[1] = gen_label_rtx ();
1531 xop[2] = gen_label_rtx ();
1532 xop[3] = operands[3];
1533 output_asm_insn (\"lr\\t%3,%2\",operands);
1534 output_asm_insn (\"sra\\t%3,8\",operands);
1535 output_asm_insn (\"jz\\t%l1\",xop);
1536 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1537 CODE_LABEL_NUMBER (xop[0]));
1538 output_asm_insn (\"mvc\\t0(256,%0),0(%1)\",operands);
1539 output_asm_insn (\"la\\t%0,256(%0)\",operands);
1540 output_asm_insn (\"la\\t%1,256(%1)\",operands);
1541 xop[3] = operands[3];
1542 output_asm_insn (\"brct\\t%3,%l0\",xop);
1543 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1544 CODE_LABEL_NUMBER (xop[1]));
1545 xop[3] = operands[3];
1546 output_asm_insn (\"bras\\t%3,%l2\",xop);
1547 output_asm_insn (\"mvc\\t0(1,%0),0(%1)\",operands);
1548 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
1549 CODE_LABEL_NUMBER (xop[2]));
1550 return \"ex\\t%2,0(%3)\";
1552 [(set_attr "op_type" "NN")
1553 (set_attr "length" "42")
1554 (set_attr "atype" "mem")])
1556 ; Move a block that is larger than 255 bytes in length.
1558 (define_insn "movstrdi_64"
1559 [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
1560 (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0)))
1561 (clobber (match_dup 0))
1562 (clobber (match_dup 1))
1563 (clobber (reg:CC 33))]
1565 "mvcle\\t%0,%1,0\;jo\\t.-4"
1566 [(set_attr "op_type" "NN")
1567 (set_attr "atype" "mem")
1568 (set_attr "length" "8")])
1570 (define_insn "movstrsi_31"
1571 [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
1572 (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0)))
1573 (clobber (match_dup 0))
1574 (clobber (match_dup 1))
1575 (clobber (reg:CC 33))]
1577 "mvcle\\t%0,%1,0\;jo\\t.-4"
1578 [(set_attr "op_type" "NN")
1579 (set_attr "atype" "mem")
1580 (set_attr "length" "8")])
1583 ; clrstrdi instruction pattern(s).
1586 (define_expand "clrstrdi"
1587 [(set (match_operand:BLK 0 "general_operand" "")
1589 (use (match_operand:DI 1 "general_operand" ""))
1590 (match_operand 2 "" "")]
1594 rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX);
1596 operands[0] = change_address (operands[0], VOIDmode, addr);
1598 if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256)
1600 emit_insn (gen_clrstrsico (operands[0], operands[1]));
1605 rtx reg0 = gen_reg_rtx (TImode);
1606 rtx reg1 = gen_reg_rtx (TImode);
1607 rtx len = operands[1];
1609 if (! CONSTANT_P (len))
1610 len = force_reg (DImode, len);
1612 /* Load up the address+length pairs. */
1614 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr);
1615 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 8), len);
1617 emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 8), const0_rtx);
1620 emit_insn (gen_clrstrsi_64 (reg0, reg1));
1626 ; clrstrsi instruction pattern(s).
1629 (define_expand "clrstrsi"
1630 [(set (match_operand:BLK 0 "general_operand" "")
1632 (use (match_operand:SI 1 "general_operand" ""))
1633 (match_operand 2 "" "")]
1637 rtx addr = force_operand (XEXP (operands[0], 0), NULL_RTX);
1639 operands[0] = change_address (operands[0], VOIDmode, addr);
1641 if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 256)
1643 emit_insn (gen_clrstrsico (operands[0], operands[1]));
1648 rtx reg0 = gen_reg_rtx (DImode);
1649 rtx reg1 = gen_reg_rtx (DImode);
1650 rtx len = operands[1];
1652 if (! CONSTANT_P (len))
1653 len = force_reg (SImode, len);
1655 /* Load up the address+length pairs. */
1657 emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 0), addr);
1658 emit_move_insn (gen_rtx_SUBREG (SImode, reg0, 4), len);
1660 emit_move_insn (gen_rtx_SUBREG (SImode, reg1, 4), const0_rtx);
1663 emit_insn (gen_clrstrsi_31 (reg0, reg1));
1668 ; Clear memory with length less than 256 bytes
1670 (define_insn "clrstrsico"
1671 [(set (match_operand:BLK 0 "s_operand" "=Qo")
1673 (use (match_operand 1 "immediate_operand" "I"))
1674 (clobber (reg:CC 33))]
1676 "xc\\t%O0(%1,%R0),%0"
1677 [(set_attr "op_type" "RS")
1678 (set_attr "atype" "mem")])
1680 ; Clear memory with length greater 256 bytes or lenght not constant
1682 (define_insn "clrstrsi_64"
1683 [(set (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
1685 (use (match_operand:TI 1 "register_operand" "d"))
1686 (clobber (match_dup 0))
1687 (clobber (match_dup 1))
1688 (clobber (reg:CC 33))]
1690 "mvcle\\t%0,%1,0\;jo\\t.-4"
1691 [(set_attr "op_type" "NN")
1692 (set_attr "atype" "mem")
1693 (set_attr "type" "other")
1694 (set_attr "length" "8")])
1696 (define_insn "clrstrsi_31"
1697 [(set (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
1699 (use (match_operand:DI 1 "register_operand" "d"))
1700 (clobber (match_dup 0))
1701 (clobber (match_dup 1))
1702 (clobber (reg:CC 33))]
1704 "mvcle\\t%0,%1,0\;jo\\t.-4"
1705 [(set_attr "op_type" "NN")
1706 (set_attr "atype" "mem")
1707 (set_attr "type" "other")
1708 (set_attr "length" "8")])
1711 ; cmpstrdi instruction pattern(s).
1714 (define_expand "cmpstrdi"
1715 [(set (match_operand:DI 0 "register_operand" "")
1716 (compare:DI (match_operand:BLK 1 "s_operand" "")
1717 (match_operand:BLK 2 "s_operand" "") ) )
1718 (use (match_operand:DI 3 "general_operand" ""))
1719 (use (match_operand:DI 4 "" ""))]
1725 /* for pre/post increment */
1726 operands[1] = protect_from_queue (operands[1], 0);
1727 operands[2] = protect_from_queue (operands[2], 0);
1728 operands[3] = protect_from_queue (operands[3], 0);
1730 addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX);
1731 addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX);
1733 if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256)
1735 if (INTVAL (operands[3]) == 0) {
1736 emit_move_insn (operands[0], operands[3]);
1740 operands[1] = change_address (operands[1], VOIDmode, addr0);
1741 operands[2] = change_address (operands[2], VOIDmode, addr1);
1743 emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3]));
1744 emit_insn (gen_cmpint_di (operands[0]));
1749 /* implementation suggested by Richard Henderson <rth@cygnus.com> */
1750 rtx reg0 = gen_reg_rtx (TImode);
1751 rtx reg1 = gen_reg_rtx (TImode);
1752 rtx len = operands[3];
1754 if (! CONSTANT_P (len))
1755 len = force_reg (DImode, len);
1757 /* Load up the address+length pairs. */
1758 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 0), addr0);
1759 emit_move_insn (gen_rtx_SUBREG (DImode, reg0, 8), len);
1761 emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 0), addr1);
1762 emit_move_insn (gen_rtx_SUBREG (DImode, reg1, 8), len);
1765 emit_insn (gen_cmpstr_64 (reg0, reg1));
1766 emit_insn (gen_cmpint_di (operands[0]));
1772 ; cmpstrsi instruction pattern(s).
1775 (define_expand "cmpstrsi"
1776 [(set (match_operand:SI 0 "register_operand" "")
1777 (compare:SI (match_operand:BLK 1 "s_operand" "")
1778 (match_operand:BLK 2 "s_operand" "") ) )
1779 (use (match_operand:SI 3 "general_operand" ""))
1780 (use (match_operand:SI 4 "" ""))]
1786 /* for pre/post increment */
1787 operands[1] = protect_from_queue (operands[1], 0);
1788 operands[2] = protect_from_queue (operands[2], 0);
1789 operands[3] = protect_from_queue (operands[3], 0);
1791 addr0 = force_operand (XEXP (operands[1], 0), NULL_RTX);
1792 addr1 = force_operand (XEXP (operands[2], 0), NULL_RTX);
1794 if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) < 256)
1796 if (INTVAL (operands[3]) == 0) {
1797 emit_move_insn (operands[0], operands[3]);
1801 operands[1] = change_address (operands[1], VOIDmode, addr0);
1802 operands[2] = change_address (operands[2], VOIDmode, addr1);
1804 emit_insn (gen_cmpstr_const (operands[1], operands[2], operands[3]));
1805 emit_insn (gen_cmpint_si (operands[0]));
1810 /* implementation suggested by Richard Henderson <rth@cygnus.com> */
1812 rtx len = operands[3];
1816 reg0 = gen_reg_rtx (TImode);
1817 reg1 = gen_reg_rtx (TImode);
1821 reg0 = gen_reg_rtx (DImode);
1822 reg1 = gen_reg_rtx (DImode);
1825 if (! CONSTANT_P (len))
1826 len = force_reg (Pmode, len);
1828 /* Load up the address+length pairs. */
1829 emit_move_insn (gen_rtx_SUBREG (Pmode, reg0, 0), addr0);
1830 emit_move_insn (gen_rtx_SUBREG (Pmode, reg0,
1831 GET_MODE_SIZE (Pmode)), len);
1833 emit_move_insn (gen_rtx_SUBREG (Pmode, reg1, 0), addr1);
1834 emit_move_insn (gen_rtx_SUBREG (Pmode, reg1,
1835 GET_MODE_SIZE (Pmode)), len);
1839 emit_insn (gen_cmpstr_64 (reg0, reg1));
1841 emit_insn (gen_cmpstr_31 (reg0, reg1));
1843 emit_insn (gen_cmpint_si (operands[0]));
1848 ; Compare a block that is less than 256 bytes in length.
1850 (define_insn "cmpstr_const"
1852 (compare:CCS (match_operand:BLK 0 "s_operand" "oQ")
1853 (match_operand:BLK 1 "s_operand" "oQ")))
1854 (use (match_operand 2 "immediate_operand" "I"))]
1855 "(unsigned) INTVAL (operands[2]) < 256"
1856 "clc\\t%O0(%c2,%R0),%1"
1857 [(set_attr "op_type" "SS")
1858 (set_attr "atype" "mem")
1859 (set_attr "type" "other")])
1861 ; Compare a block that is larger than 255 bytes in length.
1863 (define_insn "cmpstr_64"
1865 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 0 "register_operand" "d") 0))
1866 (mem:BLK (subreg:DI (match_operand:TI 1 "register_operand" "d") 0))))
1867 (clobber (subreg:DI (match_dup 0) 0))
1868 (clobber (subreg:DI (match_dup 0) 8))
1869 (clobber (subreg:DI (match_dup 1) 0))
1870 (clobber (subreg:DI (match_dup 1) 8))]
1873 [(set_attr "op_type" "RR")
1874 (set_attr "atype" "mem")
1875 (set_attr "type" "other")])
1877 (define_insn "cmpstr_31"
1879 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 0 "register_operand" "d") 0))
1880 (mem:BLK (subreg:SI (match_operand:DI 1 "register_operand" "d") 0))))
1881 (clobber (subreg:SI (match_dup 0) 0))
1882 (clobber (subreg:SI (match_dup 0) 4))
1883 (clobber (subreg:SI (match_dup 1) 0))
1884 (clobber (subreg:SI (match_dup 1) 4))]
1887 [(set_attr "op_type" "RR")
1888 (set_attr "atype" "mem")
1889 (set_attr "type" "other")])
1891 ; Convert condition code to integer in range (-1, 0, 1)
1893 (define_insn "cmpint_si"
1894 [(set (match_operand:SI 0 "register_operand" "=d")
1895 (compare:SI (reg:CCS 33) (const_int 0)))]
1899 output_asm_insn (\"lhi\\t%0,1\", operands);
1900 output_asm_insn (\"jh\\t.+12\", operands);
1901 output_asm_insn (\"jl\\t.+6\", operands);
1902 output_asm_insn (\"sr\\t%0,%0\", operands);
1903 return \"lcr\\t%0,%0\";
1905 [(set_attr "op_type" "NN")
1906 (set_attr "length" "16")
1907 (set_attr "atype" "reg")
1908 (set_attr "type" "other")])
1910 (define_insn "cmpint_di"
1911 [(set (match_operand:DI 0 "register_operand" "=d")
1912 (compare:DI (reg:CCS 33) (const_int 0)))]
1916 output_asm_insn (\"lghi\\t%0,1\", operands);
1917 output_asm_insn (\"jh\\t.+12\", operands);
1918 output_asm_insn (\"jl\\t.+6\", operands);
1919 output_asm_insn (\"sgr\\t%0,%0\", operands);
1920 return \"lcgr\\t%0,%0\";
1922 [(set_attr "op_type" "NN")
1923 (set_attr "length" "22")
1924 (set_attr "atype" "reg")
1925 (set_attr "type" "other")])
1928 ;;- Conversion instructions.
1932 ; extendsidi2 instruction pattern(s).
1935 (define_insn "extendsidi2"
1936 [(set (match_operand:DI 0 "register_operand" "=d,d")
1937 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
1942 [(set_attr "op_type" "RRE,RXE")
1943 (set_attr "atype" "reg,mem")])
1947 ; extendhidi2 instruction pattern(s).
1950 (define_insn "extendhidi2"
1951 [(set (match_operand:DI 0 "register_operand" "=d")
1952 (sign_extend:DI (match_operand:HI 1 "register_operand" "d")))
1953 (clobber (reg:CC 33))]
1955 "sllg\\t%0,%1,48\;srag\\t%0,%0,48"
1956 [(set_attr "op_type" "NN")
1957 (set_attr "length" "12")
1958 (set_attr "type" "o2")])
1961 ; extendqidi2 instruction pattern(s).
1964 (define_insn "extendqidi2"
1965 [(set (match_operand:DI 0 "register_operand" "=d")
1966 (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))
1967 (clobber (reg:CC 33))]
1969 "sllg\\t%0,%1,56\;srag\\t%0,%0,56"
1970 [(set_attr "op_type" "NN")
1971 (set_attr "length" "12")
1972 (set_attr "type" "o2")])
1975 ; extendhisi2 instruction pattern(s).
1978 (define_insn "extendhisi2"
1979 [(set (match_operand:SI 0 "register_operand" "=d,!d,d")
1980 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,d,m")))
1981 (clobber (reg:CC 33))]
1984 sll\\t%1,16\;sra\\t%1,16
1985 lr\\t%0,%1\;sll\\t%0,16\;sra\\t%0,16
1987 [(set_attr "op_type" "NN,NN,RX")
1988 (set_attr "type" "o2,o3,integer")
1989 (set_attr "atype" "reg,reg,mem")
1990 (set_attr "length" "8,10,*")])
1994 ; extendqisi2 instruction pattern(s).
1997 (define_insn "extendqisi2"
1998 [(set (match_operand:SI 0 "register_operand" "=d,d")
1999 (sign_extend:SI (match_operand:QI 1 "r_or_s_operand" "0,Q")))
2000 (clobber (reg:CC 33))]
2003 sll\\t%0,24\;sra\\t%0,24
2004 icm\\t%0,8,%1\;sra\\t%0,24"
2005 [(set_attr "op_type" "NN,NN")
2006 (set_attr "type" "o2")
2007 (set_attr "atype" "reg,mem")
2008 (set_attr "length" "8,8")])
2012 ; extendqihi2 instruction pattern(s).
2015 (define_insn "extendqihi2"
2016 [(set (match_operand:HI 0 "register_operand" "=d,d")
2017 (sign_extend:HI (match_operand:QI 1 "r_or_s_operand" "0,Q")))
2018 (clobber (reg:CC 33))]
2021 sll\\t%0,24\;sra\\t%0,24
2022 icm\\t%0,8,%1\;sra\\t%0,24"
2023 [(set_attr "op_type" "NN,NN")
2024 (set_attr "type" "o2")
2025 (set_attr "atype" "reg,mem")
2026 (set_attr "length" "8,8")])
2030 ; zero_extendsidi2 instruction pattern(s).
2033 (define_insn "zero_extendsidi2"
2034 [(set (match_operand:DI 0 "register_operand" "=d,d")
2035 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2040 [(set_attr "op_type" "RRE,RXE")
2041 (set_attr "atype" "reg,mem")])
2045 ; zero_extendhidi2 instruction pattern(s).
2048 (define_insn "zero_extendhidi2"
2049 [(set (match_operand:DI 0 "register_operand" "=!d,d")
2050 (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,m")))]
2053 llgfr\\t%0,%1\;iilh\\t%0,0
2055 [(set_attr "op_type" "NN,RXE")
2056 (set_attr "type" "o2,integer")
2057 (set_attr "atype" "reg,mem")
2058 (set_attr "length" "12,*")])
2061 ; zero_extendqidi2 instruction pattern(s)
2064 (define_insn "zero_extendqidi2"
2065 [(set (match_operand:DI 0 "register_operand" "=!d,d")
2066 (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "d,m")))
2067 (clobber (reg:CC 33))]
2070 sllg\\t%0,%1,56\;srlg\\t%0,%0,56
2072 [(set_attr "op_type" "NN,RXE")
2073 (set_attr "type" "o2,integer")
2074 (set_attr "atype" "reg,mem")
2075 (set_attr "length" "12,*")])
2079 ; zero_extendhisi2 instruction pattern(s).
2082 (define_expand "zero_extendhisi2"
2083 [(set (match_operand:SI 0 "register_operand" "")
2084 (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "")))]
2090 emit_insn (gen_zero_extendhisi2_31 (operands[0], operands[1],
2091 force_const_mem (SImode, const0_rtx)));
2096 (define_insn "*zero_extendhisi2_64"
2097 [(set (match_operand:SI 0 "register_operand" "=d,d")
2098 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,m")))]
2103 [(set_attr "op_type" "RI,RXE")
2104 (set_attr "atype" "reg,mem")])
2106 (define_insn "zero_extendhisi2_31"
2107 [(set (match_operand:SI 0 "register_operand" "=d,d")
2108 (zero_extend:SI (match_operand:HI 1 "r_or_s_operand" "0,Q")))
2109 (use (match_operand:SI 2 "memory_operand" "m,m"))
2110 (clobber (reg:CC 33))]
2114 icm\\t%0,12,%1\;srl\\t%0,16"
2115 [(set_attr "op_type" "RX,NN")
2116 (set_attr "type" "integer,o2")
2117 (set_attr "atype" "reg,mem")
2118 (set_attr "length" "*,8")])
2122 ; zero_extendqisi2 instruction pattern(s).
2125 (define_insn "*zero_extendqisi2_mem_31"
2126 [(set (match_operand:SI 0 "register_operand" "=&d")
2127 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))
2128 (use (match_operand:SI 2 "memory_operand" "m" ))
2129 (clobber (reg:CC 33))]
2131 "sr\\t%0,%0\;ic\\t%0,%1"
2132 [(set_attr "op_type" "NN")
2133 (set_attr "type" "o2")
2134 (set_attr "atype" "mem")
2135 (set_attr "length" "6")])
2137 (define_insn "zero_extendqisi2_reg_31"
2138 [(set (match_operand:SI 0 "register_operand" "=d")
2139 (zero_extend:SI (match_operand:QI 1 "register_operand" "0")))
2140 (use (match_operand:SI 2 "memory_operand" "m" ))
2141 (clobber (reg:CC 33))]
2144 [(set_attr "op_type" "RX")
2145 (set_attr "atype" "mem")])
2147 (define_insn "*zero_extendqisi2_64"
2148 [(set (match_operand:SI 0 "register_operand" "=!d,d")
2149 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "d,m")))]
2152 sllg\\t%0,%1,56\;srlg\\t%0,%0,56
2154 [(set_attr "op_type" "NN,RXE")
2155 (set_attr "type" "o2,integer")
2156 (set_attr "atype" "reg,mem")
2157 (set_attr "length" "12,*")])
2159 (define_expand "zero_extendqisi2"
2160 [(set (match_operand:SI 0 "register_operand" "")
2161 (zero_extend:SI (match_operand:QI 1 "r_or_s_operand" "")))]
2167 emit_insn (gen_zero_extendqisi2_reg_31 (operands[0], operands[1],
2168 force_const_mem (SImode, const0_rtx)));
2175 ; zero_extendqihi2 instruction pattern(s).
2178 (define_insn "zero_extendqihi2_64"
2179 [(set (match_operand:HI 0 "register_operand" "=d,d")
2180 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m")))
2181 (clobber (reg:CC 33))]
2186 [(set_attr "op_type" "RI,RXE")
2187 (set_attr "atype" "reg,mem")])
2189 (define_insn "zero_extendqihi2_31"
2190 [(set (match_operand:HI 0 "register_operand" "=d,&d")
2191 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,m")))
2192 (use (match_operand:SI 2 "memory_operand" "m,m"))
2193 (clobber (reg:CC 33))]
2197 sr\\t%0,%0\;ic\\t%0,%1"
2198 [(set_attr "op_type" "RX,NN")
2199 (set_attr "atype" "reg,mem")
2200 (set_attr "length" "*,8")])
2202 (define_expand "zero_extendqihi2"
2203 [(set (match_operand:HI 0 "register_operand" "")
2204 (zero_extend:HI (match_operand:QI 1 "general_operand" "")))]
2210 emit_insn (gen_zero_extendqihi2_31 (operands[0], operands[1],
2211 force_const_mem (SImode, const0_rtx)));
2216 emit_insn (gen_zero_extendqihi2_64 (operands[0], operands[1]));
2223 ; truncdisi2 instruction pattern(s).
2226 (define_insn "truncdisi2"
2227 [(set (match_operand:SI 0 "register_operand" "=d")
2228 (truncate:SI (match_operand:DI 1 "register_operand" "d")))]
2231 [(set_attr "op_type" "RRE")])
2235 ; truncdihi2 instruction pattern(s).
2238 (define_insn "truncdihi2"
2239 [(set (match_operand:HI 0 "register_operand" "=d")
2240 (truncate:HI (match_operand:DI 1 "register_operand" "d")))]
2242 "llgfr\\t%0,%1\;iilh\\t%0,0"
2243 [(set_attr "op_type" "NN")
2244 (set_attr "length" "10")])
2248 ; truncdiqi2 instruction pattern(s).
2251 (define_insn "truncdiqi2"
2252 [(set (match_operand:QI 0 "register_operand" "=d")
2253 (truncate:QI (match_operand:DI 1 "register_operand" "d")))
2254 (clobber (reg:CC 33))]
2256 "sllg\\t%0,%1,56\;srlg\\t%0,%0,56"
2257 [(set_attr "op_type" "NN")
2258 (set_attr "type" "o2")
2259 (set_attr "length" "12")])
2263 ; truncsihi2 instruction pattern(s).
2266 (define_expand "truncsihi2"
2267 [(set (match_operand:HI 0 "register_operand" "")
2268 (truncate:HI (match_operand:SI 1 "register_operand" "")))]
2274 emit_insn (gen_do_truncsihi2 (operands[0], operands[1],
2275 force_const_mem (SImode, const0_rtx)));
2281 (define_insn "do_truncsihi2"
2282 [(set (match_operand:HI 0 "register_operand" "=d")
2283 (truncate:HI (match_operand:SI 1 "register_operand" "0")))
2284 (use (match_operand:SI 2 "memory_operand" "m"))
2285 (clobber (reg:CC 33))]
2288 [(set_attr "op_type" "RX")])
2290 (define_insn "*truncsihi2_64"
2291 [(set (match_operand:HI 0 "register_operand" "=d")
2292 (truncate:HI (match_operand:SI 1 "register_operand" "0")))]
2295 [(set_attr "op_type" "RI")])
2299 ; truncsiqi2 instruction pattern(s).
2302 (define_insn "truncsiqi2"
2303 [(set (match_operand:QI 0 "register_operand" "=d")
2304 (truncate:QI (match_operand:SI 1 "register_operand" "0")))
2305 (clobber (reg:CC 33))]
2307 "iilh\\t%0,0\;nill\\t%0,0x00FF"
2308 [(set_attr "op_type" "NN")
2309 (set_attr "type" "o2")
2310 (set_attr "length" "8")])
2314 ; trunchiqi2 instruction pattern(s).
2317 (define_insn "trunchiqi2"
2318 [(set (match_operand:QI 0 "register_operand" "=d")
2319 (truncate:QI (match_operand:HI 1 "register_operand" "0")))
2320 (clobber (reg:CC 33))]
2323 [(set_attr "op_type" "RI")])
2327 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2330 (define_expand "fixuns_truncdfdi2"
2331 [(set (match_operand:DI 0 "register_operand" "")
2332 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2333 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2336 rtx label1 = gen_label_rtx ();
2337 rtx label2 = gen_label_rtx ();
2338 rtx temp = gen_reg_rtx (DFmode);
2339 operands[1] = force_reg (DFmode, operands[1]);
2341 emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
2342 CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, DFmode))));
2343 emit_jump_insn (gen_blt (label1));
2345 emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
2346 CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, DFmode))));
2347 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2350 emit_label (label1);
2351 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2352 emit_label (label2);
2356 (define_expand "fix_truncdfdi2"
2357 [(set (match_operand:DI 0 "register_operand" "")
2358 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2359 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2362 operands[1] = force_reg (DFmode, operands[1]);
2363 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2367 (define_insn "fix_truncdfdi2_ieee"
2368 [(set (match_operand:DI 0 "register_operand" "=d")
2369 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2370 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
2371 (clobber (reg:CC 33))]
2372 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2374 [(set_attr "op_type" "RRE")
2375 (set_attr "type" "other")])
2378 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2381 (define_expand "fixuns_truncdfsi2"
2382 [(set (match_operand:SI 0 "register_operand" "")
2383 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2384 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2387 rtx label1 = gen_label_rtx ();
2388 rtx label2 = gen_label_rtx ();
2389 rtx temp = gen_reg_rtx (DFmode);
2391 operands[1] = force_reg (DFmode,operands[1]);
2392 emit_insn (gen_cmpdf (operands[1], force_const_mem (DFmode,
2393 CONST_DOUBLE_FROM_REAL_VALUE (0x80000000ULL, DFmode))));
2394 emit_jump_insn (gen_blt (label1));
2395 emit_insn (gen_subdf3 (temp, operands[1], force_const_mem (DFmode,
2396 CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, DFmode))));
2397 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2400 emit_label (label1);
2401 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2402 emit_label (label2);
2406 (define_expand "fix_truncdfsi2"
2407 [(set (match_operand:SI 0 "register_operand" "")
2408 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2412 if (TARGET_IBM_FLOAT)
2414 /* This is the algorithm from POP chapter A.5.7.2. */
2416 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2417 rtx two31r = force_const_mem (DFmode,
2418 gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
2419 0x08000000, 0x4F000000));
2420 rtx two32 = force_const_mem (DFmode,
2421 gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
2424 operands[1] = force_reg (DFmode, operands[1]);
2425 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2426 two31r, two32, temp));
2430 operands[1] = force_reg (DFmode, operands[1]);
2431 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2437 (define_insn "fix_truncdfsi2_ieee"
2438 [(set (match_operand:SI 0 "register_operand" "=d")
2439 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2440 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
2441 (clobber (reg:CC 33))]
2442 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2444 [(set_attr "op_type" "RRE")
2445 (set_attr "type" "other" )])
2447 (define_insn "fix_truncdfsi2_ibm"
2448 [(set (match_operand:SI 0 "register_operand" "=d")
2449 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2450 (use (match_operand:DF 2 "memory_operand" "m"))
2451 (use (match_operand:DF 3 "memory_operand" "m"))
2452 (use (match_operand:BLK 4 "memory_operand" "m"))
2453 (clobber (reg:CC 33))]
2454 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2457 output_asm_insn (\"sd\\t%1,%2\", operands);
2458 output_asm_insn (\"aw\\t%1,%3\", operands);
2459 output_asm_insn (\"std\\t%1,%4\", operands);
2460 output_asm_insn (\"xi\\t%N4,128\", operands);
2461 return \"l\\t%0,%N4\";
2463 [(set_attr "op_type" "NN")
2464 (set_attr "type" "other")
2465 (set_attr "length" "20")])
2468 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2471 (define_expand "fixuns_truncsfdi2"
2472 [(set (match_operand:DI 0 "register_operand" "")
2473 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2474 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2477 rtx label1 = gen_label_rtx ();
2478 rtx label2 = gen_label_rtx ();
2479 rtx temp = gen_reg_rtx (SFmode);
2481 operands[1] = force_reg (SFmode, operands[1]);
2482 emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
2483 CONST_DOUBLE_FROM_REAL_VALUE (0x8000000000000000ULL, SFmode))));
2484 emit_jump_insn (gen_blt (label1));
2486 emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
2487 CONST_DOUBLE_FROM_REAL_VALUE (0x10000000000000000ULL, SFmode))));
2488 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2491 emit_label (label1);
2492 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2493 emit_label (label2);
2497 (define_expand "fix_truncsfdi2"
2498 [(set (match_operand:DI 0 "register_operand" "")
2499 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2500 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2503 operands[1] = force_reg (SFmode, operands[1]);
2504 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2508 (define_insn "fix_truncsfdi2_ieee"
2509 [(set (match_operand:DI 0 "register_operand" "=d")
2510 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2511 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] 1)
2512 (clobber (reg:CC 33))]
2513 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2515 [(set_attr "op_type" "RRE")
2516 (set_attr "type" "other")])
2519 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2522 (define_expand "fixuns_truncsfsi2"
2523 [(set (match_operand:SI 0 "register_operand" "")
2524 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2525 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2528 rtx label1 = gen_label_rtx ();
2529 rtx label2 = gen_label_rtx ();
2530 rtx temp = gen_reg_rtx (SFmode);
2532 operands[1] = force_reg (SFmode, operands[1]);
2533 emit_insn (gen_cmpsf (operands[1], force_const_mem (SFmode,
2534 CONST_DOUBLE_FROM_REAL_VALUE (0x80000000ULL, SFmode))));
2535 emit_jump_insn (gen_blt (label1));
2536 emit_insn (gen_subsf3 (temp, operands[1], force_const_mem (SFmode,
2537 CONST_DOUBLE_FROM_REAL_VALUE (0x100000000ULL, SFmode))));
2538 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
2541 emit_label (label1);
2542 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2543 emit_label (label2);
2547 (define_expand "fix_truncsfsi2"
2548 [(set (match_operand:SI 0 "register_operand" "")
2549 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
2553 if (TARGET_IBM_FLOAT)
2555 /* Convert to DFmode and then use the POP algorithm. */
2556 rtx temp = gen_reg_rtx (DFmode);
2557 emit_insn (gen_extendsfdf2 (temp, operands[1]));
2558 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
2562 operands[1] = force_reg (SFmode, operands[1]);
2563 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2569 (define_insn "fix_truncsfsi2_ieee"
2570 [(set (match_operand:SI 0 "register_operand" "=d")
2571 (fix:SI (match_operand:SF 1 "register_operand" "f")))
2572 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] 1)
2573 (clobber (reg:CC 33))]
2574 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2576 [(set_attr "op_type" "RRE")
2577 (set_attr "type" "other")])
2580 ; floatdidf2 instruction pattern(s).
2583 (define_insn "floatdidf2"
2584 [(set (match_operand:DF 0 "register_operand" "=f")
2585 (float:DF (match_operand:DI 1 "register_operand" "d")))]
2586 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2588 [(set_attr "op_type" "RRE")
2589 (set_attr "type" "other" )])
2592 ; floatdisf2 instruction pattern(s).
2595 (define_insn "floatdisf2"
2596 [(set (match_operand:SF 0 "register_operand" "=f")
2597 (float:SF (match_operand:DI 1 "register_operand" "d")))]
2598 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2600 [(set_attr "op_type" "RRE")
2601 (set_attr "type" "other" )])
2604 ; floatsidf2 instruction pattern(s).
2607 (define_expand "floatsidf2"
2608 [(set (match_operand:DF 0 "register_operand" "")
2609 (float:DF (match_operand:SI 1 "register_operand" "")))]
2613 if (TARGET_IBM_FLOAT)
2615 /* This is the algorithm from POP chapter A.5.7.1. */
2617 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2618 rtx two31 = force_const_mem (DFmode,
2619 gen_rtx (CONST_DOUBLE, VOIDmode, cc0_rtx,
2620 0x80000000U, 0x4E000000U));
2622 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
2627 (define_insn "floatsidf2_ieee"
2628 [(set (match_operand:DF 0 "register_operand" "=f")
2629 (float:DF (match_operand:SI 1 "register_operand" "d")))]
2630 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2632 [(set_attr "op_type" "RRE")
2633 (set_attr "type" "other" )])
2635 (define_insn "floatsidf2_ibm"
2636 [(set (match_operand:DF 0 "register_operand" "=f")
2637 (float:DF (match_operand:SI 1 "register_operand" "d")))
2638 (use (match_operand:DF 2 "memory_operand" "m"))
2639 (use (match_operand:BLK 3 "memory_operand" "m"))
2640 (clobber (reg:CC 33))]
2641 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2644 output_asm_insn (\"st\\t%0,%N3\", operands);
2645 output_asm_insn (\"xi\\t%N3,128\", operands);
2646 output_asm_insn (\"mvc\\t%O3(4,%R3),%2\", operands);
2647 output_asm_insn (\"ld\\t%0,%3\", operands);
2648 return \"sd\\t%0,%2\";
2650 [(set_attr "op_type" "NN")
2651 (set_attr "type" "other" )
2652 (set_attr "length" "20")])
2655 ; floatsisf2 instruction pattern(s).
2658 (define_expand "floatsisf2"
2659 [(set (match_operand:SF 0 "register_operand" "")
2660 (float:SF (match_operand:SI 1 "register_operand" "")))]
2664 if (TARGET_IBM_FLOAT)
2666 /* Use the POP algorithm to convert to DFmode and then truncate. */
2667 rtx temp = gen_reg_rtx (DFmode);
2668 emit_insn (gen_floatsidf2 (temp, operands[1]));
2669 emit_insn (gen_truncdfsf2 (operands[0], temp));
2674 (define_insn "floatsisf2_ieee"
2675 [(set (match_operand:SF 0 "register_operand" "=f")
2676 (float:SF (match_operand:SI 1 "register_operand" "d")))]
2677 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2679 [(set_attr "op_type" "RRE")
2680 (set_attr "type" "other" )])
2683 ; truncdfsf2 instruction pattern(s).
2686 (define_expand "truncdfsf2"
2687 [(set (match_operand:SF 0 "register_operand" "")
2688 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
2692 if (CONSTANT_P(operands[1]))
2693 operands[1] = force_const_mem (DFmode, operands[1]);
2696 (define_insn "truncdfsf2_ieee"
2697 [(set (match_operand:SF 0 "register_operand" "=f")
2698 (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f")))]
2699 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2701 [(set_attr "op_type" "RR")])
2703 (define_insn "truncdfsf2_ibm"
2704 [(set (match_operand:SF 0 "register_operand" "=f,f")
2705 (float_truncate:SF (match_operand:DF 1 "nonimmediate_operand" "f,m")))]
2706 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2710 [(set_attr "op_type" "RR,RX")])
2713 ; extendsfdf2 instruction pattern(s).
2716 (define_expand "extendsfdf2"
2717 [(set (match_operand:DF 0 "register_operand" "")
2718 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
2722 if (TARGET_IBM_FLOAT)
2724 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
2729 (define_insn "extendsfdf2_ieee"
2730 [(set (match_operand:DF 0 "register_operand" "=f,f")
2731 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
2732 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2736 [(set_attr "op_type" "RRE,RXE")])
2738 (define_insn "extendsfdf2_ibm"
2739 [(set (match_operand:DF 0 "register_operand" "=f,f")
2740 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))
2741 (clobber (reg:CC 33))]
2742 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2744 sdr\\t%0,%0\;ler\\t%0,%1
2745 sdr\\t%0,%0\;le\\t%0,%1"
2746 [(set_attr "op_type" "RRE,RXE")])
2750 ;; ARITHMETRIC OPERATIONS
2752 ; arithmetric operations set the ConditionCode,
2753 ; because of unpredictable Bits in Register for Halfword and Byte
2754 ; the ConditionCode can be set wrong in operations for Halfword and Byte
2757 ;;- Add instructions.
2761 ; adddi3 instruction pattern(s).
2764 (define_insn "addaddr_esame"
2765 [(set (match_operand:DI 0 "register_operand" "=a,a")
2766 (plus:DI (match_operand:DI 1 "register_operand" "%a,a")
2767 (match_operand:DI 2 "nonmemory_operand" "J,a")))]
2768 "TARGET_64BIT && (((REGNO (operands[1]) == STACK_POINTER_REGNUM ) ||
2769 (REGNO (operands[1]) == BASE_REGISTER)) &&
2770 (GET_CODE (operands[2]) == REG ||
2771 CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))"
2775 [(set_attr "op_type" "RX")
2776 (set_attr "atype" "mem")
2777 (set_attr "type" "la")])
2779 (define_insn "adddi3_64"
2780 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
2781 (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0")
2782 (match_operand:DI 2 "general_operand" "d,K,m") ) )
2783 (clobber (reg:CC 33))]
2789 [(set_attr "op_type" "RRE,RI,RXE")
2790 (set_attr "atype" "reg,reg,mem")])
2793 ; For weakness of reload, need (set (reg x) (plus (reg y) (reg x)))
2796 (define_insn "adddi3_inv_64"
2797 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
2798 (plus:DI (match_operand:DI 1 "general_operand" "%d,K,m")
2799 (match_operand:DI 2 "register_operand" "0,0,0") ) )
2800 (clobber (reg:CC 33))]
2806 [(set_attr "op_type" "RRE,RI,RXE")
2807 (set_attr "atype" "reg,reg,mem")])
2809 (define_insn "adddi3_31"
2810 [(set (match_operand:DI 0 "register_operand" "=d,d")
2811 (plus:DI (match_operand:DI 1 "register_operand" "0,0")
2812 (match_operand:DI 2 "general_operand" "d,m") ) )
2813 (clobber (reg:CC 33))]
2817 switch(which_alternative)
2819 case 0: /* d <- d */
2820 output_asm_insn (\"ar\\t%0,%2\", operands);
2821 output_asm_insn (\"alr\\t%N0,%N2\", operands);
2824 case 1: /* d <- m */
2825 output_asm_insn (\"a\\t%0,%2\", operands);
2826 output_asm_insn (\"al\\t%N0,%N2\", operands);
2830 output_asm_insn (\"brc\\t12,.+8\", operands);
2831 return \"ahi\\t%0,1\";
2833 [(set_attr "op_type" "NN,NN")
2834 (set_attr "atype" "reg,mem")
2835 (set_attr "length" "12,16")])
2837 (define_expand "adddi3"
2838 [(set (match_operand:DI 0 "register_operand" "")
2839 (plus:DI (match_operand:DI 1 "register_operand" "")
2840 (match_operand:DI 2 "general_operand" "")))]
2845 emit_insn(gen_adddi3_64 (operands[0],operands[1],operands[2]));
2847 emit_insn(gen_adddi3_31 (operands[0],operands[1],operands[2]));
2851 (define_insn "reload_load_address"
2852 [(set (match_operand:DI 0 "register_operand" "=a")
2853 (match_operand:QI 1 "address_operand" "p"))]
2856 [(set_attr "op_type" "RX")
2857 (set_attr "atype" "mem")
2858 (set_attr "type" "la")])
2860 (define_insn "*reload_load_address_reg_0"
2861 [(set (match_operand:DI 0 "register_operand" "=d")
2862 (plus:DI (match_operand:DI 1 "register_operand" "%0")
2863 (match_operand:DI 2 "register_operand" "d")))]
2866 [(set_attr "op_type" "RIE")
2867 (set_attr "atype" "reg")])
2869 (define_insn "*reload_la_64"
2870 [(set (match_operand:DI 0 "register_operand" "=d")
2871 (plus:DI (match_operand:DI 1 "general_operand" "g")
2872 (match_operand:DI 2 "general_operand" "g")))]
2873 "TARGET_64BIT && reload_in_progress"
2877 [(set (match_operand:DI 0 "register_operand" "")
2878 (plus:DI (match_operand:DI 1 "general_operand" "")
2879 (match_operand:DI 2 "register_operand" "")))]
2880 "TARGET_64BIT && reload_completed
2881 && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode)
2882 && !rtx_equal_p (operands[0], operands[1])
2883 && !rtx_equal_p (operands[0], operands[2])"
2884 [(set (match_dup 0) (match_dup 1))
2885 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 2)))]
2889 [(set (match_operand:DI 0 "register_operand" "")
2890 (plus:DI (match_operand:DI 1 "register_operand" "")
2891 (match_operand:DI 2 "general_operand" "")))]
2892 "TARGET_64BIT && reload_completed
2893 && !address_operand (gen_rtx_PLUS (DImode, operands[1], operands[2]), QImode)
2894 && !rtx_equal_p (operands[0], operands[1])
2895 && !rtx_equal_p (operands[0], operands[2])"
2896 [(set (match_dup 0) (match_dup 2))
2897 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 1)))]
2901 ; addsi3 instruction pattern(s).
2903 ; The following insn is used when it is known that operand one is the stack pointer,
2904 ; and operand two is small enough to fit in the displacement field
2905 ; In this case, the result will be an address
2908 (define_insn "addaddr"
2909 [(set (match_operand:SI 0 "register_operand" "=d,d")
2910 (plus:SI (match_operand:SI 1 "register_operand" "%a,a")
2911 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
2912 "(((REGNO (operands[1]) == STACK_POINTER_REGNUM ) ||
2913 (REGNO (operands[1]) == BASE_REGISTER)) &&
2914 (GET_CODE (operands[2]) == REG ||
2915 CONST_OK_FOR_LETTER_P (INTVAL (operands[2]),'J')))"
2919 [(set_attr "op_type" "RX")
2920 (set_attr "atype" "mem")
2921 (set_attr "type" "la")])
2923 (define_insn "*addsi3_cc"
2925 (compare (plus:SI (match_operand:SI 1 "register_operand" "%0,0")
2926 (match_operand:SI 2 "nonimmediate_operand" "d,m"))
2928 (set (match_operand:SI 0 "register_operand" "=d,d")
2929 (plus:SI (match_dup 1) (match_dup 2)))]
2930 "s390_match_ccmode(insn, CCLmode)"
2934 [(set_attr "op_type" "RR,RX")
2935 (set_attr "atype" "reg,mem")])
2937 (define_insn "*addsi3_cconly"
2939 (compare (plus:SI (match_operand:SI 1 "register_operand" "%0,0")
2940 (match_operand:SI 2 "general_operand" "d,m"))
2942 (clobber (match_scratch:SI 0 "=d,d"))]
2943 "s390_match_ccmode(insn, CCLmode)"
2947 [(set_attr "op_type" "RR,RX")
2948 (set_attr "atype" "reg,mem")])
2950 (define_insn "*addsi3_cconly2"
2952 (compare (match_operand:SI 1 "register_operand" "%0,0")
2953 (neg:SI (match_operand:SI 2 "general_operand" "d,m"))))
2954 (clobber (match_scratch:SI 0 "=d,d"))]
2955 "s390_match_ccmode(insn, CCLmode)"
2959 [(set_attr "op_type" "RR,RX")
2960 (set_attr "atype" "reg,mem")])
2962 (define_insn "addsi3"
2963 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
2964 (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0")
2965 (match_operand:SI 2 "general_operand" "d,K,m")))
2966 (clobber (reg:CC 33))]
2972 [(set_attr "op_type" "RR,RI,RX")
2973 (set_attr "atype" "reg,reg,mem")])
2975 (define_insn "*do_la"
2976 [(set (match_operand:SI 0 "register_operand" "=a")
2977 (match_operand:QI 1 "address_operand" "p"))]
2978 "reload_in_progress || reload_completed
2979 || legitimate_la_operand_p (operands[1])"
2981 [(set_attr "op_type" "RX")
2982 (set_attr "atype" "mem")
2983 (set_attr "type" "la")])
2985 (define_insn "*do_la_reg_0"
2986 [(set (match_operand:SI 0 "register_operand" "=d")
2987 (plus:SI (match_operand:SI 1 "register_operand" "%0")
2988 (match_operand:SI 2 "register_operand" "d")))]
2989 "reload_in_progress || reload_completed"
2991 [(set_attr "op_type" "RSI")
2992 (set_attr "atype" "reg")])
2994 (define_insn "*reload_la_31"
2995 [(set (match_operand:SI 0 "register_operand" "=d")
2996 (plus:SI (match_operand:SI 1 "general_operand" "g")
2997 (match_operand:SI 2 "general_operand" "g")))]
2998 "reload_in_progress"
3002 [(set (match_operand:SI 0 "register_operand" "")
3003 (plus:SI (match_operand:SI 1 "general_operand" "")
3004 (match_operand:SI 2 "register_operand" "")))]
3006 && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode)
3007 && !rtx_equal_p (operands[0], operands[1])
3008 && !rtx_equal_p (operands[0], operands[2])"
3009 [(set (match_dup 0) (match_dup 1))
3010 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 2)))]
3014 [(set (match_operand:SI 0 "register_operand" "")
3015 (plus:SI (match_operand:SI 1 "register_operand" "")
3016 (match_operand:SI 2 "general_operand" "")))]
3018 && !address_operand (gen_rtx_PLUS (SImode, operands[1], operands[2]), QImode)
3019 && !rtx_equal_p (operands[0], operands[1])
3020 && !rtx_equal_p (operands[0], operands[2])"
3021 [(set (match_dup 0) (match_dup 2))
3022 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))]
3025 (define_insn "addsi_64"
3026 [(set (match_operand:SI 0 "register_operand" "=d,d")
3027 (plus:SI (match_operand:SI 1 "register_operand" "%a,a")
3028 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
3033 [(set_attr "op_type" "RX")
3034 (set_attr "atype" "mem")
3035 (set_attr "type" "la")])
3038 ; addhi3 instruction pattern(s).
3041 (define_insn "addhi3"
3042 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
3043 (plus:HI (match_operand:HI 1 "register_operand" "%0,0,0")
3044 (match_operand:HI 2 "general_operand" "d,K,m")))
3045 (clobber (reg:CC 33))]
3051 [(set_attr "op_type" "RR,RI,RX")
3052 (set_attr "atype" "reg,reg,mem")])
3056 ; addqi3 instruction pattern(s).
3059 (define_insn "addqi3"
3060 [(set (match_operand:QI 0 "register_operand" "=d,d")
3061 (plus:QI (match_operand:QI 1 "register_operand" "%0,0")
3062 (match_operand:QI 2 "general_operand" "a,n")))
3063 (clobber (reg:CC 33))]
3068 [(set_attr "op_type" "RX,RX")
3069 (set_attr "atype" "reg,mem")])
3073 ; adddf3 instruction pattern(s).
3076 (define_expand "adddf3"
3078 [(set (match_operand:DF 0 "register_operand" "=f,f")
3079 (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
3080 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3081 (clobber (reg:CC 33))])]
3085 (define_insn "*adddf3"
3086 [(set (match_operand:DF 0 "register_operand" "=f,f")
3087 (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
3088 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3089 (clobber (reg:CC 33))]
3090 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3094 [(set_attr "op_type" "RR,RX")
3095 (set_attr "atype" "reg,mem")])
3097 (define_insn "*adddf3_ibm"
3098 [(set (match_operand:DF 0 "register_operand" "=f,f")
3099 (plus:DF (match_operand:DF 1 "register_operand" "%0,0")
3100 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3101 (clobber (reg:CC 33))]
3102 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3106 [(set_attr "op_type" "RR,RX")
3107 (set_attr "atype" "reg,mem")])
3110 ; addsf3 instruction pattern(s).
3113 (define_expand "addsf3"
3115 [(set (match_operand:SF 0 "register_operand" "=f,f")
3116 (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
3117 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3118 (clobber (reg:CC 33))])]
3122 (define_insn "*addsf3"
3123 [(set (match_operand:SF 0 "register_operand" "=f,f")
3124 (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
3125 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3126 (clobber (reg:CC 33))]
3127 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3131 [(set_attr "op_type" "RR,RX")
3132 (set_attr "atype" "reg,mem")])
3134 (define_insn "*addsf3"
3135 [(set (match_operand:SF 0 "register_operand" "=f,f")
3136 (plus:SF (match_operand:SF 1 "register_operand" "%0,0")
3137 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3138 (clobber (reg:CC 33))]
3139 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3143 [(set_attr "op_type" "RR,RX")
3144 (set_attr "atype" "reg,mem")])
3148 ;;- Subtract instructions.
3152 ; subdi3 instruction pattern(s).
3155 (define_insn "*subdi3_64"
3156 [(set (match_operand:DI 0 "register_operand" "=d,d")
3157 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3158 (match_operand:DI 2 "general_operand" "d,m") ) )
3159 (clobber (reg:CC 33))]
3164 [(set_attr "op_type" "RRE,RRE")
3165 (set_attr "atype" "reg,mem")])
3167 (define_insn "subdi3"
3168 [(set (match_operand:DI 0 "register_operand" "=d,d")
3169 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3170 (match_operand:DI 2 "nonimmediate_operand" "d,m")))
3171 (clobber (reg:CC 33))]
3175 switch (which_alternative)
3177 case 0: /* d <- d */
3178 output_asm_insn (\"sr\\t%0,%2\", operands);
3179 output_asm_insn (\"slr\\t%N0,%N2\", operands);
3181 case 1: /* d <- m */
3182 output_asm_insn (\"s\\t%0,%2\", operands);
3183 output_asm_insn (\"sl\\t%N0,%N2\", operands);
3187 output_asm_insn (\"brc\\t11,.+8\", operands);
3188 return \"ahi\\t%0,-1\";
3190 [(set_attr "op_type" "NN,NN")
3191 (set_attr "atype" "reg,mem")
3192 (set_attr "length" "12,16")])
3195 ; subsi3 instruction pattern(s).
3198 (define_insn "*subsi3_cc"
3200 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3201 (match_operand:SI 2 "general_operand" "d,m"))
3203 (set (match_operand:SI 0 "register_operand" "=d,d")
3204 (minus:SI (match_dup 1) (match_dup 2)))]
3205 "s390_match_ccmode(insn, CCLmode)"
3209 [(set_attr "op_type" "RR,RX")
3210 (set_attr "atype" "reg,mem")])
3212 (define_insn "*subsi3_cconly"
3214 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3215 (match_operand:SI 2 "general_operand" "d,m"))
3217 (clobber (match_scratch:SI 0 "=d,d"))]
3218 "s390_match_ccmode(insn, CCLmode)"
3222 [(set_attr "op_type" "RR,RX")
3223 (set_attr "atype" "reg,mem")])
3225 (define_insn "subsi3"
3226 [(set (match_operand:SI 0 "register_operand" "=d,d")
3227 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3228 (match_operand:SI 2 "general_operand" "d,m")))
3229 (clobber (reg:CC 33))]
3234 [(set_attr "op_type" "RR,RX")
3235 (set_attr "atype" "reg,mem")])
3238 ; subhi3 instruction pattern(s).
3241 (define_insn "subhi3"
3242 [(set (match_operand:HI 0 "register_operand" "=d,d,d")
3243 (minus:HI (match_operand:HI 1 "register_operand" "0,0,0")
3244 (match_operand:HI 2 "nonimmediate_operand" "d,K,m")))
3245 (clobber (reg:CC 33))]
3251 [(set_attr "op_type" "RR,RI,RX")
3252 (set_attr "atype" "reg,reg,mem")])
3255 ; subqi3 instruction pattern(s).
3258 (define_insn "subqi3"
3259 [(set (match_operand:QI 0 "register_operand" "=d")
3260 (minus:QI (match_operand:QI 1 "register_operand" "0")
3261 (match_operand:QI 2 "register_operand" "d")))
3262 (clobber (reg:CC 33))]
3265 [(set_attr "op_type" "RR")])
3268 ; subdf3 instruction pattern(s).
3271 (define_expand "subdf3"
3273 [(set (match_operand:DF 0 "register_operand" "=f,f")
3274 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3275 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3276 (clobber (reg:CC 33))])]
3280 (define_insn "*subdf3"
3281 [(set (match_operand:DF 0 "register_operand" "=f,f")
3282 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3283 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3284 (clobber (reg:CC 33))]
3285 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3289 [(set_attr "op_type" "RR,RX")
3290 (set_attr "atype" "reg,mem")])
3292 (define_insn "*subdf3_ibm"
3293 [(set (match_operand:DF 0 "register_operand" "=f,f")
3294 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3295 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3296 (clobber (reg:CC 33))]
3297 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3301 [(set_attr "op_type" "RR,RX")
3302 (set_attr "atype" "reg,mem")])
3305 ; subsf3 instruction pattern(s).
3308 (define_expand "subsf3"
3310 [(set (match_operand:SF 0 "register_operand" "=f,f")
3311 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3312 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3313 (clobber (reg:CC 33))])]
3317 (define_insn "*subsf3"
3318 [(set (match_operand:SF 0 "register_operand" "=f,f")
3319 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3320 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3321 (clobber (reg:CC 33))]
3322 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3326 [(set_attr "op_type" "RR,RX")
3327 (set_attr "atype" "reg,mem")])
3329 (define_insn "*subsf3_ibm"
3330 [(set (match_operand:SF 0 "register_operand" "=f,f")
3331 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3332 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3333 (clobber (reg:CC 33))]
3334 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3338 [(set_attr "op_type" "RR,RX")
3339 (set_attr "atype" "reg,mem")])
3343 ;;- Multiply instructions.
3346 (define_expand "muldi3"
3348 [(set (match_operand:DI 0 "register_operand" "")
3349 (mult:DI (match_operand:DI 1 "register_operand" "")
3350 (match_operand:DI 2 "register_operand" "")))
3351 (clobber (reg:CC 33))])]
3357 rtx label1 = gen_label_rtx ();
3358 rtx label2 = gen_label_rtx ();
3359 rtx op0_0 = operand_subword (operands[0], 0 ,1, DImode);
3360 rtx op0_1 = operand_subword (operands[0], 1 ,1, DImode);
3361 rtx temp1_0 = gen_reg_rtx (SImode);
3362 rtx temp1_1 = gen_reg_rtx (SImode);
3363 rtx temp2_0 = gen_reg_rtx (SImode);
3364 rtx temp2_1 = gen_reg_rtx (SImode);
3366 emit_move_insn (temp1_0, operand_subword (operands[1], 0 ,1, DImode));
3367 emit_move_insn (temp1_1, operand_subword (operands[1], 1 ,1, DImode));
3368 emit_move_insn (temp2_0, operand_subword (operands[2], 0 ,1, DImode));
3369 emit_move_insn (temp2_1, operand_subword (operands[2], 1 ,1, DImode));
3370 emit_move_insn (op0_1, temp1_1);
3371 emit_insn (gen_mulsi_6432 (operands[0], operands[0], temp2_1));
3373 emit_insn (gen_cmpsi (temp1_1, const0_rtx));
3374 emit_jump_insn (gen_bge (label1));
3375 emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1));
3376 emit_label (label1);
3377 emit_insn (gen_cmpsi (temp2_1, const0_rtx));
3378 emit_jump_insn (gen_bge (label2));
3379 emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1));
3380 emit_label (label2);
3382 emit_insn (gen_mulsi3 (temp2_1, temp2_1, temp1_0));
3383 emit_insn (gen_addsi3 (op0_0, op0_0, temp2_1));
3385 emit_insn (gen_mulsi3 (temp1_1, temp1_1, temp2_0));
3386 emit_insn (gen_addsi3 (op0_0, op0_0, temp1_1));
3392 (define_insn "*muldi3_64"
3393 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3394 (mult:DI (match_operand:DI 1 "register_operand" "%0,0,0")
3395 (match_operand:DI 2 "general_operand" "d,K,m")))
3396 (clobber (reg:CC 33))]
3402 [(set_attr "op_type" "RRE,RI,RX")
3403 (set_attr "atype" "reg,reg,mem")
3404 (set_attr "type" "imul")])
3407 ; mulsidi3 instruction pattern(s).
3410 ;(define_expand "mulsidi3"
3411 ; [(set (match_operand:DI 0 "register_operand" "")
3412 ; (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" ""))
3413 ; (sign_extend:DI (match_operand:SI 2 "general_operand" ""))))]
3417 ; emit_insn (gen_extendsidi2 (operands[0], operands[1]));
3418 ; emit_insn (gen_muldisidi3 (operands[0], operands[0], operands[2]));
3422 ;(define_insn "muldisidi3"
3423 ; [(set (match_operand:DI 0 "register_operand" "=d,d")
3424 ; (mult:DI (match_operand:DI 1 "register_operand" "0,0")
3425 ; (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3426 ; (clobber (reg:CC 33))]
3431 ; [(set_attr "op_type" "RR,RX")
3432 ; (set_attr "atype" "reg,mem")
3433 ; (set_attr "type" "imul")])
3436 ; mulsi3 instruction pattern(s).
3439 (define_insn "mulsi3"
3440 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
3441 (mult:SI (match_operand:SI 1 "register_operand" "%0,0,0")
3442 (match_operand:SI 2 "general_operand" "d,K,m")))
3443 (clobber (reg:CC 33))]
3449 [(set_attr "op_type" "RRE,RI,RX")
3450 (set_attr "atype" "reg,reg,mem")
3451 (set_attr "type" "imul")])
3453 (define_insn "mulsi_6432"
3454 [(set (match_operand:DI 0 "register_operand" "=d,d")
3455 (mult:DI (sign_extend:DI
3456 (subreg:SI (match_operand:DI 1 "register_operand" "0,0") 4))
3458 (match_operand:SI 2 "general_operand" "d,m"))))
3459 (clobber (reg:CC 33))]
3464 [(set_attr "op_type" "RR,RX")
3465 (set_attr "atype" "reg,mem")
3466 (set_attr "type" "imul")])
3470 ; muldf3 instruction pattern(s).
3473 (define_expand "muldf3"
3475 [(set (match_operand:DF 0 "register_operand" "=f,f")
3476 (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
3477 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3478 (clobber (reg:CC 33))])]
3482 (define_insn "*muldf3"
3483 [(set (match_operand:DF 0 "register_operand" "=f,f")
3484 (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
3485 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3486 (clobber (reg:CC 33))]
3487 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3491 [(set_attr "op_type" "RR,RX")
3492 (set_attr "type" "fmul")
3493 (set_attr "atype" "reg,mem")])
3495 (define_insn "*muldf3_ibm"
3496 [(set (match_operand:DF 0 "register_operand" "=f,f")
3497 (mult:DF (match_operand:DF 1 "register_operand" "%0,0")
3498 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3499 (clobber (reg:CC 33))]
3500 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3504 [(set_attr "op_type" "RR,RX")
3505 (set_attr "type" "fmul")
3506 (set_attr "atype" "reg,mem")])
3509 ; mulsf3 instruction pattern(s).
3512 (define_expand "mulsf3"
3514 [(set (match_operand:SF 0 "register_operand" "=f,f")
3515 (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
3516 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3517 (clobber (reg:CC 33))])]
3521 (define_insn "*mulsf3"
3522 [(set (match_operand:SF 0 "register_operand" "=f,f")
3523 (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
3524 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3525 (clobber (reg:CC 33))]
3526 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3530 [(set_attr "op_type" "RR,RX")
3531 (set_attr "type" "fmul")
3532 (set_attr "atype" "reg,mem")])
3534 (define_insn "*mulsf3_ibm"
3535 [(set (match_operand:SF 0 "register_operand" "=f,f")
3536 (mult:SF (match_operand:SF 1 "register_operand" "%0,0")
3537 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3538 (clobber (reg:CC 33))]
3539 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3543 [(set_attr "op_type" "RR,RX")
3544 (set_attr "type" "fmul")
3545 (set_attr "atype" "reg,mem")])
3549 ;;- Divide and modulo instructions.
3553 ; divdi3 and moddi3 instruction pattern(s).
3556 (define_expand "divdi3"
3557 [(set (match_operand:DI 0 "register_operand" "=d")
3558 (div:DI (match_operand:DI 1 "register_operand" "d")
3559 (match_operand:DI 2 "general_operand" "")))]
3563 rtx op3 = gen_reg_rtx (TImode);
3565 if (CONSTANT_P (operands[2]))
3566 operands[2] = force_const_mem (DImode, operands[2]);
3568 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 0), const0_rtx);
3569 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 8), operands[1]);
3570 emit_insn (gen_divmodtidi3 (op3, op3, operands[2]));
3571 emit_move_insn (operands[0], gen_rtx_SUBREG (DImode, op3, 8));
3575 (define_expand "moddi3"
3576 [(set (match_operand:DI 0 "register_operand" "=d")
3577 (mod:DI (match_operand:DI 1 "register_operand" "d")
3578 (match_operand:DI 2 "general_operand" "")))]
3582 rtx op3 = gen_reg_rtx (TImode);
3584 if (CONSTANT_P (operands[2]))
3585 operands[2] = force_const_mem (DImode, operands[2]);
3587 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 0), const0_rtx);
3588 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 8), operands[1]);
3589 emit_insn (gen_divmodtidi3 (op3, op3, operands[2]));
3590 emit_move_insn (operands[0], gen_rtx_SUBREG (DImode, op3, 0));
3594 (define_insn "divmodtidi3"
3595 [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0)
3597 (mod:TI (match_operand:TI 1 "register_operand" "0,0")
3599 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
3600 (set (subreg:DI (match_dup 0) 8)
3601 (truncate:DI (div:TI (match_dup 1) (sign_extend:TI (match_dup 2)))))
3602 (clobber (reg:CC 33))]
3607 [(set_attr "op_type" "RRE,RXE")
3608 (set_attr "type" "idiv")
3609 (set_attr "atype" "reg,mem")])
3612 ; udivdi3 and umoddi3 instruction pattern(s).
3615 (define_expand "udivdi3"
3616 [(set (match_operand:DI 0 "register_operand" "=d")
3617 (udiv:DI (match_operand:DI 1 "register_operand" "d")
3618 (match_operand:DI 2 "general_operand" "")))]
3622 rtx op3 = gen_reg_rtx(TImode);
3624 if (CONSTANT_P (operands[2]))
3625 operands[2] = force_const_mem (DImode, operands[2]);
3627 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 0), const0_rtx);
3628 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 8), operands[1]);
3629 emit_insn (gen_udivmodtidi3 (op3, op3, operands[2]));
3630 emit_move_insn (operands[0], gen_rtx_SUBREG (DImode, op3, 8));
3634 (define_expand "umoddi3"
3635 [(set (match_operand:DI 0 "register_operand" "=d")
3636 (umod:DI (match_operand:DI 1 "register_operand" "d")
3637 (match_operand:DI 2 "general_operand" "")))]
3641 rtx op3 = gen_reg_rtx (TImode);
3643 if (CONSTANT_P (operands[2]))
3644 operands[2] = force_const_mem (DImode, operands[2]);
3646 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 0), const0_rtx);
3647 emit_move_insn (gen_rtx_SUBREG (DImode, op3, 8), operands[1]);
3648 emit_insn (gen_udivmodtidi3 (op3, op3, operands[2]));
3649 emit_move_insn (operands[0], gen_rtx_SUBREG (DImode, op3, 0));
3653 (define_insn "udivmodtidi3"
3654 [(set (subreg:DI (match_operand:TI 0 "register_operand" "=d,d") 0)
3656 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
3658 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
3659 (set (subreg:DI (match_dup 0) 8)
3660 (truncate:DI (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))
3661 (clobber (reg:CC 33))]
3666 [(set_attr "op_type" "RRE,RXE")
3667 (set_attr "type" "idiv")
3668 (set_attr "atype" "reg,mem")])
3671 ; divsi3 and modsi3 instruction pattern(s).
3674 (define_expand "divsi3"
3675 [(set (match_operand:SI 0 "register_operand" "=d")
3676 (div:SI (match_operand:SI 1 "register_operand" "d")
3677 (match_operand:SI 2 "nonimmediate_operand" "")))]
3681 rtx tmp = gen_reg_rtx (DImode);
3683 if (CONSTANT_P (operands[2]))
3684 operands[2] = force_const_mem (SImode, operands[2]);
3686 operands[2] = force_reg (SImode, operands[2]);
3688 emit_insn (gen_rtx_CLOBBER (SImode, gen_rtx_SUBREG (SImode, tmp, 4)));
3689 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), operands[1]);
3690 emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32)));
3691 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3692 emit_move_insn (operands[0], gen_rtx_SUBREG (SImode, tmp, 4));
3696 (define_expand "modsi3"
3697 [(set (match_operand:SI 0 "register_operand" "=d")
3698 (mod:SI (match_operand:SI 1 "register_operand" "d")
3699 (match_operand:SI 2 "nonimmediate_operand" "")))]
3703 rtx tmp = gen_reg_rtx (DImode);
3705 if (CONSTANT_P (operands[2]))
3706 operands[2] = force_const_mem (SImode, operands[2]);
3708 operands[2] = force_reg (SImode, operands[2]);
3710 emit_insn (gen_rtx_CLOBBER (SImode, gen_rtx_SUBREG (SImode, tmp, 4)));
3711 emit_insn (gen_movsi (gen_rtx_SUBREG (SImode, tmp, 0), operands[1]));
3712 emit_insn (gen_ashrdi3 (tmp, tmp, GEN_INT (32)));
3713 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3714 emit_move_insn (operands[0], gen_rtx_SUBREG (SImode, tmp, 0));
3718 (define_insn "divmoddisi3"
3719 [(set (subreg:SI (match_operand:DI 0 "register_operand" "=d,d") 0)
3721 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
3723 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
3724 (set (subreg:SI (match_dup 0) 4)
3725 (truncate:SI (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))
3726 (clobber (reg:CC 33))]
3731 [(set_attr "op_type" "RR,RX")
3732 (set_attr "type" "idiv")
3733 (set_attr "atype" "reg,mem")])
3736 ; udivsi3 and umodsi3 instruction pattern(s).
3739 (define_expand "udivsi3"
3740 [(set (match_operand:SI 0 "register_operand" "=d")
3741 (udiv:SI (match_operand:SI 1 "general_operand" "")
3742 (match_operand:SI 2 "general_operand" "")))]
3746 rtx dr_0, dr_1, tmp;
3748 tmp = gen_reg_rtx (DImode);
3749 dr_0 = gen_rtx_SUBREG (SImode, tmp, 0);
3750 dr_1 = gen_rtx_SUBREG (SImode, tmp, 4);
3752 if (CONSTANT_P (operands[2]))
3754 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
3756 rtx label1 = gen_label_rtx ();
3758 emit_move_insn (dr_0, operands[1]);
3759 emit_move_insn (dr_1, const0_rtx);
3760 emit_insn (gen_cmpsi (dr_0, operands[2]));
3761 emit_jump_insn (gen_bltu (label1));
3762 emit_move_insn (dr_1, const1_rtx);
3763 emit_label (label1);
3767 operands[2] = force_const_mem (SImode, operands[2]);
3768 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
3769 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 4), operands[1]);
3770 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3775 rtx label1 = gen_label_rtx ();
3776 rtx label2 = gen_label_rtx ();
3777 rtx label3 = gen_label_rtx ();
3779 operands[1] = force_reg (SImode, operands[1]);
3780 operands[2] = force_reg (SImode, operands[2]);
3782 emit_move_insn (dr_1, const0_rtx);
3783 emit_insn (gen_cmpsi (operands[2], operands[1]));
3784 emit_jump_insn (gen_bgtu (label3));
3785 emit_insn (gen_cmpsi (operands[2], const1_rtx));
3786 emit_jump_insn (gen_blt (label2));
3787 emit_insn (gen_cmpsi (operands[2], const1_rtx));
3788 emit_jump_insn (gen_beq (label1));
3789 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
3790 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 4), operands[1]);
3791 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3793 emit_label (label1);
3794 emit_move_insn (dr_1, operands[1]);
3796 emit_label (label2);
3797 emit_move_insn (dr_1, const1_rtx);
3798 emit_label (label3);
3801 emit_move_insn (operands[0], dr_1);
3805 (define_expand "umodsi3"
3806 [(set (match_operand:SI 0 "register_operand" "=d")
3807 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
3808 (match_operand:SI 2 "nonimmediate_operand" "")))]
3812 rtx dr_0, dr_1, tmp;
3814 tmp = gen_reg_rtx (DImode);
3815 dr_0 = gen_rtx_SUBREG (SImode, tmp, 0);
3816 dr_1 = gen_rtx_SUBREG (SImode, tmp, 4);
3818 if (CONSTANT_P (operands[2]))
3820 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
3822 rtx label1 = gen_label_rtx ();
3824 emit_move_insn (dr_0, operands[1]);
3825 emit_insn (gen_cmpsi (dr_0, operands[2]));
3826 emit_jump_insn (gen_bltu (label1));
3827 emit_insn (gen_abssi2 (dr_0, operands[2]));
3828 emit_insn (gen_addsi3 (dr_0,dr_0, operands[1]));
3829 emit_label (label1);
3833 operands[2] = force_const_mem (SImode, operands[2]);
3834 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
3835 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 4), operands[1]);
3836 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3841 rtx label1 = gen_label_rtx ();
3842 rtx label2 = gen_label_rtx ();
3843 rtx label3 = gen_label_rtx ();
3845 operands[1] = force_reg (SImode, operands[1]);
3846 operands[2] = force_reg (SImode, operands[2]);
3848 emit_move_insn(dr_0, operands[1]);
3849 emit_insn (gen_cmpsi (operands[2], dr_0));
3850 emit_jump_insn (gen_bgtu (label3));
3851 emit_insn (gen_cmpsi (operands[2], const1_rtx));
3852 emit_jump_insn (gen_blt (label2));
3853 emit_insn (gen_cmpsi (operands[2], const1_rtx));
3854 emit_jump_insn (gen_beq (label1));
3855 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 0), const0_rtx);
3856 emit_move_insn (gen_rtx_SUBREG (SImode, tmp, 4), operands[1]);
3857 emit_insn (gen_divmoddisi3 (tmp, tmp, operands[2]));
3859 emit_label (label1);
3860 emit_move_insn (dr_0, const0_rtx);
3862 emit_label (label2);
3863 emit_insn (gen_subsi3 (dr_0, dr_0, operands[2]));
3864 emit_label (label3);
3867 emit_move_insn (operands[0], dr_0);
3872 ; divdf3 instruction pattern(s).
3875 (define_expand "divdf3"
3877 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
3878 (div:DF (match_operand:DF 1 "general_operand" "0,0")
3879 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3880 (clobber (reg:CC 33))])]
3884 (define_insn "*divdf3"
3885 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
3886 (div:DF (match_operand:DF 1 "general_operand" "0,0")
3887 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3888 (clobber (reg:CC 33))]
3889 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3893 [(set_attr "op_type" "RR,RX")
3894 (set_attr "type" "fdiv")
3895 (set_attr "atype" "reg,mem")])
3897 (define_insn "*divdf3_ibm"
3898 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f")
3899 (div:DF (match_operand:DF 1 "general_operand" "0,0")
3900 (match_operand:DF 2 "nonimmediate_operand" "f,m")))
3901 (clobber (reg:CC 33))]
3902 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3906 [(set_attr "op_type" "RR,RX")
3907 (set_attr "type" "fdiv")
3908 (set_attr "atype" "reg,mem")])
3911 ; divsf3 instruction pattern(s).
3914 (define_expand "divsf3"
3916 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
3917 (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
3918 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3919 (clobber (reg:CC 33))])]
3923 (define_insn "*divsf3"
3924 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
3925 (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
3926 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3927 (clobber (reg:CC 33))]
3928 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3932 [(set_attr "op_type" "RR,RX")
3933 (set_attr "type" "fdiv")
3934 (set_attr "atype" "reg,mem")])
3936 (define_insn "*divsf3"
3937 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f")
3938 (div:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
3939 (match_operand:SF 2 "nonimmediate_operand" "f,m")))
3940 (clobber (reg:CC 33))]
3941 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3945 [(set_attr "op_type" "RR,RX")
3946 (set_attr "type" "fdiv")
3947 (set_attr "atype" "reg,mem")])
3951 ;;- And instructions.
3955 ; anddi3 instruction pattern(s).
3958 (define_insn "*anddi3_cc"
3960 (compare (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
3961 (match_operand:DI 2 "r_or_s_operand" "d,m,Q"))
3963 (set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
3964 (and:DI (match_dup 1) (match_dup 2)))]
3965 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
3970 [(set_attr "op_type" "RR,RX,SS")
3971 (set_attr "atype" "reg,mem,mem")])
3973 (define_insn "*anddi3_cconly"
3975 (compare (and:DI (match_operand:DI 1 "register_operand" "%0,0")
3976 (match_operand:DI 2 "r_or_s_operand" "d,m"))
3978 (clobber (match_scratch:DI 0 "=d,d"))]
3979 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
3983 [(set_attr "op_type" "RR,RX")
3984 (set_attr "atype" "reg,mem")])
3986 (define_insn "anddi3"
3987 [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
3988 (and:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
3989 (match_operand:DI 2 "r_or_s_operand" "d,m,Q")))
3990 (clobber (reg:CC 33))]
3996 [(set_attr "op_type" "RR,RX,SS")
3997 (set_attr "atype" "reg,mem,mem")])
4000 ; andsi3 instruction pattern(s).
4003 (define_insn "*andsi3_cc"
4005 (compare (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
4006 (match_operand:SI 2 "r_or_s_operand" "d,m,Q"))
4008 (set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
4009 (and:SI (match_dup 1) (match_dup 2)))]
4010 "s390_match_ccmode(insn, CCTmode)"
4015 [(set_attr "op_type" "RR,RX,SS")
4016 (set_attr "atype" "reg,mem,mem")])
4018 (define_insn "*andsi3_cconly"
4020 (compare (and:SI (match_operand:SI 1 "register_operand" "%0,0")
4021 (match_operand:SI 2 "r_or_s_operand" "d,m"))
4023 (clobber (match_scratch:SI 0 "=d,d"))]
4024 "s390_match_ccmode(insn, CCTmode)"
4028 [(set_attr "op_type" "RR,RX")
4029 (set_attr "atype" "reg,mem")])
4031 (define_insn "andsi3"
4032 [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
4033 (and:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
4034 (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
4035 (clobber (reg:CC 33))]
4041 [(set_attr "op_type" "RR,RX,SS")
4042 (set_attr "atype" "reg,mem,mem")])
4045 ; andhi3 instruction pattern(s).
4048 (define_expand "andhi3"
4050 [(set (match_operand:HI 0 "r_or_s_operand" "")
4051 (and:HI (match_operand:HI 1 "r_or_s_operand" "")
4052 (match_operand:HI 2 "r_or_s_operand" "")))
4053 (clobber (reg:CC 33))])]
4057 if (CONSTANT_P (operands[2]))
4058 operands[2] = force_const_mem (HImode, operands[2]);
4061 (define_insn "*andhi3"
4062 [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
4063 (and:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
4064 (match_operand:HI 2 "r_or_s_operand" "d,Q")))
4065 (clobber (reg:CC 33))]
4070 [(set_attr "op_type" "RR,SS")
4071 (set_attr "atype" "reg,mem")])
4074 ; andqi3 instruction pattern(s).
4077 (define_insn "andqi3"
4078 [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
4079 (and:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0")
4080 (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
4081 (clobber (reg:CC 33))]
4087 [(set_attr "op_type" "RR,SI,SS")
4088 (set_attr "atype" "reg,mem,mem")])
4092 ;;- Bit set (inclusive or) instructions.
4096 ; iordi3 instruction pattern(s).
4099 (define_insn "iordi3"
4100 [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q,d")
4101 (ior:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0,0")
4102 (match_operand:DI 2 "r_or_s_operand" "d,m,Q,L")))
4103 (clobber (reg:CC 33))]
4110 [(set_attr "op_type" "RRE,RXE,SS,RI")
4111 (set_attr "atype" "reg,mem,mem,reg")])
4114 ; iorsi3 instruction pattern(s).
4117 (define_expand "iorsi3"
4119 [(set (match_operand:SI 0 "r_or_s_operand" "")
4120 (ior:SI (match_operand:SI 1 "r_or_s_operand" "")
4121 (match_operand:SI 2 "r_or_s_operand" "")))
4122 (clobber (reg:CC 33))])]
4126 if (CONSTANT_P (operands[2]))
4127 operands[2] = force_const_mem (SImode, operands[2]);
4130 (define_insn "*iorsi3"
4131 [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
4132 (ior:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
4133 (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
4134 (clobber (reg:CC 33))]
4140 [(set_attr "op_type" "RR,RX,SS")
4141 (set_attr "atype" "reg,mem,mem")])
4144 ; iorhi3 instruction pattern(s).
4147 (define_expand "iorhi3"
4149 [(set (match_operand:HI 0 "r_or_s_operand" "")
4150 (ior:HI (match_operand:HI 1 "r_or_s_operand" "")
4151 (match_operand:HI 2 "r_or_s_operand" "")))
4152 (clobber (reg:CC 33))])]
4156 if (CONSTANT_P (operands[2]))
4157 operands[2] = force_const_mem (HImode, operands[2]);
4160 (define_insn "*iorhi3"
4161 [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
4162 (ior:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
4163 (match_operand:HI 2 "r_or_s_operand" "d,Q")))
4164 (clobber (reg:CC 33))]
4169 [(set_attr "op_type" "RR,SS")
4170 (set_attr "atype" "reg,mem")])
4173 ; iorqi3 instruction pattern(s).
4176 (define_insn "iorqi3"
4177 [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
4178 (ior:QI (match_operand:QI 1 "r_or_s_operand" "%0,0,0")
4179 (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
4180 (clobber (reg:CC 33))]
4186 [(set_attr "op_type" "RR,SI,SS")
4187 (set_attr "atype" "reg,mem,mem")])
4191 ;;- Xor instructions.
4195 ; xordi3 instruction pattern(s).
4198 (define_insn "xordi3"
4199 [(set (match_operand:DI 0 "r_or_s_operand" "=d,d,Q")
4200 (xor:DI (match_operand:DI 1 "r_or_s_operand" "%0,0,0")
4201 (match_operand:DI 2 "r_or_s_operand" "d,m,Q")))
4202 (clobber (reg:CC 33))]
4208 [(set_attr "op_type" "RRE,RXE,SS")
4209 (set_attr "atype" "reg,mem,mem")])
4212 ; xorsi3 instruction pattern(s).
4215 (define_expand "xorsi3"
4217 [(set (match_operand:SI 0 "r_or_s_operand" "")
4218 (xor:SI (match_operand:SI 1 "r_or_s_operand" "")
4219 (match_operand:SI 2 "r_or_s_operand" "")))
4220 (clobber (reg:CC 33))])]
4224 if (CONSTANT_P (operands[2]))
4225 operands[2] = force_const_mem (SImode, operands[2]);
4228 (define_insn "*xorsi3"
4229 [(set (match_operand:SI 0 "r_or_s_operand" "=d,d,Q")
4230 (xor:SI (match_operand:SI 1 "r_or_s_operand" "%0,0,0")
4231 (match_operand:SI 2 "r_or_s_operand" "d,m,Q")))
4232 (clobber (reg:CC 33))]
4238 [(set_attr "op_type" "RR,RX,SS")
4239 (set_attr "atype" "reg,mem,mem")])
4242 ; xorhi3 instruction pattern(s).
4245 (define_expand "xorhi3"
4247 [(set (match_operand:HI 0 "r_or_s_operand" "")
4248 (xor:HI (match_operand:HI 1 "r_or_s_operand" "")
4249 (match_operand:HI 2 "r_or_s_operand" "")))
4250 (clobber (reg:CC 33))])]
4254 if (CONSTANT_P (operands[2]))
4255 operands[2] = force_const_mem (HImode, operands[2]);
4258 (define_insn "*xorhi3"
4259 [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
4260 (xor:HI (match_operand:HI 1 "r_or_s_operand" "%0,0")
4261 (match_operand:HI 2 "r_or_s_operand" "d,Q")))
4262 (clobber (reg:CC 33))]
4267 [(set_attr "op_type" "RR,SS")
4268 (set_attr "atype" "reg,mem")])
4271 ; xorqi3 instruction pattern(s).
4274 (define_insn "xorqi3"
4275 [(set (match_operand:QI 0 "r_or_s_operand" "=d,Q,Q")
4276 (xor:QI (match_operand:QI 1 "r_or_s_operand" "0,0,0")
4277 (match_operand:QI 2 "r_or_s_or_im8_operand" "d,n,Q")))
4278 (clobber (reg:CC 33))]
4284 [(set_attr "op_type" "RR,SI,SS")
4285 (set_attr "atype" "reg,mem,mem")])
4289 ;;- Negate instructions.
4293 ; negdi2 instruction pattern(s).
4296 (define_expand "negdi2"
4298 [(set (match_operand:DI 0 "register_operand" "=d")
4299 (neg:DI (match_operand:DI 1 "register_operand" "d")))
4300 (clobber (reg:CC 33))])]
4304 (define_insn "*negdi2_64"
4305 [(set (match_operand:DI 0 "register_operand" "=d")
4306 (neg:DI (match_operand:DI 1 "register_operand" "d")))
4307 (clobber (reg:CC 33))]
4310 [(set_attr "op_type" "RR")])
4312 (define_insn "*negdi2_31"
4313 [(set (match_operand:DI 0 "register_operand" "=d")
4314 (neg:DI (match_operand:DI 1 "register_operand" "d")))
4315 (clobber (reg:CC 33))]
4320 xop[0] = gen_label_rtx ();
4321 output_asm_insn (\"lcr\\t%0,%1\", operands);
4322 output_asm_insn (\"lcr\\t%N0,%N1\", operands);
4323 output_asm_insn (\"je\\t%l0\", xop);
4324 output_asm_insn (\"bctr\\t%0,0\", operands);
4325 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
4326 CODE_LABEL_NUMBER (xop[0]));
4329 [(set_attr "op_type" "NN")
4330 (set_attr "length" "10")])
4333 ; negsi2 instruction pattern(s).
4336 (define_insn "negsi2"
4337 [(set (match_operand:SI 0 "register_operand" "=d")
4338 (neg:SI (match_operand:SI 1 "register_operand" "d")))
4339 (clobber (reg:CC 33))]
4342 [(set_attr "op_type" "RR")])
4345 ; negdf2 instruction pattern(s).
4348 (define_expand "negdf2"
4350 [(set (match_operand:DF 0 "register_operand" "=f")
4351 (neg:DF (match_operand:DF 1 "register_operand" "f")))
4352 (clobber (reg:CC 33))])]
4356 (define_insn "*negdf2"
4357 [(set (match_operand:DF 0 "register_operand" "=f")
4358 (neg:DF (match_operand:DF 1 "register_operand" "f")))
4359 (clobber (reg:CC 33))]
4360 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4362 [(set_attr "op_type" "RR")])
4364 (define_insn "*negdf2_ibm"
4365 [(set (match_operand:DF 0 "register_operand" "=f")
4366 (neg:DF (match_operand:DF 1 "register_operand" "f")))
4367 (clobber (reg:CC 33))]
4368 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4370 [(set_attr "op_type" "RR")])
4373 ; negsf2 instruction pattern(s).
4376 (define_expand "negsf2"
4378 [(set (match_operand:SF 0 "register_operand" "=f")
4379 (neg:SF (match_operand:SF 1 "register_operand" "f")))
4380 (clobber (reg:CC 33))])]
4384 (define_insn "*negsf2"
4385 [(set (match_operand:SF 0 "register_operand" "=f")
4386 (neg:SF (match_operand:SF 1 "register_operand" "f")))
4387 (clobber (reg:CC 33))]
4388 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4390 [(set_attr "op_type" "RR")])
4392 (define_insn "*negsf2"
4393 [(set (match_operand:SF 0 "register_operand" "=f")
4394 (neg:SF (match_operand:SF 1 "register_operand" "f")))
4395 (clobber (reg:CC 33))]
4396 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4398 [(set_attr "op_type" "RR")])
4402 ;;- Absolute value instructions.
4406 ; absdi2 instruction pattern(s).
4409 (define_insn "absdi2"
4410 [(set (match_operand:DI 0 "register_operand" "=d")
4411 (abs:DI (match_operand:DI 1 "register_operand" "d")))
4412 (clobber (reg:CC 33))]
4415 [(set_attr "op_type" "RRE")])
4418 ; abssi2 instruction pattern(s).
4421 (define_insn "abssi2"
4422 [(set (match_operand:SI 0 "register_operand" "=d")
4423 (abs:SI (match_operand:SI 1 "register_operand" "d")))
4424 (clobber (reg:CC 33))]
4427 [(set_attr "op_type" "RR")])
4430 ; abshi2 instruction pattern(s).
4433 (define_insn "abshi2"
4434 [(set (match_operand:HI 0 "register_operand" "=d")
4435 (abs:HI (match_operand:HI 1 "register_operand" "d")))
4436 (clobber (reg:CC 33))]
4438 "sll\\t%1,16\;sra\\t%1,16\;lpr\\t%0,%1"
4439 [(set_attr "op_type" "NN")
4440 (set_attr "type" "o3")
4441 (set_attr "length" "10")])
4444 ; absdf2 instruction pattern(s).
4447 (define_expand "absdf2"
4449 [(set (match_operand:DF 0 "register_operand" "=f")
4450 (abs:DF (match_operand:DF 1 "register_operand" "f")))
4451 (clobber (reg:CC 33))])]
4455 (define_insn "*absdf2"
4456 [(set (match_operand:DF 0 "register_operand" "=f")
4457 (abs:DF (match_operand:DF 1 "register_operand" "f")))
4458 (clobber (reg:CC 33))]
4459 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4461 [(set_attr "op_type" "RR")])
4463 (define_insn "*absdf2_ibm"
4464 [(set (match_operand:DF 0 "register_operand" "=f")
4465 (abs:DF (match_operand:DF 1 "register_operand" "f")))
4466 (clobber (reg:CC 33))]
4467 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4469 [(set_attr "op_type" "RR")])
4472 ; abssf2 instruction pattern(s).
4475 (define_expand "abssf2"
4477 [(set (match_operand:SF 0 "register_operand" "=f")
4478 (abs:SF (match_operand:SF 1 "register_operand" "f")))
4479 (clobber (reg:CC 33))])]
4483 (define_insn "*abssf2"
4484 [(set (match_operand:SF 0 "register_operand" "=f")
4485 (abs:SF (match_operand:SF 1 "register_operand" "f")))
4486 (clobber (reg:CC 33))]
4487 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4489 [(set_attr "op_type" "RR")])
4491 (define_insn "*abssf2_ibm"
4492 [(set (match_operand:SF 0 "register_operand" "=f")
4493 (abs:SF (match_operand:SF 1 "register_operand" "f")))
4494 (clobber (reg:CC 33))]
4495 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4497 [(set_attr "op_type" "RR")])
4501 ;;- One complement instructions.
4505 ; one_cmpldi2 instruction pattern(s).
4508 (define_expand "one_cmpldi2"
4510 [(set (match_operand:DI 0 "r_or_s_operand" "=d")
4511 (not:DI (match_operand:DI 1 "r_or_s_operand" "0")))
4513 (clobber (reg:CC 33))])]
4515 "{ operands[2] = force_const_mem (DImode, constm1_rtx); }")
4517 (define_insn "*one_cmpldi2"
4518 [(set (match_operand:DI 0 "r_or_s_operand" "=d,Q")
4519 (not:DI (match_operand:DI 1 "r_or_s_operand" "0,0")))
4520 (use (match_operand:DI 2 "memory_operand" "m,m"))
4521 (clobber (reg:CC 33))]
4526 [(set_attr "op_type" "RR,SS")
4527 (set_attr "atype" "mem")])
4530 ; one_cmplsi2 instruction pattern(s).
4533 (define_expand "one_cmplsi2"
4535 [(set (match_operand:SI 0 "r_or_s_operand" "=d")
4536 (not:SI (match_operand:SI 1 "r_or_s_operand" "0")))
4538 (clobber (reg:CC 33))])]
4540 "{ operands[2] = force_const_mem (SImode, constm1_rtx); }")
4542 (define_insn "*one_cmplsi2"
4543 [(set (match_operand:SI 0 "r_or_s_operand" "=d,Q")
4544 (not:SI (match_operand:SI 1 "r_or_s_operand" "0,0")))
4545 (use (match_operand:SI 2 "memory_operand" "m,m"))
4546 (clobber (reg:CC 33))]
4551 [(set_attr "op_type" "RR,SS")
4552 (set_attr "atype" "mem")])
4555 ; one_cmplhi2 instruction pattern(s).
4558 (define_expand "one_cmplhi2"
4560 [(set (match_operand:HI 0 "r_or_s_operand" "=d")
4561 (not:HI (match_operand:HI 1 "r_or_s_operand" "0")))
4563 (clobber (reg:CC 33))])]
4565 "{ operands[2] = force_const_mem (SImode, constm1_rtx); }")
4567 (define_insn "*one_cmplhi2"
4568 [(set (match_operand:HI 0 "r_or_s_operand" "=d,Q")
4569 (not:HI (match_operand:HI 1 "r_or_s_operand" "0,0")))
4570 (use (match_operand:SI 2 "memory_operand" "m,m"))
4571 (clobber (reg:CC 33))]
4576 [(set_attr "op_type" "RX,SS")
4577 (set_attr "atype" "mem")])
4580 ; one_cmplqi2 instruction pattern(s).
4583 (define_insn "one_cmpqi2"
4584 [(set (match_operand:QI 0 "memory_operand" "=Q")
4585 (not:QI (match_operand:QI 1 "memory_operand" "0")))
4586 (clobber (reg:CC 33))]
4589 [(set_attr "op_type" "SI")])
4593 ;;- Rotate instructions.
4597 ; rotldi3 instruction pattern(s).
4600 (define_insn "rotldi3"
4601 [(set (match_operand:DI 0 "register_operand" "=d,d")
4602 (rotate:DI (match_operand:DI 1 "register_operand" "d,d")
4603 (match_operand:DI 2 "nonmemory_operand" "J,a")))
4604 (clobber (reg:CC 33))]
4609 [(set_attr "op_type" "RSE")])
4612 ; rotlsi3 instruction pattern(s).
4615 (define_insn "rotlsi3"
4616 [(set (match_operand:SI 0 "register_operand" "=d,d")
4617 (rotate:SI (match_operand:SI 1 "register_operand" "d,d")
4618 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4619 (clobber (reg:CC 33))]
4624 [(set_attr "op_type" "RSE")])
4628 ;;- Arithmetic shift instructions.
4630 ;; for left shifts always setal shifts are used (ANSI-C)
4633 ; ashldi3 instruction pattern(s).
4636 (define_expand "ashldi3"
4638 [(set (match_operand:DI 0 "register_operand" "")
4639 (ashift:DI (match_operand:DI 1 "register_operand" "")
4640 (match_operand:SI 2 "nonmemory_operand" "")))
4641 (clobber (reg:CC 33))])]
4645 (define_insn "*ashldi3_31"
4646 [(set (match_operand:DI 0 "register_operand" "=d,d")
4647 (ashift:DI (match_operand:DI 1 "register_operand" "0,0")
4648 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4649 (clobber (reg:CC 33))]
4654 [(set_attr "op_type" "RS")])
4656 (define_insn "*ashldi3_64"
4657 [(set (match_operand:DI 0 "register_operand" "=d,d")
4658 (ashift:DI (match_operand:DI 1 "register_operand" "d,d")
4659 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4660 (clobber (reg:CC 33))]
4665 [(set_attr "op_type" "RSE")])
4668 ; ashrdi3 instruction pattern(s).
4671 (define_expand "ashrdi3"
4673 [(set (match_operand:DI 0 "register_operand" "")
4674 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
4675 (match_operand:SI 2 "nonmemory_operand" "")))
4676 (clobber (reg:CC 33))])]
4680 (define_insn "*ashrdi3_31"
4681 [(set (match_operand:DI 0 "register_operand" "=d,d")
4682 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
4683 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4684 (clobber (reg:CC 33))]
4689 [(set_attr "op_type" "RS")])
4691 (define_insn "*ashrdi3_64"
4692 [(set (match_operand:DI 0 "register_operand" "=d,d")
4693 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
4694 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4695 (clobber (reg:CC 33))]
4700 [(set_attr "op_type" "RSE")])
4703 ; ashlsi3 instruction pattern(s).
4705 ; all 32 bits has to be shifted (testcase co750c)
4707 (define_insn "ashlsi3"
4708 [(set (match_operand:SI 0 "register_operand" "=d,d")
4709 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
4710 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4711 (clobber (reg:CC 33))]
4716 [(set_attr "op_type" "RS")])
4719 ; ashrsi3 instruction pattern(s).
4722 (define_insn "ashrsi3"
4723 [(set (match_operand:SI 0 "register_operand" "=d,d")
4724 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
4725 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4726 (clobber (reg:CC 33))]
4731 [(set_attr "op_type" "RS")])
4734 ; ashlhi3 instruction pattern(s).
4737 (define_insn "ashlhi3"
4738 [(set (match_operand:HI 0 "register_operand" "=d,d")
4739 (ashift:HI (match_operand:HI 1 "register_operand" "0,0")
4740 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4741 (clobber (reg:CC 33))]
4746 [(set_attr "op_type" "RS,RS")])
4749 ; ashrhi3 instruction pattern(s).
4752 (define_insn "ashrhi3"
4753 [(set (match_operand:HI 0 "register_operand" "=d,d")
4754 (ashiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
4755 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4756 (clobber (reg:CC 33))]
4759 sll\\t%0,16\;sra\\t%0,16+%c2
4760 sll\\t%0,16\;sra\\t%0,16(%2)"
4761 [(set_attr "op_type" "NN,NN")
4762 (set_attr "length" "8,8")])
4766 ;;- logical shift instructions.
4770 ; lshrdi3 instruction pattern(s).
4773 (define_expand "lshrdi3"
4775 [(set (match_operand:DI 0 "register_operand" "")
4776 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
4777 (match_operand:SI 2 "nonmemory_operand" "")))
4778 (clobber (reg:CC 33))])]
4782 (define_insn "*lshrdi3_31"
4783 [(set (match_operand:DI 0 "register_operand" "=d,d")
4784 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
4785 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4786 (clobber (reg:CC 33))]
4791 [(set_attr "op_type" "RS,RS")])
4793 (define_insn "*lshrdi3_64"
4794 [(set (match_operand:DI 0 "register_operand" "=d,d")
4795 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
4796 (match_operand:SI 2 "nonmemory_operand" "J,a")))
4797 (clobber (reg:CC 33))]
4802 [(set_attr "op_type" "RS,RS")])
4805 ; lshrsi3 instruction pattern(s).
4808 (define_insn "lshrsi3"
4809 [(set (match_operand:SI 0 "register_operand" "=d,d")
4810 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
4811 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4812 (clobber (reg:CC 33))]
4817 [(set_attr "op_type" "RS")])
4820 ; lshrhi3 instruction pattern(s).
4823 (define_insn "lshrhi3"
4824 [(set (match_operand:HI 0 "register_operand" "=d,d")
4825 (lshiftrt:HI (match_operand:HI 1 "register_operand" "0,0")
4826 (match_operand:SI 2 "r_or_im8_operand" "J,a")))
4827 (clobber (reg:CC 33))]
4830 sll\\t%0,16\;srl\\t%0,16+%c2
4831 sll\\t%0,16\;srl\\t%0,16(%2)"
4832 [(set_attr "op_type" "NN,NN")
4833 (set_attr "length" "8,8")])
4837 ;; Branch instruction patterns.
4840 (define_expand "beq"
4841 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
4843 (if_then_else (eq (reg:CCZ 33) (const_int 0))
4844 (label_ref (match_operand 0 "" ""))
4847 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4849 (define_expand "bne"
4850 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
4852 (if_then_else (ne (reg:CCZ 33) (const_int 0))
4853 (label_ref (match_operand 0 "" ""))
4856 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4858 (define_expand "bgt"
4859 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4861 (if_then_else (gt (reg:CCS 33) (const_int 0))
4862 (label_ref (match_operand 0 "" ""))
4865 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4867 (define_expand "bgtu"
4868 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
4870 (if_then_else (gtu (reg:CCU 33) (const_int 0))
4871 (label_ref (match_operand 0 "" ""))
4874 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4876 (define_expand "blt"
4877 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4879 (if_then_else (lt (reg:CCS 33) (const_int 0))
4880 (label_ref (match_operand 0 "" ""))
4883 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4885 (define_expand "bltu"
4886 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
4888 (if_then_else (ltu (reg:CCU 33) (const_int 0))
4889 (label_ref (match_operand 0 "" ""))
4892 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4894 (define_expand "bge"
4895 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4897 (if_then_else (ge (reg:CCS 33) (const_int 0))
4898 (label_ref (match_operand 0 "" ""))
4901 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4903 (define_expand "bgeu"
4904 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
4906 (if_then_else (geu (reg:CCU 33) (const_int 0))
4907 (label_ref (match_operand 0 "" ""))
4910 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4912 (define_expand "ble"
4913 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4915 (if_then_else (le (reg:CCS 33) (const_int 0))
4916 (label_ref (match_operand 0 "" ""))
4919 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4921 (define_expand "bleu"
4922 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
4924 (if_then_else (leu (reg:CCU 33) (const_int 0))
4925 (label_ref (match_operand 0 "" ""))
4928 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4930 (define_expand "bunordered"
4931 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4933 (if_then_else (unordered (reg:CCS 33) (const_int 0))
4934 (label_ref (match_operand 0 "" ""))
4937 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4939 (define_expand "bordered"
4940 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4942 (if_then_else (ordered (reg:CCS 33) (const_int 0))
4943 (label_ref (match_operand 0 "" ""))
4946 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4948 (define_expand "buneq"
4949 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4951 (if_then_else (uneq (reg:CCS 33) (const_int 0))
4952 (label_ref (match_operand 0 "" ""))
4955 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4957 (define_expand "bungt"
4958 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4960 (if_then_else (ungt (reg:CCS 33) (const_int 0))
4961 (label_ref (match_operand 0 "" ""))
4964 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4966 (define_expand "bunlt"
4967 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4969 (if_then_else (unlt (reg:CCS 33) (const_int 0))
4970 (label_ref (match_operand 0 "" ""))
4973 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4975 (define_expand "bunge"
4976 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4978 (if_then_else (unge (reg:CCS 33) (const_int 0))
4979 (label_ref (match_operand 0 "" ""))
4982 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4984 (define_expand "bunle"
4985 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4987 (if_then_else (unle (reg:CCS 33) (const_int 0))
4988 (label_ref (match_operand 0 "" ""))
4991 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
4993 (define_expand "bltgt"
4994 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
4996 (if_then_else (ltgt (reg:CCS 33) (const_int 0))
4997 (label_ref (match_operand 0 "" ""))
5000 "{ operands[1] = s390_compare_op0; operands[2] = s390_compare_op1; }")
5004 ;;- Conditional jump instructions.
5007 (define_insn "cjump"
5010 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
5011 (label_ref (match_operand 0 "" ""))
5016 if (get_attr_length (insn) == 4 || !TARGET_64BIT)
5017 return \"j%C1\\t%l0\";
5019 return \"jg%C1\\t%l0\";
5021 [(set_attr "op_type" "RI")
5022 (set (attr "length") (if_then_else
5023 (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
5024 (const_int 4) (const_int 6)))])
5026 (define_insn "*cjump_long"
5029 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
5030 (match_operand 0 "address_operand" "p")
5035 if (get_attr_op_type (insn) == OP_TYPE_RR)
5036 return \"b%C1r\\t%0\";
5038 return \"b%C1\\t%a0\";
5040 [(set (attr "op_type")
5041 (if_then_else (match_operand 0 "register_operand" "")
5042 (const_string "RR") (const_string "RX")))
5043 (set_attr "atype" "mem")])
5047 ;;- Negated conditional jump instructions.
5050 (define_insn "icjump"
5053 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
5055 (label_ref (match_operand 0 "" ""))))]
5059 if (get_attr_length (insn) == 4 || !TARGET_64BIT)
5060 return \"j%D1\\t%l0\";
5062 return \"jg%D1\\t%l0\";
5064 [(set_attr "op_type" "RI")
5065 (set (attr "length") (if_then_else
5066 (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
5067 (const_int 4) (const_int 6)))])
5069 (define_insn "*icjump_long"
5072 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
5074 (match_operand 0 "address_operand" "p")))]
5078 if (get_attr_op_type (insn) == OP_TYPE_RR)
5079 return \"b%D1r\\t%0\";
5081 return \"b%D1\\t%a0\";
5083 [(set (attr "op_type")
5084 (if_then_else (match_operand 0 "register_operand" "")
5085 (const_string "RR") (const_string "RX")))
5086 (set_attr "atype" "mem")])
5090 ;;- Subtract one and jump if not zero.
5093 ;(define_expand "decrement_and_branch_on_count"
5094 ; [(use (match_operand 0 "register_operand" ""))
5095 ; (use (label_ref (match_operand 1 "" "")))]
5099 ;/* if (TARGET_64BIT)
5100 ; emit_jump_insn (gen_brctdi (operands[0], operands[1]));
5102 ; emit_jump_insn (gen_brctsi (operands[0], operands[1]));
5106 ;(define_insn "brctsi"
5109 ; (ne (match_operand:SI 0 "register_operand" "+a")
5111 ; (label_ref (match_operand 1 "" ""))
5113 ; (set (match_dup 0)
5114 ; (plus:SI (match_dup 0) (const_int -1)))]
5117 ; [(set_attr "op_type" "RI")
5118 ; (set_attr "type" "branch")]
5121 ;(define_insn "ibrctsi"
5124 ; (eq (match_operand:SI 0 "register_operand" "+a")
5127 ; (label_ref (match_operand 1 "" ""))))
5128 ; (set (match_dup 0)
5129 ; (plus:SI (match_dup 0) (const_int -1)))]
5132 ; [(set_attr "op_type" "RI")
5133 ; (set_attr "type" "branch")]
5138 ;;- Unconditional jump instructions.
5142 ; jump instruction pattern(s).
5146 [(set (pc) (label_ref (match_operand 0 "" "")))]
5150 if (get_attr_length (insn) == 4 || !TARGET_64BIT)
5153 return \"jg\\t%l0\";
5155 [(set_attr "op_type" "RI")
5156 (set (attr "length") (if_then_else
5157 (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
5158 (const_int 4) (const_int 6)))])
5161 ; indirect-jump instruction pattern(s).
5164 (define_insn "indirect_jump"
5165 [(set (pc) (match_operand 0 "address_operand" "p"))]
5169 if (get_attr_op_type (insn) == OP_TYPE_RR)
5174 [(set (attr "op_type")
5175 (if_then_else (match_operand 0 "register_operand" "")
5176 (const_string "RR") (const_string "RX")))
5177 (set_attr "atype" "mem")])
5180 ; casesi instruction pattern(s).
5183 (define_insn "casesi_jump"
5184 [(set (pc) (match_operand 0 "address_operand" "p"))
5185 (use (label_ref (match_operand 1 "" "")))]
5189 if (get_attr_op_type (insn) == OP_TYPE_RR)
5194 [(set (attr "op_type")
5195 (if_then_else (match_operand 0 "register_operand" "")
5196 (const_string "RR") (const_string "RX")))
5197 (set_attr "atype" "mem")])
5199 (define_expand "casesi"
5200 [(match_operand:SI 0 "general_operand" "")
5201 (match_operand:SI 1 "general_operand" "")
5202 (match_operand:SI 2 "general_operand" "")
5203 (label_ref (match_operand 3 "" ""))
5204 (label_ref (match_operand 4 "" ""))]
5208 rtx index = gen_reg_rtx (SImode);
5209 rtx base = gen_reg_rtx (Pmode);
5210 rtx target = gen_reg_rtx (Pmode);
5212 emit_move_insn (index, operands[0]);
5213 emit_insn (gen_subsi3 (index, index, operands[1]));
5214 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
5217 if (Pmode != SImode)
5218 index = convert_to_mode (Pmode, index, 1);
5219 if (GET_CODE (index) != REG)
5220 index = copy_to_mode_reg (Pmode, index);
5223 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
5225 emit_insn (gen_ashlsi3 (index, index, GEN_INT (2)));
5227 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
5229 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
5230 emit_move_insn (target, index);
5233 target = gen_rtx_PLUS (Pmode, base, target);
5234 emit_jump_insn (gen_casesi_jump (target, operands[3]));
5241 ;;- Jump to subroutine.
5246 ; untyped call instruction pattern(s).
5249 ;; Call subroutine returning any type.
5250 (define_expand "untyped_call"
5251 [(parallel [(call (match_operand 0 "" "")
5253 (match_operand 1 "" "")
5254 (match_operand 2 "" "")])]
5260 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
5262 for (i = 0; i < XVECLEN (operands[2], 0); i++)
5264 rtx set = XVECEXP (operands[2], 0, i);
5265 emit_move_insn (SET_DEST (set), SET_SRC (set));
5268 /* The optimizer does not know that the call sets the function value
5269 registers we stored in the result block. We avoid problems by
5270 claiming that all hard registers are used and clobbered at this
5272 emit_insn (gen_blockage ());
5277 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
5278 ;; all of memory. This blocks insns from being moved across this point.
5280 (define_insn "blockage"
5281 [(unspec_volatile [(const_int 0)] 0)]
5287 ; call instruction pattern(s).
5290 (define_expand "call"
5291 [(parallel [(call (match_operand 0 "" "")
5292 (match_operand 1 "" ""))
5293 (clobber (match_operand 2 "" ""))])]
5297 /* Abuse operand 2 to hold the return register. */
5298 operands[2] = gen_rtx_REG (Pmode, RETURN_REGNUM);
5300 /* In 31-bit, we must load the GOT register even if the
5301 compiler doesn't know about it, because the PLT glue
5302 code uses it. In 64-bit, this is not necessary. */
5303 if (flag_pic && !TARGET_64BIT)
5304 current_function_uses_pic_offset_table = 1;
5306 /* Direct function calls need special treatment. */
5307 if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
5309 rtx sym = XEXP (operands[0], 0);
5311 /* When calling a global routine in PIC mode, we must
5312 replace the symbol itself with the PLT stub. */
5313 if (flag_pic && !SYMBOL_REF_FLAG(sym))
5315 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
5316 sym = gen_rtx_CONST (Pmode, sym);
5319 /* Unless we can use the bras(l) insn, force the
5320 routine address into a register. */
5321 if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
5323 rtx target = gen_reg_rtx (Pmode);
5324 emit_move_insn (target, sym);
5328 operands[0] = gen_rtx_MEM (QImode, sym);
5332 (define_insn "brasl"
5333 [(call (mem:QI (match_operand:DI 0 "bras_sym_operand" "X"))
5334 (match_operand:SI 1 "const_int_operand" "n"))
5335 (clobber (match_operand:DI 2 "register_operand" "=r"))]
5338 [(set_attr "op_type" "RIL")
5339 (set_attr "type" "jsr")])
5342 [(call (mem:QI (match_operand:SI 0 "bras_sym_operand" "X"))
5343 (match_operand:SI 1 "const_int_operand" "n"))
5344 (clobber (match_operand:SI 2 "register_operand" "=r"))]
5347 [(set_attr "op_type" "RI")
5348 (set_attr "type" "jsr")])
5350 (define_insn "basr_64"
5351 [(call (mem:QI (match_operand:DI 0 "register_operand" "a"))
5352 (match_operand:SI 1 "const_int_operand" "n"))
5353 (clobber (match_operand:DI 2 "register_operand" "=r"))]
5356 [(set_attr "op_type" "RR")
5357 (set_attr "type" "jsr")
5358 (set_attr "atype" "mem")])
5360 (define_insn "basr_31"
5361 [(call (mem:QI (match_operand:SI 0 "register_operand" "a"))
5362 (match_operand:SI 1 "const_int_operand" "n"))
5363 (clobber (match_operand:SI 2 "register_operand" "=r"))]
5366 [(set_attr "op_type" "RR")
5367 (set_attr "type" "jsr")
5368 (set_attr "atype" "mem")])
5370 (define_insn "bas_64"
5371 [(call (mem:QI (match_operand:QI 0 "address_operand" "p"))
5372 (match_operand:SI 1 "const_int_operand" "n"))
5373 (clobber (match_operand:DI 2 "register_operand" "=r"))]
5376 [(set_attr "op_type" "RX")
5377 (set_attr "type" "jsr")
5378 (set_attr "atype" "mem")])
5380 (define_insn "bas_31"
5381 [(call (mem:QI (match_operand:QI 0 "address_operand" "p"))
5382 (match_operand:SI 1 "const_int_operand" "n"))
5383 (clobber (match_operand:SI 2 "register_operand" "=r"))]
5386 [(set_attr "op_type" "RX")
5387 (set_attr "type" "jsr")
5388 (set_attr "atype" "mem")])
5392 ; call_value instruction pattern(s).
5395 (define_expand "call_value"
5396 [(parallel [(set (match_operand 0 "" "")
5397 (call (match_operand 1 "" "")
5398 (match_operand 2 "" "")))
5399 (clobber (match_operand 3 "" ""))])]
5403 /* Abuse operand 3 to hold the return register. */
5404 operands[3] = gen_rtx_REG (Pmode, RETURN_REGNUM);
5406 /* In 31-bit, we must load the GOT register even if the
5407 compiler doesn't know about it, because the PLT glue
5408 code uses it. In 64-bit, this is not necessary. */
5409 if (flag_pic && !TARGET_64BIT)
5410 current_function_uses_pic_offset_table = 1;
5412 /* Direct function calls need special treatment. */
5413 if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
5415 rtx sym = XEXP (operands[1], 0);
5417 /* When calling a global routine in PIC mode, we must
5418 replace the symbol itself with the PLT stub. */
5419 if (flag_pic && !SYMBOL_REF_FLAG(sym))
5421 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), 113);
5422 sym = gen_rtx_CONST (Pmode, sym);
5425 /* Unless we can use the bras(l) insn, force the
5426 routine address into a register. */
5427 if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
5429 rtx target = gen_reg_rtx (Pmode);
5430 emit_move_insn (target, sym);
5434 operands[1] = gen_rtx_MEM (QImode, sym);
5438 (define_insn "brasl_r"
5439 [(set (match_operand 0 "register_operand" "=df")
5440 (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
5441 (match_operand:SI 2 "const_int_operand" "n")))
5442 (clobber (match_operand:DI 3 "register_operand" "=r"))]
5445 [(set_attr "op_type" "RIL")
5446 (set_attr "type" "jsr")])
5448 (define_insn "bras_r"
5449 [(set (match_operand 0 "register_operand" "=df")
5450 (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
5451 (match_operand:SI 2 "const_int_operand" "n")))
5452 (clobber (match_operand:SI 3 "register_operand" "=r"))]
5455 [(set_attr "op_type" "RI")
5456 (set_attr "type" "jsr")])
5458 (define_insn "basr_r_64"
5459 [(set (match_operand 0 "register_operand" "=df")
5460 (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
5461 (match_operand:SI 2 "const_int_operand" "n")))
5462 (clobber (match_operand:DI 3 "register_operand" "=r"))]
5465 [(set_attr "op_type" "RR")
5466 (set_attr "type" "jsr")])
5468 (define_insn "basr_r_31"
5469 [(set (match_operand 0 "register_operand" "=df")
5470 (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
5471 (match_operand:SI 2 "const_int_operand" "n")))
5472 (clobber (match_operand:SI 3 "register_operand" "=r"))]
5475 [(set_attr "op_type" "RR")
5476 (set_attr "type" "jsr")
5477 (set_attr "atype" "mem")])
5479 (define_insn "bas_r_64"
5480 [(set (match_operand 0 "register_operand" "=df")
5481 (call (mem:QI (match_operand:QI 1 "address_operand" "p"))
5482 (match_operand:SI 2 "const_int_operand" "n")))
5483 (clobber (match_operand:DI 3 "register_operand" "=r"))]
5486 [(set_attr "op_type" "RX")
5487 (set_attr "type" "jsr")
5488 (set_attr "atype" "mem")])
5490 (define_insn "bas_r_31"
5491 [(set (match_operand 0 "register_operand" "=df")
5492 (call (mem:QI (match_operand:QI 1 "address_operand" "p"))
5493 (match_operand:SI 2 "const_int_operand" "n")))
5494 (clobber (match_operand:SI 3 "register_operand" "=r"))]
5497 [(set_attr "op_type" "RX")
5498 (set_attr "type" "jsr")
5499 (set_attr "atype" "mem")])
5503 ;;- Miscellaneous instructions.
5507 ; allocate stack instruction pattern(s).
5510 (define_expand "allocate_stack"
5512 (plus (reg 15) (match_operand 1 "general_operand" "")))
5513 (set (match_operand 0 "general_operand" "")
5518 rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
5519 rtx chain = gen_rtx (MEM, Pmode, stack);
5520 rtx temp = gen_reg_rtx (Pmode);
5522 emit_move_insn (temp, chain);
5525 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
5527 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
5529 emit_move_insn (chain, temp);
5531 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
5537 ; setjmp/longjmp instruction pattern(s).
5540 (define_expand "builtin_setjmp_setup"
5541 [(unspec [(match_operand 0 "register_operand" "a")] 1)]
5545 rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
5546 rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
5548 emit_move_insn (base, basereg);
5552 (define_expand "builtin_setjmp_receiver"
5553 [(unspec_volatile [(label_ref (match_operand 0 "" ""))] 2)]
5557 rtx gotreg = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
5558 rtx got = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
5559 SYMBOL_REF_FLAG (got) = 1;
5561 emit_move_insn (gotreg, got);
5562 emit_insn (gen_rtx_USE (VOIDmode, gotreg));
5566 (define_expand "builtin_longjmp"
5567 [(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]
5571 /* The elements of the buffer are, in order: */
5572 rtx fp = gen_rtx_MEM (Pmode, operands[0]);
5573 rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], GET_MODE_SIZE (Pmode)));
5574 rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2 * GET_MODE_SIZE (Pmode)));
5575 rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
5576 rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
5577 rtx jmp = gen_rtx_REG (Pmode, 14);
5579 emit_move_insn (jmp, lab);
5580 emit_move_insn (basereg, base);
5581 emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
5582 emit_move_insn (hard_frame_pointer_rtx, fp);
5584 emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
5585 emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
5586 emit_insn (gen_rtx_USE (VOIDmode, basereg));
5587 emit_indirect_jump (jmp);
5592 ;; These patterns say how to save and restore the stack pointer. We need not
5593 ;; save the stack pointer at function level since we are careful to
5594 ;; preserve the backchain. At block level, we have to restore the backchain
5595 ;; when we restore the stack pointer.
5597 ;; For nonlocal gotos, we must save both the stack pointer and its
5598 ;; backchain and restore both. Note that in the nonlocal case, the
5599 ;; save area is a memory location.
5601 (define_expand "save_stack_function"
5602 [(match_operand 0 "general_operand" "")
5603 (match_operand 1 "general_operand" "")]
5607 (define_expand "restore_stack_function"
5608 [(match_operand 0 "general_operand" "")
5609 (match_operand 1 "general_operand" "")]
5613 (define_expand "restore_stack_block"
5614 [(use (match_operand 0 "register_operand" ""))
5615 (set (match_dup 2) (match_dup 3))
5616 (set (match_dup 0) (match_operand 1 "register_operand" ""))
5617 (set (match_dup 3) (match_dup 2))]
5621 operands[2] = gen_reg_rtx (Pmode);
5622 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
5625 (define_expand "save_stack_nonlocal"
5626 [(match_operand 0 "memory_operand" "")
5627 (match_operand 1 "register_operand" "")]
5631 rtx temp = gen_reg_rtx (Pmode);
5633 /* Copy the backchain to the first word, sp to the second. */
5634 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
5635 emit_move_insn (operand_subword (operands[0], 0, 0,
5636 TARGET_64BIT ? TImode : DImode),
5638 emit_move_insn (operand_subword (operands[0], 1, 0,
5639 TARGET_64BIT ? TImode : DImode),
5644 (define_expand "restore_stack_nonlocal"
5645 [(match_operand 0 "register_operand" "")
5646 (match_operand 1 "memory_operand" "")]
5650 rtx temp = gen_reg_rtx (Pmode);
5652 /* Restore the backchain from the first word, sp from the second. */
5653 emit_move_insn (temp,
5654 operand_subword (operands[1], 0, 0,
5655 TARGET_64BIT ? TImode : DImode));
5656 emit_move_insn (operands[0],
5657 operand_subword (operands[1], 1, 0,
5658 TARGET_64BIT ? TImode : DImode));
5659 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
5665 ; nop instruction pattern(s).
5672 [(set_attr "op_type" "RR")])
5676 ; Special literal pool access instruction pattern(s).
5679 (define_insn "reload_base"
5680 [(parallel [(set (reg 13) (pc))
5681 (use (label_ref (match_operand 0 "" "")))])]
5686 return \"larl\\t13,%y0\";
5688 return \"basr\\t13,0\;ahi\\t13,%Y0\";
5690 [(set_attr "op_type" "NN")
5691 (set_attr "type" "o2")
5692 (set_attr "length" "8")])
5694 (define_insn "ltorg"
5695 [(parallel [(set (reg 13) (pc))
5696 (use (match_operand:SI 0 "const_int_operand" ""))])]
5700 s390_dump_literal_pool (insn, operands[0]);
5703 [(set_attr "op_type" "NN")
5704 (set_attr "type" "branch")
5705 (set_attr "length" "4096")])
5709 ;; Peephole optimization patterns.
5713 [(set (match_operand:SI 0 "memory_operand" "m")
5714 (match_operand:SI 1 "register_operand" "d"))
5721 [(set (match_operand:SI 0 "memory_operand" "m")
5722 (match_operand:SI 1 "register_operand" "d"))
5729 [(set (match_operand:SI 0 "register_operand" "")
5730 (match_operand:SI 1 "register_operand" ""))
5733 (plus:SI (match_dup 0)
5734 (match_operand:SI 2 "immediate_operand" "")))
5735 (clobber (reg:CC 33))])]
5736 "(REGNO (operands[0]) == STACK_POINTER_REGNUM ||
5737 REGNO (operands[1]) == STACK_POINTER_REGNUM ||
5738 REGNO (operands[0]) == BASE_REGISTER ||
5739 REGNO (operands[1]) == BASE_REGISTER) &&
5740 INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 4096"
5744 ; peepholes for fast char instructions
5748 ; [(set (match_operand:QI 0 "register_operand" "d")
5749 ; (match_operand:QI 1 "s_operand" "Q"))
5750 ; (set (match_operand:SI 2 "register_operand" "0")
5751 ; (zero_extend:SI (match_dup 0)))]
5752 ; "REGNO(operands[0]) == REGNO(operands[2])"
5753 ; "icm\\t%0,8,%1\;srl\\t%0,24")
5756 ; [(set (match_operand:QI 0 "register_operand" "d")
5757 ; (match_operand:QI 1 "s_operand" "Q"))
5758 ; (set (match_operand:SI 2 "register_operand" "0")
5759 ; (sign_extend:SI (match_dup 0)))]
5760 ; "REGNO(operands[0]) == REGNO(operands[2])"
5761 ; "icm\\t%0,8,%1\;sra\\t%0,24")
5764 [(set (match_operand:QI 0 "register_operand" "d")
5765 (match_operand:QI 1 "immediate_operand" "J"))
5766 (set (match_operand:SI 2 "register_operand" "0" )
5767 (sign_extend:SI (match_dup 0) ) )]
5768 "REGNO(operands[0]) == REGNO(operands[2])"
5772 ; peepholes for fast short instructions
5776 ; [(set (match_operand:HI 0 "register_operand" "d")
5777 ; (match_operand:HI 1 "s_operand" "Q"))
5778 ; (set (match_operand:SI 2 "register_operand" "0" )
5779 ; (zero_extend:SI (match_dup 0)))]
5780 ; "REGNO(operands[0]) == REGNO(operands[2])"
5781 ; "icm\\t%0,12,%1\;srl\\t%0,16")
5784 [(set (match_operand:HI 0 "register_operand" "d")
5785 (match_operand:HI 1 "memory_operand" "m"))
5786 (set (match_operand:SI 2 "register_operand" "0" )
5787 (sign_extend:SI (match_dup 0)))]
5788 "REGNO(operands[0]) == REGNO(operands[2])"
5792 [(set (match_operand:HI 0 "register_operand" "d")
5793 (match_operand:HI 1 "immediate_operand" "K"))
5794 (set (match_operand:SI 2 "register_operand" "0" )
5795 (sign_extend:SI (match_dup 0) ) )]
5796 "REGNO(operands[0]) == REGNO(operands[2])"
5800 ; peepholes for divide instructions
5804 [(set (match_operand:DI 0 "register_operand" "d")
5805 (match_operand:DI 1 "memory_operand" "m"))
5807 (lshiftrt:DI (match_dup 0)
5808 (match_operand:SI 2 "immediate_operand" "J")))
5810 (div:SI (match_dup 0)
5811 (match_operand:SI 3 "nonimmediate_operand" "g")))
5817 output_asm_insn (\"l\\t%0,%1\", operands);
5818 output_asm_insn (\"srdl\\t%0,%b2\", operands);
5820 if (REG_P (operands[3]))
5821 output_asm_insn (\"dr\\t%0,%3\", operands);
5823 output_asm_insn (\"d\\t%0,%3\", operands);
5825 return \"st\\t%N0,%N1\";
5829 [(set (match_operand:DI 0 "register_operand" "d")
5830 (match_operand:DI 1 "memory_operand" "m"))
5832 (lshiftrt:DI (match_dup 0)
5833 (match_operand:SI 2 "immediate_operand" "J")))
5835 (mod:SI (match_dup 0)
5836 (match_operand:SI 3 "nonimmediate_operand" "g")))
5842 output_asm_insn (\"l\\t%0,%1\", operands);
5843 output_asm_insn (\"srdl\\t%0,%b2\", operands);
5845 if (REG_P (operands[3]))
5846 output_asm_insn (\"dr\\t%0,%3\", operands);
5848 output_asm_insn (\"d\\t%0,%3\", operands);
5850 return \"st\\t%0,%1\";