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"
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"))
378 (define_function_unit "vec_alu2" 2 0
379 (and (eq_attr "type" "vecsimple")
380 (eq_attr "cpu" "ppc7450"))
381 1 2 [(eq_attr "type" "vecsimple")])
382 (define_function_unit "vec_alu2" 2 0
383 (and (eq_attr "type" "vecsimple")
384 (eq_attr "cpu" "ppc7450"))
385 1 1 [(eq_attr "type" "!vecsimple")])
386 (define_function_unit "vec_alu2" 2 0
387 (and (eq_attr "type" "veccomplex")
388 (eq_attr "cpu" "ppc7450"))
389 4 2 [(eq_attr "type" "veccomplex")])
390 (define_function_unit "vec_alu2" 2 0
391 (and (eq_attr "type" "veccomplex")
392 (eq_attr "cpu" "ppc7450"))
393 4 1 [(eq_attr "type" "!veccomplex")])
394 (define_function_unit "vec_alu2" 2 0
395 (and (eq_attr "type" "veccmp")
396 (eq_attr "cpu" "ppc7450"))
397 2 2 [(eq_attr "type" "veccmp")])
398 (define_function_unit "vec_alu2" 2 0
399 (and (eq_attr "type" "veccmp")
400 (eq_attr "cpu" "ppc7450"))
401 2 1 [(eq_attr "type" "!veccmp")])
402 (define_function_unit "vec_alu2" 2 0
403 (and (eq_attr "type" "vecfloat")
404 (eq_attr "cpu" "ppc7450"))
405 4 2 [(eq_attr "type" "vecfloat")])
406 (define_function_unit "vec_alu2" 2 0
407 (and (eq_attr "type" "vecfloat")
408 (eq_attr "cpu" "ppc7450"))
409 4 1 [(eq_attr "type" "!vecfloat")])
410 (define_function_unit "vec_alu2" 2 0
411 (and (eq_attr "type" "vecperm")
412 (eq_attr "cpu" "ppc7450"))
413 2 2 [(eq_attr "type" "vecperm")])
414 (define_function_unit "vec_alu2" 2 0
415 (and (eq_attr "type" "vecperm")
416 (eq_attr "cpu" "ppc7450"))
417 2 1 [(eq_attr "type" "!vecperm")])
419 ; PPC750 has two integer units: a primary one which can perform all
420 ; operations and a secondary one which is fed in lock step with the first
421 ; and can perform "simple" integer operations.
422 ; To catch this we define a 'dummy' imuldiv-unit that is also needed
423 ; for the complex insns.
424 (define_function_unit "iu2" 2 0
425 (and (eq_attr "type" "integer")
426 (eq_attr "cpu" "ppc750,ppc7400"))
429 (define_function_unit "iu2" 2 0
430 (and (eq_attr "type" "imul")
431 (eq_attr "cpu" "ppc750,ppc7400"))
434 (define_function_unit "iu2" 2 0
435 (and (eq_attr "type" "imul2")
436 (eq_attr "cpu" "ppc750,ppc7400"))
439 (define_function_unit "iu2" 2 0
440 (and (eq_attr "type" "imul3")
441 (eq_attr "cpu" "ppc750,ppc7400"))
444 (define_function_unit "iu2" 2 0
445 (and (eq_attr "type" "idiv")
446 (eq_attr "cpu" "ppc750,ppc7400"))
449 (define_function_unit "imuldiv" 1 0
450 (and (eq_attr "type" "imul")
451 (eq_attr "cpu" "ppc750,ppc7400"))
454 (define_function_unit "imuldiv" 1 0
455 (and (eq_attr "type" "imul2")
456 (eq_attr "cpu" "ppc750,ppc7400"))
459 (define_function_unit "imuldiv" 1 0
460 (and (eq_attr "type" "imul3")
461 (eq_attr "cpu" "ppc750,ppc7400"))
464 (define_function_unit "imuldiv" 1 0
465 (and (eq_attr "type" "idiv")
466 (eq_attr "cpu" "ppc750,ppc7400"))
469 ; CR-logical operations are execute-serialized, that is they don't
470 ; start (and block the function unit) until all preceding operations
471 ; have finished. They don't block dispatch of other insns, though.
472 ; I've imitated this by giving them longer latency.
473 (define_function_unit "sru" 1 0
474 (and (eq_attr "type" "cr_logical")
475 (eq_attr "cpu" "ppc603,ppc750,ppc7400"))
478 ; compare is done on integer unit, but feeds insns which
479 ; execute on the branch unit.
480 (define_function_unit "iu" 1 0
481 (and (eq_attr "type" "compare")
482 (eq_attr "cpu" "rios1"))
485 (define_function_unit "iu" 1 0
486 (and (eq_attr "type" "delayed_compare")
487 (eq_attr "cpu" "rios1"))
490 (define_function_unit "iu" 1 0
491 (and (eq_attr "type" "compare,delayed_compare")
492 (eq_attr "cpu" "rs64a,mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
495 ; some extra cycles added by TARGET_SCHED_ADJUST_COST between compare
496 ; and a following branch, to reduce mispredicts
497 (define_function_unit "iu3" 3 0
498 (and (eq_attr "type" "compare,delayed_compare")
499 (eq_attr "cpu" "ppc7450"))
502 (define_function_unit "iu2" 2 0
503 (and (eq_attr "type" "compare,delayed_compare")
504 (eq_attr "cpu" "rios2"))
507 (define_function_unit "iu2" 2 0
508 (and (eq_attr "type" "compare,delayed_compare")
509 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630,ppc750,ppc7400"))
512 ; fp compare uses fp unit
513 (define_function_unit "fpu" 1 0
514 (and (eq_attr "type" "fpcompare")
515 (eq_attr "cpu" "rios1"))
518 ; rios1 and rios2 have different fpcompare delays
519 (define_function_unit "fpu2" 2 0
520 (and (eq_attr "type" "fpcompare")
521 (eq_attr "cpu" "rios2,ppc630"))
524 ; on ppc601 and ppc603, fpcompare takes also 2 cycles from
526 ; here we do not define delays, just occupy the unit. The dependencies
527 ; will be assigned by the fpcompare definition in the fpu.
528 (define_function_unit "iu" 1 0
529 (and (eq_attr "type" "fpcompare")
530 (eq_attr "cpu" "ppc601,ppc603"))
533 ; fp compare uses fp unit
534 (define_function_unit "fpu" 1 0
535 (and (eq_attr "type" "fpcompare")
536 (eq_attr "cpu" "rs64a,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
539 (define_function_unit "fpu" 1 0
540 (and (eq_attr "type" "fpcompare")
541 (eq_attr "cpu" "ppc750,ppc7400,ppc7450"))
544 (define_function_unit "fpu" 1 0
545 (and (eq_attr "type" "fpcompare")
546 (eq_attr "cpu" "mpccore"))
549 (define_function_unit "bpu" 1 0
550 (and (eq_attr "type" "mtjmpr")
551 (eq_attr "cpu" "rios1,rios2,rs64a"))
554 (define_function_unit "bpu" 1 0
555 (and (eq_attr "type" "mtjmpr")
556 (eq_attr "cpu" "mpccore,ppc403,ppc405,ppc601,ppc603,ppc604,ppc604e,ppc620,ppc630"))
559 (define_function_unit "sru" 1 0
560 (and (eq_attr "type" "mtjmpr")
561 (eq_attr "cpu" "ppc750,ppc7400"))
564 (define_function_unit "imuldiv" 1 0
565 (and (eq_attr "type" "mtjmpr")
566 (eq_attr "cpu" "ppc7450"))
569 (define_function_unit "bpu" 1 0
570 (and (eq_attr "type" "cr_logical")
571 (eq_attr "cpu" "rios1,rios2,ppc604"))
574 (define_function_unit "cru" 1 0
575 (and (eq_attr "type" "cr_logical")
576 (eq_attr "cpu" "ppc604e,ppc620,ppc630,rs64a"))
579 ; all jumps/branches are executing on the bpu, in 1 cycle, for all machines.
580 (define_function_unit "bpu" 1 0
581 (eq_attr "type" "jmpreg")
584 (define_function_unit "bpu" 1 0
585 (eq_attr "type" "branch")
588 ; Floating Point Unit
589 (define_function_unit "fpu" 1 0
590 (and (eq_attr "type" "fp,dmul")
591 (eq_attr "cpu" "rios1"))
594 (define_function_unit "fpu" 1 0
595 (and (eq_attr "type" "fp")
596 (eq_attr "cpu" "rs64a,mpccore"))
599 (define_function_unit "fpu" 1 0
600 (and (eq_attr "type" "fp")
601 (eq_attr "cpu" "ppc601"))
604 (define_function_unit "fpu" 1 0
605 (and (eq_attr "type" "fp")
606 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620,ppc750,ppc7400"))
609 (define_function_unit "fpu" 1 0
610 (and (eq_attr "type" "fp,dmul")
611 (eq_attr "cpu" "ppc7450"))
614 (define_function_unit "fpu" 1 0
615 (and (eq_attr "type" "dmul")
616 (eq_attr "cpu" "rs64a"))
619 (define_function_unit "fpu" 1 0
620 (and (eq_attr "type" "dmul")
621 (eq_attr "cpu" "mpccore"))
624 (define_function_unit "fpu" 1 0
625 (and (eq_attr "type" "dmul")
626 (eq_attr "cpu" "ppc601"))
630 (define_function_unit "fpu" 1 0
631 (and (eq_attr "type" "dmul")
632 (eq_attr "cpu" "ppc603,ppc750"))
635 (define_function_unit "fpu" 1 0
636 (and (eq_attr "type" "dmul")
637 (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc7400"))
640 (define_function_unit "fpu" 1 0
641 (and (eq_attr "type" "sdiv,ddiv")
642 (eq_attr "cpu" "rios1"))
645 (define_function_unit "fpu" 1 0
646 (and (eq_attr "type" "sdiv")
647 (eq_attr "cpu" "rs64a"))
650 (define_function_unit "fpu" 1 0
651 (and (eq_attr "type" "sdiv")
652 (eq_attr "cpu" "ppc601,ppc750,ppc7400"))
655 (define_function_unit "fpu" 1 0
656 (and (eq_attr "type" "sdiv")
657 (eq_attr "cpu" "ppc7450"))
660 (define_function_unit "fpu" 1 0
661 (and (eq_attr "type" "sdiv")
662 (eq_attr "cpu" "mpccore"))
665 (define_function_unit "fpu" 1 0
666 (and (eq_attr "type" "sdiv")
667 (eq_attr "cpu" "ppc603,ppc604,ppc604e,ppc620"))
670 (define_function_unit "fpu" 1 0
671 (and (eq_attr "type" "ddiv")
672 (eq_attr "cpu" "mpccore"))
675 (define_function_unit "fpu" 1 0
676 (and (eq_attr "type" "ddiv")
677 (eq_attr "cpu" "rs64a,ppc601,ppc750,ppc604,ppc604e,ppc620,ppc7400"))
680 (define_function_unit "fpu" 1 0
681 (and (eq_attr "type" "ddiv")
682 (eq_attr "cpu" "ppc7450"))
685 (define_function_unit "fpu" 1 0
686 (and (eq_attr "type" "ddiv")
687 (eq_attr "cpu" "ppc603"))
690 (define_function_unit "fpu" 1 0
691 (and (eq_attr "type" "ssqrt")
692 (eq_attr "cpu" "ppc620"))
695 (define_function_unit "fpu" 1 0
696 (and (eq_attr "type" "dsqrt")
697 (eq_attr "cpu" "ppc620"))
700 ; RIOS2 has two symmetric FPUs.
701 (define_function_unit "fpu2" 2 0
702 (and (eq_attr "type" "fp")
703 (eq_attr "cpu" "rios2"))
706 (define_function_unit "fpu2" 2 0
707 (and (eq_attr "type" "fp")
708 (eq_attr "cpu" "ppc630"))
711 (define_function_unit "fpu2" 2 0
712 (and (eq_attr "type" "dmul")
713 (eq_attr "cpu" "rios2"))
716 (define_function_unit "fpu2" 2 0
717 (and (eq_attr "type" "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 ;; Start with fixed-point load and store insns. Here we put only the more
753 ;; complex forms. Basic data transfer is done later.
755 (define_expand "zero_extendqidi2"
756 [(set (match_operand:DI 0 "gpc_reg_operand" "")
757 (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "")))]
762 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
763 (zero_extend:DI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
768 [(set_attr "type" "load,*")])
771 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
772 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
774 (clobber (match_scratch:DI 2 "=r,r"))]
779 [(set_attr "type" "compare")
780 (set_attr "length" "4,8")])
783 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
784 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
786 (clobber (match_scratch:DI 2 ""))]
787 "TARGET_POWERPC64 && reload_completed"
789 (zero_extend:DI (match_dup 1)))
791 (compare:CC (match_dup 2)
796 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
797 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
799 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
800 (zero_extend:DI (match_dup 1)))]
805 [(set_attr "type" "compare")
806 (set_attr "length" "4,8")])
809 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
810 (compare:CC (zero_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
812 (set (match_operand:DI 0 "gpc_reg_operand" "")
813 (zero_extend:DI (match_dup 1)))]
814 "TARGET_POWERPC64 && reload_completed"
816 (zero_extend:DI (match_dup 1)))
818 (compare:CC (match_dup 0)
822 (define_insn "extendqidi2"
823 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
824 (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r")))]
829 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
830 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
832 (clobber (match_scratch:DI 2 "=r,r"))]
837 [(set_attr "type" "compare")
838 (set_attr "length" "4,8")])
841 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
842 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
844 (clobber (match_scratch:DI 2 ""))]
845 "TARGET_POWERPC64 && reload_completed"
847 (sign_extend:DI (match_dup 1)))
849 (compare:CC (match_dup 2)
854 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
855 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
857 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
858 (sign_extend:DI (match_dup 1)))]
863 [(set_attr "type" "compare")
864 (set_attr "length" "4,8")])
867 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
868 (compare:CC (sign_extend:DI (match_operand:QI 1 "gpc_reg_operand" ""))
870 (set (match_operand:DI 0 "gpc_reg_operand" "")
871 (sign_extend:DI (match_dup 1)))]
872 "TARGET_POWERPC64 && reload_completed"
874 (sign_extend:DI (match_dup 1)))
876 (compare:CC (match_dup 0)
880 (define_expand "zero_extendhidi2"
881 [(set (match_operand:DI 0 "gpc_reg_operand" "")
882 (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
887 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
888 (zero_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
893 [(set_attr "type" "load,*")])
896 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
897 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
899 (clobber (match_scratch:DI 2 "=r,r"))]
904 [(set_attr "type" "compare")
905 (set_attr "length" "4,8")])
908 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
909 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
911 (clobber (match_scratch:DI 2 ""))]
912 "TARGET_POWERPC64 && reload_completed"
914 (zero_extend:DI (match_dup 1)))
916 (compare:CC (match_dup 2)
921 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
922 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
924 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
925 (zero_extend:DI (match_dup 1)))]
930 [(set_attr "type" "compare")
931 (set_attr "length" "4,8")])
934 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
935 (compare:CC (zero_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
937 (set (match_operand:DI 0 "gpc_reg_operand" "")
938 (zero_extend:DI (match_dup 1)))]
939 "TARGET_POWERPC64 && reload_completed"
941 (zero_extend:DI (match_dup 1)))
943 (compare:CC (match_dup 0)
947 (define_expand "extendhidi2"
948 [(set (match_operand:DI 0 "gpc_reg_operand" "")
949 (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "")))]
954 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
955 (sign_extend:DI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
960 [(set_attr "type" "load,*")])
963 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
964 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
966 (clobber (match_scratch:DI 2 "=r,r"))]
971 [(set_attr "type" "compare")
972 (set_attr "length" "4,8")])
975 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
976 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
978 (clobber (match_scratch:DI 2 ""))]
979 "TARGET_POWERPC64 && reload_completed"
981 (sign_extend:DI (match_dup 1)))
983 (compare:CC (match_dup 2)
988 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
989 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
991 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
992 (sign_extend:DI (match_dup 1)))]
997 [(set_attr "type" "compare")
998 (set_attr "length" "4,8")])
1001 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1002 (compare:CC (sign_extend:DI (match_operand:HI 1 "gpc_reg_operand" ""))
1004 (set (match_operand:DI 0 "gpc_reg_operand" "")
1005 (sign_extend:DI (match_dup 1)))]
1006 "TARGET_POWERPC64 && reload_completed"
1008 (sign_extend:DI (match_dup 1)))
1010 (compare:CC (match_dup 0)
1014 (define_expand "zero_extendsidi2"
1015 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1016 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1021 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1022 (zero_extend:DI (match_operand:SI 1 "reg_or_mem_operand" "m,r")))]
1027 [(set_attr "type" "load,*")])
1030 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1031 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1033 (clobber (match_scratch:DI 2 "=r,r"))]
1038 [(set_attr "type" "compare")
1039 (set_attr "length" "4,8")])
1042 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1043 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1045 (clobber (match_scratch:DI 2 ""))]
1046 "TARGET_POWERPC64 && reload_completed"
1048 (zero_extend:DI (match_dup 1)))
1050 (compare:CC (match_dup 2)
1055 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1056 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1058 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1059 (zero_extend:DI (match_dup 1)))]
1064 [(set_attr "type" "compare")
1065 (set_attr "length" "4,8")])
1068 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1069 (compare:CC (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1071 (set (match_operand:DI 0 "gpc_reg_operand" "")
1072 (zero_extend:DI (match_dup 1)))]
1073 "TARGET_POWERPC64 && reload_completed"
1075 (zero_extend:DI (match_dup 1)))
1077 (compare:CC (match_dup 0)
1081 (define_expand "extendsidi2"
1082 [(set (match_operand:DI 0 "gpc_reg_operand" "")
1083 (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "")))]
1088 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1089 (sign_extend:DI (match_operand:SI 1 "lwa_operand" "m,r")))]
1094 [(set_attr "type" "load,*")])
1097 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1098 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1100 (clobber (match_scratch:DI 2 "=r,r"))]
1105 [(set_attr "type" "compare")
1106 (set_attr "length" "4,8")])
1109 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1110 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1112 (clobber (match_scratch:DI 2 ""))]
1113 "TARGET_POWERPC64 && reload_completed"
1115 (sign_extend:DI (match_dup 1)))
1117 (compare:CC (match_dup 2)
1122 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1123 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1125 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
1126 (sign_extend:DI (match_dup 1)))]
1131 [(set_attr "type" "compare")
1132 (set_attr "length" "4,8")])
1135 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1136 (compare:CC (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
1138 (set (match_operand:DI 0 "gpc_reg_operand" "")
1139 (sign_extend:DI (match_dup 1)))]
1140 "TARGET_POWERPC64 && reload_completed"
1142 (sign_extend:DI (match_dup 1)))
1144 (compare:CC (match_dup 0)
1148 (define_expand "zero_extendqisi2"
1149 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1150 (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "")))]
1155 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1156 (zero_extend:SI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1160 {rlinm|rlwinm} %0,%1,0,0xff"
1161 [(set_attr "type" "load,*")])
1164 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1165 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1167 (clobber (match_scratch:SI 2 "=r,r"))]
1170 {andil.|andi.} %2,%1,0xff
1172 [(set_attr "type" "compare")
1173 (set_attr "length" "4,8")])
1176 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1177 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1179 (clobber (match_scratch:SI 2 ""))]
1182 (zero_extend:SI (match_dup 1)))
1184 (compare:CC (match_dup 2)
1189 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1190 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1192 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1193 (zero_extend:SI (match_dup 1)))]
1196 {andil.|andi.} %0,%1,0xff
1198 [(set_attr "type" "compare")
1199 (set_attr "length" "4,8")])
1202 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1203 (compare:CC (zero_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1205 (set (match_operand:SI 0 "gpc_reg_operand" "")
1206 (zero_extend:SI (match_dup 1)))]
1209 (zero_extend:SI (match_dup 1)))
1211 (compare:CC (match_dup 0)
1215 (define_expand "extendqisi2"
1216 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
1217 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1222 emit_insn (gen_extendqisi2_ppc (operands[0], operands[1]));
1223 else if (TARGET_POWER)
1224 emit_insn (gen_extendqisi2_power (operands[0], operands[1]));
1226 emit_insn (gen_extendqisi2_no_power (operands[0], operands[1]));
1230 (define_insn "extendqisi2_ppc"
1231 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1232 (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1237 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1238 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1240 (clobber (match_scratch:SI 2 "=r,r"))]
1245 [(set_attr "type" "compare")
1246 (set_attr "length" "4,8")])
1249 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1250 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1252 (clobber (match_scratch:SI 2 ""))]
1253 "TARGET_POWERPC && reload_completed"
1255 (sign_extend:SI (match_dup 1)))
1257 (compare:CC (match_dup 2)
1262 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1263 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1265 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1266 (sign_extend:SI (match_dup 1)))]
1271 [(set_attr "type" "compare")
1272 (set_attr "length" "4,8")])
1275 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1276 (compare:CC (sign_extend:SI (match_operand:QI 1 "gpc_reg_operand" ""))
1278 (set (match_operand:SI 0 "gpc_reg_operand" "")
1279 (sign_extend:SI (match_dup 1)))]
1280 "TARGET_POWERPC && reload_completed"
1282 (sign_extend:SI (match_dup 1)))
1284 (compare:CC (match_dup 0)
1288 (define_expand "extendqisi2_power"
1289 [(parallel [(set (match_dup 2)
1290 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1292 (clobber (scratch:SI))])
1293 (parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
1294 (ashiftrt:SI (match_dup 2)
1296 (clobber (scratch:SI))])]
1299 { operands[1] = gen_lowpart (SImode, operands[1]);
1300 operands[2] = gen_reg_rtx (SImode); }")
1302 (define_expand "extendqisi2_no_power"
1304 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1306 (set (match_operand:SI 0 "gpc_reg_operand" "")
1307 (ashiftrt:SI (match_dup 2)
1309 "! TARGET_POWER && ! TARGET_POWERPC"
1311 { operands[1] = gen_lowpart (SImode, operands[1]);
1312 operands[2] = gen_reg_rtx (SImode); }")
1314 (define_expand "zero_extendqihi2"
1315 [(set (match_operand:HI 0 "gpc_reg_operand" "")
1316 (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "")))]
1321 [(set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1322 (zero_extend:HI (match_operand:QI 1 "reg_or_mem_operand" "m,r")))]
1326 {rlinm|rlwinm} %0,%1,0,0xff"
1327 [(set_attr "type" "load,*")])
1330 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1331 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1333 (clobber (match_scratch:HI 2 "=r,r"))]
1336 {andil.|andi.} %2,%1,0xff
1338 [(set_attr "type" "compare")
1339 (set_attr "length" "4,8")])
1342 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1343 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1345 (clobber (match_scratch:HI 2 ""))]
1348 (zero_extend:HI (match_dup 1)))
1350 (compare:CC (match_dup 2)
1355 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1356 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1358 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1359 (zero_extend:HI (match_dup 1)))]
1362 {andil.|andi.} %0,%1,0xff
1364 [(set_attr "type" "compare")
1365 (set_attr "length" "4,8")])
1368 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1369 (compare:CC (zero_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1371 (set (match_operand:HI 0 "gpc_reg_operand" "")
1372 (zero_extend:HI (match_dup 1)))]
1375 (zero_extend:HI (match_dup 1)))
1377 (compare:CC (match_dup 0)
1381 (define_expand "extendqihi2"
1382 [(use (match_operand:HI 0 "gpc_reg_operand" ""))
1383 (use (match_operand:QI 1 "gpc_reg_operand" ""))]
1388 emit_insn (gen_extendqihi2_ppc (operands[0], operands[1]));
1389 else if (TARGET_POWER)
1390 emit_insn (gen_extendqihi2_power (operands[0], operands[1]));
1392 emit_insn (gen_extendqihi2_no_power (operands[0], operands[1]));
1396 (define_insn "extendqihi2_ppc"
1397 [(set (match_operand:HI 0 "gpc_reg_operand" "=r")
1398 (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r")))]
1403 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1404 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1406 (clobber (match_scratch:HI 2 "=r,r"))]
1411 [(set_attr "type" "compare")
1412 (set_attr "length" "4,8")])
1415 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1416 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1418 (clobber (match_scratch:HI 2 ""))]
1419 "TARGET_POWERPC && reload_completed"
1421 (sign_extend:HI (match_dup 1)))
1423 (compare:CC (match_dup 2)
1428 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1429 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" "r,r"))
1431 (set (match_operand:HI 0 "gpc_reg_operand" "=r,r")
1432 (sign_extend:HI (match_dup 1)))]
1437 [(set_attr "type" "compare")
1438 (set_attr "length" "4,8")])
1441 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1442 (compare:CC (sign_extend:HI (match_operand:QI 1 "gpc_reg_operand" ""))
1444 (set (match_operand:HI 0 "gpc_reg_operand" "")
1445 (sign_extend:HI (match_dup 1)))]
1446 "TARGET_POWERPC && reload_completed"
1448 (sign_extend:HI (match_dup 1)))
1450 (compare:CC (match_dup 0)
1454 (define_expand "extendqihi2_power"
1455 [(parallel [(set (match_dup 2)
1456 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1458 (clobber (scratch:SI))])
1459 (parallel [(set (match_operand:HI 0 "gpc_reg_operand" "")
1460 (ashiftrt:SI (match_dup 2)
1462 (clobber (scratch:SI))])]
1465 { operands[0] = gen_lowpart (SImode, operands[0]);
1466 operands[1] = gen_lowpart (SImode, operands[1]);
1467 operands[2] = gen_reg_rtx (SImode); }")
1469 (define_expand "extendqihi2_no_power"
1471 (ashift:SI (match_operand:QI 1 "gpc_reg_operand" "")
1473 (set (match_operand:HI 0 "gpc_reg_operand" "")
1474 (ashiftrt:SI (match_dup 2)
1476 "! TARGET_POWER && ! TARGET_POWERPC"
1478 { operands[0] = gen_lowpart (SImode, operands[0]);
1479 operands[1] = gen_lowpart (SImode, operands[1]);
1480 operands[2] = gen_reg_rtx (SImode); }")
1482 (define_expand "zero_extendhisi2"
1483 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1484 (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1489 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1490 (zero_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1494 {rlinm|rlwinm} %0,%1,0,0xffff"
1495 [(set_attr "type" "load,*")])
1498 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1499 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1501 (clobber (match_scratch:SI 2 "=r,r"))]
1504 {andil.|andi.} %2,%1,0xffff
1506 [(set_attr "type" "compare")
1507 (set_attr "length" "4,8")])
1510 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1511 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1513 (clobber (match_scratch:SI 2 ""))]
1516 (zero_extend:SI (match_dup 1)))
1518 (compare:CC (match_dup 2)
1523 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1524 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1526 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1527 (zero_extend:SI (match_dup 1)))]
1530 {andil.|andi.} %0,%1,0xffff
1532 [(set_attr "type" "compare")
1533 (set_attr "length" "4,8")])
1536 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1537 (compare:CC (zero_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1539 (set (match_operand:SI 0 "gpc_reg_operand" "")
1540 (zero_extend:SI (match_dup 1)))]
1543 (zero_extend:SI (match_dup 1)))
1545 (compare:CC (match_dup 0)
1549 (define_expand "extendhisi2"
1550 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1551 (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "")))]
1556 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1557 (sign_extend:SI (match_operand:HI 1 "reg_or_mem_operand" "m,r")))]
1562 [(set_attr "type" "load,*")])
1565 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1566 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1568 (clobber (match_scratch:SI 2 "=r,r"))]
1571 {exts.|extsh.} %2,%1
1573 [(set_attr "type" "compare")
1574 (set_attr "length" "4,8")])
1577 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1578 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1580 (clobber (match_scratch:SI 2 ""))]
1583 (sign_extend:SI (match_dup 1)))
1585 (compare:CC (match_dup 2)
1590 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1591 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" "r,r"))
1593 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1594 (sign_extend:SI (match_dup 1)))]
1597 {exts.|extsh.} %0,%1
1599 [(set_attr "type" "compare")
1600 (set_attr "length" "4,8")])
1603 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1604 (compare:CC (sign_extend:SI (match_operand:HI 1 "gpc_reg_operand" ""))
1606 (set (match_operand:SI 0 "gpc_reg_operand" "")
1607 (sign_extend:SI (match_dup 1)))]
1610 (sign_extend:SI (match_dup 1)))
1612 (compare:CC (match_dup 0)
1616 ;; Fixed-point arithmetic insns.
1618 ;; Discourage ai/addic because of carry but provide it in an alternative
1619 ;; allowing register zero as source.
1620 (define_expand "addsi3"
1621 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1622 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1623 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
1627 if (GET_CODE (operands[2]) == CONST_INT
1628 && ! add_operand (operands[2], SImode))
1630 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
1631 ? operands[0] : gen_reg_rtx (SImode));
1633 HOST_WIDE_INT val = INTVAL (operands[2]);
1634 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1635 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1637 /* The ordering here is important for the prolog expander.
1638 When space is allocated from the stack, adding 'low' first may
1639 produce a temporary deallocation (which would be bad). */
1640 emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest)));
1641 emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low)));
1646 (define_insn "*addsi3_internal1"
1647 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r")
1648 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b")
1649 (match_operand:SI 2 "add_operand" "r,I,I,L")))]
1653 {cal %0,%2(%1)|addi %0,%1,%2}
1655 {cau|addis} %0,%1,%v2"
1656 [(set_attr "length" "4,4,4,4")])
1658 (define_insn "addsi3_high"
1659 [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
1660 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1661 (high:SI (match_operand 2 "" ""))))]
1662 "TARGET_MACHO && !TARGET_64BIT"
1663 "{cau|addis} %0,%1,ha16(%2)"
1664 [(set_attr "length" "4")])
1666 (define_insn "*addsi3_internal2"
1667 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
1668 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1669 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1671 (clobber (match_scratch:SI 3 "=r,r,r,r"))]
1672 "! TARGET_POWERPC64"
1674 {cax.|add.} %3,%1,%2
1675 {ai.|addic.} %3,%1,%2
1678 [(set_attr "type" "compare")
1679 (set_attr "length" "4,4,8,8")])
1682 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1683 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1684 (match_operand:SI 2 "reg_or_short_operand" ""))
1686 (clobber (match_scratch:SI 3 ""))]
1687 "! TARGET_POWERPC64 && reload_completed"
1689 (plus:SI (match_dup 1)
1692 (compare:CC (match_dup 3)
1696 (define_insn "*addsi3_internal3"
1697 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
1698 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
1699 (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
1701 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
1702 (plus:SI (match_dup 1)
1704 "! TARGET_POWERPC64"
1706 {cax.|add.} %0,%1,%2
1707 {ai.|addic.} %0,%1,%2
1710 [(set_attr "type" "compare")
1711 (set_attr "length" "4,4,8,8")])
1714 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
1715 (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1716 (match_operand:SI 2 "reg_or_short_operand" ""))
1718 (set (match_operand:SI 0 "gpc_reg_operand" "")
1719 (plus:SI (match_dup 1) (match_dup 2)))]
1720 "! TARGET_POWERPC64 && reload_completed"
1722 (plus:SI (match_dup 1)
1725 (compare:CC (match_dup 0)
1729 ;; Split an add that we can't do in one insn into two insns, each of which
1730 ;; does one 16-bit part. This is used by combine. Note that the low-order
1731 ;; add should be last in case the result gets used in an address.
1734 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1735 (plus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1736 (match_operand:SI 2 "non_add_cint_operand" "")))]
1738 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
1739 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
1742 HOST_WIDE_INT val = INTVAL (operands[2]);
1743 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
1744 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode);
1746 operands[3] = GEN_INT (rest);
1747 operands[4] = GEN_INT (low);
1750 (define_insn "one_cmplsi2"
1751 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1752 (not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
1757 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1758 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1760 (clobber (match_scratch:SI 2 "=r,r"))]
1761 "! TARGET_POWERPC64"
1765 [(set_attr "type" "compare")
1766 (set_attr "length" "4,8")])
1769 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1770 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1772 (clobber (match_scratch:SI 2 ""))]
1773 "! TARGET_POWERPC64 && reload_completed"
1775 (not:SI (match_dup 1)))
1777 (compare:CC (match_dup 2)
1782 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
1783 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
1785 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1786 (not:SI (match_dup 1)))]
1787 "! TARGET_POWERPC64"
1791 [(set_attr "type" "compare")
1792 (set_attr "length" "4,8")])
1795 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
1796 (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
1798 (set (match_operand:SI 0 "gpc_reg_operand" "")
1799 (not:SI (match_dup 1)))]
1800 "! TARGET_POWERPC64 && reload_completed"
1802 (not:SI (match_dup 1)))
1804 (compare:CC (match_dup 0)
1809 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1810 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "rI")
1811 (match_operand:SI 2 "gpc_reg_operand" "r")))]
1813 "{sf%I1|subf%I1c} %0,%2,%1")
1816 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1817 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I")
1818 (match_operand:SI 2 "gpc_reg_operand" "r,r")))]
1825 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1826 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1827 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1829 (clobber (match_scratch:SI 3 "=r,r"))]
1832 {sf.|subfc.} %3,%2,%1
1834 [(set_attr "type" "compare")
1835 (set_attr "length" "4,8")])
1838 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
1839 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1840 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1842 (clobber (match_scratch:SI 3 "=r,r"))]
1843 "TARGET_POWERPC && ! TARGET_POWERPC64"
1847 [(set_attr "type" "compare")
1848 (set_attr "length" "4,8")])
1851 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
1852 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1853 (match_operand:SI 2 "gpc_reg_operand" ""))
1855 (clobber (match_scratch:SI 3 ""))]
1856 "! TARGET_POWERPC64 && reload_completed"
1858 (minus:SI (match_dup 1)
1861 (compare:CC (match_dup 3)
1866 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1867 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1868 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1870 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1871 (minus:SI (match_dup 1) (match_dup 2)))]
1874 {sf.|subfc.} %0,%2,%1
1876 [(set_attr "type" "compare")
1877 (set_attr "length" "4,8")])
1880 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
1881 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
1882 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
1884 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
1885 (minus:SI (match_dup 1)
1887 "TARGET_POWERPC && ! TARGET_POWERPC64"
1891 [(set_attr "type" "compare")
1892 (set_attr "length" "4,8")])
1895 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
1896 (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "")
1897 (match_operand:SI 2 "gpc_reg_operand" ""))
1899 (set (match_operand:SI 0 "gpc_reg_operand" "")
1900 (minus:SI (match_dup 1)
1902 "! TARGET_POWERPC64 && reload_completed"
1904 (minus:SI (match_dup 1)
1907 (compare:CC (match_dup 0)
1911 (define_expand "subsi3"
1912 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1913 (minus:SI (match_operand:SI 1 "reg_or_short_operand" "")
1914 (match_operand:SI 2 "reg_or_arith_cint_operand" "")))]
1918 if (GET_CODE (operands[2]) == CONST_INT)
1920 emit_insn (gen_addsi3 (operands[0], operands[1],
1921 negate_rtx (SImode, operands[2])));
1926 ;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
1927 ;; instruction and some auxiliary computations. Then we just have a single
1928 ;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
1931 (define_expand "sminsi3"
1933 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
1934 (match_operand:SI 2 "reg_or_short_operand" ""))
1936 (minus:SI (match_dup 2) (match_dup 1))))
1937 (set (match_operand:SI 0 "gpc_reg_operand" "")
1938 (minus:SI (match_dup 2) (match_dup 3)))]
1941 { operands[3] = gen_reg_rtx (SImode); }")
1944 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1945 (smin:SI (match_operand:SI 1 "gpc_reg_operand" "")
1946 (match_operand:SI 2 "reg_or_short_operand" "")))
1947 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
1950 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
1952 (minus:SI (match_dup 2) (match_dup 1))))
1953 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 3)))]
1956 (define_expand "smaxsi3"
1958 (if_then_else:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
1959 (match_operand:SI 2 "reg_or_short_operand" ""))
1961 (minus:SI (match_dup 2) (match_dup 1))))
1962 (set (match_operand:SI 0 "gpc_reg_operand" "")
1963 (plus:SI (match_dup 3) (match_dup 1)))]
1966 { operands[3] = gen_reg_rtx (SImode); }")
1969 [(set (match_operand:SI 0 "gpc_reg_operand" "")
1970 (smax:SI (match_operand:SI 1 "gpc_reg_operand" "")
1971 (match_operand:SI 2 "reg_or_short_operand" "")))
1972 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
1975 (if_then_else:SI (gt:SI (match_dup 1) (match_dup 2))
1977 (minus:SI (match_dup 2) (match_dup 1))))
1978 (set (match_dup 0) (plus:SI (match_dup 3) (match_dup 1)))]
1981 (define_expand "uminsi3"
1982 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
1984 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
1986 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
1988 (minus:SI (match_dup 4) (match_dup 3))))
1989 (set (match_operand:SI 0 "gpc_reg_operand" "")
1990 (minus:SI (match_dup 2) (match_dup 3)))]
1994 operands[3] = gen_reg_rtx (SImode);
1995 operands[4] = gen_reg_rtx (SImode);
1996 operands[5] = GEN_INT (-2147483647 - 1);
1999 (define_expand "umaxsi3"
2000 [(set (match_dup 3) (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2002 (set (match_dup 4) (xor:SI (match_operand:SI 2 "gpc_reg_operand" "")
2004 (set (match_dup 3) (if_then_else:SI (gt (match_dup 3) (match_dup 4))
2006 (minus:SI (match_dup 4) (match_dup 3))))
2007 (set (match_operand:SI 0 "gpc_reg_operand" "")
2008 (plus:SI (match_dup 3) (match_dup 1)))]
2012 operands[3] = gen_reg_rtx (SImode);
2013 operands[4] = gen_reg_rtx (SImode);
2014 operands[5] = GEN_INT (-2147483647 - 1);
2018 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2019 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r")
2020 (match_operand:SI 2 "reg_or_short_operand" "rI"))
2022 (minus:SI (match_dup 2) (match_dup 1))))]
2027 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2029 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2030 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2032 (minus:SI (match_dup 2) (match_dup 1)))
2034 (clobber (match_scratch:SI 3 "=r,r"))]
2039 [(set_attr "type" "delayed_compare")
2040 (set_attr "length" "4,8")])
2043 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2045 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2046 (match_operand:SI 2 "reg_or_short_operand" ""))
2048 (minus:SI (match_dup 2) (match_dup 1)))
2050 (clobber (match_scratch:SI 3 ""))]
2051 "TARGET_POWER && reload_completed"
2053 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2055 (minus:SI (match_dup 2) (match_dup 1))))
2057 (compare:CC (match_dup 3)
2062 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2064 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "r,r")
2065 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
2067 (minus:SI (match_dup 2) (match_dup 1)))
2069 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2070 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2072 (minus:SI (match_dup 2) (match_dup 1))))]
2077 [(set_attr "type" "delayed_compare")
2078 (set_attr "length" "4,8")])
2081 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2083 (if_then_else:SI (gt (match_operand:SI 1 "gpc_reg_operand" "")
2084 (match_operand:SI 2 "reg_or_short_operand" ""))
2086 (minus:SI (match_dup 2) (match_dup 1)))
2088 (set (match_operand:SI 0 "gpc_reg_operand" "")
2089 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2091 (minus:SI (match_dup 2) (match_dup 1))))]
2092 "TARGET_POWER && reload_completed"
2094 (if_then_else:SI (gt (match_dup 1) (match_dup 2))
2096 (minus:SI (match_dup 2) (match_dup 1))))
2098 (compare:CC (match_dup 0)
2102 ;; We don't need abs with condition code because such comparisons should
2104 (define_expand "abssi2"
2105 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2106 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
2112 emit_insn (gen_abssi2_nopower (operands[0], operands[1]));
2117 (define_insn "abssi2_power"
2118 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2119 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2123 (define_insn "abssi2_nopower"
2124 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2125 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
2126 (clobber (match_scratch:SI 2 "=&r,&r"))]
2130 return (TARGET_POWERPC)
2131 ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%2,%0\"
2132 : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%2,%0\";
2134 [(set_attr "length" "12")])
2137 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2138 (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
2139 (clobber (match_scratch:SI 2 ""))]
2140 "! TARGET_POWER && reload_completed"
2141 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2142 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2143 (set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
2146 (define_insn "*nabs_power"
2147 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2148 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
2152 (define_insn "*nabs_no_power"
2153 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
2154 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
2155 (clobber (match_scratch:SI 2 "=&r,&r"))]
2159 return (TARGET_POWERPC)
2160 ? \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;subf %0,%0,%2\"
2161 : \"{srai|srawi} %2,%1,31\;xor %0,%2,%1\;{sf|subfc} %0,%0,%2\";
2163 [(set_attr "length" "12")])
2166 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2167 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" ""))))
2168 (clobber (match_scratch:SI 2 ""))]
2169 "! TARGET_POWER && reload_completed"
2170 [(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
2171 (set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
2172 (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))]
2175 (define_insn "negsi2"
2176 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2177 (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2182 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2183 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2185 (clobber (match_scratch:SI 2 "=r,r"))]
2186 "! TARGET_POWERPC64"
2190 [(set_attr "type" "compare")
2191 (set_attr "length" "4,8")])
2194 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2195 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2197 (clobber (match_scratch:SI 2 ""))]
2198 "! TARGET_POWERPC64 && reload_completed"
2200 (neg:SI (match_dup 1)))
2202 (compare:CC (match_dup 2)
2207 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
2208 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
2210 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2211 (neg:SI (match_dup 1)))]
2212 "! TARGET_POWERPC64"
2216 [(set_attr "type" "compare")
2217 (set_attr "length" "4,8")])
2220 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
2221 (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
2223 (set (match_operand:SI 0 "gpc_reg_operand" "")
2224 (neg:SI (match_dup 1)))]
2225 "! TARGET_POWERPC64 && reload_completed"
2227 (neg:SI (match_dup 1)))
2229 (compare:CC (match_dup 0)
2233 (define_insn "ffssi2"
2234 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
2235 (ffs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
2237 "neg %0,%1\;and %0,%0,%1\;{cntlz|cntlzw} %0,%0\;{sfi|subfic} %0,%0,32"
2238 [(set_attr "length" "16")])
2240 (define_expand "mulsi3"
2241 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2242 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2243 (use (match_operand:SI 2 "reg_or_short_operand" ""))]
2248 emit_insn (gen_mulsi3_mq (operands[0], operands[1], operands[2]));
2250 emit_insn (gen_mulsi3_no_mq (operands[0], operands[1], operands[2]));
2254 (define_insn "mulsi3_mq"
2255 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2256 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2257 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
2258 (clobber (match_scratch:SI 3 "=q,q"))]
2261 {muls|mullw} %0,%1,%2
2262 {muli|mulli} %0,%1,%2"
2264 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2265 (const_string "imul3")
2266 (match_operand:SI 2 "short_cint_operand" "")
2267 (const_string "imul2")]
2268 (const_string "imul")))])
2270 (define_insn "mulsi3_no_mq"
2271 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2272 (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2273 (match_operand:SI 2 "reg_or_short_operand" "r,I")))]
2276 {muls|mullw} %0,%1,%2
2277 {muli|mulli} %0,%1,%2"
2279 (cond [(match_operand:SI 2 "s8bit_cint_operand" "")
2280 (const_string "imul3")
2281 (match_operand:SI 2 "short_cint_operand" "")
2282 (const_string "imul2")]
2283 (const_string "imul")))])
2286 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2287 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2288 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2290 (clobber (match_scratch:SI 3 "=r,r"))
2291 (clobber (match_scratch:SI 4 "=q,q"))]
2294 {muls.|mullw.} %3,%1,%2
2296 [(set_attr "type" "delayed_compare")
2297 (set_attr "length" "4,8")])
2300 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2301 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2302 (match_operand:SI 2 "gpc_reg_operand" ""))
2304 (clobber (match_scratch:SI 3 ""))
2305 (clobber (match_scratch:SI 4 ""))]
2306 "TARGET_POWER && reload_completed"
2307 [(parallel [(set (match_dup 3)
2308 (mult:SI (match_dup 1) (match_dup 2)))
2309 (clobber (match_dup 4))])
2311 (compare:CC (match_dup 3)
2316 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2317 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2318 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2320 (clobber (match_scratch:SI 3 "=r,r"))]
2323 {muls.|mullw.} %3,%1,%2
2325 [(set_attr "type" "delayed_compare")
2326 (set_attr "length" "4,8")])
2329 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2330 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2331 (match_operand:SI 2 "gpc_reg_operand" ""))
2333 (clobber (match_scratch:SI 3 ""))]
2334 "! TARGET_POWER && reload_completed"
2336 (mult:SI (match_dup 1) (match_dup 2)))
2338 (compare:CC (match_dup 3)
2343 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2344 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2345 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2347 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2348 (mult:SI (match_dup 1) (match_dup 2)))
2349 (clobber (match_scratch:SI 4 "=q,q"))]
2352 {muls.|mullw.} %0,%1,%2
2354 [(set_attr "type" "delayed_compare")
2355 (set_attr "length" "4,8")])
2358 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2359 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2360 (match_operand:SI 2 "gpc_reg_operand" ""))
2362 (set (match_operand:SI 0 "gpc_reg_operand" "")
2363 (mult:SI (match_dup 1) (match_dup 2)))
2364 (clobber (match_scratch:SI 4 ""))]
2365 "TARGET_POWER && reload_completed"
2366 [(parallel [(set (match_dup 0)
2367 (mult:SI (match_dup 1) (match_dup 2)))
2368 (clobber (match_dup 4))])
2370 (compare:CC (match_dup 0)
2375 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2376 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r")
2377 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
2379 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2380 (mult:SI (match_dup 1) (match_dup 2)))]
2383 {muls.|mullw.} %0,%1,%2
2385 [(set_attr "type" "delayed_compare")
2386 (set_attr "length" "4,8")])
2389 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2390 (compare:CC (mult:SI (match_operand:SI 1 "gpc_reg_operand" "")
2391 (match_operand:SI 2 "gpc_reg_operand" ""))
2393 (set (match_operand:SI 0 "gpc_reg_operand" "")
2394 (mult:SI (match_dup 1) (match_dup 2)))]
2395 "! TARGET_POWER && reload_completed"
2397 (mult:SI (match_dup 1) (match_dup 2)))
2399 (compare:CC (match_dup 0)
2403 ;; Operand 1 is divided by operand 2; quotient goes to operand
2404 ;; 0 and remainder to operand 3.
2405 ;; ??? At some point, see what, if anything, we can do about if (x % y == 0).
2407 (define_expand "divmodsi4"
2408 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2409 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2410 (match_operand:SI 2 "gpc_reg_operand" "")))
2411 (set (match_operand:SI 3 "gpc_reg_operand" "")
2412 (mod:SI (match_dup 1) (match_dup 2)))])]
2413 "TARGET_POWER || (! TARGET_POWER && ! TARGET_POWERPC)"
2416 if (! TARGET_POWER && ! TARGET_POWERPC)
2418 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2419 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2420 emit_insn (gen_divss_call ());
2421 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2422 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2428 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2429 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2430 (match_operand:SI 2 "gpc_reg_operand" "r")))
2431 (set (match_operand:SI 3 "gpc_reg_operand" "=q")
2432 (mod:SI (match_dup 1) (match_dup 2)))]
2435 [(set_attr "type" "idiv")])
2437 (define_expand "udivsi3"
2438 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2439 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2440 (match_operand:SI 2 "gpc_reg_operand" "")))]
2441 "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)"
2444 if (! TARGET_POWER && ! TARGET_POWERPC)
2446 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2447 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2448 emit_insn (gen_quous_call ());
2449 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2452 else if (TARGET_POWER)
2454 emit_insn (gen_udivsi3_mq (operands[0], operands[1], operands[2]));
2459 (define_insn "udivsi3_mq"
2460 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2461 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2462 (match_operand:SI 2 "gpc_reg_operand" "r")))
2463 (clobber (match_scratch:SI 3 "=q"))]
2464 "TARGET_POWERPC && TARGET_POWER"
2466 [(set_attr "type" "idiv")])
2468 (define_insn "*udivsi3_no_mq"
2469 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2470 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2471 (match_operand:SI 2 "gpc_reg_operand" "r")))]
2472 "TARGET_POWERPC && ! TARGET_POWER"
2474 [(set_attr "type" "idiv")])
2476 ;; For powers of two we can do srai/aze for divide and then adjust for
2477 ;; modulus. If it isn't a power of two, FAIL on POWER so divmodsi4 will be
2478 ;; used; for PowerPC, force operands into register and do a normal divide;
2479 ;; for AIX common-mode, use quoss call on register operands.
2480 (define_expand "divsi3"
2481 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2482 (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2483 (match_operand:SI 2 "reg_or_cint_operand" "")))]
2487 if (GET_CODE (operands[2]) == CONST_INT
2488 && INTVAL (operands[2]) > 0
2489 && exact_log2 (INTVAL (operands[2])) >= 0)
2491 else if (TARGET_POWERPC)
2493 operands[2] = force_reg (SImode, operands[2]);
2496 emit_insn (gen_divsi3_mq (operands[0], operands[1], operands[2]));
2500 else if (TARGET_POWER)
2504 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2505 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2506 emit_insn (gen_quoss_call ());
2507 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2512 (define_insn "divsi3_mq"
2513 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2514 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2515 (match_operand:SI 2 "gpc_reg_operand" "r")))
2516 (clobber (match_scratch:SI 3 "=q"))]
2517 "TARGET_POWERPC && TARGET_POWER"
2519 [(set_attr "type" "idiv")])
2521 (define_insn "*divsi3_no_mq"
2522 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2523 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2524 (match_operand:SI 2 "gpc_reg_operand" "r")))]
2525 "TARGET_POWERPC && ! TARGET_POWER"
2527 [(set_attr "type" "idiv")])
2529 (define_expand "modsi3"
2530 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
2531 (use (match_operand:SI 1 "gpc_reg_operand" ""))
2532 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
2540 if (GET_CODE (operands[2]) != CONST_INT
2541 || INTVAL (operands[2]) <= 0
2542 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
2545 temp1 = gen_reg_rtx (SImode);
2546 temp2 = gen_reg_rtx (SImode);
2548 emit_insn (gen_divsi3 (temp1, operands[1], operands[2]));
2549 emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
2550 emit_insn (gen_subsi3 (operands[0], operands[1], temp2));
2555 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2556 (div:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2557 (match_operand:SI 2 "exact_log2_cint_operand" "N")))]
2559 "{srai|srawi} %0,%1,%p2\;{aze|addze} %0,%0"
2560 [(set_attr "length" "8")])
2563 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2564 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2565 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2567 (clobber (match_scratch:SI 3 "=r,r"))]
2570 {srai|srawi} %3,%1,%p2\;{aze.|addze.} %3,%3
2572 [(set_attr "type" "compare")
2573 (set_attr "length" "8,12")])
2576 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2577 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2578 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2580 (clobber (match_scratch:SI 3 ""))]
2583 (div:SI (match_dup 1) (match_dup 2)))
2585 (compare:CC (match_dup 3)
2590 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2591 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
2592 (match_operand:SI 2 "exact_log2_cint_operand" "N,N"))
2594 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2595 (div:SI (match_dup 1) (match_dup 2)))]
2598 {srai|srawi} %0,%1,%p2\;{aze.|addze.} %0,%0
2600 [(set_attr "type" "compare")
2601 (set_attr "length" "8,12")])
2604 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2605 (compare:CC (div:SI (match_operand:SI 1 "gpc_reg_operand" "")
2606 (match_operand:SI 2 "exact_log2_cint_operand" ""))
2608 (set (match_operand:SI 0 "gpc_reg_operand" "")
2609 (div:SI (match_dup 1) (match_dup 2)))]
2612 (div:SI (match_dup 1) (match_dup 2)))
2614 (compare:CC (match_dup 0)
2619 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2622 (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "r"))
2624 (zero_extend:DI (match_operand:SI 4 "register_operand" "2")))
2625 (match_operand:SI 3 "gpc_reg_operand" "r")))
2626 (set (match_operand:SI 2 "register_operand" "=*q")
2629 (zero_extend:DI (match_dup 1)) (const_int 32))
2630 (zero_extend:DI (match_dup 4)))
2634 [(set_attr "type" "idiv")])
2636 ;; To do unsigned divide we handle the cases of the divisor looking like a
2637 ;; negative number. If it is a constant that is less than 2**31, we don't
2638 ;; have to worry about the branches. So make a few subroutines here.
2640 ;; First comes the normal case.
2641 (define_expand "udivmodsi4_normal"
2642 [(set (match_dup 4) (const_int 0))
2643 (parallel [(set (match_operand:SI 0 "" "")
2644 (udiv:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2646 (zero_extend:DI (match_operand:SI 1 "" "")))
2647 (match_operand:SI 2 "" "")))
2648 (set (match_operand:SI 3 "" "")
2649 (umod:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup 4))
2651 (zero_extend:DI (match_dup 1)))
2655 { operands[4] = gen_reg_rtx (SImode); }")
2657 ;; This handles the branches.
2658 (define_expand "udivmodsi4_tests"
2659 [(set (match_operand:SI 0 "" "") (const_int 0))
2660 (set (match_operand:SI 3 "" "") (match_operand:SI 1 "" ""))
2661 (set (match_dup 5) (compare:CCUNS (match_dup 1) (match_operand:SI 2 "" "")))
2662 (set (pc) (if_then_else (ltu (match_dup 5) (const_int 0))
2663 (label_ref (match_operand:SI 4 "" "")) (pc)))
2664 (set (match_dup 0) (const_int 1))
2665 (set (match_dup 3) (minus:SI (match_dup 1) (match_dup 2)))
2666 (set (match_dup 6) (compare:CC (match_dup 2) (const_int 0)))
2667 (set (pc) (if_then_else (lt (match_dup 6) (const_int 0))
2668 (label_ref (match_dup 4)) (pc)))]
2671 { operands[5] = gen_reg_rtx (CCUNSmode);
2672 operands[6] = gen_reg_rtx (CCmode);
2675 (define_expand "udivmodsi4"
2676 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2677 (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "")
2678 (match_operand:SI 2 "reg_or_cint_operand" "")))
2679 (set (match_operand:SI 3 "gpc_reg_operand" "")
2680 (umod:SI (match_dup 1) (match_dup 2)))])]
2688 if (! TARGET_POWERPC)
2690 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
2691 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
2692 emit_insn (gen_divus_call ());
2693 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
2694 emit_move_insn (operands[3], gen_rtx_REG (SImode, 4));
2701 if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
2703 operands[2] = force_reg (SImode, operands[2]);
2704 label = gen_label_rtx ();
2705 emit (gen_udivmodsi4_tests (operands[0], operands[1], operands[2],
2706 operands[3], label));
2709 operands[2] = force_reg (SImode, operands[2]);
2711 emit (gen_udivmodsi4_normal (operands[0], operands[1], operands[2],
2719 ;; AIX architecture-independent common-mode multiply (DImode),
2720 ;; divide/modulus, and quotient subroutine calls. Input operands in R3 and
2721 ;; R4; results in R3 and sometimes R4; link register always clobbered by bla
2722 ;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but
2723 ;; assumed unused if generating common-mode, so ignore.
2724 (define_insn "mulh_call"
2727 (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3))
2728 (sign_extend:DI (reg:SI 4)))
2730 (clobber (match_scratch:SI 0 "=l"))]
2731 "! TARGET_POWER && ! TARGET_POWERPC"
2733 [(set_attr "type" "imul")])
2735 (define_insn "mull_call"
2737 (mult:DI (sign_extend:DI (reg:SI 3))
2738 (sign_extend:DI (reg:SI 4))))
2739 (clobber (match_scratch:SI 0 "=l"))
2740 (clobber (reg:SI 0))]
2741 "! TARGET_POWER && ! TARGET_POWERPC"
2743 [(set_attr "type" "imul")])
2745 (define_insn "divss_call"
2747 (div:SI (reg:SI 3) (reg:SI 4)))
2749 (mod:SI (reg:SI 3) (reg:SI 4)))
2750 (clobber (match_scratch:SI 0 "=l"))
2751 (clobber (reg:SI 0))]
2752 "! TARGET_POWER && ! TARGET_POWERPC"
2754 [(set_attr "type" "idiv")])
2756 (define_insn "divus_call"
2758 (udiv:SI (reg:SI 3) (reg:SI 4)))
2760 (umod:SI (reg:SI 3) (reg:SI 4)))
2761 (clobber (match_scratch:SI 0 "=l"))
2762 (clobber (reg:SI 0))
2763 (clobber (match_scratch:CC 1 "=x"))
2764 (clobber (reg:CC 69))]
2765 "! TARGET_POWER && ! TARGET_POWERPC"
2767 [(set_attr "type" "idiv")])
2769 (define_insn "quoss_call"
2771 (div:SI (reg:SI 3) (reg:SI 4)))
2772 (clobber (match_scratch:SI 0 "=l"))]
2773 "! TARGET_POWER && ! TARGET_POWERPC"
2775 [(set_attr "type" "idiv")])
2777 (define_insn "quous_call"
2779 (udiv:SI (reg:SI 3) (reg:SI 4)))
2780 (clobber (match_scratch:SI 0 "=l"))
2781 (clobber (reg:SI 0))
2782 (clobber (match_scratch:CC 1 "=x"))
2783 (clobber (reg:CC 69))]
2784 "! TARGET_POWER && ! TARGET_POWERPC"
2786 [(set_attr "type" "idiv")])
2788 ;; Logical instructions
2789 ;; The logical instructions are mostly combined by using match_operator,
2790 ;; but the plain AND insns are somewhat different because there is no
2791 ;; plain 'andi' (only 'andi.'), no plain 'andis', and there are all
2792 ;; those rotate-and-mask operations. Thus, the AND insns come first.
2794 (define_insn "andsi3"
2795 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
2796 (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r")
2797 (match_operand:SI 2 "and_operand" "?r,T,K,L")))
2798 (clobber (match_scratch:CC 3 "=X,X,x,x"))]
2802 {rlinm|rlwinm} %0,%1,0,%m2,%M2
2803 {andil.|andi.} %0,%1,%b2
2804 {andiu.|andis.} %0,%1,%u2")
2806 ;; Note to set cr's other than cr0 we do the and immediate and then
2807 ;; the test again -- this avoids a mcrf which on the higher end
2808 ;; machines causes an execution serialization
2810 (define_insn "*andsi3_internal2"
2811 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2812 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2813 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2815 (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
2816 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2817 "! TARGET_POWERPC64"
2820 {andil.|andi.} %3,%1,%b2
2821 {andiu.|andis.} %3,%1,%u2
2822 {rlinm.|rlwinm.} %3,%1,0,%m2,%M2
2827 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2828 (set_attr "length" "4,4,4,4,8,8,8,8")])
2831 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2832 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
2833 (match_operand:SI 2 "and_operand" ""))
2835 (clobber (match_scratch:SI 3 ""))
2836 (clobber (match_scratch:CC 4 ""))]
2837 "! TARGET_POWERPC64 && reload_completed"
2838 [(parallel [(set (match_dup 3)
2839 (and:SI (match_dup 1)
2841 (clobber (match_dup 4))])
2843 (compare:CC (match_dup 3)
2847 (define_insn "*andsi3_internal3"
2848 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y")
2849 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
2850 (match_operand:SI 2 "and_operand" "r,K,L,T,r,K,L,T"))
2852 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
2853 (and:SI (match_dup 1)
2855 (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
2856 "! TARGET_POWERPC64"
2859 {andil.|andi.} %0,%1,%b2
2860 {andiu.|andis.} %0,%1,%u2
2861 {rlinm.|rlwinm.} %0,%1,0,%m2,%M2
2866 [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare")
2867 (set_attr "length" "4,4,4,4,8,8,8,8")])
2870 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2871 (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "")
2872 (match_operand:SI 2 "and_operand" ""))
2874 (set (match_operand:SI 0 "gpc_reg_operand" "")
2875 (and:SI (match_dup 1)
2877 (clobber (match_scratch:CC 4 ""))]
2878 "! TARGET_POWERPC64 && reload_completed"
2879 [(parallel [(set (match_dup 0)
2880 (and:SI (match_dup 1)
2882 (clobber (match_dup 4))])
2884 (compare:CC (match_dup 0)
2888 (define_expand "iorsi3"
2889 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2890 (ior:SI (match_operand:SI 1 "gpc_reg_operand" "")
2891 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
2895 if (GET_CODE (operands[2]) == CONST_INT
2896 && ! logical_operand (operands[2], SImode))
2898 HOST_WIDE_INT value = INTVAL (operands[2]);
2899 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
2900 ? operands[0] : gen_reg_rtx (SImode));
2902 emit_insn (gen_iorsi3 (tmp, operands[1],
2903 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
2904 emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
2909 (define_expand "xorsi3"
2910 [(set (match_operand:SI 0 "gpc_reg_operand" "")
2911 (xor:SI (match_operand:SI 1 "gpc_reg_operand" "")
2912 (match_operand:SI 2 "reg_or_logical_cint_operand" "")))]
2916 if (GET_CODE (operands[2]) == CONST_INT
2917 && ! logical_operand (operands[2], SImode))
2919 HOST_WIDE_INT value = INTVAL (operands[2]);
2920 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
2921 ? operands[0] : gen_reg_rtx (SImode));
2923 emit_insn (gen_xorsi3 (tmp, operands[1],
2924 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
2925 emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
2930 (define_insn "*boolsi3_internal1"
2931 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
2932 (match_operator:SI 3 "boolean_or_operator"
2933 [(match_operand:SI 1 "gpc_reg_operand" "%r,r,r")
2934 (match_operand:SI 2 "logical_operand" "r,K,L")]))]
2938 {%q3il|%q3i} %0,%1,%b2
2939 {%q3iu|%q3is} %0,%1,%u2")
2941 (define_insn "*boolsi3_internal2"
2942 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
2943 (compare:CC (match_operator:SI 4 "boolean_or_operator"
2944 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
2945 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
2947 (clobber (match_scratch:SI 3 "=r,r"))]
2948 "! TARGET_POWERPC64"
2952 [(set_attr "type" "compare")
2953 (set_attr "length" "4,8")])
2956 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
2957 (compare:CC (match_operator:SI 4 "boolean_operator"
2958 [(match_operand:SI 1 "gpc_reg_operand" "")
2959 (match_operand:SI 2 "gpc_reg_operand" "")])
2961 (clobber (match_scratch:SI 3 ""))]
2962 "! TARGET_POWERPC64 && reload_completed"
2963 [(set (match_dup 3) (match_dup 4))
2965 (compare:CC (match_dup 3)
2969 (define_insn "*boolsi3_internal3"
2970 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
2971 (compare:CC (match_operator:SI 4 "boolean_operator"
2972 [(match_operand:SI 1 "gpc_reg_operand" "%r,r")
2973 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
2975 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
2977 "! TARGET_POWERPC64"
2981 [(set_attr "type" "compare")
2982 (set_attr "length" "4,8")])
2985 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
2986 (compare:CC (match_operator:SI 4 "boolean_operator"
2987 [(match_operand:SI 1 "gpc_reg_operand" "")
2988 (match_operand:SI 2 "gpc_reg_operand" "")])
2990 (set (match_operand:SI 0 "gpc_reg_operand" "")
2992 "! TARGET_POWERPC64 && reload_completed"
2993 [(set (match_dup 0) (match_dup 4))
2995 (compare:CC (match_dup 0)
2999 ;; Split an logical operation that we can't do in one insn into two insns,
3000 ;; each of which does one 16-bit part. This is used by combine.
3003 [(set (match_operand:SI 0 "gpc_reg_operand" "")
3004 (match_operator:SI 3 "boolean_or_operator"
3005 [(match_operand:SI 1 "gpc_reg_operand" "")
3006 (match_operand:SI 2 "non_logical_cint_operand" "")]))]
3008 [(set (match_dup 0) (match_dup 4))
3009 (set (match_dup 0) (match_dup 5))]
3013 i = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff));
3014 operands[4] = gen_rtx (GET_CODE (operands[3]), SImode,
3016 i = GEN_INT (INTVAL (operands[2]) & 0xffff);
3017 operands[5] = gen_rtx (GET_CODE (operands[3]), SImode,
3021 (define_insn "*boolcsi3_internal1"
3022 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3023 (match_operator:SI 3 "boolean_operator"
3024 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3025 (match_operand:SI 2 "gpc_reg_operand" "r")]))]
3029 (define_insn "*boolcsi3_internal2"
3030 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3031 (compare:CC (match_operator:SI 4 "boolean_operator"
3032 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3033 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3035 (clobber (match_scratch:SI 3 "=r,r"))]
3036 "! TARGET_POWERPC64"
3040 [(set_attr "type" "compare")
3041 (set_attr "length" "4,8")])
3044 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3045 (compare:CC (match_operator:SI 4 "boolean_operator"
3046 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3047 (match_operand:SI 2 "gpc_reg_operand" "")])
3049 (clobber (match_scratch:SI 3 ""))]
3050 "! TARGET_POWERPC64 && reload_completed"
3051 [(set (match_dup 3) (match_dup 4))
3053 (compare:CC (match_dup 3)
3057 (define_insn "*boolcsi3_internal3"
3058 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3059 (compare:CC (match_operator:SI 4 "boolean_operator"
3060 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3061 (match_operand:SI 2 "gpc_reg_operand" "r,r")])
3063 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3065 "! TARGET_POWERPC64"
3069 [(set_attr "type" "compare")
3070 (set_attr "length" "4,8")])
3073 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3074 (compare:CC (match_operator:SI 4 "boolean_operator"
3075 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3076 (match_operand:SI 2 "gpc_reg_operand" "")])
3078 (set (match_operand:SI 0 "gpc_reg_operand" "")
3080 "! TARGET_POWERPC64 && reload_completed"
3081 [(set (match_dup 0) (match_dup 4))
3083 (compare:CC (match_dup 0)
3087 (define_insn "*boolccsi3_internal1"
3088 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3089 (match_operator:SI 3 "boolean_operator"
3090 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r"))
3091 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))]))]
3095 (define_insn "*boolccsi3_internal2"
3096 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3097 (compare:CC (match_operator:SI 4 "boolean_operator"
3098 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
3099 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3101 (clobber (match_scratch:SI 3 "=r,r"))]
3102 "! TARGET_POWERPC64"
3106 [(set_attr "type" "compare")
3107 (set_attr "length" "4,8")])
3110 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3111 (compare:CC (match_operator:SI 4 "boolean_operator"
3112 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3113 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3115 (clobber (match_scratch:SI 3 ""))]
3116 "! TARGET_POWERPC64 && reload_completed"
3117 [(set (match_dup 3) (match_dup 4))
3119 (compare:CC (match_dup 3)
3123 (define_insn "*boolccsi3_internal3"
3124 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3125 (compare:CC (match_operator:SI 4 "boolean_operator"
3126 [(not:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r"))
3127 (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
3129 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3131 "! TARGET_POWERPC64"
3135 [(set_attr "type" "compare")
3136 (set_attr "length" "4,8")])
3139 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3140 (compare:CC (match_operator:SI 4 "boolean_operator"
3141 [(not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
3142 (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
3144 (set (match_operand:SI 0 "gpc_reg_operand" "")
3146 "! TARGET_POWERPC64 && reload_completed"
3147 [(set (match_dup 0) (match_dup 4))
3149 (compare:CC (match_dup 0)
3153 ;; maskir insn. We need four forms because things might be in arbitrary
3154 ;; orders. Don't define forms that only set CR fields because these
3155 ;; would modify an input register.
3157 (define_insn "*maskir_internal1"
3158 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3159 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3160 (match_operand:SI 1 "gpc_reg_operand" "0"))
3161 (and:SI (match_dup 2)
3162 (match_operand:SI 3 "gpc_reg_operand" "r"))))]
3166 (define_insn "*maskir_internal2"
3167 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3168 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r"))
3169 (match_operand:SI 1 "gpc_reg_operand" "0"))
3170 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3175 (define_insn "*maskir_internal3"
3176 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3177 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r")
3178 (match_operand:SI 3 "gpc_reg_operand" "r"))
3179 (and:SI (not:SI (match_dup 2))
3180 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3184 (define_insn "*maskir_internal4"
3185 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3186 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3187 (match_operand:SI 2 "gpc_reg_operand" "r"))
3188 (and:SI (not:SI (match_dup 2))
3189 (match_operand:SI 1 "gpc_reg_operand" "0"))))]
3193 (define_insn "*maskir_internal5"
3194 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3196 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3197 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3198 (and:SI (match_dup 2)
3199 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
3201 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3202 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3203 (and:SI (match_dup 2) (match_dup 3))))]
3208 [(set_attr "type" "compare")
3209 (set_attr "length" "4,8")])
3212 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3214 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3215 (match_operand:SI 1 "gpc_reg_operand" ""))
3216 (and:SI (match_dup 2)
3217 (match_operand:SI 3 "gpc_reg_operand" "")))
3219 (set (match_operand:SI 0 "gpc_reg_operand" "")
3220 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3221 (and:SI (match_dup 2) (match_dup 3))))]
3222 "TARGET_POWER && reload_completed"
3224 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3225 (and:SI (match_dup 2) (match_dup 3))))
3227 (compare:CC (match_dup 0)
3231 (define_insn "*maskir_internal6"
3232 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3234 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3235 (match_operand:SI 1 "gpc_reg_operand" "0,0"))
3236 (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3239 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3240 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3241 (and:SI (match_dup 3) (match_dup 2))))]
3246 [(set_attr "type" "compare")
3247 (set_attr "length" "4,8")])
3250 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3252 (ior:SI (and:SI (not:SI (match_operand:SI 2 "gpc_reg_operand" ""))
3253 (match_operand:SI 1 "gpc_reg_operand" ""))
3254 (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3257 (set (match_operand:SI 0 "gpc_reg_operand" "")
3258 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3259 (and:SI (match_dup 3) (match_dup 2))))]
3260 "TARGET_POWER && reload_completed"
3262 (ior:SI (and:SI (not:SI (match_dup 2)) (match_dup 1))
3263 (and:SI (match_dup 3) (match_dup 2))))
3265 (compare:CC (match_dup 0)
3269 (define_insn "*maskir_internal7"
3270 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3272 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "r,r")
3273 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
3274 (and:SI (not:SI (match_dup 2))
3275 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3277 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3278 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3279 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3284 [(set_attr "type" "compare")
3285 (set_attr "length" "4,8")])
3288 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3290 (ior:SI (and:SI (match_operand:SI 2 "gpc_reg_operand" "")
3291 (match_operand:SI 3 "gpc_reg_operand" ""))
3292 (and:SI (not:SI (match_dup 2))
3293 (match_operand:SI 1 "gpc_reg_operand" "")))
3295 (set (match_operand:SI 0 "gpc_reg_operand" "")
3296 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3297 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3298 "TARGET_POWER && reload_completed"
3300 (ior:SI (and:SI (match_dup 2) (match_dup 3))
3301 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3303 (compare:CC (match_dup 0)
3307 (define_insn "*maskir_internal8"
3308 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3310 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "r,r")
3311 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
3312 (and:SI (not:SI (match_dup 2))
3313 (match_operand:SI 1 "gpc_reg_operand" "0,0")))
3315 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3316 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3317 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3322 [(set_attr "type" "compare")
3323 (set_attr "length" "4,8")])
3326 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3328 (ior:SI (and:SI (match_operand:SI 3 "gpc_reg_operand" "")
3329 (match_operand:SI 2 "gpc_reg_operand" ""))
3330 (and:SI (not:SI (match_dup 2))
3331 (match_operand:SI 1 "gpc_reg_operand" "")))
3333 (set (match_operand:SI 0 "gpc_reg_operand" "")
3334 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3335 (and:SI (not:SI (match_dup 2)) (match_dup 1))))]
3336 "TARGET_POWER && reload_completed"
3338 (ior:SI (and:SI (match_dup 3) (match_dup 2))
3339 (and:SI (not:SI (match_dup 2)) (match_dup 1))))
3341 (compare:CC (match_dup 0)
3345 ;; Rotate and shift insns, in all their variants. These support shifts,
3346 ;; field inserts and extracts, and various combinations thereof.
3347 (define_expand "insv"
3348 [(set (zero_extract (match_operand 0 "gpc_reg_operand" "")
3349 (match_operand:SI 1 "const_int_operand" "")
3350 (match_operand:SI 2 "const_int_operand" ""))
3351 (match_operand 3 "gpc_reg_operand" ""))]
3355 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3356 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3357 compiler if the address of the structure is taken later. */
3358 if (GET_CODE (operands[0]) == SUBREG
3359 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3362 if (TARGET_POWERPC64 && GET_MODE (operands[0]) == DImode)
3363 emit_insn (gen_insvdi (operands[0], operands[1], operands[2], operands[3]));
3365 emit_insn (gen_insvsi (operands[0], operands[1], operands[2], operands[3]));
3369 (define_insn "insvsi"
3370 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3371 (match_operand:SI 1 "const_int_operand" "i")
3372 (match_operand:SI 2 "const_int_operand" "i"))
3373 (match_operand:SI 3 "gpc_reg_operand" "r"))]
3377 int start = INTVAL (operands[2]) & 31;
3378 int size = INTVAL (operands[1]) & 31;
3380 operands[4] = GEN_INT (32 - start - size);
3381 operands[1] = GEN_INT (start + size - 1);
3382 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3385 (define_insn "*insvsi_internal1"
3386 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3387 (match_operand:SI 1 "const_int_operand" "i")
3388 (match_operand:SI 2 "const_int_operand" "i"))
3389 (ashift:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3390 (match_operand:SI 4 "const_int_operand" "i")))]
3391 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3394 int shift = INTVAL (operands[4]) & 31;
3395 int start = INTVAL (operands[2]) & 31;
3396 int size = INTVAL (operands[1]) & 31;
3398 operands[4] = GEN_INT (shift - start - size);
3399 operands[1] = GEN_INT (start + size - 1);
3400 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3403 (define_insn "*insvsi_internal2"
3404 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3405 (match_operand:SI 1 "const_int_operand" "i")
3406 (match_operand:SI 2 "const_int_operand" "i"))
3407 (ashiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3408 (match_operand:SI 4 "const_int_operand" "i")))]
3409 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3412 int shift = INTVAL (operands[4]) & 31;
3413 int start = INTVAL (operands[2]) & 31;
3414 int size = INTVAL (operands[1]) & 31;
3416 operands[4] = GEN_INT (32 - shift - start - size);
3417 operands[1] = GEN_INT (start + size - 1);
3418 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3421 (define_insn "*insvsi_internal3"
3422 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3423 (match_operand:SI 1 "const_int_operand" "i")
3424 (match_operand:SI 2 "const_int_operand" "i"))
3425 (lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3426 (match_operand:SI 4 "const_int_operand" "i")))]
3427 "(32 - (INTVAL (operands[4]) & 31)) >= INTVAL (operands[1])"
3430 int shift = INTVAL (operands[4]) & 31;
3431 int start = INTVAL (operands[2]) & 31;
3432 int size = INTVAL (operands[1]) & 31;
3434 operands[4] = GEN_INT (32 - shift - start - size);
3435 operands[1] = GEN_INT (start + size - 1);
3436 return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
3439 (define_insn "*insvsi_internal4"
3440 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
3441 (match_operand:SI 1 "const_int_operand" "i")
3442 (match_operand:SI 2 "const_int_operand" "i"))
3443 (zero_extract:SI (match_operand:SI 3 "gpc_reg_operand" "r")
3444 (match_operand:SI 4 "const_int_operand" "i")
3445 (match_operand:SI 5 "const_int_operand" "i")))]
3446 "INTVAL (operands[4]) >= INTVAL (operands[1])"
3449 int extract_start = INTVAL (operands[5]) & 31;
3450 int extract_size = INTVAL (operands[4]) & 31;
3451 int insert_start = INTVAL (operands[2]) & 31;
3452 int insert_size = INTVAL (operands[1]) & 31;
3454 /* Align extract field with insert field */
3455 operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
3456 operands[1] = GEN_INT (insert_start + insert_size - 1);
3457 return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
3460 (define_insn "insvdi"
3461 [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
3462 (match_operand:SI 1 "const_int_operand" "i")
3463 (match_operand:SI 2 "const_int_operand" "i"))
3464 (match_operand:DI 3 "gpc_reg_operand" "r"))]
3468 int start = INTVAL (operands[2]) & 63;
3469 int size = INTVAL (operands[1]) & 63;
3471 operands[1] = GEN_INT (64 - start - size);
3472 return \"rldimi %0,%3,%H1,%H2\";
3475 (define_expand "extzv"
3476 [(set (match_operand 0 "gpc_reg_operand" "")
3477 (zero_extract (match_operand 1 "gpc_reg_operand" "")
3478 (match_operand:SI 2 "const_int_operand" "")
3479 (match_operand:SI 3 "const_int_operand" "")))]
3483 /* Do not handle 16/8 bit structures that fit in HI/QI modes directly, since
3484 the (SUBREG:SI (REG:HI xxx)) that is otherwise generated can confuse the
3485 compiler if the address of the structure is taken later. */
3486 if (GET_CODE (operands[0]) == SUBREG
3487 && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (operands[0]))) < UNITS_PER_WORD))
3490 if (TARGET_POWERPC64 && GET_MODE (operands[1]) == DImode)
3491 emit_insn (gen_extzvdi (operands[0], operands[1], operands[2], operands[3]));
3493 emit_insn (gen_extzvsi (operands[0], operands[1], operands[2], operands[3]));
3497 (define_insn "extzvsi"
3498 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3499 (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3500 (match_operand:SI 2 "const_int_operand" "i")
3501 (match_operand:SI 3 "const_int_operand" "i")))]
3505 int start = INTVAL (operands[3]) & 31;
3506 int size = INTVAL (operands[2]) & 31;
3508 if (start + size >= 32)
3509 operands[3] = const0_rtx;
3511 operands[3] = GEN_INT (start + size);
3512 return \"{rlinm|rlwinm} %0,%1,%3,%s2,31\";
3515 (define_insn "*extzvsi_internal1"
3516 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3517 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3518 (match_operand:SI 2 "const_int_operand" "i,i")
3519 (match_operand:SI 3 "const_int_operand" "i,i"))
3521 (clobber (match_scratch:SI 4 "=r,r"))]
3522 "! TARGET_POWERPC64"
3525 int start = INTVAL (operands[3]) & 31;
3526 int size = INTVAL (operands[2]) & 31;
3528 /* Force split for non-cc0 compare. */
3529 if (which_alternative == 1)
3532 /* If the bitfield being tested fits in the upper or lower half of a
3533 word, it is possible to use andiu. or andil. to test it. This is
3534 useful because the condition register set-use delay is smaller for
3535 andi[ul]. than for rlinm. This doesn't work when the starting bit
3536 position is 0 because the LT and GT bits may be set wrong. */
3538 if ((start > 0 && start + size <= 16) || start >= 16)
3540 operands[3] = GEN_INT (((1 << (16 - (start & 15)))
3541 - (1 << (16 - (start & 15) - size))));
3543 return \"{andiu.|andis.} %4,%1,%3\";
3545 return \"{andil.|andi.} %4,%1,%3\";
3548 if (start + size >= 32)
3549 operands[3] = const0_rtx;
3551 operands[3] = GEN_INT (start + size);
3552 return \"{rlinm.|rlwinm.} %4,%1,%3,%s2,31\";
3554 [(set_attr "type" "compare")
3555 (set_attr "length" "4,8")])
3558 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3559 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3560 (match_operand:SI 2 "const_int_operand" "")
3561 (match_operand:SI 3 "const_int_operand" ""))
3563 (clobber (match_scratch:SI 4 ""))]
3564 "! TARGET_POWERPC64 && reload_completed"
3566 (zero_extract:SI (match_dup 1) (match_dup 2)
3569 (compare:CC (match_dup 4)
3573 (define_insn "*extzvsi_internal2"
3574 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3575 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3576 (match_operand:SI 2 "const_int_operand" "i,i")
3577 (match_operand:SI 3 "const_int_operand" "i,i"))
3579 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3580 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3581 "! TARGET_POWERPC64"
3584 int start = INTVAL (operands[3]) & 31;
3585 int size = INTVAL (operands[2]) & 31;
3587 /* Force split for non-cc0 compare. */
3588 if (which_alternative == 1)
3591 if (start >= 16 && start + size == 32)
3593 operands[3] = GEN_INT ((1 << (32 - start)) - 1);
3594 return \"{andil.|andi.} %0,%1,%3\";
3597 if (start + size >= 32)
3598 operands[3] = const0_rtx;
3600 operands[3] = GEN_INT (start + size);
3601 return \"{rlinm.|rlwinm.} %0,%1,%3,%s2,31\";
3603 [(set_attr "type" "delayed_compare")
3604 (set_attr "length" "4,8")])
3607 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3608 (compare:CC (zero_extract:SI (match_operand:SI 1 "gpc_reg_operand" "")
3609 (match_operand:SI 2 "const_int_operand" "")
3610 (match_operand:SI 3 "const_int_operand" ""))
3612 (set (match_operand:SI 0 "gpc_reg_operand" "")
3613 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))]
3614 "! TARGET_POWERPC64 && reload_completed"
3616 (zero_extract:SI (match_dup 1) (match_dup 2) (match_dup 3)))
3618 (compare:CC (match_dup 0)
3622 (define_insn "extzvdi"
3623 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
3624 (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3625 (match_operand:SI 2 "const_int_operand" "i")
3626 (match_operand:SI 3 "const_int_operand" "i")))]
3630 int start = INTVAL (operands[3]) & 63;
3631 int size = INTVAL (operands[2]) & 63;
3633 if (start + size >= 64)
3634 operands[3] = const0_rtx;
3636 operands[3] = GEN_INT (start + size);
3637 operands[2] = GEN_INT (64 - size);
3638 return \"rldicl %0,%1,%3,%2\";
3641 (define_insn "*extzvdi_internal1"
3642 [(set (match_operand:CC 0 "gpc_reg_operand" "=x")
3643 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3644 (match_operand:SI 2 "const_int_operand" "i")
3645 (match_operand:SI 3 "const_int_operand" "i"))
3647 (clobber (match_scratch:DI 4 "=r"))]
3651 int start = INTVAL (operands[3]) & 63;
3652 int size = INTVAL (operands[2]) & 63;
3654 if (start + size >= 64)
3655 operands[3] = const0_rtx;
3657 operands[3] = GEN_INT (start + size);
3658 operands[2] = GEN_INT (64 - size);
3659 return \"rldicl. %4,%1,%3,%2\";
3662 (define_insn "*extzvdi_internal2"
3663 [(set (match_operand:CC 4 "gpc_reg_operand" "=x")
3664 (compare:CC (zero_extract:DI (match_operand:DI 1 "gpc_reg_operand" "r")
3665 (match_operand:SI 2 "const_int_operand" "i")
3666 (match_operand:SI 3 "const_int_operand" "i"))
3668 (set (match_operand:DI 0 "gpc_reg_operand" "=r")
3669 (zero_extract:DI (match_dup 1) (match_dup 2) (match_dup 3)))]
3673 int start = INTVAL (operands[3]) & 63;
3674 int size = INTVAL (operands[2]) & 63;
3676 if (start + size >= 64)
3677 operands[3] = const0_rtx;
3679 operands[3] = GEN_INT (start + size);
3680 operands[2] = GEN_INT (64 - size);
3681 return \"rldicl. %0,%1,%3,%2\";
3684 (define_insn "rotlsi3"
3685 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3686 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3687 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
3689 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffffffff")
3691 (define_insn "*rotlsi3_internal2"
3692 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3693 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3694 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3696 (clobber (match_scratch:SI 3 "=r,r"))]
3697 "! TARGET_POWERPC64"
3699 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffffffff
3701 [(set_attr "type" "delayed_compare")
3702 (set_attr "length" "4,8")])
3705 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3706 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3707 (match_operand:SI 2 "reg_or_cint_operand" ""))
3709 (clobber (match_scratch:SI 3 ""))]
3710 "! TARGET_POWERPC64 && reload_completed"
3712 (rotate:SI (match_dup 1) (match_dup 2)))
3714 (compare:CC (match_dup 3)
3718 (define_insn "*rotlsi3_internal3"
3719 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3720 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3721 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3723 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3724 (rotate:SI (match_dup 1) (match_dup 2)))]
3725 "! TARGET_POWERPC64"
3727 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffffffff
3729 [(set_attr "type" "delayed_compare")
3730 (set_attr "length" "4,8")])
3733 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3734 (compare:CC (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3735 (match_operand:SI 2 "reg_or_cint_operand" ""))
3737 (set (match_operand:SI 0 "gpc_reg_operand" "")
3738 (rotate:SI (match_dup 1) (match_dup 2)))]
3739 "! TARGET_POWERPC64 && reload_completed"
3741 (rotate:SI (match_dup 1) (match_dup 2)))
3743 (compare:CC (match_dup 0)
3747 (define_insn "*rotlsi3_internal4"
3748 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3749 (and:SI (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3750 (match_operand:SI 2 "reg_or_cint_operand" "ri"))
3751 (match_operand:SI 3 "mask_operand" "T")))]
3753 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,%m3,%M3")
3755 (define_insn "*rotlsi3_internal5"
3756 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3758 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3759 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3760 (match_operand:SI 3 "mask_operand" "T,T"))
3762 (clobber (match_scratch:SI 4 "=r,r"))]
3763 "! TARGET_POWERPC64"
3765 {rl%I2nm.|rlw%I2nm.} %4,%1,%h2,%m3,%M3
3767 [(set_attr "type" "delayed_compare")
3768 (set_attr "length" "4,8")])
3771 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3773 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3774 (match_operand:SI 2 "reg_or_cint_operand" ""))
3775 (match_operand:SI 3 "mask_operand" ""))
3777 (clobber (match_scratch:SI 4 ""))]
3778 "! TARGET_POWERPC64 && reload_completed"
3780 (and:SI (rotate:SI (match_dup 1)
3784 (compare:CC (match_dup 4)
3788 (define_insn "*rotlsi3_internal6"
3789 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
3791 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3792 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
3793 (match_operand:SI 3 "mask_operand" "T,T"))
3795 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3796 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
3797 "! TARGET_POWERPC64"
3799 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,%m3,%M3
3801 [(set_attr "type" "delayed_compare")
3802 (set_attr "length" "4,8")])
3805 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
3807 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3808 (match_operand:SI 2 "reg_or_cint_operand" ""))
3809 (match_operand:SI 3 "mask_operand" ""))
3811 (set (match_operand:SI 0 "gpc_reg_operand" "")
3812 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
3813 "! TARGET_POWERPC64 && reload_completed"
3815 (and:SI (rotate:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
3817 (compare:CC (match_dup 0)
3821 (define_insn "*rotlsi3_internal7"
3822 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3825 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3826 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
3828 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xff")
3830 (define_insn "*rotlsi3_internal8"
3831 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3832 (compare:CC (zero_extend:SI
3834 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3835 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3837 (clobber (match_scratch:SI 3 "=r,r"))]
3840 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xff
3842 [(set_attr "type" "delayed_compare")
3843 (set_attr "length" "4,8")])
3846 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3847 (compare:CC (zero_extend:SI
3849 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3850 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3852 (clobber (match_scratch:SI 3 ""))]
3855 (zero_extend:SI (subreg:QI
3856 (rotate:SI (match_dup 1)
3859 (compare:CC (match_dup 3)
3863 (define_insn "*rotlsi3_internal9"
3864 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3865 (compare:CC (zero_extend:SI
3867 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3868 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3870 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3871 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3874 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xff
3876 [(set_attr "type" "delayed_compare")
3877 (set_attr "length" "4,8")])
3880 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3881 (compare:CC (zero_extend:SI
3883 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3884 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3886 (set (match_operand:SI 0 "gpc_reg_operand" "")
3887 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3890 (zero_extend:SI (subreg:QI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
3892 (compare:CC (match_dup 0)
3896 (define_insn "*rotlsi3_internal10"
3897 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
3900 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r")
3901 (match_operand:SI 2 "reg_or_cint_operand" "ri")) 0)))]
3903 "{rl%I2nm|rlw%I2nm} %0,%1,%h2,0xffff")
3905 (define_insn "*rotlsi3_internal11"
3906 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
3907 (compare:CC (zero_extend:SI
3909 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3910 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3912 (clobber (match_scratch:SI 3 "=r,r"))]
3915 {rl%I2nm.|rlw%I2nm.} %3,%1,%h2,0xffff
3917 [(set_attr "type" "delayed_compare")
3918 (set_attr "length" "4,8")])
3921 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
3922 (compare:CC (zero_extend:SI
3924 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3925 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3927 (clobber (match_scratch:SI 3 ""))]
3930 (zero_extend:SI (subreg:HI
3931 (rotate:SI (match_dup 1)
3934 (compare:CC (match_dup 3)
3938 (define_insn "*rotlsi3_internal12"
3939 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
3940 (compare:CC (zero_extend:SI
3942 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3943 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri")) 0))
3945 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3946 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3949 {rl%I2nm.|rlw%I2nm.} %0,%1,%h2,0xffff
3951 [(set_attr "type" "delayed_compare")
3952 (set_attr "length" "4,8")])
3955 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
3956 (compare:CC (zero_extend:SI
3958 (rotate:SI (match_operand:SI 1 "gpc_reg_operand" "")
3959 (match_operand:SI 2 "reg_or_cint_operand" "")) 0))
3961 (set (match_operand:SI 0 "gpc_reg_operand" "")
3962 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))]
3965 (zero_extend:SI (subreg:HI (rotate:SI (match_dup 1) (match_dup 2)) 0)))
3967 (compare:CC (match_dup 0)
3971 ;; Note that we use "sle." instead of "sl." so that we can set
3972 ;; SHIFT_COUNT_TRUNCATED.
3974 (define_expand "ashlsi3"
3975 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
3976 (use (match_operand:SI 1 "gpc_reg_operand" ""))
3977 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
3982 emit_insn (gen_ashlsi3_power (operands[0], operands[1], operands[2]));
3984 emit_insn (gen_ashlsi3_no_power (operands[0], operands[1], operands[2]));
3988 (define_insn "ashlsi3_power"
3989 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
3990 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
3991 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
3992 (clobber (match_scratch:SI 3 "=q,X"))]
3996 {sli|slwi} %0,%1,%h2")
3998 (define_insn "ashlsi3_no_power"
3999 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4000 (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4001 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4003 "{sl|slw}%I2 %0,%1,%h2")
4006 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4007 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4008 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4010 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4011 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4015 {sli.|slwi.} %3,%1,%h2
4018 [(set_attr "type" "delayed_compare")
4019 (set_attr "length" "4,4,8,8")])
4022 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4023 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4024 (match_operand:SI 2 "reg_or_cint_operand" ""))
4026 (clobber (match_scratch:SI 3 ""))
4027 (clobber (match_scratch:SI 4 ""))]
4028 "TARGET_POWER && reload_completed"
4029 [(parallel [(set (match_dup 3)
4030 (ashift:SI (match_dup 1) (match_dup 2)))
4031 (clobber (match_dup 4))])
4033 (compare:CC (match_dup 3)
4038 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4039 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4040 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4042 (clobber (match_scratch:SI 3 "=r,r"))]
4043 "! TARGET_POWER && ! TARGET_POWERPC64"
4045 {sl|slw}%I2. %3,%1,%h2
4047 [(set_attr "type" "delayed_compare")
4048 (set_attr "length" "4,8")])
4051 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4052 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4053 (match_operand:SI 2 "reg_or_cint_operand" ""))
4055 (clobber (match_scratch:SI 3 ""))]
4056 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4058 (ashift:SI (match_dup 1) (match_dup 2)))
4060 (compare:CC (match_dup 3)
4065 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4066 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4067 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4069 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4070 (ashift:SI (match_dup 1) (match_dup 2)))
4071 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4075 {sli.|slwi.} %0,%1,%h2
4078 [(set_attr "type" "delayed_compare")
4079 (set_attr "length" "4,4,8,8")])
4082 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4083 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4084 (match_operand:SI 2 "reg_or_cint_operand" ""))
4086 (set (match_operand:SI 0 "gpc_reg_operand" "")
4087 (ashift:SI (match_dup 1) (match_dup 2)))
4088 (clobber (match_scratch:SI 4 ""))]
4089 "TARGET_POWER && reload_completed"
4090 [(parallel [(set (match_dup 0)
4091 (ashift:SI (match_dup 1) (match_dup 2)))
4092 (clobber (match_dup 4))])
4094 (compare:CC (match_dup 0)
4099 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4100 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4101 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4103 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4104 (ashift:SI (match_dup 1) (match_dup 2)))]
4105 "! TARGET_POWER && ! TARGET_POWERPC64"
4107 {sl|slw}%I2. %0,%1,%h2
4109 [(set_attr "type" "delayed_compare")
4110 (set_attr "length" "4,8")])
4113 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4114 (compare:CC (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4115 (match_operand:SI 2 "reg_or_cint_operand" ""))
4117 (set (match_operand:SI 0 "gpc_reg_operand" "")
4118 (ashift:SI (match_dup 1) (match_dup 2)))]
4119 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4121 (ashift:SI (match_dup 1) (match_dup 2)))
4123 (compare:CC (match_dup 0)
4128 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4129 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4130 (match_operand:SI 2 "const_int_operand" "i"))
4131 (match_operand:SI 3 "mask_operand" "T")))]
4132 "includes_lshift_p (operands[2], operands[3])"
4133 "{rlinm|rlwinm} %0,%1,%h2,%m3,%M3")
4136 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4138 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4139 (match_operand:SI 2 "const_int_operand" "i,i"))
4140 (match_operand:SI 3 "mask_operand" "T,T"))
4142 (clobber (match_scratch:SI 4 "=r,r"))]
4143 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
4145 {rlinm.|rlwinm.} %4,%1,%h2,%m3,%M3
4147 [(set_attr "type" "delayed_compare")
4148 (set_attr "length" "4,8")])
4151 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4153 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4154 (match_operand:SI 2 "const_int_operand" ""))
4155 (match_operand:SI 3 "mask_operand" ""))
4157 (clobber (match_scratch:SI 4 ""))]
4158 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3]) && reload_completed"
4160 (and:SI (ashift:SI (match_dup 1) (match_dup 2))
4163 (compare:CC (match_dup 4)
4168 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4170 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4171 (match_operand:SI 2 "const_int_operand" "i,i"))
4172 (match_operand:SI 3 "mask_operand" "T,T"))
4174 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4175 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4176 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3])"
4178 {rlinm.|rlwinm.} %0,%1,%h2,%m3,%M3
4180 [(set_attr "type" "delayed_compare")
4181 (set_attr "length" "4,8")])
4184 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4186 (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "")
4187 (match_operand:SI 2 "const_int_operand" ""))
4188 (match_operand:SI 3 "mask_operand" ""))
4190 (set (match_operand:SI 0 "gpc_reg_operand" "")
4191 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4192 "! TARGET_POWERPC64 && includes_lshift_p (operands[2], operands[3]) && reload_completed"
4194 (and:SI (ashift:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4196 (compare:CC (match_dup 0)
4200 ;; The AIX assembler mis-handles "sri x,x,0", so write that case as
4202 (define_expand "lshrsi3"
4203 [(use (match_operand:SI 0 "gpc_reg_operand" ""))
4204 (use (match_operand:SI 1 "gpc_reg_operand" ""))
4205 (use (match_operand:SI 2 "reg_or_cint_operand" ""))]
4210 emit_insn (gen_lshrsi3_power (operands[0], operands[1], operands[2]));
4212 emit_insn (gen_lshrsi3_no_power (operands[0], operands[1], operands[2]));
4216 (define_insn "lshrsi3_power"
4217 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
4218 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r")
4219 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i")))
4220 (clobber (match_scratch:SI 3 "=q,X,X"))]
4225 {s%A2i|s%A2wi} %0,%1,%h2")
4227 (define_insn "lshrsi3_no_power"
4228 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4229 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4230 (match_operand:SI 2 "reg_or_cint_operand" "O,ri")))]
4234 {sr|srw}%I2 %0,%1,%h2")
4237 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4238 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4239 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4241 (clobber (match_scratch:SI 3 "=r,X,r,r,X,r"))
4242 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4247 {s%A2i.|s%A2wi.} %3,%1,%h2
4251 [(set_attr "type" "delayed_compare")
4252 (set_attr "length" "4,4,4,8,8,8")])
4255 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4256 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4257 (match_operand:SI 2 "reg_or_cint_operand" ""))
4259 (clobber (match_scratch:SI 3 ""))
4260 (clobber (match_scratch:SI 4 ""))]
4261 "TARGET_POWER && reload_completed"
4262 [(parallel [(set (match_dup 3)
4263 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4264 (clobber (match_dup 4))])
4266 (compare:CC (match_dup 3)
4271 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4272 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4273 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4275 (clobber (match_scratch:SI 3 "=X,r,X,r"))]
4276 "! TARGET_POWER && ! TARGET_POWERPC64"
4279 {sr|srw}%I2. %3,%1,%h2
4282 [(set_attr "type" "delayed_compare")
4283 (set_attr "length" "4,4,8,8")])
4286 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4287 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4288 (match_operand:SI 2 "reg_or_cint_operand" ""))
4290 (clobber (match_scratch:SI 3 ""))]
4291 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4293 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4295 (compare:CC (match_dup 3)
4300 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,?y,?y,?y")
4301 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r,r,r")
4302 (match_operand:SI 2 "reg_or_cint_operand" "r,O,i,r,O,i"))
4304 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r")
4305 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4306 (clobber (match_scratch:SI 4 "=q,X,X,q,X,X"))]
4311 {s%A2i.|s%A2wi.} %0,%1,%h2
4315 [(set_attr "type" "delayed_compare")
4316 (set_attr "length" "4,4,4,8,8,8")])
4319 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4320 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4321 (match_operand:SI 2 "reg_or_cint_operand" ""))
4323 (set (match_operand:SI 0 "gpc_reg_operand" "")
4324 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4325 (clobber (match_scratch:SI 4 ""))]
4326 "TARGET_POWER && reload_completed"
4327 [(parallel [(set (match_dup 0)
4328 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4329 (clobber (match_dup 4))])
4331 (compare:CC (match_dup 0)
4336 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4337 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4338 (match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
4340 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4341 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4342 "! TARGET_POWER && ! TARGET_POWERPC64"
4345 {sr|srw}%I2. %0,%1,%h2
4348 [(set_attr "type" "delayed_compare")
4349 (set_attr "length" "4,4,8,8")])
4352 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4353 (compare:CC (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4354 (match_operand:SI 2 "reg_or_cint_operand" ""))
4356 (set (match_operand:SI 0 "gpc_reg_operand" "")
4357 (lshiftrt:SI (match_dup 1) (match_dup 2)))]
4358 "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
4360 (lshiftrt:SI (match_dup 1) (match_dup 2)))
4362 (compare:CC (match_dup 0)
4367 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4368 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4369 (match_operand:SI 2 "const_int_operand" "i"))
4370 (match_operand:SI 3 "mask_operand" "T")))]
4371 "includes_rshift_p (operands[2], operands[3])"
4372 "{rlinm|rlwinm} %0,%1,%s2,%m3,%M3")
4375 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4377 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4378 (match_operand:SI 2 "const_int_operand" "i,i"))
4379 (match_operand:SI 3 "mask_operand" "T,T"))
4381 (clobber (match_scratch:SI 4 "=r,r"))]
4382 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
4384 {rlinm.|rlwinm.} %4,%1,%s2,%m3,%M3
4386 [(set_attr "type" "delayed_compare")
4387 (set_attr "length" "4,8")])
4390 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4392 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4393 (match_operand:SI 2 "const_int_operand" ""))
4394 (match_operand:SI 3 "mask_operand" ""))
4396 (clobber (match_scratch:SI 4 ""))]
4397 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3]) && reload_completed"
4399 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2))
4402 (compare:CC (match_dup 4)
4407 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
4409 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4410 (match_operand:SI 2 "const_int_operand" "i,i"))
4411 (match_operand:SI 3 "mask_operand" "T,T"))
4413 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4414 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4415 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3])"
4417 {rlinm.|rlwinm.} %0,%1,%s2,%m3,%M3
4419 [(set_attr "type" "delayed_compare")
4420 (set_attr "length" "4,8")])
4423 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
4425 (and:SI (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4426 (match_operand:SI 2 "const_int_operand" ""))
4427 (match_operand:SI 3 "mask_operand" ""))
4429 (set (match_operand:SI 0 "gpc_reg_operand" "")
4430 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))]
4431 "! TARGET_POWERPC64 && includes_rshift_p (operands[2], operands[3]) && reload_completed"
4433 (and:SI (lshiftrt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
4435 (compare:CC (match_dup 0)
4440 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4443 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4444 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4445 "includes_rshift_p (operands[2], GEN_INT (255))"
4446 "{rlinm|rlwinm} %0,%1,%s2,0xff")
4449 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4453 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4454 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4456 (clobber (match_scratch:SI 3 "=r,r"))]
4457 "includes_rshift_p (operands[2], GEN_INT (255))"
4459 {rlinm.|rlwinm.} %3,%1,%s2,0xff
4461 [(set_attr "type" "delayed_compare")
4462 (set_attr "length" "4,8")])
4465 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4469 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4470 (match_operand:SI 2 "const_int_operand" "")) 0))
4472 (clobber (match_scratch:SI 3 ""))]
4473 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4475 (zero_extend:SI (subreg:QI
4476 (lshiftrt:SI (match_dup 1)
4479 (compare:CC (match_dup 3)
4484 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4488 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4489 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4491 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4492 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4493 "includes_rshift_p (operands[2], GEN_INT (255))"
4495 {rlinm.|rlwinm.} %0,%1,%s2,0xff
4497 [(set_attr "type" "delayed_compare")
4498 (set_attr "length" "4,8")])
4501 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4505 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4506 (match_operand:SI 2 "const_int_operand" "")) 0))
4508 (set (match_operand:SI 0 "gpc_reg_operand" "")
4509 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4510 "includes_rshift_p (operands[2], GEN_INT (255)) && reload_completed"
4512 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4514 (compare:CC (match_dup 0)
4519 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4522 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4523 (match_operand:SI 2 "const_int_operand" "i")) 0)))]
4524 "includes_rshift_p (operands[2], GEN_INT (65535))"
4525 "{rlinm|rlwinm} %0,%1,%s2,0xffff")
4528 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4532 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4533 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4535 (clobber (match_scratch:SI 3 "=r,r"))]
4536 "includes_rshift_p (operands[2], GEN_INT (65535))"
4538 {rlinm.|rlwinm.} %3,%1,%s2,0xffff
4540 [(set_attr "type" "delayed_compare")
4541 (set_attr "length" "4,8")])
4544 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4548 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4549 (match_operand:SI 2 "const_int_operand" "")) 0))
4551 (clobber (match_scratch:SI 3 ""))]
4552 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4554 (zero_extend:SI (subreg:HI
4555 (lshiftrt:SI (match_dup 1)
4558 (compare:CC (match_dup 3)
4563 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4567 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4568 (match_operand:SI 2 "const_int_operand" "i,i")) 0))
4570 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4571 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4572 "includes_rshift_p (operands[2], GEN_INT (65535))"
4574 {rlinm.|rlwinm.} %0,%1,%s2,0xffff
4576 [(set_attr "type" "delayed_compare")
4577 (set_attr "length" "4,8")])
4580 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4584 (lshiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4585 (match_operand:SI 2 "const_int_operand" "")) 0))
4587 (set (match_operand:SI 0 "gpc_reg_operand" "")
4588 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))]
4589 "includes_rshift_p (operands[2], GEN_INT (65535)) && reload_completed"
4591 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup 1) (match_dup 2)) 0)))
4593 (compare:CC (match_dup 0)
4598 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4600 (match_operand:SI 1 "gpc_reg_operand" "r"))
4601 (ashiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4607 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4609 (match_operand:SI 1 "gpc_reg_operand" "r"))
4610 (lshiftrt:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4616 [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
4618 (match_operand:SI 1 "gpc_reg_operand" "r"))
4619 (zero_extract:SI (match_operand:SI 2 "gpc_reg_operand" "r")
4625 (define_expand "ashrsi3"
4626 [(set (match_operand:SI 0 "gpc_reg_operand" "")
4627 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4628 (match_operand:SI 2 "reg_or_cint_operand" "")))]
4633 emit_insn (gen_ashrsi3_power (operands[0], operands[1], operands[2]));
4635 emit_insn (gen_ashrsi3_no_power (operands[0], operands[1], operands[2]));
4639 (define_insn "ashrsi3_power"
4640 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4641 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4642 (match_operand:SI 2 "reg_or_cint_operand" "r,i")))
4643 (clobber (match_scratch:SI 3 "=q,X"))]
4647 {srai|srawi} %0,%1,%h2")
4649 (define_insn "ashrsi3_no_power"
4650 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
4651 (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
4652 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
4654 "{sra|sraw}%I2 %0,%1,%h2")
4657 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
4658 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4659 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4661 (clobber (match_scratch:SI 3 "=r,r,r,r"))
4662 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4666 {srai.|srawi.} %3,%1,%h2
4669 [(set_attr "type" "delayed_compare")
4670 (set_attr "length" "4,4,8,8")])
4673 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4674 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4675 (match_operand:SI 2 "reg_or_cint_operand" ""))
4677 (clobber (match_scratch:SI 3 ""))
4678 (clobber (match_scratch:SI 4 ""))]
4679 "TARGET_POWER && reload_completed"
4680 [(parallel [(set (match_dup 3)
4681 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4682 (clobber (match_dup 4))])
4684 (compare:CC (match_dup 3)
4689 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
4690 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4691 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4693 (clobber (match_scratch:SI 3 "=r,r"))]
4696 {sra|sraw}%I2. %3,%1,%h2
4698 [(set_attr "type" "delayed_compare")
4699 (set_attr "length" "4,8")])
4702 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
4703 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4704 (match_operand:SI 2 "reg_or_cint_operand" ""))
4706 (clobber (match_scratch:SI 3 ""))]
4707 "! TARGET_POWER && reload_completed"
4709 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4711 (compare:CC (match_dup 3)
4716 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
4717 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
4718 (match_operand:SI 2 "reg_or_cint_operand" "r,i,r,i"))
4720 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
4721 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4722 (clobber (match_scratch:SI 4 "=q,X,q,X"))]
4726 {srai.|srawi.} %0,%1,%h2
4729 [(set_attr "type" "delayed_compare")
4730 (set_attr "length" "4,4,8,8")])
4733 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4734 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4735 (match_operand:SI 2 "reg_or_cint_operand" ""))
4737 (set (match_operand:SI 0 "gpc_reg_operand" "")
4738 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4739 (clobber (match_scratch:SI 4 ""))]
4740 "TARGET_POWER && reload_completed"
4741 [(parallel [(set (match_dup 0)
4742 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4743 (clobber (match_dup 4))])
4745 (compare:CC (match_dup 0)
4750 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
4751 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
4752 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
4754 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
4755 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
4758 {sra|sraw}%I2. %0,%1,%h2
4760 [(set_attr "type" "delayed_compare")
4761 (set_attr "length" "4,8")])
4764 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
4765 (compare:CC (ashiftrt:SI (match_operand:SI 1 "gpc_reg_operand" "")
4766 (match_operand:SI 2 "reg_or_cint_operand" ""))
4768 (set (match_operand:SI 0 "gpc_reg_operand" "")
4769 (ashiftrt:SI (match_dup 1) (match_dup 2)))]
4770 "! TARGET_POWER && reload_completed"
4772 (ashiftrt:SI (match_dup 1) (match_dup 2)))
4774 (compare:CC (match_dup 0)
4778 ;; Floating-point insns, excluding normal data motion.
4780 ;; PowerPC has a full set of single-precision floating point instructions.
4782 ;; For the POWER architecture, we pretend that we have both SFmode and
4783 ;; DFmode insns, while, in fact, all fp insns are actually done in double.
4784 ;; The only conversions we will do will be when storing to memory. In that
4785 ;; case, we will use the "frsp" instruction before storing.
4787 ;; Note that when we store into a single-precision memory location, we need to
4788 ;; use the frsp insn first. If the register being stored isn't dead, we
4789 ;; need a scratch register for the frsp. But this is difficult when the store
4790 ;; is done by reload. It is not incorrect to do the frsp on the register in
4791 ;; this case, we just lose precision that we would have otherwise gotten but
4792 ;; is not guaranteed. Perhaps this should be tightened up at some point.
4794 (define_insn "extendsfdf2"
4795 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
4796 (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4800 if (REGNO (operands[0]) == REGNO (operands[1]))
4803 return \"fmr %0,%1\";
4805 [(set_attr "type" "fp")])
4807 (define_insn "truncdfsf2"
4808 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4809 (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "f")))]
4812 [(set_attr "type" "fp")])
4814 (define_insn "aux_truncdfsf2"
4815 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4816 (unspec:SF [(match_operand:SF 1 "gpc_reg_operand" "f")] 0))]
4817 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4819 [(set_attr "type" "fp")])
4821 (define_insn "negsf2"
4822 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4823 (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4826 [(set_attr "type" "fp")])
4828 (define_insn "abssf2"
4829 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4830 (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
4833 [(set_attr "type" "fp")])
4836 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4837 (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "f"))))]
4840 [(set_attr "type" "fp")])
4842 (define_expand "addsf3"
4843 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4844 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "")
4845 (match_operand:SF 2 "gpc_reg_operand" "")))]
4850 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4851 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4852 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4853 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4855 [(set_attr "type" "fp")])
4858 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4859 (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4860 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4861 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4862 "{fa|fadd} %0,%1,%2"
4863 [(set_attr "type" "fp")])
4865 (define_expand "subsf3"
4866 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4867 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "")
4868 (match_operand:SF 2 "gpc_reg_operand" "")))]
4873 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4874 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4875 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4876 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4878 [(set_attr "type" "fp")])
4881 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4882 (minus:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4883 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4884 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4885 "{fs|fsub} %0,%1,%2"
4886 [(set_attr "type" "fp")])
4888 (define_expand "mulsf3"
4889 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4890 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "")
4891 (match_operand:SF 2 "gpc_reg_operand" "")))]
4896 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4897 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4898 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4899 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4901 [(set_attr "type" "fp")])
4904 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4905 (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4906 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4907 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4908 "{fm|fmul} %0,%1,%2"
4909 [(set_attr "type" "dmul")])
4911 (define_expand "divsf3"
4912 [(set (match_operand:SF 0 "gpc_reg_operand" "")
4913 (div:SF (match_operand:SF 1 "gpc_reg_operand" "")
4914 (match_operand:SF 2 "gpc_reg_operand" "")))]
4919 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4920 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4921 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4922 "TARGET_POWERPC && TARGET_HARD_FLOAT"
4924 [(set_attr "type" "sdiv")])
4927 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4928 (div:SF (match_operand:SF 1 "gpc_reg_operand" "f")
4929 (match_operand:SF 2 "gpc_reg_operand" "f")))]
4930 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
4931 "{fd|fdiv} %0,%1,%2"
4932 [(set_attr "type" "ddiv")])
4935 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4936 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4937 (match_operand:SF 2 "gpc_reg_operand" "f"))
4938 (match_operand:SF 3 "gpc_reg_operand" "f")))]
4939 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4940 "fmadds %0,%1,%2,%3"
4941 [(set_attr "type" "fp")])
4944 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4945 (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4946 (match_operand:SF 2 "gpc_reg_operand" "f"))
4947 (match_operand:SF 3 "gpc_reg_operand" "f")))]
4948 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4949 "{fma|fmadd} %0,%1,%2,%3"
4950 [(set_attr "type" "dmul")])
4953 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4954 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4955 (match_operand:SF 2 "gpc_reg_operand" "f"))
4956 (match_operand:SF 3 "gpc_reg_operand" "f")))]
4957 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4958 "fmsubs %0,%1,%2,%3"
4959 [(set_attr "type" "fp")])
4962 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4963 (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4964 (match_operand:SF 2 "gpc_reg_operand" "f"))
4965 (match_operand:SF 3 "gpc_reg_operand" "f")))]
4966 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4967 "{fms|fmsub} %0,%1,%2,%3"
4968 [(set_attr "type" "dmul")])
4971 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4972 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4973 (match_operand:SF 2 "gpc_reg_operand" "f"))
4974 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
4975 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4976 "fnmadds %0,%1,%2,%3"
4977 [(set_attr "type" "fp")])
4980 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4981 (neg:SF (plus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4982 (match_operand:SF 2 "gpc_reg_operand" "f"))
4983 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
4984 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4985 "{fnma|fnmadd} %0,%1,%2,%3"
4986 [(set_attr "type" "dmul")])
4989 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4990 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
4991 (match_operand:SF 2 "gpc_reg_operand" "f"))
4992 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
4993 "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
4994 "fnmsubs %0,%1,%2,%3"
4995 [(set_attr "type" "fp")])
4998 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
4999 (neg:SF (minus:SF (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
5000 (match_operand:SF 2 "gpc_reg_operand" "f"))
5001 (match_operand:SF 3 "gpc_reg_operand" "f"))))]
5002 "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5003 "{fnms|fnmsub} %0,%1,%2,%3"
5004 [(set_attr "type" "dmul")])
5006 (define_expand "sqrtsf2"
5007 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5008 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "")))]
5009 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
5013 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5014 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5015 "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT"
5017 [(set_attr "type" "ssqrt")])
5020 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5021 (sqrt:SF (match_operand:SF 1 "gpc_reg_operand" "f")))]
5022 "TARGET_POWER2 && TARGET_HARD_FLOAT"
5024 [(set_attr "type" "dsqrt")])
5026 ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
5027 ;; fsel instruction and some auxiliary computations. Then we just have a
5028 ;; single DEFINE_INSN for fsel and the define_splits to make them if made by
5030 (define_expand "maxsf3"
5031 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5032 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5033 (match_operand:SF 2 "gpc_reg_operand" ""))
5036 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5037 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5039 (define_expand "minsf3"
5040 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5041 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "")
5042 (match_operand:SF 2 "gpc_reg_operand" ""))
5045 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5046 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5049 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5050 (match_operator:SF 3 "min_max_operator"
5051 [(match_operand:SF 1 "gpc_reg_operand" "")
5052 (match_operand:SF 2 "gpc_reg_operand" "")]))]
5053 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5056 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5057 operands[1], operands[2]);
5061 (define_expand "movsfcc"
5062 [(set (match_operand:SF 0 "gpc_reg_operand" "")
5063 (if_then_else:SF (match_operand 1 "comparison_operator" "")
5064 (match_operand:SF 2 "gpc_reg_operand" "")
5065 (match_operand:SF 3 "gpc_reg_operand" "")))]
5066 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5069 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5075 (define_insn "*fselsfsf4"
5076 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5077 (if_then_else:SF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5078 (match_operand:SF 4 "zero_fp_constant" "F"))
5079 (match_operand:SF 2 "gpc_reg_operand" "f")
5080 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5081 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5083 [(set_attr "type" "fp")])
5085 (define_insn "*fseldfsf4"
5086 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
5087 (if_then_else:SF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5088 (match_operand:DF 4 "zero_fp_constant" "F"))
5089 (match_operand:SF 2 "gpc_reg_operand" "f")
5090 (match_operand:SF 3 "gpc_reg_operand" "f")))]
5091 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5093 [(set_attr "type" "fp")])
5095 (define_insn "negdf2"
5096 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5097 (neg:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5100 [(set_attr "type" "fp")])
5102 (define_insn "absdf2"
5103 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5104 (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5107 [(set_attr "type" "fp")])
5110 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5111 (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "f"))))]
5114 [(set_attr "type" "fp")])
5116 (define_insn "adddf3"
5117 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5118 (plus:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5119 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5121 "{fa|fadd} %0,%1,%2"
5122 [(set_attr "type" "fp")])
5124 (define_insn "subdf3"
5125 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5126 (minus:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5127 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5129 "{fs|fsub} %0,%1,%2"
5130 [(set_attr "type" "fp")])
5132 (define_insn "muldf3"
5133 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5134 (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5135 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5137 "{fm|fmul} %0,%1,%2"
5138 [(set_attr "type" "dmul")])
5140 (define_insn "divdf3"
5141 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5142 (div:DF (match_operand:DF 1 "gpc_reg_operand" "f")
5143 (match_operand:DF 2 "gpc_reg_operand" "f")))]
5145 "{fd|fdiv} %0,%1,%2"
5146 [(set_attr "type" "ddiv")])
5149 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5150 (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5151 (match_operand:DF 2 "gpc_reg_operand" "f"))
5152 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5153 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5154 "{fma|fmadd} %0,%1,%2,%3"
5155 [(set_attr "type" "dmul")])
5158 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5159 (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5160 (match_operand:DF 2 "gpc_reg_operand" "f"))
5161 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5162 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5163 "{fms|fmsub} %0,%1,%2,%3"
5164 [(set_attr "type" "dmul")])
5167 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5168 (neg:DF (plus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5169 (match_operand:DF 2 "gpc_reg_operand" "f"))
5170 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5171 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5172 "{fnma|fnmadd} %0,%1,%2,%3"
5173 [(set_attr "type" "dmul")])
5176 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5177 (neg:DF (minus:DF (mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
5178 (match_operand:DF 2 "gpc_reg_operand" "f"))
5179 (match_operand:DF 3 "gpc_reg_operand" "f"))))]
5180 "TARGET_HARD_FLOAT && TARGET_FUSED_MADD"
5181 "{fnms|fnmsub} %0,%1,%2,%3"
5182 [(set_attr "type" "dmul")])
5184 (define_insn "sqrtdf2"
5185 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5186 (sqrt:DF (match_operand:DF 1 "gpc_reg_operand" "f")))]
5187 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
5189 [(set_attr "type" "dsqrt")])
5191 ;; The conditional move instructions allow us to perform max and min
5192 ;; operations even when
5194 (define_expand "maxdf3"
5195 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5196 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5197 (match_operand:DF 2 "gpc_reg_operand" ""))
5200 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5201 "{ rs6000_emit_minmax (operands[0], SMAX, operands[1], operands[2]); DONE;}")
5203 (define_expand "mindf3"
5204 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5205 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "")
5206 (match_operand:DF 2 "gpc_reg_operand" ""))
5209 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5210 "{ rs6000_emit_minmax (operands[0], SMIN, operands[1], operands[2]); DONE;}")
5213 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5214 (match_operator:DF 3 "min_max_operator"
5215 [(match_operand:DF 1 "gpc_reg_operand" "")
5216 (match_operand:DF 2 "gpc_reg_operand" "")]))]
5217 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5220 { rs6000_emit_minmax (operands[0], GET_CODE (operands[3]),
5221 operands[1], operands[2]);
5225 (define_expand "movdfcc"
5226 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5227 (if_then_else:DF (match_operand 1 "comparison_operator" "")
5228 (match_operand:DF 2 "gpc_reg_operand" "")
5229 (match_operand:DF 3 "gpc_reg_operand" "")))]
5230 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5233 if (rs6000_emit_cmove (operands[0], operands[1], operands[2], operands[3]))
5239 (define_insn "*fseldfdf4"
5240 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5241 (if_then_else:DF (ge (match_operand:DF 1 "gpc_reg_operand" "f")
5242 (match_operand:DF 4 "zero_fp_constant" "F"))
5243 (match_operand:DF 2 "gpc_reg_operand" "f")
5244 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5245 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
5247 [(set_attr "type" "fp")])
5249 (define_insn "*fselsfdf4"
5250 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5251 (if_then_else:DF (ge (match_operand:SF 1 "gpc_reg_operand" "f")
5252 (match_operand:SF 4 "zero_fp_constant" "F"))
5253 (match_operand:DF 2 "gpc_reg_operand" "f")
5254 (match_operand:DF 3 "gpc_reg_operand" "f")))]
5257 [(set_attr "type" "fp")])
5259 ;; Conversions to and from floating-point.
5261 ; For each of these conversions, there is a define_expand, a define_insn
5262 ; with a '#' template, and a define_split (with C code). The idea is
5263 ; to allow constant folding with the template of the define_insn,
5264 ; then to have the insns split later (between sched1 and final).
5266 (define_expand "floatsidf2"
5267 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5268 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5271 (clobber (match_dup 4))
5272 (clobber (match_dup 5))
5273 (clobber (match_dup 6))])]
5274 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5277 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5278 operands[3] = force_reg (DFmode, rs6000_float_const (\"4503601774854144\", DFmode));
5279 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5280 operands[5] = gen_reg_rtx (DFmode);
5281 operands[6] = gen_reg_rtx (SImode);
5284 (define_insn "*floatsidf2_internal"
5285 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5286 (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5287 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5288 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5289 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5290 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))
5291 (clobber (match_operand:SI 6 "gpc_reg_operand" "=r"))]
5292 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5294 [(set_attr "length" "24")])
5297 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5298 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5299 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5300 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5301 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5302 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5303 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5304 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5305 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5306 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5307 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5308 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5309 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5310 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))
5311 (clobber (match_operand:SI 6 "gpc_reg_operand" ""))]
5314 rtx lowword, highword;
5315 if (GET_CODE (operands[4]) != MEM)
5317 highword = XEXP (operands[4], 0);
5318 lowword = plus_constant (highword, 4);
5319 if (! WORDS_BIG_ENDIAN)
5322 tmp = highword; highword = lowword; lowword = tmp;
5325 emit_insn (gen_xorsi3 (operands[6], operands[1],
5326 GEN_INT (~ (HOST_WIDE_INT) 0x7fffffff)));
5327 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[6]);
5328 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5329 emit_move_insn (operands[5], operands[4]);
5330 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5334 (define_expand "floatunssidf2"
5335 [(parallel [(set (match_operand:DF 0 "gpc_reg_operand" "")
5336 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5339 (clobber (match_dup 4))
5340 (clobber (match_dup 5))])]
5341 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5344 operands[2] = force_reg (SImode, GEN_INT (0x43300000));
5345 operands[3] = force_reg (DFmode, rs6000_float_const (\"4503599627370496\", DFmode));
5346 operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
5347 operands[5] = gen_reg_rtx (DFmode);
5350 (define_insn "*floatunssidf2_internal"
5351 [(set (match_operand:DF 0 "gpc_reg_operand" "=&f")
5352 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))
5353 (use (match_operand:SI 2 "gpc_reg_operand" "r"))
5354 (use (match_operand:DF 3 "gpc_reg_operand" "f"))
5355 (clobber (match_operand:DF 4 "memory_operand" "=o"))
5356 (clobber (match_operand:DF 5 "gpc_reg_operand" "=f"))]
5357 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5359 [(set_attr "length" "20")])
5362 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5363 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5364 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5365 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5366 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5367 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5368 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5369 [(set (match_operand:DF 0 "gpc_reg_operand" "")
5370 (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
5371 (use (match_operand:SI 2 "gpc_reg_operand" ""))
5372 (use (match_operand:DF 3 "gpc_reg_operand" ""))
5373 (clobber (match_operand:DF 4 "offsettable_mem_operand" ""))
5374 (clobber (match_operand:DF 5 "gpc_reg_operand" ""))]
5377 rtx lowword, highword;
5378 if (GET_CODE (operands[4]) != MEM)
5380 highword = XEXP (operands[4], 0);
5381 lowword = plus_constant (highword, 4);
5382 if (! WORDS_BIG_ENDIAN)
5385 tmp = highword; highword = lowword; lowword = tmp;
5388 emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[1]);
5389 emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]);
5390 emit_move_insn (operands[5], operands[4]);
5391 emit_insn (gen_subdf3 (operands[0], operands[5], operands[3]));
5395 (define_expand "fix_truncdfsi2"
5396 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
5397 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5398 (clobber (match_dup 2))
5399 (clobber (match_dup 3))])]
5400 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5403 operands[2] = gen_reg_rtx (DImode);
5404 operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
5407 (define_insn "*fix_truncdfsi2_internal"
5408 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5409 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f")))
5410 (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))
5411 (clobber (match_operand:DI 3 "memory_operand" "=o"))]
5412 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5414 [(set_attr "length" "16")])
5417 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5418 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5419 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5420 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5421 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5422 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5423 (fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
5424 (clobber (match_operand:DI 2 "gpc_reg_operand" ""))
5425 (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))]
5429 if (GET_CODE (operands[3]) != MEM)
5431 lowword = XEXP (operands[3], 0);
5432 if (WORDS_BIG_ENDIAN)
5433 lowword = plus_constant (lowword, 4);
5435 emit_insn (gen_fctiwz (operands[2], operands[1]));
5436 emit_move_insn (operands[3], operands[2]);
5437 emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword));
5441 ; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] 10))
5442 ; rather than (set (subreg:SI (reg)) (fix:SI ...))
5443 ; because the first makes it clear that operand 0 is not live
5444 ; before the instruction.
5445 (define_insn "fctiwz"
5446 [(set (match_operand:DI 0 "gpc_reg_operand" "=f")
5447 (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] 10))]
5448 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
5449 "{fcirz|fctiwz} %0,%1"
5450 [(set_attr "type" "fp")])
5452 (define_insn "floatdidf2"
5453 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
5454 (float:DF (match_operand:DI 1 "gpc_reg_operand" "f")))]
5455 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5457 [(set_attr "type" "fp")])
5459 (define_insn "fix_truncdfdi2"
5460 [(set (match_operand:DI 0 "gpc_reg_operand" "=f")
5461 (fix:DI (match_operand:DF 1 "gpc_reg_operand" "f")))]
5462 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
5464 [(set_attr "type" "fp")])
5466 ;; Define the DImode operations that can be done in a small number
5467 ;; of instructions. The & constraints are to prevent the register
5468 ;; allocator from allocating registers that overlap with the inputs
5469 ;; (for example, having an input in 7,8 and an output in 6,7). We
5470 ;; also allow for the output being the same as one of the inputs.
5472 (define_insn "*adddi3_noppc64"
5473 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r")
5474 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,0,0")
5475 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")))]
5476 "! TARGET_POWERPC64"
5479 if (WORDS_BIG_ENDIAN)
5480 return (GET_CODE (operands[2])) != CONST_INT
5481 ? \"{a|addc} %L0,%L1,%L2\;{ae|adde} %0,%1,%2\"
5482 : \"{ai|addic} %L0,%L1,%2\;{a%G2e|add%G2e} %0,%1\";
5484 return (GET_CODE (operands[2])) != CONST_INT
5485 ? \"{a|addc} %0,%1,%2\;{ae|adde} %L0,%L1,%L2\"
5486 : \"{ai|addic} %0,%1,%2\;{a%G2e|add%G2e} %L0,%L1\";
5488 [(set_attr "length" "8")])
5490 (define_insn "*subdi3_noppc64"
5491 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,&r,r,r,r")
5492 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I,0,r,I")
5493 (match_operand:DI 2 "gpc_reg_operand" "r,r,r,0,0")))]
5494 "! TARGET_POWERPC64"
5497 if (WORDS_BIG_ENDIAN)
5498 return (GET_CODE (operands[1]) != CONST_INT)
5499 ? \"{sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %0,%2,%1\"
5500 : \"{sfi|subfic} %L0,%L2,%1\;{sf%G1e|subf%G1e} %0,%2\";
5502 return (GET_CODE (operands[1]) != CONST_INT)
5503 ? \"{sf|subfc} %0,%2,%1\;{sfe|subfe} %L0,%L2,%L1\"
5504 : \"{sfi|subfic} %0,%2,%1\;{sf%G1e|subf%G1e} %L0,%L2\";
5506 [(set_attr "length" "8")])
5508 (define_insn "*negdi2_noppc64"
5509 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
5510 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))]
5511 "! TARGET_POWERPC64"
5514 return (WORDS_BIG_ENDIAN)
5515 ? \"{sfi|subfic} %L0,%L1,0\;{sfze|subfze} %0,%1\"
5516 : \"{sfi|subfic} %0,%1,0\;{sfze|subfze} %L0,%L1\";
5518 [(set_attr "length" "8")])
5520 (define_expand "mulsidi3"
5521 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5522 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5523 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5524 "! TARGET_POWERPC64"
5527 if (! TARGET_POWER && ! TARGET_POWERPC)
5529 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
5530 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
5531 emit_insn (gen_mull_call ());
5532 if (WORDS_BIG_ENDIAN)
5533 emit_move_insn (operands[0], gen_rtx_REG (DImode, 3));
5536 emit_move_insn (operand_subword (operands[0], 0, 0, DImode),
5537 gen_rtx_REG (SImode, 3));
5538 emit_move_insn (operand_subword (operands[0], 1, 0, DImode),
5539 gen_rtx_REG (SImode, 4));
5543 else if (TARGET_POWER)
5545 emit_insn (gen_mulsidi3_mq (operands[0], operands[1], operands[2]));
5550 (define_insn "mulsidi3_mq"
5551 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
5552 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5553 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
5554 (clobber (match_scratch:SI 3 "=q"))]
5556 "mul %0,%1,%2\;mfmq %L0"
5557 [(set_attr "type" "imul")
5558 (set_attr "length" "8")])
5560 (define_insn "*mulsidi3_no_mq"
5561 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5562 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5563 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
5564 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
5567 return (WORDS_BIG_ENDIAN)
5568 ? \"mulhw %0,%1,%2\;mullw %L0,%1,%2\"
5569 : \"mulhw %L0,%1,%2\;mullw %0,%1,%2\";
5571 [(set_attr "type" "imul")
5572 (set_attr "length" "8")])
5575 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5576 (mult:DI (sign_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5577 (sign_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5578 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
5581 (lshiftrt:DI (mult:DI (sign_extend:DI (match_dup 1))
5582 (sign_extend:DI (match_dup 2)))
5585 (mult:SI (match_dup 1)
5589 int endian = (WORDS_BIG_ENDIAN == 0);
5590 operands[3] = operand_subword (operands[0], endian, 0, DImode);
5591 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
5594 (define_expand "umulsidi3"
5595 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5596 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5597 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5598 "TARGET_POWERPC && ! TARGET_POWERPC64"
5603 emit_insn (gen_umulsidi3_mq (operands[0], operands[1], operands[2]));
5608 (define_insn "umulsidi3_mq"
5609 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5610 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5611 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))
5612 (clobber (match_scratch:SI 3 "=q"))]
5613 "TARGET_POWERPC && TARGET_POWER"
5616 return (WORDS_BIG_ENDIAN)
5617 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
5618 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
5620 [(set_attr "type" "imul")
5621 (set_attr "length" "8")])
5623 (define_insn "*umulsidi3_no_mq"
5624 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
5625 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" "%r"))
5626 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" "r"))))]
5627 "TARGET_POWERPC && ! TARGET_POWER && ! TARGET_POWERPC64"
5630 return (WORDS_BIG_ENDIAN)
5631 ? \"mulhwu %0,%1,%2\;mullw %L0,%1,%2\"
5632 : \"mulhwu %L0,%1,%2\;mullw %0,%1,%2\";
5634 [(set_attr "type" "imul")
5635 (set_attr "length" "8")])
5638 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5639 (mult:DI (zero_extend:DI (match_operand:SI 1 "gpc_reg_operand" ""))
5640 (zero_extend:DI (match_operand:SI 2 "gpc_reg_operand" ""))))]
5641 "TARGET_POWERPC && ! TARGET_POWERPC64 && reload_completed"
5644 (lshiftrt:DI (mult:DI (zero_extend:DI (match_dup 1))
5645 (zero_extend:DI (match_dup 2)))
5648 (mult:SI (match_dup 1)
5652 int endian = (WORDS_BIG_ENDIAN == 0);
5653 operands[3] = operand_subword (operands[0], endian, 0, DImode);
5654 operands[4] = operand_subword (operands[0], 1 - endian, 0, DImode);
5657 (define_expand "smulsi3_highpart"
5658 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5660 (lshiftrt:DI (mult:DI (sign_extend:DI
5661 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5663 (match_operand:SI 2 "gpc_reg_operand" "r")))
5668 if (! TARGET_POWER && ! TARGET_POWERPC)
5670 emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]);
5671 emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]);
5672 emit_insn (gen_mulh_call ());
5673 emit_move_insn (operands[0], gen_rtx_REG (SImode, 3));
5676 else if (TARGET_POWER)
5678 emit_insn (gen_smulsi3_highpart_mq (operands[0], operands[1], operands[2]));
5683 (define_insn "smulsi3_highpart_mq"
5684 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5686 (lshiftrt:DI (mult:DI (sign_extend:DI
5687 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5689 (match_operand:SI 2 "gpc_reg_operand" "r")))
5691 (clobber (match_scratch:SI 3 "=q"))]
5694 [(set_attr "type" "imul")])
5696 (define_insn "*smulsi3_highpart_no_mq"
5697 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5699 (lshiftrt:DI (mult:DI (sign_extend:DI
5700 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5702 (match_operand:SI 2 "gpc_reg_operand" "r")))
5704 "TARGET_POWERPC && ! TARGET_POWER"
5706 [(set_attr "type" "imul")])
5708 (define_expand "umulsi3_highpart"
5709 [(set (match_operand:SI 0 "gpc_reg_operand" "")
5711 (lshiftrt:DI (mult:DI (zero_extend:DI
5712 (match_operand:SI 1 "gpc_reg_operand" ""))
5714 (match_operand:SI 2 "gpc_reg_operand" "")))
5721 emit_insn (gen_umulsi3_highpart_mq (operands[0], operands[1], operands[2]));
5726 (define_insn "umulsi3_highpart_mq"
5727 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5729 (lshiftrt:DI (mult:DI (zero_extend:DI
5730 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5732 (match_operand:SI 2 "gpc_reg_operand" "r")))
5734 (clobber (match_scratch:SI 3 "=q"))]
5735 "TARGET_POWERPC && TARGET_POWER"
5737 [(set_attr "type" "imul")])
5739 (define_insn "*umulsi3_highpart_no_mq"
5740 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
5742 (lshiftrt:DI (mult:DI (zero_extend:DI
5743 (match_operand:SI 1 "gpc_reg_operand" "%r"))
5745 (match_operand:SI 2 "gpc_reg_operand" "r")))
5747 "TARGET_POWERPC && ! TARGET_POWER"
5749 [(set_attr "type" "imul")])
5751 ;; If operands 0 and 2 are in the same register, we have a problem. But
5752 ;; operands 0 and 1 (the usual case) can be in the same register. That's
5753 ;; why we have the strange constraints below.
5754 (define_insn "ashldi3_power"
5755 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
5756 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
5757 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
5758 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
5761 {sli|slwi} %0,%L1,%h2\;{cal %L0,0(0)|li %L0,0}
5762 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
5763 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2
5764 sl%I2q %L0,%L1,%h2\;sll%I2q %0,%1,%h2"
5765 [(set_attr "length" "8")])
5767 (define_insn "lshrdi3_power"
5768 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,&r")
5769 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,0,r")
5770 (match_operand:SI 2 "reg_or_cint_operand" "M,i,r,r")))
5771 (clobber (match_scratch:SI 3 "=X,q,q,q"))]
5774 {s%A2i|s%A2wi} %L0,%1,%h2\;{cal %0,0(0)|li %0,0}
5775 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
5776 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2
5777 sr%I2q %0,%1,%h2\;srl%I2q %L0,%L1,%h2"
5778 [(set_attr "length" "8")])
5780 ;; Shift by a variable amount is too complex to be worth open-coding. We
5781 ;; just handle shifts by constants.
5782 (define_insn "ashrdi3_power"
5783 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
5784 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
5785 (match_operand:SI 2 "const_int_operand" "M,i")))
5786 (clobber (match_scratch:SI 3 "=X,q"))]
5789 {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2
5790 sraiq %0,%1,%h2\;srliq %L0,%L1,%h2"
5791 [(set_attr "length" "8")])
5793 ;; PowerPC64 DImode operations.
5795 (define_expand "adddi3"
5796 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5797 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
5798 (match_operand:DI 2 "reg_or_add_cint64_operand" "")))]
5802 if (! TARGET_POWERPC64)
5804 if (non_short_cint_operand (operands[2], DImode))
5808 if (GET_CODE (operands[2]) == CONST_INT
5809 && ! add_operand (operands[2], DImode))
5811 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
5812 ? operands[0] : gen_reg_rtx (DImode));
5814 HOST_WIDE_INT val = INTVAL (operands[2]);
5815 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
5816 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
5818 if (!CONST_OK_FOR_LETTER_P (rest, 'L'))
5821 /* The ordering here is important for the prolog expander.
5822 When space is allocated from the stack, adding 'low' first may
5823 produce a temporary deallocation (which would be bad). */
5824 emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest)));
5825 emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low)));
5830 ;; Discourage ai/addic because of carry but provide it in an alternative
5831 ;; allowing register zero as source.
5833 (define_insn "*adddi3_internal1"
5834 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r")
5835 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b")
5836 (match_operand:DI 2 "add_operand" "r,I,I,L")))]
5844 (define_insn "*adddi3_internal2"
5845 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
5846 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
5847 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
5849 (clobber (match_scratch:DI 3 "=r,r,r,r"))]
5856 [(set_attr "type" "compare")
5857 (set_attr "length" "4,4,8,8")])
5860 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
5861 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
5862 (match_operand:DI 2 "reg_or_short_operand" ""))
5864 (clobber (match_scratch:DI 3 ""))]
5865 "TARGET_POWERPC64 && reload_completed"
5867 (plus:DI (match_dup 1) (match_dup 2)))
5869 (compare:CC (match_dup 3)
5873 (define_insn "*adddi3_internal3"
5874 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
5875 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
5876 (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I"))
5878 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
5879 (plus:DI (match_dup 1) (match_dup 2)))]
5886 [(set_attr "type" "compare")
5887 (set_attr "length" "4,4,8,8")])
5890 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
5891 (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
5892 (match_operand:DI 2 "reg_or_short_operand" ""))
5894 (set (match_operand:DI 0 "gpc_reg_operand" "")
5895 (plus:DI (match_dup 1) (match_dup 2)))]
5896 "TARGET_POWERPC64 && reload_completed"
5898 (plus:DI (match_dup 1) (match_dup 2)))
5900 (compare:CC (match_dup 0)
5904 ;; Split an add that we can't do in one insn into two insns, each of which
5905 ;; does one 16-bit part. This is used by combine. Note that the low-order
5906 ;; add should be last in case the result gets used in an address.
5909 [(set (match_operand:DI 0 "gpc_reg_operand" "")
5910 (plus:DI (match_operand:DI 1 "gpc_reg_operand" "")
5911 (match_operand:DI 2 "non_add_cint_operand" "")))]
5913 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
5914 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
5917 HOST_WIDE_INT val = INTVAL (operands[2]);
5918 HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000;
5919 HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode);
5921 operands[4] = GEN_INT (low);
5922 if (CONST_OK_FOR_LETTER_P (rest, 'L'))
5923 operands[3] = GEN_INT (rest);
5924 else if (! no_new_pseudos)
5926 operands[3] = gen_reg_rtx (DImode);
5927 emit_move_insn (operands[3], operands[2]);
5928 emit_insn (gen_adddi3 (operands[0], operands[1], operands[3]));
5935 (define_insn "one_cmpldi2"
5936 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
5937 (not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
5942 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
5943 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
5945 (clobber (match_scratch:DI 2 "=r,r"))]
5950 [(set_attr "type" "compare")
5951 (set_attr "length" "4,8")])
5954 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
5955 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
5957 (clobber (match_scratch:DI 2 ""))]
5958 "TARGET_POWERPC64 && reload_completed"
5960 (not:DI (match_dup 1)))
5962 (compare:CC (match_dup 2)
5967 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
5968 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
5970 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
5971 (not:DI (match_dup 1)))]
5976 [(set_attr "type" "compare")
5977 (set_attr "length" "4,8")])
5980 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
5981 (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
5983 (set (match_operand:DI 0 "gpc_reg_operand" "")
5984 (not:DI (match_dup 1)))]
5985 "TARGET_POWERPC64 && reload_completed"
5987 (not:DI (match_dup 1)))
5989 (compare:CC (match_dup 0)
5994 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
5995 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I")
5996 (match_operand:DI 2 "gpc_reg_operand" "r,r")))]
6003 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6004 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6005 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6007 (clobber (match_scratch:DI 3 "=r,r"))]
6012 [(set_attr "type" "compare")
6013 (set_attr "length" "4,8")])
6016 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6017 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6018 (match_operand:DI 2 "gpc_reg_operand" ""))
6020 (clobber (match_scratch:DI 3 ""))]
6021 "TARGET_POWERPC64 && reload_completed"
6023 (minus:DI (match_dup 1) (match_dup 2)))
6025 (compare:CC (match_dup 3)
6030 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6031 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6032 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
6034 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6035 (minus:DI (match_dup 1) (match_dup 2)))]
6040 [(set_attr "type" "compare")
6041 (set_attr "length" "4,8")])
6044 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6045 (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "")
6046 (match_operand:DI 2 "gpc_reg_operand" ""))
6048 (set (match_operand:DI 0 "gpc_reg_operand" "")
6049 (minus:DI (match_dup 1) (match_dup 2)))]
6050 "TARGET_POWERPC64 && reload_completed"
6052 (minus:DI (match_dup 1) (match_dup 2)))
6054 (compare:CC (match_dup 0)
6058 (define_expand "subdi3"
6059 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6060 (minus:DI (match_operand:DI 1 "reg_or_short_operand" "")
6061 (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))]
6065 if (GET_CODE (operands[2]) == CONST_INT)
6067 emit_insn (gen_adddi3 (operands[0], operands[1],
6068 negate_rtx (DImode, operands[2])));
6073 (define_insn "absdi2"
6074 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6075 (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0")))
6076 (clobber (match_scratch:DI 2 "=&r,&r"))]
6078 "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%2,%0"
6079 [(set_attr "length" "12")])
6082 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6083 (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
6084 (clobber (match_scratch:DI 2 ""))]
6085 "TARGET_POWERPC64 && reload_completed"
6086 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6087 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6088 (set (match_dup 0) (minus:DI (match_dup 0) (match_dup 2)))]
6091 (define_insn "*nabsdi2"
6092 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r")
6093 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,0"))))
6094 (clobber (match_scratch:DI 2 "=&r,&r"))]
6096 "sradi %2,%1,63\;xor %0,%2,%1\;subf %0,%0,%2"
6097 [(set_attr "length" "12")])
6100 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6101 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" ""))))
6102 (clobber (match_scratch:DI 2 ""))]
6103 "TARGET_POWERPC64 && reload_completed"
6104 [(set (match_dup 2) (ashiftrt:DI (match_dup 1) (const_int 63)))
6105 (set (match_dup 0) (xor:DI (match_dup 2) (match_dup 1)))
6106 (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))]
6109 (define_expand "negdi2"
6110 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6111 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))]
6116 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6117 (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6122 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6123 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6125 (clobber (match_scratch:DI 2 "=r,r"))]
6130 [(set_attr "type" "compare")
6131 (set_attr "length" "4,8")])
6134 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6135 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6137 (clobber (match_scratch:DI 2 ""))]
6138 "TARGET_POWERPC64 && reload_completed"
6140 (neg:DI (match_dup 1)))
6142 (compare:CC (match_dup 2)
6147 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
6148 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
6150 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6151 (neg:DI (match_dup 1)))]
6156 [(set_attr "type" "compare")
6157 (set_attr "length" "4,8")])
6160 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
6161 (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" ""))
6163 (set (match_operand:DI 0 "gpc_reg_operand" "")
6164 (neg:DI (match_dup 1)))]
6165 "TARGET_POWERPC64 && reload_completed"
6167 (neg:DI (match_dup 1)))
6169 (compare:CC (match_dup 0)
6173 (define_insn "ffsdi2"
6174 [(set (match_operand:DI 0 "gpc_reg_operand" "=&r")
6175 (ffs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))]
6177 "neg %0,%1\;and %0,%0,%1\;cntlzd %0,%0\;subfic %0,%0,64"
6178 [(set_attr "length" "16")])
6180 (define_insn "muldi3"
6181 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6182 (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r")
6183 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6186 [(set_attr "type" "lmul")])
6188 (define_insn "smuldi3_highpart"
6189 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6191 (lshiftrt:TI (mult:TI (sign_extend:TI
6192 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6194 (match_operand:DI 2 "gpc_reg_operand" "r")))
6198 [(set_attr "type" "lmul")])
6200 (define_insn "umuldi3_highpart"
6201 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6203 (lshiftrt:TI (mult:TI (zero_extend:TI
6204 (match_operand:DI 1 "gpc_reg_operand" "%r"))
6206 (match_operand:DI 2 "gpc_reg_operand" "r")))
6210 [(set_attr "type" "lmul")])
6212 (define_expand "divdi3"
6213 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6214 (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6215 (match_operand:DI 2 "reg_or_cint_operand" "")))]
6219 if (GET_CODE (operands[2]) == CONST_INT
6220 && INTVAL (operands[2]) > 0
6221 && exact_log2 (INTVAL (operands[2])) >= 0)
6224 operands[2] = force_reg (DImode, operands[2]);
6227 (define_expand "moddi3"
6228 [(use (match_operand:DI 0 "gpc_reg_operand" ""))
6229 (use (match_operand:DI 1 "gpc_reg_operand" ""))
6230 (use (match_operand:DI 2 "reg_or_cint_operand" ""))]
6238 if (GET_CODE (operands[2]) != CONST_INT
6239 || INTVAL (operands[2]) <= 0
6240 || (i = exact_log2 (INTVAL (operands[2]))) < 0)
6243 temp1 = gen_reg_rtx (DImode);
6244 temp2 = gen_reg_rtx (DImode);
6246 emit_insn (gen_divdi3 (temp1, operands[1], operands[2]));
6247 emit_insn (gen_ashldi3 (temp2, temp1, GEN_INT (i)));
6248 emit_insn (gen_subdi3 (operands[0], operands[1], temp2));
6253 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6254 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6255 (match_operand:DI 2 "exact_log2_cint_operand" "N")))]
6257 "sradi %0,%1,%p2\;addze %0,%0"
6258 [(set_attr "length" "8")])
6261 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6262 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6263 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6265 (clobber (match_scratch:DI 3 "=r,r"))]
6268 sradi %3,%1,%p2\;addze. %3,%3
6270 [(set_attr "type" "compare")
6271 (set_attr "length" "8,12")])
6274 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6275 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6276 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6278 (clobber (match_scratch:DI 3 ""))]
6279 "TARGET_POWERPC64 && reload_completed"
6281 (div:DI (match_dup 1) (match_dup 2)))
6283 (compare:CC (match_dup 3)
6288 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6289 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6290 (match_operand:DI 2 "exact_log2_cint_operand" "N,N"))
6292 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6293 (div:DI (match_dup 1) (match_dup 2)))]
6296 sradi %0,%1,%p2\;addze. %0,%0
6298 [(set_attr "type" "compare")
6299 (set_attr "length" "8,12")])
6302 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6303 (compare:CC (div:DI (match_operand:DI 1 "gpc_reg_operand" "")
6304 (match_operand:DI 2 "exact_log2_cint_operand" ""))
6306 (set (match_operand:DI 0 "gpc_reg_operand" "")
6307 (div:DI (match_dup 1) (match_dup 2)))]
6308 "TARGET_POWERPC64 && reload_completed"
6310 (div:DI (match_dup 1) (match_dup 2)))
6312 (compare:CC (match_dup 0)
6317 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6318 (div:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6319 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6322 [(set_attr "type" "ldiv")])
6324 (define_insn "udivdi3"
6325 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6326 (udiv:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6327 (match_operand:DI 2 "gpc_reg_operand" "r")))]
6330 [(set_attr "type" "ldiv")])
6332 (define_insn "rotldi3"
6333 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6334 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6335 (match_operand:DI 2 "reg_or_cint_operand" "ri")))]
6337 "rld%I2cl %0,%1,%H2,0")
6339 (define_insn "*rotldi3_internal2"
6340 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6341 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6342 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6344 (clobber (match_scratch:DI 3 "=r,r"))]
6347 rld%I2cl. %3,%1,%H2,0
6349 [(set_attr "type" "delayed_compare")
6350 (set_attr "length" "4,8")])
6353 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6354 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6355 (match_operand:DI 2 "reg_or_cint_operand" ""))
6357 (clobber (match_scratch:DI 3 ""))]
6358 "TARGET_POWERPC64 && reload_completed"
6360 (rotate:DI (match_dup 1) (match_dup 2)))
6362 (compare:CC (match_dup 3)
6366 (define_insn "*rotldi3_internal3"
6367 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6368 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6369 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6371 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6372 (rotate:DI (match_dup 1) (match_dup 2)))]
6375 rld%I2cl. %0,%1,%H2,0
6377 [(set_attr "type" "delayed_compare")
6378 (set_attr "length" "4,8")])
6381 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6382 (compare:CC (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6383 (match_operand:DI 2 "reg_or_cint_operand" ""))
6385 (set (match_operand:DI 0 "gpc_reg_operand" "")
6386 (rotate:DI (match_dup 1) (match_dup 2)))]
6387 "TARGET_POWERPC64 && reload_completed"
6389 (rotate:DI (match_dup 1) (match_dup 2)))
6391 (compare:CC (match_dup 0)
6395 (define_insn "*rotldi3_internal4"
6396 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6397 (and:DI (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6398 (match_operand:DI 2 "reg_or_cint_operand" "ri"))
6399 (match_operand:DI 3 "mask64_operand" "S")))]
6401 "rld%I2c%B3 %0,%1,%H2,%S3")
6403 (define_insn "*rotldi3_internal5"
6404 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6406 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6407 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6408 (match_operand:DI 3 "mask64_operand" "S,S"))
6410 (clobber (match_scratch:DI 4 "=r,r"))]
6413 rld%I2c%B3. %4,%1,%H2,%S3
6415 [(set_attr "type" "delayed_compare")
6416 (set_attr "length" "4,8")])
6419 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6421 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6422 (match_operand:DI 2 "reg_or_cint_operand" ""))
6423 (match_operand:DI 3 "mask64_operand" ""))
6425 (clobber (match_scratch:DI 4 ""))]
6426 "TARGET_POWERPC64 && reload_completed"
6428 (and:DI (rotate:DI (match_dup 1)
6432 (compare:CC (match_dup 4)
6436 (define_insn "*rotldi3_internal6"
6437 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6439 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6440 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri"))
6441 (match_operand:DI 3 "mask64_operand" "S,S"))
6443 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6444 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6447 rld%I2c%B3. %0,%1,%H2,%S3
6449 [(set_attr "type" "delayed_compare")
6450 (set_attr "length" "4,8")])
6453 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6455 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6456 (match_operand:DI 2 "reg_or_cint_operand" ""))
6457 (match_operand:DI 3 "mask64_operand" ""))
6459 (set (match_operand:DI 0 "gpc_reg_operand" "")
6460 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6461 "TARGET_POWERPC64 && reload_completed"
6463 (and:DI (rotate:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
6465 (compare:CC (match_dup 0)
6469 (define_insn "*rotldi3_internal7"
6470 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6473 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6474 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6476 "rld%I2cl %0,%1,%H2,56")
6478 (define_insn "*rotldi3_internal8"
6479 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6480 (compare:CC (zero_extend:DI
6482 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6483 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6485 (clobber (match_scratch:DI 3 "=r,r"))]
6488 rld%I2cl. %3,%1,%H2,56
6490 [(set_attr "type" "delayed_compare")
6491 (set_attr "length" "4,8")])
6494 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6495 (compare:CC (zero_extend:DI
6497 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6498 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6500 (clobber (match_scratch:DI 3 ""))]
6501 "TARGET_POWERPC64 && reload_completed"
6503 (zero_extend:DI (subreg:QI
6504 (rotate:DI (match_dup 1)
6507 (compare:CC (match_dup 3)
6511 (define_insn "*rotldi3_internal9"
6512 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6513 (compare:CC (zero_extend:DI
6515 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6516 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6518 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6519 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6522 rld%I2cl. %0,%1,%H2,56
6524 [(set_attr "type" "delayed_compare")
6525 (set_attr "length" "4,8")])
6528 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6529 (compare:CC (zero_extend:DI
6531 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6532 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6534 (set (match_operand:DI 0 "gpc_reg_operand" "")
6535 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6536 "TARGET_POWERPC64 && reload_completed"
6538 (zero_extend:DI (subreg:QI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6540 (compare:CC (match_dup 0)
6544 (define_insn "*rotldi3_internal10"
6545 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6548 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6549 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6551 "rld%I2cl %0,%1,%H2,48")
6553 (define_insn "*rotldi3_internal11"
6554 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6555 (compare:CC (zero_extend:DI
6557 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6558 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6560 (clobber (match_scratch:DI 3 "=r,r"))]
6563 rld%I2cl. %3,%1,%H2,48
6565 [(set_attr "type" "delayed_compare")
6566 (set_attr "length" "4,8")])
6569 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6570 (compare:CC (zero_extend:DI
6572 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6573 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6575 (clobber (match_scratch:DI 3 ""))]
6576 "TARGET_POWERPC64 && reload_completed"
6578 (zero_extend:DI (subreg:HI
6579 (rotate:DI (match_dup 1)
6582 (compare:CC (match_dup 3)
6586 (define_insn "*rotldi3_internal12"
6587 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6588 (compare:CC (zero_extend:DI
6590 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6591 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6593 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6594 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6597 rld%I2cl. %0,%1,%H2,48
6599 [(set_attr "type" "delayed_compare")
6600 (set_attr "length" "4,8")])
6603 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6604 (compare:CC (zero_extend:DI
6606 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6607 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6609 (set (match_operand:DI 0 "gpc_reg_operand" "")
6610 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6611 "TARGET_POWERPC64 && reload_completed"
6613 (zero_extend:DI (subreg:HI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6615 (compare:CC (match_dup 0)
6619 (define_insn "*rotldi3_internal13"
6620 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6623 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6624 (match_operand:DI 2 "reg_or_cint_operand" "ri")) 0)))]
6626 "rld%I2cl %0,%1,%H2,32")
6628 (define_insn "*rotldi3_internal14"
6629 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6630 (compare:CC (zero_extend:DI
6632 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6633 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6635 (clobber (match_scratch:DI 3 "=r,r"))]
6638 rld%I2cl. %3,%1,%H2,32
6640 [(set_attr "type" "delayed_compare")
6641 (set_attr "length" "4,8")])
6644 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6645 (compare:CC (zero_extend:DI
6647 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6648 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6650 (clobber (match_scratch:DI 3 ""))]
6651 "TARGET_POWERPC64 && reload_completed"
6653 (zero_extend:DI (subreg:SI
6654 (rotate:DI (match_dup 1)
6657 (compare:CC (match_dup 3)
6661 (define_insn "*rotldi3_internal15"
6662 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6663 (compare:CC (zero_extend:DI
6665 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6666 (match_operand:DI 2 "reg_or_cint_operand" "ri,ri")) 0))
6668 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6669 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6672 rld%I2cl. %0,%1,%H2,32
6674 [(set_attr "type" "delayed_compare")
6675 (set_attr "length" "4,8")])
6678 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6679 (compare:CC (zero_extend:DI
6681 (rotate:DI (match_operand:DI 1 "gpc_reg_operand" "")
6682 (match_operand:DI 2 "reg_or_cint_operand" "")) 0))
6684 (set (match_operand:DI 0 "gpc_reg_operand" "")
6685 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))]
6686 "TARGET_POWERPC64 && reload_completed"
6688 (zero_extend:DI (subreg:SI (rotate:DI (match_dup 1) (match_dup 2)) 0)))
6690 (compare:CC (match_dup 0)
6694 (define_expand "ashldi3"
6695 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6696 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6697 (match_operand:SI 2 "reg_or_cint_operand" "")))]
6698 "TARGET_POWERPC64 || TARGET_POWER"
6701 if (TARGET_POWERPC64)
6703 else if (TARGET_POWER)
6705 emit_insn (gen_ashldi3_power (operands[0], operands[1], operands[2]));
6712 (define_insn "*ashldi3_internal1"
6713 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6714 (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6715 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
6718 [(set_attr "length" "8")])
6720 (define_insn "*ashldi3_internal2"
6721 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6722 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6723 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6725 (clobber (match_scratch:DI 3 "=r,r"))]
6730 [(set_attr "type" "delayed_compare")
6731 (set_attr "length" "4,8")])
6734 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6735 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6736 (match_operand:SI 2 "reg_or_cint_operand" ""))
6738 (clobber (match_scratch:DI 3 ""))]
6739 "TARGET_POWERPC64 && reload_completed"
6741 (ashift:DI (match_dup 1) (match_dup 2)))
6743 (compare:CC (match_dup 3)
6747 (define_insn "*ashldi3_internal3"
6748 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6749 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6750 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6752 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6753 (ashift:DI (match_dup 1) (match_dup 2)))]
6758 [(set_attr "type" "delayed_compare")
6759 (set_attr "length" "4,8")])
6762 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6763 (compare:CC (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6764 (match_operand:SI 2 "reg_or_cint_operand" ""))
6766 (set (match_operand:DI 0 "gpc_reg_operand" "")
6767 (ashift:DI (match_dup 1) (match_dup 2)))]
6768 "TARGET_POWERPC64 && reload_completed"
6770 (ashift:DI (match_dup 1) (match_dup 2)))
6772 (compare:CC (match_dup 0)
6776 (define_insn "*ashldi3_internal4"
6777 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6778 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6779 (match_operand:SI 2 "const_int_operand" "i"))
6780 (match_operand:DI 3 "const_int_operand" "n")))]
6781 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6782 "rldic %0,%1,%H2,%W3")
6784 (define_insn "ashldi3_internal5"
6785 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6787 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6788 (match_operand:SI 2 "const_int_operand" "i,i"))
6789 (match_operand:DI 3 "const_int_operand" "n,n"))
6791 (clobber (match_scratch:DI 4 "=r,r"))]
6792 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6794 rldic. %4,%1,%H2,%W3
6796 [(set_attr "type" "delayed_compare")
6797 (set_attr "length" "4,8")])
6800 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6802 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6803 (match_operand:SI 2 "const_int_operand" ""))
6804 (match_operand:DI 3 "const_int_operand" ""))
6806 (clobber (match_scratch:DI 4 ""))]
6807 "TARGET_POWERPC64 && reload_completed
6808 && includes_rldic_lshift_p (operands[2], operands[3])"
6810 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6813 (compare:CC (match_dup 4)
6817 (define_insn "*ashldi3_internal6"
6818 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6820 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6821 (match_operand:SI 2 "const_int_operand" "i,i"))
6822 (match_operand:DI 3 "const_int_operand" "n,n"))
6824 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6825 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6826 "TARGET_POWERPC64 && includes_rldic_lshift_p (operands[2], operands[3])"
6828 rldic. %0,%1,%H2,%W3
6830 [(set_attr "type" "delayed_compare")
6831 (set_attr "length" "4,8")])
6834 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6836 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6837 (match_operand:SI 2 "const_int_operand" ""))
6838 (match_operand:DI 3 "const_int_operand" ""))
6840 (set (match_operand:DI 0 "gpc_reg_operand" "")
6841 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6842 "TARGET_POWERPC64 && reload_completed
6843 && includes_rldic_lshift_p (operands[2], operands[3])"
6845 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6848 (compare:CC (match_dup 0)
6852 (define_insn "*ashldi3_internal7"
6853 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6854 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6855 (match_operand:SI 2 "const_int_operand" "i"))
6856 (match_operand:DI 3 "mask64_operand" "S")))]
6857 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
6858 "rldicr %0,%1,%H2,%S3")
6860 (define_insn "ashldi3_internal8"
6861 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6863 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6864 (match_operand:SI 2 "const_int_operand" "i,i"))
6865 (match_operand:DI 3 "mask64_operand" "S,S"))
6867 (clobber (match_scratch:DI 4 "=r,r"))]
6868 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
6870 rldicr. %4,%1,%H2,%S3
6872 [(set_attr "type" "delayed_compare")
6873 (set_attr "length" "4,8")])
6876 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6878 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6879 (match_operand:SI 2 "const_int_operand" ""))
6880 (match_operand:DI 3 "mask64_operand" ""))
6882 (clobber (match_scratch:DI 4 ""))]
6883 "TARGET_POWERPC64 && reload_completed
6884 && includes_rldicr_lshift_p (operands[2], operands[3])"
6886 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6889 (compare:CC (match_dup 4)
6893 (define_insn "*ashldi3_internal9"
6894 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
6896 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6897 (match_operand:SI 2 "const_int_operand" "i,i"))
6898 (match_operand:DI 3 "mask64_operand" "S,S"))
6900 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6901 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6902 "TARGET_POWERPC64 && includes_rldicr_lshift_p (operands[2], operands[3])"
6904 rldicr. %0,%1,%H2,%S3
6906 [(set_attr "type" "delayed_compare")
6907 (set_attr "length" "4,8")])
6910 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
6912 (and:DI (ashift:DI (match_operand:DI 1 "gpc_reg_operand" "")
6913 (match_operand:SI 2 "const_int_operand" ""))
6914 (match_operand:DI 3 "mask64_operand" ""))
6916 (set (match_operand:DI 0 "gpc_reg_operand" "")
6917 (and:DI (ashift:DI (match_dup 1) (match_dup 2)) (match_dup 3)))]
6918 "TARGET_POWERPC64 && reload_completed
6919 && includes_rldicr_lshift_p (operands[2], operands[3])"
6921 (and:DI (ashift:DI (match_dup 1) (match_dup 2))
6924 (compare:CC (match_dup 0)
6928 (define_expand "lshrdi3"
6929 [(set (match_operand:DI 0 "gpc_reg_operand" "")
6930 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
6931 (match_operand:SI 2 "reg_or_cint_operand" "")))]
6932 "TARGET_POWERPC64 || TARGET_POWER"
6935 if (TARGET_POWERPC64)
6937 else if (TARGET_POWER)
6939 emit_insn (gen_lshrdi3_power (operands[0], operands[1], operands[2]));
6946 (define_insn "*lshrdi3_internal1"
6947 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
6948 (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
6949 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
6953 (define_insn "*lshrdi3_internal2"
6954 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
6955 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6956 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6958 (clobber (match_scratch:DI 3 "=r,r"))]
6963 [(set_attr "type" "delayed_compare")
6964 (set_attr "length" "4,8")])
6967 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
6968 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
6969 (match_operand:SI 2 "reg_or_cint_operand" ""))
6971 (clobber (match_scratch:DI 3 ""))]
6972 "TARGET_POWERPC64 && reload_completed"
6974 (lshiftrt:DI (match_dup 1) (match_dup 2)))
6976 (compare:CC (match_dup 3)
6980 (define_insn "*lshrdi3_internal3"
6981 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
6982 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
6983 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
6985 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
6986 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
6991 [(set_attr "type" "delayed_compare")
6992 (set_attr "length" "4,8")])
6995 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
6996 (compare:CC (lshiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
6997 (match_operand:SI 2 "reg_or_cint_operand" ""))
6999 (set (match_operand:DI 0 "gpc_reg_operand" "")
7000 (lshiftrt:DI (match_dup 1) (match_dup 2)))]
7001 "TARGET_POWERPC64 && reload_completed"
7003 (lshiftrt:DI (match_dup 1) (match_dup 2)))
7005 (compare:CC (match_dup 0)
7009 (define_expand "ashrdi3"
7010 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7011 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7012 (match_operand:SI 2 "reg_or_cint_operand" "")))]
7013 "TARGET_POWERPC64 || TARGET_POWER"
7016 if (TARGET_POWERPC64)
7018 else if (TARGET_POWER && GET_CODE (operands[2]) == CONST_INT)
7020 emit_insn (gen_ashrdi3_power (operands[0], operands[1], operands[2]));
7027 (define_insn "*ashrdi3_internal1"
7028 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7029 (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
7030 (match_operand:SI 2 "reg_or_cint_operand" "ri")))]
7032 "srad%I2 %0,%1,%H2")
7034 (define_insn "*ashrdi3_internal2"
7035 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7036 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7037 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7039 (clobber (match_scratch:DI 3 "=r,r"))]
7044 [(set_attr "type" "delayed_compare")
7045 (set_attr "length" "4,8")])
7048 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7049 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7050 (match_operand:SI 2 "reg_or_cint_operand" ""))
7052 (clobber (match_scratch:DI 3 ""))]
7053 "TARGET_POWERPC64 && reload_completed"
7055 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7057 (compare:CC (match_dup 3)
7061 (define_insn "*ashrdi3_internal3"
7062 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7063 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
7064 (match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
7066 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7067 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7072 [(set_attr "type" "delayed_compare")
7073 (set_attr "length" "4,8")])
7076 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7077 (compare:CC (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "")
7078 (match_operand:SI 2 "reg_or_cint_operand" ""))
7080 (set (match_operand:DI 0 "gpc_reg_operand" "")
7081 (ashiftrt:DI (match_dup 1) (match_dup 2)))]
7082 "TARGET_POWERPC64 && reload_completed"
7084 (ashiftrt:DI (match_dup 1) (match_dup 2)))
7086 (compare:CC (match_dup 0)
7090 (define_insn "anddi3"
7091 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
7092 (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r")
7093 (match_operand:DI 2 "and64_operand" "?r,S,K,J")))
7094 (clobber (match_scratch:CC 3 "=X,X,x,x"))]
7098 rldic%B2 %0,%1,0,%S2
7102 (define_insn "*anddi3_internal2"
7103 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,?y,??y,??y")
7104 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,")
7105 (match_operand:DI 2 "and64_operand" "r,S,K,J,r,S,K,J"))
7107 (clobber (match_scratch:DI 3 "=r,r,r,r,r,r,r,r"))
7108 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,x,x"))]
7112 rldic%B2. %3,%1,0,%S2
7119 [(set_attr "type" "compare,delayed_compare,compare,compare,compare,delayed_compare,compare,compare")
7120 (set_attr "length" "4,4,4,4,8,8,8,8")])
7123 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7124 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7125 (match_operand:DI 2 "and64_operand" ""))
7127 (clobber (match_scratch:DI 3 ""))
7128 (clobber (match_scratch:CC 4 ""))]
7129 "TARGET_POWERPC64 && reload_completed"
7130 [(parallel [(set (match_dup 3)
7131 (and:DI (match_dup 1)
7133 (clobber (match_dup 4))])
7135 (compare:CC (match_dup 3)
7139 (define_insn "*anddi3_internal3"
7140 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,?y,??y,??y")
7141 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r")
7142 (match_operand:DI 2 "and64_operand" "r,S,K,J,r,S,K,J"))
7144 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r")
7145 (and:DI (match_dup 1) (match_dup 2)))
7146 (clobber (match_scratch:CC 4 "=X,X,X,X,X,X,x,x"))]
7150 rldic%B2. %0,%1,0,%S2
7157 [(set_attr "type" "compare,delayed_compare,compare,compare,compare,delayed_compare,compare,compare")
7158 (set_attr "length" "4,4,4,4,8,8,8,8")])
7161 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7162 (compare:CC (and:DI (match_operand:DI 1 "gpc_reg_operand" "")
7163 (match_operand:DI 2 "and64_operand" ""))
7165 (set (match_operand:DI 0 "gpc_reg_operand" "")
7166 (and:DI (match_dup 1) (match_dup 2)))
7167 (clobber (match_scratch:CC 4 ""))]
7168 "TARGET_POWERPC64 && reload_completed"
7169 [(parallel [(set (match_dup 0)
7170 (and:DI (match_dup 1) (match_dup 2)))
7171 (clobber (match_dup 4))])
7173 (compare:CC (match_dup 0)
7177 (define_expand "iordi3"
7178 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7179 (ior:DI (match_operand:DI 1 "gpc_reg_operand" "")
7180 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7184 if (non_logical_cint_operand (operands[2], DImode))
7186 HOST_WIDE_INT value;
7187 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7188 ? operands[0] : gen_reg_rtx (DImode));
7190 if (GET_CODE (operands[2]) == CONST_INT)
7192 value = INTVAL (operands[2]);
7193 emit_insn (gen_iordi3 (tmp, operands[1],
7194 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7198 value = CONST_DOUBLE_LOW (operands[2]);
7199 emit_insn (gen_iordi3 (tmp, operands[1],
7200 immed_double_const (value
7201 & (~ (HOST_WIDE_INT) 0xffff),
7205 emit_insn (gen_iordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7210 (define_expand "xordi3"
7211 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7212 (xor:DI (match_operand:DI 1 "gpc_reg_operand" "")
7213 (match_operand:DI 2 "reg_or_logical_cint_operand" "")))]
7217 if (non_logical_cint_operand (operands[2], DImode))
7219 HOST_WIDE_INT value;
7220 rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1]))
7221 ? operands[0] : gen_reg_rtx (DImode));
7223 if (GET_CODE (operands[2]) == CONST_INT)
7225 value = INTVAL (operands[2]);
7226 emit_insn (gen_xordi3 (tmp, operands[1],
7227 GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff))));
7231 value = CONST_DOUBLE_LOW (operands[2]);
7232 emit_insn (gen_xordi3 (tmp, operands[1],
7233 immed_double_const (value
7234 & (~ (HOST_WIDE_INT) 0xffff),
7238 emit_insn (gen_xordi3 (operands[0], tmp, GEN_INT (value & 0xffff)));
7243 (define_insn "*booldi3_internal1"
7244 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
7245 (match_operator:DI 3 "boolean_or_operator"
7246 [(match_operand:DI 1 "gpc_reg_operand" "%r,r,r")
7247 (match_operand:DI 2 "logical_operand" "r,K,JF")]))]
7254 (define_insn "*booldi3_internal2"
7255 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7256 (compare:CC (match_operator:DI 4 "boolean_or_operator"
7257 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7258 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7260 (clobber (match_scratch:DI 3 "=r,r"))]
7265 [(set_attr "type" "compare")
7266 (set_attr "length" "4,8")])
7269 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7270 (compare:CC (match_operator:DI 4 "boolean_operator"
7271 [(match_operand:DI 1 "gpc_reg_operand" "")
7272 (match_operand:DI 2 "gpc_reg_operand" "")])
7274 (clobber (match_scratch:DI 3 ""))]
7275 "TARGET_POWERPC64 && reload_completed"
7276 [(set (match_dup 3) (match_dup 4))
7278 (compare:CC (match_dup 3)
7282 (define_insn "*booldi3_internal3"
7283 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7284 (compare:CC (match_operator:DI 4 "boolean_operator"
7285 [(match_operand:DI 1 "gpc_reg_operand" "%r,r")
7286 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7288 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7294 [(set_attr "type" "compare")
7295 (set_attr "length" "4,8")])
7298 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7299 (compare:CC (match_operator:DI 4 "boolean_operator"
7300 [(match_operand:DI 1 "gpc_reg_operand" "")
7301 (match_operand:DI 2 "gpc_reg_operand" "")])
7303 (set (match_operand:DI 0 "gpc_reg_operand" "")
7305 "TARGET_POWERPC64 && reload_completed"
7306 [(set (match_dup 0) (match_dup 4))
7308 (compare:CC (match_dup 0)
7312 ;; Split an logical operation that we can't do in one insn into two insns,
7313 ;; each of which does one 16-bit part. This is used by combine.
7316 [(set (match_operand:DI 0 "gpc_reg_operand" "")
7317 (match_operator:DI 3 "boolean_or_operator"
7318 [(match_operand:DI 1 "gpc_reg_operand" "")
7319 (match_operand:DI 2 "non_logical_cint_operand" "")]))]
7321 [(set (match_dup 0) (match_dup 4))
7322 (set (match_dup 0) (match_dup 5))]
7327 if (GET_CODE (operands[2]) == CONST_DOUBLE)
7329 HOST_WIDE_INT value = CONST_DOUBLE_LOW (operands[2]);
7330 i3 = immed_double_const (value & (~ (HOST_WIDE_INT) 0xffff),
7332 i4 = GEN_INT (value & 0xffff);
7336 i3 = GEN_INT (INTVAL (operands[2])
7337 & (~ (HOST_WIDE_INT) 0xffff));
7338 i4 = GEN_INT (INTVAL (operands[2]) & 0xffff);
7340 operands[4] = gen_rtx (GET_CODE (operands[3]), DImode,
7342 operands[5] = gen_rtx (GET_CODE (operands[3]), DImode,
7346 (define_insn "*boolcdi3_internal1"
7347 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7348 (match_operator:DI 3 "boolean_operator"
7349 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7350 (match_operand:DI 2 "gpc_reg_operand" "r")]))]
7354 (define_insn "*boolcdi3_internal2"
7355 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7356 (compare:CC (match_operator:DI 4 "boolean_operator"
7357 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
7358 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7360 (clobber (match_scratch:DI 3 "=r,r"))]
7365 [(set_attr "type" "compare")
7366 (set_attr "length" "4,8")])
7369 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7370 (compare:CC (match_operator:DI 4 "boolean_operator"
7371 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7372 (match_operand:DI 2 "gpc_reg_operand" "")])
7374 (clobber (match_scratch:DI 3 ""))]
7375 "TARGET_POWERPC64 && reload_completed"
7376 [(set (match_dup 3) (match_dup 4))
7378 (compare:CC (match_dup 3)
7382 (define_insn "*boolcdi3_internal3"
7383 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7384 (compare:CC (match_operator:DI 4 "boolean_operator"
7385 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
7386 (match_operand:DI 2 "gpc_reg_operand" "r,r")])
7388 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7394 [(set_attr "type" "compare")
7395 (set_attr "length" "4,8")])
7398 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7399 (compare:CC (match_operator:DI 4 "boolean_operator"
7400 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7401 (match_operand:DI 2 "gpc_reg_operand" "")])
7403 (set (match_operand:DI 0 "gpc_reg_operand" "")
7405 "TARGET_POWERPC64 && reload_completed"
7406 [(set (match_dup 0) (match_dup 4))
7408 (compare:CC (match_dup 0)
7412 (define_insn "*boolccdi3_internal1"
7413 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
7414 (match_operator:DI 3 "boolean_operator"
7415 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r"))
7416 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r"))]))]
7420 (define_insn "*boolccdi3_internal2"
7421 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
7422 (compare:CC (match_operator:DI 4 "boolean_operator"
7423 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r"))
7424 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
7426 (clobber (match_scratch:DI 3 "=r,r"))]
7431 [(set_attr "type" "compare")
7432 (set_attr "length" "4,8")])
7435 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
7436 (compare:CC (match_operator:DI 4 "boolean_operator"
7437 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7438 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
7440 (clobber (match_scratch:DI 3 ""))]
7441 "TARGET_POWERPC64 && reload_completed"
7442 [(set (match_dup 3) (match_dup 4))
7444 (compare:CC (match_dup 3)
7448 (define_insn "*boolccdi3_internal3"
7449 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
7450 (compare:CC (match_operator:DI 4 "boolean_operator"
7451 [(not:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r"))
7452 (not:DI (match_operand:DI 2 "gpc_reg_operand" "r,r"))])
7454 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
7460 [(set_attr "type" "compare")
7461 (set_attr "length" "4,8")])
7464 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
7465 (compare:CC (match_operator:DI 4 "boolean_operator"
7466 [(not:DI (match_operand:DI 1 "gpc_reg_operand" ""))
7467 (not:DI (match_operand:DI 2 "gpc_reg_operand" ""))])
7469 (set (match_operand:DI 0 "gpc_reg_operand" "")
7471 "TARGET_POWERPC64 && reload_completed"
7472 [(set (match_dup 0) (match_dup 4))
7474 (compare:CC (match_dup 0)
7478 ;; Now define ways of moving data around.
7480 ;; Elf specific ways of loading addresses for non-PIC code.
7481 ;; The output of this could be r0, but we make a very strong
7482 ;; preference for a base register because it will usually
7484 (define_insn "elf_high"
7485 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
7486 (high:SI (match_operand 1 "" "")))]
7487 "TARGET_ELF && ! TARGET_64BIT"
7488 "{liu|lis} %0,%1@ha")
7490 (define_insn "elf_low"
7491 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
7492 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
7493 (match_operand 2 "" "")))]
7494 "TARGET_ELF && ! TARGET_64BIT"
7496 {cal|la} %0,%2@l(%1)
7497 {ai|addic} %0,%1,%K2")
7499 ;; Mach-O PIC trickery.
7500 (define_insn "macho_high"
7501 [(set (match_operand:SI 0 "gpc_reg_operand" "=b*r")
7502 (high:SI (match_operand 1 "" "")))]
7503 "TARGET_MACHO && ! TARGET_64BIT"
7504 "{liu|lis} %0,ha16(%1)")
7506 (define_insn "macho_low"
7507 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
7508 (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,!*r")
7509 (match_operand 2 "" "")))]
7510 "TARGET_MACHO && ! TARGET_64BIT"
7512 {cal %0,%a2@l(%1)|la %0,lo16(%2)(%1)}
7513 {cal %0,%a2@l(%1)|addic %0,%1,lo16(%2)}")
7515 ;; Set up a register with a value from the GOT table
7517 (define_expand "movsi_got"
7518 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7519 (unspec:SI [(match_operand:SI 1 "got_operand" "")
7521 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
7524 if (GET_CODE (operands[1]) == CONST)
7526 rtx offset = const0_rtx;
7527 HOST_WIDE_INT value;
7529 operands[1] = eliminate_constant_term (XEXP (operands[1], 0), &offset);
7530 value = INTVAL (offset);
7533 rtx tmp = (no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode));
7534 emit_insn (gen_movsi_got (tmp, operands[1]));
7535 emit_insn (gen_addsi3 (operands[0], tmp, offset));
7540 operands[2] = rs6000_got_register (operands[1]);
7543 (define_insn "*movsi_got_internal"
7544 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
7545 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
7546 (match_operand:SI 2 "gpc_reg_operand" "b")] 8))]
7547 "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
7548 "{l|lwz} %0,%a1@got(%2)"
7549 [(set_attr "type" "load")])
7551 ;; Used by sched, shorten_branches and final when the GOT pseudo reg
7552 ;; didn't get allocated to a hard register.
7554 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7555 (unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
7556 (match_operand:SI 2 "memory_operand" "")] 8))]
7557 "DEFAULT_ABI == ABI_V4
7559 && (reload_in_progress || reload_completed)"
7560 [(set (match_dup 0) (match_dup 2))
7561 (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)] 8))]
7564 ;; For SI, we special-case integers that can't be loaded in one insn. We
7565 ;; do the load 16-bits at a time. We could do this by loading from memory,
7566 ;; and this is even supposed to be faster, but it is simpler not to get
7567 ;; integers in the TOC.
7568 (define_expand "movsi"
7569 [(set (match_operand:SI 0 "general_operand" "")
7570 (match_operand:SI 1 "any_operand" ""))]
7572 "{ rs6000_emit_move (operands[0], operands[1], SImode); DONE; }")
7574 (define_insn "movsi_low"
7575 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
7576 (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7577 (match_operand 2 "" ""))))]
7578 "TARGET_MACHO && ! TARGET_64BIT"
7579 "{l|lwz} %0,lo16(%2)(%1)"
7580 [(set_attr "type" "load")
7581 (set_attr "length" "4")])
7583 (define_insn "movsi_low_st"
7584 [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7585 (match_operand 2 "" "")))
7586 (match_operand:SI 0 "gpc_reg_operand" "r"))]
7587 "TARGET_MACHO && ! TARGET_64BIT"
7588 "{st|stw} %0,lo16(%2)(%1)"
7589 [(set_attr "type" "store")
7590 (set_attr "length" "4")])
7592 (define_insn "movdf_low"
7593 [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r")
7594 (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7595 (match_operand 2 "" ""))))]
7596 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7599 switch (which_alternative)
7602 return \"lfd %0,lo16(%2)(%1)\";
7606 operands2[0] = operands[0];
7607 operands2[1] = operands[1];
7608 operands2[2] = operands[2];
7609 operands2[3] = gen_rtx_REG (SImode, RS6000_PIC_OFFSET_TABLE_REGNUM);
7610 output_asm_insn (\"{l|lwz} %0,lo16(%2)(%1)\", operands);
7611 /* We cannot rely on ha16(low half)==ha16(high half), alas,
7612 although in practice it almost always is. */
7613 output_asm_insn (\"{cau|addis} %L0,%3,ha16(%2+4)\", operands2);
7614 return (\"{l|lwz} %L0,lo16(%2+4)(%L0)\");
7620 [(set_attr "type" "load")
7621 (set_attr "length" "4,12")])
7623 (define_insn "movdf_low_st"
7624 [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
7625 (match_operand 2 "" "")))
7626 (match_operand:DF 0 "gpc_reg_operand" "f"))]
7627 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7628 "stfd %0,lo16(%2)(%1)"
7629 [(set_attr "type" "store")
7630 (set_attr "length" "4")])
7632 (define_insn "movsf_low"
7633 [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r")
7634 (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7635 (match_operand 2 "" ""))))]
7636 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7639 {l|lwz} %0,lo16(%2)(%1)"
7640 [(set_attr "type" "load")
7641 (set_attr "length" "4")])
7643 (define_insn "movsf_low_st"
7644 [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
7645 (match_operand 2 "" "")))
7646 (match_operand:SF 0 "gpc_reg_operand" "f,!r"))]
7647 "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
7649 stfs %0,lo16(%2)(%1)
7650 {st|stw} %0,lo16(%2)(%1)"
7651 [(set_attr "type" "store")
7652 (set_attr "length" "4")])
7654 (define_insn "*movsi_internal1"
7655 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,r,r,r,r,r,*q,*c*l,*h,*h")
7656 (match_operand:SI 1 "input_operand" "r,U,m,r,I,L,n,R,*h,r,r,r,0"))]
7657 "gpc_reg_operand (operands[0], SImode)
7658 || gpc_reg_operand (operands[1], SImode)"
7662 {l%U1%X1|lwz%U1%X1} %0,%1
7663 {st%U0%X0|stw%U0%X0} %1,%0
7673 [(set_attr "type" "*,*,load,store,*,*,*,*,*,*,mtjmpr,*,*")
7674 (set_attr "length" "4,4,4,4,4,4,8,4,4,4,4,4,4")])
7676 ;; Split a load of a large constant into the appropriate two-insn
7680 [(set (match_operand:SI 0 "gpc_reg_operand" "")
7681 (match_operand:SI 1 "const_int_operand" ""))]
7682 "(unsigned HOST_WIDE_INT) (INTVAL (operands[1]) + 0x8000) >= 0x10000
7683 && (INTVAL (operands[1]) & 0xffff) != 0"
7687 (ior:SI (match_dup 0)
7691 operands[2] = GEN_INT (INTVAL (operands[1]) & (~ (HOST_WIDE_INT) 0xffff));
7692 operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);
7695 (define_insn "*movsi_internal2"
7696 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
7697 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r,r")
7699 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
7700 "! TARGET_POWERPC64"
7704 [(set_attr "type" "compare")
7705 (set_attr "length" "4,8")])
7708 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
7709 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
7711 (set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))]
7712 "! TARGET_POWERPC64 && reload_completed"
7713 [(set (match_dup 0) (match_dup 1))
7715 (compare:CC (match_dup 0)
7719 (define_expand "movhi"
7720 [(set (match_operand:HI 0 "general_operand" "")
7721 (match_operand:HI 1 "any_operand" ""))]
7723 "{ rs6000_emit_move (operands[0], operands[1], HImode); DONE; }")
7726 [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
7727 (match_operand:HI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
7728 "gpc_reg_operand (operands[0], HImode)
7729 || gpc_reg_operand (operands[1], HImode)"
7739 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
7741 (define_expand "movqi"
7742 [(set (match_operand:QI 0 "general_operand" "")
7743 (match_operand:QI 1 "any_operand" ""))]
7745 "{ rs6000_emit_move (operands[0], operands[1], QImode); DONE; }")
7748 [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
7749 (match_operand:QI 1 "input_operand" "r,m,r,i,*h,r,r,0"))]
7750 "gpc_reg_operand (operands[0], QImode)
7751 || gpc_reg_operand (operands[1], QImode)"
7761 [(set_attr "type" "*,load,store,*,*,*,mtjmpr,*")])
7763 ;; Here is how to move condition codes around. When we store CC data in
7764 ;; an integer register or memory, we store just the high-order 4 bits.
7765 ;; This lets us not shift in the most common case of CR0.
7766 (define_expand "movcc"
7767 [(set (match_operand:CC 0 "nonimmediate_operand" "")
7768 (match_operand:CC 1 "nonimmediate_operand" ""))]
7772 (define_insn "*movcc_internal1"
7773 [(set (match_operand:CC 0 "nonimmediate_operand" "=y,x,y,r,r,r,r,m")
7774 (match_operand:CC 1 "nonimmediate_operand" "y,r,r,x,y,r,m,r"))]
7775 "register_operand (operands[0], CCmode)
7776 || register_operand (operands[1], CCmode)"
7780 {rlinm|rlwinm} %1,%1,%F0,0xffffffff\;mtcrf %R0,%1\;{rlinm|rlwinm} %1,%1,%f0,0xffffffff
7782 mfcr %0\;{rlinm|rlwinm} %0,%0,%f1,0xf0000000
7784 {l%U1%X1|lwz%U1%X1} %0,%1
7785 {st%U0%U1|stw%U0%U1} %1,%0"
7786 [(set_attr "type" "*,*,*,compare,*,*,load,store")
7787 (set_attr "length" "*,*,12,*,8,*,*,*")])
7789 ;; For floating-point, we normally deal with the floating-point registers
7790 ;; unless -msoft-float is used. The sole exception is that parameter passing
7791 ;; can produce floating-point values in fixed-point registers. Unless the
7792 ;; value is a simple constant or already in memory, we deal with this by
7793 ;; allocating memory and copying the value explicitly via that memory location.
7794 (define_expand "movsf"
7795 [(set (match_operand:SF 0 "nonimmediate_operand" "")
7796 (match_operand:SF 1 "any_operand" ""))]
7798 "{ rs6000_emit_move (operands[0], operands[1], SFmode); DONE; }")
7801 [(set (match_operand:SF 0 "gpc_reg_operand" "")
7802 (match_operand:SF 1 "const_double_operand" ""))]
7804 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
7805 || (GET_CODE (operands[0]) == SUBREG
7806 && GET_CODE (SUBREG_REG (operands[0])) == REG
7807 && REGNO (SUBREG_REG (operands[0])) <= 31))"
7808 [(set (match_dup 2) (match_dup 3))]
7814 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
7815 REAL_VALUE_TO_TARGET_SINGLE (rv, l);
7817 if (! TARGET_POWERPC64)
7818 operands[2] = operand_subword (operands[0], 0, 0, SFmode);
7820 operands[2] = gen_lowpart (SImode, operands[0]);
7822 operands[3] = gen_int_mode (l, SImode);
7825 (define_insn "*movsf_hardfloat"
7826 [(set (match_operand:SF 0 "nonimmediate_operand" "=!r,!r,m,f,f,m,!r,!r")
7827 (match_operand:SF 1 "input_operand" "r,m,r,f,m,f,G,Fn"))]
7828 "(gpc_reg_operand (operands[0], SFmode)
7829 || gpc_reg_operand (operands[1], SFmode)) && TARGET_HARD_FLOAT"
7832 {l%U1%X1|lwz%U1%X1} %0,%1
7833 {st%U0%X0|stw%U0%X0} %1,%0
7839 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*")
7840 (set_attr "length" "4,4,4,4,4,4,4,8")])
7842 (define_insn "*movsf_softfloat"
7843 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,r")
7844 (match_operand:SF 1 "input_operand" "r,m,r,I,L,R,G,Fn"))]
7845 "(gpc_reg_operand (operands[0], SFmode)
7846 || gpc_reg_operand (operands[1], SFmode)) && TARGET_SOFT_FLOAT"
7849 {l%U1%X1|lwz%U1%X1} %0,%1
7850 {st%U0%X0|stw%U0%X0} %1,%0
7856 [(set_attr "type" "*,load,store,*,*,*,*,*")
7857 (set_attr "length" "4,4,4,4,4,4,4,8")])
7860 (define_expand "movdf"
7861 [(set (match_operand:DF 0 "nonimmediate_operand" "")
7862 (match_operand:DF 1 "any_operand" ""))]
7864 "{ rs6000_emit_move (operands[0], operands[1], DFmode); DONE; }")
7867 [(set (match_operand:DF 0 "gpc_reg_operand" "")
7868 (match_operand:DF 1 "const_int_operand" ""))]
7869 "! TARGET_POWERPC64 && reload_completed
7870 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
7871 || (GET_CODE (operands[0]) == SUBREG
7872 && GET_CODE (SUBREG_REG (operands[0])) == REG
7873 && REGNO (SUBREG_REG (operands[0])) <= 31))"
7874 [(set (match_dup 2) (match_dup 4))
7875 (set (match_dup 3) (match_dup 1))]
7878 int endian = (WORDS_BIG_ENDIAN == 0);
7879 HOST_WIDE_INT value = INTVAL (operands[1]);
7881 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
7882 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
7883 #if HOST_BITS_PER_WIDE_INT == 32
7884 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
7886 operands[4] = GEN_INT (value >> 32);
7887 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
7892 [(set (match_operand:DF 0 "gpc_reg_operand" "")
7893 (match_operand:DF 1 "const_double_operand" ""))]
7894 "! TARGET_POWERPC64 && reload_completed
7895 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
7896 || (GET_CODE (operands[0]) == SUBREG
7897 && GET_CODE (SUBREG_REG (operands[0])) == REG
7898 && REGNO (SUBREG_REG (operands[0])) <= 31))"
7899 [(set (match_dup 2) (match_dup 4))
7900 (set (match_dup 3) (match_dup 5))]
7903 int endian = (WORDS_BIG_ENDIAN == 0);
7907 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
7908 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
7910 operands[2] = operand_subword (operands[0], endian, 0, DFmode);
7911 operands[3] = operand_subword (operands[0], 1 - endian, 0, DFmode);
7912 operands[4] = gen_int_mode (l[endian], SImode);
7913 operands[5] = gen_int_mode (l[1 - endian], SImode);
7917 [(set (match_operand:DF 0 "gpc_reg_operand" "")
7918 (match_operand:DF 1 "easy_fp_constant" ""))]
7919 "TARGET_POWERPC64 && reload_completed
7920 && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
7921 || (GET_CODE (operands[0]) == SUBREG
7922 && GET_CODE (SUBREG_REG (operands[0])) == REG
7923 && REGNO (SUBREG_REG (operands[0])) <= 31))"
7924 [(set (match_dup 2) (match_dup 3))]
7927 int endian = (WORDS_BIG_ENDIAN == 0);
7932 REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
7933 REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
7935 operands[2] = gen_lowpart (DImode, operands[0]);
7936 /* HIGHPART is lower memory address when WORDS_BIG_ENDIAN. */
7937 #if HOST_BITS_PER_WIDE_INT >= 64
7938 val = ((HOST_WIDE_INT)(unsigned long)l[endian] << 32 |
7939 ((HOST_WIDE_INT)(unsigned long)l[1 - endian]));
7941 operands[3] = immed_double_const (val, -(val < 0), DImode);
7943 operands[3] = immed_double_const (l[1 - endian], l[endian], DImode);
7947 ;; Don't have reload use general registers to load a constant. First,
7948 ;; it might not work if the output operand is the equivalent of
7949 ;; a non-offsettable memref, but also it is less efficient than loading
7950 ;; the constant into an FP register, since it will probably be used there.
7951 ;; The "??" is a kludge until we can figure out a more reasonable way
7952 ;; of handling these non-offsettable values.
7953 (define_insn "*movdf_hardfloat32"
7954 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
7955 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
7956 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT
7957 && (gpc_reg_operand (operands[0], DFmode)
7958 || gpc_reg_operand (operands[1], DFmode))"
7961 switch (which_alternative)
7966 /* We normally copy the low-numbered register first. However, if
7967 the first register operand 0 is the same as the second register
7968 of operand 1, we must copy in the opposite order. */
7969 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
7970 return \"mr %L0,%L1\;mr %0,%1\";
7972 return \"mr %0,%1\;mr %L0,%L1\";
7974 if (offsettable_memref_p (operands[1])
7975 || (GET_CODE (operands[1]) == MEM
7976 && (GET_CODE (XEXP (operands[1], 0)) == LO_SUM
7977 || GET_CODE (XEXP (operands[1], 0)) == PRE_INC
7978 || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)))
7980 /* If the low-address word is used in the address, we must load
7981 it last. Otherwise, load it first. Note that we cannot have
7982 auto-increment in that case since the address register is
7983 known to be dead. */
7984 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
7986 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
7988 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
7994 addreg = find_addr_reg (XEXP (operands[1], 0));
7995 if (refers_to_regno_p (REGNO (operands[0]),
7996 REGNO (operands[0]) + 1,
7999 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8000 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8001 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8002 return \"{lx|lwzx} %0,%1\";
8006 output_asm_insn (\"{lx|lwzx} %0,%1\", operands);
8007 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8008 output_asm_insn (\"{lx|lwzx} %L0,%1\", operands);
8009 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8014 if (offsettable_memref_p (operands[0])
8015 || (GET_CODE (operands[0]) == MEM
8016 && (GET_CODE (XEXP (operands[0], 0)) == LO_SUM
8017 || GET_CODE (XEXP (operands[0], 0)) == PRE_INC
8018 || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)))
8019 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8024 addreg = find_addr_reg (XEXP (operands[0], 0));
8025 output_asm_insn (\"{stx|stwx} %1,%0\", operands);
8026 output_asm_insn (\"{cal|la} %0,4(%0)\", &addreg);
8027 output_asm_insn (\"{stx|stwx} %L1,%0\", operands);
8028 output_asm_insn (\"{cal|la} %0,-4(%0)\", &addreg);
8036 return \"fmr %0,%1\";
8038 return \"lfd%U1%X1 %0,%1\";
8040 return \"stfd%U0%X0 %1,%0\";
8043 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8044 (set_attr "length" "8,16,16,8,12,16,*,*,*")])
8046 (define_insn "*movdf_softfloat32"
8047 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8048 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8049 "! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
8050 && (gpc_reg_operand (operands[0], DFmode)
8051 || gpc_reg_operand (operands[1], DFmode))"
8054 switch (which_alternative)
8059 /* We normally copy the low-numbered register first. However, if
8060 the first register operand 0 is the same as the second register of
8061 operand 1, we must copy in the opposite order. */
8062 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8063 return \"mr %L0,%L1\;mr %0,%1\";
8065 return \"mr %0,%1\;mr %L0,%L1\";
8067 /* If the low-address word is used in the address, we must load
8068 it last. Otherwise, load it first. Note that we cannot have
8069 auto-increment in that case since the address register is
8070 known to be dead. */
8071 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8073 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8075 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8077 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8084 [(set_attr "type" "*,load,store,*,*,*")
8085 (set_attr "length" "8,8,8,8,12,16")])
8087 (define_insn "*movdf_hardfloat64"
8088 [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,!r,!r,!r,f,f,m")
8089 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F,f,m,f"))]
8090 "TARGET_POWERPC64 && TARGET_HARD_FLOAT
8091 && (gpc_reg_operand (operands[0], DFmode)
8092 || gpc_reg_operand (operands[1], DFmode))"
8103 [(set_attr "type" "*,load,store,*,*,*,fp,fpload,fpstore")
8104 (set_attr "length" "4,4,4,8,12,16,4,4,4")])
8106 (define_insn "*movdf_softfloat64"
8107 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,r,r,r")
8108 (match_operand:DF 1 "input_operand" "r,m,r,G,H,F"))]
8109 "TARGET_POWERPC64 && TARGET_SOFT_FLOAT
8110 && (gpc_reg_operand (operands[0], DFmode)
8111 || gpc_reg_operand (operands[1], DFmode))"
8119 [(set_attr "type" "*,load,store,*,*,*")
8120 (set_attr "length" "*,*,*,8,12,16")])
8122 (define_expand "movtf"
8123 [(set (match_operand:TF 0 "general_operand" "")
8124 (match_operand:TF 1 "any_operand" ""))]
8125 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8126 "{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
8128 (define_insn "*movtf_internal"
8129 [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r")
8130 (match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))]
8131 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128
8132 && (gpc_reg_operand (operands[0], TFmode)
8133 || gpc_reg_operand (operands[1], TFmode))"
8136 switch (which_alternative)
8141 /* We normally copy the low-numbered register first. However, if
8142 the first register operand 0 is the same as the second register of
8143 operand 1, we must copy in the opposite order. */
8144 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8145 return \"fmr %L0,%L1\;fmr %0,%1\";
8147 return \"fmr %0,%1\;fmr %L0,%L1\";
8149 return \"lfd %0,%1\;lfd %L0,%L1\";
8151 return \"stfd %1,%0\;stfd %L1,%L0\";
8158 [(set_attr "type" "fp,fpload,fpstore,*,*,*")
8159 (set_attr "length" "8,8,8,12,16,20")])
8162 [(set (match_operand:TF 0 "gpc_reg_operand" "")
8163 (match_operand:TF 1 "const_double_operand" ""))]
8164 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8165 [(set (match_dup 3) (match_dup 1))
8167 (float_extend:TF (match_dup 3)))]
8170 operands[2] = operand_subword (operands[1], 0, 0, DFmode);
8171 operands[3] = gen_reg_rtx (DFmode);
8174 (define_insn_and_split "extenddftf2"
8175 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8176 (float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))]
8177 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8180 [(set (match_dup 2) (match_dup 3))]
8183 operands[2] = gen_rtx_REG (DFmode, REGNO (operands[0] + 1));
8184 operands[3] = CONST0_RTX (DFmode);
8187 (define_insn_and_split "extendsftf2"
8188 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8189 (float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))]
8190 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8193 [(set (match_dup 2) (match_dup 3))]
8196 operands[2] = gen_rtx_REG (SFmode, REGNO (operands[0] + 1));
8197 operands[3] = CONST0_RTX (SFmode);
8200 (define_insn "trunctfdf2"
8201 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
8202 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8203 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8205 [(set_attr "type" "fp")
8206 (set_attr "length" "8")])
8208 (define_insn_and_split "trunctfsf2"
8209 [(set (match_operand:SF 0 "gpc_reg_operand" "=f")
8210 (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8211 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8215 (float_truncate:DF (match_dup 1)))
8217 (float_truncate:SF (match_dup 2)))]
8220 operands[2] = gen_reg_rtx (DFmode);
8223 (define_expand "floatditf2"
8225 (float:DF (match_operand:DI 1 "gpc_reg_operand" "")))
8226 (set (match_operand:TF 0 "gpc_reg_operand" "")
8227 (float_extend:TF (match_dup 2)))]
8228 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8229 && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8230 "{ operands[2] = gen_reg_rtx (DFmode); }")
8232 (define_expand "floatsitf2"
8234 (float:DF (match_operand:SI 1 "gpc_reg_operand" "")))
8235 (set (match_operand:TF 0 "gpc_reg_operand" "")
8236 (float_extend:TF (match_dup 2)))]
8237 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8238 "{ operands[2] = gen_reg_rtx (DFmode); }")
8240 (define_expand "fix_trunctfdi2"
8242 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8243 (set (match_operand:DI 0 "gpc_reg_operand" "")
8244 (fix:SI (match_dup 2)))]
8245 "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
8246 && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8247 "{ operands[2] = gen_reg_rtx (DFmode); }")
8249 (define_expand "fix_trunctfsi2"
8251 (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "")))
8252 (set (match_operand:SI 0 "gpc_reg_operand" "")
8253 (fix:SI (match_dup 2)))]
8254 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8255 "{ operands[2] = gen_reg_rtx (DFmode); }")
8257 (define_insn "negtf2"
8258 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8259 (neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8260 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8263 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8264 return \"fneg %L0,%L1\;fneg %0,%1\";
8266 return \"fneg %0,%1\;fneg %L0,%L1\";
8268 [(set_attr "type" "fp")
8269 (set_attr "length" "8")])
8271 (define_insn "abstf2"
8272 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8273 (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
8274 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8277 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8278 return \"fabs %L0,%L1\;fabs %0,%1\";
8280 return \"fabs %0,%1\;fabs %L0,%L1\";
8282 [(set_attr "type" "fp")
8283 (set_attr "length" "8")])
8286 [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
8287 (neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))]
8288 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
8291 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8292 return \"fnabs %L0,%L1\;fnabs %0,%1\";
8294 return \"fnabs %0,%1\;fnabs %L0,%L1\";
8296 [(set_attr "type" "fp")
8297 (set_attr "length" "8")])
8299 ;; Next come the multi-word integer load and store and the load and store
8301 (define_expand "movdi"
8302 [(set (match_operand:DI 0 "general_operand" "")
8303 (match_operand:DI 1 "any_operand" ""))]
8305 "{ rs6000_emit_move (operands[0], operands[1], DImode); DONE; }")
8307 (define_insn "*movdi_internal32"
8308 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,f,f,m,r,r,r,r,r")
8309 (match_operand:DI 1 "input_operand" "r,m,r,f,m,f,IJK,n,G,H,F"))]
8311 && (gpc_reg_operand (operands[0], DImode)
8312 || gpc_reg_operand (operands[1], DImode))"
8315 switch (which_alternative)
8320 /* We normally copy the low-numbered register first. However, if
8321 the first register operand 0 is the same as the second register of
8322 operand 1, we must copy in the opposite order. */
8323 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8324 return \"mr %L0,%L1\;mr %0,%1\";
8326 return \"mr %0,%1\;mr %L0,%L1\";
8328 /* If the low-address word is used in the address, we must load it
8329 last. Otherwise, load it first. Note that we cannot have
8330 auto-increment in that case since the address register is known to be
8332 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8334 return \"{l|lwz} %L0,%L1\;{l|lwz} %0,%1\";
8336 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\";
8338 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\";
8340 return \"fmr %0,%1\";
8342 return \"lfd%U1%X1 %0,%1\";
8344 return \"stfd%U0%X0 %1,%0\";
8353 [(set_attr "type" "*,load,store,fp,fpload,fpstore,*,*,*,*,*")
8354 (set_attr "length" "8,8,8,*,*,*,8,12,8,12,16")])
8357 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8358 (match_operand:DI 1 "const_int_operand" ""))]
8359 "! TARGET_POWERPC64 && reload_completed"
8360 [(set (match_dup 2) (match_dup 4))
8361 (set (match_dup 3) (match_dup 1))]
8364 HOST_WIDE_INT value = INTVAL (operands[1]);
8365 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8367 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8369 #if HOST_BITS_PER_WIDE_INT == 32
8370 operands[4] = (value & 0x80000000) ? constm1_rtx : const0_rtx;
8372 operands[4] = GEN_INT (value >> 32);
8373 operands[1] = GEN_INT (((value & 0xffffffff) ^ 0x80000000) - 0x80000000);
8378 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8379 (match_operand:DI 1 "const_double_operand" ""))]
8380 "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed"
8381 [(set (match_dup 2) (match_dup 4))
8382 (set (match_dup 3) (match_dup 5))]
8385 operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
8387 operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
8389 operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
8390 operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
8393 (define_insn "*movdi_internal64"
8394 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m,r,r,r,r,f,f,m,r,*h,*h")
8395 (match_operand:DI 1 "input_operand" "r,m,r,I,L,nF,R,f,m,f,*h,r,0"))]
8397 && (gpc_reg_operand (operands[0], DImode)
8398 || gpc_reg_operand (operands[1], DImode))"
8413 [(set_attr "type" "*,load,store,*,*,*,*,fp,fpload,fpstore,*,mtjmpr,*")
8414 (set_attr "length" "4,4,4,4,4,20,4,4,4,4,4,4,4")])
8416 ;; immediate value valid for a single instruction hiding in a const_double
8418 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
8419 (match_operand:DI 1 "const_double_operand" "F"))]
8420 "HOST_BITS_PER_WIDE_INT == 32 && TARGET_POWERPC64
8421 && GET_CODE (operands[1]) == CONST_DOUBLE
8422 && num_insns_constant (operands[1], DImode) == 1"
8425 return ((unsigned HOST_WIDE_INT)
8426 (CONST_DOUBLE_LOW (operands[1]) + 0x8000) < 0x10000)
8427 ? \"li %0,%1\" : \"lis %0,%v1\";
8430 ;; Generate all one-bits and clear left or right.
8431 ;; Use (and:DI (rotate:DI ...)) to avoid anddi3 unnecessary clobber.
8433 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8434 (match_operand:DI 1 "mask64_operand" ""))]
8435 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8436 [(set (match_dup 0) (const_int -1))
8438 (and:DI (rotate:DI (match_dup 0)
8443 ;; Split a load of a large constant into the appropriate five-instruction
8444 ;; sequence. Handle anything in a constant number of insns.
8445 ;; When non-easy constants can go in the TOC, this should use
8446 ;; easy_fp_constant predicate.
8448 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8449 (match_operand:DI 1 "const_int_operand" ""))]
8450 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8451 [(set (match_dup 0) (match_dup 2))
8452 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
8454 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
8456 if (tem == operands[0])
8463 [(set (match_operand:DI 0 "gpc_reg_operand" "")
8464 (match_operand:DI 1 "const_double_operand" ""))]
8465 "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1"
8466 [(set (match_dup 0) (match_dup 2))
8467 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
8469 { rtx tem = rs6000_emit_set_const (operands[0], DImode, operands[1], 5);
8471 if (tem == operands[0])
8477 ;; Split a load of a large constant into the appropriate five-instruction
8478 (define_insn "*movdi_internal2"
8479 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
8480 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r,r")
8482 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") (match_dup 1))]
8487 [(set_attr "type" "compare")
8488 (set_attr "length" "4,8")])
8491 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
8492 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "")
8494 (set (match_operand:DI 0 "gpc_reg_operand" "") (match_dup 1))]
8495 "TARGET_POWERPC64 && reload_completed"
8496 [(set (match_dup 0) (match_dup 1))
8498 (compare:CC (match_dup 0)
8502 ;; TImode is similar, except that we usually want to compute the address into
8503 ;; a register and use lsi/stsi (the exception is during reload). MQ is also
8504 ;; clobbered in stsi for POWER, so we need a SCRATCH for it.
8505 (define_expand "movti"
8506 [(parallel [(set (match_operand:TI 0 "general_operand" "")
8507 (match_operand:TI 1 "general_operand" ""))
8508 (clobber (scratch:SI))])]
8509 "TARGET_STRING || TARGET_POWERPC64"
8510 "{ rs6000_emit_move (operands[0], operands[1], TImode); DONE; }")
8512 ;; We say that MQ is clobbered in the last alternative because the first
8513 ;; alternative would never get used otherwise since it would need a reload
8514 ;; while the 2nd alternative would not. We put memory cases first so they
8515 ;; are preferred. Otherwise, we'd try to reload the output instead of
8516 ;; giving the SCRATCH mq.
8517 (define_insn "*movti_power"
8518 [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
8519 (match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
8520 (clobber (match_scratch:SI 2 "=q,q#X,X,X,X"))]
8521 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
8522 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
8525 switch (which_alternative)
8531 return \"{stsi|stswi} %1,%P0,16\";
8534 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
8537 /* Normally copy registers with lowest numbered register copied first.
8538 But copy in the other order if the first register of the output
8539 is the second, third, or fourth register in the input. */
8540 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
8541 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
8542 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
8544 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
8546 /* If the address is not used in the output, we can use lsi. Otherwise,
8547 fall through to generating four loads. */
8548 if (! reg_overlap_mentioned_p (operands[0], operands[1]))
8549 return \"{lsi|lswi} %0,%P1,16\";
8550 /* ... fall through ... */
8552 /* If the address register is the same as the register for the lowest-
8553 addressed word, load it last. Similarly for the next two words.
8554 Otherwise load lowest address to highest. */
8555 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8557 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
8558 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
8559 REGNO (operands[0]) + 2, operands[1], 0))
8560 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
8561 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
8562 REGNO (operands[0]) + 3, operands[1], 0))
8563 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
8565 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
8568 [(set_attr "type" "store,store,*,load,load")
8569 (set_attr "length" "*,16,16,*,16")])
8571 (define_insn "*movti_string"
8572 [(set (match_operand:TI 0 "reg_or_mem_operand" "=m,????r,????r")
8573 (match_operand:TI 1 "reg_or_mem_operand" "r,r,m"))
8574 (clobber (match_scratch:SI 2 "=X,X,X"))]
8575 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
8576 && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
8579 switch (which_alternative)
8585 return \"{st%U0|stw%U0} %1,%0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0\";
8588 /* Normally copy registers with lowest numbered register copied first.
8589 But copy in the other order if the first register of the output
8590 is the second, third, or fourth register in the input. */
8591 if (REGNO (operands[0]) >= REGNO (operands[1]) + 1
8592 && REGNO (operands[0]) <= REGNO (operands[1]) + 3)
8593 return \"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %0,%1\";
8595 return \"mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1\";
8597 /* If the address register is the same as the register for the lowest-
8598 addressed word, load it last. Similarly for the next two words.
8599 Otherwise load lowest address to highest. */
8600 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8602 return \"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %0,%1\";
8603 else if (refers_to_regno_p (REGNO (operands[0]) + 1,
8604 REGNO (operands[0]) + 2, operands[1], 0))
8605 return \"{l|lwz} %0,%1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1\";
8606 else if (refers_to_regno_p (REGNO (operands[0]) + 2,
8607 REGNO (operands[0]) + 3, operands[1], 0))
8608 return \"{l|lwz} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1\";
8610 return \"{l%U1|lwz%U1} %0,%1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\";
8613 [(set_attr "type" "store,*,load")
8614 (set_attr "length" "16,16,16")])
8616 (define_insn "*movti_ppc64"
8617 [(set (match_operand:TI 0 "nonimmediate_operand" "=r,r,m")
8618 (match_operand:TI 1 "input_operand" "r,m,r"))]
8619 "TARGET_POWERPC64 && (gpc_reg_operand (operands[0], TImode)
8620 || gpc_reg_operand (operands[1], TImode))"
8623 switch (which_alternative)
8628 /* We normally copy the low-numbered register first. However, if
8629 the first register operand 0 is the same as the second register of
8630 operand 1, we must copy in the opposite order. */
8631 if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
8632 return \"mr %L0,%L1\;mr %0,%1\";
8634 return \"mr %0,%1\;mr %L0,%L1\";
8636 /* If the low-address word is used in the address, we must load it
8637 last. Otherwise, load it first. Note that we cannot have
8638 auto-increment in that case since the address register is known to be
8640 if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
8642 return \"ld %L0,%L1\;ld %0,%1\";
8644 return \"ld%U1 %0,%1\;ld %L0,%L1\";
8646 return \"std%U0 %1,%0\;std %L1,%L0\";
8649 [(set_attr "type" "*,load,store")
8650 (set_attr "length" "8,8,8")])
8652 (define_expand "load_multiple"
8653 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
8654 (match_operand:SI 1 "" ""))
8655 (use (match_operand:SI 2 "" ""))])]
8656 "TARGET_STRING && !TARGET_POWERPC64"
8664 /* Support only loading a constant number of fixed-point registers from
8665 memory and only bother with this if more than two; the machine
8666 doesn't support more than eight. */
8667 if (GET_CODE (operands[2]) != CONST_INT
8668 || INTVAL (operands[2]) <= 2
8669 || INTVAL (operands[2]) > 8
8670 || GET_CODE (operands[1]) != MEM
8671 || GET_CODE (operands[0]) != REG
8672 || REGNO (operands[0]) >= 32)
8675 count = INTVAL (operands[2]);
8676 regno = REGNO (operands[0]);
8678 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
8679 op1 = replace_equiv_address (operands[1],
8680 force_reg (SImode, XEXP (operands[1], 0)));
8682 for (i = 0; i < count; i++)
8683 XVECEXP (operands[3], 0, i)
8684 = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno + i),
8685 adjust_address (op1, SImode, i * 4));
8689 [(match_parallel 0 "load_multiple_operation"
8690 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
8691 (mem:SI (match_operand:SI 2 "gpc_reg_operand" "b")))])]
8695 /* We have to handle the case where the pseudo used to contain the address
8696 is assigned to one of the output registers. */
8698 int words = XVECLEN (operands[0], 0);
8701 if (XVECLEN (operands[0], 0) == 1)
8702 return \"{l|lwz} %1,0(%2)\";
8704 for (i = 0; i < words; i++)
8705 if (refers_to_regno_p (REGNO (operands[1]) + i,
8706 REGNO (operands[1]) + i + 1, operands[2], 0))
8710 xop[0] = operands[1];
8711 xop[1] = operands[2];
8712 xop[2] = GEN_INT (4 * (words-1));
8713 output_asm_insn (\"{lsi|lswi} %0,%1,%2\;{l|lwz} %1,%2(%1)\", xop);
8718 xop[0] = operands[1];
8719 xop[1] = gen_rtx_REG (SImode, REGNO (operands[1]) + 1);
8720 xop[2] = GEN_INT (4 * (words-1));
8721 output_asm_insn (\"{cal %0,4(%0)|addi %0,%0,4}\;{lsi|lswi} %1,%0,%2\;{l|lwz} %0,-4(%0)\", xop);
8726 for (j = 0; j < words; j++)
8729 xop[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + j);
8730 xop[1] = operands[2];
8731 xop[2] = GEN_INT (j * 4);
8732 output_asm_insn (\"{l|lwz} %0,%2(%1)\", xop);
8734 xop[0] = operands[2];
8735 xop[1] = GEN_INT (i * 4);
8736 output_asm_insn (\"{l|lwz} %0,%1(%0)\", xop);
8741 return \"{lsi|lswi} %1,%2,%N0\";
8743 [(set_attr "type" "load")
8744 (set_attr "length" "32")])
8747 (define_expand "store_multiple"
8748 [(match_par_dup 3 [(set (match_operand:SI 0 "" "")
8749 (match_operand:SI 1 "" ""))
8750 (clobber (scratch:SI))
8751 (use (match_operand:SI 2 "" ""))])]
8752 "TARGET_STRING && !TARGET_POWERPC64"
8761 /* Support only storing a constant number of fixed-point registers to
8762 memory and only bother with this if more than two; the machine
8763 doesn't support more than eight. */
8764 if (GET_CODE (operands[2]) != CONST_INT
8765 || INTVAL (operands[2]) <= 2
8766 || INTVAL (operands[2]) > 8
8767 || GET_CODE (operands[0]) != MEM
8768 || GET_CODE (operands[1]) != REG
8769 || REGNO (operands[1]) >= 32)
8772 count = INTVAL (operands[2]);
8773 regno = REGNO (operands[1]);
8775 operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count + 1));
8776 to = force_reg (SImode, XEXP (operands[0], 0));
8777 op0 = replace_equiv_address (operands[0], to);
8779 XVECEXP (operands[3], 0, 0)
8780 = gen_rtx_SET (VOIDmode, adjust_address (op0, SImode, 0), operands[1]);
8781 XVECEXP (operands[3], 0, 1) = gen_rtx_CLOBBER (VOIDmode,
8782 gen_rtx_SCRATCH (SImode));
8784 for (i = 1; i < count; i++)
8785 XVECEXP (operands[3], 0, i + 1)
8786 = gen_rtx_SET (VOIDmode,
8787 adjust_address (op0, SImode, i * 4),
8788 gen_rtx_REG (SImode, regno + i));
8792 [(match_parallel 0 "store_multiple_operation"
8793 [(set (match_operand:SI 1 "indirect_operand" "=Q")
8794 (match_operand:SI 2 "gpc_reg_operand" "r"))
8795 (clobber (match_scratch:SI 3 "=q"))])]
8796 "TARGET_STRING && TARGET_POWER"
8797 "{stsi|stswi} %2,%P1,%O0"
8798 [(set_attr "type" "store")])
8801 [(match_parallel 0 "store_multiple_operation"
8802 [(set (mem:SI (match_operand:SI 1 "gpc_reg_operand" "b"))
8803 (match_operand:SI 2 "gpc_reg_operand" "r"))
8804 (clobber (match_scratch:SI 3 "X"))])]
8805 "TARGET_STRING && ! TARGET_POWER"
8806 "{stsi|stswi} %2,%1,%O0"
8807 [(set_attr "type" "store")])
8810 ;; String/block move insn.
8811 ;; Argument 0 is the destination
8812 ;; Argument 1 is the source
8813 ;; Argument 2 is the length
8814 ;; Argument 3 is the alignment
8816 (define_expand "movstrsi"
8817 [(parallel [(set (match_operand:BLK 0 "" "")
8818 (match_operand:BLK 1 "" ""))
8819 (use (match_operand:SI 2 "" ""))
8820 (use (match_operand:SI 3 "" ""))])]
8824 if (expand_block_move (operands))
8830 ;; Move up to 32 bytes at a time. The fixed registers are needed because the
8831 ;; register allocator doesn't have a clue about allocating 8 word registers.
8832 ;; rD/rS = r5 is preferred, efficient form.
8833 (define_expand "movstrsi_8reg"
8834 [(parallel [(set (match_operand 0 "" "")
8835 (match_operand 1 "" ""))
8836 (use (match_operand 2 "" ""))
8837 (use (match_operand 3 "" ""))
8838 (clobber (reg:SI 5))
8839 (clobber (reg:SI 6))
8840 (clobber (reg:SI 7))
8841 (clobber (reg:SI 8))
8842 (clobber (reg:SI 9))
8843 (clobber (reg:SI 10))
8844 (clobber (reg:SI 11))
8845 (clobber (reg:SI 12))
8846 (clobber (match_scratch:SI 4 ""))])]
8851 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
8852 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
8853 (use (match_operand:SI 2 "immediate_operand" "i"))
8854 (use (match_operand:SI 3 "immediate_operand" "i"))
8855 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8856 (clobber (reg:SI 6))
8857 (clobber (reg:SI 7))
8858 (clobber (reg:SI 8))
8859 (clobber (reg:SI 9))
8860 (clobber (reg:SI 10))
8861 (clobber (reg:SI 11))
8862 (clobber (reg:SI 12))
8863 (clobber (match_scratch:SI 5 "=q"))]
8864 "TARGET_STRING && TARGET_POWER
8865 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
8866 || INTVAL (operands[2]) == 0)
8867 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
8868 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
8869 && REGNO (operands[4]) == 5"
8870 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
8871 [(set_attr "type" "load")
8872 (set_attr "length" "8")])
8875 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
8876 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
8877 (use (match_operand:SI 2 "immediate_operand" "i"))
8878 (use (match_operand:SI 3 "immediate_operand" "i"))
8879 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8880 (clobber (reg:SI 6))
8881 (clobber (reg:SI 7))
8882 (clobber (reg:SI 8))
8883 (clobber (reg:SI 9))
8884 (clobber (reg:SI 10))
8885 (clobber (reg:SI 11))
8886 (clobber (reg:SI 12))
8887 (clobber (match_scratch:SI 5 "X"))]
8888 "TARGET_STRING && ! TARGET_POWER
8889 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
8890 || INTVAL (operands[2]) == 0)
8891 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
8892 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
8893 && REGNO (operands[4]) == 5"
8894 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
8895 [(set_attr "type" "load")
8896 (set_attr "length" "8")])
8899 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
8900 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
8901 (use (match_operand:SI 2 "immediate_operand" "i"))
8902 (use (match_operand:SI 3 "immediate_operand" "i"))
8903 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8904 (clobber (reg:SI 6))
8905 (clobber (reg:SI 7))
8906 (clobber (reg:SI 8))
8907 (clobber (reg:SI 9))
8908 (clobber (reg:SI 10))
8909 (clobber (reg:SI 11))
8910 (clobber (reg:SI 12))
8911 (clobber (match_scratch:SI 5 "X"))]
8912 "TARGET_STRING && TARGET_POWERPC64
8913 && ((INTVAL (operands[2]) > 24 && INTVAL (operands[2]) < 32)
8914 || INTVAL (operands[2]) == 0)
8915 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 12)
8916 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 12)
8917 && REGNO (operands[4]) == 5"
8918 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
8919 [(set_attr "type" "load")
8920 (set_attr "length" "8")])
8922 ;; Move up to 24 bytes at a time. The fixed registers are needed because the
8923 ;; register allocator doesn't have a clue about allocating 6 word registers.
8924 ;; rD/rS = r5 is preferred, efficient form.
8925 (define_expand "movstrsi_6reg"
8926 [(parallel [(set (match_operand 0 "" "")
8927 (match_operand 1 "" ""))
8928 (use (match_operand 2 "" ""))
8929 (use (match_operand 3 "" ""))
8930 (clobber (reg:SI 5))
8931 (clobber (reg:SI 6))
8932 (clobber (reg:SI 7))
8933 (clobber (reg:SI 8))
8934 (clobber (reg:SI 9))
8935 (clobber (reg:SI 10))
8936 (clobber (match_scratch:SI 4 ""))])]
8941 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
8942 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
8943 (use (match_operand:SI 2 "immediate_operand" "i"))
8944 (use (match_operand:SI 3 "immediate_operand" "i"))
8945 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8946 (clobber (reg:SI 6))
8947 (clobber (reg:SI 7))
8948 (clobber (reg:SI 8))
8949 (clobber (reg:SI 9))
8950 (clobber (reg:SI 10))
8951 (clobber (match_scratch:SI 5 "=q"))]
8952 "TARGET_STRING && TARGET_POWER
8953 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 24
8954 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
8955 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
8956 && REGNO (operands[4]) == 5"
8957 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
8958 [(set_attr "type" "load")
8959 (set_attr "length" "8")])
8962 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
8963 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
8964 (use (match_operand:SI 2 "immediate_operand" "i"))
8965 (use (match_operand:SI 3 "immediate_operand" "i"))
8966 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8967 (clobber (reg:SI 6))
8968 (clobber (reg:SI 7))
8969 (clobber (reg:SI 8))
8970 (clobber (reg:SI 9))
8971 (clobber (reg:SI 10))
8972 (clobber (match_scratch:SI 5 "X"))]
8973 "TARGET_STRING && ! TARGET_POWER
8974 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
8975 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
8976 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
8977 && REGNO (operands[4]) == 5"
8978 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
8979 [(set_attr "type" "load")
8980 (set_attr "length" "8")])
8983 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
8984 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
8985 (use (match_operand:SI 2 "immediate_operand" "i"))
8986 (use (match_operand:SI 3 "immediate_operand" "i"))
8987 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
8988 (clobber (reg:SI 6))
8989 (clobber (reg:SI 7))
8990 (clobber (reg:SI 8))
8991 (clobber (reg:SI 9))
8992 (clobber (reg:SI 10))
8993 (clobber (match_scratch:SI 5 "X"))]
8994 "TARGET_STRING && TARGET_POWERPC64
8995 && INTVAL (operands[2]) > 16 && INTVAL (operands[2]) <= 32
8996 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 10)
8997 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 10)
8998 && REGNO (operands[4]) == 5"
8999 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9000 [(set_attr "type" "load")
9001 (set_attr "length" "8")])
9003 ;; Move up to 16 bytes at a time, using 4 fixed registers to avoid spill
9004 ;; problems with TImode.
9005 ;; rD/rS = r5 is preferred, efficient form.
9006 (define_expand "movstrsi_4reg"
9007 [(parallel [(set (match_operand 0 "" "")
9008 (match_operand 1 "" ""))
9009 (use (match_operand 2 "" ""))
9010 (use (match_operand 3 "" ""))
9011 (clobber (reg:SI 5))
9012 (clobber (reg:SI 6))
9013 (clobber (reg:SI 7))
9014 (clobber (reg:SI 8))
9015 (clobber (match_scratch:SI 4 ""))])]
9020 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9021 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9022 (use (match_operand:SI 2 "immediate_operand" "i"))
9023 (use (match_operand:SI 3 "immediate_operand" "i"))
9024 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9025 (clobber (reg:SI 6))
9026 (clobber (reg:SI 7))
9027 (clobber (reg:SI 8))
9028 (clobber (match_scratch:SI 5 "=q"))]
9029 "TARGET_STRING && TARGET_POWER
9030 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9031 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9032 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9033 && REGNO (operands[4]) == 5"
9034 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9035 [(set_attr "type" "load")
9036 (set_attr "length" "8")])
9039 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9040 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9041 (use (match_operand:SI 2 "immediate_operand" "i"))
9042 (use (match_operand:SI 3 "immediate_operand" "i"))
9043 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9044 (clobber (reg:SI 6))
9045 (clobber (reg:SI 7))
9046 (clobber (reg:SI 8))
9047 (clobber (match_scratch:SI 5 "X"))]
9048 "TARGET_STRING && ! TARGET_POWER
9049 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9050 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9051 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9052 && REGNO (operands[4]) == 5"
9053 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9054 [(set_attr "type" "load")
9055 (set_attr "length" "8")])
9058 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9059 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9060 (use (match_operand:SI 2 "immediate_operand" "i"))
9061 (use (match_operand:SI 3 "immediate_operand" "i"))
9062 (clobber (match_operand:SI 4 "gpc_reg_operand" "=r"))
9063 (clobber (reg:SI 6))
9064 (clobber (reg:SI 7))
9065 (clobber (reg:SI 8))
9066 (clobber (match_scratch:SI 5 "X"))]
9067 "TARGET_STRING && TARGET_POWERPC64
9068 && INTVAL (operands[2]) > 8 && INTVAL (operands[2]) <= 16
9069 && (REGNO (operands[0]) < 5 || REGNO (operands[0]) > 8)
9070 && (REGNO (operands[1]) < 5 || REGNO (operands[1]) > 8)
9071 && REGNO (operands[4]) == 5"
9072 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9073 [(set_attr "type" "load")
9074 (set_attr "length" "8")])
9076 ;; Move up to 8 bytes at a time.
9077 (define_expand "movstrsi_2reg"
9078 [(parallel [(set (match_operand 0 "" "")
9079 (match_operand 1 "" ""))
9080 (use (match_operand 2 "" ""))
9081 (use (match_operand 3 "" ""))
9082 (clobber (match_scratch:DI 4 ""))
9083 (clobber (match_scratch:SI 5 ""))])]
9084 "TARGET_STRING && ! TARGET_POWERPC64"
9088 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9089 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9090 (use (match_operand:SI 2 "immediate_operand" "i"))
9091 (use (match_operand:SI 3 "immediate_operand" "i"))
9092 (clobber (match_scratch:DI 4 "=&r"))
9093 (clobber (match_scratch:SI 5 "=q"))]
9094 "TARGET_STRING && TARGET_POWER && ! TARGET_POWERPC64
9095 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9096 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9097 [(set_attr "type" "load")
9098 (set_attr "length" "8")])
9101 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9102 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9103 (use (match_operand:SI 2 "immediate_operand" "i"))
9104 (use (match_operand:SI 3 "immediate_operand" "i"))
9105 (clobber (match_scratch:DI 4 "=&r"))
9106 (clobber (match_scratch:SI 5 "X"))]
9107 "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
9108 && INTVAL (operands[2]) > 4 && INTVAL (operands[2]) <= 8"
9109 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9110 [(set_attr "type" "load")
9111 (set_attr "length" "8")])
9113 ;; Move up to 4 bytes at a time.
9114 (define_expand "movstrsi_1reg"
9115 [(parallel [(set (match_operand 0 "" "")
9116 (match_operand 1 "" ""))
9117 (use (match_operand 2 "" ""))
9118 (use (match_operand 3 "" ""))
9119 (clobber (match_scratch:SI 4 ""))
9120 (clobber (match_scratch:SI 5 ""))])]
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_scratch:SI 4 "=&r"))
9130 (clobber (match_scratch:SI 5 "=q"))]
9131 "TARGET_STRING && TARGET_POWER
9132 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9133 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9134 [(set_attr "type" "load")
9135 (set_attr "length" "8")])
9138 [(set (mem:BLK (match_operand:SI 0 "gpc_reg_operand" "b"))
9139 (mem:BLK (match_operand:SI 1 "gpc_reg_operand" "b")))
9140 (use (match_operand:SI 2 "immediate_operand" "i"))
9141 (use (match_operand:SI 3 "immediate_operand" "i"))
9142 (clobber (match_scratch:SI 4 "=&r"))
9143 (clobber (match_scratch:SI 5 "X"))]
9144 "TARGET_STRING && ! TARGET_POWER
9145 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9146 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9147 [(set_attr "type" "load")
9148 (set_attr "length" "8")])
9151 [(set (mem:BLK (match_operand:DI 0 "gpc_reg_operand" "b"))
9152 (mem:BLK (match_operand:DI 1 "gpc_reg_operand" "b")))
9153 (use (match_operand:SI 2 "immediate_operand" "i"))
9154 (use (match_operand:SI 3 "immediate_operand" "i"))
9155 (clobber (match_scratch:SI 4 "=&r"))
9156 (clobber (match_scratch:SI 5 "X"))]
9157 "TARGET_STRING && TARGET_POWERPC64
9158 && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) <= 4"
9159 "{lsi|lswi} %4,%1,%2\;{stsi|stswi} %4,%0,%2"
9160 [(set_attr "type" "load")
9161 (set_attr "length" "8")])
9164 ;; Define insns that do load or store with update. Some of these we can
9165 ;; get by using pre-decrement or pre-increment, but the hardware can also
9166 ;; do cases where the increment is not the size of the object.
9168 ;; In all these cases, we use operands 0 and 1 for the register being
9169 ;; incremented because those are the operands that local-alloc will
9170 ;; tie and these are the pair most likely to be tieable (and the ones
9171 ;; that will benefit the most).
9173 (define_insn "*movdi_update1"
9174 [(set (match_operand:DI 3 "gpc_reg_operand" "=r,r")
9175 (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9176 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I"))))
9177 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9178 (plus:DI (match_dup 1) (match_dup 2)))]
9179 "TARGET_POWERPC64 && TARGET_UPDATE"
9183 [(set_attr "type" "load")])
9185 (define_insn "*movdi_update2"
9186 [(set (match_operand:DI 3 "gpc_reg_operand" "=r")
9188 (mem:SI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0")
9189 (match_operand:DI 2 "gpc_reg_operand" "r")))))
9190 (set (match_operand:DI 0 "gpc_reg_operand" "=b")
9191 (plus:DI (match_dup 1) (match_dup 2)))]
9194 [(set_attr "type" "load")])
9196 (define_insn "movdi_update"
9197 [(set (mem:DI (plus:DI (match_operand:DI 1 "gpc_reg_operand" "0,0")
9198 (match_operand:DI 2 "reg_or_aligned_short_operand" "r,I")))
9199 (match_operand:DI 3 "gpc_reg_operand" "r,r"))
9200 (set (match_operand:DI 0 "gpc_reg_operand" "=b,b")
9201 (plus:DI (match_dup 1) (match_dup 2)))]
9202 "TARGET_POWERPC64 && TARGET_UPDATE"
9206 [(set_attr "type" "store")])
9208 (define_insn "*movsi_update1"
9209 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9210 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9211 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9212 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9213 (plus:SI (match_dup 1) (match_dup 2)))]
9216 {lux|lwzux} %3,%0,%2
9217 {lu|lwzu} %3,%2(%0)"
9218 [(set_attr "type" "load")])
9220 (define_insn "movsi_update"
9221 [(set (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9222 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9223 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
9224 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9225 (plus:SI (match_dup 1) (match_dup 2)))]
9228 {stux|stwux} %3,%0,%2
9229 {stu|stwu} %3,%2(%0)"
9230 [(set_attr "type" "store")])
9232 (define_insn "*movhi_update"
9233 [(set (match_operand:HI 3 "gpc_reg_operand" "=r,r")
9234 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9235 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9236 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9237 (plus:SI (match_dup 1) (match_dup 2)))]
9242 [(set_attr "type" "load")])
9244 (define_insn "*movhi_update2"
9245 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9247 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9248 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9249 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9250 (plus:SI (match_dup 1) (match_dup 2)))]
9255 [(set_attr "type" "load")])
9257 (define_insn "*movhi_update3"
9258 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9260 (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9261 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9262 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9263 (plus:SI (match_dup 1) (match_dup 2)))]
9268 [(set_attr "type" "load")])
9270 (define_insn "*movhi_update4"
9271 [(set (mem:HI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9272 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9273 (match_operand:HI 3 "gpc_reg_operand" "r,r"))
9274 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9275 (plus:SI (match_dup 1) (match_dup 2)))]
9280 [(set_attr "type" "store")])
9282 (define_insn "*movqi_update1"
9283 [(set (match_operand:QI 3 "gpc_reg_operand" "=r,r")
9284 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9285 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9286 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9287 (plus:SI (match_dup 1) (match_dup 2)))]
9292 [(set_attr "type" "load")])
9294 (define_insn "*movqi_update2"
9295 [(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
9297 (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9298 (match_operand:SI 2 "reg_or_short_operand" "r,I")))))
9299 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9300 (plus:SI (match_dup 1) (match_dup 2)))]
9305 [(set_attr "type" "load")])
9307 (define_insn "*movqi_update3"
9308 [(set (mem:QI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9309 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9310 (match_operand:QI 3 "gpc_reg_operand" "r,r"))
9311 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9312 (plus:SI (match_dup 1) (match_dup 2)))]
9317 [(set_attr "type" "store")])
9319 (define_insn "*movsf_update1"
9320 [(set (match_operand:SF 3 "gpc_reg_operand" "=f,f")
9321 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9322 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9323 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9324 (plus:SI (match_dup 1) (match_dup 2)))]
9325 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9329 [(set_attr "type" "fpload")])
9331 (define_insn "*movsf_update2"
9332 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9333 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9334 (match_operand:SF 3 "gpc_reg_operand" "f,f"))
9335 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9336 (plus:SI (match_dup 1) (match_dup 2)))]
9337 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9341 [(set_attr "type" "fpstore")])
9343 (define_insn "*movsf_update3"
9344 [(set (match_operand:SF 3 "gpc_reg_operand" "=r,r")
9345 (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9346 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9347 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9348 (plus:SI (match_dup 1) (match_dup 2)))]
9349 "TARGET_SOFT_FLOAT && TARGET_UPDATE"
9351 {lux|lwzux} %3,%0,%2
9352 {lu|lwzu} %3,%2(%0)"
9353 [(set_attr "type" "load")])
9355 (define_insn "*movsf_update4"
9356 [(set (mem:SF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9357 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9358 (match_operand:SF 3 "gpc_reg_operand" "r,r"))
9359 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9360 (plus:SI (match_dup 1) (match_dup 2)))]
9361 "TARGET_SOFT_FLOAT && TARGET_UPDATE"
9363 {stux|stwux} %3,%0,%2
9364 {stu|stwu} %3,%2(%0)"
9365 [(set_attr "type" "store")])
9367 (define_insn "*movdf_update1"
9368 [(set (match_operand:DF 3 "gpc_reg_operand" "=f,f")
9369 (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9370 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))
9371 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9372 (plus:SI (match_dup 1) (match_dup 2)))]
9373 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9377 [(set_attr "type" "fpload")])
9379 (define_insn "*movdf_update2"
9380 [(set (mem:DF (plus:SI (match_operand:SI 1 "gpc_reg_operand" "0,0")
9381 (match_operand:SI 2 "reg_or_short_operand" "r,I")))
9382 (match_operand:DF 3 "gpc_reg_operand" "f,f"))
9383 (set (match_operand:SI 0 "gpc_reg_operand" "=b,b")
9384 (plus:SI (match_dup 1) (match_dup 2)))]
9385 "TARGET_HARD_FLOAT && TARGET_UPDATE"
9389 [(set_attr "type" "fpstore")])
9391 ;; Peephole to convert two consecutive FP loads or stores into lfq/stfq.
9394 [(set (match_operand:DF 0 "gpc_reg_operand" "=f")
9395 (match_operand:DF 1 "memory_operand" ""))
9396 (set (match_operand:DF 2 "gpc_reg_operand" "=f")
9397 (match_operand:DF 3 "memory_operand" ""))]
9399 && TARGET_HARD_FLOAT
9400 && registers_ok_for_quad_peep (operands[0], operands[2])
9401 && ! MEM_VOLATILE_P (operands[1]) && ! MEM_VOLATILE_P (operands[3])
9402 && addrs_ok_for_quad_peep (XEXP (operands[1], 0), XEXP (operands[3], 0))"
9406 [(set (match_operand:DF 0 "memory_operand" "")
9407 (match_operand:DF 1 "gpc_reg_operand" "f"))
9408 (set (match_operand:DF 2 "memory_operand" "")
9409 (match_operand:DF 3 "gpc_reg_operand" "f"))]
9411 && TARGET_HARD_FLOAT
9412 && registers_ok_for_quad_peep (operands[1], operands[3])
9413 && ! MEM_VOLATILE_P (operands[0]) && ! MEM_VOLATILE_P (operands[2])
9414 && addrs_ok_for_quad_peep (XEXP (operands[0], 0), XEXP (operands[2], 0))"
9417 ;; Next come insns related to the calling sequence.
9419 ;; First, an insn to allocate new stack space for dynamic use (e.g., alloca).
9420 ;; We move the back-chain and decrement the stack pointer.
9422 (define_expand "allocate_stack"
9423 [(set (match_operand 0 "gpc_reg_operand" "=r")
9424 (minus (reg 1) (match_operand 1 "reg_or_short_operand" "")))
9426 (minus (reg 1) (match_dup 1)))]
9429 { rtx chain = gen_reg_rtx (Pmode);
9430 rtx stack_bot = gen_rtx_MEM (Pmode, stack_pointer_rtx);
9433 emit_move_insn (chain, stack_bot);
9435 /* Check stack bounds if necessary. */
9436 if (current_function_limit_stack)
9439 available = expand_binop (Pmode, sub_optab,
9440 stack_pointer_rtx, stack_limit_rtx,
9441 NULL_RTX, 1, OPTAB_WIDEN);
9442 emit_insn (gen_cond_trap (LTU, available, operands[1], const0_rtx));
9445 if (GET_CODE (operands[1]) != CONST_INT
9446 || INTVAL (operands[1]) < -32767
9447 || INTVAL (operands[1]) > 32768)
9449 neg_op0 = gen_reg_rtx (Pmode);
9451 emit_insn (gen_negsi2 (neg_op0, operands[1]));
9453 emit_insn (gen_negdi2 (neg_op0, operands[1]));
9456 neg_op0 = GEN_INT (- INTVAL (operands[1]));
9459 emit_insn ((* ((TARGET_32BIT) ? gen_movsi_update : gen_movdi_update))
9460 (stack_pointer_rtx, stack_pointer_rtx, neg_op0, chain));
9464 emit_insn ((* ((TARGET_32BIT) ? gen_addsi3 : gen_adddi3))
9465 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
9466 emit_move_insn (gen_rtx_MEM (Pmode, stack_pointer_rtx), chain);
9469 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
9473 ;; These patterns say how to save and restore the stack pointer. We need not
9474 ;; save the stack pointer at function level since we are careful to
9475 ;; preserve the backchain. At block level, we have to restore the backchain
9476 ;; when we restore the stack pointer.
9478 ;; For nonlocal gotos, we must save both the stack pointer and its
9479 ;; backchain and restore both. Note that in the nonlocal case, the
9480 ;; save area is a memory location.
9482 (define_expand "save_stack_function"
9483 [(match_operand 0 "any_operand" "")
9484 (match_operand 1 "any_operand" "")]
9488 (define_expand "restore_stack_function"
9489 [(match_operand 0 "any_operand" "")
9490 (match_operand 1 "any_operand" "")]
9494 (define_expand "restore_stack_block"
9495 [(use (match_operand 0 "register_operand" ""))
9496 (set (match_dup 2) (match_dup 3))
9497 (set (match_dup 0) (match_operand 1 "register_operand" ""))
9498 (set (match_dup 3) (match_dup 2))]
9502 operands[2] = gen_reg_rtx (Pmode);
9503 operands[3] = gen_rtx_MEM (Pmode, operands[0]);
9506 (define_expand "save_stack_nonlocal"
9507 [(match_operand 0 "memory_operand" "")
9508 (match_operand 1 "register_operand" "")]
9512 rtx temp = gen_reg_rtx (Pmode);
9514 /* Copy the backchain to the first word, sp to the second. */
9515 emit_move_insn (temp, gen_rtx_MEM (Pmode, operands[1]));
9516 emit_move_insn (operand_subword (operands[0], 0, 0,
9517 (TARGET_32BIT ? DImode : TImode)),
9519 emit_move_insn (operand_subword (operands[0], 1, 0, (TARGET_32BIT ? DImode : TImode)),
9524 (define_expand "restore_stack_nonlocal"
9525 [(match_operand 0 "register_operand" "")
9526 (match_operand 1 "memory_operand" "")]
9530 rtx temp = gen_reg_rtx (Pmode);
9532 /* Restore the backchain from the first word, sp from the second. */
9533 emit_move_insn (temp,
9534 operand_subword (operands[1], 0, 0, (TARGET_32BIT ? DImode : TImode)));
9535 emit_move_insn (operands[0],
9536 operand_subword (operands[1], 1, 0,
9537 (TARGET_32BIT ? DImode : TImode)));
9538 emit_move_insn (gen_rtx_MEM (Pmode, operands[0]), temp);
9542 ;; TOC register handling.
9544 ;; Code to initialize the TOC register...
9546 (define_insn "load_toc_aix_si"
9547 [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
9548 (unspec:SI [(const_int 0)] 7))
9550 "DEFAULT_ABI == ABI_AIX && TARGET_32BIT"
9554 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
9555 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
9556 operands[2] = gen_rtx_REG (Pmode, 2);
9557 return \"{l|lwz} %0,%1(%2)\";
9559 [(set_attr "type" "load")])
9561 (define_insn "load_toc_aix_di"
9562 [(parallel [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
9563 (unspec:DI [(const_int 0)] 7))
9565 "DEFAULT_ABI == ABI_AIX && TARGET_64BIT"
9569 #ifdef TARGET_RELOCATABLE
9570 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\",
9571 !TARGET_MINIMAL_TOC || TARGET_RELOCATABLE);
9573 ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
9576 strcat (buf, \"@toc\");
9577 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
9578 operands[2] = gen_rtx_REG (Pmode, 2);
9579 return \"ld %0,%1(%2)\";
9581 [(set_attr "type" "load")])
9583 (define_insn "load_toc_v4_pic_si"
9584 [(set (match_operand:SI 0 "register_operand" "=l")
9585 (unspec:SI [(const_int 0)] 7))]
9586 "DEFAULT_ABI == ABI_V4 && flag_pic == 1 && TARGET_32BIT"
9587 "bl _GLOBAL_OFFSET_TABLE_@local-4"
9588 [(set_attr "type" "branch")
9589 (set_attr "length" "4")])
9591 (define_insn "load_toc_v4_PIC_1"
9592 [(set (match_operand:SI 0 "register_operand" "=l")
9593 (match_operand:SI 1 "immediate_operand" "s"))
9594 (unspec [(match_dup 1)] 7)]
9595 "TARGET_ELF && flag_pic == 2"
9597 [(set_attr "type" "branch")
9598 (set_attr "length" "4")])
9600 (define_insn "load_toc_v4_PIC_1b"
9601 [(set (match_operand:SI 0 "register_operand" "=l")
9602 (match_operand:SI 1 "immediate_operand" "s"))
9603 (unspec [(match_dup 1) (match_operand 2 "immediate_operand" "s")] 6)]
9604 "TARGET_ELF && flag_pic == 2"
9605 "bl %1\\n\\t.long %2-%1+4\\n%1:"
9606 [(set_attr "type" "branch")
9607 (set_attr "length" "8")])
9609 (define_insn "load_toc_v4_PIC_2"
9610 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
9611 (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r")
9612 (minus:SI (match_operand:SI 2 "immediate_operand" "s")
9613 (match_operand:SI 3 "immediate_operand" "s")))))]
9614 "TARGET_ELF && flag_pic == 2"
9615 "{l|lwz} %0,%2-%3(%1)"
9616 [(set_attr "type" "load")])
9618 (define_insn "load_macho_picbase"
9619 [(set (match_operand:SI 0 "register_operand" "=l")
9620 (unspec:SI [(const_int 0)] 15))]
9621 "(DEFAULT_ABI == ABI_DARWIN) && flag_pic"
9625 char *picbase = machopic_function_base_name ();
9626 operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
9628 return \"bcl 20,31,%1\\n%1:\";
9630 [(set_attr "type" "branch")
9631 (set_attr "length" "4")])
9633 ;; If the TOC is shared over a translation unit, as happens with all
9634 ;; the kinds of PIC that we support, we need to restore the TOC
9635 ;; pointer only when jumping over units of translation.
9637 (define_expand "builtin_setjmp_receiver"
9638 [(use (label_ref (match_operand 0 "" "")))]
9639 "(DEFAULT_ABI == ABI_V4 && flag_pic == 1)
9640 || (TARGET_TOC && TARGET_MINIMAL_TOC)"
9643 rs6000_emit_load_toc_table (FALSE);
9647 ;; A function pointer under AIX is a pointer to a data area whose first word
9648 ;; contains the actual address of the function, whose second word contains a
9649 ;; pointer to its TOC, and whose third word contains a value to place in the
9650 ;; static chain register (r11). Note that if we load the static chain, our
9651 ;; "trampoline" need not have any executable code.
9653 (define_expand "call_indirect_aix32"
9655 (mem:SI (match_operand:SI 0 "gpc_reg_operand" "")))
9656 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
9659 (mem:SI (plus:SI (match_dup 0)
9662 (mem:SI (plus:SI (match_dup 0)
9664 (parallel [(call (mem:SI (match_dup 2))
9665 (match_operand 1 "" ""))
9669 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9670 (clobber (scratch:SI))])]
9673 { operands[2] = gen_reg_rtx (SImode); }")
9675 (define_expand "call_indirect_aix64"
9677 (mem:DI (match_operand:DI 0 "gpc_reg_operand" "")))
9678 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
9681 (mem:DI (plus:DI (match_dup 0)
9684 (mem:DI (plus:DI (match_dup 0)
9686 (parallel [(call (mem:SI (match_dup 2))
9687 (match_operand 1 "" ""))
9691 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
9692 (clobber (scratch:SI))])]
9695 { operands[2] = gen_reg_rtx (DImode); }")
9697 (define_expand "call_value_indirect_aix32"
9699 (mem:SI (match_operand:SI 1 "gpc_reg_operand" "")))
9700 (set (mem:SI (plus:SI (reg:SI 1) (const_int 20)))
9703 (mem:SI (plus:SI (match_dup 1)
9706 (mem:SI (plus:SI (match_dup 1)
9708 (parallel [(set (match_operand 0 "" "")
9709 (call (mem:SI (match_dup 3))
9710 (match_operand 2 "" "")))
9714 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9715 (clobber (scratch:SI))])]
9718 { operands[3] = gen_reg_rtx (SImode); }")
9720 (define_expand "call_value_indirect_aix64"
9722 (mem:DI (match_operand:DI 1 "gpc_reg_operand" "")))
9723 (set (mem:DI (plus:DI (reg:DI 1) (const_int 40)))
9726 (mem:DI (plus:DI (match_dup 1)
9729 (mem:DI (plus:DI (match_dup 1)
9731 (parallel [(set (match_operand 0 "" "")
9732 (call (mem:SI (match_dup 3))
9733 (match_operand 2 "" "")))
9737 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
9738 (clobber (scratch:SI))])]
9741 { operands[3] = gen_reg_rtx (DImode); }")
9743 ;; Now the definitions for the call and call_value insns
9744 (define_expand "call"
9745 [(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
9746 (match_operand 1 "" ""))
9747 (use (match_operand 2 "" ""))
9748 (clobber (scratch:SI))])]
9754 operands[0] = machopic_indirect_call_target (operands[0]);
9757 if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT)
9760 operands[0] = XEXP (operands[0], 0);
9762 if (GET_CODE (operands[0]) != SYMBOL_REF
9763 || (INTVAL (operands[2]) & CALL_LONG) != 0)
9765 if (INTVAL (operands[2]) & CALL_LONG)
9766 operands[0] = rs6000_longcall_ref (operands[0]);
9768 if (DEFAULT_ABI == ABI_V4
9769 || DEFAULT_ABI == ABI_AIX_NODESC
9770 || DEFAULT_ABI == ABI_DARWIN)
9771 operands[0] = force_reg (Pmode, operands[0]);
9773 else if (DEFAULT_ABI == ABI_AIX)
9775 /* AIX function pointers are really pointers to a three word
9777 emit_call_insn (TARGET_32BIT
9778 ? gen_call_indirect_aix32 (force_reg (SImode,
9781 : gen_call_indirect_aix64 (force_reg (DImode,
9791 (define_expand "call_value"
9792 [(parallel [(set (match_operand 0 "" "")
9793 (call (mem:SI (match_operand 1 "address_operand" ""))
9794 (match_operand 2 "" "")))
9795 (use (match_operand 3 "" ""))
9796 (clobber (scratch:SI))])]
9802 operands[1] = machopic_indirect_call_target (operands[1]);
9805 if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT)
9808 operands[1] = XEXP (operands[1], 0);
9810 if (GET_CODE (operands[1]) != SYMBOL_REF
9811 || (INTVAL (operands[3]) & CALL_LONG) != 0)
9813 if (INTVAL (operands[3]) & CALL_LONG)
9814 operands[1] = rs6000_longcall_ref (operands[1]);
9816 if (DEFAULT_ABI == ABI_V4
9817 || DEFAULT_ABI == ABI_AIX_NODESC
9818 || DEFAULT_ABI == ABI_DARWIN)
9819 operands[0] = force_reg (Pmode, operands[0]);
9821 else if (DEFAULT_ABI == ABI_AIX)
9823 /* AIX function pointers are really pointers to a three word
9825 emit_call_insn (TARGET_32BIT
9826 ? gen_call_value_indirect_aix32 (operands[0],
9830 : gen_call_value_indirect_aix64 (operands[0],
9841 ;; Call to function in current module. No TOC pointer reload needed.
9842 ;; Operand2 is non-zero if we are using the V.4 calling sequence and
9843 ;; either the function was not prototyped, or it was prototyped as a
9844 ;; variable argument function. It is > 0 if FP registers were passed
9845 ;; and < 0 if they were not.
9847 (define_insn "*call_local32"
9848 [(call (mem:SI (match_operand:SI 0 "current_file_function_operand" "s,s"))
9849 (match_operand 1 "" "g,g"))
9850 (use (match_operand:SI 2 "immediate_operand" "O,n"))
9851 (clobber (match_scratch:SI 3 "=l,l"))]
9852 "(INTVAL (operands[2]) & CALL_LONG) == 0"
9855 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
9856 output_asm_insn (\"crxor 6,6,6\", operands);
9858 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
9859 output_asm_insn (\"creqv 6,6,6\", operands);
9861 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
9863 [(set_attr "type" "branch")
9864 (set_attr "length" "4,8")])
9866 (define_insn "*call_local64"
9867 [(call (mem:SI (match_operand:DI 0 "current_file_function_operand" "s,s"))
9868 (match_operand 1 "" "g,g"))
9869 (use (match_operand:SI 2 "immediate_operand" "O,n"))
9870 (clobber (match_scratch:SI 3 "=l,l"))]
9871 "TARGET_64BIT && (INTVAL (operands[2]) & CALL_LONG) == 0"
9874 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
9875 output_asm_insn (\"crxor 6,6,6\", operands);
9877 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
9878 output_asm_insn (\"creqv 6,6,6\", operands);
9880 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
9882 [(set_attr "type" "branch")
9883 (set_attr "length" "4,8")])
9885 (define_insn "*call_value_local32"
9886 [(set (match_operand 0 "" "")
9887 (call (mem:SI (match_operand:SI 1 "current_file_function_operand" "s,s"))
9888 (match_operand 2 "" "g,g")))
9889 (use (match_operand:SI 3 "immediate_operand" "O,n"))
9890 (clobber (match_scratch:SI 4 "=l,l"))]
9891 "(INTVAL (operands[3]) & CALL_LONG) == 0"
9894 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
9895 output_asm_insn (\"crxor 6,6,6\", operands);
9897 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
9898 output_asm_insn (\"creqv 6,6,6\", operands);
9900 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
9902 [(set_attr "type" "branch")
9903 (set_attr "length" "4,8")])
9906 (define_insn "*call_value_local64"
9907 [(set (match_operand 0 "" "")
9908 (call (mem:SI (match_operand:DI 1 "current_file_function_operand" "s,s"))
9909 (match_operand 2 "" "g,g")))
9910 (use (match_operand:SI 3 "immediate_operand" "O,n"))
9911 (clobber (match_scratch:SI 4 "=l,l"))]
9912 "TARGET_64BIT && (INTVAL (operands[3]) & CALL_LONG) == 0"
9915 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
9916 output_asm_insn (\"crxor 6,6,6\", operands);
9918 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
9919 output_asm_insn (\"creqv 6,6,6\", operands);
9921 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@local\" : \"bl %z1\";
9923 [(set_attr "type" "branch")
9924 (set_attr "length" "4,8")])
9926 ;; Call to function which may be in another module. Restore the TOC
9927 ;; pointer (r2) after the call unless this is System V.
9928 ;; Operand2 is non-zero if we are using the V.4 calling sequence and
9929 ;; either the function was not prototyped, or it was prototyped as a
9930 ;; variable argument function. It is > 0 if FP registers were passed
9931 ;; and < 0 if they were not.
9933 (define_insn "*call_indirect_nonlocal_aix32"
9934 [(call (mem:SI (match_operand:SI 0 "register_operand" "cl"))
9935 (match_operand 1 "" "g"))
9939 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9940 (clobber (match_scratch:SI 2 "=l"))]
9941 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
9942 "b%T0l\;{l|lwz} 2,20(1)"
9943 [(set_attr "type" "jmpreg")
9944 (set_attr "length" "8")])
9946 (define_insn "*call_nonlocal_aix32"
9947 [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s"))
9948 (match_operand 1 "" "g"))
9949 (use (match_operand:SI 2 "immediate_operand" "O"))
9950 (clobber (match_scratch:SI 3 "=l"))]
9952 && DEFAULT_ABI == ABI_AIX
9953 && (INTVAL (operands[2]) & CALL_LONG) == 0"
9955 [(set_attr "type" "branch")
9956 (set_attr "length" "8")])
9958 (define_insn "*call_indirect_nonlocal_aix64"
9959 [(call (mem:SI (match_operand:DI 0 "register_operand" "cl"))
9960 (match_operand 1 "" "g"))
9964 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
9965 (clobber (match_scratch:SI 2 "=l"))]
9966 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
9968 [(set_attr "type" "jmpreg")
9969 (set_attr "length" "8")])
9971 (define_insn "*call_nonlocal_aix64"
9972 [(call (mem:SI (match_operand:DI 0 "symbol_ref_operand" "s"))
9973 (match_operand 1 "" "g"))
9974 (use (match_operand:SI 2 "immediate_operand" "O"))
9975 (clobber (match_scratch:SI 3 "=l"))]
9977 && DEFAULT_ABI == ABI_AIX
9978 && (INTVAL (operands[2]) & CALL_LONG) == 0"
9980 [(set_attr "type" "branch")
9981 (set_attr "length" "8")])
9983 (define_insn "*call_value_indirect_nonlocal_aix32"
9984 [(set (match_operand 0 "" "")
9985 (call (mem:SI (match_operand:SI 1 "register_operand" "cl"))
9986 (match_operand 2 "" "g")))
9990 (mem:SI (plus:SI (reg:SI 1) (const_int 20))))
9991 (clobber (match_scratch:SI 3 "=l"))]
9992 "TARGET_32BIT && DEFAULT_ABI == ABI_AIX"
9993 "b%T1l\;{l|lwz} 2,20(1)"
9994 [(set_attr "type" "jmpreg")
9995 (set_attr "length" "8")])
9997 (define_insn "*call_value_nonlocal_aix32"
9998 [(set (match_operand 0 "" "")
9999 (call (mem:SI (match_operand:SI 1 "symbol_ref_operand" "s"))
10000 (match_operand 2 "" "g")))
10001 (use (match_operand:SI 3 "immediate_operand" "O"))
10002 (clobber (match_scratch:SI 4 "=l"))]
10004 && DEFAULT_ABI == ABI_AIX
10005 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10007 [(set_attr "type" "branch")
10008 (set_attr "length" "8")])
10010 (define_insn "*call_value_indirect_nonlocal_aix64"
10011 [(set (match_operand 0 "" "")
10012 (call (mem:SI (match_operand:DI 1 "register_operand" "cl"))
10013 (match_operand 2 "" "g")))
10017 (mem:DI (plus:DI (reg:DI 1) (const_int 40))))
10018 (clobber (match_scratch:SI 3 "=l"))]
10019 "TARGET_64BIT && DEFAULT_ABI == ABI_AIX"
10020 "b%T1l\;ld 2,40(1)"
10021 [(set_attr "type" "jmpreg")
10022 (set_attr "length" "8")])
10024 (define_insn "*call_value_nonlocal_aix64"
10025 [(set (match_operand 0 "" "")
10026 (call (mem:SI (match_operand:DI 1 "symbol_ref_operand" "s"))
10027 (match_operand 2 "" "g")))
10028 (use (match_operand:SI 3 "immediate_operand" "O"))
10029 (clobber (match_scratch:SI 4 "=l"))]
10031 && DEFAULT_ABI == ABI_AIX
10032 && (INTVAL (operands[3]) & CALL_LONG) == 0"
10034 [(set_attr "type" "branch")
10035 (set_attr "length" "8")])
10037 ;; A function pointer under System V is just a normal pointer
10038 ;; operands[0] is the function pointer
10039 ;; operands[1] is the stack size to clean up
10040 ;; operands[2] is the value FUNCTION_ARG returns for the VOID argument
10041 ;; which indicates how to set cr1
10043 (define_insn "*call_nonlocal_sysv"
10044 [(call (mem:SI (match_operand:SI 0 "call_operand" "cl,cl,s,s"))
10045 (match_operand 1 "" "g,g,g,g"))
10046 (use (match_operand:SI 2 "immediate_operand" "O,n,O,n"))
10047 (clobber (match_scratch:SI 3 "=l,l,l,l"))]
10048 "DEFAULT_ABI == ABI_AIX_NODESC
10049 || DEFAULT_ABI == ABI_V4
10050 || DEFAULT_ABI == ABI_DARWIN"
10053 if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
10054 output_asm_insn (\"crxor 6,6,6\", operands);
10056 else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
10057 output_asm_insn (\"creqv 6,6,6\", operands);
10059 switch (which_alternative)
10068 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@plt\" : \"bl %z0\";
10071 [(set_attr "type" "jmpreg,jmpreg,branch,branch")
10072 (set_attr "length" "4,8,4,8")])
10074 (define_insn "*call_value_nonlocal_sysv"
10075 [(set (match_operand 0 "" "")
10076 (call (mem:SI (match_operand:SI 1 "call_operand" "cl,cl,s,s"))
10077 (match_operand 2 "" "g,g,g,g")))
10078 (use (match_operand:SI 3 "immediate_operand" "O,n,O,n"))
10079 (clobber (match_scratch:SI 4 "=l,l,l,l"))]
10080 "DEFAULT_ABI == ABI_AIX_NODESC
10081 || DEFAULT_ABI == ABI_V4
10082 || DEFAULT_ABI == ABI_DARWIN"
10085 if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
10086 output_asm_insn (\"crxor 6,6,6\", operands);
10088 else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
10089 output_asm_insn (\"creqv 6,6,6\", operands);
10091 switch (which_alternative)
10100 return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z1@plt\" : \"bl %z1\";
10103 [(set_attr "type" "jmpreg,jmpreg,branch,branch")
10104 (set_attr "length" "4,8,4,8")])
10106 ;; Call subroutine returning any type.
10107 (define_expand "untyped_call"
10108 [(parallel [(call (match_operand 0 "" "")
10110 (match_operand 1 "" "")
10111 (match_operand 2 "" "")])]
10117 emit_call_insn (GEN_CALL (operands[0], const0_rtx, const0_rtx, const0_rtx));
10119 for (i = 0; i < XVECLEN (operands[2], 0); i++)
10121 rtx set = XVECEXP (operands[2], 0, i);
10122 emit_move_insn (SET_DEST (set), SET_SRC (set));
10125 /* The optimizer does not know that the call sets the function value
10126 registers we stored in the result block. We avoid problems by
10127 claiming that all hard registers are used and clobbered at this
10129 emit_insn (gen_blockage ());
10134 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
10135 ;; all of memory. This blocks insns from being moved across this point.
10137 (define_insn "blockage"
10138 [(unspec_volatile [(const_int 0)] 0)]
10142 ;; Compare insns are next. Note that the RS/6000 has two types of compares,
10143 ;; signed & unsigned, and one type of branch.
10145 ;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc
10146 ;; insns, and branches. We store the operands of compares until we see
10148 (define_expand "cmpsi"
10150 (compare (match_operand:SI 0 "gpc_reg_operand" "")
10151 (match_operand:SI 1 "reg_or_short_operand" "")))]
10155 /* Take care of the possibility that operands[1] might be negative but
10156 this might be a logical operation. That insn doesn't exist. */
10157 if (GET_CODE (operands[1]) == CONST_INT
10158 && INTVAL (operands[1]) < 0)
10159 operands[1] = force_reg (SImode, operands[1]);
10161 rs6000_compare_op0 = operands[0];
10162 rs6000_compare_op1 = operands[1];
10163 rs6000_compare_fp_p = 0;
10167 (define_expand "cmpdi"
10169 (compare (match_operand:DI 0 "gpc_reg_operand" "")
10170 (match_operand:DI 1 "reg_or_short_operand" "")))]
10174 /* Take care of the possibility that operands[1] might be negative but
10175 this might be a logical operation. That insn doesn't exist. */
10176 if (GET_CODE (operands[1]) == CONST_INT
10177 && INTVAL (operands[1]) < 0)
10178 operands[1] = force_reg (DImode, operands[1]);
10180 rs6000_compare_op0 = operands[0];
10181 rs6000_compare_op1 = operands[1];
10182 rs6000_compare_fp_p = 0;
10186 (define_expand "cmpsf"
10187 [(set (cc0) (compare (match_operand:SF 0 "gpc_reg_operand" "")
10188 (match_operand:SF 1 "gpc_reg_operand" "")))]
10189 "TARGET_HARD_FLOAT"
10192 rs6000_compare_op0 = operands[0];
10193 rs6000_compare_op1 = operands[1];
10194 rs6000_compare_fp_p = 1;
10198 (define_expand "cmpdf"
10199 [(set (cc0) (compare (match_operand:DF 0 "gpc_reg_operand" "")
10200 (match_operand:DF 1 "gpc_reg_operand" "")))]
10201 "TARGET_HARD_FLOAT"
10204 rs6000_compare_op0 = operands[0];
10205 rs6000_compare_op1 = operands[1];
10206 rs6000_compare_fp_p = 1;
10210 (define_expand "cmptf"
10211 [(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "")
10212 (match_operand:TF 1 "gpc_reg_operand" "")))]
10213 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
10216 rs6000_compare_op0 = operands[0];
10217 rs6000_compare_op1 = operands[1];
10218 rs6000_compare_fp_p = 1;
10222 (define_expand "beq"
10223 [(use (match_operand 0 "" ""))]
10225 "{ rs6000_emit_cbranch (EQ, operands[0]); DONE; }")
10227 (define_expand "bne"
10228 [(use (match_operand 0 "" ""))]
10230 "{ rs6000_emit_cbranch (NE, operands[0]); DONE; }")
10232 (define_expand "bge"
10233 [(use (match_operand 0 "" ""))]
10235 "{ rs6000_emit_cbranch (GE, operands[0]); DONE; }")
10237 (define_expand "bgt"
10238 [(use (match_operand 0 "" ""))]
10240 "{ rs6000_emit_cbranch (GT, operands[0]); DONE; }")
10242 (define_expand "ble"
10243 [(use (match_operand 0 "" ""))]
10245 "{ rs6000_emit_cbranch (LE, operands[0]); DONE; }")
10247 (define_expand "blt"
10248 [(use (match_operand 0 "" ""))]
10250 "{ rs6000_emit_cbranch (LT, operands[0]); DONE; }")
10252 (define_expand "bgeu"
10253 [(use (match_operand 0 "" ""))]
10255 "{ rs6000_emit_cbranch (GEU, operands[0]); DONE; }")
10257 (define_expand "bgtu"
10258 [(use (match_operand 0 "" ""))]
10260 "{ rs6000_emit_cbranch (GTU, operands[0]); DONE; }")
10262 (define_expand "bleu"
10263 [(use (match_operand 0 "" ""))]
10265 "{ rs6000_emit_cbranch (LEU, operands[0]); DONE; }")
10267 (define_expand "bltu"
10268 [(use (match_operand 0 "" ""))]
10270 "{ rs6000_emit_cbranch (LTU, operands[0]); DONE; }")
10272 (define_expand "bunordered"
10273 [(use (match_operand 0 "" ""))]
10275 "{ rs6000_emit_cbranch (UNORDERED, operands[0]); DONE; }")
10277 (define_expand "bordered"
10278 [(use (match_operand 0 "" ""))]
10280 "{ rs6000_emit_cbranch (ORDERED, operands[0]); DONE; }")
10282 (define_expand "buneq"
10283 [(use (match_operand 0 "" ""))]
10285 "{ rs6000_emit_cbranch (UNEQ, operands[0]); DONE; }")
10287 (define_expand "bunge"
10288 [(use (match_operand 0 "" ""))]
10290 "{ rs6000_emit_cbranch (UNGE, operands[0]); DONE; }")
10292 (define_expand "bungt"
10293 [(use (match_operand 0 "" ""))]
10295 "{ rs6000_emit_cbranch (UNGT, operands[0]); DONE; }")
10297 (define_expand "bunle"
10298 [(use (match_operand 0 "" ""))]
10300 "{ rs6000_emit_cbranch (UNLE, operands[0]); DONE; }")
10302 (define_expand "bunlt"
10303 [(use (match_operand 0 "" ""))]
10305 "{ rs6000_emit_cbranch (UNLT, operands[0]); DONE; }")
10307 (define_expand "bltgt"
10308 [(use (match_operand 0 "" ""))]
10310 "{ rs6000_emit_cbranch (LTGT, operands[0]); DONE; }")
10312 ;; For SNE, we would prefer that the xor/abs sequence be used for integers.
10313 ;; For SEQ, likewise, except that comparisons with zero should be done
10314 ;; with an scc insns. However, due to the order that combine see the
10315 ;; resulting insns, we must, in fact, allow SEQ for integers. Fail in
10316 ;; the cases we don't want to handle.
10317 (define_expand "seq"
10318 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10320 "{ rs6000_emit_sCOND (EQ, operands[0]); DONE; }")
10322 (define_expand "sne"
10323 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10327 if (! rs6000_compare_fp_p)
10330 rs6000_emit_sCOND (NE, operands[0]);
10334 ;; A > 0 is best done using the portable sequence, so fail in that case.
10335 (define_expand "sgt"
10336 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10340 if (! rs6000_compare_fp_p
10341 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10344 rs6000_emit_sCOND (GT, operands[0]);
10348 ;; A < 0 is best done in the portable way for A an integer.
10349 (define_expand "slt"
10350 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10354 if (! rs6000_compare_fp_p
10355 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10358 rs6000_emit_sCOND (LT, operands[0]);
10362 ;; A >= 0 is best done the portable way for A an integer.
10363 (define_expand "sge"
10364 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10368 if (! rs6000_compare_fp_p
10369 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10372 rs6000_emit_sCOND (GE, operands[0]);
10376 ;; A <= 0 is best done the portable way for A an integer.
10377 (define_expand "sle"
10378 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10382 if (! rs6000_compare_fp_p
10383 && (! TARGET_POWER || rs6000_compare_op1 == const0_rtx))
10386 rs6000_emit_sCOND (LE, operands[0]);
10390 (define_expand "sgtu"
10391 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10393 "{ rs6000_emit_sCOND (GTU, operands[0]); DONE; }")
10395 (define_expand "sltu"
10396 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10398 "{ rs6000_emit_sCOND (LTU, operands[0]); DONE; }")
10400 (define_expand "sgeu"
10401 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10403 "{ rs6000_emit_sCOND (GEU, operands[0]); DONE; }")
10405 (define_expand "sleu"
10406 [(clobber (match_operand:SI 0 "gpc_reg_operand" ""))]
10408 "{ rs6000_emit_sCOND (LEU, operands[0]); DONE; }")
10410 ;; Here are the actual compare insns.
10411 (define_insn "*cmpsi_internal1"
10412 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
10413 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
10414 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
10416 "{cmp%I2|cmpw%I2} %0,%1,%2"
10417 [(set_attr "type" "compare")])
10419 (define_insn "*cmpdi_internal1"
10420 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
10421 (compare:CC (match_operand:DI 1 "gpc_reg_operand" "r")
10422 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
10425 [(set_attr "type" "compare")])
10427 ;; If we are comparing a register for equality with a large constant,
10428 ;; we can do this with an XOR followed by a compare. But we need a scratch
10429 ;; register for the result of the XOR.
10432 [(set (match_operand:CC 0 "cc_reg_operand" "")
10433 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
10434 (match_operand:SI 2 "non_short_cint_operand" "")))
10435 (clobber (match_operand:SI 3 "gpc_reg_operand" ""))]
10436 "find_single_use (operands[0], insn, 0)
10437 && (GET_CODE (*find_single_use (operands[0], insn, 0)) == EQ
10438 || GET_CODE (*find_single_use (operands[0], insn, 0)) == NE)"
10439 [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 4)))
10440 (set (match_dup 0) (compare:CC (match_dup 3) (match_dup 5)))]
10443 /* Get the constant we are comparing against, C, and see what it looks like
10444 sign-extended to 16 bits. Then see what constant could be XOR'ed
10445 with C to get the sign-extended value. */
10447 HOST_WIDE_INT c = INTVAL (operands[2]);
10448 HOST_WIDE_INT sextc = ((c & 0xffff) ^ 0x8000) - 0x8000;
10449 HOST_WIDE_INT xorv = c ^ sextc;
10451 operands[4] = GEN_INT (xorv);
10452 operands[5] = GEN_INT (sextc);
10455 (define_insn "*cmpsi_internal2"
10456 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
10457 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
10458 (match_operand:SI 2 "reg_or_u_short_operand" "rK")))]
10460 "{cmpl%I2|cmplw%I2} %0,%1,%b2"
10461 [(set_attr "type" "compare")])
10463 (define_insn "*cmpdi_internal2"
10464 [(set (match_operand:CCUNS 0 "cc_reg_operand" "=y")
10465 (compare:CCUNS (match_operand:DI 1 "gpc_reg_operand" "r")
10466 (match_operand:DI 2 "reg_or_u_short_operand" "rK")))]
10468 "cmpld%I2 %0,%1,%b2"
10469 [(set_attr "type" "compare")])
10471 ;; The following two insns don't exist as single insns, but if we provide
10472 ;; them, we can swap an add and compare, which will enable us to overlap more
10473 ;; of the required delay between a compare and branch. We generate code for
10474 ;; them by splitting.
10477 [(set (match_operand:CC 3 "cc_reg_operand" "=y")
10478 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "r")
10479 (match_operand:SI 2 "short_cint_operand" "i")))
10480 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
10481 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
10484 [(set_attr "length" "8")])
10487 [(set (match_operand:CCUNS 3 "cc_reg_operand" "=y")
10488 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "r")
10489 (match_operand:SI 2 "u_short_cint_operand" "i")))
10490 (set (match_operand:SI 0 "gpc_reg_operand" "=r")
10491 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "i")))]
10494 [(set_attr "length" "8")])
10497 [(set (match_operand:CC 3 "cc_reg_operand" "")
10498 (compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
10499 (match_operand:SI 2 "short_cint_operand" "")))
10500 (set (match_operand:SI 0 "gpc_reg_operand" "")
10501 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
10503 [(set (match_dup 3) (compare:CC (match_dup 1) (match_dup 2)))
10504 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
10507 [(set (match_operand:CCUNS 3 "cc_reg_operand" "")
10508 (compare:CCUNS (match_operand:SI 1 "gpc_reg_operand" "")
10509 (match_operand:SI 2 "u_short_cint_operand" "")))
10510 (set (match_operand:SI 0 "gpc_reg_operand" "")
10511 (plus:SI (match_dup 1) (match_operand:SI 4 "short_cint_operand" "")))]
10513 [(set (match_dup 3) (compare:CCUNS (match_dup 1) (match_dup 2)))
10514 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 4)))])
10516 (define_insn "*cmpsf_internal1"
10517 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10518 (compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "f")
10519 (match_operand:SF 2 "gpc_reg_operand" "f")))]
10520 "TARGET_HARD_FLOAT"
10522 [(set_attr "type" "fpcompare")])
10524 (define_insn "*cmpdf_internal1"
10525 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10526 (compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "f")
10527 (match_operand:DF 2 "gpc_reg_operand" "f")))]
10528 "TARGET_HARD_FLOAT"
10530 [(set_attr "type" "fpcompare")])
10532 ;; Only need to compare second words if first words equal
10533 (define_insn "*cmptf_internal1"
10534 [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
10535 (compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
10536 (match_operand:TF 2 "gpc_reg_operand" "f")))]
10537 "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_LONG_DOUBLE_128"
10538 "fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2"
10539 [(set_attr "type" "fpcompare")
10540 (set_attr "length" "12")])
10542 ;; Now we have the scc insns. We can do some combinations because of the
10543 ;; way the machine works.
10545 ;; Note that this is probably faster if we can put an insn between the
10546 ;; mfcr and rlinm, but this is tricky. Let's leave it for now. In most
10547 ;; cases the insns below which don't use an intermediate CR field will
10548 ;; be used instead.
10550 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10551 (match_operator:SI 1 "scc_comparison_operator"
10552 [(match_operand 2 "cc_reg_operand" "y")
10555 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
10556 [(set_attr "length" "12")])
10559 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10560 (match_operator:DI 1 "scc_comparison_operator"
10561 [(match_operand 2 "cc_reg_operand" "y")
10564 "%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%J1,1"
10565 [(set_attr "length" "12")])
10568 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
10569 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
10570 [(match_operand 2 "cc_reg_operand" "y,y")
10573 (set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
10574 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
10575 "! TARGET_POWERPC64"
10577 %D1mfcr %3\;{rlinm.|rlwinm.} %3,%3,%J1,1
10579 [(set_attr "type" "delayed_compare")
10580 (set_attr "length" "12,16")])
10583 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
10584 (compare:CC (match_operator:SI 1 "scc_comparison_operator"
10585 [(match_operand 2 "cc_reg_operand" "")
10588 (set (match_operand:SI 3 "gpc_reg_operand" "")
10589 (match_op_dup 1 [(match_dup 2) (const_int 0)]))]
10590 "! TARGET_POWERPC64 && reload_completed"
10591 [(set (match_dup 3)
10592 (match_op_dup 1 [(match_dup 2) (const_int 0)]))
10594 (compare:CC (match_dup 3)
10599 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10600 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10601 [(match_operand 2 "cc_reg_operand" "y")
10603 (match_operand:SI 3 "const_int_operand" "n")))]
10607 int is_bit = ccr_bit (operands[1], 1);
10608 int put_bit = 31 - (INTVAL (operands[3]) & 31);
10611 if (is_bit >= put_bit)
10612 count = is_bit - put_bit;
10614 count = 32 - (put_bit - is_bit);
10616 operands[4] = GEN_INT (count);
10617 operands[5] = GEN_INT (put_bit);
10619 return \"%D1mfcr %0\;{rlinm|rlwinm} %0,%0,%4,%5,%5\";
10621 [(set_attr "length" "12")])
10624 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
10626 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10627 [(match_operand 2 "cc_reg_operand" "y,y")
10629 (match_operand:SI 3 "const_int_operand" "n,n"))
10631 (set (match_operand:SI 4 "gpc_reg_operand" "=r,r")
10632 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10634 "! TARGET_POWERPC64"
10637 int is_bit = ccr_bit (operands[1], 1);
10638 int put_bit = 31 - (INTVAL (operands[3]) & 31);
10641 /* Force split for non-cc0 compare. */
10642 if (which_alternative == 1)
10645 if (is_bit >= put_bit)
10646 count = is_bit - put_bit;
10648 count = 32 - (put_bit - is_bit);
10650 operands[5] = GEN_INT (count);
10651 operands[6] = GEN_INT (put_bit);
10653 return \"%D1mfcr %4\;{rlinm.|rlwinm.} %4,%4,%5,%6,%6\";
10655 [(set_attr "type" "delayed_compare")
10656 (set_attr "length" "12,16")])
10659 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
10661 (ashift:SI (match_operator:SI 1 "scc_comparison_operator"
10662 [(match_operand 2 "cc_reg_operand" "")
10664 (match_operand:SI 3 "const_int_operand" ""))
10666 (set (match_operand:SI 4 "gpc_reg_operand" "")
10667 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10669 "! TARGET_POWERPC64 && reload_completed"
10670 [(set (match_dup 4)
10671 (ashift:SI (match_op_dup 1 [(match_dup 2) (const_int 0)])
10674 (compare:CC (match_dup 4)
10678 ;; There is a 3 cycle delay between consecutive mfcr instructions
10679 ;; so it is useful to combine 2 scc instructions to use only one mfcr.
10682 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10683 (match_operator:SI 1 "scc_comparison_operator"
10684 [(match_operand 2 "cc_reg_operand" "y")
10686 (set (match_operand:SI 3 "gpc_reg_operand" "=r")
10687 (match_operator:SI 4 "scc_comparison_operator"
10688 [(match_operand 5 "cc_reg_operand" "y")
10690 "REGNO (operands[2]) != REGNO (operands[5])"
10691 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
10692 [(set_attr "length" "20")])
10695 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10696 (match_operator:DI 1 "scc_comparison_operator"
10697 [(match_operand 2 "cc_reg_operand" "y")
10699 (set (match_operand:DI 3 "gpc_reg_operand" "=r")
10700 (match_operator:DI 4 "scc_comparison_operator"
10701 [(match_operand 5 "cc_reg_operand" "y")
10703 "TARGET_POWERPC64 && REGNO (operands[2]) != REGNO (operands[5])"
10704 "%D1%D4mfcr %3\;{rlinm|rlwinm} %0,%3,%J1,1\;{rlinm|rlwinm} %3,%3,%J4,1"
10705 [(set_attr "length" "20")])
10707 ;; There are some scc insns that can be done directly, without a compare.
10708 ;; These are faster because they don't involve the communications between
10709 ;; the FXU and branch units. In fact, we will be replacing all of the
10710 ;; integer scc insns here or in the portable methods in emit_store_flag.
10712 ;; Also support (neg (scc ..)) since that construct is used to replace
10713 ;; branches, (plus (scc ..) ..) since that construct is common and
10714 ;; takes no more insns than scc, and (and (neg (scc ..)) ..) in the
10715 ;; cases where it is no more expensive than (neg (scc ..)).
10717 ;; Have reload force a constant into a register for the simple insns that
10718 ;; otherwise won't accept constants. We do this because it is faster than
10719 ;; the cmp/mfcr sequence we would otherwise generate.
10722 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
10723 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
10724 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I")))
10725 (clobber (match_scratch:SI 3 "=r,&r,r,r,r"))]
10726 "! TARGET_POWERPC64"
10728 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10729 {sfi|subfic} %3,%1,0\;{ae|adde} %0,%3,%1
10730 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10731 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0
10732 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae|adde} %0,%3,%0"
10733 [(set_attr "length" "12,8,12,12,12")])
10736 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r")
10737 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r")
10738 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I")))
10739 (clobber (match_scratch:DI 3 "=r,&r,r,r,r"))]
10742 xor %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0
10743 subfic %3,%1,0\;adde %0,%3,%1
10744 xori %0,%1,%b2\;subfic %3,%0,0\;adde %0,%3,%0
10745 xoris %0,%1,%u2\;subfic %3,%0,0\;adde %0,%3,%0
10746 subfic %0,%1,%2\;subfic %3,%0,0\;adde %0,%3,%0"
10747 [(set_attr "length" "12,8,12,12,12")])
10750 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10752 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10753 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
10755 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
10756 (eq:SI (match_dup 1) (match_dup 2)))
10757 (clobber (match_scratch:SI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
10758 "! TARGET_POWERPC64"
10760 xor %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10761 {sfi|subfic} %3,%1,0\;{ae.|adde.} %0,%3,%1
10762 {xoril|xori} %0,%1,%b2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10763 {xoriu|xoris} %0,%1,%u2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10764 {sfi|subfic} %0,%1,%2\;{sfi|subfic} %3,%0,0\;{ae.|adde.} %0,%3,%0
10770 [(set_attr "type" "compare")
10771 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
10774 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
10776 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
10777 (match_operand:SI 2 "reg_or_cint_operand" ""))
10779 (set (match_operand:SI 0 "gpc_reg_operand" "")
10780 (eq:SI (match_dup 1) (match_dup 2)))
10781 (clobber (match_scratch:SI 3 ""))]
10782 "! TARGET_POWERPC64 && reload_completed"
10783 [(parallel [(set (match_dup 0)
10784 (eq:SI (match_dup 1) (match_dup 2)))
10785 (clobber (match_dup 3))])
10787 (compare:CC (match_dup 0)
10792 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10794 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10795 (match_operand:DI 2 "reg_or_cint_operand" "r,O,K,J,I,r,O,K,J,I"))
10797 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
10798 (eq:DI (match_dup 1) (match_dup 2)))
10799 (clobber (match_scratch:DI 3 "=r,&r,r,r,r,r,&r,r,r,r"))]
10802 xor %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
10803 subfic %3,%1,0\;adde. %0,%3,%1
10804 xori %0,%1,%b2\;subfic %3,%0,0\;adde. %0,%3,%0
10805 xoris %0,%1,%u2\;subfic %3,%0,0\;adde. %0,%3,%0
10806 subfic %0,%1,%2\;subfic %3,%0,0\;adde. %0,%3,%0
10812 [(set_attr "type" "compare")
10813 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
10816 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
10818 (eq:DI (match_operand:DI 1 "gpc_reg_operand" "")
10819 (match_operand:DI 2 "reg_or_cint_operand" ""))
10821 (set (match_operand:DI 0 "gpc_reg_operand" "")
10822 (eq:DI (match_dup 1) (match_dup 2)))
10823 (clobber (match_scratch:DI 3 ""))]
10824 "TARGET_POWERPC64 && reload_completed"
10825 [(parallel [(set (match_dup 0)
10826 (eq:DI (match_dup 1) (match_dup 2)))
10827 (clobber (match_dup 3))])
10829 (compare:CC (match_dup 0)
10833 ;; We have insns of the form shown by the first define_insn below. If
10834 ;; there is something inside the comparison operation, we must split it.
10836 [(set (match_operand:SI 0 "gpc_reg_operand" "")
10837 (plus:SI (match_operator 1 "comparison_operator"
10838 [(match_operand:SI 2 "" "")
10839 (match_operand:SI 3
10840 "reg_or_cint_operand" "")])
10841 (match_operand:SI 4 "gpc_reg_operand" "")))
10842 (clobber (match_operand:SI 5 "register_operand" ""))]
10843 "! gpc_reg_operand (operands[2], SImode)"
10844 [(set (match_dup 5) (match_dup 2))
10845 (set (match_dup 2) (plus:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
10849 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
10850 (plus:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
10851 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))
10852 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r")))
10853 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r"))]
10854 "! TARGET_POWERPC64"
10856 xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
10857 {sfi|subfic} %4,%1,0\;{aze|addze} %0,%3
10858 {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
10859 {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
10860 {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3"
10861 [(set_attr "length" "12,8,12,12,12")])
10864 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10867 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10868 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
10869 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
10871 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))]
10872 "! TARGET_POWERPC64"
10874 xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
10875 {sfi|subfic} %4,%1,0\;{aze.|addze.} %4,%3
10876 {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
10877 {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
10878 {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
10884 [(set_attr "type" "compare")
10885 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
10888 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
10891 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
10892 (match_operand:SI 2 "reg_or_cint_operand" ""))
10893 (match_operand:SI 3 "gpc_reg_operand" ""))
10895 (clobber (match_scratch:SI 4 ""))]
10896 "! TARGET_POWERPC64 && reload_completed"
10897 [(set (match_dup 4)
10898 (plus:SI (eq:SI (match_dup 1)
10902 (compare:CC (match_dup 4)
10907 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,x,x,x,?y,?y,?y,?y,?y")
10910 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r,r,r")
10911 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I,r,O,K,L,I"))
10912 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r,r,r,r,r,r,r"))
10914 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r,r,r")
10915 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
10916 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r,&r,&r,&r,&r,&r,&r"))]
10917 "! TARGET_POWERPC64"
10919 xor %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
10920 {sfi|subfic} %4,%1,0\;{aze.|addze.} %0,%3
10921 {xoril|xori} %4,%1,%b2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
10922 {xoriu|xoris} %4,%1,%u2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
10923 {sfi|subfic} %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
10929 [(set_attr "type" "compare")
10930 (set_attr "length" "12,8,12,12,12,16,12,16,16,16")])
10933 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
10936 (eq:SI (match_operand:SI 1 "gpc_reg_operand" "")
10937 (match_operand:SI 2 "reg_or_cint_operand" ""))
10938 (match_operand:SI 3 "gpc_reg_operand" ""))
10940 (set (match_operand:SI 0 "gpc_reg_operand" "")
10941 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
10942 (clobber (match_scratch:SI 4 ""))]
10943 "! TARGET_POWERPC64 && reload_completed"
10944 [(parallel [(set (match_dup 0)
10945 (plus:SI (eq:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
10946 (clobber (match_dup 4))])
10948 (compare:CC (match_dup 0)
10953 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r")
10954 (neg:SI (eq:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r")
10955 (match_operand:SI 2 "reg_or_cint_operand" "r,O,K,L,I"))))]
10956 "! TARGET_POWERPC64"
10958 xor %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
10959 {ai|addic} %0,%1,-1\;{sfe|subfe} %0,%0,%0
10960 {xoril|xori} %0,%1,%b2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
10961 {xoriu|xoris} %0,%1,%u2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
10962 {sfi|subfic} %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
10963 [(set_attr "length" "12,8,12,12,12")])
10965 ;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power,
10966 ;; since it nabs/sr is just as fast.
10967 (define_insn "*ne0"
10968 [(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
10969 (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
10971 (clobber (match_scratch:SI 2 "=&r"))]
10972 "! TARGET_POWER && ! TARGET_POWERPC64"
10973 "{ai|addic} %2,%1,-1\;{sfe|subfe} %0,%2,%1"
10974 [(set_attr "length" "8")])
10977 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10978 (lshiftrt:DI (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
10980 (clobber (match_scratch:DI 2 "=&r"))]
10982 "addic %2,%1,-1\;subfe %0,%2,%1"
10983 [(set_attr "length" "8")])
10985 ;; This is what (plus (ne X (const_int 0)) Y) looks like.
10987 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
10988 (plus:SI (lshiftrt:SI
10989 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
10991 (match_operand:SI 2 "gpc_reg_operand" "r")))
10992 (clobber (match_scratch:SI 3 "=&r"))]
10993 "! TARGET_POWERPC64"
10994 "{ai|addic} %3,%1,-1\;{aze|addze} %0,%2"
10995 [(set_attr "length" "8")])
10998 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
10999 (plus:DI (lshiftrt:DI
11000 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r")))
11002 (match_operand:DI 2 "gpc_reg_operand" "r")))
11003 (clobber (match_scratch:DI 3 "=&r"))]
11005 "addic %3,%1,-1\;addze %0,%2"
11006 [(set_attr "length" "8")])
11009 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11011 (plus:SI (lshiftrt:SI
11012 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11014 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11016 (clobber (match_scratch:SI 3 "=&r,&r"))
11017 (clobber (match_scratch:SI 4 "=X,&r"))]
11018 "! TARGET_POWERPC64"
11020 {ai|addic} %3,%1,-1\;{aze.|addze.} %3,%2
11022 [(set_attr "type" "compare")
11023 (set_attr "length" "8,12")])
11026 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11028 (plus:SI (lshiftrt:SI
11029 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
11031 (match_operand:SI 2 "gpc_reg_operand" ""))
11033 (clobber (match_scratch:SI 3 ""))
11034 (clobber (match_scratch:SI 4 ""))]
11035 "! TARGET_POWERPC64 && reload_completed"
11036 [(parallel [(set (match_dup 3)
11037 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1)))
11040 (clobber (match_dup 4))])
11042 (compare:CC (match_dup 3)
11047 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11049 (plus:DI (lshiftrt:DI
11050 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
11052 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
11054 (clobber (match_scratch:DI 3 "=&r,&r"))]
11057 addic %3,%1,-1\;addze. %3,%2
11059 [(set_attr "type" "compare")
11060 (set_attr "length" "8,12")])
11063 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11065 (plus:DI (lshiftrt:DI
11066 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
11068 (match_operand:DI 2 "gpc_reg_operand" ""))
11070 (clobber (match_scratch:DI 3 ""))]
11071 "TARGET_POWERPC64 && reload_completed"
11072 [(set (match_dup 3)
11073 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1)))
11077 (compare:CC (match_dup 3)
11082 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11084 (plus:SI (lshiftrt:SI
11085 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")))
11087 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
11089 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11090 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11092 (clobber (match_scratch:SI 3 "=&r,&r"))]
11093 "! TARGET_POWERPC64"
11095 {ai|addic} %3,%1,-1\;{aze.|addze.} %0,%2
11097 [(set_attr "type" "compare")
11098 (set_attr "length" "8,12")])
11101 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11103 (plus:SI (lshiftrt:SI
11104 (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))
11106 (match_operand:SI 2 "gpc_reg_operand" ""))
11108 (set (match_operand:SI 0 "gpc_reg_operand" "")
11109 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11111 (clobber (match_scratch:SI 3 ""))]
11112 "! TARGET_POWERPC64 && reload_completed"
11113 [(parallel [(set (match_dup 0)
11114 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup 1))) (const_int 31))
11116 (clobber (match_dup 3))])
11118 (compare:CC (match_dup 0)
11123 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11125 (plus:DI (lshiftrt:DI
11126 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")))
11128 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
11130 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11131 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11133 (clobber (match_scratch:DI 3 "=&r,&r"))]
11136 addic %3,%1,-1\;addze. %0,%2
11138 [(set_attr "type" "compare")
11139 (set_attr "length" "8,12")])
11142 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11144 (plus:DI (lshiftrt:DI
11145 (neg:DI (abs:DI (match_operand:DI 1 "gpc_reg_operand" "")))
11147 (match_operand:DI 2 "gpc_reg_operand" ""))
11149 (set (match_operand:DI 0 "gpc_reg_operand" "")
11150 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11152 (clobber (match_scratch:DI 3 ""))]
11153 "TARGET_POWERPC64 && reload_completed"
11154 [(parallel [(set (match_dup 0)
11155 (plus:DI (lshiftrt:DI (neg:DI (abs:DI (match_dup 1))) (const_int 63))
11157 (clobber (match_dup 3))])
11159 (compare:CC (match_dup 0)
11164 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11165 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11166 (match_operand:SI 2 "reg_or_short_operand" "r,O")))
11167 (clobber (match_scratch:SI 3 "=r,X"))]
11170 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3
11171 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri|srwi} %0,%0,31"
11172 [(set_attr "length" "12")])
11175 [(set (match_operand:CC 4 "cc_reg_operand" "=x,x,?y,?y")
11177 (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11178 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11180 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11181 (le:SI (match_dup 1) (match_dup 2)))
11182 (clobber (match_scratch:SI 3 "=r,X,r,X"))]
11185 doz %3,%2,%1\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
11186 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{sri.|srwi.} %0,%0,31
11189 [(set_attr "type" "compare,delayed_compare,compare,delayed_compare")
11190 (set_attr "length" "12,12,16,16")])
11193 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11195 (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11196 (match_operand:SI 2 "reg_or_short_operand" ""))
11198 (set (match_operand:SI 0 "gpc_reg_operand" "")
11199 (le:SI (match_dup 1) (match_dup 2)))
11200 (clobber (match_scratch:SI 3 ""))]
11201 "TARGET_POWER && reload_completed"
11202 [(parallel [(set (match_dup 0)
11203 (le:SI (match_dup 1) (match_dup 2)))
11204 (clobber (match_dup 3))])
11206 (compare:CC (match_dup 0)
11211 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11212 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11213 (match_operand:SI 2 "reg_or_short_operand" "r,O"))
11214 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
11215 (clobber (match_scratch:SI 4 "=&r,&r"))]
11218 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3
11219 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze|addze} %0,%3"
11220 [(set_attr "length" "12")])
11223 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
11225 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11226 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11227 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11229 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11232 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11233 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %4,%3
11236 [(set_attr "type" "compare")
11237 (set_attr "length" "12,12,16,16")])
11240 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11242 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11243 (match_operand:SI 2 "reg_or_short_operand" ""))
11244 (match_operand:SI 3 "gpc_reg_operand" ""))
11246 (clobber (match_scratch:SI 4 ""))]
11247 "TARGET_POWER && reload_completed"
11248 [(set (match_dup 4)
11249 (plus:SI (le:SI (match_dup 1) (match_dup 2))
11252 (compare:CC (match_dup 4)
11257 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
11259 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11260 (match_operand:SI 2 "reg_or_short_operand" "r,O,r,O"))
11261 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11263 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11264 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11265 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11268 doz %4,%2,%1\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
11269 {srai|srawi} %4,%1,31\;{sf|subfc} %4,%1,%4\;{aze.|addze.} %0,%3
11272 [(set_attr "type" "compare")
11273 (set_attr "length" "12,12,16,16")])
11276 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11278 (plus:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "")
11279 (match_operand:SI 2 "reg_or_short_operand" ""))
11280 (match_operand:SI 3 "gpc_reg_operand" ""))
11282 (set (match_operand:SI 0 "gpc_reg_operand" "")
11283 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11284 (clobber (match_scratch:SI 4 ""))]
11285 "TARGET_POWER && reload_completed"
11286 [(parallel [(set (match_dup 0)
11287 (plus:SI (le:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11288 (clobber (match_dup 4))])
11290 (compare:CC (match_dup 0)
11295 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11296 (neg:SI (le:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11297 (match_operand:SI 2 "reg_or_short_operand" "r,O"))))]
11300 doz %0,%2,%1\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0
11301 {ai|addic} %0,%1,-1\;{aze|addze} %0,%0\;{srai|srawi} %0,%0,31"
11302 [(set_attr "length" "12")])
11305 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11306 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11307 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
11308 "! TARGET_POWERPC64"
11309 "{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
11310 [(set_attr "length" "12")])
11313 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
11314 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
11315 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
11317 "subf%I2c %0,%1,%2\;li %0,0\;adde %0,%0,%0"
11318 [(set_attr "length" "12")])
11321 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11323 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
11324 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
11326 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11327 (leu:DI (match_dup 1) (match_dup 2)))]
11330 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
11332 [(set_attr "type" "compare")
11333 (set_attr "length" "12,16")])
11336 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11338 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "")
11339 (match_operand:DI 2 "reg_or_short_operand" ""))
11341 (set (match_operand:DI 0 "gpc_reg_operand" "")
11342 (leu:DI (match_dup 1) (match_dup 2)))]
11343 "TARGET_POWERPC64 && reload_completed"
11344 [(set (match_dup 0)
11345 (leu:DI (match_dup 1) (match_dup 2)))
11347 (compare:CC (match_dup 0)
11352 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11354 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11355 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11357 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11358 (leu:SI (match_dup 1) (match_dup 2)))]
11359 "! TARGET_POWERPC64"
11361 {sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
11363 [(set_attr "type" "compare")
11364 (set_attr "length" "12,16")])
11367 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11369 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11370 (match_operand:SI 2 "reg_or_short_operand" ""))
11372 (set (match_operand:SI 0 "gpc_reg_operand" "")
11373 (leu:SI (match_dup 1) (match_dup 2)))]
11374 "! TARGET_POWERPC64 && reload_completed"
11375 [(set (match_dup 0)
11376 (leu:SI (match_dup 1) (match_dup 2)))
11378 (compare:CC (match_dup 0)
11383 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11385 (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
11386 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
11388 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11389 (leu:DI (match_dup 1) (match_dup 2)))]
11392 subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
11394 [(set_attr "type" "compare")
11395 (set_attr "length" "12,16")])
11398 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11399 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11400 (match_operand:SI 2 "reg_or_short_operand" "rI"))
11401 (match_operand:SI 3 "gpc_reg_operand" "r")))
11402 (clobber (match_scratch:SI 4 "=&r"))]
11403 "! TARGET_POWERPC64"
11404 "{sf%I2|subf%I2c} %4,%1,%2\;{aze|addze} %0,%3"
11405 [(set_attr "length" "8")])
11408 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11410 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11411 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11412 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11414 (clobber (match_scratch:SI 4 "=&r,&r"))]
11415 "! TARGET_POWERPC64"
11417 {sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %4,%3
11419 [(set_attr "type" "compare")
11420 (set_attr "length" "8,12")])
11423 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11425 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11426 (match_operand:SI 2 "reg_or_short_operand" ""))
11427 (match_operand:SI 3 "gpc_reg_operand" ""))
11429 (clobber (match_scratch:SI 4 ""))]
11430 "! TARGET_POWERPC64 && reload_completed"
11431 [(set (match_dup 4)
11432 (plus:SI (leu:SI (match_dup 1) (match_dup 2))
11435 (compare:CC (match_dup 4)
11440 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11442 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11443 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11444 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11446 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11447 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11448 (clobber (match_scratch:SI 4 "=&r,&r"))]
11449 "! TARGET_POWERPC64"
11451 {sf%I2|subf%I2c} %4,%1,%2\;{aze.|addze.} %0,%3
11453 [(set_attr "type" "compare")
11454 (set_attr "length" "8,12")])
11457 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11459 (plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11460 (match_operand:SI 2 "reg_or_short_operand" ""))
11461 (match_operand:SI 3 "gpc_reg_operand" ""))
11463 (set (match_operand:SI 0 "gpc_reg_operand" "")
11464 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11465 (clobber (match_scratch:SI 4 ""))]
11466 "! TARGET_POWERPC64 && reload_completed"
11467 [(parallel [(set (match_dup 0)
11468 (plus:SI (leu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11469 (clobber (match_dup 4))])
11471 (compare:CC (match_dup 0)
11476 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11477 (neg:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11478 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
11479 "! TARGET_POWERPC64"
11480 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0"
11481 [(set_attr "length" "12")])
11484 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11486 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11487 (match_operand:SI 2 "reg_or_short_operand" "rI")))
11488 (match_operand:SI 3 "gpc_reg_operand" "r")))
11489 (clobber (match_scratch:SI 4 "=&r"))]
11490 "! TARGET_POWERPC64"
11491 "{sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
11492 [(set_attr "length" "12")])
11495 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11498 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11499 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
11500 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11502 (clobber (match_scratch:SI 4 "=&r,&r"))]
11503 "! TARGET_POWERPC64"
11505 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
11507 [(set_attr "type" "compare")
11508 (set_attr "length" "12,16")])
11511 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11514 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11515 (match_operand:SI 2 "reg_or_short_operand" "")))
11516 (match_operand:SI 3 "gpc_reg_operand" ""))
11518 (clobber (match_scratch:SI 4 ""))]
11519 "! TARGET_POWERPC64 && reload_completed"
11520 [(set (match_dup 4)
11521 (and:SI (neg:SI (leu:SI (match_dup 1)
11525 (compare:CC (match_dup 4)
11530 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11533 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11534 (match_operand:SI 2 "reg_or_short_operand" "rI,rI")))
11535 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11537 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11538 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11539 (clobber (match_scratch:SI 4 "=&r,&r"))]
11540 "! TARGET_POWERPC64"
11542 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
11544 [(set_attr "type" "compare")
11545 (set_attr "length" "12,16")])
11548 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11551 (leu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11552 (match_operand:SI 2 "reg_or_short_operand" "")))
11553 (match_operand:SI 3 "gpc_reg_operand" ""))
11555 (set (match_operand:SI 0 "gpc_reg_operand" "")
11556 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11557 (clobber (match_scratch:SI 4 ""))]
11558 "! TARGET_POWERPC64 && reload_completed"
11559 [(parallel [(set (match_dup 0)
11560 (and:SI (neg:SI (leu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
11561 (clobber (match_dup 4))])
11563 (compare:CC (match_dup 0)
11568 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11569 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11570 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
11572 "doz%I2 %0,%1,%2\;nabs %0,%0\;{sri|srwi} %0,%0,31"
11573 [(set_attr "length" "12")])
11576 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
11578 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11579 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11581 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11582 (lt:SI (match_dup 1) (match_dup 2)))]
11585 doz%I2 %0,%1,%2\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
11587 [(set_attr "type" "delayed_compare")
11588 (set_attr "length" "12,16")])
11591 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11593 (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11594 (match_operand:SI 2 "reg_or_short_operand" ""))
11596 (set (match_operand:SI 0 "gpc_reg_operand" "")
11597 (lt:SI (match_dup 1) (match_dup 2)))]
11598 "TARGET_POWER && reload_completed"
11599 [(set (match_dup 0)
11600 (lt:SI (match_dup 1) (match_dup 2)))
11602 (compare:CC (match_dup 0)
11607 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11608 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11609 (match_operand:SI 2 "reg_or_short_operand" "rI"))
11610 (match_operand:SI 3 "gpc_reg_operand" "r")))
11611 (clobber (match_scratch:SI 4 "=&r"))]
11613 "doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
11614 [(set_attr "length" "12")])
11617 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11619 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11620 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11621 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11623 (clobber (match_scratch:SI 4 "=&r,&r"))]
11626 doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
11628 [(set_attr "type" "compare")
11629 (set_attr "length" "12,16")])
11632 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11634 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11635 (match_operand:SI 2 "reg_or_short_operand" ""))
11636 (match_operand:SI 3 "gpc_reg_operand" ""))
11638 (clobber (match_scratch:SI 4 ""))]
11639 "TARGET_POWER && reload_completed"
11640 [(set (match_dup 4)
11641 (plus:SI (lt:SI (match_dup 1) (match_dup 2))
11644 (compare:CC (match_dup 4)
11649 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11651 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11652 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11653 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11655 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11656 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11657 (clobber (match_scratch:SI 4 "=&r,&r"))]
11660 doz%I2 %4,%1,%2\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3
11662 [(set_attr "type" "compare")
11663 (set_attr "length" "12,16")])
11666 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11668 (plus:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "")
11669 (match_operand:SI 2 "reg_or_short_operand" ""))
11670 (match_operand:SI 3 "gpc_reg_operand" ""))
11672 (set (match_operand:SI 0 "gpc_reg_operand" "")
11673 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11674 (clobber (match_scratch:SI 4 ""))]
11675 "TARGET_POWER && reload_completed"
11676 [(parallel [(set (match_dup 0)
11677 (plus:SI (lt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11678 (clobber (match_dup 4))])
11680 (compare:CC (match_dup 0)
11685 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11686 (neg:SI (lt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11687 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
11689 "doz%I2 %0,%1,%2\;nabs %0,%0\;{srai|srawi} %0,%0,31"
11690 [(set_attr "length" "12")])
11693 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11694 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11695 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
11696 "! TARGET_POWERPC64"
11698 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg %0,%0
11699 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
11700 [(set_attr "length" "12")])
11703 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
11705 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11706 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11708 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11709 (ltu:SI (match_dup 1) (match_dup 2)))]
11710 "! TARGET_POWERPC64"
11712 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
11713 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
11716 [(set_attr "type" "compare")
11717 (set_attr "length" "12,12,16,16")])
11720 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11722 (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11723 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11725 (set (match_operand:SI 0 "gpc_reg_operand" "")
11726 (ltu:SI (match_dup 1) (match_dup 2)))]
11727 "! TARGET_POWERPC64 && reload_completed"
11728 [(set (match_dup 0)
11729 (ltu:SI (match_dup 1) (match_dup 2)))
11731 (compare:CC (match_dup 0)
11736 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11737 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11738 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
11739 (match_operand:SI 3 "reg_or_short_operand" "rI,rI")))
11740 (clobber (match_scratch:SI 4 "=&r,&r"))]
11741 "! TARGET_POWERPC64"
11743 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3
11744 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3"
11745 [(set_attr "length" "12")])
11748 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
11750 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11751 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11752 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11754 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11755 "! TARGET_POWERPC64"
11757 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
11758 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
11761 [(set_attr "type" "compare")
11762 (set_attr "length" "12,12,16,16")])
11765 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11767 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11768 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11769 (match_operand:SI 3 "gpc_reg_operand" ""))
11771 (clobber (match_scratch:SI 4 ""))]
11772 "! TARGET_POWERPC64 && reload_completed"
11773 [(set (match_dup 4)
11774 (plus:SI (ltu:SI (match_dup 1) (match_dup 2))
11777 (compare:CC (match_dup 4)
11782 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
11784 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11785 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11786 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
11788 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11789 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11790 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
11791 "! TARGET_POWERPC64"
11793 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
11794 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
11797 [(set_attr "type" "compare")
11798 (set_attr "length" "12,12,16,16")])
11801 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11803 (plus:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11804 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
11805 (match_operand:SI 3 "gpc_reg_operand" ""))
11807 (set (match_operand:SI 0 "gpc_reg_operand" "")
11808 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11809 (clobber (match_scratch:SI 4 ""))]
11810 "! TARGET_POWERPC64 && reload_completed"
11811 [(parallel [(set (match_dup 0)
11812 (plus:SI (ltu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11813 (clobber (match_dup 4))])
11815 (compare:CC (match_dup 0)
11820 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11821 (neg:SI (ltu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11822 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))))]
11823 "! TARGET_POWERPC64"
11825 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0
11826 {ai|addic} %0,%1,%n2\;{sfe|subfe} %0,%0,%0"
11827 [(set_attr "length" "8")])
11830 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11831 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11832 (match_operand:SI 2 "reg_or_short_operand" "rI")))
11833 (clobber (match_scratch:SI 3 "=r"))]
11835 "doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae|adde} %0,%0,%3"
11836 [(set_attr "length" "12")])
11839 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
11841 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11842 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11844 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11845 (ge:SI (match_dup 1) (match_dup 2)))
11846 (clobber (match_scratch:SI 3 "=r,r"))]
11849 doz%I2 %3,%1,%2\;{sfi|subfic} %0,%3,0\;{ae.|adde.} %0,%0,%3
11851 [(set_attr "type" "compare")
11852 (set_attr "length" "12,16")])
11855 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
11857 (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
11858 (match_operand:SI 2 "reg_or_short_operand" ""))
11860 (set (match_operand:SI 0 "gpc_reg_operand" "")
11861 (ge:SI (match_dup 1) (match_dup 2)))
11862 (clobber (match_scratch:SI 3 ""))]
11863 "TARGET_POWER && reload_completed"
11864 [(parallel [(set (match_dup 0)
11865 (ge:SI (match_dup 1) (match_dup 2)))
11866 (clobber (match_dup 3))])
11868 (compare:CC (match_dup 0)
11873 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11874 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11875 (match_operand:SI 2 "reg_or_short_operand" "rI"))
11876 (match_operand:SI 3 "gpc_reg_operand" "r")))
11877 (clobber (match_scratch:SI 4 "=&r"))]
11879 "doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze|addze} %0,%3"
11880 [(set_attr "length" "12")])
11883 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
11885 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11886 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11887 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11889 (clobber (match_scratch:SI 4 "=&r,&r"))]
11892 doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %4,%3
11894 [(set_attr "type" "compare")
11895 (set_attr "length" "12,16")])
11898 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
11900 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
11901 (match_operand:SI 2 "reg_or_short_operand" ""))
11902 (match_operand:SI 3 "gpc_reg_operand" ""))
11904 (clobber (match_scratch:SI 4 ""))]
11905 "TARGET_POWER && reload_completed"
11906 [(set (match_dup 4)
11907 (plus:SI (ge:SI (match_dup 1) (match_dup 2))
11910 (compare:CC (match_dup 4)
11915 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
11917 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11918 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
11919 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
11921 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11922 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11923 (clobber (match_scratch:SI 4 "=&r,&r"))]
11926 doz%I2 %4,%1,%2\;{sfi|subfic} %4,%4,0\;{aze.|addze.} %0,%3
11928 [(set_attr "type" "compare")
11929 (set_attr "length" "12,16")])
11932 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
11934 (plus:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "")
11935 (match_operand:SI 2 "reg_or_short_operand" ""))
11936 (match_operand:SI 3 "gpc_reg_operand" ""))
11938 (set (match_operand:SI 0 "gpc_reg_operand" "")
11939 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11940 (clobber (match_scratch:SI 4 ""))]
11941 "TARGET_POWER && reload_completed"
11942 [(parallel [(set (match_dup 0)
11943 (plus:SI (ge:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
11944 (clobber (match_dup 4))])
11946 (compare:CC (match_dup 0)
11951 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
11952 (neg:SI (ge:SI (match_operand:SI 1 "gpc_reg_operand" "r")
11953 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
11955 "doz%I2 %0,%1,%2\;{ai|addic} %0,%0,-1\;{sfe|subfe} %0,%0,%0"
11956 [(set_attr "length" "12")])
11959 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
11960 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
11961 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))]
11962 "! TARGET_POWERPC64"
11964 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0
11965 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
11966 [(set_attr "length" "12")])
11969 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
11970 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
11971 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P")))]
11974 subfc %0,%2,%1\;li %0,0\;adde %0,%0,%0
11975 addic %0,%1,%n2\;li %0,0\;adde %0,%0,%0"
11976 [(set_attr "length" "12")])
11979 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
11981 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
11982 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
11984 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
11985 (geu:SI (match_dup 1) (match_dup 2)))]
11986 "! TARGET_POWERPC64"
11988 {sf|subfc} %0,%2,%1\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
11989 {ai|addic} %0,%1,%n2\;{cal %0,0(0)|li %0,0}\;{ae.|adde.} %0,%0,%0
11992 [(set_attr "type" "compare")
11993 (set_attr "length" "12,12,16,16")])
11996 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
11998 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
11999 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12001 (set (match_operand:SI 0 "gpc_reg_operand" "")
12002 (geu:SI (match_dup 1) (match_dup 2)))]
12003 "! TARGET_POWERPC64 && reload_completed"
12004 [(set (match_dup 0)
12005 (geu:SI (match_dup 1) (match_dup 2)))
12007 (compare:CC (match_dup 0)
12012 [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y")
12014 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12015 (match_operand:DI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12017 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
12018 (geu:DI (match_dup 1) (match_dup 2)))]
12021 subfc %0,%2,%1\;li %0,0\;adde. %0,%0,%0
12022 addic %0,%1,%n2\;li %0,0\;adde. %0,%0,%0
12025 [(set_attr "type" "compare")
12026 (set_attr "length" "12,12,16,16")])
12029 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12031 (geu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12032 (match_operand:DI 2 "reg_or_neg_short_operand" ""))
12034 (set (match_operand:DI 0 "gpc_reg_operand" "")
12035 (geu:DI (match_dup 1) (match_dup 2)))]
12036 "TARGET_POWERPC64 && reload_completed"
12037 [(set (match_dup 0)
12038 (geu:DI (match_dup 1) (match_dup 2)))
12040 (compare:CC (match_dup 0)
12045 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12046 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12047 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P"))
12048 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
12049 (clobber (match_scratch:SI 4 "=&r,&r"))]
12050 "! TARGET_POWERPC64"
12052 {sf|subfc} %4,%2,%1\;{aze|addze} %0,%3
12053 {ai|addic} %4,%1,%n2\;{aze|addze} %0,%3"
12054 [(set_attr "length" "8")])
12057 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12059 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12060 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12061 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12063 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12064 "! TARGET_POWERPC64"
12066 {sf|subfc} %4,%2,%1\;{aze.|addze.} %4,%3
12067 {ai|addic} %4,%1,%n2\;{aze.|addze.} %4,%3
12070 [(set_attr "type" "compare")
12071 (set_attr "length" "8,8,12,12")])
12074 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12076 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12077 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12078 (match_operand:SI 3 "gpc_reg_operand" ""))
12080 (clobber (match_scratch:SI 4 ""))]
12081 "! TARGET_POWERPC64 && reload_completed"
12082 [(set (match_dup 4)
12083 (plus:SI (geu:SI (match_dup 1) (match_dup 2))
12086 (compare:CC (match_dup 4)
12091 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12093 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12094 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P"))
12095 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12097 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12098 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12099 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12100 "! TARGET_POWERPC64"
12102 {sf|subfc} %4,%2,%1\;{aze.|addze.} %0,%3
12103 {ai|addic} %4,%1,%n2\;{aze.|addze.} %0,%3
12106 [(set_attr "type" "compare")
12107 (set_attr "length" "8,8,12,12")])
12110 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12112 (plus:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12113 (match_operand:SI 2 "reg_or_neg_short_operand" ""))
12114 (match_operand:SI 3 "gpc_reg_operand" ""))
12116 (set (match_operand:SI 0 "gpc_reg_operand" "")
12117 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12118 (clobber (match_scratch:SI 4 ""))]
12119 "! TARGET_POWERPC64 && reload_completed"
12120 [(parallel [(set (match_dup 0)
12121 (plus:SI (geu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12122 (clobber (match_dup 4))])
12124 (compare:CC (match_dup 0)
12129 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12130 (neg:SI (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12131 (match_operand:SI 2 "reg_or_short_operand" "r,I"))))]
12132 "! TARGET_POWERPC64"
12134 {sf|subfc} %0,%2,%1\;{sfe|subfe} %0,%0,%0\;nand %0,%0,%0
12135 {sfi|subfic} %0,%1,-1\;{a%I2|add%I2c} %0,%0,%2\;{sfe|subfe} %0,%0,%0"
12136 [(set_attr "length" "12")])
12139 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12141 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12142 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P")))
12143 (match_operand:SI 3 "gpc_reg_operand" "r,r")))
12144 (clobber (match_scratch:SI 4 "=&r,&r"))]
12145 "! TARGET_POWERPC64"
12147 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4
12148 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc %0,%3,%4"
12149 [(set_attr "length" "12")])
12152 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12155 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12156 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
12157 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12159 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12160 "! TARGET_POWERPC64"
12162 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
12163 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %4,%3,%4
12166 [(set_attr "type" "compare")
12167 (set_attr "length" "12,12,16,16")])
12170 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12173 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12174 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
12175 (match_operand:SI 3 "gpc_reg_operand" ""))
12177 (clobber (match_scratch:SI 4 ""))]
12178 "! TARGET_POWERPC64 && reload_completed"
12179 [(set (match_dup 4)
12180 (and:SI (neg:SI (geu:SI (match_dup 1)
12184 (compare:CC (match_dup 4)
12189 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12192 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12193 (match_operand:SI 2 "reg_or_neg_short_operand" "r,P,r,P")))
12194 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12196 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12197 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12198 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12199 "! TARGET_POWERPC64"
12201 {sf|subfc} %4,%2,%1\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
12202 {ai|addic} %4,%1,%n2\;{sfe|subfe} %4,%4,%4\;andc. %0,%3,%4
12205 [(set_attr "type" "compare")
12206 (set_attr "length" "12,12,16,16")])
12209 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12212 (geu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12213 (match_operand:SI 2 "reg_or_neg_short_operand" "")))
12214 (match_operand:SI 3 "gpc_reg_operand" ""))
12216 (set (match_operand:SI 0 "gpc_reg_operand" "")
12217 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12218 (clobber (match_scratch:SI 4 ""))]
12219 "! TARGET_POWERPC64 && reload_completed"
12220 [(parallel [(set (match_dup 0)
12221 (and:SI (neg:SI (geu:SI (match_dup 1) (match_dup 2))) (match_dup 3)))
12222 (clobber (match_dup 4))])
12224 (compare:CC (match_dup 0)
12229 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12230 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12232 "! TARGET_POWERPC64"
12233 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri|srwi} %0,%0,31"
12234 [(set_attr "length" "12")])
12237 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12238 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12241 "subfic %0,%1,0\;addme %0,%0\;srdi %0,%0,63"
12242 [(set_attr "length" "12")])
12245 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
12247 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12250 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12251 (gt:SI (match_dup 1) (const_int 0)))]
12252 "! TARGET_POWERPC64"
12254 {sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{sri.|srwi.} %0,%0,31
12256 [(set_attr "type" "delayed_compare")
12257 (set_attr "length" "12,16")])
12260 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
12262 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12265 (set (match_operand:SI 0 "gpc_reg_operand" "")
12266 (gt:SI (match_dup 1) (const_int 0)))]
12267 "! TARGET_POWERPC64 && reload_completed"
12268 [(set (match_dup 0)
12269 (gt:SI (match_dup 1) (const_int 0)))
12271 (compare:CC (match_dup 0)
12276 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
12278 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12281 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12282 (gt:DI (match_dup 1) (const_int 0)))]
12285 subfic %0,%1,0\;addme %0,%0\;srdi. %0,%0,63
12287 [(set_attr "type" "delayed_compare")
12288 (set_attr "length" "12,16")])
12291 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
12293 (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12296 (set (match_operand:DI 0 "gpc_reg_operand" "")
12297 (gt:DI (match_dup 1) (const_int 0)))]
12298 "TARGET_POWERPC64 && reload_completed"
12299 [(set (match_dup 0)
12300 (gt:DI (match_dup 1) (const_int 0)))
12302 (compare:CC (match_dup 0)
12307 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12308 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12309 (match_operand:SI 2 "reg_or_short_operand" "r")))]
12311 "doz %0,%2,%1\;nabs %0,%0\;{sri|srwi} %0,%0,31"
12312 [(set_attr "length" "12")])
12315 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12317 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12318 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12320 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12321 (gt:SI (match_dup 1) (match_dup 2)))]
12324 doz %0,%2,%1\;nabs %0,%0\;{sri.|srwi.} %0,%0,31
12326 [(set_attr "type" "delayed_compare")
12327 (set_attr "length" "12,16")])
12330 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12332 (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12333 (match_operand:SI 2 "reg_or_short_operand" ""))
12335 (set (match_operand:SI 0 "gpc_reg_operand" "")
12336 (gt:SI (match_dup 1) (match_dup 2)))]
12337 "TARGET_POWER && reload_completed"
12338 [(set (match_dup 0)
12339 (gt:SI (match_dup 1) (match_dup 2)))
12341 (compare:CC (match_dup 0)
12346 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12347 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12349 (match_operand:SI 2 "gpc_reg_operand" "r")))
12350 (clobber (match_scratch:SI 3 "=&r"))]
12351 "! TARGET_POWERPC64"
12352 "{a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze|addze} %0,%2"
12353 [(set_attr "length" "12")])
12356 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12357 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12359 (match_operand:DI 2 "gpc_reg_operand" "r")))
12360 (clobber (match_scratch:DI 3 "=&r"))]
12362 "addc %3,%1,%1\;subfe %3,%1,%3\;addze %0,%2"
12363 [(set_attr "length" "12")])
12366 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12368 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12370 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
12372 (clobber (match_scratch:SI 3 "=&r,&r"))]
12373 "! TARGET_POWERPC64"
12375 {a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %3,%2
12377 [(set_attr "type" "compare")
12378 (set_attr "length" "12,16")])
12381 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12383 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12385 (match_operand:SI 2 "gpc_reg_operand" ""))
12387 (clobber (match_scratch:SI 3 ""))]
12388 "! TARGET_POWERPC64 && reload_completed"
12389 [(set (match_dup 3)
12390 (plus:SI (gt:SI (match_dup 1) (const_int 0))
12393 (compare:CC (match_dup 3)
12398 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12400 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12402 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
12404 (clobber (match_scratch:DI 3 "=&r,&r"))]
12407 addc %3,%1,%1\;subfe %3,%1,%3\;addze. %3,%2
12409 [(set_attr "type" "compare")
12410 (set_attr "length" "12,16")])
12413 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12415 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12417 (match_operand:DI 2 "gpc_reg_operand" ""))
12419 (clobber (match_scratch:DI 3 ""))]
12420 "TARGET_POWERPC64 && reload_completed"
12421 [(set (match_dup 3)
12422 (plus:DI (gt:DI (match_dup 1) (const_int 0))
12425 (compare:CC (match_dup 3)
12430 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12432 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12434 (match_operand:SI 2 "gpc_reg_operand" "r,r"))
12436 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12437 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12438 (clobber (match_scratch:SI 3 "=&r,&r"))]
12439 "! TARGET_POWERPC64"
12441 {a|addc} %3,%1,%1\;{sfe|subfe} %3,%1,%3\;{aze.|addze.} %0,%2
12443 [(set_attr "type" "compare")
12444 (set_attr "length" "12,16")])
12447 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12449 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12451 (match_operand:SI 2 "gpc_reg_operand" ""))
12453 (set (match_operand:SI 0 "gpc_reg_operand" "")
12454 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12455 (clobber (match_scratch:SI 3 ""))]
12456 "! TARGET_POWERPC64 && reload_completed"
12457 [(parallel [(set (match_dup 0)
12458 (plus:SI (gt:SI (match_dup 1) (const_int 0)) (match_dup 2)))
12459 (clobber (match_dup 3))])
12461 (compare:CC (match_dup 0)
12466 [(set (match_operand:CC 4 "cc_reg_operand" "=x,?y")
12468 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12470 (match_operand:DI 2 "gpc_reg_operand" "r,r"))
12472 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12473 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12474 (clobber (match_scratch:DI 3 "=&r,&r"))]
12477 addc %3,%1,%1\;subfe %3,%1,%3\;addze. %0,%2
12479 [(set_attr "type" "compare")
12480 (set_attr "length" "12,16")])
12483 [(set (match_operand:CC 4 "cc_reg_not_cr0_operand" "")
12485 (plus:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "")
12487 (match_operand:DI 2 "gpc_reg_operand" ""))
12489 (set (match_operand:DI 0 "gpc_reg_operand" "")
12490 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12491 (clobber (match_scratch:DI 3 ""))]
12492 "TARGET_POWERPC64 && reload_completed"
12493 [(parallel [(set (match_dup 0)
12494 (plus:DI (gt:DI (match_dup 1) (const_int 0)) (match_dup 2)))
12495 (clobber (match_dup 3))])
12497 (compare:CC (match_dup 0)
12502 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12503 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12504 (match_operand:SI 2 "reg_or_short_operand" "r"))
12505 (match_operand:SI 3 "gpc_reg_operand" "r")))
12506 (clobber (match_scratch:SI 4 "=&r"))]
12508 "doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze|addze} %0,%3"
12509 [(set_attr "length" "12")])
12512 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
12514 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12515 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12516 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12518 (clobber (match_scratch:SI 4 "=&r,&r"))]
12521 doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %4,%3
12523 [(set_attr "type" "compare")
12524 (set_attr "length" "12,16")])
12527 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12529 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12530 (match_operand:SI 2 "reg_or_short_operand" ""))
12531 (match_operand:SI 3 "gpc_reg_operand" ""))
12533 (clobber (match_scratch:SI 4 ""))]
12534 "TARGET_POWER && reload_completed"
12535 [(set (match_dup 4)
12536 (plus:SI (gt:SI (match_dup 1) (match_dup 2))
12539 (compare:CC (match_dup 4)
12544 [(set (match_operand:CC 5 "cc_reg_operand" "=x,?y")
12546 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12547 (match_operand:SI 2 "reg_or_short_operand" "r,r"))
12548 (match_operand:SI 3 "gpc_reg_operand" "r,r"))
12550 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12551 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12552 (clobber (match_scratch:SI 4 "=&r,&r"))]
12555 doz %4,%2,%1\;{ai|addic} %4,%4,-1\;{aze.|addze.} %0,%3
12557 [(set_attr "type" "compare")
12558 (set_attr "length" "12,16")])
12561 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12563 (plus:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "")
12564 (match_operand:SI 2 "reg_or_short_operand" ""))
12565 (match_operand:SI 3 "gpc_reg_operand" ""))
12567 (set (match_operand:SI 0 "gpc_reg_operand" "")
12568 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12569 (clobber (match_scratch:SI 4 ""))]
12570 "TARGET_POWER && reload_completed"
12571 [(parallel [(set (match_dup 0)
12572 (plus:SI (gt:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12573 (clobber (match_dup 4))])
12575 (compare:CC (match_dup 0)
12580 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12581 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12583 "! TARGET_POWERPC64"
12584 "{sfi|subfic} %0,%1,0\;{ame|addme} %0,%0\;{srai|srawi} %0,%0,31"
12585 [(set_attr "length" "12")])
12588 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12589 (neg:DI (gt:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12592 "subfic %0,%1,0\;addme %0,%0\;sradi %0,%0,63"
12593 [(set_attr "length" "12")])
12596 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12597 (neg:SI (gt:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12598 (match_operand:SI 2 "reg_or_short_operand" "r"))))]
12600 "doz %0,%2,%1\;nabs %0,%0\;{srai|srawi} %0,%0,31"
12601 [(set_attr "length" "12")])
12604 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12605 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12606 (match_operand:SI 2 "reg_or_short_operand" "rI")))]
12607 "! TARGET_POWERPC64"
12608 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg %0,%0"
12609 [(set_attr "length" "12")])
12612 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12613 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12614 (match_operand:DI 2 "reg_or_short_operand" "rI")))]
12616 "subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg %0,%0"
12617 [(set_attr "length" "12")])
12620 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12622 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12623 (match_operand:SI 2 "reg_or_short_operand" "rI,rI"))
12625 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12626 (gtu:SI (match_dup 1) (match_dup 2)))]
12627 "! TARGET_POWERPC64"
12629 {sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0\;neg. %0,%0
12631 [(set_attr "type" "compare")
12632 (set_attr "length" "12,16")])
12635 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12637 (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12638 (match_operand:SI 2 "reg_or_short_operand" ""))
12640 (set (match_operand:SI 0 "gpc_reg_operand" "")
12641 (gtu:SI (match_dup 1) (match_dup 2)))]
12642 "! TARGET_POWERPC64 && reload_completed"
12643 [(set (match_dup 0)
12644 (gtu:SI (match_dup 1) (match_dup 2)))
12646 (compare:CC (match_dup 0)
12651 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
12653 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12654 (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
12656 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12657 (gtu:DI (match_dup 1) (match_dup 2)))]
12660 subf%I2c %0,%1,%2\;subfe %0,%0,%0\;neg. %0,%0
12662 [(set_attr "type" "compare")
12663 (set_attr "length" "12,16")])
12666 [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "")
12668 (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12669 (match_operand:DI 2 "reg_or_short_operand" ""))
12671 (set (match_operand:DI 0 "gpc_reg_operand" "")
12672 (gtu:DI (match_dup 1) (match_dup 2)))]
12673 "TARGET_POWERPC64 && reload_completed"
12674 [(set (match_dup 0)
12675 (gtu:DI (match_dup 1) (match_dup 2)))
12677 (compare:CC (match_dup 0)
12682 [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
12683 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")
12684 (match_operand:SI 2 "reg_or_short_operand" "I,rI"))
12685 (match_operand:SI 3 "reg_or_short_operand" "r,rI")))
12686 (clobber (match_scratch:SI 4 "=&r,&r"))]
12687 "! TARGET_POWERPC64"
12689 {ai|addic} %4,%1,%k2\;{aze|addze} %0,%3
12690 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf%I3|subf%I3c} %0,%4,%3"
12691 [(set_attr "length" "8,12")])
12694 [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
12695 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
12696 (match_operand:DI 2 "reg_or_short_operand" "I,rI"))
12697 (match_operand:DI 3 "reg_or_short_operand" "r,rI")))
12698 (clobber (match_scratch:DI 4 "=&r,&r"))]
12701 addic %4,%1,%k2\;addze %0,%3
12702 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subf%I3c %0,%4,%3"
12703 [(set_attr "length" "8,12")])
12706 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12708 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12709 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
12710 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12712 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12713 "! TARGET_POWERPC64"
12715 {ai|addic} %4,%1,%k2\;{aze.|addze.} %4,%3
12716 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %4,%4,%3
12719 [(set_attr "type" "compare")
12720 (set_attr "length" "8,12,12,16")])
12723 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12725 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12726 (match_operand:SI 2 "reg_or_short_operand" ""))
12727 (match_operand:SI 3 "gpc_reg_operand" ""))
12729 (clobber (match_scratch:SI 4 ""))]
12730 "! TARGET_POWERPC64 && reload_completed"
12731 [(set (match_dup 4)
12732 (plus:SI (gtu:SI (match_dup 1) (match_dup 2))
12735 (compare:CC (match_dup 4)
12740 [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y")
12742 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12743 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
12744 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
12746 (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))]
12749 addic %4,%1,%k2\;addze. %4,%3
12750 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %4,%4,%3
12753 [(set_attr "type" "compare")
12754 (set_attr "length" "8,12,12,16")])
12757 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
12759 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12760 (match_operand:DI 2 "reg_or_short_operand" ""))
12761 (match_operand:DI 3 "gpc_reg_operand" ""))
12763 (clobber (match_scratch:DI 4 ""))]
12764 "TARGET_POWERPC64 && reload_completed"
12765 [(set (match_dup 4)
12766 (plus:DI (gtu:DI (match_dup 1) (match_dup 2))
12769 (compare:CC (match_dup 4)
12774 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12776 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r,r,r,r")
12777 (match_operand:SI 2 "reg_or_short_operand" "I,r,I,r"))
12778 (match_operand:SI 3 "gpc_reg_operand" "r,r,r,r"))
12780 (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
12781 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12782 (clobber (match_scratch:SI 4 "=&r,&r,&r,&r"))]
12783 "! TARGET_POWERPC64"
12785 {ai|addic} %4,%1,%k2\;{aze.|addze.} %0,%3
12786 {sf%I2|subf%I2c} %4,%1,%2\;{sfe|subfe} %4,%4,%4\;{sf.|subfc.} %0,%4,%3
12789 [(set_attr "type" "compare")
12790 (set_attr "length" "8,12,12,16")])
12793 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12795 (plus:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "")
12796 (match_operand:SI 2 "reg_or_short_operand" ""))
12797 (match_operand:SI 3 "gpc_reg_operand" ""))
12799 (set (match_operand:SI 0 "gpc_reg_operand" "")
12800 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12801 (clobber (match_scratch:SI 4 ""))]
12802 "! TARGET_POWERPC64 && reload_completed"
12803 [(parallel [(set (match_dup 0)
12804 (plus:SI (gtu:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
12805 (clobber (match_dup 4))])
12807 (compare:CC (match_dup 0)
12812 [(set (match_operand:CC 5 "cc_reg_operand" "=x,x,?y,?y")
12814 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r,r,r")
12815 (match_operand:DI 2 "reg_or_short_operand" "I,r,I,r"))
12816 (match_operand:DI 3 "gpc_reg_operand" "r,r,r,r"))
12818 (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r")
12819 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
12820 (clobber (match_scratch:DI 4 "=&r,&r,&r,&r"))]
12823 addic %4,%1,%k2\;addze. %0,%3
12824 subf%I2c %4,%1,%2\;subfe %4,%4,%4\;subfc. %0,%4,%3
12827 [(set_attr "type" "compare")
12828 (set_attr "length" "8,12,12,16")])
12831 [(set (match_operand:CC 5 "cc_reg_not_cr0_operand" "")
12833 (plus:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "")
12834 (match_operand:DI 2 "reg_or_short_operand" ""))
12835 (match_operand:DI 3 "gpc_reg_operand" ""))
12837 (set (match_operand:DI 0 "gpc_reg_operand" "")
12838 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
12839 (clobber (match_scratch:DI 4 ""))]
12840 "TARGET_POWERPC64 && reload_completed"
12841 [(parallel [(set (match_dup 0)
12842 (plus:DI (gtu:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
12843 (clobber (match_dup 4))])
12845 (compare:CC (match_dup 0)
12850 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
12851 (neg:SI (gtu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
12852 (match_operand:SI 2 "reg_or_short_operand" "rI"))))]
12853 "! TARGET_POWERPC64"
12854 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0"
12855 [(set_attr "length" "8")])
12858 [(set (match_operand:DI 0 "gpc_reg_operand" "=r")
12859 (neg:DI (gtu:DI (match_operand:DI 1 "gpc_reg_operand" "r")
12860 (match_operand:DI 2 "reg_or_short_operand" "rI"))))]
12862 "subf%I2c %0,%1,%2\;subfe %0,%0,%0"
12863 [(set_attr "length" "8")])
12865 ;; Define both directions of branch and return. If we need a reload
12866 ;; register, we'd rather use CR0 since it is much easier to copy a
12867 ;; register CC value to there.
12871 (if_then_else (match_operator 1 "branch_comparison_operator"
12873 "cc_reg_operand" "x,?y")
12875 (label_ref (match_operand 0 "" ""))
12880 return output_cbranch (operands[1], \"%l0\", 0, insn);
12882 [(set_attr "type" "branch")])
12886 (if_then_else (match_operator 0 "branch_comparison_operator"
12888 "cc_reg_operand" "x,?y")
12895 return output_cbranch (operands[0], NULL, 0, insn);
12897 [(set_attr "type" "branch")
12898 (set_attr "length" "4")])
12902 (if_then_else (match_operator 1 "branch_comparison_operator"
12904 "cc_reg_operand" "x,?y")
12907 (label_ref (match_operand 0 "" ""))))]
12911 return output_cbranch (operands[1], \"%l0\", 1, insn);
12913 [(set_attr "type" "branch")])
12917 (if_then_else (match_operator 0 "branch_comparison_operator"
12919 "cc_reg_operand" "x,?y")
12926 return output_cbranch (operands[0], NULL, 1, insn);
12928 [(set_attr "type" "branch")
12929 (set_attr "length" "4")])
12931 ;; Logic on condition register values.
12933 ; This pattern matches things like
12934 ; (set (reg:CCEQ 68) (compare:CCEQ (ior:SI (gt:SI (reg:CCFP 68) (const_int 0))
12935 ; (eq:SI (reg:CCFP 68) (const_int 0)))
12937 ; which are generated by the branch logic.
12940 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
12941 (compare:CCEQ (match_operator:SI 1 "boolean_operator"
12942 [(match_operator:SI 2
12943 "branch_positive_comparison_operator"
12945 "cc_reg_operand" "y")
12947 (match_operator:SI 4
12948 "branch_positive_comparison_operator"
12950 "cc_reg_operand" "y")
12954 "cr%q1 %E0,%j2,%j4"
12955 [(set_attr "type" "cr_logical")])
12957 ; Why is the constant -1 here, but 1 in the previous pattern?
12958 ; Because ~1 has all but the low bit set.
12960 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
12961 (compare:CCEQ (match_operator:SI 1 "boolean_or_operator"
12962 [(not:SI (match_operator:SI 2
12963 "branch_positive_comparison_operator"
12965 "cc_reg_operand" "y")
12967 (match_operator:SI 4
12968 "branch_positive_comparison_operator"
12970 "cc_reg_operand" "y")
12974 "cr%q1 %E0,%j2,%j4"
12975 [(set_attr "type" "cr_logical")])
12978 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
12979 (compare:CCEQ (match_operator:SI 1
12980 "branch_positive_comparison_operator"
12982 "cc_reg_operand" "y")
12986 "{crnor %E0,%j1,%j1|crnot %E0,%j1}"
12987 [(set_attr "type" "cr_logical")])
12989 ;; If we are comparing the result of two comparisons, this can be done
12990 ;; using creqv or crxor.
12992 (define_insn_and_split ""
12993 [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
12994 (compare:CCEQ (match_operator 1 "branch_comparison_operator"
12995 [(match_operand 2 "cc_reg_operand" "y")
12997 (match_operator 3 "branch_comparison_operator"
12998 [(match_operand 4 "cc_reg_operand" "y")
13003 [(set (match_dup 0) (compare:CCEQ (xor:SI (match_dup 1) (match_dup 3))
13007 int positive_1, positive_2;
13009 positive_1 = branch_positive_comparison_operator (operands[1], CCEQmode);
13010 positive_2 = branch_positive_comparison_operator (operands[3], CCEQmode);
13013 operands[1] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[2]),
13014 GET_CODE (operands[1])),
13016 operands[2], const0_rtx);
13017 else if (GET_MODE (operands[1]) != SImode)
13018 operands[1] = gen_rtx (GET_CODE (operands[1]),
13020 operands[2], const0_rtx);
13023 operands[3] = gen_rtx (rs6000_reverse_condition (GET_MODE (operands[4]),
13024 GET_CODE (operands[3])),
13026 operands[4], const0_rtx);
13027 else if (GET_MODE (operands[3]) != SImode)
13028 operands[3] = gen_rtx (GET_CODE (operands[3]),
13030 operands[4], const0_rtx);
13032 if (positive_1 == positive_2)
13034 operands[1] = gen_rtx_NOT (SImode, operands[1]);
13035 operands[5] = constm1_rtx;
13039 operands[5] = const1_rtx;
13043 ;; Unconditional branch and return.
13045 (define_insn "jump"
13047 (label_ref (match_operand 0 "" "")))]
13050 [(set_attr "type" "branch")])
13052 (define_insn "return"
13056 [(set_attr "type" "jmpreg")])
13058 (define_expand "indirect_jump"
13059 [(set (pc) (match_operand 0 "register_operand" ""))]
13064 emit_jump_insn (gen_indirect_jumpsi (operands[0]));
13066 emit_jump_insn (gen_indirect_jumpdi (operands[0]));
13070 (define_insn "indirect_jumpsi"
13071 [(set (pc) (match_operand:SI 0 "register_operand" "c,*l"))]
13076 [(set_attr "type" "jmpreg")])
13078 (define_insn "indirect_jumpdi"
13079 [(set (pc) (match_operand:DI 0 "register_operand" "c,*l"))]
13084 [(set_attr "type" "jmpreg")])
13086 ;; Table jump for switch statements:
13087 (define_expand "tablejump"
13088 [(use (match_operand 0 "" ""))
13089 (use (label_ref (match_operand 1 "" "")))]
13094 emit_jump_insn (gen_tablejumpsi (operands[0], operands[1]));
13096 emit_jump_insn (gen_tablejumpdi (operands[0], operands[1]));
13100 (define_expand "tablejumpsi"
13101 [(set (match_dup 3)
13102 (plus:SI (match_operand:SI 0 "" "")
13104 (parallel [(set (pc) (match_dup 3))
13105 (use (label_ref (match_operand 1 "" "")))])]
13108 { operands[0] = force_reg (SImode, operands[0]);
13109 operands[2] = force_reg (SImode, gen_rtx_LABEL_REF (SImode, operands[1]));
13110 operands[3] = gen_reg_rtx (SImode);
13113 (define_expand "tablejumpdi"
13114 [(set (match_dup 4)
13115 (sign_extend:DI (match_operand:SI 0 "lwa_operand" "rm")))
13117 (plus:DI (match_dup 4)
13119 (parallel [(set (pc) (match_dup 3))
13120 (use (label_ref (match_operand 1 "" "")))])]
13123 { operands[2] = force_reg (DImode, gen_rtx_LABEL_REF (DImode, operands[1]));
13124 operands[3] = gen_reg_rtx (DImode);
13125 operands[4] = gen_reg_rtx (DImode);
13130 (match_operand:SI 0 "register_operand" "c,*l"))
13131 (use (label_ref (match_operand 1 "" "")))]
13136 [(set_attr "type" "jmpreg")])
13140 (match_operand:DI 0 "register_operand" "c,*l"))
13141 (use (label_ref (match_operand 1 "" "")))]
13146 [(set_attr "type" "jmpreg")])
13151 "{cror 0,0,0|nop}")
13153 ;; Define the subtract-one-and-jump insns, starting with the template
13154 ;; so loop.c knows what to generate.
13156 (define_expand "doloop_end"
13157 [(use (match_operand 0 "" "")) ; loop pseudo
13158 (use (match_operand 1 "" "")) ; iterations; zero if unknown
13159 (use (match_operand 2 "" "")) ; max iterations
13160 (use (match_operand 3 "" "")) ; loop level
13161 (use (match_operand 4 "" ""))] ; label
13165 /* Only use this on innermost loops. */
13166 if (INTVAL (operands[3]) > 1)
13168 if (TARGET_POWERPC64)
13170 if (GET_MODE (operands[0]) != DImode)
13172 emit_jump_insn (gen_ctrdi (operands[0], operands[4]));
13176 if (GET_MODE (operands[0]) != SImode)
13178 emit_jump_insn (gen_ctrsi (operands[0], operands[4]));
13183 (define_expand "ctrsi"
13184 [(parallel [(set (pc)
13185 (if_then_else (ne (match_operand:SI 0 "register_operand" "")
13187 (label_ref (match_operand 1 "" ""))
13190 (plus:SI (match_dup 0)
13192 (clobber (match_scratch:CC 2 ""))
13193 (clobber (match_scratch:SI 3 ""))])]
13194 "! TARGET_POWERPC64"
13197 (define_expand "ctrdi"
13198 [(parallel [(set (pc)
13199 (if_then_else (ne (match_operand:DI 0 "register_operand" "")
13201 (label_ref (match_operand 1 "" ""))
13204 (plus:DI (match_dup 0)
13206 (clobber (match_scratch:CC 2 ""))
13207 (clobber (match_scratch:DI 3 ""))])]
13211 ;; We need to be able to do this for any operand, including MEM, or we
13212 ;; will cause reload to blow up since we don't allow output reloads on
13214 ;; For the length attribute to be calculated correctly, the
13215 ;; label MUST be operand 0.
13217 (define_insn "*ctrsi_internal1"
13219 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
13221 (label_ref (match_operand 0 "" ""))
13223 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13224 (plus:SI (match_dup 1)
13226 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13227 (clobber (match_scratch:SI 4 "=X,X,r"))]
13228 "! TARGET_POWERPC64"
13231 if (which_alternative != 0)
13233 else if (get_attr_length (insn) == 4)
13234 return \"{bdn|bdnz} %l0\";
13236 return \"bdz $+8\;b %l0\";
13238 [(set_attr "type" "branch")
13239 (set_attr "length" "*,12,16")])
13241 (define_insn "*ctrsi_internal2"
13243 (if_then_else (ne (match_operand:SI 1 "register_operand" "c,*r,*r")
13246 (label_ref (match_operand 0 "" ""))))
13247 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13248 (plus:SI (match_dup 1)
13250 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13251 (clobber (match_scratch:SI 4 "=X,X,r"))]
13252 "! TARGET_POWERPC64"
13255 if (which_alternative != 0)
13257 else if (get_attr_length (insn) == 4)
13258 return \"bdz %l0\";
13260 return \"{bdn|bdnz} $+8\;b %l0\";
13262 [(set_attr "type" "branch")
13263 (set_attr "length" "*,12,16")])
13265 (define_insn "*ctrdi_internal1"
13267 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13269 (label_ref (match_operand 0 "" ""))
13271 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13272 (plus:DI (match_dup 1)
13274 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13275 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13279 if (which_alternative != 0)
13281 else if (get_attr_length (insn) == 4)
13282 return \"{bdn|bdnz} %l0\";
13284 return \"bdz $+8\;b %l0\";
13286 [(set_attr "type" "branch")
13287 (set_attr "length" "*,12,16,24")])
13289 (define_insn "*ctrdi_internal2"
13291 (if_then_else (ne (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13294 (label_ref (match_operand 0 "" ""))))
13295 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13296 (plus:DI (match_dup 1)
13298 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13299 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13303 if (which_alternative != 0)
13305 else if (get_attr_length (insn) == 4)
13306 return \"bdz %l0\";
13308 return \"{bdn|bdnz} $+8\;b %l0\";
13310 [(set_attr "type" "branch")
13311 (set_attr "length" "*,12,16,24")])
13313 ;; Similar, but we can use GE since we have a REG_NONNEG.
13315 (define_insn "*ctrsi_internal3"
13317 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
13319 (label_ref (match_operand 0 "" ""))
13321 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13322 (plus:SI (match_dup 1)
13324 (clobber (match_scratch:CC 3 "=X,&x,&X"))
13325 (clobber (match_scratch:SI 4 "=X,X,r"))]
13326 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13329 if (which_alternative != 0)
13331 else if (get_attr_length (insn) == 4)
13332 return \"{bdn|bdnz} %l0\";
13334 return \"bdz $+8\;b %l0\";
13336 [(set_attr "type" "branch")
13337 (set_attr "length" "*,12,16")])
13339 (define_insn "*ctrsi_internal4"
13341 (if_then_else (ge (match_operand:SI 1 "register_operand" "c,*r,*r")
13344 (label_ref (match_operand 0 "" ""))))
13345 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13346 (plus:SI (match_dup 1)
13348 (clobber (match_scratch:CC 3 "=X,&x,&X"))
13349 (clobber (match_scratch:SI 4 "=X,X,r"))]
13350 "! TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13353 if (which_alternative != 0)
13355 else if (get_attr_length (insn) == 4)
13356 return \"bdz %l0\";
13358 return \"{bdn|bdnz} $+8\;b %l0\";
13360 [(set_attr "type" "branch")
13361 (set_attr "length" "*,12,16")])
13363 (define_insn "*ctrdi_internal3"
13365 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13367 (label_ref (match_operand 0 "" ""))
13369 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13370 (plus:DI (match_dup 1)
13372 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13373 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13374 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13377 if (which_alternative != 0)
13379 else if (get_attr_length (insn) == 4)
13380 return \"{bdn|bdnz} %l0\";
13382 return \"bdz $+8\;b %l0\";
13384 [(set_attr "type" "branch")
13385 (set_attr "length" "*,12,16,24")])
13387 (define_insn "*ctrdi_internal4"
13389 (if_then_else (ge (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13392 (label_ref (match_operand 0 "" ""))))
13393 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13394 (plus:DI (match_dup 1)
13396 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13397 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13398 "TARGET_POWERPC64 && find_reg_note (insn, REG_NONNEG, 0)"
13401 if (which_alternative != 0)
13403 else if (get_attr_length (insn) == 4)
13404 return \"bdz %l0\";
13406 return \"{bdn|bdnz} $+8\;b %l0\";
13408 [(set_attr "type" "branch")
13409 (set_attr "length" "*,12,16,24")])
13411 ;; Similar but use EQ
13413 (define_insn "*ctrsi_internal5"
13415 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
13417 (label_ref (match_operand 0 "" ""))
13419 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13420 (plus:SI (match_dup 1)
13422 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13423 (clobber (match_scratch:SI 4 "=X,X,r"))]
13424 "! TARGET_POWERPC64"
13427 if (which_alternative != 0)
13429 else if (get_attr_length (insn) == 4)
13430 return \"bdz %l0\";
13432 return \"{bdn|bdnz} $+8\;b %l0\";
13434 [(set_attr "type" "branch")
13435 (set_attr "length" "*,12,16")])
13437 (define_insn "*ctrsi_internal6"
13439 (if_then_else (eq (match_operand:SI 1 "register_operand" "c,*r,*r")
13442 (label_ref (match_operand 0 "" ""))))
13443 (set (match_operand:SI 2 "register_operand" "=1,*r,m*q*c*l")
13444 (plus:SI (match_dup 1)
13446 (clobber (match_scratch:CC 3 "=X,&x,&x"))
13447 (clobber (match_scratch:SI 4 "=X,X,r"))]
13448 "! TARGET_POWERPC64"
13451 if (which_alternative != 0)
13453 else if (get_attr_length (insn) == 4)
13454 return \"{bdn|bdnz} %l0\";
13456 return \"bdz $+8\;b %l0\";
13458 [(set_attr "type" "branch")
13459 (set_attr "length" "*,12,16")])
13461 (define_insn "*ctrdi_internal5"
13463 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13465 (label_ref (match_operand 0 "" ""))
13467 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13468 (plus:DI (match_dup 1)
13470 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13471 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13475 if (which_alternative != 0)
13477 else if (get_attr_length (insn) == 4)
13478 return \"bdz %l0\";
13480 return \"{bdn|bdnz} $+8\;b %l0\";
13482 [(set_attr "type" "branch")
13483 (set_attr "length" "*,12,16,24")])
13485 (define_insn "*ctrdi_internal6"
13487 (if_then_else (eq (match_operand:DI 1 "register_operand" "c,*r,*r,!*f")
13490 (label_ref (match_operand 0 "" ""))))
13491 (set (match_operand:DI 2 "register_operand" "=1,*r,m*c*l,!*f")
13492 (plus:DI (match_dup 1)
13494 (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
13495 (clobber (match_scratch:DI 4 "=X,X,r,r"))]
13499 if (which_alternative != 0)
13501 else if (get_attr_length (insn) == 4)
13502 return \"{bdn|bdnz} %l0\";
13504 return \"bdz $+8\;b %l0\";
13506 [(set_attr "type" "branch")
13507 (set_attr "length" "*,12,16,24")])
13509 ;; Now the splitters if we could not allocate the CTR register
13513 (if_then_else (match_operator 2 "comparison_operator"
13514 [(match_operand:SI 1 "gpc_reg_operand" "")
13516 (match_operand 5 "" "")
13517 (match_operand 6 "" "")))
13518 (set (match_operand:SI 0 "gpc_reg_operand" "")
13519 (plus:SI (match_dup 1)
13521 (clobber (match_scratch:CC 3 ""))
13522 (clobber (match_scratch:SI 4 ""))]
13523 "! TARGET_POWERPC64 && reload_completed"
13524 [(parallel [(set (match_dup 3)
13525 (compare:CC (plus:SI (match_dup 1)
13529 (plus:SI (match_dup 1)
13531 (set (pc) (if_then_else (match_dup 7)
13535 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13540 (if_then_else (match_operator 2 "comparison_operator"
13541 [(match_operand:SI 1 "gpc_reg_operand" "")
13543 (match_operand 5 "" "")
13544 (match_operand 6 "" "")))
13545 (set (match_operand:SI 0 "nonimmediate_operand" "")
13546 (plus:SI (match_dup 1) (const_int -1)))
13547 (clobber (match_scratch:CC 3 ""))
13548 (clobber (match_scratch:SI 4 ""))]
13549 "! TARGET_POWERPC64 && reload_completed
13550 && ! gpc_reg_operand (operands[0], SImode)"
13551 [(parallel [(set (match_dup 3)
13552 (compare:CC (plus:SI (match_dup 1)
13556 (plus:SI (match_dup 1)
13560 (set (pc) (if_then_else (match_dup 7)
13564 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13568 (if_then_else (match_operator 2 "comparison_operator"
13569 [(match_operand:DI 1 "gpc_reg_operand" "")
13571 (match_operand 5 "" "")
13572 (match_operand 6 "" "")))
13573 (set (match_operand:DI 0 "gpc_reg_operand" "")
13574 (plus:DI (match_dup 1)
13576 (clobber (match_scratch:CC 3 ""))
13577 (clobber (match_scratch:DI 4 ""))]
13578 "TARGET_POWERPC64 && reload_completed && INT_REGNO_P (REGNO (operands[0]))"
13579 [(parallel [(set (match_dup 3)
13580 (compare:CC (plus:DI (match_dup 1)
13584 (plus:DI (match_dup 1)
13586 (set (pc) (if_then_else (match_dup 7)
13590 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13595 (if_then_else (match_operator 2 "comparison_operator"
13596 [(match_operand:DI 1 "gpc_reg_operand" "")
13598 (match_operand 5 "" "")
13599 (match_operand 6 "" "")))
13600 (set (match_operand:DI 0 "nonimmediate_operand" "")
13601 (plus:DI (match_dup 1) (const_int -1)))
13602 (clobber (match_scratch:CC 3 ""))
13603 (clobber (match_scratch:DI 4 ""))]
13604 "TARGET_POWERPC64 && reload_completed
13605 && ! gpc_reg_operand (operands[0], DImode)"
13606 [(parallel [(set (match_dup 3)
13607 (compare:CC (plus:DI (match_dup 1)
13611 (plus:DI (match_dup 1)
13615 (set (pc) (if_then_else (match_dup 7)
13619 { operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13624 (if_then_else (match_operator 2 "comparison_operator"
13625 [(match_operand:DI 1 "gpc_reg_operand" "")
13627 (match_operand 5 "" "")
13628 (match_operand 6 "" "")))
13629 (set (match_operand:DI 0 "gpc_reg_operand" "")
13630 (plus:DI (match_dup 1)
13632 (clobber (match_scratch:CC 3 ""))
13633 (clobber (match_scratch:DI 4 ""))]
13634 "TARGET_POWERPC64 && reload_completed && FP_REGNO_P (REGNO (operands[0]))"
13635 [(set (match_dup 8)
13639 (parallel [(set (match_dup 3)
13640 (compare:CC (plus:DI (match_dup 4)
13644 (plus:DI (match_dup 4)
13650 (set (pc) (if_then_else (match_dup 7)
13655 operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
13657 operands[8] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
13661 (define_insn "trap"
13662 [(trap_if (const_int 1) (const_int 0))]
13666 (define_expand "conditional_trap"
13667 [(trap_if (match_operator 0 "trap_comparison_operator"
13668 [(match_dup 2) (match_dup 3)])
13669 (match_operand 1 "const_int_operand" ""))]
13671 "if (rs6000_compare_fp_p || operands[1] != const0_rtx) FAIL;
13672 operands[2] = rs6000_compare_op0;
13673 operands[3] = rs6000_compare_op1;")
13676 [(trap_if (match_operator 0 "trap_comparison_operator"
13677 [(match_operand:SI 1 "register_operand" "r")
13678 (match_operand:SI 2 "reg_or_short_operand" "rI")])
13681 "{t|tw}%V0%I2 %1,%2")
13684 [(trap_if (match_operator 0 "trap_comparison_operator"
13685 [(match_operand:DI 1 "register_operand" "r")
13686 (match_operand:DI 2 "reg_or_short_operand" "rI")])
13691 ;; Insns related to generating the function prologue and epilogue.
13693 (define_expand "prologue"
13694 [(use (const_int 0))]
13695 "TARGET_SCHED_PROLOG"
13698 rs6000_emit_prologue ();
13702 (define_insn "movesi_from_cr"
13703 [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
13704 (unspec:SI [(reg:CC 68) (reg:CC 69) (reg:CC 70) (reg:CC 71)
13705 (reg:CC 72) (reg:CC 73) (reg:CC 74) (reg:CC 75)] 19))]
13709 (define_insn "*stmw"
13710 [(match_parallel 0 "stmw_operation"
13711 [(set (match_operand:SI 1 "memory_operand" "=m")
13712 (match_operand:SI 2 "gpc_reg_operand" "r"))])]
13714 "{stm|stmw} %2,%1")
13716 (define_insn "*save_fpregs_si"
13717 [(match_parallel 0 "any_operand"
13718 [(clobber (match_operand:SI 1 "register_operand" "=l"))
13719 (use (match_operand:SI 2 "call_operand" "s"))
13720 (set (match_operand:DF 3 "memory_operand" "=m")
13721 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
13725 (define_insn "*save_fpregs_di"
13726 [(match_parallel 0 "any_operand"
13727 [(clobber (match_operand:DI 1 "register_operand" "=l"))
13728 (use (match_operand:DI 2 "call_operand" "s"))
13729 (set (match_operand:DF 3 "memory_operand" "=m")
13730 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
13734 ; These are to explain that changes to the stack pointer should
13735 ; not be moved over stores to stack memory.
13736 (define_insn "stack_tie"
13737 [(set (match_operand:BLK 0 "memory_operand" "+m")
13738 (unspec:BLK [(match_dup 0)] 5))]
13741 [(set_attr "length" "0")])
13744 (define_expand "epilogue"
13745 [(use (const_int 0))]
13746 "TARGET_SCHED_PROLOG"
13749 rs6000_emit_epilogue (FALSE);
13753 ; On some processors, doing the mtcrf one CC register at a time is
13754 ; faster (like on the 604e). On others, doing them all at once is
13755 ; faster; for instance, on the 601 and 750.
13757 (define_expand "movsi_to_cr_one"
13758 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
13759 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
13760 (match_dup 2)] 20))]
13762 "operands[2] = GEN_INT (1 << (75 - REGNO (operands[0])));")
13764 (define_insn "*movsi_to_cr"
13765 [(match_parallel 0 "mtcrf_operation"
13766 [(set (match_operand:CC 1 "cc_reg_operand" "=y")
13767 (unspec:CC [(match_operand:SI 2 "gpc_reg_operand" "r")
13768 (match_operand 3 "immediate_operand" "n")]
13775 for (i = 0; i < XVECLEN (operands[0], 0); i++)
13776 mask |= INTVAL (XVECEXP (SET_SRC (XVECEXP (operands[0], 0, i)), 0, 1));
13777 operands[4] = GEN_INT (mask);
13778 return \"mtcrf %4,%2\";
13782 [(set (match_operand:CC 0 "cc_reg_operand" "=y")
13783 (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
13784 (match_operand 2 "immediate_operand" "n")] 20))]
13785 "GET_CODE (operands[0]) == REG
13786 && CR_REGNO_P (REGNO (operands[0]))
13787 && GET_CODE (operands[2]) == CONST_INT
13788 && INTVAL (operands[2]) == 1 << (75 - REGNO (operands[0]))"
13791 ; The load-multiple instructions have similar properties.
13792 ; Note that "load_multiple" is a name known to the machine-independent
13793 ; code that actually corresponds to the powerpc load-string.
13795 (define_insn "*lmw"
13796 [(match_parallel 0 "lmw_operation"
13797 [(set (match_operand:SI 1 "gpc_reg_operand" "=r")
13798 (match_operand:SI 2 "memory_operand" "m"))])]
13802 (define_insn "*return_internal_si"
13804 (use (match_operand:SI 0 "register_operand" "lc"))]
13807 [(set_attr "type" "jmpreg")])
13809 (define_insn "*return_internal_di"
13811 (use (match_operand:DI 0 "register_operand" "lc"))]
13814 [(set_attr "type" "jmpreg")])
13816 ; FIXME: This would probably be somewhat simpler if the Cygnus sibcall
13817 ; stuff was in GCC. Oh, and "any_operand" is a bit flexible...
13819 (define_insn "*return_and_restore_fpregs_si"
13820 [(match_parallel 0 "any_operand"
13822 (use (match_operand:SI 1 "register_operand" "l"))
13823 (use (match_operand:SI 2 "call_operand" "s"))
13824 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
13825 (match_operand:DF 4 "memory_operand" "m"))])]
13829 (define_insn "*return_and_restore_fpregs_di"
13830 [(match_parallel 0 "any_operand"
13832 (use (match_operand:DI 1 "register_operand" "l"))
13833 (use (match_operand:DI 2 "call_operand" "s"))
13834 (set (match_operand:DF 3 "gpc_reg_operand" "=f")
13835 (match_operand:DF 4 "memory_operand" "m"))])]
13839 ; This is used in compiling the unwind routines.
13840 (define_expand "eh_return"
13841 [(use (match_operand 0 "general_operand" ""))
13842 (use (match_operand 1 "general_operand" ""))]
13847 rs6000_emit_eh_toc_restore (operands[0]);
13850 emit_insn (gen_eh_set_lr_si (operands[1]));
13852 emit_insn (gen_eh_set_lr_di (operands[1]));
13853 emit_move_insn (EH_RETURN_STACKADJ_RTX, operands[0]);
13857 ; We can't expand this before we know where the link register is stored.
13858 (define_insn "eh_set_lr_si"
13859 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] 9)
13860 (clobber (match_scratch:SI 1 "=&b"))]
13864 (define_insn "eh_set_lr_di"
13865 [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")] 9)
13866 (clobber (match_scratch:DI 1 "=&b"))]
13871 [(unspec_volatile [(match_operand 0 "register_operand" "")] 9)
13872 (clobber (match_scratch 1 ""))]
13877 rs6000_stack_t *info = rs6000_stack_info ();
13879 if (info->lr_save_p)
13881 rtx frame_rtx = stack_pointer_rtx;
13885 if (frame_pointer_needed
13886 || current_function_calls_alloca
13887 || info->total_size > 32767)
13889 emit_move_insn (operands[1], gen_rtx_MEM (Pmode, frame_rtx));
13890 frame_rtx = operands[1];
13892 else if (info->push_p)
13893 sp_offset = info->total_size;
13895 tmp = plus_constant (frame_rtx, info->lr_save_offset + sp_offset);
13896 tmp = gen_rtx_MEM (Pmode, tmp);
13897 emit_move_insn (tmp, operands[0]);
13900 emit_move_insn (gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM), operands[0]);
13904 (define_insn "prefetch"
13905 [(prefetch (match_operand:V4SI 0 "address_operand" "p")
13906 (match_operand:SI 1 "const_int_operand" "n")
13907 (match_operand:SI 2 "const_int_operand" "n"))]
13911 if (GET_CODE (operands[0]) == REG)
13912 return INTVAL (operands[1]) ? \"dcbtst 0,%0\" : \"dcbt 0,%0\";
13913 return INTVAL (operands[1]) ? \"dcbtst %a0\" : \"dcbt %a0\";
13915 [(set_attr "type" "load")])
13917 ;; AltiVec patterns
13919 ;; Generic LVX load instruction.
13920 (define_insn "altivec_lvx_4si"
13921 [(set (match_operand:V4SI 0 "altivec_register_operand" "=v")
13922 (match_operand:V4SI 1 "memory_operand" "m"))]
13925 [(set_attr "type" "vecload")])
13927 (define_insn "altivec_lvx_8hi"
13928 [(set (match_operand:V8HI 0 "altivec_register_operand" "=v")
13929 (match_operand:V8HI 1 "memory_operand" "m"))]
13932 [(set_attr "type" "vecload")])
13934 (define_insn "altivec_lvx_16qi"
13935 [(set (match_operand:V16QI 0 "altivec_register_operand" "=v")
13936 (match_operand:V16QI 1 "memory_operand" "m"))]
13939 [(set_attr "type" "vecload")])
13941 (define_insn "altivec_lvx_4sf"
13942 [(set (match_operand:V4SF 0 "altivec_register_operand" "=v")
13943 (match_operand:V4SF 1 "memory_operand" "m"))]
13946 [(set_attr "type" "vecload")])
13948 ;; Generic STVX store instruction.
13949 (define_insn "altivec_stvx_4si"
13950 [(set (match_operand:V4SI 0 "memory_operand" "=m")
13951 (match_operand:V4SI 1 "altivec_register_operand" "v"))]
13954 [(set_attr "type" "vecstore")])
13956 (define_insn "altivec_stvx_8hi"
13957 [(set (match_operand:V8HI 0 "memory_operand" "=m")
13958 (match_operand:V8HI 1 "altivec_register_operand" "v"))]
13961 [(set_attr "type" "vecstore")])
13963 (define_insn "altivec_stvx_16qi"
13964 [(set (match_operand:V16QI 0 "memory_operand" "=m")
13965 (match_operand:V16QI 1 "altivec_register_operand" "v"))]
13968 [(set_attr "type" "vecstore")])
13970 (define_insn "altivec_stvx_4sf"
13971 [(set (match_operand:V4SF 0 "memory_operand" "=m")
13972 (match_operand:V4SF 1 "altivec_register_operand" "v"))]
13975 [(set_attr "type" "vecstore")])
13977 ;; Vector move instructions.
13978 (define_expand "movv4si"
13979 [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
13980 (match_operand:V4SI 1 "any_operand" ""))]
13982 "{ rs6000_emit_move (operands[0], operands[1], V4SImode); DONE; }")
13984 (define_insn "*movv4si_internal"
13985 [(set (match_operand:V4SI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
13986 (match_operand:V4SI 1 "input_operand" "v,m,v,r,m,r"))]
13992 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
13993 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
13994 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
13995 [(set_attr "type" "altivec")
13996 (set_attr "length" "*,*,*,16,16,16")])
13998 (define_expand "movv8hi"
13999 [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
14000 (match_operand:V8HI 1 "any_operand" ""))]
14002 "{ rs6000_emit_move (operands[0], operands[1], V8HImode); DONE; }")
14004 (define_insn "*movv8hi_internal1"
14005 [(set (match_operand:V8HI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
14006 (match_operand:V8HI 1 "input_operand" "v,m,v,r,m,r"))]
14012 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14013 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14014 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14015 [(set_attr "type" "altivec")
14016 (set_attr "length" "*,*,*,16,16,16")])
14018 (define_expand "movv16qi"
14019 [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
14020 (match_operand:V16QI 1 "any_operand" ""))]
14022 "{ rs6000_emit_move (operands[0], operands[1], V16QImode); DONE; }")
14024 (define_insn "*movv16qi_internal1"
14025 [(set (match_operand:V16QI 0 "nonimmediate_operand" "=m,v,v,m,r,r")
14026 (match_operand:V16QI 1 "input_operand" "v,m,v,r,m,r"))]
14032 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14033 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14034 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14035 [(set_attr "type" "altivec")
14036 (set_attr "length" "*,*,*,16,16,16")])
14038 (define_expand "movv4sf"
14039 [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
14040 (match_operand:V4SF 1 "any_operand" ""))]
14042 "{ rs6000_emit_move (operands[0], operands[1], V4SFmode); DONE; }")
14044 (define_insn "*movv4sf_internal1"
14045 [(set (match_operand:V4SF 0 "nonimmediate_operand" "=m,v,v,m,r,r")
14046 (match_operand:V4SF 1 "input_operand" "v,m,v,r,m,r"))]
14052 stw%U0 %1,%0\;stw %L1,%L0\;stw %Y1,%Y0\;stw %Z1,%Z0
14053 lwz%U1 %0,%1\;lwz %L0,%L1\;lwz %Y0,%Y1\;lwz %Z0,%Z1
14054 mr %0,%1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1"
14055 [(set_attr "type" "altivec")
14056 (set_attr "length" "*,*,*,16,16,16")])
14058 (define_insn "get_vrsave_internal"
14059 [(set (match_operand:SI 0 "register_operand" "=r")
14060 (unspec:SI [(reg:SI 109)] 214))]
14065 return \"mfspr %0,256\";
14067 return \"mfvrsave %0\";
14069 [(set_attr "type" "altivec")])
14071 (define_insn "*set_vrsave_internal"
14072 [(match_parallel 0 "vrsave_operation"
14074 (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "r")
14075 (reg:SI 109)] 30))])]
14080 return \"mtspr 256,%1\";
14082 return \"mtvrsave %1\";
14084 [(set_attr "type" "altivec")])
14087 (define_insn "*movv4si_const0"
14088 [(set (match_operand:V4SI 0 "altivec_register_operand" "=v")
14089 (match_operand:V4SI 1 "zero_constant" ""))]
14092 [(set_attr "type" "vecsimple")])
14094 (define_insn "*movv4sf_const0"
14095 [(set (match_operand:V4SF 0 "altivec_register_operand" "=v")
14096 (match_operand:V4SF 1 "zero_constant" ""))]
14100 [(set_attr "type" "vecsimple")])
14102 (define_insn "*movv8hi_const0"
14103 [(set (match_operand:V8HI 0 "altivec_register_operand" "=v")
14104 (match_operand:V8HI 1 "zero_constant" ""))]
14107 [(set_attr "type" "vecsimple")])
14109 (define_insn "*movv16qi_const0"
14110 [(set (match_operand:V16QI 0 "altivec_register_operand" "=v")
14111 (match_operand:V16QI 1 "zero_constant" ""))]
14114 [(set_attr "type" "vecsimple")])
14116 ;; Simple binary operations.
14118 (define_insn "addv16qi3"
14119 [(set (match_operand:V16QI 0 "register_operand" "=v")
14120 (plus:V16QI (match_operand:V16QI 1 "register_operand" "v")
14121 (match_operand:V16QI 2 "register_operand" "v")))]
14124 [(set_attr "type" "vecsimple")])
14126 (define_insn "addv8hi3"
14127 [(set (match_operand:V8HI 0 "register_operand" "=v")
14128 (plus:V8HI (match_operand:V8HI 1 "register_operand" "v")
14129 (match_operand:V8HI 2 "register_operand" "v")))]
14132 [(set_attr "type" "vecsimple")])
14134 (define_insn "addv4si3"
14135 [(set (match_operand:V4SI 0 "register_operand" "=v")
14136 (plus:V4SI (match_operand:V4SI 1 "register_operand" "v")
14137 (match_operand:V4SI 2 "register_operand" "v")))]
14140 [(set_attr "type" "vecsimple")])
14142 (define_insn "addv4sf3"
14143 [(set (match_operand:V4SF 0 "register_operand" "=v")
14144 (plus:V4SF (match_operand:V4SF 1 "register_operand" "v")
14145 (match_operand:V4SF 2 "register_operand" "v")))]
14148 [(set_attr "type" "vecfloat")])
14150 (define_insn "altivec_vaddcuw"
14151 [(set (match_operand:V4SI 0 "register_operand" "=v")
14152 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14153 (match_operand:V4SI 2 "register_operand" "v")] 35))]
14156 [(set_attr "type" "vecsimple")])
14158 (define_insn "altivec_vaddubs"
14159 [(set (match_operand:V16QI 0 "register_operand" "=v")
14160 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14161 (match_operand:V16QI 2 "register_operand" "v")] 36))]
14164 [(set_attr "type" "vecsimple")])
14166 (define_insn "altivec_vaddsbs"
14167 [(set (match_operand:V16QI 0 "register_operand" "=v")
14168 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14169 (match_operand:V16QI 2 "register_operand" "v")] 37))]
14172 [(set_attr "type" "vecsimple")])
14174 (define_insn "altivec_vadduhs"
14175 [(set (match_operand:V8HI 0 "register_operand" "=v")
14176 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14177 (match_operand:V8HI 2 "register_operand" "v")] 38))]
14180 [(set_attr "type" "vecsimple")])
14182 (define_insn "altivec_vaddshs"
14183 [(set (match_operand:V8HI 0 "register_operand" "=v")
14184 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14185 (match_operand:V8HI 2 "register_operand" "v")] 39))]
14188 [(set_attr "type" "vecsimple")])
14190 (define_insn "altivec_vadduws"
14191 [(set (match_operand:V4SI 0 "register_operand" "=v")
14192 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14193 (match_operand:V4SI 2 "register_operand" "v")] 40))]
14196 [(set_attr "type" "vecsimple")])
14198 (define_insn "altivec_vaddsws"
14199 [(set (match_operand:V4SI 0 "register_operand" "=v")
14200 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14201 (match_operand:V4SI 2 "register_operand" "v")] 41))]
14204 [(set_attr "type" "vecsimple")])
14206 (define_insn "andv4si3"
14207 [(set (match_operand:V4SI 0 "register_operand" "=v")
14208 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
14209 (match_operand:V4SI 2 "register_operand" "v")))]
14212 [(set_attr "type" "vecsimple")])
14214 (define_insn "altivec_vandc"
14215 [(set (match_operand:V4SI 0 "register_operand" "=v")
14216 (and:V4SI (match_operand:V4SI 1 "register_operand" "v")
14217 (not:V4SI (match_operand:V4SI 2 "register_operand" "v"))))]
14220 [(set_attr "type" "vecsimple")])
14222 (define_insn "altivec_vavgub"
14223 [(set (match_operand:V16QI 0 "register_operand" "=v")
14224 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14225 (match_operand:V16QI 2 "register_operand" "v")] 44))]
14228 [(set_attr "type" "vecsimple")])
14230 (define_insn "altivec_vavgsb"
14231 [(set (match_operand:V16QI 0 "register_operand" "=v")
14232 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14233 (match_operand:V16QI 2 "register_operand" "v")] 45))]
14236 [(set_attr "type" "vecsimple")])
14238 (define_insn "altivec_vavguh"
14239 [(set (match_operand:V8HI 0 "register_operand" "=v")
14240 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14241 (match_operand:V8HI 2 "register_operand" "v")] 46))]
14244 [(set_attr "type" "vecsimple")])
14246 (define_insn "altivec_vavgsh"
14247 [(set (match_operand:V8HI 0 "register_operand" "=v")
14248 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14249 (match_operand:V8HI 2 "register_operand" "v")] 47))]
14252 [(set_attr "type" "vecsimple")])
14254 (define_insn "altivec_vavguw"
14255 [(set (match_operand:V4SI 0 "register_operand" "=v")
14256 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14257 (match_operand:V4SI 2 "register_operand" "v")] 48))]
14260 [(set_attr "type" "vecsimple")])
14262 (define_insn "altivec_vavgsw"
14263 [(set (match_operand:V4SI 0 "register_operand" "=v")
14264 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14265 (match_operand:V4SI 2 "register_operand" "v")] 49))]
14268 [(set_attr "type" "vecsimple")])
14270 (define_insn "altivec_vcmpbfp"
14271 [(set (match_operand:V4SI 0 "register_operand" "=v")
14272 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14273 (match_operand:V4SF 2 "register_operand" "v")] 50))]
14276 [(set_attr "type" "veccmp")])
14278 (define_insn "altivec_vcmpequb"
14279 [(set (match_operand:V16QI 0 "register_operand" "=v")
14280 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14281 (match_operand:V16QI 2 "register_operand" "v")] 51))]
14283 "vcmpequb %0,%1,%2"
14284 [(set_attr "type" "vecsimple")])
14286 (define_insn "altivec_vcmpequh"
14287 [(set (match_operand:V8HI 0 "register_operand" "=v")
14288 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14289 (match_operand:V8HI 2 "register_operand" "v")] 52))]
14291 "vcmpequh %0,%1,%2"
14292 [(set_attr "type" "vecsimple")])
14294 (define_insn "altivec_vcmpequw"
14295 [(set (match_operand:V4SI 0 "register_operand" "=v")
14296 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14297 (match_operand:V4SI 2 "register_operand" "v")] 53))]
14299 "vcmpequw %0,%1,%2"
14300 [(set_attr "type" "vecsimple")])
14302 (define_insn "altivec_vcmpeqfp"
14303 [(set (match_operand:V4SI 0 "register_operand" "=v")
14304 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14305 (match_operand:V4SF 2 "register_operand" "v")] 54))]
14307 "vcmpeqfp %0,%1,%2"
14308 [(set_attr "type" "veccmp")])
14310 (define_insn "altivec_vcmpgefp"
14311 [(set (match_operand:V4SI 0 "register_operand" "=v")
14312 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14313 (match_operand:V4SF 2 "register_operand" "v")] 55))]
14315 "vcmpgefp %0,%1,%2"
14316 [(set_attr "type" "veccmp")])
14318 (define_insn "altivec_vcmpgtub"
14319 [(set (match_operand:V16QI 0 "register_operand" "=v")
14320 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14321 (match_operand:V16QI 2 "register_operand" "v")] 56))]
14323 "vcmpgtub %0,%1,%2"
14324 [(set_attr "type" "vecsimple")])
14326 (define_insn "altivec_vcmpgtsb"
14327 [(set (match_operand:V16QI 0 "register_operand" "=v")
14328 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14329 (match_operand:V16QI 2 "register_operand" "v")] 57))]
14331 "vcmpgtsb %0,%1,%2"
14332 [(set_attr "type" "vecsimple")])
14334 (define_insn "altivec_vcmpgtuh"
14335 [(set (match_operand:V8HI 0 "register_operand" "=v")
14336 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14337 (match_operand:V8HI 2 "register_operand" "v")] 58))]
14339 "vcmpgtuh %0,%1,%2"
14340 [(set_attr "type" "vecsimple")])
14342 (define_insn "altivec_vcmpgtsh"
14343 [(set (match_operand:V8HI 0 "register_operand" "=v")
14344 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14345 (match_operand:V8HI 2 "register_operand" "v")] 59))]
14347 "vcmpgtsh %0,%1,%2"
14348 [(set_attr "type" "vecsimple")])
14350 (define_insn "altivec_vcmpgtuw"
14351 [(set (match_operand:V4SI 0 "register_operand" "=v")
14352 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14353 (match_operand:V4SI 2 "register_operand" "v")] 60))]
14355 "vcmpgtuw %0,%1,%2"
14356 [(set_attr "type" "vecsimple")])
14358 (define_insn "altivec_vcmpgtsw"
14359 [(set (match_operand:V4SI 0 "register_operand" "=v")
14360 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14361 (match_operand:V4SI 2 "register_operand" "v")] 61))]
14363 "vcmpgtsw %0,%1,%2"
14364 [(set_attr "type" "vecsimple")])
14366 (define_insn "altivec_vcmpgtfp"
14367 [(set (match_operand:V4SI 0 "register_operand" "=v")
14368 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
14369 (match_operand:V4SF 2 "register_operand" "v")] 62))]
14371 "vcmpgtfp %0,%1,%2"
14372 [(set_attr "type" "veccmp")])
14374 ;; Fused multiply add
14375 (define_insn "altivec_vmaddfp"
14376 [(set (match_operand:V4SF 0 "register_operand" "=v")
14377 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14378 (match_operand:V4SF 2 "register_operand" "v"))
14379 (match_operand:V4SF 3 "register_operand" "v")))]
14381 "vmaddfp %0,%1,%2,%3"
14382 [(set_attr "type" "vecfloat")])
14384 ;; The unspec here is a vec splat of 0. We do multiply as a fused
14385 ;; multiply-add with an add of a 0 vector.
14387 (define_expand "mulv4sf3"
14388 [(set (match_dup 3) (unspec:V4SF [(const_int 0)] 142))
14389 (set (match_operand:V4SF 0 "register_operand" "=v")
14390 (plus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14391 (match_operand:V4SF 2 "register_operand" "v"))
14393 "TARGET_ALTIVEC && TARGET_FUSED_MADD"
14395 { operands[3] = gen_reg_rtx (V4SFmode); }")
14397 ;; Fused multiply subtract
14398 (define_insn "altivec_vnmsubfp"
14399 [(set (match_operand:V4SF 0 "register_operand" "=v")
14400 (minus:V4SF (mult:V4SF (match_operand:V4SF 1 "register_operand" "v")
14401 (match_operand:V4SF 2 "register_operand" "v"))
14402 (match_operand:V4SF 3 "register_operand" "v")))]
14404 "vnmsubfp %0,%1,%2,%3"
14405 [(set_attr "type" "vecfloat")])
14408 (define_insn "altivec_vmsumubm"
14409 [(set (match_operand:V4SI 0 "register_operand" "=v")
14410 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
14411 (match_operand:V16QI 2 "register_operand" "v")
14412 (match_operand:V4SI 3 "register_operand" "v")] 65))]
14414 "vmsumubm %0, %1, %2, %3"
14415 [(set_attr "type" "veccomplex")])
14417 (define_insn "altivec_vmsummbm"
14418 [(set (match_operand:V4SI 0 "register_operand" "=v")
14419 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
14420 (match_operand:V16QI 2 "register_operand" "v")
14421 (match_operand:V4SI 3 "register_operand" "v")] 66))]
14423 "vmsumubm %0, %1, %2, %3"
14424 [(set_attr "type" "veccomplex")])
14426 (define_insn "altivec_vmsumuhm"
14427 [(set (match_operand:V4SI 0 "register_operand" "=v")
14428 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14429 (match_operand:V8HI 2 "register_operand" "v")
14430 (match_operand:V4SI 3 "register_operand" "v")] 67))]
14432 "vmsumuhm %0, %1, %2, %3"
14433 [(set_attr "type" "veccomplex")])
14435 (define_insn "altivec_vmsumshm"
14436 [(set (match_operand:V4SI 0 "register_operand" "=v")
14437 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14438 (match_operand:V8HI 2 "register_operand" "v")
14439 (match_operand:V4SI 3 "register_operand" "v")] 68))]
14441 "vmsumshm %0, %1, %2, %3"
14442 [(set_attr "type" "veccomplex")])
14444 (define_insn "altivec_vmsumuhs"
14445 [(set (match_operand:V4SI 0 "register_operand" "=v")
14446 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14447 (match_operand:V8HI 2 "register_operand" "v")
14448 (match_operand:V4SI 3 "register_operand" "v")] 69))]
14450 "vmsumuhs %0, %1, %2, %3"
14451 [(set_attr "type" "veccomplex")])
14453 (define_insn "altivec_vmsumshs"
14454 [(set (match_operand:V4SI 0 "register_operand" "=v")
14455 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14456 (match_operand:V8HI 2 "register_operand" "v")
14457 (match_operand:V4SI 3 "register_operand" "v")] 70))]
14459 "vmsumshs %0, %1, %2, %3"
14460 [(set_attr "type" "veccomplex")])
14462 (define_insn "umaxv16qi3"
14463 [(set (match_operand:V16QI 0 "register_operand" "=v")
14464 (umax:V16QI (match_operand:V16QI 1 "register_operand" "v")
14465 (match_operand:V16QI 2 "register_operand" "v")))]
14468 [(set_attr "type" "vecsimple")])
14470 (define_insn "smaxv16qi3"
14471 [(set (match_operand:V16QI 0 "register_operand" "=v")
14472 (smax:V16QI (match_operand:V16QI 1 "register_operand" "v")
14473 (match_operand:V16QI 2 "register_operand" "v")))]
14476 [(set_attr "type" "vecsimple")])
14478 (define_insn "umaxv8hi3"
14479 [(set (match_operand:V8HI 0 "register_operand" "=v")
14480 (umax:V8HI (match_operand:V8HI 1 "register_operand" "v")
14481 (match_operand:V8HI 2 "register_operand" "v")))]
14484 [(set_attr "type" "vecsimple")])
14486 (define_insn "smaxv8hi3"
14487 [(set (match_operand:V8HI 0 "register_operand" "=v")
14488 (smax:V8HI (match_operand:V8HI 1 "register_operand" "v")
14489 (match_operand:V8HI 2 "register_operand" "v")))]
14492 [(set_attr "type" "vecsimple")])
14494 (define_insn "umaxv4si3"
14495 [(set (match_operand:V4SI 0 "register_operand" "=v")
14496 (umax:V4SI (match_operand:V4SI 1 "register_operand" "v")
14497 (match_operand:V4SI 2 "register_operand" "v")))]
14500 [(set_attr "type" "vecsimple")])
14502 (define_insn "smaxv4si3"
14503 [(set (match_operand:V4SI 0 "register_operand" "=v")
14504 (smax:V4SI (match_operand:V4SI 1 "register_operand" "v")
14505 (match_operand:V4SI 2 "register_operand" "v")))]
14508 [(set_attr "type" "vecsimple")])
14510 (define_insn "smaxv4sf3"
14511 [(set (match_operand:V4SF 0 "register_operand" "=v")
14512 (smax:V4SF (match_operand:V4SF 1 "register_operand" "v")
14513 (match_operand:V4SF 2 "register_operand" "v")))]
14516 [(set_attr "type" "veccmp")])
14518 (define_insn "altivec_vmhaddshs"
14519 [(set (match_operand:V8HI 0 "register_operand" "=v")
14520 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14521 (match_operand:V8HI 2 "register_operand" "v")
14522 (match_operand:V8HI 3 "register_operand" "v")] 71))]
14524 "vmhaddshs %0, %1, %2, %3"
14525 [(set_attr "type" "veccomplex")])
14526 (define_insn "altivec_vmhraddshs"
14527 [(set (match_operand:V8HI 0 "register_operand" "=v")
14528 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14529 (match_operand:V8HI 2 "register_operand" "v")
14530 (match_operand:V8HI 3 "register_operand" "v")] 72))]
14532 "vmhraddshs %0, %1, %2, %3"
14533 [(set_attr "type" "veccomplex")])
14534 (define_insn "altivec_vmladduhm"
14535 [(set (match_operand:V8HI 0 "register_operand" "=v")
14536 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14537 (match_operand:V8HI 2 "register_operand" "v")
14538 (match_operand:V8HI 3 "register_operand" "v")] 73))]
14540 "vmladduhm %0, %1, %2, %3"
14541 [(set_attr "type" "veccomplex")])
14543 (define_insn "altivec_vmrghb"
14544 [(set (match_operand:V16QI 0 "register_operand" "=v")
14545 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v")
14546 (parallel [(const_int 8)
14562 (match_operand:V16QI 2 "register_operand" "v")
14566 [(set_attr "type" "vecperm")])
14568 (define_insn "altivec_vmrghh"
14569 [(set (match_operand:V8HI 0 "register_operand" "=v")
14570 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v")
14571 (parallel [(const_int 4)
14579 (match_operand:V8HI 2 "register_operand" "v")
14583 [(set_attr "type" "vecperm")])
14585 (define_insn "altivec_vmrghw"
14586 [(set (match_operand:V4SI 0 "register_operand" "=v")
14587 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v")
14588 (parallel [(const_int 2)
14592 (match_operand:V4SI 2 "register_operand" "v")
14596 [(set_attr "type" "vecperm")])
14598 (define_insn "altivec_vmrglb"
14599 [(set (match_operand:V16QI 0 "register_operand" "=v")
14600 (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v")
14602 (parallel [(const_int 0)
14618 (match_operand:V16QI 1 "register_operand" "v")
14622 [(set_attr "type" "vecperm")])
14624 (define_insn "altivec_vmrglh"
14625 [(set (match_operand:V8HI 0 "register_operand" "=v")
14626 (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v")
14627 (parallel [(const_int 0)
14635 (match_operand:V8HI 1 "register_operand" "v")
14639 [(set_attr "type" "vecperm")])
14641 (define_insn "altivec_vmrglw"
14642 [(set (match_operand:V4SI 0 "register_operand" "=v")
14643 (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v")
14644 (parallel [(const_int 0)
14648 (match_operand:V4SI 1 "register_operand" "v")
14652 [(set_attr "type" "vecperm")])
14654 (define_insn "uminv16qi3"
14655 [(set (match_operand:V16QI 0 "register_operand" "=v")
14656 (umin:V16QI (match_operand:V16QI 1 "register_operand" "v")
14657 (match_operand:V16QI 2 "register_operand" "v")))]
14660 [(set_attr "type" "vecsimple")])
14662 (define_insn "sminv16qi3"
14663 [(set (match_operand:V16QI 0 "register_operand" "=v")
14664 (smin:V16QI (match_operand:V16QI 1 "register_operand" "v")
14665 (match_operand:V16QI 2 "register_operand" "v")))]
14668 [(set_attr "type" "vecsimple")])
14670 (define_insn "uminv8hi3"
14671 [(set (match_operand:V8HI 0 "register_operand" "=v")
14672 (umin:V8HI (match_operand:V8HI 1 "register_operand" "v")
14673 (match_operand:V8HI 2 "register_operand" "v")))]
14676 [(set_attr "type" "vecsimple")])
14678 (define_insn "sminv8hi3"
14679 [(set (match_operand:V8HI 0 "register_operand" "=v")
14680 (smin:V8HI (match_operand:V8HI 1 "register_operand" "v")
14681 (match_operand:V8HI 2 "register_operand" "v")))]
14684 [(set_attr "type" "vecsimple")])
14686 (define_insn "uminv4si3"
14687 [(set (match_operand:V4SI 0 "register_operand" "=v")
14688 (umin:V4SI (match_operand:V4SI 1 "register_operand" "v")
14689 (match_operand:V4SI 2 "register_operand" "v")))]
14692 [(set_attr "type" "vecsimple")])
14694 (define_insn "sminv4si3"
14695 [(set (match_operand:V4SI 0 "register_operand" "=v")
14696 (smin:V4SI (match_operand:V4SI 1 "register_operand" "v")
14697 (match_operand:V4SI 2 "register_operand" "v")))]
14700 [(set_attr "type" "vecsimple")])
14702 (define_insn "sminv4sf3"
14703 [(set (match_operand:V4SF 0 "register_operand" "=v")
14704 (smin:V4SF (match_operand:V4SF 1 "register_operand" "v")
14705 (match_operand:V4SF 2 "register_operand" "v")))]
14708 [(set_attr "type" "veccmp")])
14710 (define_insn "altivec_vmuleub"
14711 [(set (match_operand:V8HI 0 "register_operand" "=v")
14712 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14713 (match_operand:V16QI 2 "register_operand" "v")] 83))]
14716 [(set_attr "type" "veccomplex")])
14718 (define_insn "altivec_vmulesb"
14719 [(set (match_operand:V8HI 0 "register_operand" "=v")
14720 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14721 (match_operand:V16QI 2 "register_operand" "v")] 84))]
14724 [(set_attr "type" "veccomplex")])
14726 (define_insn "altivec_vmuleuh"
14727 [(set (match_operand:V4SI 0 "register_operand" "=v")
14728 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14729 (match_operand:V8HI 2 "register_operand" "v")] 85))]
14732 [(set_attr "type" "veccomplex")])
14734 (define_insn "altivec_vmulesh"
14735 [(set (match_operand:V4SI 0 "register_operand" "=v")
14736 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14737 (match_operand:V8HI 2 "register_operand" "v")] 86))]
14740 [(set_attr "type" "veccomplex")])
14742 (define_insn "altivec_vmuloub"
14743 [(set (match_operand:V8HI 0 "register_operand" "=v")
14744 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14745 (match_operand:V16QI 2 "register_operand" "v")] 87))]
14748 [(set_attr "type" "veccomplex")])
14750 (define_insn "altivec_vmulosb"
14751 [(set (match_operand:V8HI 0 "register_operand" "=v")
14752 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")
14753 (match_operand:V16QI 2 "register_operand" "v")] 88))]
14756 [(set_attr "type" "veccomplex")])
14758 (define_insn "altivec_vmulouh"
14759 [(set (match_operand:V4SI 0 "register_operand" "=v")
14760 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14761 (match_operand:V8HI 2 "register_operand" "v")] 89))]
14764 [(set_attr "type" "veccomplex")])
14766 (define_insn "altivec_vmulosh"
14767 [(set (match_operand:V4SI 0 "register_operand" "=v")
14768 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
14769 (match_operand:V8HI 2 "register_operand" "v")] 90))]
14772 [(set_attr "type" "veccomplex")])
14774 (define_insn "altivec_vnor"
14775 [(set (match_operand:V4SI 0 "register_operand" "=v")
14776 (not:V4SI (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
14777 (match_operand:V4SI 2 "register_operand" "v"))))]
14780 [(set_attr "type" "vecsimple")])
14782 (define_insn "iorv4si3"
14783 [(set (match_operand:V4SI 0 "register_operand" "=v")
14784 (ior:V4SI (match_operand:V4SI 1 "register_operand" "v")
14785 (match_operand:V4SI 2 "register_operand" "v")))]
14788 [(set_attr "type" "vecsimple")])
14790 (define_insn "altivec_vpkuhum"
14791 [(set (match_operand:V16QI 0 "register_operand" "=v")
14792 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14793 (match_operand:V8HI 2 "register_operand" "v")] 93))]
14796 [(set_attr "type" "vecperm")])
14798 (define_insn "altivec_vpkuwum"
14799 [(set (match_operand:V8HI 0 "register_operand" "=v")
14800 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14801 (match_operand:V4SI 2 "register_operand" "v")] 94))]
14804 [(set_attr "type" "vecperm")])
14806 (define_insn "altivec_vpkpx"
14807 [(set (match_operand:V8HI 0 "register_operand" "=v")
14808 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14809 (match_operand:V4SI 2 "register_operand" "v")] 95))]
14812 [(set_attr "type" "vecperm")])
14814 (define_insn "altivec_vpkuhss"
14815 [(set (match_operand:V16QI 0 "register_operand" "=v")
14816 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14817 (match_operand:V8HI 2 "register_operand" "v")] 96))]
14820 [(set_attr "type" "vecperm")])
14822 (define_insn "altivec_vpkshss"
14823 [(set (match_operand:V16QI 0 "register_operand" "=v")
14824 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14825 (match_operand:V8HI 2 "register_operand" "v")] 97))]
14828 [(set_attr "type" "vecperm")])
14830 (define_insn "altivec_vpkuwss"
14831 [(set (match_operand:V8HI 0 "register_operand" "=v")
14832 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14833 (match_operand:V4SI 2 "register_operand" "v")] 98))]
14836 [(set_attr "type" "vecperm")])
14838 (define_insn "altivec_vpkswss"
14839 [(set (match_operand:V8HI 0 "register_operand" "=v")
14840 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14841 (match_operand:V4SI 2 "register_operand" "v")] 99))]
14844 [(set_attr "type" "vecperm")])
14846 (define_insn "altivec_vpkuhus"
14847 [(set (match_operand:V16QI 0 "register_operand" "=v")
14848 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14849 (match_operand:V8HI 2 "register_operand" "v")] 100))]
14852 [(set_attr "type" "vecperm")])
14854 (define_insn "altivec_vpkshus"
14855 [(set (match_operand:V16QI 0 "register_operand" "=v")
14856 (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v")
14857 (match_operand:V8HI 2 "register_operand" "v")] 101))]
14860 [(set_attr "type" "vecperm")])
14862 (define_insn "altivec_vpkuwus"
14863 [(set (match_operand:V8HI 0 "register_operand" "=v")
14864 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14865 (match_operand:V4SI 2 "register_operand" "v")] 102))]
14868 [(set_attr "type" "vecperm")])
14870 (define_insn "altivec_vpkswus"
14871 [(set (match_operand:V8HI 0 "register_operand" "=v")
14872 (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v")
14873 (match_operand:V4SI 2 "register_operand" "v")] 103))]
14876 [(set_attr "type" "vecperm")])
14878 (define_insn "altivec_vrlb"
14879 [(set (match_operand:V16QI 0 "register_operand" "=v")
14880 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14881 (match_operand:V16QI 2 "register_operand" "v")] 104))]
14884 [(set_attr "type" "vecsimple")])
14886 (define_insn "altivec_vrlh"
14887 [(set (match_operand:V8HI 0 "register_operand" "=v")
14888 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14889 (match_operand:V8HI 2 "register_operand" "v")] 105))]
14892 [(set_attr "type" "vecsimple")])
14894 (define_insn "altivec_vrlw"
14895 [(set (match_operand:V4SI 0 "register_operand" "=v")
14896 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14897 (match_operand:V4SI 2 "register_operand" "v")] 106))]
14900 [(set_attr "type" "vecsimple")])
14902 (define_insn "altivec_vslb"
14903 [(set (match_operand:V16QI 0 "register_operand" "=v")
14904 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14905 (match_operand:V16QI 2 "register_operand" "v")] 107))]
14908 [(set_attr "type" "vecsimple")])
14910 (define_insn "altivec_vslh"
14911 [(set (match_operand:V8HI 0 "register_operand" "=v")
14912 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14913 (match_operand:V8HI 2 "register_operand" "v")] 108))]
14916 [(set_attr "type" "vecsimple")])
14918 (define_insn "altivec_vslw"
14919 [(set (match_operand:V4SI 0 "register_operand" "=v")
14920 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14921 (match_operand:V4SI 2 "register_operand" "v")] 109))]
14924 [(set_attr "type" "vecsimple")])
14926 (define_insn "altivec_vsl"
14927 [(set (match_operand:V4SI 0 "register_operand" "=v")
14928 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14929 (match_operand:V4SI 2 "register_operand" "v")] 110))]
14932 [(set_attr "type" "vecperm")])
14934 (define_insn "altivec_vslo"
14935 [(set (match_operand:V4SI 0 "register_operand" "=v")
14936 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14937 (match_operand:V4SI 2 "register_operand" "v")] 111))]
14940 [(set_attr "type" "vecperm")])
14942 (define_insn "altivec_vsrb"
14943 [(set (match_operand:V16QI 0 "register_operand" "=v")
14944 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14945 (match_operand:V16QI 2 "register_operand" "v")] 112))]
14948 [(set_attr "type" "vecsimple")])
14950 (define_insn "altivec_vsrh"
14951 [(set (match_operand:V8HI 0 "register_operand" "=v")
14952 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14953 (match_operand:V8HI 2 "register_operand" "v")] 113))]
14956 [(set_attr "type" "vecsimple")])
14958 (define_insn "altivec_vsrw"
14959 [(set (match_operand:V4SI 0 "register_operand" "=v")
14960 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14961 (match_operand:V4SI 2 "register_operand" "v")] 114))]
14964 [(set_attr "type" "vecsimple")])
14966 (define_insn "altivec_vsrab"
14967 [(set (match_operand:V16QI 0 "register_operand" "=v")
14968 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
14969 (match_operand:V16QI 2 "register_operand" "v")] 115))]
14972 [(set_attr "type" "vecsimple")])
14974 (define_insn "altivec_vsrah"
14975 [(set (match_operand:V8HI 0 "register_operand" "=v")
14976 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
14977 (match_operand:V8HI 2 "register_operand" "v")] 116))]
14980 [(set_attr "type" "vecsimple")])
14982 (define_insn "altivec_vsraw"
14983 [(set (match_operand:V4SI 0 "register_operand" "=v")
14984 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14985 (match_operand:V4SI 2 "register_operand" "v")] 117))]
14988 [(set_attr "type" "vecsimple")])
14990 (define_insn "altivec_vsr"
14991 [(set (match_operand:V4SI 0 "register_operand" "=v")
14992 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
14993 (match_operand:V4SI 2 "register_operand" "v")] 118))]
14996 [(set_attr "type" "vecperm")])
14998 (define_insn "altivec_vsro"
14999 [(set (match_operand:V4SI 0 "register_operand" "=v")
15000 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15001 (match_operand:V4SI 2 "register_operand" "v")] 119))]
15004 [(set_attr "type" "vecperm")])
15006 (define_insn "subv16qi3"
15007 [(set (match_operand:V16QI 0 "register_operand" "=v")
15008 (minus:V16QI (match_operand:V16QI 1 "register_operand" "v")
15009 (match_operand:V16QI 2 "register_operand" "v")))]
15012 [(set_attr "type" "vecsimple")])
15014 (define_insn "subv8hi3"
15015 [(set (match_operand:V8HI 0 "register_operand" "=v")
15016 (minus:V8HI (match_operand:V8HI 1 "register_operand" "v")
15017 (match_operand:V8HI 2 "register_operand" "v")))]
15020 [(set_attr "type" "vecsimple")])
15022 (define_insn "subv4si3"
15023 [(set (match_operand:V4SI 0 "register_operand" "=v")
15024 (minus:V4SI (match_operand:V4SI 1 "register_operand" "v")
15025 (match_operand:V4SI 2 "register_operand" "v")))]
15028 [(set_attr "type" "vecsimple")])
15030 (define_insn "subv4sf3"
15031 [(set (match_operand:V4SF 0 "register_operand" "=v")
15032 (minus:V4SF (match_operand:V4SF 1 "register_operand" "v")
15033 (match_operand:V4SF 2 "register_operand" "v")))]
15036 [(set_attr "type" "vecfloat")])
15038 (define_insn "altivec_vsubcuw"
15039 [(set (match_operand:V4SI 0 "register_operand" "=v")
15040 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15041 (match_operand:V4SI 2 "register_operand" "v")] 124))]
15044 [(set_attr "type" "vecsimple")])
15046 (define_insn "altivec_vsububs"
15047 [(set (match_operand:V16QI 0 "register_operand" "=v")
15048 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15049 (match_operand:V16QI 2 "register_operand" "v")] 125))]
15052 [(set_attr "type" "vecsimple")])
15054 (define_insn "altivec_vsubsbs"
15055 [(set (match_operand:V16QI 0 "register_operand" "=v")
15056 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15057 (match_operand:V16QI 2 "register_operand" "v")] 126))]
15060 [(set_attr "type" "vecsimple")])
15062 (define_insn "altivec_vsubuhs"
15063 [(set (match_operand:V8HI 0 "register_operand" "=v")
15064 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15065 (match_operand:V8HI 2 "register_operand" "v")] 127))]
15068 [(set_attr "type" "vecsimple")])
15070 (define_insn "altivec_vsubshs"
15071 [(set (match_operand:V8HI 0 "register_operand" "=v")
15072 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15073 (match_operand:V8HI 2 "register_operand" "v")] 128))]
15076 [(set_attr "type" "vecsimple")])
15078 (define_insn "altivec_vsubuws"
15079 [(set (match_operand:V4SI 0 "register_operand" "=v")
15080 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15081 (match_operand:V4SI 2 "register_operand" "v")] 129))]
15084 [(set_attr "type" "vecsimple")])
15086 (define_insn "altivec_vsubsws"
15087 [(set (match_operand:V4SI 0 "register_operand" "=v")
15088 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15089 (match_operand:V4SI 2 "register_operand" "v")] 130))]
15092 [(set_attr "type" "vecsimple")])
15094 (define_insn "altivec_vsum4ubs"
15095 [(set (match_operand:V4SI 0 "register_operand" "=v")
15096 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
15097 (match_operand:V4SI 2 "register_operand" "v")] 131))]
15099 "vsum4ubs %0,%1,%2"
15100 [(set_attr "type" "veccomplex")])
15102 (define_insn "altivec_vsum4sbs"
15103 [(set (match_operand:V4SI 0 "register_operand" "=v")
15104 (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v")
15105 (match_operand:V4SI 2 "register_operand" "v")] 132))]
15107 "vsum4sbs %0,%1,%2"
15108 [(set_attr "type" "veccomplex")])
15110 (define_insn "altivec_vsum4shs"
15111 [(set (match_operand:V4SI 0 "register_operand" "=v")
15112 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")
15113 (match_operand:V4SI 2 "register_operand" "v")] 133))]
15115 "vsum4shs %0,%1,%2"
15116 [(set_attr "type" "veccomplex")])
15118 (define_insn "altivec_vsum2sws"
15119 [(set (match_operand:V4SI 0 "register_operand" "=v")
15120 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15121 (match_operand:V4SI 2 "register_operand" "v")] 134))]
15123 "vsum2sws %0,%1,%2"
15124 [(set_attr "type" "veccomplex")])
15126 (define_insn "altivec_vsumsws"
15127 [(set (match_operand:V4SI 0 "register_operand" "=v")
15128 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15129 (match_operand:V4SI 2 "register_operand" "v")] 135))]
15132 [(set_attr "type" "veccomplex")])
15134 (define_insn "xorv4si3"
15135 [(set (match_operand:V4SI 0 "register_operand" "=v")
15136 (xor:V4SI (match_operand:V4SI 1 "register_operand" "v")
15137 (match_operand:V4SI 2 "register_operand" "v")))]
15140 [(set_attr "type" "vecsimple")])
15142 (define_insn "altivec_vspltb"
15143 [(set (match_operand:V16QI 0 "register_operand" "=v")
15144 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15145 (match_operand:QI 2 "immediate_operand" "i")] 136))]
15148 [(set_attr "type" "vecperm")])
15150 (define_insn "altivec_vsplth"
15151 [(set (match_operand:V8HI 0 "register_operand" "=v")
15152 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15153 (match_operand:QI 2 "immediate_operand" "i")] 137))]
15156 [(set_attr "type" "vecperm")])
15158 (define_insn "altivec_vspltw"
15159 [(set (match_operand:V4SI 0 "register_operand" "=v")
15160 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15161 (match_operand:QI 2 "immediate_operand" "i")] 138))]
15164 [(set_attr "type" "vecperm")])
15166 (define_insn "altivec_vspltisb"
15167 [(set (match_operand:V16QI 0 "register_operand" "=v")
15168 (unspec:V16QI [(match_operand:QI 1 "immediate_operand" "i")] 139))]
15171 [(set_attr "type" "vecsimple")])
15174 (define_insn "altivec_vspltish"
15175 [(set (match_operand:V8HI 0 "register_operand" "=v")
15176 (unspec:V8HI [(match_operand:QI 1 "immediate_operand" "i")] 140))]
15179 [(set_attr "type" "vecsimple")])
15181 (define_insn "altivec_vspltisw"
15182 [(set (match_operand:V4SI 0 "register_operand" "=v")
15183 (unspec:V4SI [(match_operand:QI 1 "immediate_operand" "i")] 141))]
15186 [(set_attr "type" "vecsimple")])
15189 [(set (match_operand:V4SF 0 "register_operand" "=v")
15190 (unspec:V4SF [(match_operand:QI 1 "immediate_operand" "i")] 142))]
15193 [(set_attr "type" "vecsimple")])
15195 (define_insn "ftruncv4sf2"
15196 [(set (match_operand:V4SF 0 "register_operand" "=v")
15197 (fix:V4SF (match_operand:V4SF 1 "register_operand" "v")))]
15200 [(set_attr "type" "vecfloat")])
15202 (define_insn "altivec_vperm_4si"
15203 [(set (match_operand:V4SI 0 "register_operand" "=v")
15204 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15205 (match_operand:V4SI 2 "register_operand" "v")
15206 (match_operand:V16QI 3 "register_operand" "v")] 144))]
15208 "vperm %0,%1,%2,%3"
15209 [(set_attr "type" "vecperm")])
15211 (define_insn "altivec_vperm_4sf"
15212 [(set (match_operand:V4SF 0 "register_operand" "=v")
15213 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15214 (match_operand:V4SF 2 "register_operand" "v")
15215 (match_operand:V16QI 3 "register_operand" "v")] 145))]
15217 "vperm %0,%1,%2,%3"
15218 [(set_attr "type" "vecperm")])
15220 (define_insn "altivec_vperm_8hi"
15221 [(set (match_operand:V8HI 0 "register_operand" "=v")
15222 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15223 (match_operand:V8HI 2 "register_operand" "v")
15224 (match_operand:V16QI 3 "register_operand" "v")] 146))]
15226 "vperm %0,%1,%2,%3"
15227 [(set_attr "type" "vecperm")])
15229 (define_insn "altivec_vperm_16qi"
15230 [(set (match_operand:V16QI 0 "register_operand" "=v")
15231 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15232 (match_operand:V16QI 2 "register_operand" "v")
15233 (match_operand:V16QI 3 "register_operand" "v")] 147))]
15235 "vperm %0,%1,%2,%3"
15236 [(set_attr "type" "vecperm")])
15238 (define_insn "altivec_vrfip"
15239 [(set (match_operand:V4SF 0 "register_operand" "=v")
15240 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 148))]
15243 [(set_attr "type" "vecfloat")])
15245 (define_insn "altivec_vrfin"
15246 [(set (match_operand:V4SF 0 "register_operand" "=v")
15247 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 149))]
15250 [(set_attr "type" "vecfloat")])
15252 (define_insn "altivec_vrfim"
15253 [(set (match_operand:V4SF 0 "register_operand" "=v")
15254 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 150))]
15257 [(set_attr "type" "vecfloat")])
15259 (define_insn "altivec_vcfux"
15260 [(set (match_operand:V4SF 0 "register_operand" "=v")
15261 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
15262 (match_operand:QI 2 "immediate_operand" "i")] 151))]
15265 [(set_attr "type" "vecfloat")])
15267 (define_insn "altivec_vcfsx"
15268 [(set (match_operand:V4SF 0 "register_operand" "=v")
15269 (unspec:V4SF [(match_operand:V4SI 1 "register_operand" "v")
15270 (match_operand:QI 2 "immediate_operand" "i")] 152))]
15273 [(set_attr "type" "vecfloat")])
15275 (define_insn "altivec_vctuxs"
15276 [(set (match_operand:V4SI 0 "register_operand" "=v")
15277 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
15278 (match_operand:QI 2 "immediate_operand" "i")] 153))]
15280 "vctuxs %0, %1, %2"
15281 [(set_attr "type" "vecfloat")])
15283 (define_insn "altivec_vctsxs"
15284 [(set (match_operand:V4SI 0 "register_operand" "=v")
15285 (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v")
15286 (match_operand:QI 2 "immediate_operand" "i")] 154))]
15288 "vctsxs %0, %1, %2"
15289 [(set_attr "type" "vecfloat")])
15291 (define_insn "altivec_vlogefp"
15292 [(set (match_operand:V4SF 0 "register_operand" "=v")
15293 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 155))]
15296 [(set_attr "type" "vecfloat")])
15298 (define_insn "altivec_vexptefp"
15299 [(set (match_operand:V4SF 0 "register_operand" "=v")
15300 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 156))]
15303 [(set_attr "type" "vecfloat")])
15305 (define_insn "altivec_vrsqrtefp"
15306 [(set (match_operand:V4SF 0 "register_operand" "=v")
15307 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 157))]
15310 [(set_attr "type" "vecfloat")])
15312 (define_insn "altivec_vrefp"
15313 [(set (match_operand:V4SF 0 "register_operand" "=v")
15314 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")] 158))]
15317 [(set_attr "type" "vecfloat")])
15319 (define_insn "altivec_vsel_4si"
15320 [(set (match_operand:V4SI 0 "register_operand" "=v")
15321 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15322 (match_operand:V4SI 2 "register_operand" "v")
15323 (match_operand:V4SI 3 "register_operand" "v")] 159))]
15326 [(set_attr "type" "vecperm")])
15328 (define_insn "altivec_vsel_4sf"
15329 [(set (match_operand:V4SF 0 "register_operand" "=v")
15330 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15331 (match_operand:V4SF 2 "register_operand" "v")
15332 (match_operand:V4SI 3 "register_operand" "v")] 160))]
15335 [(set_attr "type" "vecperm")])
15337 (define_insn "altivec_vsel_8hi"
15338 [(set (match_operand:V8HI 0 "register_operand" "=v")
15339 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15340 (match_operand:V8HI 2 "register_operand" "v")
15341 (match_operand:V8HI 3 "register_operand" "v")] 161))]
15344 [(set_attr "type" "vecperm")])
15346 (define_insn "altivec_vsel_16qi"
15347 [(set (match_operand:V16QI 0 "register_operand" "=v")
15348 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15349 (match_operand:V16QI 2 "register_operand" "v")
15350 (match_operand:V16QI 3 "register_operand" "v")] 162))]
15353 [(set_attr "type" "vecperm")])
15355 (define_insn "altivec_vsldoi_4si"
15356 [(set (match_operand:V4SI 0 "register_operand" "=v")
15357 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
15358 (match_operand:V4SI 2 "register_operand" "v")
15359 (match_operand:QI 3 "immediate_operand" "i")] 163))]
15361 "vsldoi %0, %1, %2, %3"
15362 [(set_attr "type" "vecperm")])
15364 (define_insn "altivec_vsldoi_4sf"
15365 [(set (match_operand:V4SF 0 "register_operand" "=v")
15366 (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v")
15367 (match_operand:V4SF 2 "register_operand" "v")
15368 (match_operand:QI 3 "immediate_operand" "i")] 164))]
15370 "vsldoi %0, %1, %2, %3"
15371 [(set_attr "type" "vecperm")])
15373 (define_insn "altivec_vsldoi_8hi"
15374 [(set (match_operand:V8HI 0 "register_operand" "=v")
15375 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")
15376 (match_operand:V8HI 2 "register_operand" "v")
15377 (match_operand:QI 3 "immediate_operand" "i")] 165))]
15379 "vsldoi %0, %1, %2, %3"
15380 [(set_attr "type" "vecperm")])
15382 (define_insn "altivec_vsldoi_16qi"
15383 [(set (match_operand:V16QI 0 "register_operand" "=v")
15384 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")
15385 (match_operand:V16QI 2 "register_operand" "v")
15386 (match_operand:QI 3 "immediate_operand" "i")] 166))]
15388 "vsldoi %0, %1, %2, %3"
15389 [(set_attr "type" "vecperm")])
15391 (define_insn "altivec_vupkhsb"
15392 [(set (match_operand:V8HI 0 "register_operand" "=v")
15393 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 167))]
15396 [(set_attr "type" "vecperm")])
15398 (define_insn "altivec_vupkhpx"
15399 [(set (match_operand:V4SI 0 "register_operand" "=v")
15400 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 168))]
15403 [(set_attr "type" "vecperm")])
15405 (define_insn "altivec_vupkhsh"
15406 [(set (match_operand:V4SI 0 "register_operand" "=v")
15407 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 169))]
15410 [(set_attr "type" "vecperm")])
15412 (define_insn "altivec_vupklsb"
15413 [(set (match_operand:V8HI 0 "register_operand" "=v")
15414 (unspec:V8HI [(match_operand:V16QI 1 "register_operand" "v")] 170))]
15417 [(set_attr "type" "vecperm")])
15419 (define_insn "altivec_vupklpx"
15420 [(set (match_operand:V4SI 0 "register_operand" "=v")
15421 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 171))]
15424 [(set_attr "type" "vecperm")])
15426 (define_insn "altivec_vupklsh"
15427 [(set (match_operand:V4SI 0 "register_operand" "=v")
15428 (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v")] 172))]
15431 [(set_attr "type" "vecperm")])
15433 ;; AltiVec predicates.
15435 (define_expand "cr6_test_for_zero"
15436 [(set (match_operand:SI 0 "register_operand" "=r")
15442 (define_expand "cr6_test_for_zero_reverse"
15443 [(set (match_operand:SI 0 "register_operand" "=r")
15446 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
15450 (define_expand "cr6_test_for_lt"
15451 [(set (match_operand:SI 0 "register_operand" "=r")
15457 (define_expand "cr6_test_for_lt_reverse"
15458 [(set (match_operand:SI 0 "register_operand" "=r")
15461 (set (match_dup 0) (minus:SI (const_int 1) (match_dup 0)))]
15465 ;; We can get away with generating the opcode on the fly (%3 below)
15466 ;; because all the predicates have the same scheduling parameters.
15468 (define_insn "altivec_predicate_v4si"
15470 (unspec:CC [(match_operand:V4SI 1 "register_operand" "v")
15471 (match_operand:V4SI 2 "register_operand" "v")
15472 (match_operand 3 "any_operand" "")] 173))
15473 (clobber (match_scratch:V4SI 0 "=v"))]
15476 [(set_attr "type" "veccmp")])
15478 (define_insn "altivec_predicate_v4sf"
15480 (unspec:CC [(match_operand:V4SF 1 "register_operand" "v")
15481 (match_operand:V4SF 2 "register_operand" "v")
15482 (match_operand 3 "any_operand" "")] 174))
15483 (clobber (match_scratch:V4SF 0 "=v"))]
15486 [(set_attr "type" "veccmp")])
15488 (define_insn "altivec_predicate_v8hi"
15490 (unspec:CC [(match_operand:V8HI 1 "register_operand" "v")
15491 (match_operand:V8HI 2 "register_operand" "v")
15492 (match_operand 3 "any_operand" "")] 175))
15493 (clobber (match_scratch:V8HI 0 "=v"))]
15496 [(set_attr "type" "veccmp")])
15498 (define_insn "altivec_predicate_v16qi"
15500 (unspec:CC [(match_operand:V16QI 1 "register_operand" "v")
15501 (match_operand:V16QI 2 "register_operand" "v")
15502 (match_operand 3 "any_operand" "")] 175))
15503 (clobber (match_scratch:V16QI 0 "=v"))]
15506 [(set_attr "type" "veccmp")])
15508 (define_insn "altivec_mtvscr"
15509 [(unspec [(match_operand:V4SI 0 "register_operand" "v")] 186)]
15512 [(set_attr "type" "vecsimple")])
15514 (define_insn "altivec_mfvscr"
15515 [(set (match_operand:V8HI 0 "register_operand" "=v")
15516 (unspec:V8HI [(const_int 0)] 187))]
15519 [(set_attr "type" "vecsimple")])
15521 (define_insn "altivec_dssall"
15522 [(unspec [(const_int 0)] 188)]
15525 [(set_attr "type" "vecsimple")])
15527 (define_insn "altivec_dss"
15528 [(unspec [(match_operand:QI 0 "immediate_operand" "i")] 189)]
15531 [(set_attr "type" "vecsimple")])
15533 (define_insn "altivec_dst"
15534 [(unspec [(match_operand:SI 0 "register_operand" "b")
15535 (match_operand:SI 1 "register_operand" "r")
15536 (match_operand:QI 2 "immediate_operand" "i")] 190)]
15539 [(set_attr "type" "vecsimple")])
15541 (define_insn "altivec_dstt"
15542 [(unspec [(match_operand:SI 0 "register_operand" "b")
15543 (match_operand:SI 1 "register_operand" "r")
15544 (match_operand:QI 2 "immediate_operand" "i")] 191)]
15547 [(set_attr "type" "vecsimple")])
15549 (define_insn "altivec_dstst"
15550 [(unspec [(match_operand:SI 0 "register_operand" "b")
15551 (match_operand:SI 1 "register_operand" "r")
15552 (match_operand:QI 2 "immediate_operand" "i")] 192)]
15555 [(set_attr "type" "vecsimple")])
15557 (define_insn "altivec_dststt"
15558 [(unspec [(match_operand:SI 0 "register_operand" "b")
15559 (match_operand:SI 1 "register_operand" "r")
15560 (match_operand:QI 2 "immediate_operand" "i")] 193)]
15563 [(set_attr "type" "vecsimple")])
15565 (define_insn "altivec_lvsl"
15566 [(set (match_operand:V16QI 0 "register_operand" "=v")
15567 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
15568 (match_operand:SI 2 "register_operand" "r")] 194))]
15571 [(set_attr "type" "vecload")])
15573 (define_insn "altivec_lvsr"
15574 [(set (match_operand:V16QI 0 "register_operand" "=v")
15575 (unspec:V16QI [(match_operand:SI 1 "register_operand" "b")
15576 (match_operand:SI 2 "register_operand" "r")] 195))]
15579 [(set_attr "type" "vecload")])
15581 ;; Parallel some of the LVE* and STV*'s with unspecs because some have
15582 ;; identical rtl but different instructions-- and gcc gets confused.
15584 (define_insn "altivec_lvebx"
15586 [(set (match_operand:V16QI 0 "register_operand" "=v")
15587 (mem:V16QI (plus:SI (match_operand:SI 1 "register_operand" "b")
15588 (match_operand:SI 2 "register_operand" "r"))))
15589 (unspec [(const_int 0)] 196)])]
15592 [(set_attr "type" "vecload")])
15594 (define_insn "altivec_lvehx"
15596 [(set (match_operand:V8HI 0 "register_operand" "=v")
15598 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15599 (match_operand:SI 2 "register_operand" "r"))
15601 (unspec [(const_int 0)] 197)])]
15604 [(set_attr "type" "vecload")])
15606 (define_insn "altivec_lvewx"
15608 [(set (match_operand:V4SI 0 "register_operand" "=v")
15610 (and:SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15611 (match_operand:SI 2 "register_operand" "r"))
15613 (unspec [(const_int 0)] 198)])]
15616 [(set_attr "type" "vecload")])
15618 (define_insn "altivec_lvxl"
15620 [(set (match_operand:V4SI 0 "register_operand" "=v")
15621 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15622 (match_operand:SI 2 "register_operand" "r"))))
15623 (unspec [(const_int 0)] 213)])]
15626 [(set_attr "type" "vecload")])
15628 (define_insn "altivec_lvx"
15629 [(set (match_operand:V4SI 0 "register_operand" "=v")
15630 (mem:V4SI (plus:SI (match_operand:SI 1 "register_operand" "b")
15631 (match_operand:SI 2 "register_operand" "r"))))]
15634 [(set_attr "type" "vecload")])
15636 (define_insn "altivec_stvx"
15639 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15640 (match_operand:SI 1 "register_operand" "r"))
15642 (match_operand:V4SI 2 "register_operand" "v"))
15643 (unspec [(const_int 0)] 201)])]
15646 [(set_attr "type" "vecstore")])
15648 (define_insn "altivec_stvxl"
15651 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15652 (match_operand:SI 1 "register_operand" "r"))
15654 (match_operand:V4SI 2 "register_operand" "v"))
15655 (unspec [(const_int 0)] 202)])]
15658 [(set_attr "type" "vecstore")])
15660 (define_insn "altivec_stvebx"
15663 (plus:SI (match_operand:SI 0 "register_operand" "b")
15664 (match_operand:SI 1 "register_operand" "r")))
15665 (match_operand:V16QI 2 "register_operand" "v"))
15666 (unspec [(const_int 0)] 203)])]
15669 [(set_attr "type" "vecstore")])
15671 (define_insn "altivec_stvehx"
15674 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15675 (match_operand:SI 1 "register_operand" "r"))
15677 (match_operand:V8HI 2 "register_operand" "v"))
15678 (unspec [(const_int 0)] 204)])]
15681 [(set_attr "type" "vecstore")])
15683 (define_insn "altivec_stvewx"
15686 (and:SI (plus:SI (match_operand:SI 0 "register_operand" "b")
15687 (match_operand:SI 1 "register_operand" "r"))
15689 (match_operand:V4SI 2 "register_operand" "v"))
15690 (unspec [(const_int 0)] 205)])]
15693 [(set_attr "type" "vecstore")])
15695 (define_insn "absv16qi2"
15696 [(set (match_operand:V16QI 0 "register_operand" "=v")
15697 (abs:V16QI (match_operand:V16QI 1 "register_operand" "v")))
15698 (clobber (match_scratch:V16QI 2 "=v"))
15699 (clobber (match_scratch:V16QI 3 "=v"))]
15701 "vspltisb %2,0\;vsububm %3,%2,%1\;vmaxsb %0,%1,%3"
15702 [(set_attr "type" "altivec")
15703 (set_attr "length" "12")])
15705 (define_insn "absv8hi2"
15706 [(set (match_operand:V8HI 0 "register_operand" "=v")
15707 (abs:V8HI (match_operand:V8HI 1 "register_operand" "v")))
15708 (clobber (match_scratch:V8HI 2 "=v"))
15709 (clobber (match_scratch:V8HI 3 "=v"))]
15711 "vspltisb %2,0\;vsubuhm %3,%2,%1\;vmaxsh %0,%1,%3"
15712 [(set_attr "type" "altivec")
15713 (set_attr "length" "12")])
15715 (define_insn "absv4si2"
15716 [(set (match_operand:V4SI 0 "register_operand" "=v")
15717 (abs:V4SI (match_operand:V4SI 1 "register_operand" "v")))
15718 (clobber (match_scratch:V4SI 2 "=v"))
15719 (clobber (match_scratch:V4SI 3 "=v"))]
15721 "vspltisb %2,0\;vsubuwm %3,%2,%1\;vmaxsw %0,%1,%3"
15722 [(set_attr "type" "altivec")
15723 (set_attr "length" "12")])
15725 (define_insn "absv4sf2"
15726 [(set (match_operand:V4SF 0 "register_operand" "=v")
15727 (abs:V4SF (match_operand:V4SF 1 "register_operand" "v")))
15728 (clobber (match_scratch:V4SF 2 "=v"))
15729 (clobber (match_scratch:V4SF 3 "=v"))]
15731 "vspltisw %2, -1\;vslw %3,%2,%2\;vandc %0,%1,%3"
15732 [(set_attr "type" "altivec")
15733 (set_attr "length" "12")])
15735 (define_insn "altivec_abss_v16qi"
15736 [(set (match_operand:V16QI 0 "register_operand" "=v")
15737 (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "v")] 210))
15738 (clobber (match_scratch:V16QI 2 "=v"))
15739 (clobber (match_scratch:V16QI 3 "=v"))]
15741 "vspltisb %2,0\;vsubsbs %3,%2,%1\;vmaxsb %0,%1,%3"
15742 [(set_attr "type" "altivec")
15743 (set_attr "length" "12")])
15745 (define_insn "altivec_abss_v8hi"
15746 [(set (match_operand:V8HI 0 "register_operand" "=v")
15747 (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v")] 211))
15748 (clobber (match_scratch:V8HI 2 "=v"))
15749 (clobber (match_scratch:V8HI 3 "=v"))]
15751 "vspltisb %2,0\;vsubshs %3,%2,%1\;vmaxsh %0,%1,%3"
15752 [(set_attr "type" "altivec")
15753 (set_attr "length" "12")])
15755 (define_insn "altivec_abss_v4si"
15756 [(set (match_operand:V4SI 0 "register_operand" "=v")
15757 (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")] 212))
15758 (clobber (match_scratch:V4SI 2 "=v"))
15759 (clobber (match_scratch:V4SI 3 "=v"))]
15761 "vspltisb %2,0\;vsubsws %3,%2,%1\;vmaxsw %0,%1,%3"
15762 [(set_attr "type" "altivec")
15763 (set_attr "length" "12")])