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)
68 (UNSPEC_MAIN_BASE 211)
70 ; TLS relocation specifiers
75 (UNSPEC_GOTNTPOFF 504)
76 (UNSPEC_INDNTPOFF 505)
80 (UNSPEC_TLSLDM_NTPOFF 511)
85 ;; UNSPEC_VOLATILE usage
94 (UNSPECV_POOL_START 201)
95 (UNSPECV_POOL_END 202)
96 (UNSPECV_POOL_ENTRY 203)
97 (UNSPECV_MAIN_POOL 300)
104 ;; Processor type. This attribute must exactly match the processor_type
105 ;; enumeration in s390.h.
107 (define_attr "cpu" "g5,g6,z900,z990"
108 (const (symbol_ref "s390_tune")))
110 ;; Define an insn type attribute. This is used in function unit delay
113 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
114 cs,vs,store,imul,idiv,
115 branch,jsr,fsimpd,fsimps,
116 floadd,floads,fstored, fstores,
117 fmuld,fmuls,fdivd,fdivs,
118 ftoi,itof,fsqrtd,fsqrts,
120 (const_string "integer"))
122 ;; Operand type. Used to default length attribute values
124 (define_attr "op_type"
125 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
128 ;; Insn are devide in two classes:
129 ;; agen: Insn using agen
130 ;; reg: Insn not using agen
132 (define_attr "atype" "agen,reg"
133 (cond [ (eq_attr "op_type" "E") (const_string "reg")
134 (eq_attr "op_type" "RR") (const_string "reg")
135 (eq_attr "op_type" "RX") (const_string "agen")
136 (eq_attr "op_type" "RI") (const_string "reg")
137 (eq_attr "op_type" "RRE") (const_string "reg")
138 (eq_attr "op_type" "RS") (const_string "agen")
139 (eq_attr "op_type" "RSI") (const_string "agen")
140 (eq_attr "op_type" "S") (const_string "agen")
141 (eq_attr "op_type" "SI") (const_string "agen")
142 (eq_attr "op_type" "SS") (const_string "agen")
143 (eq_attr "op_type" "SSE") (const_string "agen")
144 (eq_attr "op_type" "RXE") (const_string "agen")
145 (eq_attr "op_type" "RSE") (const_string "agen")
146 (eq_attr "op_type" "RIL") (const_string "agen")
147 (eq_attr "op_type" "RXY") (const_string "agen")
148 (eq_attr "op_type" "RSY") (const_string "agen")
149 (eq_attr "op_type" "SIY") (const_string "agen")]
150 (const_string "reg")))
152 ;; Generic pipeline function unit.
154 (define_function_unit "integer" 1 0
155 (eq_attr "type" "none") 0 0)
157 (define_function_unit "integer" 1 0
158 (eq_attr "type" "integer") 1 1)
160 (define_function_unit "integer" 1 0
161 (eq_attr "type" "fsimpd") 1 1)
163 (define_function_unit "integer" 1 0
164 (eq_attr "type" "fsimps") 1 1)
166 (define_function_unit "integer" 1 0
167 (eq_attr "type" "load") 1 1)
169 (define_function_unit "integer" 1 0
170 (eq_attr "type" "floadd") 1 1)
172 (define_function_unit "integer" 1 0
173 (eq_attr "type" "floads") 1 1)
175 (define_function_unit "integer" 1 0
176 (eq_attr "type" "la") 1 1)
178 (define_function_unit "integer" 1 0
179 (eq_attr "type" "larl") 1 1)
181 (define_function_unit "integer" 1 0
182 (eq_attr "type" "lr") 1 1)
184 (define_function_unit "integer" 1 0
185 (eq_attr "type" "branch") 1 1)
187 (define_function_unit "integer" 1 0
188 (eq_attr "type" "store") 1 1)
190 (define_function_unit "integer" 1 0
191 (eq_attr "type" "fstored") 1 1)
193 (define_function_unit "integer" 1 0
194 (eq_attr "type" "fstores") 1 1)
196 (define_function_unit "integer" 1 0
197 (eq_attr "type" "lm") 2 2)
199 (define_function_unit "integer" 1 0
200 (eq_attr "type" "stm") 2 2)
202 (define_function_unit "integer" 1 0
203 (eq_attr "type" "cs") 5 5)
205 (define_function_unit "integer" 1 0
206 (eq_attr "type" "vs") 30 30)
208 (define_function_unit "integer" 1 0
209 (eq_attr "type" "jsr") 5 5)
211 (define_function_unit "integer" 1 0
212 (eq_attr "type" "imul") 7 7)
214 (define_function_unit "integer" 1 0
215 (eq_attr "type" "fmuld") 6 6)
217 (define_function_unit "integer" 1 0
218 (eq_attr "type" "fmuls") 6 6)
220 (define_function_unit "integer" 1 0
221 (eq_attr "type" "idiv") 33 33)
223 (define_function_unit "integer" 1 0
224 (eq_attr "type" "fdivd") 33 33)
226 (define_function_unit "integer" 1 0
227 (eq_attr "type" "fdivs") 33 33)
229 (define_function_unit "integer" 1 0
230 (eq_attr "type" "fsqrtd") 30 30)
232 (define_function_unit "integer" 1 0
233 (eq_attr "type" "fsqrts") 30 30)
235 (define_function_unit "integer" 1 0
236 (eq_attr "type" "ftoi") 2 2)
238 (define_function_unit "integer" 1 0
239 (eq_attr "type" "itof") 2 2)
241 (define_function_unit "integer" 1 0
242 (eq_attr "type" "o2") 2 2)
244 (define_function_unit "integer" 1 0
245 (eq_attr "type" "o3") 3 3)
247 (define_function_unit "integer" 1 0
248 (eq_attr "type" "other") 5 5)
250 ;; Pipeline description for z900
257 (define_attr "length" ""
258 (cond [ (eq_attr "op_type" "E") (const_int 2)
259 (eq_attr "op_type" "RR") (const_int 2)
260 (eq_attr "op_type" "RX") (const_int 4)
261 (eq_attr "op_type" "RI") (const_int 4)
262 (eq_attr "op_type" "RRE") (const_int 4)
263 (eq_attr "op_type" "RS") (const_int 4)
264 (eq_attr "op_type" "RSI") (const_int 4)
265 (eq_attr "op_type" "S") (const_int 4)
266 (eq_attr "op_type" "SI") (const_int 4)
267 (eq_attr "op_type" "SS") (const_int 6)
268 (eq_attr "op_type" "SSE") (const_int 6)
269 (eq_attr "op_type" "RXE") (const_int 6)
270 (eq_attr "op_type" "RSE") (const_int 6)
271 (eq_attr "op_type" "RIL") (const_int 6)
272 (eq_attr "op_type" "RXY") (const_int 6)
273 (eq_attr "op_type" "RSY") (const_int 6)
274 (eq_attr "op_type" "SIY") (const_int 6)]
277 ;; Define attributes for `asm' insns.
279 (define_asm_attributes [(set_attr "type" "other")
280 (set_attr "op_type" "NN")])
286 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
287 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
288 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
289 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
290 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
293 ; CCZ1 -> CCA/CCU/CCS/CCT
296 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
297 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
301 ;;- Compare instructions.
304 (define_expand "cmpdi"
306 (compare:CC (match_operand:DI 0 "register_operand" "")
307 (match_operand:DI 1 "general_operand" "")))]
310 s390_compare_op0 = operands[0];
311 s390_compare_op1 = operands[1];
315 (define_expand "cmpsi"
317 (compare:CC (match_operand:SI 0 "register_operand" "")
318 (match_operand:SI 1 "general_operand" "")))]
321 s390_compare_op0 = operands[0];
322 s390_compare_op1 = operands[1];
326 (define_expand "cmpdf"
328 (compare:CC (match_operand:DF 0 "register_operand" "")
329 (match_operand:DF 1 "general_operand" "")))]
332 s390_compare_op0 = operands[0];
333 s390_compare_op1 = operands[1];
337 (define_expand "cmpsf"
339 (compare:CC (match_operand:SF 0 "register_operand" "")
340 (match_operand:SF 1 "general_operand" "")))]
343 s390_compare_op0 = operands[0];
344 s390_compare_op1 = operands[1];
349 ; Test-under-Mask (zero_extract) instructions
351 (define_insn "*tmdi_ext"
353 (compare (zero_extract:DI (match_operand:DI 0 "register_operand" "d")
354 (match_operand:DI 1 "const_int_operand" "n")
355 (match_operand:DI 2 "const_int_operand" "n"))
357 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
358 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
359 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 64
360 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
361 == INTVAL (operands[2]) >> 4"
363 int part = INTVAL (operands[2]) >> 4;
364 int block = (1 << INTVAL (operands[1])) - 1;
365 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
367 operands[2] = GEN_INT (block << shift);
371 case 0: return "tmhh\t%0,%x2";
372 case 1: return "tmhl\t%0,%x2";
373 case 2: return "tmlh\t%0,%x2";
374 case 3: return "tmll\t%0,%x2";
378 [(set_attr "op_type" "RI")])
380 (define_insn "*tmsi_ext"
382 (compare (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
383 (match_operand:SI 1 "const_int_operand" "n")
384 (match_operand:SI 2 "const_int_operand" "n"))
386 "s390_match_ccmode(insn, CCTmode)
387 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
388 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 32
389 && (INTVAL (operands[1]) + INTVAL (operands[2]) - 1) >> 4
390 == INTVAL (operands[2]) >> 4"
392 int part = INTVAL (operands[2]) >> 4;
393 int block = (1 << INTVAL (operands[1])) - 1;
394 int shift = 16 - INTVAL (operands[1]) - (INTVAL (operands[2]) & 15);
396 operands[2] = GEN_INT (block << shift);
400 case 0: return "tmh\t%0,%x2";
401 case 1: return "tml\t%0,%x2";
405 [(set_attr "op_type" "RI")])
407 (define_insn "*tmqi_ext"
409 (compare (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,S")
410 (match_operand:SI 1 "const_int_operand" "n,n")
411 (match_operand:SI 2 "const_int_operand" "n,n"))
413 "s390_match_ccmode(insn, CCTmode)
414 && INTVAL (operands[1]) >= 1 && INTVAL (operands[2]) >= 0
415 && INTVAL (operands[1]) + INTVAL (operands[2]) <= 8"
417 int block = (1 << INTVAL (operands[1])) - 1;
418 int shift = 8 - INTVAL (operands[1]) - INTVAL (operands[2]);
420 operands[2] = GEN_INT (block << shift);
421 return which_alternative == 0 ? "tm\t%0,%b2" : "tmy\t%0,%b2";
423 [(set_attr "op_type" "SI,SIY")])
425 ; Test-under-Mask instructions
427 (define_insn "*tmdi_mem"
429 (compare (and:DI (match_operand:DI 0 "memory_operand" "Q,S")
430 (match_operand:DI 1 "immediate_operand" "n,n"))
431 (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_ZARCH && 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_larl"
1265 [(set (match_operand:SI 0 "register_operand" "=d")
1266 (match_operand:SI 1 "larl_operand" "X"))]
1267 "!TARGET_64BIT && TARGET_CPU_ZARCH
1268 && !FP_REG_P (operands[0])"
1270 [(set_attr "op_type" "RIL")
1271 (set_attr "type" "larl")])
1273 (define_insn "*movsi"
1274 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
1275 (match_operand:SI 1 "general_operand" "d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
1289 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1290 (set_attr "type" "lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
1293 [(set (match_operand:SI 0 "register_operand" "")
1294 (mem:SI (match_operand 1 "address_operand" "")))]
1295 "!FP_REG_P (operands[0])
1296 && GET_CODE (operands[1]) == SYMBOL_REF
1297 && CONSTANT_POOL_ADDRESS_P (operands[1])
1298 && get_pool_mode (operands[1]) == SImode
1299 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1300 [(set (match_dup 0) (match_dup 2))]
1301 "operands[2] = get_pool_constant (operands[1]);")
1304 ; movhi instruction pattern(s).
1307 (define_expand "movhi"
1308 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1309 (match_operand:HI 1 "general_operand" ""))]
1312 /* Make it explicit that loading a register from memory
1313 always sign-extends (at least) to SImode. */
1314 if (optimize && !no_new_pseudos
1315 && register_operand (operands[0], VOIDmode)
1316 && memory_operand (operands[1], VOIDmode))
1318 rtx tmp = gen_reg_rtx (SImode);
1319 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1320 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1321 operands[1] = gen_lowpart (HImode, tmp);
1325 (define_insn "*movhi"
1326 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1327 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1337 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1338 (set_attr "type" "lr,*,*,*,store,store,cs")])
1341 [(set (match_operand:HI 0 "register_operand" "")
1342 (mem:HI (match_operand 1 "address_operand" "")))]
1343 "GET_CODE (operands[1]) == SYMBOL_REF
1344 && CONSTANT_POOL_ADDRESS_P (operands[1])
1345 && get_pool_mode (operands[1]) == HImode
1346 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1347 [(set (match_dup 0) (match_dup 2))]
1348 "operands[2] = get_pool_constant (operands[1]);")
1351 ; movqi instruction pattern(s).
1354 (define_expand "movqi"
1355 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1356 (match_operand:QI 1 "general_operand" ""))]
1359 /* On 64-bit, zero-extending from memory to register
1360 is just as fast as a QImode load. */
1361 if (TARGET_64BIT && optimize && !no_new_pseudos
1362 && register_operand (operands[0], VOIDmode)
1363 && memory_operand (operands[1], VOIDmode))
1365 rtx tmp = gen_reg_rtx (DImode);
1366 rtx ext = gen_rtx_ZERO_EXTEND (DImode, operands[1]);
1367 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1368 operands[1] = gen_lowpart (QImode, tmp);
1372 (define_insn "*movqi"
1373 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1374 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1386 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1387 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1390 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1391 (mem:QI (match_operand 1 "address_operand" "")))]
1392 "GET_CODE (operands[1]) == SYMBOL_REF
1393 && CONSTANT_POOL_ADDRESS_P (operands[1])
1394 && get_pool_mode (operands[1]) == QImode
1395 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1396 [(set (match_dup 0) (match_dup 2))]
1397 "operands[2] = get_pool_constant (operands[1]);")
1400 ; movstrictqi instruction pattern(s).
1403 (define_insn "*movstrictqi"
1404 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1405 (match_operand:QI 1 "memory_operand" "R,T"))]
1410 [(set_attr "op_type" "RX,RXY")])
1413 ; movstricthi instruction pattern(s).
1416 (define_insn "*movstricthi"
1417 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1418 (match_operand:HI 1 "s_imm_operand" "Q,S"))
1419 (clobber (reg:CC 33))]
1424 [(set_attr "op_type" "RS,RSY")])
1427 ; movstrictsi instruction pattern(s).
1430 (define_insn "movstrictsi"
1431 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1432 (match_operand:SI 1 "general_operand" "d,R,T"))]
1438 [(set_attr "op_type" "RR,RX,RXY")
1439 (set_attr "type" "lr,load,load")])
1442 ; movdf instruction pattern(s).
1445 (define_expand "movdf"
1446 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1447 (match_operand:DF 1 "general_operand" ""))]
1450 /* During and after reload, we need to force constants
1451 to the literal pool ourselves, if necessary. */
1452 if ((reload_in_progress || reload_completed)
1453 && CONSTANT_P (operands[1]))
1454 operands[1] = force_const_mem (DFmode, operands[1]);
1457 (define_insn "*movdf_64"
1458 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1459 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1471 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1472 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1474 (define_insn "*movdf_31"
1475 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1476 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1489 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1490 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1493 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1494 (match_operand:DF 1 "general_operand" ""))]
1495 "!TARGET_64BIT && reload_completed
1496 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1497 [(set (match_dup 2) (match_dup 4))
1498 (set (match_dup 3) (match_dup 5))]
1500 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1501 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1502 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1503 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1507 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1508 (match_operand:DF 1 "general_operand" ""))]
1509 "!TARGET_64BIT && reload_completed
1510 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1511 [(set (match_dup 2) (match_dup 4))
1512 (set (match_dup 3) (match_dup 5))]
1514 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1515 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1516 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1517 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1521 [(set (match_operand:DF 0 "register_operand" "")
1522 (match_operand:DF 1 "memory_operand" ""))]
1523 "!TARGET_64BIT && reload_completed
1524 && !FP_REG_P (operands[0])
1525 && !s_operand (operands[1], VOIDmode)"
1526 [(set (match_dup 0) (match_dup 1))]
1528 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1529 s390_load_address (addr, XEXP (operands[1], 0));
1530 operands[1] = replace_equiv_address (operands[1], addr);
1533 (define_expand "reload_outdf"
1534 [(parallel [(match_operand:DF 0 "memory_operand" "")
1535 (match_operand:DF 1 "register_operand" "d")
1536 (match_operand:SI 2 "register_operand" "=&a")])]
1539 s390_load_address (operands[2], XEXP (operands[0], 0));
1540 operands[0] = replace_equiv_address (operands[0], operands[2]);
1541 emit_move_insn (operands[0], operands[1]);
1546 ; movsf instruction pattern(s).
1549 (define_expand "movsf"
1550 [(set (match_operand:SF 0 "nonimmediate_operand" "")
1551 (match_operand:SF 1 "general_operand" ""))]
1554 /* During and after reload, we need to force constants
1555 to the literal pool ourselves, if necessary. */
1556 if ((reload_in_progress || reload_completed)
1557 && CONSTANT_P (operands[1]))
1558 operands[1] = force_const_mem (SFmode, operands[1]);
1561 (define_insn "*movsf"
1562 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1563 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1577 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1578 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1581 ; load_multiple pattern(s).
1584 (define_expand "load_multiple"
1585 [(match_par_dup 3 [(set (match_operand 0 "" "")
1586 (match_operand 1 "" ""))
1587 (use (match_operand 2 "" ""))])]
1595 /* Support only loading a constant number of fixed-point registers from
1596 memory and only bother with this if more than two */
1597 if (GET_CODE (operands[2]) != CONST_INT
1598 || INTVAL (operands[2]) < 2
1599 || INTVAL (operands[2]) > 16
1600 || GET_CODE (operands[1]) != MEM
1601 || GET_CODE (operands[0]) != REG
1602 || REGNO (operands[0]) >= 16)
1605 count = INTVAL (operands[2]);
1606 regno = REGNO (operands[0]);
1608 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1611 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1613 from = XEXP (operands[1], 0);
1616 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1617 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1618 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1620 from = XEXP (XEXP (operands[1], 0), 0);
1621 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1626 if (from == frame_pointer_rtx || from == arg_pointer_rtx)
1631 from = force_reg (Pmode, XEXP (operands[1], 0));
1635 for (i = 0; i < count; i++)
1636 XVECEXP (operands[3], 0, i)
1637 = gen_rtx_SET (VOIDmode, gen_rtx_REG (Pmode, regno + i),
1638 change_address (operands[1], Pmode,
1639 plus_constant (from,
1640 off + i * UNITS_PER_WORD)));
1643 (define_insn "*load_multiple_di"
1644 [(match_parallel 0 "load_multiple_operation"
1645 [(set (match_operand:DI 1 "register_operand" "=r")
1646 (match_operand:DI 2 "s_operand" "QS"))])]
1649 int words = XVECLEN (operands[0], 0);
1650 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1651 return "lmg\t%1,%0,%2";
1653 [(set_attr "op_type" "RSY")
1654 (set_attr "type" "lm")])
1656 (define_insn "*load_multiple_si"
1657 [(match_parallel 0 "load_multiple_operation"
1658 [(set (match_operand:SI 1 "register_operand" "=r,r")
1659 (match_operand:SI 2 "s_operand" "Q,S"))])]
1662 int words = XVECLEN (operands[0], 0);
1663 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1664 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1666 [(set_attr "op_type" "RS,RSY")
1667 (set_attr "type" "lm")])
1670 ; store multiple pattern(s).
1673 (define_expand "store_multiple"
1674 [(match_par_dup 3 [(set (match_operand 0 "" "")
1675 (match_operand 1 "" ""))
1676 (use (match_operand 2 "" ""))])]
1684 /* Support only storing a constant number of fixed-point registers to
1685 memory and only bother with this if more than two. */
1686 if (GET_CODE (operands[2]) != CONST_INT
1687 || INTVAL (operands[2]) < 2
1688 || INTVAL (operands[2]) > 16
1689 || GET_CODE (operands[0]) != MEM
1690 || GET_CODE (operands[1]) != REG
1691 || REGNO (operands[1]) >= 16)
1694 count = INTVAL (operands[2]);
1695 regno = REGNO (operands[1]);
1697 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1701 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1703 to = XEXP (operands[0], 0);
1706 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1707 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1708 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1710 to = XEXP (XEXP (operands[0], 0), 0);
1711 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1716 if (to == frame_pointer_rtx || to == arg_pointer_rtx)
1721 to = force_reg (Pmode, XEXP (operands[0], 0));
1725 for (i = 0; i < count; i++)
1726 XVECEXP (operands[3], 0, i)
1727 = gen_rtx_SET (VOIDmode,
1728 change_address (operands[0], Pmode,
1730 off + i * UNITS_PER_WORD)),
1731 gen_rtx_REG (Pmode, regno + i));
1734 (define_insn "*store_multiple_di"
1735 [(match_parallel 0 "store_multiple_operation"
1736 [(set (match_operand:DI 1 "s_operand" "=QS")
1737 (match_operand:DI 2 "register_operand" "r"))])]
1740 int words = XVECLEN (operands[0], 0);
1741 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1742 return "stmg\t%2,%0,%1";
1744 [(set_attr "op_type" "RSY")
1745 (set_attr "type" "stm")])
1748 (define_insn "*store_multiple_si"
1749 [(match_parallel 0 "store_multiple_operation"
1750 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1751 (match_operand:SI 2 "register_operand" "r,r"))])]
1754 int words = XVECLEN (operands[0], 0);
1755 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1756 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1758 [(set_attr "op_type" "RS,RSY")
1759 (set_attr "type" "stm")])
1762 ;; String instructions.
1766 ; movstrM instruction pattern(s).
1769 (define_expand "movstrdi"
1770 [(set (match_operand:BLK 0 "memory_operand" "")
1771 (match_operand:BLK 1 "memory_operand" ""))
1772 (use (match_operand:DI 2 "general_operand" ""))
1773 (match_operand 3 "" "")]
1775 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1777 (define_expand "movstrsi"
1778 [(set (match_operand:BLK 0 "memory_operand" "")
1779 (match_operand:BLK 1 "memory_operand" ""))
1780 (use (match_operand:SI 2 "general_operand" ""))
1781 (match_operand 3 "" "")]
1783 "s390_expand_movstr (operands[0], operands[1], operands[2]); DONE;")
1785 ; Move a block that is up to 256 bytes in length.
1786 ; The block length is taken as (operands[2] % 256) + 1.
1788 (define_insn "movstr_short_64"
1789 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1790 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1791 (use (match_operand:DI 2 "nonmemory_operand" "n,a"))
1792 (clobber (match_scratch:DI 3 "=X,&a"))]
1795 switch (which_alternative)
1798 return "mvc\t%O0(%b2+1,%R0),%1";
1801 output_asm_insn ("bras\t%3,.+10", operands);
1802 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1803 return "ex\t%2,0(%3)";
1809 [(set_attr "op_type" "SS,NN")
1810 (set_attr "type" "cs,cs")
1811 (set_attr "atype" "*,agen")
1812 (set_attr "length" "*,14")])
1814 (define_insn "movstr_short_31"
1815 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1816 (match_operand:BLK 1 "memory_operand" "Q,Q"))
1817 (use (match_operand:SI 2 "nonmemory_operand" "n,a"))
1818 (clobber (match_scratch:SI 3 "=X,&a"))]
1821 switch (which_alternative)
1824 return "mvc\t%O0(%b2+1,%R0),%1";
1827 output_asm_insn ("bras\t%3,.+10", operands);
1828 output_asm_insn ("mvc\t%O0(1,%R0),%1", operands);
1829 return "ex\t%2,0(%3)";
1835 [(set_attr "op_type" "SS,NN")
1836 (set_attr "type" "cs,cs")
1837 (set_attr "atype" "*,agen")
1838 (set_attr "length" "*,14")])
1840 ; Move a block of arbitrary length.
1842 (define_insn "movstr_long_64"
1843 [(set (match_operand:TI 0 "register_operand" "=d")
1844 (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0")
1845 (lshiftrt:TI (match_dup 2) (const_int 64)))
1847 (set (match_operand:TI 1 "register_operand" "=d")
1848 (ashift:TI (plus:TI (match_operand:TI 3 "register_operand" "1")
1849 (lshiftrt:TI (match_dup 3) (const_int 64)))
1851 (set (mem:BLK (subreg:DI (match_dup 2) 0))
1852 (mem:BLK (subreg:DI (match_dup 3) 0)))
1853 (clobber (reg:CC 33))]
1855 "mvcle\t%0,%1,0\;jo\t.-4"
1856 [(set_attr "op_type" "NN")
1857 (set_attr "type" "vs")
1858 (set_attr "length" "8")])
1860 (define_insn "movstr_long_31"
1861 [(set (match_operand:DI 0 "register_operand" "=d")
1862 (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0")
1863 (lshiftrt:DI (match_dup 2) (const_int 32)))
1865 (set (match_operand:DI 1 "register_operand" "=d")
1866 (ashift:DI (plus:DI (match_operand:DI 3 "register_operand" "1")
1867 (lshiftrt:DI (match_dup 3) (const_int 32)))
1869 (set (mem:BLK (subreg:SI (match_dup 2) 0))
1870 (mem:BLK (subreg:SI (match_dup 3) 0)))
1871 (clobber (reg:CC 33))]
1873 "mvcle\t%0,%1,0\;jo\t.-4"
1874 [(set_attr "op_type" "NN")
1875 (set_attr "type" "vs")
1876 (set_attr "length" "8")])
1879 ; clrstrM instruction pattern(s).
1882 (define_expand "clrstrdi"
1883 [(set (match_operand:BLK 0 "memory_operand" "")
1885 (use (match_operand:DI 1 "general_operand" ""))
1886 (match_operand 2 "" "")]
1888 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
1890 (define_expand "clrstrsi"
1891 [(set (match_operand:BLK 0 "memory_operand" "")
1893 (use (match_operand:SI 1 "general_operand" ""))
1894 (match_operand 2 "" "")]
1896 "s390_expand_clrstr (operands[0], operands[1]); DONE;")
1898 ; Clear a block that is up to 256 bytes in length.
1899 ; The block length is taken as (operands[2] % 256) + 1.
1901 (define_insn "clrstr_short_64"
1902 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1904 (use (match_operand:DI 1 "nonmemory_operand" "n,a"))
1905 (clobber (match_scratch:DI 2 "=X,&a"))
1906 (clobber (reg:CC 33))]
1909 switch (which_alternative)
1912 return "xc\t%O0(%b1+1,%R0),%0";
1915 output_asm_insn ("bras\t%2,.+10", operands);
1916 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
1917 return "ex\t%1,0(%2)";
1923 [(set_attr "op_type" "SS,NN")
1924 (set_attr "type" "cs,cs")
1925 (set_attr "atype" "*,agen")
1926 (set_attr "length" "*,14")])
1928 (define_insn "clrstr_short_31"
1929 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q")
1931 (use (match_operand:SI 1 "nonmemory_operand" "n,a"))
1932 (clobber (match_scratch:SI 2 "=X,&a"))
1933 (clobber (reg:CC 33))]
1936 switch (which_alternative)
1939 return "xc\t%O0(%b1+1,%R0),%0";
1942 output_asm_insn ("bras\t%2,.+10", operands);
1943 output_asm_insn ("xc\t%O0(1,%R0),%0", operands);
1944 return "ex\t%1,0(%2)";
1950 [(set_attr "op_type" "SS,NN")
1951 (set_attr "type" "cs,cs")
1952 (set_attr "atype" "*,agen")
1953 (set_attr "length" "*,14")])
1955 ; Clear a block of arbitrary length.
1957 (define_insn "clrstr_long_64"
1958 [(set (match_operand:TI 0 "register_operand" "=d")
1959 (ashift:TI (plus:TI (match_operand:TI 2 "register_operand" "0")
1960 (lshiftrt:TI (match_dup 2) (const_int 64)))
1962 (set (mem:BLK (subreg:DI (match_dup 2) 0))
1964 (use (match_operand:TI 1 "register_operand" "d"))
1965 (clobber (reg:CC 33))]
1967 "mvcle\t%0,%1,0\;jo\t.-4"
1968 [(set_attr "op_type" "NN")
1969 (set_attr "type" "vs")
1970 (set_attr "length" "8")])
1972 (define_insn "clrstr_long_31"
1973 [(set (match_operand:DI 0 "register_operand" "=d")
1974 (ashift:DI (plus:DI (match_operand:DI 2 "register_operand" "0")
1975 (lshiftrt:DI (match_dup 2) (const_int 32)))
1977 (set (mem:BLK (subreg:SI (match_dup 2) 0))
1979 (use (match_operand:DI 1 "register_operand" "d"))
1980 (clobber (reg:CC 33))]
1982 "mvcle\t%0,%1,0\;jo\t.-4"
1983 [(set_attr "op_type" "NN")
1984 (set_attr "type" "vs")
1985 (set_attr "length" "8")])
1988 ; cmpmemM instruction pattern(s).
1991 (define_expand "cmpmemdi"
1992 [(set (match_operand:DI 0 "register_operand" "")
1993 (compare:DI (match_operand:BLK 1 "memory_operand" "")
1994 (match_operand:BLK 2 "memory_operand" "") ) )
1995 (use (match_operand:DI 3 "general_operand" ""))
1996 (use (match_operand:DI 4 "" ""))]
1998 "s390_expand_cmpmem (operands[0], operands[1],
1999 operands[2], operands[3]); DONE;")
2001 (define_expand "cmpmemsi"
2002 [(set (match_operand:SI 0 "register_operand" "")
2003 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2004 (match_operand:BLK 2 "memory_operand" "") ) )
2005 (use (match_operand:SI 3 "general_operand" ""))
2006 (use (match_operand:SI 4 "" ""))]
2008 "s390_expand_cmpmem (operands[0], operands[1],
2009 operands[2], operands[3]); DONE;")
2011 ; Compare a block that is up to 256 bytes in length.
2012 ; The block length is taken as (operands[2] % 256) + 1.
2014 (define_insn "cmpmem_short_64"
2016 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2017 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2018 (use (match_operand:DI 2 "nonmemory_operand" "n,a"))
2019 (clobber (match_scratch:DI 3 "=X,&a"))]
2022 switch (which_alternative)
2025 return "clc\t%O0(%b2+1,%R0),%1";
2028 output_asm_insn ("bras\t%3,.+10", operands);
2029 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2030 return "ex\t%2,0(%3)";
2036 [(set_attr "op_type" "SS,NN")
2037 (set_attr "type" "cs,cs")
2038 (set_attr "atype" "*,agen")
2039 (set_attr "length" "*,14")])
2041 (define_insn "cmpmem_short_31"
2043 (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q")
2044 (match_operand:BLK 1 "memory_operand" "Q,Q")))
2045 (use (match_operand:SI 2 "nonmemory_operand" "n,a"))
2046 (clobber (match_scratch:SI 3 "=X,&a"))]
2049 switch (which_alternative)
2052 return "clc\t%O0(%b2+1,%R0),%1";
2055 output_asm_insn ("bras\t%3,.+10", operands);
2056 output_asm_insn ("clc\t%O0(1,%R0),%1", operands);
2057 return "ex\t%2,0(%3)";
2063 [(set_attr "op_type" "SS,NN")
2064 (set_attr "type" "cs,cs")
2065 (set_attr "atype" "*,agen")
2066 (set_attr "length" "*,14")])
2068 ; Compare a block of arbitrary length.
2070 (define_insn "cmpmem_long_64"
2071 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2072 (clobber (match_operand:TI 1 "register_operand" "=d"))
2074 (compare:CCS (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2075 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2077 (use (match_dup 3))]
2080 [(set_attr "op_type" "RR")
2081 (set_attr "type" "vs")])
2083 (define_insn "cmpmem_long_31"
2084 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2085 (clobber (match_operand:DI 1 "register_operand" "=d"))
2087 (compare:CCS (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2088 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2090 (use (match_dup 3))]
2093 [(set_attr "op_type" "RR")
2094 (set_attr "type" "vs")])
2096 ; Convert condition code to integer in range (-1, 0, 1)
2098 (define_insn "cmpint_si"
2099 [(set (match_operand:SI 0 "register_operand" "=d")
2100 (compare:SI (reg:CCS 33) (const_int 0)))]
2103 output_asm_insn ("lhi\t%0,1", operands);
2104 output_asm_insn ("jh\t.+12", operands);
2105 output_asm_insn ("jl\t.+6", operands);
2106 output_asm_insn ("sr\t%0,%0", operands);
2107 return "lcr\t%0,%0";
2109 [(set_attr "op_type" "NN")
2110 (set_attr "length" "16")
2111 (set_attr "type" "other")])
2113 (define_insn "cmpint_di"
2114 [(set (match_operand:DI 0 "register_operand" "=d")
2115 (compare:DI (reg:CCS 33) (const_int 0)))]
2118 output_asm_insn ("lghi\t%0,1", operands);
2119 output_asm_insn ("jh\t.+12", operands);
2120 output_asm_insn ("jl\t.+6", operands);
2121 output_asm_insn ("sgr\t%0,%0", operands);
2122 return "lcgr\t%0,%0";
2124 [(set_attr "op_type" "NN")
2125 (set_attr "length" "22")
2126 (set_attr "type" "other")])
2130 ;;- Conversion instructions.
2133 (define_insn "*sethighqisi"
2134 [(set (match_operand:SI 0 "register_operand" "=d,d")
2135 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2136 (clobber (reg:CC 33))]
2141 [(set_attr "op_type" "RS,RSY")])
2143 (define_insn "*sethighhisi"
2144 [(set (match_operand:SI 0 "register_operand" "=d,d")
2145 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2146 (clobber (reg:CC 33))]
2151 [(set_attr "op_type" "RS,RSY")])
2153 (define_insn "*sethighqidi_64"
2154 [(set (match_operand:DI 0 "register_operand" "=d")
2155 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2156 (clobber (reg:CC 33))]
2159 [(set_attr "op_type" "RSY")])
2161 (define_insn "*sethighqidi_31"
2162 [(set (match_operand:DI 0 "register_operand" "=d,d")
2163 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2164 (clobber (reg:CC 33))]
2169 [(set_attr "op_type" "RS,RSY")])
2171 (define_insn_and_split "*extractqi"
2172 [(set (match_operand:SI 0 "register_operand" "=d")
2173 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2174 (match_operand 2 "const_int_operand" "n")
2176 (clobber (reg:CC 33))]
2178 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2180 "&& reload_completed"
2182 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2183 (clobber (reg:CC 33))])
2184 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2186 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2187 operands[1] = change_address (operands[1], QImode, 0);
2189 [(set_attr "atype" "agen")])
2191 (define_insn_and_split "*extracthi"
2192 [(set (match_operand:SI 0 "register_operand" "=d")
2193 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2194 (match_operand 2 "const_int_operand" "n")
2196 (clobber (reg:CC 33))]
2198 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2200 "&& reload_completed"
2202 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2203 (clobber (reg:CC 33))])
2204 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2206 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2207 operands[1] = change_address (operands[1], HImode, 0);
2209 [(set_attr "atype" "agen")])
2212 ; extendsidi2 instruction pattern(s).
2215 (define_expand "extendsidi2"
2216 [(set (match_operand:DI 0 "register_operand" "")
2217 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2223 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2224 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2225 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2226 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2232 (define_insn "*extendsidi2"
2233 [(set (match_operand:DI 0 "register_operand" "=d,d")
2234 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2239 [(set_attr "op_type" "RRE,RXY")])
2242 ; extendhidi2 instruction pattern(s).
2245 (define_expand "extendhidi2"
2246 [(set (match_operand:DI 0 "register_operand" "")
2247 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2253 rtx tmp = gen_reg_rtx (SImode);
2254 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2255 emit_insn (gen_extendsidi2 (operands[0], tmp));
2260 operands[1] = gen_lowpart (DImode, operands[1]);
2261 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2262 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2268 (define_insn "*extendhidi2"
2269 [(set (match_operand:DI 0 "register_operand" "=d")
2270 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2273 [(set_attr "op_type" "RXY")])
2276 ; extendqidi2 instruction pattern(s).
2279 (define_expand "extendqidi2"
2280 [(set (match_operand:DI 0 "register_operand" "")
2281 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2287 rtx tmp = gen_reg_rtx (SImode);
2288 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2289 emit_insn (gen_extendsidi2 (operands[0], tmp));
2294 operands[1] = gen_lowpart (DImode, operands[1]);
2295 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2296 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2302 (define_insn "*extendqidi2"
2303 [(set (match_operand:DI 0 "register_operand" "=d")
2304 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2305 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2307 [(set_attr "op_type" "RXY")])
2310 [(set (match_operand:DI 0 "register_operand" "")
2311 (sign_extend:DI (match_operand:QI 1 "s_operand" "")))]
2312 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT && !reload_completed"
2314 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2315 (clobber (reg:CC 33))])
2317 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2318 (clobber (reg:CC 33))])]
2322 ; extendhisi2 instruction pattern(s).
2325 (define_expand "extendhisi2"
2326 [(set (match_operand:SI 0 "register_operand" "")
2327 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2331 operands[1] = gen_lowpart (SImode, operands[1]);
2332 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2333 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2338 (define_insn "*extendhisi2"
2339 [(set (match_operand:SI 0 "register_operand" "=d,d")
2340 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2345 [(set_attr "op_type" "RX,RXY")])
2348 ; extendqisi2 instruction pattern(s).
2351 (define_expand "extendqisi2"
2352 [(set (match_operand:SI 0 "register_operand" "")
2353 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2357 operands[1] = gen_lowpart (SImode, operands[1]);
2358 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2359 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2364 (define_insn "*extendqisi2"
2365 [(set (match_operand:SI 0 "register_operand" "=d")
2366 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2367 "TARGET_LONG_DISPLACEMENT"
2369 [(set_attr "op_type" "RXY")])
2372 [(set (match_operand:SI 0 "register_operand" "")
2373 (sign_extend:SI (match_operand:QI 1 "s_operand" "")))]
2374 "!TARGET_LONG_DISPLACEMENT && !reload_completed"
2376 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2377 (clobber (reg:CC 33))])
2379 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2380 (clobber (reg:CC 33))])]
2384 ; extendqihi2 instruction pattern(s).
2389 ; zero_extendsidi2 instruction pattern(s).
2392 (define_expand "zero_extendsidi2"
2393 [(set (match_operand:DI 0 "register_operand" "")
2394 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2400 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2401 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2402 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2408 (define_insn "*zero_extendsidi2"
2409 [(set (match_operand:DI 0 "register_operand" "=d,d")
2410 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2415 [(set_attr "op_type" "RRE,RXY")])
2418 ; zero_extendhidi2 instruction pattern(s).
2421 (define_expand "zero_extendhidi2"
2422 [(set (match_operand:DI 0 "register_operand" "")
2423 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2429 rtx tmp = gen_reg_rtx (SImode);
2430 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2431 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2436 operands[1] = gen_lowpart (DImode, operands[1]);
2437 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2438 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2444 (define_insn "*zero_extendhidi2"
2445 [(set (match_operand:DI 0 "register_operand" "=d")
2446 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2449 [(set_attr "op_type" "RXY")])
2452 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2455 (define_insn "*llgt_sisi"
2456 [(set (match_operand:SI 0 "register_operand" "=d,d")
2457 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2458 (const_int 2147483647)))]
2463 [(set_attr "op_type" "RRE,RXE")])
2465 (define_insn_and_split "*llgt_sisi_split"
2466 [(set (match_operand:SI 0 "register_operand" "=d,d")
2467 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2468 (const_int 2147483647)))
2469 (clobber (reg:CC 33))]
2472 "&& reload_completed"
2474 (and:SI (match_dup 1)
2475 (const_int 2147483647)))]
2478 (define_insn "*llgt_didi"
2479 [(set (match_operand:DI 0 "register_operand" "=d,d")
2480 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2481 (const_int 2147483647)))]
2486 [(set_attr "op_type" "RRE,RXE")])
2488 (define_insn_and_split "*llgt_didi_split"
2489 [(set (match_operand:DI 0 "register_operand" "=d,d")
2490 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2491 (const_int 2147483647)))
2492 (clobber (reg:CC 33))]
2495 "&& reload_completed"
2497 (and:DI (match_dup 1)
2498 (const_int 2147483647)))]
2501 (define_insn "*llgt_sidi"
2502 [(set (match_operand:DI 0 "register_operand" "=d")
2503 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2504 (const_int 2147483647)))]
2507 [(set_attr "op_type" "RXE")])
2509 (define_insn_and_split "*llgt_sidi_split"
2510 [(set (match_operand:DI 0 "register_operand" "=d")
2511 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2512 (const_int 2147483647)))
2513 (clobber (reg:CC 33))]
2516 "&& reload_completed"
2518 (and:DI (subreg:DI (match_dup 1) 0)
2519 (const_int 2147483647)))]
2523 ; zero_extendqidi2 instruction pattern(s)
2526 (define_expand "zero_extendqidi2"
2527 [(set (match_operand:DI 0 "register_operand" "")
2528 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2534 rtx tmp = gen_reg_rtx (SImode);
2535 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2536 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2541 operands[1] = gen_lowpart (DImode, operands[1]);
2542 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2543 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2549 (define_insn "*zero_extendqidi2"
2550 [(set (match_operand:DI 0 "register_operand" "=d")
2551 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2554 [(set_attr "op_type" "RXY")])
2557 ; zero_extendhisi2 instruction pattern(s).
2560 (define_expand "zero_extendhisi2"
2561 [(set (match_operand:SI 0 "register_operand" "")
2562 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2566 operands[1] = gen_lowpart (SImode, operands[1]);
2567 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2572 (define_insn "*zero_extendhisi2_64"
2573 [(set (match_operand:SI 0 "register_operand" "=d")
2574 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2577 [(set_attr "op_type" "RXY")])
2579 (define_insn_and_split "*zero_extendhisi2_31"
2580 [(set (match_operand:SI 0 "register_operand" "=&d")
2581 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2582 (clobber (reg:CC 33))]
2585 "&& reload_completed"
2586 [(set (match_dup 0) (const_int 0))
2588 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2589 (clobber (reg:CC 33))])]
2590 "operands[2] = gen_lowpart (HImode, operands[0]);"
2591 [(set_attr "atype" "agen")])
2594 ; zero_extendqisi2 instruction pattern(s).
2597 (define_expand "zero_extendqisi2"
2598 [(set (match_operand:SI 0 "register_operand" "")
2599 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2603 operands[1] = gen_lowpart (SImode, operands[1]);
2604 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2609 (define_insn "*zero_extendqisi2_64"
2610 [(set (match_operand:SI 0 "register_operand" "=d")
2611 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2614 [(set_attr "op_type" "RXY")])
2616 (define_insn_and_split "*zero_extendqisi2_31"
2617 [(set (match_operand:SI 0 "register_operand" "=&d")
2618 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2621 "&& reload_completed"
2622 [(set (match_dup 0) (const_int 0))
2623 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2624 "operands[2] = gen_lowpart (QImode, operands[0]);"
2625 [(set_attr "atype" "agen")])
2628 ; zero_extendqihi2 instruction pattern(s).
2631 (define_expand "zero_extendqihi2"
2632 [(set (match_operand:HI 0 "register_operand" "")
2633 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2637 operands[1] = gen_lowpart (HImode, operands[1]);
2638 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2643 (define_insn "*zero_extendqihi2_64"
2644 [(set (match_operand:HI 0 "register_operand" "=d")
2645 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2648 [(set_attr "op_type" "RXY")])
2650 (define_insn_and_split "*zero_extendqihi2_31"
2651 [(set (match_operand:HI 0 "register_operand" "=&d")
2652 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2655 "&& reload_completed"
2656 [(set (match_dup 0) (const_int 0))
2657 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2658 "operands[2] = gen_lowpart (QImode, operands[0]);"
2659 [(set_attr "atype" "agen")])
2663 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2666 (define_expand "fixuns_truncdfdi2"
2667 [(set (match_operand:DI 0 "register_operand" "")
2668 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2669 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2671 rtx label1 = gen_label_rtx ();
2672 rtx label2 = gen_label_rtx ();
2673 rtx temp = gen_reg_rtx (DFmode);
2674 operands[1] = force_reg (DFmode, operands[1]);
2676 emit_insn (gen_cmpdf (operands[1],
2677 CONST_DOUBLE_FROM_REAL_VALUE (
2678 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2679 emit_jump_insn (gen_blt (label1));
2680 emit_insn (gen_subdf3 (temp, operands[1],
2681 CONST_DOUBLE_FROM_REAL_VALUE (
2682 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2683 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2686 emit_label (label1);
2687 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2688 emit_label (label2);
2692 (define_expand "fix_truncdfdi2"
2693 [(set (match_operand:DI 0 "register_operand" "")
2694 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2695 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2697 operands[1] = force_reg (DFmode, operands[1]);
2698 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2702 (define_insn "fix_truncdfdi2_ieee"
2703 [(set (match_operand:DI 0 "register_operand" "=d")
2704 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2705 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2706 (clobber (reg:CC 33))]
2707 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2709 [(set_attr "op_type" "RRE")
2710 (set_attr "type" "ftoi")])
2713 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2716 (define_expand "fixuns_truncdfsi2"
2717 [(set (match_operand:SI 0 "register_operand" "")
2718 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2719 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2721 rtx label1 = gen_label_rtx ();
2722 rtx label2 = gen_label_rtx ();
2723 rtx temp = gen_reg_rtx (DFmode);
2725 operands[1] = force_reg (DFmode,operands[1]);
2726 emit_insn (gen_cmpdf (operands[1],
2727 CONST_DOUBLE_FROM_REAL_VALUE (
2728 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2729 emit_jump_insn (gen_blt (label1));
2730 emit_insn (gen_subdf3 (temp, operands[1],
2731 CONST_DOUBLE_FROM_REAL_VALUE (
2732 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2733 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2736 emit_label (label1);
2737 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2738 emit_label (label2);
2742 (define_expand "fix_truncdfsi2"
2743 [(set (match_operand:SI 0 "register_operand" "")
2744 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2747 if (TARGET_IBM_FLOAT)
2749 /* This is the algorithm from POP chapter A.5.7.2. */
2751 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2752 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2753 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2755 operands[1] = force_reg (DFmode, operands[1]);
2756 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2757 two31r, two32, temp));
2761 operands[1] = force_reg (DFmode, operands[1]);
2762 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2768 (define_insn "fix_truncdfsi2_ieee"
2769 [(set (match_operand:SI 0 "register_operand" "=d")
2770 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2771 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2772 (clobber (reg:CC 33))]
2773 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2775 [(set_attr "op_type" "RRE")
2776 (set_attr "type" "other" )])
2778 (define_insn "fix_truncdfsi2_ibm"
2779 [(set (match_operand:SI 0 "register_operand" "=d")
2780 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2781 (use (match_operand:DI 2 "immediate_operand" "m"))
2782 (use (match_operand:DI 3 "immediate_operand" "m"))
2783 (use (match_operand:BLK 4 "memory_operand" "m"))
2784 (clobber (reg:CC 33))]
2785 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2787 output_asm_insn ("sd\t%1,%2", operands);
2788 output_asm_insn ("aw\t%1,%3", operands);
2789 output_asm_insn ("std\t%1,%4", operands);
2790 output_asm_insn ("xi\t%N4,128", operands);
2793 [(set_attr "op_type" "NN")
2794 (set_attr "type" "ftoi")
2795 (set_attr "atype" "agen")
2796 (set_attr "length" "20")])
2799 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2802 (define_expand "fixuns_truncsfdi2"
2803 [(set (match_operand:DI 0 "register_operand" "")
2804 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2805 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2807 rtx label1 = gen_label_rtx ();
2808 rtx label2 = gen_label_rtx ();
2809 rtx temp = gen_reg_rtx (SFmode);
2811 operands[1] = force_reg (SFmode, operands[1]);
2812 emit_insn (gen_cmpsf (operands[1],
2813 CONST_DOUBLE_FROM_REAL_VALUE (
2814 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2815 emit_jump_insn (gen_blt (label1));
2817 emit_insn (gen_subsf3 (temp, operands[1],
2818 CONST_DOUBLE_FROM_REAL_VALUE (
2819 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2820 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2823 emit_label (label1);
2824 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2825 emit_label (label2);
2829 (define_expand "fix_truncsfdi2"
2830 [(set (match_operand:DI 0 "register_operand" "")
2831 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2832 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2834 operands[1] = force_reg (SFmode, operands[1]);
2835 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2839 (define_insn "fix_truncsfdi2_ieee"
2840 [(set (match_operand:DI 0 "register_operand" "=d")
2841 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2842 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2843 (clobber (reg:CC 33))]
2844 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2846 [(set_attr "op_type" "RRE")
2847 (set_attr "type" "ftoi")])
2850 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2853 (define_expand "fixuns_truncsfsi2"
2854 [(set (match_operand:SI 0 "register_operand" "")
2855 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2856 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2858 rtx label1 = gen_label_rtx ();
2859 rtx label2 = gen_label_rtx ();
2860 rtx temp = gen_reg_rtx (SFmode);
2862 operands[1] = force_reg (SFmode, operands[1]);
2863 emit_insn (gen_cmpsf (operands[1],
2864 CONST_DOUBLE_FROM_REAL_VALUE (
2865 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
2866 emit_jump_insn (gen_blt (label1));
2867 emit_insn (gen_subsf3 (temp, operands[1],
2868 CONST_DOUBLE_FROM_REAL_VALUE (
2869 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
2870 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
2873 emit_label (label1);
2874 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2875 emit_label (label2);
2879 (define_expand "fix_truncsfsi2"
2880 [(set (match_operand:SI 0 "register_operand" "")
2881 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
2884 if (TARGET_IBM_FLOAT)
2886 /* Convert to DFmode and then use the POP algorithm. */
2887 rtx temp = gen_reg_rtx (DFmode);
2888 emit_insn (gen_extendsfdf2 (temp, operands[1]));
2889 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
2893 operands[1] = force_reg (SFmode, operands[1]);
2894 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2900 (define_insn "fix_truncsfsi2_ieee"
2901 [(set (match_operand:SI 0 "register_operand" "=d")
2902 (fix:SI (match_operand:SF 1 "register_operand" "f")))
2903 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2904 (clobber (reg:CC 33))]
2905 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2907 [(set_attr "op_type" "RRE")
2908 (set_attr "type" "ftoi")])
2911 ; floatdidf2 instruction pattern(s).
2914 (define_insn "floatdidf2"
2915 [(set (match_operand:DF 0 "register_operand" "=f")
2916 (float:DF (match_operand:DI 1 "register_operand" "d")))
2917 (clobber (reg:CC 33))]
2918 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2920 [(set_attr "op_type" "RRE")
2921 (set_attr "type" "itof" )])
2924 ; floatdisf2 instruction pattern(s).
2927 (define_insn "floatdisf2"
2928 [(set (match_operand:SF 0 "register_operand" "=f")
2929 (float:SF (match_operand:DI 1 "register_operand" "d")))
2930 (clobber (reg:CC 33))]
2931 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2933 [(set_attr "op_type" "RRE")
2934 (set_attr "type" "itof" )])
2937 ; floatsidf2 instruction pattern(s).
2940 (define_expand "floatsidf2"
2942 [(set (match_operand:DF 0 "register_operand" "")
2943 (float:DF (match_operand:SI 1 "register_operand" "")))
2944 (clobber (reg:CC 33))])]
2947 if (TARGET_IBM_FLOAT)
2949 /* This is the algorithm from POP chapter A.5.7.1. */
2951 rtx temp = assign_stack_local (BLKmode, 2 * UNITS_PER_WORD, BITS_PER_WORD);
2952 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
2954 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
2959 (define_insn "floatsidf2_ieee"
2960 [(set (match_operand:DF 0 "register_operand" "=f")
2961 (float:DF (match_operand:SI 1 "register_operand" "d")))
2962 (clobber (reg:CC 33))]
2963 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2965 [(set_attr "op_type" "RRE")
2966 (set_attr "type" "itof" )])
2968 (define_insn "floatsidf2_ibm"
2969 [(set (match_operand:DF 0 "register_operand" "=f")
2970 (float:DF (match_operand:SI 1 "register_operand" "d")))
2971 (use (match_operand:DI 2 "immediate_operand" "m"))
2972 (use (match_operand:BLK 3 "memory_operand" "m"))
2973 (clobber (reg:CC 33))]
2974 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2976 output_asm_insn ("st\t%1,%N3", operands);
2977 output_asm_insn ("xi\t%N3,128", operands);
2978 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
2979 output_asm_insn ("ld\t%0,%3", operands);
2982 [(set_attr "op_type" "NN")
2983 (set_attr "type" "other" )
2984 (set_attr "atype" "agen")
2985 (set_attr "length" "20")])
2988 ; floatsisf2 instruction pattern(s).
2991 (define_expand "floatsisf2"
2993 [(set (match_operand:SF 0 "register_operand" "")
2994 (float:SF (match_operand:SI 1 "register_operand" "")))
2995 (clobber (reg:CC 33))])]
2998 if (TARGET_IBM_FLOAT)
3000 /* Use the POP algorithm to convert to DFmode and then truncate. */
3001 rtx temp = gen_reg_rtx (DFmode);
3002 emit_insn (gen_floatsidf2 (temp, operands[1]));
3003 emit_insn (gen_truncdfsf2 (operands[0], temp));
3008 (define_insn "floatsisf2_ieee"
3009 [(set (match_operand:SF 0 "register_operand" "=f")
3010 (float:SF (match_operand:SI 1 "register_operand" "d")))
3011 (clobber (reg:CC 33))]
3012 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3014 [(set_attr "op_type" "RRE")
3015 (set_attr "type" "itof" )])
3018 ; truncdfsf2 instruction pattern(s).
3021 (define_expand "truncdfsf2"
3022 [(set (match_operand:SF 0 "register_operand" "")
3023 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3027 (define_insn "truncdfsf2_ieee"
3028 [(set (match_operand:SF 0 "register_operand" "=f")
3029 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3030 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3032 [(set_attr "op_type" "RRE")])
3034 (define_insn "truncdfsf2_ibm"
3035 [(set (match_operand:SF 0 "register_operand" "=f,f")
3036 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3037 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3041 [(set_attr "op_type" "RR,RX")
3042 (set_attr "type" "floads,floads")])
3045 ; extendsfdf2 instruction pattern(s).
3048 (define_expand "extendsfdf2"
3049 [(set (match_operand:DF 0 "register_operand" "")
3050 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3053 if (TARGET_IBM_FLOAT)
3055 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3060 (define_insn "extendsfdf2_ieee"
3061 [(set (match_operand:DF 0 "register_operand" "=f,f")
3062 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3063 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3067 [(set_attr "op_type" "RRE,RXE")
3068 (set_attr "type" "floads,floads")])
3070 (define_insn "extendsfdf2_ibm"
3071 [(set (match_operand:DF 0 "register_operand" "=f,f")
3072 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3073 (clobber (reg:CC 33))]
3074 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3076 sdr\t%0,%0\;ler\t%0,%1
3077 sdr\t%0,%0\;le\t%0,%1"
3078 [(set_attr "op_type" "NN,NN")
3079 (set_attr "atype" "reg,agen")
3080 (set_attr "length" "4,6")
3081 (set_attr "type" "o2,o2")])
3085 ;; ARITHMETIC OPERATIONS
3087 ; arithmetic operations set the ConditionCode,
3088 ; because of unpredictable Bits in Register for Halfword and Byte
3089 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3092 ;;- Add instructions.
3096 ; adddi3 instruction pattern(s).
3099 (define_insn "*adddi3_sign"
3100 [(set (match_operand:DI 0 "register_operand" "=d,d")
3101 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3102 (match_operand:DI 1 "register_operand" "0,0")))
3103 (clobber (reg:CC 33))]
3108 [(set_attr "op_type" "RRE,RXY")])
3110 (define_insn "*adddi3_zero_cc"
3112 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3113 (match_operand:DI 1 "register_operand" "0,0"))
3115 (set (match_operand:DI 0 "register_operand" "=d,d")
3116 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3117 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3121 [(set_attr "op_type" "RRE,RXY")])
3123 (define_insn "*adddi3_zero_cconly"
3125 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3126 (match_operand:DI 1 "register_operand" "0,0"))
3128 (clobber (match_scratch:DI 0 "=d,d"))]
3129 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3133 [(set_attr "op_type" "RRE,RXY")])
3135 (define_insn "*adddi3_zero"
3136 [(set (match_operand:DI 0 "register_operand" "=d,d")
3137 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3138 (match_operand:DI 1 "register_operand" "0,0")))
3139 (clobber (reg:CC 33))]
3144 [(set_attr "op_type" "RRE,RXY")])
3146 (define_insn "*adddi3_imm_cc"
3148 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3149 (match_operand:DI 2 "const_int_operand" "K"))
3151 (set (match_operand:DI 0 "register_operand" "=d")
3152 (plus:DI (match_dup 1) (match_dup 2)))]
3154 && s390_match_ccmode (insn, CCAmode)
3155 && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
3157 [(set_attr "op_type" "RI")])
3159 (define_insn "*adddi3_cc"
3161 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3162 (match_operand:DI 2 "general_operand" "d,m"))
3164 (set (match_operand:DI 0 "register_operand" "=d,d")
3165 (plus:DI (match_dup 1) (match_dup 2)))]
3166 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3170 [(set_attr "op_type" "RRE,RXY")])
3172 (define_insn "*adddi3_cconly"
3174 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3175 (match_operand:DI 2 "general_operand" "d,m"))
3177 (clobber (match_scratch:DI 0 "=d,d"))]
3178 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3182 [(set_attr "op_type" "RRE,RXY")])
3184 (define_insn "*adddi3_cconly2"
3186 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3187 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3188 (clobber (match_scratch:DI 0 "=d,d"))]
3189 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3193 [(set_attr "op_type" "RRE,RXY")])
3195 (define_insn "*adddi3_64"
3196 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3197 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3198 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3199 (clobber (reg:CC 33))]
3205 [(set_attr "op_type" "RRE,RI,RXY")])
3207 (define_insn_and_split "*adddi3_31"
3208 [(set (match_operand:DI 0 "register_operand" "=&d")
3209 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3210 (match_operand:DI 2 "general_operand" "do") ) )
3211 (clobber (reg:CC 33))]
3214 "&& reload_completed"
3216 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3217 (clobber (reg:CC 33))])
3220 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3222 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3224 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3226 (label_ref (match_dup 9))))
3228 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3229 (clobber (reg:CC 33))])
3231 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3232 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3233 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3234 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3235 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3236 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3237 operands[9] = gen_label_rtx ();"
3238 [(set_attr "op_type" "NN")])
3240 (define_expand "adddi3"
3242 [(set (match_operand:DI 0 "register_operand" "")
3243 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3244 (match_operand:DI 2 "general_operand" "")))
3245 (clobber (reg:CC 33))])]
3249 (define_insn "*la_64"
3250 [(set (match_operand:DI 0 "register_operand" "=d,d")
3251 (match_operand:QI 1 "address_operand" "U,W"))]
3256 [(set_attr "op_type" "RX,RXY")
3257 (set_attr "type" "la")])
3261 [(set (match_operand:DI 0 "register_operand" "")
3262 (match_operand:QI 1 "address_operand" ""))
3263 (clobber (reg:CC 33))])]
3265 && strict_memory_address_p (VOIDmode, operands[1])
3266 && preferred_la_operand_p (operands[1])"
3267 [(set (match_dup 0) (match_dup 1))]
3271 [(set (match_operand:DI 0 "register_operand" "")
3272 (match_operand:DI 1 "register_operand" ""))
3275 (plus:DI (match_dup 0)
3276 (match_operand:DI 2 "nonmemory_operand" "")))
3277 (clobber (reg:CC 33))])]
3279 && !reg_overlap_mentioned_p (operands[0], operands[2])
3280 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (DImode, operands[1], operands[2]))
3281 && preferred_la_operand_p (gen_rtx_PLUS (DImode, operands[1], operands[2]))"
3282 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
3285 (define_expand "reload_indi"
3286 [(parallel [(match_operand:DI 0 "register_operand" "=a")
3287 (match_operand:DI 1 "s390_plus_operand" "")
3288 (match_operand:DI 2 "register_operand" "=&a")])]
3291 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
3297 ; addsi3 instruction pattern(s).
3300 (define_insn "*addsi3_imm_cc"
3302 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3303 (match_operand:SI 2 "const_int_operand" "K"))
3305 (set (match_operand:SI 0 "register_operand" "=d")
3306 (plus:SI (match_dup 1) (match_dup 2)))]
3307 "s390_match_ccmode (insn, CCAmode)
3308 && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
3310 [(set_attr "op_type" "RI")])
3312 (define_insn "*addsi3_carry1_cc"
3314 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3315 (match_operand:SI 2 "general_operand" "d,R,T"))
3317 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3318 (plus:SI (match_dup 1) (match_dup 2)))]
3319 "s390_match_ccmode (insn, CCL1mode)"
3324 [(set_attr "op_type" "RR,RX,RXY")])
3326 (define_insn "*addsi3_carry1_cconly"
3328 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3329 (match_operand:SI 2 "general_operand" "d,R,T"))
3331 (clobber (match_scratch:SI 0 "=d,d,d"))]
3332 "s390_match_ccmode (insn, CCL1mode)"
3337 [(set_attr "op_type" "RR,RX,RXY")])
3339 (define_insn "*addsi3_carry2_cc"
3341 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3342 (match_operand:SI 2 "general_operand" "d,R,T"))
3344 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3345 (plus:SI (match_dup 1) (match_dup 2)))]
3346 "s390_match_ccmode (insn, CCL1mode)"
3351 [(set_attr "op_type" "RR,RX,RXY")])
3353 (define_insn "*addsi3_carry2_cconly"
3355 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3356 (match_operand:SI 2 "general_operand" "d,R,T"))
3358 (clobber (match_scratch:SI 0 "=d,d,d"))]
3359 "s390_match_ccmode (insn, CCL1mode)"
3364 [(set_attr "op_type" "RR,RX,RXY")])
3366 (define_insn "*addsi3_cc"
3368 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3369 (match_operand:SI 2 "general_operand" "d,R,T"))
3371 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3372 (plus:SI (match_dup 1) (match_dup 2)))]
3373 "s390_match_ccmode (insn, CCLmode)"
3378 [(set_attr "op_type" "RR,RX,RXY")])
3380 (define_insn "*addsi3_cconly"
3382 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3383 (match_operand:SI 2 "general_operand" "d,R,T"))
3385 (clobber (match_scratch:SI 0 "=d,d,d"))]
3386 "s390_match_ccmode (insn, CCLmode)"
3391 [(set_attr "op_type" "RR,RX,RXY")])
3393 (define_insn "*addsi3_cconly2"
3395 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3396 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3397 (clobber (match_scratch:SI 0 "=d,d,d"))]
3398 "s390_match_ccmode(insn, CCLmode)"
3403 [(set_attr "op_type" "RR,RX,RXY")])
3405 (define_insn "*addsi3_sign"
3406 [(set (match_operand:SI 0 "register_operand" "=d,d")
3407 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3408 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3409 (clobber (reg:CC 33))]
3414 [(set_attr "op_type" "RX,RXY")])
3416 (define_insn "*addsi3_sub"
3417 [(set (match_operand:SI 0 "register_operand" "=d,d")
3418 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3419 (subreg:SI (match_operand:HI 2 "memory_operand" "R,T") 0)))
3420 (clobber (reg:CC 33))]
3425 [(set_attr "op_type" "RX,RXY")])
3427 (define_insn "addsi3"
3428 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3429 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3430 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3431 (clobber (reg:CC 33))]
3438 [(set_attr "op_type" "RR,RI,RX,RXY")])
3440 (define_insn "*la_31"
3441 [(set (match_operand:SI 0 "register_operand" "=d,d")
3442 (match_operand:QI 1 "address_operand" "U,W"))]
3443 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
3447 [(set_attr "op_type" "RX,RXY")
3448 (set_attr "type" "la")])
3452 [(set (match_operand:SI 0 "register_operand" "")
3453 (match_operand:QI 1 "address_operand" ""))
3454 (clobber (reg:CC 33))])]
3456 && strict_memory_address_p (VOIDmode, operands[1])
3457 && preferred_la_operand_p (operands[1])"
3458 [(set (match_dup 0) (match_dup 1))]
3462 [(set (match_operand:SI 0 "register_operand" "")
3463 (match_operand:SI 1 "register_operand" ""))
3466 (plus:SI (match_dup 0)
3467 (match_operand:SI 2 "nonmemory_operand" "")))
3468 (clobber (reg:CC 33))])]
3470 && !reg_overlap_mentioned_p (operands[0], operands[2])
3471 && strict_memory_address_p (VOIDmode, gen_rtx_PLUS (SImode, operands[1], operands[2]))
3472 && preferred_la_operand_p (gen_rtx_PLUS (SImode, operands[1], operands[2]))"
3473 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
3476 (define_insn "*la_31_and"
3477 [(set (match_operand:SI 0 "register_operand" "=d,d")
3478 (and:SI (match_operand:QI 1 "address_operand" "U,W")
3479 (const_int 2147483647)))]
3484 [(set_attr "op_type" "RX,RXY")
3485 (set_attr "type" "la")])
3487 (define_insn_and_split "*la_31_and_cc"
3488 [(set (match_operand:SI 0 "register_operand" "=d")
3489 (and:SI (match_operand:QI 1 "address_operand" "p")
3490 (const_int 2147483647)))
3491 (clobber (reg:CC 33))]
3494 "&& reload_completed"
3496 (and:SI (match_dup 1) (const_int 2147483647)))]
3498 [(set_attr "op_type" "RX")
3499 (set_attr "type" "la")])
3501 (define_insn "force_la_31"
3502 [(set (match_operand:SI 0 "register_operand" "=d,d")
3503 (match_operand:QI 1 "address_operand" "U,W"))
3504 (use (const_int 0))]
3509 [(set_attr "op_type" "RX")
3510 (set_attr "type" "la")])
3512 (define_expand "reload_insi"
3513 [(parallel [(match_operand:SI 0 "register_operand" "=a")
3514 (match_operand:SI 1 "s390_plus_operand" "")
3515 (match_operand:SI 2 "register_operand" "=&a")])]
3518 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
3524 ; adddf3 instruction pattern(s).
3527 (define_expand "adddf3"
3529 [(set (match_operand:DF 0 "register_operand" "=f,f")
3530 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3531 (match_operand:DF 2 "general_operand" "f,R")))
3532 (clobber (reg:CC 33))])]
3536 (define_insn "*adddf3"
3537 [(set (match_operand:DF 0 "register_operand" "=f,f")
3538 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3539 (match_operand:DF 2 "general_operand" "f,R")))
3540 (clobber (reg:CC 33))]
3541 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3545 [(set_attr "op_type" "RRE,RXE")
3546 (set_attr "type" "fsimpd,fsimpd")])
3548 (define_insn "*adddf3_cc"
3550 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3551 (match_operand:DF 2 "general_operand" "f,R"))
3552 (match_operand:DF 3 "const0_operand" "")))
3553 (set (match_operand:DF 0 "register_operand" "=f,f")
3554 (plus:DF (match_dup 1) (match_dup 2)))]
3555 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3559 [(set_attr "op_type" "RRE,RXE")
3560 (set_attr "type" "fsimpd,fsimpd")])
3562 (define_insn "*adddf3_cconly"
3564 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3565 (match_operand:DF 2 "general_operand" "f,R"))
3566 (match_operand:DF 3 "const0_operand" "")))
3567 (clobber (match_scratch:DF 0 "=f,f"))]
3568 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3572 [(set_attr "op_type" "RRE,RXE")
3573 (set_attr "type" "fsimpd,fsimpd")])
3575 (define_insn "*adddf3_ibm"
3576 [(set (match_operand:DF 0 "register_operand" "=f,f")
3577 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3578 (match_operand:DF 2 "general_operand" "f,R")))
3579 (clobber (reg:CC 33))]
3580 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3584 [(set_attr "op_type" "RR,RX")
3585 (set_attr "type" "fsimpd,fsimpd")])
3588 ; addsf3 instruction pattern(s).
3591 (define_expand "addsf3"
3593 [(set (match_operand:SF 0 "register_operand" "=f,f")
3594 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3595 (match_operand:SF 2 "general_operand" "f,R")))
3596 (clobber (reg:CC 33))])]
3600 (define_insn "*addsf3"
3601 [(set (match_operand:SF 0 "register_operand" "=f,f")
3602 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3603 (match_operand:SF 2 "general_operand" "f,R")))
3604 (clobber (reg:CC 33))]
3605 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3609 [(set_attr "op_type" "RRE,RXE")
3610 (set_attr "type" "fsimps,fsimps")])
3612 (define_insn "*addsf3_cc"
3614 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3615 (match_operand:SF 2 "general_operand" "f,R"))
3616 (match_operand:SF 3 "const0_operand" "")))
3617 (set (match_operand:SF 0 "register_operand" "=f,f")
3618 (plus:SF (match_dup 1) (match_dup 2)))]
3619 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3623 [(set_attr "op_type" "RRE,RXE")
3624 (set_attr "type" "fsimps,fsimps")])
3626 (define_insn "*addsf3_cconly"
3628 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3629 (match_operand:SF 2 "general_operand" "f,R"))
3630 (match_operand:SF 3 "const0_operand" "")))
3631 (clobber (match_scratch:SF 0 "=f,f"))]
3632 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3636 [(set_attr "op_type" "RRE,RXE")
3637 (set_attr "type" "fsimps,fsimps")])
3639 (define_insn "*addsf3"
3640 [(set (match_operand:SF 0 "register_operand" "=f,f")
3641 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3642 (match_operand:SF 2 "general_operand" "f,R")))
3643 (clobber (reg:CC 33))]
3644 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3648 [(set_attr "op_type" "RR,RX")
3649 (set_attr "type" "fsimps,fsimps")])
3653 ;;- Subtract instructions.
3657 ; subdi3 instruction pattern(s).
3660 (define_insn "*subdi3_sign"
3661 [(set (match_operand:DI 0 "register_operand" "=d,d")
3662 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3663 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3664 (clobber (reg:CC 33))]
3669 [(set_attr "op_type" "RRE,RXY")])
3671 (define_insn "*subdi3_zero_cc"
3673 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3674 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3676 (set (match_operand:DI 0 "register_operand" "=d,d")
3677 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3678 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3682 [(set_attr "op_type" "RRE,RXY")])
3684 (define_insn "*subdi3_zero_cconly"
3686 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3687 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3689 (clobber (match_scratch:DI 0 "=d,d"))]
3690 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3694 [(set_attr "op_type" "RRE,RXY")])
3696 (define_insn "*subdi3_zero"
3697 [(set (match_operand:DI 0 "register_operand" "=d,d")
3698 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3699 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3700 (clobber (reg:CC 33))]
3705 [(set_attr "op_type" "RRE,RXY")])
3707 (define_insn "*subdi3_cc"
3709 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3710 (match_operand:DI 2 "general_operand" "d,m"))
3712 (set (match_operand:DI 0 "register_operand" "=d,d")
3713 (minus:DI (match_dup 1) (match_dup 2)))]
3714 "s390_match_ccmode (insn, CCLmode)"
3718 [(set_attr "op_type" "RRE,RXY")])
3720 (define_insn "*subdi3_cconly"
3722 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3723 (match_operand:DI 2 "general_operand" "d,m"))
3725 (clobber (match_scratch:DI 0 "=d,d"))]
3726 "s390_match_ccmode (insn, CCLmode)"
3730 [(set_attr "op_type" "RRE,RXY")])
3732 (define_insn "*subdi3_64"
3733 [(set (match_operand:DI 0 "register_operand" "=d,d")
3734 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3735 (match_operand:DI 2 "general_operand" "d,m") ) )
3736 (clobber (reg:CC 33))]
3741 [(set_attr "op_type" "RRE,RRE")])
3743 (define_insn_and_split "*subdi3_31"
3744 [(set (match_operand:DI 0 "register_operand" "=&d")
3745 (minus:DI (match_operand:DI 1 "register_operand" "0")
3746 (match_operand:DI 2 "general_operand" "do") ) )
3747 (clobber (reg:CC 33))]
3750 "&& reload_completed"
3752 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3753 (clobber (reg:CC 33))])
3756 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3758 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3760 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3762 (label_ref (match_dup 9))))
3764 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3765 (clobber (reg:CC 33))])
3767 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3768 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3769 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3770 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3771 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3772 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3773 operands[9] = gen_label_rtx ();"
3774 [(set_attr "op_type" "NN")])
3776 (define_expand "subdi3"
3778 [(set (match_operand:DI 0 "register_operand" "")
3779 (minus:DI (match_operand:DI 1 "register_operand" "")
3780 (match_operand:DI 2 "general_operand" "")))
3781 (clobber (reg:CC 33))])]
3786 ; subsi3 instruction pattern(s).
3789 (define_insn "*subsi3_borrow_cc"
3791 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3792 (match_operand:SI 2 "general_operand" "d,R,T"))
3794 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3795 (minus:SI (match_dup 1) (match_dup 2)))]
3796 "s390_match_ccmode(insn, CCL2mode)"
3801 [(set_attr "op_type" "RR,RX,RXY")])
3803 (define_insn "*subsi3_borrow_cconly"
3805 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3806 (match_operand:SI 2 "general_operand" "d,R,T"))
3808 (clobber (match_scratch:SI 0 "=d,d,d"))]
3809 "s390_match_ccmode(insn, CCL2mode)"
3814 [(set_attr "op_type" "RR,RX,RXE")])
3816 (define_insn "*subsi3_cc"
3818 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3819 (match_operand:SI 2 "general_operand" "d,R,T"))
3821 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3822 (minus:SI (match_dup 1) (match_dup 2)))]
3823 "s390_match_ccmode(insn, CCLmode)"
3828 [(set_attr "op_type" "RR,RX,RXY")])
3830 (define_insn "*subsi3_cconly"
3832 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3833 (match_operand:SI 2 "general_operand" "d,R,T"))
3835 (clobber (match_scratch:SI 0 "=d,d,d"))]
3836 "s390_match_ccmode(insn, CCLmode)"
3841 [(set_attr "op_type" "RR,RX,RXY")])
3843 (define_insn "*subsi3_sign"
3844 [(set (match_operand:SI 0 "register_operand" "=d,d")
3845 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3846 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3847 (clobber (reg:CC 33))]
3852 [(set_attr "op_type" "RX,RXY")])
3854 (define_insn "*subsi3_sub"
3855 [(set (match_operand:SI 0 "register_operand" "=d,d")
3856 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
3857 (subreg:SI (match_operand:HI 2 "memory_operand" "R,T") 0)))
3858 (clobber (reg:CC 33))]
3863 [(set_attr "op_type" "RX,RXY")])
3865 (define_insn "subsi3"
3866 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
3867 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3868 (match_operand:SI 2 "general_operand" "d,R,T")))
3869 (clobber (reg:CC 33))]
3875 [(set_attr "op_type" "RR,RX,RXY")])
3879 ; subdf3 instruction pattern(s).
3882 (define_expand "subdf3"
3884 [(set (match_operand:DF 0 "register_operand" "=f,f")
3885 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3886 (match_operand:DF 2 "general_operand" "f,R")))
3887 (clobber (reg:CC 33))])]
3891 (define_insn "*subdf3"
3892 [(set (match_operand:DF 0 "register_operand" "=f,f")
3893 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3894 (match_operand:DF 2 "general_operand" "f,R")))
3895 (clobber (reg:CC 33))]
3896 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3900 [(set_attr "op_type" "RRE,RXE")
3901 (set_attr "type" "fsimpd,fsimpd")])
3903 (define_insn "*subdf3_cc"
3905 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3906 (match_operand:DF 2 "general_operand" "f,R"))
3907 (match_operand:DF 3 "const0_operand" "")))
3908 (set (match_operand:DF 0 "register_operand" "=f,f")
3909 (plus:DF (match_dup 1) (match_dup 2)))]
3910 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3914 [(set_attr "op_type" "RRE,RXE")
3915 (set_attr "type" "fsimpd,fsimpd")])
3917 (define_insn "*subdf3_cconly"
3919 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3920 (match_operand:DF 2 "general_operand" "f,R"))
3921 (match_operand:DF 3 "const0_operand" "")))
3922 (clobber (match_scratch:DF 0 "=f,f"))]
3923 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3927 [(set_attr "op_type" "RRE,RXE")
3928 (set_attr "type" "fsimpd,fsimpd")])
3930 (define_insn "*subdf3_ibm"
3931 [(set (match_operand:DF 0 "register_operand" "=f,f")
3932 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
3933 (match_operand:DF 2 "general_operand" "f,R")))
3934 (clobber (reg:CC 33))]
3935 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3939 [(set_attr "op_type" "RR,RX")
3940 (set_attr "type" "fsimpd,fsimpd")])
3943 ; subsf3 instruction pattern(s).
3946 (define_expand "subsf3"
3948 [(set (match_operand:SF 0 "register_operand" "=f,f")
3949 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3950 (match_operand:SF 2 "general_operand" "f,R")))
3951 (clobber (reg:CC 33))])]
3955 (define_insn "*subsf3"
3956 [(set (match_operand:SF 0 "register_operand" "=f,f")
3957 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3958 (match_operand:SF 2 "general_operand" "f,R")))
3959 (clobber (reg:CC 33))]
3960 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3964 [(set_attr "op_type" "RRE,RXE")
3965 (set_attr "type" "fsimps,fsimps")])
3967 (define_insn "*subsf3_cc"
3969 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3970 (match_operand:SF 2 "general_operand" "f,R"))
3971 (match_operand:SF 3 "const0_operand" "")))
3972 (set (match_operand:SF 0 "register_operand" "=f,f")
3973 (minus:SF (match_dup 1) (match_dup 2)))]
3974 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3978 [(set_attr "op_type" "RRE,RXE")
3979 (set_attr "type" "fsimps,fsimps")])
3981 (define_insn "*subsf3_cconly"
3983 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3984 (match_operand:SF 2 "general_operand" "f,R"))
3985 (match_operand:SF 3 "const0_operand" "")))
3986 (clobber (match_scratch:SF 0 "=f,f"))]
3987 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3991 [(set_attr "op_type" "RRE,RXE")
3992 (set_attr "type" "fsimps,fsimps")])
3994 (define_insn "*subsf3_ibm"
3995 [(set (match_operand:SF 0 "register_operand" "=f,f")
3996 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
3997 (match_operand:SF 2 "general_operand" "f,R")))
3998 (clobber (reg:CC 33))]
3999 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4003 [(set_attr "op_type" "RR,RX")
4004 (set_attr "type" "fsimps,fsimps")])
4008 ;;- Multiply instructions.
4012 ; muldi3 instruction pattern(s).
4015 (define_insn "*muldi3_sign"
4016 [(set (match_operand:DI 0 "register_operand" "=d,d")
4017 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4018 (match_operand:DI 1 "register_operand" "0,0")))]
4023 [(set_attr "op_type" "RRE,RXY")
4024 (set_attr "type" "imul")])
4026 (define_insn "muldi3"
4027 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4028 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4029 (match_operand:DI 2 "general_operand" "d,K,m")))]
4035 [(set_attr "op_type" "RRE,RI,RXY")
4036 (set_attr "type" "imul")])
4039 ; mulsi3 instruction pattern(s).
4042 (define_insn "*mulsi3_sign"
4043 [(set (match_operand:SI 0 "register_operand" "=d")
4044 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4045 (match_operand:SI 1 "register_operand" "0")))]
4048 [(set_attr "op_type" "RX")
4049 (set_attr "type" "imul")])
4051 (define_insn "mulsi3"
4052 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4053 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4054 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4061 [(set_attr "op_type" "RRE,RI,RX,RXY")
4062 (set_attr "type" "imul")])
4065 ; mulsidi3 instruction pattern(s).
4068 (define_insn "mulsidi3"
4069 [(set (match_operand:DI 0 "register_operand" "=d,d")
4070 (mult:DI (sign_extend:DI
4071 (match_operand:SI 1 "register_operand" "%0,0"))
4073 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4078 [(set_attr "op_type" "RR,RX")
4079 (set_attr "type" "imul")])
4082 ; umulsidi3 instruction pattern(s).
4085 (define_insn "umulsidi3"
4086 [(set (match_operand:DI 0 "register_operand" "=d,d")
4087 (mult:DI (zero_extend:DI
4088 (match_operand:SI 1 "register_operand" "%0,0"))
4090 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4091 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4095 [(set_attr "op_type" "RRE,RXY")
4096 (set_attr "type" "imul")])
4099 ; muldf3 instruction pattern(s).
4102 (define_expand "muldf3"
4104 [(set (match_operand:DF 0 "register_operand" "=f,f")
4105 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4106 (match_operand:DF 2 "general_operand" "f,R")))
4107 (clobber (reg:CC 33))])]
4111 (define_insn "*muldf3"
4112 [(set (match_operand:DF 0 "register_operand" "=f,f")
4113 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4114 (match_operand:DF 2 "general_operand" "f,R")))
4115 (clobber (reg:CC 33))]
4116 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4120 [(set_attr "op_type" "RRE,RXE")
4121 (set_attr "type" "fmuld")])
4123 (define_insn "*muldf3_ibm"
4124 [(set (match_operand:DF 0 "register_operand" "=f,f")
4125 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4126 (match_operand:DF 2 "general_operand" "f,R")))
4127 (clobber (reg:CC 33))]
4128 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4132 [(set_attr "op_type" "RR,RX")
4133 (set_attr "type" "fmuld")])
4135 (define_insn "*fmadddf"
4136 [(set (match_operand:DF 0 "register_operand" "=f,f")
4137 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4138 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4139 (match_operand:DF 3 "register_operand" "0,0")))]
4140 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
4144 [(set_attr "op_type" "RRE,RXE")
4145 (set_attr "type" "fmuld")])
4147 (define_insn "*fmsubdf"
4148 [(set (match_operand:DF 0 "register_operand" "=f,f")
4149 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4150 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4151 (match_operand:DF 3 "register_operand" "0,0")))]
4152 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
4156 [(set_attr "op_type" "RRE,RXE")
4157 (set_attr "type" "fmuld")])
4160 ; mulsf3 instruction pattern(s).
4163 (define_expand "mulsf3"
4165 [(set (match_operand:SF 0 "register_operand" "=f,f")
4166 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4167 (match_operand:SF 2 "general_operand" "f,R")))
4168 (clobber (reg:CC 33))])]
4172 (define_insn "*mulsf3"
4173 [(set (match_operand:SF 0 "register_operand" "=f,f")
4174 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4175 (match_operand:SF 2 "general_operand" "f,R")))
4176 (clobber (reg:CC 33))]
4177 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4181 [(set_attr "op_type" "RRE,RXE")
4182 (set_attr "type" "fmuls")])
4184 (define_insn "*mulsf3_ibm"
4185 [(set (match_operand:SF 0 "register_operand" "=f,f")
4186 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4187 (match_operand:SF 2 "general_operand" "f,R")))
4188 (clobber (reg:CC 33))]
4189 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4193 [(set_attr "op_type" "RR,RX")
4194 (set_attr "type" "fmuls")])
4196 (define_insn "*fmaddsf"
4197 [(set (match_operand:SF 0 "register_operand" "=f,f")
4198 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4199 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4200 (match_operand:SF 3 "register_operand" "0,0")))]
4201 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
4205 [(set_attr "op_type" "RRE,RXE")
4206 (set_attr "type" "fmuls")])
4208 (define_insn "*fmsubsf"
4209 [(set (match_operand:SF 0 "register_operand" "=f,f")
4210 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4211 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4212 (match_operand:SF 3 "register_operand" "0,0")))]
4213 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && flag_unsafe_math_optimizations"
4217 [(set_attr "op_type" "RRE,RXE")
4218 (set_attr "type" "fmuls")])
4221 ;;- Divide and modulo instructions.
4225 ; divmoddi4 instruction pattern(s).
4228 (define_expand "divmoddi4"
4229 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4230 (div:DI (match_operand:DI 1 "register_operand" "")
4231 (match_operand:DI 2 "general_operand" "")))
4232 (set (match_operand:DI 3 "general_operand" "")
4233 (mod:DI (match_dup 1) (match_dup 2)))])
4234 (clobber (match_dup 4))]
4237 rtx insn, div_equal, mod_equal;
4239 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4240 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4242 operands[4] = gen_reg_rtx(TImode);
4243 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4245 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4247 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4249 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4251 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4256 (define_insn "divmodtidi3"
4257 [(set (match_operand:TI 0 "register_operand" "=d,d")
4260 (div:DI (match_operand:DI 1 "register_operand" "0,0")
4261 (match_operand:DI 2 "general_operand" "d,m")))
4264 (mod:DI (match_dup 1)
4271 [(set_attr "op_type" "RRE,RXY")
4272 (set_attr "type" "idiv")])
4274 (define_insn "divmodtisi3"
4275 [(set (match_operand:TI 0 "register_operand" "=d,d")
4278 (div:DI (match_operand:DI 1 "register_operand" "0,0")
4279 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4282 (mod:DI (match_dup 1)
4283 (sign_extend:DI (match_dup 2))))
4289 [(set_attr "op_type" "RRE,RXY")
4290 (set_attr "type" "idiv")])
4293 ; udivmoddi4 instruction pattern(s).
4296 (define_expand "udivmoddi4"
4297 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4298 (udiv:DI (match_operand:DI 1 "general_operand" "")
4299 (match_operand:DI 2 "nonimmediate_operand" "")))
4300 (set (match_operand:DI 3 "general_operand" "")
4301 (umod:DI (match_dup 1) (match_dup 2)))])
4302 (clobber (match_dup 4))]
4305 rtx insn, div_equal, mod_equal, equal;
4307 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4308 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4309 equal = gen_rtx_IOR (TImode,
4310 gen_rtx_ZERO_EXTEND (TImode, div_equal),
4311 gen_rtx_ASHIFT (TImode,
4312 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4315 operands[4] = gen_reg_rtx(TImode);
4316 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4317 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4318 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4319 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4321 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4323 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4325 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4327 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4329 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4334 (define_insn "udivmodtidi3"
4335 [(set (match_operand:TI 0 "register_operand" "=d,d")
4336 (ior:TI (zero_extend:TI
4338 (udiv:TI (match_operand:TI 1 "register_operand" "0,0")
4340 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4344 (umod:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))
4350 [(set_attr "op_type" "RRE,RXY")
4351 (set_attr "type" "idiv")])
4354 ; divmodsi4 instruction pattern(s).
4357 (define_expand "divmodsi4"
4358 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4359 (div:SI (match_operand:SI 1 "general_operand" "")
4360 (match_operand:SI 2 "nonimmediate_operand" "")))
4361 (set (match_operand:SI 3 "general_operand" "")
4362 (mod:SI (match_dup 1) (match_dup 2)))])
4363 (clobber (match_dup 4))]
4366 rtx insn, div_equal, mod_equal, equal;
4368 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4369 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4370 equal = gen_rtx_IOR (DImode,
4371 gen_rtx_ZERO_EXTEND (DImode, div_equal),
4372 gen_rtx_ASHIFT (DImode,
4373 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4376 operands[4] = gen_reg_rtx(DImode);
4377 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4378 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4380 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4382 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4384 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4386 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4388 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4393 (define_insn "divmoddisi3"
4394 [(set (match_operand:DI 0 "register_operand" "=d,d")
4395 (ior:DI (zero_extend:DI
4397 (div:DI (match_operand:DI 1 "register_operand" "0,0")
4399 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4403 (mod:DI (match_dup 1) (sign_extend:SI (match_dup 2)))))
4409 [(set_attr "op_type" "RR,RX")
4410 (set_attr "type" "idiv")])
4413 ; udivsi3 and umodsi3 instruction pattern(s).
4416 (define_expand "udivmodsi4"
4417 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4418 (udiv:SI (match_operand:SI 1 "general_operand" "")
4419 (match_operand:SI 2 "nonimmediate_operand" "")))
4420 (set (match_operand:SI 3 "general_operand" "")
4421 (umod:SI (match_dup 1) (match_dup 2)))])
4422 (clobber (match_dup 4))]
4423 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4425 rtx insn, div_equal, mod_equal, equal;
4427 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4428 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4429 equal = gen_rtx_IOR (DImode,
4430 gen_rtx_ZERO_EXTEND (DImode, div_equal),
4431 gen_rtx_ASHIFT (DImode,
4432 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4435 operands[4] = gen_reg_rtx(DImode);
4436 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4437 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4438 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4439 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4441 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4443 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4445 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4447 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4449 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4454 (define_insn "udivmoddisi3"
4455 [(set (match_operand:DI 0 "register_operand" "=d,d")
4456 (ior:DI (zero_extend:DI
4458 (udiv:DI (match_operand:DI 1 "register_operand" "0,0")
4460 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4464 (umod:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))
4466 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4470 [(set_attr "op_type" "RRE,RXY")
4471 (set_attr "type" "idiv")])
4473 (define_expand "udivsi3"
4474 [(set (match_operand:SI 0 "register_operand" "=d")
4475 (udiv:SI (match_operand:SI 1 "general_operand" "")
4476 (match_operand:SI 2 "general_operand" "")))
4477 (clobber (match_dup 3))]
4478 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4480 rtx insn, udiv_equal, umod_equal, equal;
4482 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4483 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4484 equal = gen_rtx_IOR (DImode,
4485 gen_rtx_ZERO_EXTEND (DImode, udiv_equal),
4486 gen_rtx_ASHIFT (DImode,
4487 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4490 operands[3] = gen_reg_rtx (DImode);
4492 if (CONSTANT_P (operands[2]))
4494 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4496 rtx label1 = gen_label_rtx ();
4498 operands[1] = make_safe_from (operands[1], operands[0]);
4499 emit_move_insn (operands[0], const0_rtx);
4500 emit_insn (gen_cmpsi (operands[1], operands[2]));
4501 emit_jump_insn (gen_bltu (label1));
4502 emit_move_insn (operands[0], const1_rtx);
4503 emit_label (label1);
4507 operands[2] = force_reg (SImode, operands[2]);
4508 operands[2] = make_safe_from (operands[2], operands[0]);
4510 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4511 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4514 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4516 insn = emit_move_insn (operands[0],
4517 gen_lowpart (SImode, operands[3]));
4519 gen_rtx_EXPR_LIST (REG_EQUAL,
4520 udiv_equal, REG_NOTES (insn));
4525 rtx label1 = gen_label_rtx ();
4526 rtx label2 = gen_label_rtx ();
4527 rtx label3 = gen_label_rtx ();
4529 operands[1] = force_reg (SImode, operands[1]);
4530 operands[1] = make_safe_from (operands[1], operands[0]);
4531 operands[2] = force_reg (SImode, operands[2]);
4532 operands[2] = make_safe_from (operands[2], operands[0]);
4534 emit_move_insn (operands[0], const0_rtx);
4535 emit_insn (gen_cmpsi (operands[2], operands[1]));
4536 emit_jump_insn (gen_bgtu (label3));
4537 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4538 emit_jump_insn (gen_blt (label2));
4539 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4540 emit_jump_insn (gen_beq (label1));
4541 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4542 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4545 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4547 insn = emit_move_insn (operands[0],
4548 gen_lowpart (SImode, operands[3]));
4550 gen_rtx_EXPR_LIST (REG_EQUAL,
4551 udiv_equal, REG_NOTES (insn));
4553 emit_label (label1);
4554 emit_move_insn (operands[0], operands[1]);
4556 emit_label (label2);
4557 emit_move_insn (operands[0], const1_rtx);
4558 emit_label (label3);
4560 emit_move_insn (operands[0], operands[0]);
4564 (define_expand "umodsi3"
4565 [(set (match_operand:SI 0 "register_operand" "=d")
4566 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
4567 (match_operand:SI 2 "nonimmediate_operand" "")))
4568 (clobber (match_dup 3))]
4569 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4571 rtx insn, udiv_equal, umod_equal, equal;
4573 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4574 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4575 equal = gen_rtx_IOR (DImode,
4576 gen_rtx_ZERO_EXTEND (DImode, udiv_equal),
4577 gen_rtx_ASHIFT (DImode,
4578 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4581 operands[3] = gen_reg_rtx (DImode);
4583 if (CONSTANT_P (operands[2]))
4585 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
4587 rtx label1 = gen_label_rtx ();
4589 operands[1] = make_safe_from (operands[1], operands[0]);
4590 emit_move_insn (operands[0], operands[1]);
4591 emit_insn (gen_cmpsi (operands[0], operands[2]));
4592 emit_jump_insn (gen_bltu (label1));
4593 emit_insn (gen_abssi2 (operands[0], operands[2]));
4594 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
4595 emit_label (label1);
4599 operands[2] = force_reg (SImode, operands[2]);
4600 operands[2] = make_safe_from (operands[2], operands[0]);
4602 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4603 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4606 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4608 insn = emit_move_insn (operands[0],
4609 gen_highpart (SImode, operands[3]));
4611 gen_rtx_EXPR_LIST (REG_EQUAL,
4612 umod_equal, REG_NOTES (insn));
4617 rtx label1 = gen_label_rtx ();
4618 rtx label2 = gen_label_rtx ();
4619 rtx label3 = gen_label_rtx ();
4621 operands[1] = force_reg (SImode, operands[1]);
4622 operands[1] = make_safe_from (operands[1], operands[0]);
4623 operands[2] = force_reg (SImode, operands[2]);
4624 operands[2] = make_safe_from (operands[2], operands[0]);
4626 emit_move_insn(operands[0], operands[1]);
4627 emit_insn (gen_cmpsi (operands[2], operands[1]));
4628 emit_jump_insn (gen_bgtu (label3));
4629 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4630 emit_jump_insn (gen_blt (label2));
4631 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4632 emit_jump_insn (gen_beq (label1));
4633 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4634 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4637 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4639 insn = emit_move_insn (operands[0],
4640 gen_highpart (SImode, operands[3]));
4642 gen_rtx_EXPR_LIST (REG_EQUAL,
4643 umod_equal, REG_NOTES (insn));
4645 emit_label (label1);
4646 emit_move_insn (operands[0], const0_rtx);
4648 emit_label (label2);
4649 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
4650 emit_label (label3);
4656 ; divdf3 instruction pattern(s).
4659 (define_expand "divdf3"
4661 [(set (match_operand:DF 0 "register_operand" "=f,f")
4662 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4663 (match_operand:DF 2 "general_operand" "f,R")))
4664 (clobber (reg:CC 33))])]
4668 (define_insn "*divdf3"
4669 [(set (match_operand:DF 0 "register_operand" "=f,f")
4670 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4671 (match_operand:DF 2 "general_operand" "f,R")))
4672 (clobber (reg:CC 33))]
4673 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4677 [(set_attr "op_type" "RRE,RXE")
4678 (set_attr "type" "fdivd")])
4680 (define_insn "*divdf3_ibm"
4681 [(set (match_operand:DF 0 "register_operand" "=f,f")
4682 (div:DF (match_operand:DF 1 "register_operand" "0,0")
4683 (match_operand:DF 2 "general_operand" "f,R")))
4684 (clobber (reg:CC 33))]
4685 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4689 [(set_attr "op_type" "RR,RX")
4690 (set_attr "type" "fdivd")])
4693 ; divsf3 instruction pattern(s).
4696 (define_expand "divsf3"
4698 [(set (match_operand:SF 0 "register_operand" "=f,f")
4699 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4700 (match_operand:SF 2 "general_operand" "f,R")))
4701 (clobber (reg:CC 33))])]
4705 (define_insn "*divsf3"
4706 [(set (match_operand:SF 0 "register_operand" "=f,f")
4707 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4708 (match_operand:SF 2 "general_operand" "f,R")))
4709 (clobber (reg:CC 33))]
4710 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4714 [(set_attr "op_type" "RRE,RXE")
4715 (set_attr "type" "fdivs")])
4717 (define_insn "*divsf3"
4718 [(set (match_operand:SF 0 "register_operand" "=f,f")
4719 (div:SF (match_operand:SF 1 "register_operand" "0,0")
4720 (match_operand:SF 2 "general_operand" "f,R")))
4721 (clobber (reg:CC 33))]
4722 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4726 [(set_attr "op_type" "RR,RX")
4727 (set_attr "type" "fdivs")])
4731 ;;- And instructions.
4735 ; anddi3 instruction pattern(s).
4738 (define_insn "*anddi3_cc"
4740 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4741 (match_operand:DI 2 "general_operand" "d,m"))
4743 (set (match_operand:DI 0 "register_operand" "=d,d")
4744 (and:DI (match_dup 1) (match_dup 2)))]
4745 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4749 [(set_attr "op_type" "RRE,RXY")])
4751 (define_insn "*anddi3_cconly"
4753 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4754 (match_operand:DI 2 "general_operand" "d,m"))
4756 (clobber (match_scratch:DI 0 "=d,d"))]
4757 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
4761 [(set_attr "op_type" "RRE,RXY")])
4763 (define_insn "*anddi3_ni"
4764 [(set (match_operand:DI 0 "register_operand" "=d")
4765 (and:DI (match_operand:DI 1 "nonimmediate_operand" "0")
4766 (match_operand:DI 2 "immediate_operand" "n")))
4767 (clobber (reg:CC 33))]
4768 "TARGET_64BIT && s390_single_hi (operands[2], DImode, -1) >= 0"
4770 int part = s390_single_hi (operands[2], DImode, -1);
4771 operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
4775 case 0: return "nihh\t%0,%x2";
4776 case 1: return "nihl\t%0,%x2";
4777 case 2: return "nilh\t%0,%x2";
4778 case 3: return "nill\t%0,%x2";
4782 [(set_attr "op_type" "RI")])
4784 (define_insn "anddi3"
4785 [(set (match_operand:DI 0 "register_operand" "=d,d")
4786 (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4787 (match_operand:DI 2 "general_operand" "d,m")))
4788 (clobber (reg:CC 33))]
4793 [(set_attr "op_type" "RRE,RXY")])
4795 (define_insn "*anddi3_ss"
4796 [(set (match_operand:DI 0 "s_operand" "=Q")
4797 (and:DI (match_dup 0)
4798 (match_operand:DI 1 "s_imm_operand" "Q")))
4799 (clobber (reg:CC 33))]
4802 [(set_attr "op_type" "SS")])
4804 (define_insn "*anddi3_ss_inv"
4805 [(set (match_operand:DI 0 "s_operand" "=Q")
4806 (and:DI (match_operand:DI 1 "s_imm_operand" "Q")
4808 (clobber (reg:CC 33))]
4811 [(set_attr "op_type" "SS")])
4814 ; andsi3 instruction pattern(s).
4817 (define_insn "*andsi3_cc"
4819 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4820 (match_operand:SI 2 "general_operand" "d,R,T"))
4822 (set (match_operand:SI 0 "register_operand" "=d,d,d")
4823 (and:SI (match_dup 1) (match_dup 2)))]
4824 "s390_match_ccmode(insn, CCTmode)"
4829 [(set_attr "op_type" "RR,RX,RXY")])
4831 (define_insn "*andsi3_cconly"
4833 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4834 (match_operand:SI 2 "general_operand" "d,R,T"))
4836 (clobber (match_scratch:SI 0 "=d,d,d"))]
4837 "s390_match_ccmode(insn, CCTmode)"
4842 [(set_attr "op_type" "RR,RX,RXY")])
4844 (define_insn "*andsi3_ni"
4845 [(set (match_operand:SI 0 "register_operand" "=d")
4846 (and:SI (match_operand:SI 1 "nonimmediate_operand" "0")
4847 (match_operand:SI 2 "immediate_operand" "n")))
4848 (clobber (reg:CC 33))]
4849 "TARGET_ZARCH && s390_single_hi (operands[2], SImode, -1) >= 0"
4851 int part = s390_single_hi (operands[2], SImode, -1);
4852 operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
4856 case 0: return "nilh\t%0,%x2";
4857 case 1: return "nill\t%0,%x2";
4861 [(set_attr "op_type" "RI")])
4863 (define_insn "andsi3"
4864 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4865 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
4866 (match_operand:SI 2 "general_operand" "d,R,T")))
4867 (clobber (reg:CC 33))]
4873 [(set_attr "op_type" "RR,RX,RXY")])
4875 (define_insn "*andsi3_ss"
4876 [(set (match_operand:SI 0 "s_operand" "=Q")
4877 (and:SI (match_dup 0)
4878 (match_operand:SI 1 "s_imm_operand" "Q")))
4879 (clobber (reg:CC 33))]
4882 [(set_attr "op_type" "SS")])
4884 (define_insn "*andsi3_ss_inv"
4885 [(set (match_operand:SI 0 "s_operand" "=Q")
4886 (and:SI (match_operand:SI 1 "s_imm_operand" "Q")
4888 (clobber (reg:CC 33))]
4891 [(set_attr "op_type" "SS")])
4894 ; andhi3 instruction pattern(s).
4897 (define_insn "*andhi3_ni"
4898 [(set (match_operand:HI 0 "register_operand" "=d,d")
4899 (and:HI (match_operand:HI 1 "register_operand" "%0,0")
4900 (match_operand:HI 2 "nonmemory_operand" "d,n")))
4901 (clobber (reg:CC 33))]
4906 [(set_attr "op_type" "RR,RI")])
4908 (define_insn "andhi3"
4909 [(set (match_operand:HI 0 "register_operand" "=d")
4910 (and:HI (match_operand:HI 1 "register_operand" "%0")
4911 (match_operand:HI 2 "nonmemory_operand" "d")))
4912 (clobber (reg:CC 33))]
4915 [(set_attr "op_type" "RR")])
4917 (define_insn "*andhi3_ss"
4918 [(set (match_operand:HI 0 "s_operand" "=Q")
4919 (and:HI (match_dup 0)
4920 (match_operand:HI 1 "s_imm_operand" "Q")))
4921 (clobber (reg:CC 33))]
4924 [(set_attr "op_type" "SS")])
4926 (define_insn "*andhi3_ss_inv"
4927 [(set (match_operand:HI 0 "s_operand" "=Q")
4928 (and:HI (match_operand:HI 1 "s_imm_operand" "Q")
4930 (clobber (reg:CC 33))]
4933 [(set_attr "op_type" "SS")])
4936 ; andqi3 instruction pattern(s).
4939 (define_insn "*andqi3_ni"
4940 [(set (match_operand:QI 0 "register_operand" "=d,d")
4941 (and:QI (match_operand:QI 1 "register_operand" "%0,0")
4942 (match_operand:QI 2 "nonmemory_operand" "d,n")))
4943 (clobber (reg:CC 33))]
4948 [(set_attr "op_type" "RR,RI")])
4950 (define_insn "andqi3"
4951 [(set (match_operand:QI 0 "register_operand" "=d")
4952 (and:QI (match_operand:QI 1 "register_operand" "%0")
4953 (match_operand:QI 2 "nonmemory_operand" "d")))
4954 (clobber (reg:CC 33))]
4957 [(set_attr "op_type" "RR")])
4959 (define_insn "*andqi3_ss"
4960 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
4961 (and:QI (match_dup 0)
4962 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
4963 (clobber (reg:CC 33))]
4969 [(set_attr "op_type" "SI,SIY,SS")])
4971 (define_insn "*andqi3_ss_inv"
4972 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
4973 (and:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
4975 (clobber (reg:CC 33))]
4981 [(set_attr "op_type" "SI,SIY,SS")])
4985 ;;- Bit set (inclusive or) instructions.
4989 ; iordi3 instruction pattern(s).
4992 (define_insn "*iordi3_cc"
4994 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4995 (match_operand:DI 2 "general_operand" "d,m"))
4997 (set (match_operand:DI 0 "register_operand" "=d,d")
4998 (ior:DI (match_dup 1) (match_dup 2)))]
4999 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5003 [(set_attr "op_type" "RRE,RXY")])
5005 (define_insn "*iordi3_cconly"
5007 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5008 (match_operand:DI 2 "general_operand" "d,m"))
5010 (clobber (match_scratch:DI 0 "=d,d"))]
5011 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5015 [(set_attr "op_type" "RRE,RXY")])
5017 (define_insn "*iordi3_oi"
5018 [(set (match_operand:DI 0 "register_operand" "=d")
5019 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0")
5020 (match_operand:DI 2 "immediate_operand" "n")))
5021 (clobber (reg:CC 33))]
5022 "TARGET_64BIT && s390_single_hi (operands[2], DImode, 0) >= 0"
5024 int part = s390_single_hi (operands[2], DImode, 0);
5025 operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
5029 case 0: return "oihh\t%0,%x2";
5030 case 1: return "oihl\t%0,%x2";
5031 case 2: return "oilh\t%0,%x2";
5032 case 3: return "oill\t%0,%x2";
5036 [(set_attr "op_type" "RI")])
5038 (define_insn "iordi3"
5039 [(set (match_operand:DI 0 "register_operand" "=d,d")
5040 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5041 (match_operand:DI 2 "general_operand" "d,m")))
5042 (clobber (reg:CC 33))]
5047 [(set_attr "op_type" "RRE,RXY")])
5049 (define_insn "*iordi3_ss"
5050 [(set (match_operand:DI 0 "s_operand" "=Q")
5051 (ior:DI (match_dup 0)
5052 (match_operand:DI 1 "s_imm_operand" "Q")))
5053 (clobber (reg:CC 33))]
5056 [(set_attr "op_type" "SS")])
5058 (define_insn "*iordi3_ss_inv"
5059 [(set (match_operand:DI 0 "s_operand" "=Q")
5060 (ior:DI (match_operand:DI 1 "s_imm_operand" "Q")
5062 (clobber (reg:CC 33))]
5065 [(set_attr "op_type" "SS")])
5068 ; iorsi3 instruction pattern(s).
5071 (define_insn "*iorsi3_cc"
5073 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5074 (match_operand:SI 2 "general_operand" "d,R,T"))
5076 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5077 (ior:SI (match_dup 1) (match_dup 2)))]
5078 "s390_match_ccmode(insn, CCTmode)"
5083 [(set_attr "op_type" "RR,RX,RXY")])
5085 (define_insn "*iorsi3_cconly"
5087 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5088 (match_operand:SI 2 "general_operand" "d,R,T"))
5090 (clobber (match_scratch:SI 0 "=d,d,d"))]
5091 "s390_match_ccmode(insn, CCTmode)"
5096 [(set_attr "op_type" "RR,RX,RXY")])
5098 (define_insn "*iorsi3_oi"
5099 [(set (match_operand:SI 0 "register_operand" "=d")
5100 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0")
5101 (match_operand:SI 2 "immediate_operand" "n")))
5102 (clobber (reg:CC 33))]
5103 "TARGET_ZARCH && s390_single_hi (operands[2], SImode, 0) >= 0"
5105 int part = s390_single_hi (operands[2], SImode, 0);
5106 operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
5110 case 0: return "oilh\t%0,%x2";
5111 case 1: return "oill\t%0,%x2";
5115 [(set_attr "op_type" "RI")])
5117 (define_insn "iorsi3"
5118 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5119 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5120 (match_operand:SI 2 "general_operand" "d,R,T")))
5121 (clobber (reg:CC 33))]
5127 [(set_attr "op_type" "RR,RX,RXY")])
5129 (define_insn "*iorsi3_ss"
5130 [(set (match_operand:SI 0 "s_operand" "=Q")
5131 (ior:SI (match_dup 0)
5132 (match_operand:SI 1 "s_imm_operand" "Q")))
5133 (clobber (reg:CC 33))]
5136 [(set_attr "op_type" "SS")])
5138 (define_insn "*iorsi3_ss_inv"
5139 [(set (match_operand:SI 0 "s_operand" "=Q")
5140 (ior:SI (match_operand:SI 1 "s_imm_operand" "Q")
5142 (clobber (reg:CC 33))]
5145 [(set_attr "op_type" "SS")])
5148 ; iorhi3 instruction pattern(s).
5151 (define_insn "*iorhi3_oi"
5152 [(set (match_operand:HI 0 "register_operand" "=d,d")
5153 (ior:HI (match_operand:HI 1 "register_operand" "%0,0")
5154 (match_operand:HI 2 "nonmemory_operand" "d,n")))
5155 (clobber (reg:CC 33))]
5160 [(set_attr "op_type" "RR,RI")])
5162 (define_insn "iorhi3"
5163 [(set (match_operand:HI 0 "register_operand" "=d")
5164 (ior:HI (match_operand:HI 1 "register_operand" "%0")
5165 (match_operand:HI 2 "nonmemory_operand" "d")))
5166 (clobber (reg:CC 33))]
5169 [(set_attr "op_type" "RR")])
5171 (define_insn "*iorhi3_ss"
5172 [(set (match_operand:HI 0 "s_operand" "=Q")
5173 (ior:HI (match_dup 0)
5174 (match_operand:HI 1 "s_imm_operand" "Q")))
5175 (clobber (reg:CC 33))]
5178 [(set_attr "op_type" "SS")])
5180 (define_insn "*iorhi3_ss_inv"
5181 [(set (match_operand:HI 0 "s_operand" "=Q")
5182 (ior:HI (match_operand:HI 1 "s_imm_operand" "Q")
5184 (clobber (reg:CC 33))]
5187 [(set_attr "op_type" "SS")])
5190 ; iorqi3 instruction pattern(s).
5193 (define_insn "*iorqi3_oi"
5194 [(set (match_operand:QI 0 "register_operand" "=d,d")
5195 (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
5196 (match_operand:QI 2 "nonmemory_operand" "d,n")))
5197 (clobber (reg:CC 33))]
5202 [(set_attr "op_type" "RR,RI")])
5204 (define_insn "iorqi3"
5205 [(set (match_operand:QI 0 "register_operand" "=d")
5206 (ior:QI (match_operand:QI 1 "register_operand" "%0")
5207 (match_operand:QI 2 "nonmemory_operand" "d")))
5208 (clobber (reg:CC 33))]
5211 [(set_attr "op_type" "RR")])
5213 (define_insn "*iorqi3_ss"
5214 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5215 (ior:QI (match_dup 0)
5216 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5217 (clobber (reg:CC 33))]
5223 [(set_attr "op_type" "SI,SIY,SS")])
5225 (define_insn "*iorqi3_ss_inv"
5226 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5227 (ior:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5229 (clobber (reg:CC 33))]
5235 [(set_attr "op_type" "SI,SIY,SS")])
5239 ;;- Xor instructions.
5243 ; xordi3 instruction pattern(s).
5246 (define_insn "*xordi3_cc"
5248 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5249 (match_operand:DI 2 "general_operand" "d,m"))
5251 (set (match_operand:DI 0 "register_operand" "=d,d")
5252 (xor:DI (match_dup 1) (match_dup 2)))]
5253 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5257 [(set_attr "op_type" "RRE,RXY")])
5259 (define_insn "*xordi3_cconly"
5261 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5262 (match_operand:DI 2 "general_operand" "d,m"))
5264 (clobber (match_scratch:DI 0 "=d,d"))]
5265 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5269 [(set_attr "op_type" "RRE,RXY")])
5271 (define_insn "xordi3"
5272 [(set (match_operand:DI 0 "register_operand" "=d,d")
5273 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5274 (match_operand:DI 2 "general_operand" "d,m")))
5275 (clobber (reg:CC 33))]
5280 [(set_attr "op_type" "RRE,RXY")])
5282 (define_insn "*xordi3_ss"
5283 [(set (match_operand:DI 0 "s_operand" "=Q")
5284 (xor:DI (match_dup 0)
5285 (match_operand:DI 1 "s_imm_operand" "Q")))
5286 (clobber (reg:CC 33))]
5289 [(set_attr "op_type" "SS")])
5291 (define_insn "*xordi3_ss_inv"
5292 [(set (match_operand:DI 0 "s_operand" "=Q")
5293 (xor:DI (match_operand:DI 1 "s_imm_operand" "Q")
5295 (clobber (reg:CC 33))]
5298 [(set_attr "op_type" "SS")])
5301 ; xorsi3 instruction pattern(s).
5304 (define_insn "*xorsi3_cc"
5306 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5307 (match_operand:SI 2 "general_operand" "d,R,T"))
5309 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5310 (xor:SI (match_dup 1) (match_dup 2)))]
5311 "s390_match_ccmode(insn, CCTmode)"
5316 [(set_attr "op_type" "RR,RX,RXY")])
5318 (define_insn "*xorsi3_cconly"
5320 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5321 (match_operand:SI 2 "general_operand" "d,R,T"))
5323 (clobber (match_scratch:SI 0 "=d,d,d"))]
5324 "s390_match_ccmode(insn, CCTmode)"
5329 [(set_attr "op_type" "RR,RX,RXY")])
5331 (define_insn "xorsi3"
5332 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
5333 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5334 (match_operand:SI 2 "general_operand" "d,R,T")))
5335 (clobber (reg:CC 33))]
5341 [(set_attr "op_type" "RR,RX,RXY")])
5343 (define_insn "*xorsi3_ss"
5344 [(set (match_operand:SI 0 "s_operand" "=Q")
5345 (xor:SI (match_dup 0)
5346 (match_operand:SI 1 "s_imm_operand" "Q")))
5347 (clobber (reg:CC 33))]
5350 [(set_attr "op_type" "SS")])
5352 (define_insn "*xorsi3_ss_inv"
5353 [(set (match_operand:SI 0 "s_operand" "=Q")
5354 (xor:SI (match_operand:SI 1 "s_imm_operand" "Q")
5356 (clobber (reg:CC 33))]
5359 [(set_attr "op_type" "SS")])
5362 ; xorhi3 instruction pattern(s).
5365 (define_insn "xorhi3"
5366 [(set (match_operand:HI 0 "register_operand" "=d")
5367 (xor:HI (match_operand:HI 1 "register_operand" "%0")
5368 (match_operand:HI 2 "nonmemory_operand" "d")))
5369 (clobber (reg:CC 33))]
5372 [(set_attr "op_type" "RR")])
5374 (define_insn "*xorhi3_ss"
5375 [(set (match_operand:HI 0 "s_operand" "=Q")
5376 (xor:HI (match_dup 0)
5377 (match_operand:HI 1 "s_imm_operand" "Q")))
5378 (clobber (reg:CC 33))]
5381 [(set_attr "op_type" "SS")])
5383 (define_insn "*xorhi3_ss_inv"
5384 [(set (match_operand:HI 0 "s_operand" "=Q")
5385 (xor:HI (match_operand:HI 1 "s_imm_operand" "Q")
5387 (clobber (reg:CC 33))]
5390 [(set_attr "op_type" "SS")])
5393 ; xorqi3 instruction pattern(s).
5396 (define_insn "xorqi3"
5397 [(set (match_operand:QI 0 "register_operand" "=d")
5398 (xor:QI (match_operand:QI 1 "register_operand" "%0")
5399 (match_operand:QI 2 "nonmemory_operand" "d")))
5400 (clobber (reg:CC 33))]
5403 [(set_attr "op_type" "RR")])
5405 (define_insn "*xorqi3_ss"
5406 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5407 (xor:QI (match_dup 0)
5408 (match_operand:QI 1 "s_imm_operand" "n,n,Q")))
5409 (clobber (reg:CC 33))]
5415 [(set_attr "op_type" "SI,SIY,SS")])
5417 (define_insn "*xorqi3_ss_inv"
5418 [(set (match_operand:QI 0 "s_operand" "=Q,S,Q")
5419 (xor:QI (match_operand:QI 1 "s_imm_operand" "n,n,Q")
5421 (clobber (reg:CC 33))]
5427 [(set_attr "op_type" "SI,SIY,SS")])
5431 ;;- Negate instructions.
5435 ; negdi2 instruction pattern(s).
5438 (define_expand "negdi2"
5440 [(set (match_operand:DI 0 "register_operand" "=d")
5441 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5442 (clobber (reg:CC 33))])]
5446 (define_insn "*negdi2_64"
5447 [(set (match_operand:DI 0 "register_operand" "=d")
5448 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5449 (clobber (reg:CC 33))]
5452 [(set_attr "op_type" "RR")])
5454 (define_insn "*negdi2_31"
5455 [(set (match_operand:DI 0 "register_operand" "=d")
5456 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5457 (clobber (reg:CC 33))]
5461 xop[0] = gen_label_rtx ();
5462 output_asm_insn ("lcr\t%0,%1", operands);
5463 output_asm_insn ("lcr\t%N0,%N1", operands);
5464 output_asm_insn ("je\t%l0", xop);
5465 output_asm_insn ("bctr\t%0,0", operands);
5466 targetm.asm_out.internal_label (asm_out_file, "L",
5467 CODE_LABEL_NUMBER (xop[0]));
5470 [(set_attr "op_type" "NN")
5471 (set_attr "type" "other")
5472 (set_attr "length" "10")])
5475 ; negsi2 instruction pattern(s).
5478 (define_insn "negsi2"
5479 [(set (match_operand:SI 0 "register_operand" "=d")
5480 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5481 (clobber (reg:CC 33))]
5484 [(set_attr "op_type" "RR")])
5487 ; negdf2 instruction pattern(s).
5490 (define_expand "negdf2"
5492 [(set (match_operand:DF 0 "register_operand" "=f")
5493 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5494 (clobber (reg:CC 33))])]
5498 (define_insn "*negdf2"
5499 [(set (match_operand:DF 0 "register_operand" "=f")
5500 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5501 (clobber (reg:CC 33))]
5502 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5504 [(set_attr "op_type" "RRE")
5505 (set_attr "type" "fsimpd")])
5507 (define_insn "*negdf2_ibm"
5508 [(set (match_operand:DF 0 "register_operand" "=f")
5509 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5510 (clobber (reg:CC 33))]
5511 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5513 [(set_attr "op_type" "RR")
5514 (set_attr "type" "fsimpd")])
5517 ; negsf2 instruction pattern(s).
5520 (define_expand "negsf2"
5522 [(set (match_operand:SF 0 "register_operand" "=f")
5523 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5524 (clobber (reg:CC 33))])]
5528 (define_insn "*negsf2"
5529 [(set (match_operand:SF 0 "register_operand" "=f")
5530 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5531 (clobber (reg:CC 33))]
5532 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5534 [(set_attr "op_type" "RRE")
5535 (set_attr "type" "fsimps")])
5537 (define_insn "*negsf2"
5538 [(set (match_operand:SF 0 "register_operand" "=f")
5539 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5540 (clobber (reg:CC 33))]
5541 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5543 [(set_attr "op_type" "RR")
5544 (set_attr "type" "fsimps")])
5548 ;;- Absolute value instructions.
5552 ; absdi2 instruction pattern(s).
5555 (define_insn "absdi2"
5556 [(set (match_operand:DI 0 "register_operand" "=d")
5557 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5558 (clobber (reg:CC 33))]
5561 [(set_attr "op_type" "RRE")])
5564 ; abssi2 instruction pattern(s).
5567 (define_insn "abssi2"
5568 [(set (match_operand:SI 0 "register_operand" "=d")
5569 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5570 (clobber (reg:CC 33))]
5573 [(set_attr "op_type" "RR")])
5576 ; absdf2 instruction pattern(s).
5579 (define_expand "absdf2"
5581 [(set (match_operand:DF 0 "register_operand" "=f")
5582 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5583 (clobber (reg:CC 33))])]
5587 (define_insn "*absdf2"
5588 [(set (match_operand:DF 0 "register_operand" "=f")
5589 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5590 (clobber (reg:CC 33))]
5591 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5593 [(set_attr "op_type" "RRE")
5594 (set_attr "type" "fsimpd")])
5596 (define_insn "*absdf2_ibm"
5597 [(set (match_operand:DF 0 "register_operand" "=f")
5598 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5599 (clobber (reg:CC 33))]
5600 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5602 [(set_attr "op_type" "RR")
5603 (set_attr "type" "fsimpd")])
5606 ; abssf2 instruction pattern(s).
5609 (define_expand "abssf2"
5611 [(set (match_operand:SF 0 "register_operand" "=f")
5612 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5613 (clobber (reg:CC 33))])]
5617 (define_insn "*abssf2"
5618 [(set (match_operand:SF 0 "register_operand" "=f")
5619 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5620 (clobber (reg:CC 33))]
5621 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5623 [(set_attr "op_type" "RRE")
5624 (set_attr "type" "fsimps")])
5626 (define_insn "*abssf2_ibm"
5627 [(set (match_operand:SF 0 "register_operand" "=f")
5628 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5629 (clobber (reg:CC 33))]
5630 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5632 [(set_attr "op_type" "RR")
5633 (set_attr "type" "fsimps")])
5636 ;;- Negated absolute value instructions
5643 (define_insn "*negabssi2"
5644 [(set (match_operand:SI 0 "register_operand" "=d")
5645 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
5646 (clobber (reg:CC 33))]
5649 [(set_attr "op_type" "RR")])
5651 (define_insn "*negabsdi2"
5652 [(set (match_operand:DI 0 "register_operand" "=d")
5653 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
5654 (clobber (reg:CC 33))]
5657 [(set_attr "op_type" "RRE")])
5663 (define_insn "*negabssf2"
5664 [(set (match_operand:SF 0 "register_operand" "=f")
5665 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
5666 (clobber (reg:CC 33))]
5667 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5669 [(set_attr "op_type" "RRE")
5670 (set_attr "type" "fsimps")])
5672 (define_insn "*negabsdf2"
5673 [(set (match_operand:DF 0 "register_operand" "=f")
5674 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
5675 (clobber (reg:CC 33))]
5676 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5678 [(set_attr "op_type" "RRE")
5679 (set_attr "type" "fsimpd")])
5682 ;;- Square root instructions.
5686 ; sqrtdf2 instruction pattern(s).
5689 (define_insn "sqrtdf2"
5690 [(set (match_operand:DF 0 "register_operand" "=f,f")
5691 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
5692 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5696 [(set_attr "op_type" "RRE,RXE")])
5699 ; sqrtsf2 instruction pattern(s).
5702 (define_insn "sqrtsf2"
5703 [(set (match_operand:SF 0 "register_operand" "=f,f")
5704 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
5705 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5709 [(set_attr "op_type" "RRE,RXE")])
5712 ;;- One complement instructions.
5716 ; one_cmpldi2 instruction pattern(s).
5719 (define_expand "one_cmpldi2"
5721 [(set (match_operand:DI 0 "register_operand" "")
5722 (xor:DI (match_operand:DI 1 "register_operand" "")
5724 (clobber (reg:CC 33))])]
5729 ; one_cmplsi2 instruction pattern(s).
5732 (define_expand "one_cmplsi2"
5734 [(set (match_operand:SI 0 "register_operand" "")
5735 (xor:SI (match_operand:SI 1 "register_operand" "")
5737 (clobber (reg:CC 33))])]
5742 ; one_cmplhi2 instruction pattern(s).
5745 (define_expand "one_cmplhi2"
5747 [(set (match_operand:HI 0 "register_operand" "")
5748 (xor:HI (match_operand:HI 1 "register_operand" "")
5750 (clobber (reg:CC 33))])]
5755 ; one_cmplqi2 instruction pattern(s).
5758 (define_expand "one_cmplqi2"
5760 [(set (match_operand:QI 0 "register_operand" "")
5761 (xor:QI (match_operand:QI 1 "register_operand" "")
5763 (clobber (reg:CC 33))])]
5769 ;;- Rotate instructions.
5773 ; rotldi3 instruction pattern(s).
5776 (define_insn "rotldi3"
5777 [(set (match_operand:DI 0 "register_operand" "=d,d")
5778 (rotate:DI (match_operand:DI 1 "register_operand" "d,d")
5779 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5784 [(set_attr "op_type" "RSE")
5785 (set_attr "atype" "reg")])
5788 ; rotlsi3 instruction pattern(s).
5791 (define_insn "rotlsi3"
5792 [(set (match_operand:SI 0 "register_operand" "=d,d")
5793 (rotate:SI (match_operand:SI 1 "register_operand" "d,d")
5794 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5799 [(set_attr "op_type" "RSE")
5800 (set_attr "atype" "reg")])
5804 ;;- Arithmetic shift instructions.
5808 ; ashldi3 instruction pattern(s).
5811 (define_expand "ashldi3"
5812 [(set (match_operand:DI 0 "register_operand" "")
5813 (ashift:DI (match_operand:DI 1 "register_operand" "")
5814 (match_operand:SI 2 "nonmemory_operand" "")))]
5818 (define_insn "*ashldi3_31"
5819 [(set (match_operand:DI 0 "register_operand" "=d,d")
5820 (ashift:DI (match_operand:DI 1 "register_operand" "0,0")
5821 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5826 [(set_attr "op_type" "RS")
5827 (set_attr "atype" "reg")])
5829 (define_insn "*ashldi3_64"
5830 [(set (match_operand:DI 0 "register_operand" "=d,d")
5831 (ashift:DI (match_operand:DI 1 "register_operand" "d,d")
5832 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5837 [(set_attr "op_type" "RSE")
5838 (set_attr "atype" "reg")])
5841 ; ashrdi3 instruction pattern(s).
5844 (define_expand "ashrdi3"
5846 [(set (match_operand:DI 0 "register_operand" "")
5847 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
5848 (match_operand:SI 2 "nonmemory_operand" "")))
5849 (clobber (reg:CC 33))])]
5853 (define_insn "*ashrdi3_cc_31"
5855 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5856 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5858 (set (match_operand:DI 0 "register_operand" "=d,d")
5859 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
5860 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
5864 [(set_attr "op_type" "RS")
5865 (set_attr "atype" "reg")])
5867 (define_insn "*ashrdi3_cconly_31"
5869 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5870 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5872 (clobber (match_scratch:DI 0 "=d,d"))]
5873 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
5877 [(set_attr "op_type" "RS")
5878 (set_attr "atype" "reg")])
5880 (define_insn "*ashrdi3_31"
5881 [(set (match_operand:DI 0 "register_operand" "=d,d")
5882 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
5883 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5884 (clobber (reg:CC 33))]
5889 [(set_attr "op_type" "RS")
5890 (set_attr "atype" "reg")])
5892 (define_insn "*ashrdi3_cc_64"
5894 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5895 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5897 (set (match_operand:DI 0 "register_operand" "=d,d")
5898 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
5899 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
5903 [(set_attr "op_type" "RSE")
5904 (set_attr "atype" "reg")])
5906 (define_insn "*ashrdi3_cconly_64"
5908 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5909 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5911 (clobber (match_scratch:DI 0 "=d,d"))]
5912 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
5916 [(set_attr "op_type" "RSE")
5917 (set_attr "atype" "reg")])
5919 (define_insn "*ashrdi3_64"
5920 [(set (match_operand:DI 0 "register_operand" "=d,d")
5921 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
5922 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5923 (clobber (reg:CC 33))]
5928 [(set_attr "op_type" "RSE")
5929 (set_attr "atype" "reg")])
5933 ; ashlsi3 instruction pattern(s).
5936 (define_insn "ashlsi3"
5937 [(set (match_operand:SI 0 "register_operand" "=d,d")
5938 (ashift:SI (match_operand:SI 1 "register_operand" "0,0")
5939 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
5944 [(set_attr "op_type" "RS")
5945 (set_attr "atype" "reg")])
5948 ; ashrsi3 instruction pattern(s).
5951 (define_insn "*ashrsi3_cc"
5953 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5954 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5956 (set (match_operand:SI 0 "register_operand" "=d,d")
5957 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
5958 "s390_match_ccmode(insn, CCSmode)"
5962 [(set_attr "op_type" "RS")
5963 (set_attr "atype" "reg")])
5966 (define_insn "*ashrsi3_cconly"
5968 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5969 (match_operand:SI 2 "nonmemory_operand" "J,a"))
5971 (clobber (match_scratch:SI 0 "=d,d"))]
5972 "s390_match_ccmode(insn, CCSmode)"
5976 [(set_attr "op_type" "RS")
5977 (set_attr "atype" "reg")])
5979 (define_insn "ashrsi3"
5980 [(set (match_operand:SI 0 "register_operand" "=d,d")
5981 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
5982 (match_operand:SI 2 "nonmemory_operand" "J,a")))
5983 (clobber (reg:CC 33))]
5988 [(set_attr "op_type" "RS")
5989 (set_attr "atype" "reg")])
5993 ;;- logical shift instructions.
5997 ; lshrdi3 instruction pattern(s).
6000 (define_expand "lshrdi3"
6001 [(set (match_operand:DI 0 "register_operand" "")
6002 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6003 (match_operand:SI 2 "nonmemory_operand" "")))]
6007 (define_insn "*lshrdi3_31"
6008 [(set (match_operand:DI 0 "register_operand" "=d,d")
6009 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0,0")
6010 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
6015 [(set_attr "op_type" "RS,RS")
6016 (set_attr "atype" "reg")])
6018 (define_insn "*lshrdi3_64"
6019 [(set (match_operand:DI 0 "register_operand" "=d,d")
6020 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
6021 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
6026 [(set_attr "op_type" "RSE,RSE")
6027 (set_attr "atype" "reg")])
6030 ; lshrsi3 instruction pattern(s).
6033 (define_insn "lshrsi3"
6034 [(set (match_operand:SI 0 "register_operand" "=d,d")
6035 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0,0")
6036 (match_operand:SI 2 "nonmemory_operand" "J,a")))]
6041 [(set_attr "op_type" "RS")
6042 (set_attr "atype" "reg")])
6046 ;; Branch instruction patterns.
6049 (define_expand "beq"
6050 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
6052 (if_then_else (eq (reg:CCZ 33) (const_int 0))
6053 (label_ref (match_operand 0 "" ""))
6056 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6058 (define_expand "bne"
6059 [(set (reg:CCZ 33) (compare:CCZ (match_dup 1) (match_dup 2)))
6061 (if_then_else (ne (reg:CCZ 33) (const_int 0))
6062 (label_ref (match_operand 0 "" ""))
6065 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6067 (define_expand "bgt"
6068 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6070 (if_then_else (gt (reg:CCS 33) (const_int 0))
6071 (label_ref (match_operand 0 "" ""))
6074 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6076 (define_expand "bgtu"
6077 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6079 (if_then_else (gtu (reg:CCU 33) (const_int 0))
6080 (label_ref (match_operand 0 "" ""))
6083 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6085 (define_expand "blt"
6086 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6088 (if_then_else (lt (reg:CCS 33) (const_int 0))
6089 (label_ref (match_operand 0 "" ""))
6092 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6094 (define_expand "bltu"
6095 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6097 (if_then_else (ltu (reg:CCU 33) (const_int 0))
6098 (label_ref (match_operand 0 "" ""))
6101 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6103 (define_expand "bge"
6104 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6106 (if_then_else (ge (reg:CCS 33) (const_int 0))
6107 (label_ref (match_operand 0 "" ""))
6110 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6112 (define_expand "bgeu"
6113 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6115 (if_then_else (geu (reg:CCU 33) (const_int 0))
6116 (label_ref (match_operand 0 "" ""))
6119 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6121 (define_expand "ble"
6122 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6124 (if_then_else (le (reg:CCS 33) (const_int 0))
6125 (label_ref (match_operand 0 "" ""))
6128 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6130 (define_expand "bleu"
6131 [(set (reg:CCU 33) (compare:CCU (match_dup 1) (match_dup 2)))
6133 (if_then_else (leu (reg:CCU 33) (const_int 0))
6134 (label_ref (match_operand 0 "" ""))
6137 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6139 (define_expand "bunordered"
6140 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6142 (if_then_else (unordered (reg:CCS 33) (const_int 0))
6143 (label_ref (match_operand 0 "" ""))
6146 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6148 (define_expand "bordered"
6149 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6151 (if_then_else (ordered (reg:CCS 33) (const_int 0))
6152 (label_ref (match_operand 0 "" ""))
6155 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6157 (define_expand "buneq"
6158 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6160 (if_then_else (uneq (reg:CCS 33) (const_int 0))
6161 (label_ref (match_operand 0 "" ""))
6164 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6166 (define_expand "bungt"
6167 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6169 (if_then_else (ungt (reg:CCS 33) (const_int 0))
6170 (label_ref (match_operand 0 "" ""))
6173 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6175 (define_expand "bunlt"
6176 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6178 (if_then_else (unlt (reg:CCS 33) (const_int 0))
6179 (label_ref (match_operand 0 "" ""))
6182 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6184 (define_expand "bunge"
6185 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6187 (if_then_else (unge (reg:CCS 33) (const_int 0))
6188 (label_ref (match_operand 0 "" ""))
6191 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6193 (define_expand "bunle"
6194 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6196 (if_then_else (unle (reg:CCS 33) (const_int 0))
6197 (label_ref (match_operand 0 "" ""))
6200 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6202 (define_expand "bltgt"
6203 [(set (reg:CCS 33) (compare:CCS (match_dup 1) (match_dup 2)))
6205 (if_then_else (ltgt (reg:CCS 33) (const_int 0))
6206 (label_ref (match_operand 0 "" ""))
6209 "operands[1] = s390_compare_op0; operands[2] = s390_compare_op1;")
6213 ;;- Conditional jump instructions.
6216 (define_insn "cjump"
6219 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6220 (label_ref (match_operand 0 "" ""))
6224 if (get_attr_length (insn) == 4)
6226 else if (TARGET_CPU_ZARCH)
6227 return "jg%C1\t%l0";
6231 [(set_attr "op_type" "RI")
6232 (set_attr "type" "branch")
6233 (set (attr "length")
6234 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6236 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6238 (eq (symbol_ref "flag_pic") (const_int 0))
6239 (const_int 6)] (const_int 8)))])
6241 (define_insn "*cjump_long"
6244 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6245 (match_operand 0 "address_operand" "U")
6249 if (get_attr_op_type (insn) == OP_TYPE_RR)
6254 [(set (attr "op_type")
6255 (if_then_else (match_operand 0 "register_operand" "")
6256 (const_string "RR") (const_string "RX")))
6257 (set_attr "type" "branch")
6258 (set_attr "atype" "agen")])
6262 ;;- Negated conditional jump instructions.
6265 (define_insn "icjump"
6268 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6270 (label_ref (match_operand 0 "" ""))))]
6273 if (get_attr_length (insn) == 4)
6275 else if (TARGET_CPU_ZARCH)
6276 return "jg%D1\t%l0";
6280 [(set_attr "op_type" "RI")
6281 (set_attr "type" "branch")
6282 (set (attr "length")
6283 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6285 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6287 (eq (symbol_ref "flag_pic") (const_int 0))
6288 (const_int 6)] (const_int 8)))])
6290 (define_insn "*icjump_long"
6293 (match_operator 1 "comparison_operator" [(reg 33) (const_int 0)])
6295 (match_operand 0 "address_operand" "U")))]
6298 if (get_attr_op_type (insn) == OP_TYPE_RR)
6303 [(set (attr "op_type")
6304 (if_then_else (match_operand 0 "register_operand" "")
6305 (const_string "RR") (const_string "RX")))
6306 (set_attr "type" "branch")
6307 (set_attr "atype" "agen")])
6310 ;;- Trap instructions.
6314 [(trap_if (const_int 1) (const_int 0))]
6317 [(set_attr "op_type" "RX")
6318 (set_attr "type" "branch")])
6320 (define_expand "conditional_trap"
6321 [(set (match_dup 2) (match_dup 3))
6322 (trap_if (match_operator 0 "comparison_operator"
6323 [(match_dup 2) (const_int 0)])
6324 (match_operand:SI 1 "general_operand" ""))]
6327 enum machine_mode ccmode;
6329 if (operands[1] != const0_rtx) FAIL;
6331 ccmode = s390_select_ccmode (GET_CODE (operands[0]),
6332 s390_compare_op0, s390_compare_op1);
6333 operands[2] = gen_rtx_REG (ccmode, 33);
6334 operands[3] = gen_rtx_COMPARE (ccmode, s390_compare_op0, s390_compare_op1);
6337 (define_insn "*trap"
6338 [(trap_if (match_operator 0 "comparison_operator" [(reg 33) (const_int 0)])
6342 [(set_attr "op_type" "RI")
6343 (set_attr "type" "branch")])
6346 ;;- Loop instructions.
6348 ;; This is all complicated by the fact that since this is a jump insn
6349 ;; we must handle our own output reloads.
6351 (define_expand "doloop_end"
6352 [(use (match_operand 0 "" "")) ; loop pseudo
6353 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6354 (use (match_operand 2 "" "")) ; max iterations
6355 (use (match_operand 3 "" "")) ; loop level
6356 (use (match_operand 4 "" ""))] ; label
6359 if (GET_MODE (operands[0]) == SImode)
6360 emit_jump_insn (gen_doloop_si (operands[4], operands[0], operands[0]));
6361 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6362 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6369 (define_insn "doloop_si"
6372 (ne (match_operand:SI 1 "register_operand" "d,d")
6374 (label_ref (match_operand 0 "" ""))
6376 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6377 (plus:SI (match_dup 1) (const_int -1)))
6378 (clobber (match_scratch:SI 3 "=X,&d"))
6379 (clobber (reg:CC 33))]
6382 if (which_alternative != 0)
6384 else if (get_attr_length (insn) == 4)
6385 return "brct\t%1,%l0";
6389 [(set_attr "op_type" "RI")
6390 (set_attr "type" "branch")
6391 (set (attr "length")
6392 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6394 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6396 (eq (symbol_ref "flag_pic") (const_int 0))
6397 (const_int 6)] (const_int 8)))])
6399 (define_insn "*doloop_si_long"
6402 (ne (match_operand:SI 1 "register_operand" "d,d")
6404 (match_operand 0 "address_operand" "U,U")
6406 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6407 (plus:SI (match_dup 1) (const_int -1)))
6408 (clobber (match_scratch:SI 3 "=X,&d"))
6409 (clobber (reg:CC 33))]
6412 if (get_attr_op_type (insn) == OP_TYPE_RR)
6413 return "bctr\t%1,%0";
6415 return "bct\t%1,%a0";
6417 [(set (attr "op_type")
6418 (if_then_else (match_operand 0 "register_operand" "")
6419 (const_string "RR") (const_string "RX")))
6420 (set_attr "type" "branch")
6421 (set_attr "atype" "agen")])
6425 (if_then_else (ne (match_operand:SI 1 "register_operand" "")
6427 (match_operand 0 "" "")
6429 (set (match_operand:SI 2 "nonimmediate_operand" "")
6430 (plus:SI (match_dup 1) (const_int -1)))
6431 (clobber (match_scratch:SI 3 ""))
6432 (clobber (reg:CC 33))]
6434 && (! REG_P (operands[2])
6435 || ! rtx_equal_p (operands[1], operands[2]))"
6436 [(set (match_dup 3) (match_dup 1))
6437 (parallel [(set (reg:CCAN 33)
6438 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6440 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6441 (set (match_dup 2) (match_dup 3))
6442 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6447 (define_insn "doloop_di"
6450 (ne (match_operand:DI 1 "register_operand" "d,d")
6452 (label_ref (match_operand 0 "" ""))
6454 (set (match_operand:DI 2 "register_operand" "=1,?*m*r")
6455 (plus:DI (match_dup 1) (const_int -1)))
6456 (clobber (match_scratch:DI 3 "=X,&d"))
6457 (clobber (reg:CC 33))]
6460 if (which_alternative != 0)
6462 else if (get_attr_length (insn) == 4)
6463 return "brctg\t%1,%l0";
6467 [(set_attr "op_type" "RI")
6468 (set_attr "type" "branch")
6469 (set (attr "length")
6470 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6471 (const_int 4) (const_int 12)))])
6473 (define_insn "*doloop_di_long"
6476 (ne (match_operand:DI 1 "register_operand" "d,d")
6478 (match_operand 0 "address_operand" "U,U")
6480 (set (match_operand:DI 2 "register_operand" "=1,?*m*d")
6481 (plus:DI (match_dup 1) (const_int -1)))
6482 (clobber (match_scratch:DI 3 "=X,&d"))
6483 (clobber (reg:CC 33))]
6486 if (get_attr_op_type (insn) == OP_TYPE_RRE)
6487 return "bctgr\t%1,%0";
6489 return "bctg\t%1,%a0";
6491 [(set (attr "op_type")
6492 (if_then_else (match_operand 0 "register_operand" "")
6493 (const_string "RRE") (const_string "RXE")))
6494 (set_attr "type" "branch")
6495 (set_attr "atype" "agen")])
6499 (if_then_else (ne (match_operand:DI 1 "register_operand" "")
6501 (match_operand 0 "" "")
6503 (set (match_operand:DI 2 "nonimmediate_operand" "")
6504 (plus:DI (match_dup 1) (const_int -1)))
6505 (clobber (match_scratch:DI 3 ""))
6506 (clobber (reg:CC 33))]
6508 && (! REG_P (operands[2])
6509 || ! rtx_equal_p (operands[1], operands[2]))"
6510 [(set (match_dup 3) (match_dup 1))
6511 (parallel [(set (reg:CCAN 33)
6512 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6514 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6515 (set (match_dup 2) (match_dup 3))
6516 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6522 ;;- Unconditional jump instructions.
6526 ; jump instruction pattern(s).
6530 [(set (pc) (label_ref (match_operand 0 "" "")))]
6533 if (get_attr_length (insn) == 4)
6535 else if (TARGET_CPU_ZARCH)
6540 [(set_attr "op_type" "RI")
6541 (set_attr "type" "branch")
6542 (set (attr "length")
6543 (cond [(lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6545 (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
6547 (eq (symbol_ref "flag_pic") (const_int 0))
6548 (const_int 6)] (const_int 8)))])
6551 ; indirect-jump instruction pattern(s).
6554 (define_insn "indirect_jump"
6555 [(set (pc) (match_operand 0 "address_operand" "U"))]
6558 if (get_attr_op_type (insn) == OP_TYPE_RR)
6563 [(set (attr "op_type")
6564 (if_then_else (match_operand 0 "register_operand" "")
6565 (const_string "RR") (const_string "RX")))
6566 (set_attr "type" "branch")
6567 (set_attr "atype" "agen")])
6570 ; casesi instruction pattern(s).
6573 (define_insn "casesi_jump"
6574 [(set (pc) (match_operand 0 "address_operand" "U"))
6575 (use (label_ref (match_operand 1 "" "")))]
6578 if (get_attr_op_type (insn) == OP_TYPE_RR)
6583 [(set (attr "op_type")
6584 (if_then_else (match_operand 0 "register_operand" "")
6585 (const_string "RR") (const_string "RX")))
6586 (set_attr "type" "branch")
6587 (set_attr "atype" "agen")])
6589 (define_expand "casesi"
6590 [(match_operand:SI 0 "general_operand" "")
6591 (match_operand:SI 1 "general_operand" "")
6592 (match_operand:SI 2 "general_operand" "")
6593 (label_ref (match_operand 3 "" ""))
6594 (label_ref (match_operand 4 "" ""))]
6597 rtx index = gen_reg_rtx (SImode);
6598 rtx base = gen_reg_rtx (Pmode);
6599 rtx target = gen_reg_rtx (Pmode);
6601 emit_move_insn (index, operands[0]);
6602 emit_insn (gen_subsi3 (index, index, operands[1]));
6603 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6606 if (Pmode != SImode)
6607 index = convert_to_mode (Pmode, index, 1);
6608 if (GET_CODE (index) != REG)
6609 index = copy_to_mode_reg (Pmode, index);
6612 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6614 emit_insn (gen_ashlsi3 (index, index, GEN_INT (2)));
6616 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6618 index = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, base, index));
6619 emit_move_insn (target, index);
6622 target = gen_rtx_PLUS (Pmode, base, target);
6623 emit_jump_insn (gen_casesi_jump (target, operands[3]));
6630 ;;- Jump to subroutine.
6635 ; untyped call instruction pattern(s).
6638 ;; Call subroutine returning any type.
6639 (define_expand "untyped_call"
6640 [(parallel [(call (match_operand 0 "" "")
6642 (match_operand 1 "" "")
6643 (match_operand 2 "" "")])]
6648 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
6650 for (i = 0; i < XVECLEN (operands[2], 0); i++)
6652 rtx set = XVECEXP (operands[2], 0, i);
6653 emit_move_insn (SET_DEST (set), SET_SRC (set));
6656 /* The optimizer does not know that the call sets the function value
6657 registers we stored in the result block. We avoid problems by
6658 claiming that all hard registers are used and clobbered at this
6660 emit_insn (gen_blockage ());
6665 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
6666 ;; all of memory. This blocks insns from being moved across this point.
6668 (define_insn "blockage"
6669 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
6672 [(set_attr "type" "none")
6673 (set_attr "length" "0")])
6678 ; call instruction pattern(s).
6681 (define_expand "call"
6682 [(call (match_operand 0 "" "")
6683 (match_operand 1 "" ""))
6684 (use (match_operand 2 "" ""))]
6687 bool plt_call = false;
6690 /* Direct function calls need special treatment. */
6691 if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
6693 rtx sym = XEXP (operands[0], 0);
6695 /* When calling a global routine in PIC mode, we must
6696 replace the symbol itself with the PLT stub. */
6697 if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
6699 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6700 sym = gen_rtx_CONST (Pmode, sym);
6704 /* Unless we can use the bras(l) insn, force the
6705 routine address into a register. */
6706 if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
6709 sym = legitimize_pic_address (sym, 0);
6711 sym = force_reg (Pmode, sym);
6714 operands[0] = gen_rtx_MEM (QImode, sym);
6718 insn = emit_call_insn (gen_call_exp (operands[0], operands[1],
6719 gen_rtx_REG (Pmode, RETURN_REGNUM)));
6721 /* 31-bit PLT stubs use the GOT register implicitly. */
6722 if (!TARGET_64BIT && plt_call)
6723 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
6728 (define_expand "call_exp"
6729 [(parallel [(call (match_operand 0 "" "")
6730 (match_operand 1 "" ""))
6731 (clobber (match_operand 2 "" ""))])]
6735 (define_insn "*bras"
6736 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
6737 (match_operand 1 "const_int_operand" "n"))
6738 (clobber (match_operand 2 "register_operand" "=r"))]
6739 "TARGET_SMALL_EXEC && GET_MODE (operands[2]) == Pmode"
6741 [(set_attr "op_type" "RI")
6742 (set_attr "type" "jsr")])
6744 (define_insn "*brasl"
6745 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
6746 (match_operand 1 "const_int_operand" "n"))
6747 (clobber (match_operand 2 "register_operand" "=r"))]
6748 "TARGET_CPU_ZARCH && GET_MODE (operands[2]) == Pmode"
6750 [(set_attr "op_type" "RIL")
6751 (set_attr "type" "jsr")])
6753 (define_insn "*basr"
6754 [(call (mem:QI (match_operand 0 "address_operand" "U"))
6755 (match_operand 1 "const_int_operand" "n"))
6756 (clobber (match_operand 2 "register_operand" "=r"))]
6757 "GET_MODE (operands[2]) == Pmode"
6759 if (get_attr_op_type (insn) == OP_TYPE_RR)
6760 return "basr\t%2,%0";
6762 return "bas\t%2,%a0";
6764 [(set (attr "op_type")
6765 (if_then_else (match_operand 0 "register_operand" "")
6766 (const_string "RR") (const_string "RX")))
6767 (set_attr "type" "jsr")
6768 (set_attr "atype" "agen")])
6771 ; call_value instruction pattern(s).
6774 (define_expand "call_value"
6775 [(set (match_operand 0 "" "")
6776 (call (match_operand 1 "" "")
6777 (match_operand 2 "" "")))
6778 (use (match_operand 3 "" ""))]
6781 bool plt_call = false;
6784 /* Direct function calls need special treatment. */
6785 if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
6787 rtx sym = XEXP (operands[1], 0);
6789 /* When calling a global routine in PIC mode, we must
6790 replace the symbol itself with the PLT stub. */
6791 if (flag_pic && !SYMBOL_REF_LOCAL_P (sym))
6793 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6794 sym = gen_rtx_CONST (Pmode, sym);
6798 /* Unless we can use the bras(l) insn, force the
6799 routine address into a register. */
6800 if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
6803 sym = legitimize_pic_address (sym, 0);
6805 sym = force_reg (Pmode, sym);
6808 operands[1] = gen_rtx_MEM (QImode, sym);
6812 insn = emit_call_insn (
6813 gen_call_value_exp (operands[0], operands[1], operands[2],
6814 gen_rtx_REG (Pmode, RETURN_REGNUM)));
6816 /* 31-bit PLT stubs use the GOT register implicitly. */
6817 if (!TARGET_64BIT && plt_call)
6818 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
6823 (define_expand "call_value_exp"
6824 [(parallel [(set (match_operand 0 "" "")
6825 (call (match_operand 1 "" "")
6826 (match_operand 2 "" "")))
6827 (clobber (match_operand 3 "" ""))])]
6831 (define_insn "*bras_r"
6832 [(set (match_operand 0 "register_operand" "=df")
6833 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
6834 (match_operand:SI 2 "const_int_operand" "n")))
6835 (clobber (match_operand 3 "register_operand" "=r"))]
6836 "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode"
6838 [(set_attr "op_type" "RI")
6839 (set_attr "type" "jsr")])
6841 (define_insn "*brasl_r"
6842 [(set (match_operand 0 "register_operand" "=df")
6843 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
6844 (match_operand 2 "const_int_operand" "n")))
6845 (clobber (match_operand 3 "register_operand" "=r"))]
6846 "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode"
6848 [(set_attr "op_type" "RIL")
6849 (set_attr "type" "jsr")])
6851 (define_insn "*basr_r"
6852 [(set (match_operand 0 "register_operand" "=df")
6853 (call (mem:QI (match_operand 1 "address_operand" "U"))
6854 (match_operand 2 "const_int_operand" "n")))
6855 (clobber (match_operand 3 "register_operand" "=r"))]
6856 "GET_MODE (operands[3]) == Pmode"
6858 if (get_attr_op_type (insn) == OP_TYPE_RR)
6859 return "basr\t%3,%1";
6861 return "bas\t%3,%a1";
6863 [(set (attr "op_type")
6864 (if_then_else (match_operand 1 "register_operand" "")
6865 (const_string "RR") (const_string "RX")))
6866 (set_attr "type" "jsr")
6867 (set_attr "atype" "agen")])
6870 ;;- Thread-local storage support.
6873 (define_insn "get_tp_64"
6874 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
6875 (unspec:DI [(const_int 0)] UNSPEC_TP))]
6878 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
6880 [(set_attr "op_type" "NN,RS")
6881 (set_attr "atype" "reg,*")
6882 (set_attr "type" "o3,*")
6883 (set_attr "length" "14,*")])
6885 (define_insn "get_tp_31"
6886 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
6887 (unspec:SI [(const_int 0)] UNSPEC_TP))]
6892 [(set_attr "op_type" "RRE,RS")])
6894 (define_insn "set_tp_64"
6895 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
6896 (clobber (match_scratch:SI 1 "=d,X"))]
6899 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
6901 [(set_attr "op_type" "NN,RS")
6902 (set_attr "atype" "reg,*")
6903 (set_attr "type" "o3,*")
6904 (set_attr "length" "14,*")])
6906 (define_insn "set_tp_31"
6907 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
6912 [(set_attr "op_type" "RRE,RS")])
6914 (define_insn "*tls_load_64"
6915 [(set (match_operand:DI 0 "register_operand" "=d")
6916 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
6917 (match_operand:DI 2 "" "")]
6921 [(set_attr "op_type" "RXE")])
6923 (define_insn "*tls_load_31"
6924 [(set (match_operand:SI 0 "register_operand" "=d,d")
6925 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
6926 (match_operand:SI 2 "" "")]
6932 [(set_attr "op_type" "RX,RXY")])
6934 (define_expand "call_value_tls"
6935 [(set (match_operand 0 "" "")
6936 (call (const_int 0) (const_int 0)))
6937 (use (match_operand 1 "" ""))]
6945 sym = s390_tls_get_offset ();
6946 sym = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym), UNSPEC_PLT);
6947 sym = gen_rtx_CONST (Pmode, sym);
6949 /* Unless we can use the bras(l) insn, force the
6950 routine address into a register. */
6951 if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH)
6954 sym = legitimize_pic_address (sym, 0);
6956 sym = force_reg (Pmode, sym);
6959 sym = gen_rtx_MEM (QImode, sym);
6962 insn = emit_call_insn (
6963 gen_call_value_tls_exp (operands[0], sym, const0_rtx,
6964 gen_rtx_REG (Pmode, RETURN_REGNUM),
6967 /* The calling convention of __tls_get_offset uses the
6968 GOT register implicitly. */
6969 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
6970 use_reg (&CALL_INSN_FUNCTION_USAGE (insn), operands[0]);
6971 CONST_OR_PURE_CALL_P (insn) = 1;
6976 (define_expand "call_value_tls_exp"
6977 [(parallel [(set (match_operand 0 "" "")
6978 (call (match_operand 1 "" "")
6979 (match_operand 2 "" "")))
6980 (clobber (match_operand 3 "" ""))
6981 (use (match_operand 4 "" ""))])]
6985 (define_insn "*bras_tls"
6986 [(set (match_operand 0 "register_operand" "=df")
6987 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
6988 (match_operand 2 "const_int_operand" "n")))
6989 (clobber (match_operand 3 "register_operand" "=r"))
6990 (use (match_operand 4 "" ""))]
6991 "TARGET_SMALL_EXEC && GET_MODE (operands[3]) == Pmode"
6993 [(set_attr "op_type" "RI")
6994 (set_attr "type" "jsr")])
6996 (define_insn "*brasl_tls"
6997 [(set (match_operand 0 "register_operand" "=df")
6998 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
6999 (match_operand 2 "const_int_operand" "n")))
7000 (clobber (match_operand 3 "register_operand" "=r"))
7001 (use (match_operand 4 "" ""))]
7002 "TARGET_CPU_ZARCH && GET_MODE (operands[3]) == Pmode"
7004 [(set_attr "op_type" "RIL")
7005 (set_attr "type" "jsr")])
7007 (define_insn "*basr_tls"
7008 [(set (match_operand 0 "register_operand" "=df")
7009 (call (mem:QI (match_operand 1 "address_operand" "U"))
7010 (match_operand 2 "const_int_operand" "n")))
7011 (clobber (match_operand 3 "register_operand" "=r"))
7012 (use (match_operand 4 "" ""))]
7013 "GET_MODE (operands[3]) == Pmode"
7015 if (get_attr_op_type (insn) == OP_TYPE_RR)
7016 return "basr\t%3,%1%J4";
7018 return "bas\t%3,%a1%J4";
7020 [(set (attr "op_type")
7021 (if_then_else (match_operand 1 "register_operand" "")
7022 (const_string "RR") (const_string "RX")))
7023 (set_attr "type" "jsr")
7024 (set_attr "atype" "agen")])
7027 ;;- Miscellaneous instructions.
7031 ; allocate stack instruction pattern(s).
7034 (define_expand "allocate_stack"
7036 (plus (reg 15) (match_operand 1 "general_operand" "")))
7037 (set (match_operand 0 "general_operand" "")
7041 rtx stack = gen_rtx (REG, Pmode, STACK_POINTER_REGNUM);
7042 rtx chain = gen_rtx (MEM, Pmode, stack);
7043 rtx temp = gen_reg_rtx (Pmode);
7045 emit_move_insn (temp, chain);
7048 emit_insn (gen_adddi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7050 emit_insn (gen_addsi3 (stack, stack, negate_rtx (Pmode, operands[1])));
7052 emit_move_insn (chain, temp);
7054 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7060 ; setjmp instruction pattern.
7063 (define_expand "builtin_setjmp_receiver"
7064 [(match_operand 0 "" "")]
7067 s390_load_got (false);
7068 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7072 ;; These patterns say how to save and restore the stack pointer. We need not
7073 ;; save the stack pointer at function level since we are careful to
7074 ;; preserve the backchain. At block level, we have to restore the backchain
7075 ;; when we restore the stack pointer.
7077 ;; For nonlocal gotos, we must save both the stack pointer and its
7078 ;; backchain and restore both. Note that in the nonlocal case, the
7079 ;; save area is a memory location.
7081 (define_expand "save_stack_function"
7082 [(match_operand 0 "general_operand" "")
7083 (match_operand 1 "general_operand" "")]
7087 (define_expand "restore_stack_function"
7088 [(match_operand 0 "general_operand" "")
7089 (match_operand 1 "general_operand" "")]
7093 (define_expand "restore_stack_block"
7094 [(use (match_operand 0 "register_operand" ""))
7095 (set (match_dup 2) (match_dup 3))
7096 (set (match_dup 0) (match_operand 1 "register_operand" ""))
7097 (set (match_dup 3) (match_dup 2))]
7100 operands[2] = gen_reg_rtx (Pmode);
7101 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
7104 (define_expand "save_stack_nonlocal"
7105 [(match_operand 0 "memory_operand" "")
7106 (match_operand 1 "register_operand" "")]
7109 rtx temp = gen_reg_rtx (Pmode);
7111 /* Copy the backchain to the first word, sp to the second and the literal pool
7112 base to the third. */
7113 emit_move_insn (operand_subword (operands[0], 2, 0,
7114 TARGET_64BIT ? OImode : TImode),
7115 gen_rtx_REG (Pmode, BASE_REGISTER));
7116 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
7117 emit_move_insn (operand_subword (operands[0], 0, 0,
7118 TARGET_64BIT ? OImode : TImode),
7120 emit_move_insn (operand_subword (operands[0], 1, 0,
7121 TARGET_64BIT ? OImode : TImode),
7126 (define_expand "restore_stack_nonlocal"
7127 [(match_operand 0 "register_operand" "")
7128 (match_operand 1 "memory_operand" "")]
7131 rtx temp = gen_reg_rtx (Pmode);
7132 rtx base = gen_rtx_REG (Pmode, BASE_REGISTER);
7134 /* Restore the backchain from the first word, sp from the second and the
7135 literal pool base from the third. */
7136 emit_move_insn (temp,
7137 operand_subword (operands[1], 0, 0,
7138 TARGET_64BIT ? OImode : TImode));
7139 emit_move_insn (operands[0],
7140 operand_subword (operands[1], 1, 0,
7141 TARGET_64BIT ? OImode : TImode));
7142 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
7143 emit_move_insn (base,
7144 operand_subword (operands[1], 2, 0,
7145 TARGET_64BIT ? OImode : TImode));
7146 emit_insn (gen_rtx_USE (VOIDmode, base));
7153 ; nop instruction pattern(s).
7160 [(set_attr "op_type" "RR")])
7164 ; Special literal pool access instruction pattern(s).
7167 (define_insn "*pool_entry"
7168 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7169 UNSPECV_POOL_ENTRY)]
7172 enum machine_mode mode = GET_MODE (PATTERN (insn));
7173 unsigned int align = GET_MODE_BITSIZE (mode);
7174 s390_output_pool_entry (asm_out_file, operands[0], mode, align);
7177 [(set_attr "op_type" "NN")
7178 (set (attr "length")
7179 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7181 (define_insn "pool_start_31"
7182 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7185 [(set_attr "op_type" "NN")
7186 (set_attr "length" "2")])
7188 (define_insn "pool_end_31"
7189 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7192 [(set_attr "op_type" "NN")
7193 (set_attr "length" "2")])
7195 (define_insn "pool_start_64"
7196 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_START)]
7198 ".section\t.rodata\;.align\t8"
7199 [(set_attr "op_type" "NN")
7200 (set_attr "length" "0")])
7202 (define_insn "pool_end_64"
7203 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_END)]
7206 [(set_attr "op_type" "NN")
7207 (set_attr "length" "0")])
7209 (define_insn "main_base_31_small"
7210 [(set (match_operand 0 "register_operand" "=a")
7211 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7212 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7214 [(set_attr "op_type" "RR")
7215 (set_attr "type" "la")])
7217 (define_insn "main_base_31_large"
7218 [(set (match_operand 0 "register_operand" "=a")
7219 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7220 (set (pc) (label_ref (match_operand 2 "" "")))]
7221 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7223 [(set_attr "op_type" "RI")])
7225 (define_insn "main_base_64"
7226 [(set (match_operand 0 "register_operand" "=a")
7227 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7228 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7230 [(set_attr "op_type" "RIL")
7231 (set_attr "type" "larl")])
7233 (define_insn "main_pool"
7234 [(unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL)]
7237 [(set_attr "op_type" "NN")])
7239 (define_insn "reload_base_31"
7240 [(set (match_operand 0 "register_operand" "=a")
7241 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7242 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7243 "basr\t%0,0\;la\t%0,%1-.(%0)"
7244 [(set_attr "op_type" "NN")
7245 (set_attr "type" "la")
7246 (set_attr "length" "6")])
7248 (define_insn "reload_base_64"
7249 [(set (match_operand 0 "register_operand" "=a")
7250 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7251 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7253 [(set_attr "op_type" "RIL")
7254 (set_attr "type" "larl")])
7257 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7260 [(set_attr "op_type" "NN")
7261 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7264 ;; Insns related to generating the function prologue and epilogue.
7268 (define_expand "prologue"
7269 [(use (const_int 0))]
7271 "s390_emit_prologue (); DONE;")
7273 (define_expand "epilogue"
7274 [(use (const_int 1))]
7276 "s390_emit_epilogue (); DONE;")
7278 (define_insn "*return"
7280 (use (match_operand 0 "register_operand" "a"))]
7281 "GET_MODE (operands[0]) == Pmode"
7283 [(set_attr "op_type" "RR")
7284 (set_attr "type" "jsr")
7285 (set_attr "atype" "agen")])
7288 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7289 ;; pointer. This is used for compatability.
7291 (define_expand "ptr_extend"
7292 [(set (match_operand:DI 0 "register_operand" "=r")
7293 (match_operand:SI 1 "register_operand" "r"))]
7296 emit_insn (gen_anddi3 (operands[0],
7297 gen_lowpart (DImode, operands[1]),
7298 GEN_INT (0x7fffffff)));