1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3 ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and
4 ;; Ulrich Weigand (uweigand@de.ibm.com).
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify it under
9 ;; the terms of the GNU General Public License as published by the Free
10 ;; Software Foundation; either version 2, or (at your option) any later
13 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING. If not, write to the Free
20 ;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
24 ;; Special constraints for s/390 machine description:
26 ;; a -- Any address register from 1 to 15.
27 ;; d -- Any register from 0 to 15.
28 ;; I -- An 8-bit constant (0..255).
29 ;; J -- A 12-bit constant (0..4095).
30 ;; K -- A 16-bit constant (-32768..32767).
31 ;; Q -- A memory reference without index-register.
32 ;; S -- Valid operand for the LARL instruction.
34 ;; Special formats used for outputting 390 instructions.
36 ;; %b -- Print a constant byte integer. xy
37 ;; %h -- Print a signed 16-bit. wxyz
38 ;; %N -- Print next register (second word of a DImode reg) or next word.
39 ;; %M -- Print next register (second word of a TImode reg) or next word.
40 ;; %O -- Print the offset of a memory reference (PLUS (REG) (CONST_INT)).
41 ;; %R -- Print the register of a memory reference (PLUS (REG) (CONST_INT)).
43 ;; We have a special constraint for pattern matching.
45 ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
57 ; GOT/PLT and lt-relative accesses
58 (UNSPEC_LTREL_OFFSET 100)
59 (UNSPEC_LTREL_BASE 101)
67 (UNSPEC_RELOAD_BASE 210)
69 ; TLS relocation specifiers
74 (UNSPEC_GOTNTPOFF 504)
75 (UNSPEC_INDNTPOFF 505)
79 (UNSPEC_TLSLDM_NTPOFF 511)
84 ;; UNSPEC_VOLATILE usage
93 (UNSPECV_POOL_START 201)
94 (UNSPECV_POOL_END 202)
95 (UNSPECV_POOL_ENTRY 203)
96 (UNSPECV_MAIN_POOL 300)
103 ;; Processor type. This attribute must exactly match the processor_type
104 ;; enumeration in s390.h.
106 (define_attr "cpu" "g5,g6,z900,z990"
107 (const (symbol_ref "s390_tune")))
109 ;; Define an insn type attribute. This is used in function unit delay
112 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
113 cs,vs,store,imul,idiv,
114 branch,jsr,fsimpd,fsimps,
115 floadd,floads,fstored, fstores,
116 fmuld,fmuls,fdivd,fdivs,
117 ftoi,itof,fsqrtd,fsqrts,
119 (const_string "integer"))
121 ;; Operand type. Used to default length attribute values
123 (define_attr "op_type"
124 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
127 ;; Insn are devide in two classes:
128 ;; agen: Insn using agen
129 ;; reg: Insn not using agen
131 (define_attr "atype" "agen,reg"
132 (cond [ (eq_attr "op_type" "E") (const_string "reg")
133 (eq_attr "op_type" "RR") (const_string "reg")
134 (eq_attr "op_type" "RX") (const_string "agen")
135 (eq_attr "op_type" "RI") (const_string "reg")
136 (eq_attr "op_type" "RRE") (const_string "reg")
137 (eq_attr "op_type" "RS") (const_string "agen")
138 (eq_attr "op_type" "RSI") (const_string "agen")
139 (eq_attr "op_type" "S") (const_string "agen")
140 (eq_attr "op_type" "SI") (const_string "agen")
141 (eq_attr "op_type" "SS") (const_string "agen")
142 (eq_attr "op_type" "SSE") (const_string "agen")
143 (eq_attr "op_type" "RXE") (const_string "agen")
144 (eq_attr "op_type" "RSE") (const_string "agen")
145 (eq_attr "op_type" "RIL") (const_string "agen")
146 (eq_attr "op_type" "RXY") (const_string "agen")
147 (eq_attr "op_type" "RSY") (const_string "agen")
148 (eq_attr "op_type" "SIY") (const_string "agen")]
149 (const_string "reg")))
151 ;; Generic pipeline function unit.
153 (define_function_unit "integer" 1 0
154 (eq_attr "type" "none") 0 0)
156 (define_function_unit "integer" 1 0
157 (eq_attr "type" "integer") 1 1)
159 (define_function_unit "integer" 1 0
160 (eq_attr "type" "fsimpd") 1 1)
162 (define_function_unit "integer" 1 0
163 (eq_attr "type" "fsimps") 1 1)
165 (define_function_unit "integer" 1 0
166 (eq_attr "type" "load") 1 1)
168 (define_function_unit "integer" 1 0
169 (eq_attr "type" "floadd") 1 1)
171 (define_function_unit "integer" 1 0
172 (eq_attr "type" "floads") 1 1)
174 (define_function_unit "integer" 1 0
175 (eq_attr "type" "la") 1 1)
177 (define_function_unit "integer" 1 0
178 (eq_attr "type" "larl") 1 1)
180 (define_function_unit "integer" 1 0
181 (eq_attr "type" "lr") 1 1)
183 (define_function_unit "integer" 1 0
184 (eq_attr "type" "branch") 1 1)
186 (define_function_unit "integer" 1 0
187 (eq_attr "type" "store") 1 1)
189 (define_function_unit "integer" 1 0
190 (eq_attr "type" "fstored") 1 1)
192 (define_function_unit "integer" 1 0
193 (eq_attr "type" "fstores") 1 1)
195 (define_function_unit "integer" 1 0
196 (eq_attr "type" "lm") 2 2)
198 (define_function_unit "integer" 1 0
199 (eq_attr "type" "stm") 2 2)
201 (define_function_unit "integer" 1 0
202 (eq_attr "type" "cs") 5 5)
204 (define_function_unit "integer" 1 0
205 (eq_attr "type" "vs") 30 30)
207 (define_function_unit "integer" 1 0
208 (eq_attr "type" "jsr") 5 5)
210 (define_function_unit "integer" 1 0
211 (eq_attr "type" "imul") 7 7)
213 (define_function_unit "integer" 1 0
214 (eq_attr "type" "fmuld") 6 6)
216 (define_function_unit "integer" 1 0
217 (eq_attr "type" "fmuls") 6 6)
219 (define_function_unit "integer" 1 0
220 (eq_attr "type" "idiv") 33 33)
222 (define_function_unit "integer" 1 0
223 (eq_attr "type" "fdivd") 33 33)
225 (define_function_unit "integer" 1 0
226 (eq_attr "type" "fdivs") 33 33)
228 (define_function_unit "integer" 1 0
229 (eq_attr "type" "fsqrtd") 30 30)
231 (define_function_unit "integer" 1 0
232 (eq_attr "type" "fsqrts") 30 30)
234 (define_function_unit "integer" 1 0
235 (eq_attr "type" "ftoi") 2 2)
237 (define_function_unit "integer" 1 0
238 (eq_attr "type" "itof") 2 2)
240 (define_function_unit "integer" 1 0
241 (eq_attr "type" "o2") 2 2)
243 (define_function_unit "integer" 1 0
244 (eq_attr "type" "o3") 3 3)
246 (define_function_unit "integer" 1 0
247 (eq_attr "type" "other") 5 5)
249 ;; Pipeline description for z900
256 (define_attr "length" ""
257 (cond [ (eq_attr "op_type" "E") (const_int 2)
258 (eq_attr "op_type" "RR") (const_int 2)
259 (eq_attr "op_type" "RX") (const_int 4)
260 (eq_attr "op_type" "RI") (const_int 4)
261 (eq_attr "op_type" "RRE") (const_int 4)
262 (eq_attr "op_type" "RS") (const_int 4)
263 (eq_attr "op_type" "RSI") (const_int 4)
264 (eq_attr "op_type" "S") (const_int 4)
265 (eq_attr "op_type" "SI") (const_int 4)
266 (eq_attr "op_type" "SS") (const_int 6)
267 (eq_attr "op_type" "SSE") (const_int 6)
268 (eq_attr "op_type" "RXE") (const_int 6)
269 (eq_attr "op_type" "RSE") (const_int 6)
270 (eq_attr "op_type" "RIL") (const_int 6)
271 (eq_attr "op_type" "RXY") (const_int 6)
272 (eq_attr "op_type" "RSY") (const_int 6)
273 (eq_attr "op_type" "SIY") (const_int 6)]
276 ;; Define attributes for `asm' insns.
278 (define_asm_attributes [(set_attr "type" "other")
279 (set_attr "op_type" "NN")])
285 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
286 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
287 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
288 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
289 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
292 ; CCZ1 -> CCA/CCU/CCS/CCT
295 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
296 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
300 ;;- Compare instructions.
303 (define_expand "cmpdi"
305 (compare:CC (match_operand:DI 0 "register_operand" "")
306 (match_operand:DI 1 "general_operand" "")))]
309 s390_compare_op0 = operands[0];
310 s390_compare_op1 = operands[1];
314 (define_expand "cmpsi"
316 (compare:CC (match_operand:SI 0 "register_operand" "")
317 (match_operand:SI 1 "general_operand" "")))]
320 s390_compare_op0 = operands[0];
321 s390_compare_op1 = operands[1];
325 (define_expand "cmpdf"
327 (compare:CC (match_operand:DF 0 "register_operand" "")
328 (match_operand:DF 1 "general_operand" "")))]
331 s390_compare_op0 = operands[0];
332 s390_compare_op1 = operands[1];
336 (define_expand "cmpsf"
338 (compare:CC (match_operand:SF 0 "register_operand" "")
339 (match_operand:SF 1 "general_operand" "")))]
342 s390_compare_op0 = operands[0];
343 s390_compare_op1 = operands[1];
348 ; Test-under-Mask (zero_extract) instructions
350 (define_insn "*tmdi_ext"
352 (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
353 (match_operand:DI 1 "const_int_operand" "n")
354 (match_operand:DI 2 "const_int_operand" "n"))
356 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
357 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
358 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 64
359 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
360 == INTVAL (operands[2]) >> 4"
362 int part = INTVAL (operands[2]) >> 4;
363 int block = (1 << INTVAL (operands[1])) - 1;
364 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
366 operands[2] = GEN_INT (block << shift);
370 case 0: return "tmhh\t%0,%x2";
371 case 1: return "tmhl\t%0,%x2";
372 case 2: return "tmlh\t%0,%x2";
373 case 3: return "tmll\t%0,%x2";
377 [(set_attr "op_type" "RI")])
379 (define_insn "*tmsi_ext"
381 (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
382 (match_operand:SI 1 "const_int_operand" "n")
383 (match_operand:SI 2 "const_int_operand" "n"))
385 "s390_match_ccmode(insn, CCTmode)
386 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
387 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
388 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
389 == INTVAL (operands[2]) >> 4"
391 int part = INTVAL (operands[2]) >> 4;
392 int block = (1 << INTVAL (operands[1])) - 1;
393 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
395 operands[2] = GEN_INT (block << shift);
399 case 0: return "tmh\t%0,%x2";
400 case 1: return "tml\t%0,%x2";
404 [(set_attr "op_type" "RI")])
406 (define_insn "*tmqi_ext"
408 (compare (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,S")
409 (match_operand:SI 1 "const_int_operand" "n,n")
410 (match_operand:SI 2 "const_int_operand" "n,n"))
412 "s390_match_ccmode(insn, CCTmode)
413 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
414 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
416 int block = (1 << INTVAL (operands[1])) - 1;
417 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
419 operands[2] = GEN_INT (block << shift);
420 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
422 [(set_attr "op_type" "SI,SIY")])
424 ; Test-under-Mask instructions
426 (define_insn "*tmdi_mem"
428 (compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S")
429 (match_operand:DI 1 "immediate_operand" "n,n"))
430 (match_operand:DI 2 "immediate_operand" "n,n")))]
432 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
433 && s390_single_qi (operands[1], DImode, 0) >= 0"
435 int part = s390_single_qi (operands[1], DImode, 0);
436 operands[1] = GEN_INT (s390_extract_qi (operands[1], DImode, part));
438 operands[0] = gen_rtx_MEM (QImode,
439 plus_constant (XEXP (operands[0], 0), part));
440 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
442 [(set_attr "op_type" "SI,SIY")])
444 (define_insn "*tmsi_mem"
446 (compare (and:SI (match_operand:SI 0 "memory_operand" "Q,S")
447 (match_operand:SI 1 "immediate_operand" "n,n"))
448 (match_operand:SI 2 "immediate_operand" "n,n")))]
449 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
450 && s390_single_qi (operands[1], SImode, 0) >= 0"
452 int part = s390_single_qi (operands[1], SImode, 0);
453 operands[1] = GEN_INT (s390_extract_qi (operands[1], SImode, part));
455 operands[0] = gen_rtx_MEM (QImode,
456 plus_constant (XEXP (operands[0], 0), part));
457 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
459 [(set_attr "op_type" "SI")])
461 (define_insn "*tmhi_mem"
463 (compare (and:SI (subreg:SI (match_operand:HI 0 "memory_operand" "Q,S") 0)
464 (match_operand:SI 1 "immediate_operand" "n,n"))
465 (match_operand:SI 2 "immediate_operand" "n,n")))]
466 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
467 && s390_single_qi (operands[1], HImode, 0) >= 0"
469 int part = s390_single_qi (operands[1], HImode, 0);
470 operands[1] = GEN_INT (s390_extract_qi (operands[1], HImode, part));
472 operands[0] = gen_rtx_MEM (QImode,
473 plus_constant (XEXP (operands[0], 0), part));
474 return which_alternative == 0 ? "tm\t%0,%b1" : "tmy\t%0,%b1";
476 [(set_attr "op_type" "SI")])
478 (define_insn "*tmqi_mem"
480 (compare (and:SI (subreg:SI (match_operand:QI 0 "memory_operand" "Q,S") 0)
481 (match_operand:SI 1 "immediate_operand" "n,n"))
482 (match_operand:SI 2 "immediate_operand" "n,n")))]
483 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
487 [(set_attr "op_type" "SI,SIY")])
489 (define_insn "*tmdi_reg"
491 (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d")
492 (match_operand:DI 1 "immediate_operand" "n"))
493 (match_operand:DI 2 "immediate_operand" "n")))]
495 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
496 && s390_single_hi (operands[1], DImode, 0) >= 0"
498 int part = s390_single_hi (operands[1], DImode, 0);
499 operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part));
503 case 0: return "tmhh\t%0,%x1";
504 case 1: return "tmhl\t%0,%x1";
505 case 2: return "tmlh\t%0,%x1";
506 case 3: return "tmll\t%0,%x1";
510 [(set_attr "op_type" "RI")])
512 (define_insn "*tmsi_reg"
514 (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d")
515 (match_operand:SI 1 "immediate_operand" "n"))
516 (match_operand:SI 2 "immediate_operand" "n")))]
517 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
518 && s390_single_hi (operands[1], SImode, 0) >= 0"
520 int part = s390_single_hi (operands[1], SImode, 0);
521 operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part));
525 case 0: return "tmh\t%0,%x1";
526 case 1: return "tml\t%0,%x1";
530 [(set_attr "op_type" "RI")])
532 (define_insn "*tmhi_full"
534 (compare (match_operand:HI 0 "register_operand" "d")
535 (match_operand:HI 1 "immediate_operand" "n")))]
536 "s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))"
538 [(set_attr "op_type" "RX")])
540 (define_insn "*tmqi_full"
542 (compare (match_operand:QI 0 "register_operand" "d")
543 (match_operand:QI 1 "immediate_operand" "n")))]
544 "s390_match_ccmode (insn, s390_tm_ccmode (GEN_INT (-1), operands[1], 1))"
546 [(set_attr "op_type" "RI")])
549 ; Load-and-Test instructions
551 (define_insn "*tstdi_sign"
553 (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
554 (const_int 32)) (const_int 32))
555 (match_operand:DI 1 "const0_operand" "")))
556 (set (match_operand:DI 2 "register_operand" "=d")
557 (sign_extend:DI (match_dup 0)))]
558 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
560 [(set_attr "op_type" "RRE")])
562 (define_insn "*tstdi"
564 (compare (match_operand:DI 0 "register_operand" "d")
565 (match_operand:DI 1 "const0_operand" "")))
566 (set (match_operand:DI 2 "register_operand" "=d")
568 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
570 [(set_attr "op_type" "RRE")])
572 (define_insn "*tstdi_cconly"
574 (compare (match_operand:DI 0 "register_operand" "d")
575 (match_operand:DI 1 "const0_operand" "")))]
576 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
578 [(set_attr "op_type" "RRE")])
580 (define_insn "*tstdi_cconly_31"
582 (compare (match_operand:DI 0 "register_operand" "d")
583 (match_operand:DI 1 "const0_operand" "")))]
584 "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
586 [(set_attr "op_type" "RS")
587 (set_attr "atype" "reg")])
590 (define_insn "*tstsi"
592 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
593 (match_operand:SI 1 "const0_operand" "")))
594 (set (match_operand:SI 2 "register_operand" "=d,d,d")
596 "s390_match_ccmode(insn, CCSmode)"
601 [(set_attr "op_type" "RR,RS,RSY")])
603 (define_insn "*tstsi_cconly"
605 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
606 (match_operand:SI 1 "const0_operand" "")))
607 (clobber (match_scratch:SI 2 "=X,d,d"))]
608 "s390_match_ccmode(insn, CCSmode)"
613 [(set_attr "op_type" "RR,RS,RSY")])
615 (define_insn "*tstsi_cconly2"
617 (compare (match_operand:SI 0 "register_operand" "d")
618 (match_operand:SI 1 "const0_operand" "")))]
619 "s390_match_ccmode(insn, CCSmode)"
621 [(set_attr "op_type" "RR")])
623 (define_insn "*tsthiCCT"
625 (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d")
626 (match_operand:HI 1 "const0_operand" "")))
627 (set (match_operand:HI 2 "register_operand" "=d,d,0")
629 "s390_match_ccmode(insn, CCTmode)"
634 [(set_attr "op_type" "RS,RSY,RI")])
636 (define_insn "*tsthiCCT_cconly"
638 (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d")
639 (match_operand:HI 1 "const0_operand" "")))
640 (clobber (match_scratch:HI 2 "=d,d,X"))]
641 "s390_match_ccmode(insn, CCTmode)"
646 [(set_attr "op_type" "RS,RSY,RI")])
648 (define_insn "*tsthi"
650 (compare (match_operand:HI 0 "s_operand" "Q,S")
651 (match_operand:HI 1 "const0_operand" "")))
652 (set (match_operand:HI 2 "register_operand" "=d,d")
654 "s390_match_ccmode(insn, CCSmode)"
658 [(set_attr "op_type" "RS,RSY")])
660 (define_insn "*tsthi_cconly"
662 (compare (match_operand:HI 0 "s_operand" "Q,S")
663 (match_operand:HI 1 "const0_operand" "")))
664 (clobber (match_scratch:HI 2 "=d,d"))]
665 "s390_match_ccmode(insn, CCSmode)"
669 [(set_attr "op_type" "RS,RSY")])
671 (define_insn "*tstqiCCT"
673 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
674 (match_operand:QI 1 "const0_operand" "")))
675 (set (match_operand:QI 2 "register_operand" "=d,d,0")
677 "s390_match_ccmode(insn, CCTmode)"
682 [(set_attr "op_type" "RS,RSY,RI")])
684 (define_insn "*tstqiCCT_cconly"
686 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
687 (match_operand:QI 1 "const0_operand" "")))]
688 "s390_match_ccmode(insn, CCTmode)"
693 [(set_attr "op_type" "SI,SIY,RI")])
695 (define_insn "*tstqi"
697 (compare (match_operand:QI 0 "s_operand" "Q,S")
698 (match_operand:QI 1 "const0_operand" "")))
699 (set (match_operand:QI 2 "register_operand" "=d,d")
701 "s390_match_ccmode(insn, CCSmode)"
705 [(set_attr "op_type" "RS,RSY")])
707 (define_insn "*tstqi_cconly"
709 (compare (match_operand:QI 0 "s_operand" "Q,S")
710 (match_operand:QI 1 "const0_operand" "")))
711 (clobber (match_scratch:QI 2 "=d,d"))]
712 "s390_match_ccmode(insn, CCSmode)"
716 [(set_attr "op_type" "RS,RSY")])
719 ; Compare (signed) instructions
721 (define_insn "*cmpdi_ccs_sign"
723 (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
724 (match_operand:DI 0 "register_operand" "d,d")))]
725 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
729 [(set_attr "op_type" "RRE,RXY")])
731 (define_insn "*cmpdi_ccs"
733 (compare (match_operand:DI 0 "register_operand" "d,d,d")
734 (match_operand:DI 1 "general_operand" "d,K,m")))]
735 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
740 [(set_attr "op_type" "RRE,RI,RXY")])
742 (define_insn "*cmpsi_ccs_sign"
744 (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
745 (match_operand:SI 0 "register_operand" "d,d")))]
746 "s390_match_ccmode(insn, CCSRmode)"
750 [(set_attr "op_type" "RX,RXY")])
752 (define_insn "*cmpsi_ccs"
754 (compare (match_operand:SI 0 "register_operand" "d,d,d,d")
755 (match_operand:SI 1 "general_operand" "d,K,R,T")))]
756 "s390_match_ccmode(insn, CCSmode)"
762 [(set_attr "op_type" "RR,RI,RX,RXY")])
765 ; Compare (unsigned) instructions
767 (define_insn "*cmpdi_ccu_zero"
769 (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
770 (match_operand:DI 0 "register_operand" "d,d")))]
771 "s390_match_ccmode(insn, CCURmode) && TARGET_64BIT"
775 [(set_attr "op_type" "RRE,RXY")])
777 (define_insn "*cmpdi_ccu"
779 (compare (match_operand:DI 0 "register_operand" "d,d")
780 (match_operand:DI 1 "general_operand" "d,m")))]
781 "s390_match_ccmode(insn, CCUmode) && TARGET_64BIT"
785 [(set_attr "op_type" "RRE,RXY")])
787 (define_insn "*cmpsi_ccu"
789 (compare (match_operand:SI 0 "register_operand" "d,d,d")
790 (match_operand:SI 1 "general_operand" "d,R,T")))]
791 "s390_match_ccmode(insn, CCUmode)"
796 [(set_attr "op_type" "RR,RX,RXY")])
798 (define_insn "*cmphi_ccu"
800 (compare (match_operand:HI 0 "register_operand" "d,d")
801 (match_operand:HI 1 "s_imm_operand" "Q,S")))]
802 "s390_match_ccmode(insn, CCUmode)"
806 [(set_attr "op_type" "RS,RSY")])
808 (define_insn "*cmpqi_ccu"
810 (compare (match_operand:QI 0 "register_operand" "d,d")
811 (match_operand:QI 1 "s_imm_operand" "Q,S")))]
812 "s390_match_ccmode(insn, CCUmode)"
816 [(set_attr "op_type" "RS,RSY")])
820 (compare (match_operand:QI 0 "memory_operand" "Q,S")
821 (match_operand:QI 1 "immediate_operand" "n,n")))]
822 "s390_match_ccmode (insn, CCUmode)"
826 [(set_attr "op_type" "SI,SIY")])
828 (define_insn "*cmpdi_ccu_mem"
830 (compare (match_operand:DI 0 "s_operand" "Q")
831 (match_operand:DI 1 "s_imm_operand" "Q")))]
832 "s390_match_ccmode(insn, CCUmode)"
834 [(set_attr "op_type" "SS")])
836 (define_insn "*cmpsi_ccu_mem"
838 (compare (match_operand:SI 0 "s_operand" "Q")
839 (match_operand:SI 1 "s_imm_operand" "Q")))]
840 "s390_match_ccmode(insn, CCUmode)"
842 [(set_attr "op_type" "SS")])
844 (define_insn "*cmphi_ccu_mem"
846 (compare (match_operand:HI 0 "s_operand" "Q")
847 (match_operand:HI 1 "s_imm_operand" "Q")))]
848 "s390_match_ccmode(insn, CCUmode)"
850 [(set_attr "op_type" "SS")])
852 (define_insn "*cmpqi_ccu_mem"
854 (compare (match_operand:QI 0 "s_operand" "Q")
855 (match_operand:QI 1 "s_imm_operand" "Q")))]
856 "s390_match_ccmode(insn, CCUmode)"
858 [(set_attr "op_type" "SS")])
863 (define_insn "*cmpdf_ccs_0"
865 (compare (match_operand:DF 0 "register_operand" "f")
866 (match_operand:DF 1 "const0_operand" "")))]
867 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
869 [(set_attr "op_type" "RRE")
870 (set_attr "type" "fsimpd")])
872 (define_insn "*cmpdf_ccs_0_ibm"
874 (compare (match_operand:DF 0 "register_operand" "f")
875 (match_operand:DF 1 "const0_operand" "")))]
876 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
878 [(set_attr "op_type" "RR")
879 (set_attr "type" "fsimpd")])
881 (define_insn "*cmpdf_ccs"
883 (compare (match_operand:DF 0 "register_operand" "f,f")
884 (match_operand:DF 1 "general_operand" "f,R")))]
885 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
889 [(set_attr "op_type" "RRE,RXE")
890 (set_attr "type" "fsimpd")])
892 (define_insn "*cmpdf_ccs_ibm"
894 (compare (match_operand:DF 0 "register_operand" "f,f")
895 (match_operand:DF 1 "general_operand" "f,R")))]
896 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
900 [(set_attr "op_type" "RR,RX")
901 (set_attr "type" "fsimpd")])
906 (define_insn "*cmpsf_ccs_0"
908 (compare (match_operand:SF 0 "register_operand" "f")
909 (match_operand:SF 1 "const0_operand" "")))]
910 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
912 [(set_attr "op_type" "RRE")
913 (set_attr "type" "fsimps")])
915 (define_insn "*cmpsf_ccs_0_ibm"
917 (compare (match_operand:SF 0 "register_operand" "f")
918 (match_operand:SF 1 "const0_operand" "")))]
919 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
921 [(set_attr "op_type" "RR")
922 (set_attr "type" "fsimps")])
924 (define_insn "*cmpsf_ccs"
926 (compare (match_operand:SF 0 "register_operand" "f,f")
927 (match_operand:SF 1 "general_operand" "f,R")))]
928 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
932 [(set_attr "op_type" "RRE,RXE")
933 (set_attr "type" "fsimps")])
935 (define_insn "*cmpsf_ccs"
937 (compare (match_operand:SF 0 "register_operand" "f,f")
938 (match_operand:SF 1 "general_operand" "f,R")))]
939 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
943 [(set_attr "op_type" "RR,RX")
944 (set_attr "type" "fsimps")])
948 ;;- Move instructions.
952 ; movti instruction pattern(s).
956 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
957 (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
965 [(set_attr "op_type" "RSY,RSY,NN,NN,SS")
966 (set_attr "type" "lm,stm,*,*,cs")])
969 [(set (match_operand:TI 0 "nonimmediate_operand" "")
970 (match_operand:TI 1 "general_operand" ""))]
971 "TARGET_64BIT && reload_completed
972 && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
973 [(set (match_dup 2) (match_dup 4))
974 (set (match_dup 3) (match_dup 5))]
976 operands[2] = operand_subword (operands[0], 0, 0, TImode);
977 operands[3] = operand_subword (operands[0], 1, 0, TImode);
978 operands[4] = operand_subword (operands[1], 0, 0, TImode);
979 operands[5] = operand_subword (operands[1], 1, 0, TImode);
983 [(set (match_operand:TI 0 "nonimmediate_operand" "")
984 (match_operand:TI 1 "general_operand" ""))]
985 "TARGET_64BIT && reload_completed
986 && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
987 [(set (match_dup 2) (match_dup 4))
988 (set (match_dup 3) (match_dup 5))]
990 operands[2] = operand_subword (operands[0], 1, 0, TImode);
991 operands[3] = operand_subword (operands[0], 0, 0, TImode);
992 operands[4] = operand_subword (operands[1], 1, 0, TImode);
993 operands[5] = operand_subword (operands[1], 0, 0, TImode);
997 [(set (match_operand:TI 0 "register_operand" "")
998 (match_operand:TI 1 "memory_operand" ""))]
999 "TARGET_64BIT && reload_completed
1000 && !s_operand (operands[1], VOIDmode)"
1001 [(set (match_dup 0) (match_dup 1))]
1003 rtx addr = operand_subword (operands[0], 1, 0, TImode);
1004 s390_load_address (addr, XEXP (operands[1], 0));
1005 operands[1] = replace_equiv_address (operands[1], addr);
1008 (define_expand "reload_outti"
1009 [(parallel [(match_operand:TI 0 "memory_operand" "")
1010 (match_operand:TI 1 "register_operand" "d")
1011 (match_operand:DI 2 "register_operand" "=&a")])]
1014 s390_load_address (operands[2], XEXP (operands[0], 0));
1015 operands[0] = replace_equiv_address (operands[0], operands[2]);
1016 emit_move_insn (operands[0], operands[1]);
1021 ; movdi instruction pattern(s).
1024 (define_expand "movdi"
1025 [(set (match_operand:DI 0 "general_operand" "")
1026 (match_operand:DI 1 "general_operand" ""))]
1029 /* Handle symbolic constants. */
1030 if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1031 emit_symbolic_move (operands);
1033 /* During and after reload, we need to force constants
1034 to the literal pool ourselves, if necessary. */
1035 if ((reload_in_progress || reload_completed)
1036 && CONSTANT_P (operands[1])
1037 && (!legitimate_reload_constant_p (operands[1])
1038 || FP_REG_P (operands[0])))
1039 operands[1] = force_const_mem (DImode, operands[1]);
1042 (define_insn "*movdi_lhi"
1043 [(set (match_operand:DI 0 "register_operand" "=d")
1044 (match_operand:DI 1 "immediate_operand" "K"))]
1046 && GET_CODE (operands[1]) == CONST_INT
1047 && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
1048 && !FP_REG_P (operands[0])"
1050 [(set_attr "op_type" "RI")])
1052 (define_insn "*movdi_lli"
1053 [(set (match_operand:DI 0 "register_operand" "=d")
1054 (match_operand:DI 1 "immediate_operand" "n"))]
1055 "TARGET_64BIT && s390_single_hi (operands[1], DImode, 0) >= 0
1056 && !FP_REG_P (operands[0])"
1058 int part = s390_single_hi (operands[1], DImode, 0);
1059 operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part));
1063 case 0: return "llihh\t%0,%x1";
1064 case 1: return "llihl\t%0,%x1";
1065 case 2: return "llilh\t%0,%x1";
1066 case 3: return "llill\t%0,%x1";
1070 [(set_attr "op_type" "RI")])
1072 (define_insn "*movdi_lay"
1073 [(set (match_operand:DI 0 "register_operand" "=d")
1074 (match_operand:DI 1 "address_operand" "p"))]
1076 && TARGET_LONG_DISPLACEMENT
1077 && GET_CODE (operands[1]) == CONST_INT
1078 && !FP_REG_P (operands[0])"
1080 [(set_attr "op_type" "RXY")
1081 (set_attr "type" "la")])
1083 (define_insn "*movdi_larl"
1084 [(set (match_operand:DI 0 "register_operand" "=d")
1085 (match_operand:DI 1 "larl_operand" "X"))]
1087 && !FP_REG_P (operands[0])"
1089 [(set_attr "op_type" "RIL")
1090 (set_attr "type" "larl")])
1092 (define_insn "*movdi_64"
1093 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!*f,!R,!T,?Q")
1094 (match_operand:DI 1 "general_operand" "d,m,d,*f,R,T,*f,*f,?Q"))]
1106 [(set_attr "op_type" "RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
1107 (set_attr "type" "lr,load,store,floadd,floadd,floadd,fstored,fstored,cs")])
1109 (define_insn "*movdi_31"
1110 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
1111 (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
1124 [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS")
1125 (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")])
1128 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1129 (match_operand:DI 1 "general_operand" ""))]
1130 "!TARGET_64BIT && reload_completed
1131 && s390_split_ok_p (operands[0], operands[1], DImode, 0)"
1132 [(set (match_dup 2) (match_dup 4))
1133 (set (match_dup 3) (match_dup 5))]
1135 operands[2] = operand_subword (operands[0], 0, 0, DImode);
1136 operands[3] = operand_subword (operands[0], 1, 0, DImode);
1137 operands[4] = operand_subword (operands[1], 0, 0, DImode);
1138 operands[5] = operand_subword (operands[1], 1, 0, DImode);
1142 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1143 (match_operand:DI 1 "general_operand" ""))]
1144 "!TARGET_64BIT && reload_completed
1145 && s390_split_ok_p (operands[0], operands[1], DImode, 1)"
1146 [(set (match_dup 2) (match_dup 4))
1147 (set (match_dup 3) (match_dup 5))]
1149 operands[2] = operand_subword (operands[0], 1, 0, DImode);
1150 operands[3] = operand_subword (operands[0], 0, 0, DImode);
1151 operands[4] = operand_subword (operands[1], 1, 0, DImode);
1152 operands[5] = operand_subword (operands[1], 0, 0, DImode);
1156 [(set (match_operand:DI 0 "register_operand" "")
1157 (match_operand:DI 1 "memory_operand" ""))]
1158 "!TARGET_64BIT && reload_completed
1159 && !FP_REG_P (operands[0])
1160 && !s_operand (operands[1], VOIDmode)"
1161 [(set (match_dup 0) (match_dup 1))]
1163 rtx addr = operand_subword (operands[0], 1, 0, DImode);
1164 s390_load_address (addr, XEXP (operands[1], 0));
1165 operands[1] = replace_equiv_address (operands[1], addr);
1168 (define_expand "reload_outdi"
1169 [(parallel [(match_operand:DI 0 "memory_operand" "")
1170 (match_operand:DI 1 "register_operand" "d")
1171 (match_operand:SI 2 "register_operand" "=&a")])]
1174 s390_load_address (operands[2], XEXP (operands[0], 0));
1175 operands[0] = replace_equiv_address (operands[0], operands[2]);
1176 emit_move_insn (operands[0], operands[1]);
1181 [(set (match_operand:DI 0 "register_operand" "")
1182 (mem:DI (match_operand 1 "address_operand" "")))]
1184 && !FP_REG_P (operands[0])
1185 && GET_CODE (operands[1]) == SYMBOL_REF
1186 && CONSTANT_POOL_ADDRESS_P (operands[1])
1187 && get_pool_mode (operands[1]) == DImode
1188 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1189 [(set (match_dup 0) (match_dup 2))]
1190 "operands[2] = get_pool_constant (operands[1]);")
1193 ; movsi instruction pattern(s).
1196 (define_expand "movsi"
1197 [(set (match_operand:SI 0 "general_operand" "")
1198 (match_operand:SI 1 "general_operand" ""))]
1201 /* Handle symbolic constants. */
1202 if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1203 emit_symbolic_move (operands);
1205 /* expr.c tries to load an effective address using
1206 force_reg. This fails because we don't have a
1207 generic load_address pattern. Convert the move
1208 to a proper arithmetic operation instead, unless
1209 it is guaranteed to be OK. */
1210 if (GET_CODE (operands[1]) == PLUS
1211 && !legitimate_la_operand_p (operands[1]))
1213 operands[1] = force_operand (operands[1], operands[0]);
1214 if (operands[1] == operands[0])
1218 /* During and after reload, we need to force constants
1219 to the literal pool ourselves, if necessary. */
1220 if ((reload_in_progress || reload_completed)
1221 && CONSTANT_P (operands[1])
1222 && (!legitimate_reload_constant_p (operands[1])
1223 || FP_REG_P (operands[0])))
1224 operands[1] = force_const_mem (SImode, operands[1]);
1227 (define_insn "*movsi_lhi"
1228 [(set (match_operand:SI 0 "register_operand" "=d")
1229 (match_operand:SI 1 "immediate_operand" "K"))]
1230 "GET_CODE (operands[1]) == CONST_INT
1231 && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
1232 && !FP_REG_P (operands[0])"
1234 [(set_attr "op_type" "RI")])
1236 (define_insn "*movsi_lli"
1237 [(set (match_operand:SI 0 "register_operand" "=d")
1238 (match_operand:SI 1 "immediate_operand" "n"))]
1239 "TARGET_64BIT && s390_single_hi (operands[1], SImode, 0) >= 0
1240 && !FP_REG_P (operands[0])"
1242 int part = s390_single_hi (operands[1], SImode, 0);
1243 operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part));
1247 case 0: return "llilh\t%0,%x1";
1248 case 1: return "llill\t%0,%x1";
1252 [(set_attr "op_type" "RI")])
1254 (define_insn "*movsi_lay"
1255 [(set (match_operand:SI 0 "register_operand" "=d")
1256 (match_operand:SI 1 "address_operand" "p"))]
1257 "TARGET_LONG_DISPLACEMENT
1258 && GET_CODE (operands[1]) == CONST_INT
1259 && !FP_REG_P (operands[0])"
1261 [(set_attr "op_type" "RXY")
1262 (set_attr "type" "la")])
1264 (define_insn "*movsi"
1265 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
1266 (match_operand:SI 1 "general_operand" "d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
1280 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1281 (set_attr "type" "lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
1284 [(set (match_operand:SI 0 "register_operand" "")
1285 (mem:SI (match_operand 1 "address_operand" "")))]
1286 "!FP_REG_P (operands[0])
1287 && GET_CODE (operands[1]) == SYMBOL_REF
1288 && CONSTANT_POOL_ADDRESS_P (operands[1])
1289 && get_pool_mode (operands[1]) == SImode
1290 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1291 [(set (match_dup 0) (match_dup 2))]
1292 "operands[2] = get_pool_constant (operands[1]);")
1295 ; movhi instruction pattern(s).
1298 (define_insn "movhi"
1299 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1300 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1310 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1311 (set_attr "type" "lr,*,*,*,store,store,cs")])
1314 [(set (match_operand:HI 0 "register_operand" "")
1315 (mem:HI (match_operand 1 "address_operand" "")))]
1316 "GET_CODE (operands[1]) == SYMBOL_REF
1317 && CONSTANT_POOL_ADDRESS_P (operands[1])
1318 && get_pool_mode (operands[1]) == HImode
1319 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1320 [(set (match_dup 0) (match_dup 2))]
1321 "operands[2] = get_pool_constant (operands[1]);")
1324 ; movqi instruction pattern(s).
1327 (define_insn "movqi_64"
1328 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,R,T,Q,S,?Q")
1329 (match_operand:QI 1 "general_operand" "d,n,m,d,d,n,n,?Q"))]
1340 [(set_attr "op_type" "RR,RI,RXY,RX,RXY,SI,SIY,SS")
1341 (set_attr "type" "lr,*,*,store,store,store,store,cs")])
1343 (define_insn "movqi"
1344 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1345 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1357 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1358 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1361 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1362 (mem:QI (match_operand 1 "address_operand" "")))]
1363 "GET_CODE (operands[1]) == SYMBOL_REF
1364 && CONSTANT_POOL_ADDRESS_P (operands[1])
1365 && get_pool_mode (operands[1]) == QImode
1366 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1367 [(set (match_dup 0) (match_dup 2))]
1368 "operands[2] = get_pool_constant (operands[1]);")
1371 ; movstrictqi instruction pattern(s).
1374 (define_insn "*movstrictqi"
1375 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1376 (match_operand:QI 1 "memory_operand" "R,T"))]
1381 [(set_attr "op_type" "RX,RXY")])
1384 ; movstricthi instruction pattern(s).
1387 (define_insn "*movstricthi"
1388 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1389 (match_operand:HI 1 "s_imm_operand" "Q,S"))
1390 (clobber (reg:CC 33))]
1395 [(set_attr "op_type" "RS,RSY")])
1398 ; movstrictsi instruction pattern(s).
1401 (define_insn "movstrictsi"
1402 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1403 (match_operand:SI 1 "general_operand" "d,R,T"))]
1409 [(set_attr "op_type" "RR,RX,RXY")
1410 (set_attr "type" "lr,load,load")])
1413 ; movdf instruction pattern(s).
1416 (define_expand "movdf"
1417 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1418 (match_operand:DF 1 "general_operand" ""))]
1421 /* During and after reload, we need to force constants
1422 to the literal pool ourselves, if necessary. */
1423 if ((reload_in_progress || reload_completed)
1424 && CONSTANT_P (operands[1]))
1425 operands[1] = force_const_mem (DFmode, operands[1]);
1428 (define_insn "*movdf_64"
1429 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1430 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1442 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1443 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1445 (define_insn "*movdf_31"
1446 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1447 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1460 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1461 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1464 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1465 (match_operand:DF 1 "general_operand" ""))]
1466 "!TARGET_64BIT && reload_completed
1467 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1468 [(set (match_dup 2) (match_dup 4))
1469 (set (match_dup 3) (match_dup 5))]
1471 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1472 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1473 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1474 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1478 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1479 (match_operand:DF 1 "general_operand" ""))]
1480 "!TARGET_64BIT && reload_completed
1481 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1482 [(set (match_dup 2) (match_dup 4))
1483 (set (match_dup 3) (match_dup 5))]
1485 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1486 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1487 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1488 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1492 [(set (match_operand:DF 0 "register_operand" "")
1493 (match_operand:DF 1 "memory_operand" ""))]
1494 "!TARGET_64BIT && reload_completed
1495 && !FP_REG_P (operands[0])
1496 && !s_operand (operands[1], VOIDmode)"
1497 [(set (match_dup 0) (match_dup 1))]
1499 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1500 s390_load_address (addr, XEXP (operands[1], 0));
1501 operands[1] = replace_equiv_address (operands[1], addr);
1504 (define_expand "reload_outdf"
1505 [(parallel [(match_operand:DF 0 "memory_operand" "")
1506 (match_operand:DF 1 "register_operand" "d")
1507 (match_operand:SI 2 "register_operand" "=&a")])]
1510 s390_load_address (operands[2], XEXP (operands[0], 0));
1511 operands[0] = replace_equiv_address (operands[0], operands[2]);
1512 emit_move_insn (operands[0], operands[1]);
1517 ; movsf instruction pattern(s).
1520 (define_expand "movsf"
1521 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1522 (match_operand:SF 1 "general_operand" ""))]
1525 /* During and after reload, we need to force constants
1526 to the literal pool ourselves, if necessary. */
1527 if ((reload_in_progress || reload_completed)
1528 && CONSTANT_P (operands[1]))
1529 operands[1] = force_const_mem (SFmode, operands[1]);
1532 (define_insn "*movsf"
1533 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1534 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1548 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1549 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1552 ; load_multiple pattern(s).
1555 (define_expand "load_multiple"
1556 [(match_par_dup 3 [(set (match_operand 0 "" "")
1557 (match_operand 1 "" ""))
1558 (use (match_operand 2 "" ""))])]
1566 /* Support only loading a constant number of fixed-point registers from
1567 memory and only bother with this if more than two */
1568 if (GET_CODE (operands[2]) != CONST_INT
1569 || INTVAL (operands[2]) < 2
1570 || INTVAL (operands[2]) > 16
1571 || GET_CODE (operands[1]) != MEM
1572 || GET_CODE (operands[0]) != REG
1573 || REGNO (operands[0]) >= 16)
1576 count = INTVAL (operands[2]);
1577 regno = REGNO (operands[0]);
1579 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1582 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1584 from = XEXP (operands[1], 0);
1587 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1588 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1589 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1591 from = XEXP (XEXP (operands[1], 0), 0);
1592 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1597 if (from == frame_pointer_rtx || from == arg_pointer_rtx)
1602 from = force_reg (Pmode, XEXP (operands[1], 0));
1606 for (i = 0; i < count; i++)
1607 XVECEXP (operands[3], 0, i)
1608 = gen_rtx_SET (VOIDmode, gen_rtx_REG (Pmode, regno + i),
1609 change_address (operands[1], Pmode,
1610 plus_constant (from,
1611 off + i * UNITS_PER_WORD)));
1614 (define_insn "*load_multiple_di"
1615 [(match_parallel 0 "load_multiple_operation"
1616 [(set (match_operand:DI 1 "register_operand" "=r")
1617 (match_operand:DI 2 "s_operand" "QS"))])]
1620 int words = XVECLEN (operands[0], 0);
1621 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1622 return "lmg\t%1,%0,%2";
1624 [(set_attr "op_type" "RSY")
1625 (set_attr "type" "lm")])
1627 (define_insn "*load_multiple_si"
1628 [(match_parallel 0 "load_multiple_operation"
1629 [(set (match_operand:SI 1 "register_operand" "=r,r")
1630 (match_operand:SI 2 "s_operand" "Q,S"))])]
1633 int words = XVECLEN (operands[0], 0);
1634 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1635 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1637 [(set_attr "op_type" "RS,RSY")
1638 (set_attr "type" "lm")])
1641 ; store multiple pattern(s).
1644 (define_expand "store_multiple"
1645 [(match_par_dup 3 [(set (match_operand 0 "" "")
1646 (match_operand 1 "" ""))
1647 (use (match_operand 2 "" ""))])]
1655 /* Support only storing a constant number of fixed-point registers to
1656 memory and only bother with this if more than two. */
1657 if (GET_CODE (operands[2]) != CONST_INT
1658 || INTVAL (operands[2]) < 2
1659 || INTVAL (operands[2]) > 16
1660 || GET_CODE (operands[0]) != MEM
1661 || GET_CODE (operands[1]) != REG
1662 || REGNO (operands[1]) >= 16)
1665 count = INTVAL (operands[2]);
1666 regno = REGNO (operands[1]);
1668 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1672 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1674 to = XEXP (operands[0], 0);
1677 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1678 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1679 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1681 to = XEXP (XEXP (operands[0], 0), 0);
1682 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1687 if (to == frame_pointer_rtx || to == arg_pointer_rtx)
1692 to = force_reg (Pmode, XEXP (operands[0], 0));
1696 for (i = 0; i < count; i++)
1697 XVECEXP (operands[3], 0, i)
1698 = gen_rtx_SET (VOIDmode,
1699 change_address (operands[0], Pmode,
1701 off + i * UNITS_PER_WORD)),
1702 gen_rtx_REG (Pmode, regno + i));
1705 (define_insn "*store_multiple_di"
1706 [(match_parallel 0 "store_multiple_operation"
1707 [(set (match_operand:DI 1 "s_operand" "=QS")
1708 (match_operand:DI 2 "register_operand" "r"))])]
1711 int words = XVECLEN (operands[0], 0);
1712 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1713 return "stmg\t%2,%0,%1";
1715 [(set_attr "op_type" "RSY")
1716 (set_attr "type" "stm")])
1719 (define_insn "*store_multiple_si"
1720 [(match_parallel 0 "store_multiple_operation"
1721 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1722 (match_operand:SI 2 "register_operand" "r,r"))])]
1725 int words = XVECLEN (operands[0], 0);
1726 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1727 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1729 [(set_attr "op_type" "RS,RSY")
1730 (set_attr "type" "stm")])
1733 ;; String instructions.
1737 ; movstrM instruction pattern(s).
1740 (define_expand "movstrdi"
1741 [(set (match_operand:BLK 0 "memory_operand" "")
1742 (match_operand:BLK 1 "memory_operand" ""))
1743 (use (match_operand:DI 2 "general_operand" ""))
1744 (match_operand 3 "" "")]
1746 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1748 (define_expand "movstrsi"
1749 [(set (match_operand:BLK 0 "memory_operand" "")
1750 (match_operand:BLK 1 "memory_operand" ""))
1751 (use (match_operand:SI 2 "general_operand" ""))
1752 (match_operand 3 "" "")]
1754 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1756 ; Move a block that is up to 256 bytes in length.
1757 ; The block length is taken as (operands[2] % 256) + 1.
1759 (define_insn "movstr_short_64"
1760 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1761 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1762 (use (match_operand:DI 2 "nonmemory_operand" "n,a"))
1763 (clobber (match_scratch:DI 3 "=X,&a"))]
1766 switch (which_alternative)
1769 return "mvc\t%O0(%b2+1,%R0),%1";
1772 output_asm_insn ("bras\t%3,.+10", operands);
1773 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1774 return "ex\t%2,0(%3)";
1780 [(set_attr "op_type" "SS,NN")
1781 (set_attr "type" "cs,cs")
1782 (set_attr "atype" "*,agen")
1783 (set_attr "length" "*,14")])
1785 (define_insn "movstr_short_31"
1786 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1787 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1788 (use (match_operand:SI 2 "nonmemory_operand" "n,a"))
1789 (clobber (match_scratch:SI 3 "=X,&a"))]
1792 switch (which_alternative)
1795 return "mvc\t%O0(%b2+1,%R0),%1";
1798 output_asm_insn ("bras\t%3,.+10", operands);
1799 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1800 return "ex\t%2,0(%3)";
1806 [(set_attr "op_type" "SS,NN")
1807 (set_attr "type" "cs,cs")
1808 (set_attr "atype" "*,agen")
1809 (set_attr "length" "*,14")])
1811 ; Move a block of arbitrary length.
1813 (define_insn "movstr_long_64"
1814 [(set (match_operand:TI 0 "register_operand" "=d")
1815 (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0")
1816 (lshiftrt:TI (match_dup 2) (const_int 64)))
1818 (set (match_operand:TI 1 "register_operand" "=d")
1819 (ashift:TI (plus:TI (match_operand:TI 3 "register_operand" "1")
1820 (lshiftrt:TI (match_dup 3) (const_int 64)))
1822 (set (mem:BLK (subreg:DI (match_dup 2) 0))
1823 (mem:BLK (subreg:DI (match_dup 3) 0)))
1824 (clobber (reg:CC 33))]
1826 "mvcle\t%0,%1,0\;jo\t.-4"
1827 [(set_attr "op_type" "NN")
1828 (set_attr "type" "vs")
1829 (set_attr "length" "8")])
1831 (define_insn "movstr_long_31"
1832 [(set (match_operand:DI 0 "register_operand" "=d")
1833 (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0")
1834 (lshiftrt:DI (match_dup 2) (const_int 32)))
1836 (set (match_operand:DI 1 "register_operand" "=d")
1837 (ashift:DI (plus:DI (match_operand:DI 3 "register_operand" "1")
1838 (lshiftrt:DI (match_dup 3) (const_int 32)))
1840 (set (mem:BLK (subreg:SI (match_dup 2) 0))
1841 (mem:BLK (subreg:SI (match_dup 3) 0)))
1842 (clobber (reg:CC 33))]
1844 "mvcle\t%0,%1,0\;jo\t.-4"
1845 [(set_attr "op_type" "NN")
1846 (set_attr "type" "vs")
1847 (set_attr "length" "8")])
1850 ; clrstrM instruction pattern(s).
1853 (define_expand "clrstrdi"
1854 [(set (match_operand:BLK 0 "memory_operand" "")
1856 (use (match_operand:DI 1 "general_operand" ""))
1857 (match_operand 2 "" "")]
1859 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
1861 (define_expand "clrstrsi"
1862 [(set (match_operand:BLK 0 "memory_operand" "")
1864 (use (match_operand:SI 1 "general_operand" ""))
1865 (match_operand 2 "" "")]
1867 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
1869 ; Clear a block that is up to 256 bytes in length.
1870 ; The block length is taken as (operands[2] % 256) + 1.
1872 (define_insn "clrstr_short_64"
1873 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1875 (use (match_operand:DI 1 "nonmemory_operand" "n,a"))
1876 (clobber (match_scratch:DI 2 "=X,&a"))
1877 (clobber (reg:CC 33))]
1880 switch (which_alternative)
1883 return "xc\t%O0(%b1+1,%R0),%0";
1886 output_asm_insn ("bras\t%2,.+10", operands);
1887 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
1888 return "ex\t%1,0(%2)";
1894 [(set_attr "op_type" "SS,NN")
1895 (set_attr "type" "cs,cs")
1896 (set_attr "atype" "*,agen")
1897 (set_attr "length" "*,14")])
1899 (define_insn "clrstr_short_31"
1900 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1902 (use (match_operand:SI 1 "nonmemory_operand" "n,a"))
1903 (clobber (match_scratch:SI 2 "=X,&a"))
1904 (clobber (reg:CC 33))]
1907 switch (which_alternative)
1910 return "xc\t%O0(%b1+1,%R0),%0";
1913 output_asm_insn ("bras\t%2,.+10", operands);
1914 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
1915 return "ex\t%1,0(%2)";
1921 [(set_attr "op_type" "SS,NN")
1922 (set_attr "type" "cs,cs")
1923 (set_attr "atype" "*,agen")
1924 (set_attr "length" "*,14")])
1926 ; Clear a block of arbitrary length.
1928 (define_insn "clrstr_long_64"
1929 [(set (match_operand:TI 0 "register_operand" "=d")
1930 (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0")
1931 (lshiftrt:TI (match_dup 2) (const_int 64)))
1933 (set (mem:BLK (subreg:DI (match_dup 2) 0))
1935 (use (match_operand:TI 1 "register_operand" "d"))
1936 (clobber (reg:CC 33))]
1938 "mvcle\t%0,%1,0\;jo\t.-4"
1939 [(set_attr "op_type" "NN")
1940 (set_attr "type" "vs")
1941 (set_attr "length" "8")])
1943 (define_insn "clrstr_long_31"
1944 [(set (match_operand:DI 0 "register_operand" "=d")
1945 (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0")
1946 (lshiftrt:DI (match_dup 2) (const_int 32)))
1948 (set (mem:BLK (subreg:SI (match_dup 2) 0))
1950 (use (match_operand:DI 1 "register_operand" "d"))
1951 (clobber (reg:CC 33))]
1953 "mvcle\t%0,%1,0\;jo\t.-4"
1954 [(set_attr "op_type" "NN")
1955 (set_attr "type" "vs")
1956 (set_attr "length" "8")])
1959 ; cmpmemM instruction pattern(s).
1962 (define_expand "cmpmemdi"
1963 [(set (match_operand:DI 0 "register_operand" "")
1964 (compare:DI (match_operand:BLK 1 "memory_operand" "")
1965 (match_operand:BLK 2 "memory_operand" "") ) )
1966 (use (match_operand:DI 3 "general_operand" ""))
1967 (use (match_operand:DI 4 "" ""))]
1969 "s390_expand_cmpmem (operands[0], operands[1],
1970 operands[2], operands[3]); DONE;")
1972 (define_expand "cmpmemsi"
1973 [(set (match_operand:SI 0 "register_operand" "")
1974 (compare:SI (match_operand:BLK 1 "memory_operand" "")
1975 (match_operand:BLK 2 "memory_operand" "") ) )
1976 (use (match_operand:SI 3 "general_operand" ""))
1977 (use (match_operand:SI 4 "" ""))]
1979 "s390_expand_cmpmem (operands[0], operands[1],
1980 operands[2], operands[3]); DONE;")
1982 ; Compare a block that is up to 256 bytes in length.
1983 ; The block length is taken as (operands[2] % 256) + 1.
1985 (define_insn "cmpmem_short_64"
1987 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
1988 (match_operand:BLK 1 "memory_operand" "Q,Q")))
1989 (use (match_operand:DI 2 "nonmemory_operand" "n,a"))
1990 (clobber (match_scratch:DI 3 "=X,&a"))]
1993 switch (which_alternative)
1996 return "clc\t%O0(%b2+1,%R0),%1";
1999 output_asm_insn ("bras\t%3,.+10", operands);
2000 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2001 return "ex\t%2,0(%3)";
2007 [(set_attr "op_type" "SS,NN")
2008 (set_attr "type" "cs,cs")
2009 (set_attr "atype" "*,agen")
2010 (set_attr "length" "*,14")])
2012 (define_insn "cmpmem_short_31"
2014 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2015 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2016 (use (match_operand:SI 2 "nonmemory_operand" "n,a"))
2017 (clobber (match_scratch:SI 3 "=X,&a"))]
2020 switch (which_alternative)
2023 return "clc\t%O0(%b2+1,%R0),%1";
2026 output_asm_insn ("bras\t%3,.+10", operands);
2027 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2028 return "ex\t%2,0(%3)";
2034 [(set_attr "op_type" "SS,NN")
2035 (set_attr "type" "cs,cs")
2036 (set_attr "atype" "*,agen")
2037 (set_attr "length" "*,14")])
2039 ; Compare a block of arbitrary length.
2041 (define_insn "cmpmem_long_64"
2042 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2043 (clobber (match_operand:TI 1 "register_operand" "=d"))
2045 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2046 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2048 (use (match_dup 3))]
2051 [(set_attr "op_type" "RR")
2052 (set_attr "type" "vs")])
2054 (define_insn "cmpmem_long_31"
2055 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2056 (clobber (match_operand:DI 1 "register_operand" "=d"))
2058 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2059 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2061 (use (match_dup 3))]
2064 [(set_attr "op_type" "RR")
2065 (set_attr "type" "vs")])
2067 ; Convert condition code to integer in range (-1, 0, 1)
2069 (define_insn "cmpint_si"
2070 [(set (match_operand:SI 0 "register_operand" "=d")
2071 (compare:SI (reg:CCS 33) (const_int 0)))]
2074 output_asm_insn ("lhi\t%0,1", operands);
2075 output_asm_insn ("jh\t.+12", operands);
2076 output_asm_insn ("jl\t.+6", operands);
2077 output_asm_insn ("sr\t%0,%0", operands);
2078 return "lcr\t%0,%0";
2080 [(set_attr "op_type" "NN")
2081 (set_attr "length" "16")
2082 (set_attr "type" "other")])
2084 (define_insn "cmpint_di"
2085 [(set (match_operand:DI 0 "register_operand" "=d")
2086 (compare:DI (reg:CCS 33) (const_int 0)))]
2089 output_asm_insn ("lghi\t%0,1", operands);
2090 output_asm_insn ("jh\t.+12", operands);
2091 output_asm_insn ("jl\t.+6", operands);
2092 output_asm_insn ("sgr\t%0,%0", operands);
2093 return "lcgr\t%0,%0";
2095 [(set_attr "op_type" "NN")
2096 (set_attr "length" "22")
2097 (set_attr "type" "other")])
2101 ;;- Conversion instructions.
2104 (define_insn "*sethighqisi"
2105 [(set (match_operand:SI 0 "register_operand" "=d,d")
2106 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2107 (clobber (reg:CC 33))]
2112 [(set_attr "op_type" "RS,RSY")])
2114 (define_insn "*sethighhisi"
2115 [(set (match_operand:SI 0 "register_operand" "=d,d")
2116 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2117 (clobber (reg:CC 33))]
2122 [(set_attr "op_type" "RS,RSY")])
2124 (define_insn "*sethighqidi_64"
2125 [(set (match_operand:DI 0 "register_operand" "=d")
2126 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2127 (clobber (reg:CC 33))]
2130 [(set_attr "op_type" "RSY")])
2132 (define_insn "*sethighqidi_31"
2133 [(set (match_operand:DI 0 "register_operand" "=d,d")
2134 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2135 (clobber (reg:CC 33))]
2140 [(set_attr "op_type" "RS,RSY")])
2142 (define_insn_and_split "*extractqi"
2143 [(set (match_operand:SI 0 "register_operand" "=d")
2144 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2145 (match_operand 2 "const_int_operand" "n")
2147 (clobber (reg:CC 33))]
2149 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2151 "&& reload_completed"
2153 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2154 (clobber (reg:CC 33))])
2155 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2157 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2158 operands[1] = change_address (operands[1], QImode, 0);
2160 [(set_attr "atype" "agen")])
2162 (define_insn_and_split "*extracthi"
2163 [(set (match_operand:SI 0 "register_operand" "=d")
2164 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2165 (match_operand 2 "const_int_operand" "n")
2167 (clobber (reg:CC 33))]
2169 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2171 "&& reload_completed"
2173 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2174 (clobber (reg:CC 33))])
2175 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2177 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2178 operands[1] = change_address (operands[1], HImode, 0);
2180 [(set_attr "atype" "agen")])
2183 ; extendsidi2 instruction pattern(s).
2186 (define_expand "extendsidi2"
2187 [(set (match_operand:DI 0 "register_operand" "")
2188 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2194 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2195 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2196 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2197 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2203 (define_insn "*extendsidi2"
2204 [(set (match_operand:DI 0 "register_operand" "=d,d")
2205 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2210 [(set_attr "op_type" "RRE,RXY")])
2213 ; extendhidi2 instruction pattern(s).
2216 (define_expand "extendhidi2"
2217 [(set (match_operand:DI 0 "register_operand" "")
2218 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2224 rtx tmp = gen_reg_rtx (SImode);
2225 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2226 emit_insn (gen_extendsidi2 (operands[0], tmp));
2231 operands[1] = gen_lowpart (DImode, operands[1]);
2232 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2233 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2239 (define_insn "*extendhidi2"
2240 [(set (match_operand:DI 0 "register_operand" "=d")
2241 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2244 [(set_attr "op_type" "RXY")])
2247 ; extendqidi2 instruction pattern(s).
2250 (define_expand "extendqidi2"
2251 [(set (match_operand:DI 0 "register_operand" "")
2252 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2258 rtx tmp = gen_reg_rtx (SImode);
2259 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2260 emit_insn (gen_extendsidi2 (operands[0], tmp));
2265 operands[1] = gen_lowpart (DImode, operands[1]);
2266 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2267 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2273 (define_insn "*extendqidi2"
2274 [(set (match_operand:DI 0 "register_operand" "=d")
2275 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2276 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2278 [(set_attr "op_type" "RXY")])
2281 [(set (match_operand:DI 0 "register_operand" "")
2282 (sign_extend:DI (match_operand:QI 1 "s_operand" "")))]
2283 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT && !reload_completed"
2285 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2286 (clobber (reg:CC 33))])
2288 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2289 (clobber (reg:CC 33))])]
2293 ; extendhisi2 instruction pattern(s).
2296 (define_expand "extendhisi2"
2297 [(set (match_operand:SI 0 "register_operand" "")
2298 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2302 operands[1] = gen_lowpart (SImode, operands[1]);
2303 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2304 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2309 (define_insn "*extendhisi2"
2310 [(set (match_operand:SI 0 "register_operand" "=d,d")
2311 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2316 [(set_attr "op_type" "RX,RXY")])
2319 ; extendqisi2 instruction pattern(s).
2322 (define_expand "extendqisi2"
2323 [(set (match_operand:SI 0 "register_operand" "")
2324 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2328 operands[1] = gen_lowpart (SImode, operands[1]);
2329 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2330 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2335 (define_insn "*extendqisi2"
2336 [(set (match_operand:SI 0 "register_operand" "=d")
2337 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2338 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2340 [(set_attr "op_type" "RXY")])
2343 [(set (match_operand:SI 0 "register_operand" "")
2344 (sign_extend:SI (match_operand:QI 1 "s_operand" "")))]
2345 "(!TARGET_64BIT || !TARGET_LONG_DISPLACEMENT) && !reload_completed"
2347 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2348 (clobber (reg:CC 33))])
2350 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2351 (clobber (reg:CC 33))])]
2355 ; extendqihi2 instruction pattern(s).
2360 ; zero_extendsidi2 instruction pattern(s).
2363 (define_expand "zero_extendsidi2"
2364 [(set (match_operand:DI 0 "register_operand" "")
2365 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2371 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2372 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2373 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2379 (define_insn "*zero_extendsidi2"
2380 [(set (match_operand:DI 0 "register_operand" "=d,d")
2381 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2386 [(set_attr "op_type" "RRE,RXY")])
2389 ; zero_extendhidi2 instruction pattern(s).
2392 (define_expand "zero_extendhidi2"
2393 [(set (match_operand:DI 0 "register_operand" "")
2394 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2400 rtx tmp = gen_reg_rtx (SImode);
2401 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2402 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2407 operands[1] = gen_lowpart (DImode, operands[1]);
2408 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2409 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2415 (define_insn "*zero_extendhidi2"
2416 [(set (match_operand:DI 0 "register_operand" "=d")
2417 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2420 [(set_attr "op_type" "RXY")])
2423 ; zero_extendqidi2 instruction pattern(s)
2426 (define_expand "zero_extendqidi2"
2427 [(set (match_operand:DI 0 "register_operand" "")
2428 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2434 rtx tmp = gen_reg_rtx (SImode);
2435 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2436 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2441 operands[1] = gen_lowpart (DImode, operands[1]);
2442 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2443 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2449 (define_insn "*zero_extendqidi2"
2450 [(set (match_operand:DI 0 "register_operand" "=d")
2451 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2454 [(set_attr "op_type" "RXY")])
2457 ; zero_extendhisi2 instruction pattern(s).
2460 (define_expand "zero_extendhisi2"
2461 [(set (match_operand:SI 0 "register_operand" "")
2462 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2466 operands[1] = gen_lowpart (SImode, operands[1]);
2467 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2472 (define_insn "*zero_extendhisi2_64"
2473 [(set (match_operand:SI 0 "register_operand" "=d")
2474 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2477 [(set_attr "op_type" "RXY")])
2479 (define_insn_and_split "*zero_extendhisi2_31"
2480 [(set (match_operand:SI 0 "register_operand" "=&d")
2481 (zero_extend:SI (match_operand:HI 1 "memory_operand" "QS")))
2482 (clobber (reg:CC 33))]
2485 "&& reload_completed"
2486 [(set (match_dup 0) (const_int 0))
2488 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2489 (clobber (reg:CC 33))])]
2490 "operands[2] = gen_lowpart (HImode, operands[0]);"
2491 [(set_attr "atype" "agen")])
2494 ; zero_extendqisi2 instruction pattern(s).
2497 (define_expand "zero_extendqisi2"
2498 [(set (match_operand:SI 0 "register_operand" "")
2499 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2503 operands[1] = gen_lowpart (SImode, operands[1]);
2504 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2509 (define_insn "*zero_extendqisi2_64"
2510 [(set (match_operand:SI 0 "register_operand" "=d")
2511 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2514 [(set_attr "op_type" "RXY")])
2516 (define_insn_and_split "*zero_extendqisi2_31"
2517 [(set (match_operand:SI 0 "register_operand" "=&d")
2518 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2521 "&& reload_completed"
2522 [(set (match_dup 0) (const_int 0))
2523 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2524 "operands[2] = gen_lowpart (QImode, operands[0]);"
2525 [(set_attr "atype" "agen")])
2528 ; zero_extendqihi2 instruction pattern(s).
2531 (define_expand "zero_extendqihi2"
2532 [(set (match_operand:HI 0 "register_operand" "")
2533 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2537 operands[1] = gen_lowpart (HImode, operands[1]);
2538 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2543 (define_insn "*zero_extendqihi2_64"
2544 [(set (match_operand:HI 0 "register_operand" "=d")
2545 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2548 [(set_attr "op_type" "RXY")])
2550 (define_insn_and_split "*zero_extendqihi2_31"
2551 [(set (match_operand:HI 0 "register_operand" "=&d")
2552 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2555 "&& reload_completed"
2556 [(set (match_dup 0) (const_int 0))
2557 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2558 "operands[2] = gen_lowpart (QImode, operands[0]);"
2559 [(set_attr "atype" "agen")])
2563 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2566 (define_expand "fixuns_truncdfdi2"
2567 [(set (match_operand:DI 0 "register_operand" "")
2568 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2569 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2571 rtx label1 = gen_label_rtx ();
2572 rtx label2 = gen_label_rtx ();
2573 rtx temp = gen_reg_rtx (DFmode);
2574 operands[1] = force_reg (DFmode, operands[1]);
2576 emit_insn (gen_cmpdf (operands[1],
2577 CONST_DOUBLE_FROM_REAL_VALUE (
2578 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2579 emit_jump_insn (gen_blt (label1));
2580 emit_insn (gen_subdf3 (temp, operands[1],
2581 CONST_DOUBLE_FROM_REAL_VALUE (
2582 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2583 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2586 emit_label (label1);
2587 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2588 emit_label (label2);
2592 (define_expand "fix_truncdfdi2"
2593 [(set (match_operand:DI 0 "register_operand" "")
2594 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2595 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2597 operands[1] = force_reg (DFmode, operands[1]);
2598 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2602 (define_insn "fix_truncdfdi2_ieee"
2603 [(set (match_operand:DI 0 "register_operand" "=d")
2604 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2605 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2606 (clobber (reg:CC 33))]
2607 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2609 [(set_attr "op_type" "RRE")
2610 (set_attr "type" "ftoi")])
2613 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2616 (define_expand "fixuns_truncdfsi2"
2617 [(set (match_operand:SI 0 "register_operand" "")
2618 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2619 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2621 rtx label1 = gen_label_rtx ();
2622 rtx label2 = gen_label_rtx ();
2623 rtx temp = gen_reg_rtx (DFmode);
2625 operands[1] = force_reg (DFmode,operands[1]);
2626 emit_insn (gen_cmpdf (operands[1],
2627 CONST_DOUBLE_FROM_REAL_VALUE (
2628 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2629 emit_jump_insn (gen_blt (label1));
2630 emit_insn (gen_subdf3 (temp, operands[1],
2631 CONST_DOUBLE_FROM_REAL_VALUE (
2632 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2633 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2636 emit_label (label1);
2637 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2638 emit_label (label2);
2642 (define_expand "fix_truncdfsi2"
2643 [(set (match_operand:SI 0 "register_operand" "")
2644 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2647 if (TARGET_IBM_FLOAT)
2649 /* This is the algorithm from POP chapter A.5.7.2. */
2651 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2652 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2653 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2655 operands[1] = force_reg (DFmode, operands[1]);
2656 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2657 two31r, two32, temp));
2661 operands[1] = force_reg (DFmode, operands[1]);
2662 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2668 (define_insn "fix_truncdfsi2_ieee"
2669 [(set (match_operand:SI 0 "register_operand" "=d")
2670 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2671 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2672 (clobber (reg:CC 33))]
2673 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2675 [(set_attr "op_type" "RRE")
2676 (set_attr "type" "other" )])
2678 (define_insn "fix_truncdfsi2_ibm"
2679 [(set (match_operand:SI 0 "register_operand" "=d")
2680 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2681 (use (match_operand:DI 2 "immediate_operand" "m"))
2682 (use (match_operand:DI 3 "immediate_operand" "m"))
2683 (use (match_operand:BLK 4 "memory_operand" "m"))
2684 (clobber (reg:CC 33))]
2685 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2687 output_asm_insn ("sd\t%1,%2", operands);
2688 output_asm_insn ("aw\t%1,%3", operands);
2689 output_asm_insn ("std\t%1,%4", operands);
2690 output_asm_insn ("xi\t%N4,128", operands);
2693 [(set_attr "op_type" "NN")
2694 (set_attr "type" "ftoi")
2695 (set_attr "atype" "agen")
2696 (set_attr "length" "20")])
2699 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2702 (define_expand "fixuns_truncsfdi2"
2703 [(set (match_operand:DI 0 "register_operand" "")
2704 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2705 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2707 rtx label1 = gen_label_rtx ();
2708 rtx label2 = gen_label_rtx ();
2709 rtx temp = gen_reg_rtx (SFmode);
2711 operands[1] = force_reg (SFmode, operands[1]);
2712 emit_insn (gen_cmpsf (operands[1],
2713 CONST_DOUBLE_FROM_REAL_VALUE (
2714 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2715 emit_jump_insn (gen_blt (label1));
2717 emit_insn (gen_subsf3 (temp, operands[1],
2718 CONST_DOUBLE_FROM_REAL_VALUE (
2719 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2720 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2723 emit_label (label1);
2724 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2725 emit_label (label2);
2729 (define_expand "fix_truncsfdi2"
2730 [(set (match_operand:DI 0 "register_operand" "")
2731 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2732 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2734 operands[1] = force_reg (SFmode, operands[1]);
2735 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2739 (define_insn "fix_truncsfdi2_ieee"
2740 [(set (match_operand:DI 0 "register_operand" "=d")
2741 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2742 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2743 (clobber (reg:CC 33))]
2744 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2746 [(set_attr "op_type" "RRE")
2747 (set_attr "type" "ftoi")])
2750 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2753 (define_expand "fixuns_truncsfsi2"
2754 [(set (match_operand:SI 0 "register_operand" "")
2755 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2756 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2758 rtx label1 = gen_label_rtx ();
2759 rtx label2 = gen_label_rtx ();
2760 rtx temp = gen_reg_rtx (SFmode);
2762 operands[1] = force_reg (SFmode, operands[1]);
2763 emit_insn (gen_cmpsf (operands[1],
2764 CONST_DOUBLE_FROM_REAL_VALUE (
2765 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
2766 emit_jump_insn (gen_blt (label1));
2767 emit_insn (gen_subsf3 (temp, operands[1],
2768 CONST_DOUBLE_FROM_REAL_VALUE (
2769 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
2770 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
2773 emit_label (label1);
2774 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2775 emit_label (label2);
2779 (define_expand "fix_truncsfsi2"
2780 [(set (match_operand:SI 0 "register_operand" "")
2781 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
2784 if (TARGET_IBM_FLOAT)
2786 /* Convert to DFmode and then use the POP algorithm. */
2787 rtx temp = gen_reg_rtx (DFmode);
2788 emit_insn (gen_extendsfdf2 (temp, operands[1]));
2789 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
2793 operands[1] = force_reg (SFmode, operands[1]);
2794 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2800 (define_insn "fix_truncsfsi2_ieee"
2801 [(set (match_operand:SI 0 "register_operand" "=d")
2802 (fix:SI (match_operand:SF 1 "register_operand" "f")))
2803 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2804 (clobber (reg:CC 33))]
2805 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2807 [(set_attr "op_type" "RRE")
2808 (set_attr "type" "ftoi")])
2811 ; floatdidf2 instruction pattern(s).
2814 (define_insn "floatdidf2"
2815 [(set (match_operand:DF 0 "register_operand" "=f")
2816 (float:DF (match_operand:DI 1 "register_operand" "d")))
2817 (clobber (reg:CC 33))]
2818 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2820 [(set_attr "op_type" "RRE")
2821 (set_attr "type" "itof" )])
2824 ; floatdisf2 instruction pattern(s).
2827 (define_insn "floatdisf2"
2828 [(set (match_operand:SF 0 "register_operand" "=f")
2829 (float:SF (match_operand:DI 1 "register_operand" "d")))
2830 (clobber (reg:CC 33))]
2831 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2833 [(set_attr "op_type" "RRE")
2834 (set_attr "type" "itof" )])
2837 ; floatsidf2 instruction pattern(s).
2840 (define_expand "floatsidf2"
2842 [(set (match_operand:DF 0 "register_operand" "")
2843 (float:DF (match_operand:SI 1 "register_operand" "")))
2844 (clobber (reg:CC 33))])]
2847 if (TARGET_IBM_FLOAT)
2849 /* This is the algorithm from POP chapter A.5.7.1. */
2851 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2852 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
2854 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
2859 (define_insn "floatsidf2_ieee"
2860 [(set (match_operand:DF 0 "register_operand" "=f")
2861 (float:DF (match_operand:SI 1 "register_operand" "d")))
2862 (clobber (reg:CC 33))]
2863 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2865 [(set_attr "op_type" "RRE")
2866 (set_attr "type" "itof" )])
2868 (define_insn "floatsidf2_ibm"
2869 [(set (match_operand:DF 0 "register_operand" "=f")
2870 (float:DF (match_operand:SI 1 "register_operand" "d")))
2871 (use (match_operand:DI 2 "immediate_operand" "m"))
2872 (use (match_operand:BLK 3 "memory_operand" "m"))
2873 (clobber (reg:CC 33))]
2874 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2876 output_asm_insn ("st\t%1,%N3", operands);
2877 output_asm_insn ("xi\t%N3,128", operands);
2878 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
2879 output_asm_insn ("ld\t%0,%3", operands);
2882 [(set_attr "op_type" "NN")
2883 (set_attr "type" "other" )
2884 (set_attr "atype" "agen")
2885 (set_attr "length" "20")])
2888 ; floatsisf2 instruction pattern(s).
2891 (define_expand "floatsisf2"
2893 [(set (match_operand:SF 0 "register_operand" "")
2894 (float:SF (match_operand:SI 1 "register_operand" "")))
2895 (clobber (reg:CC 33))])]
2898 if (TARGET_IBM_FLOAT)
2900 /* Use the POP algorithm to convert to DFmode and then truncate. */
2901 rtx temp = gen_reg_rtx (DFmode);
2902 emit_insn (gen_floatsidf2 (temp, operands[1]));
2903 emit_insn (gen_truncdfsf2 (operands[0], temp));
2908 (define_insn "floatsisf2_ieee"
2909 [(set (match_operand:SF 0 "register_operand" "=f")
2910 (float:SF (match_operand:SI 1 "register_operand" "d")))
2911 (clobber (reg:CC 33))]
2912 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2914 [(set_attr "op_type" "RRE")
2915 (set_attr "type" "itof" )])
2918 ; truncdfsf2 instruction pattern(s).
2921 (define_expand "truncdfsf2"
2922 [(set (match_operand:SF 0 "register_operand" "")
2923 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
2927 (define_insn "truncdfsf2_ieee"
2928 [(set (match_operand:SF 0 "register_operand" "=f")
2929 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
2930 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2932 [(set_attr "op_type" "RRE")])
2934 (define_insn "truncdfsf2_ibm"
2935 [(set (match_operand:SF 0 "register_operand" "=f,f")
2936 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
2937 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2941 [(set_attr "op_type" "RR,RX")
2942 (set_attr "type" "floads,floads")])
2945 ; extendsfdf2 instruction pattern(s).
2948 (define_expand "extendsfdf2"
2949 [(set (match_operand:DF 0 "register_operand" "")
2950 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
2953 if (TARGET_IBM_FLOAT)
2955 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
2960 (define_insn "extendsfdf2_ieee"
2961 [(set (match_operand:DF 0 "register_operand" "=f,f")
2962 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
2963 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2967 [(set_attr "op_type" "RRE,RXE")
2968 (set_attr "type" "floads,floads")])
2970 (define_insn "extendsfdf2_ibm"
2971 [(set (match_operand:DF 0 "register_operand" "=f,f")
2972 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
2973 (clobber (reg:CC 33))]
2974 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2976 sdr\t%0,%0\;ler\t%0,%1
2977 sdr\t%0,%0\;le\t%0,%1"
2978 [(set_attr "op_type" "NN,NN")
2979 (set_attr "atype" "reg,agen")
2980 (set_attr "length" "4,6")
2981 (set_attr "type" "o2,o2")])
2985 ;; ARITHMETIC OPERATIONS
2987 ; arithmetic operations set the ConditionCode,
2988 ; because of unpredictable Bits in Register for Halfword and Byte
2989 ; the ConditionCode can be set wrong in operations for Halfword and Byte
2992 ;;- Add instructions.
2996 ; adddi3 instruction pattern(s).
2999 (define_insn "*adddi3_sign"
3000 [(set (match_operand:DI 0 "register_operand" "=d,d")
3001 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3002 (match_operand:DI 1 "register_operand" "0,0")))
3003 (clobber (reg:CC 33))]
3008 [(set_attr "op_type" "RRE,RXY")])
3010 (define_insn "*adddi3_zero_cc"
3012 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3013 (match_operand:DI 1 "register_operand" "0,0"))
3015 (set (match_operand:DI 0 "register_operand" "=d,d")
3016 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3017 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3021 [(set_attr "op_type" "RRE,RXY")])
3023 (define_insn "*adddi3_zero_cconly"
3025 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3026 (match_operand:DI 1 "register_operand" "0,0"))
3028 (clobber (match_scratch:DI 0 "=d,d"))]
3029 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3033 [(set_attr "op_type" "RRE,RXY")])
3035 (define_insn "*adddi3_zero"
3036 [(set (match_operand:DI 0 "register_operand" "=d,d")
3037 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3038 (match_operand:DI 1 "register_operand" "0,0")))
3039 (clobber (reg:CC 33))]
3044 [(set_attr "op_type" "RRE,RXY")])
3046 (define_insn "*adddi3_imm_cc"
3048 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3049 (match_operand:DI 2 "const_int_operand" "K"))
3051 (set (match_operand:DI 0 "register_operand" "=d")
3052 (plus:DI (match_dup 1) (match_dup 2)))]
3054 && s390_match_ccmode (insn, CCAmode)
3055 && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
3057 [(set_attr "op_type" "RI")])
3059 (define_insn "*adddi3_cc"
3061 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3062 (match_operand:DI 2 "general_operand" "d,m"))
3064 (set (match_operand:DI 0 "register_operand" "=d,d")
3065 (plus:DI (match_dup 1) (match_dup 2)))]
3066 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3070 [(set_attr "op_type" "RRE,RXY")])
3072 (define_insn "*adddi3_cconly"
3074 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3075 (match_operand:DI 2 "general_operand" "d,m"))
3077 (clobber (match_scratch:DI 0 "=d,d"))]
3078 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3082 [(set_attr "op_type" "RRE,RXY")])
3084 (define_insn "*adddi3_cconly2"
3086 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3087 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3088 (clobber (match_scratch:DI 0 "=d,d"))]
3089 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3093 [(set_attr "op_type" "RRE,RXY")])
3095 (define_insn "*adddi3_64"
3096 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3097 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3098 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3099 (clobber (reg:CC 33))]
3105 [(set_attr "op_type" "RRE,RI,RXY")])
3107 (define_insn_and_split "*adddi3_31"
3108 [(set (match_operand:DI 0 "register_operand" "=&d")
3109 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3110 (match_operand:DI 2 "general_operand" "do") ) )
3111 (clobber (reg:CC 33))]
3114 "&& reload_completed"
3116 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3117 (clobber (reg:CC 33))])
3120 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3122 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3124 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3126 (label_ref (match_dup 9))))
3128 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3129 (clobber (reg:CC 33))])
3131 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3132 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3133 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3134 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3135 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3136 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3137 operands[9] = gen_label_rtx ();"
3138 [(set_attr "op_type" "NN")])
3140 (define_expand "adddi3"
3142 [(set (match_operand:DI 0 "register_operand" "")
3143 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3144 (match_operand:DI 2 "general_operand" "")))
3145 (clobber (reg:CC 33))])]
3149 (define_insn "*la_64"
3150 [(set (match_operand:DI 0 "register_operand" "=d,d")
3151 (match_operand:QI 1 "address_operand" "U,W"))]
3156 [(set_attr "op_type" "RX,RXY")
3157 (set_attr "type" "la")])
3161 [(set (match_operand:DI 0 "register_operand" "")
3162 (match_operand:QI 1 "address_operand" ""))
3163 (clobber (reg:CC 33))])]
3165 && strict_memory_address_p (VOIDmode, operands[1])
3166 && preferred_la_operand_p (operands[1])"
3167 [(set (match_dup 0) (match_dup 1))]
3171 [(set (match_operand:DI 0 "register_operand" "")
3172 (match_operand:DI 1 "register_operand" ""))
3175 (plus:DI (match_dup 0)
3176 (match_operand:DI 2 "nonmemory_operand" "")))
3177 (clobber (reg:CC 33))])]
3179 && !reg_overlap_mentioned_p (operands[0], operands[2])
3180 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2]))
3181 && preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))"
3182 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
3185 (define_expand "reload_indi"
3186 [(parallel [(match_operand:DI 0 "register_operand" "=a")
3187 (match_operand:DI 1 "s390_plus_operand" "")
3188 (match_operand:DI 2 "register_operand" "=&a")])]
3191 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
3197 ; addsi3 instruction pattern(s).
3200 (define_insn "*addsi3_imm_cc"
3202 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3203 (match_operand:SI 2 "const_int_operand" "K"))
3205 (set (match_operand:SI 0 "register_operand" "=d")
3206 (plus:SI (match_dup 1) (match_dup 2)))]
3207 "s390_match_ccmode (insn, CCAmode)
3208 && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
3210 [(set_attr "op_type" "RI")])
3212 (define_insn "*addsi3_carry1_cc"
3214 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3215 (match_operand:SI 2 "general_operand" "d,R,T"))
3217 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3218 (plus:SI (match_dup 1) (match_dup 2)))]
3219 "s390_match_ccmode (insn, CCL1mode)"
3224 [(set_attr "op_type" "RR,RX,RXY")])
3226 (define_insn "*addsi3_carry1_cconly"
3228 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3229 (match_operand:SI 2 "general_operand" "d,R,T"))
3231 (clobber (match_scratch:SI 0 "=d,d,d"))]
3232 "s390_match_ccmode (insn, CCL1mode)"
3237 [(set_attr "op_type" "RR,RX,RXY")])
3239 (define_insn "*addsi3_carry2_cc"
3241 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3242 (match_operand:SI 2 "general_operand" "d,R,T"))
3244 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3245 (plus:SI (match_dup 1) (match_dup 2)))]
3246 "s390_match_ccmode (insn, CCL1mode)"
3251 [(set_attr "op_type" "RR,RX,RXY")])
3253 (define_insn "*addsi3_carry2_cconly"
3255 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3256 (match_operand:SI 2 "general_operand" "d,R,T"))
3258 (clobber (match_scratch:SI 0 "=d,d,d"))]
3259 "s390_match_ccmode (insn, CCL1mode)"
3264 [(set_attr "op_type" "RR,RX,RXY")])
3266 (define_insn "*addsi3_cc"
3268 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3269 (match_operand:SI 2 "general_operand" "d,R,T"))
3271 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3272 (plus:SI (match_dup 1) (match_dup 2)))]
3273 "s390_match_ccmode (insn, CCLmode)"
3278 [(set_attr "op_type" "RR,RX,RXY")])
3280 (define_insn "*addsi3_cconly"
3282 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3283 (match_operand:SI 2 "general_operand" "d,R,T"))
3285 (clobber (match_scratch:SI 0 "=d,d,d"))]
3286 "s390_match_ccmode (insn, CCLmode)"
3291 [(set_attr "op_type" "RR,RX,RXY")])
3293 (define_insn "*addsi3_cconly2"
3295 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3296 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3297 (clobber (match_scratch:SI 0 "=d,d,d"))]
3298 "s390_match_ccmode(insn, CCLmode)"
3303 [(set_attr "op_type" "RR,RX,RXY")])
3305 (define_insn "*addsi3_sign"
3306 [(set (match_operand:SI 0 "register_operand" "=d,d")
3307 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3308 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3309 (clobber (reg:CC 33))]
3314 [(set_attr "op_type" "RX,RXY")])
3316 (define_insn "*addsi3_sub"
3317 [(set (match_operand:SI 0 "register_operand" "=d,d")
3318 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3319 (subreg:SI (match_operand:HI 2 "memory_operand" "R,T") 0)))
3320 (clobber (reg:CC 33))]
3325 [(set_attr "op_type" "RX,RXY")])
3327 (define_insn "addsi3"
3328 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3329 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3330 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3331 (clobber (reg:CC 33))]
3338 [(set_attr "op_type" "RR,RI,RX,RXY")])
3340 (define_insn "*la_31"
3341 [(set (match_operand:SI 0 "register_operand" "=d,d")
3342 (match_operand:QI 1 "address_operand" "U,W"))]
3343 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
3347 [(set_attr "op_type" "RX,RXY")
3348 (set_attr "type" "la")])
3352 [(set (match_operand:SI 0 "register_operand" "")
3353 (match_operand:QI 1 "address_operand" ""))
3354 (clobber (reg:CC 33))])]
3356 && strict_memory_address_p (VOIDmode, operands[1])
3357 && preferred_la_operand_p (operands[1])"
3358 [(set (match_dup 0) (match_dup 1))]
3362 [(set (match_operand:SI 0 "register_operand" "")
3363 (match_operand:SI 1 "register_operand" ""))
3366 (plus:SI (match_dup 0)
3367 (match_operand:SI 2 "nonmemory_operand" "")))
3368 (clobber (reg:CC 33))])]
3370 && !reg_overlap_mentioned_p (operands[0], operands[2])
3371 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2]))
3372 && preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))"
3373 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
3376 (define_insn "*la_31_and"
3377 [(set (match_operand:SI 0 "register_operand" "=d,d")
3378 (and:SI (match_operand:QI 1 "address_operand" "U,W")
3379 (const_int 2147483647)))]
3384 [(set_attr "op_type" "RX,RXY")
3385 (set_attr "type" "la")])
3387 (define_insn_and_split "*la_31_and_cc"
3388 [(set (match_operand:SI 0 "register_operand" "=d")
3389 (and:SI (match_operand:QI 1 "address_operand" "p")
3390 (const_int 2147483647)))
3391 (clobber (reg:CC 33))]
3394 "&& reload_completed"
3396 (and:SI (match_dup 1) (const_int 2147483647)))]
3398 [(set_attr "op_type" "RX")
3399 (set_attr "type" "la")])
3401 (define_insn "force_la_31"
3402 [(set (match_operand:SI 0 "register_operand" "=d,d")
3403 (match_operand:QI 1 "address_operand" "U,W"))
3404 (use (const_int 0))]
3409 [(set_attr "op_type" "RX")
3410 (set_attr "type" "la")])
3412 (define_expand "reload_insi"
3413 [(parallel [(match_operand:SI 0 "register_operand" "=a")
3414 (match_operand:SI 1 "s390_plus_operand" "")
3415 (match_operand:SI 2 "register_operand" "=&a")])]
3418 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
3424 ; adddf3 instruction pattern(s).
3427 (define_expand "adddf3"
3429 [(set (match_operand:DF 0 "register_operand" "=f,f")
3430 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3431 (match_operand:DF 2 "general_operand" "f,R")))
3432 (clobber (reg:CC 33))])]
3436 (define_insn "*adddf3"
3437 [(set (match_operand:DF 0 "register_operand" "=f,f")
3438 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3439 (match_operand:DF 2 "general_operand" "f,R")))
3440 (clobber (reg:CC 33))]
3441 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3445 [(set_attr "op_type" "RRE,RXE")
3446 (set_attr "type" "fsimpd,fsimpd")])
3448 (define_insn "*adddf3_cc"
3450 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3451 (match_operand:DF 2 "general_operand" "f,R"))
3452 (match_operand:DF 3 "const0_operand" "")))
3453 (set (match_operand:DF 0 "register_operand" "=f,f")
3454 (plus:DF (match_dup 1) (match_dup 2)))]
3455 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3459 [(set_attr "op_type" "RRE,RXE")
3460 (set_attr "type" "fsimpd,fsimpd")])
3462 (define_insn "*adddf3_cconly"
3464 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3465 (match_operand:DF 2 "general_operand" "f,R"))
3466 (match_operand:DF 3 "const0_operand" "")))
3467 (clobber (match_scratch:DF 0 "=f,f"))]
3468 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3472 [(set_attr "op_type" "RRE,RXE")
3473 (set_attr "type" "fsimpd,fsimpd")])
3475 (define_insn "*adddf3_ibm"
3476 [(set (match_operand:DF 0 "register_operand" "=f,f")
3477 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3478 (match_operand:DF 2 "general_operand" "f,R")))
3479 (clobber (reg:CC 33))]
3480 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3484 [(set_attr "op_type" "RR,RX")
3485 (set_attr "type" "fsimpd,fsimpd")])
3488 ; addsf3 instruction pattern(s).
3491 (define_expand "addsf3"
3493 [(set (match_operand:SF 0 "register_operand" "=f,f")
3494 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3495 (match_operand:SF 2 "general_operand" "f,R")))
3496 (clobber (reg:CC 33))])]
3500 (define_insn "*addsf3"
3501 [(set (match_operand:SF 0 "register_operand" "=f,f")
3502 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3503 (match_operand:SF 2 "general_operand" "f,R")))
3504 (clobber (reg:CC 33))]
3505 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3509 [(set_attr "op_type" "RRE,RXE")
3510 (set_attr "type" "fsimps,fsimps")])
3512 (define_insn "*addsf3_cc"
3514 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3515 (match_operand:SF 2 "general_operand" "f,R"))
3516 (match_operand:SF 3 "const0_operand" "")))
3517 (set (match_operand:SF 0 "register_operand" "=f,f")
3518 (plus:SF (match_dup 1) (match_dup 2)))]
3519 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3523 [(set_attr "op_type" "RRE,RXE")
3524 (set_attr "type" "fsimps,fsimps")])
3526 (define_insn "*addsf3_cconly"
3528 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3529 (match_operand:SF 2 "general_operand" "f,R"))
3530 (match_operand:SF 3 "const0_operand" "")))
3531 (clobber (match_scratch:SF 0 "=f,f"))]
3532 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3536 [(set_attr "op_type" "RRE,RXE")
3537 (set_attr "type" "fsimps,fsimps")])
3539 (define_insn "*addsf3"
3540 [(set (match_operand:SF 0 "register_operand" "=f,f")
3541 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3542 (match_operand:SF 2 "general_operand" "f,R")))
3543 (clobber (reg:CC 33))]
3544 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3548 [(set_attr "op_type" "RR,RX")
3549 (set_attr "type" "fsimps,fsimps")])
3553 ;;- Subtract instructions.
3557 ; subdi3 instruction pattern(s).
3560 (define_insn "*subdi3_sign"
3561 [(set (match_operand:DI 0 "register_operand" "=d,d")
3562 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3563 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3564 (clobber (reg:CC 33))]
3569 [(set_attr "op_type" "RRE,RXY")])
3571 (define_insn "*subdi3_zero_cc"
3573 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3574 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3576 (set (match_operand:DI 0 "register_operand" "=d,d")
3577 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3578 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3582 [(set_attr "op_type" "RRE,RXY")])
3584 (define_insn "*subdi3_zero_cconly"
3586 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3587 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3589 (clobber (match_scratch:DI 0 "=d,d"))]
3590 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3594 [(set_attr "op_type" "RRE,RXY")])
3596 (define_insn "*subdi3_zero"
3597 [(set (match_operand:DI 0 "register_operand" "=d,d")
3598 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3599 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3600 (clobber (reg:CC 33))]
3605 [(set_attr "op_type" "RRE,RXY")])
3607 (define_insn "*subdi3_cc"
3609 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3610 (match_operand:DI 2 "general_operand" "d,m"))
3612 (set (match_operand:DI 0 "register_operand" "=d,d")
3613 (minus:DI (match_dup 1) (match_dup 2)))]
3614 "s390_match_ccmode (insn, CCLmode)"
3618 [(set_attr "op_type" "RRE,RXY")])
3620 (define_insn "*subdi3_cconly"
3622 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3623 (match_operand:DI 2 "general_operand" "d,m"))
3625 (clobber (match_scratch:DI 0 "=d,d"))]
3626 "s390_match_ccmode (insn, CCLmode)"
3630 [(set_attr "op_type" "RRE,RXY")])
3632 (define_insn "*subdi3_64"
3633 [(set (match_operand:DI 0 "register_operand" "=d,d")
3634 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3635 (match_operand:DI 2 "general_operand" "d,m") ) )
3636 (clobber (reg:CC 33))]
3641 [(set_attr "op_type" "RRE,RRE")])
3643 (define_insn_and_split "*subdi3_31"
3644 [(set (match_operand:DI 0 "register_operand" "=&d")
3645 (minus:DI (match_operand:DI 1 "register_operand" "0")
3646 (match_operand:DI 2 "general_operand" "do") ) )
3647 (clobber (reg:CC 33))]
3650 "&& reload_completed"
3652 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3653 (clobber (reg:CC 33))])
3656 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3658 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3660 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3662 (label_ref (match_dup 9))))
3664 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3665 (clobber (reg:CC 33))])
3667 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3668 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3669 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3670 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3671 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3672 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3673 operands[9] = gen_label_rtx ();"
3674 [(set_attr "op_type" "NN")])
3676 (define_expand "subdi3"
3678 [(set (match_operand:DI 0 "register_operand" "")
3679 (minus:DI (match_operand:DI 1 "register_operand" "")
3680 (match_operand:DI 2 "general_operand" "")))
3681 (clobber (reg:CC 33))])]
3686 ; subsi3 instruction pattern(s).
3689 (define_insn "*subsi3_borrow_cc"
3691 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3692 (match_operand:SI 2 "general_operand" "d,R,T"))
3694 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3695 (minus:SI (match_dup 1) (match_dup 2)))]
3696 "s390_match_ccmode(insn, CCL2mode)"
3701 [(set_attr "op_type" "RR,RX,RXY")])
3703 (define_insn "*subsi3_borrow_cconly"
3705 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3706 (match_operand:SI 2 "general_operand" "d,R,T"))
3708 (clobber (match_scratch:SI 0 "=d,d,d"))]
3709 "s390_match_ccmode(insn, CCL2mode)"
3714 [(set_attr "op_type" "RR,RX,RXE")])
3716 (define_insn "*subsi3_cc"
3718 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3719 (match_operand:SI 2 "general_operand" "d,R,T"))
3721 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3722 (minus:SI (match_dup 1) (match_dup 2)))]
3723 "s390_match_ccmode(insn, CCLmode)"
3728 [(set_attr "op_type" "RR,RX,RXY")])
3730 (define_insn "*subsi3_cconly"
3732 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3733 (match_operand:SI 2 "general_operand" "d,R,T"))
3735 (clobber (match_scratch:SI 0 "=d,d,d"))]
3736 "s390_match_ccmode(insn, CCLmode)"
3741 [(set_attr "op_type" "RR,RX,RXY")])
3743 (define_insn "*subsi3_sign"
3744 [(set (match_operand:SI 0 "register_operand" "=d,d")
3745 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3746 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3747 (clobber (reg:CC 33))]
3752 [(set_attr "op_type" "RX,RXY")])
3754 (define_insn "*subsi3_sub"
3755 [(set (match_operand:SI 0 "register_operand" "=d,d")
3756 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3757 (subreg:SI (match_operand:HI 2 "memory_operand" "R,T") 0)))
3758 (clobber (reg:CC 33))]
3763 [(set_attr "op_type" "RX,RXY")])
3765 (define_insn "subsi3"
3766 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
3767 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3768 (match_operand:SI 2 "general_operand" "d,R,T")))
3769 (clobber (reg:CC 33))]
3775 [(set_attr "op_type" "RR,RX,RXY")])
3779 ; subdf3 instruction pattern(s).
3782 (define_expand "subdf3"
3784 [(set (match_operand:DF 0 "register_operand" "=f,f")
3785 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3786 (match_operand:DF 2 "general_operand" "f,R")))
3787 (clobber (reg:CC 33))])]
3791 (define_insn "*subdf3"
3792 [(set (match_operand:DF 0 "register_operand" "=f,f")
3793 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3794 (match_operand:DF 2 "general_operand" "f,R")))
3795 (clobber (reg:CC 33))]
3796 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3800 [(set_attr "op_type" "RRE,RXE")
3801 (set_attr "type" "fsimpd,fsimpd")])
3803 (define_insn "*subdf3_cc"
3805 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3806 (match_operand:DF 2 "general_operand" "f,R"))
3807 (match_operand:DF 3 "const0_operand" "")))
3808 (set (match_operand:DF 0 "register_operand" "=f,f")
3809 (plus:DF (match_dup 1) (match_dup 2)))]
3810 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3814 [(set_attr "op_type" "RRE,RXE")
3815 (set_attr "type" "fsimpd,fsimpd")])
3817 (define_insn "*subdf3_cconly"
3819 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3820 (match_operand:DF 2 "general_operand" "f,R"))
3821 (match_operand:DF 3 "const0_operand" "")))
3822 (clobber (match_scratch:DF 0 "=f,f"))]
3823 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3827 [(set_attr "op_type" "RRE,RXE")
3828 (set_attr "type" "fsimpd,fsimpd")])
3830 (define_insn "*subdf3_ibm"
3831 [(set (match_operand:DF 0 "register_operand" "=f,f")
3832 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3833 (match_operand:DF 2 "general_operand" "f,R")))
3834 (clobber (reg:CC 33))]
3835 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3839 [(set_attr "op_type" "RR,RX")
3840 (set_attr "type" "fsimpd,fsimpd")])
3843 ; subsf3 instruction pattern(s).
3846 (define_expand "subsf3"
3848 [(set (match_operand:SF 0 "register_operand" "=f,f")
3849 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3850 (match_operand:SF 2 "general_operand" "f,R")))
3851 (clobber (reg:CC 33))])]
3855 (define_insn "*subsf3"
3856 [(set (match_operand:SF 0 "register_operand" "=f,f")
3857 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3858 (match_operand:SF 2 "general_operand" "f,R")))
3859 (clobber (reg:CC 33))]
3860 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3864 [(set_attr "op_type" "RRE,RXE")
3865 (set_attr "type" "fsimps,fsimps")])
3867 (define_insn "*subsf3_cc"
3869 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3870 (match_operand:SF 2 "general_operand" "f,R"))
3871 (match_operand:SF 3 "const0_operand" "")))
3872 (set (match_operand:SF 0 "register_operand" "=f,f")
3873 (minus:SF (match_dup 1) (match_dup 2)))]
3874 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3878 [(set_attr "op_type" "RRE,RXE")
3879 (set_attr "type" "fsimps,fsimps")])
3881 (define_insn "*subsf3_cconly"
3883 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3884 (match_operand:SF 2 "general_operand" "f,R"))
3885 (match_operand:SF 3 "const0_operand" "")))
3886 (clobber (match_scratch:SF 0 "=f,f"))]
3887 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3891 [(set_attr "op_type" "RRE,RXE")
3892 (set_attr "type" "fsimps,fsimps")])
3894 (define_insn "*subsf3_ibm"
3895 [(set (match_operand:SF 0 "register_operand" "=f,f")
3896 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3897 (match_operand:SF 2 "general_operand" "f,R")))
3898 (clobber (reg:CC 33))]
3899 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3903 [(set_attr "op_type" "RR,RX")
3904 (set_attr "type" "fsimps,fsimps")])
3908 ;;- Multiply instructions.
3912 ; muldi3 instruction pattern(s).
3915 (define_insn "*muldi3_sign"
3916 [(set (match_operand:DI 0 "register_operand" "=d,d")
3917 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
3918 (match_operand:DI 1 "register_operand" "0,0")))]
3923 [(set_attr "op_type" "RRE,RXY")
3924 (set_attr "type" "imul")])
3927 (define_insn "muldi3"
3928 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3929 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3930 (match_operand:DI 2 "general_operand" "d,K,m")))]
3936 [(set_attr "op_type" "RRE,RI,RXY")
3937 (set_attr "type" "imul")])
3940 ; mulsi3 instruction pattern(s).
3943 (define_insn "mulsi3"
3944 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3945 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3946 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
3953 [(set_attr "op_type" "RRE,RI,RX,RXY")
3954 (set_attr "type" "imul")])
3957 ; mulsidi3 instruction pattern(s).
3960 (define_expand "mulsidi3"
3961 [(set (match_operand:DI 0 "register_operand" "")
3962 (mult:DI (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" ""))
3963 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" ""))))]
3968 emit_insn (gen_zero_extendsidi2 (operands[0], operands[1]));
3969 insn = emit_insn (gen_mulsi_6432 (operands[0], operands[0], operands[2]));
3972 gen_rtx_EXPR_LIST (REG_EQUAL,
3973 gen_rtx_MULT (DImode,
3974 gen_rtx_SIGN_EXTEND (DImode, operands[1]),
3975 gen_rtx_SIGN_EXTEND (DImode, operands[2])),
3980 (define_insn "mulsi_6432"
3981 [(set (match_operand:DI 0 "register_operand" "=d,d")
3982 (mult:DI (sign_extend:DI
3983 (truncate:SI (match_operand:DI 1 "register_operand" "0,0")))
3985 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
3990 [(set_attr "op_type" "RR,RX")
3991 (set_attr "type" "imul")])
3994 ; muldf3 instruction pattern(s).
3997 (define_expand "muldf3"
3999 [(set (match_operand:DF 0 "register_operand" "=f,f")
4000 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4001 (match_operand:DF 2 "general_operand" "f,R")))
4002 (clobber (reg:CC 33))])]
4006 (define_insn "*muldf3"
4007 [(set (match_operand:DF 0 "register_operand" "=f,f")
4008 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4009 (match_operand:DF 2 "general_operand" "f,R")))
4010 (clobber (reg:CC 33))]
4011 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4015 [(set_attr "op_type" "RRE,RXE")
4016 (set_attr "type" "fmuld")])
4018 (define_insn "*muldf3_ibm"
4019 [(set (match_operand:DF 0 "register_operand" "=f,f")
4020 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4021 (match_operand:DF 2 "general_operand" "f,R")))
4022 (clobber (reg:CC 33))]
4023 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4027 [(set_attr "op_type" "RR,RX")
4028 (set_attr "type" "fmuld")])
4031 ; mulsf3 instruction pattern(s).
4034 (define_expand "mulsf3"
4036 [(set (match_operand:SF 0 "register_operand" "=f,f")
4037 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4038 (match_operand:SF 2 "general_operand" "f,R")))
4039 (clobber (reg:CC 33))])]
4043 (define_insn "*mulsf3"
4044 [(set (match_operand:SF 0 "register_operand" "=f,f")
4045 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4046 (match_operand:SF 2 "general_operand" "f,R")))
4047 (clobber (reg:CC 33))]
4048 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4052 [(set_attr "op_type" "RRE,RXE")
4053 (set_attr "type" "fmuls")])
4055 (define_insn "*mulsf3_ibm"
4056 [(set (match_operand:SF 0 "register_operand" "=f,f")
4057 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4058 (match_operand:SF 2 "general_operand" "f,R")))
4059 (clobber (reg:CC 33))]
4060 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4064 [(set_attr "op_type" "RR,RX")
4065 (set_attr "type" "fmuls")])
4069 ;;- Divide and modulo instructions.
4073 ; divmoddi4 instruction pattern(s).
4076 (define_expand "divmoddi4"
4077 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4078 (div:DI (match_operand:DI 1 "general_operand" "")
4079 (match_operand:DI 2 "general_operand" "")))
4080 (set (match_operand:DI 3 "general_operand" "")
4081 (mod:DI (match_dup 1) (match_dup 2)))])
4082 (clobber (match_dup 4))]
4085 rtx insn, div_equal, mod_equal, equal;
4087 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4088 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4089 equal = gen_rtx_IOR (TImode,
4090 gen_rtx_ZERO_EXTEND (TImode, div_equal),
4091 gen_rtx_ASHIFT (TImode,
4092 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4095 operands[4] = gen_reg_rtx(TImode);
4096 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4097 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4098 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4099 insn = emit_insn (gen_divmodtidi3 (operands[4], operands[4], operands[2]));
4101 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4103 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4105 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4107 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4109 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4114 (define_insn "divmodtidi3"
4115 [(set (match_operand:TI 0 "register_operand" "=d,d")
4118 (div:DI (truncate:DI (match_operand:TI 1 "register_operand" "0,0"))
4119 (match_operand:DI 2 "general_operand" "d,m")))
4122 (mod:DI (truncate:DI (match_dup 1))
4129 [(set_attr "op_type" "RRE,RXY")
4130 (set_attr "type" "idiv")])
4132 (define_insn "divmodtisi3"
4133 [(set (match_operand:TI 0 "register_operand" "=d,d")
4136 (div:DI (truncate:DI (match_operand:TI 1 "register_operand" "0,0"))
4137 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4140 (mod:DI (truncate:DI (match_dup 1))
4141 (sign_extend:DI (match_dup 2))))
4147 [(set_attr "op_type" "RRE,RXY")
4148 (set_attr "type" "idiv")])
4151 ; udivmoddi4 instruction pattern(s).
4154 (define_expand "udivmoddi4"
4155 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4156 (udiv:DI (match_operand:DI 1 "general_operand" "")
4157 (match_operand:DI 2 "nonimmediate_operand" "")))
4158 (set (match_operand:DI 3 "general_operand" "")
4159 (umod:DI (match_dup 1) (match_dup 2)))])
4160 (clobber (match_dup 4))]
4163 rtx insn, div_equal, mod_equal, equal;
4165 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4166 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4167 equal = gen_rtx_IOR (TImode,
4168 gen_rtx_ZERO_EXTEND (TImode, div_equal),
4169 gen_rtx_ASHIFT (TImode,
4170 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4173 operands[4] = gen_reg_rtx(TImode);
4174 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4175 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4176 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4177 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4179 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4181 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4183 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4185 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4187 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4192 (define_insn "udivmodtidi3"
4193 [(set (match_operand:TI 0 "register_operand" "=d,d")
4194 (ior:TI (zero_extend:TI
4196 (udiv:TI (match_operand:TI 1 "register_operand" "0,0")
4198 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4202 (umod:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))
4208 [(set_attr "op_type" "RRE,RXY")
4209 (set_attr "type" "idiv")])
4212 ; divmodsi4 instruction pattern(s).
4215 (define_expand "divmodsi4"
4216 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4217 (div:SI (match_operand:SI 1 "general_operand" "")
4218 (match_operand:SI 2 "nonimmediate_operand" "")))
4219 (set (match_operand:SI 3 "general_operand" "")
4220 (mod:SI (match_dup 1) (match_dup 2)))])
4221 (clobber (match_dup 4))]
4224 rtx insn, div_equal, mod_equal, equal;
4226 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4227 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4228 equal = gen_rtx_IOR (DImode,
4229 gen_rtx_ZERO_EXTEND (DImode, div_equal),
4230 gen_rtx_ASHIFT (DImode,
4231 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4234 operands[4] = gen_reg_rtx(DImode);
4235 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4236 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4238 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4240 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4242 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4244 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4246 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4251 (define_insn "divmoddisi3"
4252 [(set (match_operand:DI 0 "register_operand" "=d,d")
4253 (ior:DI (zero_extend:DI
4255 (div:DI (match_operand:DI 1 "register_operand" "0,0")
4257 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4261 (mod:DI (match_dup 1) (sign_extend:SI (match_dup 2)))))
4267 [(set_attr "op_type" "RR,RX")
4268 (set_attr "type" "idiv")])
4271 ; udivsi3 and umodsi3 instruction pattern(s).
4275 (define_expand "udivsi3"
4276 [(set (match_operand:SI 0 "register_operand" "=d")
4277 (udiv:SI (match_operand:SI 1 "general_operand" "")
4278 (match_operand:SI 2 "general_operand" "")))
4279 (clobber (match_dup 3))]
4282 rtx insn, udiv_equal, umod_equal, equal;
4284 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4285 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4286 equal = gen_rtx_IOR (DImode,
4287 gen_rtx_ZERO_EXTEND (DImode, udiv_equal),
4288 gen_rtx_ASHIFT (DImode,
4289 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4292 operands[3] = gen_reg_rtx (DImode);
4294 if (CONSTANT_P (operands[2]))
4296 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4298 rtx label1 = gen_label_rtx ();
4300 operands[1] = make_safe_from (operands[1], operands[0]);
4301 emit_move_insn (operands[0], const0_rtx);
4302 emit_insn (gen_cmpsi (operands[1], operands[2]));
4303 emit_jump_insn (gen_bltu (label1));
4304 emit_move_insn (operands[0], const1_rtx);
4305 emit_label (label1);
4309 operands[2] = force_reg (SImode, operands[2]);
4310 operands[2] = make_safe_from (operands[2], operands[0]);
4312 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4313 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4316 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4318 insn = emit_move_insn (operands[0],
4319 gen_lowpart (SImode, operands[3]));
4321 gen_rtx_EXPR_LIST (REG_EQUAL,
4322 udiv_equal, REG_NOTES (insn));
4327 rtx label1 = gen_label_rtx ();
4328 rtx label2 = gen_label_rtx ();
4329 rtx label3 = gen_label_rtx ();
4331 operands[1] = force_reg (SImode, operands[1]);
4332 operands[1] = make_safe_from (operands[1], operands[0]);
4333 operands[2] = force_reg (SImode, operands[2]);
4334 operands[2] = make_safe_from (operands[2], operands[0]);
4336 emit_move_insn (operands[0], const0_rtx);
4337 emit_insn (gen_cmpsi (operands[2], operands[1]));
4338 emit_jump_insn (gen_bgtu (label3));
4339 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4340 emit_jump_insn (gen_blt (label2));
4341 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4342 emit_jump_insn (gen_beq (label1));
4343 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4344 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4347 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4349 insn = emit_move_insn (operands[0],
4350 gen_lowpart (SImode, operands[3]));
4352 gen_rtx_EXPR_LIST (REG_EQUAL,
4353 udiv_equal, REG_NOTES (insn));
4355 emit_label (label1);
4356 emit_move_insn (operands[0], operands[1]);
4358 emit_label (label2);
4359 emit_move_insn (operands[0], const1_rtx);
4360 emit_label (label3);
4362 emit_move_insn (operands[0], operands[0]);
4366 (define_expand "umodsi3"
4367 [(set (match_operand:SI 0 "register_operand" "=d")
4368 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
4369 (match_operand:SI 2 "nonimmediate_operand" "")))
4370 (clobber (match_dup 3))]
4373 rtx insn, udiv_equal, umod_equal, equal;
4375 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4376 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4377 equal = gen_rtx_IOR (DImode,
4378 gen_rtx_ZERO_EXTEND (DImode, udiv_equal),
4379 gen_rtx_ASHIFT (DImode,
4380 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4383 operands[3] = gen_reg_rtx (DImode);
4385 if (CONSTANT_P (operands[2]))
4387 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
4389 rtx label1 = gen_label_rtx ();
4391 operands[1] = make_safe_from (operands[1], operands[0]);
4392 emit_move_insn (operands[0], operands[1]);
4393 emit_insn (gen_cmpsi (operands[0], operands[2]));
4394 emit_jump_insn (gen_bltu (label1));
4395 emit_insn (gen_abssi2 (operands[0], operands[2]));
4396 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
4397 emit_label (label1);
4401 operands[2] = force_reg (SImode, operands[2]);
4402 operands[2] = make_safe_from (operands[2], operands[0]);
4404 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4405 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4408 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4410 insn = emit_move_insn (operands[0],
4411 gen_highpart (SImode, operands[3]));
4413 gen_rtx_EXPR_LIST (REG_EQUAL,
4414 umod_equal, REG_NOTES (insn));
4419 rtx label1 = gen_label_rtx ();
4420 rtx label2 = gen_label_rtx ();
4421 rtx label3 = gen_label_rtx ();
4423 operands[1] = force_reg (SImode, operands[1]);
4424 operands[1] = make_safe_from (operands[1], operands[0]);
4425 operands[2] = force_reg (SImode, operands[2]);
4426 operands[2] = make_safe_from (operands[2], operands[0]);
4428 emit_move_insn(operands[0], operands[1]);
4429 emit_insn (gen_cmpsi (operands[2], operands[1]));
4430 emit_jump_insn (gen_bgtu (label3));
4431 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4432 emit_jump_insn (gen_blt (label2));
4433 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4434 emit_jump_insn (gen_beq (label1));
4435 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4436 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4439 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4441 insn = emit_move_insn (operands[0],
4442 gen_highpart (SImode, operands[3]));
4444 gen_rtx_EXPR_LIST (REG_EQUAL,
4445 umod_equal, REG_NOTES (insn));
4447 emit_label (label1);
4448 emit_move_insn (operands[0], const0_rtx);
4450 emit_label (label2);
4451 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
4452 emit_label (label3);
4458 ; divdf3 instruction pattern(s).
4461 (define_expand "divdf3"
4463 [(set (match_operand:DF 0 "register_operand" "=f,f")
4464 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4465 (match_operand:DF 2 "general_operand" "f,R")))
4466 (clobber (reg:CC 33))])]
4470 (define_insn "*divdf3"
4471 [(set (match_operand:DF 0 "register_operand" "=f,f")
4472 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4473 (match_operand:DF 2 "general_operand" "f,R")))
4474 (clobber (reg:CC 33))]
4475 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4479 [(set_attr "op_type" "RRE,RXE")
4480 (set_attr "type" "fdivd")])
4482 (define_insn "*divdf3_ibm"
4483 [(set (match_operand:DF 0 "register_operand" "=f,f")
4484 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4485 (match_operand:DF 2 "general_operand" "f,R")))
4486 (clobber (reg:CC 33))]
4487 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4491 [(set_attr "op_type" "RR,RX")
4492 (set_attr "type" "fdivd")])
4495 ; divsf3 instruction pattern(s).
4498 (define_expand "divsf3"
4500 [(set (match_operand:SF 0 "register_operand" "=f,f")
4501 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4502 (match_operand:SF 2 "general_operand" "f,R")))
4503 (clobber (reg:CC 33))])]
4507 (define_insn "*divsf3"
4508 [(set (match_operand:SF 0 "register_operand" "=f,f")
4509 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4510 (match_operand:SF 2 "general_operand" "f,R")))
4511 (clobber (reg:CC 33))]
4512 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4516 [(set_attr "op_type" "RRE,RXE")
4517 (set_attr "type" "fdivs")])
4519 (define_insn "*divsf3"
4520 [(set (match_operand:SF 0 "register_operand" "=f,f")
4521 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4522 (match_operand:SF 2 "general_operand" "f,R")))
4523 (clobber (reg:CC 33))]
4524 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4528 [(set_attr "op_type" "RR,RX")
4529 (set_attr "type" "fdivs")])
4533 ;;- And instructions.
4537 ; anddi3 instruction pattern(s).
4540 (define_insn "*anddi3_cc"
4542 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4543 (match_operand:DI 2 "general_operand" "d,m"))
4545 (set (match_operand:DI 0 "register_operand" "=d,d")
4546 (and:DI (match_dup 1) (match_dup 2)))]
4547 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4551 [(set_attr "op_type" "RRE,RXY")])
4553 (define_insn "*anddi3_cconly"
4555 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4556 (match_operand:DI 2 "general_operand" "d,m"))
4558 (clobber (match_scratch:DI 0 "=d,d"))]
4559 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4563 [(set_attr "op_type" "RRE,RXY")])
4565 (define_insn "*anddi3_ni"
4566 [(set (match_operand:DI 0 "register_operand" "=d")
4567 (and:DI (match_operand:DI 1 "nonimmediate_operand" "0")
4568 (match_operand:DI 2 "immediate_operand" "n")))
4569 (clobber (reg:CC 33))]
4570 "TARGET_64BIT && s390_single_hi (operands[2], DImode, -1) >= 0"
4572 int part = s390_single_hi (operands[2], DImode, -1);
4573 operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
4577 case 0: return "nihh\t%0,%x2";
4578 case 1: return "nihl\t%0,%x2";
4579 case 2: return "nilh\t%0,%x2";
4580 case 3: return "nill\t%0,%x2";
4584 [(set_attr "op_type" "RI")])
4586 (define_insn "anddi3"
4587 [(set (match_operand:DI 0 "register_operand" "=d,d")
4588 (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4589 (match_operand:DI 2 "general_operand" "d,m")))
4590 (clobber (reg:CC 33))]
4595 [(set_attr "op_type" "RRE,RXY")])
4597 (define_insn "*anddi3_ss"
4598 [(set (match_operand:DI 0 "s_operand" "=Q")
4599 (and:DI (match_dup 0)
4600 (match_operand:DI 1 "s_imm_operand" "Q")))
4601 (clobber (reg:CC 33))]
4604 [(set_attr "op_type" "SS")])
4606 (define_insn "*anddi3_ss_inv"
4607 [(set (match_operand:DI 0 "s_operand" "=Q")
4608 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
4610 (clobber (reg:CC 33))]
4613 [(set_attr "op_type" "SS")])
4616 ; andsi3 instruction pattern(s).
4619 (define_insn "*andsi3_cc"
4621 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4622 (match_operand:SI 2 "general_operand" "d,R,T"))
4624 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4625 (and:SI (match_dup 1) (match_dup 2)))]
4626 "s390_match_ccmode(insn, CCTmode)"
4631 [(set_attr "op_type" "RR,RX,RXY")])
4633 (define_insn "*andsi3_cconly"
4635 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4636 (match_operand:SI 2 "general_operand" "d,R,T"))
4638 (clobber (match_scratch:SI 0 "=d,d,d"))]
4639 "s390_match_ccmode(insn, CCTmode)"
4644 [(set_attr "op_type" "RR,RX,RXY")])
4646 (define_insn "*andsi3_ni"
4647 [(set (match_operand:SI 0 "register_operand" "=d")
4648 (and:SI (match_operand:SI 1 "nonimmediate_operand" "0")
4649 (match_operand:SI 2 "immediate_operand" "n")))
4650 (clobber (reg:CC 33))]
4651 "TARGET_64BIT && s390_single_hi (operands[2], SImode, -1) >= 0"
4653 int part = s390_single_hi (operands[2], SImode, -1);
4654 operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
4658 case 0: return "nilh\t%0,%x2";
4659 case 1: return "nill\t%0,%x2";
4663 [(set_attr "op_type" "RI")])
4665 (define_insn "andsi3"
4666 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4667 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4668 (match_operand:SI 2 "general_operand" "d,R,T")))
4669 (clobber (reg:CC 33))]
4675 [(set_attr "op_type" "RR,RX,RXY")])
4677 (define_insn "*andsi3_ss"
4678 [(set (match_operand:SI 0 "s_operand" "=Q")
4679 (and:SI (match_dup 0)
4680 (match_operand:SI 1 "s_imm_operand" "Q")))
4681 (clobber (reg:CC 33))]
4684 [(set_attr "op_type" "SS")])
4686 (define_insn "*andsi3_ss_inv"
4687 [(set (match_operand:SI 0 "s_operand" "=Q")
4688 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
4690 (clobber (reg:CC 33))]
4693 [(set_attr "op_type" "SS")])
4696 ; andhi3 instruction pattern(s).
4699 (define_insn "*andhi3_ni"
4700 [(set (match_operand:HI 0 "register_operand" "=d,d")
4701 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
4702 (match_operand:HI 2 "nonmemory_operand" "d,n")))
4703 (clobber (reg:CC 33))]
4708 [(set_attr "op_type" "RR,RI")])
4710 (define_insn "andhi3"
4711 [(set (match_operand:HI 0 "register_operand" "=d")
4712 (and:HI (match_operand:HI 1 "register_operand" "%0")
4713 (match_operand:HI 2 "nonmemory_operand" "d")))
4714 (clobber (reg:CC 33))]
4717 [(set_attr "op_type" "RR")])
4719 (define_insn "*andhi3_ss"
4720 [(set (match_operand:HI 0 "s_operand" "=Q")
4721 (and:HI (match_dup 0)
4722 (match_operand:HI 1 "s_imm_operand" "Q")))
4723 (clobber (reg:CC 33))]
4726 [(set_attr "op_type" "SS")])
4728 (define_insn "*andhi3_ss_inv"
4729 [(set (match_operand:HI 0 "s_operand" "=Q")
4730 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
4732 (clobber (reg:CC 33))]
4735 [(set_attr "op_type" "SS")])
4738 ; andqi3 instruction pattern(s).
4741 (define_insn "*andqi3_ni"
4742 [(set (match_operand:QI 0 "register_operand" "=d,d")
4743 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
4744 (match_operand:QI 2 "nonmemory_operand" "d,n")))
4745 (clobber (reg:CC 33))]
4750 [(set_attr "op_type" "RR,RI")])
4752 (define_insn "andqi3"
4753 [(set (match_operand:QI 0 "register_operand" "=d")
4754 (and:QI (match_operand:QI 1 "register_operand" "%0")
4755 (match_operand:QI 2 "nonmemory_operand" "d")))
4756 (clobber (reg:CC 33))]
4759 [(set_attr "op_type" "RR")])
4761 (define_insn "*andqi3_ss"
4762 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
4763 (and:QI (match_dup 0)
4764 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
4765 (clobber (reg:CC 33))]
4771 [(set_attr "op_type" "SI,SIY,SS")])
4773 (define_insn "*andqi3_ss_inv"
4774 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
4775 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
4777 (clobber (reg:CC 33))]
4783 [(set_attr "op_type" "SI,SIY,SS")])
4787 ;;- Bit set (inclusive or) instructions.
4791 ; iordi3 instruction pattern(s).
4794 (define_insn "*iordi3_cc"
4796 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4797 (match_operand:DI 2 "general_operand" "d,m"))
4799 (set (match_operand:DI 0 "register_operand" "=d,d")
4800 (ior:DI (match_dup 1) (match_dup 2)))]
4801 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4805 [(set_attr "op_type" "RRE,RXY")])
4807 (define_insn "*iordi3_cconly"
4809 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4810 (match_operand:DI 2 "general_operand" "d,m"))
4812 (clobber (match_scratch:DI 0 "=d,d"))]
4813 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4817 [(set_attr "op_type" "RRE,RXY")])
4819 (define_insn "*iordi3_oi"
4820 [(set (match_operand:DI 0 "register_operand" "=d")
4821 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0")
4822 (match_operand:DI 2 "immediate_operand" "n")))
4823 (clobber (reg:CC 33))]
4824 "TARGET_64BIT && s390_single_hi (operands[2], DImode, 0) >= 0"
4826 int part = s390_single_hi (operands[2], DImode, 0);
4827 operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
4831 case 0: return "oihh\t%0,%x2";
4832 case 1: return "oihl\t%0,%x2";
4833 case 2: return "oilh\t%0,%x2";
4834 case 3: return "oill\t%0,%x2";
4838 [(set_attr "op_type" "RI")])
4840 (define_insn "iordi3"
4841 [(set (match_operand:DI 0 "register_operand" "=d,d")
4842 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4843 (match_operand:DI 2 "general_operand" "d,m")))
4844 (clobber (reg:CC 33))]
4849 [(set_attr "op_type" "RRE,RXY")])
4851 (define_insn "*iordi3_ss"
4852 [(set (match_operand:DI 0 "s_operand" "=Q")
4853 (ior:DI (match_dup 0)
4854 (match_operand:DI 1 "s_imm_operand" "Q")))
4855 (clobber (reg:CC 33))]
4858 [(set_attr "op_type" "SS")])
4860 (define_insn "*iordi3_ss_inv"
4861 [(set (match_operand:DI 0 "s_operand" "=Q")
4862 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
4864 (clobber (reg:CC 33))]
4867 [(set_attr "op_type" "SS")])
4870 ; iorsi3 instruction pattern(s).
4873 (define_insn "*iorsi3_cc"
4875 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4876 (match_operand:SI 2 "general_operand" "d,R,T"))
4878 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4879 (ior:SI (match_dup 1) (match_dup 2)))]
4880 "s390_match_ccmode(insn, CCTmode)"
4885 [(set_attr "op_type" "RR,RX,RXY")])
4887 (define_insn "*iorsi3_cconly"
4889 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4890 (match_operand:SI 2 "general_operand" "d,R,T"))
4892 (clobber (match_scratch:SI 0 "=d,d,d"))]
4893 "s390_match_ccmode(insn, CCTmode)"
4898 [(set_attr "op_type" "RR,RX,RXY")])
4900 (define_insn "*iorsi3_oi"
4901 [(set (match_operand:SI 0 "register_operand" "=d")
4902 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0")
4903 (match_operand:SI 2 "immediate_operand" "n")))
4904 (clobber (reg:CC 33))]
4905 "TARGET_64BIT && s390_single_hi (operands[2], SImode, 0) >= 0"
4907 int part = s390_single_hi (operands[2], SImode, 0);
4908 operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
4912 case 0: return "oilh\t%0,%x2";
4913 case 1: return "oill\t%0,%x2";
4917 [(set_attr "op_type" "RI")])
4919 (define_insn "iorsi3"
4920 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4921 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4922 (match_operand:SI 2 "general_operand" "d,R,T")))
4923 (clobber (reg:CC 33))]
4929 [(set_attr "op_type" "RR,RX,RXY")])
4931 (define_insn "*iorsi3_ss"
4932 [(set (match_operand:SI 0 "s_operand" "=Q")
4933 (ior:SI (match_dup 0)
4934 (match_operand:SI 1 "s_imm_operand" "Q")))
4935 (clobber (reg:CC 33))]
4938 [(set_attr "op_type" "SS")])
4940 (define_insn "*iorsi3_ss_inv"
4941 [(set (match_operand:SI 0 "s_operand" "=Q")
4942 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
4944 (clobber (reg:CC 33))]
4947 [(set_attr "op_type" "SS")])
4950 ; iorhi3 instruction pattern(s).
4953 (define_insn "*iorhi3_oi"
4954 [(set (match_operand:HI 0 "register_operand" "=d,d")
4955 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
4956 (match_operand:HI 2 "nonmemory_operand" "d,n")))
4957 (clobber (reg:CC 33))]
4962 [(set_attr "op_type" "RR,RI")])
4964 (define_insn "iorhi3"
4965 [(set (match_operand:HI 0 "register_operand" "=d")
4966 (ior:HI (match_operand:HI 1 "register_operand" "%0")
4967 (match_operand:HI 2 "nonmemory_operand" "d")))
4968 (clobber (reg:CC 33))]
4971 [(set_attr "op_type" "RR")])
4973 (define_insn "*iorhi3_ss"
4974 [(set (match_operand:HI 0 "s_operand" "=Q")
4975 (ior:HI (match_dup 0)
4976 (match_operand:HI 1 "s_imm_operand" "Q")))
4977 (clobber (reg:CC 33))]
4980 [(set_attr "op_type" "SS")])
4982 (define_insn "*iorhi3_ss_inv"
4983 [(set (match_operand:HI 0 "s_operand" "=Q")
4984 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
4986 (clobber (reg:CC 33))]
4989 [(set_attr "op_type" "SS")])
4992 ; iorqi3 instruction pattern(s).
4995 (define_insn "*iorqi3_oi"
4996 [(set (match_operand:QI 0 "register_operand" "=d,d")
4997 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
4998 (match_operand:QI 2 "nonmemory_operand" "d,n")))
4999 (clobber (reg:CC 33))]
5004 [(set_attr "op_type" "RR,RI")])
5006 (define_insn "iorqi3"
5007 [(set (match_operand:QI 0 "register_operand" "=d")
5008 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5009 (match_operand:QI 2 "nonmemory_operand" "d")))
5010 (clobber (reg:CC 33))]
5013 [(set_attr "op_type" "RR")])
5015 (define_insn "*iorqi3_ss"
5016 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5017 (ior:QI (match_dup 0)
5018 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5019 (clobber (reg:CC 33))]
5025 [(set_attr "op_type" "SI,SIY,SS")])
5027 (define_insn "*iorqi3_ss_inv"
5028 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5029 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5031 (clobber (reg:CC 33))]
5037 [(set_attr "op_type" "SI,SIY,SS")])
5041 ;;- Xor instructions.
5045 ; xordi3 instruction pattern(s).
5048 (define_insn "*xordi3_cc"
5050 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5051 (match_operand:DI 2 "general_operand" "d,m"))
5053 (set (match_operand:DI 0 "register_operand" "=d,d")
5054 (xor:DI (match_dup 1) (match_dup 2)))]
5055 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5059 [(set_attr "op_type" "RRE,RXY")])
5061 (define_insn "*xordi3_cconly"
5063 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5064 (match_operand:DI 2 "general_operand" "d,m"))
5066 (clobber (match_scratch:DI 0 "=d,d"))]
5067 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5071 [(set_attr "op_type" "RRE,RXY")])
5073 (define_insn "xordi3"
5074 [(set (match_operand:DI 0 "register_operand" "=d,d")
5075 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5076 (match_operand:DI 2 "general_operand" "d,m")))
5077 (clobber (reg:CC 33))]
5082 [(set_attr "op_type" "RRE,RXY")])
5084 (define_insn "*xordi3_ss"
5085 [(set (match_operand:DI 0 "s_operand" "=Q")
5086 (xor:DI (match_dup 0)
5087 (match_operand:DI 1 "s_imm_operand" "Q")))
5088 (clobber (reg:CC 33))]
5091 [(set_attr "op_type" "SS")])
5093 (define_insn "*xordi3_ss_inv"
5094 [(set (match_operand:DI 0 "s_operand" "=Q")
5095 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5097 (clobber (reg:CC 33))]
5100 [(set_attr "op_type" "SS")])
5103 ; xorsi3 instruction pattern(s).
5106 (define_insn "*xorsi3_cc"
5108 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5109 (match_operand:SI 2 "general_operand" "d,R,T"))
5111 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5112 (xor:SI (match_dup 1) (match_dup 2)))]
5113 "s390_match_ccmode(insn, CCTmode)"
5118 [(set_attr "op_type" "RR,RX,RXY")])
5120 (define_insn "*xorsi3_cconly"
5122 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5123 (match_operand:SI 2 "general_operand" "d,R,T"))
5125 (clobber (match_scratch:SI 0 "=d,d,d"))]
5126 "s390_match_ccmode(insn, CCTmode)"
5131 [(set_attr "op_type" "RR,RX,RXY")])
5133 (define_insn "xorsi3"
5134 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5135 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5136 (match_operand:SI 2 "general_operand" "d,R,T")))
5137 (clobber (reg:CC 33))]
5143 [(set_attr "op_type" "RR,RX,RXY")])
5145 (define_insn "*xorsi3_ss"
5146 [(set (match_operand:SI 0 "s_operand" "=Q")
5147 (xor:SI (match_dup 0)
5148 (match_operand:SI 1 "s_imm_operand" "Q")))
5149 (clobber (reg:CC 33))]
5152 [(set_attr "op_type" "SS")])
5154 (define_insn "*xorsi3_ss_inv"
5155 [(set (match_operand:SI 0 "s_operand" "=Q")
5156 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5158 (clobber (reg:CC 33))]
5161 [(set_attr "op_type" "SS")])
5164 ; xorhi3 instruction pattern(s).
5167 (define_insn "xorhi3"
5168 [(set (match_operand:HI 0 "register_operand" "=d")
5169 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5170 (match_operand:HI 2 "nonmemory_operand" "d")))
5171 (clobber (reg:CC 33))]
5174 [(set_attr "op_type" "RR")])
5176 (define_insn "*xorhi3_ss"
5177 [(set (match_operand:HI 0 "s_operand" "=Q")
5178 (xor:HI (match_dup 0)
5179 (match_operand:HI 1 "s_imm_operand" "Q")))
5180 (clobber (reg:CC 33))]
5183 [(set_attr "op_type" "SS")])
5185 (define_insn "*xorhi3_ss_inv"
5186 [(set (match_operand:HI 0 "s_operand" "=Q")
5187 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5189 (clobber (reg:CC 33))]
5192 [(set_attr "op_type" "SS")])
5195 ; xorqi3 instruction pattern(s).
5198 (define_insn "xorqi3"
5199 [(set (match_operand:QI 0 "register_operand" "=d")
5200 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5201 (match_operand:QI 2 "nonmemory_operand" "d")))
5202 (clobber (reg:CC 33))]
5205 [(set_attr "op_type" "RR")])
5207 (define_insn "*xorqi3_ss"
5208 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5209 (xor:QI (match_dup 0)
5210 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5211 (clobber (reg:CC 33))]
5217 [(set_attr "op_type" "SI,SIY,SS")])
5219 (define_insn "*xorqi3_ss_inv"
5220 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5221 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5223 (clobber (reg:CC 33))]
5229 [(set_attr "op_type" "SI,SIY,SS")])
5233 ;;- Negate instructions.
5237 ; negdi2 instruction pattern(s).
5240 (define_expand "negdi2"
5242 [(set (match_operand:DI 0 "register_operand" "=d")
5243 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5244 (clobber (reg:CC 33))])]
5248 (define_insn "*negdi2_64"
5249 [(set (match_operand:DI 0 "register_operand" "=d")
5250 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5251 (clobber (reg:CC 33))]
5254 [(set_attr "op_type" "RR")])
5256 (define_insn "*negdi2_31"
5257 [(set (match_operand:DI 0 "register_operand" "=d")
5258 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5259 (clobber (reg:CC 33))]
5263 xop[0] = gen_label_rtx ();
5264 output_asm_insn ("lcr\t%0,%1", operands);
5265 output_asm_insn ("lcr\t%N0,%N1", operands);
5266 output_asm_insn ("je\t%l0", xop);
5267 output_asm_insn ("bctr\t%0,0", operands);
5268 targetm.asm_out.internal_label (asm_out_file, "L",
5269 CODE_LABEL_NUMBER (xop[0]));
5272 [(set_attr "op_type" "NN")
5273 (set_attr "type" "other")
5274 (set_attr "length" "10")])
5277 ; negsi2 instruction pattern(s).
5280 (define_insn "negsi2"
5281 [(set (match_operand:SI 0 "register_operand" "=d")
5282 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5283 (clobber (reg:CC 33))]
5286 [(set_attr "op_type" "RR")])
5289 ; negdf2 instruction pattern(s).
5292 (define_expand "negdf2"
5294 [(set (match_operand:DF 0 "register_operand" "=f")
5295 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5296 (clobber (reg:CC 33))])]
5300 (define_insn "*negdf2"
5301 [(set (match_operand:DF 0 "register_operand" "=f")
5302 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5303 (clobber (reg:CC 33))]
5304 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5306 [(set_attr "op_type" "RRE")
5307 (set_attr "type" "fsimpd")])
5309 (define_insn "*negdf2_ibm"
5310 [(set (match_operand:DF 0 "register_operand" "=f")
5311 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5312 (clobber (reg:CC 33))]
5313 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5315 [(set_attr "op_type" "RR")
5316 (set_attr "type" "fsimpd")])
5319 ; negsf2 instruction pattern(s).
5322 (define_expand "negsf2"
5324 [(set (match_operand:SF 0 "register_operand" "=f")
5325 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5326 (clobber (reg:CC 33))])]
5330 (define_insn "*negsf2"
5331 [(set (match_operand:SF 0 "register_operand" "=f")
5332 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5333 (clobber (reg:CC 33))]
5334 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5336 [(set_attr "op_type" "RRE")
5337 (set_attr "type" "fsimps")])
5339 (define_insn "*negsf2"
5340 [(set (match_operand:SF 0 "register_operand" "=f")
5341 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5342 (clobber (reg:CC 33))]
5343 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5345 [(set_attr "op_type" "RR")
5346 (set_attr "type" "fsimps")])
5350 ;;- Absolute value instructions.
5354 ; absdi2 instruction pattern(s).
5357 (define_insn "absdi2"
5358 [(set (match_operand:DI 0 "register_operand" "=d")
5359 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5360 (clobber (reg:CC 33))]
5363 [(set_attr "op_type" "RRE")])
5366 ; abssi2 instruction pattern(s).
5369 (define_insn "abssi2"
5370 [(set (match_operand:SI 0 "register_operand" "=d")
5371 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5372 (clobber (reg:CC 33))]
5375 [(set_attr "op_type" "RR")])
5378 ; absdf2 instruction pattern(s).
5381 (define_expand "absdf2"
5383 [(set (match_operand:DF 0 "register_operand" "=f")
5384 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5385 (clobber (reg:CC 33))])]
5389 (define_insn "*absdf2"
5390 [(set (match_operand:DF 0 "register_operand" "=f")
5391 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5392 (clobber (reg:CC 33))]
5393 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5395 [(set_attr "op_type" "RRE")
5396 (set_attr "type" "fsimpd")])
5398 (define_insn "*absdf2_ibm"
5399 [(set (match_operand:DF 0 "register_operand" "=f")
5400 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5401 (clobber (reg:CC 33))]
5402 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5404 [(set_attr "op_type" "RR")
5405 (set_attr "type" "fsimpd")])
5408 ; abssf2 instruction pattern(s).
5411 (define_expand "abssf2"
5413 [(set (match_operand:SF 0 "register_operand" "=f")
5414 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5415 (clobber (reg:CC 33))])]
5419 (define_insn "*abssf2"
5420 [(set (match_operand:SF 0 "register_operand" "=f")
5421 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5422 (clobber (reg:CC 33))]
5423 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5425 [(set_attr "op_type" "RRE")
5426 (set_attr "type" "fsimps")])
5428 (define_insn "*abssf2_ibm"
5429 [(set (match_operand:SF 0 "register_operand" "=f")
5430 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5431 (clobber (reg:CC 33))]
5432 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5434 [(set_attr "op_type" "RR")
5435 (set_attr "type" "fsimps")])
5438 ;;- Negated absolute value instructions
5445 (define_insn "*negabssi2"
5446 [(set (match_operand:SI 0 "register_operand" "=d")
5447 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
5448 (clobber (reg:CC 33))]
5451 [(set_attr "op_type" "RR")])
5453 (define_insn "*negabsdi2"
5454 [(set (match_operand:DI 0 "register_operand" "=d")
5455 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
5456 (clobber (reg:CC 33))]
5459 [(set_attr "op_type" "RRE")])
5465 (define_insn "*negabssf2"
5466 [(set (match_operand:SF 0 "register_operand" "=f")
5467 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
5468 (clobber (reg:CC 33))]
5469 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5471 [(set_attr "op_type" "RRE")
5472 (set_attr "type" "fsimps")])
5474 (define_insn "*negabsdf2"
5475 [(set (match_operand:DF 0 "register_operand" "=f")
5476 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
5477 (clobber (reg:CC 33))]
5478 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5480 [(set_attr "op_type" "RRE")
5481 (set_attr "type" "fsimpd")])
5484 ;;- Square root instructions.
5488 ; sqrtdf2 instruction pattern(s).
5491 (define_insn "sqrtdf2"
5492 [(set (match_operand:DF 0 "register_operand" "=f,f")
5493 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
5494 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5498 [(set_attr "op_type" "RRE,RXE")])
5501 ; sqrtsf2 instruction pattern(s).
5504 (define_insn "sqrtsf2"
5505 [(set (match_operand:SF 0 "register_operand" "=f,f")
5506 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
5507 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5511 [(set_attr "op_type" "RRE,RXE")])
5514 ;;- One complement instructions.
5518 ; one_cmpldi2 instruction pattern(s).
5521 (define_expand "one_cmpldi2"
5523 [(set (match_operand:DI 0 "register_operand" "")
5524 (xor:DI (match_operand:DI 1 "register_operand" "")
5526 (clobber (reg:CC 33))])]
5531 ; one_cmplsi2 instruction pattern(s).
5534 (define_expand "one_cmplsi2"
5536 [(set (match_operand:SI 0 "register_operand" "")
5537 (xor:SI (match_operand:SI 1 "register_operand" "")
5539 (clobber (reg:CC 33))])]
5544 ; one_cmplhi2 instruction pattern(s).
5547 (define_expand "one_cmplhi2"
5549 [(set (match_operand:HI 0 "register_operand" "")
5550 (xor:HI (match_operand:HI 1 "register_operand" "")
5552 (clobber (reg:CC 33))])]
5557 ; one_cmplqi2 instruction pattern(s).
5560 (define_expand "one_cmplqi2"
5562 [(set (match_operand:QI 0 "register_operand" "")
5563 (xor:QI (match_operand:QI 1 "register_operand" "")
5565 (clobber (reg:CC 33))])]
5571 ;;- Rotate instructions.
5575 ; rotldi3 instruction pattern(s).
5578 (define_insn "rotldi3"
5579 [(set (match_operand:DI 0 "register_operand" "=d,d")
5580 (rotate:DI (match_operand:DI 1 "register_operand" "d,d")
5581 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5586 [(set_attr "op_type" "RSE")
5587 (set_attr "atype" "reg")])
5590 ; rotlsi3 instruction pattern(s).
5593 (define_insn "rotlsi3"
5594 [(set (match_operand:SI 0 "register_operand" "=d,d")
5595 (rotate:SI (match_operand:SI 1 "register_operand" "d,d")
5596 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5601 [(set_attr "op_type" "RSE")
5602 (set_attr "atype" "reg")])
5606 ;;- Arithmetic shift instructions.
5610 ; ashldi3 instruction pattern(s).
5613 (define_expand "ashldi3"
5614 [(set (match_operand:DI 0 "register_operand" "")
5615 (ashift:DI (match_operand:DI 1 "register_operand" "")
5616 (match_operand:SI 2 "nonmemory_operand" "")))]
5620 (define_insn "*ashldi3_31"
5621 [(set (match_operand:DI 0 "register_operand" "=d,d")
5622 (ashift:DI (match_operand:DI 1 "register_operand" "0,0")
5623 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5628 [(set_attr "op_type" "RS")
5629 (set_attr "atype" "reg")])
5631 (define_insn "*ashldi3_64"
5632 [(set (match_operand:DI 0 "register_operand" "=d,d")
5633 (ashift:DI (match_operand:DI 1 "register_operand" "d,d")
5634 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5639 [(set_attr "op_type" "RSE")
5640 (set_attr "atype" "reg")])
5643 ; ashrdi3 instruction pattern(s).
5646 (define_expand "ashrdi3"
5648 [(set (match_operand:DI 0 "register_operand" "")
5649 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
5650 (match_operand:SI 2 "nonmemory_operand" "")))
5651 (clobber (reg:CC 33))])]
5655 (define_insn "*ashrdi3_cc_31"
5657 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5658 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5660 (set (match_operand:DI 0 "register_operand" "=d,d")
5661 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
5662 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
5666 [(set_attr "op_type" "RS")
5667 (set_attr "atype" "reg")])
5669 (define_insn "*ashrdi3_cconly_31"
5671 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5672 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5674 (clobber (match_scratch:DI 0 "=d,d"))]
5675 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
5679 [(set_attr "op_type" "RS")
5680 (set_attr "atype" "reg")])
5682 (define_insn "*ashrdi3_31"
5683 [(set (match_operand:DI 0 "register_operand" "=d,d")
5684 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5685 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5686 (clobber (reg:CC 33))]
5691 [(set_attr "op_type" "RS")
5692 (set_attr "atype" "reg")])
5694 (define_insn "*ashrdi3_cc_64"
5696 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5697 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5699 (set (match_operand:DI 0 "register_operand" "=d,d")
5700 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
5701 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
5705 [(set_attr "op_type" "RSE")
5706 (set_attr "atype" "reg")])
5708 (define_insn "*ashrdi3_cconly_64"
5710 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5711 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5713 (clobber (match_scratch:DI 0 "=d,d"))]
5714 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
5718 [(set_attr "op_type" "RSE")
5719 (set_attr "atype" "reg")])
5721 (define_insn "*ashrdi3_64"
5722 [(set (match_operand:DI 0 "register_operand" "=d,d")
5723 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5724 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5725 (clobber (reg:CC 33))]
5730 [(set_attr "op_type" "RSE")
5731 (set_attr "atype" "reg")])
5735 ; ashlsi3 instruction pattern(s).
5738 (define_insn "ashlsi3"
5739 [(set (match_operand:SI 0 "register_operand" "=d,d")
5740 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
5741 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5746 [(set_attr "op_type" "RS")
5747 (set_attr "atype" "reg")])
5750 ; ashrsi3 instruction pattern(s).
5753 (define_insn "*ashrsi3_cc"
5755 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5756 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5758 (set (match_operand:SI 0 "register_operand" "=d,d")
5759 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
5760 "s390_match_ccmode(insn, CCSmode)"
5764 [(set_attr "op_type" "RS")
5765 (set_attr "atype" "reg")])
5768 (define_insn "*ashrsi3_cconly"
5770 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5771 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5773 (clobber (match_scratch:SI 0 "=d,d"))]
5774 "s390_match_ccmode(insn, CCSmode)"
5778 [(set_attr "op_type" "RS")
5779 (set_attr "atype" "reg")])
5781 (define_insn "ashrsi3"
5782 [(set (match_operand:SI 0 "register_operand" "=d,d")
5783 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5784 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5785 (clobber (reg:CC 33))]
5790 [(set_attr "op_type" "RS")
5791 (set_attr "atype" "reg")])
5795 ;;- logical shift instructions.
5799 ; lshrdi3 instruction pattern(s).
5802 (define_expand "lshrdi3"
5803 [(set (match_operand:DI 0 "register_operand" "")
5804 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
5805 (match_operand:SI 2 "nonmemory_operand" "")))]
5809 (define_insn "*lshrdi3_31"
5810 [(set (match_operand:DI 0 "register_operand" "=d,d")
5811 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5812 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5817 [(set_attr "op_type" "RS,RS")
5818 (set_attr "atype" "reg")])
5820 (define_insn "*lshrdi3_64"
5821 [(set (match_operand:DI 0 "register_operand" "=d,d")
5822 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5823 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5828 [(set_attr "op_type" "RSE,RSE")
5829 (set_attr "atype" "reg")])
5832 ; lshrsi3 instruction pattern(s).
5835 (define_insn "lshrsi3"
5836 [(set (match_operand:SI 0 "register_operand" "=d,d")
5837 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5838 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5843 [(set_attr "op_type" "RS")
5844 (set_attr "atype" "reg")])
5848 ;; Branch instruction patterns.
5851 (define_expand "beq"
5852 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
5854 (if_then_else (eq (reg:CCZ 33) (const_int 0))
5855 (label_ref (match_operand 0 "" ""))
5858 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5860 (define_expand "bne"
5861 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
5863 (if_then_else (ne (reg:CCZ 33) (const_int 0))
5864 (label_ref (match_operand 0 "" ""))
5867 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5869 (define_expand "bgt"
5870 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5872 (if_then_else (gt (reg:CCS 33) (const_int 0))
5873 (label_ref (match_operand 0 "" ""))
5876 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5878 (define_expand "bgtu"
5879 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
5881 (if_then_else (gtu (reg:CCU 33) (const_int 0))
5882 (label_ref (match_operand 0 "" ""))
5885 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5887 (define_expand "blt"
5888 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5890 (if_then_else (lt (reg:CCS 33) (const_int 0))
5891 (label_ref (match_operand 0 "" ""))
5894 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5896 (define_expand "bltu"
5897 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
5899 (if_then_else (ltu (reg:CCU 33) (const_int 0))
5900 (label_ref (match_operand 0 "" ""))
5903 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5905 (define_expand "bge"
5906 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5908 (if_then_else (ge (reg:CCS 33) (const_int 0))
5909 (label_ref (match_operand 0 "" ""))
5912 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5914 (define_expand "bgeu"
5915 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
5917 (if_then_else (geu (reg:CCU 33) (const_int 0))
5918 (label_ref (match_operand 0 "" ""))
5921 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5923 (define_expand "ble"
5924 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5926 (if_then_else (le (reg:CCS 33) (const_int 0))
5927 (label_ref (match_operand 0 "" ""))
5930 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5932 (define_expand "bleu"
5933 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
5935 (if_then_else (leu (reg:CCU 33) (const_int 0))
5936 (label_ref (match_operand 0 "" ""))
5939 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5941 (define_expand "bunordered"
5942 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5944 (if_then_else (unordered (reg:CCS 33) (const_int 0))
5945 (label_ref (match_operand 0 "" ""))
5948 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5950 (define_expand "bordered"
5951 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5953 (if_then_else (ordered (reg:CCS 33) (const_int 0))
5954 (label_ref (match_operand 0 "" ""))
5957 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5959 (define_expand "buneq"
5960 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5962 (if_then_else (uneq (reg:CCS 33) (const_int 0))
5963 (label_ref (match_operand 0 "" ""))
5966 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5968 (define_expand "bungt"
5969 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5971 (if_then_else (ungt (reg:CCS 33) (const_int 0))
5972 (label_ref (match_operand 0 "" ""))
5975 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5977 (define_expand "bunlt"
5978 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5980 (if_then_else (unlt (reg:CCS 33) (const_int 0))
5981 (label_ref (match_operand 0 "" ""))
5984 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5986 (define_expand "bunge"
5987 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5989 (if_then_else (unge (reg:CCS 33) (const_int 0))
5990 (label_ref (match_operand 0 "" ""))
5993 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
5995 (define_expand "bunle"
5996 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
5998 (if_then_else (unle (reg:CCS 33) (const_int 0))
5999 (label_ref (match_operand 0 "" ""))
6002 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6004 (define_expand "bltgt"
6005 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6007 (if_then_else (ltgt (reg:CCS 33) (const_int 0))
6008 (label_ref (match_operand 0 "" ""))
6011 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6015 ;;- Conditional jump instructions.
6018 (define_insn "cjump"
6021 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6022 (label_ref (match_operand 0 "" ""))
6026 if (get_attr_length (insn) == 4)
6028 else if (TARGET_64BIT)
6029 return "jg%C1\t%l0";
6033 [(set_attr "op_type" "RI")
6034 (set_attr "type" "branch")
6035 (set (attr "length")
6036 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6038 (ne (symbol_ref "TARGET_64BIT") (const_int 0))
6040 (eq (symbol_ref "flag_pic") (const_int 0))
6041 (const_int 6)] (const_int 8)))])
6043 (define_insn "*cjump_long"
6046 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6047 (match_operand 0 "address_operand" "U")
6051 if (get_attr_op_type (insn) == OP_TYPE_RR)
6056 [(set (attr "op_type")
6057 (if_then_else (match_operand 0 "register_operand" "")
6058 (const_string "RR") (const_string "RX")))
6059 (set_attr "type" "branch")
6060 (set_attr "atype" "agen")])
6064 ;;- Negated conditional jump instructions.
6067 (define_insn "icjump"
6070 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6072 (label_ref (match_operand 0 "" ""))))]
6075 if (get_attr_length (insn) == 4)
6077 else if (TARGET_64BIT)
6078 return "jg%D1\t%l0";
6082 [(set_attr "op_type" "RI")
6083 (set_attr "type" "branch")
6084 (set (attr "length")
6085 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6087 (ne (symbol_ref "TARGET_64BIT") (const_int 0))
6089 (eq (symbol_ref "flag_pic") (const_int 0))
6090 (const_int 6)] (const_int 8)))])
6092 (define_insn "*icjump_long"
6095 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6097 (match_operand 0 "address_operand" "U")))]
6100 if (get_attr_op_type (insn) == OP_TYPE_RR)
6105 [(set (attr "op_type")
6106 (if_then_else (match_operand 0 "register_operand" "")
6107 (const_string "RR") (const_string "RX")))
6108 (set_attr "type" "branch")
6109 (set_attr "atype" "agen")])
6112 ;;- Trap instructions.
6116 [(trap_if (const_int 1) (const_int 0))]
6119 [(set_attr "op_type" "RX")
6120 (set_attr "type" "branch")])
6122 (define_expand "conditional_trap"
6123 [(set (match_dup 2) (match_dup 3))
6124 (trap_if (match_operator 0 "comparison_operator"
6125 [(match_dup 2) (const_int 0)])
6126 (match_operand:SI 1 "general_operand" ""))]
6129 enum machine_mode ccmode;
6131 if (operands[1] != const0_rtx) FAIL;
6133 ccmode = s390_select_ccmode (GET_CODE (operands[0]),
6134 s390_compare_op0, s390_compare_op1);
6135 operands[2] = gen_rtx_REG (ccmode, 33);
6136 operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
6139 (define_insn "*trap"
6140 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6144 [(set_attr "op_type" "RI")
6145 (set_attr "type" "branch")])
6148 ;;- Loop instructions.
6150 ;; This is all complicated by the fact that since this is a jump insn
6151 ;; we must handle our own output reloads.
6153 (define_expand "doloop_end"
6154 [(use (match_operand 0 "" "")) ; loop pseudo
6155 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6156 (use (match_operand 2 "" "")) ; max iterations
6157 (use (match_operand 3 "" "")) ; loop level
6158 (use (match_operand 4 "" ""))] ; label
6161 if (GET_MODE (operands[0]) == SImode)
6162 emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0]));
6163 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6164 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6171 (define_insn "doloop_si"
6174 (ne (match_operand:SI 1 "register_operand" "d,d")
6176 (label_ref (match_operand 0 "" ""))
6178 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6179 (plus:SI (match_dup 1) (const_int -1)))
6180 (clobber (match_scratch:SI 3 "=X,&d"))
6181 (clobber (reg:CC 33))]
6184 if (which_alternative != 0)
6186 else if (get_attr_length (insn) == 4)
6187 return "brct\t%1,%l0";
6191 [(set_attr "op_type" "RI")
6192 (set_attr "type" "branch")
6193 (set (attr "length")
6194 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6196 (ne (symbol_ref "TARGET_64BIT") (const_int 0))
6198 (eq (symbol_ref "flag_pic") (const_int 0))
6199 (const_int 6)] (const_int 8)))])
6201 (define_insn "*doloop_si_long"
6204 (ne (match_operand:SI 1 "register_operand" "d,d")
6206 (match_operand 0 "address_operand" "U,U")
6208 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6209 (plus:SI (match_dup 1) (const_int -1)))
6210 (clobber (match_scratch:SI 3 "=X,&d"))
6211 (clobber (reg:CC 33))]
6214 if (get_attr_op_type (insn) == OP_TYPE_RR)
6215 return "bctr\t%1,%0";
6217 return "bct\t%1,%a0";
6219 [(set (attr "op_type")
6220 (if_then_else (match_operand 0 "register_operand" "")
6221 (const_string "RR") (const_string "RX")))
6222 (set_attr "type" "branch")
6223 (set_attr "atype" "agen")])
6227 (if_then_else (ne (match_operand:SI 1 "register_operand" "")
6229 (match_operand 0 "" "")
6231 (set (match_operand:SI 2 "nonimmediate_operand" "")
6232 (plus:SI (match_dup 1) (const_int -1)))
6233 (clobber (match_scratch:SI 3 ""))
6234 (clobber (reg:CC 33))]
6236 && (! REG_P (operands[2])
6237 || ! rtx_equal_p (operands[1], operands[2]))"
6238 [(set (match_dup 3) (match_dup 1))
6239 (parallel [(set (reg:CCAN 33)
6240 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6242 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6243 (set (match_dup 2) (match_dup 3))
6244 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6249 (define_insn "doloop_di"
6252 (ne (match_operand:DI 1 "register_operand" "d,d")
6254 (label_ref (match_operand 0 "" ""))
6256 (set (match_operand:DI 2 "register_operand" "=1,?*m*r")
6257 (plus:DI (match_dup 1) (const_int -1)))
6258 (clobber (match_scratch:DI 3 "=X,&d"))
6259 (clobber (reg:CC 33))]
6262 if (which_alternative != 0)
6264 else if (get_attr_length (insn) == 4)
6265 return "brctg\t%1,%l0";
6269 [(set_attr "op_type" "RI")
6270 (set_attr "type" "branch")
6271 (set (attr "length")
6272 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6273 (const_int 4) (const_int 12)))])
6275 (define_insn "*doloop_di_long"
6278 (ne (match_operand:DI 1 "register_operand" "d,d")
6280 (match_operand 0 "address_operand" "U,U")
6282 (set (match_operand:DI 2 "register_operand" "=1,?*m*d")
6283 (plus:DI (match_dup 1) (const_int -1)))
6284 (clobber (match_scratch:DI 3 "=X,&d"))
6285 (clobber (reg:CC 33))]
6288 if (get_attr_op_type (insn) == OP_TYPE_RRE)
6289 return "bctgr\t%1,%0";
6291 return "bctg\t%1,%a0";
6293 [(set (attr "op_type")
6294 (if_then_else (match_operand 0 "register_operand" "")
6295 (const_string "RRE") (const_string "RXE")))
6296 (set_attr "type" "branch")
6297 (set_attr "atype" "agen")])
6301 (if_then_else (ne (match_operand:DI 1 "register_operand" "")
6303 (match_operand 0 "" "")
6305 (set (match_operand:DI 2 "nonimmediate_operand" "")
6306 (plus:DI (match_dup 1) (const_int -1)))
6307 (clobber (match_scratch:DI 3 ""))
6308 (clobber (reg:CC 33))]
6310 && (! REG_P (operands[2])
6311 || ! rtx_equal_p (operands[1], operands[2]))"
6312 [(set (match_dup 3) (match_dup 1))
6313 (parallel [(set (reg:CCAN 33)
6314 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6316 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6317 (set (match_dup 2) (match_dup 3))
6318 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6324 ;;- Unconditional jump instructions.
6328 ; jump instruction pattern(s).
6332 [(set (pc) (label_ref (match_operand 0 "" "")))]
6335 if (get_attr_length (insn) == 4)
6337 else if (TARGET_64BIT)
6342 [(set_attr "op_type" "RI")
6343 (set_attr "type" "branch")
6344 (set (attr "length")
6345 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6347 (ne (symbol_ref "TARGET_64BIT") (const_int 0))
6349 (eq (symbol_ref "flag_pic") (const_int 0))
6350 (const_int 6)] (const_int 8)))])
6353 ; indirect-jump instruction pattern(s).
6356 (define_insn "indirect_jump"
6357 [(set (pc) (match_operand 0 "address_operand" "U"))]
6360 if (get_attr_op_type (insn) == OP_TYPE_RR)
6365 [(set (attr "op_type")
6366 (if_then_else (match_operand 0 "register_operand" "")
6367 (const_string "RR") (const_string "RX")))
6368 (set_attr "type" "branch")
6369 (set_attr "atype" "agen")])
6372 ; casesi instruction pattern(s).
6375 (define_insn "casesi_jump"
6376 [(set (pc) (match_operand 0 "address_operand" "U"))
6377 (use (label_ref (match_operand 1 "" "")))]
6380 if (get_attr_op_type (insn) == OP_TYPE_RR)
6385 [(set (attr "op_type")
6386 (if_then_else (match_operand 0 "register_operand" "")
6387 (const_string "RR") (const_string "RX")))
6388 (set_attr "type" "branch")
6389 (set_attr "atype" "agen")])
6391 (define_expand "casesi"
6392 [(match_operand:SI 0 "general_operand" "")
6393 (match_operand:SI 1 "general_operand" "")
6394 (match_operand:SI 2 "general_operand" "")
6395 (label_ref (match_operand 3 "" ""))
6396 (label_ref (match_operand 4 "" ""))]
6399 rtx index = gen_reg_rtx (SImode);
6400 rtx base = gen_reg_rtx (Pmode);
6401 rtx target = gen_reg_rtx (Pmode);
6403 emit_move_insn (index, operands[0]);
6404 emit_insn (gen_subsi3 (index, index, operands[1]));
6405 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6408 if (Pmode != SImode)
6409 index = convert_to_mode (Pmode, index, 1);
6410 if (GET_CODE (index) != REG)
6411 index = copy_to_mode_reg (Pmode, index);
6414 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6416 emit_insn (gen_ashlsi3 (index, index, GEN_INT (2)));
6418 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6420 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
6421 emit_move_insn (target, index);
6424 target = gen_rtx_PLUS (Pmode, base, target);
6425 emit_jump_insn (gen_casesi_jump (target, operands[3]));
6432 ;;- Jump to subroutine.
6437 ; untyped call instruction pattern(s).
6440 ;; Call subroutine returning any type.
6441 (define_expand "untyped_call"
6442 [(parallel [(call (match_operand 0 "" "")
6444 (match_operand 1 "" "")
6445 (match_operand 2 "" "")])]
6450 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
6452 for (i = 0; i < XVECLEN (operands[2], 0); i++)
6454 rtx set = XVECEXP (operands[2], 0, i);
6455 emit_move_insn (SET_DEST (set), SET_SRC (set));
6458 /* The optimizer does not know that the call sets the function value
6459 registers we stored in the result block. We avoid problems by
6460 claiming that all hard registers are used and clobbered at this
6462 emit_insn (gen_blockage ());
6467 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
6468 ;; all of memory. This blocks insns from being moved across this point.
6470 (define_insn "blockage"
6471 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
6474 [(set_attr "type" "none")
6475 (set_attr "length" "0")])
6480 ; call instruction pattern(s).
6483 (define_expand "call"
6484 [(call (match_operand 0 "" "")
6485 (match_operand 1 "" ""))
6486 (use (match_operand 2 "" ""))]
6491 /* Direct function calls need special treatment. */
6492 if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
6494 rtx sym = XEXP (operands[0], 0);
6496 /* When calling a global routine in PIC mode, we must
6497 replace the symbol itself with the PLT stub. */
6498 if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
6500 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6501 sym = gen_rtx_CONST (Pmode, sym);
6504 /* Unless we can use the bras(l) insn, force the
6505 routine address into a register. */
6506 if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
6509 sym = legitimize_pic_address (sym, 0);
6511 sym = force_reg (Pmode, sym);
6514 operands[0] = gen_rtx_MEM (QImode, sym);
6518 insn = emit_call_insn (gen_call_exp (operands[0], operands[1],
6519 gen_rtx_REG (Pmode, RETURN_REGNUM)));
6523 (define_expand "call_exp"
6524 [(parallel [(call (match_operand 0 "" "")
6525 (match_operand 1 "" ""))
6526 (clobber (match_operand 2 "" ""))])]
6530 (define_insn "brasl"
6531 [(call (mem:QI (match_operand:DI 0 "bras_sym_operand" "X"))
6532 (match_operand:SI 1 "const_int_operand" "n"))
6533 (clobber (match_operand:DI 2 "register_operand" "=r"))]
6536 [(set_attr "op_type" "RIL")
6537 (set_attr "type" "jsr")])
6540 [(call (mem:QI (match_operand:SI 0 "bras_sym_operand" "X"))
6541 (match_operand:SI 1 "const_int_operand" "n"))
6542 (clobber (match_operand:SI 2 "register_operand" "=r"))]
6545 [(set_attr "op_type" "RI")
6546 (set_attr "type" "jsr")])
6548 (define_insn "basr_64"
6549 [(call (mem:QI (match_operand:DI 0 "register_operand" "a"))
6550 (match_operand:SI 1 "const_int_operand" "n"))
6551 (clobber (match_operand:DI 2 "register_operand" "=r"))]
6554 [(set_attr "op_type" "RR")
6555 (set_attr "type" "jsr")
6556 (set_attr "atype" "agen")])
6558 (define_insn "basr_31"
6559 [(call (mem:QI (match_operand:SI 0 "register_operand" "a"))
6560 (match_operand:SI 1 "const_int_operand" "n"))
6561 (clobber (match_operand:SI 2 "register_operand" "=r"))]
6564 [(set_attr "op_type" "RR")
6565 (set_attr "type" "jsr")
6566 (set_attr "atype" "agen")])
6568 (define_insn "bas_64"
6569 [(call (mem:QI (match_operand:QI 0 "address_operand" "U"))
6570 (match_operand:SI 1 "const_int_operand" "n"))
6571 (clobber (match_operand:DI 2 "register_operand" "=r"))]
6574 [(set_attr "op_type" "RX")
6575 (set_attr "type" "jsr")])
6577 (define_insn "bas_31"
6578 [(call (mem:QI (match_operand:QI 0 "address_operand" "U"))
6579 (match_operand:SI 1 "const_int_operand" "n"))
6580 (clobber (match_operand:SI 2 "register_operand" "=r"))]
6583 [(set_attr "op_type" "RX")
6584 (set_attr "type" "jsr")])
6588 ; call_value instruction pattern(s).
6591 (define_expand "call_value"
6592 [(set (match_operand 0 "" "")
6593 (call (match_operand 1 "" "")
6594 (match_operand 2 "" "")))
6595 (use (match_operand 3 "" ""))]
6600 /* Direct function calls need special treatment. */
6601 if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
6603 rtx sym = XEXP (operands[1], 0);
6605 /* When calling a global routine in PIC mode, we must
6606 replace the symbol itself with the PLT stub. */
6607 if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
6609 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6610 sym = gen_rtx_CONST (Pmode, sym);
6613 /* Unless we can use the bras(l) insn, force the
6614 routine address into a register. */
6615 if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
6618 sym = legitimize_pic_address (sym, 0);
6620 sym = force_reg (Pmode, sym);
6623 operands[1] = gen_rtx_MEM (QImode, sym);
6627 insn = emit_call_insn (
6628 gen_call_value_exp (operands[0], operands[1], operands[2],
6629 gen_rtx_REG (Pmode, RETURN_REGNUM)));
6633 (define_expand "call_value_exp"
6634 [(parallel [(set (match_operand 0 "" "")
6635 (call (match_operand 1 "" "")
6636 (match_operand 2 "" "")))
6637 (clobber (match_operand 3 "" ""))])]
6641 (define_insn "brasl_r"
6642 [(set (match_operand 0 "register_operand" "=df")
6643 (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
6644 (match_operand:SI 2 "const_int_operand" "n")))
6645 (clobber (match_operand:DI 3 "register_operand" "=r"))]
6648 [(set_attr "op_type" "RIL")
6649 (set_attr "type" "jsr")])
6651 (define_insn "bras_r"
6652 [(set (match_operand 0 "register_operand" "=df")
6653 (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
6654 (match_operand:SI 2 "const_int_operand" "n")))
6655 (clobber (match_operand:SI 3 "register_operand" "=r"))]
6658 [(set_attr "op_type" "RI")
6659 (set_attr "type" "jsr")])
6661 (define_insn "basr_r_64"
6662 [(set (match_operand 0 "register_operand" "=df")
6663 (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
6664 (match_operand:SI 2 "const_int_operand" "n")))
6665 (clobber (match_operand:DI 3 "register_operand" "=r"))]
6668 [(set_attr "op_type" "RR")
6669 (set_attr "type" "jsr")
6670 (set_attr "atype" "agen")])
6672 (define_insn "basr_r_31"
6673 [(set (match_operand 0 "register_operand" "=df")
6674 (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
6675 (match_operand:SI 2 "const_int_operand" "n")))
6676 (clobber (match_operand:SI 3 "register_operand" "=r"))]
6679 [(set_attr "op_type" "RR")
6680 (set_attr "type" "jsr")
6681 (set_attr "atype" "agen")])
6683 (define_insn "bas_r_64"
6684 [(set (match_operand 0 "register_operand" "=df")
6685 (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
6686 (match_operand:SI 2 "const_int_operand" "n")))
6687 (clobber (match_operand:DI 3 "register_operand" "=r"))]
6690 [(set_attr "op_type" "RX")
6691 (set_attr "type" "jsr")])
6693 (define_insn "bas_r_31"
6694 [(set (match_operand 0 "register_operand" "=df")
6695 (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
6696 (match_operand:SI 2 "const_int_operand" "n")))
6697 (clobber (match_operand:SI 3 "register_operand" "=r"))]
6700 [(set_attr "op_type" "RX")
6701 (set_attr "type" "jsr")])
6705 ;;- Thread-local storage support.
6708 (define_insn "get_tp_64"
6709 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
6710 (unspec:DI [(const_int 0)] UNSPEC_TP))]
6713 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
6715 [(set_attr "op_type" "NN,RS")
6716 (set_attr "atype" "reg,*")
6717 (set_attr "type" "o3,*")
6718 (set_attr "length" "14,*")])
6720 (define_insn "get_tp_31"
6721 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
6722 (unspec:SI [(const_int 0)] UNSPEC_TP))]
6727 [(set_attr "op_type" "RRE,RS")])
6729 (define_insn "set_tp_64"
6730 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
6731 (clobber (match_scratch:SI 1 "=d,X"))]
6734 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
6736 [(set_attr "op_type" "NN,RS")
6737 (set_attr "atype" "reg,*")
6738 (set_attr "type" "o3,*")
6739 (set_attr "length" "14,*")])
6741 (define_insn "set_tp_31"
6742 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
6747 [(set_attr "op_type" "RRE,RS")])
6749 (define_insn "*tls_load_64"
6750 [(set (match_operand:DI 0 "register_operand" "=d")
6751 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
6752 (match_operand:DI 2 "" "")]
6756 [(set_attr "op_type" "RXE")])
6758 (define_insn "*tls_load_31"
6759 [(set (match_operand:SI 0 "register_operand" "=d,d")
6760 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
6761 (match_operand:SI 2 "" "")]
6767 [(set_attr "op_type" "RX,RXY")])
6769 (define_expand "call_value_tls"
6770 [(set (match_operand 0 "" "")
6771 (call (const_int 0) (const_int 0)))
6772 (use (match_operand 1 "" ""))]
6780 sym = s390_tls_get_offset ();
6781 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6782 sym = gen_rtx_CONST (Pmode, sym);
6784 /* Unless we can use the bras(l) insn, force the
6785 routine address into a register. */
6786 if (!TARGET_SMALL_EXEC && !TARGET_64BIT)
6789 sym = legitimize_pic_address (sym, 0);
6791 sym = force_reg (Pmode, sym);
6794 sym = gen_rtx_MEM (QImode, sym);
6797 insn = emit_call_insn (
6798 gen_call_value_tls_exp (operands[0], sym, const0_rtx,
6799 gen_rtx_REG (Pmode, RETURN_REGNUM),
6802 /* The calling convention of __tls_get_offset uses the
6803 GOT register implicitly. */
6804 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
6805 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), operands[0]);
6806 CONST_OR_PURE_CALL_P (insn) = 1;
6811 (define_expand "call_value_tls_exp"
6812 [(parallel [(set (match_operand 0 "" "")
6813 (call (match_operand 1 "" "")
6814 (match_operand 2 "" "")))
6815 (clobber (match_operand 3 "" ""))
6816 (use (match_operand 4 "" ""))])]
6820 (define_insn "brasl_tls"
6821 [(set (match_operand 0 "register_operand" "=df")
6822 (call (mem:QI (match_operand:DI 1 "bras_sym_operand" "X"))
6823 (match_operand:SI 2 "const_int_operand" "n")))
6824 (clobber (match_operand:DI 3 "register_operand" "=r"))
6825 (use (match_operand:DI 4 "" ""))]
6828 [(set_attr "op_type" "RIL")
6829 (set_attr "type" "jsr")])
6831 (define_insn "bras_tls"
6832 [(set (match_operand 0 "register_operand" "=df")
6833 (call (mem:QI (match_operand:SI 1 "bras_sym_operand" "X"))
6834 (match_operand:SI 2 "const_int_operand" "n")))
6835 (clobber (match_operand:SI 3 "register_operand" "=r"))
6836 (use (match_operand:SI 4 "" ""))]
6839 [(set_attr "op_type" "RI")
6840 (set_attr "type" "jsr")])
6842 (define_insn "basr_tls_64"
6843 [(set (match_operand 0 "register_operand" "=df")
6844 (call (mem:QI (match_operand:DI 1 "register_operand" "a"))
6845 (match_operand:SI 2 "const_int_operand" "n")))
6846 (clobber (match_operand:DI 3 "register_operand" "=r"))
6847 (use (match_operand:DI 4 "" ""))]
6850 [(set_attr "op_type" "RR")
6851 (set_attr "type" "jsr")])
6853 (define_insn "basr_tls_31"
6854 [(set (match_operand 0 "register_operand" "=df")
6855 (call (mem:QI (match_operand:SI 1 "register_operand" "a"))
6856 (match_operand:SI 2 "const_int_operand" "n")))
6857 (clobber (match_operand:SI 3 "register_operand" "=r"))
6858 (use (match_operand:SI 4 "" ""))]
6861 [(set_attr "op_type" "RR")
6862 (set_attr "type" "jsr")
6863 (set_attr "atype" "agen")])
6865 (define_insn "bas_tls_64"
6866 [(set (match_operand 0 "register_operand" "=df")
6867 (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
6868 (match_operand:SI 2 "const_int_operand" "n")))
6869 (clobber (match_operand:DI 3 "register_operand" "=r"))
6870 (use (match_operand:DI 4 "" ""))]
6873 [(set_attr "op_type" "RX")
6874 (set_attr "type" "jsr")
6875 (set_attr "atype" "agen")])
6877 (define_insn "bas_tls_31"
6878 [(set (match_operand 0 "register_operand" "=df")
6879 (call (mem:QI (match_operand:QI 1 "address_operand" "U"))
6880 (match_operand:SI 2 "const_int_operand" "n")))
6881 (clobber (match_operand:SI 3 "register_operand" "=r"))
6882 (use (match_operand:SI 4 "" ""))]
6885 [(set_attr "op_type" "RX")
6886 (set_attr "type" "jsr")
6887 (set_attr "atype" "agen")])
6890 ;;- Miscellaneous instructions.
6894 ; allocate stack instruction pattern(s).
6897 (define_expand "allocate_stack"
6899 (plus (reg 15) (match_operand 1 "general_operand" "")))
6900 (set (match_operand 0 "general_operand" "")
6904 rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
6905 rtx chain = gen_rtx (MEM, Pmode, stack);
6906 rtx temp = gen_reg_rtx (Pmode);
6908 emit_move_insn (temp, chain);
6911 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
6913 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
6915 emit_move_insn (chain, temp);
6917 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
6923 ; setjmp/longjmp instruction pattern(s).
6926 (define_expand "builtin_setjmp_setup"
6927 [(match_operand 0 "register_operand" "")]
6930 rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
6931 rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
6933 emit_move_insn (base, basereg);
6937 (define_expand "builtin_setjmp_receiver"
6938 [(match_operand 0 "" "")]
6941 s390_load_got (false);
6942 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
6946 (define_expand "builtin_longjmp"
6947 [(match_operand 0 "register_operand" "")]
6950 /* The elements of the buffer are, in order: */
6951 rtx fp = gen_rtx_MEM (Pmode, operands[0]);
6952 rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], GET_MODE_SIZE (Pmode)));
6953 rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 2 * GET_MODE_SIZE (Pmode)));
6954 rtx base = gen_rtx_MEM (Pmode, plus_constant (operands[0], 4 * GET_MODE_SIZE (Pmode)));
6955 rtx basereg = gen_rtx_REG (Pmode, BASE_REGISTER);
6956 rtx jmp = gen_reg_rtx (Pmode);
6958 emit_move_insn (jmp, lab);
6959 emit_move_insn (basereg, base);
6960 emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
6961 emit_move_insn (hard_frame_pointer_rtx, fp);
6963 emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
6964 emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
6965 emit_insn (gen_rtx_USE (VOIDmode, basereg));
6966 emit_indirect_jump (jmp);
6971 ;; These patterns say how to save and restore the stack pointer. We need not
6972 ;; save the stack pointer at function level since we are careful to
6973 ;; preserve the backchain. At block level, we have to restore the backchain
6974 ;; when we restore the stack pointer.
6976 ;; For nonlocal gotos, we must save both the stack pointer and its
6977 ;; backchain and restore both. Note that in the nonlocal case, the
6978 ;; save area is a memory location.
6980 (define_expand "save_stack_function"
6981 [(match_operand 0 "general_operand" "")
6982 (match_operand 1 "general_operand" "")]
6986 (define_expand "restore_stack_function"
6987 [(match_operand 0 "general_operand" "")
6988 (match_operand 1 "general_operand" "")]
6992 (define_expand "restore_stack_block"
6993 [(use (match_operand 0 "register_operand" ""))
6994 (set (match_dup 2) (match_dup 3))
6995 (set (match_dup 0) (match_operand 1 "register_operand" ""))
6996 (set (match_dup 3) (match_dup 2))]
6999 operands[2] = gen_reg_rtx (Pmode);
7000 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7003 (define_expand "save_stack_nonlocal"
7004 [(match_operand 0 "memory_operand" "")
7005 (match_operand 1 "register_operand" "")]
7008 rtx temp = gen_reg_rtx (Pmode);
7010 /* Copy the backchain to the first word, sp to the second. */
7011 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7012 emit_move_insn (operand_subword (operands[0], 0, 0,
7013 TARGET_64BIT ? TImode : DImode),
7015 emit_move_insn (operand_subword (operands[0], 1, 0,
7016 TARGET_64BIT ? TImode : DImode),
7021 (define_expand "restore_stack_nonlocal"
7022 [(match_operand 0 "register_operand" "")
7023 (match_operand 1 "memory_operand" "")]
7026 rtx temp = gen_reg_rtx (Pmode);
7028 /* Restore the backchain from the first word, sp from the second. */
7029 emit_move_insn (temp,
7030 operand_subword (operands[1], 0, 0,
7031 TARGET_64BIT ? TImode : DImode));
7032 emit_move_insn (operands[0],
7033 operand_subword (operands[1], 1, 0,
7034 TARGET_64BIT ? TImode : DImode));
7035 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7041 ; nop instruction pattern(s).
7048 [(set_attr "op_type" "RR")])
7052 ; Special literal pool access instruction pattern(s).
7055 (define_insn "*pool_entry"
7056 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7057 UNSPECV_POOL_ENTRY)]
7060 enum machine_mode mode = GET_MODE (PATTERN (insn));
7061 unsigned int align = GET_MODE_BITSIZE (mode);
7062 s390_output_pool_entry (asm_out_file, operands[0], mode, align);
7065 [(set_attr "op_type" "NN")
7066 (set (attr "length")
7067 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7069 (define_insn "pool_start_31"
7070 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7073 [(set_attr "op_type" "NN")
7074 (set_attr "length" "2")])
7076 (define_insn "pool_end_31"
7077 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7080 [(set_attr "op_type" "NN")
7081 (set_attr "length" "2")])
7083 (define_insn "pool_start_64"
7084 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7086 ".section\t.rodata\;.align\t8"
7087 [(set_attr "op_type" "NN")
7088 (set_attr "length" "0")])
7090 (define_insn "pool_end_64"
7091 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7094 [(set_attr "op_type" "NN")
7095 (set_attr "length" "0")])
7097 (define_insn "reload_base_31"
7098 [(set (match_operand:SI 0 "register_operand" "=a")
7099 (unspec:SI [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7101 "basr\t%0,0\;la\t%0,%1-.(%0)"
7102 [(set_attr "op_type" "NN")
7103 (set_attr "type" "la")
7104 (set_attr "length" "6")])
7106 (define_insn "reload_base_64"
7107 [(set (match_operand:DI 0 "register_operand" "=a")
7108 (unspec:DI [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7111 [(set_attr "op_type" "RIL")
7112 (set_attr "type" "larl")])
7115 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7118 [(set_attr "op_type" "NN")
7119 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7122 ;; Insns related to generating the function prologue and epilogue.
7126 (define_expand "prologue"
7127 [(use (const_int 0))]
7129 "s390_emit_prologue (); DONE;")
7131 (define_expand "epilogue"
7132 [(use (const_int 1))]
7134 "s390_emit_epilogue (); DONE;")
7137 (define_insn "*return_si"
7139 (use (match_operand:SI 0 "register_operand" "a"))]
7142 [(set_attr "op_type" "RR")
7143 (set_attr "type" "jsr")
7144 (set_attr "atype" "agen")])
7146 (define_insn "*return_di"
7148 (use (match_operand:DI 0 "register_operand" "a"))]
7151 [(set_attr "op_type" "RR")
7152 (set_attr "type" "jsr")
7153 (set_attr "atype" "agen")])
7155 (define_insn "literal_pool_31"
7156 [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)
7157 (set (match_operand:SI 0 "register_operand" "=a")
7158 (label_ref (match_operand 1 "" "")))
7159 (use (label_ref (match_operand 2 "" "")))]
7162 if (s390_nr_constants)
7164 output_asm_insn ("bras\t%0,%2", operands);
7165 s390_output_constant_pool (operands[1], operands[2]);
7170 [(set_attr "op_type" "NN")
7171 (set_attr "type" "larl")])
7173 (define_insn "literal_pool_64"
7174 [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)
7175 (set (match_operand:DI 0 "register_operand" "=a")
7176 (label_ref (match_operand 1 "" "")))
7177 (use (label_ref (match_operand 2 "" "")))]
7180 if (s390_nr_constants)
7182 output_asm_insn ("larl\t%0,%1", operands);
7183 s390_output_constant_pool (operands[1], operands[2]);
7188 [(set_attr "op_type" "NN")
7189 (set_attr "type" "larl")])
7191 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7192 ;; pointer. This is used for compatability.
7194 (define_expand "ptr_extend"
7195 [(set (match_operand:DI 0 "register_operand" "=r")
7196 (match_operand:SI 1 "register_operand" "r"))]
7199 emit_insn (gen_anddi3 (operands[0],
7200 gen_lowpart (DImode, operands[1]),
7201 GEN_INT (0x7fffffff)));