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 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)
38 ;; Define an insn type attribute. This is used in function unit delay
40 (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"
41 (const_string "integer"))
44 ; '(pc)' in the following doesn't include the instruction itself; it is
45 ; calculated as if the instruction had zero size.
46 (define_attr "length" ""
47 (if_then_else (eq_attr "type" "branch")
48 (if_then_else (and (ge (minus (match_dup 0) (pc))
50 (lt (minus (match_dup 0) (pc))
56 ;; Processor type -- this attribute must exactly match the processor_type
57 ;; enumeration in rs6000.h.
59 (define_attr "cpu" "rios1,rios2,rs64a,mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400,ppc7450,power4"
60 (const (symbol_ref "rs6000_cpu_attr")))
62 ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
63 ; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
65 ; Load/Store Unit -- pure PowerPC only
66 ; (POWER and 601 use Integer Unit)
67 (define_function_unit "lsu" 1 0
68 (and (eq_attr "type" "load")
69 (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
72 (define_function_unit "lsu" 1 0
73 (and (eq_attr "type" "load,vecload")
74 (eq_attr "cpu" "ppc7450"))
77 (define_function_unit "lsu" 1 0
78 (and (eq_attr "type" "store,fpstore")
79 (eq_attr "cpu" "rs64a,mpccore,ppc603,ppc604,ppc604e,ppc620,ppc630"))
82 (define_function_unit "lsu" 1 0
83 (and (eq_attr "type" "store,fpstore")
84 (eq_attr "cpu" "ppc750,ppc7400"))
87 (define_function_unit "lsu" 1 0
88 (and (eq_attr "type" "store,vecstore")
89 (eq_attr "cpu" "ppc7450"))
92 (define_function_unit "lsu" 1 0
93 (and (eq_attr "type" "fpstore")
94 (eq_attr "cpu" "ppc7450"))
97 (define_function_unit "lsu" 1 0
98 (and (eq_attr "type" "fpload")
99 (eq_attr "cpu" "mpccore,ppc603,ppc750,ppc7400"))
102 (define_function_unit "lsu" 1 0
103 (and (eq_attr "type" "fpload")
104 (eq_attr "cpu" "ppc7450"))
107 (define_function_unit "lsu" 1 0
108 (and (eq_attr "type" "fpload")
109 (eq_attr "cpu" "rs64a,ppc604,ppc604e,ppc620,ppc630"))
112 (define_function_unit "iu" 1 0
113 (and (eq_attr "type" "load")
114 (eq_attr "cpu" "rios1,ppc403,ppc405,ppc601"))
117 (define_function_unit "iu" 1 0
118 (and (eq_attr "type" "store,fpstore")
119 (eq_attr "cpu" "rios1,ppc403,ppc405,ppc601"))
122 (define_function_unit "fpu" 1 0
123 (and (eq_attr "type" "fpstore")
124 (eq_attr "cpu" "rios1,ppc601"))
127 (define_function_unit "iu" 1 0
128 (and (eq_attr "type" "fpload")
129 (eq_attr "cpu" "rios1"))
132 (define_function_unit "iu" 1 0
133 (and (eq_attr "type" "fpload")
134 (eq_attr "cpu" "ppc601"))
137 (define_function_unit "iu2" 2 0
138 (and (eq_attr "type" "load,fpload")
139 (eq_attr "cpu" "rios2"))
142 (define_function_unit "iu2" 2 0
143 (and (eq_attr "type" "store,fpstore")
144 (eq_attr "cpu" "rios2"))
147 ; Integer Unit (RIOS1, PPC601, PPC603, RS64a)
148 (define_function_unit "iu" 1 0
149 (and (eq_attr "type" "integer")
150 (eq_attr "cpu" "rios1,rs64a,mpccore,ppc403,ppc405,ppc601,ppc603"))
153 (define_function_unit "iu" 1 0
154 (and (eq_attr "type" "cr_logical")
155 (eq_attr "cpu" "mpccore,ppc403,ppc405,ppc601"))
158 (define_function_unit "iu" 1 0
159 (and (eq_attr "type" "imul,imul2,imul3")
160 (eq_attr "cpu" "ppc403"))
163 (define_function_unit "iu" 1 0
164 (and (eq_attr "type" "imul")
165 (eq_attr "cpu" "ppc405"))
168 (define_function_unit "iu" 1 0
169 (and (eq_attr "type" "imul2,imul3")
170 (eq_attr "cpu" "ppc405"))
173 (define_function_unit "iu" 1 0
174 (and (eq_attr "type" "imul")
175 (eq_attr "cpu" "rios1"))
178 (define_function_unit "iu" 1 0
179 (and (eq_attr "type" "imul2")
180 (eq_attr "cpu" "rios1"))
183 (define_function_unit "iu" 1 0
184 (and (eq_attr "type" "imul3")
185 (eq_attr "cpu" "rios1"))
188 (define_function_unit "iu" 1 0
189 (and (eq_attr "type" "imul,imul2,imul3")
190 (eq_attr "cpu" "ppc601,ppc603"))
193 (define_function_unit "iu" 1 0
194 (and (eq_attr "type" "imul")
195 (eq_attr "cpu" "rs64a"))
198 (define_function_unit "iu" 1 0
199 (and (eq_attr "type" "imul2")
200 (eq_attr "cpu" "rs64a"))
203 (define_function_unit "iu" 1 0
204 (and (eq_attr "type" "imul3")
205 (eq_attr "cpu" "rs64a"))
208 (define_function_unit "iu" 1 0
209 (and (eq_attr "type" "lmul")
210 (eq_attr "cpu" "rs64a"))
213 (define_function_unit "iu" 1 0
214 (and (eq_attr "type" "idiv")
215 (eq_attr "cpu" "rios1"))
218 (define_function_unit "iu" 1 0
219 (and (eq_attr "type" "idiv")
220 (eq_attr "cpu" "rs64a"))
223 (define_function_unit "iu" 1 0
224 (and (eq_attr "type" "ldiv")
225 (eq_attr "cpu" "rs64a"))
228 (define_function_unit "iu" 1 0
229 (and (eq_attr "type" "idiv")
230 (eq_attr "cpu" "ppc403"))
233 (define_function_unit "iu" 1 0
234 (and (eq_attr "type" "idiv")
235 (eq_attr "cpu" "ppc405"))
238 (define_function_unit "iu" 1 0
239 (and (eq_attr "type" "idiv")
240 (eq_attr "cpu" "ppc601"))
243 (define_function_unit "iu" 1 0
244 (and (eq_attr "type" "idiv")
245 (eq_attr "cpu" "ppc603"))
248 ; RIOS2 has two integer units: a primary one which can perform all
249 ; operations and a secondary one which is fed in lock step with the first
250 ; and can perform "simple" integer operations.
251 ; To catch this we define a 'dummy' imuldiv-unit that is also needed
252 ; for the complex insns.
253 (define_function_unit "iu2" 2 0
254 (and (eq_attr "type" "integer")
255 (eq_attr "cpu" "rios2"))
258 (define_function_unit "iu2" 2 0
259 (and (eq_attr "type" "imul,imul2,imul3")
260 (eq_attr "cpu" "rios2"))
263 (define_function_unit "iu2" 2 0
264 (and (eq_attr "type" "idiv")
265 (eq_attr "cpu" "rios2"))
268 (define_function_unit "imuldiv" 1 0
269 (and (eq_attr "type" "imul,imul2,imul3")
270 (eq_attr "cpu" "rios2"))
273 (define_function_unit "imuldiv" 1 0
274 (and (eq_attr "type" "idiv")
275 (eq_attr "cpu" "rios2"))
278 ; MPCCORE has separate IMUL/IDIV unit for multicycle instructions
279 ; Divide latency varies greatly from 2-11, use 6 as average
280 (define_function_unit "imuldiv" 1 0
281 (and (eq_attr "type" "imul,imul2,imul3")
282 (eq_attr "cpu" "mpccore"))
285 (define_function_unit "imuldiv" 1 0
286 (and (eq_attr "type" "idiv")
287 (eq_attr "cpu" "mpccore"))
290 ; PPC604{,e} has two units that perform integer operations
291 ; and one unit for divide/multiply operations (and move
293 (define_function_unit "iu2" 2 0
294 (and (eq_attr "type" "integer")
295 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630"))
298 (define_function_unit "imuldiv" 1 0
299 (and (eq_attr "type" "imul,imul2,imul3")
300 (eq_attr "cpu" "ppc604"))
303 (define_function_unit "imuldiv" 1 0
304 (and (eq_attr "type" "imul,imul2,imul3")
305 (eq_attr "cpu" "ppc604e"))
308 (define_function_unit "imuldiv" 1 0
309 (and (eq_attr "type" "imul")
310 (eq_attr "cpu" "ppc620,ppc630"))
313 (define_function_unit "imuldiv" 1 0
314 (and (eq_attr "type" "imul2")
315 (eq_attr "cpu" "ppc620,ppc630"))
318 (define_function_unit "imuldiv" 1 0
319 (and (eq_attr "type" "imul3")
320 (eq_attr "cpu" "ppc620,ppc630"))
323 (define_function_unit "imuldiv" 1 0
324 (and (eq_attr "type" "lmul")
325 (eq_attr "cpu" "ppc620,ppc630"))
328 (define_function_unit "imuldiv" 1 0
329 (and (eq_attr "type" "idiv")
330 (eq_attr "cpu" "ppc604,ppc604e"))
333 (define_function_unit "imuldiv" 1 0
334 (and (eq_attr "type" "idiv")
335 (eq_attr "cpu" "ppc620"))
338 (define_function_unit "imuldiv" 1 0
339 (and (eq_attr "type" "idiv")
340 (eq_attr "cpu" "ppc630"))
343 (define_function_unit "imuldiv" 1 0
344 (and (eq_attr "type" "ldiv")
345 (eq_attr "cpu" "ppc620,ppc630"))
348 ; PPC7450 has 3 integer units (for most integer insns) and one mul/div
349 ; unit, which also does CR-logical insns and move to/from SPR.
350 ; It also has 4 vector units, one for each type of vector instruction.
351 ; However, we can only dispatch 2 instructions per cycle.
352 ; We model this as saying that dispatching two of the same type of instruction
353 ; in a row incurs a single cycle delay.
354 (define_function_unit "iu3" 3 0
355 (and (eq_attr "type" "integer")
356 (eq_attr "cpu" "ppc7450"))
359 (define_function_unit "imuldiv" 1 0
360 (and (eq_attr "type" "imul")
361 (eq_attr "cpu" "ppc7450"))
364 (define_function_unit "imuldiv" 1 0
365 (and (eq_attr "type" "imul2,imul3")
366 (eq_attr "cpu" "ppc7450"))
369 (define_function_unit "imuldiv" 1 0
370 (and (eq_attr "type" "idiv")
371 (eq_attr "cpu" "ppc7450"))
374 (define_function_unit "imuldiv" 1 0
375 (and (eq_attr "type" "cr_logical")
376 (eq_attr "cpu" "ppc7450"))
379 (define_function_unit "vec_alu2" 2 0
380 (and (eq_attr "type" "vecsimple")
381 (eq_attr "cpu" "ppc7450"))
382 1 2 [(eq_attr "type" "vecsimple")])
384 (define_function_unit "vec_alu2" 2 0
385 (and (eq_attr "type" "vecsimple")
386 (eq_attr "cpu" "ppc7450"))
387 1 1 [(eq_attr "type" "!vecsimple")])
389 (define_function_unit "vec_alu2" 2 0
390 (and (eq_attr "type" "veccomplex")
391 (eq_attr "cpu" "ppc7450"))
392 4 2 [(eq_attr "type" "veccomplex")])
394 (define_function_unit "vec_alu2" 2 0
395 (and (eq_attr "type" "veccomplex")
396 (eq_attr "cpu" "ppc7450"))
397 4 1 [(eq_attr "type" "!veccomplex")])
399 (define_function_unit "vec_alu2" 2 0
400 (and (eq_attr "type" "veccmp")
401 (eq_attr "cpu" "ppc7450"))
402 2 2 [(eq_attr "type" "veccmp")])
404 (define_function_unit "vec_alu2" 2 0
405 (and (eq_attr "type" "veccmp")
406 (eq_attr "cpu" "ppc7450"))
407 2 1 [(eq_attr "type" "!veccmp")])
409 (define_function_unit "vec_alu2" 2 0
410 (and (eq_attr "type" "vecfloat")
411 (eq_attr "cpu" "ppc7450"))
412 4 2 [(eq_attr "type" "vecfloat")])
414 (define_function_unit "vec_alu2" 2 0
415 (and (eq_attr "type" "vecfloat")
416 (eq_attr "cpu" "ppc7450"))
417 4 1 [(eq_attr "type" "!vecfloat")])
419 (define_function_unit "vec_alu2" 2 0
420 (and (eq_attr "type" "vecperm")
421 (eq_attr "cpu" "ppc7450"))
422 2 2 [(eq_attr "type" "vecperm")])
424 (define_function_unit "vec_alu2" 2 0
425 (and (eq_attr "type" "vecperm")
426 (eq_attr "cpu" "ppc7450"))
427 2 1 [(eq_attr "type" "!vecperm")])
429 ; PPC750 has two integer units: a primary one which can perform all
430 ; operations and a secondary one which is fed in lock step with the first
431 ; and can perform "simple" integer operations.
432 ; To catch this we define a 'dummy' imuldiv-unit that is also needed
433 ; for the complex insns.
434 (define_function_unit "iu2" 2 0
435 (and (eq_attr "type" "integer")
436 (eq_attr "cpu" "ppc750,ppc7400"))
439 (define_function_unit "iu2" 2 0
440 (and (eq_attr "type" "imul")
441 (eq_attr "cpu" "ppc750,ppc7400"))
444 (define_function_unit "iu2" 2 0
445 (and (eq_attr "type" "imul2")
446 (eq_attr "cpu" "ppc750,ppc7400"))
449 (define_function_unit "iu2" 2 0
450 (and (eq_attr "type" "imul3")
451 (eq_attr "cpu" "ppc750,ppc7400"))
454 (define_function_unit "iu2" 2 0
455 (and (eq_attr "type" "idiv")
456 (eq_attr "cpu" "ppc750,ppc7400"))
459 (define_function_unit "imuldiv" 1 0
460 (and (eq_attr "type" "imul")
461 (eq_attr "cpu" "ppc750,ppc7400"))
464 (define_function_unit "imuldiv" 1 0
465 (and (eq_attr "type" "imul2")
466 (eq_attr "cpu" "ppc750,ppc7400"))
469 (define_function_unit "imuldiv" 1 0
470 (and (eq_attr "type" "imul3")
471 (eq_attr "cpu" "ppc750,ppc7400"))
474 (define_function_unit "imuldiv" 1 0
475 (and (eq_attr "type" "idiv")
476 (eq_attr "cpu" "ppc750,ppc7400"))
479 ; CR-logical operations are execute-serialized, that is they don't
480 ; start (and block the function unit) until all preceding operations
481 ; have finished. They don't block dispatch of other insns, though.
482 ; I've imitated this by giving them longer latency.
483 (define_function_unit "sru" 1 0
484 (and (eq_attr "type" "cr_logical")
485 (eq_attr "cpu" "ppc603,ppc750,ppc7400"))
488 ; compare is done on integer unit, but feeds insns which
489 ; execute on the branch unit.
490 (define_function_unit "iu" 1 0
491 (and (eq_attr "type" "compare")
492 (eq_attr "cpu" "rios1"))
495 (define_function_unit "iu" 1 0
496 (and (eq_attr "type" "delayed_compare")
497 (eq_attr "cpu" "rios1"))
500 (define_function_unit "iu" 1 0
501 (and (eq_attr "type" "compare,delayed_compare")
502 (eq_attr "cpu" "rs64a,mpccore,ppc403,ppc405,ppc601,ppc603"))
505 ; some extra cycles added by TARGET_SCHED_ADJUST_COST between compare
506 ; and a following branch, to reduce mispredicts
507 (define_function_unit "iu3" 3 0
508 (and (eq_attr "type" "compare,delayed_compare")
509 (eq_attr "cpu" "ppc7450"))
512 (define_function_unit "iu2" 2 0
513 (and (eq_attr "type" "compare,delayed_compare")
514 (eq_attr "cpu" "rios2"))
517 (define_function_unit "iu2" 2 0
518 (and (eq_attr "type" "compare,delayed_compare")
519 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
522 ; fp compare uses fp unit
523 (define_function_unit "fpu" 1 0
524 (and (eq_attr "type" "fpcompare")
525 (eq_attr "cpu" "rios1"))
528 ; rios1 and rios2 have different fpcompare delays
529 (define_function_unit "fpu2" 2 0
530 (and (eq_attr "type" "fpcompare")
531 (eq_attr "cpu" "rios2,ppc630"))
534 ; on ppc601 and ppc603, fpcompare takes also 2 cycles from
536 ; here we do not define delays, just occupy the unit. The dependencies
537 ; will be assigned by the fpcompare definition in the fpu.
538 (define_function_unit "iu" 1 0
539 (and (eq_attr "type" "fpcompare")
540 (eq_attr "cpu" "ppc601,ppc603"))
543 ; fp compare uses fp unit
544 (define_function_unit "fpu" 1 0
545 (and (eq_attr "type" "fpcompare")
546 (eq_attr "cpu" "rs64a,ppc601,ppc603,ppc604,ppc604e,ppc620"))
549 (define_function_unit "fpu" 1 0
550 (and (eq_attr "type" "fpcompare")
551 (eq_attr "cpu" "ppc750,ppc7400,ppc7450"))
554 (define_function_unit "fpu" 1 0
555 (and (eq_attr "type" "fpcompare")
556 (eq_attr "cpu" "mpccore"))
559 (define_function_unit "bpu" 1 0
560 (and (eq_attr "type" "mtjmpr")
561 (eq_attr "cpu" "rios1,rios2,rs64a"))
564 (define_function_unit "bpu" 1 0
565 (and (eq_attr "type" "mtjmpr")
566 (eq_attr "cpu" "mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
569 (define_function_unit "sru" 1 0
570 (and (eq_attr "type" "mtjmpr")
571 (eq_attr "cpu" "ppc750,ppc7400"))
574 (define_function_unit "imuldiv" 1 0
575 (and (eq_attr "type" "mtjmpr")
576 (eq_attr "cpu" "ppc7450"))
579 (define_function_unit "bpu" 1 0
580 (and (eq_attr "type" "cr_logical")
581 (eq_attr "cpu" "rios1,rios2,ppc604"))
584 (define_function_unit "cru" 1 0
585 (and (eq_attr "type" "cr_logical")
586 (eq_attr "cpu" "ppc604e,ppc620,ppc630,rs64a"))
589 ; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
590 (define_function_unit "bpu" 1 0
591 (eq_attr "type" "jmpreg")
594 (define_function_unit "bpu" 1 0
595 (eq_attr "type" "branch")
598 ; Floating Point Unit
599 (define_function_unit "fpu" 1 0
600 (and (eq_attr "type" "fp,dmul")
601 (eq_attr "cpu" "rios1"))
604 (define_function_unit "fpu" 1 0
605 (and (eq_attr "type" "fp")
606 (eq_attr "cpu" "rs64a,mpccore"))
609 (define_function_unit "fpu" 1 0
610 (and (eq_attr "type" "fp")
611 (eq_attr "cpu" "ppc601"))
614 (define_function_unit "fpu" 1 0
615 (and (eq_attr "type" "fp")
616 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750,ppc7400"))
619 (define_function_unit "fpu" 1 0
620 (and (eq_attr "type" "fp,dmul")
621 (eq_attr "cpu" "ppc7450"))
624 (define_function_unit "fpu" 1 0
625 (and (eq_attr "type" "dmul")
626 (eq_attr "cpu" "rs64a"))
629 (define_function_unit "fpu" 1 0
630 (and (eq_attr "type" "dmul")
631 (eq_attr "cpu" "mpccore"))
634 (define_function_unit "fpu" 1 0
635 (and (eq_attr "type" "dmul")
636 (eq_attr "cpu" "ppc601"))
640 (define_function_unit "fpu" 1 0
641 (and (eq_attr "type" "dmul")
642 (eq_attr "cpu" "ppc603,ppc750"))
645 (define_function_unit "fpu" 1 0
646 (and (eq_attr "type" "dmul")
647 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc7400"))
650 (define_function_unit "fpu" 1 0
651 (and (eq_attr "type" "sdiv,ddiv")
652 (eq_attr "cpu" "rios1"))
655 (define_function_unit "fpu" 1 0
656 (and (eq_attr "type" "sdiv")
657 (eq_attr "cpu" "rs64a"))
660 (define_function_unit "fpu" 1 0
661 (and (eq_attr "type" "sdiv")
662 (eq_attr "cpu" "ppc601,ppc750,ppc7400"))
665 (define_function_unit "fpu" 1 0
666 (and (eq_attr "type" "sdiv")
667 (eq_attr "cpu" "ppc7450"))
670 (define_function_unit "fpu" 1 0
671 (and (eq_attr "type" "sdiv")
672 (eq_attr "cpu" "mpccore"))
675 (define_function_unit "fpu" 1 0
676 (and (eq_attr "type" "sdiv")
677 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
680 (define_function_unit "fpu" 1 0
681 (and (eq_attr "type" "ddiv")
682 (eq_attr "cpu" "mpccore"))
685 (define_function_unit "fpu" 1 0
686 (and (eq_attr "type" "ddiv")
687 (eq_attr "cpu" "rs64a,ppc601,ppc750,ppc604,ppc604e,ppc620,ppc7400"))
690 (define_function_unit "fpu" 1 0
691 (and (eq_attr "type" "ddiv")
692 (eq_attr "cpu" "ppc7450"))
695 (define_function_unit "fpu" 1 0
696 (and (eq_attr "type" "ddiv")
697 (eq_attr "cpu" "ppc603"))
700 (define_function_unit "fpu" 1 0
701 (and (eq_attr "type" "ssqrt")
702 (eq_attr "cpu" "ppc620"))
705 (define_function_unit "fpu" 1 0
706 (and (eq_attr "type" "dsqrt")
707 (eq_attr "cpu" "ppc620"))
710 ; RIOS2 has two symmetric FPUs.
711 (define_function_unit "fpu2" 2 0
712 (and (eq_attr "type" "fp,dmul")
713 (eq_attr "cpu" "rios2"))
716 (define_function_unit "fpu2" 2 0
717 (and (eq_attr "type" "fp,dmul")
718 (eq_attr "cpu" "ppc630"))
721 (define_function_unit "fpu2" 2 0
722 (and (eq_attr "type" "sdiv,ddiv")
723 (eq_attr "cpu" "rios2"))
726 (define_function_unit "fpu2" 2 0
727 (and (eq_attr "type" "sdiv")
728 (eq_attr "cpu" "ppc630"))
731 (define_function_unit "fpu2" 2 0
732 (and (eq_attr "type" "ddiv")
733 (eq_attr "cpu" "ppc630"))
736 (define_function_unit "fpu2" 2 0
737 (and (eq_attr "type" "ssqrt,dsqrt")
738 (eq_attr "cpu" "rios2"))
741 (define_function_unit "fpu2" 2 0
742 (and (eq_attr "type" "ssqrt")
743 (eq_attr "cpu" "ppc630"))
746 (define_function_unit "fpu2" 2 0
747 (and (eq_attr "type" "dsqrt")
748 (eq_attr "cpu" "ppc630"))
752 (define_function_unit "lsu2" 2 0
753 (and (eq_attr "type" "load")
754 (eq_attr "cpu" "power4"))
757 (define_function_unit "lsu2" 2 0
758 (and (eq_attr "type" "fpload")
759 (eq_attr "cpu" "power4"))
762 (define_function_unit "lsu2" 2 0
763 (and (eq_attr "type" "store,fpstore")
764 (eq_attr "cpu" "power4"))
767 (define_function_unit "iu2" 2 0
768 (and (eq_attr "type" "integer")
769 (eq_attr "cpu" "power4"))
772 (define_function_unit "iu2" 2 0
773 (and (eq_attr "type" "imul,lmul")
774 (eq_attr "cpu" "power4"))
777 (define_function_unit "iu2" 2 0
778 (and (eq_attr "type" "imul2")
779 (eq_attr "cpu" "power4"))
782 (define_function_unit "iu2" 2 0
783 (and (eq_attr "type" "imul3")
784 (eq_attr "cpu" "power4"))
787 (define_function_unit "iu2" 2 0
788 (and (eq_attr "type" "idiv")
789 (eq_attr "cpu" "power4"))
792 (define_function_unit "iu2" 2 0
793 (and (eq_attr "type" "ldiv")
794 (eq_attr "cpu" "power4"))
797 (define_function_unit "imuldiv" 1 0
798 (and (eq_attr "type" "idiv")
799 (eq_attr "cpu" "power4"))
802 (define_function_unit "imuldiv" 1 0
803 (and (eq_attr "type" "ldiv")
804 (eq_attr "cpu" "power4"))
807 (define_function_unit "iu2" 2 0
808 (and (eq_attr "type" "compare")
809 (eq_attr "cpu" "power4"))
812 (define_function_unit "iu2" 2 0
813 (and (eq_attr "type" "delayed_compare")
814 (eq_attr "cpu" "power4"))
817 (define_function_unit "bpu" 1 0
818 (and (eq_attr "type" "mtjmpr")
819 (eq_attr "cpu" "power4"))
822 (define_function_unit "bpu" 1 0
823 (and (eq_attr "type" "jmpreg,branch")
824 (eq_attr "cpu" "power4"))
827 (define_function_unit "cru" 1 0
828 (and (eq_attr "type" "cr_logical")
829 (eq_attr "cpu" "power4"))
832 (define_function_unit "fpu2" 2 0
833 (and (eq_attr "type" "fp,dmul")
834 (eq_attr "cpu" "power4"))
837 ; adjust_cost increases the cost of dependent branches,
838 ; so shave a few cycles off for fpcompare.
839 (define_function_unit "fpu2" 2 0
840 (and (eq_attr "type" "fpcompare")
841 (eq_attr "cpu" "power4"))
844 (define_function_unit "fpu2" 2 0
845 (and (eq_attr "type" "sdiv,ddiv")
846 (eq_attr "cpu" "power4"))
849 (define_function_unit "fpu2" 2 0
850 (and (eq_attr "type" "ssqrt,dsqrt")
851 (eq_attr "cpu" "power4"))
855 ;; Start with fixed-point load and store insns. Here we put only the more
856 ;; complex forms. Basic data transfer is done later.
858 (define_expand "zero_extendqidi2"
859 [(set (match_operand:DI 0 "gpc_reg_operand" "")
860 (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))]
865 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
866 (zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
871 [(set_attr "type" "load,*")])
874 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
875 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
877 (clobber (match_scratch:DI 2 "=r,r"))]
882 [(set_attr "type" "compare")
883 (set_attr "length" "4,8")])
886 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
887 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
889 (clobber (match_scratch:DI 2 ""))]
890 "TARGET_POWERPC64 && reload_completed"
892 (zero_extend:DI (match_dup 1)))
894 (compare:CC (match_dup 2)
899 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
900 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
902 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
903 (zero_extend:DI (match_dup 1)))]
908 [(set_attr "type" "compare")
909 (set_attr "length" "4,8")])
912 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
913 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
915 (set (match_operand:DI 0 "gpc_reg_operand" "")
916 (zero_extend:DI (match_dup 1)))]
917 "TARGET_POWERPC64 && reload_completed"
919 (zero_extend:DI (match_dup 1)))
921 (compare:CC (match_dup 0)
925 (define_insn "extendqidi2"
926 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
927 (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]
932 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
933 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
935 (clobber (match_scratch:DI 2 "=r,r"))]
940 [(set_attr "type" "compare")
941 (set_attr "length" "4,8")])
944 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
945 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
947 (clobber (match_scratch:DI 2 ""))]
948 "TARGET_POWERPC64 && reload_completed"
950 (sign_extend:DI (match_dup 1)))
952 (compare:CC (match_dup 2)
957 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
958 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
960 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
961 (sign_extend:DI (match_dup 1)))]
966 [(set_attr "type" "compare")
967 (set_attr "length" "4,8")])
970 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
971 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
973 (set (match_operand:DI 0 "gpc_reg_operand" "")
974 (sign_extend:DI (match_dup 1)))]
975 "TARGET_POWERPC64 && reload_completed"
977 (sign_extend:DI (match_dup 1)))
979 (compare:CC (match_dup 0)
983 (define_expand "zero_extendhidi2"
984 [(set (match_operand:DI 0 "gpc_reg_operand" "")
985 (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
990 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
991 (zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
996 [(set_attr "type" "load,*")])
999 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1000 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1002 (clobber (match_scratch:DI 2 "=r,r"))]
1007 [(set_attr "type" "compare")
1008 (set_attr "length" "4,8")])
1011 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1012 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1014 (clobber (match_scratch:DI 2 ""))]
1015 "TARGET_POWERPC64 && reload_completed"
1017 (zero_extend:DI (match_dup 1)))
1019 (compare:CC (match_dup 2)
1024 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1025 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1027 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1028 (zero_extend:DI (match_dup 1)))]
1033 [(set_attr "type" "compare")
1034 (set_attr "length" "4,8")])
1037 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1038 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1040 (set (match_operand:DI 0 "gpc_reg_operand" "")
1041 (zero_extend:DI (match_dup 1)))]
1042 "TARGET_POWERPC64 && reload_completed"
1044 (zero_extend:DI (match_dup 1)))
1046 (compare:CC (match_dup 0)
1050 (define_expand "extendhidi2"
1051 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1052 (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
1057 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1058 (sign_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1063 [(set_attr "type" "load,*")])
1066 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1067 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1069 (clobber (match_scratch:DI 2 "=r,r"))]
1074 [(set_attr "type" "compare")
1075 (set_attr "length" "4,8")])
1078 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1079 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1081 (clobber (match_scratch:DI 2 ""))]
1082 "TARGET_POWERPC64 && reload_completed"
1084 (sign_extend:DI (match_dup 1)))
1086 (compare:CC (match_dup 2)
1091 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1092 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1094 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1095 (sign_extend:DI (match_dup 1)))]
1100 [(set_attr "type" "compare")
1101 (set_attr "length" "4,8")])
1104 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1105 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1107 (set (match_operand:DI 0 "gpc_reg_operand" "")
1108 (sign_extend:DI (match_dup 1)))]
1109 "TARGET_POWERPC64 && reload_completed"
1111 (sign_extend:DI (match_dup 1)))
1113 (compare:CC (match_dup 0)
1117 (define_expand "zero_extendsidi2"
1118 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1119 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1124 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1125 (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))]
1130 [(set_attr "type" "load,*")])
1133 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1134 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1136 (clobber (match_scratch:DI 2 "=r,r"))]
1141 [(set_attr "type" "compare")
1142 (set_attr "length" "4,8")])
1145 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1146 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1148 (clobber (match_scratch:DI 2 ""))]
1149 "TARGET_POWERPC64 && reload_completed"
1151 (zero_extend:DI (match_dup 1)))
1153 (compare:CC (match_dup 2)
1158 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1159 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1161 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1162 (zero_extend:DI (match_dup 1)))]
1167 [(set_attr "type" "compare")
1168 (set_attr "length" "4,8")])
1171 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1172 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1174 (set (match_operand:DI 0 "gpc_reg_operand" "")
1175 (zero_extend:DI (match_dup 1)))]
1176 "TARGET_POWERPC64 && reload_completed"
1178 (zero_extend:DI (match_dup 1)))
1180 (compare:CC (match_dup 0)
1184 (define_expand "extendsidi2"
1185 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1186 (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1191 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1192 (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
1197 [(set_attr "type" "load,*")])
1200 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1201 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1203 (clobber (match_scratch:DI 2 "=r,r"))]
1208 [(set_attr "type" "compare")
1209 (set_attr "length" "4,8")])
1212 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1213 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1215 (clobber (match_scratch:DI 2 ""))]
1216 "TARGET_POWERPC64 && reload_completed"
1218 (sign_extend:DI (match_dup 1)))
1220 (compare:CC (match_dup 2)
1225 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1226 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1228 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1229 (sign_extend:DI (match_dup 1)))]
1234 [(set_attr "type" "compare")
1235 (set_attr "length" "4,8")])
1238 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1239 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1241 (set (match_operand:DI 0 "gpc_reg_operand" "")
1242 (sign_extend:DI (match_dup 1)))]
1243 "TARGET_POWERPC64 && reload_completed"
1245 (sign_extend:DI (match_dup 1)))
1247 (compare:CC (match_dup 0)
1251 (define_expand "zero_extendqisi2"
1252 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1253 (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "")))]
1258 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1259 (zero_extend:SI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1263 {rlinm|rlwinm} %0,%1,0,0xff"
1264 [(set_attr "type" "load,*")])
1267 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1268 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1270 (clobber (match_scratch:SI 2 "=r,r"))]
1273 {andil.|andi.} %2,%1,0xff
1275 [(set_attr "type" "compare")
1276 (set_attr "length" "4,8")])
1279 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1280 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1282 (clobber (match_scratch:SI 2 ""))]
1285 (zero_extend:SI (match_dup 1)))
1287 (compare:CC (match_dup 2)
1292 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1293 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1295 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1296 (zero_extend:SI (match_dup 1)))]
1299 {andil.|andi.} %0,%1,0xff
1301 [(set_attr "type" "compare")
1302 (set_attr "length" "4,8")])
1305 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1306 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1308 (set (match_operand:SI 0 "gpc_reg_operand" "")
1309 (zero_extend:SI (match_dup 1)))]
1312 (zero_extend:SI (match_dup 1)))
1314 (compare:CC (match_dup 0)
1318 (define_expand "extendqisi2"
1319 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
1320 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1325 emit_insn (gen_extendqisi2_ppc (operands[0], operands[1]));
1326 else if (TARGET_POWER)
1327 emit_insn (gen_extendqisi2_power (operands[0], operands[1]));
1329 emit_insn (gen_extendqisi2_no_power (operands[0], operands[1]));
1333 (define_insn "extendqisi2_ppc"
1334 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1335 (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1340 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1341 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1343 (clobber (match_scratch:SI 2 "=r,r"))]
1348 [(set_attr "type" "compare")
1349 (set_attr "length" "4,8")])
1352 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1353 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1355 (clobber (match_scratch:SI 2 ""))]
1356 "TARGET_POWERPC && reload_completed"
1358 (sign_extend:SI (match_dup 1)))
1360 (compare:CC (match_dup 2)
1365 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1366 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1368 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1369 (sign_extend:SI (match_dup 1)))]
1374 [(set_attr "type" "compare")
1375 (set_attr "length" "4,8")])
1378 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1379 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1381 (set (match_operand:SI 0 "gpc_reg_operand" "")
1382 (sign_extend:SI (match_dup 1)))]
1383 "TARGET_POWERPC && reload_completed"
1385 (sign_extend:SI (match_dup 1)))
1387 (compare:CC (match_dup 0)
1391 (define_expand "extendqisi2_power"
1392 [(parallel [(set (match_dup 2)
1393 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1395 (clobber (scratch:SI))])
1396 (parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
1397 (ashiftrt:SI (match_dup 2)
1399 (clobber (scratch:SI))])]
1402 { operands[1] = gen_lowpart (SImode, operands[1]);
1403 operands[2] = gen_reg_rtx (SImode); }")
1405 (define_expand "extendqisi2_no_power"
1407 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1409 (set (match_operand:SI 0 "gpc_reg_operand" "")
1410 (ashiftrt:SI (match_dup 2)
1412 "! TARGET_POWER && ! TARGET_POWERPC"
1414 { operands[1] = gen_lowpart (SImode, operands[1]);
1415 operands[2] = gen_reg_rtx (SImode); }")
1417 (define_expand "zero_extendqihi2"
1418 [(set (match_operand:HI 0 "gpc_reg_operand" "")
1419 (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "")))]
1424 [(set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1425 (zero_extend:HI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1429 {rlinm|rlwinm} %0,%1,0,0xff"
1430 [(set_attr "type" "load,*")])
1433 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1434 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1436 (clobber (match_scratch:HI 2 "=r,r"))]
1439 {andil.|andi.} %2,%1,0xff
1441 [(set_attr "type" "compare")
1442 (set_attr "length" "4,8")])
1445 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1446 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1448 (clobber (match_scratch:HI 2 ""))]
1451 (zero_extend:HI (match_dup 1)))
1453 (compare:CC (match_dup 2)
1458 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1459 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1461 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1462 (zero_extend:HI (match_dup 1)))]
1465 {andil.|andi.} %0,%1,0xff
1467 [(set_attr "type" "compare")
1468 (set_attr "length" "4,8")])
1471 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1472 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1474 (set (match_operand:HI 0 "gpc_reg_operand" "")
1475 (zero_extend:HI (match_dup 1)))]
1478 (zero_extend:HI (match_dup 1)))
1480 (compare:CC (match_dup 0)
1484 (define_expand "extendqihi2"
1485 [(use (match_operand:HI 0 "gpc_reg_operand" ""))
1486 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1491 emit_insn (gen_extendqihi2_ppc (operands[0], operands[1]));
1492 else if (TARGET_POWER)
1493 emit_insn (gen_extendqihi2_power (operands[0], operands[1]));
1495 emit_insn (gen_extendqihi2_no_power (operands[0], operands[1]));
1499 (define_insn "extendqihi2_ppc"
1500 [(set (match_operand:HI 0 "gpc_reg_operand" "=r")
1501 (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1506 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1507 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1509 (clobber (match_scratch:HI 2 "=r,r"))]
1514 [(set_attr "type" "compare")
1515 (set_attr "length" "4,8")])
1518 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1519 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1521 (clobber (match_scratch:HI 2 ""))]
1522 "TARGET_POWERPC && reload_completed"
1524 (sign_extend:HI (match_dup 1)))
1526 (compare:CC (match_dup 2)
1531 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1532 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1534 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1535 (sign_extend:HI (match_dup 1)))]
1540 [(set_attr "type" "compare")
1541 (set_attr "length" "4,8")])
1544 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1545 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1547 (set (match_operand:HI 0 "gpc_reg_operand" "")
1548 (sign_extend:HI (match_dup 1)))]
1549 "TARGET_POWERPC && reload_completed"
1551 (sign_extend:HI (match_dup 1)))
1553 (compare:CC (match_dup 0)
1557 (define_expand "extendqihi2_power"
1558 [(parallel [(set (match_dup 2)
1559 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1561 (clobber (scratch:SI))])
1562 (parallel [(set (match_operand:HI 0 "gpc_reg_operand" "")
1563 (ashiftrt:SI (match_dup 2)
1565 (clobber (scratch:SI))])]
1568 { operands[0] = gen_lowpart (SImode, operands[0]);
1569 operands[1] = gen_lowpart (SImode, operands[1]);
1570 operands[2] = gen_reg_rtx (SImode); }")
1572 (define_expand "extendqihi2_no_power"
1574 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1576 (set (match_operand:HI 0 "gpc_reg_operand" "")
1577 (ashiftrt:SI (match_dup 2)
1579 "! TARGET_POWER && ! TARGET_POWERPC"
1581 { operands[0] = gen_lowpart (SImode, operands[0]);
1582 operands[1] = gen_lowpart (SImode, operands[1]);
1583 operands[2] = gen_reg_rtx (SImode); }")
1585 (define_expand "zero_extendhisi2"
1586 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1587 (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1592 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1593 (zero_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1597 {rlinm|rlwinm} %0,%1,0,0xffff"
1598 [(set_attr "type" "load,*")])
1601 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1602 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1604 (clobber (match_scratch:SI 2 "=r,r"))]
1607 {andil.|andi.} %2,%1,0xffff
1609 [(set_attr "type" "compare")
1610 (set_attr "length" "4,8")])
1613 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1614 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1616 (clobber (match_scratch:SI 2 ""))]
1619 (zero_extend:SI (match_dup 1)))
1621 (compare:CC (match_dup 2)
1626 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1627 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1629 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1630 (zero_extend:SI (match_dup 1)))]
1633 {andil.|andi.} %0,%1,0xffff
1635 [(set_attr "type" "compare")
1636 (set_attr "length" "4,8")])
1639 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1640 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1642 (set (match_operand:SI 0 "gpc_reg_operand" "")
1643 (zero_extend:SI (match_dup 1)))]
1646 (zero_extend:SI (match_dup 1)))
1648 (compare:CC (match_dup 0)
1652 (define_expand "extendhisi2"
1653 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1654 (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1659 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1660 (sign_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1665 [(set_attr "type" "load,*")])
1668 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1669 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1671 (clobber (match_scratch:SI 2 "=r,r"))]
1674 {exts.|extsh.} %2,%1
1676 [(set_attr "type" "compare")
1677 (set_attr "length" "4,8")])
1680 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1681 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1683 (clobber (match_scratch:SI 2 ""))]
1686 (sign_extend:SI (match_dup 1)))
1688 (compare:CC (match_dup 2)
1693 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1694 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1696 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1697 (sign_extend:SI (match_dup 1)))]
1700 {exts.|extsh.} %0,%1
1702 [(set_attr "type" "compare")
1703 (set_attr "length" "4,8")])
1706 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1707 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1709 (set (match_operand:SI 0 "gpc_reg_operand" "")
1710 (sign_extend:SI (match_dup 1)))]
1713 (sign_extend:SI (match_dup 1)))
1715 (compare:CC (match_dup 0)
1719 ;; Fixed-point arithmetic insns.
1721 ;; Discourage ai/addic because of carry but provide it in an alternative
1722 ;; allowing register zero as source.
1723 (define_expand "addsi3"
1724 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1725 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1726 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
1730 if (GET_CODE (operands[2]) == CONST_INT
1731 && ! add_operand (operands[2], SImode))
1733 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
1734 ? operands[0] : gen_reg_rtx (SImode));
1736 HOST_WIDE_INT val = INTVAL (operands[2]);
1737 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1738 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1740 /* The ordering here is important for the prolog expander.
1741 When space is allocated from the stack, adding 'low' first may
1742 produce a temporary deallocation (which would be bad). */
1743 emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest)));
1744 emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low)));
1749 (define_insn "*addsi3_internal1"
1750 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r")
1751 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b")
1752 (match_operand:SI 2 "add_operand" "r,I,I,L")))]
1756 {cal %0,%2(%1)|addi %0,%1,%2}
1758 {cau|addis} %0,%1,%v2"
1759 [(set_attr "length" "4,4,4,4")])
1761 (define_insn "addsi3_high"
1762 [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
1763 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1764 (high:SI (match_operand 2 "" ""))))]
1765 "TARGET_MACHO && !TARGET_64BIT"
1766 "{cau|addis} %0,%1,ha16(%2)"
1767 [(set_attr "length" "4")])
1769 (define_insn "*addsi3_internal2"
1770 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
1771 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1772 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1774 (clobber (match_scratch:SI 3 "=r,r,r,r"))]
1775 "! TARGET_POWERPC64"
1777 {cax.|add.} %3,%1,%2
1778 {ai.|addic.} %3,%1,%2
1781 [(set_attr "type" "compare")
1782 (set_attr "length" "4,4,8,8")])
1785 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1786 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1787 (match_operand:SI 2 "reg_or_short_operand" ""))
1789 (clobber (match_scratch:SI 3 ""))]
1790 "! TARGET_POWERPC64 && reload_completed"
1792 (plus:SI (match_dup 1)
1795 (compare:CC (match_dup 3)
1799 (define_insn "*addsi3_internal3"
1800 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
1801 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1802 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1804 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
1805 (plus:SI (match_dup 1)
1807 "! TARGET_POWERPC64"
1809 {cax.|add.} %0,%1,%2
1810 {ai.|addic.} %0,%1,%2
1813 [(set_attr "type" "compare")
1814 (set_attr "length" "4,4,8,8")])
1817 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
1818 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1819 (match_operand:SI 2 "reg_or_short_operand" ""))
1821 (set (match_operand:SI 0 "gpc_reg_operand" "")
1822 (plus:SI (match_dup 1) (match_dup 2)))]
1823 "! TARGET_POWERPC64 && reload_completed"
1825 (plus:SI (match_dup 1)
1828 (compare:CC (match_dup 0)
1832 ;; Split an add that we can't do in one insn into two insns, each of which
1833 ;; does one 16-bit part. This is used by combine. Note that the low-order
1834 ;; add should be last in case the result gets used in an address.
1837 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1838 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1839 (match_operand:SI 2 "non_add_cint_operand" "")))]
1841 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
1842 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
1845 HOST_WIDE_INT val = INTVAL (operands[2]);
1846 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1847 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1849 operands[3] = GEN_INT (rest);
1850 operands[4] = GEN_INT (low);
1853 (define_insn "one_cmplsi2"
1854 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1855 (not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
1860 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1861 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1863 (clobber (match_scratch:SI 2 "=r,r"))]
1864 "! TARGET_POWERPC64"
1868 [(set_attr "type" "compare")
1869 (set_attr "length" "4,8")])
1872 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1873 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1875 (clobber (match_scratch:SI 2 ""))]
1876 "! TARGET_POWERPC64 && reload_completed"
1878 (not:SI (match_dup 1)))
1880 (compare:CC (match_dup 2)
1885 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1886 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1888 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1889 (not:SI (match_dup 1)))]
1890 "! TARGET_POWERPC64"
1894 [(set_attr "type" "compare")
1895 (set_attr "length" "4,8")])
1898 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1899 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1901 (set (match_operand:SI 0 "gpc_reg_operand" "")
1902 (not:SI (match_dup 1)))]
1903 "! TARGET_POWERPC64 && reload_completed"
1905 (not:SI (match_dup 1)))
1907 (compare:CC (match_dup 0)
1912 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1913 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "rI")
1914 (match_operand:SI 2 "gpc_reg_operand" "r")))]
1916 "{sf%I1|subf%I1c} %0,%2,%1")
1919 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1920 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I")
1921 (match_operand:SI 2 "gpc_reg_operand" "r,r")))]
1928 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1929 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1930 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1932 (clobber (match_scratch:SI 3 "=r,r"))]
1935 {sf.|subfc.} %3,%2,%1
1937 [(set_attr "type" "compare")
1938 (set_attr "length" "4,8")])
1941 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1942 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1943 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1945 (clobber (match_scratch:SI 3 "=r,r"))]
1946 "TARGET_POWERPC && ! TARGET_POWERPC64"
1950 [(set_attr "type" "compare")
1951 (set_attr "length" "4,8")])
1954 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1955 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1956 (match_operand:SI 2 "gpc_reg_operand" ""))
1958 (clobber (match_scratch:SI 3 ""))]
1959 "! TARGET_POWERPC64 && reload_completed"
1961 (minus:SI (match_dup 1)
1964 (compare:CC (match_dup 3)
1969 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1970 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1971 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1973 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1974 (minus:SI (match_dup 1) (match_dup 2)))]
1977 {sf.|subfc.} %0,%2,%1
1979 [(set_attr "type" "compare")
1980 (set_attr "length" "4,8")])
1983 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1984 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1985 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1987 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1988 (minus:SI (match_dup 1)
1990 "TARGET_POWERPC && ! TARGET_POWERPC64"
1994 [(set_attr "type" "compare")
1995 (set_attr "length" "4,8")])
1998 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
1999 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
2000 (match_operand:SI 2 "gpc_reg_operand" ""))
2002 (set (match_operand:SI 0 "gpc_reg_operand" "")
2003 (minus:SI (match_dup 1)
2005 "! TARGET_POWERPC64 && reload_completed"
2007 (minus:SI (match_dup 1)
2010 (compare:CC (match_dup 0)
2014 (define_expand "subsi3"
2015 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2016 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "")
2017 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
2021 if (GET_CODE (operands[2]) == CONST_INT)
2023 emit_insn (gen_addsi3 (operands[0], operands[1],
2024 negate_rtx (SImode, operands[2])));
2029 ;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
2030 ;; instruction and some auxiliary computations. Then we just have a single
2031 ;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
2034 (define_expand "sminsi3"
2036 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
2037 (match_operand:SI 2 "reg_or_short_operand" ""))
2039 (minus:SI (match_dup 2) (match_dup 1))))
2040 (set (match_operand:SI 0 "gpc_reg_operand" "")
2041 (minus:SI (match_dup 2) (match_dup 3)))]
2044 { operands[3] = gen_reg_rtx (SImode); }")
2047 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2048 (smin:SI (match_operand:SI 1 "gpc_reg_operand" "")
2049 (match_operand:SI 2 "reg_or_short_operand" "")))
2050 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
2053 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
2055 (minus:SI (match_dup 2) (match_dup 1))))
2056 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 3)))]
2059 (define_expand "smaxsi3"
2061 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
2062 (match_operand:SI 2 "reg_or_short_operand" ""))
2064 (minus:SI (match_dup 2) (match_dup 1))))
2065 (set (match_operand:SI 0 "gpc_reg_operand" "")
2066 (plus:SI (match_dup 3) (match_dup 1)))]
2069 { operands[3] = gen_reg_rtx (SImode); }")
2072 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2073 (smax:SI (match_operand:SI 1 "gpc_reg_operand" "")
2074 (match_operand:SI 2 "reg_or_short_operand" "")))
2075 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
2078 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
2080 (minus:SI (match_dup 2) (match_dup 1))))
2081 (set (match_dup 0) (plus:SI (match_dup 3) (match_dup 1)))]
2084 (define_expand "uminsi3"
2085 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2087 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
2089 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
2091 (minus:SI (match_dup 4) (match_dup 3))))
2092 (set (match_operand:SI 0 "gpc_reg_operand" "")
2093 (minus:SI (match_dup 2) (match_dup 3)))]
2097 operands[3] = gen_reg_rtx (SImode);
2098 operands[4] = gen_reg_rtx (SImode);
2099 operands[5] = GEN_INT (-2147483647 - 1);
2102 (define_expand "umaxsi3"
2103 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2105 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
2107 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
2109 (minus:SI (match_dup 4) (match_dup 3))))
2110 (set (match_operand:SI 0 "gpc_reg_operand" "")
2111 (plus:SI (match_dup 3) (match_dup 1)))]
2115 operands[3] = gen_reg_rtx (SImode);
2116 operands[4] = gen_reg_rtx (SImode);
2117 operands[5] = GEN_INT (-2147483647 - 1);
2121 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2122 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
2123 (match_operand:SI 2 "reg_or_short_operand" "rI"))
2125 (minus:SI (match_dup 2) (match_dup 1))))]
2130 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2132 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2133 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2135 (minus:SI (match_dup 2) (match_dup 1)))
2137 (clobber (match_scratch:SI 3 "=r,r"))]
2142 [(set_attr "type" "delayed_compare")
2143 (set_attr "length" "4,8")])
2146 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2148 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2149 (match_operand:SI 2 "reg_or_short_operand" ""))
2151 (minus:SI (match_dup 2) (match_dup 1)))
2153 (clobber (match_scratch:SI 3 ""))]
2154 "TARGET_POWER && reload_completed"
2156 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2158 (minus:SI (match_dup 2) (match_dup 1))))
2160 (compare:CC (match_dup 3)
2165 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2167 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2168 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2170 (minus:SI (match_dup 2) (match_dup 1)))
2172 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2173 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2175 (minus:SI (match_dup 2) (match_dup 1))))]
2180 [(set_attr "type" "delayed_compare")
2181 (set_attr "length" "4,8")])
2184 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2186 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2187 (match_operand:SI 2 "reg_or_short_operand" ""))
2189 (minus:SI (match_dup 2) (match_dup 1)))
2191 (set (match_operand:SI 0 "gpc_reg_operand" "")
2192 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2194 (minus:SI (match_dup 2) (match_dup 1))))]
2195 "TARGET_POWER && reload_completed"
2197 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2199 (minus:SI (match_dup 2) (match_dup 1))))
2201 (compare:CC (match_dup 0)
2205 ;; We don't need abs with condition code because such comparisons should
2207 (define_expand "abssi2"
2208 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2209 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
2215 emit_insn (gen_abssi2_nopower (operands[0], operands[1]));
2220 (define_insn "*abssi2_power"
2221 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2222 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2226 (define_insn_and_split "abssi2_nopower"
2227 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2228 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
2229 (clobber (match_scratch:SI 2 "=&r,&r"))]
2232 "&& reload_completed"
2233 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2234 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2235 (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
2238 (define_insn "*nabs_power"
2239 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2240 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
2244 (define_insn_and_split "*nabs_nopower"
2245 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2246 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
2247 (clobber (match_scratch:SI 2 "=&r,&r"))]
2250 "&& reload_completed"
2251 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2252 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2253 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))]
2256 (define_insn "negsi2"
2257 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2258 (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2263 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2264 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2266 (clobber (match_scratch:SI 2 "=r,r"))]
2267 "! TARGET_POWERPC64"
2271 [(set_attr "type" "compare")
2272 (set_attr "length" "4,8")])
2275 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2276 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2278 (clobber (match_scratch:SI 2 ""))]
2279 "! TARGET_POWERPC64 && reload_completed"
2281 (neg:SI (match_dup 1)))
2283 (compare:CC (match_dup 2)
2288 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
2289 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2291 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2292 (neg:SI (match_dup 1)))]
2293 "! TARGET_POWERPC64"
2297 [(set_attr "type" "compare")
2298 (set_attr "length" "4,8")])
2301 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
2302 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2304 (set (match_operand:SI 0 "gpc_reg_operand" "")
2305 (neg:SI (match_dup 1)))]
2306 "! TARGET_POWERPC64 && reload_completed"
2308 (neg:SI (match_dup 1)))
2310 (compare:CC (match_dup 0)
2314 (define_insn "ffssi2"
2315 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
2316 (ffs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2318 "neg %0,%1\;and %0,%0,%1\;{cntlz|cntlzw} %0,%0\;{sfi|subfic} %0,%0,32"
2319 [(set_attr "length" "16")])
2321 (define_expand "mulsi3"
2322 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2323 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2324 (use (match_operand:SI 2 "reg_or_short_operand" ""))]
2329 emit_insn (gen_mulsi3_mq (operands[0], operands[1], operands[2]));
2331 emit_insn (gen_mulsi3_no_mq (operands[0], operands[1], operands[2]));
2335 (define_insn "mulsi3_mq"
2336 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2337 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2338 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
2339 (clobber (match_scratch:SI 3 "=q,q"))]
2342 {muls|mullw} %0,%1,%2
2343 {muli|mulli} %0,%1,%2"
2345 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2346 (const_string "imul3")
2347 (match_operand:SI 2 "short_cint_operand" "")
2348 (const_string "imul2")]
2349 (const_string "imul")))])
2351 (define_insn "mulsi3_no_mq"
2352 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2353 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2354 (match_operand:SI 2 "reg_or_short_operand" "r,I")))]
2357 {muls|mullw} %0,%1,%2
2358 {muli|mulli} %0,%1,%2"
2360 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2361 (const_string "imul3")
2362 (match_operand:SI 2 "short_cint_operand" "")
2363 (const_string "imul2")]
2364 (const_string "imul")))])
2367 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2368 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2369 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2371 (clobber (match_scratch:SI 3 "=r,r"))
2372 (clobber (match_scratch:SI 4 "=q,q"))]
2375 {muls.|mullw.} %3,%1,%2
2377 [(set_attr "type" "delayed_compare")
2378 (set_attr "length" "4,8")])
2381 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2382 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2383 (match_operand:SI 2 "gpc_reg_operand" ""))
2385 (clobber (match_scratch:SI 3 ""))
2386 (clobber (match_scratch:SI 4 ""))]
2387 "TARGET_POWER && reload_completed"
2388 [(parallel [(set (match_dup 3)
2389 (mult:SI (match_dup 1) (match_dup 2)))
2390 (clobber (match_dup 4))])
2392 (compare:CC (match_dup 3)
2397 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2398 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2399 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2401 (clobber (match_scratch:SI 3 "=r,r"))]
2404 {muls.|mullw.} %3,%1,%2
2406 [(set_attr "type" "delayed_compare")
2407 (set_attr "length" "4,8")])
2410 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2411 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2412 (match_operand:SI 2 "gpc_reg_operand" ""))
2414 (clobber (match_scratch:SI 3 ""))]
2415 "! TARGET_POWER && reload_completed"
2417 (mult:SI (match_dup 1) (match_dup 2)))
2419 (compare:CC (match_dup 3)
2424 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2425 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2426 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2428 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2429 (mult:SI (match_dup 1) (match_dup 2)))
2430 (clobber (match_scratch:SI 4 "=q,q"))]
2433 {muls.|mullw.} %0,%1,%2
2435 [(set_attr "type" "delayed_compare")
2436 (set_attr "length" "4,8")])
2439 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2440 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2441 (match_operand:SI 2 "gpc_reg_operand" ""))
2443 (set (match_operand:SI 0 "gpc_reg_operand" "")
2444 (mult:SI (match_dup 1) (match_dup 2)))
2445 (clobber (match_scratch:SI 4 ""))]
2446 "TARGET_POWER && reload_completed"
2447 [(parallel [(set (match_dup 0)
2448 (mult:SI (match_dup 1) (match_dup 2)))
2449 (clobber (match_dup 4))])
2451 (compare:CC (match_dup 0)
2456 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2457 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2458 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2460 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2461 (mult:SI (match_dup 1) (match_dup 2)))]
2464 {muls.|mullw.} %0,%1,%2
2466 [(set_attr "type" "delayed_compare")
2467 (set_attr "length" "4,8")])
2470 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2471 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2472 (match_operand:SI 2 "gpc_reg_operand" ""))
2474 (set (match_operand:SI 0 "gpc_reg_operand" "")
2475 (mult:SI (match_dup 1) (match_dup 2)))]
2476 "! TARGET_POWER && reload_completed"
2478 (mult:SI (match_dup 1) (match_dup 2)))
2480 (compare:CC (match_dup 0)
2484 ;; Operand 1 is divided by operand 2; quotient goes to operand
2485 ;; 0 and remainder to operand 3.
2486 ;; ??? At some point, see what, if anything, we can do about if (x % y == 0).
2488 (define_expand "divmodsi4"
2489 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2490 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2491 (match_operand:SI 2 "gpc_reg_operand" "")))
2492 (set (match_operand:SI 3 "gpc_reg_operand" "")
2493 (mod:SI (match_dup 1) (match_dup 2)))])]
2494 "TARGET_POWER || (! TARGET_POWER && ! TARGET_POWERPC)"
2497 if (! TARGET_POWER && ! TARGET_POWERPC)
2499 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2500 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2501 emit_insn (gen_divss_call ());
2502 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2503 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2509 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2510 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2511 (match_operand:SI 2 "gpc_reg_operand" "r")))
2512 (set (match_operand:SI 3 "gpc_reg_operand" "=q")
2513 (mod:SI (match_dup 1) (match_dup 2)))]
2516 [(set_attr "type" "idiv")])
2518 (define_expand "udivsi3"
2519 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2520 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2521 (match_operand:SI 2 "gpc_reg_operand" "")))]
2522 "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)"
2525 if (! TARGET_POWER && ! TARGET_POWERPC)
2527 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2528 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2529 emit_insn (gen_quous_call ());
2530 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2533 else if (TARGET_POWER)
2535 emit_insn (gen_udivsi3_mq (operands[0], operands[1], operands[2]));
2540 (define_insn "udivsi3_mq"
2541 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2542 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2543 (match_operand:SI 2 "gpc_reg_operand" "r")))
2544 (clobber (match_scratch:SI 3 "=q"))]
2545 "TARGET_POWERPC && TARGET_POWER"
2547 [(set_attr "type" "idiv")])
2549 (define_insn "*udivsi3_no_mq"
2550 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2551 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2552 (match_operand:SI 2 "gpc_reg_operand" "r")))]
2553 "TARGET_POWERPC && ! TARGET_POWER"
2555 [(set_attr "type" "idiv")])
2557 ;; For powers of two we can do srai/aze for divide and then adjust for
2558 ;; modulus. If it isn't a power of two, FAIL on POWER so divmodsi4 will be
2559 ;; used; for PowerPC, force operands into register and do a normal divide;
2560 ;; for AIX common-mode, use quoss call on register operands.
2561 (define_expand "divsi3"
2562 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2563 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2564 (match_operand:SI 2 "reg_or_cint_operand" "")))]
2568 if (GET_CODE (operands[2]) == CONST_INT
2569 && INTVAL (operands[2]) > 0
2570 && exact_log2 (INTVAL (operands[2])) >= 0)
2572 else if (TARGET_POWERPC)
2574 operands[2] = force_reg (SImode, operands[2]);
2577 emit_insn (gen_divsi3_mq (operands[0], operands[1], operands[2]));
2581 else if (TARGET_POWER)
2585 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2586 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2587 emit_insn (gen_quoss_call ());
2588 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2593 (define_insn "divsi3_mq"
2594 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2595 (div: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 "*divsi3_no_mq"
2603 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2604 (div: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 (define_expand "modsi3"
2611 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2612 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2613 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
2621 if (GET_CODE (operands[2]) != CONST_INT
2622 || INTVAL (operands[2]) <= 0
2623 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
2626 temp1 = gen_reg_rtx (SImode);
2627 temp2 = gen_reg_rtx (SImode);
2629 emit_insn (gen_divsi3 (temp1, operands[1], operands[2]));
2630 emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
2631 emit_insn (gen_subsi3 (operands[0], operands[1], temp2));
2636 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2637 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2638 (match_operand:SI 2 "exact_log2_cint_operand" "N")))]
2640 "{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0"
2641 [(set_attr "length" "8")])
2644 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2645 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2646 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2648 (clobber (match_scratch:SI 3 "=r,r"))]
2651 {srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3
2653 [(set_attr "type" "compare")
2654 (set_attr "length" "8,12")])
2657 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2658 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2659 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2661 (clobber (match_scratch:SI 3 ""))]
2664 (div:SI (match_dup 1) (match_dup 2)))
2666 (compare:CC (match_dup 3)
2671 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2672 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2673 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2675 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2676 (div:SI (match_dup 1) (match_dup 2)))]
2679 {srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0
2681 [(set_attr "type" "compare")
2682 (set_attr "length" "8,12")])
2685 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2686 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2687 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2689 (set (match_operand:SI 0 "gpc_reg_operand" "")
2690 (div:SI (match_dup 1) (match_dup 2)))]
2693 (div:SI (match_dup 1) (match_dup 2)))
2695 (compare:CC (match_dup 0)
2700 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2703 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
2705 (zero_extend:DI (match_operand:SI 4 "register_operand" "2")))
2706 (match_operand:SI 3 "gpc_reg_operand" "r")))
2707 (set (match_operand:SI 2 "register_operand" "=*q")
2710 (zero_extend:DI (match_dup 1)) (const_int 32))
2711 (zero_extend:DI (match_dup 4)))
2715 [(set_attr "type" "idiv")])
2717 ;; To do unsigned divide we handle the cases of the divisor looking like a
2718 ;; negative number. If it is a constant that is less than 2**31, we don't
2719 ;; have to worry about the branches. So make a few subroutines here.
2721 ;; First comes the normal case.
2722 (define_expand "udivmodsi4_normal"
2723 [(set (match_dup 4) (const_int 0))
2724 (parallel [(set (match_operand:SI 0 "" "")
2725 (udiv:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2727 (zero_extend:DI (match_operand:SI 1 "" "")))
2728 (match_operand:SI 2 "" "")))
2729 (set (match_operand:SI 3 "" "")
2730 (umod:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2732 (zero_extend:DI (match_dup 1)))
2736 { operands[4] = gen_reg_rtx (SImode); }")
2738 ;; This handles the branches.
2739 (define_expand "udivmodsi4_tests"
2740 [(set (match_operand:SI 0 "" "") (const_int 0))
2741 (set (match_operand:SI 3 "" "") (match_operand:SI 1 "" ""))
2742 (set (match_dup 5) (compare:CCUNS (match_dup 1) (match_operand:SI 2 "" "")))
2743 (set (pc) (if_then_else (ltu (match_dup 5) (const_int 0))
2744 (label_ref (match_operand:SI 4 "" "")) (pc)))
2745 (set (match_dup 0) (const_int 1))
2746 (set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2)))
2747 (set (match_dup 6) (compare:CC (match_dup 2) (const_int 0)))
2748 (set (pc) (if_then_else (lt (match_dup 6) (const_int 0))
2749 (label_ref (match_dup 4)) (pc)))]
2752 { operands[5] = gen_reg_rtx (CCUNSmode);
2753 operands[6] = gen_reg_rtx (CCmode);
2756 (define_expand "udivmodsi4"
2757 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2758 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2759 (match_operand:SI 2 "reg_or_cint_operand" "")))
2760 (set (match_operand:SI 3 "gpc_reg_operand" "")
2761 (umod:SI (match_dup 1) (match_dup 2)))])]
2769 if (! TARGET_POWERPC)
2771 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2772 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2773 emit_insn (gen_divus_call ());
2774 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2775 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2782 if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
2784 operands[2] = force_reg (SImode, operands[2]);
2785 label = gen_label_rtx ();
2786 emit (gen_udivmodsi4_tests (operands[0], operands[1], operands[2],
2787 operands[3], label));
2790 operands[2] = force_reg (SImode, operands[2]);
2792 emit (gen_udivmodsi4_normal (operands[0], operands[1], operands[2],
2800 ;; AIX architecture-independent common-mode multiply (DImode),
2801 ;; divide/modulus, and quotient subroutine calls. Input operands in R3 and
2802 ;; R4; results in R3 and sometimes R4; link register always clobbered by bla
2803 ;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but
2804 ;; assumed unused if generating common-mode, so ignore.
2805 (define_insn "mulh_call"
2808 (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3))
2809 (sign_extend:DI (reg:SI 4)))
2811 (clobber (match_scratch:SI 0 "=l"))]
2812 "! TARGET_POWER && ! TARGET_POWERPC"
2814 [(set_attr "type" "imul")])
2816 (define_insn "mull_call"
2818 (mult:DI (sign_extend:DI (reg:SI 3))
2819 (sign_extend:DI (reg:SI 4))))
2820 (clobber (match_scratch:SI 0 "=l"))
2821 (clobber (reg:SI 0))]
2822 "! TARGET_POWER && ! TARGET_POWERPC"
2824 [(set_attr "type" "imul")])
2826 (define_insn "divss_call"
2828 (div:SI (reg:SI 3) (reg:SI 4)))
2830 (mod:SI (reg:SI 3) (reg:SI 4)))
2831 (clobber (match_scratch:SI 0 "=l"))
2832 (clobber (reg:SI 0))]
2833 "! TARGET_POWER && ! TARGET_POWERPC"
2835 [(set_attr "type" "idiv")])
2837 (define_insn "divus_call"
2839 (udiv:SI (reg:SI 3) (reg:SI 4)))
2841 (umod:SI (reg:SI 3) (reg:SI 4)))
2842 (clobber (match_scratch:SI 0 "=l"))
2843 (clobber (reg:SI 0))
2844 (clobber (match_scratch:CC 1 "=x"))
2845 (clobber (reg:CC 69))]
2846 "! TARGET_POWER && ! TARGET_POWERPC"
2848 [(set_attr "type" "idiv")])
2850 (define_insn "quoss_call"
2852 (div:SI (reg:SI 3) (reg:SI 4)))
2853 (clobber (match_scratch:SI 0 "=l"))]
2854 "! TARGET_POWER && ! TARGET_POWERPC"
2856 [(set_attr "type" "idiv")])
2858 (define_insn "quous_call"
2860 (udiv:SI (reg:SI 3) (reg:SI 4)))
2861 (clobber (match_scratch:SI 0 "=l"))
2862 (clobber (reg:SI 0))
2863 (clobber (match_scratch:CC 1 "=x"))
2864 (clobber (reg:CC 69))]
2865 "! TARGET_POWER && ! TARGET_POWERPC"
2867 [(set_attr "type" "idiv")])
2869 ;; Logical instructions
2870 ;; The logical instructions are mostly combined by using match_operator,
2871 ;; but the plain AND insns are somewhat different because there is no
2872 ;; plain 'andi' (only 'andi.'), no plain 'andis', and there are all
2873 ;; those rotate-and-mask operations. Thus, the AND insns come first.
2875 (define_insn "andsi3"
2876 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
2877 (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
2878 (match_operand:SI 2 "and_operand" "?r,T,K,L")))
2879 (clobber (match_scratch:CC 3 "=X,X,x,x"))]
2883 {rlinm|rlwinm} %0,%1,0,%m2,%M2
2884 {andil.|andi.} %0,%1,%b2
2885 {andiu.|andis.} %0,%1,%u2")
2887 ;; Note to set cr's other than cr0 we do the and immediate and then
2888 ;; the test again -- this avoids a mcrf which on the higher end
2889 ;; machines causes an execution serialization
2891 (define_insn "*andsi3_internal2"
2892 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2893 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2894 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2896 (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
2897 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2898 "! TARGET_POWERPC64"
2901 {andil.|andi.} %3,%1,%b2
2902 {andiu.|andis.} %3,%1,%u2
2903 {rlinm.|rlwinm.} %3,%1,0,%m2,%M2
2908 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2909 (set_attr "length" "4,4,4,4,8,8,8,8")])
2912 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2913 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
2914 (match_operand:SI 2 "and_operand" ""))
2916 (clobber (match_scratch:SI 3 ""))
2917 (clobber (match_scratch:CC 4 ""))]
2918 "! TARGET_POWERPC64 && reload_completed"
2919 [(parallel [(set (match_dup 3)
2920 (and:SI (match_dup 1)
2922 (clobber (match_dup 4))])
2924 (compare:CC (match_dup 3)
2928 (define_insn "*andsi3_internal3"
2929 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2930 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2931 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2933 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
2934 (and:SI (match_dup 1)
2936 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2937 "! TARGET_POWERPC64"
2940 {andil.|andi.} %0,%1,%b2
2941 {andiu.|andis.} %0,%1,%u2
2942 {rlinm.|rlwinm.} %0,%1,0,%m2,%M2
2947 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2948 (set_attr "length" "4,4,4,4,8,8,8,8")])
2951 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2952 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
2953 (match_operand:SI 2 "and_operand" ""))
2955 (set (match_operand:SI 0 "gpc_reg_operand" "")
2956 (and:SI (match_dup 1)
2958 (clobber (match_scratch:CC 4 ""))]
2959 "! TARGET_POWERPC64 && reload_completed"
2960 [(parallel [(set (match_dup 0)
2961 (and:SI (match_dup 1)
2963 (clobber (match_dup 4))])
2965 (compare:CC (match_dup 0)
2969 (define_expand "iorsi3"
2970 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2971 (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
2972 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
2976 if (GET_CODE (operands[2]) == CONST_INT
2977 && ! logical_operand (operands[2], SImode))
2979 HOST_WIDE_INT value = INTVAL (operands[2]);
2980 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
2981 ? operands[0] : gen_reg_rtx (SImode));
2983 emit_insn (gen_iorsi3 (tmp, operands[1],
2984 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
2985 emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
2990 (define_expand "xorsi3"
2991 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2992 (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2993 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
2997 if (GET_CODE (operands[2]) == CONST_INT
2998 && ! logical_operand (operands[2], SImode))
3000 HOST_WIDE_INT value = INTVAL (operands[2]);
3001 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
3002 ? operands[0] : gen_reg_rtx (SImode));
3004 emit_insn (gen_xorsi3 (tmp, operands[1],
3005 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
3006 emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
3011 (define_insn "*boolsi3_internal1"
3012 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
3013 (match_operator:SI 3 "boolean_or_operator"
3014 [(match_operand:SI 1 "gpc_reg_operand" "%r,r,r")
3015 (match_operand:SI 2 "logical_operand" "r,K,L")]))]
3019 {%q3il|%q3i} %0,%1,%b2
3020 {%q3iu|%q3is} %0,%1,%u2")
3022 (define_insn "*boolsi3_internal2"
3023 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3024 (compare:CC (match_operator:SI 4 "boolean_or_operator"
3025 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
3026 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3028 (clobber (match_scratch:SI 3 "=r,r"))]
3029 "! TARGET_POWERPC64"
3033 [(set_attr "type" "compare")
3034 (set_attr "length" "4,8")])
3037 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3038 (compare:CC (match_operator:SI 4 "boolean_operator"
3039 [(match_operand:SI 1 "gpc_reg_operand" "")
3040 (match_operand:SI 2 "gpc_reg_operand" "")])
3042 (clobber (match_scratch:SI 3 ""))]
3043 "! TARGET_POWERPC64 && reload_completed"
3044 [(set (match_dup 3) (match_dup 4))
3046 (compare:CC (match_dup 3)
3050 (define_insn "*boolsi3_internal3"
3051 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3052 (compare:CC (match_operator:SI 4 "boolean_operator"
3053 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
3054 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3056 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3058 "! TARGET_POWERPC64"
3062 [(set_attr "type" "compare")
3063 (set_attr "length" "4,8")])
3066 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3067 (compare:CC (match_operator:SI 4 "boolean_operator"
3068 [(match_operand:SI 1 "gpc_reg_operand" "")
3069 (match_operand:SI 2 "gpc_reg_operand" "")])
3071 (set (match_operand:SI 0 "gpc_reg_operand" "")
3073 "! TARGET_POWERPC64 && reload_completed"
3074 [(set (match_dup 0) (match_dup 4))
3076 (compare:CC (match_dup 0)
3080 ;; Split an logical operation that we can't do in one insn into two insns,
3081 ;; each of which does one 16-bit part. This is used by combine.
3084 [(set (match_operand:SI 0 "gpc_reg_operand" "")
3085 (match_operator:SI 3 "boolean_or_operator"
3086 [(match_operand:SI 1 "gpc_reg_operand" "")
3087 (match_operand:SI 2 "non_logical_cint_operand" "")]))]
3089 [(set (match_dup 0) (match_dup 4))
3090 (set (match_dup 0) (match_dup 5))]
3094 i = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
3095 operands[4] = gen_rtx (GET_CODE (operands[3]), SImode,
3097 i = GEN_INT (INTVAL (operands[2]) & 0xffff);
3098 operands[5] = gen_rtx (GET_CODE (operands[3]), SImode,
3102 (define_insn "*boolcsi3_internal1"
3103 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3104 (match_operator:SI 3 "boolean_operator"
3105 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3106 (match_operand:SI 2 "gpc_reg_operand" "r")]))]
3110 (define_insn "*boolcsi3_internal2"
3111 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3112 (compare:CC (match_operator:SI 4 "boolean_operator"
3113 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3114 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3116 (clobber (match_scratch:SI 3 "=r,r"))]
3117 "! TARGET_POWERPC64"
3121 [(set_attr "type" "compare")
3122 (set_attr "length" "4,8")])
3125 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3126 (compare:CC (match_operator:SI 4 "boolean_operator"
3127 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3128 (match_operand:SI 2 "gpc_reg_operand" "")])
3130 (clobber (match_scratch:SI 3 ""))]
3131 "! TARGET_POWERPC64 && reload_completed"
3132 [(set (match_dup 3) (match_dup 4))
3134 (compare:CC (match_dup 3)
3138 (define_insn "*boolcsi3_internal3"
3139 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3140 (compare:CC (match_operator:SI 4 "boolean_operator"
3141 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3142 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3144 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3146 "! TARGET_POWERPC64"
3150 [(set_attr "type" "compare")
3151 (set_attr "length" "4,8")])
3154 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3155 (compare:CC (match_operator:SI 4 "boolean_operator"
3156 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3157 (match_operand:SI 2 "gpc_reg_operand" "")])
3159 (set (match_operand:SI 0 "gpc_reg_operand" "")
3161 "! TARGET_POWERPC64 && reload_completed"
3162 [(set (match_dup 0) (match_dup 4))
3164 (compare:CC (match_dup 0)
3168 (define_insn "*boolccsi3_internal1"
3169 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3170 (match_operator:SI 3 "boolean_operator"
3171 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3172 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))]))]
3176 (define_insn "*boolccsi3_internal2"
3177 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3178 (compare:CC (match_operator:SI 4 "boolean_operator"
3179 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3180 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3182 (clobber (match_scratch:SI 3 "=r,r"))]
3183 "! TARGET_POWERPC64"
3187 [(set_attr "type" "compare")
3188 (set_attr "length" "4,8")])
3191 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3192 (compare:CC (match_operator:SI 4 "boolean_operator"
3193 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3194 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3196 (clobber (match_scratch:SI 3 ""))]
3197 "! TARGET_POWERPC64 && reload_completed"
3198 [(set (match_dup 3) (match_dup 4))
3200 (compare:CC (match_dup 3)
3204 (define_insn "*boolccsi3_internal3"
3205 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3206 (compare:CC (match_operator:SI 4 "boolean_operator"
3207 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3208 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3210 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3212 "! TARGET_POWERPC64"
3216 [(set_attr "type" "compare")
3217 (set_attr "length" "4,8")])
3220 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3221 (compare:CC (match_operator:SI 4 "boolean_operator"
3222 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3223 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3225 (set (match_operand:SI 0 "gpc_reg_operand" "")
3227 "! TARGET_POWERPC64 && reload_completed"
3228 [(set (match_dup 0) (match_dup 4))
3230 (compare:CC (match_dup 0)
3234 ;; maskir insn. We need four forms because things might be in arbitrary
3235 ;; orders. Don't define forms that only set CR fields because these
3236 ;; would modify an input register.
3238 (define_insn "*maskir_internal1"
3239 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3240 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3241 (match_operand:SI 1 "gpc_reg_operand" "0"))
3242 (and:SI (match_dup 2)
3243 (match_operand:SI 3 "gpc_reg_operand" "r"))))]
3247 (define_insn "*maskir_internal2"
3248 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3249 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3250 (match_operand:SI 1 "gpc_reg_operand" "0"))
3251 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3256 (define_insn "*maskir_internal3"
3257 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3258 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r")
3259 (match_operand:SI 3 "gpc_reg_operand" "r"))
3260 (and:SI (not:SI (match_dup 2))
3261 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3265 (define_insn "*maskir_internal4"
3266 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3267 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3268 (match_operand:SI 2 "gpc_reg_operand" "r"))
3269 (and:SI (not:SI (match_dup 2))
3270 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3274 (define_insn "*maskir_internal5"
3275 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3277 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3278 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3279 (and:SI (match_dup 2)
3280 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
3282 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3283 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3284 (and:SI (match_dup 2) (match_dup 3))))]
3289 [(set_attr "type" "compare")
3290 (set_attr "length" "4,8")])
3293 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3295 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3296 (match_operand:SI 1 "gpc_reg_operand" ""))
3297 (and:SI (match_dup 2)
3298 (match_operand:SI 3 "gpc_reg_operand" "")))
3300 (set (match_operand:SI 0 "gpc_reg_operand" "")
3301 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3302 (and:SI (match_dup 2) (match_dup 3))))]
3303 "TARGET_POWER && reload_completed"
3305 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3306 (and:SI (match_dup 2) (match_dup 3))))
3308 (compare:CC (match_dup 0)
3312 (define_insn "*maskir_internal6"
3313 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3315 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3316 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3317 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3320 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3321 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3322 (and:SI (match_dup 3) (match_dup 2))))]
3327 [(set_attr "type" "compare")
3328 (set_attr "length" "4,8")])
3331 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3333 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3334 (match_operand:SI 1 "gpc_reg_operand" ""))
3335 (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3338 (set (match_operand:SI 0 "gpc_reg_operand" "")
3339 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3340 (and:SI (match_dup 3) (match_dup 2))))]
3341 "TARGET_POWER && reload_completed"
3343 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3344 (and:SI (match_dup 3) (match_dup 2))))
3346 (compare:CC (match_dup 0)
3350 (define_insn "*maskir_internal7"
3351 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3353 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")
3354 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
3355 (and:SI (not:SI (match_dup 2))
3356 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3358 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3359 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3360 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3365 [(set_attr "type" "compare")
3366 (set_attr "length" "4,8")])
3369 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3371 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "")
3372 (match_operand:SI 3 "gpc_reg_operand" ""))
3373 (and:SI (not:SI (match_dup 2))
3374 (match_operand:SI 1 "gpc_reg_operand" "")))
3376 (set (match_operand:SI 0 "gpc_reg_operand" "")
3377 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3378 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3379 "TARGET_POWER && reload_completed"
3381 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3382 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3384 (compare:CC (match_dup 0)
3388 (define_insn "*maskir_internal8"
3389 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3391 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3392 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3393 (and:SI (not:SI (match_dup 2))
3394 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3396 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3397 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3398 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3403 [(set_attr "type" "compare")
3404 (set_attr "length" "4,8")])
3407 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3409 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3410 (match_operand:SI 2 "gpc_reg_operand" ""))
3411 (and:SI (not:SI (match_dup 2))
3412 (match_operand:SI 1 "gpc_reg_operand" "")))
3414 (set (match_operand:SI 0 "gpc_reg_operand" "")
3415 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3416 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3417 "TARGET_POWER && reload_completed"
3419 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3420 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3422 (compare:CC (match_dup 0)
3426 ;; Rotate and shift insns, in all their variants. These support shifts,
3427 ;; field inserts and extracts, and various combinations thereof.
3428 (define_expand "insv"
3429 [(set (zero_extract (match_operand 0 "gpc_reg_operand" "")
3430 (match_operand:SI 1 "const_int_operand" "")
3431 (match_operand:SI 2 "const_int_operand" ""))
3432 (match_operand 3 "gpc_reg_operand" ""))]
3436 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3437 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3438 compiler if the address of the structure is taken later. */
3439 if (GET_CODE (operands[0]) == SUBREG
3440 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3443 if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
3444 emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
3446 emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
3450 (define_insn "insvsi"
3451 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3452 (match_operand:SI 1 "const_int_operand" "i")
3453 (match_operand:SI 2 "const_int_operand" "i"))
3454 (match_operand:SI 3 "gpc_reg_operand" "r"))]
3458 int start = INTVAL (operands[2]) & 31;
3459 int size = INTVAL (operands[1]) & 31;
3461 operands[4] = GEN_INT (32 - start - size);
3462 operands[1] = GEN_INT (start + size - 1);
3463 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3466 (define_insn "*insvsi_internal1"
3467 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3468 (match_operand:SI 1 "const_int_operand" "i")
3469 (match_operand:SI 2 "const_int_operand" "i"))
3470 (ashift:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3471 (match_operand:SI 4 "const_int_operand" "i")))]
3472 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3475 int shift = INTVAL (operands[4]) & 31;
3476 int start = INTVAL (operands[2]) & 31;
3477 int size = INTVAL (operands[1]) & 31;
3479 operands[4] = GEN_INT (shift - start - size);
3480 operands[1] = GEN_INT (start + size - 1);
3481 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3484 (define_insn "*insvsi_internal2"
3485 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3486 (match_operand:SI 1 "const_int_operand" "i")
3487 (match_operand:SI 2 "const_int_operand" "i"))
3488 (ashiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3489 (match_operand:SI 4 "const_int_operand" "i")))]
3490 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3493 int shift = INTVAL (operands[4]) & 31;
3494 int start = INTVAL (operands[2]) & 31;
3495 int size = INTVAL (operands[1]) & 31;
3497 operands[4] = GEN_INT (32 - shift - start - size);
3498 operands[1] = GEN_INT (start + size - 1);
3499 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3502 (define_insn "*insvsi_internal3"
3503 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3504 (match_operand:SI 1 "const_int_operand" "i")
3505 (match_operand:SI 2 "const_int_operand" "i"))
3506 (lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3507 (match_operand:SI 4 "const_int_operand" "i")))]
3508 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3511 int shift = INTVAL (operands[4]) & 31;
3512 int start = INTVAL (operands[2]) & 31;
3513 int size = INTVAL (operands[1]) & 31;
3515 operands[4] = GEN_INT (32 - shift - start - size);
3516 operands[1] = GEN_INT (start + size - 1);
3517 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3520 (define_insn "*insvsi_internal4"
3521 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3522 (match_operand:SI 1 "const_int_operand" "i")
3523 (match_operand:SI 2 "const_int_operand" "i"))
3524 (zero_extract:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3525 (match_operand:SI 4 "const_int_operand" "i")
3526 (match_operand:SI 5 "const_int_operand" "i")))]
3527 "INTVAL (operands[4]) >= INTVAL (operands[1])"
3530 int extract_start = INTVAL (operands[5]) & 31;
3531 int extract_size = INTVAL (operands[4]) & 31;
3532 int insert_start = INTVAL (operands[2]) & 31;
3533 int insert_size = INTVAL (operands[1]) & 31;
3535 /* Align extract field with insert field */
3536 operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
3537 operands[1] = GEN_INT (insert_start + insert_size - 1);
3538 return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
3541 (define_insn "insvdi"
3542 [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
3543 (match_operand:SI 1 "const_int_operand" "i")
3544 (match_operand:SI 2 "const_int_operand" "i"))
3545 (match_operand:DI 3 "gpc_reg_operand" "r"))]
3549 int start = INTVAL (operands[2]) & 63;
3550 int size = INTVAL (operands[1]) & 63;
3552 operands[1] = GEN_INT (64 - start - size);
3553 return \"rldimi %0,%3,%H1,%H2\";
3556 (define_expand "extzv"
3557 [(set (match_operand 0 "gpc_reg_operand" "")
3558 (zero_extract (match_operand 1 "gpc_reg_operand" "")
3559 (match_operand:SI 2 "const_int_operand" "")
3560 (match_operand:SI 3 "const_int_operand" "")))]
3564 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3565 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3566 compiler if the address of the structure is taken later. */
3567 if (GET_CODE (operands[0]) == SUBREG
3568 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3571 if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
3572 emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
3574 emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
3578 (define_insn "extzvsi"
3579 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3580 (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3581 (match_operand:SI 2 "const_int_operand" "i")
3582 (match_operand:SI 3 "const_int_operand" "i")))]
3586 int start = INTVAL (operands[3]) & 31;
3587 int size = INTVAL (operands[2]) & 31;
3589 if (start + size >= 32)
3590 operands[3] = const0_rtx;
3592 operands[3] = GEN_INT (start + size);
3593 return \"{rlinm|rlwinm} %0,%1,%3,%s2,31\";
3596 (define_insn "*extzvsi_internal1"
3597 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3598 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3599 (match_operand:SI 2 "const_int_operand" "i,i")
3600 (match_operand:SI 3 "const_int_operand" "i,i"))
3602 (clobber (match_scratch:SI 4 "=r,r"))]
3603 "! TARGET_POWERPC64"
3606 int start = INTVAL (operands[3]) & 31;
3607 int size = INTVAL (operands[2]) & 31;
3609 /* Force split for non-cc0 compare. */
3610 if (which_alternative == 1)
3613 /* If the bitfield being tested fits in the upper or lower half of a
3614 word, it is possible to use andiu. or andil. to test it. This is
3615 useful because the condition register set-use delay is smaller for
3616 andi[ul]. than for rlinm. This doesn't work when the starting bit
3617 position is 0 because the LT and GT bits may be set wrong. */
3619 if ((start > 0 && start + size <= 16) || start >= 16)
3621 operands[3] = GEN_INT (((1 << (16 - (start & 15)))
3622 - (1 << (16 - (start & 15) - size))));
3624 return \"{andiu.|andis.} %4,%1,%3\";
3626 return \"{andil.|andi.} %4,%1,%3\";
3629 if (start + size >= 32)
3630 operands[3] = const0_rtx;
3632 operands[3] = GEN_INT (start + size);
3633 return \"{rlinm.|rlwinm.} %4,%1,%3,%s2,31\";
3635 [(set_attr "type" "compare")
3636 (set_attr "length" "4,8")])
3639 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3640 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3641 (match_operand:SI 2 "const_int_operand" "")
3642 (match_operand:SI 3 "const_int_operand" ""))
3644 (clobber (match_scratch:SI 4 ""))]
3645 "! TARGET_POWERPC64 && reload_completed"
3647 (zero_extract:SI (match_dup 1) (match_dup 2)
3650 (compare:CC (match_dup 4)
3654 (define_insn "*extzvsi_internal2"
3655 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3656 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3657 (match_operand:SI 2 "const_int_operand" "i,i")
3658 (match_operand:SI 3 "const_int_operand" "i,i"))
3660 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3661 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3662 "! TARGET_POWERPC64"
3665 int start = INTVAL (operands[3]) & 31;
3666 int size = INTVAL (operands[2]) & 31;
3668 /* Force split for non-cc0 compare. */
3669 if (which_alternative == 1)
3672 if (start >= 16 && start + size == 32)
3674 operands[3] = GEN_INT ((1 << (32 - start)) - 1);
3675 return \"{andil.|andi.} %0,%1,%3\";
3678 if (start + size >= 32)
3679 operands[3] = const0_rtx;
3681 operands[3] = GEN_INT (start + size);
3682 return \"{rlinm.|rlwinm.} %0,%1,%3,%s2,31\";
3684 [(set_attr "type" "delayed_compare")
3685 (set_attr "length" "4,8")])
3688 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3689 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3690 (match_operand:SI 2 "const_int_operand" "")
3691 (match_operand:SI 3 "const_int_operand" ""))
3693 (set (match_operand:SI 0 "gpc_reg_operand" "")
3694 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3695 "! TARGET_POWERPC64 && reload_completed"
3697 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))
3699 (compare:CC (match_dup 0)
3703 (define_insn "extzvdi"
3704 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
3705 (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3706 (match_operand:SI 2 "const_int_operand" "i")
3707 (match_operand:SI 3 "const_int_operand" "i")))]
3711 int start = INTVAL (operands[3]) & 63;
3712 int size = INTVAL (operands[2]) & 63;
3714 if (start + size >= 64)
3715 operands[3] = const0_rtx;
3717 operands[3] = GEN_INT (start + size);
3718 operands[2] = GEN_INT (64 - size);
3719 return \"rldicl %0,%1,%3,%2\";
3722 (define_insn "*extzvdi_internal1"
3723 [(set (match_operand:CC 0 "gpc_reg_operand" "=x")
3724 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3725 (match_operand:SI 2 "const_int_operand" "i")
3726 (match_operand:SI 3 "const_int_operand" "i"))
3728 (clobber (match_scratch:DI 4 "=r"))]
3732 int start = INTVAL (operands[3]) & 63;
3733 int size = INTVAL (operands[2]) & 63;
3735 if (start + size >= 64)
3736 operands[3] = const0_rtx;
3738 operands[3] = GEN_INT (start + size);
3739 operands[2] = GEN_INT (64 - size);
3740 return \"rldicl. %4,%1,%3,%2\";
3743 (define_insn "*extzvdi_internal2"
3744 [(set (match_operand:CC 4 "gpc_reg_operand" "=x")
3745 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3746 (match_operand:SI 2 "const_int_operand" "i")
3747 (match_operand:SI 3 "const_int_operand" "i"))
3749 (set (match_operand:DI 0 "gpc_reg_operand" "=r")
3750 (zero_extract:DI (match_dup 1) (match_dup 2) (match_dup 3)))]
3754 int start = INTVAL (operands[3]) & 63;
3755 int size = INTVAL (operands[2]) & 63;
3757 if (start + size >= 64)
3758 operands[3] = const0_rtx;
3760 operands[3] = GEN_INT (start + size);
3761 operands[2] = GEN_INT (64 - size);
3762 return \"rldicl. %0,%1,%3,%2\";
3765 (define_insn "rotlsi3"
3766 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3767 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3768 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
3770 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffffffff")
3772 (define_insn "*rotlsi3_internal2"
3773 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3774 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3775 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3777 (clobber (match_scratch:SI 3 "=r,r"))]
3778 "! TARGET_POWERPC64"
3780 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffffffff
3782 [(set_attr "type" "delayed_compare")
3783 (set_attr "length" "4,8")])
3786 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3787 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3788 (match_operand:SI 2 "reg_or_cint_operand" ""))
3790 (clobber (match_scratch:SI 3 ""))]
3791 "! TARGET_POWERPC64 && reload_completed"
3793 (rotate:SI (match_dup 1) (match_dup 2)))
3795 (compare:CC (match_dup 3)
3799 (define_insn "*rotlsi3_internal3"
3800 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3801 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3802 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3804 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3805 (rotate:SI (match_dup 1) (match_dup 2)))]
3806 "! TARGET_POWERPC64"
3808 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffffffff
3810 [(set_attr "type" "delayed_compare")
3811 (set_attr "length" "4,8")])
3814 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3815 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3816 (match_operand:SI 2 "reg_or_cint_operand" ""))
3818 (set (match_operand:SI 0 "gpc_reg_operand" "")
3819 (rotate:SI (match_dup 1) (match_dup 2)))]
3820 "! TARGET_POWERPC64 && reload_completed"
3822 (rotate:SI (match_dup 1) (match_dup 2)))
3824 (compare:CC (match_dup 0)
3828 (define_insn "*rotlsi3_internal4"
3829 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3830 (and:SI (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3831 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
3832 (match_operand:SI 3 "mask_operand" "T")))]
3834 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,%m3,%M3")
3836 (define_insn "*rotlsi3_internal5"
3837 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3839 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3840 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3841 (match_operand:SI 3 "mask_operand" "T,T"))
3843 (clobber (match_scratch:SI 4 "=r,r"))]
3844 "! TARGET_POWERPC64"
3846 {rl%I2nm.|rlw%I2nm.} %4,%1,%h2,%m3,%M3
3848 [(set_attr "type" "delayed_compare")
3849 (set_attr "length" "4,8")])
3852 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3854 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3855 (match_operand:SI 2 "reg_or_cint_operand" ""))
3856 (match_operand:SI 3 "mask_operand" ""))
3858 (clobber (match_scratch:SI 4 ""))]
3859 "! TARGET_POWERPC64 && reload_completed"
3861 (and:SI (rotate:SI (match_dup 1)
3865 (compare:CC (match_dup 4)
3869 (define_insn "*rotlsi3_internal6"
3870 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3872 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3873 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3874 (match_operand:SI 3 "mask_operand" "T,T"))
3876 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3877 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
3878 "! TARGET_POWERPC64"
3880 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,%m3,%M3
3882 [(set_attr "type" "delayed_compare")
3883 (set_attr "length" "4,8")])
3886 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3888 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3889 (match_operand:SI 2 "reg_or_cint_operand" ""))
3890 (match_operand:SI 3 "mask_operand" ""))
3892 (set (match_operand:SI 0 "gpc_reg_operand" "")
3893 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
3894 "! TARGET_POWERPC64 && reload_completed"
3896 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
3898 (compare:CC (match_dup 0)
3902 (define_insn "*rotlsi3_internal7"
3903 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3906 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3907 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
3909 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xff")
3911 (define_insn "*rotlsi3_internal8"
3912 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3913 (compare:CC (zero_extend:SI
3915 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3916 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3918 (clobber (match_scratch:SI 3 "=r,r"))]
3921 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xff
3923 [(set_attr "type" "delayed_compare")
3924 (set_attr "length" "4,8")])
3927 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3928 (compare:CC (zero_extend:SI
3930 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3931 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3933 (clobber (match_scratch:SI 3 ""))]
3936 (zero_extend:SI (subreg:QI
3937 (rotate:SI (match_dup 1)
3940 (compare:CC (match_dup 3)
3944 (define_insn "*rotlsi3_internal9"
3945 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3946 (compare:CC (zero_extend:SI
3948 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3949 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3951 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3952 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3955 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xff
3957 [(set_attr "type" "delayed_compare")
3958 (set_attr "length" "4,8")])
3961 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3962 (compare:CC (zero_extend:SI
3964 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3965 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3967 (set (match_operand:SI 0 "gpc_reg_operand" "")
3968 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3971 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
3973 (compare:CC (match_dup 0)
3977 (define_insn "*rotlsi3_internal10"
3978 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3981 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3982 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
3984 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffff")
3986 (define_insn "*rotlsi3_internal11"
3987 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3988 (compare:CC (zero_extend:SI
3990 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3991 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3993 (clobber (match_scratch:SI 3 "=r,r"))]
3996 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffff
3998 [(set_attr "type" "delayed_compare")
3999 (set_attr "length" "4,8")])
4002 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4003 (compare:CC (zero_extend:SI
4005 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4006 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4008 (clobber (match_scratch:SI 3 ""))]
4011 (zero_extend:SI (subreg:HI
4012 (rotate:SI (match_dup 1)
4015 (compare:CC (match_dup 3)
4019 (define_insn "*rotlsi3_internal12"
4020 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4021 (compare:CC (zero_extend:SI
4023 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4024 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
4026 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4027 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4030 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffff
4032 [(set_attr "type" "delayed_compare")
4033 (set_attr "length" "4,8")])
4036 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4037 (compare:CC (zero_extend:SI
4039 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
4040 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
4042 (set (match_operand:SI 0 "gpc_reg_operand" "")
4043 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
4046 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
4048 (compare:CC (match_dup 0)
4052 ;; Note that we use "sle." instead of "sl." so that we can set
4053 ;; SHIFT_COUNT_TRUNCATED.
4055 (define_expand "ashlsi3"
4056 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
4057 (use (match_operand:SI 1 "gpc_reg_operand" ""))
4058 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
4063 emit_insn (gen_ashlsi3_power (operands[0], operands[1], operands[2]));
4065 emit_insn (gen_ashlsi3_no_power (operands[0], operands[1], operands[2]));
4069 (define_insn "ashlsi3_power"
4070 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4071 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4072 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
4073 (clobber (match_scratch:SI 3 "=q,X"))]
4077 {sli|slwi} %0,%1,%h2")
4079 (define_insn "ashlsi3_no_power"
4080 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4081 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4082 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4084 "{sl|slw}%I2 %0,%1,%h2")
4087 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4088 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4089 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4091 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4092 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4096 {sli.|slwi.} %3,%1,%h2
4099 [(set_attr "type" "delayed_compare")
4100 (set_attr "length" "4,4,8,8")])
4103 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4104 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4105 (match_operand:SI 2 "reg_or_cint_operand" ""))
4107 (clobber (match_scratch:SI 3 ""))
4108 (clobber (match_scratch:SI 4 ""))]
4109 "TARGET_POWER && reload_completed"
4110 [(parallel [(set (match_dup 3)
4111 (ashift:SI (match_dup 1) (match_dup 2)))
4112 (clobber (match_dup 4))])
4114 (compare:CC (match_dup 3)
4119 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4120 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4121 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4123 (clobber (match_scratch:SI 3 "=r,r"))]
4124 "! TARGET_POWER && ! TARGET_POWERPC64"
4126 {sl|slw}%I2. %3,%1,%h2
4128 [(set_attr "type" "delayed_compare")
4129 (set_attr "length" "4,8")])
4132 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4133 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4134 (match_operand:SI 2 "reg_or_cint_operand" ""))
4136 (clobber (match_scratch:SI 3 ""))]
4137 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4139 (ashift:SI (match_dup 1) (match_dup 2)))
4141 (compare:CC (match_dup 3)
4146 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4147 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4148 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4150 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4151 (ashift:SI (match_dup 1) (match_dup 2)))
4152 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4156 {sli.|slwi.} %0,%1,%h2
4159 [(set_attr "type" "delayed_compare")
4160 (set_attr "length" "4,4,8,8")])
4163 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4164 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4165 (match_operand:SI 2 "reg_or_cint_operand" ""))
4167 (set (match_operand:SI 0 "gpc_reg_operand" "")
4168 (ashift:SI (match_dup 1) (match_dup 2)))
4169 (clobber (match_scratch:SI 4 ""))]
4170 "TARGET_POWER && reload_completed"
4171 [(parallel [(set (match_dup 0)
4172 (ashift:SI (match_dup 1) (match_dup 2)))
4173 (clobber (match_dup 4))])
4175 (compare:CC (match_dup 0)
4180 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4181 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4182 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4184 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4185 (ashift:SI (match_dup 1) (match_dup 2)))]
4186 "! TARGET_POWER && ! TARGET_POWERPC64"
4188 {sl|slw}%I2. %0,%1,%h2
4190 [(set_attr "type" "delayed_compare")
4191 (set_attr "length" "4,8")])
4194 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4195 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4196 (match_operand:SI 2 "reg_or_cint_operand" ""))
4198 (set (match_operand:SI 0 "gpc_reg_operand" "")
4199 (ashift:SI (match_dup 1) (match_dup 2)))]
4200 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4202 (ashift:SI (match_dup 1) (match_dup 2)))
4204 (compare:CC (match_dup 0)
4209 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4210 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4211 (match_operand:SI 2 "const_int_operand" "i"))
4212 (match_operand:SI 3 "mask_operand" "T")))]
4213 "includes_lshift_p (operands[2], operands[3])"
4214 "{rlinm|rlwinm} %0,%1,%h2,%m3,%M3")
4217 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4219 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4220 (match_operand:SI 2 "const_int_operand" "i,i"))
4221 (match_operand:SI 3 "mask_operand" "T,T"))
4223 (clobber (match_scratch:SI 4 "=r,r"))]
4224 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
4226 {rlinm.|rlwinm.} %4,%1,%h2,%m3,%M3
4228 [(set_attr "type" "delayed_compare")
4229 (set_attr "length" "4,8")])
4232 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4234 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4235 (match_operand:SI 2 "const_int_operand" ""))
4236 (match_operand:SI 3 "mask_operand" ""))
4238 (clobber (match_scratch:SI 4 ""))]
4239 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3]) && reload_completed"
4241 (and:SI (ashift:SI (match_dup 1) (match_dup 2))
4244 (compare:CC (match_dup 4)
4249 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4251 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4252 (match_operand:SI 2 "const_int_operand" "i,i"))
4253 (match_operand:SI 3 "mask_operand" "T,T"))
4255 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4256 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4257 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
4259 {rlinm.|rlwinm.} %0,%1,%h2,%m3,%M3
4261 [(set_attr "type" "delayed_compare")
4262 (set_attr "length" "4,8")])
4265 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4267 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4268 (match_operand:SI 2 "const_int_operand" ""))
4269 (match_operand:SI 3 "mask_operand" ""))
4271 (set (match_operand:SI 0 "gpc_reg_operand" "")
4272 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4273 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3]) && reload_completed"
4275 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4277 (compare:CC (match_dup 0)
4281 ;; The AIX assembler mis-handles "sri x,x,0", so write that case as
4283 (define_expand "lshrsi3"
4284 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
4285 (use (match_operand:SI 1 "gpc_reg_operand" ""))
4286 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
4291 emit_insn (gen_lshrsi3_power (operands[0], operands[1], operands[2]));
4293 emit_insn (gen_lshrsi3_no_power (operands[0], operands[1], operands[2]));
4297 (define_insn "lshrsi3_power"
4298 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
4299 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
4300 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i")))
4301 (clobber (match_scratch:SI 3 "=q,X,X"))]
4306 {s%A2i|s%A2wi} %0,%1,%h2")
4308 (define_insn "lshrsi3_no_power"
4309 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4310 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4311 (match_operand:SI 2 "reg_or_cint_operand" "O,ri")))]
4315 {sr|srw}%I2 %0,%1,%h2")
4318 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4319 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4320 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4322 (clobber (match_scratch:SI 3 "=r,X,r,r,X,r"))
4323 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4328 {s%A2i.|s%A2wi.} %3,%1,%h2
4332 [(set_attr "type" "delayed_compare")
4333 (set_attr "length" "4,4,4,8,8,8")])
4336 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4337 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4338 (match_operand:SI 2 "reg_or_cint_operand" ""))
4340 (clobber (match_scratch:SI 3 ""))
4341 (clobber (match_scratch:SI 4 ""))]
4342 "TARGET_POWER && reload_completed"
4343 [(parallel [(set (match_dup 3)
4344 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4345 (clobber (match_dup 4))])
4347 (compare:CC (match_dup 3)
4352 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4353 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4354 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4356 (clobber (match_scratch:SI 3 "=X,r,X,r"))]
4357 "! TARGET_POWER && ! TARGET_POWERPC64"
4360 {sr|srw}%I2. %3,%1,%h2
4363 [(set_attr "type" "delayed_compare")
4364 (set_attr "length" "4,4,8,8")])
4367 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4368 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4369 (match_operand:SI 2 "reg_or_cint_operand" ""))
4371 (clobber (match_scratch:SI 3 ""))]
4372 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4374 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4376 (compare:CC (match_dup 3)
4381 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4382 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4383 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4385 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r")
4386 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4387 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4392 {s%A2i.|s%A2wi.} %0,%1,%h2
4396 [(set_attr "type" "delayed_compare")
4397 (set_attr "length" "4,4,4,8,8,8")])
4400 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4401 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4402 (match_operand:SI 2 "reg_or_cint_operand" ""))
4404 (set (match_operand:SI 0 "gpc_reg_operand" "")
4405 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4406 (clobber (match_scratch:SI 4 ""))]
4407 "TARGET_POWER && reload_completed"
4408 [(parallel [(set (match_dup 0)
4409 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4410 (clobber (match_dup 4))])
4412 (compare:CC (match_dup 0)
4417 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4418 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4419 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4421 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4422 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4423 "! TARGET_POWER && ! TARGET_POWERPC64"
4426 {sr|srw}%I2. %0,%1,%h2
4429 [(set_attr "type" "delayed_compare")
4430 (set_attr "length" "4,4,8,8")])
4433 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4434 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4435 (match_operand:SI 2 "reg_or_cint_operand" ""))
4437 (set (match_operand:SI 0 "gpc_reg_operand" "")
4438 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4439 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4441 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4443 (compare:CC (match_dup 0)
4448 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4449 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4450 (match_operand:SI 2 "const_int_operand" "i"))
4451 (match_operand:SI 3 "mask_operand" "T")))]
4452 "includes_rshift_p (operands[2], operands[3])"
4453 "{rlinm|rlwinm} %0,%1,%s2,%m3,%M3")
4456 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4458 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4459 (match_operand:SI 2 "const_int_operand" "i,i"))
4460 (match_operand:SI 3 "mask_operand" "T,T"))
4462 (clobber (match_scratch:SI 4 "=r,r"))]
4463 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
4465 {rlinm.|rlwinm.} %4,%1,%s2,%m3,%M3
4467 [(set_attr "type" "delayed_compare")
4468 (set_attr "length" "4,8")])
4471 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4473 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4474 (match_operand:SI 2 "const_int_operand" ""))
4475 (match_operand:SI 3 "mask_operand" ""))
4477 (clobber (match_scratch:SI 4 ""))]
4478 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3]) && reload_completed"
4480 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2))
4483 (compare:CC (match_dup 4)
4488 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4490 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4491 (match_operand:SI 2 "const_int_operand" "i,i"))
4492 (match_operand:SI 3 "mask_operand" "T,T"))
4494 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4495 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4496 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
4498 {rlinm.|rlwinm.} %0,%1,%s2,%m3,%M3
4500 [(set_attr "type" "delayed_compare")
4501 (set_attr "length" "4,8")])
4504 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4506 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4507 (match_operand:SI 2 "const_int_operand" ""))
4508 (match_operand:SI 3 "mask_operand" ""))
4510 (set (match_operand:SI 0 "gpc_reg_operand" "")
4511 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4512 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3]) && reload_completed"
4514 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4516 (compare:CC (match_dup 0)
4521 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4524 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4525 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4526 "includes_rshift_p (operands[2], GEN_INT (255))"
4527 "{rlinm|rlwinm} %0,%1,%s2,0xff")
4530 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4534 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4535 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4537 (clobber (match_scratch:SI 3 "=r,r"))]
4538 "includes_rshift_p (operands[2], GEN_INT (255))"
4540 {rlinm.|rlwinm.} %3,%1,%s2,0xff
4542 [(set_attr "type" "delayed_compare")
4543 (set_attr "length" "4,8")])
4546 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4550 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4551 (match_operand:SI 2 "const_int_operand" "")) 0))
4553 (clobber (match_scratch:SI 3 ""))]
4554 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4556 (zero_extend:SI (subreg:QI
4557 (lshiftrt:SI (match_dup 1)
4560 (compare:CC (match_dup 3)
4565 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4569 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4570 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4572 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4573 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4574 "includes_rshift_p (operands[2], GEN_INT (255))"
4576 {rlinm.|rlwinm.} %0,%1,%s2,0xff
4578 [(set_attr "type" "delayed_compare")
4579 (set_attr "length" "4,8")])
4582 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4586 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4587 (match_operand:SI 2 "const_int_operand" "")) 0))
4589 (set (match_operand:SI 0 "gpc_reg_operand" "")
4590 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4591 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4593 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4595 (compare:CC (match_dup 0)
4600 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4603 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4604 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4605 "includes_rshift_p (operands[2], GEN_INT (65535))"
4606 "{rlinm|rlwinm} %0,%1,%s2,0xffff")
4609 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4613 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4614 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4616 (clobber (match_scratch:SI 3 "=r,r"))]
4617 "includes_rshift_p (operands[2], GEN_INT (65535))"
4619 {rlinm.|rlwinm.} %3,%1,%s2,0xffff
4621 [(set_attr "type" "delayed_compare")
4622 (set_attr "length" "4,8")])
4625 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4629 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4630 (match_operand:SI 2 "const_int_operand" "")) 0))
4632 (clobber (match_scratch:SI 3 ""))]
4633 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4635 (zero_extend:SI (subreg:HI
4636 (lshiftrt:SI (match_dup 1)
4639 (compare:CC (match_dup 3)
4644 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4648 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4649 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4651 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4652 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4653 "includes_rshift_p (operands[2], GEN_INT (65535))"
4655 {rlinm.|rlwinm.} %0,%1,%s2,0xffff
4657 [(set_attr "type" "delayed_compare")
4658 (set_attr "length" "4,8")])
4661 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4665 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4666 (match_operand:SI 2 "const_int_operand" "")) 0))
4668 (set (match_operand:SI 0 "gpc_reg_operand" "")
4669 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4670 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4672 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4674 (compare:CC (match_dup 0)
4679 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4681 (match_operand:SI 1 "gpc_reg_operand" "r"))
4682 (ashiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4688 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4690 (match_operand:SI 1 "gpc_reg_operand" "r"))
4691 (lshiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4697 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4699 (match_operand:SI 1 "gpc_reg_operand" "r"))
4700 (zero_extract:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4706 (define_expand "ashrsi3"
4707 [(set (match_operand:SI 0 "gpc_reg_operand" "")
4708 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4709 (match_operand:SI 2 "reg_or_cint_operand" "")))]
4714 emit_insn (gen_ashrsi3_power (operands[0], operands[1], operands[2]));
4716 emit_insn (gen_ashrsi3_no_power (operands[0], operands[1], operands[2]));
4720 (define_insn "ashrsi3_power"
4721 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4722 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4723 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
4724 (clobber (match_scratch:SI 3 "=q,X"))]
4728 {srai|srawi} %0,%1,%h2")
4730 (define_insn "ashrsi3_no_power"
4731 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4732 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4733 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4735 "{sra|sraw}%I2 %0,%1,%h2")
4738 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4739 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4740 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4742 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4743 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4747 {srai.|srawi.} %3,%1,%h2
4750 [(set_attr "type" "delayed_compare")
4751 (set_attr "length" "4,4,8,8")])
4754 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4755 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4756 (match_operand:SI 2 "reg_or_cint_operand" ""))
4758 (clobber (match_scratch:SI 3 ""))
4759 (clobber (match_scratch:SI 4 ""))]
4760 "TARGET_POWER && reload_completed"
4761 [(parallel [(set (match_dup 3)
4762 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4763 (clobber (match_dup 4))])
4765 (compare:CC (match_dup 3)
4770 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4771 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4772 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4774 (clobber (match_scratch:SI 3 "=r,r"))]
4777 {sra|sraw}%I2. %3,%1,%h2
4779 [(set_attr "type" "delayed_compare")
4780 (set_attr "length" "4,8")])
4783 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4784 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4785 (match_operand:SI 2 "reg_or_cint_operand" ""))
4787 (clobber (match_scratch:SI 3 ""))]
4788 "! TARGET_POWER && reload_completed"
4790 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4792 (compare:CC (match_dup 3)
4797 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4798 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4799 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4801 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4802 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4803 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4807 {srai.|srawi.} %0,%1,%h2
4810 [(set_attr "type" "delayed_compare")
4811 (set_attr "length" "4,4,8,8")])
4814 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4815 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4816 (match_operand:SI 2 "reg_or_cint_operand" ""))
4818 (set (match_operand:SI 0 "gpc_reg_operand" "")
4819 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4820 (clobber (match_scratch:SI 4 ""))]
4821 "TARGET_POWER && reload_completed"
4822 [(parallel [(set (match_dup 0)
4823 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4824 (clobber (match_dup 4))])
4826 (compare:CC (match_dup 0)
4831 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4832 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4833 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4835 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4836 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
4839 {sra|sraw}%I2. %0,%1,%h2
4841 [(set_attr "type" "delayed_compare")
4842 (set_attr "length" "4,8")])
4845 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4846 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4847 (match_operand:SI 2 "reg_or_cint_operand" ""))
4849 (set (match_operand:SI 0 "gpc_reg_operand" "")
4850 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
4851 "! TARGET_POWER && reload_completed"
4853 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4855 (compare:CC (match_dup 0)
4859 ;; Floating-point insns, excluding normal data motion.
4861 ;; PowerPC has a full set of single-precision floating point instructions.
4863 ;; For the POWER architecture, we pretend that we have both SFmode and
4864 ;; DFmode insns, while, in fact, all fp insns are actually done in double.
4865 ;; The only conversions we will do will be when storing to memory. In that
4866 ;; case, we will use the "frsp" instruction before storing.
4868 ;; Note that when we store into a single-precision memory location, we need to
4869 ;; use the frsp insn first. If the register being stored isn't dead, we
4870 ;; need a scratch register for the frsp. But this is difficult when the store
4871 ;; is done by reload. It is not incorrect to do the frsp on the register in
4872 ;; this case, we just lose precision that we would have otherwise gotten but
4873 ;; is not guaranteed. Perhaps this should be tightened up at some point.
4875 (define_insn "extendsfdf2"
4876 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
4877 (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4881 if (REGNO (operands[0]) == REGNO (operands[1]))
4884 return \"fmr %0,%1\";
4886 [(set_attr "type" "fp")])
4888 (define_insn "truncdfsf2"
4889 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4890 (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "f")))]
4893 [(set_attr "type" "fp")])
4895 (define_insn "aux_truncdfsf2"
4896 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4897 (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] 0))]
4898 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4900 [(set_attr "type" "fp")])
4902 (define_insn "negsf2"
4903 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4904 (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4907 [(set_attr "type" "fp")])
4909 (define_insn "abssf2"
4910 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4911 (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4914 [(set_attr "type" "fp")])
4917 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4918 (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f"))))]
4921 [(set_attr "type" "fp")])
4923 (define_expand "addsf3"
4924 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4925 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "")
4926 (match_operand:SF 2 "gpc_reg_operand" "")))]
4931 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4932 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4933 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4934 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4936 [(set_attr "type" "fp")])
4939 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4940 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4941 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4942 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4943 "{fa|fadd} %0,%1,%2"
4944 [(set_attr "type" "fp")])
4946 (define_expand "subsf3"
4947 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4948 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
4949 (match_operand:SF 2 "gpc_reg_operand" "")))]
4954 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4955 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4956 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4957 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4959 [(set_attr "type" "fp")])
4962 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4963 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4964 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4965 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4966 "{fs|fsub} %0,%1,%2"
4967 [(set_attr "type" "fp")])
4969 (define_expand "mulsf3"
4970 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4971 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "")
4972 (match_operand:SF 2 "gpc_reg_operand" "")))]
4977 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4978 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4979 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4980 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4982 [(set_attr "type" "fp")])
4985 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4986 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4987 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4988 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4989 "{fm|fmul} %0,%1,%2"
4990 [(set_attr "type" "dmul")])
4992 (define_expand "divsf3"
4993 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4994 (div:SF (match_operand:SF 1 "gpc_reg_operand" "")
4995 (match_operand:SF 2 "gpc_reg_operand" "")))]
5000 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5001 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5002 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5003 "TARGET_POWERPC && TARGET_HARD_FLOAT"
5005 [(set_attr "type" "sdiv")])
5008 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5009 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
5010 (match_operand:SF 2 "gpc_reg_operand" "f")))]
5011 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
5012 "{fd|fdiv} %0,%1,%2"
5013 [(set_attr "type" "ddiv")])
5016 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5017 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5018 (match_operand:SF 2 "gpc_reg_operand" "f"))
5019 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5020 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5021 "fmadds %0,%1,%2,%3"
5022 [(set_attr "type" "fp")])
5025 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5026 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5027 (match_operand:SF 2 "gpc_reg_operand" "f"))
5028 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5029 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5030 "{fma|fmadd} %0,%1,%2,%3"
5031 [(set_attr "type" "dmul")])
5034 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5035 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5036 (match_operand:SF 2 "gpc_reg_operand" "f"))
5037 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5038 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5039 "fmsubs %0,%1,%2,%3"
5040 [(set_attr "type" "fp")])
5043 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5044 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5045 (match_operand:SF 2 "gpc_reg_operand" "f"))
5046 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5047 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5048 "{fms|fmsub} %0,%1,%2,%3"
5049 [(set_attr "type" "dmul")])
5052 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5053 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5054 (match_operand:SF 2 "gpc_reg_operand" "f"))
5055 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5056 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5057 "fnmadds %0,%1,%2,%3"
5058 [(set_attr "type" "fp")])
5061 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5062 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5063 (match_operand:SF 2 "gpc_reg_operand" "f"))
5064 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5065 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5066 "{fnma|fnmadd} %0,%1,%2,%3"
5067 [(set_attr "type" "dmul")])
5070 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5071 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5072 (match_operand:SF 2 "gpc_reg_operand" "f"))
5073 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5074 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5075 "fnmsubs %0,%1,%2,%3"
5076 [(set_attr "type" "fp")])
5079 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5080 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5081 (match_operand:SF 2 "gpc_reg_operand" "f"))
5082 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5083 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5084 "{fnms|fnmsub} %0,%1,%2,%3"
5085 [(set_attr "type" "dmul")])
5087 (define_expand "sqrtsf2"
5088 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5089 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
5090 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
5094 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5095 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5096 "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT"
5098 [(set_attr "type" "ssqrt")])
5101 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5102 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5103 "TARGET_POWER2 && TARGET_HARD_FLOAT"
5105 [(set_attr "type" "dsqrt")])
5107 ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
5108 ;; fsel instruction and some auxiliary computations. Then we just have a
5109 ;; single DEFINE_INSN for fsel and the define_splits to make them if made by
5111 (define_expand "maxsf3"
5112 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5113 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5114 (match_operand:SF 2 "gpc_reg_operand" ""))
5117 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5118 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5120 (define_expand "minsf3"
5121 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5122 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5123 (match_operand:SF 2 "gpc_reg_operand" ""))
5126 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5127 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5130 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5131 (match_operator:SF 3 "min_max_operator"
5132 [(match_operand:SF 1 "gpc_reg_operand" "")
5133 (match_operand:SF 2 "gpc_reg_operand" "")]))]
5134 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5137 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5138 operands[1], operands[2]);
5142 (define_expand "movsfcc"
5143 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5144 (if_then_else:SF (match_operand 1 "comparison_operator" "")
5145 (match_operand:SF 2 "gpc_reg_operand" "")
5146 (match_operand:SF 3 "gpc_reg_operand" "")))]
5147 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5150 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5156 (define_insn "*fselsfsf4"
5157 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5158 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5159 (match_operand:SF 4 "zero_fp_constant" "F"))
5160 (match_operand:SF 2 "gpc_reg_operand" "f")
5161 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5162 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5164 [(set_attr "type" "fp")])
5166 (define_insn "*fseldfsf4"
5167 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5168 (if_then_else:SF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5169 (match_operand:DF 4 "zero_fp_constant" "F"))
5170 (match_operand:SF 2 "gpc_reg_operand" "f")
5171 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5172 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5174 [(set_attr "type" "fp")])
5176 (define_insn "negdf2"
5177 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5178 (neg:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5181 [(set_attr "type" "fp")])
5183 (define_insn "absdf2"
5184 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5185 (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5188 [(set_attr "type" "fp")])
5191 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5192 (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f"))))]
5195 [(set_attr "type" "fp")])
5197 (define_insn "adddf3"
5198 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5199 (plus:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5200 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5202 "{fa|fadd} %0,%1,%2"
5203 [(set_attr "type" "fp")])
5205 (define_insn "subdf3"
5206 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5207 (minus:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5208 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5210 "{fs|fsub} %0,%1,%2"
5211 [(set_attr "type" "fp")])
5213 (define_insn "muldf3"
5214 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5215 (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5216 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5218 "{fm|fmul} %0,%1,%2"
5219 [(set_attr "type" "dmul")])
5221 (define_insn "divdf3"
5222 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5223 (div:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5224 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5226 "{fd|fdiv} %0,%1,%2"
5227 [(set_attr "type" "ddiv")])
5230 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5231 (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5232 (match_operand:DF 2 "gpc_reg_operand" "f"))
5233 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5234 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5235 "{fma|fmadd} %0,%1,%2,%3"
5236 [(set_attr "type" "dmul")])
5239 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5240 (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5241 (match_operand:DF 2 "gpc_reg_operand" "f"))
5242 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5243 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5244 "{fms|fmsub} %0,%1,%2,%3"
5245 [(set_attr "type" "dmul")])
5248 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5249 (neg:DF (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5250 (match_operand:DF 2 "gpc_reg_operand" "f"))
5251 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5252 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5253 "{fnma|fnmadd} %0,%1,%2,%3"
5254 [(set_attr "type" "dmul")])
5257 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5258 (neg:DF (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5259 (match_operand:DF 2 "gpc_reg_operand" "f"))
5260 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5261 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5262 "{fnms|fnmsub} %0,%1,%2,%3"
5263 [(set_attr "type" "dmul")])
5265 (define_insn "sqrtdf2"
5266 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5267 (sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5268 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
5270 [(set_attr "type" "dsqrt")])
5272 ;; The conditional move instructions allow us to perform max and min
5273 ;; operations even when
5275 (define_expand "maxdf3"
5276 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5277 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5278 (match_operand:DF 2 "gpc_reg_operand" ""))
5281 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5282 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5284 (define_expand "mindf3"
5285 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5286 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5287 (match_operand:DF 2 "gpc_reg_operand" ""))
5290 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5291 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5294 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5295 (match_operator:DF 3 "min_max_operator"
5296 [(match_operand:DF 1 "gpc_reg_operand" "")
5297 (match_operand:DF 2 "gpc_reg_operand" "")]))]
5298 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5301 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5302 operands[1], operands[2]);
5306 (define_expand "movdfcc"
5307 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5308 (if_then_else:DF (match_operand 1 "comparison_operator" "")
5309 (match_operand:DF 2 "gpc_reg_operand" "")
5310 (match_operand:DF 3 "gpc_reg_operand" "")))]
5311 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5314 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5320 (define_insn "*fseldfdf4"
5321 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5322 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5323 (match_operand:DF 4 "zero_fp_constant" "F"))
5324 (match_operand:DF 2 "gpc_reg_operand" "f")
5325 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5326 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5328 [(set_attr "type" "fp")])
5330 (define_insn "*fselsfdf4"
5331 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5332 (if_then_else:DF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5333 (match_operand:SF 4 "zero_fp_constant" "F"))
5334 (match_operand:DF 2 "gpc_reg_operand" "f")
5335 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5338 [(set_attr "type" "fp")])
5340 ;; Conversions to and from floating-point.
5342 ; For each of these conversions, there is a define_expand, a define_insn
5343 ; with a '#' template, and a define_split (with C code). The idea is
5344 ; to allow constant folding with the template of the define_insn,
5345 ; then to have the insns split later (between sched1 and final).
5347 (define_expand "floatsidf2"
5348 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5349 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5352 (clobber (match_dup 4))
5353 (clobber (match_dup 5))
5354 (clobber (match_dup 6))])]
5358 if (TARGET_POWERPC64)
5360 rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5361 rtx t1 = gen_reg_rtx (DImode);
5362 rtx t2 = gen_reg_rtx (DImode);
5363 emit_insn (gen_floatsidf_ppc64 (operands[0], operands[1], mem, t1, t2));
5367 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5368 operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503601774854144\", DFmode));
5369 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5370 operands[5] = gen_reg_rtx (DFmode);
5371 operands[6] = gen_reg_rtx (SImode);
5374 (define_insn "*floatsidf2_internal"
5375 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5376 (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5377 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5378 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5379 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5380 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))
5381 (clobber (match_operand:SI 6 "gpc_reg_operand" "=r"))]
5382 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5384 [(set_attr "length" "24")])
5387 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5388 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5389 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5390 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5391 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5392 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5393 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5394 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5395 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5396 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5397 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5398 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5399 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5400 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5401 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5404 rtx lowword, highword;
5405 if (GET_CODE (operands[4]) != MEM)
5407 highword = XEXP (operands[4], 0);
5408 lowword = plus_constant (highword, 4);
5409 if (! WORDS_BIG_ENDIAN)
5412 tmp = highword; highword = lowword; lowword = tmp;
5415 emit_insn (gen_xorsi3 (operands[6], operands[1],
5416 GEN_INT (~ (HOST_WIDE_INT) 0x7fffffff)));
5417 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[6]);
5418 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5419 emit_move_insn (operands[5], operands[4]);
5420 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5424 (define_expand "floatunssidf2"
5425 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5426 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5429 (clobber (match_dup 4))
5430 (clobber (match_dup 5))])]
5434 if (TARGET_POWERPC64)
5436 rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5437 rtx t1 = gen_reg_rtx (DImode);
5438 rtx t2 = gen_reg_rtx (DImode);
5439 emit_insn (gen_floatunssidf_ppc64 (operands[0], operands[1], mem,
5444 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5445 operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503599627370496\", DFmode));
5446 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5447 operands[5] = gen_reg_rtx (DFmode);
5450 (define_insn "*floatunssidf2_internal"
5451 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5452 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5453 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5454 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5455 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5456 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))]
5457 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5459 [(set_attr "length" "20")])
5462 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5463 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5464 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5465 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5466 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5467 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5468 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5469 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5470 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5471 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5472 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5473 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5474 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5477 rtx lowword, highword;
5478 if (GET_CODE (operands[4]) != MEM)
5480 highword = XEXP (operands[4], 0);
5481 lowword = plus_constant (highword, 4);
5482 if (! WORDS_BIG_ENDIAN)
5485 tmp = highword; highword = lowword; lowword = tmp;
5488 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[1]);
5489 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5490 emit_move_insn (operands[5], operands[4]);
5491 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5495 (define_expand "fix_truncdfsi2"
5496 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
5497 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5498 (clobber (match_dup 2))
5499 (clobber (match_dup 3))])]
5500 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5503 operands[2] = gen_reg_rtx (DImode);
5504 operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5507 (define_insn "*fix_truncdfsi2_internal"
5508 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5509 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
5510 (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
5511 (clobber (match_operand:DI 3 "memory_operand" "=o"))]
5512 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5514 [(set_attr "length" "16")])
5517 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5518 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5519 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5520 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5521 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5522 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5523 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5524 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5525 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5529 if (GET_CODE (operands[3]) != MEM)
5531 lowword = XEXP (operands[3], 0);
5532 if (WORDS_BIG_ENDIAN)
5533 lowword = plus_constant (lowword, 4);
5535 emit_insn (gen_fctiwz (operands[2], operands[1]));
5536 emit_move_insn (operands[3], operands[2]);
5537 emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword));
5541 ; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] 10))
5542 ; rather than (set (subreg:SI (reg)) (fix:SI ...))
5543 ; because the first makes it clear that operand 0 is not live
5544 ; before the instruction.
5545 (define_insn "fctiwz"
5546 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
5547 (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] 10))]
5548 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5549 "{fcirz|fctiwz} %0,%1"
5550 [(set_attr "type" "fp")])
5552 (define_insn "floatdidf2"
5553 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5554 (float:DF (match_operand:DI 1 "gpc_reg_operand" "*f")))]
5555 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5557 [(set_attr "type" "fp")])
5559 (define_insn_and_split "floatsidf_ppc64"
5560 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5561 (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5562 (clobber (match_operand:DI 2 "memory_operand" "=o"))
5563 (clobber (match_operand:DI 3 "gpc_reg_operand" "=r"))
5564 (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))]
5565 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5568 [(set (match_dup 3) (sign_extend:DI (match_dup 1)))
5569 (set (match_dup 2) (match_dup 3))
5570 (set (match_dup 4) (match_dup 2))
5571 (set (match_dup 0) (float:DF (match_dup 4)))]
5574 (define_insn_and_split "floatunssidf_ppc64"
5575 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5576 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5577 (clobber (match_operand:DI 2 "memory_operand" "=o"))
5578 (clobber (match_operand:DI 3 "gpc_reg_operand" "=r"))
5579 (clobber (match_operand:DI 4 "gpc_reg_operand" "=f"))]
5580 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5583 [(set (match_dup 3) (zero_extend:DI (match_dup 1)))
5584 (set (match_dup 2) (match_dup 3))
5585 (set (match_dup 4) (match_dup 2))
5586 (set (match_dup 0) (float:DF (match_dup 4)))]
5589 (define_insn "fix_truncdfdi2"
5590 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
5591 (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
5592 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5594 [(set_attr "type" "fp")])
5596 ;; This only is safe if rounding mode set appropriately.
5597 (define_insn_and_split "floatdisf2"
5598 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5599 (float:SF (match_operand:DI 1 "gpc_reg_operand" "*f")))
5600 (clobber (match_scratch:DF 2 "=f"))]
5601 "TARGET_POWERPC64 && TARGET_HARD_FLOAT && flag_unsafe_math_optimizations"
5603 "&& reload_completed"
5605 (float:DF (match_dup 1)))
5607 (float_truncate:SF (match_dup 2)))]
5610 ;; Define the DImode operations that can be done in a small number
5611 ;; of instructions. The & constraints are to prevent the register
5612 ;; allocator from allocating registers that overlap with the inputs
5613 ;; (for example, having an input in 7,8 and an output in 6,7). We
5614 ;; also allow for the output being the same as one of the inputs.
5616 (define_insn "*adddi3_noppc64"
5617 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r")
5618 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,0,0")
5619 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")))]
5620 "! TARGET_POWERPC64"
5623 if (WORDS_BIG_ENDIAN)
5624 return (GET_CODE (operands[2])) != CONST_INT
5625 ? \"{a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2\"
5626 : \"{ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1\";
5628 return (GET_CODE (operands[2])) != CONST_INT
5629 ? \"{a|addc} %0,%1,%2\;{ae|adde} %L0,%L1,%L2\"
5630 : \"{ai|addic} %0,%1,%2\;{a%G2e|add%G2e} %L0,%L1\";
5632 [(set_attr "length" "8")])
5634 (define_insn "*subdi3_noppc64"
5635 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r")
5636 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I,0,r,I")
5637 (match_operand:DI 2 "gpc_reg_operand" "r,r,r,0,0")))]
5638 "! TARGET_POWERPC64"
5641 if (WORDS_BIG_ENDIAN)
5642 return (GET_CODE (operands[1]) != CONST_INT)
5643 ? \"{sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1\"
5644 : \"{sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2\";
5646 return (GET_CODE (operands[1]) != CONST_INT)
5647 ? \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\"
5648 : \"{sfi|subfic} %0,%2,%1\;{sf%G1e|subf%G1e} %L0,%L2\";
5650 [(set_attr "length" "8")])
5652 (define_insn "*negdi2_noppc64"
5653 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
5654 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))]
5655 "! TARGET_POWERPC64"
5658 return (WORDS_BIG_ENDIAN)
5659 ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\"
5660 : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\";
5662 [(set_attr "length" "8")])
5664 (define_expand "mulsidi3"
5665 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5666 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5667 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5668 "! TARGET_POWERPC64"
5671 if (! TARGET_POWER && ! TARGET_POWERPC)
5673 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
5674 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
5675 emit_insn (gen_mull_call ());
5676 if (WORDS_BIG_ENDIAN)
5677 emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
5680 emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
5681 gen_rtx_REG (SImode, 3));
5682 emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
5683 gen_rtx_REG (SImode, 4));
5687 else if (TARGET_POWER)
5689 emit_insn (gen_mulsidi3_mq (operands[0], operands[1], operands[2]));
5694 (define_insn "mulsidi3_mq"
5695 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
5696 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5697 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
5698 (clobber (match_scratch:SI 3 "=q"))]
5700 "mul %0,%1,%2\;mfmq %L0"
5701 [(set_attr "type" "imul")
5702 (set_attr "length" "8")])
5704 (define_insn "*mulsidi3_no_mq"
5705 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5706 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5707 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
5708 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
5711 return (WORDS_BIG_ENDIAN)
5712 ? \"mulhw %0,%1,%2\;mullw %L0,%1,%2\"
5713 : \"mulhw %L0,%1,%2\;mullw %0,%1,%2\";
5715 [(set_attr "type" "imul")
5716 (set_attr "length" "8")])
5719 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5720 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5721 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5722 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
5725 (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
5726 (sign_extend:DI (match_dup 2)))
5729 (mult:SI (match_dup 1)
5733 int endian = (WORDS_BIG_ENDIAN == 0);
5734 operands[3] = operand_subword (operands[0], endian, 0, DImode);
5735 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
5738 (define_expand "umulsidi3"
5739 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5740 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5741 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5742 "TARGET_POWERPC && ! TARGET_POWERPC64"
5747 emit_insn (gen_umulsidi3_mq (operands[0], operands[1], operands[2]));
5752 (define_insn "umulsidi3_mq"
5753 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5754 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5755 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
5756 (clobber (match_scratch:SI 3 "=q"))]
5757 "TARGET_POWERPC && TARGET_POWER"
5760 return (WORDS_BIG_ENDIAN)
5761 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
5762 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
5764 [(set_attr "type" "imul")
5765 (set_attr "length" "8")])
5767 (define_insn "*umulsidi3_no_mq"
5768 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5769 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5770 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
5771 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
5774 return (WORDS_BIG_ENDIAN)
5775 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
5776 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
5778 [(set_attr "type" "imul")
5779 (set_attr "length" "8")])
5782 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5783 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5784 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5785 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
5788 (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
5789 (zero_extend:DI (match_dup 2)))
5792 (mult:SI (match_dup 1)
5796 int endian = (WORDS_BIG_ENDIAN == 0);
5797 operands[3] = operand_subword (operands[0], endian, 0, DImode);
5798 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
5801 (define_expand "smulsi3_highpart"
5802 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5804 (lshiftrt:DI (mult:DI (sign_extend:DI
5805 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5807 (match_operand:SI 2 "gpc_reg_operand" "r")))
5812 if (! TARGET_POWER && ! TARGET_POWERPC)
5814 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
5815 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
5816 emit_insn (gen_mulh_call ());
5817 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
5820 else if (TARGET_POWER)
5822 emit_insn (gen_smulsi3_highpart_mq (operands[0], operands[1], operands[2]));
5827 (define_insn "smulsi3_highpart_mq"
5828 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5830 (lshiftrt:DI (mult:DI (sign_extend:DI
5831 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5833 (match_operand:SI 2 "gpc_reg_operand" "r")))
5835 (clobber (match_scratch:SI 3 "=q"))]
5838 [(set_attr "type" "imul")])
5840 (define_insn "*smulsi3_highpart_no_mq"
5841 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5843 (lshiftrt:DI (mult:DI (sign_extend:DI
5844 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5846 (match_operand:SI 2 "gpc_reg_operand" "r")))
5848 "TARGET_POWERPC && ! TARGET_POWER"
5850 [(set_attr "type" "imul")])
5852 (define_expand "umulsi3_highpart"
5853 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5855 (lshiftrt:DI (mult:DI (zero_extend:DI
5856 (match_operand:SI 1 "gpc_reg_operand" ""))
5858 (match_operand:SI 2 "gpc_reg_operand" "")))
5865 emit_insn (gen_umulsi3_highpart_mq (operands[0], operands[1], operands[2]));
5870 (define_insn "umulsi3_highpart_mq"
5871 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5873 (lshiftrt:DI (mult:DI (zero_extend:DI
5874 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5876 (match_operand:SI 2 "gpc_reg_operand" "r")))
5878 (clobber (match_scratch:SI 3 "=q"))]
5879 "TARGET_POWERPC && TARGET_POWER"
5881 [(set_attr "type" "imul")])
5883 (define_insn "*umulsi3_highpart_no_mq"
5884 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5886 (lshiftrt:DI (mult:DI (zero_extend:DI
5887 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5889 (match_operand:SI 2 "gpc_reg_operand" "r")))
5891 "TARGET_POWERPC && ! TARGET_POWER"
5893 [(set_attr "type" "imul")])
5895 ;; If operands 0 and 2 are in the same register, we have a problem. But
5896 ;; operands 0 and 1 (the usual case) can be in the same register. That's
5897 ;; why we have the strange constraints below.
5898 (define_insn "ashldi3_power"
5899 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
5900 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
5901 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
5902 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
5905 {sli|slwi} %0,%L1,%h2\;{cal %L0,0(0)|li %L0,0}
5906 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
5907 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
5908 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2"
5909 [(set_attr "length" "8")])
5911 (define_insn "lshrdi3_power"
5912 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
5913 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
5914 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
5915 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
5918 {s%A2i|s%A2wi} %L0,%1,%h2\;{cal %0,0(0)|li %0,0}
5919 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
5920 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
5921 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2"
5922 [(set_attr "length" "8")])
5924 ;; Shift by a variable amount is too complex to be worth open-coding. We
5925 ;; just handle shifts by constants.
5926 (define_insn "ashrdi3_power"
5927 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
5928 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
5929 (match_operand:SI 2 "const_int_operand" "M,i")))
5930 (clobber (match_scratch:SI 3 "=X,q"))]
5933 {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
5934 sraiq %0,%1,%h2\;srliq %L0,%L1,%h2"
5935 [(set_attr "length" "8")])
5937 (define_insn "ashrdi3_no_power"
5938 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r")
5939 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
5940 (match_operand:SI 2 "const_int_operand" "M,i")))]
5941 "TARGET_32BIT && !TARGET_POWER"
5943 {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
5944 {sri|srwi} %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;{srai|srawi} %0,%1,%h2"
5945 [(set_attr "length" "8,12")])
5947 ;; PowerPC64 DImode operations.
5949 (define_expand "adddi3"
5950 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5951 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
5952 (match_operand:DI 2 "reg_or_add_cint64_operand" "")))]
5956 if (! TARGET_POWERPC64)
5958 if (non_short_cint_operand (operands[2], DImode))
5962 if (GET_CODE (operands[2]) == CONST_INT
5963 && ! add_operand (operands[2], DImode))
5965 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
5966 ? operands[0] : gen_reg_rtx (DImode));
5968 HOST_WIDE_INT val = INTVAL (operands[2]);
5969 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
5970 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
5972 if (!CONST_OK_FOR_LETTER_P (rest, 'L'))
5975 /* The ordering here is important for the prolog expander.
5976 When space is allocated from the stack, adding 'low' first may
5977 produce a temporary deallocation (which would be bad). */
5978 emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest)));
5979 emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
5984 ;; Discourage ai/addic because of carry but provide it in an alternative
5985 ;; allowing register zero as source.
5987 (define_insn "*adddi3_internal1"
5988 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r")
5989 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b")
5990 (match_operand:DI 2 "add_operand" "r,I,I,L")))]
5998 (define_insn "*adddi3_internal2"
5999 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
6000 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
6001 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
6003 (clobber (match_scratch:DI 3 "=r,r,r,r"))]
6010 [(set_attr "type" "compare")
6011 (set_attr "length" "4,4,8,8")])
6014 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6015 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6016 (match_operand:DI 2 "reg_or_short_operand" ""))
6018 (clobber (match_scratch:DI 3 ""))]
6019 "TARGET_POWERPC64 && reload_completed"
6021 (plus:DI (match_dup 1) (match_dup 2)))
6023 (compare:CC (match_dup 3)
6027 (define_insn "*adddi3_internal3"
6028 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
6029 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
6030 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
6032 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
6033 (plus:DI (match_dup 1) (match_dup 2)))]
6040 [(set_attr "type" "compare")
6041 (set_attr "length" "4,4,8,8")])
6044 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6045 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6046 (match_operand:DI 2 "reg_or_short_operand" ""))
6048 (set (match_operand:DI 0 "gpc_reg_operand" "")
6049 (plus:DI (match_dup 1) (match_dup 2)))]
6050 "TARGET_POWERPC64 && reload_completed"
6052 (plus:DI (match_dup 1) (match_dup 2)))
6054 (compare:CC (match_dup 0)
6058 ;; Split an add that we can't do in one insn into two insns, each of which
6059 ;; does one 16-bit part. This is used by combine. Note that the low-order
6060 ;; add should be last in case the result gets used in an address.
6063 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6064 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6065 (match_operand:DI 2 "non_add_cint_operand" "")))]
6067 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
6068 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
6071 HOST_WIDE_INT val = INTVAL (operands[2]);
6072 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
6073 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
6075 operands[4] = GEN_INT (low);
6076 if (CONST_OK_FOR_LETTER_P (rest, 'L'))
6077 operands[3] = GEN_INT (rest);
6078 else if (! no_new_pseudos)
6080 operands[3] = gen_reg_rtx (DImode);
6081 emit_move_insn (operands[3], operands[2]);
6082 emit_insn (gen_adddi3 (operands[0], operands[1], operands[3]));
6089 (define_insn "one_cmpldi2"
6090 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6091 (not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6096 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6097 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6099 (clobber (match_scratch:DI 2 "=r,r"))]
6104 [(set_attr "type" "compare")
6105 (set_attr "length" "4,8")])
6108 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6109 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6111 (clobber (match_scratch:DI 2 ""))]
6112 "TARGET_POWERPC64 && reload_completed"
6114 (not:DI (match_dup 1)))
6116 (compare:CC (match_dup 2)
6121 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
6122 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6124 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6125 (not:DI (match_dup 1)))]
6130 [(set_attr "type" "compare")
6131 (set_attr "length" "4,8")])
6134 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
6135 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6137 (set (match_operand:DI 0 "gpc_reg_operand" "")
6138 (not:DI (match_dup 1)))]
6139 "TARGET_POWERPC64 && reload_completed"
6141 (not:DI (match_dup 1)))
6143 (compare:CC (match_dup 0)
6148 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6149 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I")
6150 (match_operand:DI 2 "gpc_reg_operand" "r,r")))]
6157 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6158 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6159 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6161 (clobber (match_scratch:DI 3 "=r,r"))]
6166 [(set_attr "type" "compare")
6167 (set_attr "length" "4,8")])
6170 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6171 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6172 (match_operand:DI 2 "gpc_reg_operand" ""))
6174 (clobber (match_scratch:DI 3 ""))]
6175 "TARGET_POWERPC64 && reload_completed"
6177 (minus:DI (match_dup 1) (match_dup 2)))
6179 (compare:CC (match_dup 3)
6184 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6185 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6186 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6188 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6189 (minus:DI (match_dup 1) (match_dup 2)))]
6194 [(set_attr "type" "compare")
6195 (set_attr "length" "4,8")])
6198 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6199 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6200 (match_operand:DI 2 "gpc_reg_operand" ""))
6202 (set (match_operand:DI 0 "gpc_reg_operand" "")
6203 (minus:DI (match_dup 1) (match_dup 2)))]
6204 "TARGET_POWERPC64 && reload_completed"
6206 (minus:DI (match_dup 1) (match_dup 2)))
6208 (compare:CC (match_dup 0)
6212 (define_expand "subdi3"
6213 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6214 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "")
6215 (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))]
6219 if (GET_CODE (operands[2]) == CONST_INT)
6221 emit_insn (gen_adddi3 (operands[0], operands[1],
6222 negate_rtx (DImode, operands[2])));
6227 (define_insn_and_split "absdi2"
6228 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6229 (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
6230 (clobber (match_scratch:DI 2 "=&r,&r"))]
6233 "&& reload_completed"
6234 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6235 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6236 (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
6239 (define_insn_and_split "*nabsdi2"
6240 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6241 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
6242 (clobber (match_scratch:DI 2 "=&r,&r"))]
6245 "&& reload_completed"
6246 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6247 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6248 (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))]
6251 (define_expand "negdi2"
6252 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6253 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))]
6258 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6259 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6264 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6265 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6267 (clobber (match_scratch:DI 2 "=r,r"))]
6272 [(set_attr "type" "compare")
6273 (set_attr "length" "4,8")])
6276 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6277 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6279 (clobber (match_scratch:DI 2 ""))]
6280 "TARGET_POWERPC64 && reload_completed"
6282 (neg:DI (match_dup 1)))
6284 (compare:CC (match_dup 2)
6289 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
6290 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6292 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6293 (neg:DI (match_dup 1)))]
6298 [(set_attr "type" "compare")
6299 (set_attr "length" "4,8")])
6302 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
6303 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6305 (set (match_operand:DI 0 "gpc_reg_operand" "")
6306 (neg:DI (match_dup 1)))]
6307 "TARGET_POWERPC64 && reload_completed"
6309 (neg:DI (match_dup 1)))
6311 (compare:CC (match_dup 0)
6315 (define_insn "ffsdi2"
6316 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6317 (ffs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6319 "neg %0,%1\;and %0,%0,%1\;cntlzd %0,%0\;subfic %0,%0,64"
6320 [(set_attr "length" "16")])
6322 (define_insn "muldi3"
6323 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6324 (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
6325 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6328 [(set_attr "type" "lmul")])
6330 (define_insn "smuldi3_highpart"
6331 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6333 (lshiftrt:TI (mult:TI (sign_extend:TI
6334 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6336 (match_operand:DI 2 "gpc_reg_operand" "r")))
6340 [(set_attr "type" "lmul")])
6342 (define_insn "umuldi3_highpart"
6343 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6345 (lshiftrt:TI (mult:TI (zero_extend:TI
6346 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6348 (match_operand:DI 2 "gpc_reg_operand" "r")))
6352 [(set_attr "type" "lmul")])
6354 (define_expand "divdi3"
6355 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6356 (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6357 (match_operand:DI 2 "reg_or_cint_operand" "")))]
6361 if (GET_CODE (operands[2]) == CONST_INT
6362 && INTVAL (operands[2]) > 0
6363 && exact_log2 (INTVAL (operands[2])) >= 0)
6366 operands[2] = force_reg (DImode, operands[2]);
6369 (define_expand "moddi3"
6370 [(use (match_operand:DI 0 "gpc_reg_operand" ""))
6371 (use (match_operand:DI 1 "gpc_reg_operand" ""))
6372 (use (match_operand:DI 2 "reg_or_cint_operand" ""))]
6380 if (GET_CODE (operands[2]) != CONST_INT
6381 || INTVAL (operands[2]) <= 0
6382 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
6385 temp1 = gen_reg_rtx (DImode);
6386 temp2 = gen_reg_rtx (DImode);
6388 emit_insn (gen_divdi3 (temp1, operands[1], operands[2]));
6389 emit_insn (gen_ashldi3 (temp2, temp1, GEN_INT (i)));
6390 emit_insn (gen_subdi3 (operands[0], operands[1], temp2));
6395 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6396 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6397 (match_operand:DI 2 "exact_log2_cint_operand" "N")))]
6399 "sradi %0,%1,%p2\;addze %0,%0"
6400 [(set_attr "length" "8")])
6403 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6404 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6405 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6407 (clobber (match_scratch:DI 3 "=r,r"))]
6410 sradi %3,%1,%p2\;addze. %3,%3
6412 [(set_attr "type" "compare")
6413 (set_attr "length" "8,12")])
6416 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6417 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6418 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6420 (clobber (match_scratch:DI 3 ""))]
6421 "TARGET_POWERPC64 && reload_completed"
6423 (div:DI (match_dup 1) (match_dup 2)))
6425 (compare:CC (match_dup 3)
6430 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6431 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6432 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6434 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6435 (div:DI (match_dup 1) (match_dup 2)))]
6438 sradi %0,%1,%p2\;addze. %0,%0
6440 [(set_attr "type" "compare")
6441 (set_attr "length" "8,12")])
6444 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6445 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6446 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6448 (set (match_operand:DI 0 "gpc_reg_operand" "")
6449 (div:DI (match_dup 1) (match_dup 2)))]
6450 "TARGET_POWERPC64 && reload_completed"
6452 (div:DI (match_dup 1) (match_dup 2)))
6454 (compare:CC (match_dup 0)
6459 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6460 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6461 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6464 [(set_attr "type" "ldiv")])
6466 (define_insn "udivdi3"
6467 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6468 (udiv:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6469 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6472 [(set_attr "type" "ldiv")])
6474 (define_insn "rotldi3"
6475 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6476 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6477 (match_operand:DI 2 "reg_or_cint_operand" "ri")))]
6479 "rld%I2cl %0,%1,%H2,0")
6481 (define_insn "*rotldi3_internal2"
6482 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6483 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6484 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6486 (clobber (match_scratch:DI 3 "=r,r"))]
6489 rld%I2cl. %3,%1,%H2,0
6491 [(set_attr "type" "delayed_compare")
6492 (set_attr "length" "4,8")])
6495 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6496 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6497 (match_operand:DI 2 "reg_or_cint_operand" ""))
6499 (clobber (match_scratch:DI 3 ""))]
6500 "TARGET_POWERPC64 && reload_completed"
6502 (rotate:DI (match_dup 1) (match_dup 2)))
6504 (compare:CC (match_dup 3)
6508 (define_insn "*rotldi3_internal3"
6509 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6510 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6511 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6513 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6514 (rotate:DI (match_dup 1) (match_dup 2)))]
6517 rld%I2cl. %0,%1,%H2,0
6519 [(set_attr "type" "delayed_compare")
6520 (set_attr "length" "4,8")])
6523 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6524 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6525 (match_operand:DI 2 "reg_or_cint_operand" ""))
6527 (set (match_operand:DI 0 "gpc_reg_operand" "")
6528 (rotate:DI (match_dup 1) (match_dup 2)))]
6529 "TARGET_POWERPC64 && reload_completed"
6531 (rotate:DI (match_dup 1) (match_dup 2)))
6533 (compare:CC (match_dup 0)
6537 (define_insn "*rotldi3_internal4"
6538 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6539 (and:DI (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6540 (match_operand:DI 2 "reg_or_cint_operand" "ri"))
6541 (match_operand:DI 3 "mask64_operand" "S")))]
6543 "rld%I2c%B3 %0,%1,%H2,%S3")
6545 (define_insn "*rotldi3_internal5"
6546 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6548 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6549 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6550 (match_operand:DI 3 "mask64_operand" "S,S"))
6552 (clobber (match_scratch:DI 4 "=r,r"))]
6555 rld%I2c%B3. %4,%1,%H2,%S3
6557 [(set_attr "type" "delayed_compare")
6558 (set_attr "length" "4,8")])
6561 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6563 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6564 (match_operand:DI 2 "reg_or_cint_operand" ""))
6565 (match_operand:DI 3 "mask64_operand" ""))
6567 (clobber (match_scratch:DI 4 ""))]
6568 "TARGET_POWERPC64 && reload_completed"
6570 (and:DI (rotate:DI (match_dup 1)
6574 (compare:CC (match_dup 4)
6578 (define_insn "*rotldi3_internal6"
6579 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6581 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6582 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6583 (match_operand:DI 3 "mask64_operand" "S,S"))
6585 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6586 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6589 rld%I2c%B3. %0,%1,%H2,%S3
6591 [(set_attr "type" "delayed_compare")
6592 (set_attr "length" "4,8")])
6595 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6597 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6598 (match_operand:DI 2 "reg_or_cint_operand" ""))
6599 (match_operand:DI 3 "mask64_operand" ""))
6601 (set (match_operand:DI 0 "gpc_reg_operand" "")
6602 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6603 "TARGET_POWERPC64 && reload_completed"
6605 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
6607 (compare:CC (match_dup 0)
6611 (define_insn "*rotldi3_internal7"
6612 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6615 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6616 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6618 "rld%I2cl %0,%1,%H2,56")
6620 (define_insn "*rotldi3_internal8"
6621 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6622 (compare:CC (zero_extend:DI
6624 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6625 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6627 (clobber (match_scratch:DI 3 "=r,r"))]
6630 rld%I2cl. %3,%1,%H2,56
6632 [(set_attr "type" "delayed_compare")
6633 (set_attr "length" "4,8")])
6636 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6637 (compare:CC (zero_extend:DI
6639 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6640 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6642 (clobber (match_scratch:DI 3 ""))]
6643 "TARGET_POWERPC64 && reload_completed"
6645 (zero_extend:DI (subreg:QI
6646 (rotate:DI (match_dup 1)
6649 (compare:CC (match_dup 3)
6653 (define_insn "*rotldi3_internal9"
6654 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6655 (compare:CC (zero_extend:DI
6657 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6658 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6660 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6661 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6664 rld%I2cl. %0,%1,%H2,56
6666 [(set_attr "type" "delayed_compare")
6667 (set_attr "length" "4,8")])
6670 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6671 (compare:CC (zero_extend:DI
6673 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6674 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6676 (set (match_operand:DI 0 "gpc_reg_operand" "")
6677 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6678 "TARGET_POWERPC64 && reload_completed"
6680 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6682 (compare:CC (match_dup 0)
6686 (define_insn "*rotldi3_internal10"
6687 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6690 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6691 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6693 "rld%I2cl %0,%1,%H2,48")
6695 (define_insn "*rotldi3_internal11"
6696 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6697 (compare:CC (zero_extend:DI
6699 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6700 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6702 (clobber (match_scratch:DI 3 "=r,r"))]
6705 rld%I2cl. %3,%1,%H2,48
6707 [(set_attr "type" "delayed_compare")
6708 (set_attr "length" "4,8")])
6711 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6712 (compare:CC (zero_extend:DI
6714 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6715 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6717 (clobber (match_scratch:DI 3 ""))]
6718 "TARGET_POWERPC64 && reload_completed"
6720 (zero_extend:DI (subreg:HI
6721 (rotate:DI (match_dup 1)
6724 (compare:CC (match_dup 3)
6728 (define_insn "*rotldi3_internal12"
6729 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6730 (compare:CC (zero_extend:DI
6732 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6733 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6735 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6736 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6739 rld%I2cl. %0,%1,%H2,48
6741 [(set_attr "type" "delayed_compare")
6742 (set_attr "length" "4,8")])
6745 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6746 (compare:CC (zero_extend:DI
6748 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6749 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6751 (set (match_operand:DI 0 "gpc_reg_operand" "")
6752 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6753 "TARGET_POWERPC64 && reload_completed"
6755 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6757 (compare:CC (match_dup 0)
6761 (define_insn "*rotldi3_internal13"
6762 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6765 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6766 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6768 "rld%I2cl %0,%1,%H2,32")
6770 (define_insn "*rotldi3_internal14"
6771 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6772 (compare:CC (zero_extend:DI
6774 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6775 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6777 (clobber (match_scratch:DI 3 "=r,r"))]
6780 rld%I2cl. %3,%1,%H2,32
6782 [(set_attr "type" "delayed_compare")
6783 (set_attr "length" "4,8")])
6786 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6787 (compare:CC (zero_extend:DI
6789 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6790 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6792 (clobber (match_scratch:DI 3 ""))]
6793 "TARGET_POWERPC64 && reload_completed"
6795 (zero_extend:DI (subreg:SI
6796 (rotate:DI (match_dup 1)
6799 (compare:CC (match_dup 3)
6803 (define_insn "*rotldi3_internal15"
6804 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6805 (compare:CC (zero_extend:DI
6807 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6808 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6810 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6811 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6814 rld%I2cl. %0,%1,%H2,32
6816 [(set_attr "type" "delayed_compare")
6817 (set_attr "length" "4,8")])
6820 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6821 (compare:CC (zero_extend:DI
6823 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6824 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6826 (set (match_operand:DI 0 "gpc_reg_operand" "")
6827 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6828 "TARGET_POWERPC64 && reload_completed"
6830 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6832 (compare:CC (match_dup 0)
6836 (define_expand "ashldi3"
6837 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6838 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6839 (match_operand:SI 2 "reg_or_cint_operand" "")))]
6840 "TARGET_POWERPC64 || TARGET_POWER"
6843 if (TARGET_POWERPC64)
6845 else if (TARGET_POWER)
6847 emit_insn (gen_ashldi3_power (operands[0], operands[1], operands[2]));
6854 (define_insn "*ashldi3_internal1"
6855 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6856 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6857 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
6860 [(set_attr "length" "8")])
6862 (define_insn "*ashldi3_internal2"
6863 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6864 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6865 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6867 (clobber (match_scratch:DI 3 "=r,r"))]
6872 [(set_attr "type" "delayed_compare")
6873 (set_attr "length" "4,8")])
6876 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6877 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6878 (match_operand:SI 2 "reg_or_cint_operand" ""))
6880 (clobber (match_scratch:DI 3 ""))]
6881 "TARGET_POWERPC64 && reload_completed"
6883 (ashift:DI (match_dup 1) (match_dup 2)))
6885 (compare:CC (match_dup 3)
6889 (define_insn "*ashldi3_internal3"
6890 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6891 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6892 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6894 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6895 (ashift:DI (match_dup 1) (match_dup 2)))]
6900 [(set_attr "type" "delayed_compare")
6901 (set_attr "length" "4,8")])
6904 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6905 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6906 (match_operand:SI 2 "reg_or_cint_operand" ""))
6908 (set (match_operand:DI 0 "gpc_reg_operand" "")
6909 (ashift:DI (match_dup 1) (match_dup 2)))]
6910 "TARGET_POWERPC64 && reload_completed"
6912 (ashift:DI (match_dup 1) (match_dup 2)))
6914 (compare:CC (match_dup 0)
6918 (define_insn "*ashldi3_internal4"
6919 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6920 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6921 (match_operand:SI 2 "const_int_operand" "i"))
6922 (match_operand:DI 3 "const_int_operand" "n")))]
6923 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6924 "rldic %0,%1,%H2,%W3")
6926 (define_insn "ashldi3_internal5"
6927 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6929 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6930 (match_operand:SI 2 "const_int_operand" "i,i"))
6931 (match_operand:DI 3 "const_int_operand" "n,n"))
6933 (clobber (match_scratch:DI 4 "=r,r"))]
6934 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6936 rldic. %4,%1,%H2,%W3
6938 [(set_attr "type" "delayed_compare")
6939 (set_attr "length" "4,8")])
6942 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6944 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6945 (match_operand:SI 2 "const_int_operand" ""))
6946 (match_operand:DI 3 "const_int_operand" ""))
6948 (clobber (match_scratch:DI 4 ""))]
6949 "TARGET_POWERPC64 && reload_completed
6950 && includes_rldic_lshift_p (operands[2], operands[3])"
6952 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6955 (compare:CC (match_dup 4)
6959 (define_insn "*ashldi3_internal6"
6960 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6962 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6963 (match_operand:SI 2 "const_int_operand" "i,i"))
6964 (match_operand:DI 3 "const_int_operand" "n,n"))
6966 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6967 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6968 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6970 rldic. %0,%1,%H2,%W3
6972 [(set_attr "type" "delayed_compare")
6973 (set_attr "length" "4,8")])
6976 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6978 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6979 (match_operand:SI 2 "const_int_operand" ""))
6980 (match_operand:DI 3 "const_int_operand" ""))
6982 (set (match_operand:DI 0 "gpc_reg_operand" "")
6983 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6984 "TARGET_POWERPC64 && reload_completed
6985 && includes_rldic_lshift_p (operands[2], operands[3])"
6987 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6990 (compare:CC (match_dup 0)
6994 (define_insn "*ashldi3_internal7"
6995 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6996 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6997 (match_operand:SI 2 "const_int_operand" "i"))
6998 (match_operand:DI 3 "mask64_operand" "S")))]
6999 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7000 "rldicr %0,%1,%H2,%S3")
7002 (define_insn "ashldi3_internal8"
7003 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7005 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7006 (match_operand:SI 2 "const_int_operand" "i,i"))
7007 (match_operand:DI 3 "mask64_operand" "S,S"))
7009 (clobber (match_scratch:DI 4 "=r,r"))]
7010 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7012 rldicr. %4,%1,%H2,%S3
7014 [(set_attr "type" "delayed_compare")
7015 (set_attr "length" "4,8")])
7018 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7020 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7021 (match_operand:SI 2 "const_int_operand" ""))
7022 (match_operand:DI 3 "mask64_operand" ""))
7024 (clobber (match_scratch:DI 4 ""))]
7025 "TARGET_POWERPC64 && reload_completed
7026 && includes_rldicr_lshift_p (operands[2], operands[3])"
7028 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7031 (compare:CC (match_dup 4)
7035 (define_insn "*ashldi3_internal9"
7036 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
7038 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7039 (match_operand:SI 2 "const_int_operand" "i,i"))
7040 (match_operand:DI 3 "mask64_operand" "S,S"))
7042 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7043 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7044 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
7046 rldicr. %0,%1,%H2,%S3
7048 [(set_attr "type" "delayed_compare")
7049 (set_attr "length" "4,8")])
7052 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
7054 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
7055 (match_operand:SI 2 "const_int_operand" ""))
7056 (match_operand:DI 3 "mask64_operand" ""))
7058 (set (match_operand:DI 0 "gpc_reg_operand" "")
7059 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
7060 "TARGET_POWERPC64 && reload_completed
7061 && includes_rldicr_lshift_p (operands[2], operands[3])"
7063 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
7066 (compare:CC (match_dup 0)
7070 (define_expand "lshrdi3"
7071 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7072 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7073 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7074 "TARGET_POWERPC64 || TARGET_POWER"
7077 if (TARGET_POWERPC64)
7079 else if (TARGET_POWER)
7081 emit_insn (gen_lshrdi3_power (operands[0], operands[1], operands[2]));
7088 (define_insn "*lshrdi3_internal1"
7089 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7090 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7091 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7095 (define_insn "*lshrdi3_internal2"
7096 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7097 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7098 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7100 (clobber (match_scratch:DI 3 "=r,r"))]
7105 [(set_attr "type" "delayed_compare")
7106 (set_attr "length" "4,8")])
7109 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7110 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7111 (match_operand:SI 2 "reg_or_cint_operand" ""))
7113 (clobber (match_scratch:DI 3 ""))]
7114 "TARGET_POWERPC64 && reload_completed"
7116 (lshiftrt:DI (match_dup 1) (match_dup 2)))
7118 (compare:CC (match_dup 3)
7122 (define_insn "*lshrdi3_internal3"
7123 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7124 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7125 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7127 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7128 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
7133 [(set_attr "type" "delayed_compare")
7134 (set_attr "length" "4,8")])
7137 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7138 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7139 (match_operand:SI 2 "reg_or_cint_operand" ""))
7141 (set (match_operand:DI 0 "gpc_reg_operand" "")
7142 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
7143 "TARGET_POWERPC64 && reload_completed"
7145 (lshiftrt:DI (match_dup 1) (match_dup 2)))
7147 (compare:CC (match_dup 0)
7151 (define_expand "ashrdi3"
7152 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7153 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7154 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7158 if (TARGET_POWERPC64)
7160 else if (TARGET_POWER && GET_CODE (operands[2]) == CONST_INT)
7162 emit_insn (gen_ashrdi3_power (operands[0], operands[1], operands[2]));
7165 else if (TARGET_32BIT && GET_CODE (operands[2]) == CONST_INT)
7167 emit_insn (gen_ashrdi3_no_power (operands[0], operands[1], operands[2]));
7174 (define_insn "*ashrdi3_internal1"
7175 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7176 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7177 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7179 "srad%I2 %0,%1,%H2")
7181 (define_insn "*ashrdi3_internal2"
7182 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7183 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7184 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7186 (clobber (match_scratch:DI 3 "=r,r"))]
7191 [(set_attr "type" "delayed_compare")
7192 (set_attr "length" "4,8")])
7195 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7196 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7197 (match_operand:SI 2 "reg_or_cint_operand" ""))
7199 (clobber (match_scratch:DI 3 ""))]
7200 "TARGET_POWERPC64 && reload_completed"
7202 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7204 (compare:CC (match_dup 3)
7208 (define_insn "*ashrdi3_internal3"
7209 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7210 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7211 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7213 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7214 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7219 [(set_attr "type" "delayed_compare")
7220 (set_attr "length" "4,8")])
7223 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7224 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7225 (match_operand:SI 2 "reg_or_cint_operand" ""))
7227 (set (match_operand:DI 0 "gpc_reg_operand" "")
7228 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7229 "TARGET_POWERPC64 && reload_completed"
7231 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7233 (compare:CC (match_dup 0)
7237 (define_insn "anddi3"
7238 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
7239 (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
7240 (match_operand:DI 2 "and64_operand" "?r,S,K,J")))
7241 (clobber (match_scratch:CC 3 "=X,X,x,x"))]
7245 rldic%B2 %0,%1,0,%S2
7249 (define_insn "*anddi3_internal2"
7250 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,?y,??y,??y")
7251 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,")
7252 (match_operand:DI 2 "and64_operand" "r,S,K,J,r,S,K,J"))
7254 (clobber (match_scratch:DI 3 "=r,r,r,r,r,r,r,r"))
7255 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,x,x"))]
7259 rldic%B2. %3,%1,0,%S2
7266 [(set_attr "type" "compare,delayed_compare,compare,compare,compare,delayed_compare,compare,compare")
7267 (set_attr "length" "4,4,4,4,8,8,8,8")])
7270 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7271 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7272 (match_operand:DI 2 "and64_operand" ""))
7274 (clobber (match_scratch:DI 3 ""))
7275 (clobber (match_scratch:CC 4 ""))]
7276 "TARGET_POWERPC64 && reload_completed"
7277 [(parallel [(set (match_dup 3)
7278 (and:DI (match_dup 1)
7280 (clobber (match_dup 4))])
7282 (compare:CC (match_dup 3)
7286 (define_insn "*anddi3_internal3"
7287 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,?y,??y,??y")
7288 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
7289 (match_operand:DI 2 "and64_operand" "r,S,K,J,r,S,K,J"))
7291 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
7292 (and:DI (match_dup 1) (match_dup 2)))
7293 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,x,x"))]
7297 rldic%B2. %0,%1,0,%S2
7304 [(set_attr "type" "compare,delayed_compare,compare,compare,compare,delayed_compare,compare,compare")
7305 (set_attr "length" "4,4,4,4,8,8,8,8")])
7308 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7309 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7310 (match_operand:DI 2 "and64_operand" ""))
7312 (set (match_operand:DI 0 "gpc_reg_operand" "")
7313 (and:DI (match_dup 1) (match_dup 2)))
7314 (clobber (match_scratch:CC 4 ""))]
7315 "TARGET_POWERPC64 && reload_completed"
7316 [(parallel [(set (match_dup 0)
7317 (and:DI (match_dup 1) (match_dup 2)))
7318 (clobber (match_dup 4))])
7320 (compare:CC (match_dup 0)
7324 (define_expand "iordi3"
7325 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7326 (ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
7327 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7331 if (non_logical_cint_operand (operands[2], DImode))
7333 HOST_WIDE_INT value;
7334 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7335 ? operands[0] : gen_reg_rtx (DImode));
7337 if (GET_CODE (operands[2]) == CONST_INT)
7339 value = INTVAL (operands[2]);
7340 emit_insn (gen_iordi3 (tmp, operands[1],
7341 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7345 value = CONST_DOUBLE_LOW (operands[2]);
7346 emit_insn (gen_iordi3 (tmp, operands[1],
7347 immed_double_const (value
7348 & (~ (HOST_WIDE_INT) 0xffff),
7352 emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7357 (define_expand "xordi3"
7358 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7359 (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
7360 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7364 if (non_logical_cint_operand (operands[2], DImode))
7366 HOST_WIDE_INT value;
7367 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7368 ? operands[0] : gen_reg_rtx (DImode));
7370 if (GET_CODE (operands[2]) == CONST_INT)
7372 value = INTVAL (operands[2]);
7373 emit_insn (gen_xordi3 (tmp, operands[1],
7374 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7378 value = CONST_DOUBLE_LOW (operands[2]);
7379 emit_insn (gen_xordi3 (tmp, operands[1],
7380 immed_double_const (value
7381 & (~ (HOST_WIDE_INT) 0xffff),
7385 emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7390 (define_insn "*booldi3_internal1"
7391 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
7392 (match_operator:DI 3 "boolean_or_operator"
7393 [(match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
7394 (match_operand:DI 2 "logical_operand" "r,K,JF")]))]
7401 (define_insn "*booldi3_internal2"
7402 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7403 (compare:CC (match_operator:DI 4 "boolean_or_operator"
7404 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7405 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7407 (clobber (match_scratch:DI 3 "=r,r"))]
7412 [(set_attr "type" "compare")
7413 (set_attr "length" "4,8")])
7416 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7417 (compare:CC (match_operator:DI 4 "boolean_operator"
7418 [(match_operand:DI 1 "gpc_reg_operand" "")
7419 (match_operand:DI 2 "gpc_reg_operand" "")])
7421 (clobber (match_scratch:DI 3 ""))]
7422 "TARGET_POWERPC64 && reload_completed"
7423 [(set (match_dup 3) (match_dup 4))
7425 (compare:CC (match_dup 3)
7429 (define_insn "*booldi3_internal3"
7430 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7431 (compare:CC (match_operator:DI 4 "boolean_operator"
7432 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7433 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7435 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7441 [(set_attr "type" "compare")
7442 (set_attr "length" "4,8")])
7445 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7446 (compare:CC (match_operator:DI 4 "boolean_operator"
7447 [(match_operand:DI 1 "gpc_reg_operand" "")
7448 (match_operand:DI 2 "gpc_reg_operand" "")])
7450 (set (match_operand:DI 0 "gpc_reg_operand" "")
7452 "TARGET_POWERPC64 && reload_completed"
7453 [(set (match_dup 0) (match_dup 4))
7455 (compare:CC (match_dup 0)
7459 ;; Split an logical operation that we can't do in one insn into two insns,
7460 ;; each of which does one 16-bit part. This is used by combine.
7463 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7464 (match_operator:DI 3 "boolean_or_operator"
7465 [(match_operand:DI 1 "gpc_reg_operand" "")
7466 (match_operand:DI 2 "non_logical_cint_operand" "")]))]
7468 [(set (match_dup 0) (match_dup 4))
7469 (set (match_dup 0) (match_dup 5))]
7474 if (GET_CODE (operands[2]) == CONST_DOUBLE)
7476 HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
7477 i3 = immed_double_const (value & (~ (HOST_WIDE_INT) 0xffff),
7479 i4 = GEN_INT (value & 0xffff);
7483 i3 = GEN_INT (INTVAL (operands[2])
7484 & (~ (HOST_WIDE_INT) 0xffff));
7485 i4 = GEN_INT (INTVAL (operands[2]) & 0xffff);
7487 operands[4] = gen_rtx (GET_CODE (operands[3]), DImode,
7489 operands[5] = gen_rtx (GET_CODE (operands[3]), DImode,
7493 (define_insn "*boolcdi3_internal1"
7494 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7495 (match_operator:DI 3 "boolean_operator"
7496 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7497 (match_operand:DI 2 "gpc_reg_operand" "r")]))]
7501 (define_insn "*boolcdi3_internal2"
7502 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7503 (compare:CC (match_operator:DI 4 "boolean_operator"
7504 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
7505 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7507 (clobber (match_scratch:DI 3 "=r,r"))]
7512 [(set_attr "type" "compare")
7513 (set_attr "length" "4,8")])
7516 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7517 (compare:CC (match_operator:DI 4 "boolean_operator"
7518 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7519 (match_operand:DI 2 "gpc_reg_operand" "")])
7521 (clobber (match_scratch:DI 3 ""))]
7522 "TARGET_POWERPC64 && reload_completed"
7523 [(set (match_dup 3) (match_dup 4))
7525 (compare:CC (match_dup 3)
7529 (define_insn "*boolcdi3_internal3"
7530 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7531 (compare:CC (match_operator:DI 4 "boolean_operator"
7532 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
7533 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7535 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7541 [(set_attr "type" "compare")
7542 (set_attr "length" "4,8")])
7545 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7546 (compare:CC (match_operator:DI 4 "boolean_operator"
7547 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7548 (match_operand:DI 2 "gpc_reg_operand" "")])
7550 (set (match_operand:DI 0 "gpc_reg_operand" "")
7552 "TARGET_POWERPC64 && reload_completed"
7553 [(set (match_dup 0) (match_dup 4))
7555 (compare:CC (match_dup 0)
7559 (define_insn "*boolccdi3_internal1"
7560 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7561 (match_operator:DI 3 "boolean_operator"
7562 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7563 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))]))]
7567 (define_insn "*boolccdi3_internal2"
7568 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7569 (compare:CC (match_operator:DI 4 "boolean_operator"
7570 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
7571 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
7573 (clobber (match_scratch:DI 3 "=r,r"))]
7578 [(set_attr "type" "compare")
7579 (set_attr "length" "4,8")])
7582 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7583 (compare:CC (match_operator:DI 4 "boolean_operator"
7584 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7585 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
7587 (clobber (match_scratch:DI 3 ""))]
7588 "TARGET_POWERPC64 && reload_completed"
7589 [(set (match_dup 3) (match_dup 4))
7591 (compare:CC (match_dup 3)
7595 (define_insn "*boolccdi3_internal3"
7596 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7597 (compare:CC (match_operator:DI 4 "boolean_operator"
7598 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
7599 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
7601 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7607 [(set_attr "type" "compare")
7608 (set_attr "length" "4,8")])
7611 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7612 (compare:CC (match_operator:DI 4 "boolean_operator"
7613 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7614 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
7616 (set (match_operand:DI 0 "gpc_reg_operand" "")
7618 "TARGET_POWERPC64 && reload_completed"
7619 [(set (match_dup 0) (match_dup 4))
7621 (compare:CC (match_dup 0)
7625 ;; Now define ways of moving data around.
7627 ;; Elf specific ways of loading addresses for non-PIC code.
7628 ;; The output of this could be r0, but we make a very strong
7629 ;; preference for a base register because it will usually
7631 (define_insn "elf_high"
7632 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
7633 (high:SI (match_operand 1 "" "")))]
7634 "TARGET_ELF && ! TARGET_64BIT"
7635 "{liu|lis} %0,%1@ha")
7637 (define_insn "elf_low"
7638 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
7639 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
7640 (match_operand 2 "" "")))]
7641 "TARGET_ELF && ! TARGET_64BIT"
7643 {cal|la} %0,%2@l(%1)
7644 {ai|addic} %0,%1,%K2")
7646 ;; Mach-O PIC trickery.
7647 (define_insn "macho_high"
7648 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
7649 (high:SI (match_operand 1 "" "")))]
7650 "TARGET_MACHO && ! TARGET_64BIT"
7651 "{liu|lis} %0,ha16(%1)")
7653 (define_insn "macho_low"
7654 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
7655 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
7656 (match_operand 2 "" "")))]
7657 "TARGET_MACHO && ! TARGET_64BIT"
7659 {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)}
7660 {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}")
7662 ;; Set up a register with a value from the GOT table
7664 (define_expand "movsi_got"
7665 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7666 (unspec:SI [(match_operand:SI 1 "got_operand" "")
7668 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
7671 if (GET_CODE (operands[1]) == CONST)
7673 rtx offset = const0_rtx;
7674 HOST_WIDE_INT value;
7676 operands[1] = eliminate_constant_term (XEXP (operands[1], 0), &offset);
7677 value = INTVAL (offset);
7680 rtx tmp = (no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode));
7681 emit_insn (gen_movsi_got (tmp, operands[1]));
7682 emit_insn (gen_addsi3 (operands[0], tmp, offset));
7687 operands[2] = rs6000_got_register (operands[1]);
7690 (define_insn "*movsi_got_internal"
7691 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
7692 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
7693 (match_operand:SI 2 "gpc_reg_operand" "b")] 8))]
7694 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
7695 "{l|lwz} %0,%a1@got(%2)"
7696 [(set_attr "type" "load")])
7698 ;; Used by sched, shorten_branches and final when the GOT pseudo reg
7699 ;; didn't get allocated to a hard register.
7701 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7702 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
7703 (match_operand:SI 2 "memory_operand" "")] 8))]
7704 "DEFAULT_ABI == ABI_V4
7706 && (reload_in_progress || reload_completed)"
7707 [(set (match_dup 0) (match_dup 2))
7708 (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)] 8))]
7711 ;; For SI, we special-case integers that can't be loaded in one insn. We
7712 ;; do the load 16-bits at a time. We could do this by loading from memory,
7713 ;; and this is even supposed to be faster, but it is simpler not to get
7714 ;; integers in the TOC.
7715 (define_expand "movsi"
7716 [(set (match_operand:SI 0 "general_operand" "")
7717 (match_operand:SI 1 "any_operand" ""))]
7719 "{ rs6000_emit_move (operands[0], operands[1], SImode); DONE; }")
7721 (define_insn "movsi_low"
7722 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
7723 (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7724 (match_operand 2 "" ""))))]
7725 "TARGET_MACHO && ! TARGET_64BIT"
7726 "{l|lwz} %0,lo16(%2)(%1)"
7727 [(set_attr "type" "load")
7728 (set_attr "length" "4")])
7730 (define_insn "movsi_low_st"
7731 [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7732 (match_operand 2 "" "")))
7733 (match_operand:SI 0 "gpc_reg_operand" "r"))]
7734 "TARGET_MACHO && ! TARGET_64BIT"
7735 "{st|stw} %0,lo16(%2)(%1)"
7736 [(set_attr "type" "store")
7737 (set_attr "length" "4")])
7739 (define_insn "movdf_low"
7740 [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r")
7741 (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7742 (match_operand 2 "" ""))))]
7743 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7746 switch (which_alternative)
7749 return \"lfd %0,lo16(%2)(%1)\";
7753 operands2[0] = operands[0];
7754 operands2[1] = operands[1];
7755 operands2[2] = operands[2];
7756 operands2[3] = gen_rtx_REG (SImode, RS6000_PIC_OFFSET_TABLE_REGNUM);
7757 output_asm_insn (\"{l|lwz} %0,lo16(%2)(%1)\", operands);
7758 /* We cannot rely on ha16(low half)==ha16(high half), alas,
7759 although in practice it almost always is. */
7760 output_asm_insn (\"{cau|addis} %L0,%3,ha16(%2+4)\", operands2);
7761 return (\"{l|lwz} %L0,lo16(%2+4)(%L0)\");
7767 [(set_attr "type" "load")
7768 (set_attr "length" "4,12")])
7770 (define_insn "movdf_low_st"
7771 [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7772 (match_operand 2 "" "")))
7773 (match_operand:DF 0 "gpc_reg_operand" "f"))]
7774 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7775 "stfd %0,lo16(%2)(%1)"
7776 [(set_attr "type" "store")
7777 (set_attr "length" "4")])
7779 (define_insn "movsf_low"
7780 [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r")
7781 (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7782 (match_operand 2 "" ""))))]
7783 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7786 {l|lwz} %0,lo16(%2)(%1)"
7787 [(set_attr "type" "load")
7788 (set_attr "length" "4")])
7790 (define_insn "movsf_low_st"
7791 [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7792 (match_operand 2 "" "")))
7793 (match_operand:SF 0 "gpc_reg_operand" "f,!r"))]
7794 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7796 stfs %0,lo16(%2)(%1)
7797 {st|stw} %0,lo16(%2)(%1)"
7798 [(set_attr "type" "store")
7799 (set_attr "length" "4")])
7801 (define_insn "*movsi_internal1"
7802 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h")
7803 (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0"))]
7804 "gpc_reg_operand (operands[0], SImode)
7805 || gpc_reg_operand (operands[1], SImode)"
7809 {l%U1%X1|lwz%U1%X1} %0,%1
7810 {st%U0%X0|stw%U0%X0} %1,%0
7820 [(set_attr "type" "*,*,load,store,*,*,*,*,*,*,mtjmpr,*,*")
7821 (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4")])
7823 ;; Split a load of a large constant into the appropriate two-insn
7827 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7828 (match_operand:SI 1 "const_int_operand" ""))]
7829 "(unsigned HOST_WIDE_INT) (INTVAL (operands[1]) + 0x8000) >= 0x10000
7830 && (INTVAL (operands[1]) & 0xffff) != 0"
7834 (ior:SI (match_dup 0)
7838 operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
7839 operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
7842 (define_insn "*movsi_internal2"
7843 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
7844 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r,r")
7846 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
7847 "! TARGET_POWERPC64"
7851 [(set_attr "type" "compare")
7852 (set_attr "length" "4,8")])
7855 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
7856 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
7858 (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))]
7859 "! TARGET_POWERPC64 && reload_completed"
7860 [(set (match_dup 0) (match_dup 1))
7862 (compare:CC (match_dup 0)
7866 (define_expand "movhi"
7867 [(set (match_operand:HI 0 "general_operand" "")
7868 (match_operand:HI 1 "any_operand" ""))]
7870 "{ rs6000_emit_move (operands[0], operands[1], HImode); DONE; }")
7873 [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
7874 (match_operand:HI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
7875 "gpc_reg_operand (operands[0], HImode)
7876 || gpc_reg_operand (operands[1], HImode)"
7886 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
7888 (define_expand "movqi"
7889 [(set (match_operand:QI 0 "general_operand" "")
7890 (match_operand:QI 1 "any_operand" ""))]
7892 "{ rs6000_emit_move (operands[0], operands[1], QImode); DONE; }")
7895 [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
7896 (match_operand:QI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
7897 "gpc_reg_operand (operands[0], QImode)
7898 || gpc_reg_operand (operands[1], QImode)"
7908 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
7910 ;; Here is how to move condition codes around. When we store CC data in
7911 ;; an integer register or memory, we store just the high-order 4 bits.
7912 ;; This lets us not shift in the most common case of CR0.
7913 (define_expand "movcc"
7914 [(set (match_operand:CC 0 "nonimmediate_operand" "")
7915 (match_operand:CC 1 "nonimmediate_operand" ""))]
7919 (define_insn "*movcc_internal1"
7920 [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,y,r,r,r,r,m")
7921 (match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,m,r"))]
7922 "register_operand (operands[0], CCmode)
7923 || register_operand (operands[1], CCmode)"
7927 {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff
7929 mfcr %0\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000
7931 {l%U1%X1|lwz%U1%X1} %0,%1
7932 {st%U0%U1|stw%U0%U1} %1,%0"
7933 [(set_attr "type" "cr_logical,cr_logical,cr_logical,cr_logical,cr_logical,*,load,store")
7934 (set_attr "length" "*,*,12,*,8,*,*,*")])
7936 ;; For floating-point, we normally deal with the floating-point registers
7937 ;; unless -msoft-float is used. The sole exception is that parameter passing
7938 ;; can produce floating-point values in fixed-point registers. Unless the
7939 ;; value is a simple constant or already in memory, we deal with this by
7940 ;; allocating memory and copying the value explicitly via that memory location.
7941 (define_expand "movsf"
7942 [(set (match_operand:SF 0 "nonimmediate_operand" "")
7943 (match_operand:SF 1 "any_operand" ""))]
7945 "{ rs6000_emit_move (operands[0], operands[1], SFmode); DONE; }")
7948 [(set (match_operand:SF 0 "gpc_reg_operand" "")
7949 (match_operand:SF 1 "const_double_operand" ""))]
7951 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
7952 || (GET_CODE (operands[0]) == SUBREG
7953 && GET_CODE (SUBREG_REG (operands[0])) == REG
7954 && REGNO (SUBREG_REG (operands[0])) <= 31))"
7955 [(set (match_dup 2) (match_dup 3))]
7961 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
7962 REAL_VALUE_TO_TARGET_SINGLE (rv, l);
7964 if (! TARGET_POWERPC64)
7965 operands[2] = operand_subword (operands[0], 0, 0, SFmode);
7967 operands[2] = gen_lowpart (SImode, operands[0]);
7969 operands[3] = gen_int_mode (l, SImode);
7972 (define_insn "*movsf_hardfloat"
7973 [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!r,!r")
7974 (match_operand:SF 1 "input_operand" "r,m,r,f,m,f,G,Fn"))]
7975 "(gpc_reg_operand (operands[0], SFmode)
7976 || gpc_reg_operand (operands[1], SFmode)) && TARGET_HARD_FLOAT"
7979 {l%U1%X1|lwz%U1%X1} %0,%1
7980 {st%U0%X0|stw%U0%X0} %1,%0
7986 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*")
7987 (set_attr "length" "4,4,4,4,4,4,4,8")])
7989 (define_insn "*movsf_softfloat"
7990 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,r")
7991 (match_operand:SF 1 "input_operand" "r,m,r,I,L,R,G,Fn"))]
7992 "(gpc_reg_operand (operands[0], SFmode)
7993 || gpc_reg_operand (operands[1], SFmode)) && TARGET_SOFT_FLOAT"
7996 {l%U1%X1|lwz%U1%X1} %0,%1
7997 {st%U0%X0|stw%U0%X0} %1,%0
8003 [(set_attr "type" "*,load,store,*,*,*,*,*")
8004 (set_attr "length" "4,4,4,4,4,4,4,8")])
8007 (define_expand "movdf"
8008 [(set (match_operand:DF 0 "nonimmediate_operand" "")
8009 (match_operand:DF 1 "any_operand" ""))]
8011 "{ rs6000_emit_move (operands[0], operands[1], DFmode); DONE; }")
8014 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8015 (match_operand:DF 1 "const_int_operand" ""))]
8016 "! TARGET_POWERPC64 && reload_completed
8017 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8018 || (GET_CODE (operands[0]) == SUBREG
8019 && GET_CODE (SUBREG_REG (operands[0])) == REG
8020 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8021 [(set (match_dup 2) (match_dup 4))
8022 (set (match_dup 3) (match_dup 1))]
8025 int endian = (WORDS_BIG_ENDIAN == 0);
8026 HOST_WIDE_INT value = INTVAL (operands[1]);
8028 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
8029 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
8030 #if HOST_BITS_PER_WIDE_INT == 32
8031 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
8033 operands[4] = GEN_INT (value >> 32);
8034 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
8039 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8040 (match_operand:DF 1 "const_double_operand" ""))]
8041 "! TARGET_POWERPC64 && reload_completed
8042 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8043 || (GET_CODE (operands[0]) == SUBREG
8044 && GET_CODE (SUBREG_REG (operands[0])) == REG
8045 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8046 [(set (match_dup 2) (match_dup 4))
8047 (set (match_dup 3) (match_dup 5))]
8050 int endian = (WORDS_BIG_ENDIAN == 0);
8054 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
8055 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
8057 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
8058 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
8059 operands[4] = gen_int_mode (l[endian], SImode);
8060 operands[5] = gen_int_mode (l[1 - endian], SImode);
8064 [(set (match_operand:DF 0 "gpc_reg_operand" "")
8065 (match_operand:DF 1 "easy_fp_constant" ""))]
8066 "TARGET_POWERPC64 && reload_completed
8067 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
8068 || (GET_CODE (operands[0]) == SUBREG
8069 && GET_CODE (SUBREG_REG (operands[0])) == REG
8070 && REGNO (SUBREG_REG (operands[0])) <= 31))"
8071 [(set (match_dup 2) (match_dup 3))]
8074 int endian = (WORDS_BIG_ENDIAN == 0);
8079 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
8080 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
8082 operands[2] = gen_lowpart (DImode, operands[0]);
8083 /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN. */
8084 #if HOST_BITS_PER_WIDE_INT >= 64
8085 val = ((HOST_WIDE_INT)(unsigned long)l[endian] << 32 |
8086 ((HOST_WIDE_INT)(unsigned long)l[1 - endian]));
8088 operands[3] = immed_double_const (val, -(val < 0), DImode);
8090 operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
8094 ;; Don't have reload use general registers to load a constant. First,
8095 ;; it might not work if the output operand is the equivalent of
8096 ;; a non-offsettable memref, but also it is less efficient than loading
8097 ;; the constant into an FP register, since it will probably be used there.
8098 ;; The "??" is a kludge until we can figure out a more reasonable way
8099 ;; of handling these non-offsettable values.
8100 (define_insn "*movdf_hardfloat32"
8101 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
8102 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
8103 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT
8104 && (gpc_reg_operand (operands[0], DFmode)
8105 || gpc_reg_operand (operands[1], DFmode))"
8108 switch (which_alternative)
8113 /* We normally copy the low-numbered register first. However, if
8114 the first register operand 0 is the same as the second register
8115 of operand 1, we must copy in the opposite order. */
8116 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8117 return \"mr %L0,%L1\;mr %0,%1\";
8119 return \"mr %0,%1\;mr %L0,%L1\";
8121 if (offsettable_memref_p (operands[1])
8122 || (GET_CODE (operands[1]) == MEM
8123 && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
8124 || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
8125 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)))
8127 /* If the low-address word is used in the address, we must load
8128 it last. Otherwise, load it first. Note that we cannot have
8129 auto-increment in that case since the address register is
8130 known to be dead. */
8131 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8133 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8135 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8141 addreg = find_addr_reg (XEXP (operands[1], 0));
8142 if (refers_to_regno_p (REGNO (operands[0]),
8143 REGNO (operands[0]) + 1,
8146 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8147 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8148 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8149 return \"{lx|lwzx} %0,%1\";
8153 output_asm_insn (\"{lx|lwzx} %0,%1\", operands);
8154 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8155 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8156 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8161 if (offsettable_memref_p (operands[0])
8162 || (GET_CODE (operands[0]) == MEM
8163 && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
8164 || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
8165 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)))
8166 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8171 addreg = find_addr_reg (XEXP (operands[0], 0));
8172 output_asm_insn (\"{stx|stwx} %1,%0\", operands);
8173 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8174 output_asm_insn (\"{stx|stwx} %L1,%0\", operands);
8175 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8183 return \"fmr %0,%1\";
8185 return \"lfd%U1%X1 %0,%1\";
8187 return \"stfd%U0%X0 %1,%0\";
8190 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8191 (set_attr "length" "8,16,16,8,12,16,*,*,*")])
8193 (define_insn "*movdf_softfloat32"
8194 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8195 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8196 "! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
8197 && (gpc_reg_operand (operands[0], DFmode)
8198 || gpc_reg_operand (operands[1], DFmode))"
8201 switch (which_alternative)
8206 /* We normally copy the low-numbered register first. However, if
8207 the first register operand 0 is the same as the second register of
8208 operand 1, we must copy in the opposite order. */
8209 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8210 return \"mr %L0,%L1\;mr %0,%1\";
8212 return \"mr %0,%1\;mr %L0,%L1\";
8214 /* If the low-address word is used in the address, we must load
8215 it last. Otherwise, load it first. Note that we cannot have
8216 auto-increment in that case since the address register is
8217 known to be dead. */
8218 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8220 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8222 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8224 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8231 [(set_attr "type" "*,load,store,*,*,*")
8232 (set_attr "length" "8,8,8,8,12,16")])
8234 (define_insn "*movdf_hardfloat64"
8235 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
8236 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
8237 "TARGET_POWERPC64 && TARGET_HARD_FLOAT
8238 && (gpc_reg_operand (operands[0], DFmode)
8239 || gpc_reg_operand (operands[1], DFmode))"
8250 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8251 (set_attr "length" "4,4,4,8,12,16,4,4,4")])
8253 (define_insn "*movdf_softfloat64"
8254 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8255 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8256 "TARGET_POWERPC64 && TARGET_SOFT_FLOAT
8257 && (gpc_reg_operand (operands[0], DFmode)
8258 || gpc_reg_operand (operands[1], DFmode))"
8266 [(set_attr "type" "*,load,store,*,*,*")
8267 (set_attr "length" "*,*,*,8,12,16")])
8269 (define_expand "movtf"
8270 [(set (match_operand:TF 0 "general_operand" "")
8271 (match_operand:TF 1 "any_operand" ""))]
8272 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8273 "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
8275 (define_insn "*movtf_internal"
8276 [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r")
8277 (match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))]
8278 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128
8279 && (gpc_reg_operand (operands[0], TFmode)
8280 || gpc_reg_operand (operands[1], TFmode))"
8283 switch (which_alternative)
8288 /* We normally copy the low-numbered register first. However, if
8289 the first register operand 0 is the same as the second register of
8290 operand 1, we must copy in the opposite order. */
8291 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8292 return \"fmr %L0,%L1\;fmr %0,%1\";
8294 return \"fmr %0,%1\;fmr %L0,%L1\";
8296 return \"lfd %0,%1\;lfd %L0,%L1\";
8298 return \"stfd %1,%0\;stfd %L1,%L0\";
8305 [(set_attr "type" "fp,fpload,fpstore,*,*,*")
8306 (set_attr "length" "8,8,8,12,16,20")])
8309 [(set (match_operand:TF 0 "gpc_reg_operand" "")
8310 (match_operand:TF 1 "const_double_operand" ""))]
8311 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8312 [(set (match_dup 3) (match_dup 1))
8314 (float_extend:TF (match_dup 3)))]
8317 operands[2] = operand_subword (operands[1], 0, 0, DFmode);
8318 operands[3] = gen_reg_rtx (DFmode);
8321 (define_insn_and_split "extenddftf2"
8322 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8323 (float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))]
8324 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8327 [(set (match_dup 2) (match_dup 3))]
8330 operands[2] = gen_rtx_REG (DFmode, REGNO (operands[0] + 1));
8331 operands[3] = CONST0_RTX (DFmode);
8334 (define_insn_and_split "extendsftf2"
8335 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8336 (float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))]
8337 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8340 [(set (match_dup 2) (match_dup 3))]
8343 operands[2] = gen_rtx_REG (SFmode, REGNO (operands[0] + 1));
8344 operands[3] = CONST0_RTX (SFmode);
8347 (define_insn "trunctfdf2"
8348 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
8349 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8350 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8352 [(set_attr "type" "fp")
8353 (set_attr "length" "8")])
8355 (define_insn_and_split "trunctfsf2"
8356 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
8357 (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f")))
8358 (clobber (match_scratch:DF 2 "=f"))]
8359 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8361 "&& reload_completed"
8363 (float_truncate:DF (match_dup 1)))
8365 (float_truncate:SF (match_dup 2)))]
8368 (define_insn_and_split "floatditf2"
8369 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8370 (float:TF (match_operand:DI 1 "gpc_reg_operand" "*f")))
8371 (clobber (match_scratch:DF 2 "=f"))]
8372 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8373 && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8375 "&& reload_completed"
8377 (float:DF (match_operand:DI 1 "gpc_reg_operand" "")))
8378 (set (match_operand:TF 0 "gpc_reg_operand" "")
8379 (float_extend:TF (match_dup 2)))]
8382 (define_insn_and_split "floatsitf2"
8383 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8384 (float:TF (match_operand:SI 1 "gpc_reg_operand" "r")))
8385 (clobber (match_scratch:DF 2 "=f"))]
8386 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8388 "&& reload_completed"
8390 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
8391 (set (match_operand:TF 0 "gpc_reg_operand" "")
8392 (float_extend:TF (match_dup 2)))]
8395 (define_insn_and_split "fix_trunctfdi2"
8396 [(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
8397 (fix:DI (match_operand:TF 1 "gpc_reg_operand" "f")))]
8398 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8399 && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8401 "&& reload_completed"
8403 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8404 (set (match_operand:DI 0 "gpc_reg_operand" "")
8405 (fix:SI (match_dup 2)))]
8408 (define_insn_and_split "fix_trunctfsi2"
8409 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
8410 (fix:SI (match_operand:TF 1 "gpc_reg_operand" "f")))]
8411 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8413 "&& reload_completed"
8415 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8416 (set (match_operand:SI 0 "gpc_reg_operand" "")
8417 (fix:SI (match_dup 2)))]
8420 (define_insn "negtf2"
8421 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8422 (neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8423 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8426 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8427 return \"fneg %L0,%L1\;fneg %0,%1\";
8429 return \"fneg %0,%1\;fneg %L0,%L1\";
8431 [(set_attr "type" "fp")
8432 (set_attr "length" "8")])
8434 (define_insn "abstf2"
8435 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8436 (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8437 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8440 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8441 return \"fabs %L0,%L1\;fabs %0,%1\";
8443 return \"fabs %0,%1\;fabs %L0,%L1\";
8445 [(set_attr "type" "fp")
8446 (set_attr "length" "8")])
8449 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8450 (neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))]
8451 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8454 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8455 return \"fnabs %L0,%L1\;fnabs %0,%1\";
8457 return \"fnabs %0,%1\;fnabs %L0,%L1\";
8459 [(set_attr "type" "fp")
8460 (set_attr "length" "8")])
8462 ;; Next come the multi-word integer load and store and the load and store
8464 (define_expand "movdi"
8465 [(set (match_operand:DI 0 "general_operand" "")
8466 (match_operand:DI 1 "any_operand" ""))]
8468 "{ rs6000_emit_move (operands[0], operands[1], DImode); DONE; }")
8470 (define_insn "*movdi_internal32"
8471 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
8472 (match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
8474 && (gpc_reg_operand (operands[0], DImode)
8475 || gpc_reg_operand (operands[1], DImode))"
8478 switch (which_alternative)
8483 /* We normally copy the low-numbered register first. However, if
8484 the first register operand 0 is the same as the second register of
8485 operand 1, we must copy in the opposite order. */
8486 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8487 return \"mr %L0,%L1\;mr %0,%1\";
8489 return \"mr %0,%1\;mr %L0,%L1\";
8491 /* If the low-address word is used in the address, we must load it
8492 last. Otherwise, load it first. Note that we cannot have
8493 auto-increment in that case since the address register is known to be
8495 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8497 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8499 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8501 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8503 return \"fmr %0,%1\";
8505 return \"lfd%U1%X1 %0,%1\";
8507 return \"stfd%U0%X0 %1,%0\";
8516 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")
8517 (set_attr "length" "8,8,8,*,*,*,8,12,8,12,16")])
8520 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8521 (match_operand:DI 1 "const_int_operand" ""))]
8522 "! TARGET_POWERPC64 && reload_completed"
8523 [(set (match_dup 2) (match_dup 4))
8524 (set (match_dup 3) (match_dup 1))]
8527 HOST_WIDE_INT value = INTVAL (operands[1]);
8528 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8530 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8532 #if HOST_BITS_PER_WIDE_INT == 32
8533 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
8535 operands[4] = GEN_INT (value >> 32);
8536 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
8541 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8542 (match_operand:DI 1 "const_double_operand" ""))]
8543 "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed"
8544 [(set (match_dup 2) (match_dup 4))
8545 (set (match_dup 3) (match_dup 5))]
8548 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8550 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8552 operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
8553 operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
8556 (define_insn "*movdi_internal64"
8557 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,f,f,m,r,*h,*h")
8558 (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
8560 && (gpc_reg_operand (operands[0], DImode)
8561 || gpc_reg_operand (operands[1], DImode))"
8576 [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,*,mtjmpr,*")
8577 (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
8579 ;; immediate value valid for a single instruction hiding in a const_double
8581 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
8582 (match_operand:DI 1 "const_double_operand" "F"))]
8583 "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
8584 && GET_CODE (operands[1]) == CONST_DOUBLE
8585 && num_insns_constant (operands[1], DImode) == 1"
8588 return ((unsigned HOST_WIDE_INT)
8589 (CONST_DOUBLE_LOW (operands[1]) + 0x8000) < 0x10000)
8590 ? \"li %0,%1\" : \"lis %0,%v1\";
8593 ;; Generate all one-bits and clear left or right.
8594 ;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
8596 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8597 (match_operand:DI 1 "mask64_operand" ""))]
8598 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8599 [(set (match_dup 0) (const_int -1))
8601 (and:DI (rotate:DI (match_dup 0)
8606 ;; Split a load of a large constant into the appropriate five-instruction
8607 ;; sequence. Handle anything in a constant number of insns.
8608 ;; When non-easy constants can go in the TOC, this should use
8609 ;; easy_fp_constant predicate.
8611 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8612 (match_operand:DI 1 "const_int_operand" ""))]
8613 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8614 [(set (match_dup 0) (match_dup 2))
8615 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
8617 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
8619 if (tem == operands[0])
8626 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8627 (match_operand:DI 1 "const_double_operand" ""))]
8628 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8629 [(set (match_dup 0) (match_dup 2))
8630 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
8632 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
8634 if (tem == operands[0])
8640 ;; Split a load of a large constant into the appropriate five-instruction
8641 (define_insn "*movdi_internal2"
8642 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
8643 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r,r")
8645 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
8650 [(set_attr "type" "compare")
8651 (set_attr "length" "4,8")])
8654 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
8655 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "")
8657 (set (match_operand:DI 0 "gpc_reg_operand" "") (match_dup 1))]
8658 "TARGET_POWERPC64 && reload_completed"
8659 [(set (match_dup 0) (match_dup 1))
8661 (compare:CC (match_dup 0)
8665 ;; TImode is similar, except that we usually want to compute the address into
8666 ;; a register and use lsi/stsi (the exception is during reload). MQ is also
8667 ;; clobbered in stsi for POWER, so we need a SCRATCH for it.
8668 (define_expand "movti"
8669 [(parallel [(set (match_operand:TI 0 "general_operand" "")
8670 (match_operand:TI 1 "general_operand" ""))
8671 (clobber (scratch:SI))])]
8672 "TARGET_STRING || TARGET_POWERPC64"
8673 "{ rs6000_emit_move (operands[0], operands[1], TImode); DONE; }")
8675 ;; We say that MQ is clobbered in the last alternative because the first
8676 ;; alternative would never get used otherwise since it would need a reload
8677 ;; while the 2nd alternative would not. We put memory cases first so they
8678 ;; are preferred. Otherwise, we'd try to reload the output instead of
8679 ;; giving the SCRATCH mq.
8680 (define_insn "*movti_power"
8681 [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
8682 (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
8683 (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
8684 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
8685 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
8688 switch (which_alternative)
8694 return \"{stsi|stswi} %1,%P0,16\";
8697 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
8700 /* Normally copy registers with lowest numbered register copied first.
8701 But copy in the other order if the first register of the output
8702 is the second, third, or fourth register in the input. */
8703 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
8704 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
8705 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
8707 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
8709 /* If the address is not used in the output, we can use lsi. Otherwise,
8710 fall through to generating four loads. */
8711 if (! reg_overlap_mentioned_p (operands[0], operands[1]))
8712 return \"{lsi|lswi} %0,%P1,16\";
8713 /* ... fall through ... */
8715 /* If the address register is the same as the register for the lowest-
8716 addressed word, load it last. Similarly for the next two words.
8717 Otherwise load lowest address to highest. */
8718 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8720 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
8721 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
8722 REGNO (operands[0]) + 2, operands[1], 0))
8723 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
8724 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
8725 REGNO (operands[0]) + 3, operands[1], 0))
8726 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
8728 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
8731 [(set_attr "type" "store,store,*,load,load")
8732 (set_attr "length" "*,16,16,*,16")])
8734 (define_insn "*movti_string"
8735 [(set (match_operand:TI 0 "reg_or_mem_operand" "=m,????r,????r")
8736 (match_operand:TI 1 "reg_or_mem_operand" "r,r,m"))
8737 (clobber (match_scratch:SI 2 "=X,X,X"))]
8738 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
8739 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
8742 switch (which_alternative)
8748 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
8751 /* Normally copy registers with lowest numbered register copied first.
8752 But copy in the other order if the first register of the output
8753 is the second, third, or fourth register in the input. */
8754 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
8755 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
8756 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
8758 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
8760 /* If the address register is the same as the register for the lowest-
8761 addressed word, load it last. Similarly for the next two words.
8762 Otherwise load lowest address to highest. */
8763 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8765 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
8766 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
8767 REGNO (operands[0]) + 2, operands[1], 0))
8768 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
8769 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
8770 REGNO (operands[0]) + 3, operands[1], 0))
8771 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
8773 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
8776 [(set_attr "type" "store,*,load")
8777 (set_attr "length" "16,16,16")])
8779 (define_insn "*movti_ppc64"
8780 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
8781 (match_operand:TI 1 "input_operand" "r,m,r"))]
8782 "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
8783 || gpc_reg_operand (operands[1], TImode))"
8786 switch (which_alternative)
8791 /* We normally copy the low-numbered register first. However, if
8792 the first register operand 0 is the same as the second register of
8793 operand 1, we must copy in the opposite order. */
8794 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8795 return \"mr %L0,%L1\;mr %0,%1\";
8797 return \"mr %0,%1\;mr %L0,%L1\";
8799 /* If the low-address word is used in the address, we must load it
8800 last. Otherwise, load it first. Note that we cannot have
8801 auto-increment in that case since the address register is known to be
8803 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8805 return \"ld %L0,%L1\;ld %0,%1\";
8807 return \"ld%U1 %0,%1\;ld %L0,%L1\";
8809 return \"std%U0 %1,%0\;std %L1,%L0\";
8812 [(set_attr "type" "*,load,store")
8813 (set_attr "length" "8,8,8")])
8815 (define_expand "load_multiple"
8816 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
8817 (match_operand:SI 1 "" ""))
8818 (use (match_operand:SI 2 "" ""))])]
8819 "TARGET_STRING && !TARGET_POWERPC64"
8827 /* Support only loading a constant number of fixed-point registers from
8828 memory and only bother with this if more than two; the machine
8829 doesn't support more than eight. */
8830 if (GET_CODE (operands[2]) != CONST_INT
8831 || INTVAL (operands[2]) <= 2
8832 || INTVAL (operands[2]) > 8
8833 || GET_CODE (operands[1]) != MEM
8834 || GET_CODE (operands[0]) != REG
8835 || REGNO (operands[0]) >= 32)
8838 count = INTVAL (operands[2]);
8839 regno = REGNO (operands[0]);
8841 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
8842 op1 = replace_equiv_address (operands[1],
8843 force_reg (SImode, XEXP (operands[1], 0)));
8845 for (i = 0; i < count; i++)
8846 XVECEXP (operands[3], 0, i)
8847 = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
8848 adjust_address (op1, SImode, i * 4));
8852 [(match_parallel 0 "load_multiple_operation"
8853 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
8854 (mem:SI (match_operand:SI 2 "gpc_reg_operand" "b")))])]
8858 /* We have to handle the case where the pseudo used to contain the address
8859 is assigned to one of the output registers. */
8861 int words = XVECLEN (operands[0], 0);
8864 if (XVECLEN (operands[0], 0) == 1)
8865 return \"{l|lwz} %1,0(%2)\";
8867 for (i = 0; i < words; i++)
8868 if (refers_to_regno_p (REGNO (operands[1]) + i,
8869 REGNO (operands[1]) + i + 1, operands[2], 0))
8873 xop[0] = operands[1];
8874 xop[1] = operands[2];
8875 xop[2] = GEN_INT (4 * (words-1));
8876 output_asm_insn (\"{lsi|lswi} %0,%1,%2\;{l|lwz} %1,%2(%1)\", xop);
8881 xop[0] = operands[1];
8882 xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
8883 xop[2] = GEN_INT (4 * (words-1));
8884 output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
8889 for (j = 0; j < words; j++)
8892 xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
8893 xop[1] = operands[2];
8894 xop[2] = GEN_INT (j * 4);
8895 output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
8897 xop[0] = operands[2];
8898 xop[1] = GEN_INT (i * 4);
8899 output_asm_insn (\"{l|lwz} %0,%1(%0)\", xop);
8904 return \"{lsi|lswi} %1,%2,%N0\";
8906 [(set_attr "type" "load")
8907 (set_attr "length" "32")])
8910 (define_expand "store_multiple"
8911 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
8912 (match_operand:SI 1 "" ""))
8913 (clobber (scratch:SI))
8914 (use (match_operand:SI 2 "" ""))])]
8915 "TARGET_STRING && !TARGET_POWERPC64"
8924 /* Support only storing a constant number of fixed-point registers to
8925 memory and only bother with this if more than two; the machine
8926 doesn't support more than eight. */
8927 if (GET_CODE (operands[2]) != CONST_INT
8928 || INTVAL (operands[2]) <= 2
8929 || INTVAL (operands[2]) > 8
8930 || GET_CODE (operands[0]) != MEM
8931 || GET_CODE (operands[1]) != REG
8932 || REGNO (operands[1]) >= 32)
8935 count = INTVAL (operands[2]);
8936 regno = REGNO (operands[1]);
8938 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
8939 to = force_reg (SImode, XEXP (operands[0], 0));
8940 op0 = replace_equiv_address (operands[0], to);
8942 XVECEXP (operands[3], 0, 0)
8943 = gen_rtx_SET (VOIDmode, adjust_address (op0, SImode, 0), operands[1]);
8944 XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
8945 gen_rtx_SCRATCH (SImode));
8947 for (i = 1; i < count; i++)
8948 XVECEXP (operands[3], 0, i + 1)
8949 = gen_rtx_SET (VOIDmode,
8950 adjust_address (op0, SImode, i * 4),
8951 gen_rtx_REG (SImode, regno + i));
8955 [(match_parallel 0 "store_multiple_operation"
8956 [(set (match_operand:SI 1 "indirect_operand" "=Q")
8957 (match_operand:SI 2 "gpc_reg_operand" "r"))
8958 (clobber (match_scratch:SI 3 "=q"))])]
8959 "TARGET_STRING && TARGET_POWER"
8960 "{stsi|stswi} %2,%P1,%O0"
8961 [(set_attr "type" "store")])
8964 [(match_parallel 0 "store_multiple_operation"
8965 [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
8966 (match_operand:SI 2 "gpc_reg_operand" "r"))
8967 (clobber (match_scratch:SI 3 "X"))])]
8968 "TARGET_STRING && ! TARGET_POWER"
8969 "{stsi|stswi} %2,%1,%O0"
8970 [(set_attr "type" "store")])
8973 ;; String/block move insn.
8974 ;; Argument 0 is the destination
8975 ;; Argument 1 is the source
8976 ;; Argument 2 is the length
8977 ;; Argument 3 is the alignment
8979 (define_expand "movstrsi"
8980 [(parallel [(set (match_operand:BLK 0 "" "")
8981 (match_operand:BLK 1 "" ""))
8982 (use (match_operand:SI 2 "" ""))
8983 (use (match_operand:SI 3 "" ""))])]
8987 if (expand_block_move (operands))
8993 ;; Move up to 32 bytes at a time. The fixed registers are needed because the
8994 ;; register allocator doesn't have a clue about allocating 8 word registers.
8995 ;; rD/rS = r5 is preferred, efficient form.
8996 (define_expand "movstrsi_8reg"
8997 [(parallel [(set (match_operand 0 "" "")
8998 (match_operand 1 "" ""))
8999 (use (match_operand 2 "" ""))
9000 (use (match_operand 3 "" ""))
9001 (clobber (reg:SI 5))
9002 (clobber (reg:SI 6))
9003 (clobber (reg:SI 7))
9004 (clobber (reg:SI 8))
9005 (clobber (reg:SI 9))
9006 (clobber (reg:SI 10))
9007 (clobber (reg:SI 11))
9008 (clobber (reg:SI 12))
9009 (clobber (match_scratch:SI 4 ""))])]
9014 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9015 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9016 (use (match_operand:SI 2 "immediate_operand" "i"))
9017 (use (match_operand:SI 3 "immediate_operand" "i"))
9018 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9019 (clobber (reg:SI 6))
9020 (clobber (reg:SI 7))
9021 (clobber (reg:SI 8))
9022 (clobber (reg:SI 9))
9023 (clobber (reg:SI 10))
9024 (clobber (reg:SI 11))
9025 (clobber (reg:SI 12))
9026 (clobber (match_scratch:SI 5 "=q"))]
9027 "TARGET_STRING && TARGET_POWER
9028 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9029 || INTVAL (operands[2]) == 0)
9030 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9031 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9032 && REGNO (operands[4]) == 5"
9033 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9034 [(set_attr "type" "load")
9035 (set_attr "length" "8")])
9038 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9039 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9040 (use (match_operand:SI 2 "immediate_operand" "i"))
9041 (use (match_operand:SI 3 "immediate_operand" "i"))
9042 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9043 (clobber (reg:SI 6))
9044 (clobber (reg:SI 7))
9045 (clobber (reg:SI 8))
9046 (clobber (reg:SI 9))
9047 (clobber (reg:SI 10))
9048 (clobber (reg:SI 11))
9049 (clobber (reg:SI 12))
9050 (clobber (match_scratch:SI 5 "X"))]
9051 "TARGET_STRING && ! TARGET_POWER
9052 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9053 || INTVAL (operands[2]) == 0)
9054 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9055 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9056 && REGNO (operands[4]) == 5"
9057 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9058 [(set_attr "type" "load")
9059 (set_attr "length" "8")])
9062 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9063 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9064 (use (match_operand:SI 2 "immediate_operand" "i"))
9065 (use (match_operand:SI 3 "immediate_operand" "i"))
9066 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9067 (clobber (reg:SI 6))
9068 (clobber (reg:SI 7))
9069 (clobber (reg:SI 8))
9070 (clobber (reg:SI 9))
9071 (clobber (reg:SI 10))
9072 (clobber (reg:SI 11))
9073 (clobber (reg:SI 12))
9074 (clobber (match_scratch:SI 5 "X"))]
9075 "TARGET_STRING && TARGET_POWERPC64
9076 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
9077 || INTVAL (operands[2]) == 0)
9078 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
9079 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
9080 && REGNO (operands[4]) == 5"
9081 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9082 [(set_attr "type" "load")
9083 (set_attr "length" "8")])
9085 ;; Move up to 24 bytes at a time. The fixed registers are needed because the
9086 ;; register allocator doesn't have a clue about allocating 6 word registers.
9087 ;; rD/rS = r5 is preferred, efficient form.
9088 (define_expand "movstrsi_6reg"
9089 [(parallel [(set (match_operand 0 "" "")
9090 (match_operand 1 "" ""))
9091 (use (match_operand 2 "" ""))
9092 (use (match_operand 3 "" ""))
9093 (clobber (reg:SI 5))
9094 (clobber (reg:SI 6))
9095 (clobber (reg:SI 7))
9096 (clobber (reg:SI 8))
9097 (clobber (reg:SI 9))
9098 (clobber (reg:SI 10))
9099 (clobber (match_scratch:SI 4 ""))])]
9104 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9105 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9106 (use (match_operand:SI 2 "immediate_operand" "i"))
9107 (use (match_operand:SI 3 "immediate_operand" "i"))
9108 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9109 (clobber (reg:SI 6))
9110 (clobber (reg:SI 7))
9111 (clobber (reg:SI 8))
9112 (clobber (reg:SI 9))
9113 (clobber (reg:SI 10))
9114 (clobber (match_scratch:SI 5 "=q"))]
9115 "TARGET_STRING && TARGET_POWER
9116 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24
9117 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9118 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9119 && REGNO (operands[4]) == 5"
9120 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9121 [(set_attr "type" "load")
9122 (set_attr "length" "8")])
9125 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9126 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9127 (use (match_operand:SI 2 "immediate_operand" "i"))
9128 (use (match_operand:SI 3 "immediate_operand" "i"))
9129 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9130 (clobber (reg:SI 6))
9131 (clobber (reg:SI 7))
9132 (clobber (reg:SI 8))
9133 (clobber (reg:SI 9))
9134 (clobber (reg:SI 10))
9135 (clobber (match_scratch:SI 5 "X"))]
9136 "TARGET_STRING && ! TARGET_POWER
9137 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
9138 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9139 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9140 && REGNO (operands[4]) == 5"
9141 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9142 [(set_attr "type" "load")
9143 (set_attr "length" "8")])
9146 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9147 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9148 (use (match_operand:SI 2 "immediate_operand" "i"))
9149 (use (match_operand:SI 3 "immediate_operand" "i"))
9150 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9151 (clobber (reg:SI 6))
9152 (clobber (reg:SI 7))
9153 (clobber (reg:SI 8))
9154 (clobber (reg:SI 9))
9155 (clobber (reg:SI 10))
9156 (clobber (match_scratch:SI 5 "X"))]
9157 "TARGET_STRING && TARGET_POWERPC64
9158 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
9159 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
9160 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
9161 && REGNO (operands[4]) == 5"
9162 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9163 [(set_attr "type" "load")
9164 (set_attr "length" "8")])
9166 ;; Move up to 16 bytes at a time, using 4 fixed registers to avoid spill
9167 ;; problems with TImode.
9168 ;; rD/rS = r5 is preferred, efficient form.
9169 (define_expand "movstrsi_4reg"
9170 [(parallel [(set (match_operand 0 "" "")
9171 (match_operand 1 "" ""))
9172 (use (match_operand 2 "" ""))
9173 (use (match_operand 3 "" ""))
9174 (clobber (reg:SI 5))
9175 (clobber (reg:SI 6))
9176 (clobber (reg:SI 7))
9177 (clobber (reg:SI 8))
9178 (clobber (match_scratch:SI 4 ""))])]
9183 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9184 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9185 (use (match_operand:SI 2 "immediate_operand" "i"))
9186 (use (match_operand:SI 3 "immediate_operand" "i"))
9187 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9188 (clobber (reg:SI 6))
9189 (clobber (reg:SI 7))
9190 (clobber (reg:SI 8))
9191 (clobber (match_scratch:SI 5 "=q"))]
9192 "TARGET_STRING && TARGET_POWER
9193 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9194 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9195 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9196 && REGNO (operands[4]) == 5"
9197 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9198 [(set_attr "type" "load")
9199 (set_attr "length" "8")])
9202 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9203 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9204 (use (match_operand:SI 2 "immediate_operand" "i"))
9205 (use (match_operand:SI 3 "immediate_operand" "i"))
9206 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9207 (clobber (reg:SI 6))
9208 (clobber (reg:SI 7))
9209 (clobber (reg:SI 8))
9210 (clobber (match_scratch:SI 5 "X"))]
9211 "TARGET_STRING && ! TARGET_POWER
9212 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9213 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9214 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9215 && REGNO (operands[4]) == 5"
9216 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9217 [(set_attr "type" "load")
9218 (set_attr "length" "8")])
9221 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9222 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9223 (use (match_operand:SI 2 "immediate_operand" "i"))
9224 (use (match_operand:SI 3 "immediate_operand" "i"))
9225 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9226 (clobber (reg:SI 6))
9227 (clobber (reg:SI 7))
9228 (clobber (reg:SI 8))
9229 (clobber (match_scratch:SI 5 "X"))]
9230 "TARGET_STRING && TARGET_POWERPC64
9231 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9232 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9233 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9234 && REGNO (operands[4]) == 5"
9235 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9236 [(set_attr "type" "load")
9237 (set_attr "length" "8")])
9239 ;; Move up to 8 bytes at a time.
9240 (define_expand "movstrsi_2reg"
9241 [(parallel [(set (match_operand 0 "" "")
9242 (match_operand 1 "" ""))
9243 (use (match_operand 2 "" ""))
9244 (use (match_operand 3 "" ""))
9245 (clobber (match_scratch:DI 4 ""))
9246 (clobber (match_scratch:SI 5 ""))])]
9247 "TARGET_STRING && ! TARGET_POWERPC64"
9251 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9252 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9253 (use (match_operand:SI 2 "immediate_operand" "i"))
9254 (use (match_operand:SI 3 "immediate_operand" "i"))
9255 (clobber (match_scratch:DI 4 "=&r"))
9256 (clobber (match_scratch:SI 5 "=q"))]
9257 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
9258 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9259 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9260 [(set_attr "type" "load")
9261 (set_attr "length" "8")])
9264 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9265 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9266 (use (match_operand:SI 2 "immediate_operand" "i"))
9267 (use (match_operand:SI 3 "immediate_operand" "i"))
9268 (clobber (match_scratch:DI 4 "=&r"))
9269 (clobber (match_scratch:SI 5 "X"))]
9270 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
9271 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9272 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9273 [(set_attr "type" "load")
9274 (set_attr "length" "8")])
9276 ;; Move up to 4 bytes at a time.
9277 (define_expand "movstrsi_1reg"
9278 [(parallel [(set (match_operand 0 "" "")
9279 (match_operand 1 "" ""))
9280 (use (match_operand 2 "" ""))
9281 (use (match_operand 3 "" ""))
9282 (clobber (match_scratch:SI 4 ""))
9283 (clobber (match_scratch:SI 5 ""))])]
9288 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9289 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9290 (use (match_operand:SI 2 "immediate_operand" "i"))
9291 (use (match_operand:SI 3 "immediate_operand" "i"))
9292 (clobber (match_scratch:SI 4 "=&r"))
9293 (clobber (match_scratch:SI 5 "=q"))]
9294 "TARGET_STRING && TARGET_POWER
9295 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9296 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9297 [(set_attr "type" "load")
9298 (set_attr "length" "8")])
9301 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9302 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9303 (use (match_operand:SI 2 "immediate_operand" "i"))
9304 (use (match_operand:SI 3 "immediate_operand" "i"))
9305 (clobber (match_scratch:SI 4 "=&r"))
9306 (clobber (match_scratch:SI 5 "X"))]
9307 "TARGET_STRING && ! TARGET_POWER
9308 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9309 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9310 [(set_attr "type" "load")
9311 (set_attr "length" "8")])
9314 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9315 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9316 (use (match_operand:SI 2 "immediate_operand" "i"))
9317 (use (match_operand:SI 3 "immediate_operand" "i"))
9318 (clobber (match_scratch:SI 4 "=&r"))
9319 (clobber (match_scratch:SI 5 "X"))]
9320 "TARGET_STRING && TARGET_POWERPC64
9321 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9322 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9323 [(set_attr "type" "load")
9324 (set_attr "length" "8")])
9327 ;; Define insns that do load or store with update. Some of these we can
9328 ;; get by using pre-decrement or pre-increment, but the hardware can also
9329 ;; do cases where the increment is not the size of the object.
9331 ;; In all these cases, we use operands 0 and 1 for the register being
9332 ;; incremented because those are the operands that local-alloc will
9333 ;; tie and these are the pair most likely to be tieable (and the ones
9334 ;; that will benefit the most).
9336 (define_insn "*movdi_update1"
9337 [(set (match_operand:DI 3 "gpc_reg_operand" "=r,r")
9338 (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9339 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I"))))
9340 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9341 (plus:DI (match_dup 1) (match_dup 2)))]
9342 "TARGET_POWERPC64 && TARGET_UPDATE"
9346 [(set_attr "type" "load")])
9348 (define_insn "*movdi_update2"
9349 [(set (match_operand:DI 3 "gpc_reg_operand" "=r")
9351 (mem:SI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0")
9352 (match_operand:DI 2 "gpc_reg_operand" "r")))))
9353 (set (match_operand:DI 0 "gpc_reg_operand" "=b")
9354 (plus:DI (match_dup 1) (match_dup 2)))]
9357 [(set_attr "type" "load")])
9359 (define_insn "movdi_update"
9360 [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9361 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I")))
9362 (match_operand:DI 3 "gpc_reg_operand" "r,r"))
9363 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9364 (plus:DI (match_dup 1) (match_dup 2)))]
9365 "TARGET_POWERPC64 && TARGET_UPDATE"
9369 [(set_attr "type" "store")])
9371 (define_insn "*movsi_update1"
9372 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9373 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9374 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9375 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9376 (plus:SI (match_dup 1) (match_dup 2)))]
9379 {lux|lwzux} %3,%0,%2
9380 {lu|lwzu} %3,%2(%0)"
9381 [(set_attr "type" "load")])
9383 (define_insn "movsi_update"
9384 [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9385 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9386 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
9387 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9388 (plus:SI (match_dup 1) (match_dup 2)))]
9391 {stux|stwux} %3,%0,%2
9392 {stu|stwu} %3,%2(%0)"
9393 [(set_attr "type" "store")])
9395 (define_insn "*movhi_update"
9396 [(set (match_operand:HI 3 "gpc_reg_operand" "=r,r")
9397 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9398 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9399 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9400 (plus:SI (match_dup 1) (match_dup 2)))]
9405 [(set_attr "type" "load")])
9407 (define_insn "*movhi_update2"
9408 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9410 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9411 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9412 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9413 (plus:SI (match_dup 1) (match_dup 2)))]
9418 [(set_attr "type" "load")])
9420 (define_insn "*movhi_update3"
9421 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9423 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9424 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9425 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9426 (plus:SI (match_dup 1) (match_dup 2)))]
9431 [(set_attr "type" "load")])
9433 (define_insn "*movhi_update4"
9434 [(set (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9435 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9436 (match_operand:HI 3 "gpc_reg_operand" "r,r"))
9437 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9438 (plus:SI (match_dup 1) (match_dup 2)))]
9443 [(set_attr "type" "store")])
9445 (define_insn "*movqi_update1"
9446 [(set (match_operand:QI 3 "gpc_reg_operand" "=r,r")
9447 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9448 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9449 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9450 (plus:SI (match_dup 1) (match_dup 2)))]
9455 [(set_attr "type" "load")])
9457 (define_insn "*movqi_update2"
9458 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9460 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9461 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9462 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9463 (plus:SI (match_dup 1) (match_dup 2)))]
9468 [(set_attr "type" "load")])
9470 (define_insn "*movqi_update3"
9471 [(set (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9472 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9473 (match_operand:QI 3 "gpc_reg_operand" "r,r"))
9474 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9475 (plus:SI (match_dup 1) (match_dup 2)))]
9480 [(set_attr "type" "store")])
9482 (define_insn "*movsf_update1"
9483 [(set (match_operand:SF 3 "gpc_reg_operand" "=f,f")
9484 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9485 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9486 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9487 (plus:SI (match_dup 1) (match_dup 2)))]
9488 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9492 [(set_attr "type" "fpload")])
9494 (define_insn "*movsf_update2"
9495 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9496 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9497 (match_operand:SF 3 "gpc_reg_operand" "f,f"))
9498 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9499 (plus:SI (match_dup 1) (match_dup 2)))]
9500 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9504 [(set_attr "type" "fpstore")])
9506 (define_insn "*movsf_update3"
9507 [(set (match_operand:SF 3 "gpc_reg_operand" "=r,r")
9508 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9509 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9510 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9511 (plus:SI (match_dup 1) (match_dup 2)))]
9512 "TARGET_SOFT_FLOAT && TARGET_UPDATE"
9514 {lux|lwzux} %3,%0,%2
9515 {lu|lwzu} %3,%2(%0)"
9516 [(set_attr "type" "load")])
9518 (define_insn "*movsf_update4"
9519 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9520 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9521 (match_operand:SF 3 "gpc_reg_operand" "r,r"))
9522 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9523 (plus:SI (match_dup 1) (match_dup 2)))]
9524 "TARGET_SOFT_FLOAT && TARGET_UPDATE"
9526 {stux|stwux} %3,%0,%2
9527 {stu|stwu} %3,%2(%0)"
9528 [(set_attr "type" "store")])
9530 (define_insn "*movdf_update1"
9531 [(set (match_operand:DF 3 "gpc_reg_operand" "=f,f")
9532 (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9533 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9534 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9535 (plus:SI (match_dup 1) (match_dup 2)))]
9536 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9540 [(set_attr "type" "fpload")])
9542 (define_insn "*movdf_update2"
9543 [(set (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9544 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9545 (match_operand:DF 3 "gpc_reg_operand" "f,f"))
9546 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9547 (plus:SI (match_dup 1) (match_dup 2)))]
9548 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9552 [(set_attr "type" "fpstore")])
9554 ;; Peephole to convert two consecutive FP loads or stores into lfq/stfq.
9557 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
9558 (match_operand:DF 1 "memory_operand" ""))
9559 (set (match_operand:DF 2 "gpc_reg_operand" "=f")
9560 (match_operand:DF 3 "memory_operand" ""))]
9562 && TARGET_HARD_FLOAT
9563 && registers_ok_for_quad_peep (operands[0], operands[2])
9564 && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
9565 && addrs_ok_for_quad_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
9569 [(set (match_operand:DF 0 "memory_operand" "")
9570 (match_operand:DF 1 "gpc_reg_operand" "f"))
9571 (set (match_operand:DF 2 "memory_operand" "")
9572 (match_operand:DF 3 "gpc_reg_operand" "f"))]
9574 && TARGET_HARD_FLOAT
9575 && registers_ok_for_quad_peep (operands[1], operands[3])
9576 && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
9577 && addrs_ok_for_quad_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
9580 ;; Next come insns related to the calling sequence.
9582 ;; First, an insn to allocate new stack space for dynamic use (e.g., alloca).
9583 ;; We move the back-chain and decrement the stack pointer.
9585 (define_expand "allocate_stack"
9586 [(set (match_operand 0 "gpc_reg_operand" "=r")
9587 (minus (reg 1) (match_operand 1 "reg_or_short_operand" "")))
9589 (minus (reg 1) (match_dup 1)))]
9592 { rtx chain = gen_reg_rtx (Pmode);
9593 rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
9596 emit_move_insn (chain, stack_bot);
9598 /* Check stack bounds if necessary. */
9599 if (current_function_limit_stack)
9602 available = expand_binop (Pmode, sub_optab,
9603 stack_pointer_rtx, stack_limit_rtx,
9604 NULL_RTX, 1, OPTAB_WIDEN);
9605 emit_insn (gen_cond_trap (LTU, available, operands[1], const0_rtx));
9608 if (GET_CODE (operands[1]) != CONST_INT
9609 || INTVAL (operands[1]) < -32767
9610 || INTVAL (operands[1]) > 32768)
9612 neg_op0 = gen_reg_rtx (Pmode);
9614 emit_insn (gen_negsi2 (neg_op0, operands[1]));
9616 emit_insn (gen_negdi2 (neg_op0, operands[1]));
9619 neg_op0 = GEN_INT (- INTVAL (operands[1]));
9622 emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_update))
9623 (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain));
9627 emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
9628 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
9629 emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
9632 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
9636 ;; These patterns say how to save and restore the stack pointer. We need not
9637 ;; save the stack pointer at function level since we are careful to
9638 ;; preserve the backchain. At block level, we have to restore the backchain
9639 ;; when we restore the stack pointer.
9641 ;; For nonlocal gotos, we must save both the stack pointer and its
9642 ;; backchain and restore both. Note that in the nonlocal case, the
9643 ;; save area is a memory location.
9645 (define_expand "save_stack_function"
9646 [(match_operand 0 "any_operand" "")
9647 (match_operand 1 "any_operand" "")]
9651 (define_expand "restore_stack_function"
9652 [(match_operand 0 "any_operand" "")
9653 (match_operand 1 "any_operand" "")]
9657 (define_expand "restore_stack_block"
9658 [(use (match_operand 0 "register_operand" ""))
9659 (set (match_dup 2) (match_dup 3))
9660 (set (match_dup 0) (match_operand 1 "register_operand" ""))
9661 (set (match_dup 3) (match_dup 2))]
9665 operands[2] = gen_reg_rtx (Pmode);
9666 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
9669 (define_expand "save_stack_nonlocal"
9670 [(match_operand 0 "memory_operand" "")
9671 (match_operand 1 "register_operand" "")]
9675 rtx temp = gen_reg_rtx (Pmode);
9677 /* Copy the backchain to the first word, sp to the second. */
9678 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
9679 emit_move_insn (operand_subword (operands[0], 0, 0,
9680 (TARGET_32BIT ? DImode : TImode)),
9682 emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
9687 (define_expand "restore_stack_nonlocal"
9688 [(match_operand 0 "register_operand" "")
9689 (match_operand 1 "memory_operand" "")]
9693 rtx temp = gen_reg_rtx (Pmode);
9695 /* Restore the backchain from the first word, sp from the second. */
9696 emit_move_insn (temp,
9697 operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
9698 emit_move_insn (operands[0],
9699 operand_subword (operands[1], 1, 0,
9700 (TARGET_32BIT ? DImode : TImode)));
9701 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
9705 ;; TOC register handling.
9707 ;; Code to initialize the TOC register...
9709 (define_insn "load_toc_aix_si"
9710 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
9711 (unspec:SI [(const_int 0)] 7))
9713 "DEFAULT_ABI == ABI_AIX && TARGET_32BIT"
9717 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
9718 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
9719 operands[2] = gen_rtx_REG (Pmode, 2);
9720 return \"{l|lwz} %0,%1(%2)\";
9722 [(set_attr "type" "load")])
9724 (define_insn "load_toc_aix_di"
9725 [(parallel [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
9726 (unspec:DI [(const_int 0)] 7))
9728 "DEFAULT_ABI == ABI_AIX && TARGET_64BIT"
9732 #ifdef TARGET_RELOCATABLE
9733 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\",
9734 !TARGET_MINIMAL_TOC || TARGET_RELOCATABLE);
9736 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
9739 strcat (buf, \"@toc\");
9740 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
9741 operands[2] = gen_rtx_REG (Pmode, 2);
9742 return \"ld %0,%1(%2)\";
9744 [(set_attr "type" "load")])
9746 (define_insn "load_toc_v4_pic_si"
9747 [(set (match_operand:SI 0 "register_operand" "=l")
9748 (unspec:SI [(const_int 0)] 7))]
9749 "DEFAULT_ABI == ABI_V4 && flag_pic == 1 && TARGET_32BIT"
9750 "bl _GLOBAL_OFFSET_TABLE_@local-4"
9751 [(set_attr "type" "branch")
9752 (set_attr "length" "4")])
9754 (define_insn "load_toc_v4_PIC_1"
9755 [(set (match_operand:SI 0 "register_operand" "=l")
9756 (match_operand:SI 1 "immediate_operand" "s"))
9757 (unspec [(match_dup 1)] 7)]
9758 "TARGET_ELF && flag_pic == 2"
9760 [(set_attr "type" "branch")
9761 (set_attr "length" "4")])
9763 (define_insn "load_toc_v4_PIC_1b"
9764 [(set (match_operand:SI 0 "register_operand" "=l")
9765 (match_operand:SI 1 "immediate_operand" "s"))
9766 (unspec [(match_dup 1) (match_operand 2 "immediate_operand" "s")] 6)]
9767 "TARGET_ELF && flag_pic == 2"
9768 "bl %1\\n\\t.long %2-%1+4\\n%1:"
9769 [(set_attr "type" "branch")
9770 (set_attr "length" "8")])
9772 (define_insn "load_toc_v4_PIC_2"
9773 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
9774 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r")
9775 (minus:SI (match_operand:SI 2 "immediate_operand" "s")
9776 (match_operand:SI 3 "immediate_operand" "s")))))]
9777 "TARGET_ELF && flag_pic == 2"
9778 "{l|lwz} %0,%2-%3(%1)"
9779 [(set_attr "type" "load")])
9781 (define_insn "load_macho_picbase"
9782 [(set (match_operand:SI 0 "register_operand" "=l")
9783 (unspec:SI [(const_int 0)] 15))]
9784 "(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
9788 char *picbase = machopic_function_base_name ();
9789 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
9791 return \"bcl 20,31,%1\\n%1:\";
9793 [(set_attr "type" "branch")
9794 (set_attr "length" "4")])
9796 ;; If the TOC is shared over a translation unit, as happens with all
9797 ;; the kinds of PIC that we support, we need to restore the TOC
9798 ;; pointer only when jumping over units of translation.
9800 (define_expand "builtin_setjmp_receiver"
9801 [(use (label_ref (match_operand 0 "" "")))]
9802 "(DEFAULT_ABI == ABI_V4 && flag_pic == 1)
9803 || (TARGET_TOC && TARGET_MINIMAL_TOC)"
9806 rs6000_emit_load_toc_table (FALSE);
9810 ;; A function pointer under AIX is a pointer to a data area whose first word
9811 ;; contains the actual address of the function, whose second word contains a
9812 ;; pointer to its TOC, and whose third word contains a value to place in the
9813 ;; static chain register (r11). Note that if we load the static chain, our
9814 ;; "trampoline" need not have any executable code.
9816 (define_expand "call_indirect_aix32"
9818 (mem:SI (match_operand:SI 0 "gpc_reg_operand" "")))
9819 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
9822 (mem:SI (plus:SI (match_dup 0)
9825 (mem:SI (plus:SI (match_dup 0)
9827 (parallel [(call (mem:SI (match_dup 2))
9828 (match_operand 1 "" ""))
9832 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9833 (clobber (scratch:SI))])]
9836 { operands[2] = gen_reg_rtx (SImode); }")
9838 (define_expand "call_indirect_aix64"
9840 (mem:DI (match_operand:DI 0 "gpc_reg_operand" "")))
9841 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
9844 (mem:DI (plus:DI (match_dup 0)
9847 (mem:DI (plus:DI (match_dup 0)
9849 (parallel [(call (mem:SI (match_dup 2))
9850 (match_operand 1 "" ""))
9854 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
9855 (clobber (scratch:SI))])]
9858 { operands[2] = gen_reg_rtx (DImode); }")
9860 (define_expand "call_value_indirect_aix32"
9862 (mem:SI (match_operand:SI 1 "gpc_reg_operand" "")))
9863 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
9866 (mem:SI (plus:SI (match_dup 1)
9869 (mem:SI (plus:SI (match_dup 1)
9871 (parallel [(set (match_operand 0 "" "")
9872 (call (mem:SI (match_dup 3))
9873 (match_operand 2 "" "")))
9877 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9878 (clobber (scratch:SI))])]
9881 { operands[3] = gen_reg_rtx (SImode); }")
9883 (define_expand "call_value_indirect_aix64"
9885 (mem:DI (match_operand:DI 1 "gpc_reg_operand" "")))
9886 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
9889 (mem:DI (plus:DI (match_dup 1)
9892 (mem:DI (plus:DI (match_dup 1)
9894 (parallel [(set (match_operand 0 "" "")
9895 (call (mem:SI (match_dup 3))
9896 (match_operand 2 "" "")))
9900 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
9901 (clobber (scratch:SI))])]
9904 { operands[3] = gen_reg_rtx (DImode); }")
9906 ;; Now the definitions for the call and call_value insns
9907 (define_expand "call"
9908 [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
9909 (match_operand 1 "" ""))
9910 (use (match_operand 2 "" ""))
9911 (clobber (scratch:SI))])]
9917 operands[0] = machopic_indirect_call_target (operands[0]);
9920 if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
9923 operands[0] = XEXP (operands[0], 0);
9925 if (GET_CODE (operands[0]) != SYMBOL_REF
9926 || (INTVAL (operands[2]) & CALL_LONG) != 0)
9928 if (INTVAL (operands[2]) & CALL_LONG)
9929 operands[0] = rs6000_longcall_ref (operands[0]);
9931 if (DEFAULT_ABI == ABI_V4
9932 || DEFAULT_ABI == ABI_AIX_NODESC
9933 || DEFAULT_ABI == ABI_DARWIN)
9934 operands[0] = force_reg (Pmode, operands[0]);
9936 else if (DEFAULT_ABI == ABI_AIX)
9938 /* AIX function pointers are really pointers to a three word
9940 emit_call_insn (TARGET_32BIT
9941 ? gen_call_indirect_aix32 (force_reg (SImode,
9944 : gen_call_indirect_aix64 (force_reg (DImode,
9954 (define_expand "call_value"
9955 [(parallel [(set (match_operand 0 "" "")
9956 (call (mem:SI (match_operand 1 "address_operand" ""))
9957 (match_operand 2 "" "")))
9958 (use (match_operand 3 "" ""))
9959 (clobber (scratch:SI))])]
9965 operands[1] = machopic_indirect_call_target (operands[1]);
9968 if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
9971 operands[1] = XEXP (operands[1], 0);
9973 if (GET_CODE (operands[1]) != SYMBOL_REF
9974 || (INTVAL (operands[3]) & CALL_LONG) != 0)
9976 if (INTVAL (operands[3]) & CALL_LONG)
9977 operands[1] = rs6000_longcall_ref (operands[1]);
9979 if (DEFAULT_ABI == ABI_V4
9980 || DEFAULT_ABI == ABI_AIX_NODESC
9981 || DEFAULT_ABI == ABI_DARWIN)
9982 operands[0] = force_reg (Pmode, operands[0]);
9984 else if (DEFAULT_ABI == ABI_AIX)
9986 /* AIX function pointers are really pointers to a three word
9988 emit_call_insn (TARGET_32BIT
9989 ? gen_call_value_indirect_aix32 (operands[0],
9993 : gen_call_value_indirect_aix64 (operands[0],
10004 ;; Call to function in current module. No TOC pointer reload needed.
10005 ;; Operand2 is non-zero if we are using the V.4 calling sequence and
10006 ;; either the function was not prototyped, or it was prototyped as a
10007 ;; variable argument function. It is > 0 if FP registers were passed
10008 ;; and < 0 if they were not.
10010 (define_insn "*call_local32"
10011 [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
10012 (match_operand 1 "" "g,g"))
10013 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10014 (clobber (match_scratch:SI 3 "=l,l"))]
10015 "(INTVAL (operands[2]) & CALL_LONG) == 0"
10018 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10019 output_asm_insn (\"crxor 6,6,6\", operands);
10021 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10022 output_asm_insn (\"creqv 6,6,6\", operands);
10024 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
10026 [(set_attr "type" "branch")
10027 (set_attr "length" "4,8")])
10029 (define_insn "*call_local64"
10030 [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
10031 (match_operand 1 "" "g,g"))
10032 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10033 (clobber (match_scratch:SI 3 "=l,l"))]
10034 "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
10037 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10038 output_asm_insn (\"crxor 6,6,6\", operands);
10040 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10041 output_asm_insn (\"creqv 6,6,6\", operands);
10043 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
10045 [(set_attr "type" "branch")
10046 (set_attr "length" "4,8")])
10048 (define_insn "*call_value_local32"
10049 [(set (match_operand 0 "" "")
10050 (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
10051 (match_operand 2 "" "g,g")))
10052 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10053 (clobber (match_scratch:SI 4 "=l,l"))]
10054 "(INTVAL (operands[3]) & CALL_LONG) == 0"
10057 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10058 output_asm_insn (\"crxor 6,6,6\", operands);
10060 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10061 output_asm_insn (\"creqv 6,6,6\", operands);
10063 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
10065 [(set_attr "type" "branch")
10066 (set_attr "length" "4,8")])
10069 (define_insn "*call_value_local64"
10070 [(set (match_operand 0 "" "")
10071 (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
10072 (match_operand 2 "" "g,g")))
10073 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10074 (clobber (match_scratch:SI 4 "=l,l"))]
10075 "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
10078 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10079 output_asm_insn (\"crxor 6,6,6\", operands);
10081 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10082 output_asm_insn (\"creqv 6,6,6\", operands);
10084 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
10086 [(set_attr "type" "branch")
10087 (set_attr "length" "4,8")])
10089 ;; Call to function which may be in another module. Restore the TOC
10090 ;; pointer (r2) after the call unless this is System V.
10091 ;; Operand2 is non-zero if we are using the V.4 calling sequence and
10092 ;; either the function was not prototyped, or it was prototyped as a
10093 ;; variable argument function. It is > 0 if FP registers were passed
10094 ;; and < 0 if they were not.
10096 (define_insn "*call_indirect_nonlocal_aix32"
10097 [(call (mem:SI (match_operand:SI 0 "register_operand" "cl"))
10098 (match_operand 1 "" "g"))
10102 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10103 (clobber (match_scratch:SI 2 "=l"))]
10104 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
10105 "b%T0l\;{l|lwz} 2,20(1)"
10106 [(set_attr "type" "jmpreg")
10107 (set_attr "length" "8")])
10109 (define_insn "*call_nonlocal_aix32"
10110 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
10111 (match_operand 1 "" "g"))
10112 (use (match_operand:SI 2 "immediate_operand" "O"))
10113 (clobber (match_scratch:SI 3 "=l"))]
10115 && DEFAULT_ABI == ABI_AIX
10116 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10118 [(set_attr "type" "branch")
10119 (set_attr "length" "8")])
10121 (define_insn "*call_indirect_nonlocal_aix64"
10122 [(call (mem:SI (match_operand:DI 0 "register_operand" "cl"))
10123 (match_operand 1 "" "g"))
10127 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10128 (clobber (match_scratch:SI 2 "=l"))]
10129 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
10130 "b%T0l\;ld 2,40(1)"
10131 [(set_attr "type" "jmpreg")
10132 (set_attr "length" "8")])
10134 (define_insn "*call_nonlocal_aix64"
10135 [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
10136 (match_operand 1 "" "g"))
10137 (use (match_operand:SI 2 "immediate_operand" "O"))
10138 (clobber (match_scratch:SI 3 "=l"))]
10140 && DEFAULT_ABI == ABI_AIX
10141 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10143 [(set_attr "type" "branch")
10144 (set_attr "length" "8")])
10146 (define_insn "*call_value_indirect_nonlocal_aix32"
10147 [(set (match_operand 0 "" "")
10148 (call (mem:SI (match_operand:SI 1 "register_operand" "cl"))
10149 (match_operand 2 "" "g")))
10153 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
10154 (clobber (match_scratch:SI 3 "=l"))]
10155 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
10156 "b%T1l\;{l|lwz} 2,20(1)"
10157 [(set_attr "type" "jmpreg")
10158 (set_attr "length" "8")])
10160 (define_insn "*call_value_nonlocal_aix32"
10161 [(set (match_operand 0 "" "")
10162 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
10163 (match_operand 2 "" "g")))
10164 (use (match_operand:SI 3 "immediate_operand" "O"))
10165 (clobber (match_scratch:SI 4 "=l"))]
10167 && DEFAULT_ABI == ABI_AIX
10168 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10170 [(set_attr "type" "branch")
10171 (set_attr "length" "8")])
10173 (define_insn "*call_value_indirect_nonlocal_aix64"
10174 [(set (match_operand 0 "" "")
10175 (call (mem:SI (match_operand:DI 1 "register_operand" "cl"))
10176 (match_operand 2 "" "g")))
10180 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10181 (clobber (match_scratch:SI 3 "=l"))]
10182 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
10183 "b%T1l\;ld 2,40(1)"
10184 [(set_attr "type" "jmpreg")
10185 (set_attr "length" "8")])
10187 (define_insn "*call_value_nonlocal_aix64"
10188 [(set (match_operand 0 "" "")
10189 (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
10190 (match_operand 2 "" "g")))
10191 (use (match_operand:SI 3 "immediate_operand" "O"))
10192 (clobber (match_scratch:SI 4 "=l"))]
10194 && DEFAULT_ABI == ABI_AIX
10195 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10197 [(set_attr "type" "branch")
10198 (set_attr "length" "8")])
10200 ;; A function pointer under System V is just a normal pointer
10201 ;; operands[0] is the function pointer
10202 ;; operands[1] is the stack size to clean up
10203 ;; operands[2] is the value FUNCTION_ARG returns for the VOID argument
10204 ;; which indicates how to set cr1
10206 (define_insn "*call_indirect_nonlocal_sysv"
10207 [(call (mem:SI (match_operand:SI 0 "register_operand" "cl,cl"))
10208 (match_operand 1 "" "g,g"))
10209 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10210 (clobber (match_scratch:SI 3 "=l,l"))]
10211 "DEFAULT_ABI == ABI_AIX_NODESC
10212 || DEFAULT_ABI == ABI_V4
10213 || DEFAULT_ABI == ABI_DARWIN"
10215 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10216 output_asm_insn ("crxor 6,6,6", operands);
10218 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10219 output_asm_insn ("creqv 6,6,6", operands);
10223 [(set_attr "type" "jmpreg,jmpreg")
10224 (set_attr "length" "4,8")])
10226 (define_insn "*call_nonlocal_sysv"
10227 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
10228 (match_operand 1 "" "g,g"))
10229 (use (match_operand:SI 2 "immediate_operand" "O,n"))
10230 (clobber (match_scratch:SI 3 "=l,l"))]
10231 "(DEFAULT_ABI == ABI_AIX_NODESC
10232 || DEFAULT_ABI == ABI_V4
10233 || DEFAULT_ABI == ABI_DARWIN)
10234 && (INTVAL (operands[2]) & CALL_LONG) == 0"
10236 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10237 output_asm_insn ("crxor 6,6,6", operands);
10239 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10240 output_asm_insn ("creqv 6,6,6", operands);
10242 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@plt" : "bl %z0";
10244 [(set_attr "type" "branch,branch")
10245 (set_attr "length" "4,8")])
10247 (define_insn "*call_value_indirect_nonlocal_sysv"
10248 [(set (match_operand 0 "" "")
10249 (call (mem:SI (match_operand:SI 1 "register_operand" "cl,cl"))
10250 (match_operand 2 "" "g,g")))
10251 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10252 (clobber (match_scratch:SI 4 "=l,l"))]
10253 "DEFAULT_ABI == ABI_AIX_NODESC
10254 || DEFAULT_ABI == ABI_V4
10255 || DEFAULT_ABI == ABI_DARWIN"
10257 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10258 output_asm_insn ("crxor 6,6,6", operands);
10260 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10261 output_asm_insn ("creqv 6,6,6", operands);
10265 [(set_attr "type" "jmpreg,jmpreg")
10266 (set_attr "length" "4,8")])
10268 (define_insn "*call_value_nonlocal_sysv"
10269 [(set (match_operand 0 "" "")
10270 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s,s"))
10271 (match_operand 2 "" "g,g")))
10272 (use (match_operand:SI 3 "immediate_operand" "O,n"))
10273 (clobber (match_scratch:SI 4 "=l,l"))]
10274 "(DEFAULT_ABI == ABI_AIX_NODESC
10275 || DEFAULT_ABI == ABI_V4
10276 || DEFAULT_ABI == ABI_DARWIN)
10277 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10279 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10280 output_asm_insn ("crxor 6,6,6", operands);
10282 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10283 output_asm_insn ("creqv 6,6,6", operands);
10285 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@plt" : "bl %z1";
10287 [(set_attr "type" "branch,branch")
10288 (set_attr "length" "4,8")])
10290 ;; Call subroutine returning any type.
10291 (define_expand "untyped_call"
10292 [(parallel [(call (match_operand 0 "" "")
10294 (match_operand 1 "" "")
10295 (match_operand 2 "" "")])]
10301 emit_call_insn (GEN_CALL (operands[0], const0_rtx, const0_rtx, const0_rtx));
10303 for (i = 0; i < XVECLEN (operands[2], 0); i++)
10305 rtx set = XVECEXP (operands[2], 0, i);
10306 emit_move_insn (SET_DEST (set), SET_SRC (set));
10309 /* The optimizer does not know that the call sets the function value
10310 registers we stored in the result block. We avoid problems by
10311 claiming that all hard registers are used and clobbered at this
10313 emit_insn (gen_blockage ());
10318 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
10319 ;; all of memory. This blocks insns from being moved across this point.
10321 (define_insn "blockage"
10322 [(unspec_volatile [(const_int 0)] 0)]
10326 ;; Compare insns are next. Note that the RS/6000 has two types of compares,
10327 ;; signed & unsigned, and one type of branch.
10329 ;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc
10330 ;; insns, and branches. We store the operands of compares until we see
10332 (define_expand "cmpsi"
10334 (compare (match_operand:SI 0 "gpc_reg_operand" "")
10335 (match_operand:SI 1 "reg_or_short_operand" "")))]
10339 /* Take care of the possibility that operands[1] might be negative but
10340 this might be a logical operation. That insn doesn't exist. */
10341 if (GET_CODE (operands[1]) == CONST_INT
10342 && INTVAL (operands[1]) < 0)
10343 operands[1] = force_reg (SImode, operands[1]);
10345 rs6000_compare_op0 = operands[0];
10346 rs6000_compare_op1 = operands[1];
10347 rs6000_compare_fp_p = 0;
10351 (define_expand "cmpdi"
10353 (compare (match_operand:DI 0 "gpc_reg_operand" "")
10354 (match_operand:DI 1 "reg_or_short_operand" "")))]
10358 /* Take care of the possibility that operands[1] might be negative but
10359 this might be a logical operation. That insn doesn't exist. */
10360 if (GET_CODE (operands[1]) == CONST_INT
10361 && INTVAL (operands[1]) < 0)
10362 operands[1] = force_reg (DImode, operands[1]);
10364 rs6000_compare_op0 = operands[0];
10365 rs6000_compare_op1 = operands[1];
10366 rs6000_compare_fp_p = 0;
10370 (define_expand "cmpsf"
10371 [(set (cc0) (compare (match_operand:SF 0 "gpc_reg_operand" "")
10372 (match_operand:SF 1 "gpc_reg_operand" "")))]
10373 "TARGET_HARD_FLOAT"
10376 rs6000_compare_op0 = operands[0];
10377 rs6000_compare_op1 = operands[1];
10378 rs6000_compare_fp_p = 1;
10382 (define_expand "cmpdf"
10383 [(set (cc0) (compare (match_operand:DF 0 "gpc_reg_operand" "")
10384 (match_operand:DF 1 "gpc_reg_operand" "")))]
10385 "TARGET_HARD_FLOAT"
10388 rs6000_compare_op0 = operands[0];
10389 rs6000_compare_op1 = operands[1];
10390 rs6000_compare_fp_p = 1;
10394 (define_expand "cmptf"
10395 [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "")
10396 (match_operand:TF 1 "gpc_reg_operand" "")))]
10397 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
10400 rs6000_compare_op0 = operands[0];
10401 rs6000_compare_op1 = operands[1];
10402 rs6000_compare_fp_p = 1;
10406 (define_expand "beq"
10407 [(use (match_operand 0 "" ""))]
10409 "{ rs6000_emit_cbranch (EQ, operands[0]); DONE; }")
10411 (define_expand "bne"
10412 [(use (match_operand 0 "" ""))]
10414 "{ rs6000_emit_cbranch (NE, operands[0]); DONE; }")
10416 (define_expand "bge"
10417 [(use (match_operand 0 "" ""))]
10419 "{ rs6000_emit_cbranch (GE, operands[0]); DONE; }")
10421 (define_expand "bgt"
10422 [(use (match_operand 0 "" ""))]
10424 "{ rs6000_emit_cbranch (GT, operands[0]); DONE; }")
10426 (define_expand "ble"
10427 [(use (match_operand 0 "" ""))]
10429 "{ rs6000_emit_cbranch (LE, operands[0]); DONE; }")
10431 (define_expand "blt"
10432 [(use (match_operand 0 "" ""))]
10434 "{ rs6000_emit_cbranch (LT, operands[0]); DONE; }")
10436 (define_expand "bgeu"
10437 [(use (match_operand 0 "" ""))]
10439 "{ rs6000_emit_cbranch (GEU, operands[0]); DONE; }")
10441 (define_expand "bgtu"
10442 [(use (match_operand 0 "" ""))]
10444 "{ rs6000_emit_cbranch (GTU, operands[0]); DONE; }")
10446 (define_expand "bleu"
10447 [(use (match_operand 0 "" ""))]
10449 "{ rs6000_emit_cbranch (LEU, operands[0]); DONE; }")
10451 (define_expand "bltu"
10452 [(use (match_operand 0 "" ""))]
10454 "{ rs6000_emit_cbranch (LTU, operands[0]); DONE; }")
10456 (define_expand "bunordered"
10457 [(use (match_operand 0 "" ""))]
10459 "{ rs6000_emit_cbranch (UNORDERED, operands[0]); DONE; }")
10461 (define_expand "bordered"
10462 [(use (match_operand 0 "" ""))]
10464 "{ rs6000_emit_cbranch (ORDERED, operands[0]); DONE; }")
10466 (define_expand "buneq"
10467 [(use (match_operand 0 "" ""))]
10469 "{ rs6000_emit_cbranch (UNEQ, operands[0]); DONE; }")
10471 (define_expand "bunge"
10472 [(use (match_operand 0 "" ""))]
10474 "{ rs6000_emit_cbranch (UNGE, operands[0]); DONE; }")
10476 (define_expand "bungt"
10477 [(use (match_operand 0 "" ""))]
10479 "{ rs6000_emit_cbranch (UNGT, operands[0]); DONE; }")
10481 (define_expand "bunle"
10482 [(use (match_operand 0 "" ""))]
10484 "{ rs6000_emit_cbranch (UNLE, operands[0]); DONE; }")
10486 (define_expand "bunlt"
10487 [(use (match_operand 0 "" ""))]
10489 "{ rs6000_emit_cbranch (UNLT, operands[0]); DONE; }")
10491 (define_expand "bltgt"
10492 [(use (match_operand 0 "" ""))]
10494 "{ rs6000_emit_cbranch (LTGT, operands[0]); DONE; }")
10496 ;; For SNE, we would prefer that the xor/abs sequence be used for integers.
10497 ;; For SEQ, likewise, except that comparisons with zero should be done
10498 ;; with an scc insns. However, due to the order that combine see the
10499 ;; resulting insns, we must, in fact, allow SEQ for integers. Fail in
10500 ;; the cases we don't want to handle.
10501 (define_expand "seq"
10502 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10504 "{ rs6000_emit_sCOND (EQ, operands[0]); DONE; }")
10506 (define_expand "sne"
10507 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10511 if (! rs6000_compare_fp_p)
10514 rs6000_emit_sCOND (NE, operands[0]);
10518 ;; A > 0 is best done using the portable sequence, so fail in that case.
10519 (define_expand "sgt"
10520 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10524 if (! rs6000_compare_fp_p
10525 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10528 rs6000_emit_sCOND (GT, operands[0]);
10532 ;; A < 0 is best done in the portable way for A an integer.
10533 (define_expand "slt"
10534 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10538 if (! rs6000_compare_fp_p
10539 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10542 rs6000_emit_sCOND (LT, operands[0]);
10546 ;; A >= 0 is best done the portable way for A an integer.
10547 (define_expand "sge"
10548 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10552 if (! rs6000_compare_fp_p
10553 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10556 rs6000_emit_sCOND (GE, operands[0]);
10560 ;; A <= 0 is best done the portable way for A an integer.
10561 (define_expand "sle"
10562 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10566 if (! rs6000_compare_fp_p
10567 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10570 rs6000_emit_sCOND (LE, operands[0]);
10574 (define_expand "sgtu"
10575 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10577 "{ rs6000_emit_sCOND (GTU, operands[0]); DONE; }")
10579 (define_expand "sltu"
10580 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10582 "{ rs6000_emit_sCOND (LTU, operands[0]); DONE; }")
10584 (define_expand "sgeu"
10585 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10587 "{ rs6000_emit_sCOND (GEU, operands[0]); DONE; }")
10589 (define_expand "sleu"
10590 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10592 "{ rs6000_emit_sCOND (LEU, operands[0]); DONE; }")
10594 ;; Here are the actual compare insns.
10595 (define_insn "*cmpsi_internal1"
10596 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
10597 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
10598 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
10600 "{cmp%I2|cmpw%I2} %0,%1,%2"
10601 [(set_attr "type" "compare")])
10603 (define_insn "*cmpdi_internal1"
10604 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
10605 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r")
10606 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
10609 [(set_attr "type" "compare")])
10611 ;; If we are comparing a register for equality with a large constant,
10612 ;; we can do this with an XOR followed by a compare. But we need a scratch
10613 ;; register for the result of the XOR.
10616 [(set (match_operand:CC 0 "cc_reg_operand" "")
10617 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
10618 (match_operand:SI 2 "non_short_cint_operand" "")))
10619 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
10620 "find_single_use (operands[0], insn, 0)
10621 && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
10622 || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
10623 [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
10624 (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
10627 /* Get the constant we are comparing against, C, and see what it looks like
10628 sign-extended to 16 bits. Then see what constant could be XOR'ed
10629 with C to get the sign-extended value. */
10631 HOST_WIDE_INT c = INTVAL (operands[2]);
10632 HOST_WIDE_INT sextc = ((c & 0xffff) ^ 0x8000) - 0x8000;
10633 HOST_WIDE_INT xorv = c ^ sextc;
10635 operands[4] = GEN_INT (xorv);
10636 operands[5] = GEN_INT (sextc);
10639 (define_insn "*cmpsi_internal2"
10640 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
10641 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
10642 (match_operand:SI 2 "reg_or_u_short_operand" "rK")))]
10644 "{cmpl%I2|cmplw%I2} %0,%1,%b2"
10645 [(set_attr "type" "compare")])
10647 (define_insn "*cmpdi_internal2"
10648 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
10649 (compare:CCUNS (match_operand:DI 1 "gpc_reg_operand" "r")
10650 (match_operand:DI 2 "reg_or_u_short_operand" "rK")))]
10652 "cmpld%I2 %0,%1,%b2"
10653 [(set_attr "type" "compare")])
10655 ;; The following two insns don't exist as single insns, but if we provide
10656 ;; them, we can swap an add and compare, which will enable us to overlap more
10657 ;; of the required delay between a compare and branch. We generate code for
10658 ;; them by splitting.
10661 [(set (match_operand:CC 3 "cc_reg_operand" "=y")
10662 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
10663 (match_operand:SI 2 "short_cint_operand" "i")))
10664 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
10665 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
10668 [(set_attr "length" "8")])
10671 [(set (match_operand:CCUNS 3 "cc_reg_operand" "=y")
10672 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
10673 (match_operand:SI 2 "u_short_cint_operand" "i")))
10674 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
10675 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
10678 [(set_attr "length" "8")])
10681 [(set (match_operand:CC 3 "cc_reg_operand" "")
10682 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
10683 (match_operand:SI 2 "short_cint_operand" "")))
10684 (set (match_operand:SI 0 "gpc_reg_operand" "")
10685 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
10687 [(set (match_dup 3) (compare:CC (match_dup 1) (match_dup 2)))
10688 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
10691 [(set (match_operand:CCUNS 3 "cc_reg_operand" "")
10692 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "")
10693 (match_operand:SI 2 "u_short_cint_operand" "")))
10694 (set (match_operand:SI 0 "gpc_reg_operand" "")
10695 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
10697 [(set (match_dup 3) (compare:CCUNS (match_dup 1) (match_dup 2)))
10698 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
10700 (define_insn "*cmpsf_internal1"
10701 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10702 (compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "f")
10703 (match_operand:SF 2 "gpc_reg_operand" "f")))]
10704 "TARGET_HARD_FLOAT"
10706 [(set_attr "type" "fpcompare")])
10708 (define_insn "*cmpdf_internal1"
10709 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10710 (compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "f")
10711 (match_operand:DF 2 "gpc_reg_operand" "f")))]
10712 "TARGET_HARD_FLOAT"
10714 [(set_attr "type" "fpcompare")])
10716 ;; Only need to compare second words if first words equal
10717 (define_insn "*cmptf_internal1"
10718 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10719 (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
10720 (match_operand:TF 2 "gpc_reg_operand" "f")))]
10721 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
10722 "fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2"
10723 [(set_attr "type" "fpcompare")
10724 (set_attr "length" "12")])
10726 ;; Now we have the scc insns. We can do some combinations because of the
10727 ;; way the machine works.
10729 ;; Note that this is probably faster if we can put an insn between the
10730 ;; mfcr and rlinm, but this is tricky. Let's leave it for now. In most
10731 ;; cases the insns below which don't use an intermediate CR field will
10732 ;; be used instead.
10734 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10735 (match_operator:SI 1 "scc_comparison_operator"
10736 [(match_operand 2 "cc_reg_operand" "y")
10739 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
10740 [(set_attr "type" "cr_logical")
10741 (set_attr "length" "12")])
10744 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10745 (match_operator:DI 1 "scc_comparison_operator"
10746 [(match_operand 2 "cc_reg_operand" "y")
10749 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
10750 [(set_attr "type" "cr_logical")
10751 (set_attr "length" "12")])
10754 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
10755 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
10756 [(match_operand 2 "cc_reg_operand" "y,y")
10759 (set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
10760 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
10761 "! TARGET_POWERPC64"
10763 %D1mfcr %3\;{rlinm.|rlwinm.} %3,%3,%J1,1
10765 [(set_attr "type" "delayed_compare")
10766 (set_attr "length" "12,16")])
10769 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
10770 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
10771 [(match_operand 2 "cc_reg_operand" "")
10774 (set (match_operand:SI 3 "gpc_reg_operand" "")
10775 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
10776 "! TARGET_POWERPC64 && reload_completed"
10777 [(set (match_dup 3)
10778 (match_op_dup 1 [(match_dup 2) (const_int 0)]))
10780 (compare:CC (match_dup 3)
10785 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10786 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10787 [(match_operand 2 "cc_reg_operand" "y")
10789 (match_operand:SI 3 "const_int_operand" "n")))]
10793 int is_bit = ccr_bit (operands[1], 1);
10794 int put_bit = 31 - (INTVAL (operands[3]) & 31);
10797 if (is_bit >= put_bit)
10798 count = is_bit - put_bit;
10800 count = 32 - (put_bit - is_bit);
10802 operands[4] = GEN_INT (count);
10803 operands[5] = GEN_INT (put_bit);
10805 return \"%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%4,%5,%5\";
10807 [(set_attr "type" "cr_logical")
10808 (set_attr "length" "12")])
10811 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
10813 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10814 [(match_operand 2 "cc_reg_operand" "y,y")
10816 (match_operand:SI 3 "const_int_operand" "n,n"))
10818 (set (match_operand:SI 4 "gpc_reg_operand" "=r,r")
10819 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10821 "! TARGET_POWERPC64"
10824 int is_bit = ccr_bit (operands[1], 1);
10825 int put_bit = 31 - (INTVAL (operands[3]) & 31);
10828 /* Force split for non-cc0 compare. */
10829 if (which_alternative == 1)
10832 if (is_bit >= put_bit)
10833 count = is_bit - put_bit;
10835 count = 32 - (put_bit - is_bit);
10837 operands[5] = GEN_INT (count);
10838 operands[6] = GEN_INT (put_bit);
10840 return \"%D1mfcr %4\;{rlinm.|rlwinm.} %4,%4,%5,%6,%6\";
10842 [(set_attr "type" "delayed_compare")
10843 (set_attr "length" "12,16")])
10846 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
10848 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10849 [(match_operand 2 "cc_reg_operand" "")
10851 (match_operand:SI 3 "const_int_operand" ""))
10853 (set (match_operand:SI 4 "gpc_reg_operand" "")
10854 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10856 "! TARGET_POWERPC64 && reload_completed"
10857 [(set (match_dup 4)
10858 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10861 (compare:CC (match_dup 4)
10865 ;; There is a 3 cycle delay between consecutive mfcr instructions
10866 ;; so it is useful to combine 2 scc instructions to use only one mfcr.
10869 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10870 (match_operator:SI 1 "scc_comparison_operator"
10871 [(match_operand 2 "cc_reg_operand" "y")
10873 (set (match_operand:SI 3 "gpc_reg_operand" "=r")
10874 (match_operator:SI 4 "scc_comparison_operator"
10875 [(match_operand 5 "cc_reg_operand" "y")
10877 "REGNO (operands[2]) != REGNO (operands[5])"
10878 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
10879 [(set_attr "type" "cr_logical")
10880 (set_attr "length" "20")])
10883 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10884 (match_operator:DI 1 "scc_comparison_operator"
10885 [(match_operand 2 "cc_reg_operand" "y")
10887 (set (match_operand:DI 3 "gpc_reg_operand" "=r")
10888 (match_operator:DI 4 "scc_comparison_operator"
10889 [(match_operand 5 "cc_reg_operand" "y")
10891 "TARGET_POWERPC64 && REGNO (operands[2]) != REGNO (operands[5])"
10892 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
10893 [(set_attr "type" "cr_logical")
10894 (set_attr "length" "20")])
10896 ;; There are some scc insns that can be done directly, without a compare.
10897 ;; These are faster because they don't involve the communications between
10898 ;; the FXU and branch units. In fact, we will be replacing all of the
10899 ;; integer scc insns here or in the portable methods in emit_store_flag.
10901 ;; Also support (neg (scc ..)) since that construct is used to replace
10902 ;; branches, (plus (scc ..) ..) since that construct is common and
10903 ;; takes no more insns than scc, and (and (neg (scc ..)) ..) in the
10904 ;; cases where it is no more expensive than (neg (scc ..)).
10906 ;; Have reload force a constant into a register for the simple insns that
10907 ;; otherwise won't accept constants. We do this because it is faster than
10908 ;; the cmp/mfcr sequence we would otherwise generate.
10911 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
10912 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
10913 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I")))
10914 (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
10915 "! TARGET_POWERPC64"
10917 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10918 {sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1
10919 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10920 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10921 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0"
10922 [(set_attr "length" "12,8,12,12,12")])
10925 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
10926 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
10927 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
10928 (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
10931 xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
10932 subfic %3,%1,0\;adde %0,%3,%1
10933 xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
10934 xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
10935 subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
10936 [(set_attr "length" "12,8,12,12,12")])
10939 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10941 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10942 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
10944 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
10945 (eq:SI (match_dup 1) (match_dup 2)))
10946 (clobber (match_scratch:SI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
10947 "! TARGET_POWERPC64"
10949 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10950 {sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1
10951 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10952 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10953 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10959 [(set_attr "type" "compare")
10960 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
10963 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
10965 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
10966 (match_operand:SI 2 "reg_or_cint_operand" ""))
10968 (set (match_operand:SI 0 "gpc_reg_operand" "")
10969 (eq:SI (match_dup 1) (match_dup 2)))
10970 (clobber (match_scratch:SI 3 ""))]
10971 "! TARGET_POWERPC64 && reload_completed"
10972 [(parallel [(set (match_dup 0)
10973 (eq:SI (match_dup 1) (match_dup 2)))
10974 (clobber (match_dup 3))])
10976 (compare:CC (match_dup 0)
10981 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10983 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10984 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I,r,O,K,J,I"))
10986 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
10987 (eq:DI (match_dup 1) (match_dup 2)))
10988 (clobber (match_scratch:DI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
10991 xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
10992 subfic %3,%1,0\;adde. %0,%3,%1
10993 xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
10994 xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
10995 subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
11001 [(set_attr "type" "compare")
11002 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11005 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11007 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "")
11008 (match_operand:DI 2 "reg_or_cint_operand" ""))
11010 (set (match_operand:DI 0 "gpc_reg_operand" "")
11011 (eq:DI (match_dup 1) (match_dup 2)))
11012 (clobber (match_scratch:DI 3 ""))]
11013 "TARGET_POWERPC64 && reload_completed"
11014 [(parallel [(set (match_dup 0)
11015 (eq:DI (match_dup 1) (match_dup 2)))
11016 (clobber (match_dup 3))])
11018 (compare:CC (match_dup 0)
11022 ;; We have insns of the form shown by the first define_insn below. If
11023 ;; there is something inside the comparison operation, we must split it.
11025 [(set (match_operand:SI 0 "gpc_reg_operand" "")
11026 (plus:SI (match_operator 1 "comparison_operator"
11027 [(match_operand:SI 2 "" "")
11028 (match_operand:SI 3
11029 "reg_or_cint_operand" "")])
11030 (match_operand:SI 4 "gpc_reg_operand" "")))
11031 (clobber (match_operand:SI 5 "register_operand" ""))]
11032 "! gpc_reg_operand (operands[2], SImode)"
11033 [(set (match_dup 5) (match_dup 2))
11034 (set (match_dup 2) (plus:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
11038 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r")
11039 (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
11040 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))
11041 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r")))]
11042 "! TARGET_POWERPC64"
11044 xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11045 {sfi|subfic} %0,%1,0\;{aze|addze} %0,%3
11046 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11047 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3
11048 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze|addze} %0,%3"
11049 [(set_attr "length" "12,8,12,12,12")])
11052 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11055 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11056 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
11057 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
11059 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))]
11060 "! TARGET_POWERPC64"
11062 xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11063 {sfi|subfic} %4,%1,0\;{aze.|addze.} %4,%3
11064 {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11065 {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11066 {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11072 [(set_attr "type" "compare")
11073 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11076 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11079 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
11080 (match_operand:SI 2 "reg_or_cint_operand" ""))
11081 (match_operand:SI 3 "gpc_reg_operand" ""))
11083 (clobber (match_scratch:SI 4 ""))]
11084 "! TARGET_POWERPC64 && reload_completed"
11085 [(set (match_dup 4)
11086 (plus:SI (eq:SI (match_dup 1)
11090 (compare:CC (match_dup 4)
11095 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
11098 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
11099 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
11100 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
11102 (set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r")
11103 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
11104 "! TARGET_POWERPC64"
11106 xor %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11107 {sfi|subfic} %0,%1,0\;{aze.|addze.} %0,%3
11108 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11109 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11110 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %0,%0,0\;{aze.|addze.} %0,%3
11116 [(set_attr "type" "compare")
11117 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
11120 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11123 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
11124 (match_operand:SI 2 "reg_or_cint_operand" ""))
11125 (match_operand:SI 3 "gpc_reg_operand" ""))
11127 (set (match_operand:SI 0 "gpc_reg_operand" "")
11128 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
11129 "! TARGET_POWERPC64 && reload_completed"
11130 [(set (match_dup 0)
11131 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11133 (compare:CC (match_dup 0)
11138 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
11139 (neg:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
11140 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))))]
11141 "! TARGET_POWERPC64"
11143 xor %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11144 {ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0
11145 {xoril|xori} %0,%1,%b2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11146 {xoriu|xoris} %0,%1,%u2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11147 {sfi|subfic} %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
11148 [(set_attr "length" "12,8,12,12,12")])
11150 ;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power,
11151 ;; since it nabs/sr is just as fast.
11152 (define_insn "*ne0"
11153 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
11154 (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
11156 (clobber (match_scratch:SI 2 "=&r"))]
11157 "! TARGET_POWER && ! TARGET_POWERPC64"
11158 "{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1"
11159 [(set_attr "length" "8")])
11162 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11163 (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
11165 (clobber (match_scratch:DI 2 "=&r"))]
11167 "addic %2,%1,-1\;subfe %0,%2,%1"
11168 [(set_attr "length" "8")])
11170 ;; This is what (plus (ne X (const_int 0)) Y) looks like.
11172 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11173 (plus:SI (lshiftrt:SI
11174 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
11176 (match_operand:SI 2 "gpc_reg_operand" "r")))
11177 (clobber (match_scratch:SI 3 "=&r"))]
11178 "! TARGET_POWERPC64"
11179 "{ai|addic} %3,%1,-1\;{aze|addze} %0,%2"
11180 [(set_attr "length" "8")])
11183 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11184 (plus:DI (lshiftrt:DI
11185 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
11187 (match_operand:DI 2 "gpc_reg_operand" "r")))
11188 (clobber (match_scratch:DI 3 "=&r"))]
11190 "addic %3,%1,-1\;addze %0,%2"
11191 [(set_attr "length" "8")])
11194 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11196 (plus:SI (lshiftrt:SI
11197 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11199 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11201 (clobber (match_scratch:SI 3 "=&r,&r"))
11202 (clobber (match_scratch:SI 4 "=X,&r"))]
11203 "! TARGET_POWERPC64"
11205 {ai|addic} %3,%1,-1\;{aze.|addze.} %3,%2
11207 [(set_attr "type" "compare")
11208 (set_attr "length" "8,12")])
11211 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11213 (plus:SI (lshiftrt:SI
11214 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
11216 (match_operand:SI 2 "gpc_reg_operand" ""))
11218 (clobber (match_scratch:SI 3 ""))
11219 (clobber (match_scratch:SI 4 ""))]
11220 "! TARGET_POWERPC64 && reload_completed"
11221 [(parallel [(set (match_dup 3)
11222 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1)))
11225 (clobber (match_dup 4))])
11227 (compare:CC (match_dup 3)
11232 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11234 (plus:DI (lshiftrt:DI
11235 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
11237 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
11239 (clobber (match_scratch:DI 3 "=&r,&r"))]
11242 addic %3,%1,-1\;addze. %3,%2
11244 [(set_attr "type" "compare")
11245 (set_attr "length" "8,12")])
11248 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11250 (plus:DI (lshiftrt:DI
11251 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
11253 (match_operand:DI 2 "gpc_reg_operand" ""))
11255 (clobber (match_scratch:DI 3 ""))]
11256 "TARGET_POWERPC64 && reload_completed"
11257 [(set (match_dup 3)
11258 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1)))
11262 (compare:CC (match_dup 3)
11267 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11269 (plus:SI (lshiftrt:SI
11270 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11272 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11274 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11275 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11277 (clobber (match_scratch:SI 3 "=&r,&r"))]
11278 "! TARGET_POWERPC64"
11280 {ai|addic} %3,%1,-1\;{aze.|addze.} %0,%2
11282 [(set_attr "type" "compare")
11283 (set_attr "length" "8,12")])
11286 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11288 (plus:SI (lshiftrt:SI
11289 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
11291 (match_operand:SI 2 "gpc_reg_operand" ""))
11293 (set (match_operand:SI 0 "gpc_reg_operand" "")
11294 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11296 (clobber (match_scratch:SI 3 ""))]
11297 "! TARGET_POWERPC64 && reload_completed"
11298 [(parallel [(set (match_dup 0)
11299 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11301 (clobber (match_dup 3))])
11303 (compare:CC (match_dup 0)
11308 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11310 (plus:DI (lshiftrt:DI
11311 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
11313 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
11315 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11316 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11318 (clobber (match_scratch:DI 3 "=&r,&r"))]
11321 addic %3,%1,-1\;addze. %0,%2
11323 [(set_attr "type" "compare")
11324 (set_attr "length" "8,12")])
11327 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11329 (plus:DI (lshiftrt:DI
11330 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
11332 (match_operand:DI 2 "gpc_reg_operand" ""))
11334 (set (match_operand:DI 0 "gpc_reg_operand" "")
11335 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11337 (clobber (match_scratch:DI 3 ""))]
11338 "TARGET_POWERPC64 && reload_completed"
11339 [(parallel [(set (match_dup 0)
11340 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11342 (clobber (match_dup 3))])
11344 (compare:CC (match_dup 0)
11349 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11350 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11351 (match_operand:SI 2 "reg_or_short_operand" "r,O")))
11352 (clobber (match_scratch:SI 3 "=r,X"))]
11355 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3
11356 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri|srwi} %0,%0,31"
11357 [(set_attr "length" "12")])
11360 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
11362 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11363 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11365 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11366 (le:SI (match_dup 1) (match_dup 2)))
11367 (clobber (match_scratch:SI 3 "=r,X,r,X"))]
11370 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
11371 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri.|srwi.} %0,%0,31
11374 [(set_attr "type" "compare,delayed_compare,compare,delayed_compare")
11375 (set_attr "length" "12,12,16,16")])
11378 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11380 (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11381 (match_operand:SI 2 "reg_or_short_operand" ""))
11383 (set (match_operand:SI 0 "gpc_reg_operand" "")
11384 (le:SI (match_dup 1) (match_dup 2)))
11385 (clobber (match_scratch:SI 3 ""))]
11386 "TARGET_POWER && reload_completed"
11387 [(parallel [(set (match_dup 0)
11388 (le:SI (match_dup 1) (match_dup 2)))
11389 (clobber (match_dup 3))])
11391 (compare:CC (match_dup 0)
11396 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11397 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11398 (match_operand:SI 2 "reg_or_short_operand" "r,O"))
11399 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
11400 (clobber (match_scratch:SI 4 "=&r,&r"))]
11403 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
11404 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze|addze} %0,%3"
11405 [(set_attr "length" "12")])
11408 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
11410 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11411 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11412 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11414 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11417 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11418 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %4,%3
11421 [(set_attr "type" "compare")
11422 (set_attr "length" "12,12,16,16")])
11425 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11427 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11428 (match_operand:SI 2 "reg_or_short_operand" ""))
11429 (match_operand:SI 3 "gpc_reg_operand" ""))
11431 (clobber (match_scratch:SI 4 ""))]
11432 "TARGET_POWER && reload_completed"
11433 [(set (match_dup 4)
11434 (plus:SI (le:SI (match_dup 1) (match_dup 2))
11437 (compare:CC (match_dup 4)
11442 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
11444 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11445 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11446 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11448 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11449 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11450 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11453 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
11454 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %0,%3
11457 [(set_attr "type" "compare")
11458 (set_attr "length" "12,12,16,16")])
11461 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11463 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11464 (match_operand:SI 2 "reg_or_short_operand" ""))
11465 (match_operand:SI 3 "gpc_reg_operand" ""))
11467 (set (match_operand:SI 0 "gpc_reg_operand" "")
11468 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11469 (clobber (match_scratch:SI 4 ""))]
11470 "TARGET_POWER && reload_completed"
11471 [(parallel [(set (match_dup 0)
11472 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11473 (clobber (match_dup 4))])
11475 (compare:CC (match_dup 0)
11480 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11481 (neg:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11482 (match_operand:SI 2 "reg_or_short_operand" "r,O"))))]
11485 doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11486 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{srai|srawi} %0,%0,31"
11487 [(set_attr "length" "12")])
11490 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11491 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11492 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
11493 "! TARGET_POWERPC64"
11494 "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
11495 [(set_attr "length" "12")])
11498 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11499 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
11500 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
11502 "subf%I2c %0,%1,%2\;li %0,0\;adde %0,%0,%0"
11503 [(set_attr "length" "12")])
11506 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11508 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
11509 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
11511 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11512 (leu:DI (match_dup 1) (match_dup 2)))]
11515 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
11517 [(set_attr "type" "compare")
11518 (set_attr "length" "12,16")])
11521 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11523 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "")
11524 (match_operand:DI 2 "reg_or_short_operand" ""))
11526 (set (match_operand:DI 0 "gpc_reg_operand" "")
11527 (leu:DI (match_dup 1) (match_dup 2)))]
11528 "TARGET_POWERPC64 && reload_completed"
11529 [(set (match_dup 0)
11530 (leu:DI (match_dup 1) (match_dup 2)))
11532 (compare:CC (match_dup 0)
11537 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11539 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11540 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11542 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11543 (leu:SI (match_dup 1) (match_dup 2)))]
11544 "! TARGET_POWERPC64"
11546 {sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
11548 [(set_attr "type" "compare")
11549 (set_attr "length" "12,16")])
11552 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11554 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11555 (match_operand:SI 2 "reg_or_short_operand" ""))
11557 (set (match_operand:SI 0 "gpc_reg_operand" "")
11558 (leu:SI (match_dup 1) (match_dup 2)))]
11559 "! TARGET_POWERPC64 && reload_completed"
11560 [(set (match_dup 0)
11561 (leu:SI (match_dup 1) (match_dup 2)))
11563 (compare:CC (match_dup 0)
11568 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11570 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
11571 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
11573 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11574 (leu:DI (match_dup 1) (match_dup 2)))]
11577 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
11579 [(set_attr "type" "compare")
11580 (set_attr "length" "12,16")])
11583 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
11584 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11585 (match_operand:SI 2 "reg_or_short_operand" "rI"))
11586 (match_operand:SI 3 "gpc_reg_operand" "r")))]
11587 "! TARGET_POWERPC64"
11588 "{sf%I2|subf%I2c} %0,%1,%2\;{aze|addze} %0,%3"
11589 [(set_attr "length" "8")])
11592 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11594 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11595 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11596 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11598 (clobber (match_scratch:SI 4 "=&r,&r"))]
11599 "! TARGET_POWERPC64"
11601 {sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %4,%3
11603 [(set_attr "type" "compare")
11604 (set_attr "length" "8,12")])
11607 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11609 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11610 (match_operand:SI 2 "reg_or_short_operand" ""))
11611 (match_operand:SI 3 "gpc_reg_operand" ""))
11613 (clobber (match_scratch:SI 4 ""))]
11614 "! TARGET_POWERPC64 && reload_completed"
11615 [(set (match_dup 4)
11616 (plus:SI (leu:SI (match_dup 1) (match_dup 2))
11619 (compare:CC (match_dup 4)
11624 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11626 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11627 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11628 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11630 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11631 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11632 (clobber (match_scratch:SI 4 "=&r,&r"))]
11633 "! TARGET_POWERPC64"
11635 {sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %0,%3
11637 [(set_attr "type" "compare")
11638 (set_attr "length" "8,12")])
11641 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11643 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11644 (match_operand:SI 2 "reg_or_short_operand" ""))
11645 (match_operand:SI 3 "gpc_reg_operand" ""))
11647 (set (match_operand:SI 0 "gpc_reg_operand" "")
11648 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11649 (clobber (match_scratch:SI 4 ""))]
11650 "! TARGET_POWERPC64 && reload_completed"
11651 [(parallel [(set (match_dup 0)
11652 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11653 (clobber (match_dup 4))])
11655 (compare:CC (match_dup 0)
11660 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11661 (neg:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11662 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
11663 "! TARGET_POWERPC64"
11664 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0"
11665 [(set_attr "length" "12")])
11668 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11670 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11671 (match_operand:SI 2 "reg_or_short_operand" "rI")))
11672 (match_operand:SI 3 "gpc_reg_operand" "r")))
11673 (clobber (match_scratch:SI 4 "=&r"))]
11674 "! TARGET_POWERPC64"
11675 "{sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
11676 [(set_attr "length" "12")])
11679 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11682 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11683 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
11684 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11686 (clobber (match_scratch:SI 4 "=&r,&r"))]
11687 "! TARGET_POWERPC64"
11689 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
11691 [(set_attr "type" "compare")
11692 (set_attr "length" "12,16")])
11695 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11698 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11699 (match_operand:SI 2 "reg_or_short_operand" "")))
11700 (match_operand:SI 3 "gpc_reg_operand" ""))
11702 (clobber (match_scratch:SI 4 ""))]
11703 "! TARGET_POWERPC64 && reload_completed"
11704 [(set (match_dup 4)
11705 (and:SI (neg:SI (leu:SI (match_dup 1)
11709 (compare:CC (match_dup 4)
11714 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11717 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11718 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
11719 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11721 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11722 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11723 (clobber (match_scratch:SI 4 "=&r,&r"))]
11724 "! TARGET_POWERPC64"
11726 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
11728 [(set_attr "type" "compare")
11729 (set_attr "length" "12,16")])
11732 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11735 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11736 (match_operand:SI 2 "reg_or_short_operand" "")))
11737 (match_operand:SI 3 "gpc_reg_operand" ""))
11739 (set (match_operand:SI 0 "gpc_reg_operand" "")
11740 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11741 (clobber (match_scratch:SI 4 ""))]
11742 "! TARGET_POWERPC64 && reload_completed"
11743 [(parallel [(set (match_dup 0)
11744 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11745 (clobber (match_dup 4))])
11747 (compare:CC (match_dup 0)
11752 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11753 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11754 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
11756 "doz%I2 %0,%1,%2\;nabs %0,%0\;{sri|srwi} %0,%0,31"
11757 [(set_attr "length" "12")])
11760 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11762 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11763 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11765 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11766 (lt:SI (match_dup 1) (match_dup 2)))]
11769 doz%I2 %0,%1,%2\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
11771 [(set_attr "type" "delayed_compare")
11772 (set_attr "length" "12,16")])
11775 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11777 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11778 (match_operand:SI 2 "reg_or_short_operand" ""))
11780 (set (match_operand:SI 0 "gpc_reg_operand" "")
11781 (lt:SI (match_dup 1) (match_dup 2)))]
11782 "TARGET_POWER && reload_completed"
11783 [(set (match_dup 0)
11784 (lt:SI (match_dup 1) (match_dup 2)))
11786 (compare:CC (match_dup 0)
11791 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11792 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11793 (match_operand:SI 2 "reg_or_short_operand" "rI"))
11794 (match_operand:SI 3 "gpc_reg_operand" "r")))
11795 (clobber (match_scratch:SI 4 "=&r"))]
11797 "doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
11798 [(set_attr "length" "12")])
11801 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11803 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11804 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11805 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11807 (clobber (match_scratch:SI 4 "=&r,&r"))]
11810 doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
11812 [(set_attr "type" "compare")
11813 (set_attr "length" "12,16")])
11816 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11818 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11819 (match_operand:SI 2 "reg_or_short_operand" ""))
11820 (match_operand:SI 3 "gpc_reg_operand" ""))
11822 (clobber (match_scratch:SI 4 ""))]
11823 "TARGET_POWER && reload_completed"
11824 [(set (match_dup 4)
11825 (plus:SI (lt:SI (match_dup 1) (match_dup 2))
11828 (compare:CC (match_dup 4)
11833 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11835 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11836 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11837 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11839 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11840 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11841 (clobber (match_scratch:SI 4 "=&r,&r"))]
11844 doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3
11846 [(set_attr "type" "compare")
11847 (set_attr "length" "12,16")])
11850 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11852 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11853 (match_operand:SI 2 "reg_or_short_operand" ""))
11854 (match_operand:SI 3 "gpc_reg_operand" ""))
11856 (set (match_operand:SI 0 "gpc_reg_operand" "")
11857 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11858 (clobber (match_scratch:SI 4 ""))]
11859 "TARGET_POWER && reload_completed"
11860 [(parallel [(set (match_dup 0)
11861 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11862 (clobber (match_dup 4))])
11864 (compare:CC (match_dup 0)
11869 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11870 (neg:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11871 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
11873 "doz%I2 %0,%1,%2\;nabs %0,%0\;{srai|srawi} %0,%0,31"
11874 [(set_attr "length" "12")])
11877 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11878 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11879 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
11880 "! TARGET_POWERPC64"
11882 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg %0,%0
11883 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
11884 [(set_attr "length" "12")])
11887 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
11889 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11890 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11892 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11893 (ltu:SI (match_dup 1) (match_dup 2)))]
11894 "! TARGET_POWERPC64"
11896 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
11897 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
11900 [(set_attr "type" "compare")
11901 (set_attr "length" "12,12,16,16")])
11904 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11906 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11907 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11909 (set (match_operand:SI 0 "gpc_reg_operand" "")
11910 (ltu:SI (match_dup 1) (match_dup 2)))]
11911 "! TARGET_POWERPC64 && reload_completed"
11912 [(set (match_dup 0)
11913 (ltu:SI (match_dup 1) (match_dup 2)))
11915 (compare:CC (match_dup 0)
11920 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
11921 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11922 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
11923 (match_operand:SI 3 "reg_or_short_operand" "rI,rI")))]
11924 "! TARGET_POWERPC64"
11926 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3
11927 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3"
11928 [(set_attr "length" "12")])
11931 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
11933 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11934 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11935 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11937 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11938 "! TARGET_POWERPC64"
11940 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
11941 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
11944 [(set_attr "type" "compare")
11945 (set_attr "length" "12,12,16,16")])
11948 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11950 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11951 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11952 (match_operand:SI 3 "gpc_reg_operand" ""))
11954 (clobber (match_scratch:SI 4 ""))]
11955 "! TARGET_POWERPC64 && reload_completed"
11956 [(set (match_dup 4)
11957 (plus:SI (ltu:SI (match_dup 1) (match_dup 2))
11960 (compare:CC (match_dup 4)
11965 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
11967 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11968 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11969 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11971 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11972 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11973 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11974 "! TARGET_POWERPC64"
11976 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
11977 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
11980 [(set_attr "type" "compare")
11981 (set_attr "length" "12,12,16,16")])
11984 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11986 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11987 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11988 (match_operand:SI 3 "gpc_reg_operand" ""))
11990 (set (match_operand:SI 0 "gpc_reg_operand" "")
11991 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11992 (clobber (match_scratch:SI 4 ""))]
11993 "! TARGET_POWERPC64 && reload_completed"
11994 [(parallel [(set (match_dup 0)
11995 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11996 (clobber (match_dup 4))])
11998 (compare:CC (match_dup 0)
12003 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12004 (neg:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12005 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))))]
12006 "! TARGET_POWERPC64"
12008 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0
12009 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0"
12010 [(set_attr "length" "8")])
12013 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12014 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12015 (match_operand:SI 2 "reg_or_short_operand" "rI")))
12016 (clobber (match_scratch:SI 3 "=r"))]
12018 "doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3"
12019 [(set_attr "length" "12")])
12022 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12024 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12025 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12027 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12028 (ge:SI (match_dup 1) (match_dup 2)))
12029 (clobber (match_scratch:SI 3 "=r,r"))]
12032 doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
12034 [(set_attr "type" "compare")
12035 (set_attr "length" "12,16")])
12038 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12040 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12041 (match_operand:SI 2 "reg_or_short_operand" ""))
12043 (set (match_operand:SI 0 "gpc_reg_operand" "")
12044 (ge:SI (match_dup 1) (match_dup 2)))
12045 (clobber (match_scratch:SI 3 ""))]
12046 "TARGET_POWER && reload_completed"
12047 [(parallel [(set (match_dup 0)
12048 (ge:SI (match_dup 1) (match_dup 2)))
12049 (clobber (match_dup 3))])
12051 (compare:CC (match_dup 0)
12056 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12057 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12058 (match_operand:SI 2 "reg_or_short_operand" "rI"))
12059 (match_operand:SI 3 "gpc_reg_operand" "r")))
12060 (clobber (match_scratch:SI 4 "=&r"))]
12062 "doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3"
12063 [(set_attr "length" "12")])
12066 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12068 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12069 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12070 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12072 (clobber (match_scratch:SI 4 "=&r,&r"))]
12075 doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
12077 [(set_attr "type" "compare")
12078 (set_attr "length" "12,16")])
12081 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12083 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12084 (match_operand:SI 2 "reg_or_short_operand" ""))
12085 (match_operand:SI 3 "gpc_reg_operand" ""))
12087 (clobber (match_scratch:SI 4 ""))]
12088 "TARGET_POWER && reload_completed"
12089 [(set (match_dup 4)
12090 (plus:SI (ge:SI (match_dup 1) (match_dup 2))
12093 (compare:CC (match_dup 4)
12098 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
12100 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12101 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12102 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12104 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12105 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12106 (clobber (match_scratch:SI 4 "=&r,&r"))]
12109 doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
12111 [(set_attr "type" "compare")
12112 (set_attr "length" "12,16")])
12115 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12117 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
12118 (match_operand:SI 2 "reg_or_short_operand" ""))
12119 (match_operand:SI 3 "gpc_reg_operand" ""))
12121 (set (match_operand:SI 0 "gpc_reg_operand" "")
12122 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12123 (clobber (match_scratch:SI 4 ""))]
12124 "TARGET_POWER && reload_completed"
12125 [(parallel [(set (match_dup 0)
12126 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12127 (clobber (match_dup 4))])
12129 (compare:CC (match_dup 0)
12134 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12135 (neg:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12136 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
12138 "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
12139 [(set_attr "length" "12")])
12142 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12143 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12144 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
12145 "! TARGET_POWERPC64"
12147 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0
12148 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
12149 [(set_attr "length" "12")])
12152 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12153 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12154 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P")))]
12157 subfc %0,%2,%1\;li %0,0\;adde %0,%0,%0
12158 addic %0,%1,%n2\;li %0,0\;adde %0,%0,%0"
12159 [(set_attr "length" "12")])
12162 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12164 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12165 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12167 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12168 (geu:SI (match_dup 1) (match_dup 2)))]
12169 "! TARGET_POWERPC64"
12171 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
12172 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
12175 [(set_attr "type" "compare")
12176 (set_attr "length" "12,12,16,16")])
12179 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12181 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12182 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12184 (set (match_operand:SI 0 "gpc_reg_operand" "")
12185 (geu:SI (match_dup 1) (match_dup 2)))]
12186 "! TARGET_POWERPC64 && reload_completed"
12187 [(set (match_dup 0)
12188 (geu:SI (match_dup 1) (match_dup 2)))
12190 (compare:CC (match_dup 0)
12195 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12197 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12198 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12200 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
12201 (geu:DI (match_dup 1) (match_dup 2)))]
12204 subfc %0,%2,%1\;li %0,0\;adde. %0,%0,%0
12205 addic %0,%1,%n2\;li %0,0\;adde. %0,%0,%0
12208 [(set_attr "type" "compare")
12209 (set_attr "length" "12,12,16,16")])
12212 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12214 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12215 (match_operand:DI 2 "reg_or_neg_short_operand" ""))
12217 (set (match_operand:DI 0 "gpc_reg_operand" "")
12218 (geu:DI (match_dup 1) (match_dup 2)))]
12219 "TARGET_POWERPC64 && reload_completed"
12220 [(set (match_dup 0)
12221 (geu:DI (match_dup 1) (match_dup 2)))
12223 (compare:CC (match_dup 0)
12228 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12229 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12230 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
12231 (match_operand:SI 3 "gpc_reg_operand" "r,r")))]
12232 "! TARGET_POWERPC64"
12234 {sf|subfc} %0,%2,%1\;{aze|addze} %0,%3
12235 {ai|addic} %0,%1,%n2\;{aze|addze} %0,%3"
12236 [(set_attr "length" "8")])
12239 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12241 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12242 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12243 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12245 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12246 "! TARGET_POWERPC64"
12248 {sf|subfc} %4,%2,%1\;{aze.|addze.} %4,%3
12249 {ai|addic} %4,%1,%n2\;{aze.|addze.} %4,%3
12252 [(set_attr "type" "compare")
12253 (set_attr "length" "8,8,12,12")])
12256 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12258 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12259 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12260 (match_operand:SI 3 "gpc_reg_operand" ""))
12262 (clobber (match_scratch:SI 4 ""))]
12263 "! TARGET_POWERPC64 && reload_completed"
12264 [(set (match_dup 4)
12265 (plus:SI (geu:SI (match_dup 1) (match_dup 2))
12268 (compare:CC (match_dup 4)
12273 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12275 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12276 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12277 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12279 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12280 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12281 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12282 "! TARGET_POWERPC64"
12284 {sf|subfc} %4,%2,%1\;{aze.|addze.} %0,%3
12285 {ai|addic} %4,%1,%n2\;{aze.|addze.} %0,%3
12288 [(set_attr "type" "compare")
12289 (set_attr "length" "8,8,12,12")])
12292 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12294 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12295 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12296 (match_operand:SI 3 "gpc_reg_operand" ""))
12298 (set (match_operand:SI 0 "gpc_reg_operand" "")
12299 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12300 (clobber (match_scratch:SI 4 ""))]
12301 "! TARGET_POWERPC64 && reload_completed"
12302 [(parallel [(set (match_dup 0)
12303 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12304 (clobber (match_dup 4))])
12306 (compare:CC (match_dup 0)
12311 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12312 (neg:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12313 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))]
12314 "! TARGET_POWERPC64"
12316 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0
12317 {sfi|subfic} %0,%1,-1\;{a%I2|add%I2c} %0,%0,%2\;{sfe|subfe} %0,%0,%0"
12318 [(set_attr "length" "12")])
12321 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12323 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12324 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
12325 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
12326 (clobber (match_scratch:SI 4 "=&r,&r"))]
12327 "! TARGET_POWERPC64"
12329 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4
12330 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
12331 [(set_attr "length" "12")])
12334 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12337 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12338 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
12339 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12341 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12342 "! TARGET_POWERPC64"
12344 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
12345 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
12348 [(set_attr "type" "compare")
12349 (set_attr "length" "12,12,16,16")])
12352 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12355 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12356 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
12357 (match_operand:SI 3 "gpc_reg_operand" ""))
12359 (clobber (match_scratch:SI 4 ""))]
12360 "! TARGET_POWERPC64 && reload_completed"
12361 [(set (match_dup 4)
12362 (and:SI (neg:SI (geu:SI (match_dup 1)
12366 (compare:CC (match_dup 4)
12371 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12374 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12375 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
12376 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12378 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12379 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12380 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12381 "! TARGET_POWERPC64"
12383 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
12384 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
12387 [(set_attr "type" "compare")
12388 (set_attr "length" "12,12,16,16")])
12391 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12394 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12395 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
12396 (match_operand:SI 3 "gpc_reg_operand" ""))
12398 (set (match_operand:SI 0 "gpc_reg_operand" "")
12399 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12400 (clobber (match_scratch:SI 4 ""))]
12401 "! TARGET_POWERPC64 && reload_completed"
12402 [(parallel [(set (match_dup 0)
12403 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12404 (clobber (match_dup 4))])
12406 (compare:CC (match_dup 0)
12411 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12412 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12414 "! TARGET_POWERPC64"
12415 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri|srwi} %0,%0,31"
12416 [(set_attr "length" "12")])
12419 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12420 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12423 "subfic %0,%1,0\;addme %0,%0\;srdi %0,%0,63"
12424 [(set_attr "length" "12")])
12427 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
12429 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12432 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12433 (gt:SI (match_dup 1) (const_int 0)))]
12434 "! TARGET_POWERPC64"
12436 {sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri.|srwi.} %0,%0,31
12438 [(set_attr "type" "delayed_compare")
12439 (set_attr "length" "12,16")])
12442 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
12444 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12447 (set (match_operand:SI 0 "gpc_reg_operand" "")
12448 (gt:SI (match_dup 1) (const_int 0)))]
12449 "! TARGET_POWERPC64 && reload_completed"
12450 [(set (match_dup 0)
12451 (gt:SI (match_dup 1) (const_int 0)))
12453 (compare:CC (match_dup 0)
12458 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
12460 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12463 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12464 (gt:DI (match_dup 1) (const_int 0)))]
12467 subfic %0,%1,0\;addme %0,%0\;srdi. %0,%0,63
12469 [(set_attr "type" "delayed_compare")
12470 (set_attr "length" "12,16")])
12473 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
12475 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12478 (set (match_operand:DI 0 "gpc_reg_operand" "")
12479 (gt:DI (match_dup 1) (const_int 0)))]
12480 "TARGET_POWERPC64 && reload_completed"
12481 [(set (match_dup 0)
12482 (gt:DI (match_dup 1) (const_int 0)))
12484 (compare:CC (match_dup 0)
12489 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12490 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12491 (match_operand:SI 2 "reg_or_short_operand" "r")))]
12493 "doz %0,%2,%1\;nabs %0,%0\;{sri|srwi} %0,%0,31"
12494 [(set_attr "length" "12")])
12497 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12499 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12500 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12502 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12503 (gt:SI (match_dup 1) (match_dup 2)))]
12506 doz %0,%2,%1\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
12508 [(set_attr "type" "delayed_compare")
12509 (set_attr "length" "12,16")])
12512 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12514 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12515 (match_operand:SI 2 "reg_or_short_operand" ""))
12517 (set (match_operand:SI 0 "gpc_reg_operand" "")
12518 (gt:SI (match_dup 1) (match_dup 2)))]
12519 "TARGET_POWER && reload_completed"
12520 [(set (match_dup 0)
12521 (gt:SI (match_dup 1) (match_dup 2)))
12523 (compare:CC (match_dup 0)
12528 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
12529 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12531 (match_operand:SI 2 "gpc_reg_operand" "r")))]
12532 "! TARGET_POWERPC64"
12533 "{a|addc} %0,%1,%1\;{sfe|subfe} %0,%1,%0\;{aze|addze} %0,%2"
12534 [(set_attr "length" "12")])
12537 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12538 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12540 (match_operand:DI 2 "gpc_reg_operand" "r")))
12541 (clobber (match_scratch:DI 3 "=&r"))]
12543 "addc %3,%1,%1\;subfe %3,%1,%3\;addze %0,%2"
12544 [(set_attr "length" "12")])
12547 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12549 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12551 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
12553 (clobber (match_scratch:SI 3 "=&r,&r"))]
12554 "! TARGET_POWERPC64"
12556 {a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %3,%2
12558 [(set_attr "type" "compare")
12559 (set_attr "length" "12,16")])
12562 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12564 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12566 (match_operand:SI 2 "gpc_reg_operand" ""))
12568 (clobber (match_scratch:SI 3 ""))]
12569 "! TARGET_POWERPC64 && reload_completed"
12570 [(set (match_dup 3)
12571 (plus:SI (gt:SI (match_dup 1) (const_int 0))
12574 (compare:CC (match_dup 3)
12579 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12581 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12583 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
12585 (clobber (match_scratch:DI 3 "=&r,&r"))]
12588 addc %3,%1,%1\;subfe %3,%1,%3\;addze. %3,%2
12590 [(set_attr "type" "compare")
12591 (set_attr "length" "12,16")])
12594 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12596 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12598 (match_operand:DI 2 "gpc_reg_operand" ""))
12600 (clobber (match_scratch:DI 3 ""))]
12601 "TARGET_POWERPC64 && reload_completed"
12602 [(set (match_dup 3)
12603 (plus:DI (gt:DI (match_dup 1) (const_int 0))
12606 (compare:CC (match_dup 3)
12611 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12613 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12615 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
12617 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12618 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12619 (clobber (match_scratch:SI 3 "=&r,&r"))]
12620 "! TARGET_POWERPC64"
12622 {a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %0,%2
12624 [(set_attr "type" "compare")
12625 (set_attr "length" "12,16")])
12628 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12630 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12632 (match_operand:SI 2 "gpc_reg_operand" ""))
12634 (set (match_operand:SI 0 "gpc_reg_operand" "")
12635 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12636 (clobber (match_scratch:SI 3 ""))]
12637 "! TARGET_POWERPC64 && reload_completed"
12638 [(parallel [(set (match_dup 0)
12639 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12640 (clobber (match_dup 3))])
12642 (compare:CC (match_dup 0)
12647 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12649 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12651 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
12653 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12654 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12655 (clobber (match_scratch:DI 3 "=&r,&r"))]
12658 addc %3,%1,%1\;subfe %3,%1,%3\;addze. %0,%2
12660 [(set_attr "type" "compare")
12661 (set_attr "length" "12,16")])
12664 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12666 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12668 (match_operand:DI 2 "gpc_reg_operand" ""))
12670 (set (match_operand:DI 0 "gpc_reg_operand" "")
12671 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12672 (clobber (match_scratch:DI 3 ""))]
12673 "TARGET_POWERPC64 && reload_completed"
12674 [(parallel [(set (match_dup 0)
12675 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12676 (clobber (match_dup 3))])
12678 (compare:CC (match_dup 0)
12683 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12684 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12685 (match_operand:SI 2 "reg_or_short_operand" "r"))
12686 (match_operand:SI 3 "gpc_reg_operand" "r")))
12687 (clobber (match_scratch:SI 4 "=&r"))]
12689 "doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
12690 [(set_attr "length" "12")])
12693 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12695 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12696 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12697 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12699 (clobber (match_scratch:SI 4 "=&r,&r"))]
12702 doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
12704 [(set_attr "type" "compare")
12705 (set_attr "length" "12,16")])
12708 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12710 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12711 (match_operand:SI 2 "reg_or_short_operand" ""))
12712 (match_operand:SI 3 "gpc_reg_operand" ""))
12714 (clobber (match_scratch:SI 4 ""))]
12715 "TARGET_POWER && reload_completed"
12716 [(set (match_dup 4)
12717 (plus:SI (gt:SI (match_dup 1) (match_dup 2))
12720 (compare:CC (match_dup 4)
12725 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
12727 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12728 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12729 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12731 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12732 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12733 (clobber (match_scratch:SI 4 "=&r,&r"))]
12736 doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3
12738 [(set_attr "type" "compare")
12739 (set_attr "length" "12,16")])
12742 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12744 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12745 (match_operand:SI 2 "reg_or_short_operand" ""))
12746 (match_operand:SI 3 "gpc_reg_operand" ""))
12748 (set (match_operand:SI 0 "gpc_reg_operand" "")
12749 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12750 (clobber (match_scratch:SI 4 ""))]
12751 "TARGET_POWER && reload_completed"
12752 [(parallel [(set (match_dup 0)
12753 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12754 (clobber (match_dup 4))])
12756 (compare:CC (match_dup 0)
12761 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12762 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12764 "! TARGET_POWERPC64"
12765 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{srai|srawi} %0,%0,31"
12766 [(set_attr "length" "12")])
12769 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12770 (neg:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12773 "subfic %0,%1,0\;addme %0,%0\;sradi %0,%0,63"
12774 [(set_attr "length" "12")])
12777 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12778 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12779 (match_operand:SI 2 "reg_or_short_operand" "r"))))]
12781 "doz %0,%2,%1\;nabs %0,%0\;{srai|srawi} %0,%0,31"
12782 [(set_attr "length" "12")])
12785 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12786 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12787 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
12788 "! TARGET_POWERPC64"
12789 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
12790 [(set_attr "length" "12")])
12793 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12794 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12795 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
12797 "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg %0,%0"
12798 [(set_attr "length" "12")])
12801 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12803 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12804 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12806 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12807 (gtu:SI (match_dup 1) (match_dup 2)))]
12808 "! TARGET_POWERPC64"
12810 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
12812 [(set_attr "type" "compare")
12813 (set_attr "length" "12,16")])
12816 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12818 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12819 (match_operand:SI 2 "reg_or_short_operand" ""))
12821 (set (match_operand:SI 0 "gpc_reg_operand" "")
12822 (gtu:SI (match_dup 1) (match_dup 2)))]
12823 "! TARGET_POWERPC64 && reload_completed"
12824 [(set (match_dup 0)
12825 (gtu:SI (match_dup 1) (match_dup 2)))
12827 (compare:CC (match_dup 0)
12832 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12834 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12835 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
12837 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12838 (gtu:DI (match_dup 1) (match_dup 2)))]
12841 subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg. %0,%0
12843 [(set_attr "type" "compare")
12844 (set_attr "length" "12,16")])
12847 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12849 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12850 (match_operand:DI 2 "reg_or_short_operand" ""))
12852 (set (match_operand:DI 0 "gpc_reg_operand" "")
12853 (gtu:DI (match_dup 1) (match_dup 2)))]
12854 "TARGET_POWERPC64 && reload_completed"
12855 [(set (match_dup 0)
12856 (gtu:DI (match_dup 1) (match_dup 2)))
12858 (compare:CC (match_dup 0)
12863 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,&r")
12864 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12865 (match_operand:SI 2 "reg_or_short_operand" "I,rI"))
12866 (match_operand:SI 3 "reg_or_short_operand" "r,rI")))]
12867 "! TARGET_POWERPC64"
12869 {ai|addic} %0,%1,%k2\;{aze|addze} %0,%3
12870 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;{sf%I3|subf%I3c} %0,%0,%3"
12871 [(set_attr "length" "8,12")])
12874 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12875 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12876 (match_operand:DI 2 "reg_or_short_operand" "I,rI"))
12877 (match_operand:DI 3 "reg_or_short_operand" "r,rI")))
12878 (clobber (match_scratch:DI 4 "=&r,&r"))]
12881 addic %4,%1,%k2\;addze %0,%3
12882 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subf%I3c %0,%4,%3"
12883 [(set_attr "length" "8,12")])
12886 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12888 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12889 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
12890 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12892 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12893 "! TARGET_POWERPC64"
12895 {ai|addic} %4,%1,%k2\;{aze.|addze.} %4,%3
12896 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
12899 [(set_attr "type" "compare")
12900 (set_attr "length" "8,12,12,16")])
12903 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12905 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12906 (match_operand:SI 2 "reg_or_short_operand" ""))
12907 (match_operand:SI 3 "gpc_reg_operand" ""))
12909 (clobber (match_scratch:SI 4 ""))]
12910 "! TARGET_POWERPC64 && reload_completed"
12911 [(set (match_dup 4)
12912 (plus:SI (gtu:SI (match_dup 1) (match_dup 2))
12915 (compare:CC (match_dup 4)
12920 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12922 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12923 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
12924 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
12926 (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))]
12929 addic %4,%1,%k2\;addze. %4,%3
12930 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %4,%4,%3
12933 [(set_attr "type" "compare")
12934 (set_attr "length" "8,12,12,16")])
12937 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12939 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12940 (match_operand:DI 2 "reg_or_short_operand" ""))
12941 (match_operand:DI 3 "gpc_reg_operand" ""))
12943 (clobber (match_scratch:DI 4 ""))]
12944 "TARGET_POWERPC64 && reload_completed"
12945 [(set (match_dup 4)
12946 (plus:DI (gtu:DI (match_dup 1) (match_dup 2))
12949 (compare:CC (match_dup 4)
12954 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12956 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12957 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
12958 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12960 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12961 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12962 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12963 "! TARGET_POWERPC64"
12965 {ai|addic} %4,%1,%k2\;{aze.|addze.} %0,%3
12966 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
12969 [(set_attr "type" "compare")
12970 (set_attr "length" "8,12,12,16")])
12973 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12975 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12976 (match_operand:SI 2 "reg_or_short_operand" ""))
12977 (match_operand:SI 3 "gpc_reg_operand" ""))
12979 (set (match_operand:SI 0 "gpc_reg_operand" "")
12980 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12981 (clobber (match_scratch:SI 4 ""))]
12982 "! TARGET_POWERPC64 && reload_completed"
12983 [(parallel [(set (match_dup 0)
12984 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12985 (clobber (match_dup 4))])
12987 (compare:CC (match_dup 0)
12992 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12994 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12995 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
12996 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
12998 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
12999 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
13000 (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))]
13003 addic %4,%1,%k2\;addze. %0,%3
13004 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %0,%4,%3
13007 [(set_attr "type" "compare")
13008 (set_attr "length" "8,12,12,16")])
13011 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
13013 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
13014 (match_operand:DI 2 "reg_or_short_operand" ""))
13015 (match_operand:DI 3 "gpc_reg_operand" ""))
13017 (set (match_operand:DI 0 "gpc_reg_operand" "")
13018 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
13019 (clobber (match_scratch:DI 4 ""))]
13020 "TARGET_POWERPC64 && reload_completed"
13021 [(parallel [(set (match_dup 0)
13022 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
13023 (clobber (match_dup 4))])
13025 (compare:CC (match_dup 0)
13030 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13031 (neg:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
13032 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
13033 "! TARGET_POWERPC64"
13034 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0"
13035 [(set_attr "length" "8")])
13038 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
13039 (neg:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
13040 (match_operand:DI 2 "reg_or_short_operand" "rI"))))]
13042 "subf%I2c %0,%1,%2\;subfe %0,%0,%0"
13043 [(set_attr "length" "8")])
13045 ;; Define both directions of branch and return. If we need a reload
13046 ;; register, we'd rather use CR0 since it is much easier to copy a
13047 ;; register CC value to there.
13051 (if_then_else (match_operator 1 "branch_comparison_operator"
13053 "cc_reg_operand" "x,?y")
13055 (label_ref (match_operand 0 "" ""))
13060 return output_cbranch (operands[1], \"%l0\", 0, insn);
13062 [(set_attr "type" "branch")])
13066 (if_then_else (match_operator 0 "branch_comparison_operator"
13068 "cc_reg_operand" "x,?y")
13075 return output_cbranch (operands[0], NULL, 0, insn);
13077 [(set_attr "type" "branch")
13078 (set_attr "length" "4")])
13082 (if_then_else (match_operator 1 "branch_comparison_operator"
13084 "cc_reg_operand" "x,?y")
13087 (label_ref (match_operand 0 "" ""))))]
13091 return output_cbranch (operands[1], \"%l0\", 1, insn);
13093 [(set_attr "type" "branch")])
13097 (if_then_else (match_operator 0 "branch_comparison_operator"
13099 "cc_reg_operand" "x,?y")
13106 return output_cbranch (operands[0], NULL, 1, insn);
13108 [(set_attr "type" "branch")
13109 (set_attr "length" "4")])
13111 ;; Logic on condition register values.
13113 ; This pattern matches things like
13114 ; (set (reg:CCEQ 68) (compare:CCEQ (ior:SI (gt:SI (reg:CCFP 68) (const_int 0))
13115 ; (eq:SI (reg:CCFP 68) (const_int 0)))
13117 ; which are generated by the branch logic.
13120 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13121 (compare:CCEQ (match_operator:SI 1 "boolean_operator"
13122 [(match_operator:SI 2
13123 "branch_positive_comparison_operator"
13125 "cc_reg_operand" "y")
13127 (match_operator:SI 4
13128 "branch_positive_comparison_operator"
13130 "cc_reg_operand" "y")
13134 "cr%q1 %E0,%j2,%j4"
13135 [(set_attr "type" "cr_logical")])
13137 ; Why is the constant -1 here, but 1 in the previous pattern?
13138 ; Because ~1 has all but the low bit set.
13140 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13141 (compare:CCEQ (match_operator:SI 1 "boolean_or_operator"
13142 [(not:SI (match_operator:SI 2
13143 "branch_positive_comparison_operator"
13145 "cc_reg_operand" "y")
13147 (match_operator:SI 4
13148 "branch_positive_comparison_operator"
13150 "cc_reg_operand" "y")
13154 "cr%q1 %E0,%j2,%j4"
13155 [(set_attr "type" "cr_logical")])
13158 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13159 (compare:CCEQ (match_operator:SI 1
13160 "branch_positive_comparison_operator"
13162 "cc_reg_operand" "y")
13166 "{crnor %E0,%j1,%j1|crnot %E0,%j1}"
13167 [(set_attr "type" "cr_logical")])
13169 ;; If we are comparing the result of two comparisons, this can be done
13170 ;; using creqv or crxor.
13172 (define_insn_and_split ""
13173 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
13174 (compare:CCEQ (match_operator 1 "branch_comparison_operator"
13175 [(match_operand 2 "cc_reg_operand" "y")
13177 (match_operator 3 "branch_comparison_operator"
13178 [(match_operand 4 "cc_reg_operand" "y")
13183 [(set (match_dup 0) (compare:CCEQ (xor:SI (match_dup 1) (match_dup 3))
13187 int positive_1, positive_2;
13189 positive_1 = branch_positive_comparison_operator (operands[1], CCEQmode);
13190 positive_2 = branch_positive_comparison_operator (operands[3], CCEQmode);
13193 operands[1] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[2]),
13194 GET_CODE (operands[1])),
13196 operands[2], const0_rtx);
13197 else if (GET_MODE (operands[1]) != SImode)
13198 operands[1] = gen_rtx (GET_CODE (operands[1]),
13200 operands[2], const0_rtx);
13203 operands[3] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[4]),
13204 GET_CODE (operands[3])),
13206 operands[4], const0_rtx);
13207 else if (GET_MODE (operands[3]) != SImode)
13208 operands[3] = gen_rtx (GET_CODE (operands[3]),
13210 operands[4], const0_rtx);
13212 if (positive_1 == positive_2)
13214 operands[1] = gen_rtx_NOT (SImode, operands[1]);
13215 operands[5] = constm1_rtx;
13219 operands[5] = const1_rtx;
13223 ;; Unconditional branch and return.
13225 (define_insn "jump"
13227 (label_ref (match_operand 0 "" "")))]
13230 [(set_attr "type" "branch")])
13232 (define_insn "return"
13236 [(set_attr "type" "jmpreg")])
13238 (define_expand "indirect_jump"
13239 [(set (pc) (match_operand 0 "register_operand" ""))]
13244 emit_jump_insn (gen_indirect_jumpsi (operands[0]));
13246 emit_jump_insn (gen_indirect_jumpdi (operands[0]));
13250 (define_insn "indirect_jumpsi"
13251 [(set (pc) (match_operand:SI 0 "register_operand" "c,*l"))]
13256 [(set_attr "type" "jmpreg")])
13258 (define_insn "indirect_jumpdi"
13259 [(set (pc) (match_operand:DI 0 "register_operand" "c,*l"))]
13264 [(set_attr "type" "jmpreg")])
13266 ;; Table jump for switch statements:
13267 (define_expand "tablejump"
13268 [(use (match_operand 0 "" ""))
13269 (use (label_ref (match_operand 1 "" "")))]
13274 emit_jump_insn (gen_tablejumpsi (operands[0], operands[1]));
13276 emit_jump_insn (gen_tablejumpdi (operands[0], operands[1]));
13280 (define_expand "tablejumpsi"
13281 [(set (match_dup 3)
13282 (plus:SI (match_operand:SI 0 "" "")
13284 (parallel [(set (pc) (match_dup 3))
13285 (use (label_ref (match_operand 1 "" "")))])]
13288 { operands[0] = force_reg (SImode, operands[0]);
13289 operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1]));
13290 operands[3] = gen_reg_rtx (SImode);
13293 (define_expand "tablejumpdi"
13294 [(set (match_dup 4)
13295 (sign_extend:DI (match_operand:SI 0 "lwa_operand" "rm")))
13297 (plus:DI (match_dup 4)
13299 (parallel [(set (pc) (match_dup 3))
13300 (use (label_ref (match_operand 1 "" "")))])]
13303 { operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
13304 operands[3] = gen_reg_rtx (DImode);
13305 operands[4] = gen_reg_rtx (DImode);
13310 (match_operand:SI 0 "register_operand" "c,*l"))
13311 (use (label_ref (match_operand 1 "" "")))]
13316 [(set_attr "type" "jmpreg")])
13320 (match_operand:DI 0 "register_operand" "c,*l"))
13321 (use (label_ref (match_operand 1 "" "")))]
13326 [(set_attr "type" "jmpreg")])
13331 "{cror 0,0,0|nop}")
13333 ;; Define the subtract-one-and-jump insns, starting with the template
13334 ;; so loop.c knows what to generate.
13336 (define_expand "doloop_end"
13337 [(use (match_operand 0 "" "")) ; loop pseudo
13338 (use (match_operand 1 "" "")) ; iterations; zero if unknown
13339 (use (match_operand 2 "" "")) ; max iterations
13340 (use (match_operand 3 "" "")) ; loop level
13341 (use (match_operand 4 "" ""))] ; label
13345 /* Only use this on innermost loops. */
13346 if (INTVAL (operands[3]) > 1)
13348 if (TARGET_POWERPC64)
13350 if (GET_MODE (operands[0]) != DImode)
13352 emit_jump_insn (gen_ctrdi (operands[0], operands[4]));
13356 if (GET_MODE (operands[0]) != SImode)
13358 emit_jump_insn (gen_ctrsi (operands[0], operands[4]));
13363 (define_expand "ctrsi"
13364 [(parallel [(set (pc)
13365 (if_then_else (ne (match_operand:SI 0 "register_operand" "")
13367 (label_ref (match_operand 1 "" ""))
13370 (plus:SI (match_dup 0)
13372 (clobber (match_scratch:CC 2 ""))
13373 (clobber (match_scratch:SI 3 ""))])]
13374 "! TARGET_POWERPC64"
13377 (define_expand "ctrdi"
13378 [(parallel [(set (pc)
13379 (if_then_else (ne (match_operand:DI 0 "register_operand" "")
13381 (label_ref (match_operand 1 "" ""))
13384 (plus:DI (match_dup 0)
13386 (clobber (match_scratch:CC 2 ""))
13387 (clobber (match_scratch:DI 3 ""))])]
13391 ;; We need to be able to do this for any operand, including MEM, or we
13392 ;; will cause reload to blow up since we don't allow output reloads on
13394 ;; For the length attribute to be calculated correctly, the
13395 ;; label MUST be operand 0.
13397 (define_insn "*ctrsi_internal1"
13399 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
13401 (label_ref (match_operand 0 "" ""))
13403 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13404 (plus:SI (match_dup 1)
13406 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13407 (clobber (match_scratch:SI 4 "=X,X,r"))]
13408 "! TARGET_POWERPC64"
13411 if (which_alternative != 0)
13413 else if (get_attr_length (insn) == 4)
13414 return \"{bdn|bdnz} %l0\";
13416 return \"bdz $+8\;b %l0\";
13418 [(set_attr "type" "branch")
13419 (set_attr "length" "*,12,16")])
13421 (define_insn "*ctrsi_internal2"
13423 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
13426 (label_ref (match_operand 0 "" ""))))
13427 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13428 (plus:SI (match_dup 1)
13430 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13431 (clobber (match_scratch:SI 4 "=X,X,r"))]
13432 "! TARGET_POWERPC64"
13435 if (which_alternative != 0)
13437 else if (get_attr_length (insn) == 4)
13438 return \"bdz %l0\";
13440 return \"{bdn|bdnz} $+8\;b %l0\";
13442 [(set_attr "type" "branch")
13443 (set_attr "length" "*,12,16")])
13445 (define_insn "*ctrdi_internal1"
13447 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
13449 (label_ref (match_operand 0 "" ""))
13451 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13452 (plus:DI (match_dup 1)
13454 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13455 (clobber (match_scratch:DI 4 "=X,X,r"))]
13459 if (which_alternative != 0)
13461 else if (get_attr_length (insn) == 4)
13462 return \"{bdn|bdnz} %l0\";
13464 return \"bdz $+8\;b %l0\";
13466 [(set_attr "type" "branch")
13467 (set_attr "length" "*,12,16")])
13469 (define_insn "*ctrdi_internal2"
13471 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r")
13474 (label_ref (match_operand 0 "" ""))))
13475 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13476 (plus:DI (match_dup 1)
13478 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13479 (clobber (match_scratch:DI 4 "=X,X,r"))]
13483 if (which_alternative != 0)
13485 else if (get_attr_length (insn) == 4)
13486 return \"bdz %l0\";
13488 return \"{bdn|bdnz} $+8\;b %l0\";
13490 [(set_attr "type" "branch")
13491 (set_attr "length" "*,12,16")])
13493 ;; Similar, but we can use GE since we have a REG_NONNEG.
13495 (define_insn "*ctrsi_internal3"
13497 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
13499 (label_ref (match_operand 0 "" ""))
13501 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13502 (plus:SI (match_dup 1)
13504 (clobber (match_scratch:CC 3 "=X,&x,&X"))
13505 (clobber (match_scratch:SI 4 "=X,X,r"))]
13506 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13509 if (which_alternative != 0)
13511 else if (get_attr_length (insn) == 4)
13512 return \"{bdn|bdnz} %l0\";
13514 return \"bdz $+8\;b %l0\";
13516 [(set_attr "type" "branch")
13517 (set_attr "length" "*,12,16")])
13519 (define_insn "*ctrsi_internal4"
13521 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
13524 (label_ref (match_operand 0 "" ""))))
13525 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13526 (plus:SI (match_dup 1)
13528 (clobber (match_scratch:CC 3 "=X,&x,&X"))
13529 (clobber (match_scratch:SI 4 "=X,X,r"))]
13530 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13533 if (which_alternative != 0)
13535 else if (get_attr_length (insn) == 4)
13536 return \"bdz %l0\";
13538 return \"{bdn|bdnz} $+8\;b %l0\";
13540 [(set_attr "type" "branch")
13541 (set_attr "length" "*,12,16")])
13543 (define_insn "*ctrdi_internal3"
13545 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
13547 (label_ref (match_operand 0 "" ""))
13549 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13550 (plus:DI (match_dup 1)
13552 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13553 (clobber (match_scratch:DI 4 "=X,X,r"))]
13554 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13557 if (which_alternative != 0)
13559 else if (get_attr_length (insn) == 4)
13560 return \"{bdn|bdnz} %l0\";
13562 return \"bdz $+8\;b %l0\";
13564 [(set_attr "type" "branch")
13565 (set_attr "length" "*,12,16")])
13567 (define_insn "*ctrdi_internal4"
13569 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r")
13572 (label_ref (match_operand 0 "" ""))))
13573 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13574 (plus:DI (match_dup 1)
13576 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13577 (clobber (match_scratch:DI 4 "=X,X,r"))]
13578 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13581 if (which_alternative != 0)
13583 else if (get_attr_length (insn) == 4)
13584 return \"bdz %l0\";
13586 return \"{bdn|bdnz} $+8\;b %l0\";
13588 [(set_attr "type" "branch")
13589 (set_attr "length" "*,12,16")])
13591 ;; Similar but use EQ
13593 (define_insn "*ctrsi_internal5"
13595 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
13597 (label_ref (match_operand 0 "" ""))
13599 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13600 (plus:SI (match_dup 1)
13602 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13603 (clobber (match_scratch:SI 4 "=X,X,r"))]
13604 "! TARGET_POWERPC64"
13607 if (which_alternative != 0)
13609 else if (get_attr_length (insn) == 4)
13610 return \"bdz %l0\";
13612 return \"{bdn|bdnz} $+8\;b %l0\";
13614 [(set_attr "type" "branch")
13615 (set_attr "length" "*,12,16")])
13617 (define_insn "*ctrsi_internal6"
13619 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
13622 (label_ref (match_operand 0 "" ""))))
13623 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13624 (plus:SI (match_dup 1)
13626 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13627 (clobber (match_scratch:SI 4 "=X,X,r"))]
13628 "! TARGET_POWERPC64"
13631 if (which_alternative != 0)
13633 else if (get_attr_length (insn) == 4)
13634 return \"{bdn|bdnz} %l0\";
13636 return \"bdz $+8\;b %l0\";
13638 [(set_attr "type" "branch")
13639 (set_attr "length" "*,12,16")])
13641 (define_insn "*ctrdi_internal5"
13643 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
13645 (label_ref (match_operand 0 "" ""))
13647 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13648 (plus:DI (match_dup 1)
13650 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13651 (clobber (match_scratch:DI 4 "=X,X,r"))]
13655 if (which_alternative != 0)
13657 else if (get_attr_length (insn) == 4)
13658 return \"bdz %l0\";
13660 return \"{bdn|bdnz} $+8\;b %l0\";
13662 [(set_attr "type" "branch")
13663 (set_attr "length" "*,12,16")])
13665 (define_insn "*ctrdi_internal6"
13667 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r")
13670 (label_ref (match_operand 0 "" ""))))
13671 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l")
13672 (plus:DI (match_dup 1)
13674 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13675 (clobber (match_scratch:DI 4 "=X,X,r"))]
13679 if (which_alternative != 0)
13681 else if (get_attr_length (insn) == 4)
13682 return \"{bdn|bdnz} %l0\";
13684 return \"bdz $+8\;b %l0\";
13686 [(set_attr "type" "branch")
13687 (set_attr "length" "*,12,16")])
13689 ;; Now the splitters if we could not allocate the CTR register
13693 (if_then_else (match_operator 2 "comparison_operator"
13694 [(match_operand:SI 1 "gpc_reg_operand" "")
13696 (match_operand 5 "" "")
13697 (match_operand 6 "" "")))
13698 (set (match_operand:SI 0 "gpc_reg_operand" "")
13699 (plus:SI (match_dup 1)
13701 (clobber (match_scratch:CC 3 ""))
13702 (clobber (match_scratch:SI 4 ""))]
13703 "! TARGET_POWERPC64 && reload_completed"
13704 [(parallel [(set (match_dup 3)
13705 (compare:CC (plus:SI (match_dup 1)
13709 (plus:SI (match_dup 1)
13711 (set (pc) (if_then_else (match_dup 7)
13715 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13720 (if_then_else (match_operator 2 "comparison_operator"
13721 [(match_operand:SI 1 "gpc_reg_operand" "")
13723 (match_operand 5 "" "")
13724 (match_operand 6 "" "")))
13725 (set (match_operand:SI 0 "nonimmediate_operand" "")
13726 (plus:SI (match_dup 1) (const_int -1)))
13727 (clobber (match_scratch:CC 3 ""))
13728 (clobber (match_scratch:SI 4 ""))]
13729 "! TARGET_POWERPC64 && reload_completed
13730 && ! gpc_reg_operand (operands[0], SImode)"
13731 [(parallel [(set (match_dup 3)
13732 (compare:CC (plus:SI (match_dup 1)
13736 (plus:SI (match_dup 1)
13740 (set (pc) (if_then_else (match_dup 7)
13744 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13748 (if_then_else (match_operator 2 "comparison_operator"
13749 [(match_operand:DI 1 "gpc_reg_operand" "")
13751 (match_operand 5 "" "")
13752 (match_operand 6 "" "")))
13753 (set (match_operand:DI 0 "gpc_reg_operand" "")
13754 (plus:DI (match_dup 1)
13756 (clobber (match_scratch:CC 3 ""))
13757 (clobber (match_scratch:DI 4 ""))]
13758 "TARGET_POWERPC64 && reload_completed"
13759 [(parallel [(set (match_dup 3)
13760 (compare:CC (plus:DI (match_dup 1)
13764 (plus:DI (match_dup 1)
13766 (set (pc) (if_then_else (match_dup 7)
13770 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13775 (if_then_else (match_operator 2 "comparison_operator"
13776 [(match_operand:DI 1 "gpc_reg_operand" "")
13778 (match_operand 5 "" "")
13779 (match_operand 6 "" "")))
13780 (set (match_operand:DI 0 "nonimmediate_operand" "")
13781 (plus:DI (match_dup 1) (const_int -1)))
13782 (clobber (match_scratch:CC 3 ""))
13783 (clobber (match_scratch:DI 4 ""))]
13784 "TARGET_POWERPC64 && reload_completed
13785 && ! gpc_reg_operand (operands[0], DImode)"
13786 [(parallel [(set (match_dup 3)
13787 (compare:CC (plus:DI (match_dup 1)
13791 (plus:DI (match_dup 1)
13795 (set (pc) (if_then_else (match_dup 7)
13799 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13803 (define_insn "trap"
13804 [(trap_if (const_int 1) (const_int 0))]
13808 (define_expand "conditional_trap"
13809 [(trap_if (match_operator 0 "trap_comparison_operator"
13810 [(match_dup 2) (match_dup 3)])
13811 (match_operand 1 "const_int_operand" ""))]
13813 "if (rs6000_compare_fp_p || operands[1] != const0_rtx) FAIL;
13814 operands[2] = rs6000_compare_op0;
13815 operands[3] = rs6000_compare_op1;")
13818 [(trap_if (match_operator 0 "trap_comparison_operator"
13819 [(match_operand:SI 1 "register_operand" "r")
13820 (match_operand:SI 2 "reg_or_short_operand" "rI")])
13823 "{t|tw}%V0%I2 %1,%2")
13826 [(trap_if (match_operator 0 "trap_comparison_operator"
13827 [(match_operand:DI 1 "register_operand" "r")
13828 (match_operand:DI 2 "reg_or_short_operand" "rI")])
13833 ;; Insns related to generating the function prologue and epilogue.
13835 (define_expand "prologue"
13836 [(use (const_int 0))]
13837 "TARGET_SCHED_PROLOG"
13840 rs6000_emit_prologue ();
13844 (define_insn "movesi_from_cr"
13845 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13846 (unspec:SI [(reg:CC 68) (reg:CC 69) (reg:CC 70) (reg:CC 71)
13847 (reg:CC 72) (reg:CC 73) (reg:CC 74) (reg:CC 75)] 19))]
13850 [(set_attr "type" "cr_logical")])
13852 (define_insn "*stmw"
13853 [(match_parallel 0 "stmw_operation"
13854 [(set (match_operand:SI 1 "memory_operand" "=m")
13855 (match_operand:SI 2 "gpc_reg_operand" "r"))])]
13857 "{stm|stmw} %2,%1")
13859 (define_insn "*save_fpregs_si"
13860 [(match_parallel 0 "any_operand"
13861 [(clobber (match_operand:SI 1 "register_operand" "=l"))
13862 (use (match_operand:SI 2 "call_operand" "s"))
13863 (set (match_operand:DF 3 "memory_operand" "=m")
13864 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
13868 (define_insn "*save_fpregs_di"
13869 [(match_parallel 0 "any_operand"
13870 [(clobber (match_operand:DI 1 "register_operand" "=l"))
13871 (use (match_operand:DI 2 "call_operand" "s"))
13872 (set (match_operand:DF 3 "memory_operand" "=m")
13873 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
13877 ; These are to explain that changes to the stack pointer should
13878 ; not be moved over stores to stack memory.
13879 (define_insn "stack_tie"
13880 [(set (match_operand:BLK 0 "memory_operand" "+m")
13881 (unspec:BLK [(match_dup 0)] 5))]
13884 [(set_attr "length" "0")])
13887 (define_expand "epilogue"
13888 [(use (const_int 0))]
13889 "TARGET_SCHED_PROLOG"
13892 rs6000_emit_epilogue (FALSE);
13896 ; On some processors, doing the mtcrf one CC register at a time is
13897 ; faster (like on the 604e). On others, doing them all at once is
13898 ; faster; for instance, on the 601 and 750.
13900 (define_expand "movsi_to_cr_one"
13901 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
13902 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
13903 (match_dup 2)] 20))]
13905 "operands[2] = GEN_INT (1 << (75 - REGNO (operands[0])));")
13907 (define_insn "*movsi_to_cr"
13908 [(match_parallel 0 "mtcrf_operation"
13909 [(set (match_operand:CC 1 "cc_reg_operand" "=y")
13910 (unspec:CC [(match_operand:SI 2 "gpc_reg_operand" "r")
13911 (match_operand 3 "immediate_operand" "n")]
13918 for (i = 0; i < XVECLEN (operands[0], 0); i++)
13919 mask |= INTVAL (XVECEXP (SET_SRC (XVECEXP (operands[0], 0, i)), 0, 1));
13920 operands[4] = GEN_INT (mask);
13921 return \"mtcrf %4,%2\";
13923 [(set_attr "type" "cr_logical")])
13926 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
13927 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
13928 (match_operand 2 "immediate_operand" "n")] 20))]
13929 "GET_CODE (operands[0]) == REG
13930 && CR_REGNO_P (REGNO (operands[0]))
13931 && GET_CODE (operands[2]) == CONST_INT
13932 && INTVAL (operands[2]) == 1 << (75 - REGNO (operands[0]))"
13934 [(set_attr "type" "cr_logical")])
13936 ; The load-multiple instructions have similar properties.
13937 ; Note that "load_multiple" is a name known to the machine-independent
13938 ; code that actually corresponds to the powerpc load-string.
13940 (define_insn "*lmw"
13941 [(match_parallel 0 "lmw_operation"
13942 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
13943 (match_operand:SI 2 "memory_operand" "m"))])]
13947 (define_insn "*return_internal_si"
13949 (use (match_operand:SI 0 "register_operand" "lc"))]
13952 [(set_attr "type" "jmpreg")])
13954 (define_insn "*return_internal_di"
13956 (use (match_operand:DI 0 "register_operand" "lc"))]
13959 [(set_attr "type" "jmpreg")])
13961 ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
13962 ; stuff was in GCC. Oh, and "any_operand" is a bit flexible...
13964 (define_insn "*return_and_restore_fpregs_si"
13965 [(match_parallel 0 "any_operand"
13967 (use (match_operand:SI 1 "register_operand" "l"))
13968 (use (match_operand:SI 2 "call_operand" "s"))
13969 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
13970 (match_operand:DF 4 "memory_operand" "m"))])]
13974 (define_insn "*return_and_restore_fpregs_di"
13975 [(match_parallel 0 "any_operand"
13977 (use (match_operand:DI 1 "register_operand" "l"))
13978 (use (match_operand:DI 2 "call_operand" "s"))
13979 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
13980 (match_operand:DF 4 "memory_operand" "m"))])]
13984 ; This is used in compiling the unwind routines.
13985 (define_expand "eh_return"
13986 [(use (match_operand 0 "general_operand" ""))
13987 (use (match_operand 1 "general_operand" ""))]
13992 rs6000_emit_eh_toc_restore (operands[0]);
13995 emit_insn (gen_eh_set_lr_si (operands[1]));
13997 emit_insn (gen_eh_set_lr_di (operands[1]));
13998 emit_move_insn (EH_RETURN_STACKADJ_RTX, operands[0]);
14002 ; We can't expand this before we know where the link register is stored.
14003 (define_insn "eh_set_lr_si"
14004 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] 9)
14005 (clobber (match_scratch:SI 1 "=&b"))]
14009 (define_insn "eh_set_lr_di"
14010 [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")] 9)
14011 (clobber (match_scratch:DI 1 "=&b"))]
14016 [(unspec_volatile [(match_operand 0 "register_operand" "")] 9)
14017 (clobber (match_scratch 1 ""))]
14022 rs6000_stack_t *info = rs6000_stack_info ();
14024 if (info->lr_save_p)
14026 rtx frame_rtx = stack_pointer_rtx;
14030 if (frame_pointer_needed
14031 || current_function_calls_alloca
14032 || info->total_size > 32767)
14034 emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx));
14035 frame_rtx = operands[1];
14037 else if (info->push_p)
14038 sp_offset = info->total_size;
14040 tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset);
14041 tmp = gen_rtx_MEM (Pmode, tmp);
14042 emit_move_insn (tmp, operands[0]);
14045 emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]);
14049 (define_insn "prefetch"
14050 [(prefetch (match_operand:V4SI 0 "address_operand" "p")
14051 (match_operand:SI 1 "const_int_operand" "n")
14052 (match_operand:SI 2 "const_int_operand" "n"))]
14056 if (GET_CODE (operands[0]) == REG)
14057 return INTVAL (operands[1]) ? \"dcbtst 0,%0\" : \"dcbt 0,%0\";
14058 return INTVAL (operands[1]) ? \"dcbtst %a0\" : \"dcbt %a0\";
14060 [(set_attr "type" "load")])
14062 ;; AltiVec patterns
14064 ;; Generic LVX load instruction.
14065 (define_insn "altivec_lvx_4si"
14066 [(set (match_operand:V4SI 0 "altivec_register_operand" "=v")
14067 (match_operand:V4SI 1 "memory_operand" "m"))]
14070 [(set_attr "type" "vecload")])
14072 (define_insn "altivec_lvx_8hi"
14073 [(set (match_operand:V8HI 0 "altivec_register_operand" "=v")
14074 (match_operand:V8HI 1 "memory_operand" "m"))]
14077 [(set_attr "type" "vecload")])
14079 (define_insn "altivec_lvx_16qi"
14080 [(set (match_operand:V16QI 0 "altivec_register_operand" "=v")
14081 (match_operand:V16QI 1 "memory_operand" "m"))]
14084 [(set_attr "type" "vecload")])
14086 (define_insn "altivec_lvx_4sf"
14087 [(set (match_operand:V4SF 0 "altivec_register_operand" "=v")
14088 (match_operand:V4SF 1 "memory_operand" "m"))]
14091 [(set_attr "type" "vecload")])
14093 ;; Generic STVX store instruction.
14094 (define_insn "altivec_stvx_4si"
14095 [(set (match_operand:V4SI 0 "memory_operand" "=m")
14096 (match_operand:V4SI 1 "altivec_register_operand" "v"))]
14099 [(set_attr "type" "vecstore")])
14101 (define_insn "altivec_stvx_8hi"
14102 [(set (match_operand:V8HI 0 "memory_operand" "=m")
14103 (match_operand:V8HI 1 "altivec_register_operand" "v"))]
14106 [(set_attr "type" "vecstore")])
14108 (define_insn "altivec_stvx_16qi"
14109 [(set (match_operand:V16QI 0 "memory_operand" "=m")
14110 (match_operand:V16QI 1 "altivec_register_operand" "v"))]
14113 [(set_attr "type" "vecstore")])
14115 (define_insn "altivec_stvx_4sf"
14116 [(set (match_operand:V4SF 0 "memory_operand" "=m")
14117 (match_operand:V4SF 1 "altivec_register_operand" "v"))]
14120 [(set_attr "type" "vecstore")])
14122 ;; Vector move instructions.
14123 (define_expand "movv4si"
14124 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
14125 (match_operand:V4SI 1 "any_operand" ""))]
14127 "{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }")
14129 (define_insn "*movv4si_internal"
14130 [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
14131 (match_operand:V4SI 1 "input_operand" "v,m,v,r,o,r"))]
14137 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14138 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14139 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14140 [(set_attr "type" "altivec")
14141 (set_attr "length" "*,*,*,16,16,16")])
14143 (define_expand "movv8hi"
14144 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
14145 (match_operand:V8HI 1 "any_operand" ""))]
14147 "{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }")
14149 (define_insn "*movv8hi_internal1"
14150 [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
14151 (match_operand:V8HI 1 "input_operand" "v,m,v,r,o,r"))]
14157 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14158 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14159 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14160 [(set_attr "type" "altivec")
14161 (set_attr "length" "*,*,*,16,16,16")])
14163 (define_expand "movv16qi"
14164 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
14165 (match_operand:V16QI 1 "any_operand" ""))]
14167 "{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }")
14169 (define_insn "*movv16qi_internal1"
14170 [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,o,r,r")
14171 (match_operand:V16QI 1 "input_operand" "v,m,v,r,o,r"))]
14177 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14178 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14179 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14180 [(set_attr "type" "altivec")
14181 (set_attr "length" "*,*,*,16,16,16")])
14183 (define_expand "movv4sf"
14184 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
14185 (match_operand:V4SF 1 "any_operand" ""))]
14187 "{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }")
14189 (define_insn "*movv4sf_internal1"
14190 [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,o,r,r")
14191 (match_operand:V4SF 1 "input_operand" "v,m,v,r,o,r"))]
14197 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14198 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14199 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14200 [(set_attr "type" "altivec")
14201 (set_attr "length" "*,*,*,16,16,16")])
14203 (define_insn "get_vrsave_internal"
14204 [(set (match_operand:SI 0 "register_operand" "=r")
14205 (unspec:SI [(reg:SI 109)] 214))]
14210 return \"mfspr %0,256\";
14212 return \"mfvrsave %0\";
14214 [(set_attr "type" "altivec")])
14216 (define_insn "*set_vrsave_internal"
14217 [(match_parallel 0 "vrsave_operation"
14219 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
14220 (reg:SI 109)] 30))])]
14225 return \"mtspr 256,%1\";
14227 return \"mtvrsave %1\";
14229 [(set_attr "type" "altivec")])
14232 (define_insn "*movv4si_const0"
14233 [(set (match_operand:V4SI 0 "altivec_register_operand" "=v")
14234 (match_operand:V4SI 1 "zero_constant" ""))]
14237 [(set_attr "type" "vecsimple")])
14239 (define_insn "*movv4sf_const0"
14240 [(set (match_operand:V4SF 0 "altivec_register_operand" "=v")
14241 (match_operand:V4SF 1 "zero_constant" ""))]
14245 [(set_attr "type" "vecsimple")])
14247 (define_insn "*movv8hi_const0"
14248 [(set (match_operand:V8HI 0 "altivec_register_operand" "=v")
14249 (match_operand:V8HI 1 "zero_constant" ""))]
14252 [(set_attr "type" "vecsimple")])
14254 (define_insn "*movv16qi_const0"
14255 [(set (match_operand:V16QI 0 "altivec_register_operand" "=v")
14256 (match_operand:V16QI 1 "zero_constant" ""))]
14259 [(set_attr "type" "vecsimple")])
14261 ;; Simple binary operations.
14263 (define_insn "addv16qi3"
14264 [(set (match_operand:V16QI 0 "register_operand" "=v")
14265 (plus:V16QI (match_operand:V16QI 1 "register_operand" "v")
14266 (match_operand:V16QI 2 "register_operand" "v")))]
14269 [(set_attr "type" "vecsimple")])
14271 (define_insn "addv8hi3"
14272 [(set (match_operand:V8HI 0 "register_operand" "=v")
14273 (plus:V8HI (match_operand:V8HI 1 "register_operand" "v")
14274 (match_operand:V8HI 2 "register_operand" "v")))]
14277 [(set_attr "type" "vecsimple")])
14279 (define_insn "addv4si3"
14280 [(set (match_operand:V4SI 0 "register_operand" "=v")
14281 (plus:V4SI (match_operand:V4SI 1 "register_operand" "v")
14282 (match_operand:V4SI 2 "register_operand" "v")))]
14285 [(set_attr "type" "vecsimple")])
14287 (define_insn "addv4sf3"
14288 [(set (match_operand:V4SF 0 "register_operand" "=v")
14289 (plus:V4SF (match_operand:V4SF 1 "register_operand" "v")
14290 (match_operand:V4SF 2 "register_operand" "v")))]
14293 [(set_attr "type" "vecfloat")])
14295 (define_insn "altivec_vaddcuw"
14296 [(set (match_operand:V4SI 0 "register_operand" "=v")
14297 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14298 (match_operand:V4SI 2 "register_operand" "v")] 35))]
14301 [(set_attr "type" "vecsimple")])
14303 (define_insn "altivec_vaddubs"
14304 [(set (match_operand:V16QI 0 "register_operand" "=v")
14305 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14306 (match_operand:V16QI 2 "register_operand" "v")] 36))
14307 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14310 [(set_attr "type" "vecsimple")])
14312 (define_insn "altivec_vaddsbs"
14313 [(set (match_operand:V16QI 0 "register_operand" "=v")
14314 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14315 (match_operand:V16QI 2 "register_operand" "v")] 37))
14316 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14319 [(set_attr "type" "vecsimple")])
14321 (define_insn "altivec_vadduhs"
14322 [(set (match_operand:V8HI 0 "register_operand" "=v")
14323 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14324 (match_operand:V8HI 2 "register_operand" "v")] 38))
14325 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14328 [(set_attr "type" "vecsimple")])
14330 (define_insn "altivec_vaddshs"
14331 [(set (match_operand:V8HI 0 "register_operand" "=v")
14332 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14333 (match_operand:V8HI 2 "register_operand" "v")] 39))
14334 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14337 [(set_attr "type" "vecsimple")])
14339 (define_insn "altivec_vadduws"
14340 [(set (match_operand:V4SI 0 "register_operand" "=v")
14341 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14342 (match_operand:V4SI 2 "register_operand" "v")] 40))
14343 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14346 [(set_attr "type" "vecsimple")])
14348 (define_insn "altivec_vaddsws"
14349 [(set (match_operand:V4SI 0 "register_operand" "=v")
14350 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14351 (match_operand:V4SI 2 "register_operand" "v")] 41))
14352 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14355 [(set_attr "type" "vecsimple")])
14357 (define_insn "andv4si3"
14358 [(set (match_operand:V4SI 0 "register_operand" "=v")
14359 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
14360 (match_operand:V4SI 2 "register_operand" "v")))]
14363 [(set_attr "type" "vecsimple")])
14365 (define_insn "altivec_vandc"
14366 [(set (match_operand:V4SI 0 "register_operand" "=v")
14367 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
14368 (not:V4SI (match_operand:V4SI 2 "register_operand" "v"))))]
14371 [(set_attr "type" "vecsimple")])
14373 (define_insn "altivec_vavgub"
14374 [(set (match_operand:V16QI 0 "register_operand" "=v")
14375 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14376 (match_operand:V16QI 2 "register_operand" "v")] 44))]
14379 [(set_attr "type" "vecsimple")])
14381 (define_insn "altivec_vavgsb"
14382 [(set (match_operand:V16QI 0 "register_operand" "=v")
14383 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14384 (match_operand:V16QI 2 "register_operand" "v")] 45))]
14387 [(set_attr "type" "vecsimple")])
14389 (define_insn "altivec_vavguh"
14390 [(set (match_operand:V8HI 0 "register_operand" "=v")
14391 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14392 (match_operand:V8HI 2 "register_operand" "v")] 46))]
14395 [(set_attr "type" "vecsimple")])
14397 (define_insn "altivec_vavgsh"
14398 [(set (match_operand:V8HI 0 "register_operand" "=v")
14399 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14400 (match_operand:V8HI 2 "register_operand" "v")] 47))]
14403 [(set_attr "type" "vecsimple")])
14405 (define_insn "altivec_vavguw"
14406 [(set (match_operand:V4SI 0 "register_operand" "=v")
14407 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14408 (match_operand:V4SI 2 "register_operand" "v")] 48))]
14411 [(set_attr "type" "vecsimple")])
14413 (define_insn "altivec_vavgsw"
14414 [(set (match_operand:V4SI 0 "register_operand" "=v")
14415 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14416 (match_operand:V4SI 2 "register_operand" "v")] 49))]
14419 [(set_attr "type" "vecsimple")])
14421 (define_insn "altivec_vcmpbfp"
14422 [(set (match_operand:V4SI 0 "register_operand" "=v")
14423 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14424 (match_operand:V4SF 2 "register_operand" "v")] 50))]
14427 [(set_attr "type" "veccmp")])
14429 (define_insn "altivec_vcmpequb"
14430 [(set (match_operand:V16QI 0 "register_operand" "=v")
14431 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14432 (match_operand:V16QI 2 "register_operand" "v")] 51))]
14434 "vcmpequb %0,%1,%2"
14435 [(set_attr "type" "vecsimple")])
14437 (define_insn "altivec_vcmpequh"
14438 [(set (match_operand:V8HI 0 "register_operand" "=v")
14439 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14440 (match_operand:V8HI 2 "register_operand" "v")] 52))]
14442 "vcmpequh %0,%1,%2"
14443 [(set_attr "type" "vecsimple")])
14445 (define_insn "altivec_vcmpequw"
14446 [(set (match_operand:V4SI 0 "register_operand" "=v")
14447 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14448 (match_operand:V4SI 2 "register_operand" "v")] 53))]
14450 "vcmpequw %0,%1,%2"
14451 [(set_attr "type" "vecsimple")])
14453 (define_insn "altivec_vcmpeqfp"
14454 [(set (match_operand:V4SI 0 "register_operand" "=v")
14455 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14456 (match_operand:V4SF 2 "register_operand" "v")] 54))]
14458 "vcmpeqfp %0,%1,%2"
14459 [(set_attr "type" "veccmp")])
14461 (define_insn "altivec_vcmpgefp"
14462 [(set (match_operand:V4SI 0 "register_operand" "=v")
14463 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14464 (match_operand:V4SF 2 "register_operand" "v")] 55))]
14466 "vcmpgefp %0,%1,%2"
14467 [(set_attr "type" "veccmp")])
14469 (define_insn "altivec_vcmpgtub"
14470 [(set (match_operand:V16QI 0 "register_operand" "=v")
14471 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14472 (match_operand:V16QI 2 "register_operand" "v")] 56))]
14474 "vcmpgtub %0,%1,%2"
14475 [(set_attr "type" "vecsimple")])
14477 (define_insn "altivec_vcmpgtsb"
14478 [(set (match_operand:V16QI 0 "register_operand" "=v")
14479 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14480 (match_operand:V16QI 2 "register_operand" "v")] 57))]
14482 "vcmpgtsb %0,%1,%2"
14483 [(set_attr "type" "vecsimple")])
14485 (define_insn "altivec_vcmpgtuh"
14486 [(set (match_operand:V8HI 0 "register_operand" "=v")
14487 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14488 (match_operand:V8HI 2 "register_operand" "v")] 58))]
14490 "vcmpgtuh %0,%1,%2"
14491 [(set_attr "type" "vecsimple")])
14493 (define_insn "altivec_vcmpgtsh"
14494 [(set (match_operand:V8HI 0 "register_operand" "=v")
14495 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14496 (match_operand:V8HI 2 "register_operand" "v")] 59))]
14498 "vcmpgtsh %0,%1,%2"
14499 [(set_attr "type" "vecsimple")])
14501 (define_insn "altivec_vcmpgtuw"
14502 [(set (match_operand:V4SI 0 "register_operand" "=v")
14503 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14504 (match_operand:V4SI 2 "register_operand" "v")] 60))]
14506 "vcmpgtuw %0,%1,%2"
14507 [(set_attr "type" "vecsimple")])
14509 (define_insn "altivec_vcmpgtsw"
14510 [(set (match_operand:V4SI 0 "register_operand" "=v")
14511 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14512 (match_operand:V4SI 2 "register_operand" "v")] 61))]
14514 "vcmpgtsw %0,%1,%2"
14515 [(set_attr "type" "vecsimple")])
14517 (define_insn "altivec_vcmpgtfp"
14518 [(set (match_operand:V4SI 0 "register_operand" "=v")
14519 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14520 (match_operand:V4SF 2 "register_operand" "v")] 62))]
14522 "vcmpgtfp %0,%1,%2"
14523 [(set_attr "type" "veccmp")])
14525 ;; Fused multiply add
14526 (define_insn "altivec_vmaddfp"
14527 [(set (match_operand:V4SF 0 "register_operand" "=v")
14528 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14529 (match_operand:V4SF 2 "register_operand" "v"))
14530 (match_operand:V4SF 3 "register_operand" "v")))]
14532 "vmaddfp %0,%1,%2,%3"
14533 [(set_attr "type" "vecfloat")])
14535 ;; The unspec here is a vec splat of 0. We do multiply as a fused
14536 ;; multiply-add with an add of a 0 vector.
14538 (define_expand "mulv4sf3"
14539 [(set (match_dup 3) (unspec:V4SF [(const_int 0)] 142))
14540 (set (match_operand:V4SF 0 "register_operand" "=v")
14541 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14542 (match_operand:V4SF 2 "register_operand" "v"))
14544 "TARGET_ALTIVEC && TARGET_FUSED_MADD"
14546 { operands[3] = gen_reg_rtx (V4SFmode); }")
14548 ;; Fused multiply subtract
14549 (define_insn "altivec_vnmsubfp"
14550 [(set (match_operand:V4SF 0 "register_operand" "=v")
14551 (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14552 (match_operand:V4SF 2 "register_operand" "v"))
14553 (match_operand:V4SF 3 "register_operand" "v")))]
14555 "vnmsubfp %0,%1,%2,%3"
14556 [(set_attr "type" "vecfloat")])
14559 (define_insn "altivec_vmsumubm"
14560 [(set (match_operand:V4SI 0 "register_operand" "=v")
14561 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
14562 (match_operand:V16QI 2 "register_operand" "v")
14563 (match_operand:V4SI 3 "register_operand" "v")] 65))]
14565 "vmsumubm %0, %1, %2, %3"
14566 [(set_attr "type" "veccomplex")])
14568 (define_insn "altivec_vmsummbm"
14569 [(set (match_operand:V4SI 0 "register_operand" "=v")
14570 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
14571 (match_operand:V16QI 2 "register_operand" "v")
14572 (match_operand:V4SI 3 "register_operand" "v")] 66))]
14574 "vmsumubm %0, %1, %2, %3"
14575 [(set_attr "type" "veccomplex")])
14577 (define_insn "altivec_vmsumuhm"
14578 [(set (match_operand:V4SI 0 "register_operand" "=v")
14579 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14580 (match_operand:V8HI 2 "register_operand" "v")
14581 (match_operand:V4SI 3 "register_operand" "v")] 67))]
14583 "vmsumuhm %0, %1, %2, %3"
14584 [(set_attr "type" "veccomplex")])
14586 (define_insn "altivec_vmsumshm"
14587 [(set (match_operand:V4SI 0 "register_operand" "=v")
14588 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14589 (match_operand:V8HI 2 "register_operand" "v")
14590 (match_operand:V4SI 3 "register_operand" "v")] 68))]
14592 "vmsumshm %0, %1, %2, %3"
14593 [(set_attr "type" "veccomplex")])
14595 (define_insn "altivec_vmsumuhs"
14596 [(set (match_operand:V4SI 0 "register_operand" "=v")
14597 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14598 (match_operand:V8HI 2 "register_operand" "v")
14599 (match_operand:V4SI 3 "register_operand" "v")] 69))
14600 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14602 "vmsumuhs %0, %1, %2, %3"
14603 [(set_attr "type" "veccomplex")])
14605 (define_insn "altivec_vmsumshs"
14606 [(set (match_operand:V4SI 0 "register_operand" "=v")
14607 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14608 (match_operand:V8HI 2 "register_operand" "v")
14609 (match_operand:V4SI 3 "register_operand" "v")] 70))
14610 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14612 "vmsumshs %0, %1, %2, %3"
14613 [(set_attr "type" "veccomplex")])
14615 (define_insn "umaxv16qi3"
14616 [(set (match_operand:V16QI 0 "register_operand" "=v")
14617 (umax:V16QI (match_operand:V16QI 1 "register_operand" "v")
14618 (match_operand:V16QI 2 "register_operand" "v")))]
14621 [(set_attr "type" "vecsimple")])
14623 (define_insn "smaxv16qi3"
14624 [(set (match_operand:V16QI 0 "register_operand" "=v")
14625 (smax:V16QI (match_operand:V16QI 1 "register_operand" "v")
14626 (match_operand:V16QI 2 "register_operand" "v")))]
14629 [(set_attr "type" "vecsimple")])
14631 (define_insn "umaxv8hi3"
14632 [(set (match_operand:V8HI 0 "register_operand" "=v")
14633 (umax:V8HI (match_operand:V8HI 1 "register_operand" "v")
14634 (match_operand:V8HI 2 "register_operand" "v")))]
14637 [(set_attr "type" "vecsimple")])
14639 (define_insn "smaxv8hi3"
14640 [(set (match_operand:V8HI 0 "register_operand" "=v")
14641 (smax:V8HI (match_operand:V8HI 1 "register_operand" "v")
14642 (match_operand:V8HI 2 "register_operand" "v")))]
14645 [(set_attr "type" "vecsimple")])
14647 (define_insn "umaxv4si3"
14648 [(set (match_operand:V4SI 0 "register_operand" "=v")
14649 (umax:V4SI (match_operand:V4SI 1 "register_operand" "v")
14650 (match_operand:V4SI 2 "register_operand" "v")))]
14653 [(set_attr "type" "vecsimple")])
14655 (define_insn "smaxv4si3"
14656 [(set (match_operand:V4SI 0 "register_operand" "=v")
14657 (smax:V4SI (match_operand:V4SI 1 "register_operand" "v")
14658 (match_operand:V4SI 2 "register_operand" "v")))]
14661 [(set_attr "type" "vecsimple")])
14663 (define_insn "smaxv4sf3"
14664 [(set (match_operand:V4SF 0 "register_operand" "=v")
14665 (smax:V4SF (match_operand:V4SF 1 "register_operand" "v")
14666 (match_operand:V4SF 2 "register_operand" "v")))]
14669 [(set_attr "type" "veccmp")])
14671 (define_insn "altivec_vmhaddshs"
14672 [(set (match_operand:V8HI 0 "register_operand" "=v")
14673 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14674 (match_operand:V8HI 2 "register_operand" "v")
14675 (match_operand:V8HI 3 "register_operand" "v")] 71))
14676 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14678 "vmhaddshs %0, %1, %2, %3"
14679 [(set_attr "type" "veccomplex")])
14680 (define_insn "altivec_vmhraddshs"
14681 [(set (match_operand:V8HI 0 "register_operand" "=v")
14682 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14683 (match_operand:V8HI 2 "register_operand" "v")
14684 (match_operand:V8HI 3 "register_operand" "v")] 72))
14685 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14687 "vmhraddshs %0, %1, %2, %3"
14688 [(set_attr "type" "veccomplex")])
14689 (define_insn "altivec_vmladduhm"
14690 [(set (match_operand:V8HI 0 "register_operand" "=v")
14691 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14692 (match_operand:V8HI 2 "register_operand" "v")
14693 (match_operand:V8HI 3 "register_operand" "v")] 73))]
14695 "vmladduhm %0, %1, %2, %3"
14696 [(set_attr "type" "veccomplex")])
14698 (define_insn "altivec_vmrghb"
14699 [(set (match_operand:V16QI 0 "register_operand" "=v")
14700 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
14701 (parallel [(const_int 8)
14717 (match_operand:V16QI 2 "register_operand" "v")
14721 [(set_attr "type" "vecperm")])
14723 (define_insn "altivec_vmrghh"
14724 [(set (match_operand:V8HI 0 "register_operand" "=v")
14725 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
14726 (parallel [(const_int 4)
14734 (match_operand:V8HI 2 "register_operand" "v")
14738 [(set_attr "type" "vecperm")])
14740 (define_insn "altivec_vmrghw"
14741 [(set (match_operand:V4SI 0 "register_operand" "=v")
14742 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
14743 (parallel [(const_int 2)
14747 (match_operand:V4SI 2 "register_operand" "v")
14751 [(set_attr "type" "vecperm")])
14753 (define_insn "altivec_vmrglb"
14754 [(set (match_operand:V16QI 0 "register_operand" "=v")
14755 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
14757 (parallel [(const_int 0)
14773 (match_operand:V16QI 1 "register_operand" "v")
14777 [(set_attr "type" "vecperm")])
14779 (define_insn "altivec_vmrglh"
14780 [(set (match_operand:V8HI 0 "register_operand" "=v")
14781 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
14782 (parallel [(const_int 0)
14790 (match_operand:V8HI 1 "register_operand" "v")
14794 [(set_attr "type" "vecperm")])
14796 (define_insn "altivec_vmrglw"
14797 [(set (match_operand:V4SI 0 "register_operand" "=v")
14798 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
14799 (parallel [(const_int 0)
14803 (match_operand:V4SI 1 "register_operand" "v")
14807 [(set_attr "type" "vecperm")])
14809 (define_insn "uminv16qi3"
14810 [(set (match_operand:V16QI 0 "register_operand" "=v")
14811 (umin:V16QI (match_operand:V16QI 1 "register_operand" "v")
14812 (match_operand:V16QI 2 "register_operand" "v")))]
14815 [(set_attr "type" "vecsimple")])
14817 (define_insn "sminv16qi3"
14818 [(set (match_operand:V16QI 0 "register_operand" "=v")
14819 (smin:V16QI (match_operand:V16QI 1 "register_operand" "v")
14820 (match_operand:V16QI 2 "register_operand" "v")))]
14823 [(set_attr "type" "vecsimple")])
14825 (define_insn "uminv8hi3"
14826 [(set (match_operand:V8HI 0 "register_operand" "=v")
14827 (umin:V8HI (match_operand:V8HI 1 "register_operand" "v")
14828 (match_operand:V8HI 2 "register_operand" "v")))]
14831 [(set_attr "type" "vecsimple")])
14833 (define_insn "sminv8hi3"
14834 [(set (match_operand:V8HI 0 "register_operand" "=v")
14835 (smin:V8HI (match_operand:V8HI 1 "register_operand" "v")
14836 (match_operand:V8HI 2 "register_operand" "v")))]
14839 [(set_attr "type" "vecsimple")])
14841 (define_insn "uminv4si3"
14842 [(set (match_operand:V4SI 0 "register_operand" "=v")
14843 (umin:V4SI (match_operand:V4SI 1 "register_operand" "v")
14844 (match_operand:V4SI 2 "register_operand" "v")))]
14847 [(set_attr "type" "vecsimple")])
14849 (define_insn "sminv4si3"
14850 [(set (match_operand:V4SI 0 "register_operand" "=v")
14851 (smin:V4SI (match_operand:V4SI 1 "register_operand" "v")
14852 (match_operand:V4SI 2 "register_operand" "v")))]
14855 [(set_attr "type" "vecsimple")])
14857 (define_insn "sminv4sf3"
14858 [(set (match_operand:V4SF 0 "register_operand" "=v")
14859 (smin:V4SF (match_operand:V4SF 1 "register_operand" "v")
14860 (match_operand:V4SF 2 "register_operand" "v")))]
14863 [(set_attr "type" "veccmp")])
14865 (define_insn "altivec_vmuleub"
14866 [(set (match_operand:V8HI 0 "register_operand" "=v")
14867 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14868 (match_operand:V16QI 2 "register_operand" "v")] 83))]
14871 [(set_attr "type" "veccomplex")])
14873 (define_insn "altivec_vmulesb"
14874 [(set (match_operand:V8HI 0 "register_operand" "=v")
14875 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14876 (match_operand:V16QI 2 "register_operand" "v")] 84))]
14879 [(set_attr "type" "veccomplex")])
14881 (define_insn "altivec_vmuleuh"
14882 [(set (match_operand:V4SI 0 "register_operand" "=v")
14883 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14884 (match_operand:V8HI 2 "register_operand" "v")] 85))]
14887 [(set_attr "type" "veccomplex")])
14889 (define_insn "altivec_vmulesh"
14890 [(set (match_operand:V4SI 0 "register_operand" "=v")
14891 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14892 (match_operand:V8HI 2 "register_operand" "v")] 86))]
14895 [(set_attr "type" "veccomplex")])
14897 (define_insn "altivec_vmuloub"
14898 [(set (match_operand:V8HI 0 "register_operand" "=v")
14899 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14900 (match_operand:V16QI 2 "register_operand" "v")] 87))]
14903 [(set_attr "type" "veccomplex")])
14905 (define_insn "altivec_vmulosb"
14906 [(set (match_operand:V8HI 0 "register_operand" "=v")
14907 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14908 (match_operand:V16QI 2 "register_operand" "v")] 88))]
14911 [(set_attr "type" "veccomplex")])
14913 (define_insn "altivec_vmulouh"
14914 [(set (match_operand:V4SI 0 "register_operand" "=v")
14915 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14916 (match_operand:V8HI 2 "register_operand" "v")] 89))]
14919 [(set_attr "type" "veccomplex")])
14921 (define_insn "altivec_vmulosh"
14922 [(set (match_operand:V4SI 0 "register_operand" "=v")
14923 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14924 (match_operand:V8HI 2 "register_operand" "v")] 90))]
14927 [(set_attr "type" "veccomplex")])
14929 (define_insn "altivec_vnor"
14930 [(set (match_operand:V4SI 0 "register_operand" "=v")
14931 (not:V4SI (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
14932 (match_operand:V4SI 2 "register_operand" "v"))))]
14935 [(set_attr "type" "vecsimple")])
14937 (define_insn "iorv4si3"
14938 [(set (match_operand:V4SI 0 "register_operand" "=v")
14939 (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
14940 (match_operand:V4SI 2 "register_operand" "v")))]
14943 [(set_attr "type" "vecsimple")])
14945 (define_insn "altivec_vpkuhum"
14946 [(set (match_operand:V16QI 0 "register_operand" "=v")
14947 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14948 (match_operand:V8HI 2 "register_operand" "v")] 93))]
14951 [(set_attr "type" "vecperm")])
14953 (define_insn "altivec_vpkuwum"
14954 [(set (match_operand:V8HI 0 "register_operand" "=v")
14955 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14956 (match_operand:V4SI 2 "register_operand" "v")] 94))]
14959 [(set_attr "type" "vecperm")])
14961 (define_insn "altivec_vpkpx"
14962 [(set (match_operand:V8HI 0 "register_operand" "=v")
14963 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14964 (match_operand:V4SI 2 "register_operand" "v")] 95))]
14967 [(set_attr "type" "vecperm")])
14969 (define_insn "altivec_vpkuhss"
14970 [(set (match_operand:V16QI 0 "register_operand" "=v")
14971 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14972 (match_operand:V8HI 2 "register_operand" "v")] 96))
14973 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14976 [(set_attr "type" "vecperm")])
14978 (define_insn "altivec_vpkshss"
14979 [(set (match_operand:V16QI 0 "register_operand" "=v")
14980 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14981 (match_operand:V8HI 2 "register_operand" "v")] 97))
14982 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14985 [(set_attr "type" "vecperm")])
14987 (define_insn "altivec_vpkuwss"
14988 [(set (match_operand:V8HI 0 "register_operand" "=v")
14989 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14990 (match_operand:V4SI 2 "register_operand" "v")] 98))
14991 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
14994 [(set_attr "type" "vecperm")])
14996 (define_insn "altivec_vpkswss"
14997 [(set (match_operand:V8HI 0 "register_operand" "=v")
14998 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14999 (match_operand:V4SI 2 "register_operand" "v")] 99))
15000 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15003 [(set_attr "type" "vecperm")])
15005 (define_insn "altivec_vpkuhus"
15006 [(set (match_operand:V16QI 0 "register_operand" "=v")
15007 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
15008 (match_operand:V8HI 2 "register_operand" "v")] 100))
15009 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15012 [(set_attr "type" "vecperm")])
15014 (define_insn "altivec_vpkshus"
15015 [(set (match_operand:V16QI 0 "register_operand" "=v")
15016 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
15017 (match_operand:V8HI 2 "register_operand" "v")] 101))
15018 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15021 [(set_attr "type" "vecperm")])
15023 (define_insn "altivec_vpkuwus"
15024 [(set (match_operand:V8HI 0 "register_operand" "=v")
15025 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
15026 (match_operand:V4SI 2 "register_operand" "v")] 102))
15027 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15030 [(set_attr "type" "vecperm")])
15032 (define_insn "altivec_vpkswus"
15033 [(set (match_operand:V8HI 0 "register_operand" "=v")
15034 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
15035 (match_operand:V4SI 2 "register_operand" "v")] 103))
15036 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15039 [(set_attr "type" "vecperm")])
15041 (define_insn "altivec_vrlb"
15042 [(set (match_operand:V16QI 0 "register_operand" "=v")
15043 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15044 (match_operand:V16QI 2 "register_operand" "v")] 104))]
15047 [(set_attr "type" "vecsimple")])
15049 (define_insn "altivec_vrlh"
15050 [(set (match_operand:V8HI 0 "register_operand" "=v")
15051 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15052 (match_operand:V8HI 2 "register_operand" "v")] 105))]
15055 [(set_attr "type" "vecsimple")])
15057 (define_insn "altivec_vrlw"
15058 [(set (match_operand:V4SI 0 "register_operand" "=v")
15059 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15060 (match_operand:V4SI 2 "register_operand" "v")] 106))]
15063 [(set_attr "type" "vecsimple")])
15065 (define_insn "altivec_vslb"
15066 [(set (match_operand:V16QI 0 "register_operand" "=v")
15067 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15068 (match_operand:V16QI 2 "register_operand" "v")] 107))]
15071 [(set_attr "type" "vecsimple")])
15073 (define_insn "altivec_vslh"
15074 [(set (match_operand:V8HI 0 "register_operand" "=v")
15075 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15076 (match_operand:V8HI 2 "register_operand" "v")] 108))]
15079 [(set_attr "type" "vecsimple")])
15081 (define_insn "altivec_vslw"
15082 [(set (match_operand:V4SI 0 "register_operand" "=v")
15083 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15084 (match_operand:V4SI 2 "register_operand" "v")] 109))]
15087 [(set_attr "type" "vecsimple")])
15089 (define_insn "altivec_vsl"
15090 [(set (match_operand:V4SI 0 "register_operand" "=v")
15091 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15092 (match_operand:V4SI 2 "register_operand" "v")] 110))]
15095 [(set_attr "type" "vecperm")])
15097 (define_insn "altivec_vslo"
15098 [(set (match_operand:V4SI 0 "register_operand" "=v")
15099 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15100 (match_operand:V4SI 2 "register_operand" "v")] 111))]
15103 [(set_attr "type" "vecperm")])
15105 (define_insn "altivec_vsrb"
15106 [(set (match_operand:V16QI 0 "register_operand" "=v")
15107 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15108 (match_operand:V16QI 2 "register_operand" "v")] 112))]
15111 [(set_attr "type" "vecsimple")])
15113 (define_insn "altivec_vsrh"
15114 [(set (match_operand:V8HI 0 "register_operand" "=v")
15115 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15116 (match_operand:V8HI 2 "register_operand" "v")] 113))]
15119 [(set_attr "type" "vecsimple")])
15121 (define_insn "altivec_vsrw"
15122 [(set (match_operand:V4SI 0 "register_operand" "=v")
15123 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15124 (match_operand:V4SI 2 "register_operand" "v")] 114))]
15127 [(set_attr "type" "vecsimple")])
15129 (define_insn "altivec_vsrab"
15130 [(set (match_operand:V16QI 0 "register_operand" "=v")
15131 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15132 (match_operand:V16QI 2 "register_operand" "v")] 115))]
15135 [(set_attr "type" "vecsimple")])
15137 (define_insn "altivec_vsrah"
15138 [(set (match_operand:V8HI 0 "register_operand" "=v")
15139 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15140 (match_operand:V8HI 2 "register_operand" "v")] 116))]
15143 [(set_attr "type" "vecsimple")])
15145 (define_insn "altivec_vsraw"
15146 [(set (match_operand:V4SI 0 "register_operand" "=v")
15147 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15148 (match_operand:V4SI 2 "register_operand" "v")] 117))]
15151 [(set_attr "type" "vecsimple")])
15153 (define_insn "altivec_vsr"
15154 [(set (match_operand:V4SI 0 "register_operand" "=v")
15155 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15156 (match_operand:V4SI 2 "register_operand" "v")] 118))]
15159 [(set_attr "type" "vecperm")])
15161 (define_insn "altivec_vsro"
15162 [(set (match_operand:V4SI 0 "register_operand" "=v")
15163 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15164 (match_operand:V4SI 2 "register_operand" "v")] 119))]
15167 [(set_attr "type" "vecperm")])
15169 (define_insn "subv16qi3"
15170 [(set (match_operand:V16QI 0 "register_operand" "=v")
15171 (minus:V16QI (match_operand:V16QI 1 "register_operand" "v")
15172 (match_operand:V16QI 2 "register_operand" "v")))]
15175 [(set_attr "type" "vecsimple")])
15177 (define_insn "subv8hi3"
15178 [(set (match_operand:V8HI 0 "register_operand" "=v")
15179 (minus:V8HI (match_operand:V8HI 1 "register_operand" "v")
15180 (match_operand:V8HI 2 "register_operand" "v")))]
15183 [(set_attr "type" "vecsimple")])
15185 (define_insn "subv4si3"
15186 [(set (match_operand:V4SI 0 "register_operand" "=v")
15187 (minus:V4SI (match_operand:V4SI 1 "register_operand" "v")
15188 (match_operand:V4SI 2 "register_operand" "v")))]
15191 [(set_attr "type" "vecsimple")])
15193 (define_insn "subv4sf3"
15194 [(set (match_operand:V4SF 0 "register_operand" "=v")
15195 (minus:V4SF (match_operand:V4SF 1 "register_operand" "v")
15196 (match_operand:V4SF 2 "register_operand" "v")))]
15199 [(set_attr "type" "vecfloat")])
15201 (define_insn "altivec_vsubcuw"
15202 [(set (match_operand:V4SI 0 "register_operand" "=v")
15203 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15204 (match_operand:V4SI 2 "register_operand" "v")] 124))]
15207 [(set_attr "type" "vecsimple")])
15209 (define_insn "altivec_vsububs"
15210 [(set (match_operand:V16QI 0 "register_operand" "=v")
15211 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15212 (match_operand:V16QI 2 "register_operand" "v")] 125))
15213 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15216 [(set_attr "type" "vecsimple")])
15218 (define_insn "altivec_vsubsbs"
15219 [(set (match_operand:V16QI 0 "register_operand" "=v")
15220 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15221 (match_operand:V16QI 2 "register_operand" "v")] 126))
15222 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15225 [(set_attr "type" "vecsimple")])
15227 (define_insn "altivec_vsubuhs"
15228 [(set (match_operand:V8HI 0 "register_operand" "=v")
15229 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15230 (match_operand:V8HI 2 "register_operand" "v")] 127))
15231 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15234 [(set_attr "type" "vecsimple")])
15236 (define_insn "altivec_vsubshs"
15237 [(set (match_operand:V8HI 0 "register_operand" "=v")
15238 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15239 (match_operand:V8HI 2 "register_operand" "v")] 128))
15240 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15243 [(set_attr "type" "vecsimple")])
15245 (define_insn "altivec_vsubuws"
15246 [(set (match_operand:V4SI 0 "register_operand" "=v")
15247 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15248 (match_operand:V4SI 2 "register_operand" "v")] 129))
15249 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15252 [(set_attr "type" "vecsimple")])
15254 (define_insn "altivec_vsubsws"
15255 [(set (match_operand:V4SI 0 "register_operand" "=v")
15256 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15257 (match_operand:V4SI 2 "register_operand" "v")] 130))
15258 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15261 [(set_attr "type" "vecsimple")])
15263 (define_insn "altivec_vsum4ubs"
15264 [(set (match_operand:V4SI 0 "register_operand" "=v")
15265 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
15266 (match_operand:V4SI 2 "register_operand" "v")] 131))
15267 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15269 "vsum4ubs %0,%1,%2"
15270 [(set_attr "type" "veccomplex")])
15272 (define_insn "altivec_vsum4sbs"
15273 [(set (match_operand:V4SI 0 "register_operand" "=v")
15274 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
15275 (match_operand:V4SI 2 "register_operand" "v")] 132))
15276 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15278 "vsum4sbs %0,%1,%2"
15279 [(set_attr "type" "veccomplex")])
15281 (define_insn "altivec_vsum4shs"
15282 [(set (match_operand:V4SI 0 "register_operand" "=v")
15283 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
15284 (match_operand:V4SI 2 "register_operand" "v")] 133))
15285 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15287 "vsum4shs %0,%1,%2"
15288 [(set_attr "type" "veccomplex")])
15290 (define_insn "altivec_vsum2sws"
15291 [(set (match_operand:V4SI 0 "register_operand" "=v")
15292 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15293 (match_operand:V4SI 2 "register_operand" "v")] 134))
15294 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15296 "vsum2sws %0,%1,%2"
15297 [(set_attr "type" "veccomplex")])
15299 (define_insn "altivec_vsumsws"
15300 [(set (match_operand:V4SI 0 "register_operand" "=v")
15301 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15302 (match_operand:V4SI 2 "register_operand" "v")] 135))
15303 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15306 [(set_attr "type" "veccomplex")])
15308 (define_insn "xorv4si3"
15309 [(set (match_operand:V4SI 0 "register_operand" "=v")
15310 (xor:V4SI (match_operand:V4SI 1 "register_operand" "v")
15311 (match_operand:V4SI 2 "register_operand" "v")))]
15314 [(set_attr "type" "vecsimple")])
15316 (define_insn "altivec_vspltb"
15317 [(set (match_operand:V16QI 0 "register_operand" "=v")
15318 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15319 (match_operand:QI 2 "immediate_operand" "i")] 136))]
15322 [(set_attr "type" "vecperm")])
15324 (define_insn "altivec_vsplth"
15325 [(set (match_operand:V8HI 0 "register_operand" "=v")
15326 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15327 (match_operand:QI 2 "immediate_operand" "i")] 137))]
15330 [(set_attr "type" "vecperm")])
15332 (define_insn "altivec_vspltw"
15333 [(set (match_operand:V4SI 0 "register_operand" "=v")
15334 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15335 (match_operand:QI 2 "immediate_operand" "i")] 138))]
15338 [(set_attr "type" "vecperm")])
15340 (define_insn "altivec_vspltisb"
15341 [(set (match_operand:V16QI 0 "register_operand" "=v")
15342 (unspec:V16QI [(match_operand:QI 1 "immediate_operand" "i")] 139))]
15345 [(set_attr "type" "vecsimple")])
15348 (define_insn "altivec_vspltish"
15349 [(set (match_operand:V8HI 0 "register_operand" "=v")
15350 (unspec:V8HI [(match_operand:QI 1 "immediate_operand" "i")] 140))]
15353 [(set_attr "type" "vecsimple")])
15355 (define_insn "altivec_vspltisw"
15356 [(set (match_operand:V4SI 0 "register_operand" "=v")
15357 (unspec:V4SI [(match_operand:QI 1 "immediate_operand" "i")] 141))]
15360 [(set_attr "type" "vecsimple")])
15363 [(set (match_operand:V4SF 0 "register_operand" "=v")
15364 (unspec:V4SF [(match_operand:QI 1 "immediate_operand" "i")] 142))]
15367 [(set_attr "type" "vecsimple")])
15369 (define_insn "ftruncv4sf2"
15370 [(set (match_operand:V4SF 0 "register_operand" "=v")
15371 (fix:V4SF (match_operand:V4SF 1 "register_operand" "v")))]
15374 [(set_attr "type" "vecfloat")])
15376 (define_insn "altivec_vperm_4si"
15377 [(set (match_operand:V4SI 0 "register_operand" "=v")
15378 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15379 (match_operand:V4SI 2 "register_operand" "v")
15380 (match_operand:V16QI 3 "register_operand" "v")] 144))]
15382 "vperm %0,%1,%2,%3"
15383 [(set_attr "type" "vecperm")])
15385 (define_insn "altivec_vperm_4sf"
15386 [(set (match_operand:V4SF 0 "register_operand" "=v")
15387 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15388 (match_operand:V4SF 2 "register_operand" "v")
15389 (match_operand:V16QI 3 "register_operand" "v")] 145))]
15391 "vperm %0,%1,%2,%3"
15392 [(set_attr "type" "vecperm")])
15394 (define_insn "altivec_vperm_8hi"
15395 [(set (match_operand:V8HI 0 "register_operand" "=v")
15396 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15397 (match_operand:V8HI 2 "register_operand" "v")
15398 (match_operand:V16QI 3 "register_operand" "v")] 146))]
15400 "vperm %0,%1,%2,%3"
15401 [(set_attr "type" "vecperm")])
15403 (define_insn "altivec_vperm_16qi"
15404 [(set (match_operand:V16QI 0 "register_operand" "=v")
15405 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15406 (match_operand:V16QI 2 "register_operand" "v")
15407 (match_operand:V16QI 3 "register_operand" "v")] 147))]
15409 "vperm %0,%1,%2,%3"
15410 [(set_attr "type" "vecperm")])
15412 (define_insn "altivec_vrfip"
15413 [(set (match_operand:V4SF 0 "register_operand" "=v")
15414 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 148))]
15417 [(set_attr "type" "vecfloat")])
15419 (define_insn "altivec_vrfin"
15420 [(set (match_operand:V4SF 0 "register_operand" "=v")
15421 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 149))]
15424 [(set_attr "type" "vecfloat")])
15426 (define_insn "altivec_vrfim"
15427 [(set (match_operand:V4SF 0 "register_operand" "=v")
15428 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 150))]
15431 [(set_attr "type" "vecfloat")])
15433 (define_insn "altivec_vcfux"
15434 [(set (match_operand:V4SF 0 "register_operand" "=v")
15435 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
15436 (match_operand:QI 2 "immediate_operand" "i")] 151))]
15439 [(set_attr "type" "vecfloat")])
15441 (define_insn "altivec_vcfsx"
15442 [(set (match_operand:V4SF 0 "register_operand" "=v")
15443 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
15444 (match_operand:QI 2 "immediate_operand" "i")] 152))]
15447 [(set_attr "type" "vecfloat")])
15449 (define_insn "altivec_vctuxs"
15450 [(set (match_operand:V4SI 0 "register_operand" "=v")
15451 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
15452 (match_operand:QI 2 "immediate_operand" "i")] 153))
15453 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15455 "vctuxs %0, %1, %2"
15456 [(set_attr "type" "vecfloat")])
15458 (define_insn "altivec_vctsxs"
15459 [(set (match_operand:V4SI 0 "register_operand" "=v")
15460 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
15461 (match_operand:QI 2 "immediate_operand" "i")] 154))
15462 (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))]
15464 "vctsxs %0, %1, %2"
15465 [(set_attr "type" "vecfloat")])
15467 (define_insn "altivec_vlogefp"
15468 [(set (match_operand:V4SF 0 "register_operand" "=v")
15469 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 155))]
15472 [(set_attr "type" "vecfloat")])
15474 (define_insn "altivec_vexptefp"
15475 [(set (match_operand:V4SF 0 "register_operand" "=v")
15476 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 156))]
15479 [(set_attr "type" "vecfloat")])
15481 (define_insn "altivec_vrsqrtefp"
15482 [(set (match_operand:V4SF 0 "register_operand" "=v")
15483 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 157))]
15486 [(set_attr "type" "vecfloat")])
15488 (define_insn "altivec_vrefp"
15489 [(set (match_operand:V4SF 0 "register_operand" "=v")
15490 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 158))]
15493 [(set_attr "type" "vecfloat")])
15495 (define_insn "altivec_vsel_4si"
15496 [(set (match_operand:V4SI 0 "register_operand" "=v")
15497 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15498 (match_operand:V4SI 2 "register_operand" "v")
15499 (match_operand:V4SI 3 "register_operand" "v")] 159))]
15502 [(set_attr "type" "vecperm")])
15504 (define_insn "altivec_vsel_4sf"
15505 [(set (match_operand:V4SF 0 "register_operand" "=v")
15506 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15507 (match_operand:V4SF 2 "register_operand" "v")
15508 (match_operand:V4SI 3 "register_operand" "v")] 160))]
15511 [(set_attr "type" "vecperm")])
15513 (define_insn "altivec_vsel_8hi"
15514 [(set (match_operand:V8HI 0 "register_operand" "=v")
15515 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15516 (match_operand:V8HI 2 "register_operand" "v")
15517 (match_operand:V8HI 3 "register_operand" "v")] 161))]
15520 [(set_attr "type" "vecperm")])
15522 (define_insn "altivec_vsel_16qi"
15523 [(set (match_operand:V16QI 0 "register_operand" "=v")
15524 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15525 (match_operand:V16QI 2 "register_operand" "v")
15526 (match_operand:V16QI 3 "register_operand" "v")] 162))]
15529 [(set_attr "type" "vecperm")])
15531 (define_insn "altivec_vsldoi_4si"
15532 [(set (match_operand:V4SI 0 "register_operand" "=v")
15533 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15534 (match_operand:V4SI 2 "register_operand" "v")
15535 (match_operand:QI 3 "immediate_operand" "i")] 163))]
15537 "vsldoi %0, %1, %2, %3"
15538 [(set_attr "type" "vecperm")])
15540 (define_insn "altivec_vsldoi_4sf"
15541 [(set (match_operand:V4SF 0 "register_operand" "=v")
15542 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15543 (match_operand:V4SF 2 "register_operand" "v")
15544 (match_operand:QI 3 "immediate_operand" "i")] 164))]
15546 "vsldoi %0, %1, %2, %3"
15547 [(set_attr "type" "vecperm")])
15549 (define_insn "altivec_vsldoi_8hi"
15550 [(set (match_operand:V8HI 0 "register_operand" "=v")
15551 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15552 (match_operand:V8HI 2 "register_operand" "v")
15553 (match_operand:QI 3 "immediate_operand" "i")] 165))]
15555 "vsldoi %0, %1, %2, %3"
15556 [(set_attr "type" "vecperm")])
15558 (define_insn "altivec_vsldoi_16qi"
15559 [(set (match_operand:V16QI 0 "register_operand" "=v")
15560 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15561 (match_operand:V16QI 2 "register_operand" "v")
15562 (match_operand:QI 3 "immediate_operand" "i")] 166))]
15564 "vsldoi %0, %1, %2, %3"
15565 [(set_attr "type" "vecperm")])
15567 (define_insn "altivec_vupkhsb"
15568 [(set (match_operand:V8HI 0 "register_operand" "=v")
15569 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 167))]
15572 [(set_attr "type" "vecperm")])
15574 (define_insn "altivec_vupkhpx"
15575 [(set (match_operand:V4SI 0 "register_operand" "=v")
15576 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 168))]
15579 [(set_attr "type" "vecperm")])
15581 (define_insn "altivec_vupkhsh"
15582 [(set (match_operand:V4SI 0 "register_operand" "=v")
15583 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 169))]
15586 [(set_attr "type" "vecperm")])
15588 (define_insn "altivec_vupklsb"
15589 [(set (match_operand:V8HI 0 "register_operand" "=v")
15590 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 170))]
15593 [(set_attr "type" "vecperm")])
15595 (define_insn "altivec_vupklpx"
15596 [(set (match_operand:V4SI 0 "register_operand" "=v")
15597 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 171))]
15600 [(set_attr "type" "vecperm")])
15602 (define_insn "altivec_vupklsh"
15603 [(set (match_operand:V4SI 0 "register_operand" "=v")
15604 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 172))]
15607 [(set_attr "type" "vecperm")])
15609 ;; AltiVec predicates.
15611 (define_expand "cr6_test_for_zero"
15612 [(set (match_operand:SI 0 "register_operand" "=r")
15618 (define_expand "cr6_test_for_zero_reverse"
15619 [(set (match_operand:SI 0 "register_operand" "=r")
15622 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
15626 (define_expand "cr6_test_for_lt"
15627 [(set (match_operand:SI 0 "register_operand" "=r")
15633 (define_expand "cr6_test_for_lt_reverse"
15634 [(set (match_operand:SI 0 "register_operand" "=r")
15637 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
15641 ;; We can get away with generating the opcode on the fly (%3 below)
15642 ;; because all the predicates have the same scheduling parameters.
15644 (define_insn "altivec_predicate_v4si"
15646 (unspec:CC [(match_operand:V4SI 1 "register_operand" "v")
15647 (match_operand:V4SI 2 "register_operand" "v")
15648 (match_operand 3 "any_operand" "")] 173))
15649 (clobber (match_scratch:V4SI 0 "=v"))]
15652 [(set_attr "type" "veccmp")])
15654 (define_insn "altivec_predicate_v4sf"
15656 (unspec:CC [(match_operand:V4SF 1 "register_operand" "v")
15657 (match_operand:V4SF 2 "register_operand" "v")
15658 (match_operand 3 "any_operand" "")] 174))
15659 (clobber (match_scratch:V4SF 0 "=v"))]
15662 [(set_attr "type" "veccmp")])
15664 (define_insn "altivec_predicate_v8hi"
15666 (unspec:CC [(match_operand:V8HI 1 "register_operand" "v")
15667 (match_operand:V8HI 2 "register_operand" "v")
15668 (match_operand 3 "any_operand" "")] 175))
15669 (clobber (match_scratch:V8HI 0 "=v"))]
15672 [(set_attr "type" "veccmp")])
15674 (define_insn "altivec_predicate_v16qi"
15676 (unspec:CC [(match_operand:V16QI 1 "register_operand" "v")
15677 (match_operand:V16QI 2 "register_operand" "v")
15678 (match_operand 3 "any_operand" "")] 175))
15679 (clobber (match_scratch:V16QI 0 "=v"))]
15682 [(set_attr "type" "veccmp")])
15684 (define_insn "altivec_mtvscr"
15686 (unspec_volatile:SI
15687 [(match_operand:V4SI 0 "register_operand" "v")] 186))]
15690 [(set_attr "type" "vecsimple")])
15692 (define_insn "altivec_mfvscr"
15693 [(set (match_operand:V8HI 0 "register_operand" "=v")
15694 (unspec_volatile:V8HI [(reg:SI 110)] 187))]
15697 [(set_attr "type" "vecsimple")])
15699 (define_insn "altivec_dssall"
15700 [(unspec [(const_int 0)] 188)]
15703 [(set_attr "type" "vecsimple")])
15705 (define_insn "altivec_dss"
15706 [(unspec [(match_operand:QI 0 "immediate_operand" "i")] 189)]
15709 [(set_attr "type" "vecsimple")])
15711 (define_insn "altivec_dst"
15712 [(unspec [(match_operand:SI 0 "register_operand" "b")
15713 (match_operand:SI 1 "register_operand" "r")
15714 (match_operand:QI 2 "immediate_operand" "i")] 190)]
15717 [(set_attr "type" "vecsimple")])
15719 (define_insn "altivec_dstt"
15720 [(unspec [(match_operand:SI 0 "register_operand" "b")
15721 (match_operand:SI 1 "register_operand" "r")
15722 (match_operand:QI 2 "immediate_operand" "i")] 191)]
15725 [(set_attr "type" "vecsimple")])
15727 (define_insn "altivec_dstst"
15728 [(unspec [(match_operand:SI 0 "register_operand" "b")
15729 (match_operand:SI 1 "register_operand" "r")
15730 (match_operand:QI 2 "immediate_operand" "i")] 192)]
15733 [(set_attr "type" "vecsimple")])
15735 (define_insn "altivec_dststt"
15736 [(unspec [(match_operand:SI 0 "register_operand" "b")
15737 (match_operand:SI 1 "register_operand" "r")
15738 (match_operand:QI 2 "immediate_operand" "i")] 193)]
15741 [(set_attr "type" "vecsimple")])
15743 (define_insn "altivec_lvsl"
15744 [(set (match_operand:V16QI 0 "register_operand" "=v")
15745 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
15746 (match_operand:SI 2 "register_operand" "r")] 194))]
15749 [(set_attr "type" "vecload")])
15751 (define_insn "altivec_lvsr"
15752 [(set (match_operand:V16QI 0 "register_operand" "=v")
15753 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
15754 (match_operand:SI 2 "register_operand" "r")] 195))]
15757 [(set_attr "type" "vecload")])
15759 ;; Parallel some of the LVE* and STV*'s with unspecs because some have
15760 ;; identical rtl but different instructions-- and gcc gets confused.
15762 (define_insn "altivec_lvebx"
15764 [(set (match_operand:V16QI 0 "register_operand" "=v")
15765 (mem:V16QI (plus:SI (match_operand:SI 1 "register_operand" "b")
15766 (match_operand:SI 2 "register_operand" "r"))))
15767 (unspec [(const_int 0)] 196)])]
15770 [(set_attr "type" "vecload")])
15772 (define_insn "altivec_lvehx"
15774 [(set (match_operand:V8HI 0 "register_operand" "=v")
15776 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15777 (match_operand:SI 2 "register_operand" "r"))
15779 (unspec [(const_int 0)] 197)])]
15782 [(set_attr "type" "vecload")])
15784 (define_insn "altivec_lvewx"
15786 [(set (match_operand:V4SI 0 "register_operand" "=v")
15788 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15789 (match_operand:SI 2 "register_operand" "r"))
15791 (unspec [(const_int 0)] 198)])]
15794 [(set_attr "type" "vecload")])
15796 (define_insn "altivec_lvxl"
15798 [(set (match_operand:V4SI 0 "register_operand" "=v")
15799 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15800 (match_operand:SI 2 "register_operand" "r"))))
15801 (unspec [(const_int 0)] 213)])]
15804 [(set_attr "type" "vecload")])
15806 (define_insn "altivec_lvx"
15807 [(set (match_operand:V4SI 0 "register_operand" "=v")
15808 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15809 (match_operand:SI 2 "register_operand" "r"))))]
15812 [(set_attr "type" "vecload")])
15814 (define_insn "altivec_stvx"
15817 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15818 (match_operand:SI 1 "register_operand" "r"))
15820 (match_operand:V4SI 2 "register_operand" "v"))
15821 (unspec [(const_int 0)] 201)])]
15824 [(set_attr "type" "vecstore")])
15826 (define_insn "altivec_stvxl"
15829 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15830 (match_operand:SI 1 "register_operand" "r"))
15832 (match_operand:V4SI 2 "register_operand" "v"))
15833 (unspec [(const_int 0)] 202)])]
15836 [(set_attr "type" "vecstore")])
15838 (define_insn "altivec_stvebx"
15841 (plus:SI (match_operand:SI 0 "register_operand" "b")
15842 (match_operand:SI 1 "register_operand" "r")))
15843 (match_operand:V16QI 2 "register_operand" "v"))
15844 (unspec [(const_int 0)] 203)])]
15847 [(set_attr "type" "vecstore")])
15849 (define_insn "altivec_stvehx"
15852 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15853 (match_operand:SI 1 "register_operand" "r"))
15855 (match_operand:V8HI 2 "register_operand" "v"))
15856 (unspec [(const_int 0)] 204)])]
15859 [(set_attr "type" "vecstore")])
15861 (define_insn "altivec_stvewx"
15864 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15865 (match_operand:SI 1 "register_operand" "r"))
15867 (match_operand:V4SI 2 "register_operand" "v"))
15868 (unspec [(const_int 0)] 205)])]
15871 [(set_attr "type" "vecstore")])
15873 (define_insn "absv16qi2"
15874 [(set (match_operand:V16QI 0 "register_operand" "=v")
15875 (abs:V16QI (match_operand:V16QI 1 "register_operand" "v")))
15876 (clobber (match_scratch:V16QI 2 "=v"))
15877 (clobber (match_scratch:V16QI 3 "=v"))]
15879 "vspltisb %2,0\;vsububm %3,%2,%1\;vmaxsb %0,%1,%3"
15880 [(set_attr "type" "altivec")
15881 (set_attr "length" "12")])
15883 (define_insn "absv8hi2"
15884 [(set (match_operand:V8HI 0 "register_operand" "=v")
15885 (abs:V8HI (match_operand:V8HI 1 "register_operand" "v")))
15886 (clobber (match_scratch:V8HI 2 "=v"))
15887 (clobber (match_scratch:V8HI 3 "=v"))]
15889 "vspltisb %2,0\;vsubuhm %3,%2,%1\;vmaxsh %0,%1,%3"
15890 [(set_attr "type" "altivec")
15891 (set_attr "length" "12")])
15893 (define_insn "absv4si2"
15894 [(set (match_operand:V4SI 0 "register_operand" "=v")
15895 (abs:V4SI (match_operand:V4SI 1 "register_operand" "v")))
15896 (clobber (match_scratch:V4SI 2 "=v"))
15897 (clobber (match_scratch:V4SI 3 "=v"))]
15899 "vspltisb %2,0\;vsubuwm %3,%2,%1\;vmaxsw %0,%1,%3"
15900 [(set_attr "type" "altivec")
15901 (set_attr "length" "12")])
15903 (define_insn "absv4sf2"
15904 [(set (match_operand:V4SF 0 "register_operand" "=v")
15905 (abs:V4SF (match_operand:V4SF 1 "register_operand" "v")))
15906 (clobber (match_scratch:V4SF 2 "=v"))
15907 (clobber (match_scratch:V4SF 3 "=v"))]
15909 "vspltisw %2, -1\;vslw %3,%2,%2\;vandc %0,%1,%3"
15910 [(set_attr "type" "altivec")
15911 (set_attr "length" "12")])
15913 (define_insn "altivec_abss_v16qi"
15914 [(set (match_operand:V16QI 0 "register_operand" "=v")
15915 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")] 210))
15916 (clobber (match_scratch:V16QI 2 "=v"))
15917 (clobber (match_scratch:V16QI 3 "=v"))]
15919 "vspltisb %2,0\;vsubsbs %3,%2,%1\;vmaxsb %0,%1,%3"
15920 [(set_attr "type" "altivec")
15921 (set_attr "length" "12")])
15923 (define_insn "altivec_abss_v8hi"
15924 [(set (match_operand:V8HI 0 "register_operand" "=v")
15925 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")] 211))
15926 (clobber (match_scratch:V8HI 2 "=v"))
15927 (clobber (match_scratch:V8HI 3 "=v"))]
15929 "vspltisb %2,0\;vsubshs %3,%2,%1\;vmaxsh %0,%1,%3"
15930 [(set_attr "type" "altivec")
15931 (set_attr "length" "12")])
15933 (define_insn "altivec_abss_v4si"
15934 [(set (match_operand:V4SI 0 "register_operand" "=v")
15935 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")] 212))
15936 (clobber (match_scratch:V4SI 2 "=v"))
15937 (clobber (match_scratch:V4SI 3 "=v"))]
15939 "vspltisb %2,0\;vsubsws %3,%2,%1\;vmaxsw %0,%1,%3"
15940 [(set_attr "type" "altivec")
15941 (set_attr "length" "12")])