1 ;; Machine description for IBM RISC System
6000 (POWER) for GNU C compiler
2 ;; Copyright (C)
1990,
91,
92,
93,
94,
1995 Free Software Foundation, Inc.
3 ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
5 ;; This file is part of GNU CC.
7 ;; GNU CC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version
2, or (at your option)
12 ;; GNU CC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU CC; see the file COPYING. If not, write to
19 ;; the Free Software Foundation,
675 Mass Ave, Cambridge, MA
02139, USA.
21 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
23 ;; Define an insn type attribute. This is used in function unit delay
25 (define_attr "type" "integer,load,fpload,imul,idiv,branch,compare,delayed_compare,fpcompare,mtjmpr,fp,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg"
26 (const_string "integer"))
29 (define_attr "length" ""
30 (if_then_else (eq_attr "type" "branch")
31 (if_then_else (and (ge (minus (pc) (match_dup
0))
33 (lt (minus (pc) (match_dup
0))
39 ;; Processor type -- this attribute must exactly match the processor_type
40 ;; enumeration in rs6000.h.
42 (define_attr "cpu" "rios1,rios2,ppc403,ppc601,ppc603,ppc604,ppc620"
43 (const (symbol_ref "rs6000_cpu_attr")))
45 ; (define_function_unit NAME MULTIPLICITY SIMULTANEITY
46 ; TEST READY-DELAY ISSUE-DELAY [CONFLICT-LIST])
48 ; Load/Store Unit -- POWER/
2 and pure PowerPC only
49 ; (POWER and
601 use Integer Unit)
50 (define_function_unit "lsu"
1 0
51 (and (eq_attr "type" "load")
52 (eq_attr "cpu" "rios2,ppc603,ppc604,ppc620"))
55 (define_function_unit "lsu"
1 0
56 (and (eq_attr "type" "fpload")
57 (eq_attr "cpu" "rios2,ppc603,ppc604,ppc620"))
60 (define_function_unit "iu"
1 0
61 (and (eq_attr "type" "load")
62 (eq_attr "cpu" "rios1,ppc403,ppc601"))
65 (define_function_unit "iu"
1 0
66 (and (eq_attr "type" "fpload")
67 (eq_attr "cpu" "rios1,ppc601"))
70 ; Integer Unit (RIOS1, PPC601, PPC603)
71 ; Trivial operations take one cycle which need not be listed here.
72 (define_function_unit "iu"
1 0
73 (and (eq_attr "type" "imul")
74 (eq_attr "cpu" "rios1"))
77 (define_function_unit "iu"
1 0
78 (and (eq_attr "type" "imul")
79 (eq_attr "cpu" "ppc403"))
82 (define_function_unit "iu"
1 0
83 (and (eq_attr "type" "imul")
84 (eq_attr "cpu" "ppc601,ppc603"))
87 (define_function_unit "iu"
1 0
88 (and (eq_attr "type" "idiv")
89 (eq_attr "cpu" "rios1"))
92 (define_function_unit "iu"
1 0
93 (and (eq_attr "type" "idiv")
94 (eq_attr "cpu" "ppc403"))
97 (define_function_unit "iu"
1 0
98 (and (eq_attr "type" "idiv")
99 (eq_attr "cpu" "ppc601"))
102 (define_function_unit "iu"
1 0
103 (and (eq_attr "type" "idiv")
104 (eq_attr "cpu" "ppc603"))
107 ; RIOS2 has two integer units: a primary one which can perform all
108 ; operations and a secondary one which is fed in lock step with the first
109 ; and can perform "simple" integer operations.
110 (define_function_unit "iu2"
2 0
111 (and (eq_attr "type" "integer")
112 (eq_attr "cpu" "rios2"))
114 [(eq_attr "type" "imul,idiv")])
116 (define_function_unit "imuldiv"
1 0
117 (and (eq_attr "type" "imul")
118 (eq_attr "cpu" "rios2"))
120 [(eq_attr "type" "integer")])
122 (define_function_unit "imuldiv"
1 0
123 (and (eq_attr "type" "idiv")
124 (eq_attr "cpu" "rios2"))
126 [(eq_attr "type" "integer")])
128 ; PPC604 has three integer units: one primary and two secondary.
129 (define_function_unit "iu3"
3 0
130 (and (eq_attr "type" "integer")
131 (eq_attr "cpu" "ppc604,ppc620"))
133 [(eq_attr "type" "imul,idiv")])
135 (define_function_unit "imuldiv"
1 0
136 (and (eq_attr "type" "imul")
137 (eq_attr "cpu" "ppc604,ppc620"))
139 [(eq_attr "type" "integer")])
141 (define_function_unit "imuldiv"
1 0
142 (and (eq_attr "type" "idiv")
143 (eq_attr "cpu" "ppc604,ppc620"))
145 [(eq_attr "type" "integer")])
147 ; Branch Processing Unit
148 (define_function_unit "bpu"
1 0
149 (eq_attr "type" "compare")
152 (define_function_unit "bpu"
1 0
153 (eq_attr "type" "delayed_compare")
156 (define_function_unit "bpu"
1 0
157 (and (eq_attr "type" "fpcompare")
158 (eq_attr "cpu" "rios1,rios2"))
161 (define_function_unit "bpu"
1 0
162 (and (eq_attr "type" "fpcompare")
163 (eq_attr "cpu" "ppc601,ppc603,ppc604,ppc620"))
166 (define_function_unit "bpu"
1 0
167 (and (eq_attr "type" "mtjmpr")
168 (eq_attr "cpu" "rios1,rios2"))
171 (define_function_unit "bpu"
1 0
172 (and (eq_attr "type" "mtjmpr")
173 (eq_attr "cpu" "ppc403,ppc601,ppc603,ppc604,ppc620"))
176 ; Floating Point Unit (RIOS1, PPC601, PPC603, PPC604).
177 (define_function_unit "fpu"
1 0
178 (and (eq_attr "type" "fp,dmul")
179 (eq_attr "cpu" "rios1"))
182 (define_function_unit "fpu"
1 0
183 (and (eq_attr "type" "fp")
184 (eq_attr "cpu" "ppc601"))
187 (define_function_unit "fpu"
1 0
188 (and (eq_attr "type" "fp")
189 (eq_attr "cpu" "ppc603,ppc604,ppc620"))
192 (define_function_unit "fpu"
1 0
193 (and (eq_attr "type" "dmul")
194 (eq_attr "cpu" "ppc601"))
197 (define_function_unit "fpu"
1 0
198 (and (eq_attr "type" "dmul")
199 (eq_attr "cpu" "ppc603"))
202 (define_function_unit "fpu"
1 0
203 (and (eq_attr "type" "dmul")
204 (eq_attr "cpu" "ppc604,ppc620"))
207 (define_function_unit "fpu"
1 0
208 (and (eq_attr "type" "sdiv,ddiv")
209 (eq_attr "cpu" "rios1"))
212 (define_function_unit "fpu"
1 0
213 (and (eq_attr "type" "sdiv")
214 (eq_attr "cpu" "ppc601"))
217 (define_function_unit "fpu"
1 0
218 (and (eq_attr "type" "sdiv")
219 (eq_attr "cpu" "ppc603,ppc604,ppc620"))
222 (define_function_unit "fpu"
1 0
223 (and (eq_attr "type" "ddiv")
224 (eq_attr "cpu" "ppc601,ppc604,ppc620"))
227 (define_function_unit "fpu"
1 0
228 (and (eq_attr "type" "ddiv")
229 (eq_attr "cpu" "ppc603"))
232 (define_function_unit "fpu"
1 0
233 (and (eq_attr "type" "ssqrt")
234 (eq_attr "cpu" "ppc620"))
237 (define_function_unit "fpu"
1 0
238 (and (eq_attr "type" "dsqrt")
239 (eq_attr "cpu" "ppc620"))
242 ; RIOS2 has two symmetric FPUs.
243 (define_function_unit "fpu2"
2 0
244 (and (eq_attr "type" "fp")
245 (eq_attr "cpu" "rios2"))
248 (define_function_unit "fpu2"
2 0
249 (and (eq_attr "type" "dmul")
250 (eq_attr "cpu" "rios2"))
253 (define_function_unit "fpu2"
2 0
254 (and (eq_attr "type" "sdiv,ddiv")
255 (eq_attr "cpu" "rios2"))
258 (define_function_unit "fpu2"
2 0
259 (and (eq_attr "type" "ssqrt,dsqrt")
260 (eq_attr "cpu" "rios2"))
263 ;; Start with fixed-point load and store insns. Here we put only the more
264 ;; complex forms. Basic data transfer is done later.
266 (define_expand "zero_extendqidi2"
267 [(set (match_operand:DI
0 "gpc_reg_operand" "")
268 (zero_extend:DI (match_operand:QI
1 "gpc_reg_operand" "")))]
273 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
274 (zero_extend:DI (match_operand:QI
1 "reg_or_mem_operand" "m,r")))]
279 [(set_attr "type" "load,*")])
282 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
283 (compare:CC (zero_extend:DI (match_operand:QI
1 "gpc_reg_operand" "r"))
285 (clobber (match_scratch:DI
2 "=r"))]
288 [(set_attr "type" "compare")])
291 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
292 (compare:CC (zero_extend:DI (match_operand:QI
1 "gpc_reg_operand" "r"))
294 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
295 (zero_extend:DI (match_dup
1)))]
298 [(set_attr "type" "compare")])
300 (define_insn "extendqidi2"
301 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
302 (sign_extend:DI (match_operand:QI
1 "gpc_reg_operand" "r")))]
307 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
308 (compare:CC (sign_extend:DI (match_operand:QI
1 "gpc_reg_operand" "r"))
310 (clobber (match_scratch:DI
2 "=r"))]
313 [(set_attr "type" "compare")])
316 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
317 (compare:CC (sign_extend:DI (match_operand:QI
1 "gpc_reg_operand" "r"))
319 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
320 (sign_extend:DI (match_dup
1)))]
323 [(set_attr "type" "compare")])
325 (define_expand "zero_extendhidi2"
326 [(set (match_operand:DI
0 "gpc_reg_operand" "")
327 (zero_extend:DI (match_operand:HI
1 "gpc_reg_operand" "")))]
332 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
333 (zero_extend:DI (match_operand:HI
1 "reg_or_mem_operand" "m,r")))]
338 [(set_attr "type" "load,*")])
341 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
342 (compare:CC (zero_extend:DI (match_operand:HI
1 "gpc_reg_operand" "r"))
344 (clobber (match_scratch:DI
2 "=r"))]
347 [(set_attr "type" "compare")])
350 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
351 (compare:CC (zero_extend:DI (match_operand:HI
1 "gpc_reg_operand" "r"))
353 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
354 (zero_extend:DI (match_dup
1)))]
357 [(set_attr "type" "compare")])
359 (define_expand "extendhidi2"
360 [(set (match_operand:DI
0 "gpc_reg_operand" "")
361 (sign_extend:DI (match_operand:HI
1 "gpc_reg_operand" "")))]
366 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
367 (sign_extend:DI (match_operand:HI
1 "reg_or_mem_operand" "m,r")))]
372 [(set_attr "type" "load,*")])
375 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
376 (compare:CC (sign_extend:DI (match_operand:HI
1 "gpc_reg_operand" "r"))
378 (clobber (match_scratch:DI
2 "=r"))]
381 [(set_attr "type" "compare")])
384 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
385 (compare:CC (sign_extend:DI (match_operand:HI
1 "gpc_reg_operand" "r"))
387 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
388 (sign_extend:DI (match_dup
1)))]
391 [(set_attr "type" "compare")])
393 (define_expand "zero_extendsidi2"
394 [(set (match_operand:DI
0 "gpc_reg_operand" "")
395 (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" "")))]
400 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
401 (zero_extend:DI (match_operand:SI
1 "reg_or_mem_operand" "m,r")))]
406 [(set_attr "type" "load,*")])
409 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
410 (compare:CC (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
412 (clobber (match_scratch:DI
2 "=r"))]
415 [(set_attr "type" "compare")])
418 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
419 (compare:CC (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
421 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
422 (zero_extend:DI (match_dup
1)))]
425 [(set_attr "type" "compare")])
427 (define_expand "extendsidi2"
428 [(set (match_operand:DI
0 "gpc_reg_operand" "")
429 (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" "")))]
434 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
435 (sign_extend:DI (match_operand:SI
1 "lwa_operand" "m,r")))]
440 [(set_attr "type" "load,*")])
443 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
444 (compare:CC (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
446 (clobber (match_scratch:DI
2 "=r"))]
449 [(set_attr "type" "compare")])
452 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
453 (compare:CC (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
455 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
456 (sign_extend:DI (match_dup
1)))]
459 [(set_attr "type" "compare")])
461 (define_expand "zero_extendqisi2"
462 [(set (match_operand:SI
0 "gpc_reg_operand" "")
463 (zero_extend:SI (match_operand:QI
1 "gpc_reg_operand" "")))]
468 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
469 (zero_extend:SI (match_operand:QI
1 "reg_or_mem_operand" "m,r")))]
473 {rlinm|rlwinm} %
0,%
1,
0,
0xff"
474 [(set_attr "type" "load,*")])
477 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
478 (compare:CC (zero_extend:SI (match_operand:QI
1 "gpc_reg_operand" "r"))
480 (clobber (match_scratch:SI
2 "=r"))]
482 "{andil.|andi.} %
2,%
1,
0xff"
483 [(set_attr "type" "compare")])
486 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
487 (compare:CC (zero_extend:SI (match_operand:QI
1 "gpc_reg_operand" "r"))
489 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
490 (zero_extend:SI (match_dup
1)))]
492 "{andil.|andi.} %
0,%
1,
0xff"
493 [(set_attr "type" "compare")])
495 (define_expand "extendqisi2"
496 [(use (match_operand:SI
0 "gpc_reg_operand" ""))
497 (use (match_operand:QI
1 "gpc_reg_operand" ""))]
502 emit_insn (gen_extendqisi2_ppc (operands[
0], operands[
1]));
503 else if (TARGET_POWER)
504 emit_insn (gen_extendqisi2_power (operands[
0], operands[
1]));
506 emit_insn (gen_extendqisi2_no_power (operands[
0], operands[
1]));
510 (define_insn "extendqisi2_ppc"
511 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
512 (sign_extend:SI (match_operand:QI
1 "gpc_reg_operand" "r")))]
517 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
518 (compare:CC (sign_extend:SI (match_operand:QI
1 "gpc_reg_operand" "r"))
520 (clobber (match_scratch:SI
2 "=r"))]
523 [(set_attr "type" "compare")])
526 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
527 (compare:CC (sign_extend:SI (match_operand:QI
1 "gpc_reg_operand" "r"))
529 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
530 (sign_extend:SI (match_dup
1)))]
533 [(set_attr "type" "compare")])
535 (define_expand "extendqisi2_power"
536 [(parallel [(set (match_dup
2)
537 (ashift:SI (match_operand:QI
1 "gpc_reg_operand" "")
539 (clobber (scratch:SI))])
540 (parallel [(set (match_operand:SI
0 "gpc_reg_operand" "")
541 (ashiftrt:SI (match_dup
2)
543 (clobber (scratch:SI))])]
546 { operands[
1] = gen_lowpart (SImode, operands[
1]);
547 operands[
2] = gen_reg_rtx (SImode); }")
549 (define_expand "extendqisi2_no_power"
551 (ashift:SI (match_operand:QI
1 "gpc_reg_operand" "")
553 (set (match_operand:SI
0 "gpc_reg_operand" "")
554 (ashiftrt:SI (match_dup
2)
556 "! TARGET_POWER && ! TARGET_POWERPC"
558 { operands[
1] = gen_lowpart (SImode, operands[
1]);
559 operands[
2] = gen_reg_rtx (SImode); }")
561 (define_expand "zero_extendqihi2"
562 [(set (match_operand:HI
0 "gpc_reg_operand" "")
563 (zero_extend:HI (match_operand:QI
1 "gpc_reg_operand" "")))]
568 [(set (match_operand:HI
0 "gpc_reg_operand" "=r,r")
569 (zero_extend:HI (match_operand:QI
1 "reg_or_mem_operand" "m,r")))]
573 {rlinm|rlwinm} %
0,%
1,
0,
0xff"
574 [(set_attr "type" "load,*")])
577 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
578 (compare:CC (zero_extend:HI (match_operand:QI
1 "gpc_reg_operand" "r"))
580 (clobber (match_scratch:HI
2 "=r"))]
582 "{andil.|andi.} %
2,%
1,
0xff"
583 [(set_attr "type" "compare")])
586 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
587 (compare:CC (zero_extend:HI (match_operand:QI
1 "gpc_reg_operand" "r"))
589 (set (match_operand:HI
0 "gpc_reg_operand" "=r")
590 (zero_extend:HI (match_dup
1)))]
592 "{andil.|andi.} %
0,%
1,
0xff"
593 [(set_attr "type" "compare")])
595 (define_expand "extendqihi2"
596 [(use (match_operand:HI
0 "gpc_reg_operand" ""))
597 (use (match_operand:QI
1 "gpc_reg_operand" ""))]
602 emit_insn (gen_extendqihi2_ppc (operands[
0], operands[
1]));
603 else if (TARGET_POWER)
604 emit_insn (gen_extendqihi2_power (operands[
0], operands[
1]));
606 emit_insn (gen_extendqihi2_no_power (operands[
0], operands[
1]));
610 (define_insn "extendqihi2_ppc"
611 [(set (match_operand:HI
0 "gpc_reg_operand" "=r")
612 (sign_extend:HI (match_operand:QI
1 "gpc_reg_operand" "r")))]
617 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
618 (compare:CC (sign_extend:HI (match_operand:QI
1 "gpc_reg_operand" "r"))
620 (clobber (match_scratch:HI
2 "=r"))]
623 [(set_attr "type" "compare")])
626 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
627 (compare:CC (sign_extend:HI (match_operand:QI
1 "gpc_reg_operand" "r"))
629 (set (match_operand:HI
0 "gpc_reg_operand" "=r")
630 (sign_extend:HI (match_dup
1)))]
633 [(set_attr "type" "compare")])
635 (define_expand "extendqihi2_power"
636 [(parallel [(set (match_dup
2)
637 (ashift:SI (match_operand:QI
1 "gpc_reg_operand" "")
639 (clobber (scratch:SI))])
640 (parallel [(set (match_operand:HI
0 "gpc_reg_operand" "")
641 (ashiftrt:SI (match_dup
2)
643 (clobber (scratch:SI))])]
646 { operands[
0] = gen_lowpart (SImode, operands[
0]);
647 operands[
1] = gen_lowpart (SImode, operands[
1]);
648 operands[
2] = gen_reg_rtx (SImode); }")
650 (define_expand "extendqihi2_no_power"
652 (ashift:SI (match_operand:QI
1 "gpc_reg_operand" "")
654 (set (match_operand:HI
0 "gpc_reg_operand" "")
655 (ashiftrt:SI (match_dup
2)
657 "! TARGET_POWER && ! TARGET_POWERPC"
659 { operands[
0] = gen_lowpart (SImode, operands[
0]);
660 operands[
1] = gen_lowpart (SImode, operands[
1]);
661 operands[
2] = gen_reg_rtx (SImode); }")
663 (define_expand "zero_extendhisi2"
664 [(set (match_operand:SI
0 "gpc_reg_operand" "")
665 (zero_extend:SI (match_operand:HI
1 "gpc_reg_operand" "")))]
670 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
671 (zero_extend:SI (match_operand:HI
1 "reg_or_mem_operand" "m,r")))]
675 {rlinm|rlwinm} %
0,%
1,
0,
0xffff"
676 [(set_attr "type" "load,*")])
679 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
680 (compare:CC (zero_extend:SI (match_operand:HI
1 "gpc_reg_operand" "r"))
682 (clobber (match_scratch:SI
2 "=r"))]
684 "{andil.|andi.} %
2,%
1,
0xffff"
685 [(set_attr "type" "compare")])
688 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
689 (compare:CC (zero_extend:SI (match_operand:HI
1 "gpc_reg_operand" "r"))
691 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
692 (zero_extend:SI (match_dup
1)))]
694 "{andil.|andi.} %
0,%
1,
0xffff"
695 [(set_attr "type" "compare")])
697 (define_expand "extendhisi2"
698 [(set (match_operand:SI
0 "gpc_reg_operand" "")
699 (sign_extend:SI (match_operand:HI
1 "gpc_reg_operand" "")))]
704 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
705 (sign_extend:SI (match_operand:HI
1 "reg_or_mem_operand" "m,r")))]
710 [(set_attr "type" "load,*")])
713 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
714 (compare:CC (sign_extend:SI (match_operand:HI
1 "gpc_reg_operand" "r"))
716 (clobber (match_scratch:SI
2 "=r"))]
718 "{exts.|extsh.} %
2,%
1"
719 [(set_attr "type" "compare")])
722 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
723 (compare:CC (sign_extend:SI (match_operand:HI
1 "gpc_reg_operand" "r"))
725 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
726 (sign_extend:SI (match_dup
1)))]
728 "{exts.|extsh.} %
0,%
1"
729 [(set_attr "type" "compare")])
731 ;; Fixed-point arithmetic insns.
733 ;; Discourage ai/addic because of carry but provide it in an alternative
734 ;; allowing register zero as source.
735 (define_insn "addsi3"
736 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,?r,r")
737 (plus:SI (match_operand:SI
1 "gpc_reg_operand" "%r,b,r,b")
738 (match_operand:SI
2 "add_operand" "r,I,I,J")))]
742 {cal %
0,%
2(%
1)|addi %
0,%
1,%
2}
744 {cau|addis} %
0,%
1,%u2")
747 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
748 (compare:CC (plus:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r")
749 (match_operand:SI
2 "reg_or_short_operand" "r,I"))
751 (clobber (match_scratch:SI
3 "=r,r"))]
755 {ai.|addic.} %
3,%
1,%
2"
756 [(set_attr "type" "compare")])
759 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
760 (compare:CC (plus:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r")
761 (match_operand:SI
2 "reg_or_short_operand" "r,I"))
763 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
764 (plus:SI (match_dup
1) (match_dup
2)))]
768 {ai.|addic.} %
0,%
1,%
2"
769 [(set_attr "type" "compare")])
771 ;; Split an add that we can't do in one insn into two insns, each of which
772 ;; does one
16-bit part. This is used by combine. Note that the low-order
773 ;; add should be last in case the result gets used in an address.
776 [(set (match_operand:SI
0 "gpc_reg_operand" "")
777 (plus:SI (match_operand:SI
1 "gpc_reg_operand" "")
778 (match_operand:SI
2 "non_add_cint_operand" "")))]
780 [(set (match_dup
0) (plus:SI (match_dup
1) (match_dup
3)))
781 (set (match_dup
0) (plus:SI (match_dup
0) (match_dup
4)))]
784 int low = INTVAL (operands[
2]) &
0xffff;
785 int high = (unsigned) INTVAL (operands[
2]) >>
16;
788 high++, low |=
0xffff0000;
790 operands[
3] = gen_rtx (CONST_INT, VOIDmode, high <<
16);
791 operands[
4] = gen_rtx (CONST_INT, VOIDmode, low);
794 (define_insn "one_cmplsi2"
795 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
796 (not:SI (match_operand:SI
1 "gpc_reg_operand" "r")))]
801 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
802 (compare:CC (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
804 (clobber (match_scratch:SI
2 "=r"))]
807 [(set_attr "type" "compare")])
810 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
811 (compare:CC (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
813 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
814 (not:SI (match_dup
1)))]
817 [(set_attr "type" "compare")])
820 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
821 (minus:SI (match_operand:SI
1 "reg_or_short_operand" "rI")
822 (match_operand:SI
2 "gpc_reg_operand" "r")))]
824 "{sf%I1|subf%I1c} %
0,%
2,%
1")
827 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
828 (minus:SI (match_operand:SI
1 "reg_or_short_operand" "r,I")
829 (match_operand:SI
2 "gpc_reg_operand" "r,r")))]
836 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
837 (compare:CC (minus:SI (match_operand:SI
1 "gpc_reg_operand" "r")
838 (match_operand:SI
2 "gpc_reg_operand" "r"))
840 (clobber (match_scratch:SI
3 "=r"))]
842 "{sf.|subfc.} %
3,%
2,%
1"
843 [(set_attr "type" "compare")])
846 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
847 (compare:CC (minus:SI (match_operand:SI
1 "gpc_reg_operand" "r")
848 (match_operand:SI
2 "gpc_reg_operand" "r"))
850 (clobber (match_scratch:SI
3 "=r"))]
853 [(set_attr "type" "compare")])
856 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
857 (compare:CC (minus:SI (match_operand:SI
1 "gpc_reg_operand" "r")
858 (match_operand:SI
2 "gpc_reg_operand" "r"))
860 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
861 (minus:SI (match_dup
1) (match_dup
2)))]
863 "{sf.|subfc.} %
0,%
2,%
1"
864 [(set_attr "type" "compare")])
867 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
868 (compare:CC (minus:SI (match_operand:SI
1 "gpc_reg_operand" "r")
869 (match_operand:SI
2 "gpc_reg_operand" "r"))
871 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
872 (minus:SI (match_dup
1) (match_dup
2)))]
875 [(set_attr "type" "compare")])
877 (define_expand "subsi3"
878 [(set (match_operand:SI
0 "gpc_reg_operand" "")
879 (minus:SI (match_operand:SI
1 "reg_or_short_operand" "")
880 (match_operand:SI
2 "reg_or_cint_operand" "")))]
884 if (GET_CODE (operands[
2]) == CONST_INT)
886 emit_insn (gen_addsi3 (operands[
0], operands[
1],
887 negate_rtx (SImode, operands[
2])));
892 ;; For SMIN, SMAX, UMIN, and UMAX, we use DEFINE_EXPAND's that involve a doz[i]
893 ;; instruction and some auxiliary computations. Then we just have a single
894 ;; DEFINE_INSN for doz[i] and the define_splits to make them if made by
897 (define_expand "sminsi3"
899 (if_then_else:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "")
900 (match_operand:SI
2 "reg_or_short_operand" ""))
902 (minus:SI (match_dup
2) (match_dup
1))))
903 (set (match_operand:SI
0 "gpc_reg_operand" "")
904 (minus:SI (match_dup
2) (match_dup
3)))]
907 { operands[
3] = gen_reg_rtx (SImode); }")
910 [(set (match_operand:SI
0 "gpc_reg_operand" "")
911 (smin:SI (match_operand:SI
1 "gpc_reg_operand" "")
912 (match_operand:SI
2 "reg_or_short_operand" "")))
913 (clobber (match_operand:SI
3 "gpc_reg_operand" ""))]
916 (if_then_else:SI (gt:SI (match_dup
1) (match_dup
2))
918 (minus:SI (match_dup
2) (match_dup
1))))
919 (set (match_dup
0) (minus:SI (match_dup
2) (match_dup
3)))]
922 (define_expand "smaxsi3"
924 (if_then_else:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "")
925 (match_operand:SI
2 "reg_or_short_operand" ""))
927 (minus:SI (match_dup
2) (match_dup
1))))
928 (set (match_operand:SI
0 "gpc_reg_operand" "")
929 (plus:SI (match_dup
3) (match_dup
1)))]
932 { operands[
3] = gen_reg_rtx (SImode); }")
935 [(set (match_operand:SI
0 "gpc_reg_operand" "")
936 (smax:SI (match_operand:SI
1 "gpc_reg_operand" "")
937 (match_operand:SI
2 "reg_or_short_operand" "")))
938 (clobber (match_operand:SI
3 "gpc_reg_operand" ""))]
941 (if_then_else:SI (gt:SI (match_dup
1) (match_dup
2))
943 (minus:SI (match_dup
2) (match_dup
1))))
944 (set (match_dup
0) (plus:SI (match_dup
3) (match_dup
1)))]
947 (define_expand "uminsi3"
948 [(set (match_dup
3) (xor:SI (match_operand:SI
1 "gpc_reg_operand" "")
950 (set (match_dup
4) (xor:SI (match_operand:SI
2 "gpc_reg_operand" "")
952 (set (match_dup
3) (if_then_else:SI (gt (match_dup
3) (match_dup
4))
954 (minus:SI (match_dup
4) (match_dup
3))))
955 (set (match_operand:SI
0 "gpc_reg_operand" "")
956 (minus:SI (match_dup
2) (match_dup
3)))]
960 operands[
3] = gen_reg_rtx (SImode);
961 operands[
4] = gen_reg_rtx (SImode);
962 operands[
5] = GEN_INT (-
2147483647 -
1);
965 (define_expand "umaxsi3"
966 [(set (match_dup
3) (xor:SI (match_operand:SI
1 "gpc_reg_operand" "")
968 (set (match_dup
4) (xor:SI (match_operand:SI
2 "gpc_reg_operand" "")
970 (set (match_dup
3) (if_then_else:SI (gt (match_dup
3) (match_dup
4))
972 (minus:SI (match_dup
4) (match_dup
3))))
973 (set (match_operand:SI
0 "gpc_reg_operand" "")
974 (plus:SI (match_dup
3) (match_dup
1)))]
978 operands[
3] = gen_reg_rtx (SImode);
979 operands[
4] = gen_reg_rtx (SImode);
980 operands[
5] = GEN_INT (-
2147483647 -
1);
984 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
985 (if_then_else:SI (gt (match_operand:SI
1 "gpc_reg_operand" "r")
986 (match_operand:SI
2 "reg_or_short_operand" "rI"))
988 (minus:SI (match_dup
2) (match_dup
1))))]
993 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
995 (if_then_else:SI (gt (match_operand:SI
1 "gpc_reg_operand" "r")
996 (match_operand:SI
2 "reg_or_short_operand" "rI"))
998 (minus:SI (match_dup
2) (match_dup
1)))
1000 (clobber (match_scratch:SI
3 "=r"))]
1003 [(set_attr "type" "delayed_compare")])
1006 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1008 (if_then_else:SI (gt (match_operand:SI
1 "gpc_reg_operand" "r")
1009 (match_operand:SI
2 "reg_or_short_operand" "rI"))
1011 (minus:SI (match_dup
2) (match_dup
1)))
1013 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1014 (if_then_else:SI (gt (match_dup
1) (match_dup
2))
1016 (minus:SI (match_dup
2) (match_dup
1))))]
1019 [(set_attr "type" "delayed_compare")])
1021 ;; We don't need abs with condition code because such comparisons should
1023 (define_expand "abssi2"
1024 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1025 (abs:SI (match_operand:SI
1 "gpc_reg_operand" "")))]
1031 emit_insn (gen_abssi2_nopower (operands[
0], operands[
1]));
1036 (define_insn "abssi2_power"
1037 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1038 (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))]
1042 (define_insn "abssi2_nopower"
1043 [(set (match_operand:SI
0 "gpc_reg_operand" "=&r,r")
1044 (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r,
0")))
1045 (clobber (match_scratch:SI
2 "=&r,&r"))]
1049 return (TARGET_POWERPC)
1050 ?
\"{srai|srawi} %
2,%
1,
31\;xor %
0,%
2,%
1\;subf %
0,%
2,%
0\"
1051 :
\"{srai|srawi} %
2,%
1,
31\;xor %
0,%
2,%
1\;{sf|subfc} %
0,%
2,%
0\";
1053 [(set_attr "length" "
12")])
1056 [(set (match_operand:SI
0 "gpc_reg_operand" "=&r,r")
1057 (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r,
0")))
1058 (clobber (match_scratch:SI
2 "=&r,&r"))]
1059 "!TARGET_POWER && reload_completed"
1060 [(set (match_dup
2) (ashiftrt:SI (match_dup
1) (const_int
31)))
1061 (set (match_dup
0) (xor:SI (match_dup
2) (match_dup
1)))
1062 (set (match_dup
0) (minus:SI (match_dup
2) (match_dup
0)))]
1066 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1067 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r"))))]
1072 [(set (match_operand:SI
0 "gpc_reg_operand" "=&r,r")
1073 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r,
0"))))
1074 (clobber (match_scratch:SI
2 "=&r,&r"))]
1078 return (TARGET_POWERPC)
1079 ?
\"{srai|srawi} %
2,%
1,
31\;xor %
0,%
2,%
1\;subf %
0,%
0,%
2\"
1080 :
\"{srai|srawi} %
2,%
1,
31\;xor %
0,%
2,%
1\;{sf|subfc} %
0,%
0,%
2\";
1082 [(set_attr "length" "
12")])
1085 [(set (match_operand:SI
0 "gpc_reg_operand" "=&r,r")
1086 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r,
0"))))
1087 (clobber (match_scratch:SI
2 "=&r,&r"))]
1088 "!TARGET_POWER && reload_completed"
1089 [(set (match_dup
2) (ashiftrt:SI (match_dup
1) (const_int
31)))
1090 (set (match_dup
0) (xor:SI (match_dup
2) (match_dup
1)))
1091 (set (match_dup
0) (minus:SI (match_dup
0) (match_dup
2)))]
1094 (define_insn "negsi2"
1095 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1096 (neg:SI (match_operand:SI
1 "gpc_reg_operand" "r")))]
1101 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1102 (compare:CC (neg:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1104 (clobber (match_scratch:SI
2 "=r"))]
1107 [(set_attr "type" "compare")])
1110 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
1111 (compare:CC (neg:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1113 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1114 (neg:SI (match_dup
1)))]
1117 [(set_attr "type" "compare")])
1119 (define_insn "ffssi2"
1120 [(set (match_operand:SI
0 "gpc_reg_operand" "=&r")
1121 (ffs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))]
1123 "neg %
0,%
1\;and %
0,%
0,%
1\;{cntlz|cntlzw} %
0,%
0\;{sfi|subfic} %
0,%
0,
32"
1124 [(set_attr "length" "
16")])
1126 (define_expand "mulsi3"
1127 [(use (match_operand:SI
0 "gpc_reg_operand" ""))
1128 (use (match_operand:SI
1 "gpc_reg_operand" ""))
1129 (use (match_operand:SI
2 "reg_or_short_operand" ""))]
1134 emit_insn (gen_mulsi3_mq (operands[
0], operands[
1], operands[
2]));
1136 emit_insn (gen_mulsi3_no_mq (operands[
0], operands[
1], operands[
2]));
1140 (define_insn "mulsi3_mq"
1141 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
1142 (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r")
1143 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
1144 (clobber (match_scratch:SI
3 "=q,q"))]
1147 {muls|mullw} %
0,%
1,%
2
1148 {muli|mulli} %
0,%
1,%
2"
1149 [(set_attr "type" "imul")])
1151 (define_insn "mulsi3_no_mq"
1152 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
1153 (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r")
1154 (match_operand:SI
2 "reg_or_short_operand" "r,I")))]
1159 [(set_attr "type" "imul")])
1162 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1163 (compare:CC (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1164 (match_operand:SI
2 "gpc_reg_operand" "r"))
1166 (clobber (match_scratch:SI
3 "=r"))
1167 (clobber (match_scratch:SI
4 "=q"))]
1169 "{muls.|mullw.} %
3,%
1,%
2"
1170 [(set_attr "type" "delayed_compare")])
1173 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1174 (compare:CC (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1175 (match_operand:SI
2 "gpc_reg_operand" "r"))
1177 (clobber (match_scratch:SI
3 "=r"))]
1180 [(set_attr "type" "delayed_compare")])
1183 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1184 (compare:CC (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1185 (match_operand:SI
2 "gpc_reg_operand" "r"))
1187 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1188 (mult:SI (match_dup
1) (match_dup
2)))
1189 (clobber (match_scratch:SI
4 "=q"))]
1191 "{muls.|mullw.} %
0,%
1,%
2"
1192 [(set_attr "type" "delayed_compare")])
1195 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1196 (compare:CC (mult:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1197 (match_operand:SI
2 "gpc_reg_operand" "r"))
1199 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1200 (mult:SI (match_dup
1) (match_dup
2)))]
1203 [(set_attr "type" "delayed_compare")])
1205 ;; Operand
1 is divided by operand
2; quotient goes to operand
1206 ;;
0 and remainder to operand
3.
1207 ;; ??? At some point, see what, if anything, we can do about if (x % y ==
0).
1209 (define_expand "divmodsi4"
1210 [(parallel [(set (match_operand:SI
0 "gpc_reg_operand" "")
1211 (div:SI (match_operand:SI
1 "gpc_reg_operand" "")
1212 (match_operand:SI
2 "gpc_reg_operand" "")))
1213 (set (match_operand:SI
3 "gpc_reg_operand" "")
1214 (mod:SI (match_dup
1) (match_dup
2)))])]
1215 "TARGET_POWER || (! TARGET_POWER && ! TARGET_POWERPC)"
1218 if (! TARGET_POWER && ! TARGET_POWERPC)
1220 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
1221 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
1222 emit_insn (gen_divss_call ());
1223 emit_move_insn (operands[
0], gen_rtx (REG, SImode,
3));
1224 emit_move_insn (operands[
3], gen_rtx (REG, SImode,
4));
1230 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1231 (div:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1232 (match_operand:SI
2 "gpc_reg_operand" "r")))
1233 (set (match_operand:SI
3 "gpc_reg_operand" "=q")
1234 (mod:SI (match_dup
1) (match_dup
2)))]
1237 [(set_attr "type" "idiv")])
1240 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1241 (div:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1242 (match_operand:SI
2 "gpc_reg_operand" "r")))]
1245 [(set_attr "type" "idiv")])
1247 (define_expand "udivsi3"
1248 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1249 (udiv:SI (match_operand:SI
1 "gpc_reg_operand" "")
1250 (match_operand:SI
2 "gpc_reg_operand" "")))]
1251 "TARGET_POWERPC || (! TARGET_POWER && ! TARGET_POWERPC)"
1254 if (! TARGET_POWER && ! TARGET_POWERPC)
1256 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
1257 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
1258 emit_insn (gen_quous_call ());
1259 emit_move_insn (operands[
0], gen_rtx (REG, SImode,
3));
1265 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1266 (udiv:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1267 (match_operand:SI
2 "gpc_reg_operand" "r")))]
1270 [(set_attr "type" "idiv")])
1272 ;; For powers of two we can do srai/aze for divide and then adjust for
1273 ;; modulus. If it isn't a power of two, FAIL on POWER so divmodsi4 will be
1274 ;; used; for PowerPC, force operands into register and do a normal divide;
1275 ;; for AIX common-mode, use quoss call on register operands.
1276 (define_expand "divsi3"
1277 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1278 (div:SI (match_operand:SI
1 "gpc_reg_operand" "")
1279 (match_operand:SI
2 "reg_or_cint_operand" "")))]
1283 if (GET_CODE (operands[
2]) == CONST_INT
1284 && exact_log2 (INTVAL (operands[
2])) >=
0)
1286 else if (TARGET_POWER && ! TARGET_POWERPC)
1289 operands[
2] = force_reg (SImode, operands[
2]);
1291 if (! TARGET_POWER && ! TARGET_POWERPC)
1293 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
1294 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
1295 emit_insn (gen_quoss_call ());
1296 emit_move_insn (operands[
0], gen_rtx (REG, SImode,
3));
1301 (define_expand "modsi3"
1302 [(use (match_operand:SI
0 "gpc_reg_operand" ""))
1303 (use (match_operand:SI
1 "gpc_reg_operand" ""))
1304 (use (match_operand:SI
2 "reg_or_cint_operand" ""))]
1308 int i = exact_log2 (INTVAL (operands[
2]));
1312 if (GET_CODE (operands[
2]) != CONST_INT || i <
0)
1315 temp1 = gen_reg_rtx (SImode);
1316 temp2 = gen_reg_rtx (SImode);
1318 emit_insn (gen_divsi3 (temp1, operands[
1], operands[
2]));
1319 emit_insn (gen_ashlsi3 (temp2, temp1, GEN_INT (i)));
1320 emit_insn (gen_subsi3 (operands[
0], operands[
1], temp2));
1325 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1326 (div:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1327 (match_operand:SI
2 "const_int_operand" "N")))]
1328 "exact_log2 (INTVAL (operands[
2])) >=
0"
1329 "{srai|srawi} %
0,%
1,%p2\;{aze|addze} %
0,%
0"
1330 [(set_attr "length" "
8")])
1333 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1334 (compare:CC (div:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1335 (match_operand:SI
2 "const_int_operand" "N"))
1337 (clobber (match_scratch:SI
3 "=r"))]
1338 "exact_log2 (INTVAL (operands[
2])) >=
0"
1339 "{srai|srawi} %
3,%
1,%p2\;{aze.|addze.} %
3,%
3"
1340 [(set_attr "type" "compare")
1341 (set_attr "length" "
8")])
1344 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1345 (compare:CC (div:SI (match_operand:SI
1 "gpc_reg_operand" "r")
1346 (match_operand:SI
2 "const_int_operand" "N"))
1348 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1349 (div:SI (match_dup
1) (match_dup
2)))]
1350 "exact_log2 (INTVAL (operands[
2])) >=
0"
1351 "{srai|srawi} %
0,%
1,%p2\;{aze.|addze.} %
0,%
0"
1352 [(set_attr "type" "compare")
1353 (set_attr "length" "
8")])
1356 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1359 (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
1361 (zero_extend:DI (match_operand:SI
4 "register_operand" "
2")))
1362 (match_operand:SI
3 "gpc_reg_operand" "r")))
1363 (set (match_operand:SI
2 "register_operand" "=*q")
1366 (zero_extend:DI (match_dup
1)) (const_int
32))
1367 (zero_extend:DI (match_dup
4)))
1371 [(set_attr "type" "idiv")])
1373 ;; To do unsigned divide we handle the cases of the divisor looking like a
1374 ;; negative number. If it is a constant that is less than
2**
31, we don't
1375 ;; have to worry about the branches. So make a few subroutines here.
1377 ;; First comes the normal case.
1378 (define_expand "udivmodsi4_normal"
1379 [(set (match_dup
4) (const_int
0))
1380 (parallel [(set (match_operand:SI
0 "" "")
1381 (udiv:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup
4))
1383 (zero_extend:DI (match_operand:SI
1 "" "")))
1384 (match_operand:SI
2 "" "")))
1385 (set (match_operand:SI
3 "" "")
1386 (umod:SI (plus:DI (ashift:DI (zero_extend:DI (match_dup
4))
1388 (zero_extend:DI (match_dup
1)))
1392 { operands[
4] = gen_reg_rtx (SImode); }")
1394 ;; This handles the branches.
1395 (define_expand "udivmodsi4_tests"
1396 [(set (match_operand:SI
0 "" "") (const_int
0))
1397 (set (match_operand:SI
3 "" "") (match_operand:SI
1 "" ""))
1398 (set (match_dup
5) (compare:CCUNS (match_dup
1) (match_operand:SI
2 "" "")))
1399 (set (pc) (if_then_else (ltu (match_dup
5) (const_int
0))
1400 (label_ref (match_operand:SI
4 "" "")) (pc)))
1401 (set (match_dup
0) (const_int
1))
1402 (set (match_dup
3) (minus:SI (match_dup
1) (match_dup
2)))
1403 (set (match_dup
6) (compare:CC (match_dup
2) (const_int
0)))
1404 (set (pc) (if_then_else (lt (match_dup
6) (const_int
0))
1405 (label_ref (match_dup
4)) (pc)))]
1408 { operands[
5] = gen_reg_rtx (CCUNSmode);
1409 operands[
6] = gen_reg_rtx (CCmode);
1412 (define_expand "udivmodsi4"
1413 [(parallel [(set (match_operand:SI
0 "gpc_reg_operand" "")
1414 (udiv:SI (match_operand:SI
1 "gpc_reg_operand" "")
1415 (match_operand:SI
2 "reg_or_cint_operand" "")))
1416 (set (match_operand:SI
3 "gpc_reg_operand" "")
1417 (umod:SI (match_dup
1) (match_dup
2)))])]
1424 if (! TARGET_POWERPC)
1426 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
1427 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
1428 emit_insn (gen_divus_call ());
1429 emit_move_insn (operands[
0], gen_rtx (REG, SImode,
3));
1430 emit_move_insn (operands[
3], gen_rtx (REG, SImode,
4));
1436 if (GET_CODE (operands[
2]) != CONST_INT || INTVAL (operands[
2]) <
0)
1438 operands[
2] = force_reg (SImode, operands[
2]);
1439 label = gen_label_rtx ();
1440 emit (gen_udivmodsi4_tests (operands[
0], operands[
1], operands[
2],
1441 operands[
3], label));
1444 operands[
2] = force_reg (SImode, operands[
2]);
1446 emit (gen_udivmodsi4_normal (operands[
0], operands[
1], operands[
2],
1454 ;; AIX architecture-independent common-mode multiply (DImode),
1455 ;; divide/modulus, and quotient subroutine calls. Input operands in R3 and
1456 ;; R4; results in R3 and somtimes R4; link register always clobbered by bla
1457 ;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but
1458 ;; assumed unused if generating common-mode, so ignore.
1459 (define_insn "mulh_call"
1462 (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI
3))
1463 (sign_extend:DI (reg:SI
4)))
1465 (clobber (match_scratch:SI
0 "=l"))]
1466 "! TARGET_POWER && ! TARGET_POWERPC"
1469 (define_insn "mull_call"
1471 (mult:DI (sign_extend:DI (reg:SI
3))
1472 (sign_extend:DI (reg:SI
4))))
1473 (clobber (match_scratch:SI
0 "=l"))
1474 (clobber (reg:SI
0))]
1475 "! TARGET_POWER && ! TARGET_POWERPC"
1478 (define_insn "divss_call"
1480 (div:SI (reg:SI
3) (reg:SI
4)))
1482 (mod:SI (reg:SI
3) (reg:SI
4)))
1483 (clobber (match_scratch:SI
0 "=l"))
1484 (clobber (reg:SI
0))]
1485 "! TARGET_POWER && ! TARGET_POWERPC"
1488 (define_insn "divus_call"
1490 (udiv:SI (reg:SI
3) (reg:SI
4)))
1492 (umod:SI (reg:SI
3) (reg:SI
4)))
1493 (clobber (match_scratch:SI
0 "=l"))
1494 (clobber (reg:SI
0))]
1495 "! TARGET_POWER && ! TARGET_POWERPC"
1498 (define_insn "quoss_call"
1500 (div:SI (reg:SI
3) (reg:SI
4)))
1501 (clobber (match_scratch:SI
0 "=l"))]
1502 "! TARGET_POWER && ! TARGET_POWERPC"
1505 (define_insn "quous_call"
1507 (udiv:SI (reg:SI
3) (reg:SI
4)))
1508 (clobber (match_scratch:SI
0 "=l"))
1509 (clobber (reg:SI
0))]
1510 "! TARGET_POWER && ! TARGET_POWERPC"
1513 (define_insn "andsi3"
1514 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r")
1515 (and:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r")
1516 (match_operand:SI
2 "and_operand" "?r,L,K,J")))
1517 (clobber (match_scratch:CC
3 "=X,X,x,x"))]
1521 {rlinm|rlwinm} %
0,%
1,
0,%m2,%M2
1522 {andil.|andi.} %
0,%
1,%b2
1523 {andiu.|andis.} %
0,%
1,%u2")
1526 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x,x,x")
1527 (compare:CC (and:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r")
1528 (match_operand:SI
2 "and_operand" "r,K,J,L"))
1530 (clobber (match_scratch:SI
3 "=r,r,r,r"))]
1534 {andil.|andi.} %
3,%
1,%b2
1535 {andiu.|andis.} %
3,%
1,%u2
1536 {rlinm.|rlwinm.} %
3,%
1,
0,%m2,%M2"
1537 [(set_attr "type" "compare,compare,compare,delayed_compare")])
1540 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x,x,x")
1541 (compare:CC (and:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r")
1542 (match_operand:SI
2 "and_operand" "r,K,J,L"))
1544 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r")
1545 (and:SI (match_dup
1) (match_dup
2)))]
1549 {andil.|andi.} %
0,%
1,%b2
1550 {andiu.|andis.} %
0,%
1,%u2
1551 {rlinm.|rlwinm.} %
0,%
1,
0,%m2,%M2"
1552 [(set_attr "type" "compare,compare,compare,delayed_compare")])
1554 ;; Take a AND with a constant that cannot be done in a single insn and try to
1555 ;; split it into two insns. This does not verify that the insns are valid
1556 ;; since this need not be done as combine will do it.
1559 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1560 (and:SI (match_operand:SI
1 "gpc_reg_operand" "")
1561 (match_operand:SI
2 "non_and_cint_operand" "")))]
1563 [(set (match_dup
0) (and:SI (match_dup
1) (match_dup
3)))
1564 (set (match_dup
0) (and:SI (match_dup
0) (match_dup
4)))]
1567 int maskval = INTVAL (operands[
2]);
1568 int i, transitions, last_bit_value;
1569 int orig = maskval, first_c = maskval, second_c;
1571 /* We know that MASKVAL must have more than
2 bit-transitions. Start at
1572 the low-order bit and count for the third transition. When we get there,
1573 make a first mask that has everything to the left of that position
1574 a one. Then make the second mask to turn off whatever else is needed. */
1576 for (i =
1, transitions =
0, last_bit_value = maskval &
1; i <
32; i++)
1578 if (((maskval >>=
1) &
1) != last_bit_value)
1579 last_bit_value ^=
1, transitions++;
1581 if (transitions >
2)
1583 first_c |= (~
0) << i;
1588 second_c = orig | ~ first_c;
1590 operands[
3] = gen_rtx (CONST_INT, VOIDmode, first_c);
1591 operands[
4] = gen_rtx (CONST_INT, VOIDmode, second_c);
1594 (define_insn "iorsi3"
1595 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r")
1596 (ior:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r")
1597 (match_operand:SI
2 "logical_operand" "r,K,J")))]
1601 {oril|ori} %
0,%
1,%b2
1602 {oriu|oris} %
0,%
1,%u2")
1605 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1606 (compare:CC (ior:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1607 (match_operand:SI
2 "gpc_reg_operand" "r"))
1609 (clobber (match_scratch:SI
3 "=r"))]
1612 [(set_attr "type" "compare")])
1615 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1616 (compare:CC (ior:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1617 (match_operand:SI
2 "gpc_reg_operand" "r"))
1619 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1620 (ior:SI (match_dup
1) (match_dup
2)))]
1623 [(set_attr "type" "compare")])
1625 ;; Split an IOR that we can't do in one insn into two insns, each of which
1626 ;; does one
16-bit part. This is used by combine.
1629 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1630 (ior:SI (match_operand:SI
1 "gpc_reg_operand" "")
1631 (match_operand:SI
2 "non_logical_cint_operand" "")))]
1633 [(set (match_dup
0) (ior:SI (match_dup
1) (match_dup
3)))
1634 (set (match_dup
0) (ior:SI (match_dup
0) (match_dup
4)))]
1637 operands[
3] = gen_rtx (CONST_INT, VOIDmode,
1638 INTVAL (operands[
2]) &
0xffff0000);
1639 operands[
4] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[
2]) &
0xffff);
1642 (define_insn "xorsi3"
1643 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r")
1644 (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r")
1645 (match_operand:SI
2 "logical_operand" "r,K,J")))]
1649 {xoril|xori} %
0,%
1,%b2
1650 {xoriu|xoris} %
0,%
1,%u2")
1653 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1654 (compare:CC (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1655 (match_operand:SI
2 "gpc_reg_operand" "r"))
1657 (clobber (match_scratch:SI
3 "=r"))]
1660 [(set_attr "type" "compare")])
1663 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1664 (compare:CC (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1665 (match_operand:SI
2 "gpc_reg_operand" "r"))
1667 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1668 (xor:SI (match_dup
1) (match_dup
2)))]
1671 [(set_attr "type" "compare")])
1673 ;; Split an XOR that we can't do in one insn into two insns, each of which
1674 ;; does one
16-bit part. This is used by combine.
1677 [(set (match_operand:SI
0 "gpc_reg_operand" "")
1678 (xor:SI (match_operand:SI
1 "gpc_reg_operand" "")
1679 (match_operand:SI
2 "non_logical_cint_operand" "")))]
1681 [(set (match_dup
0) (xor:SI (match_dup
1) (match_dup
3)))
1682 (set (match_dup
0) (xor:SI (match_dup
0) (match_dup
4)))]
1685 operands[
3] = gen_rtx (CONST_INT, VOIDmode,
1686 INTVAL (operands[
2]) &
0xffff0000);
1687 operands[
4] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[
2]) &
0xffff);
1691 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1692 (not:SI (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1693 (match_operand:SI
2 "gpc_reg_operand" "r"))))]
1698 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1699 (compare:CC (not:SI (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1700 (match_operand:SI
2 "gpc_reg_operand" "r")))
1702 (clobber (match_scratch:SI
3 "=r"))]
1705 [(set_attr "type" "compare")])
1708 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1709 (compare:CC (not:SI (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
1710 (match_operand:SI
2 "gpc_reg_operand" "r")))
1712 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1713 (not:SI (xor:SI (match_dup
1) (match_dup
2))))]
1716 [(set_attr "type" "compare")])
1719 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1720 (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1721 (match_operand:SI
2 "gpc_reg_operand" "r")))]
1726 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1727 (compare:CC (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1728 (match_operand:SI
2 "gpc_reg_operand" "r"))
1730 (clobber (match_scratch:SI
3 "=r"))]
1733 [(set_attr "type" "compare")])
1736 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1737 (compare:CC (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1738 (match_operand:SI
2 "gpc_reg_operand" "r"))
1740 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1741 (and:SI (not:SI (match_dup
1)) (match_dup
2)))]
1744 [(set_attr "type" "compare")])
1747 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1748 (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1749 (match_operand:SI
2 "gpc_reg_operand" "r")))]
1754 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1755 (compare:CC (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1756 (match_operand:SI
2 "gpc_reg_operand" "r"))
1758 (clobber (match_scratch:SI
3 "=r"))]
1761 [(set_attr "type" "compare")])
1764 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1765 (compare:CC (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
1766 (match_operand:SI
2 "gpc_reg_operand" "r"))
1768 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1769 (ior:SI (not:SI (match_dup
1)) (match_dup
2)))]
1772 [(set_attr "type" "compare")])
1775 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1776 (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1777 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))))]
1782 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1783 (compare:CC (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1784 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r")))
1786 (clobber (match_scratch:SI
3 "=r"))]
1789 [(set_attr "type" "compare")])
1792 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1793 (compare:CC (ior:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1794 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r")))
1796 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1797 (ior:SI (not:SI (match_dup
1)) (not:SI (match_dup
2))))]
1800 [(set_attr "type" "compare")])
1803 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1804 (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1805 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))))]
1810 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
1811 (compare:CC (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1812 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r")))
1814 (clobber (match_scratch:SI
3 "=r"))]
1817 [(set_attr "type" "compare")])
1820 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
1821 (compare:CC (and:SI (not:SI (match_operand:SI
1 "gpc_reg_operand" "%r"))
1822 (not:SI (match_operand:SI
2 "gpc_reg_operand" "r")))
1824 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1825 (and:SI (not:SI (match_dup
1)) (not:SI (match_dup
2))))]
1828 [(set_attr "type" "compare")])
1830 ;; maskir insn. We need four forms because things might be in arbitrary
1831 ;; orders. Don't define forms that only set CR fields because these
1832 ;; would modify an input register.
1835 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1836 (ior:SI (and:SI (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))
1837 (match_operand:SI
1 "gpc_reg_operand" "
0"))
1838 (and:SI (match_dup
2)
1839 (match_operand:SI
3 "gpc_reg_operand" "r"))))]
1844 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1845 (ior:SI (and:SI (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))
1846 (match_operand:SI
1 "gpc_reg_operand" "
0"))
1847 (and:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1853 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1854 (ior:SI (and:SI (match_operand:SI
2 "gpc_reg_operand" "r")
1855 (match_operand:SI
3 "gpc_reg_operand" "r"))
1856 (and:SI (not:SI (match_dup
2))
1857 (match_operand:SI
1 "gpc_reg_operand" "
0"))))]
1862 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
1863 (ior:SI (and:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1864 (match_operand:SI
2 "gpc_reg_operand" "r"))
1865 (and:SI (not:SI (match_dup
2))
1866 (match_operand:SI
1 "gpc_reg_operand" "
0"))))]
1871 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
1873 (ior:SI (and:SI (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))
1874 (match_operand:SI
1 "gpc_reg_operand" "
0"))
1875 (and:SI (match_dup
2)
1876 (match_operand:SI
3 "gpc_reg_operand" "r")))
1878 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1879 (ior:SI (and:SI (not:SI (match_dup
2)) (match_dup
1))
1880 (and:SI (match_dup
2) (match_dup
3))))]
1883 [(set_attr "type" "compare")])
1886 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
1888 (ior:SI (and:SI (not:SI (match_operand:SI
2 "gpc_reg_operand" "r"))
1889 (match_operand:SI
1 "gpc_reg_operand" "
0"))
1890 (and:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1893 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1894 (ior:SI (and:SI (not:SI (match_dup
2)) (match_dup
1))
1895 (and:SI (match_dup
3) (match_dup
2))))]
1898 [(set_attr "type" "compare")])
1901 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
1903 (ior:SI (and:SI (match_operand:SI
2 "gpc_reg_operand" "r")
1904 (match_operand:SI
3 "gpc_reg_operand" "r"))
1905 (and:SI (not:SI (match_dup
2))
1906 (match_operand:SI
1 "gpc_reg_operand" "
0")))
1908 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1909 (ior:SI (and:SI (match_dup
2) (match_dup
3))
1910 (and:SI (not:SI (match_dup
2)) (match_dup
1))))]
1913 [(set_attr "type" "compare")])
1916 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
1918 (ior:SI (and:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1919 (match_operand:SI
2 "gpc_reg_operand" "r"))
1920 (and:SI (not:SI (match_dup
2))
1921 (match_operand:SI
1 "gpc_reg_operand" "
0")))
1923 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
1924 (ior:SI (and:SI (match_dup
3) (match_dup
2))
1925 (and:SI (not:SI (match_dup
2)) (match_dup
1))))]
1928 [(set_attr "type" "compare")])
1930 ;; Rotate and shift insns, in all their variants. These support shifts,
1931 ;; field inserts and extracts, and various combinations thereof.
1933 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
1934 (match_operand:SI
1 "const_int_operand" "i")
1935 (match_operand:SI
2 "const_int_operand" "i"))
1936 (match_operand:SI
3 "gpc_reg_operand" "r"))]
1940 int start = INTVAL (operands[
2]) &
31;
1941 int size = INTVAL (operands[
1]) &
31;
1943 operands[
4] = gen_rtx (CONST_INT, VOIDmode,
32 - start - size);
1944 operands[
1] = gen_rtx (CONST_INT, VOIDmode, start + size -
1);
1945 return
\"{rlimi|rlwimi} %
0,%
3,%
4,%h2,%h1
\";
1949 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
1950 (match_operand:SI
1 "const_int_operand" "i")
1951 (match_operand:SI
2 "const_int_operand" "i"))
1952 (ashift:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1953 (match_operand:SI
4 "const_int_operand" "i")))]
1957 int shift = INTVAL (operands[
4]) &
31;
1958 int start = INTVAL (operands[
2]) &
31;
1959 int size = INTVAL (operands[
1]) &
31;
1961 operands[
4] = gen_rtx (CONST_INT, VOIDmode, (shift - start - size) &
31);
1962 operands[
1] = gen_rtx (CONST_INT, VOIDmode, start + size -
1);
1963 return
\"{rlimi|rlwimi} %
0,%
3,%
4,%h2,%h1
\";
1967 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
1968 (match_operand:SI
1 "const_int_operand" "i")
1969 (match_operand:SI
2 "const_int_operand" "i"))
1970 (ashiftrt:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1971 (match_operand:SI
4 "const_int_operand" "i")))]
1975 int shift = INTVAL (operands[
4]) &
31;
1976 int start = INTVAL (operands[
2]) &
31;
1977 int size = INTVAL (operands[
1]) &
31;
1979 operands[
4] = gen_rtx (CONST_INT, VOIDmode, (
32 - shift - start - size) &
31);
1980 operands[
1] = gen_rtx (CONST_INT, VOIDmode, start + size -
1);
1981 return
\"{rlimi|rlwimi} %
0,%
3,%
4,%h2,%h1
\";
1985 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
1986 (match_operand:SI
1 "const_int_operand" "i")
1987 (match_operand:SI
2 "const_int_operand" "i"))
1988 (lshiftrt:SI (match_operand:SI
3 "gpc_reg_operand" "r")
1989 (match_operand:SI
4 "const_int_operand" "i")))]
1993 int shift = INTVAL (operands[
4]) &
31;
1994 int start = INTVAL (operands[
2]) &
31;
1995 int size = INTVAL (operands[
1]) &
31;
1997 operands[
4] = gen_rtx (CONST_INT, VOIDmode, (
32 - shift - start - size) &
31);
1998 operands[
1] = gen_rtx (CONST_INT, VOIDmode, start + size -
1);
1999 return
\"{rlimi|rlwimi} %
0,%
3,%
4,%h2,%h1
\";
2003 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
2004 (match_operand:SI
1 "const_int_operand" "i")
2005 (match_operand:SI
2 "const_int_operand" "i"))
2006 (zero_extract:SI (match_operand:SI
3 "gpc_reg_operand" "r")
2007 (match_operand:SI
4 "const_int_operand" "i")
2008 (match_operand:SI
5 "const_int_operand" "i")))]
2009 "INTVAL (operands[
4]) >= INTVAL (operands[
1])"
2012 int extract_start = INTVAL (operands[
5]) &
31;
2013 int extract_size = INTVAL (operands[
4]) &
31;
2014 int insert_start = INTVAL (operands[
2]) &
31;
2015 int insert_size = INTVAL (operands[
1]) &
31;
2017 /* Align extract field with insert field */
2018 operands[
5] = gen_rtx (CONST_INT, VOIDmode,
2019 (extract_start + extract_size - insert_start - insert_size) &
31);
2020 operands[
1] = gen_rtx (CONST_INT, VOIDmode, insert_start + insert_size -
1);
2021 return
\"{rlimi|rlwimi} %
0,%
3,%
5,%h2,%h1
\";
2024 (define_insn "extzv"
2025 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2026 (zero_extract:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2027 (match_operand:SI
2 "const_int_operand" "i")
2028 (match_operand:SI
3 "const_int_operand" "i")))]
2032 int start = INTVAL (operands[
3]) &
31;
2033 int size = INTVAL (operands[
2]) &
31;
2035 if (start + size >=
32)
2036 operands[
3] = const0_rtx;
2038 operands[
3] = gen_rtx (CONST_INT, VOIDmode, start + size);
2039 return
\"{rlinm|rlwinm} %
0,%
1,%
3,%s2,
31\";
2043 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2044 (compare:CC (zero_extract:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2045 (match_operand:SI
2 "const_int_operand" "i")
2046 (match_operand:SI
3 "const_int_operand" "i"))
2048 (clobber (match_scratch:SI
4 "=r"))]
2052 int start = INTVAL (operands[
3]) &
31;
2053 int size = INTVAL (operands[
2]) &
31;
2055 /* If the bitfield being tested fits in the upper or lower half of a
2056 word, it is possible to use andiu. or andil. to test it. This is
2057 useful because the condition register set-use delay is smaller for
2058 andi[ul]. than for rlinm. This doesn't work when the starting bit
2059 position is
0 because the LT and GT bits may be set wrong. */
2061 if ((start >
0 && start + size <=
16) || start >=
16)
2063 operands[
3] = gen_rtx (CONST_INT, VOIDmode,
2064 ((
1 << (
16 - (start &
15)))
2065 - (
1 << (
16 - (start &
15) - size))));
2067 return
\"{andiu.|andis.} %
4,%
1,%
3\";
2069 return
\"{andil.|andi.} %
4,%
1,%
3\";
2072 if (start + size >=
32)
2073 operands[
3] = const0_rtx;
2075 operands[
3] = gen_rtx (CONST_INT, VOIDmode, start + size);
2076 return
\"{rlinm.|rlwinm.} %
4,%
1,%
3,%s2,
31\";
2078 [(set_attr "type" "compare")])
2081 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
2082 (compare:CC (zero_extract:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2083 (match_operand:SI
2 "const_int_operand" "i")
2084 (match_operand:SI
3 "const_int_operand" "i"))
2086 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2087 (zero_extract:SI (match_dup
1) (match_dup
2) (match_dup
3)))]
2091 int start = INTVAL (operands[
3]) &
31;
2092 int size = INTVAL (operands[
2]) &
31;
2094 if (start >=
16 && start + size ==
32)
2096 operands[
3] = gen_rtx (CONST_INT, VOIDmode, (
1 << (
32 - start)) -
1);
2097 return
\"{andil.|andi.} %
0,%
1,%
3\";
2100 if (start + size >=
32)
2101 operands[
3] = const0_rtx;
2103 operands[
3] = gen_rtx (CONST_INT, VOIDmode, start + size);
2104 return
\"{rlinm.|rlwinm.} %
0,%
1,%
3,%s2,
31\";
2106 [(set_attr "type" "delayed_compare")])
2108 (define_insn "rotlsi3"
2109 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2110 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2111 (match_operand:SI
2 "reg_or_cint_operand" "ri")))]
2113 "{rl%I2nm|rlw%I2nm} %
0,%
1,%h2,
0xffffffff")
2116 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2117 (compare:CC (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2118 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2120 (clobber (match_scratch:SI
3 "=r"))]
2122 "{rl%I2nm.|rlw%I2nm.} %
3,%
1,%h2,
0xffffffff"
2123 [(set_attr "type" "delayed_compare")])
2126 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2127 (compare:CC (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2128 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2130 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2131 (rotate:SI (match_dup
1) (match_dup
2)))]
2133 "{rl%I2nm.|rlw%I2nm.} %
0,%
1,%h2,
0xffffffff"
2134 [(set_attr "type" "delayed_compare")])
2137 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2138 (and:SI (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2139 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2140 (match_operand:SI
3 "mask_operand" "L")))]
2142 "{rl%I2nm|rlw%I2nm} %
0,%
1,%h2,%m3,%M3")
2145 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2147 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2148 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2149 (match_operand:SI
3 "mask_operand" "L"))
2151 (clobber (match_scratch:SI
4 "=r"))]
2153 "{rl%I2nm.|rlw%I2nm.} %
4,%
1,%h2,%m3,%M3"
2154 [(set_attr "type" "delayed_compare")])
2157 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
2159 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2160 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2161 (match_operand:SI
3 "mask_operand" "L"))
2163 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2164 (and:SI (rotate:SI (match_dup
1) (match_dup
2)) (match_dup
3)))]
2166 "{rl%I2nm.|rlw%I2nm.} %
0,%
1,%h2,%m3,%M3"
2167 [(set_attr "type" "delayed_compare")])
2170 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2173 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2174 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0)))]
2176 "{rl%I2nm|rlw%I2nm} %
0,%
1,%h2,
0xff")
2179 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2180 (compare:CC (zero_extend:SI
2182 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2183 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0))
2185 (clobber (match_scratch:SI
3 "=r"))]
2187 "{rl%I2nm.|rlw%I2nm.} %
3,%
1,%h2,
0xff"
2188 [(set_attr "type" "delayed_compare")])
2191 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2192 (compare:CC (zero_extend:SI
2194 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2195 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0))
2197 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2198 (zero_extend:SI (subreg:QI (rotate:SI (match_dup
1) (match_dup
2))
0)))]
2200 "{rl%I2nm.|rlw%I2nm.} %
0,%
1,%h2,
0xff"
2201 [(set_attr "type" "delayed_compare")])
2204 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2207 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2208 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0)))]
2210 "{rl%I2nm|rlw%I2nm} %
0,%
1,%h2,
0xffff")
2213 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2214 (compare:CC (zero_extend:SI
2216 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2217 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0))
2219 (clobber (match_scratch:SI
3 "=r"))]
2221 "{rl%I2nm.|rlw%I2nm.} %
3,%
1,%h2,
0xffff"
2222 [(set_attr "type" "delayed_compare")])
2225 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2226 (compare:CC (zero_extend:SI
2228 (rotate:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2229 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
0))
2231 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2232 (zero_extend:SI (subreg:HI (rotate:SI (match_dup
1) (match_dup
2))
0)))]
2234 "{rl%I2nm.|rlw%I2nm.} %
0,%
1,%h2,
0xffff"
2235 [(set_attr "type" "delayed_compare")])
2237 ;; Note that we use "sle." instead of "sl." so that we can set
2238 ;; SHIFT_COUNT_TRUNCATED.
2240 (define_expand "ashlsi3"
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_cint_operand" ""))]
2248 emit_insn (gen_ashlsi3_power (operands[
0], operands[
1], operands[
2]));
2250 emit_insn (gen_ashlsi3_no_power (operands[
0], operands[
1], operands[
2]));
2254 (define_insn "ashlsi3_power"
2255 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2256 (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2257 (match_operand:SI
2 "reg_or_cint_operand" "r,i")))
2258 (clobber (match_scratch:SI
3 "=q,X"))]
2262 {sli|slwi} %
0,%
1,%h2"
2263 [(set_attr "length" "
8")])
2265 (define_insn "ashlsi3_no_power"
2266 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2267 (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2268 (match_operand:SI
2 "reg_or_cint_operand" "ri")))]
2271 [(set_attr "length" "
8")])
2274 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
2275 (compare:CC (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2276 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2278 (clobber (match_scratch:SI
3 "=r,r"))
2279 (clobber (match_scratch:SI
4 "=q,X"))]
2283 {sli.|slwi.} %
3,%
1,%h2"
2284 [(set_attr "type" "delayed_compare")])
2287 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2288 (compare:CC (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2289 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2291 (clobber (match_scratch:SI
3 "=r"))]
2294 [(set_attr "type" "delayed_compare")])
2297 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
2298 (compare:CC (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2299 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2301 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2302 (ashift:SI (match_dup
1) (match_dup
2)))
2303 (clobber (match_scratch:SI
4 "=q,X"))]
2307 {sli.|slwi.} %
0,%
1,%h2"
2308 [(set_attr "type" "delayed_compare")])
2311 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2312 (compare:CC (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2313 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2315 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2316 (ashift:SI (match_dup
1) (match_dup
2)))]
2319 [(set_attr "type" "delayed_compare")])
2322 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2323 (and:SI (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2324 (match_operand:SI
2 "const_int_operand" "i"))
2325 (match_operand:SI
3 "mask_operand" "L")))]
2326 "includes_lshift_p (operands[
2], operands[
3])"
2327 "{rlinm|rlwinm} %
0,%
1,%h2,%m3,%M3")
2330 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2332 (and:SI (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2333 (match_operand:SI
2 "const_int_operand" "i"))
2334 (match_operand:SI
3 "mask_operand" "L"))
2336 (clobber (match_scratch:SI
4 "=r"))]
2337 "includes_lshift_p (operands[
2], operands[
3])"
2338 "{rlinm.|rlwinm.} %
4,%
1,%h2,%m3,%M3"
2339 [(set_attr "type" "delayed_compare")])
2342 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
2344 (and:SI (ashift:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2345 (match_operand:SI
2 "const_int_operand" "i"))
2346 (match_operand:SI
3 "mask_operand" "L"))
2348 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2349 (and:SI (ashift:SI (match_dup
1) (match_dup
2)) (match_dup
3)))]
2350 "includes_lshift_p (operands[
2], operands[
3])"
2351 "{rlinm.|rlwinm.} %
0,%
1,%h2,%m3,%M3"
2352 [(set_attr "type" "delayed_compare")])
2354 ;; The AIX assembler mis-handles "sri x,x,
0", so write that case as
2356 (define_expand "lshrsi3"
2357 [(use (match_operand:SI
0 "gpc_reg_operand" ""))
2358 (use (match_operand:SI
1 "gpc_reg_operand" ""))
2359 (use (match_operand:SI
2 "reg_or_cint_operand" ""))]
2364 emit_insn (gen_lshrsi3_power (operands[
0], operands[
1], operands[
2]));
2366 emit_insn (gen_lshrsi3_no_power (operands[
0], operands[
1], operands[
2]));
2370 (define_insn "lshrsi3_power"
2371 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2372 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2373 (match_operand:SI
2 "reg_or_cint_operand" "r,i")))
2374 (clobber (match_scratch:SI
3 "=q,X"))]
2378 {s%A2i|s%A2wi} %
0,%
1,%h2")
2380 (define_insn "lshrsi3_no_power"
2381 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2382 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2383 (match_operand:SI
2 "reg_or_cint_operand" "ri")))]
2388 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
2389 (compare:CC (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2390 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2392 (clobber (match_scratch:SI
3 "=r,r"))
2393 (clobber (match_scratch:SI
4 "=q,X"))]
2397 {s%A2i.|s%A2wi.} %
3,%
1,%h2"
2398 [(set_attr "type" "delayed_compare")])
2401 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2402 (compare:CC (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2403 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2405 (clobber (match_scratch:SI
3 "=r"))]
2408 [(set_attr "type" "delayed_compare")])
2411 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
2412 (compare:CC (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2413 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2415 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2416 (lshiftrt:SI (match_dup
1) (match_dup
2)))
2417 (clobber (match_scratch:SI
4 "=q,X"))]
2421 {s%A2i.|s%A2wi.} %
0,%
1,%h2"
2422 [(set_attr "type" "delayed_compare")])
2425 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2426 (compare:CC (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2427 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2429 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2430 (lshiftrt:SI (match_dup
1) (match_dup
2)))]
2433 [(set_attr "type" "delayed_compare")])
2436 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2437 (and:SI (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2438 (match_operand:SI
2 "const_int_operand" "i"))
2439 (match_operand:SI
3 "mask_operand" "L")))]
2440 "includes_rshift_p (operands[
2], operands[
3])"
2441 "{rlinm|rlwinm} %
0,%
1,%s2,%m3,%M3")
2444 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2446 (and:SI (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2447 (match_operand:SI
2 "const_int_operand" "i"))
2448 (match_operand:SI
3 "mask_operand" "L"))
2450 (clobber (match_scratch:SI
4 "=r"))]
2451 "includes_rshift_p (operands[
2], operands[
3])"
2452 "{rlinm.|rlwinm.} %
4,%
1,%s2,%m3,%M3"
2453 [(set_attr "type" "delayed_compare")])
2456 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
2458 (and:SI (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2459 (match_operand:SI
2 "const_int_operand" "i"))
2460 (match_operand:SI
3 "mask_operand" "L"))
2462 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2463 (and:SI (lshiftrt:SI (match_dup
1) (match_dup
2)) (match_dup
3)))]
2464 "includes_rshift_p (operands[
2], operands[
3])"
2465 "{rlinm.|rlwinm.} %
0,%
1,%s2,%m3,%M3"
2466 [(set_attr "type" "delayed_compare")])
2469 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2472 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2473 (match_operand:SI
2 "const_int_operand" "i"))
0)))]
2474 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
255))"
2475 "{rlinm|rlwinm} %
0,%
1,%s2,
0xff")
2478 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2482 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2483 (match_operand:SI
2 "const_int_operand" "i"))
0))
2485 (clobber (match_scratch:SI
3 "=r"))]
2486 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
255))"
2487 "{rlinm.|rlwinm.} %
3,%
1,%s2,
0xff"
2488 [(set_attr "type" "delayed_compare")])
2491 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2495 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2496 (match_operand:SI
2 "const_int_operand" "i"))
0))
2498 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2499 (zero_extend:SI (subreg:QI (lshiftrt:SI (match_dup
1) (match_dup
2))
0)))]
2500 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
255))"
2501 "{rlinm.|rlwinm.} %
0,%
1,%s2,
0xff"
2502 [(set_attr "type" "delayed_compare")])
2505 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2508 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2509 (match_operand:SI
2 "const_int_operand" "i"))
0)))]
2510 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
65535))"
2511 "{rlinm|rlwinm} %
0,%
1,%s2,
0xffff")
2514 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2518 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2519 (match_operand:SI
2 "const_int_operand" "i"))
0))
2521 (clobber (match_scratch:SI
3 "=r"))]
2522 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
65535))"
2523 "{rlinm.|rlwinm.} %
3,%
1,%s2,
0xffff"
2524 [(set_attr "type" "delayed_compare")])
2527 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2531 (lshiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2532 (match_operand:SI
2 "const_int_operand" "i"))
0))
2534 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2535 (zero_extend:SI (subreg:HI (lshiftrt:SI (match_dup
1) (match_dup
2))
0)))]
2536 "includes_rshift_p (operands[
2], gen_rtx (CONST_INT, VOIDmode,
65535))"
2537 "{rlinm.|rlwinm.} %
0,%
1,%s2,
0xffff"
2538 [(set_attr "type" "delayed_compare")])
2541 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
2543 (match_operand:SI
1 "gpc_reg_operand" "r"))
2544 (ashiftrt:SI (match_operand:SI
2 "gpc_reg_operand" "r")
2550 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
2552 (match_operand:SI
1 "gpc_reg_operand" "r"))
2553 (lshiftrt:SI (match_operand:SI
2 "gpc_reg_operand" "r")
2559 [(set (zero_extract:SI (match_operand:SI
0 "gpc_reg_operand" "+r")
2561 (match_operand:SI
1 "gpc_reg_operand" "r"))
2562 (zero_extract:SI (match_operand:SI
2 "gpc_reg_operand" "r")
2568 (define_expand "ashrsi3"
2569 [(set (match_operand:SI
0 "gpc_reg_operand" "")
2570 (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "")
2571 (match_operand:SI
2 "reg_or_cint_operand" "")))]
2576 emit_insn (gen_ashrsi3_power (operands[
0], operands[
1], operands[
2]));
2578 emit_insn (gen_ashrsi3_no_power (operands[
0], operands[
1], operands[
2]));
2582 (define_insn "ashrsi3_power"
2583 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2584 (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2585 (match_operand:SI
2 "reg_or_cint_operand" "r,i")))
2586 (clobber (match_scratch:SI
3 "=q,X"))]
2590 {srai|srawi} %
0,%
1,%h2")
2592 (define_insn "ashrsi3_no_power"
2593 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
2594 (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2595 (match_operand:SI
2 "reg_or_cint_operand" "ri")))]
2597 "sraw%I2 %
0,%
1,%h2")
2600 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
2601 (compare:CC (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2602 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2604 (clobber (match_scratch:SI
3 "=r,r"))
2605 (clobber (match_scratch:SI
4 "=q,X"))]
2609 {srai.|srawi.} %
3,%
1,%h2"
2610 [(set_attr "type" "delayed_compare")])
2613 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
2614 (compare:CC (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2615 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2617 (clobber (match_scratch:SI
3 "=r"))]
2619 "sraw%I2. %
3,%
1,%h2"
2620 [(set_attr "type" "delayed_compare")])
2623 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
2624 (compare:CC (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
2625 (match_operand:SI
2 "reg_or_cint_operand" "r,i"))
2627 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
2628 (ashiftrt:SI (match_dup
1) (match_dup
2)))
2629 (clobber (match_scratch:SI
4 "=q,X"))]
2633 {srai.|srawi.} %
0,%
1,%h2"
2634 [(set_attr "type" "delayed_compare")])
2637 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
2638 (compare:CC (ashiftrt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
2639 (match_operand:SI
2 "reg_or_cint_operand" "ri"))
2641 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
2642 (ashiftrt:SI (match_dup
1) (match_dup
2)))]
2644 "sraw%I2. %
0,%
1,%h2"
2645 [(set_attr "type" "delayed_compare")])
2647 ;; Floating-point insns, excluding normal data motion.
2649 ;; PowerPC has a full set of single-precision floating point instructions.
2651 ;; For the POWER architecture, we pretend that we have both SFmode and
2652 ;; DFmode insns, while, in fact, all fp insns are actually done in double.
2653 ;; The only conversions we will do will be when storing to memory. In that
2654 ;; case, we will use the "frsp" instruction before storing.
2656 ;; Note that when we store into a single-precision memory location, we need to
2657 ;; use the frsp insn first. If the register being stored isn't dead, we
2658 ;; need a scratch register for the frsp. But this is difficult when the store
2659 ;; is done by reload. It is not incorrect to do the frsp on the register in
2660 ;; this case, we just lose precision that we would have otherwise gotten but
2661 ;; is not guaranteed. Perhaps this should be tightened up at some point.
2663 (define_insn "extendsfdf2"
2664 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
2665 (float_extend:DF (match_operand:SF
1 "gpc_reg_operand" "f")))]
2669 if (REGNO (operands[
0]) == REGNO (operands[
1]))
2672 return
\"fmr %
0,%
1\";
2674 [(set_attr "type" "fp")])
2676 (define_insn "truncdfsf2"
2677 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2678 (float_truncate:SF (match_operand:DF
1 "gpc_reg_operand" "f")))]
2681 [(set_attr "type" "fp")])
2683 (define_insn "negsf2"
2684 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2685 (neg:SF (match_operand:SF
1 "gpc_reg_operand" "f")))]
2688 [(set_attr "type" "fp")])
2690 (define_insn "abssf2"
2691 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2692 (abs:SF (match_operand:SF
1 "gpc_reg_operand" "f")))]
2695 [(set_attr "type" "fp")])
2698 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2699 (neg:SF (abs:SF (match_operand:SF
1 "gpc_reg_operand" "f"))))]
2702 [(set_attr "type" "fp")])
2704 (define_expand "addsf3"
2705 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2706 (plus:SF (match_operand:SF
1 "gpc_reg_operand" "")
2707 (match_operand:SF
2 "gpc_reg_operand" "")))]
2712 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2713 (plus:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2714 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2715 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2717 [(set_attr "type" "fp")])
2720 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2721 (plus:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2722 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2723 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2724 "{fa|fadd} %
0,%
1,%
2"
2725 [(set_attr "type" "fp")])
2727 (define_expand "subsf3"
2728 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2729 (minus:SF (match_operand:SF
1 "gpc_reg_operand" "")
2730 (match_operand:SF
2 "gpc_reg_operand" "")))]
2735 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2736 (minus:SF (match_operand:SF
1 "gpc_reg_operand" "f")
2737 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2738 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2740 [(set_attr "type" "fp")])
2743 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2744 (minus:SF (match_operand:SF
1 "gpc_reg_operand" "f")
2745 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2746 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2747 "{fs|fsub} %
0,%
1,%
2"
2748 [(set_attr "type" "fp")])
2750 (define_expand "mulsf3"
2751 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2752 (mult:SF (match_operand:SF
1 "gpc_reg_operand" "")
2753 (match_operand:SF
2 "gpc_reg_operand" "")))]
2758 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2759 (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2760 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2761 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2763 [(set_attr "type" "fp")])
2766 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2767 (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2768 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2769 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2770 "{fm|fmul} %
0,%
1,%
2"
2771 [(set_attr "type" "fp")])
2773 (define_expand "divsf3"
2774 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2775 (div:SF (match_operand:SF
1 "gpc_reg_operand" "")
2776 (match_operand:SF
2 "gpc_reg_operand" "")))]
2781 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2782 (div:SF (match_operand:SF
1 "gpc_reg_operand" "f")
2783 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2784 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2786 [(set_attr "type" "sdiv")])
2789 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2790 (div:SF (match_operand:SF
1 "gpc_reg_operand" "f")
2791 (match_operand:SF
2 "gpc_reg_operand" "f")))]
2792 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2793 "{fd|fdiv} %
0,%
1,%
2"
2794 [(set_attr "type" "sdiv")])
2797 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2798 (plus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2799 (match_operand:SF
2 "gpc_reg_operand" "f"))
2800 (match_operand:SF
3 "gpc_reg_operand" "f")))]
2801 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2802 "fmadds %
0,%
1,%
2,%
3"
2803 [(set_attr "type" "fp")])
2806 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2807 (plus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2808 (match_operand:SF
2 "gpc_reg_operand" "f"))
2809 (match_operand:SF
3 "gpc_reg_operand" "f")))]
2810 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2811 "{fma|fmadd} %
0,%
1,%
2,%
3"
2812 [(set_attr "type" "fp")])
2815 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2816 (minus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2817 (match_operand:SF
2 "gpc_reg_operand" "f"))
2818 (match_operand:SF
3 "gpc_reg_operand" "f")))]
2819 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2820 "fmsubs %
0,%
1,%
2,%
3"
2821 [(set_attr "type" "fp")])
2824 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2825 (minus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2826 (match_operand:SF
2 "gpc_reg_operand" "f"))
2827 (match_operand:SF
3 "gpc_reg_operand" "f")))]
2828 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2829 "{fms|fmsub} %
0,%
1,%
2,%
3"
2830 [(set_attr "type" "fp")])
2833 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2834 (neg:SF (plus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2835 (match_operand:SF
2 "gpc_reg_operand" "f"))
2836 (match_operand:SF
3 "gpc_reg_operand" "f"))))]
2837 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2838 "fnmadds %
0,%
1,%
2,%
3"
2839 [(set_attr "type" "fp")])
2842 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2843 (neg:SF (plus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2844 (match_operand:SF
2 "gpc_reg_operand" "f"))
2845 (match_operand:SF
3 "gpc_reg_operand" "f"))))]
2846 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2847 "{fnma|fnmadd} %
0,%
1,%
2,%
3"
2848 [(set_attr "type" "fp")])
2851 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2852 (neg:SF (minus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2853 (match_operand:SF
2 "gpc_reg_operand" "f"))
2854 (match_operand:SF
3 "gpc_reg_operand" "f"))))]
2855 "TARGET_POWERPC && TARGET_HARD_FLOAT"
2856 "fnmsubs %
0,%
1,%
2,%
3"
2857 [(set_attr "type" "fp")])
2860 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2861 (neg:SF (minus:SF (mult:SF (match_operand:SF
1 "gpc_reg_operand" "%f")
2862 (match_operand:SF
2 "gpc_reg_operand" "f"))
2863 (match_operand:SF
3 "gpc_reg_operand" "f"))))]
2864 "! TARGET_POWERPC && TARGET_HARD_FLOAT"
2865 "{fnms|fnmsub} %
0,%
1,%
2,%
3"
2866 [(set_attr "type" "fp")])
2868 (define_expand "sqrtsf2"
2869 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2870 (sqrt:SF (match_operand:SF
1 "gpc_reg_operand" "")))]
2871 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
2875 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2876 (sqrt:SF (match_operand:SF
1 "gpc_reg_operand" "f")))]
2877 "TARGET_PPC_GPOPT && TARGET_HARD_FLOAT"
2879 [(set_attr "type" "ssqrt")])
2882 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2883 (sqrt:SF (match_operand:SF
1 "gpc_reg_operand" "f")))]
2884 "TARGET_POWER2 && TARGET_HARD_FLOAT"
2886 [(set_attr "type" "dsqrt")])
2888 ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
2889 ;; fsel instruction and some auxiliary computations. Then we just have a
2890 ;; single DEFINE_INSN for fsel and the define_splits to make them if made by
2892 (define_expand "maxsf3"
2894 (minus:SF (match_operand:SF
1 "gpc_reg_operand" "")
2895 (match_operand:SF
2 "gpc_reg_operand" "")))
2896 (set (match_operand:SF
0 "gpc_reg_operand" "")
2897 (if_then_else:SF (ge (match_dup
3)
2901 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
2903 { operands[
3] = gen_reg_rtx (SFmode); }")
2906 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2907 (smax:SF (match_operand:SF
1 "gpc_reg_operand" "")
2908 (match_operand:SF
2 "gpc_reg_operand" "")))
2909 (clobber (match_operand:SF
3 "gpc_reg_operand" ""))]
2910 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
2912 (minus:SF (match_dup
1) (match_dup
2)))
2914 (if_then_else:SF (ge (match_dup
3)
2920 (define_expand "minsf3"
2922 (minus:SF (match_operand:SF
2 "gpc_reg_operand" "")
2923 (match_operand:SF
1 "gpc_reg_operand" "")))
2924 (set (match_operand:SF
0 "gpc_reg_operand" "")
2925 (if_then_else:SF (ge (match_dup
3)
2929 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
2931 { operands[
3] = gen_reg_rtx (SFmode); }")
2934 [(set (match_operand:SF
0 "gpc_reg_operand" "")
2935 (smin:SF (match_operand:SF
1 "gpc_reg_operand" "")
2936 (match_operand:SF
2 "gpc_reg_operand" "")))
2937 (clobber (match_operand:SF
3 "gpc_reg_operand" ""))]
2938 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
2940 (minus:SF (match_dup
2) (match_dup
1)))
2942 (if_then_else:SF (ge (match_dup
3)
2948 (define_expand "movsfcc"
2949 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
2950 (if_then_else:SF (match_operand
1 "comparison_operator" "")
2951 (match_operand:SF
2 "gpc_reg_operand" "f")
2952 (match_operand:SF
3 "gpc_reg_operand" "f")))]
2953 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
2957 enum rtx_code code = GET_CODE (operands[
1]);
2958 if (! rs6000_compare_fp_p)
2962 case GE: case EQ: case NE:
2963 op0 = rs6000_compare_op0;
2964 op1 = rs6000_compare_op1;
2967 op0 = rs6000_compare_op1;
2968 op1 = rs6000_compare_op0;
2969 temp = operands[
2]; operands[
2] = operands[
3]; operands[
3] = temp;
2972 op0 = rs6000_compare_op1;
2973 op1 = rs6000_compare_op0;
2976 op0 = rs6000_compare_op0;
2977 op1 = rs6000_compare_op1;
2978 temp = operands[
2]; operands[
2] = operands[
3]; operands[
3] = temp;
2983 if (GET_MODE (rs6000_compare_op0) == DFmode)
2985 temp = gen_reg_rtx (DFmode);
2986 emit_insn (gen_subdf3 (temp, op0, op1));
2987 emit_insn (gen_fseldfsf4 (operands[
0], temp, operands[
2], operands[
3]));
2990 emit_insn (gen_negdf2 (temp, temp));
2991 emit_insn (gen_fseldfsf4 (operands[
0], temp, operands[
0], operands[
3]));
2995 emit_insn (gen_negdf2 (temp, temp));
2996 emit_insn (gen_fseldfsf4 (operands[
0], temp, operands[
3], operands[
0]));
3001 temp = gen_reg_rtx (SFmode);
3002 emit_insn (gen_subsf3 (temp, op0, op1));
3003 emit_insn (gen_fselsfsf4 (operands[
0], temp, operands[
2], operands[
3]));
3006 emit_insn (gen_negsf2 (temp, temp));
3007 emit_insn (gen_fselsfsf4 (operands[
0], temp, operands[
0], operands[
3]));
3011 emit_insn (gen_negsf2 (temp, temp));
3012 emit_insn (gen_fselsfsf4 (operands[
0], temp, operands[
3], operands[
0]));
3018 (define_insn "fselsfsf4"
3019 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
3020 (if_then_else:SF (ge (match_operand:SF
1 "gpc_reg_operand" "f")
3022 (match_operand:SF
2 "gpc_reg_operand" "f")
3023 (match_operand:SF
3 "gpc_reg_operand" "f")))]
3024 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3026 [(set_attr "type" "fp")])
3028 (define_insn "fseldfsf4"
3029 [(set (match_operand:SF
0 "gpc_reg_operand" "=f")
3030 (if_then_else:SF (ge (match_operand:DF
1 "gpc_reg_operand" "f")
3032 (match_operand:SF
2 "gpc_reg_operand" "f")
3033 (match_operand:SF
3 "gpc_reg_operand" "f")))]
3034 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3036 [(set_attr "type" "fp")])
3038 (define_insn "negdf2"
3039 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3040 (neg:DF (match_operand:DF
1 "gpc_reg_operand" "f")))]
3043 [(set_attr "type" "fp")])
3045 (define_insn "absdf2"
3046 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3047 (abs:DF (match_operand:DF
1 "gpc_reg_operand" "f")))]
3050 [(set_attr "type" "fp")])
3053 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3054 (neg:DF (abs:DF (match_operand:DF
1 "gpc_reg_operand" "f"))))]
3057 [(set_attr "type" "fp")])
3059 (define_insn "adddf3"
3060 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3061 (plus:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3062 (match_operand:DF
2 "gpc_reg_operand" "f")))]
3064 "{fa|fadd} %
0,%
1,%
2"
3065 [(set_attr "type" "fp")])
3067 (define_insn "subdf3"
3068 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3069 (minus:DF (match_operand:DF
1 "gpc_reg_operand" "f")
3070 (match_operand:DF
2 "gpc_reg_operand" "f")))]
3072 "{fs|fsub} %
0,%
1,%
2"
3073 [(set_attr "type" "fp")])
3075 (define_insn "muldf3"
3076 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3077 (mult:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3078 (match_operand:DF
2 "gpc_reg_operand" "f")))]
3080 "{fm|fmul} %
0,%
1,%
2"
3081 [(set_attr "type" "dmul")])
3083 (define_insn "divdf3"
3084 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3085 (div:DF (match_operand:DF
1 "gpc_reg_operand" "f")
3086 (match_operand:DF
2 "gpc_reg_operand" "f")))]
3088 "{fd|fdiv} %
0,%
1,%
2"
3089 [(set_attr "type" "ddiv")])
3092 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3093 (plus:DF (mult:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3094 (match_operand:DF
2 "gpc_reg_operand" "f"))
3095 (match_operand:DF
3 "gpc_reg_operand" "f")))]
3097 "{fma|fmadd} %
0,%
1,%
2,%
3"
3098 [(set_attr "type" "dmul")])
3101 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3102 (minus:DF (mult:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3103 (match_operand:DF
2 "gpc_reg_operand" "f"))
3104 (match_operand:DF
3 "gpc_reg_operand" "f")))]
3106 "{fms|fmsub} %
0,%
1,%
2,%
3"
3107 [(set_attr "type" "dmul")])
3110 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3111 (neg:DF (plus:DF (mult:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3112 (match_operand:DF
2 "gpc_reg_operand" "f"))
3113 (match_operand:DF
3 "gpc_reg_operand" "f"))))]
3115 "{fnma|fnmadd} %
0,%
1,%
2,%
3"
3116 [(set_attr "type" "dmul")])
3119 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3120 (neg:DF (minus:DF (mult:DF (match_operand:DF
1 "gpc_reg_operand" "%f")
3121 (match_operand:DF
2 "gpc_reg_operand" "f"))
3122 (match_operand:DF
3 "gpc_reg_operand" "f"))))]
3124 "{fnms|fnmsub} %
0,%
1,%
2,%
3"
3125 [(set_attr "type" "dmul")])
3127 (define_insn "sqrtdf2"
3128 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3129 (sqrt:DF (match_operand:DF
1 "gpc_reg_operand" "f")))]
3130 "(TARGET_PPC_GPOPT || TARGET_POWER2) && TARGET_HARD_FLOAT"
3132 [(set_attr "type" "dsqrt")])
3134 ;; For MIN, MAX, and conditional move, we use DEFINE_EXPAND's that involve a
3135 ;; fsel instruction and some auxiliary computations. Then we just have a
3136 ;; single DEFINE_INSN for fsel and the define_splits to make them if made by
3139 (define_expand "maxdf3"
3141 (minus:DF (match_operand:DF
1 "gpc_reg_operand" "")
3142 (match_operand:DF
2 "gpc_reg_operand" "")))
3143 (set (match_operand:DF
0 "gpc_reg_operand" "")
3144 (if_then_else:DF (ge (match_dup
3)
3148 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3150 { operands[
3] = gen_reg_rtx (DFmode); }")
3153 [(set (match_operand:DF
0 "gpc_reg_operand" "")
3154 (smax:DF (match_operand:DF
1 "gpc_reg_operand" "")
3155 (match_operand:DF
2 "gpc_reg_operand" "")))
3156 (clobber (match_operand:DF
3 "gpc_reg_operand" ""))]
3157 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3159 (minus:DF (match_dup
1) (match_dup
2)))
3161 (if_then_else:DF (ge (match_dup
3)
3167 (define_expand "mindf3"
3169 (minus:DF (match_operand:DF
2 "gpc_reg_operand" "")
3170 (match_operand:DF
1 "gpc_reg_operand" "")))
3171 (set (match_operand:DF
0 "gpc_reg_operand" "")
3172 (if_then_else:DF (ge (match_dup
3)
3176 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3178 { operands[
3] = gen_reg_rtx (DFmode); }")
3181 [(set (match_operand:DF
0 "gpc_reg_operand" "")
3182 (smin:DF (match_operand:DF
1 "gpc_reg_operand" "")
3183 (match_operand:DF
2 "gpc_reg_operand" "")))
3184 (clobber (match_operand:DF
3 "gpc_reg_operand" ""))]
3185 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3187 (minus:DF (match_dup
2) (match_dup
1)))
3189 (if_then_else:DF (ge (match_dup
3)
3195 (define_expand "movdfcc"
3196 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3197 (if_then_else:DF (match_operand
1 "comparison_operator" "")
3198 (match_operand:DF
2 "gpc_reg_operand" "f")
3199 (match_operand:DF
3 "gpc_reg_operand" "f")))]
3200 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3204 enum rtx_code code = GET_CODE (operands[
1]);
3205 if (! rs6000_compare_fp_p)
3209 case GE: case EQ: case NE:
3210 op0 = rs6000_compare_op0;
3211 op1 = rs6000_compare_op1;
3214 op0 = rs6000_compare_op1;
3215 op1 = rs6000_compare_op0;
3216 temp = operands[
2]; operands[
2] = operands[
3]; operands[
3] = temp;
3219 op0 = rs6000_compare_op1;
3220 op1 = rs6000_compare_op0;
3223 op0 = rs6000_compare_op0;
3224 op1 = rs6000_compare_op1;
3225 temp = operands[
2]; operands[
2] = operands[
3]; operands[
3] = temp;
3230 if (GET_MODE (rs6000_compare_op0) == DFmode)
3232 temp = gen_reg_rtx (DFmode);
3233 emit_insn (gen_subdf3 (temp, op0, op1));
3234 emit_insn (gen_fseldfdf4 (operands[
0], temp, operands[
2], operands[
3]));
3237 emit_insn (gen_negdf2 (temp, temp));
3238 emit_insn (gen_fseldfdf4 (operands[
0], temp, operands[
0], operands[
3]));
3242 emit_insn (gen_negdf2 (temp, temp));
3243 emit_insn (gen_fseldfdf4 (operands[
0], temp, operands[
3], operands[
0]));
3248 temp = gen_reg_rtx (SFmode);
3249 emit_insn (gen_subsf3 (temp, op0, op1));
3250 emit_insn (gen_fselsfdf4 (operands[
0], temp, operands[
2], operands[
3]));
3253 emit_insn (gen_negsf2 (temp, temp));
3254 emit_insn (gen_fselsfdf4 (operands[
0], temp, operands[
0], operands[
3]));
3258 emit_insn (gen_negsf2 (temp, temp));
3259 emit_insn (gen_fselsfdf4 (operands[
0], temp, operands[
3], operands[
0]));
3265 (define_insn "fseldfdf4"
3266 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3267 (if_then_else:DF (ge (match_operand:DF
1 "gpc_reg_operand" "f")
3269 (match_operand:DF
2 "gpc_reg_operand" "f")
3270 (match_operand:DF
3 "gpc_reg_operand" "f")))]
3271 "TARGET_PPC_GFXOPT && TARGET_HARD_FLOAT"
3273 [(set_attr "type" "fp")])
3275 (define_insn "fselsfdf4"
3276 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3277 (if_then_else:DF (ge (match_operand:SF
1 "gpc_reg_operand" "f")
3279 (match_operand:DF
2 "gpc_reg_operand" "f")
3280 (match_operand:DF
3 "gpc_reg_operand" "f")))]
3283 [(set_attr "type" "fp")])
3285 ;; Conversions to and from floating-point.
3286 (define_expand "floatsidf2"
3288 (plus:DI (zero_extend:DI
3289 (xor:SI (match_operand:SI
1 "gpc_reg_operand" "")
3292 (set (match_operand:DF
0 "gpc_reg_operand" "")
3293 (minus:DF (subreg:DF (match_dup
2)
0)
3295 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
3298 operands[
2] = gen_reg_rtx (DImode);
3299 operands[
3] = gen_rtx (CONST_INT, VOIDmode,
0x80000000);
3300 operands[
4] = rs6000_immed_double_const (
0,
0x43300000, DImode);
3301 operands[
5] = force_reg (DFmode, rs6000_immed_double_const (
0x43300000,
3306 (define_expand "floatunssidf2"
3308 (plus:DI (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" ""))
3310 (set (match_operand:DF
0 "gpc_reg_operand" "")
3311 (minus:DF (subreg:DF (match_dup
2)
0)
3313 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT"
3316 operands[
2] = gen_reg_rtx (DImode);
3317 operands[
3] = rs6000_immed_double_const (
0,
0x43300000, DImode);
3318 operands[
4] = force_reg (DFmode, rs6000_immed_double_const (
0x43300000,
0, DFmode));
3321 ;; For the above two cases, we always split.
3323 [(set (match_operand:DI
0 "gpc_reg_operand" "")
3324 (plus:DI (zero_extend:DI
3325 (xor:SI (match_operand:SI
1 "gpc_reg_operand" "")
3326 (match_operand:SI
2 "logical_operand" "")))
3327 (match_operand:DI
3 "low_32_bit_operand" "")))]
3329 [(set (match_dup
6) (xor:SI (match_dup
1) (match_dup
2)))
3330 (set (match_dup
4) (match_dup
5))]
3332 { operands[
4] = operand_subword (operands[
0],
0,
0, DImode);
3333 operands[
5] = operand_subword (operands[
3],
0,
0, DImode);
3334 operands[
6] = operand_subword (operands[
0],
1,
0, DImode);
3338 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3339 (plus:DI (zero_extend:DI
3340 (xor:SI (match_operand:SI
1 "gpc_reg_operand" "%r")
3341 (match_operand:SI
2 "logical_operand" "rKJ")))
3342 (match_operand:DI
3 "low_32_bit_operand" "n")))]
3345 [(set_attr "length" "
8")])
3348 [(set (match_operand:DI
0 "gpc_reg_operand" "=")
3349 (plus:DI (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" ""))
3350 (match_operand:DI
2 "low_32_bit_operand" "")))]
3352 [(set (match_dup
3) (match_dup
4))
3353 (set (match_dup
5) (match_dup
1))]
3355 { operands[
3] = operand_subword (operands[
0],
0,
0, DImode);
3356 operands[
4] = operand_subword (operands[
2],
0,
0, DImode);
3357 operands[
5] = operand_subword (operands[
0],
1,
0, DImode);
3359 if (rtx_equal_p (operands[
1], operands[
5]))
3361 emit_move_insn (operands[
3], operands[
4]);
3365 if (rtx_equal_p (operands[
1], operands[
3]))
3369 temp = operands[
3]; operands[
3] = operands[
5]; operands[
5] = temp;
3370 temp = operands[
4]; operands[
4] = operands[
1]; operands[
1] = temp;
3375 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3376 (plus:DI (zero_extend:DI (match_operand:SI
1 "gpc_reg_operand" "r"))
3377 (match_operand:DI
2 "low_32_bit_operand" "n")))]
3380 [(set_attr "length" "
8")])
3382 (define_expand "fix_truncdfsi2"
3383 [(set (match_operand:SI
0 "gpc_reg_operand" "")
3384 (fix:SI (match_operand:DF
1 "gpc_reg_operand" "")))]
3388 if (TARGET_POWER2 || TARGET_POWERPC)
3390 rtx stack_slot = assign_stack_temp (DImode,
8,
0),
3391 temp = gen_reg_rtx (DImode);
3393 emit_insn (gen_fpcvtsi (temp, operands[
1]));
3394 emit_move_insn (stack_slot, temp);
3395 emit_move_insn (operands[
0],
3396 operand_subword (stack_slot,
1,
0, DImode));
3401 emit_insn (gen_trunc_call (operands[
0], operands[
1],
3402 gen_rtx (SYMBOL_REF, Pmode, RS6000_ITRUNC)));
3407 (define_insn "fpcvtsi"
3408 [(set (match_operand:DI
0 "gpc_reg_operand" "=f")
3410 (fix:SI (match_operand:DF
1 "gpc_reg_operand" "f"))))]
3411 "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT"
3412 "{fcirz|fctiwz} %
0,%
1"
3413 [(set_attr "type" "fp")])
3415 (define_expand "fixuns_truncdfsi2"
3416 [(set (match_operand:SI
0 "gpc_reg_operand" "")
3417 (unsigned_fix:SI (match_operand:DF
1 "gpc_reg_operand" "")))]
3418 "! TARGET_POWER2 && ! TARGET_POWERPC && TARGET_HARD_FLOAT"
3421 emit_insn (gen_trunc_call (operands[
0], operands[
1],
3422 gen_rtx (SYMBOL_REF, Pmode, RS6000_UITRUNC)));
3426 (define_expand "trunc_call"
3427 [(parallel [(set (match_operand:SI
0 "" "")
3428 (fix:SI (match_operand:DF
1 "" "")))
3429 (use (match_operand:SI
2 "" ""))])]
3433 rtx insns = gen_trunc_call_rtl (operands[
0], operands[
1], operands[
2]);
3434 rtx first = XVECEXP (insns,
0,
0);
3435 rtx last = XVECEXP (insns,
0, XVECLEN (insns,
0) -
1);
3437 REG_NOTES (first) = gen_rtx (INSN_LIST, REG_LIBCALL, last,
3439 REG_NOTES (last) = gen_rtx (INSN_LIST, REG_RETVAL, first, REG_NOTES (last));
3445 (define_expand "trunc_call_rtl"
3446 [(set (reg:DF
33) (match_operand:DF
1 "gpc_reg_operand" ""))
3448 (parallel [(set (reg:SI
3)
3449 (call (mem:SI (match_operand
2 "" "")) (const_int
0)))
3450 (clobber (scratch:SI))])
3451 (set (match_operand:SI
0 "gpc_reg_operand" "")
3456 rs6000_trunc_used =
1;
3459 (define_insn "floatdidf2"
3460 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
3461 (float:DF (match_operand:DI
1 "gpc_reg_operand" "f")))]
3462 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
3464 [(set_attr "type" "fp")])
3466 (define_insn "fix_truncdfdi2"
3467 [(set (match_operand:DI
0 "gpc_reg_operand" "=f")
3468 (fix:DI (match_operand:DF
1 "gpc_reg_operand" "f")))]
3469 "TARGET_POWERPC64 && TARGET_HARD_FLOAT"
3471 [(set_attr "type" "fp")])
3473 ;; Define the DImode operations that can be done in a small number
3475 (define_expand "adddi3"
3476 [(set (match_operand:DI
0 "gpc_reg_operand" "")
3477 (plus:DI (match_operand:DI
1 "gpc_reg_operand" "")
3478 (match_operand:DI
2 "reg_or_short_operand" "")))]
3482 if (! TARGET_POWER && ! TARGET_POWERPC64
3483 && short_cint_operand (operands[
2], DImode))
3488 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
3489 (plus:DI (match_operand:DI
1 "gpc_reg_operand" "%r,r")
3490 (match_operand:DI
2 "reg_or_short_operand" "r,I")))]
3491 "TARGET_POWER && ! TARGET_POWERPC64"
3493 {a|addc} %L0,%L1,%L2\;{ae|adde} %
0,%
1,%
2
3494 {ai|addic} %L0,%L1,%
2\;{a%G2e|add%G2e} %
0,%
1"
3495 [(set_attr "length" "
8")])
3498 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3499 (plus:DI (match_operand:DI
1 "gpc_reg_operand" "%r")
3500 (match_operand:DI
2 "gpc_reg_operand" "r")))]
3501 "! TARGET_POWER && ! TARGET_POWERPC64"
3502 "addc %L0,%L1,%L2\;adde %
0,%
1,%
2"
3503 [(set_attr "length" "
8")])
3505 (define_expand "subdi3"
3506 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
3507 (minus:DI (match_operand:DI
1 "reg_or_short_operand" "r,I")
3508 (match_operand:DI
2 "gpc_reg_operand" "r,r")))]
3512 if (! TARGET_POWER && ! TARGET_POWERPC64
3513 && short_cint_operand (operands[
1], DImode))
3518 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
3519 (minus:DI (match_operand:DI
1 "reg_or_short_operand" "r,I")
3520 (match_operand:DI
2 "gpc_reg_operand" "r,r")))]
3521 "TARGET_POWER && ! TARGET_POWERPC64"
3523 {sf|subfc} %L0,%L2,%L1\;{sfe|subfe} %
0,%
2,%
1
3524 {sfi|subfic} %L0,%L2,%
1\;{sf%G1e|subf%G1e} %
0,%
2"
3525 [(set_attr "length" "
8")])
3528 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3529 (minus:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3530 (match_operand:DI
2 "gpc_reg_operand" "r")))]
3531 "! TARGET_POWER && ! TARGET_POWERPC64"
3532 "subfc %L0,%L2,%L1\;subfe %
0,%
2,%
1"
3533 [(set_attr "length" "
8")])
3535 (define_expand "negdi2"
3536 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3537 (neg:DI (match_operand:DI
1 "gpc_reg_operand" "r")))]
3542 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3543 (neg:DI (match_operand:DI
1 "gpc_reg_operand" "r")))]
3544 "! TARGET_POWERPC64"
3545 "{sfi|subfic} %L0,%L1,
0\;{sfze|subfze} %
0,%
1"
3546 [(set_attr "length" "
8")])
3548 (define_expand "mulsidi3"
3549 [(set (match_operand:DI
0 "gpc_reg_operand" "")
3550 (mult:DI (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" ""))
3551 (sign_extend:DI (match_operand:SI
2 "gpc_reg_operand" ""))))]
3555 if (! TARGET_POWER && ! TARGET_POWERPC)
3557 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
3558 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
3559 emit_insn (gen_mull_call ());
3560 emit_move_insn (operand_subword (operands[
0],
0,
0, DImode),
3561 gen_rtx (REG, SImode,
3));
3562 emit_move_insn (operand_subword (operands[
0],
1,
0, DImode),
3563 gen_rtx (REG, SImode,
4));
3566 else if (TARGET_POWER)
3568 emit_insn (gen_mulsidi3_mq (operands[
0], operands[
1], operands[
2]));
3573 (define_insn "mulsidi3_mq"
3574 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3575 (mult:DI (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" "%r"))
3576 (sign_extend:DI (match_operand:SI
2 "gpc_reg_operand" "r"))))
3577 (clobber (match_scratch:SI
3 "=q"))]
3579 "mul %
0,%
1,%
2\;mfmq %L0"
3580 [(set_attr "type" "imul")
3581 (set_attr "length" "
8")])
3584 [(set (match_operand:DI
0 "gpc_reg_operand" "=&r")
3585 (mult:DI (sign_extend:DI (match_operand:SI
1 "gpc_reg_operand" "%r"))
3586 (sign_extend:DI (match_operand:SI
2 "gpc_reg_operand" "r"))))]
3587 "TARGET_POWERPC && ! TARGET_POWERPC64"
3588 "mulhw %
0,%
1,%
2\;mullw %L0,%
1,%
2"
3589 [(set_attr "type" "imul")
3590 (set_attr "length" "
8")])
3592 (define_expand "smulsi3_highpart"
3593 [(set (match_operand:SI
0 "gpc_reg_operand" "")
3595 (lshiftrt:DI (mult:DI (sign_extend:DI
3596 (match_operand:SI
1 "gpc_reg_operand" "%r"))
3598 (match_operand:SI
2 "gpc_reg_operand" "r")))
3603 if (! TARGET_POWER && ! TARGET_POWERPC)
3605 emit_move_insn (gen_rtx (REG, SImode,
3), operands[
1]);
3606 emit_move_insn (gen_rtx (REG, SImode,
4), operands[
2]);
3607 emit_insn (gen_mulh_call ());
3608 emit_move_insn (operands[
0], gen_rtx (REG, SImode,
3));
3611 else if (TARGET_POWER)
3613 emit_insn (gen_smulsi3_highpart_mq (operands[
0], operands[
1], operands[
2]));
3618 (define_insn "smulsi3_highpart_mq"
3619 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
3621 (lshiftrt:DI (mult:DI (sign_extend:DI
3622 (match_operand:SI
1 "gpc_reg_operand" "%r"))
3624 (match_operand:SI
2 "gpc_reg_operand" "r")))
3626 (clobber (match_scratch:SI
3 "=q"))]
3629 [(set_attr "type" "imul")])
3632 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
3634 (lshiftrt:DI (mult:DI (sign_extend:DI
3635 (match_operand:SI
1 "gpc_reg_operand" "%r"))
3637 (match_operand:SI
2 "gpc_reg_operand" "r")))
3641 [(set_attr "type" "imul")])
3643 (define_insn "umulsi3_highpart"
3644 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
3646 (lshiftrt:DI (mult:DI (zero_extend:DI
3647 (match_operand:SI
1 "gpc_reg_operand" "%r"))
3649 (match_operand:SI
2 "gpc_reg_operand" "r")))
3653 [(set_attr "type" "imul")])
3655 ;; If operands
0 and
2 are in the same register, we have a problem. But
3656 ;; operands
0 and
1 (the usual case) can be in the same register. That's
3657 ;; why we have the strange constraints below.
3658 (define_insn "ashldi3"
3659 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r,r,&r")
3660 (ashift:DI (match_operand:DI
1 "gpc_reg_operand" "r,r,
0,r")
3661 (match_operand:SI
2 "reg_or_cint_operand" "M,i,r,r")))
3662 (clobber (match_scratch:SI
3 "=X,q,q,q"))]
3665 {sli|slwi} %
0,%L1,%h2\;{cal %L0,
0(
0)|li %L0,
0}
3666 sl%I2q %L0,%L1,%h2\;sll%I2q %
0,%
1,%h2
3667 sl%I2q %L0,%L1,%h2\;sll%I2q %
0,%
1,%h2
3668 sl%I2q %L0,%L1,%h2\;sll%I2q %
0,%
1,%h2"
3669 [(set_attr "length" "
8")])
3671 (define_insn "lshrdi3"
3672 [(set (match_operand:DI
0 "gpc_reg_operand" "=&r,r,r,&r")
3673 (lshiftrt:DI (match_operand:DI
1 "gpc_reg_operand" "r,r,
0,r")
3674 (match_operand:SI
2 "reg_or_cint_operand" "M,i,r,r")))
3675 (clobber (match_scratch:SI
3 "=X,q,q,q"))]
3678 {cal %
0,
0(
0)|li %
0,
0}\;{s%A2i|s%A2wi} %L0,%
1,%h2
3679 sr%I2q %
0,%
1,%h2\;srl%I2q %L0,%L1,%h2
3680 sr%I2q %
0,%
1,%h2\;srl%I2q %L0,%L1,%h2
3681 sr%I2q %
0,%
1,%h2\;srl%I2q %L0,%L1,%h2"
3682 [(set_attr "length" "
8")])
3684 ;; Shift by a variable amount is too complex to be worth open-coding. We
3685 ;; just handle shifts by constants.
3687 (define_expand "ashrdi3"
3688 [(parallel [(set (match_operand:DI
0 "gpc_reg_operand" "")
3689 (ashiftrt:DI (match_operand:DI
1 "gpc_reg_operand" "")
3690 (match_operand:SI
2 "general_operand" "")))
3691 (clobber (match_scratch:SI
3 ""))])]
3694 { if (GET_CODE (operands[
2]) != CONST_INT)
3699 [(set (match_operand:DI
0 "gpc_reg_operand" "=r,r")
3700 (ashiftrt:DI (match_operand:DI
1 "gpc_reg_operand" "r,r")
3701 (match_operand:SI
2 "const_int_operand" "M,i")))
3702 (clobber (match_scratch:SI
3 "=X,q"))]
3705 {srai|srawi} %
0,%
1,
31\;{srai|srawi} %L0,%
1,%h2
3706 sraiq %
0,%
1,%h2\;srliq %L0,%L1,%h2"
3707 [(set_attr "length" "
8")])
3709 ;; PowerPC64 DImode operations.
3711 (define_insn "ffsdi2"
3712 [(set (match_operand:DI
0 "gpc_reg_operand" "=&r")
3713 (ffs:DI (match_operand:DI
1 "gpc_reg_operand" "r")))]
3715 "neg %
0,%
1\;and %
0,%
0,%
1\;cntlzd %
0,%
0\;subfic %
0,%
0,
64"
3716 [(set_attr "length" "
16")])
3718 (define_insn "muldi3"
3719 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3720 (mult:DI (match_operand:DI
1 "gpc_reg_operand" "%r")
3721 (match_operand:DI
2 "gpc_reg_operand" "r")))]
3724 [(set_attr "type" "imul")])
3726 (define_insn "smuldi3_highpart"
3727 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3729 (lshiftrt:TI (mult:TI (sign_extend:TI
3730 (match_operand:DI
1 "gpc_reg_operand" "%r"))
3732 (match_operand:DI
2 "gpc_reg_operand" "r")))
3736 [(set_attr "type" "imul")])
3738 (define_insn "umuldi3_highpart"
3739 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3741 (lshiftrt:TI (mult:TI (zero_extend:TI
3742 (match_operand:DI
1 "gpc_reg_operand" "%r"))
3744 (match_operand:DI
2 "gpc_reg_operand" "r")))
3748 [(set_attr "type" "imul")])
3750 (define_insn "divdi3"
3751 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3752 (div:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3753 (match_operand:DI
2 "gpc_reg_operand" "r")))]
3756 [(set_attr "type" "idiv")])
3758 (define_insn "udivdi3"
3759 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3760 (udiv:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3761 (match_operand:DI
2 "gpc_reg_operand" "r")))]
3764 [(set_attr "type" "idiv")])
3766 (define_insn "rotldi3"
3767 [(set (match_operand:DI
0 "gpc_reg_operand" "=r")
3768 (rotate:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3769 (match_operand:DI
2 "reg_or_cint_operand" "ri")))]
3771 "rld%I2cl %
0,%
1,%h2,
0")
3774 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
3775 (compare:CC (rotate:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3776 (match_operand:DI
2 "reg_or_cint_operand" "ri"))
3778 (clobber (match_scratch:DI
3 "=r"))]
3780 "rld%I2cl. %
3,%
1,%h2,
0"
3781 [(set_attr "type" "delayed_compare")])
3784 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
3785 (compare:CC (rotate:DI (match_operand:DI
1 "gpc_reg_operand" "r")
3786 (match_operand:DI
2 "reg_or_cint_operand" "ri"))
3788 (set (match_operand:DI
0 "gpc_reg_operand" "=r")
3789 (rotate:DI (match_dup
1) (match_dup
2)))]
3791 "rld%I2cl. %
0,%
1,%h2,
0"
3792 [(set_attr "type" "delayed_compare")])
3794 ;; Now define ways of moving data around.
3796 ;; For SI, we special-case integers that can't be loaded in one insn. We
3797 ;; do the load
16-bits at a time. We could do this by loading from memory,
3798 ;; and this is even supposed to be faster, but it is simpler not to get
3799 ;; integers in the TOC.
3800 (define_expand "movsi"
3801 [(set (match_operand:SI
0 "general_operand" "")
3802 (match_operand:SI
1 "any_operand" ""))]
3806 if (GET_CODE (operands[
0]) != REG)
3807 operands[
1] = force_reg (SImode, operands[
1]);
3809 if (CONSTANT_P (operands[
1]) && GET_CODE (operands[
1]) != CONST_INT
3810 && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[
1]))
3812 /* If we are to limit the number of things we put in the TOC and
3813 this is a symbol plus a constant we can add in one insn,
3814 just put the sumbol in the TOC and add the constant. Don't do
3815 this if reload is in progress. */
3816 if (GET_CODE (operands[
1]) == CONST
3817 && TARGET_NO_SUM_IN_TOC && ! reload_in_progress
3818 && GET_CODE (XEXP (operands[
1],
0)) == PLUS
3819 && add_operand (XEXP (XEXP (operands[
1],
0),
1), SImode)
3820 && (GET_CODE (XEXP (XEXP (operands[
1],
0),
0)) == LABEL_REF
3821 || GET_CODE (XEXP (XEXP (operands[
1],
0),
0)) == SYMBOL_REF)
3822 && ! side_effects_p (operands[
0]))
3824 rtx sym = force_const_mem (SImode, XEXP (XEXP (operands[
1],
0),
0));
3825 rtx other = XEXP (XEXP (operands[
1],
0),
1);
3827 emit_insn (gen_addsi3 (operands[
0], force_reg (SImode, sym), other));
3831 operands[
1] = force_const_mem (SImode, operands[
1]);
3832 if (! memory_address_p (SImode, XEXP (operands[
1],
0))
3833 && ! reload_in_progress)
3834 operands[
1] = change_address (operands[
1], SImode,
3835 XEXP (operands[
1],
0));
3838 if (GET_CODE (operands[
1]) == CONST_INT
3839 && (unsigned) (INTVAL (operands[
1]) +
0x8000) >=
0x10000
3840 && (INTVAL (operands[
1]) &
0xffff) !=
0)
3842 emit_move_insn (operands[
0],
3843 gen_rtx (CONST_INT, VOIDmode,
3844 INTVAL (operands[
1]) &
0xffff0000));
3845 emit_insn (gen_iorsi3 (operands[
0], operands[
0],
3846 gen_rtx (CONST_INT, VOIDmode,
3847 INTVAL (operands[
1]) &
0xffff)));
3853 [(set (match_operand:SI
0 "nonimmediate_operand" "=r,r,m,r,r,r,r,*q,*c*l,*h")
3854 (match_operand:SI
1 "input_operand" "r,m,r,I,J,R,*h,r,r,
0"))]
3855 "gpc_reg_operand (operands[
0], SImode)
3856 || gpc_reg_operand (operands[
1], SImode)"
3859 {l%U1%X1|lwz%U1%X1} %
0,%
1
3860 {st%U0%X0|stw%U0%X0} %
1,%
0
3868 [(set_attr "type" "*,load,*,*,*,*,*,*,mtjmpr,*")])
3870 ;; Split a load of a large constant into the appropriate two-insn
3874 [(set (match_operand:SI
0 "gpc_reg_operand" "")
3875 (match_operand:SI
1 "const_int_operand" ""))]
3876 "(unsigned) (INTVAL (operands[
1]) +
0x8000) >=
0x10000
3877 && (INTVAL (operands[
1]) &
0xffff) !=
0"
3881 (ior:SI (match_dup
0)
3885 operands[
2] = gen_rtx (CONST_INT, VOIDmode,
3886 INTVAL (operands[
1]) &
0xffff0000);
3887 operands[
3] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[
1]) &
0xffff);
3891 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
3892 (compare:CC (match_operand:SI
1 "gpc_reg_operand" "r")
3894 (set (match_operand:SI
0 "gpc_reg_operand" "=r") (match_dup
1))]
3897 [(set_attr "type" "compare")])
3899 (define_expand "movhi"
3900 [(set (match_operand:HI
0 "general_operand" "")
3901 (match_operand:HI
1 "any_operand" ""))]
3905 if (GET_CODE (operands[
0]) != REG)
3906 operands[
1] = force_reg (HImode, operands[
1]);
3908 if (CONSTANT_P (operands[
1]) && GET_CODE (operands[
1]) != CONST_INT)
3910 operands[
1] = force_const_mem (HImode, operands[
1]);
3911 if (! memory_address_p (HImode, XEXP (operands[
1],
0))
3912 && ! reload_in_progress)
3913 operands[
1] = change_address (operands[
1], HImode,
3914 XEXP (operands[
1],
0));
3919 [(set (match_operand:HI
0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
3920 (match_operand:HI
1 "input_operand" "r,m,r,i,*h,r,r,
0"))]
3921 "gpc_reg_operand (operands[
0], HImode)
3922 || gpc_reg_operand (operands[
1], HImode)"
3932 [(set_attr "type" "*,load,*,*,*,*,mtjmpr,*")])
3934 (define_expand "movqi"
3935 [(set (match_operand:QI
0 "general_operand" "")
3936 (match_operand:QI
1 "any_operand" ""))]
3940 if (GET_CODE (operands[
0]) != REG)
3941 operands[
1] = force_reg (QImode, operands[
1]);
3943 if (CONSTANT_P (operands[
1]) && GET_CODE (operands[
1]) != CONST_INT)
3945 operands[
1] = force_const_mem (QImode, operands[
1]);
3946 if (! memory_address_p (QImode, XEXP (operands[
1],
0))
3947 && ! reload_in_progress)
3948 operands[
1] = change_address (operands[
1], QImode,
3949 XEXP (operands[
1],
0));
3954 [(set (match_operand:QI
0 "nonimmediate_operand" "=r,r,m,r,r,*q,*c*l,*h")
3955 (match_operand:QI
1 "input_operand" "r,m,r,i,*h,r,r,
0"))]
3956 "gpc_reg_operand (operands[
0], QImode)
3957 || gpc_reg_operand (operands[
1], QImode)"
3967 [(set_attr "type" "*,load,*,*,*,*,mtjmpr,*")])
3969 ;; Here is how to move condition codes around. When we store CC data in
3970 ;; an integer register or memory, we store just the high-order
4 bits.
3971 ;; This lets us not shift in the most common case of CR0.
3972 (define_expand "movcc"
3973 [(set (match_operand:CC
0 "nonimmediate_operand" "")
3974 (match_operand:CC
1 "nonimmediate_operand" ""))]
3979 [(set (match_operand:CC
0 "nonimmediate_operand" "=y,x,y,r,r,r,r,m")
3980 (match_operand:CC
1 "nonimmediate_operand" "y,r,r,x,y,r,m,r"))]
3981 "register_operand (operands[
0], CCmode)
3982 || register_operand (operands[
1], CCmode)"
3986 {rlinm|rlwinm} %
1,%
1,%F0,
0xffffffff\;mtcrf %R0,%
1\;{rlinm|rlwinm} %
1,%
1,%f0,
0xffffffff
3988 mfcr %
0\;{rlinm|rlwinm} %
0,%
0,%f1,
0xf0000000
3990 {l%U1%X1|lwz%U1%X1} %
0,%
1
3991 {st%U0%U1|stw%U0%U1} %
1,%
0"
3992 [(set_attr "type" "*,*,*,compare,*,*,load,*")
3993 (set_attr "length" "*,*,
12,*,
8,*,*,*")])
3995 ;; For floating-point, we normally deal with the floating-point registers
3996 ;; unless -msoft-float is used. The sole exception is that parameter passing
3997 ;; can produce floating-point values in fixed-point registers. Unless the
3998 ;; value is a simple constant or already in memory, we deal with this by
3999 ;; allocating memory and copying the value explicitly via that memory location.
4000 (define_expand "movsf"
4001 [(set (match_operand:SF
0 "nonimmediate_operand" "")
4002 (match_operand:SF
1 "any_operand" ""))]
4006 /* If we are called from reload, we might be getting a SUBREG of a hard
4007 reg. So expand it. */
4008 if (GET_CODE (operands[
0]) == SUBREG
4009 && GET_CODE (SUBREG_REG (operands[
0])) == REG
4010 && REGNO (SUBREG_REG (operands[
0])) < FIRST_PSEUDO_REGISTER)
4011 operands[
0] = alter_subreg (operands[
0]);
4012 if (GET_CODE (operands[
1]) == SUBREG
4013 && GET_CODE (SUBREG_REG (operands[
1])) == REG
4014 && REGNO (SUBREG_REG (operands[
1])) < FIRST_PSEUDO_REGISTER)
4015 operands[
1] = alter_subreg (operands[
1]);
4017 if (TARGET_SOFT_FLOAT && GET_CODE (operands[
0]) == MEM)
4018 operands[
1] = force_reg (SFmode, operands[
1]);
4020 else if (TARGET_HARD_FLOAT)
4022 if (GET_CODE (operands[
1]) == REG && REGNO (operands[
1]) <
32)
4024 /* If this is a store to memory or another integer register do the
4025 move directly. Otherwise store to a temporary stack slot and
4026 load from there into a floating point register. */
4028 if (GET_CODE (operands[
0]) == MEM
4029 || (GET_CODE (operands[
0]) == REG
4030 && (REGNO (operands[
0]) <
32
4031 || (reload_in_progress
4032 && REGNO (operands[
0]) >= FIRST_PSEUDO_REGISTER))))
4034 emit_move_insn (operand_subword (operands[
0],
0,
0, SFmode),
4035 operand_subword (operands[
1],
0,
0, SFmode));
4040 rtx stack_slot = assign_stack_temp (SFmode,
4,
0);
4042 emit_move_insn (stack_slot, operands[
1]);
4043 emit_move_insn (operands[
0], stack_slot);
4048 if (GET_CODE (operands[
0]) == MEM)
4050 /* If operands[
1] is a register, it may have double-precision data
4051 in it, so truncate it to single precision. We need not do
4052 this for POWERPC. */
4053 if (! TARGET_POWERPC && GET_CODE (operands[
1]) == REG)
4055 rtx newreg = reload_in_progress ? operands[
1] : gen_reg_rtx (SFmode);
4056 emit_insn (gen_truncdfsf2 (newreg,
4057 gen_rtx (SUBREG, DFmode, operands[
1],
0)));
4058 operands[
1] = newreg;
4061 operands[
1] = force_reg (SFmode, operands[
1]);
4064 if (GET_CODE (operands[
0]) == REG && REGNO (operands[
0]) <
32)
4066 if (GET_CODE (operands[
1]) == MEM
4067 #if HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT && ! defined(REAL_IS_NOT_DOUBLE)
4068 || GET_CODE (operands[
1]) == CONST_DOUBLE
4070 || (GET_CODE (operands[
1]) == REG
4071 && (REGNO (operands[
1]) <
32
4072 || (reload_in_progress
4073 && REGNO (operands[
1]) >= FIRST_PSEUDO_REGISTER))))
4075 emit_move_insn (operand_subword (operands[
0],
0,
0, SFmode),
4076 operand_subword (operands[
1],
0,
0, SFmode));
4081 rtx stack_slot = assign_stack_temp (SFmode,
4,
0);
4083 emit_move_insn (stack_slot, operands[
1]);
4084 emit_move_insn (operands[
0], stack_slot);
4090 if (CONSTANT_P (operands[
1]))
4092 operands[
1] = force_const_mem (SFmode, operands[
1]);
4093 if (! memory_address_p (SFmode, XEXP (operands[
1],
0))
4094 && ! reload_in_progress)
4095 operands[
1] = change_address (operands[
1], SFmode,
4096 XEXP (operands[
1],
0));
4101 [(set (match_operand:SF
0 "gpc_reg_operand" "")
4102 (match_operand:SF
1 "easy_fp_constant" ""))]
4103 "reload_completed && REGNO (operands[
0]) <=
31"
4104 [(set (match_dup
2) (match_dup
3))]
4106 { operands[
2] = operand_subword (operands[
0],
0,
0, SFmode);
4107 operands[
3] = operand_subword (operands[
1],
0,
0, SFmode); }")
4110 [(set (match_operand:SF
0 "fp_reg_or_mem_operand" "=f,f,m")
4111 (match_operand:SF
1 "input_operand" "f,m,f"))]
4112 "(gpc_reg_operand (operands[
0], SFmode)
4113 || gpc_reg_operand (operands[
1], SFmode)) && TARGET_HARD_FLOAT"
4118 [(set_attr "type" "fp,fpload,*")])
4121 [(set (match_operand:SF
0 "nonimmediate_operand" "=r,r,m,r,r,r")
4122 (match_operand:SF
1 "input_operand" "r,m,r,I,J,R"))]
4123 "(gpc_reg_operand (operands[
0], SFmode)
4124 || gpc_reg_operand (operands[
1], SFmode)) && TARGET_SOFT_FLOAT"
4127 {l%U1%X1|lwz%U1%X1} %
0,%
1
4128 {st%U0%X0|stw%U0%X0} %
1,%
0
4132 [(set_attr "type" "*,load,*,*,*,*")])
4135 (define_expand "movdf"
4136 [(set (match_operand:DF
0 "nonimmediate_operand" "")
4137 (match_operand:DF
1 "any_operand" ""))]
4141 if (GET_CODE (operands[
0]) == MEM && GET_CODE (operands[
1]) == MEM)
4143 emit_move_insn (operand_subword (operands[
0],
1,
1, DFmode),
4144 operand_subword_force (operands[
1],
1, DFmode));
4145 emit_move_insn (operand_subword (operands[
0],
0,
1, DFmode),
4146 operand_subword_force (operands[
1],
0, DFmode));
4150 if (GET_CODE (operands[
0]) != REG)
4151 operands[
1] = force_reg (DFmode, operands[
1]);
4153 if (CONSTANT_P (operands[
1]) && ! easy_fp_constant (operands[
1], DFmode))
4155 operands[
1] = force_const_mem (DFmode, operands[
1]);
4156 if (! memory_address_p (DFmode, XEXP (operands[
1],
0))
4157 && ! reload_in_progress)
4158 operands[
1] = change_address (operands[
1], DFmode,
4159 XEXP (operands[
1],
0));
4164 [(set (match_operand:DF
0 "gpc_reg_operand" "")
4165 (match_operand:DF
1 "easy_fp_constant" ""))]
4166 "reload_completed && REGNO (operands[
0]) <=
31"
4167 [(set (match_dup
2) (match_dup
3))
4168 (set (match_dup
4) (match_dup
5))]
4170 { operands[
2] = operand_subword (operands[
0],
0,
0, DFmode);
4171 operands[
3] = operand_subword (operands[
1],
0,
0, DFmode);
4172 operands[
4] = operand_subword (operands[
0],
1,
0, DFmode);
4173 operands[
5] = operand_subword (operands[
1],
1,
0, DFmode); }")
4175 ;; Don't have reload use general registers to load a constant. First,
4176 ;; it might not work if the output operand has is the equivalent of
4177 ;; a non-offsettable memref, but also it is less efficient than loading
4178 ;; the constant into an FP register, since it will probably be used there.
4179 ;; The "??" is a kludge until we can figure out a more reasonable way
4180 ;; of handling these non-offsettable values.
4182 [(set (match_operand:DF
0 "nonimmediate_operand" "=!r,??r,o,!r,f,f,m")
4183 (match_operand:DF
1 "input_operand" "r,o,r,G,f,m,f"))]
4184 "! TARGET_POWERPC64 && TARGET_HARD_FLOAT
4185 && (register_operand (operands[
0], DFmode)
4186 || register_operand (operands[
1], DFmode))"
4189 switch (which_alternative)
4192 /* We normally copy the low-numbered register first. However, if
4193 the first register operand
0 is the same as the second register of
4194 operand
1, we must copy in the opposite order. */
4195 if (REGNO (operands[
0]) == REGNO (operands[
1]) +
1)
4196 return
\"mr %L0,%L1\;mr %
0,%
1\";
4198 return
\"mr %
0,%
1\;mr %L0,%L1
\";
4200 /* If the low-address word is used in the address, we must load it
4201 last. Otherwise, load it first. Note that we cannot have
4202 auto-increment in that case since the address register is known to be
4204 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4206 return
\"{l|lwz} %L0,%L1\;{l|lwz} %
0,%
1\";
4208 return
\"{l%U1|lwz%U1} %
0,%
1\;{l|lwz} %L0,%L1
\";
4210 return
\"{st%U0|stw%U0} %
1,%
0\;{st|stw} %L1,%L0
\";
4214 return
\"fmr %
0,%
1\";
4216 return
\"lfd%U1%X1 %
0,%
1\";
4218 return
\"stfd%U0%X0 %
1,%
0\";
4221 [(set_attr "type" "*,load,*,*,fp,fpload,*")
4222 (set_attr "length" "
8,
8,
8,
8,*,*,*")])
4225 [(set (match_operand:DF
0 "nonimmediate_operand" "=r,r,o,r")
4226 (match_operand:DF
1 "input_operand" "r,o,r,G"))]
4227 "! TARGET_POWERPC64 && TARGET_SOFT_FLOAT
4228 && (register_operand (operands[
0], DFmode)
4229 || register_operand (operands[
1], DFmode))"
4232 switch (which_alternative)
4235 /* We normally copy the low-numbered register first. However, if
4236 the first register operand
0 is the same as the second register of
4237 operand
1, we must copy in the opposite order. */
4238 if (REGNO (operands[
0]) == REGNO (operands[
1]) +
1)
4239 return
\"mr %L0,%L1\;mr %
0,%
1\";
4241 return
\"mr %
0,%
1\;mr %L0,%L1
\";
4243 /* If the low-address word is used in the address, we must load it
4244 last. Otherwise, load it first. Note that we cannot have
4245 auto-increment in that case since the address register is known to be
4247 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4249 return
\"{l|lwz} %L0,%L1\;{l|lwz} %
0,%
1\";
4251 return
\"{l%U1|lwz%U1} %
0,%
1\;{l|lwz} %L0,%L1
\";
4253 return
\"{st%U0|stw%U0} %
1,%
0\;{st|stw} %L1,%L0
\";
4258 [(set_attr "type" "*,load,*,*")
4259 (set_attr "length" "
8,
8,
8,
8")])
4262 [(set (match_operand:DF
0 "nonimmediate_operand" "=!r,??r,o,!r,f,f,m")
4263 (match_operand:DF
1 "input_operand" "r,o,r,G,f,m,f"))]
4264 "TARGET_POWERPC64 && TARGET_HARD_FLOAT
4265 && (register_operand (operands[
0], DFmode)
4266 || register_operand (operands[
1], DFmode))"
4275 [(set_attr "type" "*,load,*,*,fp,fpload,*")])
4278 [(set (match_operand:DF
0 "nonimmediate_operand" "=r,r,o,r")
4279 (match_operand:DF
1 "input_operand" "r,o,r,G"))]
4280 "TARGET_POWERPC64 && TARGET_SOFT_FLOAT
4281 && (register_operand (operands[
0], DFmode)
4282 || register_operand (operands[
1], DFmode))"
4288 [(set_attr "type" "*,load,*,*")])
4290 ;; Next come the multi-word integer load and store and the load and store
4292 (define_expand "movdi"
4293 [(set (match_operand:DI
0 "general_operand" "")
4294 (match_operand:DI
1 "general_operand" ""))]
4298 if (GET_CODE (operands[
1]) == CONST_DOUBLE
4299 || GET_CODE (operands[
1]) == CONST_INT)
4301 emit_move_insn (operand_subword (operands[
0],
0,
0, DImode),
4302 operand_subword (operands[
1],
0,
0, DImode));
4303 emit_move_insn (operand_subword (operands[
0],
1,
0, DImode),
4304 operand_subword (operands[
1],
1,
0, DImode));
4308 if (GET_CODE (operands[
0]) == MEM)
4309 operands[
1] = force_reg (DImode, operands[
1]);
4311 /* Stores between FPR and any non-FPR registers must go through a
4312 temporary stack slot. */
4314 if (GET_CODE (operands[
0]) == REG && GET_CODE (operands[
1]) == REG
4315 && ((FP_REGNO_P (REGNO (operands[
0]))
4316 && ! FP_REGNO_P (REGNO (operands[
1])))
4317 || (FP_REGNO_P (REGNO (operands[
1]))
4318 && ! FP_REGNO_P (REGNO (operands[
0])))))
4320 rtx stack_slot = assign_stack_temp (DImode,
8,
0);
4322 emit_move_insn (stack_slot, operands[
1]);
4323 emit_move_insn (operands[
0], stack_slot);
4329 [(set (match_operand:DI
0 "nonimmediate_operand" "=r,r,m,f,f,m")
4330 (match_operand:DI
1 "input_operand" "r,m,r,f,m,f"))]
4331 "! TARGET_POWERPC64 && (gpc_reg_operand (operands[
0], DImode)
4332 || gpc_reg_operand (operands[
1], DImode))"
4335 switch (which_alternative)
4338 /* We normally copy the low-numbered register first. However, if
4339 the first register operand
0 is the same as the second register of
4340 operand
1, we must copy in the opposite order. */
4341 if (REGNO (operands[
0]) == REGNO (operands[
1]) +
1)
4342 return
\"mr %L0,%L1\;mr %
0,%
1\";
4344 return
\"mr %
0,%
1\;mr %L0,%L1
\";
4346 /* If the low-address word is used in the address, we must load it
4347 last. Otherwise, load it first. Note that we cannot have
4348 auto-increment in that case since the address register is known to be
4350 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4352 return
\"{l|lwz} %L0,%L1\;{l|lwz} %
0,%
1\";
4354 return
\"{l%U1|lwz%U1} %
0,%
1\;{l|lwz} %L0,%L1
\";
4356 return
\"{st%U0|stw%U0} %
1,%
0\;{st|stw} %L1,%L0
\";
4358 return
\"fmr %
0,%
1\";
4360 return
\"lfd%U1%X1 %
0,%
1\";
4362 return
\"stfd%U0%X0 %
1,%
0\";
4365 [(set_attr "type" "*,load,*,fp,fpload,*")
4366 (set_attr "length" "
8,
8,
8,*,*,*")])
4369 [(set (match_operand:DI
0 "nonimmediate_operand" "=r,r,m,r,r,r,f,f,m,r,*h")
4370 (match_operand:DI
1 "input_operand" "r,m,r,I,J,R,f,m,f,*h,r"))]
4371 "TARGET_POWERPC64 && (gpc_reg_operand (operands[
0], DImode)
4372 || gpc_reg_operand (operands[
1], DImode))"
4385 [(set_attr "type" "*,load,*,*,*,*,fp,fpload,*,*,mtjmpr")])
4387 ;; TImode is similar, except that we usually want to compute the address into
4388 ;; a register and use lsi/stsi (the exception is during reload). MQ is also
4389 ;; clobbered in stsi for POWER, so we need a SCRATCH for it.
4390 (define_expand "movti"
4391 [(parallel [(set (match_operand:TI
0 "general_operand" "")
4392 (match_operand:TI
1 "general_operand" ""))
4393 (clobber (scratch:SI))])]
4394 "TARGET_MULTIPLE || TARGET_POWERPC64"
4397 if (GET_CODE (operands[
0]) == MEM)
4398 operands[
1] = force_reg (TImode, operands[
1]);
4400 if (GET_CODE (operands[
0]) == MEM
4401 && GET_CODE (XEXP (operands[
0],
0)) != REG
4402 && ! reload_in_progress)
4403 operands[
0] = change_address (operands[
0], TImode,
4404 copy_addr_to_reg (XEXP (operands[
0],
0)));
4406 if (GET_CODE (operands[
1]) == MEM
4407 && GET_CODE (XEXP (operands[
1],
0)) != REG
4408 && ! reload_in_progress)
4409 operands[
1] = change_address (operands[
1], TImode,
4410 copy_addr_to_reg (XEXP (operands[
1],
0)));
4413 ;; We say that MQ is clobbered in the last alternative because the first
4414 ;; alternative would never get used otherwise since it would need a reload
4415 ;; while the
2nd alternative would not. We put memory cases first so they
4416 ;; are preferred. Otherwise, we'd try to reload the output instead of
4417 ;; giving the SCRATCH mq.
4419 [(set (match_operand:TI
0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
4420 (match_operand:TI
1 "reg_or_mem_operand" "r,r,r,Q,m"))
4421 (clobber (match_scratch:SI
2 "=q,q#X,X,X,X"))]
4422 "TARGET_MULTIPLE && TARGET_POWER && ! TARGET_POWERPC64
4423 && (gpc_reg_operand (operands[
0], TImode) || gpc_reg_operand (operands[
1], TImode))"
4426 switch (which_alternative)
4432 return
\"{stsi|stswi} %
1,%P0,
16\";
4435 return
\"{st%U0|stw%U0} %
1,%
0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0
\";
4438 /* Normally copy registers with lowest numbered register copied first.
4439 But copy in the other order if the first register of the output
4440 is the second, third, or fourth register in the input. */
4441 if (REGNO (operands[
0]) >= REGNO (operands[
1]) +
1
4442 && REGNO (operands[
0]) <= REGNO (operands[
1]) +
3)
4443 return
\"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %
0,%
1\";
4445 return
\"mr %
0,%
1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1
\";
4447 /* If the address is not used in the output, we can use lsi. Otherwise,
4448 fall through to generating four loads. */
4449 if (! reg_overlap_mentioned_p (operands[
0], operands[
1]))
4450 return
\"{lsi|lswi} %
0,%P1,
16\";
4451 /* ... fall through ... */
4453 /* If the address register is the same as the register for the lowest-
4454 addressed word, load it last. Similarly for the next two words.
4455 Otherwise load lowest address to highest. */
4456 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4458 return
\"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %
0,%
1\";
4459 else if (refers_to_regno_p (REGNO (operands[
0]) +
1,
4460 REGNO (operands[
0]) +
2, operands[
1],
0))
4461 return
\"{l|lwz} %
0,%
1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1
\";
4462 else if (refers_to_regno_p (REGNO (operands[
0]) +
2,
4463 REGNO (operands[
0]) +
3, operands[
1],
0))
4464 return
\"{l|lwz} %
0,%
1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1
\";
4466 return
\"{l%U1|lwz%U1} %
0,%
1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1
\";
4469 [(set_attr "type" "*,load,load,*,*")
4470 (set_attr "length" "*,
16,
16,*,
16")])
4473 [(set (match_operand:TI
0 "reg_or_mem_operand" "=m,????r,????r")
4474 (match_operand:TI
1 "reg_or_mem_operand" "r,r,m"))
4475 (clobber (match_scratch:SI
2 "=X,X,X"))]
4476 "TARGET_MULTIPLE && !TARGET_POWER && ! TARGET_POWERPC64
4477 && (gpc_reg_operand (operands[
0], TImode) || gpc_reg_operand (operands[
1], TImode))"
4480 switch (which_alternative)
4486 return
\"{st%U0|stw%U0} %
1,%
0\;{st|stw} %L1,%L0\;{st|stw} %Y1,%Y0\;{st|stw} %Z1,%Z0
\";
4489 /* Normally copy registers with lowest numbered register copied first.
4490 But copy in the other order if the first register of the output
4491 is the second, third, or fourth register in the input. */
4492 if (REGNO (operands[
0]) >= REGNO (operands[
1]) +
1
4493 && REGNO (operands[
0]) <= REGNO (operands[
1]) +
3)
4494 return
\"mr %Z0,%Z1\;mr %Y0,%Y1\;mr %L0,%L1\;mr %
0,%
1\";
4496 return
\"mr %
0,%
1\;mr %L0,%L1\;mr %Y0,%Y1\;mr %Z0,%Z1
\";
4498 /* If the address register is the same as the register for the lowest-
4499 addressed word, load it last. Similarly for the next two words.
4500 Otherwise load lowest address to highest. */
4501 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4503 return
\"{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %
0,%
1\";
4504 else if (refers_to_regno_p (REGNO (operands[
0]) +
1,
4505 REGNO (operands[
0]) +
2, operands[
1],
0))
4506 return
\"{l|lwz} %
0,%
1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1\;{l|lwz} %L0,%L1
\";
4507 else if (refers_to_regno_p (REGNO (operands[
0]) +
2,
4508 REGNO (operands[
0]) +
3, operands[
1],
0))
4509 return
\"{l|lwz} %
0,%
1\;{l|lwz} %L0,%L1\;{l|lwz} %Z0,%Z1\;{l|lwz} %Y0,%Y1
\";
4511 return
\"{l%U1|lwz%U1} %
0,%
1\;{l|lwz} %L0,%L1\;{l|lwz} %Y0,%Y1\;{l|lwz} %Z0,%Z1
\";
4514 [(set_attr "type" "load,*,*")
4515 (set_attr "length" "
16,
16,
16")])
4518 [(set (match_operand:TI
0 "nonimmediate_operand" "=r,r,m")
4519 (match_operand:TI
1 "input_operand" "r,m,r"))]
4520 "TARGET_POWERPC64 && (gpc_reg_operand (operands[
0], TImode)
4521 || gpc_reg_operand (operands[
1], TImode))"
4524 switch (which_alternative)
4527 /* We normally copy the low-numbered register first. However, if
4528 the first register operand
0 is the same as the second register of
4529 operand
1, we must copy in the opposite order. */
4530 if (REGNO (operands[
0]) == REGNO (operands[
1]) +
1)
4531 return
\"mr %L0,%L1\;mr %
0,%
1\";
4533 return
\"mr %
0,%
1\;mr %L0,%L1
\";
4535 /* If the low-address word is used in the address, we must load it
4536 last. Otherwise, load it first. Note that we cannot have
4537 auto-increment in that case since the address register is known to be
4539 if (refers_to_regno_p (REGNO (operands[
0]), REGNO (operands[
0]) +
1,
4541 return
\"ld %L0,%L1\;ld %
0,%
1\";
4543 return
\"ld%U1 %
0,%
1\;ld %L0,%L1
\";
4545 return
\"std%U0 %
1,%
0\;std %L1,%L0
\";
4548 [(set_attr "type" "*,load,*")
4549 (set_attr "length" "
8,
8,
8")])
4551 (define_expand "load_multiple"
4552 [(match_par_dup
3 [(set (match_operand:SI
0 "" "")
4553 (match_operand:SI
1 "" ""))
4554 (use (match_operand:SI
2 "" ""))])]
4563 /* Support only loading a constant number of fixed-point registers from
4564 memory and only bother with this if more than two; the machine
4565 doesn't support more than eight. */
4566 if (GET_CODE (operands[
2]) != CONST_INT
4567 || INTVAL (operands[
2]) <=
2
4568 || INTVAL (operands[
2]) >
8
4569 || GET_CODE (operands[
1]) != MEM
4570 || GET_CODE (operands[
0]) != REG
4571 || REGNO (operands[
0]) >=
32)
4574 count = INTVAL (operands[
2]);
4575 regno = REGNO (operands[
0]);
4577 operands[
3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count));
4578 from = force_reg (SImode, XEXP (operands[
1],
0));
4580 for (i =
0; i < count; i++)
4581 XVECEXP (operands[
3],
0, i)
4582 = gen_rtx (SET, VOIDmode, gen_rtx (REG, SImode, regno + i),
4583 gen_rtx (MEM, SImode, plus_constant (from, i *
4)));
4587 [(match_parallel
0 "load_multiple_operation"
4588 [(set (match_operand:SI
1 "gpc_reg_operand" "=r")
4589 (match_operand:SI
2 "indirect_operand" "Q"))])]
4593 /* We have to handle the case where the pseudo used to contain the address
4594 is assigned to one of the output registers. In that case, do the
4595 lsi, but then load the correct value. This is a bit of a mess, but is
4597 We set the length attribute to the maximum possible size (
8 bytes). */
4598 static char result[
100];
4602 strcpy (result,
\"{lsi|lswi} %
1,%P2,%N0
\");
4603 for (i =
0; i < XVECLEN (operands[
0],
0); i++)
4604 if (refers_to_regno_p (REGNO (operands[
1]) + i,
4605 REGNO (operands[
1]) + i +
1, operands[
2],
0))
4607 sprintf (newload,
\"\;{l|lwz} %d,%d(%d)
\",
4608 REGNO (operands[
1]) + i,
4609 i *
4, REGNO (XEXP (operands[
2],
0)));
4610 strcat (result, newload);
4615 [(set_attr "type" "load")
4616 (set_attr "length" "
8")])
4619 (define_expand "store_multiple"
4620 [(match_par_dup
3 [(set (match_operand:SI
0 "" "")
4621 (match_operand:SI
1 "" ""))
4622 (clobber (scratch:SI))
4623 (use (match_operand:SI
2 "" ""))])]
4632 /* Support only storing a constant number of fixed-point registers to
4633 memory and only bother with this if more than two; the machine
4634 doesn't support more than eight. */
4635 if (GET_CODE (operands[
2]) != CONST_INT
4636 || INTVAL (operands[
2]) <=
2
4637 || INTVAL (operands[
2]) >
8
4638 || GET_CODE (operands[
0]) != MEM
4639 || GET_CODE (operands[
1]) != REG
4640 || REGNO (operands[
1]) >=
32)
4643 count = INTVAL (operands[
2]);
4644 regno = REGNO (operands[
1]);
4646 operands[
3] = gen_rtx (PARALLEL, VOIDmode, rtvec_alloc (count +
1));
4647 to = force_reg (SImode, XEXP (operands[
0],
0));
4649 XVECEXP (operands[
3],
0,
0)
4650 = gen_rtx (SET, VOIDmode, gen_rtx (MEM, SImode, to), operands[
1]);
4651 XVECEXP (operands[
3],
0,
1) = gen_rtx (CLOBBER, VOIDmode,
4652 gen_rtx (SCRATCH, SImode));
4654 for (i =
1; i < count; i++)
4655 XVECEXP (operands[
3],
0, i +
1)
4656 = gen_rtx (SET, VOIDmode,
4657 gen_rtx (MEM, SImode, plus_constant (to, i *
4)),
4658 gen_rtx (REG, SImode, regno + i));
4662 [(match_parallel
0 "store_multiple_operation"
4663 [(set (match_operand:SI
1 "indirect_operand" "=Q")
4664 (match_operand:SI
2 "gpc_reg_operand" "r"))
4665 (clobber (match_scratch:SI
3 "=q"))])]
4666 "TARGET_MULTIPLE && TARGET_POWER"
4667 "{stsi|stswi} %
2,%P1,%O0")
4670 [(match_parallel
0 "store_multiple_operation"
4671 [(set (match_operand:SI
1 "indirect_operand" "=Q")
4672 (match_operand:SI
2 "gpc_reg_operand" "r"))
4673 (clobber (match_scratch:SI
3 "X"))])]
4674 "TARGET_MULTIPLE && !TARGET_POWER"
4675 "{stsi|stswi} %
2,%P1,%O0")
4677 ;; Define insns that do load or store with update. Some of these we can
4678 ;; get by using pre-decrement or pre-increment, but the hardware can also
4679 ;; do cases where the increment is not the size of the object.
4681 ;; In all these cases, we use operands
0 and
1 for the register being
4682 ;; incremented because those are the operands that local-alloc will
4683 ;; tie and these are the pair most likely to be tieable (and the ones
4684 ;; that will benefit the most).
4687 [(set (match_operand:DI
3 "gpc_reg_operand" "=r,r")
4688 (mem:DI (plus:DI (match_operand:DI
1 "gpc_reg_operand" "
0,
0")
4689 (match_operand:DI
2 "reg_or_short_operand" "r,I"))))
4690 (set (match_operand:DI
0 "gpc_reg_operand" "=b,b")
4691 (plus:DI (match_dup
1) (match_dup
2)))]
4696 [(set_attr "type" "load")])
4699 [(set (match_operand:DI
3 "gpc_reg_operand" "=r")
4701 (mem:SI (plus:DI (match_operand:DI
1 "gpc_reg_operand" "
0")
4702 (match_operand:DI
2 "gpc_reg_operand" "r")))))
4703 (set (match_operand:DI
0 "gpc_reg_operand" "=b")
4704 (plus:DI (match_dup
1) (match_dup
2)))]
4707 [(set_attr "type" "load")])
4710 [(set (mem:DI (plus:DI (match_operand:DI
1 "gpc_reg_operand" "
0,
0")
4711 (match_operand:DI
2 "reg_or_short_operand" "r,I")))
4712 (match_operand:DI
3 "gpc_reg_operand" "r,r"))
4713 (set (match_operand:DI
0 "gpc_reg_operand" "=b,b")
4714 (plus:DI (match_dup
1) (match_dup
2)))]
4721 [(set (match_operand:SI
3 "gpc_reg_operand" "=r,r")
4722 (mem:SI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4723 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))
4724 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4725 (plus:SI (match_dup
1) (match_dup
2)))]
4728 {lux|lwzux} %
3,%
0,%
2
4729 {lu|lwzu} %
3,%
2(%
0)"
4730 [(set_attr "type" "load")])
4733 [(set (mem:SI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4734 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
4735 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
4736 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4737 (plus:SI (match_dup
1) (match_dup
2)))]
4740 {stux|stwux} %
3,%
0,%
2
4741 {stu|stwu} %
3,%
2(%
0)")
4744 [(set (match_operand:HI
3 "gpc_reg_operand" "=r,r")
4745 (mem:HI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4746 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))
4747 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4748 (plus:SI (match_dup
1) (match_dup
2)))]
4753 [(set_attr "type" "load")])
4756 [(set (match_operand:SI
3 "gpc_reg_operand" "=r,r")
4758 (mem:HI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4759 (match_operand:SI
2 "reg_or_short_operand" "r,I")))))
4760 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4761 (plus:SI (match_dup
1) (match_dup
2)))]
4766 [(set_attr "type" "load")])
4769 [(set (match_operand:SI
3 "gpc_reg_operand" "=r,r")
4771 (mem:HI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4772 (match_operand:SI
2 "reg_or_short_operand" "r,I")))))
4773 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4774 (plus:SI (match_dup
1) (match_dup
2)))]
4779 [(set_attr "type" "load")])
4782 [(set (mem:HI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4783 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
4784 (match_operand:HI
3 "gpc_reg_operand" "r,r"))
4785 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4786 (plus:SI (match_dup
1) (match_dup
2)))]
4793 [(set (match_operand:QI
3 "gpc_reg_operand" "=r,r")
4794 (mem:QI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4795 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))
4796 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4797 (plus:SI (match_dup
1) (match_dup
2)))]
4802 [(set_attr "type" "load")])
4805 [(set (match_operand:SI
3 "gpc_reg_operand" "=r,r")
4807 (mem:QI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4808 (match_operand:SI
2 "reg_or_short_operand" "r,I")))))
4809 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4810 (plus:SI (match_dup
1) (match_dup
2)))]
4815 [(set_attr "type" "load")])
4818 [(set (mem:QI (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4819 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
4820 (match_operand:QI
3 "gpc_reg_operand" "r,r"))
4821 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4822 (plus:SI (match_dup
1) (match_dup
2)))]
4829 [(set (match_operand:SF
3 "gpc_reg_operand" "=f,f")
4830 (mem:SF (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4831 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))
4832 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4833 (plus:SI (match_dup
1) (match_dup
2)))]
4838 [(set_attr "type" "fpload")])
4841 [(set (mem:SF (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4842 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
4843 (match_operand:SF
3 "gpc_reg_operand" "f,f"))
4844 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4845 (plus:SI (match_dup
1) (match_dup
2)))]
4852 [(set (match_operand:DF
3 "gpc_reg_operand" "=f,f")
4853 (mem:DF (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4854 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))
4855 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4856 (plus:SI (match_dup
1) (match_dup
2)))]
4861 [(set_attr "type" "fpload")])
4864 [(set (mem:DF (plus:SI (match_operand:SI
1 "gpc_reg_operand" "
0,
0")
4865 (match_operand:SI
2 "reg_or_short_operand" "r,I")))
4866 (match_operand:DF
3 "gpc_reg_operand" "f,f"))
4867 (set (match_operand:SI
0 "gpc_reg_operand" "=b,b")
4868 (plus:SI (match_dup
1) (match_dup
2)))]
4874 ;; Peephole to convert two consecutive FP loads or stores into lfq/stfq.
4877 [(set (match_operand:DF
0 "gpc_reg_operand" "=f")
4878 (match_operand:DF
1 "memory_operand" ""))
4879 (set (match_operand:DF
2 "gpc_reg_operand" "=f")
4880 (match_operand:DF
3 "memory_operand" ""))]
4882 && TARGET_HARD_FLOAT
4883 && registers_ok_for_quad_peep (operands[
0], operands[
2])
4884 && ! MEM_VOLATILE_P (operands[
1]) && ! MEM_VOLATILE_P (operands[
3])
4885 && addrs_ok_for_quad_peep (XEXP (operands[
1],
0), XEXP (operands[
3],
0))"
4889 [(set (match_operand:DF
0 "memory_operand" "")
4890 (match_operand:DF
1 "gpc_reg_operand" "f"))
4891 (set (match_operand:DF
2 "memory_operand" "")
4892 (match_operand:DF
3 "gpc_reg_operand" "f"))]
4894 && TARGET_HARD_FLOAT
4895 && registers_ok_for_quad_peep (operands[
1], operands[
3])
4896 && ! MEM_VOLATILE_P (operands[
0]) && ! MEM_VOLATILE_P (operands[
2])
4897 && addrs_ok_for_quad_peep (XEXP (operands[
0],
0), XEXP (operands[
2],
0))"
4900 ;; Next come insns related to the calling sequence.
4902 ;; First, an insn to allocate new stack space for dynamic use (e.g., alloca).
4903 ;; We move the back-chain and decrement the stack pointer.
4905 (define_expand "allocate_stack"
4907 (minus:SI (reg:SI
1) (match_operand:SI
0 "reg_or_short_operand" "")))]
4910 { rtx chain = gen_reg_rtx (SImode);
4911 rtx stack_bot = gen_rtx (MEM, Pmode, stack_pointer_rtx);
4913 emit_move_insn (chain, stack_bot);
4914 emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, operands[
0]));
4915 emit_move_insn (stack_bot, chain);
4919 ;; These patterns say how to save and restore the stack pointer. We need not
4920 ;; save the stack pointer at function level since we are careful to
4921 ;; preserve the backchain. At block level, we have to restore the backchain
4922 ;; when we restore the stack pointer.
4924 ;; For nonlocal gotos, we must save both the stack pointer and its
4925 ;; backchain and restore both. Note that in the nonlocal case, the
4926 ;; save area is a memory location.
4928 (define_expand "save_stack_function"
4929 [(use (const_int
0))]
4933 (define_expand "restore_stack_function"
4934 [(use (const_int
0))]
4938 (define_expand "restore_stack_block"
4939 [(set (match_dup
2) (mem:SI (match_operand:SI
0 "register_operand" "")))
4940 (set (match_dup
0) (match_operand:SI
1 "register_operand" ""))
4941 (set (mem:SI (match_dup
0)) (match_dup
2))]
4944 { operands[
2] = gen_reg_rtx (SImode); }")
4946 (define_expand "save_stack_nonlocal"
4947 [(match_operand:DI
0 "memory_operand" "")
4948 (match_operand:SI
1 "register_operand" "")]
4952 rtx temp = gen_reg_rtx (SImode);
4954 /* Copy the backchain to the first word, sp to the second. */
4955 emit_move_insn (temp, gen_rtx (MEM, SImode, operands[
1]));
4956 emit_move_insn (operand_subword (operands[
0],
0,
0, DImode), temp);
4957 emit_move_insn (operand_subword (operands[
0],
1,
0, DImode), operands[
1]);
4961 (define_expand "restore_stack_nonlocal"
4962 [(match_operand:SI
0 "register_operand" "")
4963 (match_operand:DI
1 "memory_operand" "")]
4967 rtx temp = gen_reg_rtx (SImode);
4969 /* Restore the backchain from the first word, sp from the second. */
4970 emit_move_insn (temp, operand_subword (operands[
1],
0,
0, DImode));
4971 emit_move_insn (operands[
0], operand_subword (operands[
1],
1,
0, DImode));
4972 emit_move_insn (gen_rtx (MEM, SImode, operands[
0]), temp);
4976 ;; A function pointer is a pointer to a data area whose first word contains
4977 ;; the actual address of the function, whose second word contains a pointer
4978 ;; to its TOC, and whose third word contains a value to place in the static
4979 ;; chain register (r11). Note that if we load the static chain, our
4980 ;; "trampoline" need not have any executable code.
4982 ;; operands[
0] is an SImode pseudo in which we place the address of the
4984 ;; operands[
1] is the address of data area of the function to call
4986 (define_expand "call_via_ptr"
4987 [(set (match_operand:SI
0 "gpc_reg_operand" "")
4988 (mem:SI (match_operand:SI
1 "gpc_reg_operand" "")))
4989 (set (mem:SI (plus:SI (reg:SI
1) (const_int
20)))
4992 (mem:SI (plus:SI (match_dup
1)
4995 (mem:SI (plus:SI (match_dup
1)
5002 (define_expand "call"
5003 [(parallel [(call (mem:SI (match_operand:SI
0 "address_operand" ""))
5004 (match_operand
1 "" ""))
5005 (clobber (scratch:SI))])]
5009 if (GET_CODE (operands[
0]) != MEM || GET_CODE (operands[
1]) != CONST_INT)
5012 operands[
0] = XEXP (operands[
0],
0);
5013 if (GET_CODE (operands[
0]) != SYMBOL_REF)
5015 #ifndef USING_SVR4_H
5016 /* AIX function pointers are really pointers to a three word area */
5017 rtx temp = gen_reg_rtx (SImode);
5019 emit_insn (gen_call_via_ptr (temp, force_reg (SImode, operands[
0])));
5021 #endif /* !USING_SVR4_H */
5025 (define_expand "call_value"
5026 [(parallel [(set (match_operand
0 "" "")
5027 (call (mem:SI (match_operand:SI
1 "address_operand" ""))
5028 (match_operand
2 "" "")))
5029 (clobber (scratch:SI))])]
5033 if (GET_CODE (operands[
1]) != MEM || GET_CODE (operands[
2]) != CONST_INT)
5036 operands[
1] = XEXP (operands[
1],
0);
5037 if (GET_CODE (operands[
1]) != SYMBOL_REF)
5039 #ifndef USING_SVR4_H
5040 /* AIX function pointers are really pointers to a three word area */
5041 rtx temp = gen_reg_rtx (SImode);
5043 emit_insn (gen_call_via_ptr (temp, force_reg (SImode, operands[
1])));
5045 #endif /* !USING_SVR4_H */
5049 ;; Call to function in current module. No TOC pointer reload needed.
5052 [(call (mem:SI (match_operand:SI
0 "current_file_function_operand" "s"))
5053 (match_operand
1 "" "g"))
5054 (clobber (match_scratch:SI
2 "=l"))]
5058 ;; Call to function which may be in another module. Restore the TOC
5059 ;; pointer (r2) after the call unless this is System V.
5062 [(call (mem:SI (match_operand:SI
0 "call_operand" "l,s"))
5063 (match_operand
1 "" "fg,fg"))
5064 (clobber (match_scratch:SI
2 "=l,l"))]
5068 #ifndef USING_SVR4_H
5069 if (GET_CODE (operands[
0]) == REG)
5070 return
\"{brl|blrl}\;{l|lwz}
2,
20(
1)
\";
5072 return
\"bl %z0\;%.
\";
5075 if (GET_CODE (operands[
0]) == REG)
5076 return
\"{brl|blrl}
\";
5081 [(set_attr "length" "
8")])
5084 [(set (match_operand
0 "" "=fg")
5085 (call (mem:SI (match_operand:SI
1 "current_file_function_operand" "s"))
5086 (match_operand
2 "" "g")))
5087 (clobber (match_scratch:SI
3 "=l"))]
5092 [(set (match_operand
0 "" "=fg,fg")
5093 (call (mem:SI (match_operand:SI
1 "call_operand" "l,s"))
5094 (match_operand
2 "" "fg,fg")))
5095 (clobber (match_scratch:SI
3 "=l,l"))]
5099 #ifndef USING_SVR4_H
5100 if (GET_CODE (operands[
1]) == REG)
5101 return
\"{brl|blrl}\;{l|lwz}
2,
20(
1)
\";
5103 return
\"bl %z1\;%.
\";
5106 if (GET_CODE (operands[
1]) == REG)
5107 return
\"{brl|blrl}
\";
5112 [(set_attr "length" "
8")])
5114 ;; Call subroutine returning any type.
5116 (define_expand "untyped_call"
5117 [(parallel [(call (match_operand
0 "" "")
5119 (match_operand
1 "" "")
5120 (match_operand
2 "" "")])]
5126 emit_call_insn (gen_call (operands[
0], const0_rtx, NULL, const0_rtx));
5128 for (i =
0; i < XVECLEN (operands[
2],
0); i++)
5130 rtx set = XVECEXP (operands[
2],
0, i);
5131 emit_move_insn (SET_DEST (set), SET_SRC (set));
5134 /* The optimizer does not know that the call sets the function value
5135 registers we stored in the result block. We avoid problems by
5136 claiming that all hard registers are used and clobbered at this
5138 emit_insn (gen_blockage ());
5143 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
5144 ;; all of memory. This blocks insns from being moved across this point.
5146 (define_insn "blockage"
5147 [(unspec_volatile [(const_int
0)]
0)]
5151 ;; Compare insns are next. Note that the RS/
6000 has two types of compares,
5152 ;; signed & unsigned, and one type of branch.
5154 ;; Start with the DEFINE_EXPANDs to generate the rtl for compares, scc
5155 ;; insns, and branches. We store the operands of compares until we see
5157 (define_expand "cmpsi"
5159 (compare (match_operand:SI
0 "gpc_reg_operand" "")
5160 (match_operand:SI
1 "reg_or_short_operand" "")))]
5164 /* Take care of the possibility that operands[
1] might be negative but
5165 this might be a logical operation. That insn doesn't exist. */
5166 if (GET_CODE (operands[
1]) == CONST_INT
5167 && INTVAL (operands[
1]) <
0)
5168 operands[
1] = force_reg (SImode, operands[
1]);
5170 rs6000_compare_op0 = operands[
0];
5171 rs6000_compare_op1 = operands[
1];
5172 rs6000_compare_fp_p =
0;
5176 (define_expand "cmpsf"
5177 [(set (cc0) (compare (match_operand:SF
0 "gpc_reg_operand" "")
5178 (match_operand:SF
1 "gpc_reg_operand" "")))]
5182 rs6000_compare_op0 = operands[
0];
5183 rs6000_compare_op1 = operands[
1];
5184 rs6000_compare_fp_p =
1;
5188 (define_expand "cmpdf"
5189 [(set (cc0) (compare (match_operand:DF
0 "gpc_reg_operand" "")
5190 (match_operand:DF
1 "gpc_reg_operand" "")))]
5194 rs6000_compare_op0 = operands[
0];
5195 rs6000_compare_op1 = operands[
1];
5196 rs6000_compare_fp_p =
1;
5200 (define_expand "beq"
5201 [(set (match_dup
2) (match_dup
1))
5203 (if_then_else (eq (match_dup
2)
5205 (label_ref (match_operand
0 "" ""))
5209 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5210 operands[
1] = gen_rtx (COMPARE, mode,
5211 rs6000_compare_op0, rs6000_compare_op1);
5212 operands[
2] = gen_reg_rtx (mode);
5215 (define_expand "bne"
5216 [(set (match_dup
2) (match_dup
1))
5218 (if_then_else (ne (match_dup
2)
5220 (label_ref (match_operand
0 "" ""))
5224 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5225 operands[
1] = gen_rtx (COMPARE, mode,
5226 rs6000_compare_op0, rs6000_compare_op1);
5227 operands[
2] = gen_reg_rtx (mode);
5230 (define_expand "blt"
5231 [(set (match_dup
2) (match_dup
1))
5233 (if_then_else (lt (match_dup
2)
5235 (label_ref (match_operand
0 "" ""))
5239 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5240 operands[
1] = gen_rtx (COMPARE, mode,
5241 rs6000_compare_op0, rs6000_compare_op1);
5242 operands[
2] = gen_reg_rtx (mode);
5245 (define_expand "bgt"
5246 [(set (match_dup
2) (match_dup
1))
5248 (if_then_else (gt (match_dup
2)
5250 (label_ref (match_operand
0 "" ""))
5254 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5255 operands[
1] = gen_rtx (COMPARE, mode,
5256 rs6000_compare_op0, rs6000_compare_op1);
5257 operands[
2] = gen_reg_rtx (mode);
5260 (define_expand "ble"
5261 [(set (match_dup
2) (match_dup
1))
5263 (if_then_else (le (match_dup
2)
5265 (label_ref (match_operand
0 "" ""))
5269 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5270 operands[
1] = gen_rtx (COMPARE, mode,
5271 rs6000_compare_op0, rs6000_compare_op1);
5272 operands[
2] = gen_reg_rtx (mode);
5275 (define_expand "bge"
5276 [(set (match_dup
2) (match_dup
1))
5278 (if_then_else (ge (match_dup
2)
5280 (label_ref (match_operand
0 "" ""))
5284 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5285 operands[
1] = gen_rtx (COMPARE, mode,
5286 rs6000_compare_op0, rs6000_compare_op1);
5287 operands[
2] = gen_reg_rtx (mode);
5290 (define_expand "bgtu"
5291 [(set (match_dup
2) (match_dup
1))
5293 (if_then_else (gtu (match_dup
2)
5295 (label_ref (match_operand
0 "" ""))
5299 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5300 rs6000_compare_op0, rs6000_compare_op1);
5301 operands[
2] = gen_reg_rtx (CCUNSmode);
5304 (define_expand "bltu"
5305 [(set (match_dup
2) (match_dup
1))
5307 (if_then_else (ltu (match_dup
2)
5309 (label_ref (match_operand
0 "" ""))
5313 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5314 rs6000_compare_op0, rs6000_compare_op1);
5315 operands[
2] = gen_reg_rtx (CCUNSmode);
5318 (define_expand "bgeu"
5319 [(set (match_dup
2) (match_dup
1))
5321 (if_then_else (geu (match_dup
2)
5323 (label_ref (match_operand
0 "" ""))
5327 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5328 rs6000_compare_op0, rs6000_compare_op1);
5329 operands[
2] = gen_reg_rtx (CCUNSmode);
5332 (define_expand "bleu"
5333 [(set (match_dup
2) (match_dup
1))
5335 (if_then_else (leu (match_dup
2)
5337 (label_ref (match_operand
0 "" ""))
5341 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5342 rs6000_compare_op0, rs6000_compare_op1);
5343 operands[
2] = gen_reg_rtx (CCUNSmode);
5346 ;; For SNE, we would prefer that the xor/abs sequence be used for integers.
5347 ;; For SEQ, likewise, except that comparisons with zero should be done
5348 ;; with an scc insns. However, due to the order that combine see the
5349 ;; resulting insns, we must, in fact, allow SEQ for integers. Fail in
5350 ;; the cases we don't want to handle.
5351 (define_expand "seq"
5352 [(set (match_dup
2) (match_dup
1))
5353 (set (match_operand:SI
0 "gpc_reg_operand" "")
5354 (eq:SI (match_dup
2) (const_int
0)))]
5357 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5358 operands[
1] = gen_rtx (COMPARE, mode,
5359 rs6000_compare_op0, rs6000_compare_op1);
5360 operands[
2] = gen_reg_rtx (mode);
5363 (define_expand "sne"
5364 [(set (match_dup
2) (match_dup
1))
5365 (set (match_operand:SI
0 "gpc_reg_operand" "")
5366 (ne:SI (match_dup
2) (const_int
0)))]
5369 { if (! rs6000_compare_fp_p)
5372 operands[
1] = gen_rtx (COMPARE, CCFPmode,
5373 rs6000_compare_op0, rs6000_compare_op1);
5374 operands[
2] = gen_reg_rtx (CCFPmode);
5377 ;; A >
0 is best done using the portable sequence, so fail in that case.
5378 (define_expand "sgt"
5379 [(set (match_dup
2) (match_dup
1))
5380 (set (match_operand:SI
0 "gpc_reg_operand" "")
5381 (gt:SI (match_dup
2) (const_int
0)))]
5384 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5386 if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
5389 operands[
1] = gen_rtx (COMPARE, mode,
5390 rs6000_compare_op0, rs6000_compare_op1);
5391 operands[
2] = gen_reg_rtx (mode);
5394 ;; A <
0 is best done in the portable way for A an integer.
5395 (define_expand "slt"
5396 [(set (match_dup
2) (match_dup
1))
5397 (set (match_operand:SI
0 "gpc_reg_operand" "")
5398 (lt:SI (match_dup
2) (const_int
0)))]
5401 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5403 if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
5406 operands[
1] = gen_rtx (COMPARE, mode,
5407 rs6000_compare_op0, rs6000_compare_op1);
5408 operands[
2] = gen_reg_rtx (mode);
5411 (define_expand "sge"
5412 [(set (match_dup
2) (match_dup
1))
5413 (set (match_operand:SI
0 "gpc_reg_operand" "")
5414 (ge:SI (match_dup
2) (const_int
0)))]
5417 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5418 operands[
1] = gen_rtx (COMPARE, mode,
5419 rs6000_compare_op0, rs6000_compare_op1);
5420 operands[
2] = gen_reg_rtx (mode);
5423 ;; A <=
0 is best done the portable way for A an integer.
5424 (define_expand "sle"
5425 [(set (match_dup
2) (match_dup
1))
5426 (set (match_operand:SI
0 "gpc_reg_operand" "")
5427 (le:SI (match_dup
2) (const_int
0)))]
5430 { enum machine_mode mode = rs6000_compare_fp_p ? CCFPmode : CCmode;
5432 if (! rs6000_compare_fp_p && rs6000_compare_op1 == const0_rtx)
5435 operands[
1] = gen_rtx (COMPARE, mode,
5436 rs6000_compare_op0, rs6000_compare_op1);
5437 operands[
2] = gen_reg_rtx (mode);
5440 (define_expand "sgtu"
5441 [(set (match_dup
2) (match_dup
1))
5442 (set (match_operand:SI
0 "gpc_reg_operand" "")
5443 (gtu:SI (match_dup
2) (const_int
0)))]
5446 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5447 rs6000_compare_op0, rs6000_compare_op1);
5448 operands[
2] = gen_reg_rtx (CCUNSmode);
5451 (define_expand "sltu"
5452 [(set (match_dup
2) (match_dup
1))
5453 (set (match_operand:SI
0 "gpc_reg_operand" "")
5454 (ltu:SI (match_dup
2) (const_int
0)))]
5457 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5458 rs6000_compare_op0, rs6000_compare_op1);
5459 operands[
2] = gen_reg_rtx (CCUNSmode);
5462 (define_expand "sgeu"
5463 [(set (match_dup
2) (match_dup
1))
5464 (set (match_operand:SI
0 "gpc_reg_operand" "")
5465 (geu:SI (match_dup
2) (const_int
0)))]
5468 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5469 rs6000_compare_op0, rs6000_compare_op1);
5470 operands[
2] = gen_reg_rtx (CCUNSmode);
5473 (define_expand "sleu"
5474 [(set (match_dup
2) (match_dup
1))
5475 (set (match_operand:SI
0 "gpc_reg_operand" "")
5476 (leu:SI (match_dup
2) (const_int
0)))]
5479 { operands[
1] = gen_rtx (COMPARE, CCUNSmode,
5480 rs6000_compare_op0, rs6000_compare_op1);
5481 operands[
2] = gen_reg_rtx (CCUNSmode);
5484 ;; Here are the actual compare insns.
5486 [(set (match_operand:CC
0 "cc_reg_operand" "=y")
5487 (compare:CC (match_operand:SI
1 "gpc_reg_operand" "r")
5488 (match_operand:SI
2 "reg_or_short_operand" "rI")))]
5490 "{cmp%I2|cmpw%I2} %
0,%
1,%
2"
5491 [(set_attr "type" "compare")])
5493 ;; If we are comparing a register for equality with a large constant,
5494 ;; we can do this with an XOR followed by a compare. But we need a scratch
5495 ;; register for the result of the XOR.
5498 [(set (match_operand:CC
0 "cc_reg_operand" "")
5499 (compare:CC (match_operand:SI
1 "gpc_reg_operand" "")
5500 (match_operand:SI
2 "non_short_cint_operand" "")))
5501 (clobber (match_operand:SI
3 "gpc_reg_operand" ""))]
5502 "find_single_use (operands[
0], insn,
0)
5503 && (GET_CODE (*find_single_use (operands[
0], insn,
0)) == EQ
5504 || GET_CODE (*find_single_use (operands[
0], insn,
0)) == NE)"
5505 [(set (match_dup
3) (xor:SI (match_dup
1) (match_dup
4)))
5506 (set (match_dup
0) (compare:CC (match_dup
3) (match_dup
5)))]
5509 /* Get the constant we are comparing against, C, and see what it looks like
5510 sign-extended to
16 bits. Then see what constant could be XOR'ed
5511 with C to get the sign-extended value. */
5513 int c = INTVAL (operands[
2]);
5514 int sextc = (c <<
16) >>
16;
5515 int xorv = c ^ sextc;
5517 operands[
4] = gen_rtx (CONST_INT, VOIDmode, xorv);
5518 operands[
5] = gen_rtx (CONST_INT, VOIDmode, sextc);
5522 [(set (match_operand:CCUNS
0 "cc_reg_operand" "=y")
5523 (compare:CCUNS (match_operand:SI
1 "gpc_reg_operand" "r")
5524 (match_operand:SI
2 "reg_or_u_short_operand" "rI")))]
5526 "{cmpl%I2|cmplw%I2} %
0,%
1,%W2"
5527 [(set_attr "type" "compare")])
5529 ;; The following two insns don't exist as single insns, but if we provide
5530 ;; them, we can swap an add and compare, which will enable us to overlap more
5531 ;; of the required delay between a compare and branch. We generate code for
5532 ;; them by splitting.
5535 [(set (match_operand:CC
3 "cc_reg_operand" "=y")
5536 (compare:CC (match_operand:SI
1 "gpc_reg_operand" "r")
5537 (match_operand:SI
2 "short_cint_operand" "i")))
5538 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
5539 (plus:SI (match_dup
1) (match_operand:SI
4 "short_cint_operand" "i")))]
5542 [(set_attr "length" "
8")])
5545 [(set (match_operand:CCUNS
3 "cc_reg_operand" "=y")
5546 (compare:CCUNS (match_operand:SI
1 "gpc_reg_operand" "r")
5547 (match_operand:SI
2 "u_short_cint_operand" "i")))
5548 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
5549 (plus:SI (match_dup
1) (match_operand:SI
4 "short_cint_operand" "i")))]
5552 [(set_attr "length" "
8")])
5555 [(set (match_operand:CC
3 "cc_reg_operand" "")
5556 (compare:CC (match_operand:SI
1 "gpc_reg_operand" "")
5557 (match_operand:SI
2 "short_cint_operand" "")))
5558 (set (match_operand:SI
0 "gpc_reg_operand" "")
5559 (plus:SI (match_dup
1) (match_operand:SI
4 "short_cint_operand" "")))]
5561 [(set (match_dup
3) (compare:CC (match_dup
1) (match_dup
2)))
5562 (set (match_dup
0) (plus:SI (match_dup
1) (match_dup
4)))])
5565 [(set (match_operand:CCUNS
3 "cc_reg_operand" "")
5566 (compare:CCUNS (match_operand:SI
1 "gpc_reg_operand" "")
5567 (match_operand:SI
2 "u_short_cint_operand" "")))
5568 (set (match_operand:SI
0 "gpc_reg_operand" "")
5569 (plus:SI (match_dup
1) (match_operand:SI
4 "short_cint_operand" "")))]
5571 [(set (match_dup
3) (compare:CCUNS (match_dup
1) (match_dup
2)))
5572 (set (match_dup
0) (plus:SI (match_dup
1) (match_dup
4)))])
5575 [(set (match_operand:CCFP
0 "cc_reg_operand" "=y")
5576 (compare:CCFP (match_operand:SF
1 "gpc_reg_operand" "f")
5577 (match_operand:SF
2 "gpc_reg_operand" "f")))]
5580 [(set_attr "type" "fpcompare")])
5583 [(set (match_operand:CCFP
0 "cc_reg_operand" "=y")
5584 (compare:CCFP (match_operand:DF
1 "gpc_reg_operand" "f")
5585 (match_operand:DF
2 "gpc_reg_operand" "f")))]
5588 [(set_attr "type" "fpcompare")])
5590 ;; Now we have the scc insns. We can do some combinations because of the
5591 ;; way the machine works.
5593 ;; Note that this is probably faster if we can put an insn between the
5594 ;; mfcr and rlinm, but this is tricky. Let's leave it for now. In most
5595 ;; cases the insns below which don't use an intermediate CR field will
5598 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5599 (match_operator:SI
1 "scc_comparison_operator"
5600 [(match_operand
2 "cc_reg_operand" "y")
5603 "%D1mfcr %
0\;{rlinm|rlwinm} %
0,%
0,%J1,
1"
5604 [(set_attr "length" "
12")])
5607 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
5608 (compare:CC (match_operator:SI
1 "scc_comparison_operator"
5609 [(match_operand
2 "cc_reg_operand" "y")
5612 (set (match_operand:SI
3 "gpc_reg_operand" "=r")
5613 (match_op_dup
1 [(match_dup
2) (const_int
0)]))]
5615 "%D1mfcr %
3\;{rlinm.|rlwinm.} %
3,%
3,%J1,
1"
5616 [(set_attr "type" "delayed_compare")
5617 (set_attr "length" "
12")])
5620 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5621 (ashift:SI (match_operator:SI
1 "scc_comparison_operator"
5622 [(match_operand
2 "cc_reg_operand" "y")
5624 (match_operand:SI
3 "const_int_operand" "n")))]
5628 int is_bit = ccr_bit (operands[
1],
1);
5629 int put_bit =
31 - (INTVAL (operands[
3]) &
31);
5632 if (is_bit >= put_bit)
5633 count = is_bit - put_bit;
5635 count =
32 - (put_bit - is_bit);
5637 operands[
4] = gen_rtx (CONST_INT, VOIDmode, count);
5638 operands[
5] = gen_rtx (CONST_INT, VOIDmode, put_bit);
5640 return
\"%D1mfcr %
0\;{rlinm|rlwinm} %
0,%
0,%
4,%
5,%
5\";
5642 [(set_attr "length" "
12")])
5645 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
5647 (ashift:SI (match_operator:SI
1 "scc_comparison_operator"
5648 [(match_operand
2 "cc_reg_operand" "y")
5650 (match_operand:SI
3 "const_int_operand" "n"))
5652 (set (match_operand:SI
4 "gpc_reg_operand" "=r")
5653 (ashift:SI (match_op_dup
1 [(match_dup
2) (const_int
0)])
5658 int is_bit = ccr_bit (operands[
1],
1);
5659 int put_bit =
31 - (INTVAL (operands[
3]) &
31);
5662 if (is_bit >= put_bit)
5663 count = is_bit - put_bit;
5665 count =
32 - (put_bit - is_bit);
5667 operands[
5] = gen_rtx (CONST_INT, VOIDmode, count);
5668 operands[
6] = gen_rtx (CONST_INT, VOIDmode, put_bit);
5670 return
\"%D1mfcr %
4\;{rlinm.|rlwinm.} %
4,%
4,%
5,%
6,%
6\";
5672 [(set_attr "type" "delayed_compare")
5673 (set_attr "length" "
12")])
5675 ;; If we are comparing the result of two comparisons, this can be done
5676 ;; using creqv or crxor.
5679 [(set (match_operand:CCEQ
0 "cc_reg_operand" "=y")
5680 (compare:CCEQ (match_operator
1 "scc_comparison_operator"
5681 [(match_operand
2 "cc_reg_operand" "y")
5683 (match_operator
3 "scc_comparison_operator"
5684 [(match_operand
4 "cc_reg_operand" "y")
5686 "REGNO (operands[
2]) != REGNO (operands[
4])"
5689 enum rtx_code code1, code2;
5691 code1 = GET_CODE (operands[
1]);
5692 code2 = GET_CODE (operands[
3]);
5694 if ((code1 == EQ || code1 == LT || code1 == GT
5695 || code1 == LTU || code1 == GTU
5696 || (code1 != NE && GET_MODE (operands[
2]) == CCFPmode))
5698 (code2 == EQ || code2 == LT || code2 == GT
5699 || code2 == LTU || code2 == GTU
5700 || (code2 != NE && GET_MODE (operands[
4]) == CCFPmode)))
5701 return
\"%C1%C3crxor %E0,%j1,%j3
\";
5703 return
\"%C1%C3creqv %E0,%j1,%j3
\";
5705 [(set_attr "length" "
12")])
5707 ;; There is a
3 cycle delay between consecutive mfcr instructions
5708 ;; so it is useful to combine
2 scc instructions to use only one mfcr.
5711 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5712 (match_operator:SI
1 "scc_comparison_operator"
5713 [(match_operand
2 "cc_reg_operand" "y")
5715 (set (match_operand:SI
3 "gpc_reg_operand" "=r")
5716 (match_operator:SI
4 "scc_comparison_operator"
5717 [(match_operand
5 "cc_reg_operand" "y")
5719 "REGNO (operands[
2]) != REGNO (operands[
5])"
5720 "%D1%D4mfcr %
3\;{rlinm|rlwinm} %
0,%
3,%J1,
1\;{rlinm|rlwinm} %
3,%
3,%J4,
1"
5721 [(set_attr "length" "
20")])
5723 ;; There are some scc insns that can be done directly, without a compare.
5724 ;; These are faster because they don't involve the communications between
5725 ;; the FXU and branch units. In fact, we will be replacing all of the
5726 ;; integer scc insns here or in the portable methods in emit_store_flag.
5728 ;; Also support (neg (scc ..)) since that construct is used to replace
5729 ;; branches, (plus (scc ..) ..) since that construct is common and
5730 ;; takes no more insns than scc, and (and (neg (scc ..)) ..) in the
5731 ;; cases where it is no more expensive than (neg (scc ..)).
5733 ;; Have reload force a constant into a register for the simple insns that
5734 ;; otherwise won't accept constants. We do this because it is faster than
5735 ;; the cmp/mfcr sequence we would otherwise generate.
5738 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r,r")
5739 (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5740 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I")))
5741 (clobber (match_scratch:SI
3 "=r,&r,r,r,r"))]
5744 xor %
0,%
1,%
2\;{sfi|subfic} %
3,%
0,
0\;{ae|adde} %
0,%
3,%
0
5745 {sfi|subfic} %
3,%
1,
0\;{ae|adde} %
0,%
3,%
1
5746 {xoril|xori} %
0,%
1,%b2\;{sfi|subfic} %
3,%
0,
0\;{ae|adde} %
0,%
3,%
0
5747 {xoriu|xoris} %
0,%
1,%u2\;{sfi|subfic} %
3,%
0,
0\;{ae|adde} %
0,%
3,%
0
5748 {sfi|subfic} %
0,%
1,%
2\;{sfi|subfic} %
3,%
0,
0\;{ae|adde} %
0,%
3,%
0"
5749 [(set_attr "length" "
12,
8,
12,
12,
12")])
5752 [(set (match_operand:CC
4 "cc_reg_operand" "=x,x,x,x,x")
5754 (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5755 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I"))
5757 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r,r")
5758 (eq:SI (match_dup
1) (match_dup
2)))
5759 (clobber (match_scratch:SI
3 "=r,&r,r,r,r"))]
5762 xor %
0,%
1,%
2\;{sfi|subfic} %
3,%
0,
0\;{ae.|adde.} %
0,%
3,%
0
5763 {sfi|subfic} %
3,%
1,
0\;{ae.|adde.} %
0,%
3,%
1
5764 {xoril|xori} %
0,%
1,%b2\;{sfi|subfic} %
3,%
0,
0\;{ae.|adde.} %
0,%
3,%
0
5765 {xoriu|xoris} %
0,%
1,%u2\;{sfi|subfic} %
3,%
0,
0\;{ae.|adde.} %
0,%
3,%
0
5766 {sfi|subfic} %
0,%
1,%
2\;{sfi|subfic} %
3,%
0,
0\;{ae.|adde.} %
0,%
3,%
0"
5767 [(set_attr "type" "compare")
5768 (set_attr "length" "
12,
8,
12,
12,
12")])
5770 ;; We have insns of the form shown by the first define_insn below. If
5771 ;; there is something inside the comparison operation, we must split it.
5773 [(set (match_operand:SI
0 "gpc_reg_operand" "")
5774 (plus:SI (match_operator
1 "comparison_operator"
5775 [(match_operand:SI
2 "" "")
5777 "reg_or_cint_operand" "")])
5778 (match_operand:SI
4 "gpc_reg_operand" "")))
5779 (clobber (match_operand:SI
5 "register_operand" ""))]
5780 "! gpc_reg_operand (operands[
2], SImode)"
5781 [(set (match_dup
5) (match_dup
2))
5782 (set (match_dup
2) (plus:SI (match_op_dup
1 [(match_dup
2) (match_dup
3)])
5786 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r,r")
5787 (plus:SI (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5788 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I"))
5789 (match_operand:SI
3 "gpc_reg_operand" "r,r,r,r,r")))
5790 (clobber (match_scratch:SI
4 "=&r,&r,&r,&r,&r"))]
5793 xor %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3
5794 {sfi|subfic} %
4,%
1,
0\;{aze|addze} %
0,%
3
5795 {xoril|xori} %
4,%
1,%b2\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3
5796 {xoriu|xoris} %
4,%
1,%u2\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3
5797 {sfi|subfic} %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3"
5798 [(set_attr "length" "
12,
8,
12,
12,
12")])
5801 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x,x,x,x")
5804 (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5805 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I"))
5806 (match_operand:SI
3 "gpc_reg_operand" "r,r,r,r,r"))
5808 (clobber (match_scratch:SI
4 "=&r,&r,&r,&r,&r"))]
5811 xor %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3
5812 {sfi|subfic} %
4,%
1,
0\;{aze.|addze.} %
0,%
3
5813 {xoril|xori} %
4,%
1,%b2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3
5814 {xoriu|xoris} %
4,%
1,%u2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3
5815 {sfi|subfic} %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3"
5816 [(set_attr "type" "compare")
5817 (set_attr "length" "
12,
8,
12,
12,
12")])
5820 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x,x,x,x")
5823 (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5824 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I"))
5825 (match_operand:SI
3 "gpc_reg_operand" "r,r,r,r,r"))
5827 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r,r")
5828 (plus:SI (eq:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
5829 (clobber (match_scratch:SI
4 "=&r,&r,&r,&r,&r"))]
5832 xor %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3
5833 {sfi|subfic} %
4,%
1,
0\;{aze.|addze.} %
4,%
3
5834 {xoril|xori} %
4,%
1,%b2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3
5835 {xoriu|xoris} %
4,%
1,%u2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3
5836 {sfi|subfic} %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3"
5837 [(set_attr "type" "compare")
5838 (set_attr "length" "
12,
8,
12,
12,
12")])
5841 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r,r")
5842 (neg:SI (eq:SI (match_operand:SI
1 "gpc_reg_operand" "%r,r,r,r,r")
5843 (match_operand:SI
2 "reg_or_cint_operand" "r,O,K,J,I"))))]
5846 xor %
0,%
1,%
2\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0
5847 {ai|addic} %
0,%
1,-
1\;{sfe|subfe} %
0,%
0,%
0
5848 {xoril|xori} %
0,%
1,%b2\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0
5849 {xoriu|xoris} %
0,%
1,%u2\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0
5850 {sfi|subfic} %
0,%
1,%
2\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0"
5851 [(set_attr "length" "
12,
8,
12,
12,
12")])
5853 ;; Simplify (ne X (const_int
0)) on the PowerPC. No need to on the Power,
5854 ;; since it nabs/sr is just as fast.
5856 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5857 (lshiftrt:SI (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))
5859 (clobber (match_scratch:SI
2 "=&r"))]
5861 "{ai|addic} %
2,%
1,-
1\;{sfe|subfe} %
0,%
2,%
1"
5862 [(set_attr "length" "
8")])
5864 ;; This is what (plus (ne X (const_int
0)) Y) looks like.
5866 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5867 (plus:SI (lshiftrt:SI
5868 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))
5870 (match_operand:SI
2 "gpc_reg_operand" "r")))
5871 (clobber (match_scratch:SI
3 "=&r"))]
5873 "{ai|addic} %
3,%
1,-
1\;{aze|addze} %
0,%
2"
5874 [(set_attr "length" "
8")])
5877 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
5879 (plus:SI (lshiftrt:SI
5880 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))
5882 (match_operand:SI
2 "gpc_reg_operand" "r"))
5884 (clobber (match_scratch:SI
3 "=&r"))]
5886 "{ai|addic} %
3,%
1,-
1\;{aze.|addze.} %
3,%
2"
5887 [(set_attr "type" "compare")
5888 (set_attr "length" "
8")])
5891 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
5893 (plus:SI (lshiftrt:SI
5894 (neg:SI (abs:SI (match_operand:SI
1 "gpc_reg_operand" "r")))
5896 (match_operand:SI
2 "gpc_reg_operand" "r"))
5898 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
5899 (plus:SI (lshiftrt:SI (neg:SI (abs:SI (match_dup
1))) (const_int
31))
5901 (clobber (match_scratch:SI
3 "=&r"))]
5903 "{ai|addic} %
3,%
1,-
1\;{aze.|addze.} %
0,%
2"
5904 [(set_attr "type" "compare")
5905 (set_attr "length" "
8")])
5908 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
5909 (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5910 (match_operand:SI
2 "reg_or_short_operand" "r,O")))
5911 (clobber (match_scratch:SI
3 "=r,X"))]
5914 doz %
3,%
2,%
1\;{sfi|subfic} %
0,%
3,
0\;{ae|adde} %
0,%
0,%
3
5915 {ai|addic} %
0,%
1,-
1\;{aze|addze} %
0,%
0\;{sri|srwi} %
0,%
0,
31"
5916 [(set_attr "length" "
12")])
5919 [(set (match_operand:CC
4 "cc_reg_operand" "=x,x")
5921 (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5922 (match_operand:SI
2 "reg_or_short_operand" "r,O"))
5924 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
5925 (le:SI (match_dup
1) (match_dup
2)))
5926 (clobber (match_scratch:SI
3 "=r,X"))]
5929 doz %
3,%
2,%
1\;{sfi|subfic} %
0,%
3,
0\;{ae.|adde.} %
0,%
0,%
3
5930 {ai|addic} %
0,%
1,-
1\;{aze|addze} %
0,%
0\;{sri.|srwi.} %
0,%
0,
31"
5931 [(set_attr "type" "compare,delayed_compare")
5932 (set_attr "length" "
12")])
5935 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
5936 (plus:SI (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5937 (match_operand:SI
2 "reg_or_short_operand" "r,O"))
5938 (match_operand:SI
3 "gpc_reg_operand" "r,r")))
5939 (clobber (match_scratch:SI
4 "=&r,&r"))]
5942 doz %
4,%
2,%
1\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3
5943 {srai|srawi} %
4,%
1,
31\;{sf|subfc} %
4,%
1,%
4\;{aze|addze} %
0,%
3"
5944 [(set_attr "length" "
12")])
5947 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
5949 (plus:SI (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5950 (match_operand:SI
2 "reg_or_short_operand" "r,O"))
5951 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
5953 (clobber (match_scratch:SI
4 "=&r,&r"))]
5956 doz %
4,%
2,%
1\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3
5957 {srai|srawi} %
4,%
1,
31\;{sf|subfc} %
4,%
1,%
4\;{aze.|addze.} %
4,%
3"
5958 [(set_attr "type" "compare")
5959 (set_attr "length" "
12")])
5962 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x")
5964 (plus:SI (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5965 (match_operand:SI
2 "reg_or_short_operand" "r,O"))
5966 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
5968 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
5969 (plus:SI (le:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
5970 (clobber (match_scratch:SI
4 "=&r,&r"))]
5973 doz %
4,%
2,%
1\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3
5974 {srai|srawi} %
4,%
1,
31\;{sf|subfc} %
4,%
1,%
4\;{aze.|addze.} %
0,%
3"
5975 [(set_attr "type" "compare")
5976 (set_attr "length" "
12")])
5979 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
5980 (neg:SI (le:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
5981 (match_operand:SI
2 "reg_or_short_operand" "r,O"))))]
5984 doz %
0,%
2,%
1\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0
5985 {ai|addic} %
0,%
1,-
1\;{aze|addze} %
0,%
0\;{srai|srawi} %
0,%
0,
31"
5986 [(set_attr "length" "
12")])
5989 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
5990 (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
5991 (match_operand:SI
2 "reg_or_short_operand" "rI")))]
5993 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{cal %
0,
0(
0)|li %
0,
0}\;{ae|adde} %
0,%
0,%
0"
5994 [(set_attr "length" "
12")])
5997 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
5999 (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6000 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6002 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6003 (leu:SI (match_dup
1) (match_dup
2)))]
6005 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{cal %
0,
0(
0)|li %
0,
0}\;{ae.|adde.} %
0,%
0,%
0"
6006 [(set_attr "type" "compare")
6007 (set_attr "length" "
12")])
6010 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6011 (plus:SI (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6012 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6013 (match_operand:SI
3 "gpc_reg_operand" "r")))
6014 (clobber (match_scratch:SI
4 "=&r"))]
6016 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{aze|addze} %
0,%
3"
6017 [(set_attr "length" "
8")])
6020 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6022 (plus:SI (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6023 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6024 (match_operand:SI
3 "gpc_reg_operand" "r"))
6026 (clobber (match_scratch:SI
4 "=&r"))]
6028 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{aze.|addze.} %
4,%
3"
6029 [(set_attr "type" "compare")
6030 (set_attr "length" "
8")])
6033 [(set (match_operand:CC
5 "cc_reg_operand" "=x")
6035 (plus:SI (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6036 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6037 (match_operand:SI
3 "gpc_reg_operand" "r"))
6039 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6040 (plus:SI (leu:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6041 (clobber (match_scratch:SI
4 "=&r"))]
6043 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{aze.|addze.} %
0,%
3"
6044 [(set_attr "type" "compare")
6045 (set_attr "length" "
8")])
6048 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6049 (neg:SI (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6050 (match_operand:SI
2 "reg_or_short_operand" "rI"))))]
6052 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{sfe|subfe} %
0,%
0,%
0\;nand %
0,%
0,%
0"
6053 [(set_attr "length" "
12")])
6056 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6058 (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6059 (match_operand:SI
2 "reg_or_short_operand" "rI")))
6060 (match_operand:SI
3 "gpc_reg_operand" "r")))
6061 (clobber (match_scratch:SI
4 "=&r"))]
6063 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;andc %
0,%
3,%
4"
6064 [(set_attr "length" "
12")])
6067 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6070 (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6071 (match_operand:SI
2 "reg_or_short_operand" "rI")))
6072 (match_operand:SI
3 "gpc_reg_operand" "r"))
6074 (clobber (match_scratch:SI
4 "=&r"))]
6076 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;andc. %
4,%
3,%
4"
6077 [(set_attr "type" "compare")
6078 (set_attr "length" "
12")])
6081 [(set (match_operand:CC
5 "cc_reg_operand" "=x")
6084 (leu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6085 (match_operand:SI
2 "reg_or_short_operand" "rI")))
6086 (match_operand:SI
3 "gpc_reg_operand" "r"))
6088 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6089 (and:SI (neg:SI (leu:SI (match_dup
1) (match_dup
2))) (match_dup
3)))
6090 (clobber (match_scratch:SI
4 "=&r"))]
6092 "{sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;andc. %
0,%
3,%
4"
6093 [(set_attr "type" "compare")
6094 (set_attr "length" "
12")])
6097 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6098 (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6099 (match_operand:SI
2 "reg_or_short_operand" "rI")))]
6101 "doz%I2 %
0,%
1,%
2\;nabs %
0,%
0\;{sri|srwi} %
0,%
0,
31"
6102 [(set_attr "length" "
12")])
6105 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
6107 (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6108 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6110 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6111 (lt:SI (match_dup
1) (match_dup
2)))]
6113 "doz%I2 %
0,%
1,%
2\;nabs %
0,%
0\;{sri.|srwi.} %
0,%
0,
31"
6114 [(set_attr "type" "delayed_compare")
6115 (set_attr "length" "
12")])
6118 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6119 (plus:SI (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6120 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6121 (match_operand:SI
3 "gpc_reg_operand" "r")))
6122 (clobber (match_scratch:SI
4 "=&r"))]
6124 "doz%I2 %
4,%
1,%
2\;{ai|addic} %
4,%
4,-
1\;{aze|addze} %
0,%
3"
6125 [(set_attr "length" "
12")])
6128 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6130 (plus:SI (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6131 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6132 (match_operand:SI
3 "gpc_reg_operand" "r"))
6134 (clobber (match_scratch:SI
4 "=&r"))]
6136 "doz%I2 %
4,%
1,%
2\;{ai|addic} %
4,%
4,-
1\;{aze.|addze.} %
4,%
3"
6137 [(set_attr "type" "compare")
6138 (set_attr "length" "
12")])
6141 [(set (match_operand:CC
5 "cc_reg_operand" "=x")
6143 (plus:SI (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6144 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6145 (match_operand:SI
3 "gpc_reg_operand" "r"))
6147 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6148 (plus:SI (lt:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6149 (clobber (match_scratch:SI
4 "=&r"))]
6151 "doz%I2 %
4,%
1,%
2\;{ai|addic} %
4,%
4,-
1\;{aze.|addze.} %
0,%
3"
6152 [(set_attr "type" "compare")
6153 (set_attr "length" "
12")])
6156 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6157 (neg:SI (lt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6158 (match_operand:SI
2 "reg_or_short_operand" "rI"))))]
6160 "doz%I2 %
0,%
1,%
2\;nabs %
0,%
0\;{srai|srawi} %
0,%
0,
31"
6161 [(set_attr "length" "
12")])
6164 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6165 (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6166 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P")))]
6169 {sf|subfc} %
0,%
2,%
1\;{sfe|subfe} %
0,%
0,%
0\;neg %
0,%
0
6170 {ai|addic} %
0,%
1,%n2\;{sfe|subfe} %
0,%
0,%
0\;neg %
0,%
0"
6171 [(set_attr "length" "
12")])
6174 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
6176 (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6177 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6179 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6180 (ltu:SI (match_dup
1) (match_dup
2)))]
6183 {sf|subfc} %
0,%
2,%
1\;{sfe|subfe} %
0,%
0,%
0\;neg. %
0,%
0
6184 {ai|addic} %
0,%
1,%n2\;{sfe|subfe} %
0,%
0,%
0\;neg. %
0,%
0"
6185 [(set_attr "type" "compare")
6186 (set_attr "length" "
12")])
6189 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r,r")
6190 (plus:SI (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r,r,r")
6191 (match_operand:SI
2 "reg_or_neg_short_operand" "r,r,P,P"))
6192 (match_operand:SI
3 "reg_or_short_operand" "r,I,r,I")))
6193 (clobber (match_scratch:SI
4 "=&r,r,&r,r"))]
6196 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3
6197 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3
6198 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3
6199 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3"
6200 [(set_attr "length" "
12")])
6203 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
6205 (plus:SI (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6206 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6207 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6209 (clobber (match_scratch:SI
4 "=&r,&r"))]
6212 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
4,%
4,%
3
6213 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
4,%
4,%
3"
6214 [(set_attr "type" "compare")
6215 (set_attr "length" "
12")])
6218 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x")
6220 (plus:SI (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6221 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6222 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6224 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6225 (plus:SI (ltu:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6226 (clobber (match_scratch:SI
4 "=&r,&r"))]
6229 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
0,%
4,%
3
6230 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
0,%
4,%
3"
6231 [(set_attr "type" "compare")
6232 (set_attr "length" "
12")])
6235 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6236 (neg:SI (ltu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6237 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))))]
6240 {sf|subfc} %
0,%
2,%
1\;{sfe|subfe} %
0,%
0,%
0
6241 {ai|addic} %
0,%
1,%n2\;{sfe|subfe} %
0,%
0,%
0"
6242 [(set_attr "length" "
8")])
6245 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6246 (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6247 (match_operand:SI
2 "reg_or_short_operand" "rI")))
6248 (clobber (match_scratch:SI
3 "=r"))]
6250 "doz%I2 %
3,%
1,%
2\;{sfi|subfic} %
0,%
3,
0\;{ae|adde} %
0,%
0,%
3"
6251 [(set_attr "length" "
12")])
6254 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
6256 (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6257 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6259 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6260 (ge:SI (match_dup
1) (match_dup
2)))
6261 (clobber (match_scratch:SI
3 "=r"))]
6263 "doz%I2 %
3,%
1,%
2\;{sfi|subfic} %
0,%
3,
0\;{ae.|adde.} %
0,%
0,%
3"
6264 [(set_attr "type" "compare")
6265 (set_attr "length" "
12")])
6268 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6269 (plus:SI (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6270 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6271 (match_operand:SI
3 "gpc_reg_operand" "r")))
6272 (clobber (match_scratch:SI
4 "=&r"))]
6274 "doz%I2 %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze|addze} %
0,%
3"
6275 [(set_attr "length" "
12")])
6278 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6280 (plus:SI (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6281 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6282 (match_operand:SI
3 "gpc_reg_operand" "r"))
6284 (clobber (match_scratch:SI
4 "=&r"))]
6286 "doz%I2 %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
4,%
3"
6287 [(set_attr "type" "compare")
6288 (set_attr "length" "
12")])
6291 [(set (match_operand:CC
5 "cc_reg_operand" "=x")
6293 (plus:SI (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6294 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6295 (match_operand:SI
3 "gpc_reg_operand" "r"))
6297 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6298 (plus:SI (ge:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6299 (clobber (match_scratch:SI
4 "=&r"))]
6301 "doz%I2 %
4,%
1,%
2\;{sfi|subfic} %
4,%
4,
0\;{aze.|addze.} %
0,%
3"
6302 [(set_attr "type" "compare")
6303 (set_attr "length" "
12")])
6306 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6307 (neg:SI (ge:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6308 (match_operand:SI
2 "reg_or_short_operand" "rI"))))]
6310 "doz%I2 %
0,%
1,%
2\;{ai|addic} %
0,%
0,-
1\;{sfe|subfe} %
0,%
0,%
0"
6311 [(set_attr "length" "
12")])
6313 ;; This is (and (neg (ge X (const_int
0))) Y).
6315 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6318 (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
6320 (match_operand:SI
2 "gpc_reg_operand" "r")))
6321 (clobber (match_scratch:SI
3 "=&r"))]
6323 "{srai|srawi} %
3,%
1,
31\;andc %
0,%
2,%
3"
6324 [(set_attr "length" "
8")])
6327 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6331 (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
6333 (match_operand:SI
2 "gpc_reg_operand" "r"))
6335 (clobber (match_scratch:SI
3 "=&r"))]
6337 "{srai|srawi} %
3,%
1,
31\;andc. %
3,%
2,%
3"
6338 [(set_attr "type" "compare")
6339 (set_attr "length" "
8")])
6342 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
6346 (not:SI (match_operand:SI
1 "gpc_reg_operand" "r"))
6348 (match_operand:SI
2 "gpc_reg_operand" "r"))
6350 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6351 (and:SI (neg:SI (lshiftrt:SI (not:SI (match_dup
1))
6354 (clobber (match_scratch:SI
3 "=&r"))]
6356 "{srai|srawi} %
3,%
1,
31\;andc. %
0,%
2,%
3"
6357 [(set_attr "type" "compare")
6358 (set_attr "length" "
8")])
6361 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6362 (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6363 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P")))]
6366 {sf|subfc} %
0,%
2,%
1\;{cal %
0,
0(
0)|li %
0,
0}\;{ae|adde} %
0,%
0,%
0
6367 {ai|addic} %
0,%
1,%n2\;{cal %
0,
0(
0)|li %
0,
0}\;{ae|adde} %
0,%
0,%
0"
6368 [(set_attr "length" "
12")])
6371 [(set (match_operand:CC
3 "cc_reg_operand" "=x,x")
6373 (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6374 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6376 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6377 (geu:SI (match_dup
1) (match_dup
2)))]
6380 {sf|subfc} %
0,%
2,%
1\;{cal %
0,
0(
0)|li %
0,
0}\;{ae.|adde.} %
0,%
0,%
0
6381 {ai|addic} %
0,%
1,%n2\;{cal %
0,
0(
0)|li %
0,
0}\;{ae.|adde.} %
0,%
0,%
0"
6382 [(set_attr "type" "compare")
6383 (set_attr "length" "
12")])
6386 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6387 (plus:SI (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6388 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6389 (match_operand:SI
3 "gpc_reg_operand" "r,r")))
6390 (clobber (match_scratch:SI
4 "=&r,&r"))]
6393 {sf|subfc} %
4,%
2,%
1\;{aze|addze} %
0,%
3
6394 {ai|addic} %
4,%
1,%n2\;{aze|addze} %
0,%
3"
6395 [(set_attr "length" "
8")])
6398 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
6400 (plus:SI (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6401 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6402 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6404 (clobber (match_scratch:SI
4 "=&r,&r"))]
6407 {sf|subfc} %
4,%
2,%
1\;{aze.|addze.} %
4,%
3
6408 {ai|addic} %
4,%
1,%n2\;{aze.|addze.} %
4,%
3"
6409 [(set_attr "type" "compare")
6410 (set_attr "length" "
8")])
6413 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x")
6415 (plus:SI (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6416 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P"))
6417 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6419 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6420 (plus:SI (geu:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6421 (clobber (match_scratch:SI
4 "=&r,&r"))]
6424 {sf|subfc} %
4,%
2,%
1\;{aze.|addze.} %
0,%
3
6425 {ai|addic} %
4,%
1,%n2\;{aze.|addze.} %
4,%
3"
6426 [(set_attr "type" "compare")
6427 (set_attr "length" "
8")])
6430 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6431 (neg:SI (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6432 (match_operand:SI
2 "reg_or_short_operand" "r,I"))))]
6435 {sf|subfc} %
0,%
2,%
1\;{sfe|subfe} %
0,%
0,%
0\;nand %
0,%
0,%
0
6436 {sfi|subfic} %
0,%
1,-
1\;a%I2 %
0,%
0,%
2\;{sfe|subfe} %
0,%
0,%
0"
6437 [(set_attr "length" "
12")])
6440 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6442 (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6443 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P")))
6444 (match_operand:SI
3 "gpc_reg_operand" "r,r")))
6445 (clobber (match_scratch:SI
4 "=&r,&r"))]
6448 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;andc %
0,%
3,%
4
6449 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;andc %
0,%
3,%
4"
6450 [(set_attr "length" "
12")])
6453 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
6456 (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6457 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P")))
6458 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6460 (clobber (match_scratch:SI
4 "=&r,&r"))]
6463 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;andc. %
4,%
3,%
4
6464 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;andc. %
4,%
3,%
4"
6465 [(set_attr "type" "compare")
6466 (set_attr "length" "
12")])
6469 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x")
6472 (geu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6473 (match_operand:SI
2 "reg_or_neg_short_operand" "r,P")))
6474 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6476 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6477 (and:SI (neg:SI (geu:SI (match_dup
1) (match_dup
2))) (match_dup
3)))
6478 (clobber (match_scratch:SI
4 "=&r,&r"))]
6481 {sf|subfc} %
4,%
2,%
1\;{sfe|subfe} %
4,%
4,%
4\;andc. %
0,%
3,%
4
6482 {ai|addic} %
4,%
1,%n2\;{sfe|subfe} %
4,%
4,%
4\;andc. %
0,%
3,%
4"
6483 [(set_attr "type" "compare")
6484 (set_attr "length" "
12")])
6487 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6488 (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6491 "{sfi|subfic} %
0,%
1,
0\;{ame|addme} %
0,%
0\;{sri|srwi} %
0,%
0,
31"
6492 [(set_attr "length" "
12")])
6495 [(set (match_operand:CC
2 "cc_reg_operand" "=x")
6497 (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6500 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6501 (gt:SI (match_dup
1) (const_int
0)))]
6503 "{sfi|subfic} %
0,%
1,
0\;{ame|addme} %
0,%
0\;{sri.|srwi.} %
0,%
0,
31"
6504 [(set_attr "type" "delayed_compare")
6505 (set_attr "length" "
12")])
6508 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6509 (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6510 (match_operand:SI
2 "reg_or_short_operand" "r")))]
6512 "doz %
0,%
2,%
1\;nabs %
0,%
0\;{sri|srwi} %
0,%
0,
31"
6513 [(set_attr "length" "
12")])
6516 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
6518 (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6519 (match_operand:SI
2 "reg_or_short_operand" "r"))
6521 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6522 (gt:SI (match_dup
1) (match_dup
2)))]
6524 "doz %
0,%
2,%
1\;nabs %
0,%
0\;{sri.|srwi.} %
0,%
0,
31"
6525 [(set_attr "type" "delayed_compare")
6526 (set_attr "length" "
12")])
6529 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6530 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6532 (match_operand:SI
2 "gpc_reg_operand" "r")))
6533 (clobber (match_scratch:SI
3 "=&r"))]
6535 "{a|addc} %
3,%
1,%
1\;{sfe|subfe} %
3,%
1,%
3\;{aze|addze} %
0,%
2"
6536 [(set_attr "length" "
12")])
6539 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6541 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6543 (match_operand:SI
2 "gpc_reg_operand" "r"))
6545 (clobber (match_scratch:SI
3 "=&r"))]
6547 "{a|addc} %
3,%
1,%
1\;{sfe|subfe} %
3,%
1,%
3\;{aze.|addze.} %
0,%
2"
6548 [(set_attr "type" "compare")
6549 (set_attr "length" "
12")])
6552 [(set (match_operand:CC
4 "cc_reg_operand" "=x")
6554 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6556 (match_operand:SI
2 "gpc_reg_operand" "r"))
6558 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6559 (plus:SI (gt:SI (match_dup
1) (const_int
0)) (match_dup
2)))
6560 (clobber (match_scratch:SI
3 "=&r"))]
6562 "{a|addc} %
3,%
1,%
1\;{sfe|subfe} %
3,%
1,%
3\;{aze.|addze.} %
3,%
2"
6563 [(set_attr "type" "compare")
6564 (set_attr "length" "
12")])
6567 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6568 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6569 (match_operand:SI
2 "reg_or_short_operand" "r"))
6570 (match_operand:SI
3 "gpc_reg_operand" "r")))
6571 (clobber (match_scratch:SI
4 "=&r"))]
6573 "doz %
4,%
2,%
1\;{ai|addic} %
4,%
4,-
1\;{aze|addze} %
0,%
3"
6574 [(set_attr "length" "
12")])
6577 [(set (match_operand:CC
0 "cc_reg_operand" "=x")
6579 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6580 (match_operand:SI
2 "reg_or_short_operand" "r"))
6581 (match_operand:SI
3 "gpc_reg_operand" "r"))
6583 (clobber (match_scratch:SI
4 "=&r"))]
6585 "doz %
4,%
2,%
1\;{ai|addic} %
4,%
4,-
1\;{aze.|addze.} %
4,%
3"
6586 [(set_attr "type" "compare")
6587 (set_attr "length" "
12")])
6590 [(set (match_operand:CC
5 "cc_reg_operand" "=x")
6592 (plus:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6593 (match_operand:SI
2 "reg_or_short_operand" "r"))
6594 (match_operand:SI
3 "gpc_reg_operand" "r"))
6596 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6597 (plus:SI (gt:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6598 (clobber (match_scratch:SI
4 "=&r"))]
6600 "doz %
4,%
2,%
1\;{ai|addic} %
4,%
4,-
1\;{aze.|addze.} %
0,%
3"
6601 [(set_attr "type" "compare")
6602 (set_attr "length" "
12")])
6605 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6606 (neg:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6609 "{sfi|subfic} %
0,%
1,
0\;{ame|addme} %
0,%
0\;{srai|srawi} %
0,%
0,
31"
6610 [(set_attr "length" "
12")])
6613 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6614 (neg:SI (gt:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6615 (match_operand:SI
2 "reg_or_short_operand" "r"))))]
6617 "doz %
0,%
2,%
1\;nabs %
0,%
0\;{srai|srawi} %
0,%
0,
31"
6618 [(set_attr "length" "
12")])
6621 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6622 (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6623 (match_operand:SI
2 "reg_or_short_operand" "rI")))]
6625 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{sfe|subfe} %
0,%
0,%
0\;neg %
0,%
0"
6626 [(set_attr "length" "
12")])
6629 [(set (match_operand:CC
3 "cc_reg_operand" "=x")
6631 (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6632 (match_operand:SI
2 "reg_or_short_operand" "rI"))
6634 (set (match_operand:SI
0 "gpc_reg_operand" "=r")
6635 (gtu:SI (match_dup
1) (match_dup
2)))]
6637 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{sfe|subfe} %
0,%
0,%
0\;neg. %
0,%
0"
6638 [(set_attr "type" "compare")
6639 (set_attr "length" "
12")])
6642 [(set (match_operand:SI
0 "gpc_reg_operand" "=r,r,r")
6643 (plus:SI (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r,r")
6644 (match_operand:SI
2 "reg_or_short_operand" "I,r,rI"))
6645 (match_operand:SI
3 "reg_or_short_operand" "r,r,I")))
6646 (clobber (match_scratch:SI
4 "=&r,&r,&r"))]
6649 {ai|addic} %
4,%
1,%k2\;{aze|addze} %
0,%
3
6650 {sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3
6651 {sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;{sf%I3|subf%I3c} %
0,%
4,%
3"
6652 [(set_attr "length" "
8,
12,
12")])
6655 [(set (match_operand:CC
0 "cc_reg_operand" "=x,x")
6657 (plus:SI (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6658 (match_operand:SI
2 "reg_or_short_operand" "I,r"))
6659 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6661 (clobber (match_scratch:SI
4 "=&r,&r"))]
6664 {ai|addic} %
4,%
1,%k2\;{aze.|addze.} %
0,%
3
6665 {sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
0,%
4,%
3"
6666 [(set_attr "type" "compare")
6667 (set_attr "length" "
8,
12")])
6670 [(set (match_operand:CC
5 "cc_reg_operand" "=x,x")
6672 (plus:SI (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r,r")
6673 (match_operand:SI
2 "reg_or_short_operand" "I,r"))
6674 (match_operand:SI
3 "gpc_reg_operand" "r,r"))
6676 (set (match_operand:SI
0 "gpc_reg_operand" "=r,r")
6677 (plus:SI (gtu:SI (match_dup
1) (match_dup
2)) (match_dup
3)))
6678 (clobber (match_scratch:SI
4 "=&r,&r"))]
6681 {ai|addic} %
4,%
1,%k2\;{aze.|addze.} %
0,%
3
6682 {sf%I2|subf%I2c} %
4,%
1,%
2\;{sfe|subfe} %
4,%
4,%
4\;{sf.|subfc.} %
0,%
4,%
3"
6683 [(set_attr "type" "compare")
6684 (set_attr "length" "
8,
12")])
6687 [(set (match_operand:SI
0 "gpc_reg_operand" "=r")
6688 (neg:SI (gtu:SI (match_operand:SI
1 "gpc_reg_operand" "r")
6689 (match_operand:SI
2 "reg_or_short_operand" "rI"))))]
6691 "{sf%I2|subf%I2c} %
0,%
1,%
2\;{sfe|subfe} %
0,%
0,%
0"
6692 [(set_attr "length" "
8")])
6694 ;; Define both directions of branch and return. If we need a reload
6695 ;; register, we'd rather use CR0 since it is much easier to copy a
6696 ;; register CC value to there.
6700 (if_then_else (match_operator
1 "branch_comparison_operator"
6702 "cc_reg_operand" "x,?y")
6704 (label_ref (match_operand
0 "" ""))
6709 if (get_attr_length (insn) ==
8)
6710 return
\"%C1bc %t1,%j1,%l0
\";
6712 return
\"%C1bc %T1,%j1,$+
8\;b %l0
\";
6714 [(set_attr "type" "branch")])
6718 (if_then_else (match_operator
0 "branch_comparison_operator"
6720 "cc_reg_operand" "x,?y")
6725 "{%C0bcr|%C0bclr} %t0,%j0"
6726 [(set_attr "length" "
8")])
6730 (if_then_else (match_operator
1 "branch_comparison_operator"
6732 "cc_reg_operand" "x,?y")
6735 (label_ref (match_operand
0 "" ""))))]
6739 if (get_attr_length (insn) ==
8)
6740 return
\"%C1bc %T1,%j1,%l0
\";
6742 return
\"%C1bc %t1,%j1,$+
8\;b %l0
\";
6744 [(set_attr "type" "branch")])
6748 (if_then_else (match_operator
0 "branch_comparison_operator"
6750 "cc_reg_operand" "x,?y")
6755 "{%C0bcr|%C0bclr} %T0,%j0"
6756 [(set_attr "length" "
8")])
6758 ;; Unconditional branch and return.
6762 (label_ref (match_operand
0 "" "")))]
6766 (define_insn "return"
6770 [(set_attr "type" "jmpreg")])
6772 (define_insn "indirect_jump"
6773 [(set (pc) (match_operand:SI
0 "register_operand" "c,l"))]
6778 [(set_attr "type" "jmpreg")])
6780 ;; Table jump for switch statements:
6781 (define_expand "tablejump"
6783 (plus:SI (match_operand:SI
0 "" "")
6785 (parallel [(set (pc) (match_dup
3))
6786 (use (label_ref (match_operand
1 "" "")))])]
6789 { operands[
0] = force_reg (SImode, operands[
0]);
6790 operands[
2] = force_reg (SImode, gen_rtx (LABEL_REF, VOIDmode, operands[
1]));
6791 operands[
3] = gen_reg_rtx (SImode);
6796 (match_operand:SI
0 "register_operand" "c,l"))
6797 (use (label_ref (match_operand
1 "" "")))]
6808 ;; Define the subtract-one-and-jump insns, starting with the template
6809 ;; so loop.c knows what to generate.
6811 (define_expand "decrement_and_branchsi"
6812 [(parallel [(set (pc) (if_then_else (ne (match_operand:SI
0 "register_operand" "c")
6814 (label_ref (match_operand
1 "" ""))
6816 (set (match_dup
0) (plus:SI (match_dup
0) (const_int -
1)))])]
6820 ;; We need to be able to do this for any operand, including MEM, or we
6821 ;; will cause reload to blow up since we don't allow output reloads on
6825 (if_then_else (ne (match_operand:SI
1 "register_operand" "
0,*r,*r")
6827 (label_ref (match_operand
2 "" ""))
6829 (set (match_operand:SI
0 "register_operand" "=c,*r,m*q*c*l")
6830 (plus:SI (match_dup
1) (const_int -
1)))
6831 (clobber (match_scratch:CC
3 "=X,&x,&x"))
6832 (clobber (match_scratch:SI
4 "=X,X,r"))]
6836 if (which_alternative !=
0)
6838 else if (get_attr_length (insn) ==
8)
6839 return
\"{bdn|bdnz} %l2
\";
6841 return
\"bdz $+
8\;b %l2
\";
6843 [(set_attr "type" "branch")
6844 (set_attr "length" "*,
12,
16")])
6846 ;; Similar, but we can use GE since we have a REG_NONNEG.
6849 (if_then_else (ge (match_operand:SI
1 "register_operand" "
0,*r,*r")
6851 (label_ref (match_operand
2 "" ""))
6853 (set (match_operand:SI
0 "register_operand" "=c,*r,m*q*c*l")
6854 (plus:SI (match_dup
1) (const_int -
1)))
6855 (clobber (match_scratch:CC
3 "=X,&x,&X"))
6856 (clobber (match_scratch:SI
4 "=X,X,r"))]
6857 "find_reg_note (insn, REG_NONNEG,
0)"
6860 if (which_alternative !=
0)
6862 else if (get_attr_length (insn) ==
8)
6863 return
\"{bdn|bdnz} %l2
\";
6865 return
\"bdz $+
8\;b %l2
\";
6867 [(set_attr "type" "branch")
6868 (set_attr "length" "*,
12,
16")])
6872 (if_then_else (eq (match_operand:SI
1 "register_operand" "
0,*r,*r")
6874 (label_ref (match_operand
2 "" ""))
6876 (set (match_operand:SI
0 "register_operand" "=c,*r,m*q*c*l")
6877 (plus:SI (match_dup
1) (const_int -
1)))
6878 (clobber (match_scratch:CC
3 "=X,&x,&x"))
6879 (clobber (match_scratch:SI
4 "=X,X,r"))]
6883 if (which_alternative !=
0)
6885 else if (get_attr_length (insn) ==
8)
6888 return
\"{bdn|bdnz} $+
8\;b %l2
\";
6890 [(set_attr "type" "branch")
6891 (set_attr "length" "*,
12,
16")])
6895 (if_then_else (match_operator
2 "comparison_operator"
6896 [(match_operand:SI
1 "gpc_reg_operand" "")
6898 (match_operand
5 "" "")
6899 (match_operand
6 "" "")))
6900 (set (match_operand:SI
0 "gpc_reg_operand" "")
6901 (plus:SI (match_dup
1) (const_int -
1)))
6902 (clobber (match_scratch:CC
3 ""))
6903 (clobber (match_scratch:SI
4 ""))]
6905 [(parallel [(set (match_dup
3)
6906 (compare:CC (plus:SI (match_dup
1) (const_int -
1))
6908 (set (match_dup
0) (plus:SI (match_dup
1) (const_int -
1)))])
6909 (set (pc) (if_then_else (match_dup
7) (match_dup
5) (match_dup
6)))]
6911 { operands[
7] = gen_rtx (GET_CODE (operands[
2]), VOIDmode, operands[
3],
6916 (if_then_else (match_operator
2 "comparison_operator"
6917 [(match_operand:SI
1 "gpc_reg_operand" "")
6919 (match_operand
5 "" "")
6920 (match_operand
6 "" "")))
6921 (set (match_operand:SI
0 "general_operand" "")
6922 (plus:SI (match_dup
1) (const_int -
1)))
6923 (clobber (match_scratch:CC
3 ""))
6924 (clobber (match_scratch:SI
4 ""))]
6925 "reload_completed && ! gpc_reg_operand (operands[
0], SImode)"
6926 [(parallel [(set (match_dup
3)
6927 (compare:CC (plus:SI (match_dup
1) (const_int -
1))
6929 (set (match_dup
4) (plus:SI (match_dup
1) (const_int -
1)))])
6930 (set (match_dup
0) (match_dup
4))
6931 (set (pc) (if_then_else (match_dup
7) (match_dup
5) (match_dup
6)))]
6933 { operands[
7] = gen_rtx (GET_CODE (operands[
2]), VOIDmode, operands[
3],