1 ;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler
2 ;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 ;; 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
4 ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
23 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
25 ;; `unspec' values used in rs6000.md:
27 ;; 0 frsp for POWER machines
29 ;; 5 used to tie the stack contents and the stack pointer
30 ;; 6 address of a word pointing to the TOC
31 ;; 7 address of the TOC (more-or-less)
35 ;; 15 load_macho_picbase
36 ;; 16 macho_correct_pic
40 ;; Define an insn type attribute. This is used in function unit delay
42 (define_attr "type" "integer,load,store,fpload,fpstore,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,branch,compare,cr_logical,delayed_compare,fpcompare,mtjmpr,fp,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,vecsimple,veccomplex,veccmp,vecperm,vecfloat,altivec"
43 (const_string "integer"))
46 ; '(pc)' in the following doesn't include the instruction itself; it is
47 ; calculated as if the instruction had zero size.
48 (define_attr "length" ""
49 (if_then_else (eq_attr "type" "branch")
50 (if_then_else (and (ge (minus (match_dup 0) (pc))
52 (lt (minus (match_dup 0) (pc))
58 ;; Processor type -- this attribute must exactly match the processor_type
59 ;; enumeration in rs6000.h.
61 (define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,ppc8540,power4"
62 (const (symbol_ref "rs6000_cpu_attr")))
64 ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
65 ; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
67 ; Load/Store Unit -- pure PowerPC only
68 ; (POWER and 601 use Integer Unit)
69 (define_function_unit "lsu" 1 0
70 (and (eq_attr "type" "load")
71 (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
74 (define_function_unit "lsu" 1 0
75 (and (eq_attr "type" "load,vecload")
76 (eq_attr "cpu" "ppc7450"))
79 (define_function_unit "lsu" 1 0
80 (and (eq_attr "type" "store,fpstore")
81 (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630"))
84 (define_function_unit "lsu" 1 0
85 (and (eq_attr "type" "store,fpstore")
86 (eq_attr "cpu" "ppc750,ppc7400"))
89 (define_function_unit "lsu" 1 0
90 (and (eq_attr "type" "store,vecstore")
91 (eq_attr "cpu" "ppc7450"))
94 (define_function_unit "lsu" 1 0
95 (and (eq_attr "type" "fpstore")
96 (eq_attr "cpu" "ppc7450"))
99 (define_function_unit "lsu" 1 0
100 (and (eq_attr "type" "fpload")
101 (eq_attr "cpu" "mpccore,ppc603,ppc750,ppc7400"))
104 (define_function_unit "lsu" 1 0
105 (and (eq_attr "type" "fpload")
106 (eq_attr "cpu" "ppc7450"))
109 (define_function_unit "lsu" 1 0
110 (and (eq_attr "type" "fpload")
111 (eq_attr "cpu" "rs64a,ppc604,ppc604e,ppc620,ppc630"))
114 (define_function_unit "iu" 1 0
115 (and (eq_attr "type" "load")
116 (eq_attr "cpu" "rios1,ppc403,ppc405,ppc601"))
119 (define_function_unit "iu" 1 0
120 (and (eq_attr "type" "store,fpstore")
121 (eq_attr "cpu" "rios1,ppc403,ppc405,ppc601"))
124 (define_function_unit "fpu" 1 0
125 (and (eq_attr "type" "fpstore")
126 (eq_attr "cpu" "rios1,ppc601"))
129 (define_function_unit "iu" 1 0
130 (and (eq_attr "type" "fpload")
131 (eq_attr "cpu" "rios1"))
134 (define_function_unit "iu" 1 0
135 (and (eq_attr "type" "fpload")
136 (eq_attr "cpu" "ppc601"))
139 (define_function_unit "iu2" 2 0
140 (and (eq_attr "type" "load,fpload")
141 (eq_attr "cpu" "rios2"))
144 (define_function_unit "iu2" 2 0
145 (and (eq_attr "type" "store,fpstore")
146 (eq_attr "cpu" "rios2"))
149 ; Integer Unit (RIOS1, PPC601, PPC603, RS64a)
150 (define_function_unit "iu" 1 0
151 (and (eq_attr "type" "integer")
152 (eq_attr "cpu" "rios1,rs64a,mpccore,ppc403,ppc405,ppc601,ppc603"))
155 (define_function_unit "iu" 1 0
156 (and (eq_attr "type" "cr_logical")
157 (eq_attr "cpu" "mpccore,ppc403,ppc405,ppc601"))
160 (define_function_unit "iu" 1 0
161 (and (eq_attr "type" "imul,imul2,imul3")
162 (eq_attr "cpu" "ppc403"))
165 (define_function_unit "iu" 1 0
166 (and (eq_attr "type" "imul")
167 (eq_attr "cpu" "ppc405"))
170 (define_function_unit "iu" 1 0
171 (and (eq_attr "type" "imul2,imul3")
172 (eq_attr "cpu" "ppc405"))
175 (define_function_unit "iu" 1 0
176 (and (eq_attr "type" "imul")
177 (eq_attr "cpu" "rios1"))
180 (define_function_unit "iu" 1 0
181 (and (eq_attr "type" "imul2")
182 (eq_attr "cpu" "rios1"))
185 (define_function_unit "iu" 1 0
186 (and (eq_attr "type" "imul3")
187 (eq_attr "cpu" "rios1"))
190 (define_function_unit "iu" 1 0
191 (and (eq_attr "type" "imul,imul2,imul3")
192 (eq_attr "cpu" "ppc601,ppc603"))
195 (define_function_unit "iu" 1 0
196 (and (eq_attr "type" "imul")
197 (eq_attr "cpu" "rs64a"))
200 (define_function_unit "iu" 1 0
201 (and (eq_attr "type" "imul2")
202 (eq_attr "cpu" "rs64a"))
205 (define_function_unit "iu" 1 0
206 (and (eq_attr "type" "imul3")
207 (eq_attr "cpu" "rs64a"))
210 (define_function_unit "iu" 1 0
211 (and (eq_attr "type" "lmul")
212 (eq_attr "cpu" "rs64a"))
215 (define_function_unit "iu" 1 0
216 (and (eq_attr "type" "idiv")
217 (eq_attr "cpu" "rios1"))
220 (define_function_unit "iu" 1 0
221 (and (eq_attr "type" "idiv")
222 (eq_attr "cpu" "rs64a"))
225 (define_function_unit "iu" 1 0
226 (and (eq_attr "type" "ldiv")
227 (eq_attr "cpu" "rs64a"))
230 (define_function_unit "iu" 1 0
231 (and (eq_attr "type" "idiv")
232 (eq_attr "cpu" "ppc403"))
235 (define_function_unit "iu" 1 0
236 (and (eq_attr "type" "idiv")
237 (eq_attr "cpu" "ppc405"))
240 (define_function_unit "iu" 1 0
241 (and (eq_attr "type" "idiv")
242 (eq_attr "cpu" "ppc601"))
245 (define_function_unit "iu" 1 0
246 (and (eq_attr "type" "idiv")
247 (eq_attr "cpu" "ppc603"))
250 ; RIOS2 has two integer units: a primary one which can perform all
251 ; operations and a secondary one which is fed in lock step with the first
252 ; and can perform "simple" integer operations.
253 ; To catch this we define a 'dummy' imuldiv-unit that is also needed
254 ; for the complex insns.
255 (define_function_unit "iu2" 2 0
256 (and (eq_attr "type" "integer")
257 (eq_attr "cpu" "rios2"))
260 (define_function_unit "iu2" 2 0
261 (and (eq_attr "type" "imul,imul2,imul3")
262 (eq_attr "cpu" "rios2"))
265 (define_function_unit "iu2" 2 0
266 (and (eq_attr "type" "idiv")
267 (eq_attr "cpu" "rios2"))
270 (define_function_unit "imuldiv" 1 0
271 (and (eq_attr "type" "imul,imul2,imul3")
272 (eq_attr "cpu" "rios2"))
275 (define_function_unit "imuldiv" 1 0
276 (and (eq_attr "type" "idiv")
277 (eq_attr "cpu" "rios2"))
280 ; MPCCORE has separate IMUL/IDIV unit for multicycle instructions
281 ; Divide latency varies greatly from 2-11, use 6 as average
282 (define_function_unit "imuldiv" 1 0
283 (and (eq_attr "type" "imul,imul2,imul3")
284 (eq_attr "cpu" "mpccore"))
287 (define_function_unit "imuldiv" 1 0
288 (and (eq_attr "type" "idiv")
289 (eq_attr "cpu" "mpccore"))
292 ; PPC604{,e} has two units that perform integer operations
293 ; and one unit for divide/multiply operations (and move
295 (define_function_unit "iu2" 2 0
296 (and (eq_attr "type" "integer")
297 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630"))
300 (define_function_unit "imuldiv" 1 0
301 (and (eq_attr "type" "imul,imul2,imul3")
302 (eq_attr "cpu" "ppc604"))
305 (define_function_unit "imuldiv" 1 0
306 (and (eq_attr "type" "imul,imul2,imul3")
307 (eq_attr "cpu" "ppc604e"))
310 (define_function_unit "imuldiv" 1 0
311 (and (eq_attr "type" "imul")
312 (eq_attr "cpu" "ppc620,ppc630"))
315 (define_function_unit "imuldiv" 1 0
316 (and (eq_attr "type" "imul2")
317 (eq_attr "cpu" "ppc620,ppc630"))
320 (define_function_unit "imuldiv" 1 0
321 (and (eq_attr "type" "imul3")
322 (eq_attr "cpu" "ppc620,ppc630"))
325 (define_function_unit "imuldiv" 1 0
326 (and (eq_attr "type" "lmul")
327 (eq_attr "cpu" "ppc620,ppc630"))
330 (define_function_unit "imuldiv" 1 0
331 (and (eq_attr "type" "idiv")
332 (eq_attr "cpu" "ppc604,ppc604e"))
335 (define_function_unit "imuldiv" 1 0
336 (and (eq_attr "type" "idiv")
337 (eq_attr "cpu" "ppc620"))
340 (define_function_unit "imuldiv" 1 0
341 (and (eq_attr "type" "idiv")
342 (eq_attr "cpu" "ppc630"))
345 (define_function_unit "imuldiv" 1 0
346 (and (eq_attr "type" "ldiv")
347 (eq_attr "cpu" "ppc620,ppc630"))
350 ; PPC7450 has 3 integer units (for most integer insns) and one mul/div
351 ; unit, which also does CR-logical insns and move to/from SPR.
352 ; It also has 4 vector units, one for each type of vector instruction.
353 ; However, we can only dispatch 2 instructions per cycle.
354 ; We model this as saying that dispatching two of the same type of instruction
355 ; in a row incurs a single cycle delay.
356 (define_function_unit "iu3" 3 0
357 (and (eq_attr "type" "integer")
358 (eq_attr "cpu" "ppc7450"))
361 (define_function_unit "imuldiv" 1 0
362 (and (eq_attr "type" "imul")
363 (eq_attr "cpu" "ppc7450"))
366 (define_function_unit "imuldiv" 1 0
367 (and (eq_attr "type" "imul2,imul3")
368 (eq_attr "cpu" "ppc7450"))
371 (define_function_unit "imuldiv" 1 0
372 (and (eq_attr "type" "idiv")
373 (eq_attr "cpu" "ppc7450"))
376 (define_function_unit "imuldiv" 1 0
377 (and (eq_attr "type" "cr_logical")
378 (eq_attr "cpu" "ppc7450"))
381 (define_function_unit "vec_alu2" 2 0
382 (and (eq_attr "type" "vecsimple")
383 (eq_attr "cpu" "ppc7450"))
384 1 2 [(eq_attr "type" "vecsimple")])
386 (define_function_unit "vec_alu2" 2 0
387 (and (eq_attr "type" "vecsimple")
388 (eq_attr "cpu" "ppc7450"))
389 1 1 [(eq_attr "type" "!vecsimple")])
391 (define_function_unit "vec_alu2" 2 0
392 (and (eq_attr "type" "veccomplex")
393 (eq_attr "cpu" "ppc7450"))
394 4 2 [(eq_attr "type" "veccomplex")])
396 (define_function_unit "vec_alu2" 2 0
397 (and (eq_attr "type" "veccomplex")
398 (eq_attr "cpu" "ppc7450"))
399 4 1 [(eq_attr "type" "!veccomplex")])
401 (define_function_unit "vec_alu2" 2 0
402 (and (eq_attr "type" "veccmp")
403 (eq_attr "cpu" "ppc7450"))
404 2 2 [(eq_attr "type" "veccmp")])
406 (define_function_unit "vec_alu2" 2 0
407 (and (eq_attr "type" "veccmp")
408 (eq_attr "cpu" "ppc7450"))
409 2 1 [(eq_attr "type" "!veccmp")])
411 (define_function_unit "vec_alu2" 2 0
412 (and (eq_attr "type" "vecfloat")
413 (eq_attr "cpu" "ppc7450"))
414 4 2 [(eq_attr "type" "vecfloat")])
416 (define_function_unit "vec_alu2" 2 0
417 (and (eq_attr "type" "vecfloat")
418 (eq_attr "cpu" "ppc7450"))
419 4 1 [(eq_attr "type" "!vecfloat")])
421 (define_function_unit "vec_alu2" 2 0
422 (and (eq_attr "type" "vecperm")
423 (eq_attr "cpu" "ppc7450"))
424 2 2 [(eq_attr "type" "vecperm")])
426 (define_function_unit "vec_alu2" 2 0
427 (and (eq_attr "type" "vecperm")
428 (eq_attr "cpu" "ppc7450"))
429 2 1 [(eq_attr "type" "!vecperm")])
431 ; PPC750 has two integer units: a primary one which can perform all
432 ; operations and a secondary one which is fed in lock step with the first
433 ; and can perform "simple" integer operations.
434 ; To catch this we define a 'dummy' imuldiv-unit that is also needed
435 ; for the complex insns.
436 (define_function_unit "iu2" 2 0
437 (and (eq_attr "type" "integer")
438 (eq_attr "cpu" "ppc750,ppc7400"))
441 (define_function_unit "iu2" 2 0
442 (and (eq_attr "type" "imul")
443 (eq_attr "cpu" "ppc750,ppc7400"))
446 (define_function_unit "iu2" 2 0
447 (and (eq_attr "type" "imul2")
448 (eq_attr "cpu" "ppc750,ppc7400"))
451 (define_function_unit "iu2" 2 0
452 (and (eq_attr "type" "imul3")
453 (eq_attr "cpu" "ppc750,ppc7400"))
456 (define_function_unit "iu2" 2 0
457 (and (eq_attr "type" "idiv")
458 (eq_attr "cpu" "ppc750,ppc7400"))
461 (define_function_unit "imuldiv" 1 0
462 (and (eq_attr "type" "imul")
463 (eq_attr "cpu" "ppc750,ppc7400"))
466 (define_function_unit "imuldiv" 1 0
467 (and (eq_attr "type" "imul2")
468 (eq_attr "cpu" "ppc750,ppc7400"))
471 (define_function_unit "imuldiv" 1 0
472 (and (eq_attr "type" "imul3")
473 (eq_attr "cpu" "ppc750,ppc7400"))
476 (define_function_unit "imuldiv" 1 0
477 (and (eq_attr "type" "idiv")
478 (eq_attr "cpu" "ppc750,ppc7400"))
481 ; CR-logical operations are execute-serialized, that is they don't
482 ; start (and block the function unit) until all preceding operations
483 ; have finished. They don't block dispatch of other insns, though.
484 ; I've imitated this by giving them longer latency.
485 (define_function_unit "sru" 1 0
486 (and (eq_attr "type" "cr_logical")
487 (eq_attr "cpu" "ppc603,ppc750,ppc7400"))
490 ; compare is done on integer unit, but feeds insns which
491 ; execute on the branch unit.
492 (define_function_unit "iu" 1 0
493 (and (eq_attr "type" "compare")
494 (eq_attr "cpu" "rios1"))
497 (define_function_unit "iu" 1 0
498 (and (eq_attr "type" "delayed_compare")
499 (eq_attr "cpu" "rios1"))
502 (define_function_unit "iu" 1 0
503 (and (eq_attr "type" "compare,delayed_compare")
504 (eq_attr "cpu" "rs64a,mpccore,ppc403,ppc405,ppc601,ppc603"))
507 ; some extra cycles added by TARGET_SCHED_ADJUST_COST between compare
508 ; and a following branch, to reduce mispredicts
509 (define_function_unit "iu3" 3 0
510 (and (eq_attr "type" "compare,delayed_compare")
511 (eq_attr "cpu" "ppc7450"))
514 (define_function_unit "iu2" 2 0
515 (and (eq_attr "type" "compare,delayed_compare")
516 (eq_attr "cpu" "rios2"))
519 (define_function_unit "iu2" 2 0
520 (and (eq_attr "type" "compare,delayed_compare")
521 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
524 ; fp compare uses fp unit
525 (define_function_unit "fpu" 1 0
526 (and (eq_attr "type" "fpcompare")
527 (eq_attr "cpu" "rios1"))
530 ; rios1 and rios2 have different fpcompare delays
531 (define_function_unit "fpu2" 2 0
532 (and (eq_attr "type" "fpcompare")
533 (eq_attr "cpu" "rios2,ppc630"))
536 ; on ppc601 and ppc603, fpcompare takes also 2 cycles from
538 ; here we do not define delays, just occupy the unit. The dependencies
539 ; will be assigned by the fpcompare definition in the fpu.
540 (define_function_unit "iu" 1 0
541 (and (eq_attr "type" "fpcompare")
542 (eq_attr "cpu" "ppc601,ppc603"))
545 ; fp compare uses fp unit
546 (define_function_unit "fpu" 1 0
547 (and (eq_attr "type" "fpcompare")
548 (eq_attr "cpu" "rs64a,ppc601,ppc603,ppc604,ppc604e,ppc620"))
551 (define_function_unit "fpu" 1 0
552 (and (eq_attr "type" "fpcompare")
553 (eq_attr "cpu" "ppc750,ppc7400,ppc7450"))
556 (define_function_unit "fpu" 1 0
557 (and (eq_attr "type" "fpcompare")
558 (eq_attr "cpu" "mpccore"))
561 (define_function_unit "bpu" 1 0
562 (and (eq_attr "type" "mtjmpr")
563 (eq_attr "cpu" "rios1,rios2,rs64a"))
566 (define_function_unit "bpu" 1 0
567 (and (eq_attr "type" "mtjmpr")
568 (eq_attr "cpu" "mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
571 (define_function_unit "sru" 1 0
572 (and (eq_attr "type" "mtjmpr")
573 (eq_attr "cpu" "ppc750,ppc7400"))
576 (define_function_unit "imuldiv" 1 0
577 (and (eq_attr "type" "mtjmpr")
578 (eq_attr "cpu" "ppc7450"))
581 (define_function_unit "bpu" 1 0
582 (and (eq_attr "type" "cr_logical")
583 (eq_attr "cpu" "rios1,rios2,ppc604"))
586 (define_function_unit "cru" 1 0
587 (and (eq_attr "type" "cr_logical")
588 (eq_attr "cpu" "ppc604e,ppc620,ppc630,rs64a"))
591 ; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
592 (define_function_unit "bpu" 1 0
593 (eq_attr "type" "jmpreg")
596 (define_function_unit "bpu" 1 0
597 (eq_attr "type" "branch")
600 ; Floating Point Unit
601 (define_function_unit "fpu" 1 0
602 (and (eq_attr "type" "fp,dmul")
603 (eq_attr "cpu" "rios1"))
606 (define_function_unit "fpu" 1 0
607 (and (eq_attr "type" "fp")
608 (eq_attr "cpu" "rs64a,mpccore"))
611 (define_function_unit "fpu" 1 0
612 (and (eq_attr "type" "fp")
613 (eq_attr "cpu" "ppc601"))
616 (define_function_unit "fpu" 1 0
617 (and (eq_attr "type" "fp")
618 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750,ppc7400"))
621 (define_function_unit "fpu" 1 0
622 (and (eq_attr "type" "fp,dmul")
623 (eq_attr "cpu" "ppc7450"))
626 (define_function_unit "fpu" 1 0
627 (and (eq_attr "type" "dmul")
628 (eq_attr "cpu" "rs64a"))
631 (define_function_unit "fpu" 1 0
632 (and (eq_attr "type" "dmul")
633 (eq_attr "cpu" "mpccore"))
636 (define_function_unit "fpu" 1 0
637 (and (eq_attr "type" "dmul")
638 (eq_attr "cpu" "ppc601"))
642 (define_function_unit "fpu" 1 0
643 (and (eq_attr "type" "dmul")
644 (eq_attr "cpu" "ppc603,ppc750"))
647 (define_function_unit "fpu" 1 0
648 (and (eq_attr "type" "dmul")
649 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc7400"))
652 (define_function_unit "fpu" 1 0
653 (and (eq_attr "type" "sdiv,ddiv")
654 (eq_attr "cpu" "rios1"))
657 (define_function_unit "fpu" 1 0
658 (and (eq_attr "type" "sdiv")
659 (eq_attr "cpu" "rs64a"))
662 (define_function_unit "fpu" 1 0
663 (and (eq_attr "type" "sdiv")
664 (eq_attr "cpu" "ppc601,ppc750,ppc7400"))
667 (define_function_unit "fpu" 1 0
668 (and (eq_attr "type" "sdiv")
669 (eq_attr "cpu" "ppc7450"))
672 (define_function_unit "fpu" 1 0
673 (and (eq_attr "type" "sdiv")
674 (eq_attr "cpu" "mpccore"))
677 (define_function_unit "fpu" 1 0
678 (and (eq_attr "type" "sdiv")
679 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
682 (define_function_unit "fpu" 1 0
683 (and (eq_attr "type" "ddiv")
684 (eq_attr "cpu" "mpccore"))
687 (define_function_unit "fpu" 1 0
688 (and (eq_attr "type" "ddiv")
689 (eq_attr "cpu" "rs64a,ppc601,ppc750,ppc604,ppc604e,ppc620,ppc7400"))
692 (define_function_unit "fpu" 1 0
693 (and (eq_attr "type" "ddiv")
694 (eq_attr "cpu" "ppc7450"))
697 (define_function_unit "fpu" 1 0
698 (and (eq_attr "type" "ddiv")
699 (eq_attr "cpu" "ppc603"))
702 (define_function_unit "fpu" 1 0
703 (and (eq_attr "type" "ssqrt")
704 (eq_attr "cpu" "ppc620"))
707 (define_function_unit "fpu" 1 0
708 (and (eq_attr "type" "dsqrt")
709 (eq_attr "cpu" "ppc620"))
712 ; RIOS2 has two symmetric FPUs.
713 (define_function_unit "fpu2" 2 0
714 (and (eq_attr "type" "fp,dmul")
715 (eq_attr "cpu" "rios2"))
718 (define_function_unit "fpu2" 2 0
719 (and (eq_attr "type" "fp,dmul")
720 (eq_attr "cpu" "ppc630"))
723 (define_function_unit "fpu2" 2 0
724 (and (eq_attr "type" "sdiv,ddiv")
725 (eq_attr "cpu" "rios2"))
728 (define_function_unit "fpu2" 2 0
729 (and (eq_attr "type" "sdiv")
730 (eq_attr "cpu" "ppc630"))
733 (define_function_unit "fpu2" 2 0
734 (and (eq_attr "type" "ddiv")
735 (eq_attr "cpu" "ppc630"))
738 (define_function_unit "fpu2" 2 0
739 (and (eq_attr "type" "ssqrt,dsqrt")
740 (eq_attr "cpu" "rios2"))
743 (define_function_unit "fpu2" 2 0
744 (and (eq_attr "type" "ssqrt")
745 (eq_attr "cpu" "ppc630"))
748 (define_function_unit "fpu2" 2 0
749 (and (eq_attr "type" "dsqrt")
750 (eq_attr "cpu" "ppc630"))
754 (define_function_unit "lsu2" 2 0
755 (and (eq_attr "type" "load")
756 (eq_attr "cpu" "power4"))
759 (define_function_unit "lsu2" 2 0
760 (and (eq_attr "type" "fpload")
761 (eq_attr "cpu" "power4"))
764 (define_function_unit "lsu2" 2 0
765 (and (eq_attr "type" "store,fpstore")
766 (eq_attr "cpu" "power4"))
769 (define_function_unit "iu2" 2 0
770 (and (eq_attr "type" "integer")
771 (eq_attr "cpu" "power4"))
774 (define_function_unit "iu2" 2 0
775 (and (eq_attr "type" "imul,lmul")
776 (eq_attr "cpu" "power4"))
779 (define_function_unit "iu2" 2 0
780 (and (eq_attr "type" "imul2")
781 (eq_attr "cpu" "power4"))
784 (define_function_unit "iu2" 2 0
785 (and (eq_attr "type" "imul3")
786 (eq_attr "cpu" "power4"))
789 (define_function_unit "iu2" 2 0
790 (and (eq_attr "type" "idiv")
791 (eq_attr "cpu" "power4"))
794 (define_function_unit "iu2" 2 0
795 (and (eq_attr "type" "ldiv")
796 (eq_attr "cpu" "power4"))
799 (define_function_unit "imuldiv" 1 0
800 (and (eq_attr "type" "idiv")
801 (eq_attr "cpu" "power4"))
804 (define_function_unit "imuldiv" 1 0
805 (and (eq_attr "type" "ldiv")
806 (eq_attr "cpu" "power4"))
809 (define_function_unit "iu2" 2 0
810 (and (eq_attr "type" "compare")
811 (eq_attr "cpu" "power4"))
814 (define_function_unit "iu2" 2 0
815 (and (eq_attr "type" "delayed_compare")
816 (eq_attr "cpu" "power4"))
819 (define_function_unit "bpu" 1 0
820 (and (eq_attr "type" "mtjmpr")
821 (eq_attr "cpu" "power4"))
824 (define_function_unit "bpu" 1 0
825 (and (eq_attr "type" "jmpreg,branch")
826 (eq_attr "cpu" "power4"))
829 (define_function_unit "cru" 1 0
830 (and (eq_attr "type" "cr_logical")
831 (eq_attr "cpu" "power4"))
834 (define_function_unit "fpu2" 2 0
835 (and (eq_attr "type" "fp,dmul")
836 (eq_attr "cpu" "power4"))
839 ; adjust_cost increases the cost of dependent branches,
840 ; so shave a few cycles off for fpcompare.
841 (define_function_unit "fpu2" 2 0
842 (and (eq_attr "type" "fpcompare")
843 (eq_attr "cpu" "power4"))
846 (define_function_unit "fpu2" 2 0
847 (and (eq_attr "type" "sdiv,ddiv")
848 (eq_attr "cpu" "power4"))
851 (define_function_unit "fpu2" 2 0
852 (and (eq_attr "type" "ssqrt,dsqrt")
853 (eq_attr "cpu" "power4"))
857 ;; Start with fixed-point load and store insns. Here we put only the more
858 ;; complex forms. Basic data transfer is done later.
860 (define_expand "zero_extendqidi2"
861 [(set (match_operand:DI 0 "gpc_reg_operand" "")
862 (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))]
867 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
868 (zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
873 [(set_attr "type" "load,*")])
876 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
877 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
879 (clobber (match_scratch:DI 2 "=r,r"))]
884 [(set_attr "type" "compare")
885 (set_attr "length" "4,8")])
888 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
889 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
891 (clobber (match_scratch:DI 2 ""))]
892 "TARGET_POWERPC64 && reload_completed"
894 (zero_extend:DI (match_dup 1)))
896 (compare:CC (match_dup 2)
901 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
902 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
904 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
905 (zero_extend:DI (match_dup 1)))]
910 [(set_attr "type" "compare")
911 (set_attr "length" "4,8")])
914 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
915 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
917 (set (match_operand:DI 0 "gpc_reg_operand" "")
918 (zero_extend:DI (match_dup 1)))]
919 "TARGET_POWERPC64 && reload_completed"
921 (zero_extend:DI (match_dup 1)))
923 (compare:CC (match_dup 0)
927 (define_insn "extendqidi2"
928 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
929 (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]
934 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
935 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
937 (clobber (match_scratch:DI 2 "=r,r"))]
942 [(set_attr "type" "compare")
943 (set_attr "length" "4,8")])
946 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
947 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
949 (clobber (match_scratch:DI 2 ""))]
950 "TARGET_POWERPC64 && reload_completed"
952 (sign_extend:DI (match_dup 1)))
954 (compare:CC (match_dup 2)
959 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
960 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
962 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
963 (sign_extend:DI (match_dup 1)))]
968 [(set_attr "type" "compare")
969 (set_attr "length" "4,8")])
972 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
973 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
975 (set (match_operand:DI 0 "gpc_reg_operand" "")
976 (sign_extend:DI (match_dup 1)))]
977 "TARGET_POWERPC64 && reload_completed"
979 (sign_extend:DI (match_dup 1)))
981 (compare:CC (match_dup 0)
985 (define_expand "zero_extendhidi2"
986 [(set (match_operand:DI 0 "gpc_reg_operand" "")
987 (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
992 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
993 (zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
998 [(set_attr "type" "load,*")])
1001 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1002 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1004 (clobber (match_scratch:DI 2 "=r,r"))]
1009 [(set_attr "type" "compare")
1010 (set_attr "length" "4,8")])
1013 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1014 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1016 (clobber (match_scratch:DI 2 ""))]
1017 "TARGET_POWERPC64 && reload_completed"
1019 (zero_extend:DI (match_dup 1)))
1021 (compare:CC (match_dup 2)
1026 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1027 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1029 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1030 (zero_extend:DI (match_dup 1)))]
1035 [(set_attr "type" "compare")
1036 (set_attr "length" "4,8")])
1039 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1040 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1042 (set (match_operand:DI 0 "gpc_reg_operand" "")
1043 (zero_extend:DI (match_dup 1)))]
1044 "TARGET_POWERPC64 && reload_completed"
1046 (zero_extend:DI (match_dup 1)))
1048 (compare:CC (match_dup 0)
1052 (define_expand "extendhidi2"
1053 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1054 (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
1059 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1060 (sign_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1065 [(set_attr "type" "load,*")])
1068 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1069 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1071 (clobber (match_scratch:DI 2 "=r,r"))]
1076 [(set_attr "type" "compare")
1077 (set_attr "length" "4,8")])
1080 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1081 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1083 (clobber (match_scratch:DI 2 ""))]
1084 "TARGET_POWERPC64 && reload_completed"
1086 (sign_extend:DI (match_dup 1)))
1088 (compare:CC (match_dup 2)
1093 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1094 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1096 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1097 (sign_extend:DI (match_dup 1)))]
1102 [(set_attr "type" "compare")
1103 (set_attr "length" "4,8")])
1106 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1107 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1109 (set (match_operand:DI 0 "gpc_reg_operand" "")
1110 (sign_extend:DI (match_dup 1)))]
1111 "TARGET_POWERPC64 && reload_completed"
1113 (sign_extend:DI (match_dup 1)))
1115 (compare:CC (match_dup 0)
1119 (define_expand "zero_extendsidi2"
1120 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1121 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1126 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1127 (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))]
1132 [(set_attr "type" "load,*")])
1135 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1136 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1138 (clobber (match_scratch:DI 2 "=r,r"))]
1143 [(set_attr "type" "compare")
1144 (set_attr "length" "4,8")])
1147 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1148 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1150 (clobber (match_scratch:DI 2 ""))]
1151 "TARGET_POWERPC64 && reload_completed"
1153 (zero_extend:DI (match_dup 1)))
1155 (compare:CC (match_dup 2)
1160 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1161 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1163 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1164 (zero_extend:DI (match_dup 1)))]
1169 [(set_attr "type" "compare")
1170 (set_attr "length" "4,8")])
1173 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1174 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1176 (set (match_operand:DI 0 "gpc_reg_operand" "")
1177 (zero_extend:DI (match_dup 1)))]
1178 "TARGET_POWERPC64 && reload_completed"
1180 (zero_extend:DI (match_dup 1)))
1182 (compare:CC (match_dup 0)
1186 (define_expand "extendsidi2"
1187 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1188 (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1193 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1194 (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
1199 [(set_attr "type" "load,*")])
1202 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1203 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1205 (clobber (match_scratch:DI 2 "=r,r"))]
1210 [(set_attr "type" "compare")
1211 (set_attr "length" "4,8")])
1214 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1215 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1217 (clobber (match_scratch:DI 2 ""))]
1218 "TARGET_POWERPC64 && reload_completed"
1220 (sign_extend:DI (match_dup 1)))
1222 (compare:CC (match_dup 2)
1227 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1228 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1230 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1231 (sign_extend:DI (match_dup 1)))]
1236 [(set_attr "type" "compare")
1237 (set_attr "length" "4,8")])
1240 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1241 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1243 (set (match_operand:DI 0 "gpc_reg_operand" "")
1244 (sign_extend:DI (match_dup 1)))]
1245 "TARGET_POWERPC64 && reload_completed"
1247 (sign_extend:DI (match_dup 1)))
1249 (compare:CC (match_dup 0)
1253 (define_expand "zero_extendqisi2"
1254 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1255 (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "")))]
1260 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1261 (zero_extend:SI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1265 {rlinm|rlwinm} %0,%1,0,0xff"
1266 [(set_attr "type" "load,*")])
1269 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1270 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1272 (clobber (match_scratch:SI 2 "=r,r"))]
1275 {andil.|andi.} %2,%1,0xff
1277 [(set_attr "type" "compare")
1278 (set_attr "length" "4,8")])
1281 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1282 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1284 (clobber (match_scratch:SI 2 ""))]
1287 (zero_extend:SI (match_dup 1)))
1289 (compare:CC (match_dup 2)
1294 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1295 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1297 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1298 (zero_extend:SI (match_dup 1)))]
1301 {andil.|andi.} %0,%1,0xff
1303 [(set_attr "type" "compare")
1304 (set_attr "length" "4,8")])
1307 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1308 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1310 (set (match_operand:SI 0 "gpc_reg_operand" "")
1311 (zero_extend:SI (match_dup 1)))]
1314 (zero_extend:SI (match_dup 1)))
1316 (compare:CC (match_dup 0)
1320 (define_expand "extendqisi2"
1321 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
1322 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1327 emit_insn (gen_extendqisi2_ppc (operands[0], operands[1]));
1328 else if (TARGET_POWER)
1329 emit_insn (gen_extendqisi2_power (operands[0], operands[1]));
1331 emit_insn (gen_extendqisi2_no_power (operands[0], operands[1]));
1335 (define_insn "extendqisi2_ppc"
1336 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1337 (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1342 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1343 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1345 (clobber (match_scratch:SI 2 "=r,r"))]
1350 [(set_attr "type" "compare")
1351 (set_attr "length" "4,8")])
1354 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1355 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1357 (clobber (match_scratch:SI 2 ""))]
1358 "TARGET_POWERPC && reload_completed"
1360 (sign_extend:SI (match_dup 1)))
1362 (compare:CC (match_dup 2)
1367 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1368 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1370 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1371 (sign_extend:SI (match_dup 1)))]
1376 [(set_attr "type" "compare")
1377 (set_attr "length" "4,8")])
1380 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1381 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1383 (set (match_operand:SI 0 "gpc_reg_operand" "")
1384 (sign_extend:SI (match_dup 1)))]
1385 "TARGET_POWERPC && reload_completed"
1387 (sign_extend:SI (match_dup 1)))
1389 (compare:CC (match_dup 0)
1393 (define_expand "extendqisi2_power"
1394 [(parallel [(set (match_dup 2)
1395 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1397 (clobber (scratch:SI))])
1398 (parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
1399 (ashiftrt:SI (match_dup 2)
1401 (clobber (scratch:SI))])]
1404 { operands[1] = gen_lowpart (SImode, operands[1]);
1405 operands[2] = gen_reg_rtx (SImode); }")
1407 (define_expand "extendqisi2_no_power"
1409 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1411 (set (match_operand:SI 0 "gpc_reg_operand" "")
1412 (ashiftrt:SI (match_dup 2)
1414 "! TARGET_POWER && ! TARGET_POWERPC"
1416 { operands[1] = gen_lowpart (SImode, operands[1]);
1417 operands[2] = gen_reg_rtx (SImode); }")
1419 (define_expand "zero_extendqihi2"
1420 [(set (match_operand:HI 0 "gpc_reg_operand" "")
1421 (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "")))]
1426 [(set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1427 (zero_extend:HI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1431 {rlinm|rlwinm} %0,%1,0,0xff"
1432 [(set_attr "type" "load,*")])
1435 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1436 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1438 (clobber (match_scratch:HI 2 "=r,r"))]
1441 {andil.|andi.} %2,%1,0xff
1443 [(set_attr "type" "compare")
1444 (set_attr "length" "4,8")])
1447 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1448 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1450 (clobber (match_scratch:HI 2 ""))]
1453 (zero_extend:HI (match_dup 1)))
1455 (compare:CC (match_dup 2)
1460 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1461 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1463 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1464 (zero_extend:HI (match_dup 1)))]
1467 {andil.|andi.} %0,%1,0xff
1469 [(set_attr "type" "compare")
1470 (set_attr "length" "4,8")])
1473 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1474 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1476 (set (match_operand:HI 0 "gpc_reg_operand" "")
1477 (zero_extend:HI (match_dup 1)))]
1480 (zero_extend:HI (match_dup 1)))
1482 (compare:CC (match_dup 0)
1486 (define_expand "extendqihi2"
1487 [(use (match_operand:HI 0 "gpc_reg_operand" ""))
1488 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1493 emit_insn (gen_extendqihi2_ppc (operands[0], operands[1]));
1494 else if (TARGET_POWER)
1495 emit_insn (gen_extendqihi2_power (operands[0], operands[1]));
1497 emit_insn (gen_extendqihi2_no_power (operands[0], operands[1]));
1501 (define_insn "extendqihi2_ppc"
1502 [(set (match_operand:HI 0 "gpc_reg_operand" "=r")
1503 (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1508 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1509 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1511 (clobber (match_scratch:HI 2 "=r,r"))]
1516 [(set_attr "type" "compare")
1517 (set_attr "length" "4,8")])
1520 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1521 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1523 (clobber (match_scratch:HI 2 ""))]
1524 "TARGET_POWERPC && reload_completed"
1526 (sign_extend:HI (match_dup 1)))
1528 (compare:CC (match_dup 2)
1533 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1534 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1536 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1537 (sign_extend:HI (match_dup 1)))]
1542 [(set_attr "type" "compare")
1543 (set_attr "length" "4,8")])
1546 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1547 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1549 (set (match_operand:HI 0 "gpc_reg_operand" "")
1550 (sign_extend:HI (match_dup 1)))]
1551 "TARGET_POWERPC && reload_completed"
1553 (sign_extend:HI (match_dup 1)))
1555 (compare:CC (match_dup 0)
1559 (define_expand "extendqihi2_power"
1560 [(parallel [(set (match_dup 2)
1561 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1563 (clobber (scratch:SI))])
1564 (parallel [(set (match_operand:HI 0 "gpc_reg_operand" "")
1565 (ashiftrt:SI (match_dup 2)
1567 (clobber (scratch:SI))])]
1570 { operands[0] = gen_lowpart (SImode, operands[0]);
1571 operands[1] = gen_lowpart (SImode, operands[1]);
1572 operands[2] = gen_reg_rtx (SImode); }")
1574 (define_expand "extendqihi2_no_power"
1576 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1578 (set (match_operand:HI 0 "gpc_reg_operand" "")
1579 (ashiftrt:SI (match_dup 2)
1581 "! TARGET_POWER && ! TARGET_POWERPC"
1583 { operands[0] = gen_lowpart (SImode, operands[0]);
1584 operands[1] = gen_lowpart (SImode, operands[1]);
1585 operands[2] = gen_reg_rtx (SImode); }")
1587 (define_expand "zero_extendhisi2"
1588 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1589 (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1594 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1595 (zero_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1599 {rlinm|rlwinm} %0,%1,0,0xffff"
1600 [(set_attr "type" "load,*")])
1603 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1604 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1606 (clobber (match_scratch:SI 2 "=r,r"))]
1609 {andil.|andi.} %2,%1,0xffff
1611 [(set_attr "type" "compare")
1612 (set_attr "length" "4,8")])
1615 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1616 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1618 (clobber (match_scratch:SI 2 ""))]
1621 (zero_extend:SI (match_dup 1)))
1623 (compare:CC (match_dup 2)
1628 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1629 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1631 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1632 (zero_extend:SI (match_dup 1)))]
1635 {andil.|andi.} %0,%1,0xffff
1637 [(set_attr "type" "compare")
1638 (set_attr "length" "4,8")])
1641 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1642 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1644 (set (match_operand:SI 0 "gpc_reg_operand" "")
1645 (zero_extend:SI (match_dup 1)))]
1648 (zero_extend:SI (match_dup 1)))
1650 (compare:CC (match_dup 0)
1654 (define_expand "extendhisi2"
1655 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1656 (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1661 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1662 (sign_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1667 [(set_attr "type" "load,*")])
1670 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1671 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1673 (clobber (match_scratch:SI 2 "=r,r"))]
1676 {exts.|extsh.} %2,%1
1678 [(set_attr "type" "compare")
1679 (set_attr "length" "4,8")])
1682 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1683 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1685 (clobber (match_scratch:SI 2 ""))]
1688 (sign_extend:SI (match_dup 1)))
1690 (compare:CC (match_dup 2)
1695 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1696 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1698 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1699 (sign_extend:SI (match_dup 1)))]
1702 {exts.|extsh.} %0,%1
1704 [(set_attr "type" "compare")
1705 (set_attr "length" "4,8")])
1708 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1709 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1711 (set (match_operand:SI 0 "gpc_reg_operand" "")
1712 (sign_extend:SI (match_dup 1)))]
1715 (sign_extend:SI (match_dup 1)))
1717 (compare:CC (match_dup 0)
1721 ;; Fixed-point arithmetic insns.
1723 ;; Discourage ai/addic because of carry but provide it in an alternative
1724 ;; allowing register zero as source.
1725 (define_expand "addsi3"
1726 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1727 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1728 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
1732 if (GET_CODE (operands[2]) == CONST_INT
1733 && ! add_operand (operands[2], SImode))
1735 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
1736 ? operands[0] : gen_reg_rtx (SImode));
1738 HOST_WIDE_INT val = INTVAL (operands[2]);
1739 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1740 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1742 /* The ordering here is important for the prolog expander.
1743 When space is allocated from the stack, adding 'low' first may
1744 produce a temporary deallocation (which would be bad). */
1745 emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest)));
1746 emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low)));
1751 (define_insn "*addsi3_internal1"
1752 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r")
1753 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b")
1754 (match_operand:SI 2 "add_operand" "r,I,I,L")))]
1758 {cal %0,%2(%1)|addi %0,%1,%2}
1760 {cau|addis} %0,%1,%v2"
1761 [(set_attr "length" "4,4,4,4")])
1763 (define_insn "addsi3_high"
1764 [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
1765 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1766 (high:SI (match_operand 2 "" ""))))]
1767 "TARGET_MACHO && !TARGET_64BIT"
1768 "{cau|addis} %0,%1,ha16(%2)"
1769 [(set_attr "length" "4")])
1771 (define_insn "*addsi3_internal2"
1772 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
1773 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1774 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1776 (clobber (match_scratch:SI 3 "=r,r,r,r"))]
1777 "! TARGET_POWERPC64"
1779 {cax.|add.} %3,%1,%2
1780 {ai.|addic.} %3,%1,%2
1783 [(set_attr "type" "compare")
1784 (set_attr "length" "4,4,8,8")])
1787 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1788 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1789 (match_operand:SI 2 "reg_or_short_operand" ""))
1791 (clobber (match_scratch:SI 3 ""))]
1792 "! TARGET_POWERPC64 && reload_completed"
1794 (plus:SI (match_dup 1)
1797 (compare:CC (match_dup 3)
1801 (define_insn "*addsi3_internal3"
1802 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
1803 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1804 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1806 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
1807 (plus:SI (match_dup 1)
1809 "! TARGET_POWERPC64"
1811 {cax.|add.} %0,%1,%2
1812 {ai.|addic.} %0,%1,%2
1815 [(set_attr "type" "compare")
1816 (set_attr "length" "4,4,8,8")])
1819 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
1820 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1821 (match_operand:SI 2 "reg_or_short_operand" ""))
1823 (set (match_operand:SI 0 "gpc_reg_operand" "")
1824 (plus:SI (match_dup 1) (match_dup 2)))]
1825 "! TARGET_POWERPC64 && reload_completed"
1827 (plus:SI (match_dup 1)
1830 (compare:CC (match_dup 0)
1834 ;; Split an add that we can't do in one insn into two insns, each of which
1835 ;; does one 16-bit part. This is used by combine. Note that the low-order
1836 ;; add should be last in case the result gets used in an address.
1839 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1840 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1841 (match_operand:SI 2 "non_add_cint_operand" "")))]
1843 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
1844 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
1847 HOST_WIDE_INT val = INTVAL (operands[2]);
1848 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1849 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1851 operands[3] = GEN_INT (rest);
1852 operands[4] = GEN_INT (low);
1855 (define_insn "one_cmplsi2"
1856 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1857 (not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
1862 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1863 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1865 (clobber (match_scratch:SI 2 "=r,r"))]
1866 "! TARGET_POWERPC64"
1870 [(set_attr "type" "compare")
1871 (set_attr "length" "4,8")])
1874 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1875 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1877 (clobber (match_scratch:SI 2 ""))]
1878 "! TARGET_POWERPC64 && reload_completed"
1880 (not:SI (match_dup 1)))
1882 (compare:CC (match_dup 2)
1887 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1888 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1890 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1891 (not:SI (match_dup 1)))]
1892 "! TARGET_POWERPC64"
1896 [(set_attr "type" "compare")
1897 (set_attr "length" "4,8")])
1900 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1901 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1903 (set (match_operand:SI 0 "gpc_reg_operand" "")
1904 (not:SI (match_dup 1)))]
1905 "! TARGET_POWERPC64 && reload_completed"
1907 (not:SI (match_dup 1)))
1909 (compare:CC (match_dup 0)
1914 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1915 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "rI")
1916 (match_operand:SI 2 "gpc_reg_operand" "r")))]
1918 "{sf%I1|subf%I1c} %0,%2,%1")
1921 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1922 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I")
1923 (match_operand:SI 2 "gpc_reg_operand" "r,r")))]
1930 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1931 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1932 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1934 (clobber (match_scratch:SI 3 "=r,r"))]
1937 {sf.|subfc.} %3,%2,%1
1939 [(set_attr "type" "compare")
1940 (set_attr "length" "4,8")])
1943 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1944 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1945 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1947 (clobber (match_scratch:SI 3 "=r,r"))]
1948 "TARGET_POWERPC && ! TARGET_POWERPC64"
1952 [(set_attr "type" "compare")
1953 (set_attr "length" "4,8")])
1956 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1957 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1958 (match_operand:SI 2 "gpc_reg_operand" ""))
1960 (clobber (match_scratch:SI 3 ""))]
1961 "! TARGET_POWERPC64 && reload_completed"
1963 (minus:SI (match_dup 1)
1966 (compare:CC (match_dup 3)
1971 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1972 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1973 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1975 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1976 (minus:SI (match_dup 1) (match_dup 2)))]
1979 {sf.|subfc.} %0,%2,%1
1981 [(set_attr "type" "compare")
1982 (set_attr "length" "4,8")])
1985 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1986 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1987 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1989 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1990 (minus:SI (match_dup 1)
1992 "TARGET_POWERPC && ! TARGET_POWERPC64"
1996 [(set_attr "type" "compare")
1997 (set_attr "length" "4,8")])
2000 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2001 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
2002 (match_operand:SI 2 "gpc_reg_operand" ""))
2004 (set (match_operand:SI 0 "gpc_reg_operand" "")
2005 (minus:SI (match_dup 1)
2007 "! TARGET_POWERPC64 && reload_completed"
2009 (minus:SI (match_dup 1)
2012 (compare:CC (match_dup 0)
2016 (define_expand "subsi3"
2017 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2018 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "")
2019 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
2023 if (GET_CODE (operands[2]) == CONST_INT)
2025 emit_insn (gen_addsi3 (operands[0], operands[1],
2026 negate_rtx (SImode, operands[2])));
2031 ;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
2032 ;; instruction and some auxiliary computations. Then we just have a single
2033 ;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
2036 (define_expand "sminsi3"
2038 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
2039 (match_operand:SI 2 "reg_or_short_operand" ""))
2041 (minus:SI (match_dup 2) (match_dup 1))))
2042 (set (match_operand:SI 0 "gpc_reg_operand" "")
2043 (minus:SI (match_dup 2) (match_dup 3)))]
2044 "TARGET_POWER || TARGET_ISEL"
2049 operands[2] = force_reg (SImode, operands[2]);
2050 rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]);
2054 operands[3] = gen_reg_rtx (SImode);
2058 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2059 (smin:SI (match_operand:SI 1 "gpc_reg_operand" "")
2060 (match_operand:SI 2 "reg_or_short_operand" "")))
2061 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
2064 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
2066 (minus:SI (match_dup 2) (match_dup 1))))
2067 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 3)))]
2070 (define_expand "smaxsi3"
2072 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
2073 (match_operand:SI 2 "reg_or_short_operand" ""))
2075 (minus:SI (match_dup 2) (match_dup 1))))
2076 (set (match_operand:SI 0 "gpc_reg_operand" "")
2077 (plus:SI (match_dup 3) (match_dup 1)))]
2078 "TARGET_POWER || TARGET_ISEL"
2083 operands[2] = force_reg (SImode, operands[2]);
2084 rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]);
2087 operands[3] = gen_reg_rtx (SImode);
2091 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2092 (smax:SI (match_operand:SI 1 "gpc_reg_operand" "")
2093 (match_operand:SI 2 "reg_or_short_operand" "")))
2094 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
2097 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
2099 (minus:SI (match_dup 2) (match_dup 1))))
2100 (set (match_dup 0) (plus:SI (match_dup 3) (match_dup 1)))]
2103 (define_expand "uminsi3"
2104 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2106 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
2108 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
2110 (minus:SI (match_dup 4) (match_dup 3))))
2111 (set (match_operand:SI 0 "gpc_reg_operand" "")
2112 (minus:SI (match_dup 2) (match_dup 3)))]
2113 "TARGET_POWER || TARGET_ISEL"
2118 rs6000_emit_minmax (operands[0], UMIN, operands[1], operands[2]);
2121 operands[3] = gen_reg_rtx (SImode);
2122 operands[4] = gen_reg_rtx (SImode);
2123 operands[5] = GEN_INT (-2147483647 - 1);
2126 (define_expand "umaxsi3"
2127 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2129 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
2131 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
2133 (minus:SI (match_dup 4) (match_dup 3))))
2134 (set (match_operand:SI 0 "gpc_reg_operand" "")
2135 (plus:SI (match_dup 3) (match_dup 1)))]
2136 "TARGET_POWER || TARGET_ISEL"
2141 rs6000_emit_minmax (operands[0], UMAX, operands[1], operands[2]);
2144 operands[3] = gen_reg_rtx (SImode);
2145 operands[4] = gen_reg_rtx (SImode);
2146 operands[5] = GEN_INT (-2147483647 - 1);
2150 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2151 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
2152 (match_operand:SI 2 "reg_or_short_operand" "rI"))
2154 (minus:SI (match_dup 2) (match_dup 1))))]
2159 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2161 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2162 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2164 (minus:SI (match_dup 2) (match_dup 1)))
2166 (clobber (match_scratch:SI 3 "=r,r"))]
2171 [(set_attr "type" "delayed_compare")
2172 (set_attr "length" "4,8")])
2175 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2177 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2178 (match_operand:SI 2 "reg_or_short_operand" ""))
2180 (minus:SI (match_dup 2) (match_dup 1)))
2182 (clobber (match_scratch:SI 3 ""))]
2183 "TARGET_POWER && reload_completed"
2185 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2187 (minus:SI (match_dup 2) (match_dup 1))))
2189 (compare:CC (match_dup 3)
2194 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2196 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2197 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2199 (minus:SI (match_dup 2) (match_dup 1)))
2201 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2202 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2204 (minus:SI (match_dup 2) (match_dup 1))))]
2209 [(set_attr "type" "delayed_compare")
2210 (set_attr "length" "4,8")])
2213 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2215 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2216 (match_operand:SI 2 "reg_or_short_operand" ""))
2218 (minus:SI (match_dup 2) (match_dup 1)))
2220 (set (match_operand:SI 0 "gpc_reg_operand" "")
2221 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2223 (minus:SI (match_dup 2) (match_dup 1))))]
2224 "TARGET_POWER && reload_completed"
2226 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2228 (minus:SI (match_dup 2) (match_dup 1))))
2230 (compare:CC (match_dup 0)
2234 ;; We don't need abs with condition code because such comparisons should
2236 (define_expand "abssi2"
2237 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2238 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
2244 emit_insn (gen_abssi2_isel (operands[0], operands[1]));
2247 else if (! TARGET_POWER)
2249 emit_insn (gen_abssi2_nopower (operands[0], operands[1]));
2254 (define_insn "*abssi2_power"
2255 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2256 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2260 (define_insn_and_split "abssi2_isel"
2261 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2262 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "b")))
2263 (clobber (match_scratch:SI 2 "=b"))
2264 (clobber (match_scratch:CC 3 "=y"))]
2267 "&& reload_completed"
2268 [(set (match_dup 2) (neg:SI (match_dup 1)))
2270 (compare:CC (match_dup 1)
2273 (if_then_else:SI (ge (match_dup 3)
2279 (define_insn_and_split "abssi2_nopower"
2280 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2281 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
2282 (clobber (match_scratch:SI 2 "=&r,&r"))]
2283 "! TARGET_POWER && ! TARGET_ISEL"
2285 "&& reload_completed"
2286 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2287 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2288 (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
2291 (define_insn "*nabs_power"
2292 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2293 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
2297 (define_insn_and_split "*nabs_nopower"
2298 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2299 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
2300 (clobber (match_scratch:SI 2 "=&r,&r"))]
2303 "&& reload_completed"
2304 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2305 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2306 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))]
2309 (define_insn "negsi2"
2310 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2311 (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2316 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2317 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2319 (clobber (match_scratch:SI 2 "=r,r"))]
2320 "! TARGET_POWERPC64"
2324 [(set_attr "type" "compare")
2325 (set_attr "length" "4,8")])
2328 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2329 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2331 (clobber (match_scratch:SI 2 ""))]
2332 "! TARGET_POWERPC64 && reload_completed"
2334 (neg:SI (match_dup 1)))
2336 (compare:CC (match_dup 2)
2341 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
2342 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2344 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2345 (neg:SI (match_dup 1)))]
2346 "! TARGET_POWERPC64"
2350 [(set_attr "type" "compare")
2351 (set_attr "length" "4,8")])
2354 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
2355 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2357 (set (match_operand:SI 0 "gpc_reg_operand" "")
2358 (neg:SI (match_dup 1)))]
2359 "! TARGET_POWERPC64 && reload_completed"
2361 (neg:SI (match_dup 1)))
2363 (compare:CC (match_dup 0)
2367 (define_insn "ffssi2"
2368 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
2369 (ffs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2371 "neg %0,%1\;and %0,%0,%1\;{cntlz|cntlzw} %0,%0\;{sfi|subfic} %0,%0,32"
2372 [(set_attr "length" "16")])
2374 (define_expand "mulsi3"
2375 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2376 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2377 (use (match_operand:SI 2 "reg_or_short_operand" ""))]
2382 emit_insn (gen_mulsi3_mq (operands[0], operands[1], operands[2]));
2384 emit_insn (gen_mulsi3_no_mq (operands[0], operands[1], operands[2]));
2388 (define_insn "mulsi3_mq"
2389 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2390 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2391 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
2392 (clobber (match_scratch:SI 3 "=q,q"))]
2395 {muls|mullw} %0,%1,%2
2396 {muli|mulli} %0,%1,%2"
2398 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2399 (const_string "imul3")
2400 (match_operand:SI 2 "short_cint_operand" "")
2401 (const_string "imul2")]
2402 (const_string "imul")))])
2404 (define_insn "mulsi3_no_mq"
2405 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2406 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2407 (match_operand:SI 2 "reg_or_short_operand" "r,I")))]
2410 {muls|mullw} %0,%1,%2
2411 {muli|mulli} %0,%1,%2"
2413 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2414 (const_string "imul3")
2415 (match_operand:SI 2 "short_cint_operand" "")
2416 (const_string "imul2")]
2417 (const_string "imul")))])
2420 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2421 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2422 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2424 (clobber (match_scratch:SI 3 "=r,r"))
2425 (clobber (match_scratch:SI 4 "=q,q"))]
2428 {muls.|mullw.} %3,%1,%2
2430 [(set_attr "type" "delayed_compare")
2431 (set_attr "length" "4,8")])
2434 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2435 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2436 (match_operand:SI 2 "gpc_reg_operand" ""))
2438 (clobber (match_scratch:SI 3 ""))
2439 (clobber (match_scratch:SI 4 ""))]
2440 "TARGET_POWER && reload_completed"
2441 [(parallel [(set (match_dup 3)
2442 (mult:SI (match_dup 1) (match_dup 2)))
2443 (clobber (match_dup 4))])
2445 (compare:CC (match_dup 3)
2450 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2451 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2452 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2454 (clobber (match_scratch:SI 3 "=r,r"))]
2457 {muls.|mullw.} %3,%1,%2
2459 [(set_attr "type" "delayed_compare")
2460 (set_attr "length" "4,8")])
2463 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2464 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2465 (match_operand:SI 2 "gpc_reg_operand" ""))
2467 (clobber (match_scratch:SI 3 ""))]
2468 "! TARGET_POWER && reload_completed"
2470 (mult:SI (match_dup 1) (match_dup 2)))
2472 (compare:CC (match_dup 3)
2477 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2478 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2479 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2481 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2482 (mult:SI (match_dup 1) (match_dup 2)))
2483 (clobber (match_scratch:SI 4 "=q,q"))]
2486 {muls.|mullw.} %0,%1,%2
2488 [(set_attr "type" "delayed_compare")
2489 (set_attr "length" "4,8")])
2492 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2493 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2494 (match_operand:SI 2 "gpc_reg_operand" ""))
2496 (set (match_operand:SI 0 "gpc_reg_operand" "")
2497 (mult:SI (match_dup 1) (match_dup 2)))
2498 (clobber (match_scratch:SI 4 ""))]
2499 "TARGET_POWER && reload_completed"
2500 [(parallel [(set (match_dup 0)
2501 (mult:SI (match_dup 1) (match_dup 2)))
2502 (clobber (match_dup 4))])
2504 (compare:CC (match_dup 0)
2509 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2510 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2511 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2513 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2514 (mult:SI (match_dup 1) (match_dup 2)))]
2517 {muls.|mullw.} %0,%1,%2
2519 [(set_attr "type" "delayed_compare")
2520 (set_attr "length" "4,8")])
2523 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2524 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2525 (match_operand:SI 2 "gpc_reg_operand" ""))
2527 (set (match_operand:SI 0 "gpc_reg_operand" "")
2528 (mult:SI (match_dup 1) (match_dup 2)))]
2529 "! TARGET_POWER && reload_completed"
2531 (mult:SI (match_dup 1) (match_dup 2)))
2533 (compare:CC (match_dup 0)
2537 ;; Operand 1 is divided by operand 2; quotient goes to operand
2538 ;; 0 and remainder to operand 3.
2539 ;; ??? At some point, see what, if anything, we can do about if (x % y == 0).
2541 (define_expand "divmodsi4"
2542 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2543 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2544 (match_operand:SI 2 "gpc_reg_operand" "")))
2545 (set (match_operand:SI 3 "gpc_reg_operand" "")
2546 (mod:SI (match_dup 1) (match_dup 2)))])]
2547 "TARGET_POWER || (! TARGET_POWER && ! TARGET_POWERPC)"
2550 if (! TARGET_POWER && ! TARGET_POWERPC)
2552 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2553 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2554 emit_insn (gen_divss_call ());
2555 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2556 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2562 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2563 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2564 (match_operand:SI 2 "gpc_reg_operand" "r")))
2565 (set (match_operand:SI 3 "gpc_reg_operand" "=q")
2566 (mod:SI (match_dup 1) (match_dup 2)))]
2569 [(set_attr "type" "idiv")])
2571 (define_expand "udivsi3"
2572 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2573 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2574 (match_operand:SI 2 "gpc_reg_operand" "")))]
2575 "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)"
2578 if (! TARGET_POWER && ! TARGET_POWERPC)
2580 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2581 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2582 emit_insn (gen_quous_call ());
2583 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2586 else if (TARGET_POWER)
2588 emit_insn (gen_udivsi3_mq (operands[0], operands[1], operands[2]));
2593 (define_insn "udivsi3_mq"
2594 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2595 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2596 (match_operand:SI 2 "gpc_reg_operand" "r")))
2597 (clobber (match_scratch:SI 3 "=q"))]
2598 "TARGET_POWERPC && TARGET_POWER"
2600 [(set_attr "type" "idiv")])
2602 (define_insn "*udivsi3_no_mq"
2603 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2604 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2605 (match_operand:SI 2 "gpc_reg_operand" "r")))]
2606 "TARGET_POWERPC && ! TARGET_POWER"
2608 [(set_attr "type" "idiv")])
2610 ;; For powers of two we can do srai/aze for divide and then adjust for
2611 ;; modulus. If it isn't a power of two, FAIL on POWER so divmodsi4 will be
2612 ;; used; for PowerPC, force operands into register and do a normal divide;
2613 ;; for AIX common-mode, use quoss call on register operands.
2614 (define_expand "divsi3"
2615 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2616 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2617 (match_operand:SI 2 "reg_or_cint_operand" "")))]
2621 if (GET_CODE (operands[2]) == CONST_INT
2622 && INTVAL (operands[2]) > 0
2623 && exact_log2 (INTVAL (operands[2])) >= 0)
2625 else if (TARGET_POWERPC)
2627 operands[2] = force_reg (SImode, operands[2]);
2630 emit_insn (gen_divsi3_mq (operands[0], operands[1], operands[2]));
2634 else if (TARGET_POWER)
2638 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2639 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2640 emit_insn (gen_quoss_call ());
2641 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2646 (define_insn "divsi3_mq"
2647 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2648 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2649 (match_operand:SI 2 "gpc_reg_operand" "r")))
2650 (clobber (match_scratch:SI 3 "=q"))]
2651 "TARGET_POWERPC && TARGET_POWER"
2653 [(set_attr "type" "idiv")])
2655 (define_insn "*divsi3_no_mq"
2656 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2657 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2658 (match_operand:SI 2 "gpc_reg_operand" "r")))]
2659 "TARGET_POWERPC && ! TARGET_POWER"
2661 [(set_attr "type" "idiv")])
2663 (define_expand "modsi3"
2664 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2665 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2666 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
2674 if (GET_CODE (operands[2]) != CONST_INT
2675 || INTVAL (operands[2]) <= 0
2676 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
2679 temp1 = gen_reg_rtx (SImode);
2680 temp2 = gen_reg_rtx (SImode);
2682 emit_insn (gen_divsi3 (temp1, operands[1], operands[2]));
2683 emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
2684 emit_insn (gen_subsi3 (operands[0], operands[1], temp2));
2689 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2690 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2691 (match_operand:SI 2 "exact_log2_cint_operand" "N")))]
2693 "{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0"
2694 [(set_attr "length" "8")])
2697 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2698 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2699 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2701 (clobber (match_scratch:SI 3 "=r,r"))]
2704 {srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3
2706 [(set_attr "type" "compare")
2707 (set_attr "length" "8,12")])
2710 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2711 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2712 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2714 (clobber (match_scratch:SI 3 ""))]
2717 (div:SI (match_dup 1) (match_dup 2)))
2719 (compare:CC (match_dup 3)
2724 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2725 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2726 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2728 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2729 (div:SI (match_dup 1) (match_dup 2)))]
2732 {srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0
2734 [(set_attr "type" "compare")
2735 (set_attr "length" "8,12")])
2738 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2739 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2740 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2742 (set (match_operand:SI 0 "gpc_reg_operand" "")
2743 (div:SI (match_dup 1) (match_dup 2)))]
2746 (div:SI (match_dup 1) (match_dup 2)))
2748 (compare:CC (match_dup 0)
2753 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2756 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
2758 (zero_extend:DI (match_operand:SI 4 "register_operand" "2")))
2759 (match_operand:SI 3 "gpc_reg_operand" "r")))
2760 (set (match_operand:SI 2 "register_operand" "=*q")
2763 (zero_extend:DI (match_dup 1)) (const_int 32))
2764 (zero_extend:DI (match_dup 4)))
2768 [(set_attr "type" "idiv")])
2770 ;; To do unsigned divide we handle the cases of the divisor looking like a
2771 ;; negative number. If it is a constant that is less than 2**31, we don't
2772 ;; have to worry about the branches. So make a few subroutines here.
2774 ;; First comes the normal case.
2775 (define_expand "udivmodsi4_normal"
2776 [(set (match_dup 4) (const_int 0))
2777 (parallel [(set (match_operand:SI 0 "" "")
2778 (udiv:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2780 (zero_extend:DI (match_operand:SI 1 "" "")))
2781 (match_operand:SI 2 "" "")))
2782 (set (match_operand:SI 3 "" "")
2783 (umod:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2785 (zero_extend:DI (match_dup 1)))
2789 { operands[4] = gen_reg_rtx (SImode); }")
2791 ;; This handles the branches.
2792 (define_expand "udivmodsi4_tests"
2793 [(set (match_operand:SI 0 "" "") (const_int 0))
2794 (set (match_operand:SI 3 "" "") (match_operand:SI 1 "" ""))
2795 (set (match_dup 5) (compare:CCUNS (match_dup 1) (match_operand:SI 2 "" "")))
2796 (set (pc) (if_then_else (ltu (match_dup 5) (const_int 0))
2797 (label_ref (match_operand:SI 4 "" "")) (pc)))
2798 (set (match_dup 0) (const_int 1))
2799 (set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2)))
2800 (set (match_dup 6) (compare:CC (match_dup 2) (const_int 0)))
2801 (set (pc) (if_then_else (lt (match_dup 6) (const_int 0))
2802 (label_ref (match_dup 4)) (pc)))]
2805 { operands[5] = gen_reg_rtx (CCUNSmode);
2806 operands[6] = gen_reg_rtx (CCmode);
2809 (define_expand "udivmodsi4"
2810 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2811 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2812 (match_operand:SI 2 "reg_or_cint_operand" "")))
2813 (set (match_operand:SI 3 "gpc_reg_operand" "")
2814 (umod:SI (match_dup 1) (match_dup 2)))])]
2822 if (! TARGET_POWERPC)
2824 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2825 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2826 emit_insn (gen_divus_call ());
2827 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2828 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2835 if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
2837 operands[2] = force_reg (SImode, operands[2]);
2838 label = gen_label_rtx ();
2839 emit (gen_udivmodsi4_tests (operands[0], operands[1], operands[2],
2840 operands[3], label));
2843 operands[2] = force_reg (SImode, operands[2]);
2845 emit (gen_udivmodsi4_normal (operands[0], operands[1], operands[2],
2853 ;; AIX architecture-independent common-mode multiply (DImode),
2854 ;; divide/modulus, and quotient subroutine calls. Input operands in R3 and
2855 ;; R4; results in R3 and sometimes R4; link register always clobbered by bla
2856 ;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but
2857 ;; assumed unused if generating common-mode, so ignore.
2858 (define_insn "mulh_call"
2861 (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3))
2862 (sign_extend:DI (reg:SI 4)))
2864 (clobber (match_scratch:SI 0 "=l"))]
2865 "! TARGET_POWER && ! TARGET_POWERPC"
2867 [(set_attr "type" "imul")])
2869 (define_insn "mull_call"
2871 (mult:DI (sign_extend:DI (reg:SI 3))
2872 (sign_extend:DI (reg:SI 4))))
2873 (clobber (match_scratch:SI 0 "=l"))
2874 (clobber (reg:SI 0))]
2875 "! TARGET_POWER && ! TARGET_POWERPC"
2877 [(set_attr "type" "imul")])
2879 (define_insn "divss_call"
2881 (div:SI (reg:SI 3) (reg:SI 4)))
2883 (mod:SI (reg:SI 3) (reg:SI 4)))
2884 (clobber (match_scratch:SI 0 "=l"))
2885 (clobber (reg:SI 0))]
2886 "! TARGET_POWER && ! TARGET_POWERPC"
2888 [(set_attr "type" "idiv")])
2890 (define_insn "divus_call"
2892 (udiv:SI (reg:SI 3) (reg:SI 4)))
2894 (umod:SI (reg:SI 3) (reg:SI 4)))
2895 (clobber (match_scratch:SI 0 "=l"))
2896 (clobber (reg:SI 0))
2897 (clobber (match_scratch:CC 1 "=x"))
2898 (clobber (reg:CC 69))]
2899 "! TARGET_POWER && ! TARGET_POWERPC"
2901 [(set_attr "type" "idiv")])
2903 (define_insn "quoss_call"
2905 (div:SI (reg:SI 3) (reg:SI 4)))
2906 (clobber (match_scratch:SI 0 "=l"))]
2907 "! TARGET_POWER && ! TARGET_POWERPC"
2909 [(set_attr "type" "idiv")])
2911 (define_insn "quous_call"
2913 (udiv:SI (reg:SI 3) (reg:SI 4)))
2914 (clobber (match_scratch:SI 0 "=l"))
2915 (clobber (reg:SI 0))
2916 (clobber (match_scratch:CC 1 "=x"))
2917 (clobber (reg:CC 69))]
2918 "! TARGET_POWER && ! TARGET_POWERPC"
2920 [(set_attr "type" "idiv")])
2922 ;; Logical instructions
2923 ;; The logical instructions are mostly combined by using match_operator,
2924 ;; but the plain AND insns are somewhat different because there is no
2925 ;; plain 'andi' (only 'andi.'), no plain 'andis', and there are all
2926 ;; those rotate-and-mask operations. Thus, the AND insns come first.
2928 (define_insn "andsi3"
2929 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
2930 (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
2931 (match_operand:SI 2 "and_operand" "?r,T,K,L")))
2932 (clobber (match_scratch:CC 3 "=X,X,x,x"))]
2936 {rlinm|rlwinm} %0,%1,0,%m2,%M2
2937 {andil.|andi.} %0,%1,%b2
2938 {andiu.|andis.} %0,%1,%u2")
2940 ;; Note to set cr's other than cr0 we do the and immediate and then
2941 ;; the test again -- this avoids a mfcr which on the higher end
2942 ;; machines causes an execution serialization
2944 (define_insn "*andsi3_internal2"
2945 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2946 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2947 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2949 (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
2950 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2951 "! TARGET_POWERPC64"
2954 {andil.|andi.} %3,%1,%b2
2955 {andiu.|andis.} %3,%1,%u2
2956 {rlinm.|rlwinm.} %3,%1,0,%m2,%M2
2961 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2962 (set_attr "length" "4,4,4,4,8,8,8,8")])
2964 (define_insn "*andsi3_internal3"
2965 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2966 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2967 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2969 (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
2970 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2974 {andil.|andi.} %3,%1,%b2
2975 {andiu.|andis.} %3,%1,%u2
2976 {rlinm.|rlwinm.} %3,%1,0,%m2,%M2
2981 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2982 (set_attr "length" "8,4,4,4,8,8,8,8")])
2985 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2986 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
2987 (match_operand:SI 2 "and_operand" ""))
2989 (clobber (match_scratch:SI 3 ""))
2990 (clobber (match_scratch:CC 4 ""))]
2992 [(parallel [(set (match_dup 3)
2993 (and:SI (match_dup 1)
2995 (clobber (match_dup 4))])
2997 (compare:CC (match_dup 3)
3001 ;; We don't have a 32 bit "and. rt,ra,rb" for ppc64. cr is set from the
3002 ;; whole 64 bit reg, and we don't know what is in the high 32 bits.
3005 [(set (match_operand:CC 0 "cc_reg_operand" "")
3006 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
3007 (match_operand:SI 2 "gpc_reg_operand" ""))
3009 (clobber (match_scratch:SI 3 ""))
3010 (clobber (match_scratch:CC 4 ""))]
3011 "TARGET_POWERPC64 && reload_completed"
3012 [(parallel [(set (match_dup 3)
3013 (and:SI (match_dup 1)
3015 (clobber (match_dup 4))])
3017 (compare:CC (match_dup 3)
3021 (define_insn "*andsi3_internal4"
3022 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
3023 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
3024 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
3026 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
3027 (and:SI (match_dup 1)
3029 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
3030 "! TARGET_POWERPC64"
3033 {andil.|andi.} %0,%1,%b2
3034 {andiu.|andis.} %0,%1,%u2
3035 {rlinm.|rlwinm.} %0,%1,0,%m2,%M2
3040 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
3041 (set_attr "length" "4,4,4,4,8,8,8,8")])
3043 (define_insn "*andsi3_internal5"
3044 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
3045 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
3046 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
3048 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
3049 (and:SI (match_dup 1)
3051 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
3055 {andil.|andi.} %0,%1,%b2
3056 {andiu.|andis.} %0,%1,%u2
3057 {rlinm.|rlwinm.} %0,%1,0,%m2,%M2
3062 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
3063 (set_attr "length" "8,4,4,4,8,8,8,8")])
3066 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3067 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
3068 (match_operand:SI 2 "and_operand" ""))
3070 (set (match_operand:SI 0 "gpc_reg_operand" "")
3071 (and:SI (match_dup 1)
3073 (clobber (match_scratch:CC 4 ""))]
3075 [(parallel [(set (match_dup 0)
3076 (and:SI (match_dup 1)
3078 (clobber (match_dup 4))])
3080 (compare:CC (match_dup 0)
3085 [(set (match_operand:CC 3 "cc_reg_operand" "")
3086 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
3087 (match_operand:SI 2 "gpc_reg_operand" ""))
3089 (set (match_operand:SI 0 "gpc_reg_operand" "")
3090 (and:SI (match_dup 1)
3092 (clobber (match_scratch:CC 4 ""))]
3093 "TARGET_POWERPC64 && reload_completed"
3094 [(parallel [(set (match_dup 0)
3095 (and:SI (match_dup 1)
3097 (clobber (match_dup 4))])
3099 (compare:CC (match_dup 0)
3103 ;; Handle the PowerPC64 rlwinm corner case
3105 (define_insn_and_split "*andsi3_internal6"
3106 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3107 (and:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3108 (match_operand:SI 2 "mask_operand_wrap" "i")))]
3113 (and:SI (rotate:SI (match_dup 1) (match_dup 3))
3116 (rotate:SI (match_dup 0) (match_dup 5)))]
3119 int mb = extract_MB (operands[2]);
3120 int me = extract_ME (operands[2]);
3121 operands[3] = GEN_INT (me + 1);
3122 operands[5] = GEN_INT (32 - (me + 1));
3123 operands[4] = GEN_INT (~((HOST_WIDE_INT) -1 << (33 + me - mb)));
3125 [(set_attr "length" "8")])
3127 (define_insn_and_split "*andsi3_internal7"
3128 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
3129 (compare:CC (and:SI (match_operand:SI 0 "gpc_reg_operand" "r,r")
3130 (match_operand:SI 1 "mask_operand_wrap" "i,i"))
3132 (clobber (match_scratch:SI 3 "=r,r"))]
3136 [(parallel [(set (match_dup 2)
3137 (compare:CC (and:SI (rotate:SI (match_dup 0) (match_dup 4))
3140 (clobber (match_dup 3))])]
3143 int mb = extract_MB (operands[1]);
3144 int me = extract_ME (operands[1]);
3145 operands[4] = GEN_INT (me + 1);
3146 operands[5] = GEN_INT (~((HOST_WIDE_INT) -1 << (33 + me - mb)));
3148 [(set_attr "type" "delayed_compare,compare")
3149 (set_attr "length" "4,8")])
3151 (define_insn_and_split "*andsi3_internal8"
3152 [(set (match_operand:CC 3 "cc_reg_operand" "=x,??y")
3153 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3154 (match_operand:SI 2 "mask_operand_wrap" "i,i"))
3156 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3157 (and:SI (match_dup 1)
3162 [(parallel [(set (match_dup 3)
3163 (compare:CC (and:SI (rotate:SI (match_dup 1) (match_dup 4))
3167 (and:SI (rotate:SI (match_dup 1) (match_dup 4))
3170 (rotate:SI (match_dup 0) (match_dup 6)))]
3173 int mb = extract_MB (operands[2]);
3174 int me = extract_ME (operands[2]);
3175 operands[4] = GEN_INT (me + 1);
3176 operands[6] = GEN_INT (32 - (me + 1));
3177 operands[5] = GEN_INT (~((HOST_WIDE_INT) -1 << (33 + me - mb)));
3179 [(set_attr "type" "delayed_compare,compare")
3180 (set_attr "length" "8,12")])
3182 (define_expand "iorsi3"
3183 [(set (match_operand:SI 0 "gpc_reg_operand" "")
3184 (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
3185 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
3189 if (GET_CODE (operands[2]) == CONST_INT
3190 && ! logical_operand (operands[2], SImode))
3192 HOST_WIDE_INT value = INTVAL (operands[2]);
3193 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
3194 ? operands[0] : gen_reg_rtx (SImode));
3196 emit_insn (gen_iorsi3 (tmp, operands[1],
3197 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
3198 emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
3203 (define_expand "xorsi3"
3204 [(set (match_operand:SI 0 "gpc_reg_operand" "")
3205 (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
3206 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
3210 if (GET_CODE (operands[2]) == CONST_INT
3211 && ! logical_operand (operands[2], SImode))
3213 HOST_WIDE_INT value = INTVAL (operands[2]);
3214 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
3215 ? operands[0] : gen_reg_rtx (SImode));
3217 emit_insn (gen_xorsi3 (tmp, operands[1],
3218 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
3219 emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
3224 (define_insn "*boolsi3_internal1"
3225 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
3226 (match_operator:SI 3 "boolean_or_operator"
3227 [(match_operand:SI 1 "gpc_reg_operand" "%r,r,r")
3228 (match_operand:SI 2 "logical_operand" "r,K,L")]))]
3232 {%q3il|%q3i} %0,%1,%b2
3233 {%q3iu|%q3is} %0,%1,%u2")
3235 (define_insn "*boolsi3_internal2"
3236 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3237 (compare:CC (match_operator:SI 4 "boolean_or_operator"
3238 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
3239 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3241 (clobber (match_scratch:SI 3 "=r,r"))]
3242 "! TARGET_POWERPC64"
3246 [(set_attr "type" "compare")
3247 (set_attr "length" "4,8")])
3250 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3251 (compare:CC (match_operator:SI 4 "boolean_operator"
3252 [(match_operand:SI 1 "gpc_reg_operand" "")
3253 (match_operand:SI 2 "gpc_reg_operand" "")])
3255 (clobber (match_scratch:SI 3 ""))]
3256 "! TARGET_POWERPC64 && reload_completed"
3257 [(set (match_dup 3) (match_dup 4))
3259 (compare:CC (match_dup 3)
3263 (define_insn "*boolsi3_internal3"
3264 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3265 (compare:CC (match_operator:SI 4 "boolean_operator"
3266 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
3267 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3269 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3271 "! TARGET_POWERPC64"
3275 [(set_attr "type" "compare")
3276 (set_attr "length" "4,8")])
3279 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3280 (compare:CC (match_operator:SI 4 "boolean_operator"
3281 [(match_operand:SI 1 "gpc_reg_operand" "")
3282 (match_operand:SI 2 "gpc_reg_operand" "")])
3284 (set (match_operand:SI 0 "gpc_reg_operand" "")
3286 "! TARGET_POWERPC64 && reload_completed"
3287 [(set (match_dup 0) (match_dup 4))
3289 (compare:CC (match_dup 0)
3293 ;; Split an logical operation that we can't do in one insn into two insns,
3294 ;; each of which does one 16-bit part. This is used by combine.
3297 [(set (match_operand:SI 0 "gpc_reg_operand" "")
3298 (match_operator:SI 3 "boolean_or_operator"
3299 [(match_operand:SI 1 "gpc_reg_operand" "")
3300 (match_operand:SI 2 "non_logical_cint_operand" "")]))]
3302 [(set (match_dup 0) (match_dup 4))
3303 (set (match_dup 0) (match_dup 5))]
3307 i = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
3308 operands[4] = gen_rtx (GET_CODE (operands[3]), SImode,
3310 i = GEN_INT (INTVAL (operands[2]) & 0xffff);
3311 operands[5] = gen_rtx (GET_CODE (operands[3]), SImode,
3315 (define_insn "*boolcsi3_internal1"
3316 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3317 (match_operator:SI 3 "boolean_operator"
3318 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3319 (match_operand:SI 2 "gpc_reg_operand" "r")]))]
3323 (define_insn "*boolcsi3_internal2"
3324 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3325 (compare:CC (match_operator:SI 4 "boolean_operator"
3326 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3327 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3329 (clobber (match_scratch:SI 3 "=r,r"))]
3330 "! TARGET_POWERPC64"
3334 [(set_attr "type" "compare")
3335 (set_attr "length" "4,8")])
3338 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3339 (compare:CC (match_operator:SI 4 "boolean_operator"
3340 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3341 (match_operand:SI 2 "gpc_reg_operand" "")])
3343 (clobber (match_scratch:SI 3 ""))]
3344 "! TARGET_POWERPC64 && reload_completed"
3345 [(set (match_dup 3) (match_dup 4))
3347 (compare:CC (match_dup 3)
3351 (define_insn "*boolcsi3_internal3"
3352 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3353 (compare:CC (match_operator:SI 4 "boolean_operator"
3354 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3355 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3357 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3359 "! TARGET_POWERPC64"
3363 [(set_attr "type" "compare")
3364 (set_attr "length" "4,8")])
3367 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3368 (compare:CC (match_operator:SI 4 "boolean_operator"
3369 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3370 (match_operand:SI 2 "gpc_reg_operand" "")])
3372 (set (match_operand:SI 0 "gpc_reg_operand" "")
3374 "! TARGET_POWERPC64 && reload_completed"
3375 [(set (match_dup 0) (match_dup 4))
3377 (compare:CC (match_dup 0)
3381 (define_insn "*boolccsi3_internal1"
3382 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3383 (match_operator:SI 3 "boolean_operator"
3384 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3385 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))]))]
3389 (define_insn "*boolccsi3_internal2"
3390 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3391 (compare:CC (match_operator:SI 4 "boolean_operator"
3392 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3393 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3395 (clobber (match_scratch:SI 3 "=r,r"))]
3396 "! TARGET_POWERPC64"
3400 [(set_attr "type" "compare")
3401 (set_attr "length" "4,8")])
3404 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3405 (compare:CC (match_operator:SI 4 "boolean_operator"
3406 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3407 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3409 (clobber (match_scratch:SI 3 ""))]
3410 "! TARGET_POWERPC64 && reload_completed"
3411 [(set (match_dup 3) (match_dup 4))
3413 (compare:CC (match_dup 3)
3417 (define_insn "*boolccsi3_internal3"
3418 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3419 (compare:CC (match_operator:SI 4 "boolean_operator"
3420 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3421 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3423 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3425 "! TARGET_POWERPC64"
3429 [(set_attr "type" "compare")
3430 (set_attr "length" "4,8")])
3433 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3434 (compare:CC (match_operator:SI 4 "boolean_operator"
3435 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3436 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3438 (set (match_operand:SI 0 "gpc_reg_operand" "")
3440 "! TARGET_POWERPC64 && reload_completed"
3441 [(set (match_dup 0) (match_dup 4))
3443 (compare:CC (match_dup 0)
3447 ;; maskir insn. We need four forms because things might be in arbitrary
3448 ;; orders. Don't define forms that only set CR fields because these
3449 ;; would modify an input register.
3451 (define_insn "*maskir_internal1"
3452 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3453 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3454 (match_operand:SI 1 "gpc_reg_operand" "0"))
3455 (and:SI (match_dup 2)
3456 (match_operand:SI 3 "gpc_reg_operand" "r"))))]
3460 (define_insn "*maskir_internal2"
3461 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3462 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3463 (match_operand:SI 1 "gpc_reg_operand" "0"))
3464 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3469 (define_insn "*maskir_internal3"
3470 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3471 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r")
3472 (match_operand:SI 3 "gpc_reg_operand" "r"))
3473 (and:SI (not:SI (match_dup 2))
3474 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3478 (define_insn "*maskir_internal4"
3479 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3480 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3481 (match_operand:SI 2 "gpc_reg_operand" "r"))
3482 (and:SI (not:SI (match_dup 2))
3483 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3487 (define_insn "*maskir_internal5"
3488 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3490 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3491 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3492 (and:SI (match_dup 2)
3493 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
3495 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3496 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3497 (and:SI (match_dup 2) (match_dup 3))))]
3502 [(set_attr "type" "compare")
3503 (set_attr "length" "4,8")])
3506 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3508 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3509 (match_operand:SI 1 "gpc_reg_operand" ""))
3510 (and:SI (match_dup 2)
3511 (match_operand:SI 3 "gpc_reg_operand" "")))
3513 (set (match_operand:SI 0 "gpc_reg_operand" "")
3514 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3515 (and:SI (match_dup 2) (match_dup 3))))]
3516 "TARGET_POWER && reload_completed"
3518 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3519 (and:SI (match_dup 2) (match_dup 3))))
3521 (compare:CC (match_dup 0)
3525 (define_insn "*maskir_internal6"
3526 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3528 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3529 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3530 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3533 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3534 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3535 (and:SI (match_dup 3) (match_dup 2))))]
3540 [(set_attr "type" "compare")
3541 (set_attr "length" "4,8")])
3544 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3546 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3547 (match_operand:SI 1 "gpc_reg_operand" ""))
3548 (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3551 (set (match_operand:SI 0 "gpc_reg_operand" "")
3552 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3553 (and:SI (match_dup 3) (match_dup 2))))]
3554 "TARGET_POWER && reload_completed"
3556 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3557 (and:SI (match_dup 3) (match_dup 2))))
3559 (compare:CC (match_dup 0)
3563 (define_insn "*maskir_internal7"
3564 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3566 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")
3567 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
3568 (and:SI (not:SI (match_dup 2))
3569 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3571 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3572 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3573 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3578 [(set_attr "type" "compare")
3579 (set_attr "length" "4,8")])
3582 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3584 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "")
3585 (match_operand:SI 3 "gpc_reg_operand" ""))
3586 (and:SI (not:SI (match_dup 2))
3587 (match_operand:SI 1 "gpc_reg_operand" "")))
3589 (set (match_operand:SI 0 "gpc_reg_operand" "")
3590 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3591 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3592 "TARGET_POWER && reload_completed"
3594 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3595 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3597 (compare:CC (match_dup 0)
3601 (define_insn "*maskir_internal8"
3602 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3604 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3605 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3606 (and:SI (not:SI (match_dup 2))
3607 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3609 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3610 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3611 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3616 [(set_attr "type" "compare")
3617 (set_attr "length" "4,8")])
3620 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3622 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3623 (match_operand:SI 2 "gpc_reg_operand" ""))
3624 (and:SI (not:SI (match_dup 2))
3625 (match_operand:SI 1 "gpc_reg_operand" "")))
3627 (set (match_operand:SI 0 "gpc_reg_operand" "")
3628 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3629 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3630 "TARGET_POWER && reload_completed"
3632 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3633 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3635 (compare:CC (match_dup 0)
3639 ;; Rotate and shift insns, in all their variants. These support shifts,
3640 ;; field inserts and extracts, and various combinations thereof.
3641 (define_expand "insv"
3642 [(set (zero_extract (match_operand 0 "gpc_reg_operand" "")
3643 (match_operand:SI 1 "const_int_operand" "")
3644 (match_operand:SI 2 "const_int_operand" ""))
3645 (match_operand 3 "gpc_reg_operand" ""))]
3649 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3650 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3651 compiler if the address of the structure is taken later. */
3652 if (GET_CODE (operands[0]) == SUBREG
3653 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3656 if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
3657 emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
3659 emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
3663 (define_insn "insvsi"
3664 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3665 (match_operand:SI 1 "const_int_operand" "i")
3666 (match_operand:SI 2 "const_int_operand" "i"))
3667 (match_operand:SI 3 "gpc_reg_operand" "r"))]
3671 int start = INTVAL (operands[2]) & 31;
3672 int size = INTVAL (operands[1]) & 31;
3674 operands[4] = GEN_INT (32 - start - size);
3675 operands[1] = GEN_INT (start + size - 1);
3676 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3679 (define_insn "*insvsi_internal1"
3680 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3681 (match_operand:SI 1 "const_int_operand" "i")
3682 (match_operand:SI 2 "const_int_operand" "i"))
3683 (ashift:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3684 (match_operand:SI 4 "const_int_operand" "i")))]
3685 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3688 int shift = INTVAL (operands[4]) & 31;
3689 int start = INTVAL (operands[2]) & 31;
3690 int size = INTVAL (operands[1]) & 31;
3692 operands[4] = GEN_INT (shift - start - size);
3693 operands[1] = GEN_INT (start + size - 1);
3694 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3697 (define_insn "*insvsi_internal2"
3698 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3699 (match_operand:SI 1 "const_int_operand" "i")
3700 (match_operand:SI 2 "const_int_operand" "i"))
3701 (ashiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3702 (match_operand:SI 4 "const_int_operand" "i")))]
3703 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3706 int shift = INTVAL (operands[4]) & 31;
3707 int start = INTVAL (operands[2]) & 31;
3708 int size = INTVAL (operands[1]) & 31;
3710 operands[4] = GEN_INT (32 - shift - start - size);
3711 operands[1] = GEN_INT (start + size - 1);
3712 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3715 (define_insn "*insvsi_internal3"
3716 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3717 (match_operand:SI 1 "const_int_operand" "i")
3718 (match_operand:SI 2 "const_int_operand" "i"))
3719 (lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3720 (match_operand:SI 4 "const_int_operand" "i")))]
3721 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3724 int shift = INTVAL (operands[4]) & 31;
3725 int start = INTVAL (operands[2]) & 31;
3726 int size = INTVAL (operands[1]) & 31;
3728 operands[4] = GEN_INT (32 - shift - start - size);
3729 operands[1] = GEN_INT (start + size - 1);
3730 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3733 (define_insn "*insvsi_internal4"
3734 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3735 (match_operand:SI 1 "const_int_operand" "i")
3736 (match_operand:SI 2 "const_int_operand" "i"))
3737 (zero_extract:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3738 (match_operand:SI 4 "const_int_operand" "i")
3739 (match_operand:SI 5 "const_int_operand" "i")))]
3740 "INTVAL (operands[4]) >= INTVAL (operands[1])"
3743 int extract_start = INTVAL (operands[5]) & 31;
3744 int extract_size = INTVAL (operands[4]) & 31;
3745 int insert_start = INTVAL (operands[2]) & 31;
3746 int insert_size = INTVAL (operands[1]) & 31;
3748 /* Align extract field with insert field */
3749 operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
3750 operands[1] = GEN_INT (insert_start + insert_size - 1);
3751 return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
3754 (define_insn "insvdi"
3755 [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
3756 (match_operand:SI 1 "const_int_operand" "i")
3757 (match_operand:SI 2 "const_int_operand" "i"))
3758 (match_operand:DI 3 "gpc_reg_operand" "r"))]
3762 int start = INTVAL (operands[2]) & 63;
3763 int size = INTVAL (operands[1]) & 63;
3765 operands[1] = GEN_INT (64 - start - size);
3766 return \"rldimi %0,%3,%H1,%H2\";
3769 (define_expand "extzv"
3770 [(set (match_operand 0 "gpc_reg_operand" "")
3771 (zero_extract (match_operand 1 "gpc_reg_operand" "")
3772 (match_operand:SI 2 "const_int_operand" "")
3773 (match_operand:SI 3 "const_int_operand" "")))]
3777 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3778 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3779 compiler if the address of the structure is taken later. */
3780 if (GET_CODE (operands[0]) == SUBREG
3781 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3784 if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
3785 emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
3787 emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
3791 (define_insn "extzvsi"
3792 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3793 (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3794 (match_operand:SI 2 "const_int_operand" "i")
3795 (match_operand:SI 3 "const_int_operand" "i")))]
3799 int start = INTVAL (operands[3]) & 31;
3800 int size = INTVAL (operands[2]) & 31;
3802 if (start + size >= 32)
3803 operands[3] = const0_rtx;
3805 operands[3] = GEN_INT (start + size);
3806 return \"{rlinm|rlwinm} %0,%1,%3,%s2,31\";
3809 (define_insn "*extzvsi_internal1"
3810 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3811 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3812 (match_operand:SI 2 "const_int_operand" "i,i")
3813 (match_operand:SI 3 "const_int_operand" "i,i"))
3815 (clobber (match_scratch:SI 4 "=r,r"))]
3819 int start = INTVAL (operands[3]) & 31;
3820 int size = INTVAL (operands[2]) & 31;
3822 /* Force split for non-cc0 compare. */
3823 if (which_alternative == 1)
3826 /* If the bit-field being tested fits in the upper or lower half of a
3827 word, it is possible to use andiu. or andil. to test it. This is
3828 useful because the condition register set-use delay is smaller for
3829 andi[ul]. than for rlinm. This doesn't work when the starting bit
3830 position is 0 because the LT and GT bits may be set wrong. */
3832 if ((start > 0 && start + size <= 16) || start >= 16)
3834 operands[3] = GEN_INT (((1 << (16 - (start & 15)))
3835 - (1 << (16 - (start & 15) - size))));
3837 return \"{andiu.|andis.} %4,%1,%3\";
3839 return \"{andil.|andi.} %4,%1,%3\";
3842 if (start + size >= 32)
3843 operands[3] = const0_rtx;
3845 operands[3] = GEN_INT (start + size);
3846 return \"{rlinm.|rlwinm.} %4,%1,%3,%s2,31\";
3848 [(set_attr "type" "compare")
3849 (set_attr "length" "4,8")])
3852 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3853 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3854 (match_operand:SI 2 "const_int_operand" "")
3855 (match_operand:SI 3 "const_int_operand" ""))
3857 (clobber (match_scratch:SI 4 ""))]
3860 (zero_extract:SI (match_dup 1) (match_dup 2)
3863 (compare:CC (match_dup 4)
3867 (define_insn "*extzvsi_internal2"
3868 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3869 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3870 (match_operand:SI 2 "const_int_operand" "i,i")
3871 (match_operand:SI 3 "const_int_operand" "i,i"))
3873 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3874 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3878 int start = INTVAL (operands[3]) & 31;
3879 int size = INTVAL (operands[2]) & 31;
3881 /* Force split for non-cc0 compare. */
3882 if (which_alternative == 1)
3885 /* Since we are using the output value, we can't ignore any need for
3886 a shift. The bit-field must end at the LSB. */
3887 if (start >= 16 && start + size == 32)
3889 operands[3] = GEN_INT ((1 << size) - 1);
3890 return \"{andil.|andi.} %0,%1,%3\";
3893 if (start + size >= 32)
3894 operands[3] = const0_rtx;
3896 operands[3] = GEN_INT (start + size);
3897 return \"{rlinm.|rlwinm.} %0,%1,%3,%s2,31\";
3899 [(set_attr "type" "compare")
3900 (set_attr "length" "4,8")])
3903 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3904 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3905 (match_operand:SI 2 "const_int_operand" "")
3906 (match_operand:SI 3 "const_int_operand" ""))
3908 (set (match_operand:SI 0 "gpc_reg_operand" "")
3909 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3912 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))
3914 (compare:CC (match_dup 0)
3918 (define_insn "extzvdi"
3919 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
3920 (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3921 (match_operand:SI 2 "const_int_operand" "i")
3922 (match_operand:SI 3 "const_int_operand" "i")))]
3926 int start = INTVAL (operands[3]) & 63;
3927 int size = INTVAL (operands[2]) & 63;
3929 if (start + size >= 64)
3930 operands[3] = const0_rtx;
3932 operands[3] = GEN_INT (start + size);
3933 operands[2] = GEN_INT (64 - size);
3934 return \"rldicl %0,%1,%3,%2\";
3937 (define_insn "*extzvdi_internal1"
3938 [(set (match_operand:CC 0 "gpc_reg_operand" "=x")
3939 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3940 (match_operand:SI 2 "const_int_operand" "i")
3941 (match_operand:SI 3 "const_int_operand" "i"))
3943 (clobber (match_scratch:DI 4 "=r"))]
3947 int start = INTVAL (operands[3]) & 63;
3948 int size = INTVAL (operands[2]) & 63;
3950 if (start + size >= 64)
3951 operands[3] = const0_rtx;
3953 operands[3] = GEN_INT (start + size);
3954 operands[2] = GEN_INT (64 - size);
3955 return \"rldicl. %4,%1,%3,%2\";
3958 (define_insn "*extzvdi_internal2"
3959 [(set (match_operand:CC 4 "gpc_reg_operand" "=x")
3960 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3961 (match_operand:SI 2 "const_int_operand" "i")
3962 (match_operand:SI 3 "const_int_operand" "i"))
3964 (set (match_operand:DI 0 "gpc_reg_operand" "=r")
3965 (zero_extract:DI (match_dup 1) (match_dup 2) (match_dup 3)))]
3969 int start = INTVAL (operands[3]) & 63;
3970 int size = INTVAL (operands[2]) & 63;
3972 if (start + size >= 64)
3973 operands[3] = const0_rtx;
3975 operands[3] = GEN_INT (start + size);
3976 operands[2] = GEN_INT (64 - size);
3977 return \"rldicl. %0,%1,%3,%2\";
3980 (define_insn "rotlsi3"
3981 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3982 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3983 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
3985 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffffffff")
3987 (define_insn "*rotlsi3_internal2"
3988 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3989 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3990 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3992 (clobber (match_scratch:SI 3 "=r,r"))]
3995 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffffffff
3997 [(set_attr "type" "delayed_compare")
3998 (set_attr "length" "4,8")])
4001 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4002 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4003 (match_operand:SI 2 "reg_or_cint_operand" ""))
4005 (clobber (match_scratch:SI 3 ""))]
4008 (rotate:SI (match_dup 1) (match_dup 2)))
4010 (compare:CC (match_dup 3)
4014 (define_insn "*rotlsi3_internal3"
4015 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4016 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4017 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4019 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4020 (rotate:SI (match_dup 1) (match_dup 2)))]
4023 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffffffff
4025 [(set_attr "type" "delayed_compare")
4026 (set_attr "length" "4,8")])
4029 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4030 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4031 (match_operand:SI 2 "reg_or_cint_operand" ""))
4033 (set (match_operand:SI 0 "gpc_reg_operand" "")
4034 (rotate:SI (match_dup 1) (match_dup 2)))]
4037 (rotate:SI (match_dup 1) (match_dup 2)))
4039 (compare:CC (match_dup 0)
4043 (define_insn "*rotlsi3_internal4"
4044 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4045 (and:SI (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4046 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
4047 (match_operand:SI 3 "mask_operand" "n")))]
4049 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,%m3,%M3")
4051 (define_insn "*rotlsi3_internal5"
4052 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4054 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4055 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4056 (match_operand:SI 3 "mask_operand" "n,n"))
4058 (clobber (match_scratch:SI 4 "=r,r"))]
4061 {rl%I2nm.|rlw%I2nm.} %4,%1,%h2,%m3,%M3
4063 [(set_attr "type" "delayed_compare")
4064 (set_attr "length" "4,8")])
4067 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4069 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4070 (match_operand:SI 2 "reg_or_cint_operand" ""))
4071 (match_operand:SI 3 "mask_operand" ""))
4073 (clobber (match_scratch:SI 4 ""))]
4076 (and:SI (rotate:SI (match_dup 1)
4080 (compare:CC (match_dup 4)
4084 (define_insn "*rotlsi3_internal6"
4085 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4087 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4088 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4089 (match_operand:SI 3 "mask_operand" "n,n"))
4091 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4092 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4095 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,%m3,%M3
4097 [(set_attr "type" "delayed_compare")
4098 (set_attr "length" "4,8")])
4101 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4103 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4104 (match_operand:SI 2 "reg_or_cint_operand" ""))
4105 (match_operand:SI 3 "mask_operand" ""))
4107 (set (match_operand:SI 0 "gpc_reg_operand" "")
4108 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4111 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4113 (compare:CC (match_dup 0)
4117 (define_insn "*rotlsi3_internal7"
4118 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4121 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4122 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
4124 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xff")
4126 (define_insn "*rotlsi3_internal8"
4127 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4128 (compare:CC (zero_extend:SI
4130 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4131 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
4133 (clobber (match_scratch:SI 3 "=r,r"))]
4136 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xff
4138 [(set_attr "type" "delayed_compare")
4139 (set_attr "length" "4,8")])
4142 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4143 (compare:CC (zero_extend:SI
4145 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4146 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4148 (clobber (match_scratch:SI 3 ""))]
4151 (zero_extend:SI (subreg:QI
4152 (rotate:SI (match_dup 1)
4155 (compare:CC (match_dup 3)
4159 (define_insn "*rotlsi3_internal9"
4160 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4161 (compare:CC (zero_extend:SI
4163 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4164 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
4166 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4167 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4170 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xff
4172 [(set_attr "type" "delayed_compare")
4173 (set_attr "length" "4,8")])
4176 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4177 (compare:CC (zero_extend:SI
4179 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4180 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4182 (set (match_operand:SI 0 "gpc_reg_operand" "")
4183 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4186 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
4188 (compare:CC (match_dup 0)
4192 (define_insn "*rotlsi3_internal10"
4193 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4196 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4197 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
4199 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffff")
4201 (define_insn "*rotlsi3_internal11"
4202 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4203 (compare:CC (zero_extend:SI
4205 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4206 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
4208 (clobber (match_scratch:SI 3 "=r,r"))]
4211 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffff
4213 [(set_attr "type" "delayed_compare")
4214 (set_attr "length" "4,8")])
4217 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4218 (compare:CC (zero_extend:SI
4220 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4221 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4223 (clobber (match_scratch:SI 3 ""))]
4226 (zero_extend:SI (subreg:HI
4227 (rotate:SI (match_dup 1)
4230 (compare:CC (match_dup 3)
4234 (define_insn "*rotlsi3_internal12"
4235 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4236 (compare:CC (zero_extend:SI
4238 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4239 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
4241 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4242 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4245 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffff
4247 [(set_attr "type" "delayed_compare")
4248 (set_attr "length" "4,8")])
4251 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4252 (compare:CC (zero_extend:SI
4254 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4255 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4257 (set (match_operand:SI 0 "gpc_reg_operand" "")
4258 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4261 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
4263 (compare:CC (match_dup 0)
4267 ;; Note that we use "sle." instead of "sl." so that we can set
4268 ;; SHIFT_COUNT_TRUNCATED.
4270 (define_expand "ashlsi3"
4271 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
4272 (use (match_operand:SI 1 "gpc_reg_operand" ""))
4273 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
4278 emit_insn (gen_ashlsi3_power (operands[0], operands[1], operands[2]));
4280 emit_insn (gen_ashlsi3_no_power (operands[0], operands[1], operands[2]));
4284 (define_insn "ashlsi3_power"
4285 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4286 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4287 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
4288 (clobber (match_scratch:SI 3 "=q,X"))]
4292 {sli|slwi} %0,%1,%h2")
4294 (define_insn "ashlsi3_no_power"
4295 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4296 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4297 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4299 "{sl|slw}%I2 %0,%1,%h2")
4302 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4303 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4304 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4306 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4307 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4311 {sli.|slwi.} %3,%1,%h2
4314 [(set_attr "type" "delayed_compare")
4315 (set_attr "length" "4,4,8,8")])
4318 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4319 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4320 (match_operand:SI 2 "reg_or_cint_operand" ""))
4322 (clobber (match_scratch:SI 3 ""))
4323 (clobber (match_scratch:SI 4 ""))]
4324 "TARGET_POWER && reload_completed"
4325 [(parallel [(set (match_dup 3)
4326 (ashift:SI (match_dup 1) (match_dup 2)))
4327 (clobber (match_dup 4))])
4329 (compare:CC (match_dup 3)
4334 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4335 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4336 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4338 (clobber (match_scratch:SI 3 "=r,r"))]
4339 "! TARGET_POWER && ! TARGET_POWERPC64"
4341 {sl|slw}%I2. %3,%1,%h2
4343 [(set_attr "type" "delayed_compare")
4344 (set_attr "length" "4,8")])
4347 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4348 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4349 (match_operand:SI 2 "reg_or_cint_operand" ""))
4351 (clobber (match_scratch:SI 3 ""))]
4352 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4354 (ashift:SI (match_dup 1) (match_dup 2)))
4356 (compare:CC (match_dup 3)
4361 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4362 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4363 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4365 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4366 (ashift:SI (match_dup 1) (match_dup 2)))
4367 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4371 {sli.|slwi.} %0,%1,%h2
4374 [(set_attr "type" "delayed_compare")
4375 (set_attr "length" "4,4,8,8")])
4378 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4379 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4380 (match_operand:SI 2 "reg_or_cint_operand" ""))
4382 (set (match_operand:SI 0 "gpc_reg_operand" "")
4383 (ashift:SI (match_dup 1) (match_dup 2)))
4384 (clobber (match_scratch:SI 4 ""))]
4385 "TARGET_POWER && reload_completed"
4386 [(parallel [(set (match_dup 0)
4387 (ashift:SI (match_dup 1) (match_dup 2)))
4388 (clobber (match_dup 4))])
4390 (compare:CC (match_dup 0)
4395 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4396 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4397 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4399 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4400 (ashift:SI (match_dup 1) (match_dup 2)))]
4401 "! TARGET_POWER && ! TARGET_POWERPC64"
4403 {sl|slw}%I2. %0,%1,%h2
4405 [(set_attr "type" "delayed_compare")
4406 (set_attr "length" "4,8")])
4409 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4410 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4411 (match_operand:SI 2 "reg_or_cint_operand" ""))
4413 (set (match_operand:SI 0 "gpc_reg_operand" "")
4414 (ashift:SI (match_dup 1) (match_dup 2)))]
4415 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4417 (ashift:SI (match_dup 1) (match_dup 2)))
4419 (compare:CC (match_dup 0)
4424 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4425 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4426 (match_operand:SI 2 "const_int_operand" "i"))
4427 (match_operand:SI 3 "mask_operand" "n")))]
4428 "includes_lshift_p (operands[2], operands[3])"
4429 "{rlinm|rlwinm} %0,%1,%h2,%m3,%M3")
4432 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4434 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4435 (match_operand:SI 2 "const_int_operand" "i,i"))
4436 (match_operand:SI 3 "mask_operand" "n,n"))
4438 (clobber (match_scratch:SI 4 "=r,r"))]
4439 "includes_lshift_p (operands[2], operands[3])"
4441 {rlinm.|rlwinm.} %4,%1,%h2,%m3,%M3
4443 [(set_attr "type" "delayed_compare")
4444 (set_attr "length" "4,8")])
4447 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4449 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4450 (match_operand:SI 2 "const_int_operand" ""))
4451 (match_operand:SI 3 "mask_operand" ""))
4453 (clobber (match_scratch:SI 4 ""))]
4454 "includes_lshift_p (operands[2], operands[3]) && reload_completed"
4456 (and:SI (ashift:SI (match_dup 1) (match_dup 2))
4459 (compare:CC (match_dup 4)
4464 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4466 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4467 (match_operand:SI 2 "const_int_operand" "i,i"))
4468 (match_operand:SI 3 "mask_operand" "n,n"))
4470 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4471 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4472 "includes_lshift_p (operands[2], operands[3])"
4474 {rlinm.|rlwinm.} %0,%1,%h2,%m3,%M3
4476 [(set_attr "type" "delayed_compare")
4477 (set_attr "length" "4,8")])
4480 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4482 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4483 (match_operand:SI 2 "const_int_operand" ""))
4484 (match_operand:SI 3 "mask_operand" ""))
4486 (set (match_operand:SI 0 "gpc_reg_operand" "")
4487 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4488 "includes_lshift_p (operands[2], operands[3]) && reload_completed"
4490 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4492 (compare:CC (match_dup 0)
4496 ;; The AIX assembler mis-handles "sri x,x,0", so write that case as
4498 (define_expand "lshrsi3"
4499 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
4500 (use (match_operand:SI 1 "gpc_reg_operand" ""))
4501 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
4506 emit_insn (gen_lshrsi3_power (operands[0], operands[1], operands[2]));
4508 emit_insn (gen_lshrsi3_no_power (operands[0], operands[1], operands[2]));
4512 (define_insn "lshrsi3_power"
4513 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
4514 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
4515 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i")))
4516 (clobber (match_scratch:SI 3 "=q,X,X"))]
4521 {s%A2i|s%A2wi} %0,%1,%h2")
4523 (define_insn "lshrsi3_no_power"
4524 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4525 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4526 (match_operand:SI 2 "reg_or_cint_operand" "O,ri")))]
4530 {sr|srw}%I2 %0,%1,%h2")
4533 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4534 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4535 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4537 (clobber (match_scratch:SI 3 "=r,X,r,r,X,r"))
4538 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4543 {s%A2i.|s%A2wi.} %3,%1,%h2
4547 [(set_attr "type" "delayed_compare")
4548 (set_attr "length" "4,4,4,8,8,8")])
4551 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4552 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4553 (match_operand:SI 2 "reg_or_cint_operand" ""))
4555 (clobber (match_scratch:SI 3 ""))
4556 (clobber (match_scratch:SI 4 ""))]
4557 "TARGET_POWER && reload_completed"
4558 [(parallel [(set (match_dup 3)
4559 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4560 (clobber (match_dup 4))])
4562 (compare:CC (match_dup 3)
4567 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4568 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4569 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4571 (clobber (match_scratch:SI 3 "=X,r,X,r"))]
4572 "! TARGET_POWER && ! TARGET_POWERPC64"
4575 {sr|srw}%I2. %3,%1,%h2
4578 [(set_attr "type" "delayed_compare")
4579 (set_attr "length" "4,4,8,8")])
4582 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4583 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4584 (match_operand:SI 2 "reg_or_cint_operand" ""))
4586 (clobber (match_scratch:SI 3 ""))]
4587 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4589 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4591 (compare:CC (match_dup 3)
4596 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4597 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4598 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4600 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r")
4601 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4602 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4607 {s%A2i.|s%A2wi.} %0,%1,%h2
4611 [(set_attr "type" "delayed_compare")
4612 (set_attr "length" "4,4,4,8,8,8")])
4615 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4616 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4617 (match_operand:SI 2 "reg_or_cint_operand" ""))
4619 (set (match_operand:SI 0 "gpc_reg_operand" "")
4620 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4621 (clobber (match_scratch:SI 4 ""))]
4622 "TARGET_POWER && reload_completed"
4623 [(parallel [(set (match_dup 0)
4624 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4625 (clobber (match_dup 4))])
4627 (compare:CC (match_dup 0)
4632 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4633 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4634 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4636 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4637 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4638 "! TARGET_POWER && ! TARGET_POWERPC64"
4641 {sr|srw}%I2. %0,%1,%h2
4644 [(set_attr "type" "delayed_compare")
4645 (set_attr "length" "4,4,8,8")])
4648 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4649 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4650 (match_operand:SI 2 "reg_or_cint_operand" ""))
4652 (set (match_operand:SI 0 "gpc_reg_operand" "")
4653 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4654 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4656 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4658 (compare:CC (match_dup 0)
4663 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4664 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4665 (match_operand:SI 2 "const_int_operand" "i"))
4666 (match_operand:SI 3 "mask_operand" "n")))]
4667 "includes_rshift_p (operands[2], operands[3])"
4668 "{rlinm|rlwinm} %0,%1,%s2,%m3,%M3")
4671 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4673 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4674 (match_operand:SI 2 "const_int_operand" "i,i"))
4675 (match_operand:SI 3 "mask_operand" "n,n"))
4677 (clobber (match_scratch:SI 4 "=r,r"))]
4678 "includes_rshift_p (operands[2], operands[3])"
4680 {rlinm.|rlwinm.} %4,%1,%s2,%m3,%M3
4682 [(set_attr "type" "delayed_compare")
4683 (set_attr "length" "4,8")])
4686 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4688 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4689 (match_operand:SI 2 "const_int_operand" ""))
4690 (match_operand:SI 3 "mask_operand" ""))
4692 (clobber (match_scratch:SI 4 ""))]
4693 "includes_rshift_p (operands[2], operands[3]) && reload_completed"
4695 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2))
4698 (compare:CC (match_dup 4)
4703 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4705 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4706 (match_operand:SI 2 "const_int_operand" "i,i"))
4707 (match_operand:SI 3 "mask_operand" "n,n"))
4709 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4710 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4711 "includes_rshift_p (operands[2], operands[3])"
4713 {rlinm.|rlwinm.} %0,%1,%s2,%m3,%M3
4715 [(set_attr "type" "delayed_compare")
4716 (set_attr "length" "4,8")])
4719 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4721 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4722 (match_operand:SI 2 "const_int_operand" ""))
4723 (match_operand:SI 3 "mask_operand" ""))
4725 (set (match_operand:SI 0 "gpc_reg_operand" "")
4726 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4727 "includes_rshift_p (operands[2], operands[3]) && reload_completed"
4729 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4731 (compare:CC (match_dup 0)
4736 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4739 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4740 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4741 "includes_rshift_p (operands[2], GEN_INT (255))"
4742 "{rlinm|rlwinm} %0,%1,%s2,0xff")
4745 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4749 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4750 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4752 (clobber (match_scratch:SI 3 "=r,r"))]
4753 "includes_rshift_p (operands[2], GEN_INT (255))"
4755 {rlinm.|rlwinm.} %3,%1,%s2,0xff
4757 [(set_attr "type" "delayed_compare")
4758 (set_attr "length" "4,8")])
4761 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4765 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4766 (match_operand:SI 2 "const_int_operand" "")) 0))
4768 (clobber (match_scratch:SI 3 ""))]
4769 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4771 (zero_extend:SI (subreg:QI
4772 (lshiftrt:SI (match_dup 1)
4775 (compare:CC (match_dup 3)
4780 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4784 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4785 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4787 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4788 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4789 "includes_rshift_p (operands[2], GEN_INT (255))"
4791 {rlinm.|rlwinm.} %0,%1,%s2,0xff
4793 [(set_attr "type" "delayed_compare")
4794 (set_attr "length" "4,8")])
4797 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4801 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4802 (match_operand:SI 2 "const_int_operand" "")) 0))
4804 (set (match_operand:SI 0 "gpc_reg_operand" "")
4805 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4806 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4808 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4810 (compare:CC (match_dup 0)
4815 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4818 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4819 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4820 "includes_rshift_p (operands[2], GEN_INT (65535))"
4821 "{rlinm|rlwinm} %0,%1,%s2,0xffff")
4824 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4828 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4829 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4831 (clobber (match_scratch:SI 3 "=r,r"))]
4832 "includes_rshift_p (operands[2], GEN_INT (65535))"
4834 {rlinm.|rlwinm.} %3,%1,%s2,0xffff
4836 [(set_attr "type" "delayed_compare")
4837 (set_attr "length" "4,8")])
4840 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4844 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4845 (match_operand:SI 2 "const_int_operand" "")) 0))
4847 (clobber (match_scratch:SI 3 ""))]
4848 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4850 (zero_extend:SI (subreg:HI
4851 (lshiftrt:SI (match_dup 1)
4854 (compare:CC (match_dup 3)
4859 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4863 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4864 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4866 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4867 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4868 "includes_rshift_p (operands[2], GEN_INT (65535))"
4870 {rlinm.|rlwinm.} %0,%1,%s2,0xffff
4872 [(set_attr "type" "delayed_compare")
4873 (set_attr "length" "4,8")])
4876 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4880 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4881 (match_operand:SI 2 "const_int_operand" "")) 0))
4883 (set (match_operand:SI 0 "gpc_reg_operand" "")
4884 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4885 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4887 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4889 (compare:CC (match_dup 0)
4894 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4896 (match_operand:SI 1 "gpc_reg_operand" "r"))
4897 (ashiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4903 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4905 (match_operand:SI 1 "gpc_reg_operand" "r"))
4906 (lshiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4912 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4914 (match_operand:SI 1 "gpc_reg_operand" "r"))
4915 (zero_extract:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4921 (define_expand "ashrsi3"
4922 [(set (match_operand:SI 0 "gpc_reg_operand" "")
4923 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4924 (match_operand:SI 2 "reg_or_cint_operand" "")))]
4929 emit_insn (gen_ashrsi3_power (operands[0], operands[1], operands[2]));
4931 emit_insn (gen_ashrsi3_no_power (operands[0], operands[1], operands[2]));
4935 (define_insn "ashrsi3_power"
4936 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4937 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4938 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
4939 (clobber (match_scratch:SI 3 "=q,X"))]
4943 {srai|srawi} %0,%1,%h2")
4945 (define_insn "ashrsi3_no_power"
4946 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4947 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4948 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4950 "{sra|sraw}%I2 %0,%1,%h2")
4953 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4954 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4955 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4957 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4958 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4962 {srai.|srawi.} %3,%1,%h2
4965 [(set_attr "type" "delayed_compare")
4966 (set_attr "length" "4,4,8,8")])
4969 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4970 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4971 (match_operand:SI 2 "reg_or_cint_operand" ""))
4973 (clobber (match_scratch:SI 3 ""))
4974 (clobber (match_scratch:SI 4 ""))]
4975 "TARGET_POWER && reload_completed"
4976 [(parallel [(set (match_dup 3)
4977 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4978 (clobber (match_dup 4))])
4980 (compare:CC (match_dup 3)
4985 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4986 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4987 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4989 (clobber (match_scratch:SI 3 "=r,r"))]
4992 {sra|sraw}%I2. %3,%1,%h2
4994 [(set_attr "type" "delayed_compare")
4995 (set_attr "length" "4,8")])
4998 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4999 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
5000 (match_operand:SI 2 "reg_or_cint_operand" ""))
5002 (clobber (match_scratch:SI 3 ""))]
5003 "! TARGET_POWER && reload_completed"
5005 (ashiftrt:SI (match_dup 1) (match_dup 2)))
5007 (compare:CC (match_dup 3)
5012 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
5013 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
5014 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
5016 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
5017 (ashiftrt:SI (match_dup 1) (match_dup 2)))
5018 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
5022 {srai.|srawi.} %0,%1,%h2
5025 [(set_attr "type" "delayed_compare")
5026 (set_attr "length" "4,4,8,8")])
5029 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
5030 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
5031 (match_operand:SI 2 "reg_or_cint_operand" ""))
5033 (set (match_operand:SI 0 "gpc_reg_operand" "")
5034 (ashiftrt:SI (match_dup 1) (match_dup 2)))
5035 (clobber (match_scratch:SI 4 ""))]
5036 "TARGET_POWER && reload_completed"
5037 [(parallel [(set (match_dup 0)
5038 (ashiftrt:SI (match_dup 1) (match_dup 2)))
5039 (clobber (match_dup 4))])
5041 (compare:CC (match_dup 0)
5046 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
5047 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
5048 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
5050 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
5051 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
5054 {sra|sraw}%I2. %0,%1,%h2
5056 [(set_attr "type" "delayed_compare")
5057 (set_attr "length" "4,8")])
5060 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
5061 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
5062 (match_operand:SI 2 "reg_or_cint_operand" ""))
5064 (set (match_operand:SI 0 "gpc_reg_operand" "")
5065 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
5066 "! TARGET_POWER && reload_completed"
5068 (ashiftrt:SI (match_dup 1) (match_dup 2)))
5070 (compare:CC (match_dup 0)
5074 ;; Floating-point insns, excluding normal data motion.
5076 ;; PowerPC has a full set of single-precision floating point instructions.
5078 ;; For the POWER architecture, we pretend that we have both SFmode and
5079 ;; DFmode insns, while, in fact, all fp insns are actually done in double.
5080 ;; The only conversions we will do will be when storing to memory. In that
5081 ;; case, we will use the "frsp" instruction before storing.
5083 ;; Note that when we store into a single-precision memory location, we need to
5084 ;; use the frsp insn first. If the register being stored isn't dead, we
5085 ;; need a scratch register for the frsp. But this is difficult when the store
5086 ;; is done by reload. It is not incorrect to do the frsp on the register in
5087 ;; this case, we just lose precision that we would have otherwise gotten but
5088 ;; is not guaranteed. Perhaps this should be tightened up at some point.
5090 (define_insn "extendsfdf2"
5091 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5092 (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5093 "TARGET_HARD_FLOAT && TARGET_FPRS"
5096 if (REGNO (operands[0]) == REGNO (operands[1]))
5099 return \"fmr %0,%1\";
5101 [(set_attr "type" "fp")])
5103 (define_insn "truncdfsf2"
5104 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5105 (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5106 "TARGET_HARD_FLOAT && TARGET_FPRS"
5108 [(set_attr "type" "fp")])
5110 (define_insn "aux_truncdfsf2"
5111 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5112 (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] 0))]
5113 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5115 [(set_attr "type" "fp")])
5117 (define_expand "negsf2"
5118 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5119 (neg:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
5123 (define_insn "*negsf2"
5124 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5125 (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5126 "TARGET_HARD_FLOAT && TARGET_FPRS"
5128 [(set_attr "type" "fp")])
5130 (define_expand "abssf2"
5131 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5132 (abs:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
5136 (define_insn "*abssf2"
5137 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5138 (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5139 "TARGET_HARD_FLOAT && TARGET_FPRS"
5141 [(set_attr "type" "fp")])
5144 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5145 (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f"))))]
5146 "TARGET_HARD_FLOAT && TARGET_FPRS"
5148 [(set_attr "type" "fp")])
5150 (define_expand "addsf3"
5151 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5152 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "")
5153 (match_operand:SF 2 "gpc_reg_operand" "")))]
5158 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5159 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5160 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5161 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5163 [(set_attr "type" "fp")])
5166 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5167 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5168 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5169 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5170 "{fa|fadd} %0,%1,%2"
5171 [(set_attr "type" "fp")])
5173 (define_expand "subsf3"
5174 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5175 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
5176 (match_operand:SF 2 "gpc_reg_operand" "")))]
5181 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5182 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5183 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5184 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5186 [(set_attr "type" "fp")])
5189 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5190 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5191 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5192 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5193 "{fs|fsub} %0,%1,%2"
5194 [(set_attr "type" "fp")])
5196 (define_expand "mulsf3"
5197 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5198 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "")
5199 (match_operand:SF 2 "gpc_reg_operand" "")))]
5204 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5205 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5206 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5207 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5209 [(set_attr "type" "fp")])
5212 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5213 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5214 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5215 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5216 "{fm|fmul} %0,%1,%2"
5217 [(set_attr "type" "dmul")])
5219 (define_expand "divsf3"
5220 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5221 (div:SF (match_operand:SF 1 "gpc_reg_operand" "")
5222 (match_operand:SF 2 "gpc_reg_operand" "")))]
5227 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5228 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5229 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5230 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5232 [(set_attr "type" "sdiv")])
5235 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5236 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5237 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5238 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS"
5239 "{fd|fdiv} %0,%1,%2"
5240 [(set_attr "type" "ddiv")])
5243 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5244 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5245 (match_operand:SF 2 "gpc_reg_operand" "f"))
5246 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5247 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5248 "fmadds %0,%1,%2,%3"
5249 [(set_attr "type" "fp")])
5252 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5253 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5254 (match_operand:SF 2 "gpc_reg_operand" "f"))
5255 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5256 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5257 "{fma|fmadd} %0,%1,%2,%3"
5258 [(set_attr "type" "dmul")])
5261 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5262 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5263 (match_operand:SF 2 "gpc_reg_operand" "f"))
5264 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5265 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5266 "fmsubs %0,%1,%2,%3"
5267 [(set_attr "type" "fp")])
5270 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5271 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5272 (match_operand:SF 2 "gpc_reg_operand" "f"))
5273 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5274 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5275 "{fms|fmsub} %0,%1,%2,%3"
5276 [(set_attr "type" "dmul")])
5279 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5280 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5281 (match_operand:SF 2 "gpc_reg_operand" "f"))
5282 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5283 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5284 "fnmadds %0,%1,%2,%3"
5285 [(set_attr "type" "fp")])
5288 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5289 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5290 (match_operand:SF 2 "gpc_reg_operand" "f"))
5291 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5292 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5293 "{fnma|fnmadd} %0,%1,%2,%3"
5294 [(set_attr "type" "dmul")])
5297 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5298 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5299 (match_operand:SF 2 "gpc_reg_operand" "f"))
5300 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5301 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5302 "fnmsubs %0,%1,%2,%3"
5303 [(set_attr "type" "fp")])
5306 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5307 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5308 (match_operand:SF 2 "gpc_reg_operand" "f"))
5309 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5310 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5311 "{fnms|fnmsub} %0,%1,%2,%3"
5312 [(set_attr "type" "dmul")])
5314 (define_expand "sqrtsf2"
5315 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5316 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
5317 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT && TARGET_FPRS"
5321 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5322 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5323 "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5325 [(set_attr "type" "ssqrt")])
5328 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5329 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5330 "TARGET_POWER2 && TARGET_HARD_FLOAT && TARGET_FPRS"
5332 [(set_attr "type" "dsqrt")])
5334 ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
5335 ;; fsel instruction and some auxiliary computations. Then we just have a
5336 ;; single DEFINE_INSN for fsel and the define_splits to make them if made by
5338 (define_expand "maxsf3"
5339 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5340 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5341 (match_operand:SF 2 "gpc_reg_operand" ""))
5344 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5345 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5347 (define_expand "minsf3"
5348 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5349 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5350 (match_operand:SF 2 "gpc_reg_operand" ""))
5353 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5354 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5357 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5358 (match_operator:SF 3 "min_max_operator"
5359 [(match_operand:SF 1 "gpc_reg_operand" "")
5360 (match_operand:SF 2 "gpc_reg_operand" "")]))]
5361 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5364 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5365 operands[1], operands[2]);
5369 (define_expand "movsicc"
5370 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5371 (if_then_else:SI (match_operand 1 "comparison_operator" "")
5372 (match_operand:SI 2 "gpc_reg_operand" "")
5373 (match_operand:SI 3 "gpc_reg_operand" "")))]
5377 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5383 ;; We use the BASE_REGS for the isel input operands because, if rA is
5384 ;; 0, the value of 0 is placed in rD upon truth. Similarly for rB
5385 ;; because we may switch the operands and rB may end up being rA.
5387 ;; We need 2 patterns: an unsigned and a signed pattern. We could
5388 ;; leave out the mode in operand 4 and use one pattern, but reload can
5389 ;; change the mode underneath our feet and then gets confused trying
5390 ;; to reload the value.
5391 (define_insn "isel_signed"
5392 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5394 (match_operator 1 "comparison_operator"
5395 [(match_operand:CC 4 "cc_reg_operand" "y")
5397 (match_operand:SI 2 "gpc_reg_operand" "b")
5398 (match_operand:SI 3 "gpc_reg_operand" "b")))]
5401 { return output_isel (operands); }"
5402 [(set_attr "length" "4")])
5404 (define_insn "isel_unsigned"
5405 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5407 (match_operator 1 "comparison_operator"
5408 [(match_operand:CCUNS 4 "cc_reg_operand" "y")
5410 (match_operand:SI 2 "gpc_reg_operand" "b")
5411 (match_operand:SI 3 "gpc_reg_operand" "b")))]
5414 { return output_isel (operands); }"
5415 [(set_attr "length" "4")])
5417 (define_expand "movsfcc"
5418 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5419 (if_then_else:SF (match_operand 1 "comparison_operator" "")
5420 (match_operand:SF 2 "gpc_reg_operand" "")
5421 (match_operand:SF 3 "gpc_reg_operand" "")))]
5422 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5425 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5431 (define_insn "*fselsfsf4"
5432 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5433 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5434 (match_operand:SF 4 "zero_fp_constant" "F"))
5435 (match_operand:SF 2 "gpc_reg_operand" "f")
5436 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5437 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5439 [(set_attr "type" "fp")])
5441 (define_insn "*fseldfsf4"
5442 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5443 (if_then_else:SF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5444 (match_operand:DF 4 "zero_fp_constant" "F"))
5445 (match_operand:SF 2 "gpc_reg_operand" "f")
5446 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5447 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5449 [(set_attr "type" "fp")])
5451 (define_insn "negdf2"
5452 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5453 (neg:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5454 "TARGET_HARD_FLOAT && TARGET_FPRS"
5456 [(set_attr "type" "fp")])
5458 (define_insn "absdf2"
5459 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5460 (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5461 "TARGET_HARD_FLOAT && TARGET_FPRS"
5463 [(set_attr "type" "fp")])
5466 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5467 (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f"))))]
5468 "TARGET_HARD_FLOAT && TARGET_FPRS"
5470 [(set_attr "type" "fp")])
5472 (define_insn "adddf3"
5473 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5474 (plus:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5475 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5476 "TARGET_HARD_FLOAT && TARGET_FPRS"
5477 "{fa|fadd} %0,%1,%2"
5478 [(set_attr "type" "fp")])
5480 (define_insn "subdf3"
5481 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5482 (minus:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5483 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5484 "TARGET_HARD_FLOAT && TARGET_FPRS"
5485 "{fs|fsub} %0,%1,%2"
5486 [(set_attr "type" "fp")])
5488 (define_insn "muldf3"
5489 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5490 (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5491 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5492 "TARGET_HARD_FLOAT && TARGET_FPRS"
5493 "{fm|fmul} %0,%1,%2"
5494 [(set_attr "type" "dmul")])
5496 (define_insn "divdf3"
5497 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5498 (div:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5499 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5500 "TARGET_HARD_FLOAT && TARGET_FPRS"
5501 "{fd|fdiv} %0,%1,%2"
5502 [(set_attr "type" "ddiv")])
5505 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5506 (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5507 (match_operand:DF 2 "gpc_reg_operand" "f"))
5508 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5509 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5510 "{fma|fmadd} %0,%1,%2,%3"
5511 [(set_attr "type" "dmul")])
5514 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5515 (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5516 (match_operand:DF 2 "gpc_reg_operand" "f"))
5517 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5518 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5519 "{fms|fmsub} %0,%1,%2,%3"
5520 [(set_attr "type" "dmul")])
5523 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5524 (neg:DF (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5525 (match_operand:DF 2 "gpc_reg_operand" "f"))
5526 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5527 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5528 "{fnma|fnmadd} %0,%1,%2,%3"
5529 [(set_attr "type" "dmul")])
5532 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5533 (neg:DF (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5534 (match_operand:DF 2 "gpc_reg_operand" "f"))
5535 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5536 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
5537 "{fnms|fnmsub} %0,%1,%2,%3"
5538 [(set_attr "type" "dmul")])
5540 (define_insn "sqrtdf2"
5541 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5542 (sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5543 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT && TARGET_FPRS"
5545 [(set_attr "type" "dsqrt")])
5547 ;; The conditional move instructions allow us to perform max and min
5548 ;; operations even when
5550 (define_expand "maxdf3"
5551 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5552 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5553 (match_operand:DF 2 "gpc_reg_operand" ""))
5556 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5557 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5559 (define_expand "mindf3"
5560 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5561 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5562 (match_operand:DF 2 "gpc_reg_operand" ""))
5565 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5566 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5569 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5570 (match_operator:DF 3 "min_max_operator"
5571 [(match_operand:DF 1 "gpc_reg_operand" "")
5572 (match_operand:DF 2 "gpc_reg_operand" "")]))]
5573 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5576 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5577 operands[1], operands[2]);
5581 (define_expand "movdfcc"
5582 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5583 (if_then_else:DF (match_operand 1 "comparison_operator" "")
5584 (match_operand:DF 2 "gpc_reg_operand" "")
5585 (match_operand:DF 3 "gpc_reg_operand" "")))]
5586 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5589 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5595 (define_insn "*fseldfdf4"
5596 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5597 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5598 (match_operand:DF 4 "zero_fp_constant" "F"))
5599 (match_operand:DF 2 "gpc_reg_operand" "f")
5600 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5601 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT && TARGET_FPRS"
5603 [(set_attr "type" "fp")])
5605 (define_insn "*fselsfdf4"
5606 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5607 (if_then_else:DF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5608 (match_operand:SF 4 "zero_fp_constant" "F"))
5609 (match_operand:DF 2 "gpc_reg_operand" "f")
5610 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5613 [(set_attr "type" "fp")])
5615 ;; Conversions to and from floating-point.
5617 (define_expand "fixunssfsi2"
5618 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5619 (unsigned_fix:SI (fix:SF (match_operand:SF 1 "gpc_reg_operand" ""))))]
5620 "TARGET_HARD_FLOAT && !TARGET_FPRS"
5623 (define_expand "fix_truncsfsi2"
5624 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5625 (fix:SI (match_operand:SF 1 "gpc_reg_operand" "")))]
5626 "TARGET_HARD_FLOAT && !TARGET_FPRS"
5629 ; For each of these conversions, there is a define_expand, a define_insn
5630 ; with a '#' template, and a define_split (with C code). The idea is
5631 ; to allow constant folding with the template of the define_insn,
5632 ; then to have the insns split later (between sched1 and final).
5634 (define_expand "floatsidf2"
5635 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5636 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5639 (clobber (match_dup 4))
5640 (clobber (match_dup 5))
5641 (clobber (match_dup 6))])]
5642 "TARGET_HARD_FLOAT && TARGET_FPRS"
5645 if (TARGET_POWERPC64)
5647 rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5648 rtx t1 = gen_reg_rtx (DImode);
5649 rtx t2 = gen_reg_rtx (DImode);
5650 emit_insn (gen_floatsidf_ppc64 (operands[0], operands[1], mem, t1, t2));
5654 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5655 operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503601774854144\", DFmode));
5656 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5657 operands[5] = gen_reg_rtx (DFmode);
5658 operands[6] = gen_reg_rtx (SImode);
5661 (define_insn "*floatsidf2_internal"
5662 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5663 (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5664 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5665 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5666 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5667 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))
5668 (clobber (match_operand:SI 6 "gpc_reg_operand" "=r"))]
5669 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5671 [(set_attr "length" "24")])
5674 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5675 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5676 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5677 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5678 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5679 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5680 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5681 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5682 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5683 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5684 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5685 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5686 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5687 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5688 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5691 rtx lowword, highword;
5692 if (GET_CODE (operands[4]) != MEM)
5694 highword = XEXP (operands[4], 0);
5695 lowword = plus_constant (highword, 4);
5696 if (! WORDS_BIG_ENDIAN)
5699 tmp = highword; highword = lowword; lowword = tmp;
5702 emit_insn (gen_xorsi3 (operands[6], operands[1],
5703 GEN_INT (~ (HOST_WIDE_INT) 0x7fffffff)));
5704 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[6]);
5705 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5706 emit_move_insn (operands[5], operands[4]);
5707 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5711 (define_expand "floatunssisf2"
5712 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5713 (unsigned_float:SF (match_operand:SI 1 "gpc_reg_operand" "")))]
5714 "TARGET_HARD_FLOAT && !TARGET_FPRS"
5717 (define_expand "floatunssidf2"
5718 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5719 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5722 (clobber (match_dup 4))
5723 (clobber (match_dup 5))])]
5724 "TARGET_HARD_FLOAT && TARGET_FPRS"
5727 if (TARGET_POWERPC64)
5729 rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5730 rtx t1 = gen_reg_rtx (DImode);
5731 rtx t2 = gen_reg_rtx (DImode);
5732 emit_insn (gen_floatunssidf_ppc64 (operands[0], operands[1], mem,
5737 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5738 operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503599627370496\", DFmode));
5739 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5740 operands[5] = gen_reg_rtx (DFmode);
5743 (define_insn "*floatunssidf2_internal"
5744 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5745 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5746 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5747 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5748 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5749 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))]
5750 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5752 [(set_attr "length" "20")])
5755 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5756 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5757 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5758 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5759 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5760 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5761 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5762 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5763 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5764 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5765 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5766 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5767 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5770 rtx lowword, highword;
5771 if (GET_CODE (operands[4]) != MEM)
5773 highword = XEXP (operands[4], 0);
5774 lowword = plus_constant (highword, 4);
5775 if (! WORDS_BIG_ENDIAN)
5778 tmp = highword; highword = lowword; lowword = tmp;
5781 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[1]);
5782 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5783 emit_move_insn (operands[5], operands[4]);
5784 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5788 (define_expand "fix_truncdfsi2"
5789 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
5790 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5791 (clobber (match_dup 2))
5792 (clobber (match_dup 3))])]
5793 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS"
5796 operands[2] = gen_reg_rtx (DImode);
5797 operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5800 (define_insn "*fix_truncdfsi2_internal"
5801 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5802 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
5803 (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
5804 (clobber (match_operand:DI 3 "memory_operand" "=o"))]
5805 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS"
5807 [(set_attr "length" "16")])
5810 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5811 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5812 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5813 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5814 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS"
5815 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5816 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5817 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5818 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5822 if (GET_CODE (operands[3]) != MEM)
5824 lowword = XEXP (operands[3], 0);
5825 if (WORDS_BIG_ENDIAN)
5826 lowword = plus_constant (lowword, 4);
5828 emit_insn (gen_fctiwz (operands[2], operands[1]));
5829 emit_move_insn (operands[3], operands[2]);
5830 emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword));
5834 ; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] 10))
5835 ; rather than (set (subreg:SI (reg)) (fix:SI ...))
5836 ; because the first makes it clear that operand 0 is not live
5837 ; before the instruction.
5838 (define_insn "fctiwz"
5839 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
5840 (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] 10))]
5841 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS"
5842 "{fcirz|fctiwz} %0,%1"
5843 [(set_attr "type" "fp")])
5845 (define_expand "floatsisf2"
5846 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5847 (float:SF (match_operand:SI 1 "gpc_reg_operand" "")))]
5848 "TARGET_HARD_FLOAT && !TARGET_FPRS"
5851 (define_insn "floatdidf2"
5852 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5853 (float:DF (match_operand:DI 1 "gpc_reg_operand" "*f")))]
5854 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5856 [(set_attr "type" "fp")])
5858 (define_insn_and_split "floatsidf_ppc64"
5859 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5860 (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5861 (clobber (match_operand:DI 2 "memory_operand" "=o"))
5862 (clobber (match_operand:DI 3 "gpc_reg_operand" "=r"))
5863 (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))]
5864 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5867 [(set (match_dup 3) (sign_extend:DI (match_dup 1)))
5868 (set (match_dup 2) (match_dup 3))
5869 (set (match_dup 4) (match_dup 2))
5870 (set (match_dup 0) (float:DF (match_dup 4)))]
5873 (define_insn_and_split "floatunssidf_ppc64"
5874 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5875 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5876 (clobber (match_operand:DI 2 "memory_operand" "=o"))
5877 (clobber (match_operand:DI 3 "gpc_reg_operand" "=r"))
5878 (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))]
5879 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5882 [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
5883 (set (match_dup 2) (match_dup 3))
5884 (set (match_dup 4) (match_dup 2))
5885 (set (match_dup 0) (float:DF (match_dup 4)))]
5888 (define_insn "fix_truncdfdi2"
5889 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
5890 (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
5891 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5893 [(set_attr "type" "fp")])
5895 (define_expand "floatdisf2"
5896 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5897 (float:SF (match_operand:DI 1 "gpc_reg_operand" "")))]
5898 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5901 if (!flag_unsafe_math_optimizations)
5903 rtx label = gen_label_rtx ();
5904 emit_insn (gen_floatdisf2_internal2 (operands[1], label));
5907 emit_insn (gen_floatdisf2_internal1 (operands[0], operands[1]));
5911 ;; This is not IEEE compliant if rounding mode is "round to nearest".
5912 ;; If the DI->DF conversion is inexact, then it's possible to suffer
5913 ;; from double rounding.
5914 (define_insn_and_split "floatdisf2_internal1"
5915 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5916 (float:SF (match_operand:DI 1 "gpc_reg_operand" "*f")))
5917 (clobber (match_scratch:DF 2 "=f"))]
5918 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5920 "&& reload_completed"
5922 (float:DF (match_dup 1)))
5924 (float_truncate:SF (match_dup 2)))]
5927 ;; Twiddles bits to avoid double rounding.
5928 ;; Bits that might be trucated when converting to DFmode are replaced
5929 ;; by a bit that won't be lost at that stage, but is below the SFmode
5930 ;; rounding position.
5931 (define_expand "floatdisf2_internal2"
5932 [(parallel [(set (match_dup 4)
5933 (compare:CC (and:DI (match_operand:DI 0 "" "")
5936 (set (match_dup 2) (and:DI (match_dup 0) (const_int 2047)))
5937 (clobber (match_scratch:CC 7 ""))])
5938 (set (match_dup 3) (ashiftrt:DI (match_dup 0) (const_int 53)))
5939 (set (match_dup 3) (plus:DI (match_dup 3) (const_int 1)))
5940 (set (pc) (if_then_else (eq (match_dup 4) (const_int 0))
5941 (label_ref (match_operand:DI 1 "" ""))
5943 (set (match_dup 5) (compare:CCUNS (match_dup 3) (const_int 2)))
5944 (set (pc) (if_then_else (ltu (match_dup 5) (const_int 0))
5945 (label_ref (match_dup 1))
5947 (set (match_dup 0) (xor:DI (match_dup 0) (match_dup 2)))
5948 (set (match_dup 0) (ior:DI (match_dup 0) (const_int 2048)))]
5949 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS"
5952 operands[2] = gen_reg_rtx (DImode);
5953 operands[3] = gen_reg_rtx (DImode);
5954 operands[4] = gen_reg_rtx (CCmode);
5955 operands[5] = gen_reg_rtx (CCUNSmode);
5958 ;; Define the DImode operations that can be done in a small number
5959 ;; of instructions. The & constraints are to prevent the register
5960 ;; allocator from allocating registers that overlap with the inputs
5961 ;; (for example, having an input in 7,8 and an output in 6,7). We
5962 ;; also allow for the output being the same as one of the inputs.
5964 (define_insn "*adddi3_noppc64"
5965 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r")
5966 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,0,0")
5967 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")))]
5968 "! TARGET_POWERPC64"
5971 if (WORDS_BIG_ENDIAN)
5972 return (GET_CODE (operands[2])) != CONST_INT
5973 ? \"{a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2\"
5974 : \"{ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1\";
5976 return (GET_CODE (operands[2])) != CONST_INT
5977 ? \"{a|addc} %0,%1,%2\;{ae|adde} %L0,%L1,%L2\"
5978 : \"{ai|addic} %0,%1,%2\;{a%G2e|add%G2e} %L0,%L1\";
5980 [(set_attr "length" "8")])
5982 (define_insn "*subdi3_noppc64"
5983 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r")
5984 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I,0,r,I")
5985 (match_operand:DI 2 "gpc_reg_operand" "r,r,r,0,0")))]
5986 "! TARGET_POWERPC64"
5989 if (WORDS_BIG_ENDIAN)
5990 return (GET_CODE (operands[1]) != CONST_INT)
5991 ? \"{sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1\"
5992 : \"{sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2\";
5994 return (GET_CODE (operands[1]) != CONST_INT)
5995 ? \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\"
5996 : \"{sfi|subfic} %0,%2,%1\;{sf%G1e|subf%G1e} %L0,%L2\";
5998 [(set_attr "length" "8")])
6000 (define_insn "*negdi2_noppc64"
6001 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6002 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))]
6003 "! TARGET_POWERPC64"
6006 return (WORDS_BIG_ENDIAN)
6007 ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\"
6008 : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\";
6010 [(set_attr "length" "8")])
6012 (define_expand "mulsidi3"
6013 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6014 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
6015 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
6016 "! TARGET_POWERPC64"
6019 if (! TARGET_POWER && ! TARGET_POWERPC)
6021 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
6022 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
6023 emit_insn (gen_mull_call ());
6024 if (WORDS_BIG_ENDIAN)
6025 emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
6028 emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
6029 gen_rtx_REG (SImode, 3));
6030 emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
6031 gen_rtx_REG (SImode, 4));
6035 else if (TARGET_POWER)
6037 emit_insn (gen_mulsidi3_mq (operands[0], operands[1], operands[2]));
6042 (define_insn "mulsidi3_mq"
6043 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6044 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
6045 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
6046 (clobber (match_scratch:SI 3 "=q"))]
6048 "mul %0,%1,%2\;mfmq %L0"
6049 [(set_attr "type" "imul")
6050 (set_attr "length" "8")])
6052 (define_insn "*mulsidi3_no_mq"
6053 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6054 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
6055 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
6056 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
6059 return (WORDS_BIG_ENDIAN)
6060 ? \"mulhw %0,%1,%2\;mullw %L0,%1,%2\"
6061 : \"mulhw %L0,%1,%2\;mullw %0,%1,%2\";
6063 [(set_attr "type" "imul")
6064 (set_attr "length" "8")])
6067 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6068 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
6069 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
6070 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
6073 (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
6074 (sign_extend:DI (match_dup 2)))
6077 (mult:SI (match_dup 1)
6081 int endian = (WORDS_BIG_ENDIAN == 0);
6082 operands[3] = operand_subword (operands[0], endian, 0, DImode);
6083 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
6086 (define_expand "umulsidi3"
6087 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6088 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
6089 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
6090 "TARGET_POWERPC && ! TARGET_POWERPC64"
6095 emit_insn (gen_umulsidi3_mq (operands[0], operands[1], operands[2]));
6100 (define_insn "umulsidi3_mq"
6101 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6102 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
6103 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
6104 (clobber (match_scratch:SI 3 "=q"))]
6105 "TARGET_POWERPC && TARGET_POWER"
6108 return (WORDS_BIG_ENDIAN)
6109 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
6110 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
6112 [(set_attr "type" "imul")
6113 (set_attr "length" "8")])
6115 (define_insn "*umulsidi3_no_mq"
6116 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6117 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
6118 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
6119 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
6122 return (WORDS_BIG_ENDIAN)
6123 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
6124 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
6126 [(set_attr "type" "imul")
6127 (set_attr "length" "8")])
6130 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6131 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
6132 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
6133 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
6136 (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
6137 (zero_extend:DI (match_dup 2)))
6140 (mult:SI (match_dup 1)
6144 int endian = (WORDS_BIG_ENDIAN == 0);
6145 operands[3] = operand_subword (operands[0], endian, 0, DImode);
6146 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
6149 (define_expand "smulsi3_highpart"
6150 [(set (match_operand:SI 0 "gpc_reg_operand" "")
6152 (lshiftrt:DI (mult:DI (sign_extend:DI
6153 (match_operand:SI 1 "gpc_reg_operand" "%r"))
6155 (match_operand:SI 2 "gpc_reg_operand" "r")))
6160 if (! TARGET_POWER && ! TARGET_POWERPC)
6162 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
6163 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
6164 emit_insn (gen_mulh_call ());
6165 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
6168 else if (TARGET_POWER)
6170 emit_insn (gen_smulsi3_highpart_mq (operands[0], operands[1], operands[2]));
6175 (define_insn "smulsi3_highpart_mq"
6176 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
6178 (lshiftrt:DI (mult:DI (sign_extend:DI
6179 (match_operand:SI 1 "gpc_reg_operand" "%r"))
6181 (match_operand:SI 2 "gpc_reg_operand" "r")))
6183 (clobber (match_scratch:SI 3 "=q"))]
6186 [(set_attr "type" "imul")])
6188 (define_insn "*smulsi3_highpart_no_mq"
6189 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
6191 (lshiftrt:DI (mult:DI (sign_extend:DI
6192 (match_operand:SI 1 "gpc_reg_operand" "%r"))
6194 (match_operand:SI 2 "gpc_reg_operand" "r")))
6196 "TARGET_POWERPC && ! TARGET_POWER"
6198 [(set_attr "type" "imul")])
6200 (define_expand "umulsi3_highpart"
6201 [(set (match_operand:SI 0 "gpc_reg_operand" "")
6203 (lshiftrt:DI (mult:DI (zero_extend:DI
6204 (match_operand:SI 1 "gpc_reg_operand" ""))
6206 (match_operand:SI 2 "gpc_reg_operand" "")))
6213 emit_insn (gen_umulsi3_highpart_mq (operands[0], operands[1], operands[2]));
6218 (define_insn "umulsi3_highpart_mq"
6219 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
6221 (lshiftrt:DI (mult:DI (zero_extend:DI
6222 (match_operand:SI 1 "gpc_reg_operand" "%r"))
6224 (match_operand:SI 2 "gpc_reg_operand" "r")))
6226 (clobber (match_scratch:SI 3 "=q"))]
6227 "TARGET_POWERPC && TARGET_POWER"
6229 [(set_attr "type" "imul")])
6231 (define_insn "*umulsi3_highpart_no_mq"
6232 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
6234 (lshiftrt:DI (mult:DI (zero_extend:DI
6235 (match_operand:SI 1 "gpc_reg_operand" "%r"))
6237 (match_operand:SI 2 "gpc_reg_operand" "r")))
6239 "TARGET_POWERPC && ! TARGET_POWER"
6241 [(set_attr "type" "imul")])
6243 ;; If operands 0 and 2 are in the same register, we have a problem. But
6244 ;; operands 0 and 1 (the usual case) can be in the same register. That's
6245 ;; why we have the strange constraints below.
6246 (define_insn "ashldi3_power"
6247 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
6248 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
6249 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
6250 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
6253 {sli|slwi} %0,%L1,%h2\;{cal %L0,0(0)|li %L0,0}
6254 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
6255 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
6256 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2"
6257 [(set_attr "length" "8")])
6259 (define_insn "lshrdi3_power"
6260 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
6261 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
6262 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
6263 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
6266 {s%A2i|s%A2wi} %L0,%1,%h2\;{cal %0,0(0)|li %0,0}
6267 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
6268 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
6269 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2"
6270 [(set_attr "length" "8")])
6272 ;; Shift by a variable amount is too complex to be worth open-coding. We
6273 ;; just handle shifts by constants.
6274 (define_insn "ashrdi3_power"
6275 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6276 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6277 (match_operand:SI 2 "const_int_operand" "M,i")))
6278 (clobber (match_scratch:SI 3 "=X,q"))]
6281 {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
6282 sraiq %0,%1,%h2\;srliq %L0,%L1,%h2"
6283 [(set_attr "length" "8")])
6285 (define_insn "ashrdi3_no_power"
6286 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r")
6287 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6288 (match_operand:SI 2 "const_int_operand" "M,i")))]
6289 "TARGET_32BIT && !TARGET_POWER"
6291 {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
6292 {sri|srwi} %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;{srai|srawi} %0,%1,%h2"
6293 [(set_attr "length" "8,12")])
6295 ;; PowerPC64 DImode operations.
6297 (define_expand "adddi3"
6298 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6299 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6300 (match_operand:DI 2 "reg_or_add_cint64_operand" "")))]
6304 if (! TARGET_POWERPC64)
6306 if (non_short_cint_operand (operands[2], DImode))
6310 if (GET_CODE (operands[2]) == CONST_INT
6311 && ! add_operand (operands[2], DImode))
6313 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
6314 ? operands[0] : gen_reg_rtx (DImode));
6316 HOST_WIDE_INT val = INTVAL (operands[2]);
6317 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
6318 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
6320 if (!CONST_OK_FOR_LETTER_P (rest, 'L'))
6323 /* The ordering here is important for the prolog expander.
6324 When space is allocated from the stack, adding 'low' first may
6325 produce a temporary deallocation (which would be bad). */
6326 emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest)));
6327 emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
6332 ;; Discourage ai/addic because of carry but provide it in an alternative
6333 ;; allowing register zero as source.
6335 (define_insn "*adddi3_internal1"
6336 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r")
6337 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b")
6338 (match_operand:DI 2 "add_operand" "r,I,I,L")))]
6346 (define_insn "*adddi3_internal2"
6347 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
6348 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
6349 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
6351 (clobber (match_scratch:DI 3 "=r,r,r,r"))]
6358 [(set_attr "type" "compare")
6359 (set_attr "length" "4,4,8,8")])
6362 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6363 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6364 (match_operand:DI 2 "reg_or_short_operand" ""))
6366 (clobber (match_scratch:DI 3 ""))]
6367 "TARGET_POWERPC64 && reload_completed"
6369 (plus:DI (match_dup 1) (match_dup 2)))
6371 (compare:CC (match_dup 3)
6375 (define_insn "*adddi3_internal3"
6376 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
6377 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
6378 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
6380 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
6381 (plus:DI (match_dup 1) (match_dup 2)))]
6388 [(set_attr "type" "compare")
6389 (set_attr "length" "4,4,8,8")])
6392 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6393 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6394 (match_operand:DI 2 "reg_or_short_operand" ""))
6396 (set (match_operand:DI 0 "gpc_reg_operand" "")
6397 (plus:DI (match_dup 1) (match_dup 2)))]
6398 "TARGET_POWERPC64 && reload_completed"
6400 (plus:DI (match_dup 1) (match_dup 2)))
6402 (compare:CC (match_dup 0)
6406 ;; Split an add that we can't do in one insn into two insns, each of which
6407 ;; does one 16-bit part. This is used by combine. Note that the low-order
6408 ;; add should be last in case the result gets used in an address.
6411 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6412 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6413 (match_operand:DI 2 "non_add_cint_operand" "")))]
6415 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
6416 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
6419 HOST_WIDE_INT val = INTVAL (operands[2]);
6420 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
6421 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
6423 operands[4] = GEN_INT (low);
6424 if (CONST_OK_FOR_LETTER_P (rest, 'L'))
6425 operands[3] = GEN_INT (rest);
6426 else if (! no_new_pseudos)
6428 operands[3] = gen_reg_rtx (DImode);
6429 emit_move_insn (operands[3], operands[2]);
6430 emit_insn (gen_adddi3 (operands[0], operands[1], operands[3]));
6437 (define_insn "one_cmpldi2"
6438 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6439 (not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6444 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6445 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6447 (clobber (match_scratch:DI 2 "=r,r"))]
6452 [(set_attr "type" "compare")
6453 (set_attr "length" "4,8")])
6456 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6457 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6459 (clobber (match_scratch:DI 2 ""))]
6460 "TARGET_POWERPC64 && reload_completed"
6462 (not:DI (match_dup 1)))
6464 (compare:CC (match_dup 2)
6469 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
6470 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6472 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6473 (not:DI (match_dup 1)))]
6478 [(set_attr "type" "compare")
6479 (set_attr "length" "4,8")])
6482 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
6483 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6485 (set (match_operand:DI 0 "gpc_reg_operand" "")
6486 (not:DI (match_dup 1)))]
6487 "TARGET_POWERPC64 && reload_completed"
6489 (not:DI (match_dup 1)))
6491 (compare:CC (match_dup 0)
6496 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6497 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I")
6498 (match_operand:DI 2 "gpc_reg_operand" "r,r")))]
6505 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6506 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6507 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6509 (clobber (match_scratch:DI 3 "=r,r"))]
6514 [(set_attr "type" "compare")
6515 (set_attr "length" "4,8")])
6518 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6519 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6520 (match_operand:DI 2 "gpc_reg_operand" ""))
6522 (clobber (match_scratch:DI 3 ""))]
6523 "TARGET_POWERPC64 && reload_completed"
6525 (minus:DI (match_dup 1) (match_dup 2)))
6527 (compare:CC (match_dup 3)
6532 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6533 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6534 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6536 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6537 (minus:DI (match_dup 1) (match_dup 2)))]
6542 [(set_attr "type" "compare")
6543 (set_attr "length" "4,8")])
6546 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6547 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6548 (match_operand:DI 2 "gpc_reg_operand" ""))
6550 (set (match_operand:DI 0 "gpc_reg_operand" "")
6551 (minus:DI (match_dup 1) (match_dup 2)))]
6552 "TARGET_POWERPC64 && reload_completed"
6554 (minus:DI (match_dup 1) (match_dup 2)))
6556 (compare:CC (match_dup 0)
6560 (define_expand "subdi3"
6561 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6562 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "")
6563 (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))]
6567 if (GET_CODE (operands[2]) == CONST_INT)
6569 emit_insn (gen_adddi3 (operands[0], operands[1],
6570 negate_rtx (DImode, operands[2])));
6575 (define_insn_and_split "absdi2"
6576 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6577 (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
6578 (clobber (match_scratch:DI 2 "=&r,&r"))]
6581 "&& reload_completed"
6582 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6583 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6584 (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
6587 (define_insn_and_split "*nabsdi2"
6588 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6589 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
6590 (clobber (match_scratch:DI 2 "=&r,&r"))]
6593 "&& reload_completed"
6594 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6595 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6596 (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))]
6599 (define_expand "negdi2"
6600 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6601 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))]
6606 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6607 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6612 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6613 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6615 (clobber (match_scratch:DI 2 "=r,r"))]
6620 [(set_attr "type" "compare")
6621 (set_attr "length" "4,8")])
6624 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6625 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6627 (clobber (match_scratch:DI 2 ""))]
6628 "TARGET_POWERPC64 && reload_completed"
6630 (neg:DI (match_dup 1)))
6632 (compare:CC (match_dup 2)
6637 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
6638 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6640 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6641 (neg:DI (match_dup 1)))]
6646 [(set_attr "type" "compare")
6647 (set_attr "length" "4,8")])
6650 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
6651 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6653 (set (match_operand:DI 0 "gpc_reg_operand" "")
6654 (neg:DI (match_dup 1)))]
6655 "TARGET_POWERPC64 && reload_completed"
6657 (neg:DI (match_dup 1)))
6659 (compare:CC (match_dup 0)
6663 (define_insn "ffsdi2"
6664 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6665 (ffs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6667 "neg %0,%1\;and %0,%0,%1\;cntlzd %0,%0\;subfic %0,%0,64"
6668 [(set_attr "length" "16")])
6670 (define_insn "muldi3"
6671 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6672 (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
6673 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6676 [(set_attr "type" "lmul")])
6678 (define_insn "smuldi3_highpart"
6679 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6681 (lshiftrt:TI (mult:TI (sign_extend:TI
6682 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6684 (match_operand:DI 2 "gpc_reg_operand" "r")))
6688 [(set_attr "type" "lmul")])
6690 (define_insn "umuldi3_highpart"
6691 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6693 (lshiftrt:TI (mult:TI (zero_extend:TI
6694 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6696 (match_operand:DI 2 "gpc_reg_operand" "r")))
6700 [(set_attr "type" "lmul")])
6702 (define_expand "divdi3"
6703 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6704 (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6705 (match_operand:DI 2 "reg_or_cint_operand" "")))]
6709 if (GET_CODE (operands[2]) == CONST_INT
6710 && INTVAL (operands[2]) > 0
6711 && exact_log2 (INTVAL (operands[2])) >= 0)
6714 operands[2] = force_reg (DImode, operands[2]);
6717 (define_expand "moddi3"
6718 [(use (match_operand:DI 0 "gpc_reg_operand" ""))
6719 (use (match_operand:DI 1 "gpc_reg_operand" ""))
6720 (use (match_operand:DI 2 "reg_or_cint_operand" ""))]
6728 if (GET_CODE (operands[2]) != CONST_INT
6729 || INTVAL (operands[2]) <= 0
6730 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
6733 temp1 = gen_reg_rtx (DImode);
6734 temp2 = gen_reg_rtx (DImode);
6736 emit_insn (gen_divdi3 (temp1, operands[1], operands[2]));
6737 emit_insn (gen_ashldi3 (temp2, temp1, GEN_INT (i)));
6738 emit_insn (gen_subdi3 (operands[0], operands[1], temp2));
6743 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6744 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6745 (match_operand:DI 2 "exact_log2_cint_operand" "N")))]
6747 "sradi %0,%1,%p2\;addze %0,%0"
6748 [(set_attr "length" "8")])
6751 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6752 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6753 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6755 (clobber (match_scratch:DI 3 "=r,r"))]
6758 sradi %3,%1,%p2\;addze. %3,%3
6760 [(set_attr "type" "compare")
6761 (set_attr "length" "8,12")])
6764 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6765 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6766 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6768 (clobber (match_scratch:DI 3 ""))]
6769 "TARGET_POWERPC64 && reload_completed"
6771 (div:DI (match_dup 1) (match_dup 2)))
6773 (compare:CC (match_dup 3)
6778 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6779 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6780 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6782 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6783 (div:DI (match_dup 1) (match_dup 2)))]
6786 sradi %0,%1,%p2\;addze. %0,%0
6788 [(set_attr "type" "compare")
6789 (set_attr "length" "8,12")])
6792 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6793 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6794 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6796 (set (match_operand:DI 0 "gpc_reg_operand" "")
6797 (div:DI (match_dup 1) (match_dup 2)))]
6798 "TARGET_POWERPC64 && reload_completed"
6800 (div:DI (match_dup 1) (match_dup 2)))
6802 (compare:CC (match_dup 0)
6807 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6808 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6809 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6812 [(set_attr "type" "ldiv")])
6814 (define_insn "udivdi3"
6815 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6816 (udiv:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6817 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6820 [(set_attr "type" "ldiv")])
6822 (define_insn "rotldi3"
6823 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6824 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6825 (match_operand:DI 2 "reg_or_cint_operand" "ri")))]
6827 "rld%I2cl %0,%1,%H2,0")
6829 (define_insn "*rotldi3_internal2"
6830 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6831 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6832 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6834 (clobber (match_scratch:DI 3 "=r,r"))]
6837 rld%I2cl. %3,%1,%H2,0
6839 [(set_attr "type" "delayed_compare")
6840 (set_attr "length" "4,8")])
6843 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6844 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6845 (match_operand:DI 2 "reg_or_cint_operand" ""))
6847 (clobber (match_scratch:DI 3 ""))]
6848 "TARGET_POWERPC64 && reload_completed"
6850 (rotate:DI (match_dup 1) (match_dup 2)))
6852 (compare:CC (match_dup 3)
6856 (define_insn "*rotldi3_internal3"
6857 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6858 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6859 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6861 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6862 (rotate:DI (match_dup 1) (match_dup 2)))]
6865 rld%I2cl. %0,%1,%H2,0
6867 [(set_attr "type" "delayed_compare")
6868 (set_attr "length" "4,8")])
6871 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6872 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6873 (match_operand:DI 2 "reg_or_cint_operand" ""))
6875 (set (match_operand:DI 0 "gpc_reg_operand" "")
6876 (rotate:DI (match_dup 1) (match_dup 2)))]
6877 "TARGET_POWERPC64 && reload_completed"
6879 (rotate:DI (match_dup 1) (match_dup 2)))
6881 (compare:CC (match_dup 0)
6885 (define_insn "*rotldi3_internal4"
6886 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6887 (and:DI (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6888 (match_operand:DI 2 "reg_or_cint_operand" "ri"))
6889 (match_operand:DI 3 "mask64_operand" "n")))]
6891 "rld%I2c%B3 %0,%1,%H2,%S3")
6893 (define_insn "*rotldi3_internal5"
6894 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6896 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6897 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6898 (match_operand:DI 3 "mask64_operand" "n,n"))
6900 (clobber (match_scratch:DI 4 "=r,r"))]
6903 rld%I2c%B3. %4,%1,%H2,%S3
6905 [(set_attr "type" "delayed_compare")
6906 (set_attr "length" "4,8")])
6909 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6911 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6912 (match_operand:DI 2 "reg_or_cint_operand" ""))
6913 (match_operand:DI 3 "mask64_operand" ""))
6915 (clobber (match_scratch:DI 4 ""))]
6916 "TARGET_POWERPC64 && reload_completed"
6918 (and:DI (rotate:DI (match_dup 1)
6922 (compare:CC (match_dup 4)
6926 (define_insn "*rotldi3_internal6"
6927 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6929 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6930 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6931 (match_operand:DI 3 "mask64_operand" "n,n"))
6933 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6934 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6937 rld%I2c%B3. %0,%1,%H2,%S3
6939 [(set_attr "type" "delayed_compare")
6940 (set_attr "length" "4,8")])
6943 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6945 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6946 (match_operand:DI 2 "reg_or_cint_operand" ""))
6947 (match_operand:DI 3 "mask64_operand" ""))
6949 (set (match_operand:DI 0 "gpc_reg_operand" "")
6950 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6951 "TARGET_POWERPC64 && reload_completed"
6953 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
6955 (compare:CC (match_dup 0)
6959 (define_insn "*rotldi3_internal7"
6960 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6963 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6964 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6966 "rld%I2cl %0,%1,%H2,56")
6968 (define_insn "*rotldi3_internal8"
6969 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6970 (compare:CC (zero_extend:DI
6972 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6973 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6975 (clobber (match_scratch:DI 3 "=r,r"))]
6978 rld%I2cl. %3,%1,%H2,56
6980 [(set_attr "type" "delayed_compare")
6981 (set_attr "length" "4,8")])
6984 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6985 (compare:CC (zero_extend:DI
6987 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6988 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6990 (clobber (match_scratch:DI 3 ""))]
6991 "TARGET_POWERPC64 && reload_completed"
6993 (zero_extend:DI (subreg:QI
6994 (rotate:DI (match_dup 1)
6997 (compare:CC (match_dup 3)
7001 (define_insn "*rotldi3_internal9"
7002 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7003 (compare:CC (zero_extend:DI
7005 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7006 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
7008 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7009 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7012 rld%I2cl. %0,%1,%H2,56
7014 [(set_attr "type" "delayed_compare")
7015 (set_attr "length" "4,8")])
7018 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7019 (compare:CC (zero_extend:DI
7021 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
7022 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
7024 (set (match_operand:DI 0 "gpc_reg_operand" "")
7025 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7026 "TARGET_POWERPC64 && reload_completed"
7028 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
7030 (compare:CC (match_dup 0)
7034 (define_insn "*rotldi3_internal10"
7035 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7038 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7039 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
7041 "rld%I2cl %0,%1,%H2,48")
7043 (define_insn "*rotldi3_internal11"
7044 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7045 (compare:CC (zero_extend:DI
7047 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7048 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
7050 (clobber (match_scratch:DI 3 "=r,r"))]
7053 rld%I2cl. %3,%1,%H2,48
7055 [(set_attr "type" "delayed_compare")
7056 (set_attr "length" "4,8")])
7059 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7060 (compare:CC (zero_extend:DI
7062 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
7063 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
7065 (clobber (match_scratch:DI 3 ""))]
7066 "TARGET_POWERPC64 && reload_completed"
7068 (zero_extend:DI (subreg:HI
7069 (rotate:DI (match_dup 1)
7072 (compare:CC (match_dup 3)
7076 (define_insn "*rotldi3_internal12"
7077 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7078 (compare:CC (zero_extend:DI
7080 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7081 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
7083 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7084 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7087 rld%I2cl. %0,%1,%H2,48
7089 [(set_attr "type" "delayed_compare")
7090 (set_attr "length" "4,8")])
7093 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7094 (compare:CC (zero_extend:DI
7096 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
7097 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
7099 (set (match_operand:DI 0 "gpc_reg_operand" "")
7100 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7101 "TARGET_POWERPC64 && reload_completed"
7103 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
7105 (compare:CC (match_dup 0)
7109 (define_insn "*rotldi3_internal13"
7110 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7113 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7114 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
7116 "rld%I2cl %0,%1,%H2,32")
7118 (define_insn "*rotldi3_internal14"
7119 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7120 (compare:CC (zero_extend:DI
7122 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7123 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
7125 (clobber (match_scratch:DI 3 "=r,r"))]
7128 rld%I2cl. %3,%1,%H2,32
7130 [(set_attr "type" "delayed_compare")
7131 (set_attr "length" "4,8")])
7134 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7135 (compare:CC (zero_extend:DI
7137 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
7138 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
7140 (clobber (match_scratch:DI 3 ""))]
7141 "TARGET_POWERPC64 && reload_completed"
7143 (zero_extend:DI (subreg:SI
7144 (rotate:DI (match_dup 1)
7147 (compare:CC (match_dup 3)
7151 (define_insn "*rotldi3_internal15"
7152 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7153 (compare:CC (zero_extend:DI
7155 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7156 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
7158 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7159 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7162 rld%I2cl. %0,%1,%H2,32
7164 [(set_attr "type" "delayed_compare")
7165 (set_attr "length" "4,8")])
7168 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7169 (compare:CC (zero_extend:DI
7171 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
7172 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
7174 (set (match_operand:DI 0 "gpc_reg_operand" "")
7175 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
7176 "TARGET_POWERPC64 && reload_completed"
7178 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
7180 (compare:CC (match_dup 0)
7184 (define_expand "ashldi3"
7185 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7186 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7187 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7188 "TARGET_POWERPC64 || TARGET_POWER"
7191 if (TARGET_POWERPC64)
7193 else if (TARGET_POWER)
7195 emit_insn (gen_ashldi3_power (operands[0], operands[1], operands[2]));
7202 (define_insn "*ashldi3_internal1"
7203 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7204 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7205 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7208 [(set_attr "length" "8")])
7210 (define_insn "*ashldi3_internal2"
7211 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7212 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7213 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7215 (clobber (match_scratch:DI 3 "=r,r"))]
7220 [(set_attr "type" "delayed_compare")
7221 (set_attr "length" "4,8")])
7224 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7225 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7226 (match_operand:SI 2 "reg_or_cint_operand" ""))
7228 (clobber (match_scratch:DI 3 ""))]
7229 "TARGET_POWERPC64 && reload_completed"
7231 (ashift:DI (match_dup 1) (match_dup 2)))
7233 (compare:CC (match_dup 3)
7237 (define_insn "*ashldi3_internal3"
7238 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7239 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7240 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7242 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7243 (ashift:DI (match_dup 1) (match_dup 2)))]
7248 [(set_attr "type" "delayed_compare")
7249 (set_attr "length" "4,8")])
7252 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7253 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7254 (match_operand:SI 2 "reg_or_cint_operand" ""))
7256 (set (match_operand:DI 0 "gpc_reg_operand" "")
7257 (ashift:DI (match_dup 1) (match_dup 2)))]
7258 "TARGET_POWERPC64 && reload_completed"
7260 (ashift:DI (match_dup 1) (match_dup 2)))
7262 (compare:CC (match_dup 0)
7266 (define_insn "*ashldi3_internal4"
7267 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7268 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7269 (match_operand:SI 2 "const_int_operand" "i"))
7270 (match_operand:DI 3 "const_int_operand" "n")))]
7271 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
7272 "rldic %0,%1,%H2,%W3")
7274 (define_insn "ashldi3_internal5"
7275 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7277 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7278 (match_operand:SI 2 "const_int_operand" "i,i"))
7279 (match_operand:DI 3 "const_int_operand" "n,n"))
7281 (clobber (match_scratch:DI 4 "=r,r"))]
7282 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
7284 rldic. %4,%1,%H2,%W3
7286 [(set_attr "type" "delayed_compare")
7287 (set_attr "length" "4,8")])
7290 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7292 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7293 (match_operand:SI 2 "const_int_operand" ""))
7294 (match_operand:DI 3 "const_int_operand" ""))
7296 (clobber (match_scratch:DI 4 ""))]
7297 "TARGET_POWERPC64 && reload_completed
7298 && includes_rldic_lshift_p (operands[2], operands[3])"
7300 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7303 (compare:CC (match_dup 4)
7307 (define_insn "*ashldi3_internal6"
7308 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
7310 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7311 (match_operand:SI 2 "const_int_operand" "i,i"))
7312 (match_operand:DI 3 "const_int_operand" "n,n"))
7314 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7315 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7316 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
7318 rldic. %0,%1,%H2,%W3
7320 [(set_attr "type" "delayed_compare")
7321 (set_attr "length" "4,8")])
7324 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
7326 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7327 (match_operand:SI 2 "const_int_operand" ""))
7328 (match_operand:DI 3 "const_int_operand" ""))
7330 (set (match_operand:DI 0 "gpc_reg_operand" "")
7331 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7332 "TARGET_POWERPC64 && reload_completed
7333 && includes_rldic_lshift_p (operands[2], operands[3])"
7335 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7338 (compare:CC (match_dup 0)
7342 (define_insn "*ashldi3_internal7"
7343 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7344 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7345 (match_operand:SI 2 "const_int_operand" "i"))
7346 (match_operand:DI 3 "mask64_operand" "n")))]
7347 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7348 "rldicr %0,%1,%H2,%S3")
7350 (define_insn "ashldi3_internal8"
7351 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7353 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7354 (match_operand:SI 2 "const_int_operand" "i,i"))
7355 (match_operand:DI 3 "mask64_operand" "n,n"))
7357 (clobber (match_scratch:DI 4 "=r,r"))]
7358 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7360 rldicr. %4,%1,%H2,%S3
7362 [(set_attr "type" "delayed_compare")
7363 (set_attr "length" "4,8")])
7366 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7368 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7369 (match_operand:SI 2 "const_int_operand" ""))
7370 (match_operand:DI 3 "mask64_operand" ""))
7372 (clobber (match_scratch:DI 4 ""))]
7373 "TARGET_POWERPC64 && reload_completed
7374 && includes_rldicr_lshift_p (operands[2], operands[3])"
7376 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7379 (compare:CC (match_dup 4)
7383 (define_insn "*ashldi3_internal9"
7384 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
7386 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7387 (match_operand:SI 2 "const_int_operand" "i,i"))
7388 (match_operand:DI 3 "mask64_operand" "n,n"))
7390 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7391 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7392 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7394 rldicr. %0,%1,%H2,%S3
7396 [(set_attr "type" "delayed_compare")
7397 (set_attr "length" "4,8")])
7400 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
7402 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7403 (match_operand:SI 2 "const_int_operand" ""))
7404 (match_operand:DI 3 "mask64_operand" ""))
7406 (set (match_operand:DI 0 "gpc_reg_operand" "")
7407 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7408 "TARGET_POWERPC64 && reload_completed
7409 && includes_rldicr_lshift_p (operands[2], operands[3])"
7411 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7414 (compare:CC (match_dup 0)
7418 (define_expand "lshrdi3"
7419 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7420 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7421 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7422 "TARGET_POWERPC64 || TARGET_POWER"
7425 if (TARGET_POWERPC64)
7427 else if (TARGET_POWER)
7429 emit_insn (gen_lshrdi3_power (operands[0], operands[1], operands[2]));
7436 (define_insn "*lshrdi3_internal1"
7437 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7438 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7439 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7443 (define_insn "*lshrdi3_internal2"
7444 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7445 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7446 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7448 (clobber (match_scratch:DI 3 "=r,r"))]
7453 [(set_attr "type" "delayed_compare")
7454 (set_attr "length" "4,8")])
7457 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7458 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7459 (match_operand:SI 2 "reg_or_cint_operand" ""))
7461 (clobber (match_scratch:DI 3 ""))]
7462 "TARGET_POWERPC64 && reload_completed"
7464 (lshiftrt:DI (match_dup 1) (match_dup 2)))
7466 (compare:CC (match_dup 3)
7470 (define_insn "*lshrdi3_internal3"
7471 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7472 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7473 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7475 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7476 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
7481 [(set_attr "type" "delayed_compare")
7482 (set_attr "length" "4,8")])
7485 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7486 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7487 (match_operand:SI 2 "reg_or_cint_operand" ""))
7489 (set (match_operand:DI 0 "gpc_reg_operand" "")
7490 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
7491 "TARGET_POWERPC64 && reload_completed"
7493 (lshiftrt:DI (match_dup 1) (match_dup 2)))
7495 (compare:CC (match_dup 0)
7499 (define_expand "ashrdi3"
7500 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7501 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7502 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7506 if (TARGET_POWERPC64)
7508 else if (TARGET_POWER && GET_CODE (operands[2]) == CONST_INT)
7510 emit_insn (gen_ashrdi3_power (operands[0], operands[1], operands[2]));
7513 else if (TARGET_32BIT && GET_CODE (operands[2]) == CONST_INT)
7515 emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2]));
7522 (define_insn "*ashrdi3_internal1"
7523 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7524 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7525 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7527 "srad%I2 %0,%1,%H2")
7529 (define_insn "*ashrdi3_internal2"
7530 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7531 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7532 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7534 (clobber (match_scratch:DI 3 "=r,r"))]
7539 [(set_attr "type" "delayed_compare")
7540 (set_attr "length" "4,8")])
7543 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7544 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7545 (match_operand:SI 2 "reg_or_cint_operand" ""))
7547 (clobber (match_scratch:DI 3 ""))]
7548 "TARGET_POWERPC64 && reload_completed"
7550 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7552 (compare:CC (match_dup 3)
7556 (define_insn "*ashrdi3_internal3"
7557 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7558 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7559 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7561 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7562 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7567 [(set_attr "type" "delayed_compare")
7568 (set_attr "length" "4,8")])
7571 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7572 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7573 (match_operand:SI 2 "reg_or_cint_operand" ""))
7575 (set (match_operand:DI 0 "gpc_reg_operand" "")
7576 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7577 "TARGET_POWERPC64 && reload_completed"
7579 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7581 (compare:CC (match_dup 0)
7585 (define_insn "anddi3"
7586 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
7587 (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
7588 (match_operand:DI 2 "and64_2_operand" "?r,S,K,J,t")))
7589 (clobber (match_scratch:CC 3 "=X,X,x,x,X"))]
7593 rldic%B2 %0,%1,0,%S2
7597 [(set_attr "length" "4,4,4,4,8")])
7600 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7601 (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7602 (match_operand:DI 2 "mask64_2_operand" "")))
7603 (clobber (match_scratch:CC 3 ""))]
7605 && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode))
7606 && !mask64_operand (operands[2], DImode)"
7608 (and:DI (rotate:DI (match_dup 1)
7612 (and:DI (rotate:DI (match_dup 0)
7617 build_mask64_2_operands (operands[2], &operands[4]);
7620 (define_insn "*anddi3_internal2"
7621 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,??y,??y,?y")
7622 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
7623 (match_operand:DI 2 "and64_2_operand" "r,S,K,J,t,r,S,K,J,t"))
7625 (clobber (match_scratch:DI 3 "=r,r,r,r,r,r,r,r,r,r"))
7626 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,x,x,X"))]
7630 rldic%B2. %3,%1,0,%S2
7639 [(set_attr "type" "compare,delayed_compare,compare,compare,delayed_compare,compare,compare,compare,compare,compare")
7640 (set_attr "length" "4,4,4,4,8,8,8,8,8,12")])
7643 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7644 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7645 (match_operand:DI 2 "and64_operand" ""))
7647 (clobber (match_scratch:DI 3 ""))
7648 (clobber (match_scratch:CC 4 ""))]
7649 "TARGET_POWERPC64 && reload_completed"
7650 [(parallel [(set (match_dup 3)
7651 (and:DI (match_dup 1)
7653 (clobber (match_dup 4))])
7655 (compare:CC (match_dup 3)
7660 [(set (match_operand:CC 0 "cc_reg_operand" "")
7661 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7662 (match_operand:DI 2 "mask64_2_operand" ""))
7664 (clobber (match_scratch:DI 3 ""))
7665 (clobber (match_scratch:CC 4 ""))]
7666 "TARGET_POWERPC64 && reload_completed
7667 && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode))
7668 && !mask64_operand (operands[2], DImode)"
7670 (and:DI (rotate:DI (match_dup 1)
7673 (parallel [(set (match_dup 0)
7674 (compare:CC (and:DI (rotate:DI (match_dup 3)
7678 (clobber (match_dup 3))])]
7681 build_mask64_2_operands (operands[2], &operands[5]);
7684 (define_insn "*anddi3_internal3"
7685 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,x,?y,?y,??y,??y,?y")
7686 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
7687 (match_operand:DI 2 "and64_2_operand" "r,S,K,J,t,r,S,K,J,t"))
7689 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
7690 (and:DI (match_dup 1) (match_dup 2)))
7691 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,X,x,x,X"))]
7695 rldic%B2. %0,%1,0,%S2
7704 [(set_attr "type" "compare,delayed_compare,compare,compare,delayed_compare,compare,compare,compare,compare,compare")
7705 (set_attr "length" "4,4,4,4,8,8,8,8,8,12")])
7708 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7709 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7710 (match_operand:DI 2 "and64_operand" ""))
7712 (set (match_operand:DI 0 "gpc_reg_operand" "")
7713 (and:DI (match_dup 1) (match_dup 2)))
7714 (clobber (match_scratch:CC 4 ""))]
7715 "TARGET_POWERPC64 && reload_completed"
7716 [(parallel [(set (match_dup 0)
7717 (and:DI (match_dup 1) (match_dup 2)))
7718 (clobber (match_dup 4))])
7720 (compare:CC (match_dup 0)
7725 [(set (match_operand:CC 3 "cc_reg_operand" "")
7726 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7727 (match_operand:DI 2 "mask64_2_operand" ""))
7729 (set (match_operand:DI 0 "gpc_reg_operand" "")
7730 (and:DI (match_dup 1) (match_dup 2)))
7731 (clobber (match_scratch:CC 4 ""))]
7732 "TARGET_POWERPC64 && reload_completed
7733 && (fixed_regs[CR0_REGNO] || !logical_operand (operands[2], DImode))
7734 && !mask64_operand (operands[2], DImode)"
7736 (and:DI (rotate:DI (match_dup 1)
7739 (parallel [(set (match_dup 3)
7740 (compare:CC (and:DI (rotate:DI (match_dup 0)
7745 (and:DI (rotate:DI (match_dup 0)
7750 build_mask64_2_operands (operands[2], &operands[5]);
7753 (define_expand "iordi3"
7754 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7755 (ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
7756 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7760 if (non_logical_cint_operand (operands[2], DImode))
7762 HOST_WIDE_INT value;
7763 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7764 ? operands[0] : gen_reg_rtx (DImode));
7766 if (GET_CODE (operands[2]) == CONST_INT)
7768 value = INTVAL (operands[2]);
7769 emit_insn (gen_iordi3 (tmp, operands[1],
7770 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7774 value = CONST_DOUBLE_LOW (operands[2]);
7775 emit_insn (gen_iordi3 (tmp, operands[1],
7776 immed_double_const (value
7777 & (~ (HOST_WIDE_INT) 0xffff),
7781 emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7786 (define_expand "xordi3"
7787 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7788 (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
7789 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7793 if (non_logical_cint_operand (operands[2], DImode))
7795 HOST_WIDE_INT value;
7796 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7797 ? operands[0] : gen_reg_rtx (DImode));
7799 if (GET_CODE (operands[2]) == CONST_INT)
7801 value = INTVAL (operands[2]);
7802 emit_insn (gen_xordi3 (tmp, operands[1],
7803 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7807 value = CONST_DOUBLE_LOW (operands[2]);
7808 emit_insn (gen_xordi3 (tmp, operands[1],
7809 immed_double_const (value
7810 & (~ (HOST_WIDE_INT) 0xffff),
7814 emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7819 (define_insn "*booldi3_internal1"
7820 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
7821 (match_operator:DI 3 "boolean_or_operator"
7822 [(match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
7823 (match_operand:DI 2 "logical_operand" "r,K,JF")]))]
7830 (define_insn "*booldi3_internal2"
7831 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7832 (compare:CC (match_operator:DI 4 "boolean_or_operator"
7833 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7834 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7836 (clobber (match_scratch:DI 3 "=r,r"))]
7841 [(set_attr "type" "compare")
7842 (set_attr "length" "4,8")])
7845 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7846 (compare:CC (match_operator:DI 4 "boolean_operator"
7847 [(match_operand:DI 1 "gpc_reg_operand" "")
7848 (match_operand:DI 2 "gpc_reg_operand" "")])
7850 (clobber (match_scratch:DI 3 ""))]
7851 "TARGET_POWERPC64 && reload_completed"
7852 [(set (match_dup 3) (match_dup 4))
7854 (compare:CC (match_dup 3)
7858 (define_insn "*booldi3_internal3"
7859 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7860 (compare:CC (match_operator:DI 4 "boolean_operator"
7861 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7862 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7864 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7870 [(set_attr "type" "compare")
7871 (set_attr "length" "4,8")])
7874 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7875 (compare:CC (match_operator:DI 4 "boolean_operator"
7876 [(match_operand:DI 1 "gpc_reg_operand" "")
7877 (match_operand:DI 2 "gpc_reg_operand" "")])
7879 (set (match_operand:DI 0 "gpc_reg_operand" "")
7881 "TARGET_POWERPC64 && reload_completed"
7882 [(set (match_dup 0) (match_dup 4))
7884 (compare:CC (match_dup 0)
7888 ;; Split an logical operation that we can't do in one insn into two insns,
7889 ;; each of which does one 16-bit part. This is used by combine.
7892 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7893 (match_operator:DI 3 "boolean_or_operator"
7894 [(match_operand:DI 1 "gpc_reg_operand" "")
7895 (match_operand:DI 2 "non_logical_cint_operand" "")]))]
7897 [(set (match_dup 0) (match_dup 4))
7898 (set (match_dup 0) (match_dup 5))]
7903 if (GET_CODE (operands[2]) == CONST_DOUBLE)
7905 HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
7906 i3 = immed_double_const (value & (~ (HOST_WIDE_INT) 0xffff),
7908 i4 = GEN_INT (value & 0xffff);
7912 i3 = GEN_INT (INTVAL (operands[2])
7913 & (~ (HOST_WIDE_INT) 0xffff));
7914 i4 = GEN_INT (INTVAL (operands[2]) & 0xffff);
7916 operands[4] = gen_rtx (GET_CODE (operands[3]), DImode,
7918 operands[5] = gen_rtx (GET_CODE (operands[3]), DImode,
7922 (define_insn "*boolcdi3_internal1"
7923 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7924 (match_operator:DI 3 "boolean_operator"
7925 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7926 (match_operand:DI 2 "gpc_reg_operand" "r")]))]
7930 (define_insn "*boolcdi3_internal2"
7931 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7932 (compare:CC (match_operator:DI 4 "boolean_operator"
7933 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
7934 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7936 (clobber (match_scratch:DI 3 "=r,r"))]
7941 [(set_attr "type" "compare")
7942 (set_attr "length" "4,8")])
7945 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7946 (compare:CC (match_operator:DI 4 "boolean_operator"
7947 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7948 (match_operand:DI 2 "gpc_reg_operand" "")])
7950 (clobber (match_scratch:DI 3 ""))]
7951 "TARGET_POWERPC64 && reload_completed"
7952 [(set (match_dup 3) (match_dup 4))
7954 (compare:CC (match_dup 3)
7958 (define_insn "*boolcdi3_internal3"
7959 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7960 (compare:CC (match_operator:DI 4 "boolean_operator"
7961 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
7962 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7964 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7970 [(set_attr "type" "compare")
7971 (set_attr "length" "4,8")])
7974 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7975 (compare:CC (match_operator:DI 4 "boolean_operator"
7976 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7977 (match_operand:DI 2 "gpc_reg_operand" "")])
7979 (set (match_operand:DI 0 "gpc_reg_operand" "")
7981 "TARGET_POWERPC64 && reload_completed"
7982 [(set (match_dup 0) (match_dup 4))
7984 (compare:CC (match_dup 0)
7988 (define_insn "*boolccdi3_internal1"
7989 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7990 (match_operator:DI 3 "boolean_operator"
7991 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7992 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))]))]
7996 (define_insn "*boolccdi3_internal2"
7997 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7998 (compare:CC (match_operator:DI 4 "boolean_operator"
7999 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
8000 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
8002 (clobber (match_scratch:DI 3 "=r,r"))]
8007 [(set_attr "type" "compare")
8008 (set_attr "length" "4,8")])
8011 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
8012 (compare:CC (match_operator:DI 4 "boolean_operator"
8013 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
8014 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
8016 (clobber (match_scratch:DI 3 ""))]
8017 "TARGET_POWERPC64 && reload_completed"
8018 [(set (match_dup 3) (match_dup 4))
8020 (compare:CC (match_dup 3)
8024 (define_insn "*boolccdi3_internal3"
8025 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
8026 (compare:CC (match_operator:DI 4 "boolean_operator"
8027 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
8028 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
8030 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
8036 [(set_attr "type" "compare")
8037 (set_attr "length" "4,8")])
8040 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
8041 (compare:CC (match_operator:DI 4 "boolean_operator"
8042 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
8043 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
8045 (set (match_operand:DI 0 "gpc_reg_operand" "")
8047 "TARGET_POWERPC64 && reload_completed"
8048 [(set (match_dup 0) (match_dup 4))
8050 (compare:CC (match_dup 0)
8054 ;; Now define ways of moving data around.
8056 ;; Elf specific ways of loading addresses for non-PIC code.
8057 ;; The output of this could be r0, but we make a very strong
8058 ;; preference for a base register because it will usually
8060 (define_insn "elf_high"
8061 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
8062 (high:SI (match_operand 1 "" "")))]
8063 "TARGET_ELF && ! TARGET_64BIT"
8064 "{liu|lis} %0,%1@ha")
8066 (define_insn "elf_low"
8067 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
8068 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
8069 (match_operand 2 "" "")))]
8070 "TARGET_ELF && ! TARGET_64BIT"
8072 {cal|la} %0,%2@l(%1)
8073 {ai|addic} %0,%1,%K2")
8075 ;; Mach-O PIC trickery.
8076 (define_insn "macho_high"
8077 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
8078 (high:SI (match_operand 1 "" "")))]
8079 "TARGET_MACHO && ! TARGET_64BIT"
8080 "{liu|lis} %0,ha16(%1)")
8082 (define_insn "macho_low"
8083 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
8084 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
8085 (match_operand 2 "" "")))]
8086 "TARGET_MACHO && ! TARGET_64BIT"
8088 {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)}
8089 {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}")
8091 ;; Set up a register with a value from the GOT table
8093 (define_expand "movsi_got"
8094 [(set (match_operand:SI 0 "gpc_reg_operand" "")
8095 (unspec:SI [(match_operand:SI 1 "got_operand" "")
8097 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
8100 if (GET_CODE (operands[1]) == CONST)
8102 rtx offset = const0_rtx;
8103 HOST_WIDE_INT value;
8105 operands[1] = eliminate_constant_term (XEXP (operands[1], 0), &offset);
8106 value = INTVAL (offset);
8109 rtx tmp = (no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode));
8110 emit_insn (gen_movsi_got (tmp, operands[1]));
8111 emit_insn (gen_addsi3 (operands[0], tmp, offset));
8116 operands[2] = rs6000_got_register (operands[1]);
8119 (define_insn "*movsi_got_internal"
8120 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
8121 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
8122 (match_operand:SI 2 "gpc_reg_operand" "b")] 8))]
8123 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
8124 "{l|lwz} %0,%a1@got(%2)"
8125 [(set_attr "type" "load")])
8127 ;; Used by sched, shorten_branches and final when the GOT pseudo reg
8128 ;; didn't get allocated to a hard register.
8130 [(set (match_operand:SI 0 "gpc_reg_operand" "")
8131 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
8132 (match_operand:SI 2 "memory_operand" "")] 8))]
8133 "DEFAULT_ABI == ABI_V4
8135 && (reload_in_progress || reload_completed)"
8136 [(set (match_dup 0) (match_dup 2))
8137 (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)] 8))]
8140 ;; For SI, we special-case integers that can't be loaded in one insn. We
8141 ;; do the load 16-bits at a time. We could do this by loading from memory,
8142 ;; and this is even supposed to be faster, but it is simpler not to get
8143 ;; integers in the TOC.
8144 (define_expand "movsi"
8145 [(set (match_operand:SI 0 "general_operand" "")
8146 (match_operand:SI 1 "any_operand" ""))]
8148 "{ rs6000_emit_move (operands[0], operands[1], SImode); DONE; }")
8150 (define_insn "movsi_low"
8151 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
8152 (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
8153 (match_operand 2 "" ""))))]
8154 "TARGET_MACHO && ! TARGET_64BIT"
8155 "{l|lwz} %0,lo16(%2)(%1)"
8156 [(set_attr "type" "load")
8157 (set_attr "length" "4")])
8159 (define_insn "movsi_low_st"
8160 [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
8161 (match_operand 2 "" "")))
8162 (match_operand:SI 0 "gpc_reg_operand" "r"))]
8163 "TARGET_MACHO && ! TARGET_64BIT"
8164 "{st|stw} %0,lo16(%2)(%1)"
8165 [(set_attr "type" "store")
8166 (set_attr "length" "4")])
8168 (define_insn "movdf_low"
8169 [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r")
8170 (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
8171 (match_operand 2 "" ""))))]
8172 "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT"
8175 switch (which_alternative)
8178 return \"lfd %0,lo16(%2)(%1)\";
8182 operands2[0] = operands[0];
8183 operands2[1] = operands[1];
8184 operands2[2] = operands[2];
8185 operands2[3] = gen_rtx_REG (SImode, RS6000_PIC_OFFSET_TABLE_REGNUM);
8186 output_asm_insn (\"{l|lwz} %0,lo16(%2)(%1)\", operands);
8187 /* We cannot rely on ha16(low half)==ha16(high half), alas,
8188 although in practice it almost always is. */
8189 output_asm_insn (\"{cau|addis} %L0,%3,ha16(%2+4)\", operands2);
8190 return (\"{l|lwz} %L0,lo16(%2+4)(%L0)\");
8196 [(set_attr "type" "load")
8197 (set_attr "length" "4,12")])
8199 (define_insn "movdf_low_st"
8200 [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
8201 (match_operand 2 "" "")))
8202 (match_operand:DF 0 "gpc_reg_operand" "f"))]
8203 "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT"
8204 "stfd %0,lo16(%2)(%1)"
8205 [(set_attr "type" "store")
8206 (set_attr "length" "4")])
8208 (define_insn "movsf_low"
8209 [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r")
8210 (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
8211 (match_operand 2 "" ""))))]
8212 "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT"
8215 {l|lwz} %0,lo16(%2)(%1)"
8216 [(set_attr "type" "load")
8217 (set_attr "length" "4")])
8219 (define_insn "movsf_low_st"
8220 [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
8221 (match_operand 2 "" "")))
8222 (match_operand:SF 0 "gpc_reg_operand" "f,!r"))]
8223 "TARGET_MACHO && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_64BIT"
8225 stfs %0,lo16(%2)(%1)
8226 {st|stw} %0,lo16(%2)(%1)"
8227 [(set_attr "type" "store")
8228 (set_attr "length" "4")])
8230 (define_insn "*movsi_internal1"
8231 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h")
8232 (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0"))]
8233 "gpc_reg_operand (operands[0], SImode)
8234 || gpc_reg_operand (operands[1], SImode)"
8238 {l%U1%X1|lwz%U1%X1} %0,%1
8239 {st%U0%X0|stw%U0%X0} %1,%0
8249 [(set_attr "type" "*,*,load,store,*,*,*,*,*,*,mtjmpr,*,*")
8250 (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4")])
8252 ;; Split a load of a large constant into the appropriate two-insn
8256 [(set (match_operand:SI 0 "gpc_reg_operand" "")
8257 (match_operand:SI 1 "const_int_operand" ""))]
8258 "(unsigned HOST_WIDE_INT) (INTVAL (operands[1]) + 0x8000) >= 0x10000
8259 && (INTVAL (operands[1]) & 0xffff) != 0"
8263 (ior:SI (match_dup 0)
8266 { rtx tem = rs6000_emit_set_const (operands[0], SImode, operands[1], 2);
8268 if (tem == operands[0])
8274 (define_insn "*movsi_internal2"
8275 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
8276 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r,r")
8278 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
8279 "! TARGET_POWERPC64"
8283 [(set_attr "type" "compare")
8284 (set_attr "length" "4,8")])
8287 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
8288 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
8290 (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))]
8291 "! TARGET_POWERPC64 && reload_completed"
8292 [(set (match_dup 0) (match_dup 1))
8294 (compare:CC (match_dup 0)
8298 (define_expand "movhi"
8299 [(set (match_operand:HI 0 "general_operand" "")
8300 (match_operand:HI 1 "any_operand" ""))]
8302 "{ rs6000_emit_move (operands[0], operands[1], HImode); DONE; }")
8304 (define_insn "*movhi_internal"
8305 [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
8306 (match_operand:HI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
8307 "gpc_reg_operand (operands[0], HImode)
8308 || gpc_reg_operand (operands[1], HImode)"
8318 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
8320 (define_expand "movqi"
8321 [(set (match_operand:QI 0 "general_operand" "")
8322 (match_operand:QI 1 "any_operand" ""))]
8324 "{ rs6000_emit_move (operands[0], operands[1], QImode); DONE; }")
8326 (define_insn "*movqi_internal"
8327 [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
8328 (match_operand:QI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
8329 "gpc_reg_operand (operands[0], QImode)
8330 || gpc_reg_operand (operands[1], QImode)"
8340 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
8342 ;; Here is how to move condition codes around. When we store CC data in
8343 ;; an integer register or memory, we store just the high-order 4 bits.
8344 ;; This lets us not shift in the most common case of CR0.
8345 (define_expand "movcc"
8346 [(set (match_operand:CC 0 "nonimmediate_operand" "")
8347 (match_operand:CC 1 "nonimmediate_operand" ""))]
8351 (define_insn "*movcc_internal1"
8352 [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,y,r,r,r,r,m")
8353 (match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,m,r"))]
8354 "register_operand (operands[0], CCmode)
8355 || register_operand (operands[1], CCmode)"
8359 {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff
8361 mfcr %0\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000
8363 {l%U1%X1|lwz%U1%X1} %0,%1
8364 {st%U0%U1|stw%U0%U1} %1,%0"
8365 [(set_attr "type" "cr_logical,cr_logical,cr_logical,cr_logical,cr_logical,*,load,store")
8366 (set_attr "length" "*,*,12,*,8,*,*,*")])
8368 ;; For floating-point, we normally deal with the floating-point registers
8369 ;; unless -msoft-float is used. The sole exception is that parameter passing
8370 ;; can produce floating-point values in fixed-point registers. Unless the
8371 ;; value is a simple constant or already in memory, we deal with this by
8372 ;; allocating memory and copying the value explicitly via that memory location.
8373 (define_expand "movsf"
8374 [(set (match_operand:SF 0 "nonimmediate_operand" "")
8375 (match_operand:SF 1 "any_operand" ""))]
8377 "{ rs6000_emit_move (operands[0], operands[1], SFmode); DONE; }")
8380 [(set (match_operand:SF 0 "gpc_reg_operand" "")
8381 (match_operand:SF 1 "const_double_operand" ""))]
8383 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8384 || (GET_CODE (operands[0]) == SUBREG
8385 && GET_CODE (SUBREG_REG (operands[0])) == REG
8386 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8387 [(set (match_dup 2) (match_dup 3))]
8393 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
8394 REAL_VALUE_TO_TARGET_SINGLE (rv, l);
8396 if (! TARGET_POWERPC64)
8397 operands[2] = operand_subword (operands[0], 0, 0, SFmode);
8399 operands[2] = gen_lowpart (SImode, operands[0]);
8401 operands[3] = gen_int_mode (l, SImode);
8404 (define_insn "*movsf_hardfloat"
8405 [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!r,!r")
8406 (match_operand:SF 1 "input_operand" "r,m,r,f,m,f,G,Fn"))]
8407 "(gpc_reg_operand (operands[0], SFmode)
8408 || gpc_reg_operand (operands[1], SFmode))
8409 && (TARGET_HARD_FLOAT && TARGET_FPRS)"
8412 {l%U1%X1|lwz%U1%X1} %0,%1
8413 {st%U0%X0|stw%U0%X0} %1,%0
8419 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*")
8420 (set_attr "length" "4,4,4,4,4,4,4,8")])
8422 (define_insn "*movsf_softfloat"
8423 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,r")
8424 (match_operand:SF 1 "input_operand" "r,m,r,I,L,R,G,Fn"))]
8425 "(gpc_reg_operand (operands[0], SFmode)
8426 || gpc_reg_operand (operands[1], SFmode))
8427 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)"
8430 {l%U1%X1|lwz%U1%X1} %0,%1
8431 {st%U0%X0|stw%U0%X0} %1,%0
8437 [(set_attr "type" "*,load,store,*,*,*,*,*")
8438 (set_attr "length" "4,4,4,4,4,4,4,8")])
8441 (define_expand "movdf"
8442 [(set (match_operand:DF 0 "nonimmediate_operand" "")
8443 (match_operand:DF 1 "any_operand" ""))]
8445 "{ rs6000_emit_move (operands[0], operands[1], DFmode); DONE; }")
8448 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8449 (match_operand:DF 1 "const_int_operand" ""))]
8450 "! TARGET_POWERPC64 && reload_completed
8451 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8452 || (GET_CODE (operands[0]) == SUBREG
8453 && GET_CODE (SUBREG_REG (operands[0])) == REG
8454 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8455 [(set (match_dup 2) (match_dup 4))
8456 (set (match_dup 3) (match_dup 1))]
8459 int endian = (WORDS_BIG_ENDIAN == 0);
8460 HOST_WIDE_INT value = INTVAL (operands[1]);
8462 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
8463 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
8464 #if HOST_BITS_PER_WIDE_INT == 32
8465 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
8467 operands[4] = GEN_INT (value >> 32);
8468 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
8473 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8474 (match_operand:DF 1 "const_double_operand" ""))]
8475 "! TARGET_POWERPC64 && reload_completed
8476 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8477 || (GET_CODE (operands[0]) == SUBREG
8478 && GET_CODE (SUBREG_REG (operands[0])) == REG
8479 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8480 [(set (match_dup 2) (match_dup 4))
8481 (set (match_dup 3) (match_dup 5))]
8484 int endian = (WORDS_BIG_ENDIAN == 0);
8488 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
8489 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
8491 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
8492 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
8493 operands[4] = gen_int_mode (l[endian], SImode);
8494 operands[5] = gen_int_mode (l[1 - endian], SImode);
8498 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8499 (match_operand:DF 1 "easy_fp_constant" ""))]
8500 "TARGET_POWERPC64 && reload_completed
8501 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8502 || (GET_CODE (operands[0]) == SUBREG
8503 && GET_CODE (SUBREG_REG (operands[0])) == REG
8504 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8505 [(set (match_dup 2) (match_dup 3))]
8508 int endian = (WORDS_BIG_ENDIAN == 0);
8513 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
8514 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
8516 operands[2] = gen_lowpart (DImode, operands[0]);
8517 /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN. */
8518 #if HOST_BITS_PER_WIDE_INT >= 64
8519 val = ((HOST_WIDE_INT)(unsigned long)l[endian] << 32 |
8520 ((HOST_WIDE_INT)(unsigned long)l[1 - endian]));
8522 operands[3] = immed_double_const (val, -(val < 0), DImode);
8524 operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
8528 ;; Don't have reload use general registers to load a constant. First,
8529 ;; it might not work if the output operand is the equivalent of
8530 ;; a non-offsettable memref, but also it is less efficient than loading
8531 ;; the constant into an FP register, since it will probably be used there.
8532 ;; The "??" is a kludge until we can figure out a more reasonable way
8533 ;; of handling these non-offsettable values.
8534 (define_insn "*movdf_hardfloat32"
8535 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
8536 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
8537 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS
8538 && (gpc_reg_operand (operands[0], DFmode)
8539 || gpc_reg_operand (operands[1], DFmode))"
8542 switch (which_alternative)
8547 /* We normally copy the low-numbered register first. However, if
8548 the first register operand 0 is the same as the second register
8549 of operand 1, we must copy in the opposite order. */
8550 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8551 return \"mr %L0,%L1\;mr %0,%1\";
8553 return \"mr %0,%1\;mr %L0,%L1\";
8555 if (offsettable_memref_p (operands[1])
8556 || (GET_CODE (operands[1]) == MEM
8557 && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
8558 || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
8559 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)))
8561 /* If the low-address word is used in the address, we must load
8562 it last. Otherwise, load it first. Note that we cannot have
8563 auto-increment in that case since the address register is
8564 known to be dead. */
8565 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8567 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8569 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8575 addreg = find_addr_reg (XEXP (operands[1], 0));
8576 if (refers_to_regno_p (REGNO (operands[0]),
8577 REGNO (operands[0]) + 1,
8580 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8581 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8582 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8583 return \"{lx|lwzx} %0,%1\";
8587 output_asm_insn (\"{lx|lwzx} %0,%1\", operands);
8588 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8589 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8590 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8595 if (offsettable_memref_p (operands[0])
8596 || (GET_CODE (operands[0]) == MEM
8597 && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
8598 || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
8599 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)))
8600 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8605 addreg = find_addr_reg (XEXP (operands[0], 0));
8606 output_asm_insn (\"{stx|stwx} %1,%0\", operands);
8607 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8608 output_asm_insn (\"{stx|stwx} %L1,%0\", operands);
8609 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8617 return \"fmr %0,%1\";
8619 return \"lfd%U1%X1 %0,%1\";
8621 return \"stfd%U0%X0 %1,%0\";
8624 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8625 (set_attr "length" "8,16,16,8,12,16,*,*,*")])
8627 (define_insn "*movdf_softfloat32"
8628 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8629 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8630 "! TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
8631 && (gpc_reg_operand (operands[0], DFmode)
8632 || gpc_reg_operand (operands[1], DFmode))"
8635 switch (which_alternative)
8640 /* We normally copy the low-numbered register first. However, if
8641 the first register operand 0 is the same as the second register of
8642 operand 1, we must copy in the opposite order. */
8643 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8644 return \"mr %L0,%L1\;mr %0,%1\";
8646 return \"mr %0,%1\;mr %L0,%L1\";
8648 /* If the low-address word is used in the address, we must load
8649 it last. Otherwise, load it first. Note that we cannot have
8650 auto-increment in that case since the address register is
8651 known to be dead. */
8652 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8654 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8656 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8658 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8665 [(set_attr "type" "*,load,store,*,*,*")
8666 (set_attr "length" "8,8,8,8,12,16")])
8668 (define_insn "*movdf_hardfloat64"
8669 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
8670 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
8671 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS
8672 && (gpc_reg_operand (operands[0], DFmode)
8673 || gpc_reg_operand (operands[1], DFmode))"
8684 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8685 (set_attr "length" "4,4,4,8,12,16,4,4,4")])
8687 (define_insn "*movdf_softfloat64"
8688 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8689 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8690 "TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
8691 && (gpc_reg_operand (operands[0], DFmode)
8692 || gpc_reg_operand (operands[1], DFmode))"
8700 [(set_attr "type" "*,load,store,*,*,*")
8701 (set_attr "length" "*,*,*,8,12,16")])
8703 (define_expand "movtf"
8704 [(set (match_operand:TF 0 "general_operand" "")
8705 (match_operand:TF 1 "any_operand" ""))]
8706 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8707 && TARGET_LONG_DOUBLE_128"
8708 "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
8710 (define_insn "*movtf_internal"
8711 [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r")
8712 (match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))]
8713 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8714 && TARGET_LONG_DOUBLE_128
8715 && (gpc_reg_operand (operands[0], TFmode)
8716 || gpc_reg_operand (operands[1], TFmode))"
8719 switch (which_alternative)
8724 /* We normally copy the low-numbered register first. However, if
8725 the first register operand 0 is the same as the second register of
8726 operand 1, we must copy in the opposite order. */
8727 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8728 return \"fmr %L0,%L1\;fmr %0,%1\";
8730 return \"fmr %0,%1\;fmr %L0,%L1\";
8732 return \"lfd %0,%1\;lfd %L0,%L1\";
8734 return \"stfd %1,%0\;stfd %L1,%L0\";
8741 [(set_attr "type" "fp,fpload,fpstore,*,*,*")
8742 (set_attr "length" "8,8,8,12,16,20")])
8745 [(set (match_operand:TF 0 "gpc_reg_operand" "")
8746 (match_operand:TF 1 "const_double_operand" ""))]
8747 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8748 && TARGET_LONG_DOUBLE_128"
8749 [(set (match_dup 3) (match_dup 1))
8751 (float_extend:TF (match_dup 3)))]
8754 operands[2] = operand_subword (operands[1], 0, 0, DFmode);
8755 operands[3] = gen_reg_rtx (DFmode);
8758 (define_insn_and_split "extenddftf2"
8759 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8760 (float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))]
8761 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8762 && TARGET_LONG_DOUBLE_128"
8765 [(set (match_dup 2) (match_dup 3))]
8768 operands[2] = gen_rtx_REG (DFmode, REGNO (operands[0] + 1));
8769 operands[3] = CONST0_RTX (DFmode);
8772 (define_insn_and_split "extendsftf2"
8773 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8774 (float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))]
8775 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8776 && TARGET_LONG_DOUBLE_128"
8779 [(set (match_dup 2) (match_dup 3))]
8782 operands[2] = gen_rtx_REG (SFmode, REGNO (operands[0] + 1));
8783 operands[3] = CONST0_RTX (SFmode);
8786 (define_insn "trunctfdf2"
8787 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
8788 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8789 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8790 && TARGET_LONG_DOUBLE_128"
8792 [(set_attr "type" "fp")
8793 (set_attr "length" "8")])
8795 (define_insn_and_split "trunctfsf2"
8796 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
8797 (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f")))
8798 (clobber (match_scratch:DF 2 "=f"))]
8799 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
8800 && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
8802 "&& reload_completed"
8804 (float_truncate:DF (match_dup 1)))
8806 (float_truncate:SF (match_dup 2)))]
8809 (define_insn_and_split "floatditf2"
8810 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8811 (float:TF (match_operand:DI 1 "gpc_reg_operand" "*f")))
8812 (clobber (match_scratch:DF 2 "=f"))]
8813 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8814 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
8816 "&& reload_completed"
8818 (float:DF (match_operand:DI 1 "gpc_reg_operand" "")))
8819 (set (match_operand:TF 0 "gpc_reg_operand" "")
8820 (float_extend:TF (match_dup 2)))]
8823 (define_insn_and_split "floatsitf2"
8824 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8825 (float:TF (match_operand:SI 1 "gpc_reg_operand" "r")))
8826 (clobber (match_scratch:DF 2 "=f"))]
8827 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8828 && TARGET_LONG_DOUBLE_128"
8830 "&& reload_completed"
8832 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
8833 (set (match_operand:TF 0 "gpc_reg_operand" "")
8834 (float_extend:TF (match_dup 2)))]
8837 (define_insn_and_split "fix_trunctfdi2"
8838 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
8839 (fix:DI (match_operand:TF 1 "gpc_reg_operand" "f")))]
8840 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8841 && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
8843 "&& reload_completed"
8845 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8846 (set (match_operand:DI 0 "gpc_reg_operand" "")
8847 (fix:SI (match_dup 2)))]
8850 (define_insn_and_split "fix_trunctfsi2"
8851 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
8852 (fix:SI (match_operand:TF 1 "gpc_reg_operand" "f")))]
8853 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8854 && TARGET_LONG_DOUBLE_128"
8856 "&& reload_completed"
8858 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8859 (set (match_operand:SI 0 "gpc_reg_operand" "")
8860 (fix:SI (match_dup 2)))]
8863 (define_insn "negtf2"
8864 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8865 (neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8866 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8867 && TARGET_LONG_DOUBLE_128"
8870 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8871 return \"fneg %L0,%L1\;fneg %0,%1\";
8873 return \"fneg %0,%1\;fneg %L0,%L1\";
8875 [(set_attr "type" "fp")
8876 (set_attr "length" "8")])
8878 (define_insn "abstf2"
8879 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8880 (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8881 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8882 && TARGET_LONG_DOUBLE_128"
8885 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8886 return \"fabs %L0,%L1\;fabs %0,%1\";
8888 return \"fabs %0,%1\;fabs %L0,%L1\";
8890 [(set_attr "type" "fp")
8891 (set_attr "length" "8")])
8894 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8895 (neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))]
8896 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
8897 && TARGET_LONG_DOUBLE_128"
8900 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8901 return \"fnabs %L0,%L1\;fnabs %0,%1\";
8903 return \"fnabs %0,%1\;fnabs %L0,%L1\";
8905 [(set_attr "type" "fp")
8906 (set_attr "length" "8")])
8908 ;; Next come the multi-word integer load and store and the load and store
8910 (define_expand "movdi"
8911 [(set (match_operand:DI 0 "general_operand" "")
8912 (match_operand:DI 1 "any_operand" ""))]
8914 "{ rs6000_emit_move (operands[0], operands[1], DImode); DONE; }")
8916 (define_insn "*movdi_internal32"
8917 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
8918 (match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
8920 && (gpc_reg_operand (operands[0], DImode)
8921 || gpc_reg_operand (operands[1], DImode))"
8924 switch (which_alternative)
8929 /* We normally copy the low-numbered register first. However, if
8930 the first register operand 0 is the same as the second register of
8931 operand 1, we must copy in the opposite order. */
8932 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8933 return \"mr %L0,%L1\;mr %0,%1\";
8935 return \"mr %0,%1\;mr %L0,%L1\";
8937 /* If the low-address word is used in the address, we must load it
8938 last. Otherwise, load it first. Note that we cannot have
8939 auto-increment in that case since the address register is known to be
8941 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8943 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8945 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8947 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8949 return \"fmr %0,%1\";
8951 return \"lfd%U1%X1 %0,%1\";
8953 return \"stfd%U0%X0 %1,%0\";
8962 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")
8963 (set_attr "length" "8,8,8,*,*,*,8,12,8,12,16")])
8966 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8967 (match_operand:DI 1 "const_int_operand" ""))]
8968 "! TARGET_POWERPC64 && reload_completed"
8969 [(set (match_dup 2) (match_dup 4))
8970 (set (match_dup 3) (match_dup 1))]
8973 HOST_WIDE_INT value = INTVAL (operands[1]);
8974 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8976 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8978 #if HOST_BITS_PER_WIDE_INT == 32
8979 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
8981 operands[4] = GEN_INT (value >> 32);
8982 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
8987 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8988 (match_operand:DI 1 "const_double_operand" ""))]
8989 "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed"
8990 [(set (match_dup 2) (match_dup 4))
8991 (set (match_dup 3) (match_dup 5))]
8994 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8996 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8998 operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
8999 operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
9002 (define_insn "*movdi_internal64"
9003 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,f,f,m,r,*h,*h")
9004 (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
9006 && (gpc_reg_operand (operands[0], DImode)
9007 || gpc_reg_operand (operands[1], DImode))"
9022 [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,*,mtjmpr,*")
9023 (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
9025 ;; immediate value valid for a single instruction hiding in a const_double
9027 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
9028 (match_operand:DI 1 "const_double_operand" "F"))]
9029 "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
9030 && GET_CODE (operands[1]) == CONST_DOUBLE
9031 && num_insns_constant (operands[1], DImode) == 1"
9034 return ((unsigned HOST_WIDE_INT)
9035 (CONST_DOUBLE_LOW (operands[1]) + 0x8000) < 0x10000)
9036 ? \"li %0,%1\" : \"lis %0,%v1\";
9039 ;; Generate all one-bits and clear left or right.
9040 ;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
9042 [(set (match_operand:DI 0 "gpc_reg_operand" "")
9043 (match_operand:DI 1 "mask64_operand" ""))]
9044 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
9045 [(set (match_dup 0) (const_int -1))
9047 (and:DI (rotate:DI (match_dup 0)
9052 ;; Split a load of a large constant into the appropriate five-instruction
9053 ;; sequence. Handle anything in a constant number of insns.
9054 ;; When non-easy constants can go in the TOC, this should use
9055 ;; easy_fp_constant predicate.
9057 [(set (match_operand:DI 0 "gpc_reg_operand" "")
9058 (match_operand:DI 1 "const_int_operand" ""))]
9059 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
9060 [(set (match_dup 0) (match_dup 2))
9061 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
9063 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
9065 if (tem == operands[0])
9072 [(set (match_operand:DI 0 "gpc_reg_operand" "")
9073 (match_operand:DI 1 "const_double_operand" ""))]
9074 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
9075 [(set (match_dup 0) (match_dup 2))
9076 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
9078 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
9080 if (tem == operands[0])
9086 ;; Split a load of a large constant into the appropriate five-instruction
9087 (define_insn "*movdi_internal2"
9088 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
9089 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r,r")
9091 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
9096 [(set_attr "type" "compare")
9097 (set_attr "length" "4,8")])
9100 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
9101 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "")
9103 (set (match_operand:DI 0 "gpc_reg_operand" "") (match_dup 1))]
9104 "TARGET_POWERPC64 && reload_completed"
9105 [(set (match_dup 0) (match_dup 1))
9107 (compare:CC (match_dup 0)
9111 ;; TImode is similar, except that we usually want to compute the address into
9112 ;; a register and use lsi/stsi (the exception is during reload). MQ is also
9113 ;; clobbered in stsi for POWER, so we need a SCRATCH for it.
9114 (define_expand "movti"
9115 [(parallel [(set (match_operand:TI 0 "general_operand" "")
9116 (match_operand:TI 1 "general_operand" ""))
9117 (clobber (scratch:SI))])]
9118 "TARGET_STRING || TARGET_POWERPC64"
9119 "{ rs6000_emit_move (operands[0], operands[1], TImode); DONE; }")
9121 ;; We say that MQ is clobbered in the last alternative because the first
9122 ;; alternative would never get used otherwise since it would need a reload
9123 ;; while the 2nd alternative would not. We put memory cases first so they
9124 ;; are preferred. Otherwise, we'd try to reload the output instead of
9125 ;; giving the SCRATCH mq.
9126 (define_insn "*movti_power"
9127 [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
9128 (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
9129 (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
9130 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
9131 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
9134 switch (which_alternative)
9140 return \"{stsi|stswi} %1,%P0,16\";
9143 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
9146 /* Normally copy registers with lowest numbered register copied first.
9147 But copy in the other order if the first register of the output
9148 is the second, third, or fourth register in the input. */
9149 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
9150 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
9151 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
9153 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
9155 /* If the address is not used in the output, we can use lsi. Otherwise,
9156 fall through to generating four loads. */
9157 if (! reg_overlap_mentioned_p (operands[0], operands[1]))
9158 return \"{lsi|lswi} %0,%P1,16\";
9159 /* ... fall through ... */
9161 /* If the address register is the same as the register for the lowest-
9162 addressed word, load it last. Similarly for the next two words.
9163 Otherwise load lowest address to highest. */
9164 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
9166 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
9167 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
9168 REGNO (operands[0]) + 2, operands[1], 0))
9169 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
9170 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
9171 REGNO (operands[0]) + 3, operands[1], 0))
9172 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
9174 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
9177 [(set_attr "type" "store,store,*,load,load")
9178 (set_attr "length" "*,16,16,*,16")])
9180 (define_insn "*movti_string"
9181 [(set (match_operand:TI 0 "reg_or_mem_operand" "=m,????r,????r")
9182 (match_operand:TI 1 "reg_or_mem_operand" "r,r,m"))
9183 (clobber (match_scratch:SI 2 "=X,X,X"))]
9184 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
9185 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
9188 switch (which_alternative)
9194 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
9197 /* Normally copy registers with lowest numbered register copied first.
9198 But copy in the other order if the first register of the output
9199 is the second, third, or fourth register in the input. */
9200 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
9201 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
9202 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
9204 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
9206 /* If the address register is the same as the register for the lowest-
9207 addressed word, load it last. Similarly for the next two words.
9208 Otherwise load lowest address to highest. */
9209 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
9211 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
9212 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
9213 REGNO (operands[0]) + 2, operands[1], 0))
9214 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
9215 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
9216 REGNO (operands[0]) + 3, operands[1], 0))
9217 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
9219 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
9222 [(set_attr "type" "store,*,load")
9223 (set_attr "length" "16,16,16")])
9225 (define_insn "*movti_ppc64"
9226 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
9227 (match_operand:TI 1 "input_operand" "r,m,r"))]
9228 "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
9229 || gpc_reg_operand (operands[1], TImode))"
9232 switch (which_alternative)
9237 /* We normally copy the low-numbered register first. However, if
9238 the first register operand 0 is the same as the second register of
9239 operand 1, we must copy in the opposite order. */
9240 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
9241 return \"mr %L0,%L1\;mr %0,%1\";
9243 return \"mr %0,%1\;mr %L0,%L1\";
9245 /* If the low-address word is used in the address, we must load it
9246 last. Otherwise, load it first. Note that we cannot have
9247 auto-increment in that case since the address register is known to be
9249 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
9251 return \"ld %L0,%L1\;ld %0,%1\";
9253 return \"ld%U1 %0,%1\;ld %L0,%L1\";
9255 return \"std%U0 %1,%0\;std %L1,%L0\";
9258 [(set_attr "type" "*,load,store")
9259 (set_attr "length" "8,8,8")])
9261 (define_expand "load_multiple"
9262 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
9263 (match_operand:SI 1 "" ""))
9264 (use (match_operand:SI 2 "" ""))])]
9265 "TARGET_STRING && !TARGET_POWERPC64"
9273 /* Support only loading a constant number of fixed-point registers from
9274 memory and only bother with this if more than two; the machine
9275 doesn't support more than eight. */
9276 if (GET_CODE (operands[2]) != CONST_INT
9277 || INTVAL (operands[2]) <= 2
9278 || INTVAL (operands[2]) > 8
9279 || GET_CODE (operands[1]) != MEM
9280 || GET_CODE (operands[0]) != REG
9281 || REGNO (operands[0]) >= 32)
9284 count = INTVAL (operands[2]);
9285 regno = REGNO (operands[0]);
9287 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
9288 op1 = replace_equiv_address (operands[1],
9289 force_reg (SImode, XEXP (operands[1], 0)));
9291 for (i = 0; i < count; i++)
9292 XVECEXP (operands[3], 0, i)
9293 = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
9294 adjust_address (op1, SImode, i * 4));
9298 [(match_parallel 0 "load_multiple_operation"
9299 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
9300 (mem:SI (match_operand:SI 2 "gpc_reg_operand" "b")))])]
9304 /* We have to handle the case where the pseudo used to contain the address
9305 is assigned to one of the output registers. */
9307 int words = XVECLEN (operands[0], 0);
9310 if (XVECLEN (operands[0], 0) == 1)
9311 return \"{l|lwz} %1,0(%2)\";
9313 for (i = 0; i < words; i++)
9314 if (refers_to_regno_p (REGNO (operands[1]) + i,
9315 REGNO (operands[1]) + i + 1, operands[2], 0))
9319 xop[0] = operands[1];
9320 xop[1] = operands[2];
9321 xop[2] = GEN_INT (4 * (words-1));
9322 output_asm_insn (\"{lsi|lswi} %0,%1,%2\;{l|lwz} %1,%2(%1)\", xop);
9327 xop[0] = operands[1];
9328 xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
9329 xop[2] = GEN_INT (4 * (words-1));
9330 output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
9335 for (j = 0; j < words; j++)
9338 xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
9339 xop[1] = operands[2];
9340 xop[2] = GEN_INT (j * 4);
9341 output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
9343 xop[0] = operands[2];
9344 xop[1] = GEN_INT (i * 4);
9345 output_asm_insn (\"{l|lwz} %0,%1(%0)\", xop);
9350 return \"{lsi|lswi} %1,%2,%N0\";
9352 [(set_attr "type" "load")
9353 (set_attr "length" "32")])
9356 (define_expand "store_multiple"
9357 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
9358 (match_operand:SI 1 "" ""))
9359 (clobber (scratch:SI))
9360 (use (match_operand:SI 2 "" ""))])]
9361 "TARGET_STRING && !TARGET_POWERPC64"
9370 /* Support only storing a constant number of fixed-point registers to
9371 memory and only bother with this if more than two; the machine
9372 doesn't support more than eight. */
9373 if (GET_CODE (operands[2]) != CONST_INT
9374 || INTVAL (operands[2]) <= 2
9375 || INTVAL (operands[2]) > 8
9376 || GET_CODE (operands[0]) != MEM
9377 || GET_CODE (operands[1]) != REG
9378 || REGNO (operands[1]) >= 32)
9381 count = INTVAL (operands[2]);
9382 regno = REGNO (operands[1]);
9384 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
9385 to = force_reg (SImode, XEXP (operands[0], 0));
9386 op0 = replace_equiv_address (operands[0], to);
9388 XVECEXP (operands[3], 0, 0)
9389 = gen_rtx_SET (VOIDmode, adjust_address (op0, SImode, 0), operands[1]);
9390 XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
9391 gen_rtx_SCRATCH (SImode));
9393 for (i = 1; i < count; i++)
9394 XVECEXP (operands[3], 0, i + 1)
9395 = gen_rtx_SET (VOIDmode,
9396 adjust_address (op0, SImode, i * 4),
9397 gen_rtx_REG (SImode, regno + i));
9401 [(match_parallel 0 "store_multiple_operation"
9402 [(set (match_operand:SI 1 "indirect_operand" "=Q")
9403 (match_operand:SI 2 "gpc_reg_operand" "r"))
9404 (clobber (match_scratch:SI 3 "=q"))])]
9405 "TARGET_STRING && TARGET_POWER"
9406 "{stsi|stswi} %2,%P1,%O0"
9407 [(set_attr "type" "store")])
9410 [(match_parallel 0 "store_multiple_operation"
9411 [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
9412 (match_operand:SI 2 "gpc_reg_operand" "r"))
9413 (clobber (match_scratch:SI 3 "X"))])]
9414 "TARGET_STRING && ! TARGET_POWER"
9415 "{stsi|stswi} %2,%1,%O0"
9416 [(set_attr "type" "store")])
9419 ;; String/block move insn.
9420 ;; Argument 0 is the destination
9421 ;; Argument 1 is the source
9422 ;; Argument 2 is the length
9423 ;; Argument 3 is the alignment
9425 (define_expand "movstrsi"
9426 [(parallel [(set (match_operand:BLK 0 "" "")
9427 (match_operand:BLK 1 "" ""))
9428 (use (match_operand:SI 2 "" ""))
9429 (use (match_operand:SI 3 "" ""))])]
9433 if (expand_block_move (operands))
9439 ;; Move up to 32 bytes at a time. The fixed registers are needed because the
9440 ;; register allocator doesn't have a clue about allocating 8 word registers.
9441 ;; rD/rS = r5 is preferred, efficient form.
9442 (define_expand "movstrsi_8reg"
9443 [(parallel [(set (match_operand 0 "" "")
9444 (match_operand 1 "" ""))
9445 (use (match_operand 2 "" ""))
9446 (use (match_operand 3 "" ""))
9447 (clobber (reg:SI 5))
9448 (clobber (reg:SI 6))
9449 (clobber (reg:SI 7))
9450 (clobber (reg:SI 8))
9451 (clobber (reg:SI 9))
9452 (clobber (reg:SI 10))
9453 (clobber (reg:SI 11))
9454 (clobber (reg:SI 12))
9455 (clobber (match_scratch:SI 4 ""))])]
9460 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9461 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9462 (use (match_operand:SI 2 "immediate_operand" "i"))
9463 (use (match_operand:SI 3 "immediate_operand" "i"))
9464 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9465 (clobber (reg:SI 6))
9466 (clobber (reg:SI 7))
9467 (clobber (reg:SI 8))
9468 (clobber (reg:SI 9))
9469 (clobber (reg:SI 10))
9470 (clobber (reg:SI 11))
9471 (clobber (reg:SI 12))
9472 (clobber (match_scratch:SI 5 "=q"))]
9473 "TARGET_STRING && TARGET_POWER
9474 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9475 || INTVAL (operands[2]) == 0)
9476 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9477 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9478 && REGNO (operands[4]) == 5"
9479 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9480 [(set_attr "type" "load")
9481 (set_attr "length" "8")])
9484 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9485 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9486 (use (match_operand:SI 2 "immediate_operand" "i"))
9487 (use (match_operand:SI 3 "immediate_operand" "i"))
9488 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9489 (clobber (reg:SI 6))
9490 (clobber (reg:SI 7))
9491 (clobber (reg:SI 8))
9492 (clobber (reg:SI 9))
9493 (clobber (reg:SI 10))
9494 (clobber (reg:SI 11))
9495 (clobber (reg:SI 12))
9496 (clobber (match_scratch:SI 5 "X"))]
9497 "TARGET_STRING && ! TARGET_POWER
9498 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9499 || INTVAL (operands[2]) == 0)
9500 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9501 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9502 && REGNO (operands[4]) == 5"
9503 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9504 [(set_attr "type" "load")
9505 (set_attr "length" "8")])
9508 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9509 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9510 (use (match_operand:SI 2 "immediate_operand" "i"))
9511 (use (match_operand:SI 3 "immediate_operand" "i"))
9512 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9513 (clobber (reg:SI 6))
9514 (clobber (reg:SI 7))
9515 (clobber (reg:SI 8))
9516 (clobber (reg:SI 9))
9517 (clobber (reg:SI 10))
9518 (clobber (reg:SI 11))
9519 (clobber (reg:SI 12))
9520 (clobber (match_scratch:SI 5 "X"))]
9521 "TARGET_STRING && TARGET_POWERPC64
9522 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9523 || INTVAL (operands[2]) == 0)
9524 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9525 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9526 && REGNO (operands[4]) == 5"
9527 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9528 [(set_attr "type" "load")
9529 (set_attr "length" "8")])
9531 ;; Move up to 24 bytes at a time. The fixed registers are needed because the
9532 ;; register allocator doesn't have a clue about allocating 6 word registers.
9533 ;; rD/rS = r5 is preferred, efficient form.
9534 (define_expand "movstrsi_6reg"
9535 [(parallel [(set (match_operand 0 "" "")
9536 (match_operand 1 "" ""))
9537 (use (match_operand 2 "" ""))
9538 (use (match_operand 3 "" ""))
9539 (clobber (reg:SI 5))
9540 (clobber (reg:SI 6))
9541 (clobber (reg:SI 7))
9542 (clobber (reg:SI 8))
9543 (clobber (reg:SI 9))
9544 (clobber (reg:SI 10))
9545 (clobber (match_scratch:SI 4 ""))])]
9550 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9551 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9552 (use (match_operand:SI 2 "immediate_operand" "i"))
9553 (use (match_operand:SI 3 "immediate_operand" "i"))
9554 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9555 (clobber (reg:SI 6))
9556 (clobber (reg:SI 7))
9557 (clobber (reg:SI 8))
9558 (clobber (reg:SI 9))
9559 (clobber (reg:SI 10))
9560 (clobber (match_scratch:SI 5 "=q"))]
9561 "TARGET_STRING && TARGET_POWER
9562 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24
9563 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9564 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9565 && REGNO (operands[4]) == 5"
9566 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9567 [(set_attr "type" "load")
9568 (set_attr "length" "8")])
9571 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9572 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9573 (use (match_operand:SI 2 "immediate_operand" "i"))
9574 (use (match_operand:SI 3 "immediate_operand" "i"))
9575 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9576 (clobber (reg:SI 6))
9577 (clobber (reg:SI 7))
9578 (clobber (reg:SI 8))
9579 (clobber (reg:SI 9))
9580 (clobber (reg:SI 10))
9581 (clobber (match_scratch:SI 5 "X"))]
9582 "TARGET_STRING && ! TARGET_POWER
9583 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
9584 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9585 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9586 && REGNO (operands[4]) == 5"
9587 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9588 [(set_attr "type" "load")
9589 (set_attr "length" "8")])
9592 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9593 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9594 (use (match_operand:SI 2 "immediate_operand" "i"))
9595 (use (match_operand:SI 3 "immediate_operand" "i"))
9596 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9597 (clobber (reg:SI 6))
9598 (clobber (reg:SI 7))
9599 (clobber (reg:SI 8))
9600 (clobber (reg:SI 9))
9601 (clobber (reg:SI 10))
9602 (clobber (match_scratch:SI 5 "X"))]
9603 "TARGET_STRING && TARGET_POWERPC64
9604 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
9605 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9606 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9607 && REGNO (operands[4]) == 5"
9608 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9609 [(set_attr "type" "load")
9610 (set_attr "length" "8")])
9612 ;; Move up to 16 bytes at a time, using 4 fixed registers to avoid spill
9613 ;; problems with TImode.
9614 ;; rD/rS = r5 is preferred, efficient form.
9615 (define_expand "movstrsi_4reg"
9616 [(parallel [(set (match_operand 0 "" "")
9617 (match_operand 1 "" ""))
9618 (use (match_operand 2 "" ""))
9619 (use (match_operand 3 "" ""))
9620 (clobber (reg:SI 5))
9621 (clobber (reg:SI 6))
9622 (clobber (reg:SI 7))
9623 (clobber (reg:SI 8))
9624 (clobber (match_scratch:SI 4 ""))])]
9629 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9630 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9631 (use (match_operand:SI 2 "immediate_operand" "i"))
9632 (use (match_operand:SI 3 "immediate_operand" "i"))
9633 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9634 (clobber (reg:SI 6))
9635 (clobber (reg:SI 7))
9636 (clobber (reg:SI 8))
9637 (clobber (match_scratch:SI 5 "=q"))]
9638 "TARGET_STRING && TARGET_POWER
9639 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9640 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9641 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9642 && REGNO (operands[4]) == 5"
9643 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9644 [(set_attr "type" "load")
9645 (set_attr "length" "8")])
9648 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9649 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9650 (use (match_operand:SI 2 "immediate_operand" "i"))
9651 (use (match_operand:SI 3 "immediate_operand" "i"))
9652 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9653 (clobber (reg:SI 6))
9654 (clobber (reg:SI 7))
9655 (clobber (reg:SI 8))
9656 (clobber (match_scratch:SI 5 "X"))]
9657 "TARGET_STRING && ! TARGET_POWER
9658 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9659 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9660 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9661 && REGNO (operands[4]) == 5"
9662 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9663 [(set_attr "type" "load")
9664 (set_attr "length" "8")])
9667 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9668 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9669 (use (match_operand:SI 2 "immediate_operand" "i"))
9670 (use (match_operand:SI 3 "immediate_operand" "i"))
9671 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9672 (clobber (reg:SI 6))
9673 (clobber (reg:SI 7))
9674 (clobber (reg:SI 8))
9675 (clobber (match_scratch:SI 5 "X"))]
9676 "TARGET_STRING && TARGET_POWERPC64
9677 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9678 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9679 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9680 && REGNO (operands[4]) == 5"
9681 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9682 [(set_attr "type" "load")
9683 (set_attr "length" "8")])
9685 ;; Move up to 8 bytes at a time.
9686 (define_expand "movstrsi_2reg"
9687 [(parallel [(set (match_operand 0 "" "")
9688 (match_operand 1 "" ""))
9689 (use (match_operand 2 "" ""))
9690 (use (match_operand 3 "" ""))
9691 (clobber (match_scratch:DI 4 ""))
9692 (clobber (match_scratch:SI 5 ""))])]
9693 "TARGET_STRING && ! TARGET_POWERPC64"
9697 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9698 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9699 (use (match_operand:SI 2 "immediate_operand" "i"))
9700 (use (match_operand:SI 3 "immediate_operand" "i"))
9701 (clobber (match_scratch:DI 4 "=&r"))
9702 (clobber (match_scratch:SI 5 "=q"))]
9703 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
9704 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9705 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9706 [(set_attr "type" "load")
9707 (set_attr "length" "8")])
9710 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9711 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9712 (use (match_operand:SI 2 "immediate_operand" "i"))
9713 (use (match_operand:SI 3 "immediate_operand" "i"))
9714 (clobber (match_scratch:DI 4 "=&r"))
9715 (clobber (match_scratch:SI 5 "X"))]
9716 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
9717 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9718 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9719 [(set_attr "type" "load")
9720 (set_attr "length" "8")])
9722 ;; Move up to 4 bytes at a time.
9723 (define_expand "movstrsi_1reg"
9724 [(parallel [(set (match_operand 0 "" "")
9725 (match_operand 1 "" ""))
9726 (use (match_operand 2 "" ""))
9727 (use (match_operand 3 "" ""))
9728 (clobber (match_scratch:SI 4 ""))
9729 (clobber (match_scratch:SI 5 ""))])]
9734 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9735 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9736 (use (match_operand:SI 2 "immediate_operand" "i"))
9737 (use (match_operand:SI 3 "immediate_operand" "i"))
9738 (clobber (match_scratch:SI 4 "=&r"))
9739 (clobber (match_scratch:SI 5 "=q"))]
9740 "TARGET_STRING && TARGET_POWER
9741 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9742 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9743 [(set_attr "type" "load")
9744 (set_attr "length" "8")])
9747 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9748 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9749 (use (match_operand:SI 2 "immediate_operand" "i"))
9750 (use (match_operand:SI 3 "immediate_operand" "i"))
9751 (clobber (match_scratch:SI 4 "=&r"))
9752 (clobber (match_scratch:SI 5 "X"))]
9753 "TARGET_STRING && ! TARGET_POWER
9754 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9755 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9756 [(set_attr "type" "load")
9757 (set_attr "length" "8")])
9760 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9761 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9762 (use (match_operand:SI 2 "immediate_operand" "i"))
9763 (use (match_operand:SI 3 "immediate_operand" "i"))
9764 (clobber (match_scratch:SI 4 "=&r"))
9765 (clobber (match_scratch:SI 5 "X"))]
9766 "TARGET_STRING && TARGET_POWERPC64
9767 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9768 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9769 [(set_attr "type" "load")
9770 (set_attr "length" "8")])
9773 ;; Define insns that do load or store with update. Some of these we can
9774 ;; get by using pre-decrement or pre-increment, but the hardware can also
9775 ;; do cases where the increment is not the size of the object.
9777 ;; In all these cases, we use operands 0 and 1 for the register being
9778 ;; incremented because those are the operands that local-alloc will
9779 ;; tie and these are the pair most likely to be tieable (and the ones
9780 ;; that will benefit the most).
9782 (define_insn "*movdi_update1"
9783 [(set (match_operand:DI 3 "gpc_reg_operand" "=r,r")
9784 (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9785 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I"))))
9786 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9787 (plus:DI (match_dup 1) (match_dup 2)))]
9788 "TARGET_POWERPC64 && TARGET_UPDATE"
9792 [(set_attr "type" "load")])
9794 (define_insn "*movdi_update2"
9795 [(set (match_operand:DI 3 "gpc_reg_operand" "=r")
9797 (mem:SI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0")
9798 (match_operand:DI 2 "gpc_reg_operand" "r")))))
9799 (set (match_operand:DI 0 "gpc_reg_operand" "=b")
9800 (plus:DI (match_dup 1) (match_dup 2)))]
9803 [(set_attr "type" "load")])
9805 (define_insn "movdi_update"
9806 [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9807 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I")))
9808 (match_operand:DI 3 "gpc_reg_operand" "r,r"))
9809 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9810 (plus:DI (match_dup 1) (match_dup 2)))]
9811 "TARGET_POWERPC64 && TARGET_UPDATE"
9815 [(set_attr "type" "store")])
9817 (define_insn "*movsi_update1"
9818 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9819 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9820 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9821 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9822 (plus:SI (match_dup 1) (match_dup 2)))]
9825 {lux|lwzux} %3,%0,%2
9826 {lu|lwzu} %3,%2(%0)"
9827 [(set_attr "type" "load")])
9829 (define_insn "movsi_update"
9830 [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9831 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9832 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
9833 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9834 (plus:SI (match_dup 1) (match_dup 2)))]
9837 {stux|stwux} %3,%0,%2
9838 {stu|stwu} %3,%2(%0)"
9839 [(set_attr "type" "store")])
9841 (define_insn "*movhi_update"
9842 [(set (match_operand:HI 3 "gpc_reg_operand" "=r,r")
9843 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9844 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9845 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9846 (plus:SI (match_dup 1) (match_dup 2)))]
9851 [(set_attr "type" "load")])
9853 (define_insn "*movhi_update2"
9854 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9856 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9857 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9858 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9859 (plus:SI (match_dup 1) (match_dup 2)))]
9864 [(set_attr "type" "load")])
9866 (define_insn "*movhi_update3"
9867 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9869 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9870 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9871 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9872 (plus:SI (match_dup 1) (match_dup 2)))]
9877 [(set_attr "type" "load")])
9879 (define_insn "*movhi_update4"
9880 [(set (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9881 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9882 (match_operand:HI 3 "gpc_reg_operand" "r,r"))
9883 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9884 (plus:SI (match_dup 1) (match_dup 2)))]
9889 [(set_attr "type" "store")])
9891 (define_insn "*movqi_update1"
9892 [(set (match_operand:QI 3 "gpc_reg_operand" "=r,r")
9893 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9894 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9895 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9896 (plus:SI (match_dup 1) (match_dup 2)))]
9901 [(set_attr "type" "load")])
9903 (define_insn "*movqi_update2"
9904 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9906 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9907 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9908 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9909 (plus:SI (match_dup 1) (match_dup 2)))]
9914 [(set_attr "type" "load")])
9916 (define_insn "*movqi_update3"
9917 [(set (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9918 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9919 (match_operand:QI 3 "gpc_reg_operand" "r,r"))
9920 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9921 (plus:SI (match_dup 1) (match_dup 2)))]
9926 [(set_attr "type" "store")])
9928 (define_insn "*movsf_update1"
9929 [(set (match_operand:SF 3 "gpc_reg_operand" "=f,f")
9930 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9931 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9932 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9933 (plus:SI (match_dup 1) (match_dup 2)))]
9934 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_UPDATE"
9938 [(set_attr "type" "fpload")])
9940 (define_insn "*movsf_update2"
9941 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9942 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9943 (match_operand:SF 3 "gpc_reg_operand" "f,f"))
9944 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9945 (plus:SI (match_dup 1) (match_dup 2)))]
9946 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_UPDATE"
9950 [(set_attr "type" "fpstore")])
9952 (define_insn "*movsf_update3"
9953 [(set (match_operand:SF 3 "gpc_reg_operand" "=r,r")
9954 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9955 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9956 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9957 (plus:SI (match_dup 1) (match_dup 2)))]
9958 "(TARGET_SOFT_FLOAT || !TARGET_FPRS) && TARGET_UPDATE"
9960 {lux|lwzux} %3,%0,%2
9961 {lu|lwzu} %3,%2(%0)"
9962 [(set_attr "type" "load")])
9964 (define_insn "*movsf_update4"
9965 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9966 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9967 (match_operand:SF 3 "gpc_reg_operand" "r,r"))
9968 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9969 (plus:SI (match_dup 1) (match_dup 2)))]
9970 "(TARGET_SOFT_FLOAT || !TARGET_FPRS) && TARGET_UPDATE"
9972 {stux|stwux} %3,%0,%2
9973 {stu|stwu} %3,%2(%0)"
9974 [(set_attr "type" "store")])
9976 (define_insn "*movdf_update1"
9977 [(set (match_operand:DF 3 "gpc_reg_operand" "=f,f")
9978 (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9979 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9980 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9981 (plus:SI (match_dup 1) (match_dup 2)))]
9982 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_UPDATE"
9986 [(set_attr "type" "fpload")])
9988 (define_insn "*movdf_update2"
9989 [(set (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9990 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9991 (match_operand:DF 3 "gpc_reg_operand" "f,f"))
9992 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9993 (plus:SI (match_dup 1) (match_dup 2)))]
9994 "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_UPDATE"
9998 [(set_attr "type" "fpstore")])
10000 ;; Peephole to convert two consecutive FP loads or stores into lfq/stfq.
10003 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
10004 (match_operand:DF 1 "memory_operand" ""))
10005 (set (match_operand:DF 2 "gpc_reg_operand" "=f")
10006 (match_operand:DF 3 "memory_operand" ""))]
10008 && TARGET_HARD_FLOAT && TARGET_FPRS
10009 && registers_ok_for_quad_peep (operands[0], operands[2])
10010 && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
10011 && addrs_ok_for_quad_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
10015 [(set (match_operand:DF 0 "memory_operand" "")
10016 (match_operand:DF 1 "gpc_reg_operand" "f"))
10017 (set (match_operand:DF 2 "memory_operand" "")
10018 (match_operand:DF 3 "gpc_reg_operand" "f"))]
10020 && TARGET_HARD_FLOAT && TARGET_FPRS
10021 && registers_ok_for_quad_peep (operands[1], operands[3])
10022 && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
10023 && addrs_ok_for_quad_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
10024 "stfq%U0%X0 %1,%0")
10026 ;; Next come insns related to the calling sequence.
10028 ;; First, an insn to allocate new stack space for dynamic use (e.g., alloca).
10029 ;; We move the back-chain and decrement the stack pointer.
10031 (define_expand "allocate_stack"
10032 [(set (match_operand 0 "gpc_reg_operand" "=r")
10033 (minus (reg 1) (match_operand 1 "reg_or_short_operand" "")))
10035 (minus (reg 1) (match_dup 1)))]
10038 { rtx chain = gen_reg_rtx (Pmode);
10039 rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
10042 emit_move_insn (chain, stack_bot);
10044 /* Check stack bounds if necessary. */
10045 if (current_function_limit_stack)
10048 available = expand_binop (Pmode, sub_optab,
10049 stack_pointer_rtx, stack_limit_rtx,
10050 NULL_RTX, 1, OPTAB_WIDEN);
10051 emit_insn (gen_cond_trap (LTU, available, operands[1], const0_rtx));
10054 if (GET_CODE (operands[1]) != CONST_INT
10055 || INTVAL (operands[1]) < -32767
10056 || INTVAL (operands[1]) > 32768)
10058 neg_op0 = gen_reg_rtx (Pmode);
10060 emit_insn (gen_negsi2 (neg_op0, operands[1]));
10062 emit_insn (gen_negdi2 (neg_op0, operands[1]));
10065 neg_op0 = GEN_INT (- INTVAL (operands[1]));
10068 emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_update))
10069 (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain));
10073 emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
10074 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
10075 emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
10078 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
10082 ;; These patterns say how to save and restore the stack pointer. We need not
10083 ;; save the stack pointer at function level since we are careful to
10084 ;; preserve the backchain. At block level, we have to restore the backchain
10085 ;; when we restore the stack pointer.
10087 ;; For nonlocal gotos, we must save both the stack pointer and its
10088 ;; backchain and restore both. Note that in the nonlocal case, the
10089 ;; save area is a memory location.
10091 (define_expand "save_stack_function"
10092 [(match_operand 0 "any_operand" "")
10093 (match_operand 1 "any_operand" "")]
10097 (define_expand "restore_stack_function"
10098 [(match_operand 0 "any_operand" "")
10099 (match_operand 1 "any_operand" "")]
10103 (define_expand "restore_stack_block"
10104 [(use (match_operand 0 "register_operand" ""))
10105 (set (match_dup 2) (match_dup 3))
10106 (set (match_dup 0) (match_operand 1 "register_operand" ""))
10107 (set (match_dup 3) (match_dup 2))]
10111 operands[2] = gen_reg_rtx (Pmode);
10112 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
10115 (define_expand "save_stack_nonlocal"
10116 [(match_operand 0 "memory_operand" "")
10117 (match_operand 1 "register_operand" "")]
10121 rtx temp = gen_reg_rtx (Pmode);
10123 /* Copy the backchain to the first word, sp to the second. */
10124 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
10125 emit_move_insn (operand_subword (operands[0], 0, 0,
10126 (TARGET_32BIT ? DImode : TImode)),
10128 emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
10133 (define_expand "restore_stack_nonlocal"
10134 [(match_operand 0 "register_operand" "")
10135 (match_operand 1 "memory_operand" "")]
10139 rtx temp = gen_reg_rtx (Pmode);
10141 /* Restore the backchain from the first word, sp from the second. */
10142 emit_move_insn (temp,
10143 operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
10144 emit_move_insn (operands[0],
10145 operand_subword (operands[1], 1, 0,
10146 (TARGET_32BIT ? DImode : TImode)));
10147 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
10151 ;; TOC register handling.
10153 ;; Code to initialize the TOC register...
10155 (define_insn "load_toc_aix_si"
10156 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10157 (unspec:SI [(const_int 0)] 7))
10158 (use (reg:SI 2))])]
10159 "DEFAULT_ABI == ABI_AIX && TARGET_32BIT"
10163 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
10164 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
10165 operands[2] = gen_rtx_REG (Pmode, 2);
10166 return \"{l|lwz} %0,%1(%2)\";
10168 [(set_attr "type" "load")])
10170 (define_insn "load_toc_aix_di"
10171 [(parallel [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10172 (unspec:DI [(const_int 0)] 7))
10173 (use (reg:DI 2))])]
10174 "DEFAULT_ABI == ABI_AIX && TARGET_64BIT"
10178 #ifdef TARGET_RELOCATABLE
10179 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\",
10180 !TARGET_MINIMAL_TOC || TARGET_RELOCATABLE);
10182 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
10185 strcat (buf, \"@toc\");
10186 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
10187 operands[2] = gen_rtx_REG (Pmode, 2);
10188 return \"ld %0,%1(%2)\";
10190 [(set_attr "type" "load")])
10192 (define_insn "load_toc_v4_pic_si"
10193 [(set (match_operand:SI 0 "register_operand" "=l")
10194 (unspec:SI [(const_int 0)] 7))]
10195 "DEFAULT_ABI == ABI_V4 && flag_pic == 1 && TARGET_32BIT"
10196 "bl _GLOBAL_OFFSET_TABLE_@local-4"
10197 [(set_attr "type" "branch")
10198 (set_attr "length" "4")])
10200 (define_insn "load_toc_v4_PIC_1"
10201 [(set (match_operand:SI 0 "register_operand" "=l")
10202 (match_operand:SI 1 "immediate_operand" "s"))
10203 (unspec [(match_dup 1)] 7)]
10204 "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
10206 [(set_attr "type" "branch")
10207 (set_attr "length" "4")])
10209 (define_insn "load_toc_v4_PIC_1b"
10210 [(set (match_operand:SI 0 "register_operand" "=l")
10211 (match_operand:SI 1 "immediate_operand" "s"))
10212 (unspec [(match_dup 1) (match_operand 2 "immediate_operand" "s")] 6)]
10213 "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
10214 "bl %1\\n\\t.long %2-%1+4\\n%1:"
10215 [(set_attr "type" "branch")
10216 (set_attr "length" "8")])
10218 (define_insn "load_toc_v4_PIC_2"
10219 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10220 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r")
10221 (minus:SI (match_operand:SI 2 "immediate_operand" "s")
10222 (match_operand:SI 3 "immediate_operand" "s")))))]
10223 "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
10224 "{l|lwz} %0,%2-%3(%1)"
10225 [(set_attr "type" "load")])
10227 (define_insn "load_macho_picbase"
10228 [(set (match_operand:SI 0 "register_operand" "=l")
10229 (unspec:SI [(match_operand:SI 1 "immediate_operand" "s")] 15))]
10230 "(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
10231 "bcl 20,31,%1\\n%1:"
10232 [(set_attr "type" "branch")
10233 (set_attr "length" "4")])
10235 (define_insn "macho_correct_pic"
10236 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10237 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "=r")
10238 (unspec:SI [(match_operand:SI 2 "immediate_operand" "s")
10239 (match_operand:SI 3 "immediate_operand" "s")]
10241 "DEFAULT_ABI == ABI_DARWIN"
10242 "addis %0,%1,ha16(%2-%3)\n\taddi %1,%1,lo16(%2-%3)"
10243 [(set_attr "length" "8")])
10245 ;; If the TOC is shared over a translation unit, as happens with all
10246 ;; the kinds of PIC that we support, we need to restore the TOC
10247 ;; pointer only when jumping over units of translation.
10248 ;; On Darwin, we need to reload the picbase.
10250 (define_expand "builtin_setjmp_receiver"
10251 [(use (label_ref (match_operand 0 "" "")))]
10252 "(DEFAULT_ABI == ABI_V4 && flag_pic == 1)
10253 || (TARGET_TOC && TARGET_MINIMAL_TOC)
10254 || (DEFAULT_ABI == ABI_DARWIN && flag_pic)"
10258 if (DEFAULT_ABI == ABI_DARWIN)
10260 char *picbase = machopic_function_base_name ();
10261 rtx picrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
10262 rtx picreg = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
10266 ASM_GENERATE_INTERNAL_LABEL(tmplab, \"LSJR\",
10267 CODE_LABEL_NUMBER (operands[0]));
10268 tmplabrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (tmplab, -1));
10270 emit_insn (gen_load_macho_picbase (picreg, tmplabrtx));
10271 emit_insn (gen_macho_correct_pic (picreg, picreg, picrtx, tmplabrtx));
10275 rs6000_emit_load_toc_table (FALSE);
10279 ;; A function pointer under AIX is a pointer to a data area whose first word
10280 ;; contains the actual address of the function, whose second word contains a
10281 ;; pointer to its TOC, and whose third word contains a value to place in the
10282 ;; static chain register (r11). Note that if we load the static chain, our
10283 ;; "trampoline" need not have any executable code.
10285 (define_expand "call_indirect_aix32"
10286 [(set (match_dup 2)
10287 (mem:SI (match_operand:SI 0 "gpc_reg_operand" "")))
10288 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
10291 (mem:SI (plus:SI (match_dup 0)
10294 (mem:SI (plus:SI (match_dup 0)
10296 (parallel [(call (mem:SI (match_dup 2))
10297 (match_operand 1 "" ""))
10301 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10302 (clobber (scratch:SI))])]
10305 { operands[2] = gen_reg_rtx (SImode); }")
10307 (define_expand "call_indirect_aix64"
10308 [(set (match_dup 2)
10309 (mem:DI (match_operand:DI 0 "gpc_reg_operand" "")))
10310 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
10313 (mem:DI (plus:DI (match_dup 0)
10316 (mem:DI (plus:DI (match_dup 0)
10318 (parallel [(call (mem:SI (match_dup 2))
10319 (match_operand 1 "" ""))
10323 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10324 (clobber (scratch:SI))])]
10327 { operands[2] = gen_reg_rtx (DImode); }")
10329 (define_expand "call_value_indirect_aix32"
10330 [(set (match_dup 3)
10331 (mem:SI (match_operand:SI 1 "gpc_reg_operand" "")))
10332 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
10335 (mem:SI (plus:SI (match_dup 1)
10338 (mem:SI (plus:SI (match_dup 1)
10340 (parallel [(set (match_operand 0 "" "")
10341 (call (mem:SI (match_dup 3))
10342 (match_operand 2 "" "")))
10346 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10347 (clobber (scratch:SI))])]
10350 { operands[3] = gen_reg_rtx (SImode); }")
10352 (define_expand "call_value_indirect_aix64"
10353 [(set (match_dup 3)
10354 (mem:DI (match_operand:DI 1 "gpc_reg_operand" "")))
10355 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
10358 (mem:DI (plus:DI (match_dup 1)
10361 (mem:DI (plus:DI (match_dup 1)
10363 (parallel [(set (match_operand 0 "" "")
10364 (call (mem:SI (match_dup 3))
10365 (match_operand 2 "" "")))
10369 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10370 (clobber (scratch:SI))])]
10373 { operands[3] = gen_reg_rtx (DImode); }")
10375 ;; Now the definitions for the call and call_value insns
10376 (define_expand "call"
10377 [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
10378 (match_operand 1 "" ""))
10379 (use (match_operand 2 "" ""))
10380 (clobber (scratch:SI))])]
10386 operands[0] = machopic_indirect_call_target (operands[0]);
10389 if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
10392 operands[0] = XEXP (operands[0], 0);
10394 if (GET_CODE (operands[0]) != SYMBOL_REF
10395 || (INTVAL (operands[2]) & CALL_LONG) != 0)
10397 if (INTVAL (operands[2]) & CALL_LONG)
10398 operands[0] = rs6000_longcall_ref (operands[0]);
10400 if (DEFAULT_ABI == ABI_V4
10401 || DEFAULT_ABI == ABI_AIX_NODESC
10402 || DEFAULT_ABI == ABI_DARWIN)
10403 operands[0] = force_reg (Pmode, operands[0]);
10405 else if (DEFAULT_ABI == ABI_AIX)
10407 /* AIX function pointers are really pointers to a three word
10409 emit_call_insn (TARGET_32BIT
10410 ? gen_call_indirect_aix32 (force_reg (SImode,
10413 : gen_call_indirect_aix64 (force_reg (DImode,
10423 (define_expand "call_value"
10424 [(parallel [(set (match_operand 0 "" "")
10425 (call (mem:SI (match_operand 1 "address_operand" ""))
10426 (match_operand 2 "" "")))
10427 (use (match_operand 3 "" ""))
10428 (clobber (scratch:SI))])]
10434 operands[1] = machopic_indirect_call_target (operands[1]);
10437 if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
10440 operands[1] = XEXP (operands[1], 0);
10442 if (GET_CODE (operands[1]) != SYMBOL_REF
10443 || (INTVAL (operands[3]) & CALL_LONG) != 0)
10445 if (INTVAL (operands[3]) & CALL_LONG)
10446 operands[1] = rs6000_longcall_ref (operands[1]);
10448 if (DEFAULT_ABI == ABI_V4
10449 || DEFAULT_ABI == ABI_AIX_NODESC
10450 || DEFAULT_ABI == ABI_DARWIN)
10451 operands[0] = force_reg (Pmode, operands[0]);
10453 else if (DEFAULT_ABI == ABI_AIX)
10455 /* AIX function pointers are really pointers to a three word
10457 emit_call_insn (TARGET_32BIT
10458 ? gen_call_value_indirect_aix32 (operands[0],
10462 : gen_call_value_indirect_aix64 (operands[0],
10473 ;; Call to function in current module. No TOC pointer reload needed.
10474 ;; Operand2 is nonzero if we are using the V.4 calling sequence and
10475 ;; either the function was not prototyped, or it was prototyped as a
10476 ;; variable argument function. It is > 0 if FP registers were passed
10477 ;; and < 0 if they were not.
10479 (define_insn "*call_local32"
10480 [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
10481 (match_operand 1 "" "g,g"))
10482 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10483 (clobber (match_scratch:SI 3 "=l,l"))]
10484 "(INTVAL (operands[2]) & CALL_LONG) == 0"
10487 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10488 output_asm_insn (\"crxor 6,6,6\", operands);
10490 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10491 output_asm_insn (\"creqv 6,6,6\", operands);
10493 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
10495 [(set_attr "type" "branch")
10496 (set_attr "length" "4,8")])
10498 (define_insn "*call_local64"
10499 [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
10500 (match_operand 1 "" "g,g"))
10501 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10502 (clobber (match_scratch:SI 3 "=l,l"))]
10503 "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
10506 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10507 output_asm_insn (\"crxor 6,6,6\", operands);
10509 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10510 output_asm_insn (\"creqv 6,6,6\", operands);
10512 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
10514 [(set_attr "type" "branch")
10515 (set_attr "length" "4,8")])
10517 (define_insn "*call_value_local32"
10518 [(set (match_operand 0 "" "")
10519 (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
10520 (match_operand 2 "" "g,g")))
10521 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10522 (clobber (match_scratch:SI 4 "=l,l"))]
10523 "(INTVAL (operands[3]) & CALL_LONG) == 0"
10526 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10527 output_asm_insn (\"crxor 6,6,6\", operands);
10529 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10530 output_asm_insn (\"creqv 6,6,6\", operands);
10532 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
10534 [(set_attr "type" "branch")
10535 (set_attr "length" "4,8")])
10538 (define_insn "*call_value_local64"
10539 [(set (match_operand 0 "" "")
10540 (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
10541 (match_operand 2 "" "g,g")))
10542 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10543 (clobber (match_scratch:SI 4 "=l,l"))]
10544 "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
10547 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10548 output_asm_insn (\"crxor 6,6,6\", operands);
10550 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10551 output_asm_insn (\"creqv 6,6,6\", operands);
10553 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
10555 [(set_attr "type" "branch")
10556 (set_attr "length" "4,8")])
10558 ;; Call to function which may be in another module. Restore the TOC
10559 ;; pointer (r2) after the call unless this is System V.
10560 ;; Operand2 is nonzero if we are using the V.4 calling sequence and
10561 ;; either the function was not prototyped, or it was prototyped as a
10562 ;; variable argument function. It is > 0 if FP registers were passed
10563 ;; and < 0 if they were not.
10565 (define_insn "*call_indirect_nonlocal_aix32"
10566 [(call (mem:SI (match_operand:SI 0 "register_operand" "cl"))
10567 (match_operand 1 "" "g"))
10571 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10572 (clobber (match_scratch:SI 2 "=l"))]
10573 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
10574 "b%T0l\;{l|lwz} 2,20(1)"
10575 [(set_attr "type" "jmpreg")
10576 (set_attr "length" "8")])
10578 (define_insn "*call_nonlocal_aix32"
10579 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
10580 (match_operand 1 "" "g"))
10581 (use (match_operand:SI 2 "immediate_operand" "O"))
10582 (clobber (match_scratch:SI 3 "=l"))]
10584 && DEFAULT_ABI == ABI_AIX
10585 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10587 [(set_attr "type" "branch")
10588 (set_attr "length" "8")])
10590 (define_insn "*call_indirect_nonlocal_aix64"
10591 [(call (mem:SI (match_operand:DI 0 "register_operand" "cl"))
10592 (match_operand 1 "" "g"))
10596 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10597 (clobber (match_scratch:SI 2 "=l"))]
10598 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
10599 "b%T0l\;ld 2,40(1)"
10600 [(set_attr "type" "jmpreg")
10601 (set_attr "length" "8")])
10603 (define_insn "*call_nonlocal_aix64"
10604 [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
10605 (match_operand 1 "" "g"))
10606 (use (match_operand:SI 2 "immediate_operand" "O"))
10607 (clobber (match_scratch:SI 3 "=l"))]
10609 && DEFAULT_ABI == ABI_AIX
10610 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10612 [(set_attr "type" "branch")
10613 (set_attr "length" "8")])
10615 (define_insn "*call_value_indirect_nonlocal_aix32"
10616 [(set (match_operand 0 "" "")
10617 (call (mem:SI (match_operand:SI 1 "register_operand" "cl"))
10618 (match_operand 2 "" "g")))
10622 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10623 (clobber (match_scratch:SI 3 "=l"))]
10624 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
10625 "b%T1l\;{l|lwz} 2,20(1)"
10626 [(set_attr "type" "jmpreg")
10627 (set_attr "length" "8")])
10629 (define_insn "*call_value_nonlocal_aix32"
10630 [(set (match_operand 0 "" "")
10631 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
10632 (match_operand 2 "" "g")))
10633 (use (match_operand:SI 3 "immediate_operand" "O"))
10634 (clobber (match_scratch:SI 4 "=l"))]
10636 && DEFAULT_ABI == ABI_AIX
10637 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10639 [(set_attr "type" "branch")
10640 (set_attr "length" "8")])
10642 (define_insn "*call_value_indirect_nonlocal_aix64"
10643 [(set (match_operand 0 "" "")
10644 (call (mem:SI (match_operand:DI 1 "register_operand" "cl"))
10645 (match_operand 2 "" "g")))
10649 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10650 (clobber (match_scratch:SI 3 "=l"))]
10651 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
10652 "b%T1l\;ld 2,40(1)"
10653 [(set_attr "type" "jmpreg")
10654 (set_attr "length" "8")])
10656 (define_insn "*call_value_nonlocal_aix64"
10657 [(set (match_operand 0 "" "")
10658 (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
10659 (match_operand 2 "" "g")))
10660 (use (match_operand:SI 3 "immediate_operand" "O"))
10661 (clobber (match_scratch:SI 4 "=l"))]
10663 && DEFAULT_ABI == ABI_AIX
10664 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10666 [(set_attr "type" "branch")
10667 (set_attr "length" "8")])
10669 ;; A function pointer under System V is just a normal pointer
10670 ;; operands[0] is the function pointer
10671 ;; operands[1] is the stack size to clean up
10672 ;; operands[2] is the value FUNCTION_ARG returns for the VOID argument
10673 ;; which indicates how to set cr1
10675 (define_insn "*call_indirect_nonlocal_sysv"
10676 [(call (mem:SI (match_operand:SI 0 "register_operand" "cl,cl"))
10677 (match_operand 1 "" "g,g"))
10678 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10679 (clobber (match_scratch:SI 3 "=l,l"))]
10680 "DEFAULT_ABI == ABI_AIX_NODESC
10681 || DEFAULT_ABI == ABI_V4
10682 || DEFAULT_ABI == ABI_DARWIN"
10684 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10685 output_asm_insn ("crxor 6,6,6", operands);
10687 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10688 output_asm_insn ("creqv 6,6,6", operands);
10692 [(set_attr "type" "jmpreg,jmpreg")
10693 (set_attr "length" "4,8")])
10695 (define_insn "*call_nonlocal_sysv"
10696 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
10697 (match_operand 1 "" "g,g"))
10698 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10699 (clobber (match_scratch:SI 3 "=l,l"))]
10700 "(DEFAULT_ABI == ABI_AIX_NODESC
10701 || DEFAULT_ABI == ABI_V4
10702 || DEFAULT_ABI == ABI_DARWIN)
10703 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10705 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10706 output_asm_insn ("crxor 6,6,6", operands);
10708 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10709 output_asm_insn ("creqv 6,6,6", operands);
10711 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@plt" : "bl %z0";
10713 [(set_attr "type" "branch,branch")
10714 (set_attr "length" "4,8")])
10716 (define_insn "*call_value_indirect_nonlocal_sysv"
10717 [(set (match_operand 0 "" "")
10718 (call (mem:SI (match_operand:SI 1 "register_operand" "cl,cl"))
10719 (match_operand 2 "" "g,g")))
10720 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10721 (clobber (match_scratch:SI 4 "=l,l"))]
10722 "DEFAULT_ABI == ABI_AIX_NODESC
10723 || DEFAULT_ABI == ABI_V4
10724 || DEFAULT_ABI == ABI_DARWIN"
10726 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10727 output_asm_insn ("crxor 6,6,6", operands);
10729 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10730 output_asm_insn ("creqv 6,6,6", operands);
10734 [(set_attr "type" "jmpreg,jmpreg")
10735 (set_attr "length" "4,8")])
10737 (define_insn "*call_value_nonlocal_sysv"
10738 [(set (match_operand 0 "" "")
10739 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s"))
10740 (match_operand 2 "" "g,g")))
10741 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10742 (clobber (match_scratch:SI 4 "=l,l"))]
10743 "(DEFAULT_ABI == ABI_AIX_NODESC
10744 || DEFAULT_ABI == ABI_V4
10745 || DEFAULT_ABI == ABI_DARWIN)
10746 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10748 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10749 output_asm_insn ("crxor 6,6,6", operands);
10751 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10752 output_asm_insn ("creqv 6,6,6", operands);
10754 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@plt" : "bl %z1";
10756 [(set_attr "type" "branch,branch")
10757 (set_attr "length" "4,8")])
10759 ;; Call subroutine returning any type.
10760 (define_expand "untyped_call"
10761 [(parallel [(call (match_operand 0 "" "")
10763 (match_operand 1 "" "")
10764 (match_operand 2 "" "")])]
10770 emit_call_insn (GEN_CALL (operands[0], const0_rtx, const0_rtx, const0_rtx));
10772 for (i = 0; i < XVECLEN (operands[2], 0); i++)
10774 rtx set = XVECEXP (operands[2], 0, i);
10775 emit_move_insn (SET_DEST (set), SET_SRC (set));
10778 /* The optimizer does not know that the call sets the function value
10779 registers we stored in the result block. We avoid problems by
10780 claiming that all hard registers are used and clobbered at this
10782 emit_insn (gen_blockage ());
10787 ;; sibling call patterns
10788 (define_expand "sibcall"
10789 [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
10790 (match_operand 1 "" ""))
10791 (use (match_operand 2 "" ""))
10799 operands[0] = machopic_indirect_call_target (operands[0]);
10802 if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
10805 operands[0] = XEXP (operands[0], 0);
10809 ;; this and similar patterns must be marked as using LR, otherwise
10810 ;; dataflow will try to delete the store into it. This is true
10811 ;; even when the actual reg to jump to is in CTR, when LR was
10812 ;; saved and restored around the PIC-setting BCL.
10813 (define_insn "*sibcall_local32"
10814 [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
10815 (match_operand 1 "" "g,g"))
10816 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10817 (use (match_scratch:SI 3 "=l,l"))
10819 "(INTVAL (operands[2]) & CALL_LONG) == 0"
10822 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10823 output_asm_insn (\"crxor 6,6,6\", operands);
10825 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10826 output_asm_insn (\"creqv 6,6,6\", operands);
10828 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z0@local\" : \"b %z0\";
10830 [(set_attr "type" "branch")
10831 (set_attr "length" "4,8")])
10833 (define_insn "*sibcall_local64"
10834 [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
10835 (match_operand 1 "" "g,g"))
10836 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10837 (use (match_scratch:SI 3 "=l,l"))
10839 "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
10842 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10843 output_asm_insn (\"crxor 6,6,6\", operands);
10845 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10846 output_asm_insn (\"creqv 6,6,6\", operands);
10848 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z0@local\" : \"b %z0\";
10850 [(set_attr "type" "branch")
10851 (set_attr "length" "4,8")])
10853 (define_insn "*sibcall_value_local32"
10854 [(set (match_operand 0 "" "")
10855 (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
10856 (match_operand 2 "" "g,g")))
10857 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10858 (use (match_scratch:SI 4 "=l,l"))
10860 "(INTVAL (operands[3]) & CALL_LONG) == 0"
10863 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10864 output_asm_insn (\"crxor 6,6,6\", operands);
10866 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10867 output_asm_insn (\"creqv 6,6,6\", operands);
10869 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z1@local\" : \"b %z1\";
10871 [(set_attr "type" "branch")
10872 (set_attr "length" "4,8")])
10875 (define_insn "*sibcall_value_local64"
10876 [(set (match_operand 0 "" "")
10877 (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
10878 (match_operand 2 "" "g,g")))
10879 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10880 (use (match_scratch:SI 4 "=l,l"))
10882 "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
10885 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10886 output_asm_insn (\"crxor 6,6,6\", operands);
10888 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10889 output_asm_insn (\"creqv 6,6,6\", operands);
10891 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z1@local\" : \"b %z1\";
10893 [(set_attr "type" "branch")
10894 (set_attr "length" "4,8")])
10896 (define_insn "*sibcall_nonlocal_aix32"
10897 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
10898 (match_operand 1 "" "g"))
10899 (use (match_operand:SI 2 "immediate_operand" "O"))
10900 (use (match_scratch:SI 3 "=l"))
10903 && DEFAULT_ABI == ABI_AIX
10904 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10906 [(set_attr "type" "branch")
10907 (set_attr "length" "4")])
10909 (define_insn "*sibcall_nonlocal_aix64"
10910 [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
10911 (match_operand 1 "" "g"))
10912 (use (match_operand:SI 2 "immediate_operand" "O"))
10913 (use (match_scratch:SI 3 "=l"))
10916 && DEFAULT_ABI == ABI_AIX
10917 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10919 [(set_attr "type" "branch")
10920 (set_attr "length" "4")])
10922 (define_insn "*sibcall_value_nonlocal_aix32"
10923 [(set (match_operand 0 "" "")
10924 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
10925 (match_operand 2 "" "g")))
10926 (use (match_operand:SI 3 "immediate_operand" "O"))
10927 (use (match_scratch:SI 4 "=l"))
10930 && DEFAULT_ABI == ABI_AIX
10931 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10933 [(set_attr "type" "branch")
10934 (set_attr "length" "4")])
10936 (define_insn "*sibcall_value_nonlocal_aix64"
10937 [(set (match_operand 0 "" "")
10938 (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
10939 (match_operand 2 "" "g")))
10940 (use (match_operand:SI 3 "immediate_operand" "O"))
10941 (use (match_scratch:SI 4 "=l"))
10944 && DEFAULT_ABI == ABI_AIX
10945 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10947 [(set_attr "type" "branch")
10948 (set_attr "length" "4")])
10950 (define_insn "*sibcall_nonlocal_sysv"
10951 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
10952 (match_operand 1 "" ""))
10953 (use (match_operand 2 "immediate_operand" "O,n"))
10954 (use (match_scratch:SI 3 "=l,l"))
10956 "(DEFAULT_ABI == ABI_DARWIN
10957 || DEFAULT_ABI == ABI_V4
10958 || DEFAULT_ABI == ABI_AIX_NODESC)
10959 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10962 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10963 output_asm_insn (\"crxor 6,6,6\", operands);
10965 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10966 output_asm_insn (\"creqv 6,6,6\", operands);
10968 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z0@plt\" : \"b %z0\";
10970 [(set_attr "type" "branch,branch")
10971 (set_attr "length" "4,8")])
10973 (define_expand "sibcall_value"
10974 [(parallel [(set (match_operand 0 "register_operand" "")
10975 (call (mem:SI (match_operand 1 "address_operand" ""))
10976 (match_operand 2 "" "")))
10977 (use (match_operand 3 "" ""))
10985 operands[1] = machopic_indirect_call_target (operands[1]);
10988 if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
10991 operands[1] = XEXP (operands[1], 0);
10995 (define_insn "*sibcall_value_nonlocal_sysv"
10996 [(set (match_operand 0 "" "")
10997 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s"))
10998 (match_operand 2 "" "")))
10999 (use (match_operand:SI 3 "immediate_operand" "O,n"))
11000 (use (match_scratch:SI 4 "=l,l"))
11002 "(DEFAULT_ABI == ABI_DARWIN
11003 || DEFAULT_ABI == ABI_V4
11004 || DEFAULT_ABI == ABI_AIX_NODESC)
11005 && (INTVAL (operands[3]) & CALL_LONG) == 0"
11008 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
11009 output_asm_insn (\"crxor 6,6,6\", operands);
11011 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
11012 output_asm_insn (\"creqv 6,6,6\", operands);
11014 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"b %z1@plt\" : \"b %z1\";
11016 [(set_attr "type" "branch,branch")
11017 (set_attr "length" "4,8")])
11019 (define_expand "sibcall_epilogue"
11020 [(use (const_int 0))]
11021 "TARGET_SCHED_PROLOG"
11024 rs6000_emit_epilogue (TRUE);
11028 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
11029 ;; all of memory. This blocks insns from being moved across this point.
11031 (define_insn "blockage"
11032 [(unspec_volatile [(const_int 0)] 0)]
11036 ;; Compare insns are next. Note that the RS/6000 has two types of compares,
11037 ;; signed & unsigned, and one type of branch.
11039 ;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc
11040 ;; insns, and branches. We store the operands of compares until we see
11042 (define_expand "cmpsi"
11044 (compare (match_operand:SI 0 "gpc_reg_operand" "")
11045 (match_operand:SI 1 "reg_or_short_operand" "")))]
11049 /* Take care of the possibility that operands[1] might be negative but
11050 this might be a logical operation. That insn doesn't exist. */
11051 if (GET_CODE (operands[1]) == CONST_INT
11052 && INTVAL (operands[1]) < 0)
11053 operands[1] = force_reg (SImode, operands[1]);
11055 rs6000_compare_op0 = operands[0];
11056 rs6000_compare_op1 = operands[1];
11057 rs6000_compare_fp_p = 0;
11061 (define_expand "cmpdi"
11063 (compare (match_operand:DI 0 "gpc_reg_operand" "")
11064 (match_operand:DI 1 "reg_or_short_operand" "")))]
11068 /* Take care of the possibility that operands[1] might be negative but
11069 this might be a logical operation. That insn doesn't exist. */
11070 if (GET_CODE (operands[1]) == CONST_INT
11071 && INTVAL (operands[1]) < 0)
11072 operands[1] = force_reg (DImode, operands[1]);
11074 rs6000_compare_op0 = operands[0];
11075 rs6000_compare_op1 = operands[1];
11076 rs6000_compare_fp_p = 0;
11080 (define_expand "cmpsf"
11081 [(set (cc0) (compare (match_operand:SF 0 "gpc_reg_operand" "")
11082 (match_operand:SF 1 "gpc_reg_operand" "")))]
11083 "TARGET_HARD_FLOAT"
11086 rs6000_compare_op0 = operands[0];
11087 rs6000_compare_op1 = operands[1];
11088 rs6000_compare_fp_p = 1;
11092 (define_expand "cmpdf"
11093 [(set (cc0) (compare (match_operand:DF 0 "gpc_reg_operand" "")
11094 (match_operand:DF 1 "gpc_reg_operand" "")))]
11095 "TARGET_HARD_FLOAT && TARGET_FPRS"
11098 rs6000_compare_op0 = operands[0];
11099 rs6000_compare_op1 = operands[1];
11100 rs6000_compare_fp_p = 1;
11104 (define_expand "cmptf"
11105 [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "")
11106 (match_operand:TF 1 "gpc_reg_operand" "")))]
11107 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
11108 && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
11111 rs6000_compare_op0 = operands[0];
11112 rs6000_compare_op1 = operands[1];
11113 rs6000_compare_fp_p = 1;
11117 (define_expand "beq"
11118 [(use (match_operand 0 "" ""))]
11120 "{ rs6000_emit_cbranch (EQ, operands[0]); DONE; }")
11122 (define_expand "bne"
11123 [(use (match_operand 0 "" ""))]
11125 "{ rs6000_emit_cbranch (NE, operands[0]); DONE; }")
11127 (define_expand "bge"
11128 [(use (match_operand 0 "" ""))]
11130 "{ rs6000_emit_cbranch (GE, operands[0]); DONE; }")
11132 (define_expand "bgt"
11133 [(use (match_operand 0 "" ""))]
11135 "{ rs6000_emit_cbranch (GT, operands[0]); DONE; }")
11137 (define_expand "ble"
11138 [(use (match_operand 0 "" ""))]
11140 "{ rs6000_emit_cbranch (LE, operands[0]); DONE; }")
11142 (define_expand "blt"
11143 [(use (match_operand 0 "" ""))]
11145 "{ rs6000_emit_cbranch (LT, operands[0]); DONE; }")
11147 (define_expand "bgeu"
11148 [(use (match_operand 0 "" ""))]
11150 "{ rs6000_emit_cbranch (GEU, operands[0]); DONE; }")
11152 (define_expand "bgtu"
11153 [(use (match_operand 0 "" ""))]
11155 "{ rs6000_emit_cbranch (GTU, operands[0]); DONE; }")
11157 (define_expand "bleu"
11158 [(use (match_operand 0 "" ""))]
11160 "{ rs6000_emit_cbranch (LEU, operands[0]); DONE; }")
11162 (define_expand "bltu"
11163 [(use (match_operand 0 "" ""))]
11165 "{ rs6000_emit_cbranch (LTU, operands[0]); DONE; }")
11167 (define_expand "bunordered"
11168 [(use (match_operand 0 "" ""))]
11170 "{ rs6000_emit_cbranch (UNORDERED, operands[0]); DONE; }")
11172 (define_expand "bordered"
11173 [(use (match_operand 0 "" ""))]
11175 "{ rs6000_emit_cbranch (ORDERED, operands[0]); DONE; }")
11177 (define_expand "buneq"
11178 [(use (match_operand 0 "" ""))]
11180 "{ rs6000_emit_cbranch (UNEQ, operands[0]); DONE; }")
11182 (define_expand "bunge"
11183 [(use (match_operand 0 "" ""))]
11185 "{ rs6000_emit_cbranch (UNGE, operands[0]); DONE; }")
11187 (define_expand "bungt"
11188 [(use (match_operand 0 "" ""))]
11190 "{ rs6000_emit_cbranch (UNGT, operands[0]); DONE; }")
11192 (define_expand "bunle"
11193 [(use (match_operand 0 "" ""))]
11195 "{ rs6000_emit_cbranch (UNLE, operands[0]); DONE; }")
11197 (define_expand "bunlt"
11198 [(use (match_operand 0 "" ""))]
11200 "{ rs6000_emit_cbranch (UNLT, operands[0]); DONE; }")
11202 (define_expand "bltgt"
11203 [(use (match_operand 0 "" ""))]
11205 "{ rs6000_emit_cbranch (LTGT, operands[0]); DONE; }")
11207 ;; For SNE, we would prefer that the xor/abs sequence be used for integers.
11208 ;; For SEQ, likewise, except that comparisons with zero should be done
11209 ;; with an scc insns. However, due to the order that combine see the
11210 ;; resulting insns, we must, in fact, allow SEQ for integers. Fail in
11211 ;; the cases we don't want to handle.
11212 (define_expand "seq"
11213 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11215 "{ rs6000_emit_sCOND (EQ, operands[0]); DONE; }")
11217 (define_expand "sne"
11218 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11222 if (! rs6000_compare_fp_p)
11225 rs6000_emit_sCOND (NE, operands[0]);
11229 ;; A > 0 is best done using the portable sequence, so fail in that case.
11230 (define_expand "sgt"
11231 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11235 if (! rs6000_compare_fp_p
11236 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
11239 rs6000_emit_sCOND (GT, operands[0]);
11243 ;; A < 0 is best done in the portable way for A an integer.
11244 (define_expand "slt"
11245 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11249 if (! rs6000_compare_fp_p
11250 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
11253 rs6000_emit_sCOND (LT, operands[0]);
11257 ;; A >= 0 is best done the portable way for A an integer.
11258 (define_expand "sge"
11259 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11263 if (! rs6000_compare_fp_p
11264 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
11267 rs6000_emit_sCOND (GE, operands[0]);
11271 ;; A <= 0 is best done the portable way for A an integer.
11272 (define_expand "sle"
11273 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11277 if (! rs6000_compare_fp_p
11278 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
11281 rs6000_emit_sCOND (LE, operands[0]);
11285 (define_expand "sgtu"
11286 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11288 "{ rs6000_emit_sCOND (GTU, operands[0]); DONE; }")
11290 (define_expand "sltu"
11291 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11293 "{ rs6000_emit_sCOND (LTU, operands[0]); DONE; }")
11295 (define_expand "sgeu"
11296 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11298 "{ rs6000_emit_sCOND (GEU, operands[0]); DONE; }")
11300 (define_expand "sleu"
11301 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
11303 "{ rs6000_emit_sCOND (LEU, operands[0]); DONE; }")
11305 ;; Here are the actual compare insns.
11306 (define_insn "*cmpsi_internal1"
11307 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
11308 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
11309 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
11311 "{cmp%I2|cmpw%I2} %0,%1,%2"
11312 [(set_attr "type" "compare")])
11314 (define_insn "*cmpdi_internal1"
11315 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
11316 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r")
11317 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
11320 [(set_attr "type" "compare")])
11322 ;; If we are comparing a register for equality with a large constant,
11323 ;; we can do this with an XOR followed by a compare. But we need a scratch
11324 ;; register for the result of the XOR.
11327 [(set (match_operand:CC 0 "cc_reg_operand" "")
11328 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
11329 (match_operand:SI 2 "non_short_cint_operand" "")))
11330 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
11331 "find_single_use (operands[0], insn, 0)
11332 && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
11333 || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
11334 [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
11335 (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
11338 /* Get the constant we are comparing against, C, and see what it looks like
11339 sign-extended to 16 bits. Then see what constant could be XOR'ed
11340 with C to get the sign-extended value. */
11342 HOST_WIDE_INT c = INTVAL (operands[2]);
11343 HOST_WIDE_INT sextc = ((c & 0xffff) ^ 0x8000) - 0x8000;
11344 HOST_WIDE_INT xorv = c ^ sextc;
11346 operands[4] = GEN_INT (xorv);
11347 operands[5] = GEN_INT (sextc);
11350 (define_insn "*cmpsi_internal2"
11351 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
11352 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
11353 (match_operand:SI 2 "reg_or_u_short_operand" "rK")))]
11355 "{cmpl%I2|cmplw%I2} %0,%1,%b2"
11356 [(set_attr "type" "compare")])
11358 (define_insn "*cmpdi_internal2"
11359 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
11360 (compare:CCUNS (match_operand:DI 1 "gpc_reg_operand" "r")
11361 (match_operand:DI 2 "reg_or_u_short_operand" "rK")))]
11363 "cmpld%I2 %0,%1,%b2"
11364 [(set_attr "type" "compare")])
11366 ;; The following two insns don't exist as single insns, but if we provide
11367 ;; them, we can swap an add and compare, which will enable us to overlap more
11368 ;; of the required delay between a compare and branch. We generate code for
11369 ;; them by splitting.
11372 [(set (match_operand:CC 3 "cc_reg_operand" "=y")
11373 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
11374 (match_operand:SI 2 "short_cint_operand" "i")))
11375 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
11376 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
11379 [(set_attr "length" "8")])
11382 [(set (match_operand:CCUNS 3 "cc_reg_operand" "=y")
11383 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
11384 (match_operand:SI 2 "u_short_cint_operand" "i")))
11385 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
11386 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
11389 [(set_attr "length" "8")])
11392 [(set (match_operand:CC 3 "cc_reg_operand" "")
11393 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
11394 (match_operand:SI 2 "short_cint_operand" "")))
11395 (set (match_operand:SI 0 "gpc_reg_operand" "")
11396 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
11398 [(set (match_dup 3) (compare:CC (match_dup 1) (match_dup 2)))
11399 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
11402 [(set (match_operand:CCUNS 3 "cc_reg_operand" "")
11403 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "")
11404 (match_operand:SI 2 "u_short_cint_operand" "")))
11405 (set (match_operand:SI 0 "gpc_reg_operand" "")
11406 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
11408 [(set (match_dup 3) (compare:CCUNS (match_dup 1) (match_dup 2)))
11409 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
11411 (define_insn "*cmpsf_internal1"
11412 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
11413 (compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "f")
11414 (match_operand:SF 2 "gpc_reg_operand" "f")))]
11415 "TARGET_HARD_FLOAT && TARGET_FPRS"
11417 [(set_attr "type" "fpcompare")])
11419 (define_insn "*cmpdf_internal1"
11420 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
11421 (compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "f")
11422 (match_operand:DF 2 "gpc_reg_operand" "f")))]
11423 "TARGET_HARD_FLOAT && TARGET_FPRS"
11425 [(set_attr "type" "fpcompare")])
11427 ;; Only need to compare second words if first words equal
11428 (define_insn "*cmptf_internal1"
11429 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
11430 (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
11431 (match_operand:TF 2 "gpc_reg_operand" "f")))]
11432 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
11433 && TARGET_LONG_DOUBLE_128"
11434 "fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2"
11435 [(set_attr "type" "fpcompare")
11436 (set_attr "length" "12")])
11438 ;; Now we have the scc insns. We can do some combinations because of the
11439 ;; way the machine works.
11441 ;; Note that this is probably faster if we can put an insn between the
11442 ;; mfcr and rlinm, but this is tricky. Let's leave it for now. In most
11443 ;; cases the insns below which don't use an intermediate CR field will
11444 ;; be used instead.
11446 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11447 (match_operator:SI 1 "scc_comparison_operator"
11448 [(match_operand 2 "cc_reg_operand" "y")
11451 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
11452 [(set_attr "type" "cr_logical")
11453 (set_attr "length" "12")])
11455 ;; Same as above, but get the OV/ORDERED bit.
11456 (define_insn "move_from_CR_ov_bit"
11457 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11458 (unspec:SI [(match_operand 1 "cc_reg_operand" "y")] 724))]
11460 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%t1,1"
11461 [(set_attr "length" "12")])
11464 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11465 (match_operator:DI 1 "scc_comparison_operator"
11466 [(match_operand 2 "cc_reg_operand" "y")
11469 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
11470 [(set_attr "type" "cr_logical")
11471 (set_attr "length" "12")])
11474 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11475 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
11476 [(match_operand 2 "cc_reg_operand" "y,y")
11479 (set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
11480 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
11481 "! TARGET_POWERPC64"
11483 %D1mfcr %3\;{rlinm.|rlwinm.} %3,%3,%J1,1
11485 [(set_attr "type" "delayed_compare")
11486 (set_attr "length" "12,16")])
11489 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11490 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
11491 [(match_operand 2 "cc_reg_operand" "")
11494 (set (match_operand:SI 3 "gpc_reg_operand" "")
11495 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
11496 "! TARGET_POWERPC64 && reload_completed"
11497 [(set (match_dup 3)
11498 (match_op_dup 1 [(match_dup 2) (const_int 0)]))
11500 (compare:CC (match_dup 3)
11505 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11506 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
11507 [(match_operand 2 "cc_reg_operand" "y")
11509 (match_operand:SI 3 "const_int_operand" "n")))]
11513 int is_bit = ccr_bit (operands[1], 1);
11514 int put_bit = 31 - (INTVAL (operands[3]) & 31);
11517 if (is_bit >= put_bit)
11518 count = is_bit - put_bit;
11520 count = 32 - (put_bit - is_bit);
11522 operands[4] = GEN_INT (count);
11523 operands[5] = GEN_INT (put_bit);
11525 return \"%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%4,%5,%5\";
11527 [(set_attr "type" "cr_logical")
11528 (set_attr "length" "12")])
11531 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11533 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
11534 [(match_operand 2 "cc_reg_operand" "y,y")
11536 (match_operand:SI 3 "const_int_operand" "n,n"))
11538 (set (match_operand:SI 4 "gpc_reg_operand" "=r,r")
11539 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
11544 int is_bit = ccr_bit (operands[1], 1);
11545 int put_bit = 31 - (INTVAL (operands[3]) & 31);
11548 /* Force split for non-cc0 compare. */
11549 if (which_alternative == 1)
11552 if (is_bit >= put_bit)
11553 count = is_bit - put_bit;
11555 count = 32 - (put_bit - is_bit);
11557 operands[5] = GEN_INT (count);
11558 operands[6] = GEN_INT (put_bit);
11560 return \"%D1mfcr %4\;{rlinm.|rlwinm.} %4,%4,%5,%6,%6\";
11562 [(set_attr "type" "delayed_compare")
11563 (set_attr "length" "12,16")])
11566 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11568 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
11569 [(match_operand 2 "cc_reg_operand" "")
11571 (match_operand:SI 3 "const_int_operand" ""))
11573 (set (match_operand:SI 4 "gpc_reg_operand" "")
11574 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
11577 [(set (match_dup 4)
11578 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
11581 (compare:CC (match_dup 4)
11585 ;; There is a 3 cycle delay between consecutive mfcr instructions
11586 ;; so it is useful to combine 2 scc instructions to use only one mfcr.
11589 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11590 (match_operator:SI 1 "scc_comparison_operator"
11591 [(match_operand 2 "cc_reg_operand" "y")
11593 (set (match_operand:SI 3 "gpc_reg_operand" "=r")
11594 (match_operator:SI 4 "scc_comparison_operator"
11595 [(match_operand 5 "cc_reg_operand" "y")
11597 "REGNO (operands[2]) != REGNO (operands[5])"
11598 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
11599 [(set_attr "type" "cr_logical")
11600 (set_attr "length" "20")])
11603 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11604 (match_operator:DI 1 "scc_comparison_operator"
11605 [(match_operand 2 "cc_reg_operand" "y")
11607 (set (match_operand:DI 3 "gpc_reg_operand" "=r")
11608 (match_operator:DI 4 "scc_comparison_operator"
11609 [(match_operand 5 "cc_reg_operand" "y")
11611 "TARGET_POWERPC64 && REGNO (operands[2]) != REGNO (operands[5])"
11612 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
11613 [(set_attr "type" "cr_logical")
11614 (set_attr "length" "20")])
11616 ;; There are some scc insns that can be done directly, without a compare.
11617 ;; These are faster because they don't involve the communications between
11618 ;; the FXU and branch units. In fact, we will be replacing all of the
11619 ;; integer scc insns here or in the portable methods in emit_store_flag.
11621 ;; Also support (neg (scc ..)) since that construct is used to replace
11622 ;; branches, (plus (scc ..) ..) since that construct is common and
11623 ;; takes no more insns than scc, and (and (neg (scc ..)) ..) in the
11624 ;; cases where it is no more expensive than (neg (scc ..)).
11626 ;; Have reload force a constant into a register for the simple insns that
11627 ;; otherwise won't accept constants. We do this because it is faster than
11628 ;; the cmp/mfcr sequence we would otherwise generate.
11631 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
11632 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
11633 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I")))
11634 (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
11635 "! TARGET_POWERPC64"
11637 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
11638 {sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1
11639 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
11640 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
11641 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0"
11642 [(set_attr "length" "12,8,12,12,12")])
11645 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
11646 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
11647 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
11648 (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
11651 xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
11652 subfic %3,%1,0\;adde %0,%3,%1
11653 xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
11654 xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
11655 subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
11656 [(set_attr "length" "12,8,12,12,12")])
11659 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11661 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11662 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
11664 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
11665 (eq:SI (match_dup 1) (match_dup 2)))
11666 (clobber (match_scratch:SI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
11667 "! TARGET_POWERPC64"
11669 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
11670 {sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1
11671 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
11672 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
11673 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
11679 [(set_attr "type" "compare")
11680 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11683 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11685 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
11686 (match_operand:SI 2 "reg_or_cint_operand" ""))
11688 (set (match_operand:SI 0 "gpc_reg_operand" "")
11689 (eq:SI (match_dup 1) (match_dup 2)))
11690 (clobber (match_scratch:SI 3 ""))]
11691 "! TARGET_POWERPC64 && reload_completed"
11692 [(parallel [(set (match_dup 0)
11693 (eq:SI (match_dup 1) (match_dup 2)))
11694 (clobber (match_dup 3))])
11696 (compare:CC (match_dup 0)
11701 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11703 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11704 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I,r,O,K,J,I"))
11706 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
11707 (eq:DI (match_dup 1) (match_dup 2)))
11708 (clobber (match_scratch:DI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
11711 xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
11712 subfic %3,%1,0\;adde. %0,%3,%1
11713 xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
11714 xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
11715 subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
11721 [(set_attr "type" "compare")
11722 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11725 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11727 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "")
11728 (match_operand:DI 2 "reg_or_cint_operand" ""))
11730 (set (match_operand:DI 0 "gpc_reg_operand" "")
11731 (eq:DI (match_dup 1) (match_dup 2)))
11732 (clobber (match_scratch:DI 3 ""))]
11733 "TARGET_POWERPC64 && reload_completed"
11734 [(parallel [(set (match_dup 0)
11735 (eq:DI (match_dup 1) (match_dup 2)))
11736 (clobber (match_dup 3))])
11738 (compare:CC (match_dup 0)
11742 ;; We have insns of the form shown by the first define_insn below. If
11743 ;; there is something inside the comparison operation, we must split it.
11745 [(set (match_operand:SI 0 "gpc_reg_operand" "")
11746 (plus:SI (match_operator 1 "comparison_operator"
11747 [(match_operand:SI 2 "" "")
11748 (match_operand:SI 3
11749 "reg_or_cint_operand" "")])
11750 (match_operand:SI 4 "gpc_reg_operand" "")))
11751 (clobber (match_operand:SI 5 "register_operand" ""))]
11752 "! gpc_reg_operand (operands[2], SImode)"
11753 [(set (match_dup 5) (match_dup 2))
11754 (set (match_dup 2) (plus:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
11758 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r")
11759 (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
11760 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))
11761 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r")))]
11762 "! TARGET_POWERPC64"
11764 xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11765 {sfi|subfic} %0,%1,0\;{aze|addze} %0,%3
11766 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11767 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11768 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3"
11769 [(set_attr "length" "12,8,12,12,12")])
11772 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11775 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11776 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
11777 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
11779 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))]
11780 "! TARGET_POWERPC64"
11782 xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11783 {sfi|subfic} %4,%1,0\;{aze.|addze.} %4,%3
11784 {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11785 {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11786 {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11792 [(set_attr "type" "compare")
11793 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11796 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11799 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
11800 (match_operand:SI 2 "reg_or_cint_operand" ""))
11801 (match_operand:SI 3 "gpc_reg_operand" ""))
11803 (clobber (match_scratch:SI 4 ""))]
11804 "! TARGET_POWERPC64 && reload_completed"
11805 [(set (match_dup 4)
11806 (plus:SI (eq:SI (match_dup 1)
11810 (compare:CC (match_dup 4)
11815 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11818 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11819 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
11820 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
11822 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r")
11823 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
11824 "! TARGET_POWERPC64"
11826 xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11827 {sfi|subfic} %0,%1,0\;{aze.|addze.} %0,%3
11828 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11829 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11830 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11836 [(set_attr "type" "compare")
11837 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11840 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11843 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
11844 (match_operand:SI 2 "reg_or_cint_operand" ""))
11845 (match_operand:SI 3 "gpc_reg_operand" ""))
11847 (set (match_operand:SI 0 "gpc_reg_operand" "")
11848 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
11849 "! TARGET_POWERPC64 && reload_completed"
11850 [(set (match_dup 0)
11851 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11853 (compare:CC (match_dup 0)
11858 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
11859 (neg:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
11860 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))))]
11861 "! TARGET_POWERPC64"
11863 xor %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11864 {ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0
11865 {xoril|xori} %0,%1,%b2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11866 {xoriu|xoris} %0,%1,%u2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11867 {sfi|subfic} %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
11868 [(set_attr "length" "12,8,12,12,12")])
11870 ;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power,
11871 ;; since it nabs/sr is just as fast.
11872 (define_insn "*ne0"
11873 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
11874 (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
11876 (clobber (match_scratch:SI 2 "=&r"))]
11877 "! TARGET_POWER && ! TARGET_POWERPC64 && !TARGET_ISEL"
11878 "{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1"
11879 [(set_attr "length" "8")])
11882 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11883 (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
11885 (clobber (match_scratch:DI 2 "=&r"))]
11887 "addic %2,%1,-1\;subfe %0,%2,%1"
11888 [(set_attr "length" "8")])
11890 ;; This is what (plus (ne X (const_int 0)) Y) looks like.
11892 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11893 (plus:SI (lshiftrt:SI
11894 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
11896 (match_operand:SI 2 "gpc_reg_operand" "r")))
11897 (clobber (match_scratch:SI 3 "=&r"))]
11898 "! TARGET_POWERPC64"
11899 "{ai|addic} %3,%1,-1\;{aze|addze} %0,%2"
11900 [(set_attr "length" "8")])
11903 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11904 (plus:DI (lshiftrt:DI
11905 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
11907 (match_operand:DI 2 "gpc_reg_operand" "r")))
11908 (clobber (match_scratch:DI 3 "=&r"))]
11910 "addic %3,%1,-1\;addze %0,%2"
11911 [(set_attr "length" "8")])
11914 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11916 (plus:SI (lshiftrt:SI
11917 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11919 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11921 (clobber (match_scratch:SI 3 "=&r,&r"))
11922 (clobber (match_scratch:SI 4 "=X,&r"))]
11923 "! TARGET_POWERPC64"
11925 {ai|addic} %3,%1,-1\;{aze.|addze.} %3,%2
11927 [(set_attr "type" "compare")
11928 (set_attr "length" "8,12")])
11931 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11933 (plus:SI (lshiftrt:SI
11934 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
11936 (match_operand:SI 2 "gpc_reg_operand" ""))
11938 (clobber (match_scratch:SI 3 ""))
11939 (clobber (match_scratch:SI 4 ""))]
11940 "! TARGET_POWERPC64 && reload_completed"
11941 [(parallel [(set (match_dup 3)
11942 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1)))
11945 (clobber (match_dup 4))])
11947 (compare:CC (match_dup 3)
11952 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11954 (plus:DI (lshiftrt:DI
11955 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
11957 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
11959 (clobber (match_scratch:DI 3 "=&r,&r"))]
11962 addic %3,%1,-1\;addze. %3,%2
11964 [(set_attr "type" "compare")
11965 (set_attr "length" "8,12")])
11968 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11970 (plus:DI (lshiftrt:DI
11971 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
11973 (match_operand:DI 2 "gpc_reg_operand" ""))
11975 (clobber (match_scratch:DI 3 ""))]
11976 "TARGET_POWERPC64 && reload_completed"
11977 [(set (match_dup 3)
11978 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1)))
11982 (compare:CC (match_dup 3)
11987 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11989 (plus:SI (lshiftrt:SI
11990 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11992 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11994 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11995 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11997 (clobber (match_scratch:SI 3 "=&r,&r"))]
11998 "! TARGET_POWERPC64"
12000 {ai|addic} %3,%1,-1\;{aze.|addze.} %0,%2
12002 [(set_attr "type" "compare")
12003 (set_attr "length" "8,12")])
12006 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12008 (plus:SI (lshiftrt:SI
12009 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
12011 (match_operand:SI 2 "gpc_reg_operand" ""))
12013 (set (match_operand:SI 0 "gpc_reg_operand" "")
12014 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
12016 (clobber (match_scratch:SI 3 ""))]
12017 "! TARGET_POWERPC64 && reload_completed"
12018 [(parallel [(set (match_dup 0)
12019 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
12021 (clobber (match_dup 3))])
12023 (compare:CC (match_dup 0)
12028 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12030 (plus:DI (lshiftrt:DI
12031 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
12033 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
12035 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12036 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
12038 (clobber (match_scratch:DI 3 "=&r,&r"))]
12041 addic %3,%1,-1\;addze. %0,%2
12043 [(set_attr "type" "compare")
12044 (set_attr "length" "8,12")])
12047 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12049 (plus:DI (lshiftrt:DI
12050 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
12052 (match_operand:DI 2 "gpc_reg_operand" ""))
12054 (set (match_operand:DI 0 "gpc_reg_operand" "")
12055 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
12057 (clobber (match_scratch:DI 3 ""))]
12058 "TARGET_POWERPC64 && reload_completed"
12059 [(parallel [(set (match_dup 0)
12060 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
12062 (clobber (match_dup 3))])
12064 (compare:CC (match_dup 0)
12069 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12070 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12071 (match_operand:SI 2 "reg_or_short_operand" "r,O")))
12072 (clobber (match_scratch:SI 3 "=r,X"))]
12075 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3
12076 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri|srwi} %0,%0,31"
12077 [(set_attr "length" "12")])
12080 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
12082 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12083 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
12085 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12086 (le:SI (match_dup 1) (match_dup 2)))
12087 (clobber (match_scratch:SI 3 "=r,X,r,X"))]
12090 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
12091 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri.|srwi.} %0,%0,31
12094 [(set_attr "type" "compare,delayed_compare,compare,delayed_compare")
12095 (set_attr "length" "12,12,16,16")])
12098 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12100 (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
12101 (match_operand:SI 2 "reg_or_short_operand" ""))
12103 (set (match_operand:SI 0 "gpc_reg_operand" "")
12104 (le:SI (match_dup 1) (match_dup 2)))
12105 (clobber (match_scratch:SI 3 ""))]
12106 "TARGET_POWER && reload_completed"
12107 [(parallel [(set (match_dup 0)
12108 (le:SI (match_dup 1) (match_dup 2)))
12109 (clobber (match_dup 3))])
12111 (compare:CC (match_dup 0)
12116 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12117 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12118 (match_operand:SI 2 "reg_or_short_operand" "r,O"))
12119 (match_operand:SI 3 "gpc_reg_operand" "r,r")))]
12122 doz %0,%2,%1\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
12123 {srai|srawi} %0,%1,31\;{sf|subfc} %0,%1,%0\;{aze|addze} %0,%3"
12124 [(set_attr "length" "12")])
12127 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12129 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12130 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
12131 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12133 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12136 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
12137 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %4,%3
12140 [(set_attr "type" "compare")
12141 (set_attr "length" "12,12,16,16")])
12144 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12146 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
12147 (match_operand:SI 2 "reg_or_short_operand" ""))
12148 (match_operand:SI 3 "gpc_reg_operand" ""))
12150 (clobber (match_scratch:SI 4 ""))]
12151 "TARGET_POWER && reload_completed"
12152 [(set (match_dup 4)
12153 (plus:SI (le:SI (match_dup 1) (match_dup 2))
12156 (compare:CC (match_dup 4)
12161 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
12163 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12164 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
12165 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12167 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
12168 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12171 doz %0,%2,%1\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
12172 {srai|srawi} %0,%1,31\;{sf|subfc} %0,%1,%0\;{aze.|addze.} %0,%3
12175 [(set_attr "type" "compare")
12176 (set_attr "length" "12,12,16,16")])
12179 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12181 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
12182 (match_operand:SI 2 "reg_or_short_operand" ""))
12183 (match_operand:SI 3 "gpc_reg_operand" ""))
12185 (set (match_operand:SI 0 "gpc_reg_operand" "")
12186 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12187 "TARGET_POWER && reload_completed"
12188 [(set (match_dup 0)
12189 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12191 (compare:CC (match_dup 0)
12196 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12197 (neg:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12198 (match_operand:SI 2 "reg_or_short_operand" "r,O"))))]
12201 doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
12202 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{srai|srawi} %0,%0,31"
12203 [(set_attr "length" "12")])
12206 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12207 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12208 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
12209 "! TARGET_POWERPC64"
12210 "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
12211 [(set_attr "length" "12")])
12214 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12215 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12216 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
12218 "subf%I2c %0,%1,%2\;li %0,0\;adde %0,%0,%0"
12219 [(set_attr "length" "12")])
12222 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12224 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12225 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
12227 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12228 (leu:DI (match_dup 1) (match_dup 2)))]
12231 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
12233 [(set_attr "type" "compare")
12234 (set_attr "length" "12,16")])
12237 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12239 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12240 (match_operand:DI 2 "reg_or_short_operand" ""))
12242 (set (match_operand:DI 0 "gpc_reg_operand" "")
12243 (leu:DI (match_dup 1) (match_dup 2)))]
12244 "TARGET_POWERPC64 && reload_completed"
12245 [(set (match_dup 0)
12246 (leu:DI (match_dup 1) (match_dup 2)))
12248 (compare:CC (match_dup 0)
12253 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12255 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12256 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12258 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12259 (leu:SI (match_dup 1) (match_dup 2)))]
12260 "! TARGET_POWERPC64"
12262 {sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
12264 [(set_attr "type" "compare")
12265 (set_attr "length" "12,16")])
12268 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12270 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12271 (match_operand:SI 2 "reg_or_short_operand" ""))
12273 (set (match_operand:SI 0 "gpc_reg_operand" "")
12274 (leu:SI (match_dup 1) (match_dup 2)))]
12275 "! TARGET_POWERPC64 && reload_completed"
12276 [(set (match_dup 0)
12277 (leu:SI (match_dup 1) (match_dup 2)))
12279 (compare:CC (match_dup 0)
12284 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12286 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12287 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
12289 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12290 (leu:DI (match_dup 1) (match_dup 2)))]
12293 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
12295 [(set_attr "type" "compare")
12296 (set_attr "length" "12,16")])
12299 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
12300 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12301 (match_operand:SI 2 "reg_or_short_operand" "rI"))
12302 (match_operand:SI 3 "gpc_reg_operand" "r")))]
12303 "! TARGET_POWERPC64"
12304 "{sf%I2|subf%I2c} %0,%1,%2\;{aze|addze} %0,%3"
12305 [(set_attr "length" "8")])
12308 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12310 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12311 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12312 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12314 (clobber (match_scratch:SI 4 "=&r,&r"))]
12315 "! TARGET_POWERPC64"
12317 {sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %4,%3
12319 [(set_attr "type" "compare")
12320 (set_attr "length" "8,12")])
12323 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12325 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12326 (match_operand:SI 2 "reg_or_short_operand" ""))
12327 (match_operand:SI 3 "gpc_reg_operand" ""))
12329 (clobber (match_scratch:SI 4 ""))]
12330 "! TARGET_POWERPC64 && reload_completed"
12331 [(set (match_dup 4)
12332 (plus:SI (leu:SI (match_dup 1) (match_dup 2))
12335 (compare:CC (match_dup 4)
12340 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12342 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12343 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12344 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12346 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12347 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12348 "! TARGET_POWERPC64"
12350 {sf%I2|subf%I2c} %0,%1,%2\;{aze.|addze.} %0,%3
12352 [(set_attr "type" "compare")
12353 (set_attr "length" "8,12")])
12356 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12358 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12359 (match_operand:SI 2 "reg_or_short_operand" ""))
12360 (match_operand:SI 3 "gpc_reg_operand" ""))
12362 (set (match_operand:SI 0 "gpc_reg_operand" "")
12363 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12364 "! TARGET_POWERPC64 && reload_completed"
12365 [(set (match_dup 0)
12366 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12368 (compare:CC (match_dup 0)
12373 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12374 (neg:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12375 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
12376 "! TARGET_POWERPC64"
12377 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0"
12378 [(set_attr "length" "12")])
12381 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
12383 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12384 (match_operand:SI 2 "reg_or_short_operand" "rI")))
12385 (match_operand:SI 3 "gpc_reg_operand" "r")))]
12386 "! TARGET_POWERPC64"
12387 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0"
12388 [(set_attr "length" "12")])
12391 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12394 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12395 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
12396 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12398 (clobber (match_scratch:SI 4 "=&r,&r"))]
12399 "! TARGET_POWERPC64"
12401 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
12403 [(set_attr "type" "compare")
12404 (set_attr "length" "12,16")])
12407 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12410 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12411 (match_operand:SI 2 "reg_or_short_operand" "")))
12412 (match_operand:SI 3 "gpc_reg_operand" ""))
12414 (clobber (match_scratch:SI 4 ""))]
12415 "! TARGET_POWERPC64 && reload_completed"
12416 [(set (match_dup 4)
12417 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2)))
12420 (compare:CC (match_dup 4)
12425 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12428 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12429 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
12430 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12432 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12433 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))]
12434 "! TARGET_POWERPC64"
12436 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;andc. %0,%3,%0
12438 [(set_attr "type" "compare")
12439 (set_attr "length" "12,16")])
12442 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12445 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12446 (match_operand:SI 2 "reg_or_short_operand" "")))
12447 (match_operand:SI 3 "gpc_reg_operand" ""))
12449 (set (match_operand:SI 0 "gpc_reg_operand" "")
12450 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))]
12451 "! TARGET_POWERPC64 && reload_completed"
12452 [(set (match_dup 0)
12453 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2)))
12456 (compare:CC (match_dup 0)
12461 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12462 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12463 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
12465 "doz%I2 %0,%1,%2\;nabs %0,%0\;{sri|srwi} %0,%0,31"
12466 [(set_attr "length" "12")])
12469 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12471 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12472 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12474 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12475 (lt:SI (match_dup 1) (match_dup 2)))]
12478 doz%I2 %0,%1,%2\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
12480 [(set_attr "type" "delayed_compare")
12481 (set_attr "length" "12,16")])
12484 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12486 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12487 (match_operand:SI 2 "reg_or_short_operand" ""))
12489 (set (match_operand:SI 0 "gpc_reg_operand" "")
12490 (lt:SI (match_dup 1) (match_dup 2)))]
12491 "TARGET_POWER && reload_completed"
12492 [(set (match_dup 0)
12493 (lt:SI (match_dup 1) (match_dup 2)))
12495 (compare:CC (match_dup 0)
12500 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
12501 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12502 (match_operand:SI 2 "reg_or_short_operand" "rI"))
12503 (match_operand:SI 3 "gpc_reg_operand" "r")))]
12505 "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{aze|addze} %0,%3"
12506 [(set_attr "length" "12")])
12509 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12511 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12512 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12513 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12515 (clobber (match_scratch:SI 4 "=&r,&r"))]
12518 doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
12520 [(set_attr "type" "compare")
12521 (set_attr "length" "12,16")])
12524 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12526 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12527 (match_operand:SI 2 "reg_or_short_operand" ""))
12528 (match_operand:SI 3 "gpc_reg_operand" ""))
12530 (clobber (match_scratch:SI 4 ""))]
12531 "TARGET_POWER && reload_completed"
12532 [(set (match_dup 4)
12533 (plus:SI (lt:SI (match_dup 1) (match_dup 2))
12536 (compare:CC (match_dup 4)
12541 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12543 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12544 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12545 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12547 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12548 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12551 doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{aze.|addze.} %0,%3
12553 [(set_attr "type" "compare")
12554 (set_attr "length" "12,16")])
12557 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12559 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12560 (match_operand:SI 2 "reg_or_short_operand" ""))
12561 (match_operand:SI 3 "gpc_reg_operand" ""))
12563 (set (match_operand:SI 0 "gpc_reg_operand" "")
12564 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12565 "TARGET_POWER && reload_completed"
12566 [(set (match_dup 0)
12567 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12569 (compare:CC (match_dup 0)
12574 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12575 (neg:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12576 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
12578 "doz%I2 %0,%1,%2\;nabs %0,%0\;{srai|srawi} %0,%0,31"
12579 [(set_attr "length" "12")])
12582 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12583 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12584 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
12585 "! TARGET_POWERPC64"
12587 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg %0,%0
12588 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
12589 [(set_attr "length" "12")])
12592 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12594 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12595 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12597 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12598 (ltu:SI (match_dup 1) (match_dup 2)))]
12599 "! TARGET_POWERPC64"
12601 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
12602 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
12605 [(set_attr "type" "compare")
12606 (set_attr "length" "12,12,16,16")])
12609 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12611 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12612 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12614 (set (match_operand:SI 0 "gpc_reg_operand" "")
12615 (ltu:SI (match_dup 1) (match_dup 2)))]
12616 "! TARGET_POWERPC64 && reload_completed"
12617 [(set (match_dup 0)
12618 (ltu:SI (match_dup 1) (match_dup 2)))
12620 (compare:CC (match_dup 0)
12625 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12626 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12627 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
12628 (match_operand:SI 3 "reg_or_short_operand" "rI,rI")))]
12629 "! TARGET_POWERPC64"
12631 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3
12632 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3"
12633 [(set_attr "length" "12")])
12636 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12638 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12639 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12640 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12642 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12643 "! TARGET_POWERPC64"
12645 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
12646 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
12649 [(set_attr "type" "compare")
12650 (set_attr "length" "12,12,16,16")])
12653 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12655 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12656 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12657 (match_operand:SI 3 "gpc_reg_operand" ""))
12659 (clobber (match_scratch:SI 4 ""))]
12660 "! TARGET_POWERPC64 && reload_completed"
12661 [(set (match_dup 4)
12662 (plus:SI (ltu:SI (match_dup 1) (match_dup 2))
12665 (compare:CC (match_dup 4)
12670 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
12672 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12673 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12674 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12676 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
12677 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12678 "! TARGET_POWERPC64"
12680 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3
12681 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3
12684 [(set_attr "type" "compare")
12685 (set_attr "length" "12,12,16,16")])
12688 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12690 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12691 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12692 (match_operand:SI 3 "gpc_reg_operand" ""))
12694 (set (match_operand:SI 0 "gpc_reg_operand" "")
12695 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12696 "! TARGET_POWERPC64 && reload_completed"
12697 [(set (match_dup 0)
12698 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12700 (compare:CC (match_dup 0)
12705 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12706 (neg:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12707 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))))]
12708 "! TARGET_POWERPC64"
12710 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0
12711 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0"
12712 [(set_attr "length" "8")])
12715 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12716 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12717 (match_operand:SI 2 "reg_or_short_operand" "rI")))
12718 (clobber (match_scratch:SI 3 "=r"))]
12720 "doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3"
12721 [(set_attr "length" "12")])
12724 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12726 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12727 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12729 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12730 (ge:SI (match_dup 1) (match_dup 2)))
12731 (clobber (match_scratch:SI 3 "=r,r"))]
12734 doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
12736 [(set_attr "type" "compare")
12737 (set_attr "length" "12,16")])
12740 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12742 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12743 (match_operand:SI 2 "reg_or_short_operand" ""))
12745 (set (match_operand:SI 0 "gpc_reg_operand" "")
12746 (ge:SI (match_dup 1) (match_dup 2)))
12747 (clobber (match_scratch:SI 3 ""))]
12748 "TARGET_POWER && reload_completed"
12749 [(parallel [(set (match_dup 0)
12750 (ge:SI (match_dup 1) (match_dup 2)))
12751 (clobber (match_dup 3))])
12753 (compare:CC (match_dup 0)
12758 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
12759 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12760 (match_operand:SI 2 "reg_or_short_operand" "rI"))
12761 (match_operand:SI 3 "gpc_reg_operand" "r")))]
12763 "doz%I2 %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3"
12764 [(set_attr "length" "12")])
12767 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12769 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12770 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12771 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12773 (clobber (match_scratch:SI 4 "=&r,&r"))]
12776 doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
12778 [(set_attr "type" "compare")
12779 (set_attr "length" "12,16")])
12782 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12784 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12785 (match_operand:SI 2 "reg_or_short_operand" ""))
12786 (match_operand:SI 3 "gpc_reg_operand" ""))
12788 (clobber (match_scratch:SI 4 ""))]
12789 "TARGET_POWER && reload_completed"
12790 [(set (match_dup 4)
12791 (plus:SI (ge:SI (match_dup 1) (match_dup 2))
12794 (compare:CC (match_dup 4)
12799 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12801 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12802 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12803 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12805 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12806 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12809 doz%I2 %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
12811 [(set_attr "type" "compare")
12812 (set_attr "length" "12,16")])
12815 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12817 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12818 (match_operand:SI 2 "reg_or_short_operand" ""))
12819 (match_operand:SI 3 "gpc_reg_operand" ""))
12821 (set (match_operand:SI 0 "gpc_reg_operand" "")
12822 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12823 "TARGET_POWER && reload_completed"
12824 [(set (match_dup 0)
12825 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12827 (compare:CC (match_dup 0)
12832 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12833 (neg:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12834 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
12836 "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
12837 [(set_attr "length" "12")])
12840 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12841 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12842 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
12843 "! TARGET_POWERPC64"
12845 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0
12846 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
12847 [(set_attr "length" "12")])
12850 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12851 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12852 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P")))]
12855 subfc %0,%2,%1\;li %0,0\;adde %0,%0,%0
12856 addic %0,%1,%n2\;li %0,0\;adde %0,%0,%0"
12857 [(set_attr "length" "12")])
12860 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12862 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12863 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12865 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12866 (geu:SI (match_dup 1) (match_dup 2)))]
12867 "! TARGET_POWERPC64"
12869 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
12870 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
12873 [(set_attr "type" "compare")
12874 (set_attr "length" "12,12,16,16")])
12877 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12879 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12880 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12882 (set (match_operand:SI 0 "gpc_reg_operand" "")
12883 (geu:SI (match_dup 1) (match_dup 2)))]
12884 "! TARGET_POWERPC64 && reload_completed"
12885 [(set (match_dup 0)
12886 (geu:SI (match_dup 1) (match_dup 2)))
12888 (compare:CC (match_dup 0)
12893 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12895 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12896 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12898 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
12899 (geu:DI (match_dup 1) (match_dup 2)))]
12902 subfc %0,%2,%1\;li %0,0\;adde. %0,%0,%0
12903 addic %0,%1,%n2\;li %0,0\;adde. %0,%0,%0
12906 [(set_attr "type" "compare")
12907 (set_attr "length" "12,12,16,16")])
12910 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12912 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12913 (match_operand:DI 2 "reg_or_neg_short_operand" ""))
12915 (set (match_operand:DI 0 "gpc_reg_operand" "")
12916 (geu:DI (match_dup 1) (match_dup 2)))]
12917 "TARGET_POWERPC64 && reload_completed"
12918 [(set (match_dup 0)
12919 (geu:DI (match_dup 1) (match_dup 2)))
12921 (compare:CC (match_dup 0)
12926 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12927 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12928 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
12929 (match_operand:SI 3 "gpc_reg_operand" "r,r")))]
12930 "! TARGET_POWERPC64"
12932 {sf|subfc} %0,%2,%1\;{aze|addze} %0,%3
12933 {ai|addic} %0,%1,%n2\;{aze|addze} %0,%3"
12934 [(set_attr "length" "8")])
12937 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12939 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12940 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12941 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12943 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12944 "! TARGET_POWERPC64"
12946 {sf|subfc} %4,%2,%1\;{aze.|addze.} %4,%3
12947 {ai|addic} %4,%1,%n2\;{aze.|addze.} %4,%3
12950 [(set_attr "type" "compare")
12951 (set_attr "length" "8,8,12,12")])
12954 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12956 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12957 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12958 (match_operand:SI 3 "gpc_reg_operand" ""))
12960 (clobber (match_scratch:SI 4 ""))]
12961 "! TARGET_POWERPC64 && reload_completed"
12962 [(set (match_dup 4)
12963 (plus:SI (geu:SI (match_dup 1) (match_dup 2))
12966 (compare:CC (match_dup 4)
12971 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
12973 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12974 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12975 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12977 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
12978 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12979 "! TARGET_POWERPC64"
12981 {sf|subfc} %0,%2,%1\;{aze.|addze.} %0,%3
12982 {ai|addic} %0,%1,%n2\;{aze.|addze.} %0,%3
12985 [(set_attr "type" "compare")
12986 (set_attr "length" "8,8,12,12")])
12989 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12991 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12992 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12993 (match_operand:SI 3 "gpc_reg_operand" ""))
12995 (set (match_operand:SI 0 "gpc_reg_operand" "")
12996 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
12997 "! TARGET_POWERPC64 && reload_completed"
12998 [(set (match_dup 0)
12999 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
13001 (compare:CC (match_dup 0)
13006 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
13007 (neg:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13008 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))]
13009 "! TARGET_POWERPC64"
13011 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0
13012 {sfi|subfic} %0,%1,-1\;{a%I2|add%I2c} %0,%0,%2\;{sfe|subfe} %0,%0,%0"
13013 [(set_attr "length" "12")])
13016 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
13018 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13019 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
13020 (match_operand:SI 3 "gpc_reg_operand" "r,r")))]
13021 "! TARGET_POWERPC64"
13023 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0
13024 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;andc %0,%3,%0"
13025 [(set_attr "length" "12")])
13028 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
13031 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
13032 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
13033 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
13035 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
13036 "! TARGET_POWERPC64"
13038 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
13039 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
13042 [(set_attr "type" "compare")
13043 (set_attr "length" "12,12,16,16")])
13046 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13049 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
13050 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
13051 (match_operand:SI 3 "gpc_reg_operand" ""))
13053 (clobber (match_scratch:SI 4 ""))]
13054 "! TARGET_POWERPC64 && reload_completed"
13055 [(set (match_dup 4)
13056 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2)))
13059 (compare:CC (match_dup 4)
13064 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
13067 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
13068 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
13069 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
13071 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
13072 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))]
13073 "! TARGET_POWERPC64"
13075 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;andc. %0,%3,%0
13076 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;andc. %0,%3,%0
13079 [(set_attr "type" "compare")
13080 (set_attr "length" "12,12,16,16")])
13083 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
13086 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
13087 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
13088 (match_operand:SI 3 "gpc_reg_operand" ""))
13090 (set (match_operand:SI 0 "gpc_reg_operand" "")
13091 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))]
13092 "! TARGET_POWERPC64 && reload_completed"
13093 [(set (match_dup 0)
13094 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
13096 (compare:CC (match_dup 0)
13101 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13102 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13104 "! TARGET_POWERPC64"
13105 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri|srwi} %0,%0,31"
13106 [(set_attr "length" "12")])
13109 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
13110 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13113 "subfic %0,%1,0\;addme %0,%0\;srdi %0,%0,63"
13114 [(set_attr "length" "12")])
13117 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
13119 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13122 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
13123 (gt:SI (match_dup 1) (const_int 0)))]
13124 "! TARGET_POWERPC64"
13126 {sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri.|srwi.} %0,%0,31
13128 [(set_attr "type" "delayed_compare")
13129 (set_attr "length" "12,16")])
13132 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
13134 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13137 (set (match_operand:SI 0 "gpc_reg_operand" "")
13138 (gt:SI (match_dup 1) (const_int 0)))]
13139 "! TARGET_POWERPC64 && reload_completed"
13140 [(set (match_dup 0)
13141 (gt:SI (match_dup 1) (const_int 0)))
13143 (compare:CC (match_dup 0)
13148 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
13150 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
13153 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
13154 (gt:DI (match_dup 1) (const_int 0)))]
13157 subfic %0,%1,0\;addme %0,%0\;srdi. %0,%0,63
13159 [(set_attr "type" "delayed_compare")
13160 (set_attr "length" "12,16")])
13163 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
13165 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
13168 (set (match_operand:DI 0 "gpc_reg_operand" "")
13169 (gt:DI (match_dup 1) (const_int 0)))]
13170 "TARGET_POWERPC64 && reload_completed"
13171 [(set (match_dup 0)
13172 (gt:DI (match_dup 1) (const_int 0)))
13174 (compare:CC (match_dup 0)
13179 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13180 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13181 (match_operand:SI 2 "reg_or_short_operand" "r")))]
13183 "doz %0,%2,%1\;nabs %0,%0\;{sri|srwi} %0,%0,31"
13184 [(set_attr "length" "12")])
13187 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
13189 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13190 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
13192 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
13193 (gt:SI (match_dup 1) (match_dup 2)))]
13196 doz %0,%2,%1\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
13198 [(set_attr "type" "delayed_compare")
13199 (set_attr "length" "12,16")])
13202 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
13204 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13205 (match_operand:SI 2 "reg_or_short_operand" ""))
13207 (set (match_operand:SI 0 "gpc_reg_operand" "")
13208 (gt:SI (match_dup 1) (match_dup 2)))]
13209 "TARGET_POWER && reload_completed"
13210 [(set (match_dup 0)
13211 (gt:SI (match_dup 1) (match_dup 2)))
13213 (compare:CC (match_dup 0)
13218 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
13219 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13221 (match_operand:SI 2 "gpc_reg_operand" "r")))]
13222 "! TARGET_POWERPC64"
13223 "{a|addc} %0,%1,%1\;{sfe|subfe} %0,%1,%0\;{aze|addze} %0,%2"
13224 [(set_attr "length" "12")])
13227 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
13228 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13230 (match_operand:DI 2 "gpc_reg_operand" "r")))]
13232 "addc %0,%1,%1\;subfe %0,%1,%0\;addze %0,%2"
13233 [(set_attr "length" "12")])
13236 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
13238 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13240 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
13242 (clobber (match_scratch:SI 3 "=&r,&r"))]
13243 "! TARGET_POWERPC64"
13245 {a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %3,%2
13247 [(set_attr "type" "compare")
13248 (set_attr "length" "12,16")])
13251 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13253 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13255 (match_operand:SI 2 "gpc_reg_operand" ""))
13257 (clobber (match_scratch:SI 3 ""))]
13258 "! TARGET_POWERPC64 && reload_completed"
13259 [(set (match_dup 3)
13260 (plus:SI (gt:SI (match_dup 1) (const_int 0))
13263 (compare:CC (match_dup 3)
13268 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
13270 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
13272 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
13274 (clobber (match_scratch:DI 3 "=&r,&r"))]
13277 addc %3,%1,%1\;subfe %3,%1,%3\;addze. %3,%2
13279 [(set_attr "type" "compare")
13280 (set_attr "length" "12,16")])
13283 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13285 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
13287 (match_operand:DI 2 "gpc_reg_operand" ""))
13289 (clobber (match_scratch:DI 3 ""))]
13290 "TARGET_POWERPC64 && reload_completed"
13291 [(set (match_dup 3)
13292 (plus:DI (gt:DI (match_dup 1) (const_int 0))
13295 (compare:CC (match_dup 3)
13300 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
13302 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13304 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
13306 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
13307 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))]
13308 "! TARGET_POWERPC64"
13310 {a|addc} %0,%1,%1\;{sfe|subfe} %0,%1,%0\;{aze.|addze.} %0,%2
13312 [(set_attr "type" "compare")
13313 (set_attr "length" "12,16")])
13316 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
13318 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13320 (match_operand:SI 2 "gpc_reg_operand" ""))
13322 (set (match_operand:SI 0 "gpc_reg_operand" "")
13323 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))]
13324 "! TARGET_POWERPC64 && reload_completed"
13325 [(set (match_dup 0)
13326 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
13328 (compare:CC (match_dup 0)
13333 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
13335 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
13337 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
13339 (set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r")
13340 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))]
13343 addc %0,%1,%1\;subfe %0,%1,%0\;addze. %0,%2
13345 [(set_attr "type" "compare")
13346 (set_attr "length" "12,16")])
13349 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
13351 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
13353 (match_operand:DI 2 "gpc_reg_operand" ""))
13355 (set (match_operand:DI 0 "gpc_reg_operand" "")
13356 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))]
13357 "TARGET_POWERPC64 && reload_completed"
13358 [(set (match_dup 0)
13359 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
13361 (compare:CC (match_dup 0)
13366 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
13367 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13368 (match_operand:SI 2 "reg_or_short_operand" "r"))
13369 (match_operand:SI 3 "gpc_reg_operand" "r")))]
13371 "doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{aze|addze} %0,%3"
13372 [(set_attr "length" "12")])
13375 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
13377 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13378 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
13379 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
13381 (clobber (match_scratch:SI 4 "=&r,&r"))]
13384 doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
13386 [(set_attr "type" "compare")
13387 (set_attr "length" "12,16")])
13390 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13392 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13393 (match_operand:SI 2 "reg_or_short_operand" ""))
13394 (match_operand:SI 3 "gpc_reg_operand" ""))
13396 (clobber (match_scratch:SI 4 ""))]
13397 "TARGET_POWER && reload_completed"
13398 [(set (match_dup 4)
13399 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
13401 (compare:CC (match_dup 4)
13406 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
13408 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13409 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
13410 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
13412 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
13413 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13416 doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{aze.|addze.} %0,%3
13418 [(set_attr "type" "compare")
13419 (set_attr "length" "12,16")])
13422 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
13424 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
13425 (match_operand:SI 2 "reg_or_short_operand" ""))
13426 (match_operand:SI 3 "gpc_reg_operand" ""))
13428 (set (match_operand:SI 0 "gpc_reg_operand" "")
13429 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13430 "TARGET_POWER && reload_completed"
13431 [(set (match_dup 0)
13432 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
13434 (compare:CC (match_dup 0)
13439 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13440 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13442 "! TARGET_POWERPC64"
13443 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{srai|srawi} %0,%0,31"
13444 [(set_attr "length" "12")])
13447 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
13448 (neg:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13451 "subfic %0,%1,0\;addme %0,%0\;sradi %0,%0,63"
13452 [(set_attr "length" "12")])
13455 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13456 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13457 (match_operand:SI 2 "reg_or_short_operand" "r"))))]
13459 "doz %0,%2,%1\;nabs %0,%0\;{srai|srawi} %0,%0,31"
13460 [(set_attr "length" "12")])
13463 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13464 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13465 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
13466 "! TARGET_POWERPC64"
13467 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
13468 [(set_attr "length" "12")])
13471 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
13472 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13473 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
13475 "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg %0,%0"
13476 [(set_attr "length" "12")])
13479 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
13481 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13482 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
13484 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
13485 (gtu:SI (match_dup 1) (match_dup 2)))]
13486 "! TARGET_POWERPC64"
13488 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
13490 [(set_attr "type" "compare")
13491 (set_attr "length" "12,16")])
13494 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
13496 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
13497 (match_operand:SI 2 "reg_or_short_operand" ""))
13499 (set (match_operand:SI 0 "gpc_reg_operand" "")
13500 (gtu:SI (match_dup 1) (match_dup 2)))]
13501 "! TARGET_POWERPC64 && reload_completed"
13502 [(set (match_dup 0)
13503 (gtu:SI (match_dup 1) (match_dup 2)))
13505 (compare:CC (match_dup 0)
13510 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
13512 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
13513 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
13515 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
13516 (gtu:DI (match_dup 1) (match_dup 2)))]
13519 subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg. %0,%0
13521 [(set_attr "type" "compare")
13522 (set_attr "length" "12,16")])
13525 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
13527 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
13528 (match_operand:DI 2 "reg_or_short_operand" ""))
13530 (set (match_operand:DI 0 "gpc_reg_operand" "")
13531 (gtu:DI (match_dup 1) (match_dup 2)))]
13532 "TARGET_POWERPC64 && reload_completed"
13533 [(set (match_dup 0)
13534 (gtu:DI (match_dup 1) (match_dup 2)))
13536 (compare:CC (match_dup 0)
13541 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
13542 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
13543 (match_operand:SI 2 "reg_or_short_operand" "I,rI"))
13544 (match_operand:SI 3 "reg_or_short_operand" "r,rI")))]
13545 "! TARGET_POWERPC64"
13547 {ai|addic} %0,%1,%k2\;{aze|addze} %0,%3
13548 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3"
13549 [(set_attr "length" "8,12")])
13552 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r")
13553 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
13554 (match_operand:DI 2 "reg_or_short_operand" "I,rI"))
13555 (match_operand:DI 3 "reg_or_short_operand" "r,rI")))]
13558 addic %0,%1,%k2\;addze %0,%3
13559 subf%I2c %0,%1,%2\;subfe %0,%0,%0\;subf%I3c %0,%0,%3"
13560 [(set_attr "length" "8,12")])
13563 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
13565 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
13566 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
13567 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
13569 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
13570 "! TARGET_POWERPC64"
13572 {ai|addic} %4,%1,%k2\;{aze.|addze.} %4,%3
13573 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
13576 [(set_attr "type" "compare")
13577 (set_attr "length" "8,12,12,16")])
13580 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13582 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
13583 (match_operand:SI 2 "reg_or_short_operand" ""))
13584 (match_operand:SI 3 "gpc_reg_operand" ""))
13586 (clobber (match_scratch:SI 4 ""))]
13587 "! TARGET_POWERPC64 && reload_completed"
13588 [(set (match_dup 4)
13589 (plus:SI (gtu:SI (match_dup 1) (match_dup 2))
13592 (compare:CC (match_dup 4)
13597 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
13599 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
13600 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
13601 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
13603 (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))]
13606 addic %4,%1,%k2\;addze. %4,%3
13607 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %4,%4,%3
13610 [(set_attr "type" "compare")
13611 (set_attr "length" "8,12,12,16")])
13614 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
13616 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
13617 (match_operand:DI 2 "reg_or_short_operand" ""))
13618 (match_operand:DI 3 "gpc_reg_operand" ""))
13620 (clobber (match_scratch:DI 4 ""))]
13621 "TARGET_POWERPC64 && reload_completed"
13622 [(set (match_dup 4)
13623 (plus:DI (gtu:DI (match_dup 1) (match_dup 2))
13626 (compare:CC (match_dup 4)
13631 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
13633 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
13634 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
13635 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
13637 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
13638 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13639 "! TARGET_POWERPC64"
13641 {ai|addic} %0,%1,%k2\;{aze.|addze.} %0,%3
13642 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;{sf.|subfc.} %0,%0,%3
13645 [(set_attr "type" "compare")
13646 (set_attr "length" "8,12,12,16")])
13649 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
13651 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
13652 (match_operand:SI 2 "reg_or_short_operand" ""))
13653 (match_operand:SI 3 "gpc_reg_operand" ""))
13655 (set (match_operand:SI 0 "gpc_reg_operand" "")
13656 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13657 "! TARGET_POWERPC64 && reload_completed"
13658 [(set (match_dup 0)
13659 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
13661 (compare:CC (match_dup 0)
13666 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
13668 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
13669 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
13670 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
13672 (set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,&r,&r")
13673 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13676 addic %0,%1,%k2\;addze. %0,%3
13677 subf%I2c %0,%1,%2\;subfe %0,%0,%0\;subfc. %0,%0,%3
13680 [(set_attr "type" "compare")
13681 (set_attr "length" "8,12,12,16")])
13684 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
13686 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
13687 (match_operand:DI 2 "reg_or_short_operand" ""))
13688 (match_operand:DI 3 "gpc_reg_operand" ""))
13690 (set (match_operand:DI 0 "gpc_reg_operand" "")
13691 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
13692 "TARGET_POWERPC64 && reload_completed"
13693 [(set (match_dup 0)
13694 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
13696 (compare:CC (match_dup 0)
13701 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13702 (neg:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13703 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
13704 "! TARGET_POWERPC64"
13705 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0"
13706 [(set_attr "length" "8")])
13709 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
13710 (neg:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13711 (match_operand:DI 2 "reg_or_short_operand" "rI"))))]
13713 "subf%I2c %0,%1,%2\;subfe %0,%0,%0"
13714 [(set_attr "length" "8")])
13716 ;; Define both directions of branch and return. If we need a reload
13717 ;; register, we'd rather use CR0 since it is much easier to copy a
13718 ;; register CC value to there.
13722 (if_then_else (match_operator 1 "branch_comparison_operator"
13724 "cc_reg_operand" "x,?y")
13726 (label_ref (match_operand 0 "" ""))
13731 return output_cbranch (operands[1], \"%l0\", 0, insn);
13733 [(set_attr "type" "branch")])
13737 (if_then_else (match_operator 0 "branch_comparison_operator"
13739 "cc_reg_operand" "x,?y")
13746 return output_cbranch (operands[0], NULL, 0, insn);
13748 [(set_attr "type" "branch")
13749 (set_attr "length" "4")])
13753 (if_then_else (match_operator 1 "branch_comparison_operator"
13755 "cc_reg_operand" "x,?y")
13758 (label_ref (match_operand 0 "" ""))))]
13762 return output_cbranch (operands[1], \"%l0\", 1, insn);
13764 [(set_attr "type" "branch")])
13768 (if_then_else (match_operator 0 "branch_comparison_operator"
13770 "cc_reg_operand" "x,?y")
13777 return output_cbranch (operands[0], NULL, 1, insn);
13779 [(set_attr "type" "branch")
13780 (set_attr "length" "4")])
13782 ;; Logic on condition register values.
13784 ; This pattern matches things like
13785 ; (set (reg:CCEQ 68) (compare:CCEQ (ior:SI (gt:SI (reg:CCFP 68) (const_int 0))
13786 ; (eq:SI (reg:CCFP 68) (const_int 0)))
13788 ; which are generated by the branch logic.
13791 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13792 (compare:CCEQ (match_operator:SI 1 "boolean_operator"
13793 [(match_operator:SI 2
13794 "branch_positive_comparison_operator"
13796 "cc_reg_operand" "y")
13798 (match_operator:SI 4
13799 "branch_positive_comparison_operator"
13801 "cc_reg_operand" "y")
13805 "cr%q1 %E0,%j2,%j4"
13806 [(set_attr "type" "cr_logical")])
13808 ; Why is the constant -1 here, but 1 in the previous pattern?
13809 ; Because ~1 has all but the low bit set.
13811 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13812 (compare:CCEQ (match_operator:SI 1 "boolean_or_operator"
13813 [(not:SI (match_operator:SI 2
13814 "branch_positive_comparison_operator"
13816 "cc_reg_operand" "y")
13818 (match_operator:SI 4
13819 "branch_positive_comparison_operator"
13821 "cc_reg_operand" "y")
13825 "cr%q1 %E0,%j2,%j4"
13826 [(set_attr "type" "cr_logical")])
13829 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13830 (compare:CCEQ (match_operator:SI 1
13831 "branch_positive_comparison_operator"
13833 "cc_reg_operand" "y")
13837 "{crnor %E0,%j1,%j1|crnot %E0,%j1}"
13838 [(set_attr "type" "cr_logical")])
13840 ;; If we are comparing the result of two comparisons, this can be done
13841 ;; using creqv or crxor.
13843 (define_insn_and_split ""
13844 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13845 (compare:CCEQ (match_operator 1 "branch_comparison_operator"
13846 [(match_operand 2 "cc_reg_operand" "y")
13848 (match_operator 3 "branch_comparison_operator"
13849 [(match_operand 4 "cc_reg_operand" "y")
13854 [(set (match_dup 0) (compare:CCEQ (xor:SI (match_dup 1) (match_dup 3))
13858 int positive_1, positive_2;
13860 positive_1 = branch_positive_comparison_operator (operands[1], CCEQmode);
13861 positive_2 = branch_positive_comparison_operator (operands[3], CCEQmode);
13864 operands[1] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[2]),
13865 GET_CODE (operands[1])),
13867 operands[2], const0_rtx);
13868 else if (GET_MODE (operands[1]) != SImode)
13869 operands[1] = gen_rtx (GET_CODE (operands[1]),
13871 operands[2], const0_rtx);
13874 operands[3] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[4]),
13875 GET_CODE (operands[3])),
13877 operands[4], const0_rtx);
13878 else if (GET_MODE (operands[3]) != SImode)
13879 operands[3] = gen_rtx (GET_CODE (operands[3]),
13881 operands[4], const0_rtx);
13883 if (positive_1 == positive_2)
13885 operands[1] = gen_rtx_NOT (SImode, operands[1]);
13886 operands[5] = constm1_rtx;
13890 operands[5] = const1_rtx;
13894 ;; Unconditional branch and return.
13896 (define_insn "jump"
13898 (label_ref (match_operand 0 "" "")))]
13901 [(set_attr "type" "branch")])
13903 (define_insn "return"
13907 [(set_attr "type" "jmpreg")])
13909 (define_expand "indirect_jump"
13910 [(set (pc) (match_operand 0 "register_operand" ""))]
13915 emit_jump_insn (gen_indirect_jumpsi (operands[0]));
13917 emit_jump_insn (gen_indirect_jumpdi (operands[0]));
13921 (define_insn "indirect_jumpsi"
13922 [(set (pc) (match_operand:SI 0 "register_operand" "c,*l"))]
13927 [(set_attr "type" "jmpreg")])
13929 (define_insn "indirect_jumpdi"
13930 [(set (pc) (match_operand:DI 0 "register_operand" "c,*l"))]
13935 [(set_attr "type" "jmpreg")])
13937 ;; Table jump for switch statements:
13938 (define_expand "tablejump"
13939 [(use (match_operand 0 "" ""))
13940 (use (label_ref (match_operand 1 "" "")))]
13945 emit_jump_insn (gen_tablejumpsi (operands[0], operands[1]));
13947 emit_jump_insn (gen_tablejumpdi (operands[0], operands[1]));
13951 (define_expand "tablejumpsi"
13952 [(set (match_dup 3)
13953 (plus:SI (match_operand:SI 0 "" "")
13955 (parallel [(set (pc) (match_dup 3))
13956 (use (label_ref (match_operand 1 "" "")))])]
13959 { operands[0] = force_reg (SImode, operands[0]);
13960 operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1]));
13961 operands[3] = gen_reg_rtx (SImode);
13964 (define_expand "tablejumpdi"
13965 [(set (match_dup 4)
13966 (sign_extend:DI (match_operand:SI 0 "lwa_operand" "rm")))
13968 (plus:DI (match_dup 4)
13970 (parallel [(set (pc) (match_dup 3))
13971 (use (label_ref (match_operand 1 "" "")))])]
13974 { operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
13975 operands[3] = gen_reg_rtx (DImode);
13976 operands[4] = gen_reg_rtx (DImode);
13981 (match_operand:SI 0 "register_operand" "c,*l"))
13982 (use (label_ref (match_operand 1 "" "")))]
13987 [(set_attr "type" "jmpreg")])
13991 (match_operand:DI 0 "register_operand" "c,*l"))
13992 (use (label_ref (match_operand 1 "" "")))]
13997 [(set_attr "type" "jmpreg")])
14002 "{cror 0,0,0|nop}")
14004 ;; Define the subtract-one-and-jump insns, starting with the template
14005 ;; so loop.c knows what to generate.
14007 (define_expand "doloop_end"
14008 [(use (match_operand 0 "" "")) ; loop pseudo
14009 (use (match_operand 1 "" "")) ; iterations; zero if unknown
14010 (use (match_operand 2 "" "")) ; max iterations
14011 (use (match_operand 3 "" "")) ; loop level
14012 (use (match_operand 4 "" ""))] ; label
14016 /* Only use this on innermost loops. */
14017 if (INTVAL (operands[3]) > 1)
14019 if (TARGET_POWERPC64)
14021 if (GET_MODE (operands[0]) != DImode)
14023 emit_jump_insn (gen_ctrdi (operands[0], operands[4]));
14027 if (GET_MODE (operands[0]) != SImode)
14029 emit_jump_insn (gen_ctrsi (operands[0], operands[4]));
14034 (define_expand "ctrsi"
14035 [(parallel [(set (pc)
14036 (if_then_else (ne (match_operand:SI 0 "register_operand" "")
14038 (label_ref (match_operand 1 "" ""))
14041 (plus:SI (match_dup 0)
14043 (clobber (match_scratch:CC 2 ""))
14044 (clobber (match_scratch:SI 3 ""))])]
14045 "! TARGET_POWERPC64"
14048 (define_expand "ctrdi"
14049 [(parallel [(set (pc)
14050 (if_then_else (ne (match_operand:DI 0 "register_operand" "")
14052 (label_ref (match_operand 1 "" ""))
14055 (plus:DI (match_dup 0)
14057 (clobber (match_scratch:CC 2 ""))
14058 (clobber (match_scratch:DI 3 ""))])]
14062 ;; We need to be able to do this for any operand, including MEM, or we
14063 ;; will cause reload to blow up since we don't allow output reloads on
14065 ;; For the length attribute to be calculated correctly, the
14066 ;; label MUST be operand 0.
14068 (define_insn "*ctrsi_internal1"
14070 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
14072 (label_ref (match_operand 0 "" ""))
14074 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14075 (plus:SI (match_dup 1)
14077 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14078 (clobber (match_scratch:SI 4 "=X,X,r"))]
14079 "! TARGET_POWERPC64"
14082 if (which_alternative != 0)
14084 else if (get_attr_length (insn) == 4)
14085 return \"{bdn|bdnz} %l0\";
14087 return \"bdz $+8\;b %l0\";
14089 [(set_attr "type" "branch")
14090 (set_attr "length" "*,12,16")])
14092 (define_insn "*ctrsi_internal2"
14094 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
14097 (label_ref (match_operand 0 "" ""))))
14098 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14099 (plus:SI (match_dup 1)
14101 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14102 (clobber (match_scratch:SI 4 "=X,X,r"))]
14103 "! TARGET_POWERPC64"
14106 if (which_alternative != 0)
14108 else if (get_attr_length (insn) == 4)
14109 return \"bdz %l0\";
14111 return \"{bdn|bdnz} $+8\;b %l0\";
14113 [(set_attr "type" "branch")
14114 (set_attr "length" "*,12,16")])
14116 (define_insn "*ctrdi_internal1"
14118 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
14120 (label_ref (match_operand 0 "" ""))
14122 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14123 (plus:DI (match_dup 1)
14125 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14126 (clobber (match_scratch:DI 4 "=X,X,r"))]
14130 if (which_alternative != 0)
14132 else if (get_attr_length (insn) == 4)
14133 return \"{bdn|bdnz} %l0\";
14135 return \"bdz $+8\;b %l0\";
14137 [(set_attr "type" "branch")
14138 (set_attr "length" "*,12,16")])
14140 (define_insn "*ctrdi_internal2"
14142 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
14145 (label_ref (match_operand 0 "" ""))))
14146 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14147 (plus:DI (match_dup 1)
14149 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14150 (clobber (match_scratch:DI 4 "=X,X,r"))]
14154 if (which_alternative != 0)
14156 else if (get_attr_length (insn) == 4)
14157 return \"bdz %l0\";
14159 return \"{bdn|bdnz} $+8\;b %l0\";
14161 [(set_attr "type" "branch")
14162 (set_attr "length" "*,12,16")])
14164 ;; Similar, but we can use GE since we have a REG_NONNEG.
14166 (define_insn "*ctrsi_internal3"
14168 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
14170 (label_ref (match_operand 0 "" ""))
14172 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14173 (plus:SI (match_dup 1)
14175 (clobber (match_scratch:CC 3 "=X,&x,&X"))
14176 (clobber (match_scratch:SI 4 "=X,X,r"))]
14177 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
14180 if (which_alternative != 0)
14182 else if (get_attr_length (insn) == 4)
14183 return \"{bdn|bdnz} %l0\";
14185 return \"bdz $+8\;b %l0\";
14187 [(set_attr "type" "branch")
14188 (set_attr "length" "*,12,16")])
14190 (define_insn "*ctrsi_internal4"
14192 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
14195 (label_ref (match_operand 0 "" ""))))
14196 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14197 (plus:SI (match_dup 1)
14199 (clobber (match_scratch:CC 3 "=X,&x,&X"))
14200 (clobber (match_scratch:SI 4 "=X,X,r"))]
14201 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
14204 if (which_alternative != 0)
14206 else if (get_attr_length (insn) == 4)
14207 return \"bdz %l0\";
14209 return \"{bdn|bdnz} $+8\;b %l0\";
14211 [(set_attr "type" "branch")
14212 (set_attr "length" "*,12,16")])
14214 (define_insn "*ctrdi_internal3"
14216 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
14218 (label_ref (match_operand 0 "" ""))
14220 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14221 (plus:DI (match_dup 1)
14223 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14224 (clobber (match_scratch:DI 4 "=X,X,r"))]
14225 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
14228 if (which_alternative != 0)
14230 else if (get_attr_length (insn) == 4)
14231 return \"{bdn|bdnz} %l0\";
14233 return \"bdz $+8\;b %l0\";
14235 [(set_attr "type" "branch")
14236 (set_attr "length" "*,12,16")])
14238 (define_insn "*ctrdi_internal4"
14240 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
14243 (label_ref (match_operand 0 "" ""))))
14244 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14245 (plus:DI (match_dup 1)
14247 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14248 (clobber (match_scratch:DI 4 "=X,X,r"))]
14249 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
14252 if (which_alternative != 0)
14254 else if (get_attr_length (insn) == 4)
14255 return \"bdz %l0\";
14257 return \"{bdn|bdnz} $+8\;b %l0\";
14259 [(set_attr "type" "branch")
14260 (set_attr "length" "*,12,16")])
14262 ;; Similar but use EQ
14264 (define_insn "*ctrsi_internal5"
14266 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
14268 (label_ref (match_operand 0 "" ""))
14270 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14271 (plus:SI (match_dup 1)
14273 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14274 (clobber (match_scratch:SI 4 "=X,X,r"))]
14275 "! TARGET_POWERPC64"
14278 if (which_alternative != 0)
14280 else if (get_attr_length (insn) == 4)
14281 return \"bdz %l0\";
14283 return \"{bdn|bdnz} $+8\;b %l0\";
14285 [(set_attr "type" "branch")
14286 (set_attr "length" "*,12,16")])
14288 (define_insn "*ctrsi_internal6"
14290 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
14293 (label_ref (match_operand 0 "" ""))))
14294 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
14295 (plus:SI (match_dup 1)
14297 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14298 (clobber (match_scratch:SI 4 "=X,X,r"))]
14299 "! TARGET_POWERPC64"
14302 if (which_alternative != 0)
14304 else if (get_attr_length (insn) == 4)
14305 return \"{bdn|bdnz} %l0\";
14307 return \"bdz $+8\;b %l0\";
14309 [(set_attr "type" "branch")
14310 (set_attr "length" "*,12,16")])
14312 (define_insn "*ctrdi_internal5"
14314 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
14316 (label_ref (match_operand 0 "" ""))
14318 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14319 (plus:DI (match_dup 1)
14321 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14322 (clobber (match_scratch:DI 4 "=X,X,r"))]
14326 if (which_alternative != 0)
14328 else if (get_attr_length (insn) == 4)
14329 return \"bdz %l0\";
14331 return \"{bdn|bdnz} $+8\;b %l0\";
14333 [(set_attr "type" "branch")
14334 (set_attr "length" "*,12,16")])
14336 (define_insn "*ctrdi_internal6"
14338 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
14341 (label_ref (match_operand 0 "" ""))))
14342 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
14343 (plus:DI (match_dup 1)
14345 (clobber (match_scratch:CC 3 "=X,&x,&x"))
14346 (clobber (match_scratch:DI 4 "=X,X,r"))]
14350 if (which_alternative != 0)
14352 else if (get_attr_length (insn) == 4)
14353 return \"{bdn|bdnz} %l0\";
14355 return \"bdz $+8\;b %l0\";
14357 [(set_attr "type" "branch")
14358 (set_attr "length" "*,12,16")])
14360 ;; Now the splitters if we could not allocate the CTR register
14364 (if_then_else (match_operator 2 "comparison_operator"
14365 [(match_operand:SI 1 "gpc_reg_operand" "")
14367 (match_operand 5 "" "")
14368 (match_operand 6 "" "")))
14369 (set (match_operand:SI 0 "gpc_reg_operand" "")
14370 (plus:SI (match_dup 1)
14372 (clobber (match_scratch:CC 3 ""))
14373 (clobber (match_scratch:SI 4 ""))]
14374 "! TARGET_POWERPC64 && reload_completed"
14375 [(parallel [(set (match_dup 3)
14376 (compare:CC (plus:SI (match_dup 1)
14380 (plus:SI (match_dup 1)
14382 (set (pc) (if_then_else (match_dup 7)
14386 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
14391 (if_then_else (match_operator 2 "comparison_operator"
14392 [(match_operand:SI 1 "gpc_reg_operand" "")
14394 (match_operand 5 "" "")
14395 (match_operand 6 "" "")))
14396 (set (match_operand:SI 0 "nonimmediate_operand" "")
14397 (plus:SI (match_dup 1) (const_int -1)))
14398 (clobber (match_scratch:CC 3 ""))
14399 (clobber (match_scratch:SI 4 ""))]
14400 "! TARGET_POWERPC64 && reload_completed
14401 && ! gpc_reg_operand (operands[0], SImode)"
14402 [(parallel [(set (match_dup 3)
14403 (compare:CC (plus:SI (match_dup 1)
14407 (plus:SI (match_dup 1)
14411 (set (pc) (if_then_else (match_dup 7)
14415 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
14419 (if_then_else (match_operator 2 "comparison_operator"
14420 [(match_operand:DI 1 "gpc_reg_operand" "")
14422 (match_operand 5 "" "")
14423 (match_operand 6 "" "")))
14424 (set (match_operand:DI 0 "gpc_reg_operand" "")
14425 (plus:DI (match_dup 1)
14427 (clobber (match_scratch:CC 3 ""))
14428 (clobber (match_scratch:DI 4 ""))]
14429 "TARGET_POWERPC64 && reload_completed"
14430 [(parallel [(set (match_dup 3)
14431 (compare:CC (plus:DI (match_dup 1)
14435 (plus:DI (match_dup 1)
14437 (set (pc) (if_then_else (match_dup 7)
14441 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
14446 (if_then_else (match_operator 2 "comparison_operator"
14447 [(match_operand:DI 1 "gpc_reg_operand" "")
14449 (match_operand 5 "" "")
14450 (match_operand 6 "" "")))
14451 (set (match_operand:DI 0 "nonimmediate_operand" "")
14452 (plus:DI (match_dup 1) (const_int -1)))
14453 (clobber (match_scratch:CC 3 ""))
14454 (clobber (match_scratch:DI 4 ""))]
14455 "TARGET_POWERPC64 && reload_completed
14456 && ! gpc_reg_operand (operands[0], DImode)"
14457 [(parallel [(set (match_dup 3)
14458 (compare:CC (plus:DI (match_dup 1)
14462 (plus:DI (match_dup 1)
14466 (set (pc) (if_then_else (match_dup 7)
14470 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
14474 (define_insn "trap"
14475 [(trap_if (const_int 1) (const_int 0))]
14479 (define_expand "conditional_trap"
14480 [(trap_if (match_operator 0 "trap_comparison_operator"
14481 [(match_dup 2) (match_dup 3)])
14482 (match_operand 1 "const_int_operand" ""))]
14484 "if (rs6000_compare_fp_p || operands[1] != const0_rtx) FAIL;
14485 operands[2] = rs6000_compare_op0;
14486 operands[3] = rs6000_compare_op1;")
14489 [(trap_if (match_operator 0 "trap_comparison_operator"
14490 [(match_operand:SI 1 "register_operand" "r")
14491 (match_operand:SI 2 "reg_or_short_operand" "rI")])
14494 "{t|tw}%V0%I2 %1,%2")
14497 [(trap_if (match_operator 0 "trap_comparison_operator"
14498 [(match_operand:DI 1 "register_operand" "r")
14499 (match_operand:DI 2 "reg_or_short_operand" "rI")])
14504 ;; Insns related to generating the function prologue and epilogue.
14506 (define_expand "prologue"
14507 [(use (const_int 0))]
14508 "TARGET_SCHED_PROLOG"
14511 rs6000_emit_prologue ();
14515 (define_insn "movesi_from_cr"
14516 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
14517 (unspec:SI [(reg:CC 68) (reg:CC 69) (reg:CC 70) (reg:CC 71)
14518 (reg:CC 72) (reg:CC 73) (reg:CC 74) (reg:CC 75)] 19))]
14521 [(set_attr "type" "cr_logical")])
14523 (define_insn "*stmw"
14524 [(match_parallel 0 "stmw_operation"
14525 [(set (match_operand:SI 1 "memory_operand" "=m")
14526 (match_operand:SI 2 "gpc_reg_operand" "r"))])]
14528 "{stm|stmw} %2,%1")
14530 (define_insn "*save_fpregs_si"
14531 [(match_parallel 0 "any_operand"
14532 [(clobber (match_operand:SI 1 "register_operand" "=l"))
14533 (use (match_operand:SI 2 "call_operand" "s"))
14534 (set (match_operand:DF 3 "memory_operand" "=m")
14535 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
14539 (define_insn "*save_fpregs_di"
14540 [(match_parallel 0 "any_operand"
14541 [(clobber (match_operand:DI 1 "register_operand" "=l"))
14542 (use (match_operand:DI 2 "call_operand" "s"))
14543 (set (match_operand:DF 3 "memory_operand" "=m")
14544 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
14548 ; These are to explain that changes to the stack pointer should
14549 ; not be moved over stores to stack memory.
14550 (define_insn "stack_tie"
14551 [(set (match_operand:BLK 0 "memory_operand" "+m")
14552 (unspec:BLK [(match_dup 0)] 5))]
14555 [(set_attr "length" "0")])
14558 (define_expand "epilogue"
14559 [(use (const_int 0))]
14560 "TARGET_SCHED_PROLOG"
14563 rs6000_emit_epilogue (FALSE);
14567 ; On some processors, doing the mtcrf one CC register at a time is
14568 ; faster (like on the 604e). On others, doing them all at once is
14569 ; faster; for instance, on the 601 and 750.
14571 (define_expand "movsi_to_cr_one"
14572 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
14573 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
14574 (match_dup 2)] 20))]
14576 "operands[2] = GEN_INT (1 << (75 - REGNO (operands[0])));")
14578 (define_insn "*movsi_to_cr"
14579 [(match_parallel 0 "mtcrf_operation"
14580 [(set (match_operand:CC 1 "cc_reg_operand" "=y")
14581 (unspec:CC [(match_operand:SI 2 "gpc_reg_operand" "r")
14582 (match_operand 3 "immediate_operand" "n")]
14589 for (i = 0; i < XVECLEN (operands[0], 0); i++)
14590 mask |= INTVAL (XVECEXP (SET_SRC (XVECEXP (operands[0], 0, i)), 0, 1));
14591 operands[4] = GEN_INT (mask);
14592 return \"mtcrf %4,%2\";
14594 [(set_attr "type" "cr_logical")])
14597 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
14598 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
14599 (match_operand 2 "immediate_operand" "n")] 20))]
14600 "GET_CODE (operands[0]) == REG
14601 && CR_REGNO_P (REGNO (operands[0]))
14602 && GET_CODE (operands[2]) == CONST_INT
14603 && INTVAL (operands[2]) == 1 << (75 - REGNO (operands[0]))"
14605 [(set_attr "type" "cr_logical")])
14607 ; The load-multiple instructions have similar properties.
14608 ; Note that "load_multiple" is a name known to the machine-independent
14609 ; code that actually corresponds to the powerpc load-string.
14611 (define_insn "*lmw"
14612 [(match_parallel 0 "lmw_operation"
14613 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
14614 (match_operand:SI 2 "memory_operand" "m"))])]
14618 (define_insn "*return_internal_si"
14620 (use (match_operand:SI 0 "register_operand" "lc"))]
14623 [(set_attr "type" "jmpreg")])
14625 (define_insn "*return_internal_di"
14627 (use (match_operand:DI 0 "register_operand" "lc"))]
14630 [(set_attr "type" "jmpreg")])
14632 ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
14633 ; stuff was in GCC. Oh, and "any_operand" is a bit flexible...
14635 (define_insn "*return_and_restore_fpregs_si"
14636 [(match_parallel 0 "any_operand"
14638 (use (match_operand:SI 1 "register_operand" "l"))
14639 (use (match_operand:SI 2 "call_operand" "s"))
14640 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
14641 (match_operand:DF 4 "memory_operand" "m"))])]
14645 (define_insn "*return_and_restore_fpregs_di"
14646 [(match_parallel 0 "any_operand"
14648 (use (match_operand:DI 1 "register_operand" "l"))
14649 (use (match_operand:DI 2 "call_operand" "s"))
14650 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
14651 (match_operand:DF 4 "memory_operand" "m"))])]
14655 ; This is used in compiling the unwind routines.
14656 (define_expand "eh_return"
14657 [(use (match_operand 0 "general_operand" ""))
14658 (use (match_operand 1 "general_operand" ""))]
14663 rs6000_emit_eh_toc_restore (operands[0]);
14666 emit_insn (gen_eh_set_lr_si (operands[1]));
14668 emit_insn (gen_eh_set_lr_di (operands[1]));
14669 emit_move_insn (EH_RETURN_STACKADJ_RTX, operands[0]);
14673 ; We can't expand this before we know where the link register is stored.
14674 (define_insn "eh_set_lr_si"
14675 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] 9)
14676 (clobber (match_scratch:SI 1 "=&b"))]
14680 (define_insn "eh_set_lr_di"
14681 [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")] 9)
14682 (clobber (match_scratch:DI 1 "=&b"))]
14687 [(unspec_volatile [(match_operand 0 "register_operand" "")] 9)
14688 (clobber (match_scratch 1 ""))]
14693 rs6000_stack_t *info = rs6000_stack_info ();
14695 if (info->lr_save_p)
14697 rtx frame_rtx = stack_pointer_rtx;
14701 if (frame_pointer_needed
14702 || current_function_calls_alloca
14703 || info->total_size > 32767)
14705 emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx));
14706 frame_rtx = operands[1];
14708 else if (info->push_p)
14709 sp_offset = info->total_size;
14711 tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset);
14712 tmp = gen_rtx_MEM (Pmode, tmp);
14713 emit_move_insn (tmp, operands[0]);
14716 emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]);
14720 (define_insn "prefetch"
14721 [(prefetch (match_operand:V4SI 0 "address_operand" "p")
14722 (match_operand:SI 1 "const_int_operand" "n")
14723 (match_operand:SI 2 "const_int_operand" "n"))]
14727 if (GET_CODE (operands[0]) == REG)
14728 return INTVAL (operands[1]) ? \"dcbtst 0,%0\" : \"dcbt 0,%0\";
14729 return INTVAL (operands[1]) ? \"dcbtst %a0\" : \"dcbt %a0\";
14731 [(set_attr "type" "load")])
14733 (include "altivec.md")