1 ;;- Machine description for GNU compiler -- S/390 / zSeries version.
2 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
3 ;; Free Software Foundation, Inc.
4 ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and
5 ;; Ulrich Weigand (uweigand@de.ibm.com).
7 ;; This file is part of GCC.
9 ;; GCC is free software; you can redistribute it and/or modify it under
10 ;; the terms of the GNU General Public License as published by the Free
11 ;; Software Foundation; either version 2, or (at your option) any later
14 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GCC; see the file COPYING. If not, write to the Free
21 ;; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
25 ;; Special constraints for s/390 machine description:
27 ;; a -- Any address register from 1 to 15.
28 ;; d -- Any register from 0 to 15.
29 ;; I -- An 8-bit constant (0..255).
30 ;; J -- A 12-bit constant (0..4095).
31 ;; K -- A 16-bit constant (-32768..32767).
32 ;; L -- Value appropriate as displacement.
33 ;; (0..4095) for short displacement
34 ;; (-524288..524287) for long displacement
35 ;; M -- Constant integer with a value of 0x7fffffff.
36 ;; N -- Multiple letter constraint followed by 4 parameter letters.
37 ;; 0..9,x: number of the part counting from most to least significant
38 ;; H,Q: mode of the part
39 ;; D,S,H: mode of the containing operand
40 ;; 0,F: value of the other parts (F - all bits set)
42 ;; The constraint matches if the specified part of a constant
43 ;; has a value different from its other parts. If the letter x
44 ;; is specified instead of a part number, the constraint matches
45 ;; if there is any single part with non-default value.
46 ;; Q -- Memory reference without index register and with short displacement.
47 ;; R -- Memory reference with index register and short displacement.
48 ;; S -- Memory reference without index register but with long displacement.
49 ;; T -- Memory reference with index register and long displacement.
50 ;; A -- Multiple letter constraint followed by Q, R, S, or T:
51 ;; Offsettable memory reference of type specified by second letter.
52 ;; U -- Pointer with short displacement.
53 ;; W -- Pointer with long displacement.
54 ;; Y -- Shift count operand.
56 ;; Special formats used for outputting 390 instructions.
58 ;; %C: print opcode suffix for branch condition.
59 ;; %D: print opcode suffix for inverse branch condition.
60 ;; %J: print tls_load/tls_gdcall/tls_ldcall suffix
61 ;; %O: print only the displacement of a memory reference.
62 ;; %R: print only the base register of a memory reference.
63 ;; %N: print the second word of a DImode operand.
64 ;; %M: print the second word of a TImode operand.
66 ;; %b: print integer X as if it's an unsigned byte.
67 ;; %x: print integer X as if it's an unsigned word.
68 ;; %h: print integer X as if it's a signed word.
69 ;; %i: print the first nonzero HImode part of X
70 ;; %j: print the first HImode part unequal to 0xffff of X
73 ;; We have a special constraint for pattern matching.
75 ;; s_operand -- Matches a valid S operand in a RS, SI or SS type instruction.
88 ; GOT/PLT and lt-relative accesses
89 (UNSPEC_LTREL_OFFSET 100)
90 (UNSPEC_LTREL_BASE 101)
98 (UNSPEC_RELOAD_BASE 210)
99 (UNSPEC_MAIN_BASE 211)
104 ; TLS relocation specifiers
109 (UNSPEC_GOTNTPOFF 504)
110 (UNSPEC_INDNTPOFF 505)
114 (UNSPEC_TLSLDM_NTPOFF 511)
115 (UNSPEC_TLS_LOAD 512)
122 ;; UNSPEC_VOLATILE usage
130 (UNSPECV_TPF_PROLOGUE 20)
131 (UNSPECV_TPF_EPILOGUE 21)
135 (UNSPECV_POOL_SECTION 201)
136 (UNSPECV_POOL_ALIGN 202)
137 (UNSPECV_POOL_ENTRY 203)
138 (UNSPECV_MAIN_POOL 300)
145 ;; Processor type. This attribute must exactly match the processor_type
146 ;; enumeration in s390.h. The current machine description does not
147 ;; distinguish between g5 and g6, but there are differences between the two
148 ;; CPUs could in theory be modeled.
150 (define_attr "cpu" "g5,g6,z900,z990"
151 (const (symbol_ref "s390_tune")))
153 ;; Define an insn type attribute. This is used in function unit delay
156 (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
157 cs,vs,store,imul,idiv,
158 branch,jsr,fsimpd,fsimps,
159 floadd,floads,fstored, fstores,
160 fmuld,fmuls,fdivd,fdivs,
161 ftoi,itof,fsqrtd,fsqrts,
163 (const_string "integer"))
165 ;; Operand type. Used to default length attribute values
167 (define_attr "op_type"
168 "NN,E,RR,RRE,RX,RS,RSI,RI,SI,S,SS,SSE,RXE,RSE,RIL,RIE,RXY,RSY,SIY"
171 ;; Insn are devide in two classes:
172 ;; agen: Insn using agen
173 ;; reg: Insn not using agen
175 (define_attr "atype" "agen,reg"
176 (cond [ (eq_attr "op_type" "E") (const_string "reg")
177 (eq_attr "op_type" "RR") (const_string "reg")
178 (eq_attr "op_type" "RX") (const_string "agen")
179 (eq_attr "op_type" "RI") (const_string "reg")
180 (eq_attr "op_type" "RRE") (const_string "reg")
181 (eq_attr "op_type" "RS") (const_string "agen")
182 (eq_attr "op_type" "RSI") (const_string "agen")
183 (eq_attr "op_type" "S") (const_string "agen")
184 (eq_attr "op_type" "SI") (const_string "agen")
185 (eq_attr "op_type" "SS") (const_string "agen")
186 (eq_attr "op_type" "SSE") (const_string "agen")
187 (eq_attr "op_type" "RXE") (const_string "agen")
188 (eq_attr "op_type" "RSE") (const_string "agen")
189 (eq_attr "op_type" "RIL") (const_string "agen")
190 (eq_attr "op_type" "RXY") (const_string "agen")
191 (eq_attr "op_type" "RSY") (const_string "agen")
192 (eq_attr "op_type" "SIY") (const_string "agen")]
193 (const_string "reg")))
195 ;; Pipeline description for z900. For lack of anything better,
196 ;; this description is also used for the g5 and g6.
199 ;; Pipeline description for z990.
204 (define_attr "length" ""
205 (cond [ (eq_attr "op_type" "E") (const_int 2)
206 (eq_attr "op_type" "RR") (const_int 2)
207 (eq_attr "op_type" "RX") (const_int 4)
208 (eq_attr "op_type" "RI") (const_int 4)
209 (eq_attr "op_type" "RRE") (const_int 4)
210 (eq_attr "op_type" "RS") (const_int 4)
211 (eq_attr "op_type" "RSI") (const_int 4)
212 (eq_attr "op_type" "S") (const_int 4)
213 (eq_attr "op_type" "SI") (const_int 4)
214 (eq_attr "op_type" "SS") (const_int 6)
215 (eq_attr "op_type" "SSE") (const_int 6)
216 (eq_attr "op_type" "RXE") (const_int 6)
217 (eq_attr "op_type" "RSE") (const_int 6)
218 (eq_attr "op_type" "RIL") (const_int 6)
219 (eq_attr "op_type" "RXY") (const_int 6)
220 (eq_attr "op_type" "RSY") (const_int 6)
221 (eq_attr "op_type" "SIY") (const_int 6)]
224 ;; Define attributes for `asm' insns.
226 (define_asm_attributes [(set_attr "type" "other")
227 (set_attr "op_type" "NN")])
233 ; CCL: Zero Nonzero Zero Nonzero (AL, ALR, SL, SLR, N, NC, NI, NR, O, OC, OI, OR, X, XC, XI, XR)
234 ; CCA: Zero <Zero >Zero Overflow (A, AR, AH, AHI, S, SR, SH, SHI, LTR, LCR, LNR, LPR, SLA, SLDA, SLA, SRDA)
235 ; CCU: Equal ULess UGreater -- (CL, CLR, CLI, CLM)
236 ; CCS: Equal SLess SGreater -- (C, CR, CH, CHI, ICM)
237 ; CCT: Zero Mixed Mixed Ones (TM, TMH, TML)
240 ; CCZ1 -> CCA/CCU/CCS/CCT
243 ; String: CLC, CLCL, CLCLE, CLST, CUSE, MVCL, MVCLE, MVPG, MVST, SRST
244 ; Clobber: CKSM, CFC, CS, CDS, CUUTF, CUTFU, PLO, SPM, STCK, STCKE, TS, TRT, TRE, UPT
248 ;;- Compare instructions.
251 (define_expand "cmpdi"
253 (compare:CC (match_operand:DI 0 "register_operand" "")
254 (match_operand:DI 1 "general_operand" "")))]
257 s390_compare_op0 = operands[0];
258 s390_compare_op1 = operands[1];
262 (define_expand "cmpsi"
264 (compare:CC (match_operand:SI 0 "register_operand" "")
265 (match_operand:SI 1 "general_operand" "")))]
268 s390_compare_op0 = operands[0];
269 s390_compare_op1 = operands[1];
273 (define_expand "cmpdf"
275 (compare:CC (match_operand:DF 0 "register_operand" "")
276 (match_operand:DF 1 "general_operand" "")))]
279 s390_compare_op0 = operands[0];
280 s390_compare_op1 = operands[1];
284 (define_expand "cmpsf"
286 (compare:CC (match_operand:SF 0 "register_operand" "")
287 (match_operand:SF 1 "general_operand" "")))]
290 s390_compare_op0 = operands[0];
291 s390_compare_op1 = operands[1];
296 ; Test-under-Mask instructions
298 (define_insn "*tmqi_mem"
300 (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S")
301 (match_operand:QI 1 "immediate_operand" "n,n"))
302 (match_operand:QI 2 "immediate_operand" "n,n")))]
303 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))"
307 [(set_attr "op_type" "SI,SIY")])
309 (define_insn "*tmdi_reg"
311 (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d")
312 (match_operand:DI 1 "immediate_operand"
313 "N0HD0,N1HD0,N2HD0,N3HD0"))
314 (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
316 && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
317 && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
323 [(set_attr "op_type" "RI")])
325 (define_insn "*tmsi_reg"
327 (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
328 (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
329 (match_operand:SI 2 "immediate_operand" "n,n")))]
330 "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
331 && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
335 [(set_attr "op_type" "RI")])
337 (define_insn "*tmhi_full"
339 (compare (match_operand:HI 0 "register_operand" "d")
340 (match_operand:HI 1 "immediate_operand" "n")))]
341 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
343 [(set_attr "op_type" "RX")])
345 (define_insn "*tmqi_full"
347 (compare (match_operand:QI 0 "register_operand" "d")
348 (match_operand:QI 1 "immediate_operand" "n")))]
349 "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))"
351 [(set_attr "op_type" "RI")])
354 ; Load-and-Test instructions
356 (define_insn "*tstdi_sign"
358 (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0)
359 (const_int 32)) (const_int 32))
360 (match_operand:DI 1 "const0_operand" "")))
361 (set (match_operand:DI 2 "register_operand" "=d")
362 (sign_extend:DI (match_dup 0)))]
363 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
365 [(set_attr "op_type" "RRE")])
367 (define_insn "*tstdi"
369 (compare (match_operand:DI 0 "register_operand" "d")
370 (match_operand:DI 1 "const0_operand" "")))
371 (set (match_operand:DI 2 "register_operand" "=d")
373 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
375 [(set_attr "op_type" "RRE")])
377 (define_insn "*tstdi_cconly"
379 (compare (match_operand:DI 0 "register_operand" "d")
380 (match_operand:DI 1 "const0_operand" "")))]
381 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
383 [(set_attr "op_type" "RRE")])
385 (define_insn "*tstdi_cconly_31"
387 (compare (match_operand:DI 0 "register_operand" "d")
388 (match_operand:DI 1 "const0_operand" "")))]
389 "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
391 [(set_attr "op_type" "RS")
392 (set_attr "atype" "reg")])
395 (define_insn "*tstsi"
397 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
398 (match_operand:SI 1 "const0_operand" "")))
399 (set (match_operand:SI 2 "register_operand" "=d,d,d")
401 "s390_match_ccmode(insn, CCSmode)"
406 [(set_attr "op_type" "RR,RS,RSY")])
408 (define_insn "*tstsi_cconly"
410 (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
411 (match_operand:SI 1 "const0_operand" "")))
412 (clobber (match_scratch:SI 2 "=X,d,d"))]
413 "s390_match_ccmode(insn, CCSmode)"
418 [(set_attr "op_type" "RR,RS,RSY")])
420 (define_insn "*tstsi_cconly2"
422 (compare (match_operand:SI 0 "register_operand" "d")
423 (match_operand:SI 1 "const0_operand" "")))]
424 "s390_match_ccmode(insn, CCSmode)"
426 [(set_attr "op_type" "RR")])
428 (define_insn "*tsthiCCT"
430 (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d")
431 (match_operand:HI 1 "const0_operand" "")))
432 (set (match_operand:HI 2 "register_operand" "=d,d,0")
434 "s390_match_ccmode(insn, CCTmode)"
439 [(set_attr "op_type" "RS,RSY,RI")])
441 (define_insn "*tsthiCCT_cconly"
443 (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d")
444 (match_operand:HI 1 "const0_operand" "")))
445 (clobber (match_scratch:HI 2 "=d,d,X"))]
446 "s390_match_ccmode(insn, CCTmode)"
451 [(set_attr "op_type" "RS,RSY,RI")])
453 (define_insn "*tsthi"
455 (compare (match_operand:HI 0 "s_operand" "Q,S")
456 (match_operand:HI 1 "const0_operand" "")))
457 (set (match_operand:HI 2 "register_operand" "=d,d")
459 "s390_match_ccmode(insn, CCSmode)"
463 [(set_attr "op_type" "RS,RSY")])
465 (define_insn "*tsthi_cconly"
467 (compare (match_operand:HI 0 "s_operand" "Q,S")
468 (match_operand:HI 1 "const0_operand" "")))
469 (clobber (match_scratch:HI 2 "=d,d"))]
470 "s390_match_ccmode(insn, CCSmode)"
474 [(set_attr "op_type" "RS,RSY")])
476 (define_insn "*tstqiCCT"
478 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
479 (match_operand:QI 1 "const0_operand" "")))
480 (set (match_operand:QI 2 "register_operand" "=d,d,0")
482 "s390_match_ccmode(insn, CCTmode)"
487 [(set_attr "op_type" "RS,RSY,RI")])
489 (define_insn "*tstqiCCT_cconly"
491 (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d")
492 (match_operand:QI 1 "const0_operand" "")))]
493 "s390_match_ccmode(insn, CCTmode)"
498 [(set_attr "op_type" "SI,SIY,RI")])
500 (define_insn "*tstqi"
502 (compare (match_operand:QI 0 "s_operand" "Q,S")
503 (match_operand:QI 1 "const0_operand" "")))
504 (set (match_operand:QI 2 "register_operand" "=d,d")
506 "s390_match_ccmode(insn, CCSmode)"
510 [(set_attr "op_type" "RS,RSY")])
512 (define_insn "*tstqi_cconly"
514 (compare (match_operand:QI 0 "s_operand" "Q,S")
515 (match_operand:QI 1 "const0_operand" "")))
516 (clobber (match_scratch:QI 2 "=d,d"))]
517 "s390_match_ccmode(insn, CCSmode)"
521 [(set_attr "op_type" "RS,RSY")])
524 ; Compare (equality) instructions
526 (define_insn "*cmpdi_cct"
528 (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,d,m,Q")
529 (match_operand:DI 1 "general_operand" "d,K,m,d,Q")))]
530 "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT
531 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))"
538 [(set_attr "op_type" "RRE,RI,RXY,RXY,SS")])
540 (define_insn "*cmpsi_cct"
542 (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,d,R,T,Q")
543 (match_operand:SI 1 "general_operand" "d,K,R,T,d,d,Q")))]
544 "s390_match_ccmode (insn, CCTmode)
545 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))"
554 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")])
557 ; Compare (signed) instructions
559 (define_insn "*cmpdi_ccs_sign"
561 (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
562 (match_operand:DI 0 "register_operand" "d,d")))]
563 "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT"
567 [(set_attr "op_type" "RRE,RXY")])
569 (define_insn "*cmpdi_ccs"
571 (compare (match_operand:DI 0 "register_operand" "d,d,d")
572 (match_operand:DI 1 "general_operand" "d,K,m")))]
573 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
578 [(set_attr "op_type" "RRE,RI,RXY")])
580 (define_insn "*cmpsi_ccs_sign"
582 (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T"))
583 (match_operand:SI 0 "register_operand" "d,d")))]
584 "s390_match_ccmode(insn, CCSRmode)"
588 [(set_attr "op_type" "RX,RXY")])
590 (define_insn "*cmpsi_ccs"
592 (compare (match_operand:SI 0 "register_operand" "d,d,d,d")
593 (match_operand:SI 1 "general_operand" "d,K,R,T")))]
594 "s390_match_ccmode(insn, CCSmode)"
600 [(set_attr "op_type" "RR,RI,RX,RXY")])
603 ; Compare (unsigned) instructions
605 (define_insn "*cmpdi_ccu_zero"
607 (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m"))
608 (match_operand:DI 0 "register_operand" "d,d")))]
609 "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT"
613 [(set_attr "op_type" "RRE,RXY")])
615 (define_insn "*cmpdi_ccu"
617 (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,Q")
618 (match_operand:DI 1 "general_operand" "d,m,Q")))]
619 "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT
620 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))"
625 [(set_attr "op_type" "RRE,RXY,SS")])
627 (define_insn "*cmpsi_ccu"
629 (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,Q")
630 (match_operand:SI 1 "general_operand" "d,R,T,Q")))]
631 "s390_match_ccmode (insn, CCUmode)
632 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))"
638 [(set_attr "op_type" "RR,RX,RXY,SS")])
640 (define_insn "*cmphi_ccu"
642 (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q")
643 (match_operand:HI 1 "general_operand" "Q,S,Q")))]
644 "s390_match_ccmode (insn, CCUmode)
645 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))
646 && !register_operand (operands[1], HImode)"
651 [(set_attr "op_type" "RS,RSY,SS")])
653 (define_insn "*cmpqi_ccu"
655 (compare (match_operand:QI 0 "nonimmediate_operand" "d,d,Q,S,Q")
656 (match_operand:QI 1 "general_operand" "Q,S,n,n,Q")))]
657 "s390_match_ccmode (insn, CCUmode)
658 && (!s390_pool_operand (operands[0]) || !s390_pool_operand (operands[1]))
659 && !register_operand (operands[1], QImode)"
666 [(set_attr "op_type" "RS,RSY,SI,SIY,SS")])
671 (define_insn "*cmpdf_ccs_0"
673 (compare (match_operand:DF 0 "register_operand" "f")
674 (match_operand:DF 1 "const0_operand" "")))]
675 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
677 [(set_attr "op_type" "RRE")
678 (set_attr "type" "fsimpd")])
680 (define_insn "*cmpdf_ccs_0_ibm"
682 (compare (match_operand:DF 0 "register_operand" "f")
683 (match_operand:DF 1 "const0_operand" "")))]
684 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
686 [(set_attr "op_type" "RR")
687 (set_attr "type" "fsimpd")])
689 (define_insn "*cmpdf_ccs"
691 (compare (match_operand:DF 0 "register_operand" "f,f")
692 (match_operand:DF 1 "general_operand" "f,R")))]
693 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
697 [(set_attr "op_type" "RRE,RXE")
698 (set_attr "type" "fsimpd")])
700 (define_insn "*cmpdf_ccs_ibm"
702 (compare (match_operand:DF 0 "register_operand" "f,f")
703 (match_operand:DF 1 "general_operand" "f,R")))]
704 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
708 [(set_attr "op_type" "RR,RX")
709 (set_attr "type" "fsimpd")])
714 (define_insn "*cmpsf_ccs_0"
716 (compare (match_operand:SF 0 "register_operand" "f")
717 (match_operand:SF 1 "const0_operand" "")))]
718 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
720 [(set_attr "op_type" "RRE")
721 (set_attr "type" "fsimps")])
723 (define_insn "*cmpsf_ccs_0_ibm"
725 (compare (match_operand:SF 0 "register_operand" "f")
726 (match_operand:SF 1 "const0_operand" "")))]
727 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
729 [(set_attr "op_type" "RR")
730 (set_attr "type" "fsimps")])
732 (define_insn "*cmpsf_ccs"
734 (compare (match_operand:SF 0 "register_operand" "f,f")
735 (match_operand:SF 1 "general_operand" "f,R")))]
736 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
740 [(set_attr "op_type" "RRE,RXE")
741 (set_attr "type" "fsimps")])
743 (define_insn "*cmpsf_ccs"
745 (compare (match_operand:SF 0 "register_operand" "f,f")
746 (match_operand:SF 1 "general_operand" "f,R")))]
747 "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
751 [(set_attr "op_type" "RR,RX")
752 (set_attr "type" "fsimps")])
756 ;;- Move instructions.
760 ; movti instruction pattern(s).
764 [(set (match_operand:TI 0 "nonimmediate_operand" "=d,QS,d,o,Q")
765 (match_operand:TI 1 "general_operand" "QS,d,dKm,d,Q"))]
773 [(set_attr "op_type" "RSY,RSY,NN,NN,SS")
774 (set_attr "type" "lm,stm,*,*,cs")])
777 [(set (match_operand:TI 0 "nonimmediate_operand" "")
778 (match_operand:TI 1 "general_operand" ""))]
779 "TARGET_64BIT && reload_completed
780 && s390_split_ok_p (operands[0], operands[1], TImode, 0)"
781 [(set (match_dup 2) (match_dup 4))
782 (set (match_dup 3) (match_dup 5))]
784 operands[2] = operand_subword (operands[0], 0, 0, TImode);
785 operands[3] = operand_subword (operands[0], 1, 0, TImode);
786 operands[4] = operand_subword (operands[1], 0, 0, TImode);
787 operands[5] = operand_subword (operands[1], 1, 0, TImode);
791 [(set (match_operand:TI 0 "nonimmediate_operand" "")
792 (match_operand:TI 1 "general_operand" ""))]
793 "TARGET_64BIT && reload_completed
794 && s390_split_ok_p (operands[0], operands[1], TImode, 1)"
795 [(set (match_dup 2) (match_dup 4))
796 (set (match_dup 3) (match_dup 5))]
798 operands[2] = operand_subword (operands[0], 1, 0, TImode);
799 operands[3] = operand_subword (operands[0], 0, 0, TImode);
800 operands[4] = operand_subword (operands[1], 1, 0, TImode);
801 operands[5] = operand_subword (operands[1], 0, 0, TImode);
805 [(set (match_operand:TI 0 "register_operand" "")
806 (match_operand:TI 1 "memory_operand" ""))]
807 "TARGET_64BIT && reload_completed
808 && !s_operand (operands[1], VOIDmode)"
809 [(set (match_dup 0) (match_dup 1))]
811 rtx addr = operand_subword (operands[0], 1, 0, TImode);
812 s390_load_address (addr, XEXP (operands[1], 0));
813 operands[1] = replace_equiv_address (operands[1], addr);
816 (define_expand "reload_outti"
817 [(parallel [(match_operand:TI 0 "memory_operand" "")
818 (match_operand:TI 1 "register_operand" "d")
819 (match_operand:DI 2 "register_operand" "=&a")])]
822 s390_load_address (operands[2], XEXP (operands[0], 0));
823 operands[0] = replace_equiv_address (operands[0], operands[2]);
824 emit_move_insn (operands[0], operands[1]);
829 ; movdi instruction pattern(s).
832 (define_expand "movdi"
833 [(set (match_operand:DI 0 "general_operand" "")
834 (match_operand:DI 1 "general_operand" ""))]
837 /* Handle symbolic constants. */
838 if (TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
839 emit_symbolic_move (operands);
842 (define_insn "*movdi_larl"
843 [(set (match_operand:DI 0 "register_operand" "=d")
844 (match_operand:DI 1 "larl_operand" "X"))]
846 && !FP_REG_P (operands[0])"
848 [(set_attr "op_type" "RIL")
849 (set_attr "type" "larl")])
851 (define_insn "*movdi_64"
852 [(set (match_operand:DI 0 "nonimmediate_operand"
853 "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q")
854 (match_operand:DI 1 "general_operand"
855 "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))]
873 [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
874 (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd,
875 fstored,fstored,cs")])
877 (define_insn "*movdi_31"
878 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
879 (match_operand:DI 1 "general_operand" "Q,d,dKm,d,*f,R,T,*f,*f,Q"))]
892 [(set_attr "op_type" "RS,RS,NN,NN,RR,RX,RXY,RX,RXY,SS")
893 (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,cs")])
896 [(set (match_operand:DI 0 "nonimmediate_operand" "")
897 (match_operand:DI 1 "general_operand" ""))]
898 "!TARGET_64BIT && reload_completed
899 && s390_split_ok_p (operands[0], operands[1], DImode, 0)"
900 [(set (match_dup 2) (match_dup 4))
901 (set (match_dup 3) (match_dup 5))]
903 operands[2] = operand_subword (operands[0], 0, 0, DImode);
904 operands[3] = operand_subword (operands[0], 1, 0, DImode);
905 operands[4] = operand_subword (operands[1], 0, 0, DImode);
906 operands[5] = operand_subword (operands[1], 1, 0, DImode);
910 [(set (match_operand:DI 0 "nonimmediate_operand" "")
911 (match_operand:DI 1 "general_operand" ""))]
912 "!TARGET_64BIT && reload_completed
913 && s390_split_ok_p (operands[0], operands[1], DImode, 1)"
914 [(set (match_dup 2) (match_dup 4))
915 (set (match_dup 3) (match_dup 5))]
917 operands[2] = operand_subword (operands[0], 1, 0, DImode);
918 operands[3] = operand_subword (operands[0], 0, 0, DImode);
919 operands[4] = operand_subword (operands[1], 1, 0, DImode);
920 operands[5] = operand_subword (operands[1], 0, 0, DImode);
924 [(set (match_operand:DI 0 "register_operand" "")
925 (match_operand:DI 1 "memory_operand" ""))]
926 "!TARGET_64BIT && reload_completed
927 && !FP_REG_P (operands[0])
928 && !s_operand (operands[1], VOIDmode)"
929 [(set (match_dup 0) (match_dup 1))]
931 rtx addr = operand_subword (operands[0], 1, 0, DImode);
932 s390_load_address (addr, XEXP (operands[1], 0));
933 operands[1] = replace_equiv_address (operands[1], addr);
936 (define_expand "reload_outdi"
937 [(parallel [(match_operand:DI 0 "memory_operand" "")
938 (match_operand:DI 1 "register_operand" "d")
939 (match_operand:SI 2 "register_operand" "=&a")])]
942 s390_load_address (operands[2], XEXP (operands[0], 0));
943 operands[0] = replace_equiv_address (operands[0], operands[2]);
944 emit_move_insn (operands[0], operands[1]);
949 [(set (match_operand:DI 0 "register_operand" "")
950 (mem:DI (match_operand 1 "address_operand" "")))]
952 && !FP_REG_P (operands[0])
953 && GET_CODE (operands[1]) == SYMBOL_REF
954 && CONSTANT_POOL_ADDRESS_P (operands[1])
955 && get_pool_mode (operands[1]) == DImode
956 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
957 [(set (match_dup 0) (match_dup 2))]
958 "operands[2] = get_pool_constant (operands[1]);")
960 (define_insn "*la_64"
961 [(set (match_operand:DI 0 "register_operand" "=d,d")
962 (match_operand:QI 1 "address_operand" "U,W"))]
967 [(set_attr "op_type" "RX,RXY")
968 (set_attr "type" "la")])
972 [(set (match_operand:DI 0 "register_operand" "")
973 (match_operand:QI 1 "address_operand" ""))
974 (clobber (reg:CC 33))])]
976 && preferred_la_operand_p (operands[1], const0_rtx)"
977 [(set (match_dup 0) (match_dup 1))]
981 [(set (match_operand:DI 0 "register_operand" "")
982 (match_operand:DI 1 "register_operand" ""))
985 (plus:DI (match_dup 0)
986 (match_operand:DI 2 "nonmemory_operand" "")))
987 (clobber (reg:CC 33))])]
989 && !reg_overlap_mentioned_p (operands[0], operands[2])
990 && preferred_la_operand_p (operands[1], operands[2])"
991 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
994 (define_expand "reload_indi"
995 [(parallel [(match_operand:DI 0 "register_operand" "=a")
996 (match_operand:DI 1 "s390_plus_operand" "")
997 (match_operand:DI 2 "register_operand" "=&a")])]
1000 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1005 ; movsi instruction pattern(s).
1008 (define_expand "movsi"
1009 [(set (match_operand:SI 0 "general_operand" "")
1010 (match_operand:SI 1 "general_operand" ""))]
1013 /* Handle symbolic constants. */
1014 if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1]))
1015 emit_symbolic_move (operands);
1018 (define_insn "*movsi_larl"
1019 [(set (match_operand:SI 0 "register_operand" "=d")
1020 (match_operand:SI 1 "larl_operand" "X"))]
1021 "!TARGET_64BIT && TARGET_CPU_ZARCH
1022 && !FP_REG_P (operands[0])"
1024 [(set_attr "op_type" "RIL")
1025 (set_attr "type" "larl")])
1027 (define_insn "*movsi_zarch"
1028 [(set (match_operand:SI 0 "nonimmediate_operand"
1029 "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
1030 (match_operand:SI 1 "general_operand"
1031 "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
1049 [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1050 (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
1052 (define_insn "*movsi_esa"
1053 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q")
1054 (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))]
1065 [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS")
1066 (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")])
1069 [(set (match_operand:SI 0 "register_operand" "")
1070 (mem:SI (match_operand 1 "address_operand" "")))]
1071 "!FP_REG_P (operands[0])
1072 && GET_CODE (operands[1]) == SYMBOL_REF
1073 && CONSTANT_POOL_ADDRESS_P (operands[1])
1074 && get_pool_mode (operands[1]) == SImode
1075 && legitimate_reload_constant_p (get_pool_constant (operands[1]))"
1076 [(set (match_dup 0) (match_dup 2))]
1077 "operands[2] = get_pool_constant (operands[1]);")
1079 (define_insn "*la_31"
1080 [(set (match_operand:SI 0 "register_operand" "=d,d")
1081 (match_operand:QI 1 "address_operand" "U,W"))]
1082 "!TARGET_64BIT && legitimate_la_operand_p (operands[1])"
1086 [(set_attr "op_type" "RX,RXY")
1087 (set_attr "type" "la")])
1091 [(set (match_operand:SI 0 "register_operand" "")
1092 (match_operand:QI 1 "address_operand" ""))
1093 (clobber (reg:CC 33))])]
1095 && preferred_la_operand_p (operands[1], const0_rtx)"
1096 [(set (match_dup 0) (match_dup 1))]
1100 [(set (match_operand:SI 0 "register_operand" "")
1101 (match_operand:SI 1 "register_operand" ""))
1104 (plus:SI (match_dup 0)
1105 (match_operand:SI 2 "nonmemory_operand" "")))
1106 (clobber (reg:CC 33))])]
1108 && !reg_overlap_mentioned_p (operands[0], operands[2])
1109 && preferred_la_operand_p (operands[1], operands[2])"
1110 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
1113 (define_insn "*la_31_and"
1114 [(set (match_operand:SI 0 "register_operand" "=d,d")
1115 (and:SI (match_operand:QI 1 "address_operand" "U,W")
1116 (const_int 2147483647)))]
1121 [(set_attr "op_type" "RX,RXY")
1122 (set_attr "type" "la")])
1124 (define_insn_and_split "*la_31_and_cc"
1125 [(set (match_operand:SI 0 "register_operand" "=d")
1126 (and:SI (match_operand:QI 1 "address_operand" "p")
1127 (const_int 2147483647)))
1128 (clobber (reg:CC 33))]
1131 "&& reload_completed"
1133 (and:SI (match_dup 1) (const_int 2147483647)))]
1135 [(set_attr "op_type" "RX")
1136 (set_attr "type" "la")])
1138 (define_insn "force_la_31"
1139 [(set (match_operand:SI 0 "register_operand" "=d,d")
1140 (match_operand:QI 1 "address_operand" "U,W"))
1141 (use (const_int 0))]
1146 [(set_attr "op_type" "RX")
1147 (set_attr "type" "la")])
1149 (define_expand "reload_insi"
1150 [(parallel [(match_operand:SI 0 "register_operand" "=a")
1151 (match_operand:SI 1 "s390_plus_operand" "")
1152 (match_operand:SI 2 "register_operand" "=&a")])]
1155 s390_expand_plus_operand (operands[0], operands[1], operands[2]);
1160 ; movhi instruction pattern(s).
1163 (define_expand "movhi"
1164 [(set (match_operand:HI 0 "nonimmediate_operand" "")
1165 (match_operand:HI 1 "general_operand" ""))]
1168 /* Make it explicit that loading a register from memory
1169 always sign-extends (at least) to SImode. */
1170 if (optimize && !no_new_pseudos
1171 && register_operand (operands[0], VOIDmode)
1172 && GET_CODE (operands[1]) == MEM)
1174 rtx tmp = gen_reg_rtx (SImode);
1175 rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
1176 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1177 operands[1] = gen_lowpart (HImode, tmp);
1181 (define_insn "*movhi"
1182 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,T,?Q")
1183 (match_operand:HI 1 "general_operand" "d,n,R,T,d,d,?Q"))]
1193 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SS")
1194 (set_attr "type" "lr,*,*,*,store,store,cs")])
1197 [(set (match_operand:HI 0 "register_operand" "")
1198 (mem:HI (match_operand 1 "address_operand" "")))]
1199 "GET_CODE (operands[1]) == SYMBOL_REF
1200 && CONSTANT_POOL_ADDRESS_P (operands[1])
1201 && get_pool_mode (operands[1]) == HImode
1202 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1203 [(set (match_dup 0) (match_dup 2))]
1204 "operands[2] = get_pool_constant (operands[1]);")
1207 ; movqi instruction pattern(s).
1210 (define_expand "movqi"
1211 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1212 (match_operand:QI 1 "general_operand" ""))]
1215 /* On z/Architecture, zero-extending from memory to register
1216 is just as fast as a QImode load. */
1217 if (TARGET_ZARCH && optimize && !no_new_pseudos
1218 && register_operand (operands[0], VOIDmode)
1219 && GET_CODE (operands[1]) == MEM)
1221 rtx tmp = gen_reg_rtx (word_mode);
1222 rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
1223 emit_insn (gen_rtx_SET (VOIDmode, tmp, ext));
1224 operands[1] = gen_lowpart (QImode, tmp);
1228 (define_insn "*movqi"
1229 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,T,Q,S,?Q")
1230 (match_operand:QI 1 "general_operand" "d,n,R,T,d,d,n,n,?Q"))]
1242 [(set_attr "op_type" "RR,RI,RX,RXY,RX,RXY,SI,SIY,SS")
1243 (set_attr "type" "lr,*,*,*,store,store,store,store,cs")])
1246 [(set (match_operand:QI 0 "nonimmediate_operand" "")
1247 (mem:QI (match_operand 1 "address_operand" "")))]
1248 "GET_CODE (operands[1]) == SYMBOL_REF
1249 && CONSTANT_POOL_ADDRESS_P (operands[1])
1250 && get_pool_mode (operands[1]) == QImode
1251 && GET_CODE (get_pool_constant (operands[1])) == CONST_INT"
1252 [(set (match_dup 0) (match_dup 2))]
1253 "operands[2] = get_pool_constant (operands[1]);")
1256 ; movstrictqi instruction pattern(s).
1259 (define_insn "*movstrictqi"
1260 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+d,d"))
1261 (match_operand:QI 1 "memory_operand" "R,T"))]
1266 [(set_attr "op_type" "RX,RXY")])
1269 ; movstricthi instruction pattern(s).
1272 (define_insn "*movstricthi"
1273 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d"))
1274 (match_operand:HI 1 "memory_operand" "Q,S"))
1275 (clobber (reg:CC 33))]
1280 [(set_attr "op_type" "RS,RSY")])
1283 ; movstrictsi instruction pattern(s).
1286 (define_insn "movstrictsi"
1287 [(set (strict_low_part (match_operand:SI 0 "register_operand" "+d,d,d"))
1288 (match_operand:SI 1 "general_operand" "d,R,T"))]
1294 [(set_attr "op_type" "RR,RX,RXY")
1295 (set_attr "type" "lr,load,load")])
1298 ; movdf instruction pattern(s).
1301 (define_expand "movdf"
1302 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1303 (match_operand:DF 1 "general_operand" ""))]
1307 (define_insn "*movdf_64"
1308 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q")
1309 (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))]
1321 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS")
1322 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,cs")])
1324 (define_insn "*movdf_31"
1325 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q")
1326 (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))]
1339 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,NN,NN,SS")
1340 (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,cs")])
1343 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1344 (match_operand:DF 1 "general_operand" ""))]
1345 "!TARGET_64BIT && reload_completed
1346 && s390_split_ok_p (operands[0], operands[1], DFmode, 0)"
1347 [(set (match_dup 2) (match_dup 4))
1348 (set (match_dup 3) (match_dup 5))]
1350 operands[2] = operand_subword (operands[0], 0, 0, DFmode);
1351 operands[3] = operand_subword (operands[0], 1, 0, DFmode);
1352 operands[4] = operand_subword (operands[1], 0, 0, DFmode);
1353 operands[5] = operand_subword (operands[1], 1, 0, DFmode);
1357 [(set (match_operand:DF 0 "nonimmediate_operand" "")
1358 (match_operand:DF 1 "general_operand" ""))]
1359 "!TARGET_64BIT && reload_completed
1360 && s390_split_ok_p (operands[0], operands[1], DFmode, 1)"
1361 [(set (match_dup 2) (match_dup 4))
1362 (set (match_dup 3) (match_dup 5))]
1364 operands[2] = operand_subword (operands[0], 1, 0, DFmode);
1365 operands[3] = operand_subword (operands[0], 0, 0, DFmode);
1366 operands[4] = operand_subword (operands[1], 1, 0, DFmode);
1367 operands[5] = operand_subword (operands[1], 0, 0, DFmode);
1371 [(set (match_operand:DF 0 "register_operand" "")
1372 (match_operand:DF 1 "memory_operand" ""))]
1373 "!TARGET_64BIT && reload_completed
1374 && !FP_REG_P (operands[0])
1375 && !s_operand (operands[1], VOIDmode)"
1376 [(set (match_dup 0) (match_dup 1))]
1378 rtx addr = operand_subword (operands[0], 1, 0, DFmode);
1379 s390_load_address (addr, XEXP (operands[1], 0));
1380 operands[1] = replace_equiv_address (operands[1], addr);
1383 (define_expand "reload_outdf"
1384 [(parallel [(match_operand:DF 0 "memory_operand" "")
1385 (match_operand:DF 1 "register_operand" "d")
1386 (match_operand:SI 2 "register_operand" "=&a")])]
1389 s390_load_address (operands[2], XEXP (operands[0], 0));
1390 operands[0] = replace_equiv_address (operands[0], operands[2]);
1391 emit_move_insn (operands[0], operands[1]);
1396 ; movsf instruction pattern(s).
1399 (define_insn "movsf"
1400 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q")
1401 (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))]
1415 [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
1416 (set_attr "type" "floads,floads,floads,fstores,fstores,lr,load,load,store,store,cs")])
1419 ; load_multiple pattern(s).
1421 ; ??? Due to reload problems with replacing registers inside match_parallel
1422 ; we currently support load_multiple/store_multiple only after reload.
1425 (define_expand "load_multiple"
1426 [(match_par_dup 3 [(set (match_operand 0 "" "")
1427 (match_operand 1 "" ""))
1428 (use (match_operand 2 "" ""))])]
1431 enum machine_mode mode;
1437 /* Support only loading a constant number of fixed-point registers from
1438 memory and only bother with this if more than two */
1439 if (GET_CODE (operands[2]) != CONST_INT
1440 || INTVAL (operands[2]) < 2
1441 || INTVAL (operands[2]) > 16
1442 || GET_CODE (operands[1]) != MEM
1443 || GET_CODE (operands[0]) != REG
1444 || REGNO (operands[0]) >= 16)
1447 count = INTVAL (operands[2]);
1448 regno = REGNO (operands[0]);
1449 mode = GET_MODE (operands[0]);
1450 if (mode != SImode && mode != word_mode)
1453 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1456 if (GET_CODE (XEXP (operands[1], 0)) == REG)
1458 from = XEXP (operands[1], 0);
1461 else if (GET_CODE (XEXP (operands[1], 0)) == PLUS
1462 && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG
1463 && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT)
1465 from = XEXP (XEXP (operands[1], 0), 0);
1466 off = INTVAL (XEXP (XEXP (operands[1], 0), 1));
1473 from = force_reg (Pmode, XEXP (operands[1], 0));
1477 for (i = 0; i < count; i++)
1478 XVECEXP (operands[3], 0, i)
1479 = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i),
1480 change_address (operands[1], mode,
1481 plus_constant (from, off + i * GET_MODE_SIZE (mode))));
1484 (define_insn "*load_multiple_di"
1485 [(match_parallel 0 "load_multiple_operation"
1486 [(set (match_operand:DI 1 "register_operand" "=r")
1487 (match_operand:DI 2 "s_operand" "QS"))])]
1488 "reload_completed && word_mode == DImode"
1490 int words = XVECLEN (operands[0], 0);
1491 operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1);
1492 return "lmg\t%1,%0,%2";
1494 [(set_attr "op_type" "RSY")
1495 (set_attr "type" "lm")])
1497 (define_insn "*load_multiple_si"
1498 [(match_parallel 0 "load_multiple_operation"
1499 [(set (match_operand:SI 1 "register_operand" "=r,r")
1500 (match_operand:SI 2 "s_operand" "Q,S"))])]
1503 int words = XVECLEN (operands[0], 0);
1504 operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1);
1505 return which_alternative == 0 ? "lm\t%1,%0,%2" : "lmy\t%1,%0,%2";
1507 [(set_attr "op_type" "RS,RSY")
1508 (set_attr "type" "lm")])
1511 ; store multiple pattern(s).
1514 (define_expand "store_multiple"
1515 [(match_par_dup 3 [(set (match_operand 0 "" "")
1516 (match_operand 1 "" ""))
1517 (use (match_operand 2 "" ""))])]
1520 enum machine_mode mode;
1526 /* Support only storing a constant number of fixed-point registers to
1527 memory and only bother with this if more than two. */
1528 if (GET_CODE (operands[2]) != CONST_INT
1529 || INTVAL (operands[2]) < 2
1530 || INTVAL (operands[2]) > 16
1531 || GET_CODE (operands[0]) != MEM
1532 || GET_CODE (operands[1]) != REG
1533 || REGNO (operands[1]) >= 16)
1536 count = INTVAL (operands[2]);
1537 regno = REGNO (operands[1]);
1538 mode = GET_MODE (operands[1]);
1539 if (mode != SImode && mode != word_mode)
1542 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
1546 if (GET_CODE (XEXP (operands[0], 0)) == REG)
1548 to = XEXP (operands[0], 0);
1551 else if (GET_CODE (XEXP (operands[0], 0)) == PLUS
1552 && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG
1553 && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT)
1555 to = XEXP (XEXP (operands[0], 0), 0);
1556 off = INTVAL (XEXP (XEXP (operands[0], 0), 1));
1563 to = force_reg (Pmode, XEXP (operands[0], 0));
1567 for (i = 0; i < count; i++)
1568 XVECEXP (operands[3], 0, i)
1569 = gen_rtx_SET (VOIDmode,
1570 change_address (operands[0], mode,
1571 plus_constant (to, off + i * GET_MODE_SIZE (mode))),
1572 gen_rtx_REG (mode, regno + i));
1575 (define_insn "*store_multiple_di"
1576 [(match_parallel 0 "store_multiple_operation"
1577 [(set (match_operand:DI 1 "s_operand" "=QS")
1578 (match_operand:DI 2 "register_operand" "r"))])]
1579 "reload_completed && word_mode == DImode"
1581 int words = XVECLEN (operands[0], 0);
1582 operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1);
1583 return "stmg\t%2,%0,%1";
1585 [(set_attr "op_type" "RSY")
1586 (set_attr "type" "stm")])
1589 (define_insn "*store_multiple_si"
1590 [(match_parallel 0 "store_multiple_operation"
1591 [(set (match_operand:SI 1 "s_operand" "=Q,S")
1592 (match_operand:SI 2 "register_operand" "r,r"))])]
1595 int words = XVECLEN (operands[0], 0);
1596 operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1);
1597 return which_alternative == 0 ? "stm\t%2,%0,%1" : "stmy\t%2,%0,%1";
1599 [(set_attr "op_type" "RS,RSY")
1600 (set_attr "type" "stm")])
1603 ;; String instructions.
1606 (define_insn "*execute"
1607 [(match_parallel 0 ""
1608 [(unspec [(match_operand 1 "register_operand" "a")
1609 (match_operand:BLK 2 "memory_operand" "R")
1610 (match_operand 3 "" "")] UNSPEC_EXECUTE)])]
1611 "GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT
1612 && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD"
1614 [(set_attr "op_type" "RX")])
1618 ; strlenM instruction pattern(s).
1621 (define_expand "strlendi"
1622 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1625 (unspec:DI [(const_int 0)
1626 (match_operand:BLK 1 "memory_operand" "")
1628 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1629 (clobber (scratch:DI))
1630 (clobber (reg:CC 33))])
1632 [(set (match_operand:DI 0 "register_operand" "")
1633 (minus:DI (match_dup 4) (match_dup 5)))
1634 (clobber (reg:CC 33))])]
1637 operands[4] = gen_reg_rtx (DImode);
1638 operands[5] = gen_reg_rtx (DImode);
1639 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1640 operands[1] = replace_equiv_address (operands[1], operands[5]);
1643 (define_insn "*strlendi"
1644 [(set (match_operand:DI 0 "register_operand" "=a")
1645 (unspec:DI [(match_operand:DI 2 "general_operand" "0")
1646 (mem:BLK (match_operand:DI 3 "register_operand" "1"))
1648 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1649 (clobber (match_scratch:DI 1 "=a"))
1650 (clobber (reg:CC 33))]
1652 "srst\t%0,%1\;jo\t.-4"
1653 [(set_attr "op_type" "NN")
1654 (set_attr "type" "vs")
1655 (set_attr "length" "8")])
1657 (define_expand "strlensi"
1658 [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
1661 (unspec:SI [(const_int 0)
1662 (match_operand:BLK 1 "memory_operand" "")
1664 (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
1665 (clobber (scratch:SI))
1666 (clobber (reg:CC 33))])
1668 [(set (match_operand:SI 0 "register_operand" "")
1669 (minus:SI (match_dup 4) (match_dup 5)))
1670 (clobber (reg:CC 33))])]
1673 operands[4] = gen_reg_rtx (SImode);
1674 operands[5] = gen_reg_rtx (SImode);
1675 emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
1676 operands[1] = replace_equiv_address (operands[1], operands[5]);
1679 (define_insn "*strlensi"
1680 [(set (match_operand:SI 0 "register_operand" "=a")
1681 (unspec:SI [(match_operand:SI 2 "general_operand" "0")
1682 (mem:BLK (match_operand:SI 3 "register_operand" "1"))
1684 (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
1685 (clobber (match_scratch:SI 1 "=a"))
1686 (clobber (reg:CC 33))]
1688 "srst\t%0,%1\;jo\t.-4"
1689 [(set_attr "op_type" "NN")
1690 (set_attr "type" "vs")
1691 (set_attr "length" "8")])
1694 ; movmemM instruction pattern(s).
1697 (define_expand "movmemdi"
1698 [(set (match_operand:BLK 0 "memory_operand" "")
1699 (match_operand:BLK 1 "memory_operand" ""))
1700 (use (match_operand:DI 2 "general_operand" ""))
1701 (match_operand 3 "" "")]
1703 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1705 (define_expand "movmemsi"
1706 [(set (match_operand:BLK 0 "memory_operand" "")
1707 (match_operand:BLK 1 "memory_operand" ""))
1708 (use (match_operand:SI 2 "general_operand" ""))
1709 (match_operand 3 "" "")]
1711 "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;")
1713 ; Move a block that is up to 256 bytes in length.
1714 ; The block length is taken as (operands[2] % 256) + 1.
1716 (define_expand "movmem_short"
1718 [(set (match_operand:BLK 0 "memory_operand" "")
1719 (match_operand:BLK 1 "memory_operand" ""))
1720 (use (match_operand 2 "nonmemory_operand" ""))
1721 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1722 (clobber (match_dup 3))])]
1724 "operands[3] = gen_rtx_SCRATCH (Pmode);")
1726 (define_insn "*movmem_short"
1727 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
1728 (match_operand:BLK 1 "memory_operand" "Q,Q,Q"))
1729 (use (match_operand 2 "nonmemory_operand" "n,a,a"))
1730 (use (match_operand 3 "immediate_operand" "X,R,X"))
1731 (clobber (match_scratch 4 "=X,X,&a"))]
1732 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
1733 && GET_MODE (operands[4]) == Pmode"
1735 [(set_attr "op_type" "SS,RX,RX")
1736 (set_attr "type" "cs")])
1739 [(set (match_operand:BLK 0 "memory_operand" "")
1740 (match_operand:BLK 1 "memory_operand" ""))
1741 (use (match_operand 2 "const_int_operand" ""))
1742 (use (match_operand 3 "immediate_operand" ""))
1743 (clobber (scratch))]
1746 [(set (match_dup 0) (match_dup 1))
1747 (use (match_dup 2))])]
1748 "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);")
1751 [(set (match_operand:BLK 0 "memory_operand" "")
1752 (match_operand:BLK 1 "memory_operand" ""))
1753 (use (match_operand 2 "register_operand" ""))
1754 (use (match_operand 3 "memory_operand" ""))
1755 (clobber (scratch))]
1758 [(unspec [(match_dup 2) (match_dup 3)
1759 (const_int 0)] UNSPEC_EXECUTE)
1760 (set (match_dup 0) (match_dup 1))
1761 (use (const_int 1))])]
1765 [(set (match_operand:BLK 0 "memory_operand" "")
1766 (match_operand:BLK 1 "memory_operand" ""))
1767 (use (match_operand 2 "register_operand" ""))
1768 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1769 (clobber (match_operand 3 "register_operand" ""))]
1770 "reload_completed && TARGET_CPU_ZARCH"
1771 [(set (match_dup 3) (label_ref (match_dup 4)))
1773 [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
1774 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
1775 (set (match_dup 0) (match_dup 1))
1776 (use (const_int 1))])]
1777 "operands[4] = gen_label_rtx ();")
1780 [(set (match_operand:BLK 0 "memory_operand" "=Q")
1781 (match_operand:BLK 1 "memory_operand" "Q"))
1782 (use (match_operand 2 "const_int_operand" "n"))]
1784 "mvc\t%O0(%2,%R0),%1"
1785 [(set_attr "op_type" "SS")
1786 (set_attr "type" "cs")])
1788 ; Move a block of arbitrary length.
1790 (define_expand "movmem_long"
1792 [(clobber (match_dup 2))
1793 (clobber (match_dup 3))
1794 (set (match_operand:BLK 0 "memory_operand" "")
1795 (match_operand:BLK 1 "memory_operand" ""))
1796 (use (match_operand 2 "general_operand" ""))
1798 (clobber (reg:CC 33))])]
1801 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1802 rtx reg0 = gen_reg_rtx (dword_mode);
1803 rtx reg1 = gen_reg_rtx (dword_mode);
1804 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1805 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
1806 rtx len0 = gen_lowpart (Pmode, reg0);
1807 rtx len1 = gen_lowpart (Pmode, reg1);
1809 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1810 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1811 emit_move_insn (len0, operands[2]);
1813 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
1814 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
1815 emit_move_insn (len1, operands[2]);
1817 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1818 operands[1] = replace_equiv_address_nv (operands[1], addr1);
1823 (define_insn "*movmem_long_64"
1824 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1825 (clobber (match_operand:TI 1 "register_operand" "=d"))
1826 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1827 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))
1830 (clobber (reg:CC 33))]
1832 "mvcle\t%0,%1,0\;jo\t.-4"
1833 [(set_attr "op_type" "NN")
1834 (set_attr "type" "vs")
1835 (set_attr "length" "8")])
1837 (define_insn "*movmem_long_31"
1838 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1839 (clobber (match_operand:DI 1 "register_operand" "=d"))
1840 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
1841 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))
1844 (clobber (reg:CC 33))]
1846 "mvcle\t%0,%1,0\;jo\t.-4"
1847 [(set_attr "op_type" "NN")
1848 (set_attr "type" "vs")
1849 (set_attr "length" "8")])
1852 ; clrmemM instruction pattern(s).
1855 (define_expand "clrmemdi"
1856 [(set (match_operand:BLK 0 "memory_operand" "")
1858 (use (match_operand:DI 1 "general_operand" ""))
1859 (match_operand 2 "" "")]
1861 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
1863 (define_expand "clrmemsi"
1864 [(set (match_operand:BLK 0 "memory_operand" "")
1866 (use (match_operand:SI 1 "general_operand" ""))
1867 (match_operand 2 "" "")]
1869 "s390_expand_clrmem (operands[0], operands[1]); DONE;")
1871 ; Clear a block that is up to 256 bytes in length.
1872 ; The block length is taken as (operands[1] % 256) + 1.
1874 (define_expand "clrmem_short"
1876 [(set (match_operand:BLK 0 "memory_operand" "")
1878 (use (match_operand 1 "nonmemory_operand" ""))
1879 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1880 (clobber (match_dup 2))
1881 (clobber (reg:CC 33))])]
1883 "operands[2] = gen_rtx_SCRATCH (Pmode);")
1885 (define_insn "*clrmem_short"
1886 [(set (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
1888 (use (match_operand 1 "nonmemory_operand" "n,a,a"))
1889 (use (match_operand 2 "immediate_operand" "X,R,X"))
1890 (clobber (match_scratch 3 "=X,X,&a"))
1891 (clobber (reg:CC 33))]
1892 "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode)
1893 && GET_MODE (operands[3]) == Pmode"
1895 [(set_attr "op_type" "SS,RX,RX")
1896 (set_attr "type" "cs")])
1899 [(set (match_operand:BLK 0 "memory_operand" "")
1901 (use (match_operand 1 "const_int_operand" ""))
1902 (use (match_operand 2 "immediate_operand" ""))
1904 (clobber (reg:CC 33))]
1907 [(set (match_dup 0) (const_int 0))
1909 (clobber (reg:CC 33))])]
1910 "operands[1] = GEN_INT ((INTVAL (operands[1]) & 0xff) + 1);")
1913 [(set (match_operand:BLK 0 "memory_operand" "")
1915 (use (match_operand 1 "register_operand" ""))
1916 (use (match_operand 2 "memory_operand" ""))
1918 (clobber (reg:CC 33))]
1921 [(unspec [(match_dup 1) (match_dup 2)
1922 (const_int 0)] UNSPEC_EXECUTE)
1923 (set (match_dup 0) (const_int 0))
1925 (clobber (reg:CC 33))])]
1929 [(set (match_operand:BLK 0 "memory_operand" "")
1931 (use (match_operand 1 "register_operand" ""))
1932 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
1933 (clobber (match_operand 2 "register_operand" ""))
1934 (clobber (reg:CC 33))]
1935 "reload_completed && TARGET_CPU_ZARCH"
1936 [(set (match_dup 2) (label_ref (match_dup 3)))
1938 [(unspec [(match_dup 1) (mem:BLK (match_dup 2))
1939 (label_ref (match_dup 3))] UNSPEC_EXECUTE)
1940 (set (match_dup 0) (const_int 0))
1942 (clobber (reg:CC 33))])]
1943 "operands[3] = gen_label_rtx ();")
1945 (define_insn "*xc_zero"
1946 [(set (match_operand:BLK 0 "memory_operand" "=Q")
1948 (use (match_operand 1 "const_int_operand" "n"))
1949 (clobber (reg:CC 33))]
1951 "xc\t%O0(%1,%R0),%0"
1952 [(set_attr "op_type" "SS")
1953 (set_attr "type" "cs")])
1955 ; Clear a block of arbitrary length.
1957 (define_expand "clrmem_long"
1959 [(clobber (match_dup 1))
1960 (set (match_operand:BLK 0 "memory_operand" "")
1962 (use (match_operand 1 "general_operand" ""))
1964 (clobber (reg:CC 33))])]
1967 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
1968 rtx reg0 = gen_reg_rtx (dword_mode);
1969 rtx reg1 = gen_reg_rtx (dword_mode);
1970 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
1971 rtx len0 = gen_lowpart (Pmode, reg0);
1973 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
1974 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
1975 emit_move_insn (len0, operands[1]);
1977 emit_move_insn (reg1, const0_rtx);
1979 operands[0] = replace_equiv_address_nv (operands[0], addr0);
1984 (define_insn "*clrmem_long_64"
1985 [(clobber (match_operand:TI 0 "register_operand" "=d"))
1986 (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
1989 (use (match_operand:TI 1 "register_operand" "d"))
1990 (clobber (reg:CC 33))]
1992 "mvcle\t%0,%1,0\;jo\t.-4"
1993 [(set_attr "op_type" "NN")
1994 (set_attr "type" "vs")
1995 (set_attr "length" "8")])
1997 (define_insn "*clrmem_long_31"
1998 [(clobber (match_operand:DI 0 "register_operand" "=d"))
1999 (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2002 (use (match_operand:DI 1 "register_operand" "d"))
2003 (clobber (reg:CC 33))]
2005 "mvcle\t%0,%1,0\;jo\t.-4"
2006 [(set_attr "op_type" "NN")
2007 (set_attr "type" "vs")
2008 (set_attr "length" "8")])
2011 ; cmpmemM instruction pattern(s).
2014 (define_expand "cmpmemsi"
2015 [(set (match_operand:SI 0 "register_operand" "")
2016 (compare:SI (match_operand:BLK 1 "memory_operand" "")
2017 (match_operand:BLK 2 "memory_operand" "") ) )
2018 (use (match_operand:SI 3 "general_operand" ""))
2019 (use (match_operand:SI 4 "" ""))]
2021 "s390_expand_cmpmem (operands[0], operands[1],
2022 operands[2], operands[3]); DONE;")
2024 ; Compare a block that is up to 256 bytes in length.
2025 ; The block length is taken as (operands[2] % 256) + 1.
2027 (define_expand "cmpmem_short"
2030 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2031 (match_operand:BLK 1 "memory_operand" "")))
2032 (use (match_operand 2 "nonmemory_operand" ""))
2033 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
2034 (clobber (match_dup 3))])]
2036 "operands[3] = gen_rtx_SCRATCH (Pmode);")
2038 (define_insn "*cmpmem_short"
2040 (compare:CCU (match_operand:BLK 0 "memory_operand" "=Q,Q,Q")
2041 (match_operand:BLK 1 "memory_operand" "Q,Q,Q")))
2042 (use (match_operand 2 "nonmemory_operand" "n,a,a"))
2043 (use (match_operand 3 "immediate_operand" "X,R,X"))
2044 (clobber (match_scratch 4 "=X,X,&a"))]
2045 "(GET_MODE (operands[2]) == Pmode || GET_MODE (operands[2]) == VOIDmode)
2046 && GET_MODE (operands[4]) == Pmode"
2048 [(set_attr "op_type" "SS,RX,RX")
2049 (set_attr "type" "cs")])
2053 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2054 (match_operand:BLK 1 "memory_operand" "")))
2055 (use (match_operand 2 "const_int_operand" ""))
2056 (use (match_operand 3 "immediate_operand" ""))
2057 (clobber (scratch))]
2060 [(set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2061 (use (match_dup 2))])]
2062 "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);")
2066 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2067 (match_operand:BLK 1 "memory_operand" "")))
2068 (use (match_operand 2 "register_operand" ""))
2069 (use (match_operand 3 "memory_operand" ""))
2070 (clobber (scratch))]
2073 [(unspec [(match_dup 2) (match_dup 3)
2074 (const_int 0)] UNSPEC_EXECUTE)
2075 (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2076 (use (const_int 1))])]
2081 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2082 (match_operand:BLK 1 "memory_operand" "")))
2083 (use (match_operand 2 "register_operand" ""))
2084 (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN)))
2085 (clobber (match_operand 3 "register_operand" ""))]
2086 "reload_completed && TARGET_CPU_ZARCH"
2087 [(set (match_dup 3) (label_ref (match_dup 4)))
2089 [(unspec [(match_dup 2) (mem:BLK (match_dup 3))
2090 (label_ref (match_dup 4))] UNSPEC_EXECUTE)
2091 (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1)))
2092 (use (const_int 1))])]
2093 "operands[4] = gen_label_rtx ();")
2097 (compare:CCU (match_operand:BLK 0 "memory_operand" "=Q")
2098 (match_operand:BLK 1 "memory_operand" "Q")))
2099 (use (match_operand 2 "const_int_operand" "n"))]
2101 "clc\t%O0(%2,%R0),%1"
2102 [(set_attr "op_type" "SS")
2103 (set_attr "type" "cs")])
2105 ; Compare a block of arbitrary length.
2107 (define_expand "cmpmem_long"
2109 [(clobber (match_dup 2))
2110 (clobber (match_dup 3))
2112 (compare:CCU (match_operand:BLK 0 "memory_operand" "")
2113 (match_operand:BLK 1 "memory_operand" "")))
2114 (use (match_operand 2 "general_operand" ""))
2115 (use (match_dup 3))])]
2118 enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode;
2119 rtx reg0 = gen_reg_rtx (dword_mode);
2120 rtx reg1 = gen_reg_rtx (dword_mode);
2121 rtx addr0 = gen_lowpart (Pmode, gen_highpart (word_mode, reg0));
2122 rtx addr1 = gen_lowpart (Pmode, gen_highpart (word_mode, reg1));
2123 rtx len0 = gen_lowpart (Pmode, reg0);
2124 rtx len1 = gen_lowpart (Pmode, reg1);
2126 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg0));
2127 emit_move_insn (addr0, force_operand (XEXP (operands[0], 0), NULL_RTX));
2128 emit_move_insn (len0, operands[2]);
2130 emit_insn (gen_rtx_CLOBBER (VOIDmode, reg1));
2131 emit_move_insn (addr1, force_operand (XEXP (operands[1], 0), NULL_RTX));
2132 emit_move_insn (len1, operands[2]);
2134 operands[0] = replace_equiv_address_nv (operands[0], addr0);
2135 operands[1] = replace_equiv_address_nv (operands[1], addr1);
2140 (define_insn "*cmpmem_long_64"
2141 [(clobber (match_operand:TI 0 "register_operand" "=d"))
2142 (clobber (match_operand:TI 1 "register_operand" "=d"))
2144 (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0))
2145 (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))))
2147 (use (match_dup 3))]
2149 "clcle\t%0,%1,0\;jo\t.-4"
2150 [(set_attr "op_type" "NN")
2151 (set_attr "type" "vs")
2152 (set_attr "length" "8")])
2154 (define_insn "*cmpmem_long_31"
2155 [(clobber (match_operand:DI 0 "register_operand" "=d"))
2156 (clobber (match_operand:DI 1 "register_operand" "=d"))
2158 (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0))
2159 (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))))
2161 (use (match_dup 3))]
2163 "clcle\t%0,%1,0\;jo\t.-4"
2164 [(set_attr "op_type" "NN")
2165 (set_attr "type" "vs")
2166 (set_attr "length" "8")])
2168 ; Convert condition code to integer in range (-1, 0, 1)
2170 (define_insn "*cmpint_si"
2171 [(set (match_operand:SI 0 "register_operand" "=d")
2172 (unspec:SI [(reg:CCU 33)] UNSPEC_CMPINT))]
2175 output_asm_insn ("lhi\t%0,1", operands);
2176 output_asm_insn ("jh\t.+12", operands);
2177 output_asm_insn ("jl\t.+6", operands);
2178 output_asm_insn ("sr\t%0,%0", operands);
2179 return "lcr\t%0,%0";
2181 [(set_attr "op_type" "NN")
2182 (set_attr "length" "16")
2183 (set_attr "type" "other")])
2185 (define_insn "*cmpint_di"
2186 [(set (match_operand:DI 0 "register_operand" "=d")
2187 (sign_extend:DI (unspec:SI [(reg:CCU 33)] UNSPEC_CMPINT)))]
2190 output_asm_insn ("lghi\t%0,1", operands);
2191 output_asm_insn ("jh\t.+16", operands);
2192 output_asm_insn ("jl\t.+8", operands);
2193 output_asm_insn ("sgr\t%0,%0", operands);
2194 return "lcgr\t%0,%0";
2196 [(set_attr "op_type" "NN")
2197 (set_attr "length" "20")
2198 (set_attr "type" "other")])
2202 ;;- Conversion instructions.
2205 (define_insn "*sethighqisi"
2206 [(set (match_operand:SI 0 "register_operand" "=d,d")
2207 (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2208 (clobber (reg:CC 33))]
2213 [(set_attr "op_type" "RS,RSY")])
2215 (define_insn "*sethighhisi"
2216 [(set (match_operand:SI 0 "register_operand" "=d,d")
2217 (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2218 (clobber (reg:CC 33))]
2223 [(set_attr "op_type" "RS,RSY")])
2225 (define_insn "*sethighqidi_64"
2226 [(set (match_operand:DI 0 "register_operand" "=d")
2227 (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH))
2228 (clobber (reg:CC 33))]
2231 [(set_attr "op_type" "RSY")])
2233 (define_insn "*sethighqidi_31"
2234 [(set (match_operand:DI 0 "register_operand" "=d,d")
2235 (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH))
2236 (clobber (reg:CC 33))]
2241 [(set_attr "op_type" "RS,RSY")])
2243 (define_insn_and_split "*extractqi"
2244 [(set (match_operand:SI 0 "register_operand" "=d")
2245 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2246 (match_operand 2 "const_int_operand" "n")
2248 (clobber (reg:CC 33))]
2250 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8"
2252 "&& reload_completed"
2254 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2255 (clobber (reg:CC 33))])
2256 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2258 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2259 operands[1] = change_address (operands[1], QImode, 0);
2261 [(set_attr "atype" "agen")])
2263 (define_insn_and_split "*extracthi"
2264 [(set (match_operand:SI 0 "register_operand" "=d")
2265 (zero_extract:SI (match_operand:QI 1 "s_operand" "Q")
2266 (match_operand 2 "const_int_operand" "n")
2268 (clobber (reg:CC 33))]
2270 && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16"
2272 "&& reload_completed"
2274 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2275 (clobber (reg:CC 33))])
2276 (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))]
2278 operands[2] = GEN_INT (32 - INTVAL (operands[2]));
2279 operands[1] = change_address (operands[1], HImode, 0);
2281 [(set_attr "atype" "agen")])
2284 ; extendsidi2 instruction pattern(s).
2287 (define_expand "extendsidi2"
2288 [(set (match_operand:DI 0 "register_operand" "")
2289 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2295 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2296 emit_move_insn (gen_highpart (SImode, operands[0]), operands[1]);
2297 emit_move_insn (gen_lowpart (SImode, operands[0]), const0_rtx);
2298 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (32)));
2304 (define_insn "*extendsidi2"
2305 [(set (match_operand:DI 0 "register_operand" "=d,d")
2306 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2311 [(set_attr "op_type" "RRE,RXY")])
2314 ; extendhidi2 instruction pattern(s).
2317 (define_expand "extendhidi2"
2318 [(set (match_operand:DI 0 "register_operand" "")
2319 (sign_extend:DI (match_operand:HI 1 "register_operand" "")))]
2325 rtx tmp = gen_reg_rtx (SImode);
2326 emit_insn (gen_extendhisi2 (tmp, operands[1]));
2327 emit_insn (gen_extendsidi2 (operands[0], tmp));
2332 operands[1] = gen_lowpart (DImode, operands[1]);
2333 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2334 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48)));
2340 (define_insn "*extendhidi2"
2341 [(set (match_operand:DI 0 "register_operand" "=d")
2342 (sign_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2345 [(set_attr "op_type" "RXY")])
2348 ; extendqidi2 instruction pattern(s).
2351 (define_expand "extendqidi2"
2352 [(set (match_operand:DI 0 "register_operand" "")
2353 (sign_extend:DI (match_operand:QI 1 "register_operand" "")))]
2359 rtx tmp = gen_reg_rtx (SImode);
2360 emit_insn (gen_extendqisi2 (tmp, operands[1]));
2361 emit_insn (gen_extendsidi2 (operands[0], tmp));
2366 operands[1] = gen_lowpart (DImode, operands[1]);
2367 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2368 emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56)));
2374 (define_insn "*extendqidi2"
2375 [(set (match_operand:DI 0 "register_operand" "=d")
2376 (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2377 "TARGET_64BIT && TARGET_LONG_DISPLACEMENT"
2379 [(set_attr "op_type" "RXY")])
2381 (define_insn_and_split "*extendqidi2_short_displ"
2382 [(set (match_operand:DI 0 "register_operand" "=d")
2383 (sign_extend:DI (match_operand:QI 1 "s_operand" "Q")))
2384 (clobber (reg:CC 33))]
2385 "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT"
2387 "&& reload_completed"
2389 [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH))
2390 (clobber (reg:CC 33))])
2392 [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56)))
2393 (clobber (reg:CC 33))])]
2397 ; extendhisi2 instruction pattern(s).
2400 (define_expand "extendhisi2"
2401 [(set (match_operand:SI 0 "register_operand" "")
2402 (sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
2406 operands[1] = gen_lowpart (SImode, operands[1]);
2407 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16)));
2408 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16)));
2413 (define_insn "*extendhisi2"
2414 [(set (match_operand:SI 0 "register_operand" "=d,d")
2415 (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")))]
2420 [(set_attr "op_type" "RX,RXY")])
2423 ; extendqisi2 instruction pattern(s).
2426 (define_expand "extendqisi2"
2427 [(set (match_operand:SI 0 "register_operand" "")
2428 (sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
2432 operands[1] = gen_lowpart (SImode, operands[1]);
2433 emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24)));
2434 emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24)));
2439 (define_insn "*extendqisi2"
2440 [(set (match_operand:SI 0 "register_operand" "=d")
2441 (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2442 "TARGET_LONG_DISPLACEMENT"
2444 [(set_attr "op_type" "RXY")])
2446 (define_insn_and_split "*extendqisi2_short_displ"
2447 [(set (match_operand:SI 0 "register_operand" "=d")
2448 (sign_extend:SI (match_operand:QI 1 "s_operand" "Q")))
2449 (clobber (reg:CC 33))]
2450 "!TARGET_LONG_DISPLACEMENT"
2452 "&& reload_completed"
2454 [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH))
2455 (clobber (reg:CC 33))])
2457 [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))
2458 (clobber (reg:CC 33))])]
2462 ; extendqihi2 instruction pattern(s).
2467 ; zero_extendsidi2 instruction pattern(s).
2470 (define_expand "zero_extendsidi2"
2471 [(set (match_operand:DI 0 "register_operand" "")
2472 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
2478 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[0]));
2479 emit_move_insn (gen_lowpart (SImode, operands[0]), operands[1]);
2480 emit_move_insn (gen_highpart (SImode, operands[0]), const0_rtx);
2486 (define_insn "*zero_extendsidi2"
2487 [(set (match_operand:DI 0 "register_operand" "=d,d")
2488 (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")))]
2493 [(set_attr "op_type" "RRE,RXY")])
2496 ; zero_extendhidi2 instruction pattern(s).
2499 (define_expand "zero_extendhidi2"
2500 [(set (match_operand:DI 0 "register_operand" "")
2501 (zero_extend:DI (match_operand:HI 1 "register_operand" "")))]
2507 rtx tmp = gen_reg_rtx (SImode);
2508 emit_insn (gen_zero_extendhisi2 (tmp, operands[1]));
2509 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2514 operands[1] = gen_lowpart (DImode, operands[1]);
2515 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48)));
2516 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48)));
2522 (define_insn "*zero_extendhidi2"
2523 [(set (match_operand:DI 0 "register_operand" "=d")
2524 (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))]
2527 [(set_attr "op_type" "RXY")])
2530 ; LLGT-type instructions (zero-extend from 31 bit to 64 bit).
2533 (define_insn "*llgt_sisi"
2534 [(set (match_operand:SI 0 "register_operand" "=d,d")
2535 (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
2536 (const_int 2147483647)))]
2541 [(set_attr "op_type" "RRE,RXE")])
2544 [(set (match_operand:SI 0 "register_operand" "")
2545 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
2546 (const_int 2147483647)))
2547 (clobber (reg:CC 33))]
2548 "TARGET_64BIT && reload_completed"
2550 (and:SI (match_dup 1)
2551 (const_int 2147483647)))]
2554 (define_insn "*llgt_didi"
2555 [(set (match_operand:DI 0 "register_operand" "=d,d")
2556 (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
2557 (const_int 2147483647)))]
2562 [(set_attr "op_type" "RRE,RXE")])
2565 [(set (match_operand:DI 0 "register_operand" "")
2566 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
2567 (const_int 2147483647)))
2568 (clobber (reg:CC 33))]
2569 "TARGET_64BIT && reload_completed"
2571 (and:DI (match_dup 1)
2572 (const_int 2147483647)))]
2575 (define_insn "*llgt_sidi"
2576 [(set (match_operand:DI 0 "register_operand" "=d")
2577 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2578 (const_int 2147483647)))]
2581 [(set_attr "op_type" "RXE")])
2583 (define_insn_and_split "*llgt_sidi_split"
2584 [(set (match_operand:DI 0 "register_operand" "=d")
2585 (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0)
2586 (const_int 2147483647)))
2587 (clobber (reg:CC 33))]
2590 "&& reload_completed"
2592 (and:DI (subreg:DI (match_dup 1) 0)
2593 (const_int 2147483647)))]
2597 ; zero_extendqidi2 instruction pattern(s)
2600 (define_expand "zero_extendqidi2"
2601 [(set (match_operand:DI 0 "register_operand" "")
2602 (zero_extend:DI (match_operand:QI 1 "register_operand" "")))]
2608 rtx tmp = gen_reg_rtx (SImode);
2609 emit_insn (gen_zero_extendqisi2 (tmp, operands[1]));
2610 emit_insn (gen_zero_extendsidi2 (operands[0], tmp));
2615 operands[1] = gen_lowpart (DImode, operands[1]);
2616 emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56)));
2617 emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56)));
2623 (define_insn "*zero_extendqidi2"
2624 [(set (match_operand:DI 0 "register_operand" "=d")
2625 (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))]
2628 [(set_attr "op_type" "RXY")])
2631 ; zero_extendhisi2 instruction pattern(s).
2634 (define_expand "zero_extendhisi2"
2635 [(set (match_operand:SI 0 "register_operand" "")
2636 (zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
2640 operands[1] = gen_lowpart (SImode, operands[1]);
2641 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff)));
2646 (define_insn "*zero_extendhisi2_64"
2647 [(set (match_operand:SI 0 "register_operand" "=d")
2648 (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
2651 [(set_attr "op_type" "RXY")])
2653 (define_insn_and_split "*zero_extendhisi2_31"
2654 [(set (match_operand:SI 0 "register_operand" "=&d")
2655 (zero_extend:SI (match_operand:HI 1 "s_operand" "QS")))
2656 (clobber (reg:CC 33))]
2659 "&& reload_completed"
2660 [(set (match_dup 0) (const_int 0))
2662 [(set (strict_low_part (match_dup 2)) (match_dup 1))
2663 (clobber (reg:CC 33))])]
2664 "operands[2] = gen_lowpart (HImode, operands[0]);"
2665 [(set_attr "atype" "agen")])
2668 ; zero_extendqisi2 instruction pattern(s).
2671 (define_expand "zero_extendqisi2"
2672 [(set (match_operand:SI 0 "register_operand" "")
2673 (zero_extend:SI (match_operand:QI 1 "register_operand" "")))]
2677 operands[1] = gen_lowpart (SImode, operands[1]);
2678 emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff)));
2683 (define_insn "*zero_extendqisi2_64"
2684 [(set (match_operand:SI 0 "register_operand" "=d")
2685 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2688 [(set_attr "op_type" "RXY")])
2690 (define_insn_and_split "*zero_extendqisi2_31"
2691 [(set (match_operand:SI 0 "register_operand" "=&d")
2692 (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
2695 "&& reload_completed"
2696 [(set (match_dup 0) (const_int 0))
2697 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2698 "operands[2] = gen_lowpart (QImode, operands[0]);"
2699 [(set_attr "atype" "agen")])
2702 ; zero_extendqihi2 instruction pattern(s).
2705 (define_expand "zero_extendqihi2"
2706 [(set (match_operand:HI 0 "register_operand" "")
2707 (zero_extend:HI (match_operand:QI 1 "register_operand" "")))]
2711 operands[1] = gen_lowpart (HImode, operands[1]);
2712 emit_insn (gen_andhi3 (operands[0], operands[1], GEN_INT (0xff)));
2717 (define_insn "*zero_extendqihi2_64"
2718 [(set (match_operand:HI 0 "register_operand" "=d")
2719 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2722 [(set_attr "op_type" "RXY")])
2724 (define_insn_and_split "*zero_extendqihi2_31"
2725 [(set (match_operand:HI 0 "register_operand" "=&d")
2726 (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
2729 "&& reload_completed"
2730 [(set (match_dup 0) (const_int 0))
2731 (set (strict_low_part (match_dup 2)) (match_dup 1))]
2732 "operands[2] = gen_lowpart (QImode, operands[0]);"
2733 [(set_attr "atype" "agen")])
2737 ; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s).
2740 (define_expand "fixuns_truncdfdi2"
2741 [(set (match_operand:DI 0 "register_operand" "")
2742 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))]
2743 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2745 rtx label1 = gen_label_rtx ();
2746 rtx label2 = gen_label_rtx ();
2747 rtx temp = gen_reg_rtx (DFmode);
2748 operands[1] = force_reg (DFmode, operands[1]);
2750 emit_insn (gen_cmpdf (operands[1],
2751 CONST_DOUBLE_FROM_REAL_VALUE (
2752 REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode)));
2753 emit_jump_insn (gen_blt (label1));
2754 emit_insn (gen_subdf3 (temp, operands[1],
2755 CONST_DOUBLE_FROM_REAL_VALUE (
2756 REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode)));
2757 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7)));
2760 emit_label (label1);
2761 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2762 emit_label (label2);
2766 (define_expand "fix_truncdfdi2"
2767 [(set (match_operand:DI 0 "register_operand" "")
2768 (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))]
2769 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2771 operands[1] = force_reg (DFmode, operands[1]);
2772 emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2776 (define_insn "fix_truncdfdi2_ieee"
2777 [(set (match_operand:DI 0 "register_operand" "=d")
2778 (fix:DI (match_operand:DF 1 "register_operand" "f")))
2779 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2780 (clobber (reg:CC 33))]
2781 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2783 [(set_attr "op_type" "RRE")
2784 (set_attr "type" "ftoi")])
2787 ; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s).
2790 (define_expand "fixuns_truncdfsi2"
2791 [(set (match_operand:SI 0 "register_operand" "")
2792 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))]
2793 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2795 rtx label1 = gen_label_rtx ();
2796 rtx label2 = gen_label_rtx ();
2797 rtx temp = gen_reg_rtx (DFmode);
2799 operands[1] = force_reg (DFmode,operands[1]);
2800 emit_insn (gen_cmpdf (operands[1],
2801 CONST_DOUBLE_FROM_REAL_VALUE (
2802 REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode)));
2803 emit_jump_insn (gen_blt (label1));
2804 emit_insn (gen_subdf3 (temp, operands[1],
2805 CONST_DOUBLE_FROM_REAL_VALUE (
2806 REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode)));
2807 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7)));
2810 emit_label (label1);
2811 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2812 emit_label (label2);
2816 (define_expand "fix_truncdfsi2"
2817 [(set (match_operand:SI 0 "register_operand" "")
2818 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))]
2821 if (TARGET_IBM_FLOAT)
2823 /* This is the algorithm from POP chapter A.5.7.2. */
2825 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
2826 rtx two31r = s390_gen_rtx_const_DI (0x4f000000, 0x08000000);
2827 rtx two32 = s390_gen_rtx_const_DI (0x4e000001, 0x00000000);
2829 operands[1] = force_reg (DFmode, operands[1]);
2830 emit_insn (gen_fix_truncdfsi2_ibm (operands[0], operands[1],
2831 two31r, two32, temp));
2835 operands[1] = force_reg (DFmode, operands[1]);
2836 emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2842 (define_insn "fix_truncdfsi2_ieee"
2843 [(set (match_operand:SI 0 "register_operand" "=d")
2844 (fix:SI (match_operand:DF 1 "register_operand" "f")))
2845 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2846 (clobber (reg:CC 33))]
2847 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2849 [(set_attr "op_type" "RRE")
2850 (set_attr "type" "other" )])
2852 (define_insn "fix_truncdfsi2_ibm"
2853 [(set (match_operand:SI 0 "register_operand" "=d")
2854 (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f")))
2855 (use (match_operand:DI 2 "immediate_operand" "m"))
2856 (use (match_operand:DI 3 "immediate_operand" "m"))
2857 (use (match_operand:BLK 4 "memory_operand" "m"))
2858 (clobber (reg:CC 33))]
2859 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
2861 output_asm_insn ("sd\t%1,%2", operands);
2862 output_asm_insn ("aw\t%1,%3", operands);
2863 output_asm_insn ("std\t%1,%4", operands);
2864 output_asm_insn ("xi\t%N4,128", operands);
2867 [(set_attr "op_type" "NN")
2868 (set_attr "type" "ftoi")
2869 (set_attr "atype" "agen")
2870 (set_attr "length" "20")])
2873 ; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s).
2876 (define_expand "fixuns_truncsfdi2"
2877 [(set (match_operand:DI 0 "register_operand" "")
2878 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))]
2879 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2881 rtx label1 = gen_label_rtx ();
2882 rtx label2 = gen_label_rtx ();
2883 rtx temp = gen_reg_rtx (SFmode);
2885 operands[1] = force_reg (SFmode, operands[1]);
2886 emit_insn (gen_cmpsf (operands[1],
2887 CONST_DOUBLE_FROM_REAL_VALUE (
2888 REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode)));
2889 emit_jump_insn (gen_blt (label1));
2891 emit_insn (gen_subsf3 (temp, operands[1],
2892 CONST_DOUBLE_FROM_REAL_VALUE (
2893 REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode)));
2894 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7)));
2897 emit_label (label1);
2898 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2899 emit_label (label2);
2903 (define_expand "fix_truncsfdi2"
2904 [(set (match_operand:DI 0 "register_operand" "")
2905 (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))]
2906 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2908 operands[1] = force_reg (SFmode, operands[1]);
2909 emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5)));
2913 (define_insn "fix_truncsfdi2_ieee"
2914 [(set (match_operand:DI 0 "register_operand" "=d")
2915 (fix:DI (match_operand:SF 1 "register_operand" "f")))
2916 (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2917 (clobber (reg:CC 33))]
2918 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2920 [(set_attr "op_type" "RRE")
2921 (set_attr "type" "ftoi")])
2924 ; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s).
2927 (define_expand "fixuns_truncsfsi2"
2928 [(set (match_operand:SI 0 "register_operand" "")
2929 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))]
2930 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2932 rtx label1 = gen_label_rtx ();
2933 rtx label2 = gen_label_rtx ();
2934 rtx temp = gen_reg_rtx (SFmode);
2936 operands[1] = force_reg (SFmode, operands[1]);
2937 emit_insn (gen_cmpsf (operands[1],
2938 CONST_DOUBLE_FROM_REAL_VALUE (
2939 REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode)));
2940 emit_jump_insn (gen_blt (label1));
2941 emit_insn (gen_subsf3 (temp, operands[1],
2942 CONST_DOUBLE_FROM_REAL_VALUE (
2943 REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode)));
2944 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7)));
2947 emit_label (label1);
2948 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2949 emit_label (label2);
2953 (define_expand "fix_truncsfsi2"
2954 [(set (match_operand:SI 0 "register_operand" "")
2955 (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))]
2958 if (TARGET_IBM_FLOAT)
2960 /* Convert to DFmode and then use the POP algorithm. */
2961 rtx temp = gen_reg_rtx (DFmode);
2962 emit_insn (gen_extendsfdf2 (temp, operands[1]));
2963 emit_insn (gen_fix_truncdfsi2 (operands[0], temp));
2967 operands[1] = force_reg (SFmode, operands[1]);
2968 emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5)));
2974 (define_insn "fix_truncsfsi2_ieee"
2975 [(set (match_operand:SI 0 "register_operand" "=d")
2976 (fix:SI (match_operand:SF 1 "register_operand" "f")))
2977 (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND)
2978 (clobber (reg:CC 33))]
2979 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2981 [(set_attr "op_type" "RRE")
2982 (set_attr "type" "ftoi")])
2985 ; floatdidf2 instruction pattern(s).
2988 (define_insn "floatdidf2"
2989 [(set (match_operand:DF 0 "register_operand" "=f")
2990 (float:DF (match_operand:DI 1 "register_operand" "d")))
2991 (clobber (reg:CC 33))]
2992 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
2994 [(set_attr "op_type" "RRE")
2995 (set_attr "type" "itof" )])
2998 ; floatdisf2 instruction pattern(s).
3001 (define_insn "floatdisf2"
3002 [(set (match_operand:SF 0 "register_operand" "=f")
3003 (float:SF (match_operand:DI 1 "register_operand" "d")))
3004 (clobber (reg:CC 33))]
3005 "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3007 [(set_attr "op_type" "RRE")
3008 (set_attr "type" "itof" )])
3011 ; floatsidf2 instruction pattern(s).
3014 (define_expand "floatsidf2"
3016 [(set (match_operand:DF 0 "register_operand" "")
3017 (float:DF (match_operand:SI 1 "register_operand" "")))
3018 (clobber (reg:CC 33))])]
3021 if (TARGET_IBM_FLOAT)
3023 /* This is the algorithm from POP chapter A.5.7.1. */
3025 rtx temp = assign_stack_local (BLKmode, 8, BITS_PER_WORD);
3026 rtx two31 = s390_gen_rtx_const_DI (0x4e000000, 0x80000000);
3028 emit_insn (gen_floatsidf2_ibm (operands[0], operands[1], two31, temp));
3033 (define_insn "floatsidf2_ieee"
3034 [(set (match_operand:DF 0 "register_operand" "=f")
3035 (float:DF (match_operand:SI 1 "register_operand" "d")))
3036 (clobber (reg:CC 33))]
3037 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3039 [(set_attr "op_type" "RRE")
3040 (set_attr "type" "itof" )])
3042 (define_insn "floatsidf2_ibm"
3043 [(set (match_operand:DF 0 "register_operand" "=f")
3044 (float:DF (match_operand:SI 1 "register_operand" "d")))
3045 (use (match_operand:DI 2 "immediate_operand" "m"))
3046 (use (match_operand:BLK 3 "memory_operand" "m"))
3047 (clobber (reg:CC 33))]
3048 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3050 output_asm_insn ("st\t%1,%N3", operands);
3051 output_asm_insn ("xi\t%N3,128", operands);
3052 output_asm_insn ("mvc\t%O3(4,%R3),%2", operands);
3053 output_asm_insn ("ld\t%0,%3", operands);
3056 [(set_attr "op_type" "NN")
3057 (set_attr "type" "other" )
3058 (set_attr "atype" "agen")
3059 (set_attr "length" "20")])
3062 ; floatsisf2 instruction pattern(s).
3065 (define_expand "floatsisf2"
3067 [(set (match_operand:SF 0 "register_operand" "")
3068 (float:SF (match_operand:SI 1 "register_operand" "")))
3069 (clobber (reg:CC 33))])]
3072 if (TARGET_IBM_FLOAT)
3074 /* Use the POP algorithm to convert to DFmode and then truncate. */
3075 rtx temp = gen_reg_rtx (DFmode);
3076 emit_insn (gen_floatsidf2 (temp, operands[1]));
3077 emit_insn (gen_truncdfsf2 (operands[0], temp));
3082 (define_insn "floatsisf2_ieee"
3083 [(set (match_operand:SF 0 "register_operand" "=f")
3084 (float:SF (match_operand:SI 1 "register_operand" "d")))
3085 (clobber (reg:CC 33))]
3086 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3088 [(set_attr "op_type" "RRE")
3089 (set_attr "type" "itof" )])
3092 ; truncdfsf2 instruction pattern(s).
3095 (define_expand "truncdfsf2"
3096 [(set (match_operand:SF 0 "register_operand" "")
3097 (float_truncate:SF (match_operand:DF 1 "general_operand" "")))]
3101 (define_insn "truncdfsf2_ieee"
3102 [(set (match_operand:SF 0 "register_operand" "=f")
3103 (float_truncate:SF (match_operand:DF 1 "general_operand" "f")))]
3104 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3106 [(set_attr "op_type" "RRE")])
3108 (define_insn "truncdfsf2_ibm"
3109 [(set (match_operand:SF 0 "register_operand" "=f,f")
3110 (float_truncate:SF (match_operand:DF 1 "general_operand" "f,R")))]
3111 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3115 [(set_attr "op_type" "RR,RX")
3116 (set_attr "type" "floads,floads")])
3119 ; extendsfdf2 instruction pattern(s).
3122 (define_expand "extendsfdf2"
3123 [(set (match_operand:DF 0 "register_operand" "")
3124 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
3127 if (TARGET_IBM_FLOAT)
3129 emit_insn (gen_extendsfdf2_ibm (operands[0], operands[1]));
3134 (define_insn "extendsfdf2_ieee"
3135 [(set (match_operand:DF 0 "register_operand" "=f,f")
3136 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))]
3137 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3141 [(set_attr "op_type" "RRE,RXE")
3142 (set_attr "type" "floads,floads")])
3144 (define_insn "extendsfdf2_ibm"
3145 [(set (match_operand:DF 0 "register_operand" "=f,f")
3146 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R")))
3147 (clobber (reg:CC 33))]
3148 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3150 sdr\t%0,%0\;ler\t%0,%1
3151 sdr\t%0,%0\;le\t%0,%1"
3152 [(set_attr "op_type" "NN,NN")
3153 (set_attr "atype" "reg,agen")
3154 (set_attr "length" "4,6")
3155 (set_attr "type" "o2,o2")])
3159 ;; ARITHMETIC OPERATIONS
3161 ; arithmetic operations set the ConditionCode,
3162 ; because of unpredictable Bits in Register for Halfword and Byte
3163 ; the ConditionCode can be set wrong in operations for Halfword and Byte
3166 ;;- Add instructions.
3170 ; addti3 instruction pattern(s).
3173 (define_insn_and_split "addti3"
3174 [(set (match_operand:TI 0 "register_operand" "=&d")
3175 (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0")
3176 (match_operand:TI 2 "general_operand" "do") ) )
3177 (clobber (reg:CC 33))]
3180 "&& reload_completed"
3183 (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8))
3185 (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))])
3187 [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5))
3188 (ltu:DI (reg:CCL1 33) (const_int 0))))
3189 (clobber (reg:CC 33))])]
3190 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3191 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3192 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3193 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3194 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3195 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3196 [(set_attr "op_type" "NN")])
3199 ; adddi3 instruction pattern(s).
3202 (define_insn "*adddi3_sign"
3203 [(set (match_operand:DI 0 "register_operand" "=d,d")
3204 (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3205 (match_operand:DI 1 "register_operand" "0,0")))
3206 (clobber (reg:CC 33))]
3211 [(set_attr "op_type" "RRE,RXY")])
3213 (define_insn "*adddi3_zero_cc"
3215 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3216 (match_operand:DI 1 "register_operand" "0,0"))
3218 (set (match_operand:DI 0 "register_operand" "=d,d")
3219 (plus:DI (zero_extend:DI (match_dup 2)) (match_dup 1)))]
3220 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3224 [(set_attr "op_type" "RRE,RXY")])
3226 (define_insn "*adddi3_zero_cconly"
3228 (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3229 (match_operand:DI 1 "register_operand" "0,0"))
3231 (clobber (match_scratch:DI 0 "=d,d"))]
3232 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3236 [(set_attr "op_type" "RRE,RXY")])
3238 (define_insn "*adddi3_zero"
3239 [(set (match_operand:DI 0 "register_operand" "=d,d")
3240 (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))
3241 (match_operand:DI 1 "register_operand" "0,0")))
3242 (clobber (reg:CC 33))]
3247 [(set_attr "op_type" "RRE,RXY")])
3249 (define_insn "*adddi3_imm_cc"
3251 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0")
3252 (match_operand:DI 2 "const_int_operand" "K"))
3254 (set (match_operand:DI 0 "register_operand" "=d")
3255 (plus:DI (match_dup 1) (match_dup 2)))]
3257 && s390_match_ccmode (insn, CCAmode)
3258 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3260 [(set_attr "op_type" "RI")])
3262 (define_insn "*adddi3_carry1_cc"
3264 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3265 (match_operand:DI 2 "general_operand" "d,m"))
3267 (set (match_operand:DI 0 "register_operand" "=d,d")
3268 (plus:DI (match_dup 1) (match_dup 2)))]
3269 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3273 [(set_attr "op_type" "RRE,RXY")])
3275 (define_insn "*adddi3_carry1_cconly"
3277 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3278 (match_operand:DI 2 "general_operand" "d,m"))
3280 (clobber (match_scratch:DI 0 "=d,d"))]
3281 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3285 [(set_attr "op_type" "RRE,RXY")])
3287 (define_insn "*adddi3_carry2_cc"
3289 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3290 (match_operand:DI 2 "general_operand" "d,m"))
3292 (set (match_operand:DI 0 "register_operand" "=d,d")
3293 (plus:DI (match_dup 1) (match_dup 2)))]
3294 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3298 [(set_attr "op_type" "RRE,RXY")])
3300 (define_insn "*adddi3_carry2_cconly"
3302 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3303 (match_operand:DI 2 "general_operand" "d,m"))
3305 (clobber (match_scratch:DI 0 "=d,d"))]
3306 "s390_match_ccmode (insn, CCL1mode) && TARGET_64BIT"
3310 [(set_attr "op_type" "RRE,RXY")])
3312 (define_insn "*adddi3_cc"
3314 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3315 (match_operand:DI 2 "general_operand" "d,m"))
3317 (set (match_operand:DI 0 "register_operand" "=d,d")
3318 (plus:DI (match_dup 1) (match_dup 2)))]
3319 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3323 [(set_attr "op_type" "RRE,RXY")])
3325 (define_insn "*adddi3_cconly"
3327 (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3328 (match_operand:DI 2 "general_operand" "d,m"))
3330 (clobber (match_scratch:DI 0 "=d,d"))]
3331 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3335 [(set_attr "op_type" "RRE,RXY")])
3337 (define_insn "*adddi3_cconly2"
3339 (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0")
3340 (neg:SI (match_operand:DI 2 "general_operand" "d,m"))))
3341 (clobber (match_scratch:DI 0 "=d,d"))]
3342 "s390_match_ccmode(insn, CCLmode) && TARGET_64BIT"
3346 [(set_attr "op_type" "RRE,RXY")])
3348 (define_insn "*adddi3_64"
3349 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
3350 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
3351 (match_operand:DI 2 "general_operand" "d,K,m") ) )
3352 (clobber (reg:CC 33))]
3358 [(set_attr "op_type" "RRE,RI,RXY")])
3360 (define_insn_and_split "*adddi3_31z"
3361 [(set (match_operand:DI 0 "register_operand" "=&d")
3362 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3363 (match_operand:DI 2 "general_operand" "do") ) )
3364 (clobber (reg:CC 33))]
3365 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3367 "&& reload_completed"
3370 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3372 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3374 [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5))
3375 (ltu:SI (reg:CCL1 33) (const_int 0))))
3376 (clobber (reg:CC 33))])]
3377 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3378 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3379 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3380 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3381 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3382 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3383 [(set_attr "op_type" "NN")])
3385 (define_insn_and_split "*adddi3_31"
3386 [(set (match_operand:DI 0 "register_operand" "=&d")
3387 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0")
3388 (match_operand:DI 2 "general_operand" "do") ) )
3389 (clobber (reg:CC 33))]
3392 "&& reload_completed"
3394 [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5)))
3395 (clobber (reg:CC 33))])
3398 (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8))
3400 (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))])
3402 (if_then_else (ltu (reg:CCL1 33) (const_int 0))
3404 (label_ref (match_dup 9))))
3406 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1)))
3407 (clobber (reg:CC 33))])
3409 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3410 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3411 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3412 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3413 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3414 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3415 operands[9] = gen_label_rtx ();"
3416 [(set_attr "op_type" "NN")])
3418 (define_expand "adddi3"
3420 [(set (match_operand:DI 0 "register_operand" "")
3421 (plus:DI (match_operand:DI 1 "nonimmediate_operand" "")
3422 (match_operand:DI 2 "general_operand" "")))
3423 (clobber (reg:CC 33))])]
3428 ; addsi3 instruction pattern(s).
3431 (define_insn "*addsi3_imm_cc"
3433 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0")
3434 (match_operand:SI 2 "const_int_operand" "K"))
3436 (set (match_operand:SI 0 "register_operand" "=d")
3437 (plus:SI (match_dup 1) (match_dup 2)))]
3438 "s390_match_ccmode (insn, CCAmode)
3439 && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
3441 [(set_attr "op_type" "RI")])
3443 (define_insn "*addsi3_carry1_cc"
3445 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3446 (match_operand:SI 2 "general_operand" "d,R,T"))
3448 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3449 (plus:SI (match_dup 1) (match_dup 2)))]
3450 "s390_match_ccmode (insn, CCL1mode)"
3455 [(set_attr "op_type" "RR,RX,RXY")])
3457 (define_insn "*addsi3_carry1_cconly"
3459 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3460 (match_operand:SI 2 "general_operand" "d,R,T"))
3462 (clobber (match_scratch:SI 0 "=d,d,d"))]
3463 "s390_match_ccmode (insn, CCL1mode)"
3468 [(set_attr "op_type" "RR,RX,RXY")])
3470 (define_insn "*addsi3_carry2_cc"
3472 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3473 (match_operand:SI 2 "general_operand" "d,R,T"))
3475 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3476 (plus:SI (match_dup 1) (match_dup 2)))]
3477 "s390_match_ccmode (insn, CCL1mode)"
3482 [(set_attr "op_type" "RR,RX,RXY")])
3484 (define_insn "*addsi3_carry2_cconly"
3486 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3487 (match_operand:SI 2 "general_operand" "d,R,T"))
3489 (clobber (match_scratch:SI 0 "=d,d,d"))]
3490 "s390_match_ccmode (insn, CCL1mode)"
3495 [(set_attr "op_type" "RR,RX,RXY")])
3497 (define_insn "*addsi3_cc"
3499 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3500 (match_operand:SI 2 "general_operand" "d,R,T"))
3502 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3503 (plus:SI (match_dup 1) (match_dup 2)))]
3504 "s390_match_ccmode (insn, CCLmode)"
3509 [(set_attr "op_type" "RR,RX,RXY")])
3511 (define_insn "*addsi3_cconly"
3513 (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3514 (match_operand:SI 2 "general_operand" "d,R,T"))
3516 (clobber (match_scratch:SI 0 "=d,d,d"))]
3517 "s390_match_ccmode (insn, CCLmode)"
3522 [(set_attr "op_type" "RR,RX,RXY")])
3524 (define_insn "*addsi3_cconly2"
3526 (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
3527 (neg:SI (match_operand:SI 2 "general_operand" "d,R,T"))))
3528 (clobber (match_scratch:SI 0 "=d,d,d"))]
3529 "s390_match_ccmode (insn, CCLmode)"
3534 [(set_attr "op_type" "RR,RX,RXY")])
3536 (define_insn "*addsi3_sign"
3537 [(set (match_operand:SI 0 "register_operand" "=d,d")
3538 (plus:SI (match_operand:SI 1 "register_operand" "0,0")
3539 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
3540 (clobber (reg:CC 33))]
3545 [(set_attr "op_type" "RX,RXY")])
3547 (define_insn "addsi3"
3548 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
3549 (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
3550 (match_operand:SI 2 "general_operand" "d,K,R,T")))
3551 (clobber (reg:CC 33))]
3558 [(set_attr "op_type" "RR,RI,RX,RXY")])
3561 ; adddf3 instruction pattern(s).
3564 (define_expand "adddf3"
3566 [(set (match_operand:DF 0 "register_operand" "=f,f")
3567 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3568 (match_operand:DF 2 "general_operand" "f,R")))
3569 (clobber (reg:CC 33))])]
3573 (define_insn "*adddf3"
3574 [(set (match_operand:DF 0 "register_operand" "=f,f")
3575 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3576 (match_operand:DF 2 "general_operand" "f,R")))
3577 (clobber (reg:CC 33))]
3578 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3582 [(set_attr "op_type" "RRE,RXE")
3583 (set_attr "type" "fsimpd,fsimpd")])
3585 (define_insn "*adddf3_cc"
3587 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3588 (match_operand:DF 2 "general_operand" "f,R"))
3589 (match_operand:DF 3 "const0_operand" "")))
3590 (set (match_operand:DF 0 "register_operand" "=f,f")
3591 (plus:DF (match_dup 1) (match_dup 2)))]
3592 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3596 [(set_attr "op_type" "RRE,RXE")
3597 (set_attr "type" "fsimpd,fsimpd")])
3599 (define_insn "*adddf3_cconly"
3601 (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3602 (match_operand:DF 2 "general_operand" "f,R"))
3603 (match_operand:DF 3 "const0_operand" "")))
3604 (clobber (match_scratch:DF 0 "=f,f"))]
3605 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3609 [(set_attr "op_type" "RRE,RXE")
3610 (set_attr "type" "fsimpd,fsimpd")])
3612 (define_insn "*adddf3_ibm"
3613 [(set (match_operand:DF 0 "register_operand" "=f,f")
3614 (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
3615 (match_operand:DF 2 "general_operand" "f,R")))
3616 (clobber (reg:CC 33))]
3617 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3621 [(set_attr "op_type" "RR,RX")
3622 (set_attr "type" "fsimpd,fsimpd")])
3625 ; addsf3 instruction pattern(s).
3628 (define_expand "addsf3"
3630 [(set (match_operand:SF 0 "register_operand" "=f,f")
3631 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3632 (match_operand:SF 2 "general_operand" "f,R")))
3633 (clobber (reg:CC 33))])]
3637 (define_insn "*addsf3"
3638 [(set (match_operand:SF 0 "register_operand" "=f,f")
3639 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3640 (match_operand:SF 2 "general_operand" "f,R")))
3641 (clobber (reg:CC 33))]
3642 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3646 [(set_attr "op_type" "RRE,RXE")
3647 (set_attr "type" "fsimps,fsimps")])
3649 (define_insn "*addsf3_cc"
3651 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3652 (match_operand:SF 2 "general_operand" "f,R"))
3653 (match_operand:SF 3 "const0_operand" "")))
3654 (set (match_operand:SF 0 "register_operand" "=f,f")
3655 (plus:SF (match_dup 1) (match_dup 2)))]
3656 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3660 [(set_attr "op_type" "RRE,RXE")
3661 (set_attr "type" "fsimps,fsimps")])
3663 (define_insn "*addsf3_cconly"
3665 (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3666 (match_operand:SF 2 "general_operand" "f,R"))
3667 (match_operand:SF 3 "const0_operand" "")))
3668 (clobber (match_scratch:SF 0 "=f,f"))]
3669 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
3673 [(set_attr "op_type" "RRE,RXE")
3674 (set_attr "type" "fsimps,fsimps")])
3676 (define_insn "*addsf3"
3677 [(set (match_operand:SF 0 "register_operand" "=f,f")
3678 (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
3679 (match_operand:SF 2 "general_operand" "f,R")))
3680 (clobber (reg:CC 33))]
3681 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
3685 [(set_attr "op_type" "RR,RX")
3686 (set_attr "type" "fsimps,fsimps")])
3690 ;;- Subtract instructions.
3694 ; subti3 instruction pattern(s).
3697 (define_insn_and_split "subti3"
3698 [(set (match_operand:TI 0 "register_operand" "=&d")
3699 (minus:TI (match_operand:TI 1 "register_operand" "0")
3700 (match_operand:TI 2 "general_operand" "do") ) )
3701 (clobber (reg:CC 33))]
3704 "&& reload_completed"
3707 (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8))
3709 (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))])
3711 [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5))
3712 (gtu:DI (reg:CCL2 33) (const_int 0))))
3713 (clobber (reg:CC 33))])]
3714 "operands[3] = operand_subword (operands[0], 0, 0, TImode);
3715 operands[4] = operand_subword (operands[1], 0, 0, TImode);
3716 operands[5] = operand_subword (operands[2], 0, 0, TImode);
3717 operands[6] = operand_subword (operands[0], 1, 0, TImode);
3718 operands[7] = operand_subword (operands[1], 1, 0, TImode);
3719 operands[8] = operand_subword (operands[2], 1, 0, TImode);"
3720 [(set_attr "op_type" "NN")])
3723 ; subdi3 instruction pattern(s).
3726 (define_insn "*subdi3_sign"
3727 [(set (match_operand:DI 0 "register_operand" "=d,d")
3728 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3729 (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3730 (clobber (reg:CC 33))]
3735 [(set_attr "op_type" "RRE,RXY")])
3737 (define_insn "*subdi3_zero_cc"
3739 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3740 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3742 (set (match_operand:DI 0 "register_operand" "=d,d")
3743 (minus:DI (match_dup 1) (zero_extend:DI (match_dup 2))))]
3744 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3748 [(set_attr "op_type" "RRE,RXY")])
3750 (define_insn "*subdi3_zero_cconly"
3752 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3753 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))
3755 (clobber (match_scratch:DI 0 "=d,d"))]
3756 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3760 [(set_attr "op_type" "RRE,RXY")])
3762 (define_insn "*subdi3_zero"
3763 [(set (match_operand:DI 0 "register_operand" "=d,d")
3764 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3765 (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))))
3766 (clobber (reg:CC 33))]
3771 [(set_attr "op_type" "RRE,RXY")])
3773 (define_insn "*subdi3_borrow_cc"
3775 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3776 (match_operand:DI 2 "general_operand" "d,m"))
3778 (set (match_operand:DI 0 "register_operand" "=d,d")
3779 (minus:DI (match_dup 1) (match_dup 2)))]
3780 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3784 [(set_attr "op_type" "RRE,RXY")])
3786 (define_insn "*subdi3_borrow_cconly"
3788 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3789 (match_operand:DI 2 "general_operand" "d,m"))
3791 (clobber (match_scratch:DI 0 "=d,d"))]
3792 "s390_match_ccmode (insn, CCL2mode) && TARGET_64BIT"
3796 [(set_attr "op_type" "RRE,RXY")])
3798 (define_insn "*subdi3_cc"
3800 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3801 (match_operand:DI 2 "general_operand" "d,m"))
3803 (set (match_operand:DI 0 "register_operand" "=d,d")
3804 (minus:DI (match_dup 1) (match_dup 2)))]
3805 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3809 [(set_attr "op_type" "RRE,RXY")])
3811 (define_insn "*subdi3_cc2"
3813 (compare (match_operand:DI 1 "register_operand" "0,0")
3814 (match_operand:DI 2 "general_operand" "d,m")))
3815 (set (match_operand:DI 0 "register_operand" "=d,d")
3816 (minus:DI (match_dup 1) (match_dup 2)))]
3817 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3821 [(set_attr "op_type" "RRE,RXY")])
3823 (define_insn "*subdi3_cconly"
3825 (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3826 (match_operand:DI 2 "general_operand" "d,m"))
3828 (clobber (match_scratch:DI 0 "=d,d"))]
3829 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
3833 [(set_attr "op_type" "RRE,RXY")])
3835 (define_insn "*subdi3_cconly2"
3837 (compare (match_operand:DI 1 "register_operand" "0,0")
3838 (match_operand:DI 2 "general_operand" "d,m")))
3839 (clobber (match_scratch:DI 0 "=d,d"))]
3840 "s390_match_ccmode (insn, CCL3mode) && TARGET_64BIT"
3844 [(set_attr "op_type" "RRE,RXY")])
3846 (define_insn "*subdi3_64"
3847 [(set (match_operand:DI 0 "register_operand" "=d,d")
3848 (minus:DI (match_operand:DI 1 "register_operand" "0,0")
3849 (match_operand:DI 2 "general_operand" "d,m") ) )
3850 (clobber (reg:CC 33))]
3855 [(set_attr "op_type" "RRE,RRE")])
3857 (define_insn_and_split "*subdi3_31z"
3858 [(set (match_operand:DI 0 "register_operand" "=&d")
3859 (minus:DI (match_operand:DI 1 "register_operand" "0")
3860 (match_operand:DI 2 "general_operand" "do") ) )
3861 (clobber (reg:CC 33))]
3862 "!TARGET_64BIT && TARGET_CPU_ZARCH"
3864 "&& reload_completed"
3867 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3869 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3871 [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5))
3872 (gtu:SI (reg:CCL2 33) (const_int 0))))
3873 (clobber (reg:CC 33))])]
3874 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3875 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3876 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3877 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3878 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3879 operands[8] = operand_subword (operands[2], 1, 0, DImode);"
3880 [(set_attr "op_type" "NN")])
3882 (define_insn_and_split "*subdi3_31"
3883 [(set (match_operand:DI 0 "register_operand" "=&d")
3884 (minus:DI (match_operand:DI 1 "register_operand" "0")
3885 (match_operand:DI 2 "general_operand" "do") ) )
3886 (clobber (reg:CC 33))]
3889 "&& reload_completed"
3891 [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5)))
3892 (clobber (reg:CC 33))])
3895 (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8))
3897 (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))])
3899 (if_then_else (gtu (reg:CCL2 33) (const_int 0))
3901 (label_ref (match_dup 9))))
3903 [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))
3904 (clobber (reg:CC 33))])
3906 "operands[3] = operand_subword (operands[0], 0, 0, DImode);
3907 operands[4] = operand_subword (operands[1], 0, 0, DImode);
3908 operands[5] = operand_subword (operands[2], 0, 0, DImode);
3909 operands[6] = operand_subword (operands[0], 1, 0, DImode);
3910 operands[7] = operand_subword (operands[1], 1, 0, DImode);
3911 operands[8] = operand_subword (operands[2], 1, 0, DImode);
3912 operands[9] = gen_label_rtx ();"
3913 [(set_attr "op_type" "NN")])
3915 (define_expand "subdi3"
3917 [(set (match_operand:DI 0 "register_operand" "")
3918 (minus:DI (match_operand:DI 1 "register_operand" "")
3919 (match_operand:DI 2 "general_operand" "")))
3920 (clobber (reg:CC 33))])]
3925 ; subsi3 instruction pattern(s).
3928 (define_insn "*subsi3_borrow_cc"
3930 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3931 (match_operand:SI 2 "general_operand" "d,R,T"))
3933 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3934 (minus:SI (match_dup 1) (match_dup 2)))]
3935 "s390_match_ccmode (insn, CCL2mode)"
3940 [(set_attr "op_type" "RR,RX,RXY")])
3942 (define_insn "*subsi3_borrow_cconly"
3944 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3945 (match_operand:SI 2 "general_operand" "d,R,T"))
3947 (clobber (match_scratch:SI 0 "=d,d,d"))]
3948 "s390_match_ccmode (insn, CCL2mode)"
3953 [(set_attr "op_type" "RR,RX,RXY")])
3955 (define_insn "*subsi3_cc"
3957 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3958 (match_operand:SI 2 "general_operand" "d,R,T"))
3960 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3961 (minus:SI (match_dup 1) (match_dup 2)))]
3962 "s390_match_ccmode (insn, CCLmode)"
3967 [(set_attr "op_type" "RR,RX,RXY")])
3969 (define_insn "*subsi3_cc2"
3971 (compare (match_operand:SI 1 "register_operand" "0,0,0")
3972 (match_operand:SI 2 "general_operand" "d,R,T")))
3973 (set (match_operand:SI 0 "register_operand" "=d,d,d")
3974 (minus:SI (match_dup 1) (match_dup 2)))]
3975 "s390_match_ccmode (insn, CCL3mode)"
3980 [(set_attr "op_type" "RR,RX,RXY")])
3982 (define_insn "*subsi3_cconly"
3984 (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
3985 (match_operand:SI 2 "general_operand" "d,R,T"))
3987 (clobber (match_scratch:SI 0 "=d,d,d"))]
3988 "s390_match_ccmode (insn, CCLmode)"
3993 [(set_attr "op_type" "RR,RX,RXY")])
3995 (define_insn "*subsi3_cconly2"
3997 (compare (match_operand:SI 1 "register_operand" "0,0,0")
3998 (match_operand:SI 2 "general_operand" "d,R,T")))
3999 (clobber (match_scratch:SI 0 "=d,d,d"))]
4000 "s390_match_ccmode (insn, CCL3mode)"
4005 [(set_attr "op_type" "RR,RX,RXY")])
4007 (define_insn "*subsi3_sign"
4008 [(set (match_operand:SI 0 "register_operand" "=d,d")
4009 (minus:SI (match_operand:SI 1 "register_operand" "0,0")
4010 (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T"))))
4011 (clobber (reg:CC 33))]
4016 [(set_attr "op_type" "RX,RXY")])
4018 (define_insn "subsi3"
4019 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
4020 (minus:SI (match_operand:SI 1 "register_operand" "0,0,0")
4021 (match_operand:SI 2 "general_operand" "d,R,T")))
4022 (clobber (reg:CC 33))]
4028 [(set_attr "op_type" "RR,RX,RXY")])
4032 ; subdf3 instruction pattern(s).
4035 (define_expand "subdf3"
4037 [(set (match_operand:DF 0 "register_operand" "=f,f")
4038 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4039 (match_operand:DF 2 "general_operand" "f,R")))
4040 (clobber (reg:CC 33))])]
4044 (define_insn "*subdf3"
4045 [(set (match_operand:DF 0 "register_operand" "=f,f")
4046 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4047 (match_operand:DF 2 "general_operand" "f,R")))
4048 (clobber (reg:CC 33))]
4049 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4053 [(set_attr "op_type" "RRE,RXE")
4054 (set_attr "type" "fsimpd,fsimpd")])
4056 (define_insn "*subdf3_cc"
4058 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4059 (match_operand:DF 2 "general_operand" "f,R"))
4060 (match_operand:DF 3 "const0_operand" "")))
4061 (set (match_operand:DF 0 "register_operand" "=f,f")
4062 (plus:DF (match_dup 1) (match_dup 2)))]
4063 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4067 [(set_attr "op_type" "RRE,RXE")
4068 (set_attr "type" "fsimpd,fsimpd")])
4070 (define_insn "*subdf3_cconly"
4072 (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")
4073 (match_operand:DF 2 "general_operand" "f,R"))
4074 (match_operand:DF 3 "const0_operand" "")))
4075 (clobber (match_scratch:DF 0 "=f,f"))]
4076 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4080 [(set_attr "op_type" "RRE,RXE")
4081 (set_attr "type" "fsimpd,fsimpd")])
4083 (define_insn "*subdf3_ibm"
4084 [(set (match_operand:DF 0 "register_operand" "=f,f")
4085 (minus:DF (match_operand:DF 1 "register_operand" "0,0")
4086 (match_operand:DF 2 "general_operand" "f,R")))
4087 (clobber (reg:CC 33))]
4088 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4092 [(set_attr "op_type" "RR,RX")
4093 (set_attr "type" "fsimpd,fsimpd")])
4096 ; subsf3 instruction pattern(s).
4099 (define_expand "subsf3"
4101 [(set (match_operand:SF 0 "register_operand" "=f,f")
4102 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4103 (match_operand:SF 2 "general_operand" "f,R")))
4104 (clobber (reg:CC 33))])]
4108 (define_insn "*subsf3"
4109 [(set (match_operand:SF 0 "register_operand" "=f,f")
4110 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4111 (match_operand:SF 2 "general_operand" "f,R")))
4112 (clobber (reg:CC 33))]
4113 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4117 [(set_attr "op_type" "RRE,RXE")
4118 (set_attr "type" "fsimps,fsimps")])
4120 (define_insn "*subsf3_cc"
4122 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4123 (match_operand:SF 2 "general_operand" "f,R"))
4124 (match_operand:SF 3 "const0_operand" "")))
4125 (set (match_operand:SF 0 "register_operand" "=f,f")
4126 (minus:SF (match_dup 1) (match_dup 2)))]
4127 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4131 [(set_attr "op_type" "RRE,RXE")
4132 (set_attr "type" "fsimps,fsimps")])
4134 (define_insn "*subsf3_cconly"
4136 (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")
4137 (match_operand:SF 2 "general_operand" "f,R"))
4138 (match_operand:SF 3 "const0_operand" "")))
4139 (clobber (match_scratch:SF 0 "=f,f"))]
4140 "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4144 [(set_attr "op_type" "RRE,RXE")
4145 (set_attr "type" "fsimps,fsimps")])
4147 (define_insn "*subsf3_ibm"
4148 [(set (match_operand:SF 0 "register_operand" "=f,f")
4149 (minus:SF (match_operand:SF 1 "register_operand" "0,0")
4150 (match_operand:SF 2 "general_operand" "f,R")))
4151 (clobber (reg:CC 33))]
4152 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4156 [(set_attr "op_type" "RR,RX")
4157 (set_attr "type" "fsimps,fsimps")])
4161 ;;- Conditional add/subtract instructions.
4165 ; adddicc instruction pattern(s).
4168 (define_insn "*adddi3_alc_cc"
4171 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4172 (match_operand:DI 2 "general_operand" "d,m"))
4173 (match_operand:DI 3 "s390_alc_comparison" ""))
4175 (set (match_operand:DI 0 "register_operand" "=d,d")
4176 (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4177 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4181 [(set_attr "op_type" "RRE,RXY")])
4183 (define_insn "*adddi3_alc"
4184 [(set (match_operand:DI 0 "register_operand" "=d,d")
4185 (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
4186 (match_operand:DI 2 "general_operand" "d,m"))
4187 (match_operand:DI 3 "s390_alc_comparison" "")))
4188 (clobber (reg:CC 33))]
4193 [(set_attr "op_type" "RRE,RXY")])
4195 (define_insn "*subdi3_slb_cc"
4198 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4199 (match_operand:DI 2 "general_operand" "d,m"))
4200 (match_operand:DI 3 "s390_slb_comparison" ""))
4202 (set (match_operand:DI 0 "register_operand" "=d,d")
4203 (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4204 "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT"
4208 [(set_attr "op_type" "RRE,RXY")])
4210 (define_insn "*subdi3_slb"
4211 [(set (match_operand:DI 0 "register_operand" "=d,d")
4212 (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0")
4213 (match_operand:DI 2 "general_operand" "d,m"))
4214 (match_operand:DI 3 "s390_slb_comparison" "")))
4215 (clobber (reg:CC 33))]
4220 [(set_attr "op_type" "RRE,RXY")])
4222 (define_expand "adddicc"
4223 [(match_operand:DI 0 "register_operand" "")
4224 (match_operand 1 "comparison_operator" "")
4225 (match_operand:DI 2 "register_operand" "")
4226 (match_operand:DI 3 "const_int_operand" "")]
4228 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4229 s390_compare_op0, s390_compare_op1,
4230 operands[0], operands[2],
4231 operands[3])) FAIL; DONE;")
4234 ; addsicc instruction pattern(s).
4237 (define_insn "*addsi3_alc_cc"
4240 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4241 (match_operand:SI 2 "general_operand" "d,m"))
4242 (match_operand:SI 3 "s390_alc_comparison" ""))
4244 (set (match_operand:SI 0 "register_operand" "=d,d")
4245 (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4246 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4250 [(set_attr "op_type" "RRE,RXY")])
4252 (define_insn "*addsi3_alc"
4253 [(set (match_operand:SI 0 "register_operand" "=d,d")
4254 (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
4255 (match_operand:SI 2 "general_operand" "d,m"))
4256 (match_operand:SI 3 "s390_alc_comparison" "")))
4257 (clobber (reg:CC 33))]
4262 [(set_attr "op_type" "RRE,RXY")])
4264 (define_insn "*subsi3_slb_cc"
4267 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4268 (match_operand:SI 2 "general_operand" "d,m"))
4269 (match_operand:SI 3 "s390_slb_comparison" ""))
4271 (set (match_operand:SI 0 "register_operand" "=d,d")
4272 (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4273 "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH"
4277 [(set_attr "op_type" "RRE,RXY")])
4279 (define_insn "*subsi3_slb"
4280 [(set (match_operand:SI 0 "register_operand" "=d,d")
4281 (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
4282 (match_operand:SI 2 "general_operand" "d,m"))
4283 (match_operand:SI 3 "s390_slb_comparison" "")))
4284 (clobber (reg:CC 33))]
4289 [(set_attr "op_type" "RRE,RXY")])
4291 (define_expand "addsicc"
4292 [(match_operand:SI 0 "register_operand" "")
4293 (match_operand 1 "comparison_operator" "")
4294 (match_operand:SI 2 "register_operand" "")
4295 (match_operand:SI 3 "const_int_operand" "")]
4297 "if (!s390_expand_addcc (GET_CODE (operands[1]),
4298 s390_compare_op0, s390_compare_op1,
4299 operands[0], operands[2],
4300 operands[3])) FAIL; DONE;")
4303 ; scond instruction pattern(s).
4306 (define_insn_and_split "*sconddi"
4307 [(set (match_operand:DI 0 "register_operand" "=&d")
4308 (match_operand:DI 1 "s390_alc_comparison" ""))
4309 (clobber (reg:CC 33))]
4312 "&& reload_completed"
4313 [(set (match_dup 0) (const_int 0))
4315 [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0))
4317 (clobber (reg:CC 33))])]
4319 [(set_attr "op_type" "NN")])
4321 (define_insn_and_split "*scondsi"
4322 [(set (match_operand:SI 0 "register_operand" "=&d")
4323 (match_operand:SI 1 "s390_alc_comparison" ""))
4324 (clobber (reg:CC 33))]
4327 "&& reload_completed"
4328 [(set (match_dup 0) (const_int 0))
4330 [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0))
4332 (clobber (reg:CC 33))])]
4334 [(set_attr "op_type" "NN")])
4336 (define_insn_and_split "*sconddi_neg"
4337 [(set (match_operand:DI 0 "register_operand" "=&d")
4338 (match_operand:DI 1 "s390_slb_comparison" ""))
4339 (clobber (reg:CC 33))]
4342 "&& reload_completed"
4343 [(set (match_dup 0) (const_int 0))
4345 [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0))
4347 (clobber (reg:CC 33))])
4349 [(set (match_dup 0) (neg:DI (match_dup 0)))
4350 (clobber (reg:CC 33))])]
4352 [(set_attr "op_type" "NN")])
4354 (define_insn_and_split "*scondsi_neg"
4355 [(set (match_operand:SI 0 "register_operand" "=&d")
4356 (match_operand:SI 1 "s390_slb_comparison" ""))
4357 (clobber (reg:CC 33))]
4360 "&& reload_completed"
4361 [(set (match_dup 0) (const_int 0))
4363 [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0))
4365 (clobber (reg:CC 33))])
4367 [(set (match_dup 0) (neg:SI (match_dup 0)))
4368 (clobber (reg:CC 33))])]
4370 [(set_attr "op_type" "NN")])
4372 (define_expand "sltu"
4373 [(match_operand:SI 0 "register_operand" "")]
4375 "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1,
4376 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4378 (define_expand "sgtu"
4379 [(match_operand:SI 0 "register_operand" "")]
4381 "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1,
4382 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4384 (define_expand "sleu"
4385 [(match_operand:SI 0 "register_operand" "")]
4387 "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1,
4388 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4390 (define_expand "sgeu"
4391 [(match_operand:SI 0 "register_operand" "")]
4393 "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1,
4394 operands[0], const0_rtx, const1_rtx)) FAIL; DONE;")
4398 ;;- Multiply instructions.
4402 ; muldi3 instruction pattern(s).
4405 (define_insn "*muldi3_sign"
4406 [(set (match_operand:DI 0 "register_operand" "=d,d")
4407 (mult:DI (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "d,m"))
4408 (match_operand:DI 1 "register_operand" "0,0")))]
4413 [(set_attr "op_type" "RRE,RXY")
4414 (set_attr "type" "imul")])
4416 (define_insn "muldi3"
4417 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
4418 (mult:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0")
4419 (match_operand:DI 2 "general_operand" "d,K,m")))]
4425 [(set_attr "op_type" "RRE,RI,RXY")
4426 (set_attr "type" "imul")])
4429 ; mulsi3 instruction pattern(s).
4432 (define_insn "*mulsi3_sign"
4433 [(set (match_operand:SI 0 "register_operand" "=d")
4434 (mult:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R"))
4435 (match_operand:SI 1 "register_operand" "0")))]
4438 [(set_attr "op_type" "RX")
4439 (set_attr "type" "imul")])
4441 (define_insn "mulsi3"
4442 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
4443 (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
4444 (match_operand:SI 2 "general_operand" "d,K,R,T")))]
4451 [(set_attr "op_type" "RRE,RI,RX,RXY")
4452 (set_attr "type" "imul")])
4455 ; mulsidi3 instruction pattern(s).
4458 (define_insn "mulsidi3"
4459 [(set (match_operand:DI 0 "register_operand" "=d,d")
4460 (mult:DI (sign_extend:DI
4461 (match_operand:SI 1 "register_operand" "%0,0"))
4463 (match_operand:SI 2 "nonimmediate_operand" "d,R"))))]
4468 [(set_attr "op_type" "RR,RX")
4469 (set_attr "type" "imul")])
4472 ; umulsidi3 instruction pattern(s).
4475 (define_insn "umulsidi3"
4476 [(set (match_operand:DI 0 "register_operand" "=d,d")
4477 (mult:DI (zero_extend:DI
4478 (match_operand:SI 1 "register_operand" "%0,0"))
4480 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))]
4481 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4485 [(set_attr "op_type" "RRE,RXY")
4486 (set_attr "type" "imul")])
4489 ; muldf3 instruction pattern(s).
4492 (define_expand "muldf3"
4493 [(set (match_operand:DF 0 "register_operand" "=f,f")
4494 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4495 (match_operand:DF 2 "general_operand" "f,R")))]
4499 (define_insn "*muldf3"
4500 [(set (match_operand:DF 0 "register_operand" "=f,f")
4501 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4502 (match_operand:DF 2 "general_operand" "f,R")))]
4503 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4507 [(set_attr "op_type" "RRE,RXE")
4508 (set_attr "type" "fmuld")])
4510 (define_insn "*muldf3_ibm"
4511 [(set (match_operand:DF 0 "register_operand" "=f,f")
4512 (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0")
4513 (match_operand:DF 2 "general_operand" "f,R")))]
4514 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4518 [(set_attr "op_type" "RR,RX")
4519 (set_attr "type" "fmuld")])
4521 (define_insn "*fmadddf"
4522 [(set (match_operand:DF 0 "register_operand" "=f,f")
4523 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f")
4524 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4525 (match_operand:DF 3 "register_operand" "0,0")))]
4526 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4530 [(set_attr "op_type" "RRE,RXE")
4531 (set_attr "type" "fmuld")])
4533 (define_insn "*fmsubdf"
4534 [(set (match_operand:DF 0 "register_operand" "=f,f")
4535 (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f")
4536 (match_operand:DF 2 "nonimmediate_operand" "f,R"))
4537 (match_operand:DF 3 "register_operand" "0,0")))]
4538 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4542 [(set_attr "op_type" "RRE,RXE")
4543 (set_attr "type" "fmuld")])
4546 ; mulsf3 instruction pattern(s).
4549 (define_expand "mulsf3"
4550 [(set (match_operand:SF 0 "register_operand" "=f,f")
4551 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4552 (match_operand:SF 2 "general_operand" "f,R")))]
4556 (define_insn "*mulsf3"
4557 [(set (match_operand:SF 0 "register_operand" "=f,f")
4558 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4559 (match_operand:SF 2 "general_operand" "f,R")))]
4560 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
4564 [(set_attr "op_type" "RRE,RXE")
4565 (set_attr "type" "fmuls")])
4567 (define_insn "*mulsf3_ibm"
4568 [(set (match_operand:SF 0 "register_operand" "=f,f")
4569 (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0")
4570 (match_operand:SF 2 "general_operand" "f,R")))]
4571 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
4575 [(set_attr "op_type" "RR,RX")
4576 (set_attr "type" "fmuls")])
4578 (define_insn "*fmaddsf"
4579 [(set (match_operand:SF 0 "register_operand" "=f,f")
4580 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f")
4581 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4582 (match_operand:SF 3 "register_operand" "0,0")))]
4583 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4587 [(set_attr "op_type" "RRE,RXE")
4588 (set_attr "type" "fmuls")])
4590 (define_insn "*fmsubsf"
4591 [(set (match_operand:SF 0 "register_operand" "=f,f")
4592 (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f")
4593 (match_operand:SF 2 "nonimmediate_operand" "f,R"))
4594 (match_operand:SF 3 "register_operand" "0,0")))]
4595 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD"
4599 [(set_attr "op_type" "RRE,RXE")
4600 (set_attr "type" "fmuls")])
4603 ;;- Divide and modulo instructions.
4607 ; divmoddi4 instruction pattern(s).
4610 (define_expand "divmoddi4"
4611 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4612 (div:DI (match_operand:DI 1 "register_operand" "")
4613 (match_operand:DI 2 "general_operand" "")))
4614 (set (match_operand:DI 3 "general_operand" "")
4615 (mod:DI (match_dup 1) (match_dup 2)))])
4616 (clobber (match_dup 4))]
4619 rtx insn, div_equal, mod_equal;
4621 div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
4622 mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
4624 operands[4] = gen_reg_rtx(TImode);
4625 emit_insn (gen_divmodtidi3 (operands[4], operands[1], operands[2]));
4627 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4629 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4631 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4633 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4638 (define_insn "divmodtidi3"
4639 [(set (match_operand:TI 0 "register_operand" "=d,d")
4643 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4644 (match_operand:DI 2 "general_operand" "d,m")))
4646 (zero_extend:TI (div:DI (match_dup 1) (match_dup 2)))))]
4651 [(set_attr "op_type" "RRE,RXY")
4652 (set_attr "type" "idiv")])
4654 (define_insn "divmodtisi3"
4655 [(set (match_operand:TI 0 "register_operand" "=d,d")
4659 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4661 (match_operand:SI 2 "nonimmediate_operand" "d,m"))))
4664 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2))))))]
4669 [(set_attr "op_type" "RRE,RXY")
4670 (set_attr "type" "idiv")])
4673 ; udivmoddi4 instruction pattern(s).
4676 (define_expand "udivmoddi4"
4677 [(parallel [(set (match_operand:DI 0 "general_operand" "")
4678 (udiv:DI (match_operand:DI 1 "general_operand" "")
4679 (match_operand:DI 2 "nonimmediate_operand" "")))
4680 (set (match_operand:DI 3 "general_operand" "")
4681 (umod:DI (match_dup 1) (match_dup 2)))])
4682 (clobber (match_dup 4))]
4685 rtx insn, div_equal, mod_equal, equal;
4687 div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
4688 mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
4689 equal = gen_rtx_IOR (TImode,
4690 gen_rtx_ASHIFT (TImode,
4691 gen_rtx_ZERO_EXTEND (TImode, mod_equal),
4693 gen_rtx_ZERO_EXTEND (TImode, div_equal));
4695 operands[4] = gen_reg_rtx(TImode);
4696 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4697 emit_move_insn (gen_lowpart (DImode, operands[4]), operands[1]);
4698 emit_move_insn (gen_highpart (DImode, operands[4]), const0_rtx);
4699 insn = emit_insn (gen_udivmodtidi3 (operands[4], operands[4], operands[2]));
4701 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4703 insn = emit_move_insn (operands[0], gen_lowpart (DImode, operands[4]));
4705 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4707 insn = emit_move_insn (operands[3], gen_highpart (DImode, operands[4]));
4709 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4714 (define_insn "udivmodtidi3"
4715 [(set (match_operand:TI 0 "register_operand" "=d,d")
4720 (umod:TI (match_operand:TI 1 "register_operand" "0,0")
4722 (match_operand:DI 2 "nonimmediate_operand" "d,m")))))
4726 (udiv:TI (match_dup 1) (zero_extend:TI (match_dup 2)))))))]
4731 [(set_attr "op_type" "RRE,RXY")
4732 (set_attr "type" "idiv")])
4735 ; divmodsi4 instruction pattern(s).
4738 (define_expand "divmodsi4"
4739 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4740 (div:SI (match_operand:SI 1 "general_operand" "")
4741 (match_operand:SI 2 "nonimmediate_operand" "")))
4742 (set (match_operand:SI 3 "general_operand" "")
4743 (mod:SI (match_dup 1) (match_dup 2)))])
4744 (clobber (match_dup 4))]
4747 rtx insn, div_equal, mod_equal, equal;
4749 div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
4750 mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
4751 equal = gen_rtx_IOR (DImode,
4752 gen_rtx_ASHIFT (DImode,
4753 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4755 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4757 operands[4] = gen_reg_rtx(DImode);
4758 emit_insn (gen_extendsidi2 (operands[4], operands[1]));
4759 insn = emit_insn (gen_divmoddisi3 (operands[4], operands[4], operands[2]));
4761 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4763 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4765 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4767 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4769 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4774 (define_insn "divmoddisi3"
4775 [(set (match_operand:DI 0 "register_operand" "=d,d")
4780 (mod:DI (match_operand:DI 1 "register_operand" "0,0")
4782 (match_operand:SI 2 "nonimmediate_operand" "d,R")))))
4786 (div:DI (match_dup 1) (sign_extend:DI (match_dup 2)))))))]
4791 [(set_attr "op_type" "RR,RX")
4792 (set_attr "type" "idiv")])
4795 ; udivsi3 and umodsi3 instruction pattern(s).
4798 (define_expand "udivmodsi4"
4799 [(parallel [(set (match_operand:SI 0 "general_operand" "")
4800 (udiv:SI (match_operand:SI 1 "general_operand" "")
4801 (match_operand:SI 2 "nonimmediate_operand" "")))
4802 (set (match_operand:SI 3 "general_operand" "")
4803 (umod:SI (match_dup 1) (match_dup 2)))])
4804 (clobber (match_dup 4))]
4805 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4807 rtx insn, div_equal, mod_equal, equal;
4809 div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4810 mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4811 equal = gen_rtx_IOR (DImode,
4812 gen_rtx_ASHIFT (DImode,
4813 gen_rtx_ZERO_EXTEND (DImode, mod_equal),
4815 gen_rtx_ZERO_EXTEND (DImode, div_equal));
4817 operands[4] = gen_reg_rtx(DImode);
4818 emit_insn (gen_rtx_CLOBBER (VOIDmode, operands[4]));
4819 emit_move_insn (gen_lowpart (SImode, operands[4]), operands[1]);
4820 emit_move_insn (gen_highpart (SImode, operands[4]), const0_rtx);
4821 insn = emit_insn (gen_udivmoddisi3 (operands[4], operands[4], operands[2]));
4823 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4825 insn = emit_move_insn (operands[0], gen_lowpart (SImode, operands[4]));
4827 gen_rtx_EXPR_LIST (REG_EQUAL, div_equal, REG_NOTES (insn));
4829 insn = emit_move_insn (operands[3], gen_highpart (SImode, operands[4]));
4831 gen_rtx_EXPR_LIST (REG_EQUAL, mod_equal, REG_NOTES (insn));
4836 (define_insn "udivmoddisi3"
4837 [(set (match_operand:DI 0 "register_operand" "=d,d")
4842 (umod:DI (match_operand:DI 1 "register_operand" "0,0")
4844 (match_operand:SI 2 "nonimmediate_operand" "d,m")))))
4848 (udiv:DI (match_dup 1) (zero_extend:DI (match_dup 2)))))))]
4849 "!TARGET_64BIT && TARGET_CPU_ZARCH"
4853 [(set_attr "op_type" "RRE,RXY")
4854 (set_attr "type" "idiv")])
4856 (define_expand "udivsi3"
4857 [(set (match_operand:SI 0 "register_operand" "=d")
4858 (udiv:SI (match_operand:SI 1 "general_operand" "")
4859 (match_operand:SI 2 "general_operand" "")))
4860 (clobber (match_dup 3))]
4861 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4863 rtx insn, udiv_equal, umod_equal, equal;
4865 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4866 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4867 equal = gen_rtx_IOR (DImode,
4868 gen_rtx_ASHIFT (DImode,
4869 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4871 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4873 operands[3] = gen_reg_rtx (DImode);
4875 if (CONSTANT_P (operands[2]))
4877 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
4879 rtx label1 = gen_label_rtx ();
4881 operands[1] = make_safe_from (operands[1], operands[0]);
4882 emit_move_insn (operands[0], const0_rtx);
4883 emit_insn (gen_cmpsi (operands[1], operands[2]));
4884 emit_jump_insn (gen_bltu (label1));
4885 emit_move_insn (operands[0], const1_rtx);
4886 emit_label (label1);
4890 operands[2] = force_reg (SImode, operands[2]);
4891 operands[2] = make_safe_from (operands[2], operands[0]);
4893 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4894 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4897 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4899 insn = emit_move_insn (operands[0],
4900 gen_lowpart (SImode, operands[3]));
4902 gen_rtx_EXPR_LIST (REG_EQUAL,
4903 udiv_equal, REG_NOTES (insn));
4908 rtx label1 = gen_label_rtx ();
4909 rtx label2 = gen_label_rtx ();
4910 rtx label3 = gen_label_rtx ();
4912 operands[1] = force_reg (SImode, operands[1]);
4913 operands[1] = make_safe_from (operands[1], operands[0]);
4914 operands[2] = force_reg (SImode, operands[2]);
4915 operands[2] = make_safe_from (operands[2], operands[0]);
4917 emit_move_insn (operands[0], const0_rtx);
4918 emit_insn (gen_cmpsi (operands[2], operands[1]));
4919 emit_jump_insn (gen_bgtu (label3));
4920 emit_insn (gen_cmpsi (operands[2], const0_rtx));
4921 emit_jump_insn (gen_blt (label2));
4922 emit_insn (gen_cmpsi (operands[2], const1_rtx));
4923 emit_jump_insn (gen_beq (label1));
4924 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4925 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4928 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4930 insn = emit_move_insn (operands[0],
4931 gen_lowpart (SImode, operands[3]));
4933 gen_rtx_EXPR_LIST (REG_EQUAL,
4934 udiv_equal, REG_NOTES (insn));
4936 emit_label (label1);
4937 emit_move_insn (operands[0], operands[1]);
4939 emit_label (label2);
4940 emit_move_insn (operands[0], const1_rtx);
4941 emit_label (label3);
4943 emit_move_insn (operands[0], operands[0]);
4947 (define_expand "umodsi3"
4948 [(set (match_operand:SI 0 "register_operand" "=d")
4949 (umod:SI (match_operand:SI 1 "nonimmediate_operand" "")
4950 (match_operand:SI 2 "nonimmediate_operand" "")))
4951 (clobber (match_dup 3))]
4952 "!TARGET_64BIT && !TARGET_CPU_ZARCH"
4954 rtx insn, udiv_equal, umod_equal, equal;
4956 udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
4957 umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
4958 equal = gen_rtx_IOR (DImode,
4959 gen_rtx_ASHIFT (DImode,
4960 gen_rtx_ZERO_EXTEND (DImode, umod_equal),
4962 gen_rtx_ZERO_EXTEND (DImode, udiv_equal));
4964 operands[3] = gen_reg_rtx (DImode);
4966 if (CONSTANT_P (operands[2]))
4968 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
4970 rtx label1 = gen_label_rtx ();
4972 operands[1] = make_safe_from (operands[1], operands[0]);
4973 emit_move_insn (operands[0], operands[1]);
4974 emit_insn (gen_cmpsi (operands[0], operands[2]));
4975 emit_jump_insn (gen_bltu (label1));
4976 emit_insn (gen_abssi2 (operands[0], operands[2]));
4977 emit_insn (gen_addsi3 (operands[0], operands[0], operands[1]));
4978 emit_label (label1);
4982 operands[2] = force_reg (SImode, operands[2]);
4983 operands[2] = make_safe_from (operands[2], operands[0]);
4985 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
4986 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
4989 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
4991 insn = emit_move_insn (operands[0],
4992 gen_highpart (SImode, operands[3]));
4994 gen_rtx_EXPR_LIST (REG_EQUAL,
4995 umod_equal, REG_NOTES (insn));
5000 rtx label1 = gen_label_rtx ();
5001 rtx label2 = gen_label_rtx ();
5002 rtx label3 = gen_label_rtx ();
5004 operands[1] = force_reg (SImode, operands[1]);
5005 operands[1] = make_safe_from (operands[1], operands[0]);
5006 operands[2] = force_reg (SImode, operands[2]);
5007 operands[2] = make_safe_from (operands[2], operands[0]);
5009 emit_move_insn(operands[0], operands[1]);
5010 emit_insn (gen_cmpsi (operands[2], operands[1]));
5011 emit_jump_insn (gen_bgtu (label3));
5012 emit_insn (gen_cmpsi (operands[2], const0_rtx));
5013 emit_jump_insn (gen_blt (label2));
5014 emit_insn (gen_cmpsi (operands[2], const1_rtx));
5015 emit_jump_insn (gen_beq (label1));
5016 emit_insn (gen_zero_extendsidi2 (operands[3], operands[1]));
5017 insn = emit_insn (gen_divmoddisi3 (operands[3], operands[3],
5020 gen_rtx_EXPR_LIST (REG_EQUAL, equal, REG_NOTES (insn));
5022 insn = emit_move_insn (operands[0],
5023 gen_highpart (SImode, operands[3]));
5025 gen_rtx_EXPR_LIST (REG_EQUAL,
5026 umod_equal, REG_NOTES (insn));
5028 emit_label (label1);
5029 emit_move_insn (operands[0], const0_rtx);
5031 emit_label (label2);
5032 emit_insn (gen_subsi3 (operands[0], operands[0], operands[2]));
5033 emit_label (label3);
5039 ; divdf3 instruction pattern(s).
5042 (define_expand "divdf3"
5043 [(set (match_operand:DF 0 "register_operand" "=f,f")
5044 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5045 (match_operand:DF 2 "general_operand" "f,R")))]
5049 (define_insn "*divdf3"
5050 [(set (match_operand:DF 0 "register_operand" "=f,f")
5051 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5052 (match_operand:DF 2 "general_operand" "f,R")))]
5053 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5057 [(set_attr "op_type" "RRE,RXE")
5058 (set_attr "type" "fdivd")])
5060 (define_insn "*divdf3_ibm"
5061 [(set (match_operand:DF 0 "register_operand" "=f,f")
5062 (div:DF (match_operand:DF 1 "register_operand" "0,0")
5063 (match_operand:DF 2 "general_operand" "f,R")))]
5064 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5068 [(set_attr "op_type" "RR,RX")
5069 (set_attr "type" "fdivd")])
5072 ; divsf3 instruction pattern(s).
5075 (define_expand "divsf3"
5076 [(set (match_operand:SF 0 "register_operand" "=f,f")
5077 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5078 (match_operand:SF 2 "general_operand" "f,R")))]
5082 (define_insn "*divsf3"
5083 [(set (match_operand:SF 0 "register_operand" "=f,f")
5084 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5085 (match_operand:SF 2 "general_operand" "f,R")))]
5086 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5090 [(set_attr "op_type" "RRE,RXE")
5091 (set_attr "type" "fdivs")])
5093 (define_insn "*divsf3"
5094 [(set (match_operand:SF 0 "register_operand" "=f,f")
5095 (div:SF (match_operand:SF 1 "register_operand" "0,0")
5096 (match_operand:SF 2 "general_operand" "f,R")))]
5097 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5101 [(set_attr "op_type" "RR,RX")
5102 (set_attr "type" "fdivs")])
5106 ;;- And instructions.
5110 ; anddi3 instruction pattern(s).
5113 (define_insn "*anddi3_cc"
5115 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5116 (match_operand:DI 2 "general_operand" "d,m"))
5118 (set (match_operand:DI 0 "register_operand" "=d,d")
5119 (and:DI (match_dup 1) (match_dup 2)))]
5120 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5124 [(set_attr "op_type" "RRE,RXY")])
5126 (define_insn "*anddi3_cconly"
5128 (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5129 (match_operand:DI 2 "general_operand" "d,m"))
5131 (clobber (match_scratch:DI 0 "=d,d"))]
5132 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT
5133 /* Do not steal TM patterns. */
5134 && s390_single_part (operands[2], DImode, HImode, 0) < 0"
5138 [(set_attr "op_type" "RRE,RXY")])
5140 (define_insn "*anddi3"
5141 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
5142 (and:DI (match_operand:DI 1 "nonimmediate_operand"
5143 "%d,o,0,0,0,0,0,0,0,0")
5144 (match_operand:DI 2 "general_operand"
5145 "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q")))
5146 (clobber (reg:CC 33))]
5147 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5159 [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY,SI,SS")])
5162 [(set (match_operand:DI 0 "s_operand" "")
5163 (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5164 (clobber (reg:CC 33))]
5167 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5168 (clobber (reg:CC 33))])]
5169 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5171 (define_expand "anddi3"
5172 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5173 (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
5174 (match_operand:DI 2 "general_operand" "")))
5175 (clobber (reg:CC 33))]
5177 "s390_expand_logical_operator (AND, DImode, operands); DONE;")
5180 ; andsi3 instruction pattern(s).
5183 (define_insn "*andsi3_cc"
5185 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5186 (match_operand:SI 2 "general_operand" "d,R,T"))
5188 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5189 (and:SI (match_dup 1) (match_dup 2)))]
5190 "s390_match_ccmode(insn, CCTmode)"
5195 [(set_attr "op_type" "RR,RX,RXY")])
5197 (define_insn "*andsi3_cconly"
5199 (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5200 (match_operand:SI 2 "general_operand" "d,R,T"))
5202 (clobber (match_scratch:SI 0 "=d,d,d"))]
5203 "s390_match_ccmode(insn, CCTmode)
5204 /* Do not steal TM patterns. */
5205 && s390_single_part (operands[2], SImode, HImode, 0) < 0"
5210 [(set_attr "op_type" "RR,RX,RXY")])
5212 (define_insn "*andsi3_zarch"
5213 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,AQ,Q")
5214 (and:SI (match_operand:SI 1 "nonimmediate_operand"
5215 "%d,o,0,0,0,0,0,0,0")
5216 (match_operand:SI 2 "general_operand"
5217 "M,M,N0HSF,N1HSF,d,R,T,NxQSF,Q")))
5218 (clobber (reg:CC 33))]
5219 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5230 [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY,SI,SS")])
5232 (define_insn "*andsi3_esa"
5233 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5234 (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0")
5235 (match_operand:SI 2 "general_operand" "d,R,NxQSF,Q")))
5236 (clobber (reg:CC 33))]
5237 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5243 [(set_attr "op_type" "RR,RX,SI,SS")])
5246 [(set (match_operand:SI 0 "s_operand" "")
5247 (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5248 (clobber (reg:CC 33))]
5251 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5252 (clobber (reg:CC 33))])]
5253 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5255 (define_expand "andsi3"
5256 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5257 (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
5258 (match_operand:SI 2 "general_operand" "")))
5259 (clobber (reg:CC 33))]
5261 "s390_expand_logical_operator (AND, SImode, operands); DONE;")
5264 ; andhi3 instruction pattern(s).
5267 (define_insn "*andhi3_zarch"
5268 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5269 (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0")
5270 (match_operand:HI 2 "general_operand" "d,n,NxQHF,Q")))
5271 (clobber (reg:CC 33))]
5272 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5278 [(set_attr "op_type" "RR,RI,SI,SS")])
5280 (define_insn "*andhi3_esa"
5281 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5282 (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5283 (match_operand:HI 2 "general_operand" "d,NxQHF,Q")))
5284 (clobber (reg:CC 33))]
5285 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5290 [(set_attr "op_type" "RR,SI,SS")])
5293 [(set (match_operand:HI 0 "s_operand" "")
5294 (and:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5295 (clobber (reg:CC 33))]
5298 [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1)))
5299 (clobber (reg:CC 33))])]
5300 "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
5302 (define_expand "andhi3"
5303 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5304 (and:HI (match_operand:HI 1 "nonimmediate_operand" "")
5305 (match_operand:HI 2 "general_operand" "")))
5306 (clobber (reg:CC 33))]
5308 "s390_expand_logical_operator (AND, HImode, operands); DONE;")
5311 ; andqi3 instruction pattern(s).
5314 (define_insn "*andqi3_zarch"
5315 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q")
5316 (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0")
5317 (match_operand:QI 2 "general_operand" "d,n,n,n,Q")))
5318 (clobber (reg:CC 33))]
5319 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5326 [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5328 (define_insn "*andqi3_esa"
5329 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5330 (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
5331 (match_operand:QI 2 "general_operand" "d,n,Q")))
5332 (clobber (reg:CC 33))]
5333 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5338 [(set_attr "op_type" "RR,SI,SS")])
5340 (define_expand "andqi3"
5341 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5342 (and:QI (match_operand:QI 1 "nonimmediate_operand" "")
5343 (match_operand:QI 2 "general_operand" "")))
5344 (clobber (reg:CC 33))]
5346 "s390_expand_logical_operator (AND, QImode, operands); DONE;")
5350 ;;- Bit set (inclusive or) instructions.
5354 ; iordi3 instruction pattern(s).
5357 (define_insn "*iordi3_cc"
5359 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5360 (match_operand:DI 2 "general_operand" "d,m"))
5362 (set (match_operand:DI 0 "register_operand" "=d,d")
5363 (ior:DI (match_dup 1) (match_dup 2)))]
5364 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5368 [(set_attr "op_type" "RRE,RXY")])
5370 (define_insn "*iordi3_cconly"
5372 (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5373 (match_operand:DI 2 "general_operand" "d,m"))
5375 (clobber (match_scratch:DI 0 "=d,d"))]
5376 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5380 [(set_attr "op_type" "RRE,RXY")])
5382 (define_insn "*iordi3"
5383 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
5384 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0,0,0")
5385 (match_operand:DI 2 "general_operand"
5386 "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q")))
5387 (clobber (reg:CC 33))]
5388 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5398 [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY,SI,SS")])
5401 [(set (match_operand:DI 0 "s_operand" "")
5402 (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5403 (clobber (reg:CC 33))]
5406 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5407 (clobber (reg:CC 33))])]
5408 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5410 (define_expand "iordi3"
5411 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5412 (ior:DI (match_operand:DI 1 "nonimmediate_operand" "")
5413 (match_operand:DI 2 "general_operand" "")))
5414 (clobber (reg:CC 33))]
5416 "s390_expand_logical_operator (IOR, DImode, operands); DONE;")
5419 ; iorsi3 instruction pattern(s).
5422 (define_insn "*iorsi3_cc"
5424 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5425 (match_operand:SI 2 "general_operand" "d,R,T"))
5427 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5428 (ior:SI (match_dup 1) (match_dup 2)))]
5429 "s390_match_ccmode(insn, CCTmode)"
5434 [(set_attr "op_type" "RR,RX,RXY")])
5436 (define_insn "*iorsi3_cconly"
5438 (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5439 (match_operand:SI 2 "general_operand" "d,R,T"))
5441 (clobber (match_scratch:SI 0 "=d,d,d"))]
5442 "s390_match_ccmode(insn, CCTmode)"
5447 [(set_attr "op_type" "RR,RX,RXY")])
5449 (define_insn "*iorsi3_zarch"
5450 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,AQ,Q")
5451 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0,0,0")
5452 (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T,NxQS0,Q")))
5453 (clobber (reg:CC 33))]
5454 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5463 [(set_attr "op_type" "RI,RI,RR,RX,RXY,SI,SS")])
5465 (define_insn "*iorsi3_esa"
5466 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5467 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0")
5468 (match_operand:SI 2 "general_operand" "d,R,NxQS0,Q")))
5469 (clobber (reg:CC 33))]
5470 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5476 [(set_attr "op_type" "RR,RX,SI,SS")])
5479 [(set (match_operand:SI 0 "s_operand" "")
5480 (ior:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5481 (clobber (reg:CC 33))]
5484 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5485 (clobber (reg:CC 33))])]
5486 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5488 (define_expand "iorsi3"
5489 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5490 (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
5491 (match_operand:SI 2 "general_operand" "")))
5492 (clobber (reg:CC 33))]
5494 "s390_expand_logical_operator (IOR, SImode, operands); DONE;")
5497 ; iorhi3 instruction pattern(s).
5500 (define_insn "*iorhi3_zarch"
5501 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5502 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0")
5503 (match_operand:HI 2 "general_operand" "d,n,NxQH0,Q")))
5504 (clobber (reg:CC 33))]
5505 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5511 [(set_attr "op_type" "RR,RI,SI,SS")])
5513 (define_insn "*iorhi3_esa"
5514 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5515 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5516 (match_operand:HI 2 "general_operand" "d,NxQH0,Q")))
5517 (clobber (reg:CC 33))]
5518 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5523 [(set_attr "op_type" "RR,SI,SS")])
5526 [(set (match_operand:HI 0 "s_operand" "")
5527 (ior:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5528 (clobber (reg:CC 33))]
5531 [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1)))
5532 (clobber (reg:CC 33))])]
5533 "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
5535 (define_expand "iorhi3"
5536 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5537 (ior:HI (match_operand:HI 1 "nonimmediate_operand" "")
5538 (match_operand:HI 2 "general_operand" "")))
5539 (clobber (reg:CC 33))]
5541 "s390_expand_logical_operator (IOR, HImode, operands); DONE;")
5544 ; iorqi3 instruction pattern(s).
5547 (define_insn "*iorqi3_zarch"
5548 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q")
5549 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0")
5550 (match_operand:QI 2 "general_operand" "d,n,n,n,Q")))
5551 (clobber (reg:CC 33))]
5552 "TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5559 [(set_attr "op_type" "RR,RI,SI,SIY,SS")])
5561 (define_insn "*iorqi3_esa"
5562 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q")
5563 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
5564 (match_operand:QI 2 "general_operand" "d,n,Q")))
5565 (clobber (reg:CC 33))]
5566 "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)"
5571 [(set_attr "op_type" "RR,SI,SS")])
5573 (define_expand "iorqi3"
5574 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5575 (ior:QI (match_operand:QI 1 "nonimmediate_operand" "")
5576 (match_operand:QI 2 "general_operand" "")))
5577 (clobber (reg:CC 33))]
5579 "s390_expand_logical_operator (IOR, QImode, operands); DONE;")
5583 ;;- Xor instructions.
5587 ; xordi3 instruction pattern(s).
5590 (define_insn "*xordi3_cc"
5592 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5593 (match_operand:DI 2 "general_operand" "d,m"))
5595 (set (match_operand:DI 0 "register_operand" "=d,d")
5596 (xor:DI (match_dup 1) (match_dup 2)))]
5597 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5601 [(set_attr "op_type" "RRE,RXY")])
5603 (define_insn "*xordi3_cconly"
5605 (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
5606 (match_operand:DI 2 "general_operand" "d,m"))
5608 (clobber (match_scratch:DI 0 "=d,d"))]
5609 "s390_match_ccmode(insn, CCTmode) && TARGET_64BIT"
5613 [(set_attr "op_type" "RRE,RXY")])
5615 (define_insn "*xordi3"
5616 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q")
5617 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0")
5618 (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q")))
5619 (clobber (reg:CC 33))]
5620 "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
5626 [(set_attr "op_type" "RRE,RXY,SI,SS")])
5629 [(set (match_operand:DI 0 "s_operand" "")
5630 (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" "")))
5631 (clobber (reg:CC 33))]
5634 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5635 (clobber (reg:CC 33))])]
5636 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5638 (define_expand "xordi3"
5639 [(set (match_operand:DI 0 "nonimmediate_operand" "")
5640 (xor:DI (match_operand:DI 1 "nonimmediate_operand" "")
5641 (match_operand:DI 2 "general_operand" "")))
5642 (clobber (reg:CC 33))]
5644 "s390_expand_logical_operator (XOR, DImode, operands); DONE;")
5647 ; xorsi3 instruction pattern(s).
5650 (define_insn "*xorsi3_cc"
5652 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5653 (match_operand:SI 2 "general_operand" "d,R,T"))
5655 (set (match_operand:SI 0 "register_operand" "=d,d,d")
5656 (xor:SI (match_dup 1) (match_dup 2)))]
5657 "s390_match_ccmode(insn, CCTmode)"
5662 [(set_attr "op_type" "RR,RX,RXY")])
5664 (define_insn "*xorsi3_cconly"
5666 (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
5667 (match_operand:SI 2 "general_operand" "d,R,T"))
5669 (clobber (match_scratch:SI 0 "=d,d,d"))]
5670 "s390_match_ccmode(insn, CCTmode)"
5675 [(set_attr "op_type" "RR,RX,RXY")])
5677 (define_insn "*xorsi3"
5678 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,AQ,Q")
5679 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0")
5680 (match_operand:SI 2 "general_operand" "d,R,T,NxQS0,Q")))
5681 (clobber (reg:CC 33))]
5682 "s390_logical_operator_ok_p (operands)"
5689 [(set_attr "op_type" "RR,RX,RXY,SI,SS")])
5692 [(set (match_operand:SI 0 "s_operand" "")
5693 (xor:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" "")))
5694 (clobber (reg:CC 33))]
5697 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5698 (clobber (reg:CC 33))])]
5699 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5701 (define_expand "xorsi3"
5702 [(set (match_operand:SI 0 "nonimmediate_operand" "")
5703 (xor:SI (match_operand:SI 1 "nonimmediate_operand" "")
5704 (match_operand:SI 2 "general_operand" "")))
5705 (clobber (reg:CC 33))]
5707 "s390_expand_logical_operator (XOR, SImode, operands); DONE;")
5710 ; xorhi3 instruction pattern(s).
5713 (define_insn "*xorhi3"
5714 [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q")
5715 (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0")
5716 (match_operand:HI 2 "general_operand" "d,NxQH0,Q")))
5717 (clobber (reg:CC 33))]
5718 "s390_logical_operator_ok_p (operands)"
5723 [(set_attr "op_type" "RR,SI,SS")])
5726 [(set (match_operand:HI 0 "s_operand" "")
5727 (xor:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" "")))
5728 (clobber (reg:CC 33))]
5731 [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1)))
5732 (clobber (reg:CC 33))])]
5733 "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
5735 (define_expand "xorhi3"
5736 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5737 (xor:HI (match_operand:HI 1 "nonimmediate_operand" "")
5738 (match_operand:HI 2 "general_operand" "")))
5739 (clobber (reg:CC 33))]
5741 "s390_expand_logical_operator (XOR, HImode, operands); DONE;")
5744 ; xorqi3 instruction pattern(s).
5747 (define_insn "*xorqi3"
5748 [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,S,Q")
5749 (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0")
5750 (match_operand:QI 2 "general_operand" "d,n,n,Q")))
5751 (clobber (reg:CC 33))]
5752 "s390_logical_operator_ok_p (operands)"
5758 [(set_attr "op_type" "RR,SI,SIY,SS")])
5760 (define_expand "xorqi3"
5761 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5762 (xor:QI (match_operand:QI 1 "nonimmediate_operand" "")
5763 (match_operand:QI 2 "general_operand" "")))
5764 (clobber (reg:CC 33))]
5766 "s390_expand_logical_operator (XOR, QImode, operands); DONE;")
5770 ;;- Negate instructions.
5774 ; negdi2 instruction pattern(s).
5777 (define_expand "negdi2"
5779 [(set (match_operand:DI 0 "register_operand" "=d")
5780 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5781 (clobber (reg:CC 33))])]
5785 (define_insn "*negdi2_64"
5786 [(set (match_operand:DI 0 "register_operand" "=d")
5787 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5788 (clobber (reg:CC 33))]
5791 [(set_attr "op_type" "RR")])
5793 (define_insn "*negdi2_31"
5794 [(set (match_operand:DI 0 "register_operand" "=d")
5795 (neg:DI (match_operand:DI 1 "register_operand" "d")))
5796 (clobber (reg:CC 33))]
5800 xop[0] = gen_label_rtx ();
5801 output_asm_insn ("lcr\t%0,%1", operands);
5802 output_asm_insn ("lcr\t%N0,%N1", operands);
5803 output_asm_insn ("je\t%l0", xop);
5804 output_asm_insn ("bctr\t%0,0", operands);
5805 targetm.asm_out.internal_label (asm_out_file, "L",
5806 CODE_LABEL_NUMBER (xop[0]));
5809 [(set_attr "op_type" "NN")
5810 (set_attr "type" "other")
5811 (set_attr "length" "10")])
5814 ; negsi2 instruction pattern(s).
5817 (define_insn "negsi2"
5818 [(set (match_operand:SI 0 "register_operand" "=d")
5819 (neg:SI (match_operand:SI 1 "register_operand" "d")))
5820 (clobber (reg:CC 33))]
5823 [(set_attr "op_type" "RR")])
5826 ; negdf2 instruction pattern(s).
5829 (define_expand "negdf2"
5831 [(set (match_operand:DF 0 "register_operand" "=f")
5832 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5833 (clobber (reg:CC 33))])]
5837 (define_insn "*negdf2"
5838 [(set (match_operand:DF 0 "register_operand" "=f")
5839 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5840 (clobber (reg:CC 33))]
5841 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5843 [(set_attr "op_type" "RRE")
5844 (set_attr "type" "fsimpd")])
5846 (define_insn "*negdf2_ibm"
5847 [(set (match_operand:DF 0 "register_operand" "=f")
5848 (neg:DF (match_operand:DF 1 "register_operand" "f")))
5849 (clobber (reg:CC 33))]
5850 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5852 [(set_attr "op_type" "RR")
5853 (set_attr "type" "fsimpd")])
5856 ; negsf2 instruction pattern(s).
5859 (define_expand "negsf2"
5861 [(set (match_operand:SF 0 "register_operand" "=f")
5862 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5863 (clobber (reg:CC 33))])]
5867 (define_insn "*negsf2"
5868 [(set (match_operand:SF 0 "register_operand" "=f")
5869 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5870 (clobber (reg:CC 33))]
5871 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5873 [(set_attr "op_type" "RRE")
5874 (set_attr "type" "fsimps")])
5876 (define_insn "*negsf2"
5877 [(set (match_operand:SF 0 "register_operand" "=f")
5878 (neg:SF (match_operand:SF 1 "register_operand" "f")))
5879 (clobber (reg:CC 33))]
5880 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5882 [(set_attr "op_type" "RR")
5883 (set_attr "type" "fsimps")])
5887 ;;- Absolute value instructions.
5891 ; absdi2 instruction pattern(s).
5894 (define_insn "absdi2"
5895 [(set (match_operand:DI 0 "register_operand" "=d")
5896 (abs:DI (match_operand:DI 1 "register_operand" "d")))
5897 (clobber (reg:CC 33))]
5900 [(set_attr "op_type" "RRE")])
5903 ; abssi2 instruction pattern(s).
5906 (define_insn "abssi2"
5907 [(set (match_operand:SI 0 "register_operand" "=d")
5908 (abs:SI (match_operand:SI 1 "register_operand" "d")))
5909 (clobber (reg:CC 33))]
5912 [(set_attr "op_type" "RR")])
5915 ; absdf2 instruction pattern(s).
5918 (define_expand "absdf2"
5920 [(set (match_operand:DF 0 "register_operand" "=f")
5921 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5922 (clobber (reg:CC 33))])]
5926 (define_insn "*absdf2"
5927 [(set (match_operand:DF 0 "register_operand" "=f")
5928 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5929 (clobber (reg:CC 33))]
5930 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5932 [(set_attr "op_type" "RRE")
5933 (set_attr "type" "fsimpd")])
5935 (define_insn "*absdf2_ibm"
5936 [(set (match_operand:DF 0 "register_operand" "=f")
5937 (abs:DF (match_operand:DF 1 "register_operand" "f")))
5938 (clobber (reg:CC 33))]
5939 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5941 [(set_attr "op_type" "RR")
5942 (set_attr "type" "fsimpd")])
5945 ; abssf2 instruction pattern(s).
5948 (define_expand "abssf2"
5950 [(set (match_operand:SF 0 "register_operand" "=f")
5951 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5952 (clobber (reg:CC 33))])]
5956 (define_insn "*abssf2"
5957 [(set (match_operand:SF 0 "register_operand" "=f")
5958 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5959 (clobber (reg:CC 33))]
5960 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
5962 [(set_attr "op_type" "RRE")
5963 (set_attr "type" "fsimps")])
5965 (define_insn "*abssf2_ibm"
5966 [(set (match_operand:SF 0 "register_operand" "=f")
5967 (abs:SF (match_operand:SF 1 "register_operand" "f")))
5968 (clobber (reg:CC 33))]
5969 "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT"
5971 [(set_attr "op_type" "RR")
5972 (set_attr "type" "fsimps")])
5975 ;;- Negated absolute value instructions
5982 (define_insn "*negabssi2"
5983 [(set (match_operand:SI 0 "register_operand" "=d")
5984 (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))))
5985 (clobber (reg:CC 33))]
5988 [(set_attr "op_type" "RR")])
5990 (define_insn "*negabsdi2"
5991 [(set (match_operand:DI 0 "register_operand" "=d")
5992 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))))
5993 (clobber (reg:CC 33))]
5996 [(set_attr "op_type" "RRE")])
6002 (define_insn "*negabssf2"
6003 [(set (match_operand:SF 0 "register_operand" "=f")
6004 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6005 (clobber (reg:CC 33))]
6006 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6008 [(set_attr "op_type" "RRE")
6009 (set_attr "type" "fsimps")])
6011 (define_insn "*negabsdf2"
6012 [(set (match_operand:DF 0 "register_operand" "=f")
6013 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6014 (clobber (reg:CC 33))]
6015 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6017 [(set_attr "op_type" "RRE")
6018 (set_attr "type" "fsimpd")])
6021 ;;- Square root instructions.
6025 ; sqrtdf2 instruction pattern(s).
6028 (define_insn "sqrtdf2"
6029 [(set (match_operand:DF 0 "register_operand" "=f,f")
6030 (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))]
6031 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6035 [(set_attr "op_type" "RRE,RXE")])
6038 ; sqrtsf2 instruction pattern(s).
6041 (define_insn "sqrtsf2"
6042 [(set (match_operand:SF 0 "register_operand" "=f,f")
6043 (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))]
6044 "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT"
6048 [(set_attr "op_type" "RRE,RXE")])
6051 ;;- One complement instructions.
6055 ; one_cmpldi2 instruction pattern(s).
6058 (define_expand "one_cmpldi2"
6060 [(set (match_operand:DI 0 "register_operand" "")
6061 (xor:DI (match_operand:DI 1 "register_operand" "")
6063 (clobber (reg:CC 33))])]
6068 ; one_cmplsi2 instruction pattern(s).
6071 (define_expand "one_cmplsi2"
6073 [(set (match_operand:SI 0 "register_operand" "")
6074 (xor:SI (match_operand:SI 1 "register_operand" "")
6076 (clobber (reg:CC 33))])]
6081 ; one_cmplhi2 instruction pattern(s).
6084 (define_expand "one_cmplhi2"
6086 [(set (match_operand:HI 0 "register_operand" "")
6087 (xor:HI (match_operand:HI 1 "register_operand" "")
6089 (clobber (reg:CC 33))])]
6094 ; one_cmplqi2 instruction pattern(s).
6097 (define_expand "one_cmplqi2"
6099 [(set (match_operand:QI 0 "register_operand" "")
6100 (xor:QI (match_operand:QI 1 "register_operand" "")
6102 (clobber (reg:CC 33))])]
6108 ;;- Rotate instructions.
6112 ; rotldi3 instruction pattern(s).
6115 (define_insn "rotldi3"
6116 [(set (match_operand:DI 0 "register_operand" "=d")
6117 (rotate:DI (match_operand:DI 1 "register_operand" "d")
6118 (match_operand:SI 2 "shift_count_operand" "Y")))]
6121 [(set_attr "op_type" "RSE")
6122 (set_attr "atype" "reg")])
6125 ; rotlsi3 instruction pattern(s).
6128 (define_insn "rotlsi3"
6129 [(set (match_operand:SI 0 "register_operand" "=d")
6130 (rotate:SI (match_operand:SI 1 "register_operand" "d")
6131 (match_operand:SI 2 "shift_count_operand" "Y")))]
6134 [(set_attr "op_type" "RSE")
6135 (set_attr "atype" "reg")])
6139 ;;- Arithmetic shift instructions.
6143 ; ashldi3 instruction pattern(s).
6146 (define_expand "ashldi3"
6147 [(set (match_operand:DI 0 "register_operand" "")
6148 (ashift:DI (match_operand:DI 1 "register_operand" "")
6149 (match_operand:SI 2 "shift_count_operand" "")))]
6153 (define_insn "*ashldi3_31"
6154 [(set (match_operand:DI 0 "register_operand" "=d")
6155 (ashift:DI (match_operand:DI 1 "register_operand" "0")
6156 (match_operand:SI 2 "shift_count_operand" "Y")))]
6159 [(set_attr "op_type" "RS")
6160 (set_attr "atype" "reg")])
6162 (define_insn "*ashldi3_64"
6163 [(set (match_operand:DI 0 "register_operand" "=d")
6164 (ashift:DI (match_operand:DI 1 "register_operand" "d")
6165 (match_operand:SI 2 "shift_count_operand" "Y")))]
6168 [(set_attr "op_type" "RSE")
6169 (set_attr "atype" "reg")])
6172 ; ashrdi3 instruction pattern(s).
6175 (define_expand "ashrdi3"
6177 [(set (match_operand:DI 0 "register_operand" "")
6178 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6179 (match_operand:SI 2 "shift_count_operand" "")))
6180 (clobber (reg:CC 33))])]
6184 (define_insn "*ashrdi3_cc_31"
6186 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6187 (match_operand:SI 2 "shift_count_operand" "Y"))
6189 (set (match_operand:DI 0 "register_operand" "=d")
6190 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6191 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6193 [(set_attr "op_type" "RS")
6194 (set_attr "atype" "reg")])
6196 (define_insn "*ashrdi3_cconly_31"
6198 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6199 (match_operand:SI 2 "shift_count_operand" "Y"))
6201 (clobber (match_scratch:DI 0 "=d"))]
6202 "!TARGET_64BIT && s390_match_ccmode(insn, CCSmode)"
6204 [(set_attr "op_type" "RS")
6205 (set_attr "atype" "reg")])
6207 (define_insn "*ashrdi3_31"
6208 [(set (match_operand:DI 0 "register_operand" "=d")
6209 (ashiftrt:DI (match_operand:DI 1 "register_operand" "0")
6210 (match_operand:SI 2 "shift_count_operand" "Y")))
6211 (clobber (reg:CC 33))]
6214 [(set_attr "op_type" "RS")
6215 (set_attr "atype" "reg")])
6217 (define_insn "*ashrdi3_cc_64"
6219 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6220 (match_operand:SI 2 "shift_count_operand" "Y"))
6222 (set (match_operand:DI 0 "register_operand" "=d")
6223 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
6224 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6226 [(set_attr "op_type" "RSE")
6227 (set_attr "atype" "reg")])
6229 (define_insn "*ashrdi3_cconly_64"
6231 (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6232 (match_operand:SI 2 "shift_count_operand" "Y"))
6234 (clobber (match_scratch:DI 0 "=d"))]
6235 "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
6237 [(set_attr "op_type" "RSE")
6238 (set_attr "atype" "reg")])
6240 (define_insn "*ashrdi3_64"
6241 [(set (match_operand:DI 0 "register_operand" "=d")
6242 (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
6243 (match_operand:SI 2 "shift_count_operand" "Y")))
6244 (clobber (reg:CC 33))]
6247 [(set_attr "op_type" "RSE")
6248 (set_attr "atype" "reg")])
6252 ; ashlsi3 instruction pattern(s).
6255 (define_insn "ashlsi3"
6256 [(set (match_operand:SI 0 "register_operand" "=d")
6257 (ashift:SI (match_operand:SI 1 "register_operand" "0")
6258 (match_operand:SI 2 "shift_count_operand" "Y")))]
6261 [(set_attr "op_type" "RS")
6262 (set_attr "atype" "reg")])
6265 ; ashrsi3 instruction pattern(s).
6268 (define_insn "*ashrsi3_cc"
6270 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6271 (match_operand:SI 2 "shift_count_operand" "Y"))
6273 (set (match_operand:SI 0 "register_operand" "=d")
6274 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
6275 "s390_match_ccmode(insn, CCSmode)"
6277 [(set_attr "op_type" "RS")
6278 (set_attr "atype" "reg")])
6281 (define_insn "*ashrsi3_cconly"
6283 (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6284 (match_operand:SI 2 "shift_count_operand" "Y"))
6286 (clobber (match_scratch:SI 0 "=d"))]
6287 "s390_match_ccmode(insn, CCSmode)"
6289 [(set_attr "op_type" "RS")
6290 (set_attr "atype" "reg")])
6292 (define_insn "ashrsi3"
6293 [(set (match_operand:SI 0 "register_operand" "=d")
6294 (ashiftrt:SI (match_operand:SI 1 "register_operand" "0")
6295 (match_operand:SI 2 "shift_count_operand" "Y")))
6296 (clobber (reg:CC 33))]
6299 [(set_attr "op_type" "RS")
6300 (set_attr "atype" "reg")])
6304 ;;- logical shift instructions.
6308 ; lshrdi3 instruction pattern(s).
6311 (define_expand "lshrdi3"
6312 [(set (match_operand:DI 0 "register_operand" "")
6313 (lshiftrt:DI (match_operand:DI 1 "register_operand" "")
6314 (match_operand:SI 2 "shift_count_operand" "")))]
6318 (define_insn "*lshrdi3_31"
6319 [(set (match_operand:DI 0 "register_operand" "=d")
6320 (lshiftrt:DI (match_operand:DI 1 "register_operand" "0")
6321 (match_operand:SI 2 "shift_count_operand" "Y")))]
6324 [(set_attr "op_type" "RS")
6325 (set_attr "atype" "reg")])
6327 (define_insn "*lshrdi3_64"
6328 [(set (match_operand:DI 0 "register_operand" "=d")
6329 (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
6330 (match_operand:SI 2 "shift_count_operand" "Y")))]
6333 [(set_attr "op_type" "RSE")
6334 (set_attr "atype" "reg")])
6337 ; lshrsi3 instruction pattern(s).
6340 (define_insn "lshrsi3"
6341 [(set (match_operand:SI 0 "register_operand" "=d")
6342 (lshiftrt:SI (match_operand:SI 1 "register_operand" "0")
6343 (match_operand:SI 2 "shift_count_operand" "Y")))]
6346 [(set_attr "op_type" "RS")
6347 (set_attr "atype" "reg")])
6351 ;; Branch instruction patterns.
6354 (define_expand "beq"
6355 [(match_operand 0 "" "")]
6357 "s390_emit_jump (operands[0],
6358 s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
6360 (define_expand "bne"
6361 [(match_operand 0 "" "")]
6363 "s390_emit_jump (operands[0],
6364 s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
6366 (define_expand "bgt"
6367 [(match_operand 0 "" "")]
6369 "s390_emit_jump (operands[0],
6370 s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
6372 (define_expand "bgtu"
6373 [(match_operand 0 "" "")]
6375 "s390_emit_jump (operands[0],
6376 s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
6378 (define_expand "blt"
6379 [(match_operand 0 "" "")]
6381 "s390_emit_jump (operands[0],
6382 s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
6384 (define_expand "bltu"
6385 [(match_operand 0 "" "")]
6387 "s390_emit_jump (operands[0],
6388 s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
6390 (define_expand "bge"
6391 [(match_operand 0 "" "")]
6393 "s390_emit_jump (operands[0],
6394 s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
6396 (define_expand "bgeu"
6397 [(match_operand 0 "" "")]
6399 "s390_emit_jump (operands[0],
6400 s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
6402 (define_expand "ble"
6403 [(match_operand 0 "" "")]
6405 "s390_emit_jump (operands[0],
6406 s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
6408 (define_expand "bleu"
6409 [(match_operand 0 "" "")]
6411 "s390_emit_jump (operands[0],
6412 s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
6414 (define_expand "bunordered"
6415 [(match_operand 0 "" "")]
6417 "s390_emit_jump (operands[0],
6418 s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6420 (define_expand "bordered"
6421 [(match_operand 0 "" "")]
6423 "s390_emit_jump (operands[0],
6424 s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
6426 (define_expand "buneq"
6427 [(match_operand 0 "" "")]
6429 "s390_emit_jump (operands[0],
6430 s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
6432 (define_expand "bunlt"
6433 [(match_operand 0 "" "")]
6435 "s390_emit_jump (operands[0],
6436 s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
6438 (define_expand "bungt"
6439 [(match_operand 0 "" "")]
6441 "s390_emit_jump (operands[0],
6442 s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
6444 (define_expand "bunle"
6445 [(match_operand 0 "" "")]
6447 "s390_emit_jump (operands[0],
6448 s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
6450 (define_expand "bunge"
6451 [(match_operand 0 "" "")]
6453 "s390_emit_jump (operands[0],
6454 s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
6456 (define_expand "bltgt"
6457 [(match_operand 0 "" "")]
6459 "s390_emit_jump (operands[0],
6460 s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
6464 ;;- Conditional jump instructions.
6467 (define_insn "*cjump_64"
6470 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6471 (label_ref (match_operand 0 "" ""))
6475 if (get_attr_length (insn) == 4)
6478 return "jg%C1\t%l0";
6480 [(set_attr "op_type" "RI")
6481 (set_attr "type" "branch")
6482 (set (attr "length")
6483 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6484 (const_int 4) (const_int 6)))])
6486 (define_insn "*cjump_31"
6489 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6490 (label_ref (match_operand 0 "" ""))
6494 if (get_attr_length (insn) == 4)
6499 [(set_attr "op_type" "RI")
6500 (set_attr "type" "branch")
6501 (set (attr "length")
6502 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6503 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6504 (const_int 4) (const_int 6))
6505 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6506 (const_int 4) (const_int 8))))])
6508 (define_insn "*cjump_long"
6511 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6512 (match_operand 0 "address_operand" "U")
6516 if (get_attr_op_type (insn) == OP_TYPE_RR)
6521 [(set (attr "op_type")
6522 (if_then_else (match_operand 0 "register_operand" "")
6523 (const_string "RR") (const_string "RX")))
6524 (set_attr "type" "branch")
6525 (set_attr "atype" "agen")])
6529 ;;- Negated conditional jump instructions.
6532 (define_insn "*icjump_64"
6535 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6537 (label_ref (match_operand 0 "" ""))))]
6540 if (get_attr_length (insn) == 4)
6543 return "jg%D1\t%l0";
6545 [(set_attr "op_type" "RI")
6546 (set_attr "type" "branch")
6547 (set (attr "length")
6548 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6549 (const_int 4) (const_int 6)))])
6551 (define_insn "*icjump_31"
6554 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6556 (label_ref (match_operand 0 "" ""))))]
6559 if (get_attr_length (insn) == 4)
6564 [(set_attr "op_type" "RI")
6565 (set_attr "type" "branch")
6566 (set (attr "length")
6567 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6568 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6569 (const_int 4) (const_int 6))
6570 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6571 (const_int 4) (const_int 8))))])
6573 (define_insn "*icjump_long"
6576 (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)])
6578 (match_operand 0 "address_operand" "U")))]
6581 if (get_attr_op_type (insn) == OP_TYPE_RR)
6586 [(set (attr "op_type")
6587 (if_then_else (match_operand 0 "register_operand" "")
6588 (const_string "RR") (const_string "RX")))
6589 (set_attr "type" "branch")
6590 (set_attr "atype" "agen")])
6593 ;;- Trap instructions.
6597 [(trap_if (const_int 1) (const_int 0))]
6600 [(set_attr "op_type" "RI")
6601 (set_attr "type" "branch")])
6603 (define_expand "conditional_trap"
6604 [(trap_if (match_operand 0 "comparison_operator" "")
6605 (match_operand 1 "general_operand" ""))]
6608 if (operands[1] != const0_rtx) FAIL;
6609 operands[0] = s390_emit_compare (GET_CODE (operands[0]),
6610 s390_compare_op0, s390_compare_op1);
6613 (define_insn "*trap"
6614 [(trap_if (match_operator 0 "s390_comparison" [(reg 33) (const_int 0)])
6618 [(set_attr "op_type" "RI")
6619 (set_attr "type" "branch")])
6622 ;;- Loop instructions.
6624 ;; This is all complicated by the fact that since this is a jump insn
6625 ;; we must handle our own output reloads.
6627 (define_expand "doloop_end"
6628 [(use (match_operand 0 "" "")) ; loop pseudo
6629 (use (match_operand 1 "" "")) ; iterations; zero if unknown
6630 (use (match_operand 2 "" "")) ; max iterations
6631 (use (match_operand 3 "" "")) ; loop level
6632 (use (match_operand 4 "" ""))] ; label
6635 if (GET_MODE (operands[0]) == SImode && !TARGET_CPU_ZARCH)
6636 emit_jump_insn (gen_doloop_si31 (operands[4], operands[0], operands[0]));
6637 else if (GET_MODE (operands[0]) == SImode && TARGET_CPU_ZARCH)
6638 emit_jump_insn (gen_doloop_si64 (operands[4], operands[0], operands[0]));
6639 else if (GET_MODE (operands[0]) == DImode && TARGET_64BIT)
6640 emit_jump_insn (gen_doloop_di (operands[4], operands[0], operands[0]));
6647 (define_insn_and_split "doloop_si64"
6650 (ne (match_operand:SI 1 "register_operand" "d,d")
6652 (label_ref (match_operand 0 "" ""))
6654 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6655 (plus:SI (match_dup 1) (const_int -1)))
6656 (clobber (match_scratch:SI 3 "=X,&d"))
6657 (clobber (reg:CC 33))]
6660 if (which_alternative != 0)
6662 else if (get_attr_length (insn) == 4)
6663 return "brct\t%1,%l0";
6665 return "ahi\t%1,-1\;jgne\t%l0";
6667 "&& reload_completed
6668 && (! REG_P (operands[2])
6669 || ! rtx_equal_p (operands[1], operands[2]))"
6670 [(set (match_dup 3) (match_dup 1))
6671 (parallel [(set (reg:CCAN 33)
6672 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6674 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6675 (set (match_dup 2) (match_dup 3))
6676 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6677 (label_ref (match_dup 0))
6680 [(set_attr "op_type" "RI")
6681 (set_attr "type" "branch")
6682 (set (attr "length")
6683 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6684 (const_int 4) (const_int 10)))])
6686 (define_insn_and_split "doloop_si31"
6689 (ne (match_operand:SI 1 "register_operand" "d,d")
6691 (label_ref (match_operand 0 "" ""))
6693 (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d")
6694 (plus:SI (match_dup 1) (const_int -1)))
6695 (clobber (match_scratch:SI 3 "=X,&d"))
6696 (clobber (reg:CC 33))]
6699 if (which_alternative != 0)
6701 else if (get_attr_length (insn) == 4)
6702 return "brct\t%1,%l0";
6706 "&& reload_completed
6707 && (! REG_P (operands[2])
6708 || ! rtx_equal_p (operands[1], operands[2]))"
6709 [(set (match_dup 3) (match_dup 1))
6710 (parallel [(set (reg:CCAN 33)
6711 (compare:CCAN (plus:SI (match_dup 3) (const_int -1))
6713 (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))])
6714 (set (match_dup 2) (match_dup 3))
6715 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6716 (label_ref (match_dup 0))
6719 [(set_attr "op_type" "RI")
6720 (set_attr "type" "branch")
6721 (set (attr "length")
6722 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6723 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6724 (const_int 4) (const_int 6))
6725 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6726 (const_int 4) (const_int 8))))])
6728 (define_insn "*doloop_si_long"
6731 (ne (match_operand:SI 1 "register_operand" "d,d")
6733 (match_operand 0 "address_operand" "U,U")
6735 (set (match_operand:SI 2 "register_operand" "=1,?*m*d")
6736 (plus:SI (match_dup 1) (const_int -1)))
6737 (clobber (match_scratch:SI 3 "=X,&d"))
6738 (clobber (reg:CC 33))]
6741 if (get_attr_op_type (insn) == OP_TYPE_RR)
6742 return "bctr\t%1,%0";
6744 return "bct\t%1,%a0";
6746 [(set (attr "op_type")
6747 (if_then_else (match_operand 0 "register_operand" "")
6748 (const_string "RR") (const_string "RX")))
6749 (set_attr "type" "branch")
6750 (set_attr "atype" "agen")])
6752 (define_insn_and_split "doloop_di"
6755 (ne (match_operand:DI 1 "register_operand" "d,d")
6757 (label_ref (match_operand 0 "" ""))
6759 (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*r")
6760 (plus:DI (match_dup 1) (const_int -1)))
6761 (clobber (match_scratch:DI 3 "=X,&d"))
6762 (clobber (reg:CC 33))]
6765 if (which_alternative != 0)
6767 else if (get_attr_length (insn) == 4)
6768 return "brctg\t%1,%l0";
6770 return "aghi\t%1,-1\;jgne\t%l0";
6772 "&& reload_completed
6773 && (! REG_P (operands[2])
6774 || ! rtx_equal_p (operands[1], operands[2]))"
6775 [(set (match_dup 3) (match_dup 1))
6776 (parallel [(set (reg:CCAN 33)
6777 (compare:CCAN (plus:DI (match_dup 3) (const_int -1))
6779 (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))])
6780 (set (match_dup 2) (match_dup 3))
6781 (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0))
6782 (label_ref (match_dup 0))
6785 [(set_attr "op_type" "RI")
6786 (set_attr "type" "branch")
6787 (set (attr "length")
6788 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6789 (const_int 4) (const_int 10)))])
6792 ;;- Unconditional jump instructions.
6796 ; jump instruction pattern(s).
6799 (define_expand "jump"
6800 [(match_operand 0 "" "")]
6802 "s390_emit_jump (operands[0], NULL_RTX); DONE;")
6804 (define_insn "*jump64"
6805 [(set (pc) (label_ref (match_operand 0 "" "")))]
6808 if (get_attr_length (insn) == 4)
6813 [(set_attr "op_type" "RI")
6814 (set_attr "type" "branch")
6815 (set (attr "length")
6816 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6817 (const_int 4) (const_int 6)))])
6819 (define_insn "*jump31"
6820 [(set (pc) (label_ref (match_operand 0 "" "")))]
6823 if (get_attr_length (insn) == 4)
6828 [(set_attr "op_type" "RI")
6829 (set_attr "type" "branch")
6830 (set (attr "length")
6831 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
6832 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6833 (const_int 4) (const_int 6))
6834 (if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
6835 (const_int 4) (const_int 8))))])
6838 ; indirect-jump instruction pattern(s).
6841 (define_insn "indirect_jump"
6842 [(set (pc) (match_operand 0 "address_operand" "U"))]
6845 if (get_attr_op_type (insn) == OP_TYPE_RR)
6850 [(set (attr "op_type")
6851 (if_then_else (match_operand 0 "register_operand" "")
6852 (const_string "RR") (const_string "RX")))
6853 (set_attr "type" "branch")
6854 (set_attr "atype" "agen")])
6857 ; casesi instruction pattern(s).
6860 (define_insn "casesi_jump"
6861 [(set (pc) (match_operand 0 "address_operand" "U"))
6862 (use (label_ref (match_operand 1 "" "")))]
6865 if (get_attr_op_type (insn) == OP_TYPE_RR)
6870 [(set (attr "op_type")
6871 (if_then_else (match_operand 0 "register_operand" "")
6872 (const_string "RR") (const_string "RX")))
6873 (set_attr "type" "branch")
6874 (set_attr "atype" "agen")])
6876 (define_expand "casesi"
6877 [(match_operand:SI 0 "general_operand" "")
6878 (match_operand:SI 1 "general_operand" "")
6879 (match_operand:SI 2 "general_operand" "")
6880 (label_ref (match_operand 3 "" ""))
6881 (label_ref (match_operand 4 "" ""))]
6884 rtx index = gen_reg_rtx (SImode);
6885 rtx base = gen_reg_rtx (Pmode);
6886 rtx target = gen_reg_rtx (Pmode);
6888 emit_move_insn (index, operands[0]);
6889 emit_insn (gen_subsi3 (index, index, operands[1]));
6890 emit_cmp_and_jump_insns (index, operands[2], GTU, NULL_RTX, SImode, 1,
6893 if (Pmode != SImode)
6894 index = convert_to_mode (Pmode, index, 1);
6895 if (GET_CODE (index) != REG)
6896 index = copy_to_mode_reg (Pmode, index);
6899 emit_insn (gen_ashldi3 (index, index, GEN_INT (3)));
6901 emit_insn (gen_ashlsi3 (index, index, const2_rtx));
6903 emit_move_insn (base, gen_rtx_LABEL_REF (Pmode, operands[3]));
6905 index = gen_const_mem (Pmode, gen_rtx_PLUS (Pmode, base, index));
6906 emit_move_insn (target, index);
6909 target = gen_rtx_PLUS (Pmode, base, target);
6910 emit_jump_insn (gen_casesi_jump (target, operands[3]));
6917 ;;- Jump to subroutine.
6922 ; untyped call instruction pattern(s).
6925 ;; Call subroutine returning any type.
6926 (define_expand "untyped_call"
6927 [(parallel [(call (match_operand 0 "" "")
6929 (match_operand 1 "" "")
6930 (match_operand 2 "" "")])]
6935 emit_call_insn (gen_call (operands[0], const0_rtx, const0_rtx));
6937 for (i = 0; i < XVECLEN (operands[2], 0); i++)
6939 rtx set = XVECEXP (operands[2], 0, i);
6940 emit_move_insn (SET_DEST (set), SET_SRC (set));
6943 /* The optimizer does not know that the call sets the function value
6944 registers we stored in the result block. We avoid problems by
6945 claiming that all hard registers are used and clobbered at this
6947 emit_insn (gen_blockage ());
6952 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
6953 ;; all of memory. This blocks insns from being moved across this point.
6955 (define_insn "blockage"
6956 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
6959 [(set_attr "type" "none")
6960 (set_attr "length" "0")])
6966 (define_expand "sibcall"
6967 [(call (match_operand 0 "" "")
6968 (match_operand 1 "" ""))]
6971 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX, NULL_RTX);
6975 (define_insn "*sibcall_br"
6976 [(call (mem:QI (reg 1))
6977 (match_operand 0 "const_int_operand" "n"))]
6978 "SIBLING_CALL_P (insn)
6979 && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode"
6981 [(set_attr "op_type" "RR")
6982 (set_attr "type" "branch")
6983 (set_attr "atype" "agen")])
6985 (define_insn "*sibcall_brc"
6986 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
6987 (match_operand 1 "const_int_operand" "n"))]
6988 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
6990 [(set_attr "op_type" "RI")
6991 (set_attr "type" "branch")])
6993 (define_insn "*sibcall_brcl"
6994 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
6995 (match_operand 1 "const_int_operand" "n"))]
6996 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
6998 [(set_attr "op_type" "RIL")
6999 (set_attr "type" "branch")])
7002 ; sibcall_value patterns
7005 (define_expand "sibcall_value"
7006 [(set (match_operand 0 "" "")
7007 (call (match_operand 1 "" "")
7008 (match_operand 2 "" "")))]
7011 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0], NULL_RTX);
7015 (define_insn "*sibcall_value_br"
7016 [(set (match_operand 0 "" "")
7017 (call (mem:QI (reg 1))
7018 (match_operand 1 "const_int_operand" "n")))]
7019 "SIBLING_CALL_P (insn)
7020 && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode"
7022 [(set_attr "op_type" "RR")
7023 (set_attr "type" "branch")
7024 (set_attr "atype" "agen")])
7026 (define_insn "*sibcall_value_brc"
7027 [(set (match_operand 0 "" "")
7028 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7029 (match_operand 2 "const_int_operand" "n")))]
7030 "SIBLING_CALL_P (insn) && TARGET_SMALL_EXEC"
7032 [(set_attr "op_type" "RI")
7033 (set_attr "type" "branch")])
7035 (define_insn "*sibcall_value_brcl"
7036 [(set (match_operand 0 "" "")
7037 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7038 (match_operand 2 "const_int_operand" "n")))]
7039 "SIBLING_CALL_P (insn) && TARGET_CPU_ZARCH"
7041 [(set_attr "op_type" "RIL")
7042 (set_attr "type" "branch")])
7046 ; call instruction pattern(s).
7049 (define_expand "call"
7050 [(call (match_operand 0 "" "")
7051 (match_operand 1 "" ""))
7052 (use (match_operand 2 "" ""))]
7055 s390_emit_call (XEXP (operands[0], 0), NULL_RTX, NULL_RTX,
7056 gen_rtx_REG (Pmode, RETURN_REGNUM));
7060 (define_insn "*bras"
7061 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7062 (match_operand 1 "const_int_operand" "n"))
7063 (clobber (match_operand 2 "register_operand" "=r"))]
7064 "!SIBLING_CALL_P (insn)
7065 && TARGET_SMALL_EXEC
7066 && GET_MODE (operands[2]) == Pmode"
7068 [(set_attr "op_type" "RI")
7069 (set_attr "type" "jsr")])
7071 (define_insn "*brasl"
7072 [(call (mem:QI (match_operand 0 "bras_sym_operand" "X"))
7073 (match_operand 1 "const_int_operand" "n"))
7074 (clobber (match_operand 2 "register_operand" "=r"))]
7075 "!SIBLING_CALL_P (insn)
7077 && GET_MODE (operands[2]) == Pmode"
7079 [(set_attr "op_type" "RIL")
7080 (set_attr "type" "jsr")])
7082 (define_insn "*basr"
7083 [(call (mem:QI (match_operand 0 "address_operand" "U"))
7084 (match_operand 1 "const_int_operand" "n"))
7085 (clobber (match_operand 2 "register_operand" "=r"))]
7086 "!SIBLING_CALL_P (insn) && GET_MODE (operands[2]) == Pmode"
7088 if (get_attr_op_type (insn) == OP_TYPE_RR)
7089 return "basr\t%2,%0";
7091 return "bas\t%2,%a0";
7093 [(set (attr "op_type")
7094 (if_then_else (match_operand 0 "register_operand" "")
7095 (const_string "RR") (const_string "RX")))
7096 (set_attr "type" "jsr")
7097 (set_attr "atype" "agen")])
7100 ; call_value instruction pattern(s).
7103 (define_expand "call_value"
7104 [(set (match_operand 0 "" "")
7105 (call (match_operand 1 "" "")
7106 (match_operand 2 "" "")))
7107 (use (match_operand 3 "" ""))]
7110 s390_emit_call (XEXP (operands[1], 0), NULL_RTX, operands[0],
7111 gen_rtx_REG (Pmode, RETURN_REGNUM));
7115 (define_insn "*bras_r"
7116 [(set (match_operand 0 "" "")
7117 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7118 (match_operand:SI 2 "const_int_operand" "n")))
7119 (clobber (match_operand 3 "register_operand" "=r"))]
7120 "!SIBLING_CALL_P (insn)
7121 && TARGET_SMALL_EXEC
7122 && GET_MODE (operands[3]) == Pmode"
7124 [(set_attr "op_type" "RI")
7125 (set_attr "type" "jsr")])
7127 (define_insn "*brasl_r"
7128 [(set (match_operand 0 "" "")
7129 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7130 (match_operand 2 "const_int_operand" "n")))
7131 (clobber (match_operand 3 "register_operand" "=r"))]
7132 "!SIBLING_CALL_P (insn)
7134 && GET_MODE (operands[3]) == Pmode"
7136 [(set_attr "op_type" "RIL")
7137 (set_attr "type" "jsr")])
7139 (define_insn "*basr_r"
7140 [(set (match_operand 0 "" "")
7141 (call (mem:QI (match_operand 1 "address_operand" "U"))
7142 (match_operand 2 "const_int_operand" "n")))
7143 (clobber (match_operand 3 "register_operand" "=r"))]
7144 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7146 if (get_attr_op_type (insn) == OP_TYPE_RR)
7147 return "basr\t%3,%1";
7149 return "bas\t%3,%a1";
7151 [(set (attr "op_type")
7152 (if_then_else (match_operand 1 "register_operand" "")
7153 (const_string "RR") (const_string "RX")))
7154 (set_attr "type" "jsr")
7155 (set_attr "atype" "agen")])
7158 ;;- Thread-local storage support.
7161 (define_insn "get_tp_64"
7162 [(set (match_operand:DI 0 "nonimmediate_operand" "=??d,Q")
7163 (unspec:DI [(const_int 0)] UNSPEC_TP))]
7166 ear\t%0,%%a0\;sllg\t%0,%0,32\;ear\t%0,%%a1
7168 [(set_attr "op_type" "NN,RS")
7169 (set_attr "atype" "reg,*")
7170 (set_attr "type" "o3,*")
7171 (set_attr "length" "14,*")])
7173 (define_insn "get_tp_31"
7174 [(set (match_operand:SI 0 "nonimmediate_operand" "=d,Q")
7175 (unspec:SI [(const_int 0)] UNSPEC_TP))]
7180 [(set_attr "op_type" "RRE,RS")])
7182 (define_insn "set_tp_64"
7183 [(unspec_volatile [(match_operand:DI 0 "general_operand" "??d,Q")] UNSPECV_SET_TP)
7184 (clobber (match_scratch:SI 1 "=d,X"))]
7187 sar\t%%a1,%0\;srlg\t%1,%0,32\;sar\t%%a0,%1
7189 [(set_attr "op_type" "NN,RS")
7190 (set_attr "atype" "reg,*")
7191 (set_attr "type" "o3,*")
7192 (set_attr "length" "14,*")])
7194 (define_insn "set_tp_31"
7195 [(unspec_volatile [(match_operand:SI 0 "general_operand" "d,Q")] UNSPECV_SET_TP)]
7200 [(set_attr "op_type" "RRE,RS")])
7202 (define_insn "*tls_load_64"
7203 [(set (match_operand:DI 0 "register_operand" "=d")
7204 (unspec:DI [(match_operand:DI 1 "memory_operand" "m")
7205 (match_operand:DI 2 "" "")]
7209 [(set_attr "op_type" "RXE")])
7211 (define_insn "*tls_load_31"
7212 [(set (match_operand:SI 0 "register_operand" "=d,d")
7213 (unspec:SI [(match_operand:SI 1 "memory_operand" "R,T")
7214 (match_operand:SI 2 "" "")]
7220 [(set_attr "op_type" "RX,RXY")])
7222 (define_insn "*bras_tls"
7223 [(set (match_operand 0 "" "")
7224 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7225 (match_operand 2 "const_int_operand" "n")))
7226 (clobber (match_operand 3 "register_operand" "=r"))
7227 (use (match_operand 4 "" ""))]
7228 "!SIBLING_CALL_P (insn)
7229 && TARGET_SMALL_EXEC
7230 && GET_MODE (operands[3]) == Pmode"
7232 [(set_attr "op_type" "RI")
7233 (set_attr "type" "jsr")])
7235 (define_insn "*brasl_tls"
7236 [(set (match_operand 0 "" "")
7237 (call (mem:QI (match_operand 1 "bras_sym_operand" "X"))
7238 (match_operand 2 "const_int_operand" "n")))
7239 (clobber (match_operand 3 "register_operand" "=r"))
7240 (use (match_operand 4 "" ""))]
7241 "!SIBLING_CALL_P (insn)
7243 && GET_MODE (operands[3]) == Pmode"
7245 [(set_attr "op_type" "RIL")
7246 (set_attr "type" "jsr")])
7248 (define_insn "*basr_tls"
7249 [(set (match_operand 0 "" "")
7250 (call (mem:QI (match_operand 1 "address_operand" "U"))
7251 (match_operand 2 "const_int_operand" "n")))
7252 (clobber (match_operand 3 "register_operand" "=r"))
7253 (use (match_operand 4 "" ""))]
7254 "!SIBLING_CALL_P (insn) && GET_MODE (operands[3]) == Pmode"
7256 if (get_attr_op_type (insn) == OP_TYPE_RR)
7257 return "basr\t%3,%1%J4";
7259 return "bas\t%3,%a1%J4";
7261 [(set (attr "op_type")
7262 (if_then_else (match_operand 1 "register_operand" "")
7263 (const_string "RR") (const_string "RX")))
7264 (set_attr "type" "jsr")
7265 (set_attr "atype" "agen")])
7268 ;;- Miscellaneous instructions.
7272 ; allocate stack instruction pattern(s).
7275 (define_expand "allocate_stack"
7276 [(match_operand 0 "general_operand" "")
7277 (match_operand 1 "general_operand" "")]
7278 "TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN"
7280 rtx temp = gen_reg_rtx (Pmode);
7282 emit_move_insn (temp, s390_back_chain_rtx ());
7283 anti_adjust_stack (operands[1]);
7284 emit_move_insn (s390_back_chain_rtx (), temp);
7286 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
7292 ; setjmp instruction pattern.
7295 (define_expand "builtin_setjmp_receiver"
7296 [(match_operand 0 "" "")]
7299 emit_insn (s390_load_got ());
7300 emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx));
7304 ;; These patterns say how to save and restore the stack pointer. We need not
7305 ;; save the stack pointer at function level since we are careful to
7306 ;; preserve the backchain. At block level, we have to restore the backchain
7307 ;; when we restore the stack pointer.
7309 ;; For nonlocal gotos, we must save both the stack pointer and its
7310 ;; backchain and restore both. Note that in the nonlocal case, the
7311 ;; save area is a memory location.
7313 (define_expand "save_stack_function"
7314 [(match_operand 0 "general_operand" "")
7315 (match_operand 1 "general_operand" "")]
7319 (define_expand "restore_stack_function"
7320 [(match_operand 0 "general_operand" "")
7321 (match_operand 1 "general_operand" "")]
7325 (define_expand "restore_stack_block"
7326 [(match_operand 0 "register_operand" "")
7327 (match_operand 1 "register_operand" "")]
7328 "TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN"
7330 rtx temp = gen_reg_rtx (Pmode);
7332 emit_move_insn (temp, s390_back_chain_rtx ());
7333 emit_move_insn (operands[0], operands[1]);
7334 emit_move_insn (s390_back_chain_rtx (), temp);
7339 (define_expand "save_stack_nonlocal"
7340 [(match_operand 0 "memory_operand" "")
7341 (match_operand 1 "register_operand" "")]
7344 enum machine_mode mode = TARGET_64BIT ? OImode : TImode;
7345 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7347 /* Copy the backchain to the first word, sp to the second and the
7348 literal pool base to the third. */
7350 if (TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN)
7352 rtx temp = force_reg (Pmode, s390_back_chain_rtx ());
7353 emit_move_insn (operand_subword (operands[0], 0, 0, mode), temp);
7356 emit_move_insn (operand_subword (operands[0], 1, 0, mode), operands[1]);
7357 emit_move_insn (operand_subword (operands[0], 2, 0, mode), base);
7362 (define_expand "restore_stack_nonlocal"
7363 [(match_operand 0 "register_operand" "")
7364 (match_operand 1 "memory_operand" "")]
7367 enum machine_mode mode = TARGET_64BIT ? OImode : TImode;
7368 rtx base = gen_rtx_REG (Pmode, BASE_REGNUM);
7369 rtx temp = NULL_RTX;
7371 /* Restore the backchain from the first word, sp from the second and the
7372 literal pool base from the third. */
7374 if (TARGET_BACKCHAIN || TARGET_KERNEL_BACKCHAIN)
7375 temp = force_reg (Pmode, operand_subword (operands[1], 0, 0, mode));
7377 emit_move_insn (base, operand_subword (operands[1], 2, 0, mode));
7378 emit_move_insn (operands[0], operand_subword (operands[1], 1, 0, mode));
7381 emit_move_insn (s390_back_chain_rtx (), temp);
7383 emit_insn (gen_rtx_USE (VOIDmode, base));
7389 ; nop instruction pattern(s).
7396 [(set_attr "op_type" "RR")])
7400 ; Special literal pool access instruction pattern(s).
7403 (define_insn "*pool_entry"
7404 [(unspec_volatile [(match_operand 0 "consttable_operand" "X")]
7405 UNSPECV_POOL_ENTRY)]
7408 enum machine_mode mode = GET_MODE (PATTERN (insn));
7409 unsigned int align = GET_MODE_BITSIZE (mode);
7410 s390_output_pool_entry (operands[0], mode, align);
7413 [(set_attr "op_type" "NN")
7414 (set (attr "length")
7415 (symbol_ref "GET_MODE_SIZE (GET_MODE (PATTERN (insn)))"))])
7417 (define_insn "pool_align"
7418 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")]
7419 UNSPECV_POOL_ALIGN)]
7422 [(set_attr "op_type" "NN")
7423 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7425 (define_insn "pool_section_start"
7426 [(unspec_volatile [(const_int 1)] UNSPECV_POOL_SECTION)]
7429 [(set_attr "op_type" "NN")
7430 (set_attr "length" "0")])
7432 (define_insn "pool_section_end"
7433 [(unspec_volatile [(const_int 0)] UNSPECV_POOL_SECTION)]
7436 [(set_attr "op_type" "NN")
7437 (set_attr "length" "0")])
7439 (define_insn "main_base_31_small"
7440 [(set (match_operand 0 "register_operand" "=a")
7441 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7442 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7444 [(set_attr "op_type" "RR")
7445 (set_attr "type" "la")])
7447 (define_insn "main_base_31_large"
7448 [(set (match_operand 0 "register_operand" "=a")
7449 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))
7450 (set (pc) (label_ref (match_operand 2 "" "")))]
7451 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7453 [(set_attr "op_type" "RI")])
7455 (define_insn "main_base_64"
7456 [(set (match_operand 0 "register_operand" "=a")
7457 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_MAIN_BASE))]
7458 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7460 [(set_attr "op_type" "RIL")
7461 (set_attr "type" "larl")])
7463 (define_insn "main_pool"
7464 [(set (match_operand 0 "register_operand" "=a")
7465 (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))]
7466 "GET_MODE (operands[0]) == Pmode"
7468 [(set_attr "op_type" "NN")
7470 (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0))
7471 (const_string "larl") (const_string "la")))])
7473 (define_insn "reload_base_31"
7474 [(set (match_operand 0 "register_operand" "=a")
7475 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7476 "!TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7477 "basr\t%0,0\;la\t%0,%1-.(%0)"
7478 [(set_attr "op_type" "NN")
7479 (set_attr "type" "la")
7480 (set_attr "length" "6")])
7482 (define_insn "reload_base_64"
7483 [(set (match_operand 0 "register_operand" "=a")
7484 (unspec [(label_ref (match_operand 1 "" ""))] UNSPEC_RELOAD_BASE))]
7485 "TARGET_CPU_ZARCH && GET_MODE (operands[0]) == Pmode"
7487 [(set_attr "op_type" "RIL")
7488 (set_attr "type" "larl")])
7491 [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)]
7494 [(set_attr "op_type" "NN")
7495 (set (attr "length") (symbol_ref "INTVAL (operands[0])"))])
7498 ;; Insns related to generating the function prologue and epilogue.
7502 (define_expand "prologue"
7503 [(use (const_int 0))]
7505 "s390_emit_prologue (); DONE;")
7507 (define_insn "prologue_tpf"
7508 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE)
7509 (clobber (reg:DI 1))]
7510 "TARGET_TPF_PROFILING"
7512 [(set_attr "type" "jsr")
7513 (set_attr "op_type" "RX")])
7515 (define_expand "epilogue"
7516 [(use (const_int 1))]
7518 "s390_emit_epilogue (false); DONE;")
7520 (define_insn "epilogue_tpf"
7521 [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE)
7522 (clobber (reg:DI 1))]
7523 "TARGET_TPF_PROFILING"
7525 [(set_attr "type" "jsr")
7526 (set_attr "op_type" "RX")])
7529 (define_expand "sibcall_epilogue"
7530 [(use (const_int 0))]
7532 "s390_emit_epilogue (true); DONE;")
7534 (define_insn "*return"
7536 (use (match_operand 0 "register_operand" "a"))]
7537 "GET_MODE (operands[0]) == Pmode"
7539 [(set_attr "op_type" "RR")
7540 (set_attr "type" "jsr")
7541 (set_attr "atype" "agen")])
7544 ;; Instruction definition to extend a 31-bit pointer into a 64-bit
7545 ;; pointer. This is used for compatibility.
7547 (define_expand "ptr_extend"
7548 [(set (match_operand:DI 0 "register_operand" "=r")
7549 (match_operand:SI 1 "register_operand" "r"))]
7552 emit_insn (gen_anddi3 (operands[0],
7553 gen_lowpart (DImode, operands[1]),
7554 GEN_INT (0x7fffffff)));
7558 ;; Instruction definition to expand eh_return macro to support
7559 ;; swapping in special linkage return addresses.
7561 (define_expand "eh_return"
7562 [(use (match_operand 0 "register_operand" ""))]
7565 s390_emit_tpf_eh_return (operands[0]);