1 ;;- Machine description for HP PA-RISC architecture for GCC compiler
2 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 ;; 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 ;; Contributed by the Center for Software Science at the University
7 ;; This file is part of GCC.
9 ;; GCC is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GCC is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GCC; see the file COPYING. If not, write to
21 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 ;; Boston, MA 02110-1301, USA.
24 ;; This gcc Version 2 machine description is inspired by sparc.md and
27 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
29 ;; Uses of UNSPEC in this file:
32 [(UNSPEC_CFFC 0) ; canonicalize_funcptr_for_compare
33 (UNSPEC_GOTO 1) ; indirect_goto
34 (UNSPEC_DLTIND14R 2) ;
47 [(UNSPECV_BLOCKAGE 0) ; blockage
48 (UNSPECV_DCACHE 1) ; dcacheflush
49 (UNSPECV_ICACHE 2) ; icacheflush
50 (UNSPECV_OPC 3) ; outline_prologue_call
51 (UNSPECV_OEC 4) ; outline_epilogue_call
52 (UNSPECV_LONGJMP 5) ; builtin_longjmp
55 ;; Insn type. Used to default other attribute values.
57 ;; type "unary" insns have one input operand (1) and one output operand (0)
58 ;; type "binary" insns have two input operands (1,2) and one output (0)
61 "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch"
62 (const_string "binary"))
64 (define_attr "pa_combine_type"
65 "fmpy,faddsub,uncond_branch,addmove,none"
66 (const_string "none"))
68 ;; Processor type (for scheduling, not code generation) -- this attribute
69 ;; must exactly match the processor_type enumeration in pa.h.
71 ;; FIXME: Add 800 scheduling for completeness?
73 (define_attr "cpu" "700,7100,7100LC,7200,7300,8000" (const (symbol_ref "pa_cpu_attr")))
75 ;; Length (in # of bytes).
76 (define_attr "length" ""
77 (cond [(eq_attr "type" "load,fpload")
78 (if_then_else (match_operand 1 "symbolic_memory_operand" "")
79 (const_int 8) (const_int 4))
81 (eq_attr "type" "store,fpstore")
82 (if_then_else (match_operand 0 "symbolic_memory_operand" "")
83 (const_int 8) (const_int 4))
85 (eq_attr "type" "binary,shift,nullshift")
86 (if_then_else (match_operand 2 "arith_operand" "")
87 (const_int 4) (const_int 12))
89 (eq_attr "type" "move,unary,shift,nullshift")
90 (if_then_else (match_operand 1 "arith_operand" "")
91 (const_int 4) (const_int 8))]
95 (define_asm_attributes
96 [(set_attr "length" "4")
97 (set_attr "type" "multi")])
99 ;; Attributes for instruction and branch scheduling
101 ;; For conditional branches.
102 (define_attr "in_branch_delay" "false,true"
103 (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
104 (eq_attr "length" "4"))
105 (const_string "true")
106 (const_string "false")))
108 ;; Disallow instructions which use the FPU since they will tie up the FPU
109 ;; even if the instruction is nullified.
110 (define_attr "in_nullified_branch_delay" "false,true"
111 (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch")
112 (eq_attr "length" "4"))
113 (const_string "true")
114 (const_string "false")))
116 ;; For calls and millicode calls. Allow unconditional branches in the
118 (define_attr "in_call_delay" "false,true"
119 (cond [(and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
120 (eq_attr "length" "4"))
121 (const_string "true")
122 (eq_attr "type" "uncond_branch")
123 (if_then_else (ne (symbol_ref "TARGET_JUMP_IN_DELAY")
125 (const_string "true")
126 (const_string "false"))]
127 (const_string "false")))
130 ;; Call delay slot description.
131 (define_delay (eq_attr "type" "call")
132 [(eq_attr "in_call_delay" "true") (nil) (nil)])
134 ;; Millicode call delay slot description.
135 (define_delay (eq_attr "type" "milli")
136 [(eq_attr "in_call_delay" "true") (nil) (nil)])
138 ;; Return and other similar instructions.
139 (define_delay (eq_attr "type" "btable_branch,branch,parallel_branch")
140 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
142 ;; Floating point conditional branch delay slot description and
143 (define_delay (eq_attr "type" "fbranch")
144 [(eq_attr "in_branch_delay" "true")
145 (eq_attr "in_nullified_branch_delay" "true")
148 ;; Integer conditional branch delay slot description.
149 ;; Nullification of conditional branches on the PA is dependent on the
150 ;; direction of the branch. Forward branches nullify true and
151 ;; backward branches nullify false. If the direction is unknown
152 ;; then nullification is not allowed.
153 (define_delay (eq_attr "type" "cbranch")
154 [(eq_attr "in_branch_delay" "true")
155 (and (eq_attr "in_nullified_branch_delay" "true")
156 (attr_flag "forward"))
157 (and (eq_attr "in_nullified_branch_delay" "true")
158 (attr_flag "backward"))])
160 (define_delay (and (eq_attr "type" "uncond_branch")
161 (eq (symbol_ref "following_call (insn)")
163 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
165 ;; Memory. Disregarding Cache misses, the Mustang memory times are:
166 ;; load: 2, fpload: 3
167 ;; store, fpstore: 3, no D-cache operations should be scheduled.
169 ;; The Timex (aka 700) has two floating-point units: ALU, and MUL/DIV/SQRT.
171 ;; Instruction Time Unit Minimum Distance (unit contention)
178 ;; fmpyadd 3 ALU,MPY 2
179 ;; fmpysub 3 ALU,MPY 2
180 ;; fmpycfxt 3 ALU,MPY 2
183 ;; fdiv,sgl 10 MPY 10
184 ;; fdiv,dbl 12 MPY 12
185 ;; fsqrt,sgl 14 MPY 14
186 ;; fsqrt,dbl 18 MPY 18
188 ;; We don't model fmpyadd/fmpysub properly as those instructions
189 ;; keep both the FP ALU and MPY units busy. Given that these
190 ;; processors are obsolete, I'm not going to spend the time to
191 ;; model those instructions correctly.
193 (define_automaton "pa700")
194 (define_cpu_unit "dummy_700,mem_700,fpalu_700,fpmpy_700" "pa700")
196 (define_insn_reservation "W0" 4
197 (and (eq_attr "type" "fpcc")
198 (eq_attr "cpu" "700"))
201 (define_insn_reservation "W1" 3
202 (and (eq_attr "type" "fpalu")
203 (eq_attr "cpu" "700"))
206 (define_insn_reservation "W2" 3
207 (and (eq_attr "type" "fpmulsgl,fpmuldbl")
208 (eq_attr "cpu" "700"))
211 (define_insn_reservation "W3" 10
212 (and (eq_attr "type" "fpdivsgl")
213 (eq_attr "cpu" "700"))
216 (define_insn_reservation "W4" 12
217 (and (eq_attr "type" "fpdivdbl")
218 (eq_attr "cpu" "700"))
221 (define_insn_reservation "W5" 14
222 (and (eq_attr "type" "fpsqrtsgl")
223 (eq_attr "cpu" "700"))
226 (define_insn_reservation "W6" 18
227 (and (eq_attr "type" "fpsqrtdbl")
228 (eq_attr "cpu" "700"))
231 (define_insn_reservation "W7" 2
232 (and (eq_attr "type" "load")
233 (eq_attr "cpu" "700"))
236 (define_insn_reservation "W8" 2
237 (and (eq_attr "type" "fpload")
238 (eq_attr "cpu" "700"))
241 (define_insn_reservation "W9" 3
242 (and (eq_attr "type" "store")
243 (eq_attr "cpu" "700"))
246 (define_insn_reservation "W10" 3
247 (and (eq_attr "type" "fpstore")
248 (eq_attr "cpu" "700"))
251 (define_insn_reservation "W11" 1
252 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,load,fpload,store,fpstore")
253 (eq_attr "cpu" "700"))
256 ;; We have a bypass for all computations in the FP unit which feed an
257 ;; FP store as long as the sizes are the same.
258 (define_bypass 2 "W1,W2" "W10" "hppa_fpstore_bypass_p")
259 (define_bypass 9 "W3" "W10" "hppa_fpstore_bypass_p")
260 (define_bypass 11 "W4" "W10" "hppa_fpstore_bypass_p")
261 (define_bypass 13 "W5" "W10" "hppa_fpstore_bypass_p")
262 (define_bypass 17 "W6" "W10" "hppa_fpstore_bypass_p")
264 ;; We have an "anti-bypass" for FP loads which feed an FP store.
265 (define_bypass 4 "W8" "W10" "hppa_fpstore_bypass_p")
267 ;; Function units for the 7100 and 7150. The 7100/7150 can dual-issue
268 ;; floating point computations with non-floating point computations (fp loads
269 ;; and stores are not fp computations).
271 ;; Memory. Disregarding Cache misses, memory loads take two cycles; stores also
272 ;; take two cycles, during which no Dcache operations should be scheduled.
273 ;; Any special cases are handled in pa_adjust_cost. The 7100, 7150 and 7100LC
274 ;; all have the same memory characteristics if one disregards cache misses.
276 ;; The 7100/7150 has three floating-point units: ALU, MUL, and DIV.
277 ;; There's no value in modeling the ALU and MUL separately though
278 ;; since there can never be a functional unit conflict given the
279 ;; latency and issue rates for those units.
282 ;; Instruction Time Unit Minimum Distance (unit contention)
289 ;; fmpyadd 2 ALU,MPY 1
290 ;; fmpysub 2 ALU,MPY 1
291 ;; fmpycfxt 2 ALU,MPY 1
295 ;; fdiv,dbl 15 DIV 15
297 ;; fsqrt,dbl 15 DIV 15
299 (define_automaton "pa7100")
300 (define_cpu_unit "i_7100, f_7100,fpmac_7100,fpdivsqrt_7100,mem_7100" "pa7100")
302 (define_insn_reservation "X0" 2
303 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
304 (eq_attr "cpu" "7100"))
307 (define_insn_reservation "X1" 8
308 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl")
309 (eq_attr "cpu" "7100"))
310 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*7")
312 (define_insn_reservation "X2" 15
313 (and (eq_attr "type" "fpdivdbl,fpsqrtdbl")
314 (eq_attr "cpu" "7100"))
315 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*14")
317 (define_insn_reservation "X3" 2
318 (and (eq_attr "type" "load")
319 (eq_attr "cpu" "7100"))
322 (define_insn_reservation "X4" 2
323 (and (eq_attr "type" "fpload")
324 (eq_attr "cpu" "7100"))
327 (define_insn_reservation "X5" 2
328 (and (eq_attr "type" "store")
329 (eq_attr "cpu" "7100"))
330 "i_7100+mem_7100,mem_7100")
332 (define_insn_reservation "X6" 2
333 (and (eq_attr "type" "fpstore")
334 (eq_attr "cpu" "7100"))
335 "i_7100+mem_7100,mem_7100")
337 (define_insn_reservation "X7" 1
338 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore")
339 (eq_attr "cpu" "7100"))
342 ;; We have a bypass for all computations in the FP unit which feed an
343 ;; FP store as long as the sizes are the same.
344 (define_bypass 1 "X0" "X6" "hppa_fpstore_bypass_p")
345 (define_bypass 7 "X1" "X6" "hppa_fpstore_bypass_p")
346 (define_bypass 14 "X2" "X6" "hppa_fpstore_bypass_p")
348 ;; We have an "anti-bypass" for FP loads which feed an FP store.
349 (define_bypass 3 "X4" "X6" "hppa_fpstore_bypass_p")
351 ;; The 7100LC has three floating-point units: ALU, MUL, and DIV.
352 ;; There's no value in modeling the ALU and MUL separately though
353 ;; since there can never be a functional unit conflict that
354 ;; can be avoided given the latency, issue rates and mandatory
355 ;; one cycle cpu-wide lock for a double precision fp multiply.
358 ;; Instruction Time Unit Minimum Distance (unit contention)
365 ;; fmpyadd,sgl 2 ALU,MPY 1
366 ;; fmpyadd,dbl 3 ALU,MPY 2
367 ;; fmpysub,sgl 2 ALU,MPY 1
368 ;; fmpysub,dbl 3 ALU,MPY 2
369 ;; fmpycfxt,sgl 2 ALU,MPY 1
370 ;; fmpycfxt,dbl 3 ALU,MPY 2
375 ;; fdiv,dbl 15 DIV 15
377 ;; fsqrt,dbl 15 DIV 15
379 ;; The PA7200 is just like the PA7100LC except that there is
380 ;; no store-store penalty.
382 ;; The PA7300 is just like the PA7200 except that there is
383 ;; no store-load penalty.
385 ;; Note there are some aspects of the 7100LC we are not modeling
386 ;; at the moment. I'll be reviewing the 7100LC scheduling info
387 ;; shortly and updating this description.
391 ;; other issue modeling
393 (define_automaton "pa7100lc")
394 (define_cpu_unit "i0_7100lc, i1_7100lc, f_7100lc" "pa7100lc")
395 (define_cpu_unit "fpmac_7100lc" "pa7100lc")
396 (define_cpu_unit "mem_7100lc" "pa7100lc")
398 ;; Double precision multiplies lock the entire CPU for one
399 ;; cycle. There is no way to avoid this lock and trying to
400 ;; schedule around the lock is pointless and thus there is no
401 ;; value in trying to model this lock.
403 ;; Not modeling the lock allows us to treat fp multiplies just
404 ;; like any other FP alu instruction. It allows for a smaller
405 ;; DFA and may reduce register pressure.
406 (define_insn_reservation "Y0" 2
407 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
408 (eq_attr "cpu" "7100LC,7200,7300"))
409 "f_7100lc,fpmac_7100lc")
411 ;; fp division and sqrt instructions lock the entire CPU for
412 ;; 7 cycles (single precision) or 14 cycles (double precision).
413 ;; There is no way to avoid this lock and trying to schedule
414 ;; around the lock is pointless and thus there is no value in
415 ;; trying to model this lock. Not modeling the lock allows
416 ;; for a smaller DFA and may reduce register pressure.
417 (define_insn_reservation "Y1" 1
418 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl")
419 (eq_attr "cpu" "7100LC,7200,7300"))
422 (define_insn_reservation "Y2" 2
423 (and (eq_attr "type" "load")
424 (eq_attr "cpu" "7100LC,7200,7300"))
425 "i1_7100lc+mem_7100lc")
427 (define_insn_reservation "Y3" 2
428 (and (eq_attr "type" "fpload")
429 (eq_attr "cpu" "7100LC,7200,7300"))
430 "i1_7100lc+mem_7100lc")
432 (define_insn_reservation "Y4" 2
433 (and (eq_attr "type" "store")
434 (eq_attr "cpu" "7100LC"))
435 "i1_7100lc+mem_7100lc,mem_7100lc")
437 (define_insn_reservation "Y5" 2
438 (and (eq_attr "type" "fpstore")
439 (eq_attr "cpu" "7100LC"))
440 "i1_7100lc+mem_7100lc,mem_7100lc")
442 (define_insn_reservation "Y6" 1
443 (and (eq_attr "type" "shift,nullshift")
444 (eq_attr "cpu" "7100LC,7200,7300"))
447 (define_insn_reservation "Y7" 1
448 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift")
449 (eq_attr "cpu" "7100LC,7200,7300"))
450 "(i0_7100lc|i1_7100lc)")
452 ;; The 7200 has a store-load penalty
453 (define_insn_reservation "Y8" 2
454 (and (eq_attr "type" "store")
455 (eq_attr "cpu" "7200"))
456 "i1_7100lc,mem_7100lc")
458 (define_insn_reservation "Y9" 2
459 (and (eq_attr "type" "fpstore")
460 (eq_attr "cpu" "7200"))
461 "i1_7100lc,mem_7100lc")
463 ;; The 7300 has no penalty for store-store or store-load
464 (define_insn_reservation "Y10" 2
465 (and (eq_attr "type" "store")
466 (eq_attr "cpu" "7300"))
469 (define_insn_reservation "Y11" 2
470 (and (eq_attr "type" "fpstore")
471 (eq_attr "cpu" "7300"))
474 ;; We have an "anti-bypass" for FP loads which feed an FP store.
475 (define_bypass 3 "Y3" "Y5,Y9,Y11" "hppa_fpstore_bypass_p")
477 ;; Scheduling for the PA8000 is somewhat different than scheduling for a
478 ;; traditional architecture.
480 ;; The PA8000 has a large (56) entry reorder buffer that is split between
481 ;; memory and non-memory operations.
483 ;; The PA8000 can issue two memory and two non-memory operations per cycle to
484 ;; the function units, with the exception of branches and multi-output
485 ;; instructions. The PA8000 can retire two non-memory operations per cycle
486 ;; and two memory operations per cycle, only one of which may be a store.
488 ;; Given the large reorder buffer, the processor can hide most latencies.
489 ;; According to HP, they've got the best results by scheduling for retirement
490 ;; bandwidth with limited latency scheduling for floating point operations.
491 ;; Latency for integer operations and memory references is ignored.
494 ;; We claim floating point operations have a 2 cycle latency and are
495 ;; fully pipelined, except for div and sqrt which are not pipelined and
496 ;; take from 17 to 31 cycles to complete.
498 ;; It's worth noting that there is no way to saturate all the functional
499 ;; units on the PA8000 as there is not enough issue bandwidth.
501 (define_automaton "pa8000")
502 (define_cpu_unit "inm0_8000, inm1_8000, im0_8000, im1_8000" "pa8000")
503 (define_cpu_unit "rnm0_8000, rnm1_8000, rm0_8000, rm1_8000" "pa8000")
504 (define_cpu_unit "store_8000" "pa8000")
505 (define_cpu_unit "f0_8000, f1_8000" "pa8000")
506 (define_cpu_unit "fdivsqrt0_8000, fdivsqrt1_8000" "pa8000")
507 (define_reservation "inm_8000" "inm0_8000 | inm1_8000")
508 (define_reservation "im_8000" "im0_8000 | im1_8000")
509 (define_reservation "rnm_8000" "rnm0_8000 | rnm1_8000")
510 (define_reservation "rm_8000" "rm0_8000 | rm1_8000")
511 (define_reservation "f_8000" "f0_8000 | f1_8000")
512 (define_reservation "fdivsqrt_8000" "fdivsqrt0_8000 | fdivsqrt1_8000")
514 ;; We can issue any two memops per cycle, but we can only retire
515 ;; one memory store per cycle. We assume that the reorder buffer
516 ;; will hide any memory latencies per HP's recommendation.
517 (define_insn_reservation "Z0" 0
519 (eq_attr "type" "load,fpload")
520 (eq_attr "cpu" "8000"))
523 (define_insn_reservation "Z1" 0
525 (eq_attr "type" "store,fpstore")
526 (eq_attr "cpu" "8000"))
527 "im_8000,rm_8000+store_8000")
529 ;; We can issue and retire two non-memory operations per cycle with
530 ;; a few exceptions (branches). This group catches those we want
531 ;; to assume have zero latency.
532 (define_insn_reservation "Z2" 0
534 (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl")
535 (eq_attr "cpu" "8000"))
538 ;; Branches use both slots in the non-memory issue and
540 (define_insn_reservation "Z3" 0
542 (eq_attr "type" "uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
543 (eq_attr "cpu" "8000"))
544 "inm0_8000+inm1_8000,rnm0_8000+rnm1_8000")
546 ;; We partial latency schedule the floating point units.
547 ;; They can issue/retire two at a time in the non-memory
548 ;; units. We fix their latency at 2 cycles and they
549 ;; are fully pipelined.
550 (define_insn_reservation "Z4" 1
552 (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
553 (eq_attr "cpu" "8000"))
554 "inm_8000,f_8000,rnm_8000")
556 ;; The fdivsqrt units are not pipelined and have a very long latency.
557 ;; To keep the DFA from exploding, we do not show all the
558 ;; reservations for the divsqrt unit.
559 (define_insn_reservation "Z5" 17
561 (eq_attr "type" "fpdivsgl,fpsqrtsgl")
562 (eq_attr "cpu" "8000"))
563 "inm_8000,fdivsqrt_8000*6,rnm_8000")
565 (define_insn_reservation "Z6" 31
567 (eq_attr "type" "fpdivdbl,fpsqrtdbl")
568 (eq_attr "cpu" "8000"))
569 "inm_8000,fdivsqrt_8000*6,rnm_8000")
571 (include "predicates.md")
573 ;; Compare instructions.
574 ;; This controls RTL generation and register allocation.
576 ;; We generate RTL for comparisons and branches by having the cmpxx
577 ;; patterns store away the operands. Then, the scc and bcc patterns
578 ;; emit RTL for both the compare and the branch.
581 (define_expand "cmpdi"
583 (compare:CC (match_operand:DI 0 "reg_or_0_operand" "")
584 (match_operand:DI 1 "register_operand" "")))]
589 hppa_compare_op0 = operands[0];
590 hppa_compare_op1 = operands[1];
591 hppa_branch_type = CMP_SI;
595 (define_expand "cmpsi"
597 (compare:CC (match_operand:SI 0 "reg_or_0_operand" "")
598 (match_operand:SI 1 "arith5_operand" "")))]
602 hppa_compare_op0 = operands[0];
603 hppa_compare_op1 = operands[1];
604 hppa_branch_type = CMP_SI;
608 (define_expand "cmpsf"
610 (compare:CCFP (match_operand:SF 0 "reg_or_0_operand" "")
611 (match_operand:SF 1 "reg_or_0_operand" "")))]
612 "! TARGET_SOFT_FLOAT"
615 hppa_compare_op0 = operands[0];
616 hppa_compare_op1 = operands[1];
617 hppa_branch_type = CMP_SF;
621 (define_expand "cmpdf"
623 (compare:CCFP (match_operand:DF 0 "reg_or_0_operand" "")
624 (match_operand:DF 1 "reg_or_0_operand" "")))]
625 "! TARGET_SOFT_FLOAT"
628 hppa_compare_op0 = operands[0];
629 hppa_compare_op1 = operands[1];
630 hppa_branch_type = CMP_DF;
636 (match_operator:CCFP 2 "comparison_operator"
637 [(match_operand:SF 0 "reg_or_0_operand" "fG")
638 (match_operand:SF 1 "reg_or_0_operand" "fG")]))]
639 "! TARGET_SOFT_FLOAT"
640 "fcmp,sgl,%Y2 %f0,%f1"
641 [(set_attr "length" "4")
642 (set_attr "type" "fpcc")])
646 (match_operator:CCFP 2 "comparison_operator"
647 [(match_operand:DF 0 "reg_or_0_operand" "fG")
648 (match_operand:DF 1 "reg_or_0_operand" "fG")]))]
649 "! TARGET_SOFT_FLOAT"
650 "fcmp,dbl,%Y2 %f0,%f1"
651 [(set_attr "length" "4")
652 (set_attr "type" "fpcc")])
654 ;; Provide a means to emit the movccfp0 and movccfp1 optimization
655 ;; placeholders. This is necessary in rare situations when a
656 ;; placeholder is re-emitted (see PR 8705).
658 (define_expand "movccfp"
660 (match_operand 0 "const_int_operand" ""))]
661 "! TARGET_SOFT_FLOAT"
664 if ((unsigned HOST_WIDE_INT) INTVAL (operands[0]) > 1)
668 ;; The following patterns are optimization placeholders. In almost
669 ;; all cases, the user of the condition code will be simplified and the
670 ;; original condition code setting insn should be eliminated.
672 (define_insn "*movccfp0"
675 "! TARGET_SOFT_FLOAT"
676 "fcmp,dbl,= %%fr0,%%fr0"
677 [(set_attr "length" "4")
678 (set_attr "type" "fpcc")])
680 (define_insn "*movccfp1"
683 "! TARGET_SOFT_FLOAT"
684 "fcmp,dbl,!= %%fr0,%%fr0"
685 [(set_attr "length" "4")
686 (set_attr "type" "fpcc")])
691 [(set (match_operand:SI 0 "register_operand" "")
697 /* fp scc patterns rarely match, and are not a win on the PA. */
698 if (hppa_branch_type != CMP_SI)
700 /* set up operands from compare. */
701 operands[1] = hppa_compare_op0;
702 operands[2] = hppa_compare_op1;
703 /* fall through and generate default code */
707 [(set (match_operand:SI 0 "register_operand" "")
713 /* fp scc patterns rarely match, and are not a win on the PA. */
714 if (hppa_branch_type != CMP_SI)
716 operands[1] = hppa_compare_op0;
717 operands[2] = hppa_compare_op1;
721 [(set (match_operand:SI 0 "register_operand" "")
727 /* fp scc patterns rarely match, and are not a win on the PA. */
728 if (hppa_branch_type != CMP_SI)
730 operands[1] = hppa_compare_op0;
731 operands[2] = hppa_compare_op1;
735 [(set (match_operand:SI 0 "register_operand" "")
741 /* fp scc patterns rarely match, and are not a win on the PA. */
742 if (hppa_branch_type != CMP_SI)
744 operands[1] = hppa_compare_op0;
745 operands[2] = hppa_compare_op1;
749 [(set (match_operand:SI 0 "register_operand" "")
755 /* fp scc patterns rarely match, and are not a win on the PA. */
756 if (hppa_branch_type != CMP_SI)
758 operands[1] = hppa_compare_op0;
759 operands[2] = hppa_compare_op1;
763 [(set (match_operand:SI 0 "register_operand" "")
769 /* fp scc patterns rarely match, and are not a win on the PA. */
770 if (hppa_branch_type != CMP_SI)
772 operands[1] = hppa_compare_op0;
773 operands[2] = hppa_compare_op1;
776 (define_expand "sltu"
777 [(set (match_operand:SI 0 "register_operand" "")
778 (ltu:SI (match_dup 1)
783 if (hppa_branch_type != CMP_SI)
785 operands[1] = hppa_compare_op0;
786 operands[2] = hppa_compare_op1;
789 (define_expand "sgtu"
790 [(set (match_operand:SI 0 "register_operand" "")
791 (gtu:SI (match_dup 1)
796 if (hppa_branch_type != CMP_SI)
798 operands[1] = hppa_compare_op0;
799 operands[2] = hppa_compare_op1;
802 (define_expand "sleu"
803 [(set (match_operand:SI 0 "register_operand" "")
804 (leu:SI (match_dup 1)
809 if (hppa_branch_type != CMP_SI)
811 operands[1] = hppa_compare_op0;
812 operands[2] = hppa_compare_op1;
815 (define_expand "sgeu"
816 [(set (match_operand:SI 0 "register_operand" "")
817 (geu:SI (match_dup 1)
822 if (hppa_branch_type != CMP_SI)
824 operands[1] = hppa_compare_op0;
825 operands[2] = hppa_compare_op1;
828 ;; Instruction canonicalization puts immediate operands second, which
829 ;; is the reverse of what we want.
832 [(set (match_operand:SI 0 "register_operand" "=r")
833 (match_operator:SI 3 "comparison_operator"
834 [(match_operand:SI 1 "register_operand" "r")
835 (match_operand:SI 2 "arith11_operand" "rI")]))]
837 "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi 1,%0"
838 [(set_attr "type" "binary")
839 (set_attr "length" "8")])
842 [(set (match_operand:DI 0 "register_operand" "=r")
843 (match_operator:DI 3 "comparison_operator"
844 [(match_operand:DI 1 "register_operand" "r")
845 (match_operand:DI 2 "arith11_operand" "rI")]))]
847 "cmp%I2clr,*%B3 %2,%1,%0\;ldi 1,%0"
848 [(set_attr "type" "binary")
849 (set_attr "length" "8")])
851 (define_insn "iorscc"
852 [(set (match_operand:SI 0 "register_operand" "=r")
853 (ior:SI (match_operator:SI 3 "comparison_operator"
854 [(match_operand:SI 1 "register_operand" "r")
855 (match_operand:SI 2 "arith11_operand" "rI")])
856 (match_operator:SI 6 "comparison_operator"
857 [(match_operand:SI 4 "register_operand" "r")
858 (match_operand:SI 5 "arith11_operand" "rI")])))]
860 "{com%I2clr|cmp%I2clr},%S3 %2,%1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%4,%0\;ldi 1,%0"
861 [(set_attr "type" "binary")
862 (set_attr "length" "12")])
865 [(set (match_operand:DI 0 "register_operand" "=r")
866 (ior:DI (match_operator:DI 3 "comparison_operator"
867 [(match_operand:DI 1 "register_operand" "r")
868 (match_operand:DI 2 "arith11_operand" "rI")])
869 (match_operator:DI 6 "comparison_operator"
870 [(match_operand:DI 4 "register_operand" "r")
871 (match_operand:DI 5 "arith11_operand" "rI")])))]
873 "cmp%I2clr,*%S3 %2,%1,%%r0\;cmp%I5clr,*%B6 %5,%4,%0\;ldi 1,%0"
874 [(set_attr "type" "binary")
875 (set_attr "length" "12")])
877 ;; Combiner patterns for common operations performed with the output
878 ;; from an scc insn (negscc and incscc).
879 (define_insn "negscc"
880 [(set (match_operand:SI 0 "register_operand" "=r")
881 (neg:SI (match_operator:SI 3 "comparison_operator"
882 [(match_operand:SI 1 "register_operand" "r")
883 (match_operand:SI 2 "arith11_operand" "rI")])))]
885 "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi -1,%0"
886 [(set_attr "type" "binary")
887 (set_attr "length" "8")])
890 [(set (match_operand:DI 0 "register_operand" "=r")
891 (neg:DI (match_operator:DI 3 "comparison_operator"
892 [(match_operand:DI 1 "register_operand" "r")
893 (match_operand:DI 2 "arith11_operand" "rI")])))]
895 "cmp%I2clr,*%B3 %2,%1,%0\;ldi -1,%0"
896 [(set_attr "type" "binary")
897 (set_attr "length" "8")])
899 ;; Patterns for adding/subtracting the result of a boolean expression from
900 ;; a register. First we have special patterns that make use of the carry
901 ;; bit, and output only two instructions. For the cases we can't in
902 ;; general do in two instructions, the incscc pattern at the end outputs
903 ;; two or three instructions.
906 [(set (match_operand:SI 0 "register_operand" "=r")
907 (plus:SI (leu:SI (match_operand:SI 2 "register_operand" "r")
908 (match_operand:SI 3 "arith11_operand" "rI"))
909 (match_operand:SI 1 "register_operand" "r")))]
911 "sub%I3 %3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
912 [(set_attr "type" "binary")
913 (set_attr "length" "8")])
916 [(set (match_operand:DI 0 "register_operand" "=r")
917 (plus:DI (leu:DI (match_operand:DI 2 "register_operand" "r")
918 (match_operand:DI 3 "arith11_operand" "rI"))
919 (match_operand:DI 1 "register_operand" "r")))]
921 "sub%I3 %3,%2,%%r0\;add,dc %%r0,%1,%0"
922 [(set_attr "type" "binary")
923 (set_attr "length" "8")])
925 ; This need only accept registers for op3, since canonicalization
926 ; replaces geu with gtu when op3 is an integer.
928 [(set (match_operand:SI 0 "register_operand" "=r")
929 (plus:SI (geu:SI (match_operand:SI 2 "register_operand" "r")
930 (match_operand:SI 3 "register_operand" "r"))
931 (match_operand:SI 1 "register_operand" "r")))]
933 "sub %2,%3,%%r0\;{addc|add,c} %%r0,%1,%0"
934 [(set_attr "type" "binary")
935 (set_attr "length" "8")])
938 [(set (match_operand:DI 0 "register_operand" "=r")
939 (plus:DI (geu:DI (match_operand:DI 2 "register_operand" "r")
940 (match_operand:DI 3 "register_operand" "r"))
941 (match_operand:DI 1 "register_operand" "r")))]
943 "sub %2,%3,%%r0\;add,dc %%r0,%1,%0"
944 [(set_attr "type" "binary")
945 (set_attr "length" "8")])
947 ; Match only integers for op3 here. This is used as canonical form of the
948 ; geu pattern when op3 is an integer. Don't match registers since we can't
949 ; make better code than the general incscc pattern.
951 [(set (match_operand:SI 0 "register_operand" "=r")
952 (plus:SI (gtu:SI (match_operand:SI 2 "register_operand" "r")
953 (match_operand:SI 3 "int11_operand" "I"))
954 (match_operand:SI 1 "register_operand" "r")))]
956 "addi %k3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
957 [(set_attr "type" "binary")
958 (set_attr "length" "8")])
961 [(set (match_operand:DI 0 "register_operand" "=r")
962 (plus:DI (gtu:DI (match_operand:DI 2 "register_operand" "r")
963 (match_operand:DI 3 "int11_operand" "I"))
964 (match_operand:DI 1 "register_operand" "r")))]
966 "addi %k3,%2,%%r0\;add,dc %%r0,%1,%0"
967 [(set_attr "type" "binary")
968 (set_attr "length" "8")])
970 (define_insn "incscc"
971 [(set (match_operand:SI 0 "register_operand" "=r,r")
972 (plus:SI (match_operator:SI 4 "comparison_operator"
973 [(match_operand:SI 2 "register_operand" "r,r")
974 (match_operand:SI 3 "arith11_operand" "rI,rI")])
975 (match_operand:SI 1 "register_operand" "0,?r")))]
978 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi 1,%0,%0
979 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
980 [(set_attr "type" "binary,binary")
981 (set_attr "length" "8,12")])
984 [(set (match_operand:DI 0 "register_operand" "=r,r")
985 (plus:DI (match_operator:DI 4 "comparison_operator"
986 [(match_operand:DI 2 "register_operand" "r,r")
987 (match_operand:DI 3 "arith11_operand" "rI,rI")])
988 (match_operand:DI 1 "register_operand" "0,?r")))]
991 cmp%I3clr,*%B4 %3,%2,%%r0\;addi 1,%0,%0
992 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
993 [(set_attr "type" "binary,binary")
994 (set_attr "length" "8,12")])
997 [(set (match_operand:SI 0 "register_operand" "=r")
998 (minus:SI (match_operand:SI 1 "register_operand" "r")
999 (gtu:SI (match_operand:SI 2 "register_operand" "r")
1000 (match_operand:SI 3 "arith11_operand" "rI"))))]
1002 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
1003 [(set_attr "type" "binary")
1004 (set_attr "length" "8")])
1007 [(set (match_operand:DI 0 "register_operand" "=r")
1008 (minus:DI (match_operand:DI 1 "register_operand" "r")
1009 (gtu:DI (match_operand:DI 2 "register_operand" "r")
1010 (match_operand:DI 3 "arith11_operand" "rI"))))]
1012 "sub%I3 %3,%2,%%r0\;sub,db %1,%%r0,%0"
1013 [(set_attr "type" "binary")
1014 (set_attr "length" "8")])
1017 [(set (match_operand:SI 0 "register_operand" "=r")
1018 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1019 (gtu:SI (match_operand:SI 2 "register_operand" "r")
1020 (match_operand:SI 3 "arith11_operand" "rI")))
1021 (match_operand:SI 4 "register_operand" "r")))]
1023 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
1024 [(set_attr "type" "binary")
1025 (set_attr "length" "8")])
1028 [(set (match_operand:DI 0 "register_operand" "=r")
1029 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1030 (gtu:DI (match_operand:DI 2 "register_operand" "r")
1031 (match_operand:DI 3 "arith11_operand" "rI")))
1032 (match_operand:DI 4 "register_operand" "r")))]
1034 "sub%I3 %3,%2,%%r0\;sub,db %1,%4,%0"
1035 [(set_attr "type" "binary")
1036 (set_attr "length" "8")])
1038 ; This need only accept registers for op3, since canonicalization
1039 ; replaces ltu with leu when op3 is an integer.
1041 [(set (match_operand:SI 0 "register_operand" "=r")
1042 (minus:SI (match_operand:SI 1 "register_operand" "r")
1043 (ltu:SI (match_operand:SI 2 "register_operand" "r")
1044 (match_operand:SI 3 "register_operand" "r"))))]
1046 "sub %2,%3,%%r0\;{subb|sub,b} %1,%%r0,%0"
1047 [(set_attr "type" "binary")
1048 (set_attr "length" "8")])
1051 [(set (match_operand:DI 0 "register_operand" "=r")
1052 (minus:DI (match_operand:DI 1 "register_operand" "r")
1053 (ltu:DI (match_operand:DI 2 "register_operand" "r")
1054 (match_operand:DI 3 "register_operand" "r"))))]
1056 "sub %2,%3,%%r0\;sub,db %1,%%r0,%0"
1057 [(set_attr "type" "binary")
1058 (set_attr "length" "8")])
1061 [(set (match_operand:SI 0 "register_operand" "=r")
1062 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1063 (ltu:SI (match_operand:SI 2 "register_operand" "r")
1064 (match_operand:SI 3 "register_operand" "r")))
1065 (match_operand:SI 4 "register_operand" "r")))]
1067 "sub %2,%3,%%r0\;{subb|sub,b} %1,%4,%0"
1068 [(set_attr "type" "binary")
1069 (set_attr "length" "8")])
1072 [(set (match_operand:DI 0 "register_operand" "=r")
1073 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1074 (ltu:DI (match_operand:DI 2 "register_operand" "r")
1075 (match_operand:DI 3 "register_operand" "r")))
1076 (match_operand:DI 4 "register_operand" "r")))]
1078 "sub %2,%3,%%r0\;sub,db %1,%4,%0"
1079 [(set_attr "type" "binary")
1080 (set_attr "length" "8")])
1082 ; Match only integers for op3 here. This is used as canonical form of the
1083 ; ltu pattern when op3 is an integer. Don't match registers since we can't
1084 ; make better code than the general incscc pattern.
1086 [(set (match_operand:SI 0 "register_operand" "=r")
1087 (minus:SI (match_operand:SI 1 "register_operand" "r")
1088 (leu:SI (match_operand:SI 2 "register_operand" "r")
1089 (match_operand:SI 3 "int11_operand" "I"))))]
1091 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
1092 [(set_attr "type" "binary")
1093 (set_attr "length" "8")])
1096 [(set (match_operand:DI 0 "register_operand" "=r")
1097 (minus:DI (match_operand:DI 1 "register_operand" "r")
1098 (leu:DI (match_operand:DI 2 "register_operand" "r")
1099 (match_operand:DI 3 "int11_operand" "I"))))]
1101 "addi %k3,%2,%%r0\;sub,db %1,%%r0,%0"
1102 [(set_attr "type" "binary")
1103 (set_attr "length" "8")])
1106 [(set (match_operand:SI 0 "register_operand" "=r")
1107 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1108 (leu:SI (match_operand:SI 2 "register_operand" "r")
1109 (match_operand:SI 3 "int11_operand" "I")))
1110 (match_operand:SI 4 "register_operand" "r")))]
1112 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
1113 [(set_attr "type" "binary")
1114 (set_attr "length" "8")])
1117 [(set (match_operand:DI 0 "register_operand" "=r")
1118 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1119 (leu:DI (match_operand:DI 2 "register_operand" "r")
1120 (match_operand:DI 3 "int11_operand" "I")))
1121 (match_operand:DI 4 "register_operand" "r")))]
1123 "addi %k3,%2,%%r0\;sub,db %1,%4,%0"
1124 [(set_attr "type" "binary")
1125 (set_attr "length" "8")])
1127 (define_insn "decscc"
1128 [(set (match_operand:SI 0 "register_operand" "=r,r")
1129 (minus:SI (match_operand:SI 1 "register_operand" "0,?r")
1130 (match_operator:SI 4 "comparison_operator"
1131 [(match_operand:SI 2 "register_operand" "r,r")
1132 (match_operand:SI 3 "arith11_operand" "rI,rI")])))]
1135 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi -1,%0,%0
1136 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1137 [(set_attr "type" "binary,binary")
1138 (set_attr "length" "8,12")])
1141 [(set (match_operand:DI 0 "register_operand" "=r,r")
1142 (minus:DI (match_operand:DI 1 "register_operand" "0,?r")
1143 (match_operator:DI 4 "comparison_operator"
1144 [(match_operand:DI 2 "register_operand" "r,r")
1145 (match_operand:DI 3 "arith11_operand" "rI,rI")])))]
1148 cmp%I3clr,*%B4 %3,%2,%%r0\;addi -1,%0,%0
1149 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1150 [(set_attr "type" "binary,binary")
1151 (set_attr "length" "8,12")])
1153 ; Patterns for max and min. (There is no need for an earlyclobber in the
1154 ; last alternative since the middle alternative will match if op0 == op1.)
1156 (define_insn "sminsi3"
1157 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1158 (smin:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1159 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1162 {comclr|cmpclr},> %2,%0,%%r0\;copy %2,%0
1163 {comiclr|cmpiclr},> %2,%0,%%r0\;ldi %2,%0
1164 {comclr|cmpclr},> %1,%r2,%0\;copy %1,%0"
1165 [(set_attr "type" "multi,multi,multi")
1166 (set_attr "length" "8,8,8")])
1168 (define_insn "smindi3"
1169 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1170 (smin:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1171 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1174 cmpclr,*> %2,%0,%%r0\;copy %2,%0
1175 cmpiclr,*> %2,%0,%%r0\;ldi %2,%0
1176 cmpclr,*> %1,%r2,%0\;copy %1,%0"
1177 [(set_attr "type" "multi,multi,multi")
1178 (set_attr "length" "8,8,8")])
1180 (define_insn "uminsi3"
1181 [(set (match_operand:SI 0 "register_operand" "=r,r")
1182 (umin:SI (match_operand:SI 1 "register_operand" "%0,0")
1183 (match_operand:SI 2 "arith11_operand" "r,I")))]
1186 {comclr|cmpclr},>> %2,%0,%%r0\;copy %2,%0
1187 {comiclr|cmpiclr},>> %2,%0,%%r0\;ldi %2,%0"
1188 [(set_attr "type" "multi,multi")
1189 (set_attr "length" "8,8")])
1191 (define_insn "umindi3"
1192 [(set (match_operand:DI 0 "register_operand" "=r,r")
1193 (umin:DI (match_operand:DI 1 "register_operand" "%0,0")
1194 (match_operand:DI 2 "arith11_operand" "r,I")))]
1197 cmpclr,*>> %2,%0,%%r0\;copy %2,%0
1198 cmpiclr,*>> %2,%0,%%r0\;ldi %2,%0"
1199 [(set_attr "type" "multi,multi")
1200 (set_attr "length" "8,8")])
1202 (define_insn "smaxsi3"
1203 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1204 (smax:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1205 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1208 {comclr|cmpclr},< %2,%0,%%r0\;copy %2,%0
1209 {comiclr|cmpiclr},< %2,%0,%%r0\;ldi %2,%0
1210 {comclr|cmpclr},< %1,%r2,%0\;copy %1,%0"
1211 [(set_attr "type" "multi,multi,multi")
1212 (set_attr "length" "8,8,8")])
1214 (define_insn "smaxdi3"
1215 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1216 (smax:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1217 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1220 cmpclr,*< %2,%0,%%r0\;copy %2,%0
1221 cmpiclr,*< %2,%0,%%r0\;ldi %2,%0
1222 cmpclr,*< %1,%r2,%0\;copy %1,%0"
1223 [(set_attr "type" "multi,multi,multi")
1224 (set_attr "length" "8,8,8")])
1226 (define_insn "umaxsi3"
1227 [(set (match_operand:SI 0 "register_operand" "=r,r")
1228 (umax:SI (match_operand:SI 1 "register_operand" "%0,0")
1229 (match_operand:SI 2 "arith11_operand" "r,I")))]
1232 {comclr|cmpclr},<< %2,%0,%%r0\;copy %2,%0
1233 {comiclr|cmpiclr},<< %2,%0,%%r0\;ldi %2,%0"
1234 [(set_attr "type" "multi,multi")
1235 (set_attr "length" "8,8")])
1237 (define_insn "umaxdi3"
1238 [(set (match_operand:DI 0 "register_operand" "=r,r")
1239 (umax:DI (match_operand:DI 1 "register_operand" "%0,0")
1240 (match_operand:DI 2 "arith11_operand" "r,I")))]
1243 cmpclr,*<< %2,%0,%%r0\;copy %2,%0
1244 cmpiclr,*<< %2,%0,%%r0\;ldi %2,%0"
1245 [(set_attr "type" "multi,multi")
1246 (set_attr "length" "8,8")])
1248 (define_insn "abssi2"
1249 [(set (match_operand:SI 0 "register_operand" "=r")
1250 (abs:SI (match_operand:SI 1 "register_operand" "r")))]
1252 "or,>= %%r0,%1,%0\;subi 0,%0,%0"
1253 [(set_attr "type" "multi")
1254 (set_attr "length" "8")])
1256 (define_insn "absdi2"
1257 [(set (match_operand:DI 0 "register_operand" "=r")
1258 (abs:DI (match_operand:DI 1 "register_operand" "r")))]
1260 "or,*>= %%r0,%1,%0\;subi 0,%0,%0"
1261 [(set_attr "type" "multi")
1262 (set_attr "length" "8")])
1264 ;;; Experimental conditional move patterns
1266 (define_expand "movsicc"
1267 [(set (match_operand:SI 0 "register_operand" "")
1269 (match_operator 1 "comparison_operator"
1272 (match_operand:SI 2 "reg_or_cint_move_operand" "")
1273 (match_operand:SI 3 "reg_or_cint_move_operand" "")))]
1277 enum rtx_code code = GET_CODE (operands[1]);
1279 if (hppa_branch_type != CMP_SI)
1282 if (GET_MODE (hppa_compare_op0) != GET_MODE (hppa_compare_op1)
1283 || GET_MODE (hppa_compare_op0) != GET_MODE (operands[0]))
1286 /* operands[1] is currently the result of compare_from_rtx. We want to
1287 emit a compare of the original operands. */
1288 operands[1] = gen_rtx_fmt_ee (code, SImode, hppa_compare_op0, hppa_compare_op1);
1289 operands[4] = hppa_compare_op0;
1290 operands[5] = hppa_compare_op1;
1293 ;; We used to accept any register for op1.
1295 ;; However, it loses sometimes because the compiler will end up using
1296 ;; different registers for op0 and op1 in some critical cases. local-alloc
1297 ;; will not tie op0 and op1 because op0 is used in multiple basic blocks.
1299 ;; If/when global register allocation supports tying we should allow any
1300 ;; register for op1 again.
1302 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1304 (match_operator 2 "comparison_operator"
1305 [(match_operand:SI 3 "register_operand" "r,r,r,r")
1306 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI")])
1307 (match_operand:SI 1 "reg_or_cint_move_operand" "0,J,N,K")
1311 {com%I4clr|cmp%I4clr},%S2 %4,%3,%%r0\;ldi 0,%0
1312 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldi %1,%0
1313 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldil L'%1,%0
1314 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;{zdepi|depwi,z} %Z1,%0"
1315 [(set_attr "type" "multi,multi,multi,nullshift")
1316 (set_attr "length" "8,8,8,8")])
1319 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1321 (match_operator 5 "comparison_operator"
1322 [(match_operand:SI 3 "register_operand" "r,r,r,r,r,r,r,r")
1323 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1324 (match_operand:SI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1325 (match_operand:SI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1328 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;copy %2,%0
1329 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldi %2,%0
1330 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldil L'%2,%0
1331 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;{zdepi|depwi,z} %Z2,%0
1332 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;copy %1,%0
1333 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldi %1,%0
1334 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldil L'%1,%0
1335 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;{zdepi|depwi,z} %Z1,%0"
1336 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1337 (set_attr "length" "8,8,8,8,8,8,8,8")])
1339 (define_expand "movdicc"
1340 [(set (match_operand:DI 0 "register_operand" "")
1342 (match_operator 1 "comparison_operator"
1345 (match_operand:DI 2 "reg_or_cint_move_operand" "")
1346 (match_operand:DI 3 "reg_or_cint_move_operand" "")))]
1350 enum rtx_code code = GET_CODE (operands[1]);
1352 if (hppa_branch_type != CMP_SI)
1355 if (GET_MODE (hppa_compare_op0) != GET_MODE (hppa_compare_op1)
1356 || GET_MODE (hppa_compare_op0) != GET_MODE (operands[0]))
1359 /* operands[1] is currently the result of compare_from_rtx. We want to
1360 emit a compare of the original operands. */
1361 operands[1] = gen_rtx_fmt_ee (code, DImode, hppa_compare_op0, hppa_compare_op1);
1362 operands[4] = hppa_compare_op0;
1363 operands[5] = hppa_compare_op1;
1366 ; We need the first constraint alternative in order to avoid
1367 ; earlyclobbers on all other alternatives.
1369 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r")
1371 (match_operator 2 "comparison_operator"
1372 [(match_operand:DI 3 "register_operand" "r,r,r,r,r")
1373 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI")])
1374 (match_operand:DI 1 "reg_or_cint_move_operand" "0,r,J,N,K")
1378 cmp%I4clr,*%S2 %4,%3,%%r0\;ldi 0,%0
1379 cmp%I4clr,*%B2 %4,%3,%0\;copy %1,%0
1380 cmp%I4clr,*%B2 %4,%3,%0\;ldi %1,%0
1381 cmp%I4clr,*%B2 %4,%3,%0\;ldil L'%1,%0
1382 cmp%I4clr,*%B2 %4,%3,%0\;depdi,z %z1,%0"
1383 [(set_attr "type" "multi,multi,multi,multi,nullshift")
1384 (set_attr "length" "8,8,8,8,8")])
1387 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1389 (match_operator 5 "comparison_operator"
1390 [(match_operand:DI 3 "register_operand" "r,r,r,r,r,r,r,r")
1391 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1392 (match_operand:DI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1393 (match_operand:DI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1396 cmp%I4clr,*%S5 %4,%3,%%r0\;copy %2,%0
1397 cmp%I4clr,*%S5 %4,%3,%%r0\;ldi %2,%0
1398 cmp%I4clr,*%S5 %4,%3,%%r0\;ldil L'%2,%0
1399 cmp%I4clr,*%S5 %4,%3,%%r0\;depdi,z %z2,%0
1400 cmp%I4clr,*%B5 %4,%3,%%r0\;copy %1,%0
1401 cmp%I4clr,*%B5 %4,%3,%%r0\;ldi %1,%0
1402 cmp%I4clr,*%B5 %4,%3,%%r0\;ldil L'%1,%0
1403 cmp%I4clr,*%B5 %4,%3,%%r0\;depdi,z %z1,%0"
1404 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1405 (set_attr "length" "8,8,8,8,8,8,8,8")])
1407 ;; Conditional Branches
1409 (define_expand "beq"
1411 (if_then_else (eq (match_dup 1) (match_dup 2))
1412 (label_ref (match_operand 0 "" ""))
1417 if (hppa_branch_type != CMP_SI)
1419 emit_insn (gen_cmp_fp (EQ, hppa_compare_op0, hppa_compare_op1));
1420 emit_bcond_fp (NE, operands[0]);
1423 /* set up operands from compare. */
1424 operands[1] = hppa_compare_op0;
1425 operands[2] = hppa_compare_op1;
1426 /* fall through and generate default code */
1429 (define_expand "bne"
1431 (if_then_else (ne (match_dup 1) (match_dup 2))
1432 (label_ref (match_operand 0 "" ""))
1437 if (hppa_branch_type != CMP_SI)
1439 emit_insn (gen_cmp_fp (NE, hppa_compare_op0, hppa_compare_op1));
1440 emit_bcond_fp (NE, operands[0]);
1443 operands[1] = hppa_compare_op0;
1444 operands[2] = hppa_compare_op1;
1447 (define_expand "bgt"
1449 (if_then_else (gt (match_dup 1) (match_dup 2))
1450 (label_ref (match_operand 0 "" ""))
1455 if (hppa_branch_type != CMP_SI)
1457 emit_insn (gen_cmp_fp (GT, hppa_compare_op0, hppa_compare_op1));
1458 emit_bcond_fp (NE, operands[0]);
1461 operands[1] = hppa_compare_op0;
1462 operands[2] = hppa_compare_op1;
1465 (define_expand "blt"
1467 (if_then_else (lt (match_dup 1) (match_dup 2))
1468 (label_ref (match_operand 0 "" ""))
1473 if (hppa_branch_type != CMP_SI)
1475 emit_insn (gen_cmp_fp (LT, hppa_compare_op0, hppa_compare_op1));
1476 emit_bcond_fp (NE, operands[0]);
1479 operands[1] = hppa_compare_op0;
1480 operands[2] = hppa_compare_op1;
1483 (define_expand "bge"
1485 (if_then_else (ge (match_dup 1) (match_dup 2))
1486 (label_ref (match_operand 0 "" ""))
1491 if (hppa_branch_type != CMP_SI)
1493 emit_insn (gen_cmp_fp (GE, hppa_compare_op0, hppa_compare_op1));
1494 emit_bcond_fp (NE, operands[0]);
1497 operands[1] = hppa_compare_op0;
1498 operands[2] = hppa_compare_op1;
1501 (define_expand "ble"
1503 (if_then_else (le (match_dup 1) (match_dup 2))
1504 (label_ref (match_operand 0 "" ""))
1509 if (hppa_branch_type != CMP_SI)
1511 emit_insn (gen_cmp_fp (LE, hppa_compare_op0, hppa_compare_op1));
1512 emit_bcond_fp (NE, operands[0]);
1515 operands[1] = hppa_compare_op0;
1516 operands[2] = hppa_compare_op1;
1519 (define_expand "bgtu"
1521 (if_then_else (gtu (match_dup 1) (match_dup 2))
1522 (label_ref (match_operand 0 "" ""))
1527 if (hppa_branch_type != CMP_SI)
1529 operands[1] = hppa_compare_op0;
1530 operands[2] = hppa_compare_op1;
1533 (define_expand "bltu"
1535 (if_then_else (ltu (match_dup 1) (match_dup 2))
1536 (label_ref (match_operand 0 "" ""))
1541 if (hppa_branch_type != CMP_SI)
1543 operands[1] = hppa_compare_op0;
1544 operands[2] = hppa_compare_op1;
1547 (define_expand "bgeu"
1549 (if_then_else (geu (match_dup 1) (match_dup 2))
1550 (label_ref (match_operand 0 "" ""))
1555 if (hppa_branch_type != CMP_SI)
1557 operands[1] = hppa_compare_op0;
1558 operands[2] = hppa_compare_op1;
1561 (define_expand "bleu"
1563 (if_then_else (leu (match_dup 1) (match_dup 2))
1564 (label_ref (match_operand 0 "" ""))
1569 if (hppa_branch_type != CMP_SI)
1571 operands[1] = hppa_compare_op0;
1572 operands[2] = hppa_compare_op1;
1575 (define_expand "bltgt"
1577 (if_then_else (ltgt (match_dup 1) (match_dup 2))
1578 (label_ref (match_operand 0 "" ""))
1583 if (hppa_branch_type == CMP_SI)
1585 emit_insn (gen_cmp_fp (LTGT, hppa_compare_op0, hppa_compare_op1));
1586 emit_bcond_fp (NE, operands[0]);
1590 (define_expand "bunle"
1592 (if_then_else (unle (match_dup 1) (match_dup 2))
1593 (label_ref (match_operand 0 "" ""))
1598 if (hppa_branch_type == CMP_SI)
1600 emit_insn (gen_cmp_fp (UNLE, hppa_compare_op0, hppa_compare_op1));
1601 emit_bcond_fp (NE, operands[0]);
1605 (define_expand "bunlt"
1607 (if_then_else (unlt (match_dup 1) (match_dup 2))
1608 (label_ref (match_operand 0 "" ""))
1613 if (hppa_branch_type == CMP_SI)
1615 emit_insn (gen_cmp_fp (UNLT, hppa_compare_op0, hppa_compare_op1));
1616 emit_bcond_fp (NE, operands[0]);
1620 (define_expand "bunge"
1622 (if_then_else (unge (match_dup 1) (match_dup 2))
1623 (label_ref (match_operand 0 "" ""))
1628 if (hppa_branch_type == CMP_SI)
1630 emit_insn (gen_cmp_fp (UNGE, hppa_compare_op0, hppa_compare_op1));
1631 emit_bcond_fp (NE, operands[0]);
1635 (define_expand "bungt"
1637 (if_then_else (ungt (match_dup 1) (match_dup 2))
1638 (label_ref (match_operand 0 "" ""))
1643 if (hppa_branch_type == CMP_SI)
1645 emit_insn (gen_cmp_fp (UNGT, hppa_compare_op0, hppa_compare_op1));
1646 emit_bcond_fp (NE, operands[0]);
1650 (define_expand "buneq"
1652 (if_then_else (uneq (match_dup 1) (match_dup 2))
1653 (label_ref (match_operand 0 "" ""))
1658 if (hppa_branch_type == CMP_SI)
1660 emit_insn (gen_cmp_fp (UNEQ, hppa_compare_op0, hppa_compare_op1));
1661 emit_bcond_fp (NE, operands[0]);
1665 (define_expand "bunordered"
1667 (if_then_else (unordered (match_dup 1) (match_dup 2))
1668 (label_ref (match_operand 0 "" ""))
1673 if (hppa_branch_type == CMP_SI)
1675 emit_insn (gen_cmp_fp (UNORDERED, hppa_compare_op0, hppa_compare_op1));
1676 emit_bcond_fp (NE, operands[0]);
1680 (define_expand "bordered"
1682 (if_then_else (ordered (match_dup 1) (match_dup 2))
1683 (label_ref (match_operand 0 "" ""))
1688 if (hppa_branch_type == CMP_SI)
1690 emit_insn (gen_cmp_fp (ORDERED, hppa_compare_op0, hppa_compare_op1));
1691 emit_bcond_fp (NE, operands[0]);
1695 ;; Match the branch patterns.
1698 ;; Note a long backward conditional branch with an annulled delay slot
1699 ;; has a length of 12.
1703 (match_operator 3 "comparison_operator"
1704 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1705 (match_operand:SI 2 "arith5_operand" "rL")])
1706 (label_ref (match_operand 0 "" ""))
1711 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1712 get_attr_length (insn), 0, insn);
1714 [(set_attr "type" "cbranch")
1715 (set (attr "length")
1716 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1719 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1722 (eq (symbol_ref "flag_pic") (const_int 0))
1726 ;; Match the negated branch.
1731 (match_operator 3 "comparison_operator"
1732 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1733 (match_operand:SI 2 "arith5_operand" "rL")])
1735 (label_ref (match_operand 0 "" ""))))]
1739 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1740 get_attr_length (insn), 1, insn);
1742 [(set_attr "type" "cbranch")
1743 (set (attr "length")
1744 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1747 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1750 (eq (symbol_ref "flag_pic") (const_int 0))
1757 (match_operator 3 "comparison_operator"
1758 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1759 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1760 (label_ref (match_operand 0 "" ""))
1765 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1766 get_attr_length (insn), 0, insn);
1768 [(set_attr "type" "cbranch")
1769 (set (attr "length")
1770 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1773 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1776 (eq (symbol_ref "flag_pic") (const_int 0))
1780 ;; Match the negated branch.
1785 (match_operator 3 "comparison_operator"
1786 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1787 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1789 (label_ref (match_operand 0 "" ""))))]
1793 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1794 get_attr_length (insn), 1, insn);
1796 [(set_attr "type" "cbranch")
1797 (set (attr "length")
1798 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1801 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1804 (eq (symbol_ref "flag_pic") (const_int 0))
1810 (match_operator 3 "cmpib_comparison_operator"
1811 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1812 (match_operand:DI 2 "arith5_operand" "rL")])
1813 (label_ref (match_operand 0 "" ""))
1818 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1819 get_attr_length (insn), 0, insn);
1821 [(set_attr "type" "cbranch")
1822 (set (attr "length")
1823 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1826 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1829 (eq (symbol_ref "flag_pic") (const_int 0))
1833 ;; Match the negated branch.
1838 (match_operator 3 "cmpib_comparison_operator"
1839 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1840 (match_operand:DI 2 "arith5_operand" "rL")])
1842 (label_ref (match_operand 0 "" ""))))]
1846 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1847 get_attr_length (insn), 1, insn);
1849 [(set_attr "type" "cbranch")
1850 (set (attr "length")
1851 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1854 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1857 (eq (symbol_ref "flag_pic") (const_int 0))
1861 ;; Branch on Bit patterns.
1865 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1867 (match_operand:SI 1 "uint5_operand" ""))
1869 (label_ref (match_operand 2 "" ""))
1874 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1875 get_attr_length (insn), 0, insn, 0);
1877 [(set_attr "type" "cbranch")
1878 (set (attr "length")
1879 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1887 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1889 (match_operand:DI 1 "uint32_operand" ""))
1891 (label_ref (match_operand 2 "" ""))
1896 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1897 get_attr_length (insn), 0, insn, 0);
1899 [(set_attr "type" "cbranch")
1900 (set (attr "length")
1901 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1909 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1911 (match_operand:SI 1 "uint5_operand" ""))
1914 (label_ref (match_operand 2 "" ""))))]
1918 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1919 get_attr_length (insn), 1, insn, 0);
1921 [(set_attr "type" "cbranch")
1922 (set (attr "length")
1923 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1931 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1933 (match_operand:DI 1 "uint32_operand" ""))
1936 (label_ref (match_operand 2 "" ""))))]
1940 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1941 get_attr_length (insn), 1, insn, 0);
1943 [(set_attr "type" "cbranch")
1944 (set (attr "length")
1945 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1953 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1955 (match_operand:SI 1 "uint5_operand" ""))
1957 (label_ref (match_operand 2 "" ""))
1962 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1963 get_attr_length (insn), 0, insn, 1);
1965 [(set_attr "type" "cbranch")
1966 (set (attr "length")
1967 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1975 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1977 (match_operand:DI 1 "uint32_operand" ""))
1979 (label_ref (match_operand 2 "" ""))
1984 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1985 get_attr_length (insn), 0, insn, 1);
1987 [(set_attr "type" "cbranch")
1988 (set (attr "length")
1989 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1997 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1999 (match_operand:SI 1 "uint5_operand" ""))
2002 (label_ref (match_operand 2 "" ""))))]
2006 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
2007 get_attr_length (insn), 1, insn, 1);
2009 [(set_attr "type" "cbranch")
2010 (set (attr "length")
2011 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2019 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2021 (match_operand:DI 1 "uint32_operand" ""))
2024 (label_ref (match_operand 2 "" ""))))]
2028 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
2029 get_attr_length (insn), 1, insn, 1);
2031 [(set_attr "type" "cbranch")
2032 (set (attr "length")
2033 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2038 ;; Branch on Variable Bit patterns.
2042 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2044 (match_operand:SI 1 "register_operand" "q"))
2046 (label_ref (match_operand 2 "" ""))
2051 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2052 get_attr_length (insn), 0, insn, 0);
2054 [(set_attr "type" "cbranch")
2055 (set (attr "length")
2056 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2064 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2066 (match_operand:DI 1 "register_operand" "q"))
2068 (label_ref (match_operand 2 "" ""))
2073 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2074 get_attr_length (insn), 0, insn, 0);
2076 [(set_attr "type" "cbranch")
2077 (set (attr "length")
2078 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2086 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2088 (match_operand:SI 1 "register_operand" "q"))
2091 (label_ref (match_operand 2 "" ""))))]
2095 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2096 get_attr_length (insn), 1, insn, 0);
2098 [(set_attr "type" "cbranch")
2099 (set (attr "length")
2100 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2108 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2110 (match_operand:DI 1 "register_operand" "q"))
2113 (label_ref (match_operand 2 "" ""))))]
2117 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2118 get_attr_length (insn), 1, insn, 0);
2120 [(set_attr "type" "cbranch")
2121 (set (attr "length")
2122 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2130 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2132 (match_operand:SI 1 "register_operand" "q"))
2134 (label_ref (match_operand 2 "" ""))
2139 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2140 get_attr_length (insn), 0, insn, 1);
2142 [(set_attr "type" "cbranch")
2143 (set (attr "length")
2144 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2152 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2154 (match_operand:DI 1 "register_operand" "q"))
2156 (label_ref (match_operand 2 "" ""))
2161 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2162 get_attr_length (insn), 0, insn, 1);
2164 [(set_attr "type" "cbranch")
2165 (set (attr "length")
2166 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2174 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2176 (match_operand:SI 1 "register_operand" "q"))
2179 (label_ref (match_operand 2 "" ""))))]
2183 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2184 get_attr_length (insn), 1, insn, 1);
2186 [(set_attr "type" "cbranch")
2187 (set (attr "length")
2188 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2196 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2198 (match_operand:DI 1 "register_operand" "q"))
2201 (label_ref (match_operand 2 "" ""))))]
2205 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2206 get_attr_length (insn), 1, insn, 1);
2208 [(set_attr "type" "cbranch")
2209 (set (attr "length")
2210 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2215 ;; Floating point branches
2217 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2218 (label_ref (match_operand 0 "" ""))
2220 "! TARGET_SOFT_FLOAT"
2223 if (INSN_ANNULLED_BRANCH_P (insn))
2224 return \"ftest\;b,n %0\";
2226 return \"ftest\;b%* %0\";
2228 [(set_attr "type" "fbranch")
2229 (set_attr "length" "8")])
2232 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2234 (label_ref (match_operand 0 "" ""))))]
2235 "! TARGET_SOFT_FLOAT"
2238 if (INSN_ANNULLED_BRANCH_P (insn))
2239 return \"ftest\;add,tr %%r0,%%r0,%%r0\;b,n %0\";
2241 return \"ftest\;add,tr %%r0,%%r0,%%r0\;b%* %0\";
2243 [(set_attr "type" "fbranch")
2244 (set_attr "length" "12")])
2246 ;; Move instructions
2248 (define_expand "movsi"
2249 [(set (match_operand:SI 0 "general_operand" "")
2250 (match_operand:SI 1 "general_operand" ""))]
2254 if (emit_move_sequence (operands, SImode, 0))
2258 ;; Handle SImode input reloads requiring %r1 as a scratch register.
2259 (define_expand "reload_insi_r1"
2260 [(set (match_operand:SI 0 "register_operand" "=Z")
2261 (match_operand:SI 1 "non_hard_reg_operand" ""))
2262 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
2266 if (emit_move_sequence (operands, SImode, operands[2]))
2269 /* We don't want the clobber emitted, so handle this ourselves. */
2270 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
2274 ;; Handle SImode input reloads requiring a general register as a
2275 ;; scratch register.
2276 (define_expand "reload_insi"
2277 [(set (match_operand:SI 0 "register_operand" "=Z")
2278 (match_operand:SI 1 "non_hard_reg_operand" ""))
2279 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2283 if (emit_move_sequence (operands, SImode, operands[2]))
2286 /* We don't want the clobber emitted, so handle this ourselves. */
2287 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
2291 ;; Handle SImode output reloads requiring a general register as a
2292 ;; scratch register.
2293 (define_expand "reload_outsi"
2294 [(set (match_operand:SI 0 "non_hard_reg_operand" "")
2295 (match_operand:SI 1 "register_operand" "Z"))
2296 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2300 if (emit_move_sequence (operands, SImode, operands[2]))
2303 /* We don't want the clobber emitted, so handle this ourselves. */
2304 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
2309 [(set (match_operand:SI 0 "move_dest_operand"
2310 "=r,r,r,r,r,r,Q,!*q,!r,!*f,*f,T,r,f")
2311 (match_operand:SI 1 "move_src_operand"
2312 "A,r,J,N,K,RQ,rM,!rM,!*q,!*fM,RT,*f,f,r"))]
2313 "(register_operand (operands[0], SImode)
2314 || reg_or_0_operand (operands[1], SImode))
2315 && !TARGET_SOFT_FLOAT
2322 {zdepi|depwi,z} %Z1,%0
2326 {mfctl|mfctl,w} %%sar,%0
2330 {fstws|fstw} %1,-16(%%sp)\n\t{ldws|ldw} -16(%%sp),%0
2331 {stws|stw} %1,-16(%%sp)\n\t{fldws|fldw} -16(%%sp),%0"
2332 [(set_attr "type" "load,move,move,move,shift,load,store,move,move,fpalu,fpload,fpstore,move,move")
2333 (set_attr "pa_combine_type" "addmove")
2334 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,8,8")])
2337 [(set (match_operand:SI 0 "move_dest_operand"
2338 "=r,r,r,r,r,r,Q,!*q,!r,!*f,*f,T")
2339 (match_operand:SI 1 "move_src_operand"
2340 "A,r,J,N,K,RQ,rM,!rM,!*q,!*fM,RT,*f"))]
2341 "(register_operand (operands[0], SImode)
2342 || reg_or_0_operand (operands[1], SImode))
2343 && !TARGET_SOFT_FLOAT
2350 {zdepi|depwi,z} %Z1,%0
2354 {mfctl|mfctl,w} %%sar,%0
2358 [(set_attr "type" "load,move,move,move,shift,load,store,move,move,fpalu,fpload,fpstore")
2359 (set_attr "pa_combine_type" "addmove")
2360 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4")])
2363 [(set (match_operand:SI 0 "indexed_memory_operand" "=R")
2364 (match_operand:SI 1 "register_operand" "f"))]
2366 && !TARGET_DISABLE_INDEXING
2367 && reload_completed"
2369 [(set_attr "type" "fpstore")
2370 (set_attr "pa_combine_type" "addmove")
2371 (set_attr "length" "4")])
2373 ; Rewrite RTL using an indexed store. This will allow the insn that
2374 ; computes the address to be deleted if the register it sets is dead.
2376 [(set (match_operand:SI 0 "register_operand" "")
2377 (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "")
2379 (match_operand:SI 2 "register_operand" "")))
2380 (set (mem:SI (match_dup 0))
2381 (match_operand:SI 3 "register_operand" ""))]
2383 && !TARGET_DISABLE_INDEXING
2384 && REG_OK_FOR_BASE_P (operands[2])
2385 && FP_REGNO_P (REGNO (operands[3]))"
2386 [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
2388 (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
2393 [(set (match_operand:SI 0 "register_operand" "")
2394 (plus:SI (match_operand:SI 2 "register_operand" "")
2395 (mult:SI (match_operand:SI 1 "register_operand" "")
2397 (set (mem:SI (match_dup 0))
2398 (match_operand:SI 3 "register_operand" ""))]
2400 && !TARGET_DISABLE_INDEXING
2401 && REG_OK_FOR_BASE_P (operands[2])
2402 && FP_REGNO_P (REGNO (operands[3]))"
2403 [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
2405 (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
2410 [(set (match_operand:DI 0 "register_operand" "")
2411 (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
2413 (match_operand:DI 2 "register_operand" "")))
2414 (set (mem:SI (match_dup 0))
2415 (match_operand:SI 3 "register_operand" ""))]
2417 && !TARGET_DISABLE_INDEXING
2419 && REG_OK_FOR_BASE_P (operands[2])
2420 && FP_REGNO_P (REGNO (operands[3]))"
2421 [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
2423 (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
2428 [(set (match_operand:DI 0 "register_operand" "")
2429 (plus:DI (match_operand:DI 2 "register_operand" "")
2430 (mult:DI (match_operand:DI 1 "register_operand" "")
2432 (set (mem:SI (match_dup 0))
2433 (match_operand:SI 3 "register_operand" ""))]
2435 && !TARGET_DISABLE_INDEXING
2437 && REG_OK_FOR_BASE_P (operands[2])
2438 && FP_REGNO_P (REGNO (operands[3]))"
2439 [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
2441 (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
2446 [(set (match_operand:SI 0 "register_operand" "")
2447 (plus:SI (match_operand:SI 1 "register_operand" "")
2448 (match_operand:SI 2 "register_operand" "")))
2449 (set (mem:SI (match_dup 0))
2450 (match_operand:SI 3 "register_operand" ""))]
2452 && !TARGET_DISABLE_INDEXING
2453 && TARGET_NO_SPACE_REGS
2454 && REG_OK_FOR_INDEX_P (operands[1])
2455 && REG_OK_FOR_BASE_P (operands[2])
2456 && FP_REGNO_P (REGNO (operands[3]))"
2457 [(set (mem:SI (plus:SI (match_dup 1) (match_dup 2)))
2459 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
2463 [(set (match_operand:SI 0 "register_operand" "")
2464 (plus:SI (match_operand:SI 1 "register_operand" "")
2465 (match_operand:SI 2 "register_operand" "")))
2466 (set (mem:SI (match_dup 0))
2467 (match_operand:SI 3 "register_operand" ""))]
2469 && !TARGET_DISABLE_INDEXING
2470 && TARGET_NO_SPACE_REGS
2471 && REG_OK_FOR_BASE_P (operands[1])
2472 && REG_OK_FOR_INDEX_P (operands[2])
2473 && FP_REGNO_P (REGNO (operands[3]))"
2474 [(set (mem:SI (plus:SI (match_dup 2) (match_dup 1)))
2476 (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
2480 [(set (match_operand:DI 0 "register_operand" "")
2481 (plus:DI (match_operand:DI 1 "register_operand" "")
2482 (match_operand:DI 2 "register_operand" "")))
2483 (set (mem:SI (match_dup 0))
2484 (match_operand:SI 3 "register_operand" ""))]
2486 && !TARGET_DISABLE_INDEXING
2488 && TARGET_NO_SPACE_REGS
2489 && REG_OK_FOR_INDEX_P (operands[1])
2490 && REG_OK_FOR_BASE_P (operands[2])
2491 && FP_REGNO_P (REGNO (operands[3]))"
2492 [(set (mem:SI (plus:DI (match_dup 1) (match_dup 2)))
2494 (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
2498 [(set (match_operand:DI 0 "register_operand" "")
2499 (plus:DI (match_operand:DI 1 "register_operand" "")
2500 (match_operand:DI 2 "register_operand" "")))
2501 (set (mem:SI (match_dup 0))
2502 (match_operand:SI 3 "register_operand" ""))]
2504 && !TARGET_DISABLE_INDEXING
2506 && TARGET_NO_SPACE_REGS
2507 && REG_OK_FOR_BASE_P (operands[1])
2508 && REG_OK_FOR_INDEX_P (operands[2])
2509 && FP_REGNO_P (REGNO (operands[3]))"
2510 [(set (mem:SI (plus:DI (match_dup 2) (match_dup 1)))
2512 (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
2516 [(set (match_operand:SI 0 "move_dest_operand"
2517 "=r,r,r,r,r,r,Q,!*q,!r")
2518 (match_operand:SI 1 "move_src_operand"
2519 "A,r,J,N,K,RQ,rM,!rM,!*q"))]
2520 "(register_operand (operands[0], SImode)
2521 || reg_or_0_operand (operands[1], SImode))
2522 && TARGET_SOFT_FLOAT"
2528 {zdepi|depwi,z} %Z1,%0
2532 {mfctl|mfctl,w} %%sar,%0"
2533 [(set_attr "type" "load,move,move,move,move,load,store,move,move")
2534 (set_attr "pa_combine_type" "addmove")
2535 (set_attr "length" "4,4,4,4,4,4,4,4,4")])
2537 ;; Load or store with base-register modification.
2539 [(set (match_operand:SI 0 "register_operand" "=r")
2540 (mem:SI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2541 (match_operand:DI 2 "int5_operand" "L"))))
2543 (plus:DI (match_dup 1) (match_dup 2)))]
2546 [(set_attr "type" "load")
2547 (set_attr "length" "4")])
2549 ; And a zero extended variant.
2551 [(set (match_operand:DI 0 "register_operand" "=r")
2552 (zero_extend:DI (mem:SI
2554 (match_operand:DI 1 "register_operand" "+r")
2555 (match_operand:DI 2 "int5_operand" "L")))))
2557 (plus:DI (match_dup 1) (match_dup 2)))]
2560 [(set_attr "type" "load")
2561 (set_attr "length" "4")])
2563 (define_expand "pre_load"
2564 [(parallel [(set (match_operand:SI 0 "register_operand" "")
2565 (mem (plus (match_operand 1 "register_operand" "")
2566 (match_operand 2 "pre_cint_operand" ""))))
2568 (plus (match_dup 1) (match_dup 2)))])]
2574 emit_insn (gen_pre_ldd (operands[0], operands[1], operands[2]));
2577 emit_insn (gen_pre_ldw (operands[0], operands[1], operands[2]));
2581 (define_insn "pre_ldw"
2582 [(set (match_operand:SI 0 "register_operand" "=r")
2583 (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2584 (match_operand:SI 2 "pre_cint_operand" ""))))
2586 (plus:SI (match_dup 1) (match_dup 2)))]
2590 if (INTVAL (operands[2]) < 0)
2591 return \"{ldwm|ldw,mb} %2(%1),%0\";
2592 return \"{ldws|ldw},mb %2(%1),%0\";
2594 [(set_attr "type" "load")
2595 (set_attr "length" "4")])
2597 (define_insn "pre_ldd"
2598 [(set (match_operand:DI 0 "register_operand" "=r")
2599 (mem:DI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2600 (match_operand:DI 2 "pre_cint_operand" ""))))
2602 (plus:DI (match_dup 1) (match_dup 2)))]
2605 [(set_attr "type" "load")
2606 (set_attr "length" "4")])
2609 [(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "+r")
2610 (match_operand:SI 1 "pre_cint_operand" "")))
2611 (match_operand:SI 2 "reg_or_0_operand" "rM"))
2613 (plus:SI (match_dup 0) (match_dup 1)))]
2617 if (INTVAL (operands[1]) < 0)
2618 return \"{stwm|stw,mb} %r2,%1(%0)\";
2619 return \"{stws|stw},mb %r2,%1(%0)\";
2621 [(set_attr "type" "store")
2622 (set_attr "length" "4")])
2625 [(set (match_operand:SI 0 "register_operand" "=r")
2626 (mem:SI (match_operand:SI 1 "register_operand" "+r")))
2628 (plus:SI (match_dup 1)
2629 (match_operand:SI 2 "post_cint_operand" "")))]
2633 if (INTVAL (operands[2]) > 0)
2634 return \"{ldwm|ldw,ma} %2(%1),%0\";
2635 return \"{ldws|ldw},ma %2(%1),%0\";
2637 [(set_attr "type" "load")
2638 (set_attr "length" "4")])
2640 (define_expand "post_store"
2641 [(parallel [(set (mem (match_operand 0 "register_operand" ""))
2642 (match_operand 1 "reg_or_0_operand" ""))
2645 (match_operand 2 "post_cint_operand" "")))])]
2651 emit_insn (gen_post_std (operands[0], operands[1], operands[2]));
2654 emit_insn (gen_post_stw (operands[0], operands[1], operands[2]));
2658 (define_insn "post_stw"
2659 [(set (mem:SI (match_operand:SI 0 "register_operand" "+r"))
2660 (match_operand:SI 1 "reg_or_0_operand" "rM"))
2662 (plus:SI (match_dup 0)
2663 (match_operand:SI 2 "post_cint_operand" "")))]
2667 if (INTVAL (operands[2]) > 0)
2668 return \"{stwm|stw,ma} %r1,%2(%0)\";
2669 return \"{stws|stw},ma %r1,%2(%0)\";
2671 [(set_attr "type" "store")
2672 (set_attr "length" "4")])
2674 (define_insn "post_std"
2675 [(set (mem:DI (match_operand:DI 0 "register_operand" "+r"))
2676 (match_operand:DI 1 "reg_or_0_operand" "rM"))
2678 (plus:DI (match_dup 0)
2679 (match_operand:DI 2 "post_cint_operand" "")))]
2682 [(set_attr "type" "store")
2683 (set_attr "length" "4")])
2685 ;; For loading the address of a label while generating PIC code.
2686 ;; Note since this pattern can be created at reload time (via movsi), all
2687 ;; the same rules for movsi apply here. (no new pseudos, no temporaries).
2689 [(set (match_operand 0 "pmode_register_operand" "=a")
2690 (match_operand 1 "pic_label_operand" ""))]
2696 xoperands[0] = operands[0];
2697 xoperands[1] = operands[1];
2698 xoperands[2] = gen_label_rtx ();
2700 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
2701 CODE_LABEL_NUMBER (xoperands[2]));
2702 output_asm_insn (\"mfia %0\", xoperands);
2704 /* If we're trying to load the address of a label that happens to be
2705 close, then we can use a shorter sequence. */
2706 if (GET_CODE (operands[1]) == LABEL_REF
2707 && !LABEL_REF_NONLOCAL_P (operands[1])
2708 && INSN_ADDRESSES_SET_P ()
2709 && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
2710 - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
2711 output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
2714 output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
2715 output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
2719 [(set_attr "type" "multi")
2720 (set_attr "length" "12")]) ; 8 or 12
2723 [(set (match_operand 0 "pmode_register_operand" "=a")
2724 (match_operand 1 "pic_label_operand" ""))]
2730 xoperands[0] = operands[0];
2731 xoperands[1] = operands[1];
2732 xoperands[2] = gen_label_rtx ();
2734 output_asm_insn (\"bl .+8,%0\", xoperands);
2735 output_asm_insn (\"depi 0,31,2,%0\", xoperands);
2736 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
2737 CODE_LABEL_NUMBER (xoperands[2]));
2739 /* If we're trying to load the address of a label that happens to be
2740 close, then we can use a shorter sequence. */
2741 if (GET_CODE (operands[1]) == LABEL_REF
2742 && !LABEL_REF_NONLOCAL_P (operands[1])
2743 && INSN_ADDRESSES_SET_P ()
2744 && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
2745 - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
2746 output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
2749 output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
2750 output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
2754 [(set_attr "type" "multi")
2755 (set_attr "length" "16")]) ; 12 or 16
2758 [(set (match_operand:SI 0 "register_operand" "=a")
2759 (plus:SI (match_operand:SI 1 "register_operand" "r")
2760 (high:SI (match_operand 2 "" ""))))]
2761 "symbolic_operand (operands[2], Pmode)
2762 && ! function_label_operand (operands[2], Pmode)
2765 [(set_attr "type" "binary")
2766 (set_attr "length" "4")])
2769 [(set (match_operand:DI 0 "register_operand" "=a")
2770 (plus:DI (match_operand:DI 1 "register_operand" "r")
2771 (high:DI (match_operand 2 "" ""))))]
2772 "symbolic_operand (operands[2], Pmode)
2773 && ! function_label_operand (operands[2], Pmode)
2777 [(set_attr "type" "binary")
2778 (set_attr "length" "4")])
2780 ;; Always use addil rather than ldil;add sequences. This allows the
2781 ;; HP linker to eliminate the dp relocation if the symbolic operand
2782 ;; lives in the TEXT space.
2784 [(set (match_operand:SI 0 "register_operand" "=a")
2785 (high:SI (match_operand 1 "" "")))]
2786 "symbolic_operand (operands[1], Pmode)
2787 && ! function_label_operand (operands[1], Pmode)
2788 && ! read_only_operand (operands[1], Pmode)
2792 if (TARGET_LONG_LOAD_STORE)
2793 return \"addil NLR'%H1,%%r27\;ldo N'%H1(%%r1),%%r1\";
2795 return \"addil LR'%H1,%%r27\";
2797 [(set_attr "type" "binary")
2798 (set (attr "length")
2799 (if_then_else (eq (symbol_ref "TARGET_LONG_LOAD_STORE") (const_int 0))
2804 ;; This is for use in the prologue/epilogue code. We need it
2805 ;; to add large constants to a stack pointer or frame pointer.
2806 ;; Because of the additional %r1 pressure, we probably do not
2807 ;; want to use this in general code, so make it available
2808 ;; only after reload.
2810 [(set (match_operand:SI 0 "register_operand" "=!a,*r")
2811 (plus:SI (match_operand:SI 1 "register_operand" "r,r")
2812 (high:SI (match_operand 2 "const_int_operand" ""))))]
2816 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2817 [(set_attr "type" "binary,binary")
2818 (set_attr "length" "4,8")])
2821 [(set (match_operand:DI 0 "register_operand" "=!a,*r")
2822 (plus:DI (match_operand:DI 1 "register_operand" "r,r")
2823 (high:DI (match_operand 2 "const_int_operand" ""))))]
2824 "reload_completed && TARGET_64BIT"
2827 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2828 [(set_attr "type" "binary,binary")
2829 (set_attr "length" "4,8")])
2832 [(set (match_operand:SI 0 "register_operand" "=r")
2833 (high:SI (match_operand 1 "" "")))]
2834 "(!flag_pic || !symbolic_operand (operands[1], Pmode))
2835 && !is_function_label_plus_const (operands[1])"
2838 if (symbolic_operand (operands[1], Pmode))
2839 return \"ldil LR'%H1,%0\";
2841 return \"ldil L'%G1,%0\";
2843 [(set_attr "type" "move")
2844 (set_attr "length" "4")])
2847 [(set (match_operand:DI 0 "register_operand" "=r")
2848 (high:DI (match_operand 1 "const_int_operand" "")))]
2851 [(set_attr "type" "move")
2852 (set_attr "length" "4")])
2855 [(set (match_operand:DI 0 "register_operand" "=r")
2856 (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
2857 (match_operand:DI 2 "const_int_operand" "i")))]
2860 [(set_attr "type" "move")
2861 (set_attr "length" "4")])
2864 [(set (match_operand:SI 0 "register_operand" "=r")
2865 (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
2866 (match_operand:SI 2 "immediate_operand" "i")))]
2867 "!is_function_label_plus_const (operands[2])"
2870 gcc_assert (!flag_pic || !symbolic_operand (operands[2], Pmode));
2872 if (symbolic_operand (operands[2], Pmode))
2873 return \"ldo RR'%G2(%1),%0\";
2875 return \"ldo R'%G2(%1),%0\";
2877 [(set_attr "type" "move")
2878 (set_attr "length" "4")])
2880 ;; Now that a symbolic_address plus a constant is broken up early
2881 ;; in the compilation phase (for better CSE) we need a special
2882 ;; combiner pattern to load the symbolic address plus the constant
2883 ;; in only 2 instructions. (For cases where the symbolic address
2884 ;; was not a common subexpression.)
2886 [(set (match_operand:SI 0 "register_operand" "")
2887 (match_operand:SI 1 "symbolic_operand" ""))
2888 (clobber (match_operand:SI 2 "register_operand" ""))]
2889 "! (flag_pic && pic_label_operand (operands[1], SImode))"
2890 [(set (match_dup 2) (high:SI (match_dup 1)))
2891 (set (match_dup 0) (lo_sum:SI (match_dup 2) (match_dup 1)))]
2894 ;; hppa_legitimize_address goes to a great deal of trouble to
2895 ;; create addresses which use indexing. In some cases, this
2896 ;; is a lose because there isn't any store instructions which
2897 ;; allow indexed addresses (with integer register source).
2899 ;; These define_splits try to turn a 3 insn store into
2900 ;; a 2 insn store with some creative RTL rewriting.
2902 [(set (mem:SI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2903 (match_operand:SI 1 "shadd_operand" ""))
2904 (plus:SI (match_operand:SI 2 "register_operand" "")
2905 (match_operand:SI 3 "const_int_operand" ""))))
2906 (match_operand:SI 4 "register_operand" ""))
2907 (clobber (match_operand:SI 5 "register_operand" ""))]
2909 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2911 (set (mem:SI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2915 [(set (mem:HI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2916 (match_operand:SI 1 "shadd_operand" ""))
2917 (plus:SI (match_operand:SI 2 "register_operand" "")
2918 (match_operand:SI 3 "const_int_operand" ""))))
2919 (match_operand:HI 4 "register_operand" ""))
2920 (clobber (match_operand:SI 5 "register_operand" ""))]
2922 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2924 (set (mem:HI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2928 [(set (mem:QI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2929 (match_operand:SI 1 "shadd_operand" ""))
2930 (plus:SI (match_operand:SI 2 "register_operand" "")
2931 (match_operand:SI 3 "const_int_operand" ""))))
2932 (match_operand:QI 4 "register_operand" ""))
2933 (clobber (match_operand:SI 5 "register_operand" ""))]
2935 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2937 (set (mem:QI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2940 (define_expand "movhi"
2941 [(set (match_operand:HI 0 "general_operand" "")
2942 (match_operand:HI 1 "general_operand" ""))]
2946 if (emit_move_sequence (operands, HImode, 0))
2951 [(set (match_operand:HI 0 "move_dest_operand"
2952 "=r,r,r,r,r,Q,!*q,!r")
2953 (match_operand:HI 1 "move_src_operand"
2954 "r,J,N,K,RQ,rM,!rM,!*q"))]
2955 "register_operand (operands[0], HImode)
2956 || reg_or_0_operand (operands[1], HImode)"
2961 {zdepi|depwi,z} %Z1,%0
2965 {mfctl|mfctl,w} %sar,%0"
2966 [(set_attr "type" "move,move,move,shift,load,store,move,move")
2967 (set_attr "pa_combine_type" "addmove")
2968 (set_attr "length" "4,4,4,4,4,4,4,4")])
2971 [(set (match_operand:HI 0 "register_operand" "=r")
2972 (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2973 (match_operand:SI 2 "int5_operand" "L"))))
2975 (plus:SI (match_dup 1) (match_dup 2)))]
2977 "{ldhs|ldh},mb %2(%1),%0"
2978 [(set_attr "type" "load")
2979 (set_attr "length" "4")])
2982 [(set (match_operand:HI 0 "register_operand" "=r")
2983 (mem:HI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2984 (match_operand:DI 2 "int5_operand" "L"))))
2986 (plus:DI (match_dup 1) (match_dup 2)))]
2989 [(set_attr "type" "load")
2990 (set_attr "length" "4")])
2992 ; And a zero extended variant.
2994 [(set (match_operand:DI 0 "register_operand" "=r")
2995 (zero_extend:DI (mem:HI
2997 (match_operand:DI 1 "register_operand" "+r")
2998 (match_operand:DI 2 "int5_operand" "L")))))
3000 (plus:DI (match_dup 1) (match_dup 2)))]
3003 [(set_attr "type" "load")
3004 (set_attr "length" "4")])
3007 [(set (match_operand:SI 0 "register_operand" "=r")
3008 (zero_extend:SI (mem:HI
3010 (match_operand:SI 1 "register_operand" "+r")
3011 (match_operand:SI 2 "int5_operand" "L")))))
3013 (plus:SI (match_dup 1) (match_dup 2)))]
3015 "{ldhs|ldh},mb %2(%1),%0"
3016 [(set_attr "type" "load")
3017 (set_attr "length" "4")])
3020 [(set (match_operand:SI 0 "register_operand" "=r")
3021 (zero_extend:SI (mem:HI
3023 (match_operand:DI 1 "register_operand" "+r")
3024 (match_operand:DI 2 "int5_operand" "L")))))
3026 (plus:DI (match_dup 1) (match_dup 2)))]
3029 [(set_attr "type" "load")
3030 (set_attr "length" "4")])
3033 [(set (mem:HI (plus:SI (match_operand:SI 0 "register_operand" "+r")
3034 (match_operand:SI 1 "int5_operand" "L")))
3035 (match_operand:HI 2 "reg_or_0_operand" "rM"))
3037 (plus:SI (match_dup 0) (match_dup 1)))]
3039 "{sths|sth},mb %r2,%1(%0)"
3040 [(set_attr "type" "store")
3041 (set_attr "length" "4")])
3044 [(set (mem:HI (plus:DI (match_operand:DI 0 "register_operand" "+r")
3045 (match_operand:DI 1 "int5_operand" "L")))
3046 (match_operand:HI 2 "reg_or_0_operand" "rM"))
3048 (plus:DI (match_dup 0) (match_dup 1)))]
3051 [(set_attr "type" "store")
3052 (set_attr "length" "4")])
3055 [(set (match_operand:HI 0 "register_operand" "=r")
3056 (plus:HI (match_operand:HI 1 "register_operand" "r")
3057 (match_operand 2 "const_int_operand" "J")))]
3060 [(set_attr "type" "binary")
3061 (set_attr "pa_combine_type" "addmove")
3062 (set_attr "length" "4")])
3064 (define_expand "movqi"
3065 [(set (match_operand:QI 0 "general_operand" "")
3066 (match_operand:QI 1 "general_operand" ""))]
3070 if (emit_move_sequence (operands, QImode, 0))
3075 [(set (match_operand:QI 0 "move_dest_operand"
3076 "=r,r,r,r,r,Q,!*q,!r")
3077 (match_operand:QI 1 "move_src_operand"
3078 "r,J,N,K,RQ,rM,!rM,!*q"))]
3079 "register_operand (operands[0], QImode)
3080 || reg_or_0_operand (operands[1], QImode)"
3085 {zdepi|depwi,z} %Z1,%0
3089 {mfctl|mfctl,w} %%sar,%0"
3090 [(set_attr "type" "move,move,move,shift,load,store,move,move")
3091 (set_attr "pa_combine_type" "addmove")
3092 (set_attr "length" "4,4,4,4,4,4,4,4")])
3095 [(set (match_operand:QI 0 "register_operand" "=r")
3096 (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r")
3097 (match_operand:SI 2 "int5_operand" "L"))))
3098 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3100 "{ldbs|ldb},mb %2(%1),%0"
3101 [(set_attr "type" "load")
3102 (set_attr "length" "4")])
3105 [(set (match_operand:QI 0 "register_operand" "=r")
3106 (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "+r")
3107 (match_operand:DI 2 "int5_operand" "L"))))
3108 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3111 [(set_attr "type" "load")
3112 (set_attr "length" "4")])
3114 ; Now the same thing with zero extensions.
3116 [(set (match_operand:DI 0 "register_operand" "=r")
3117 (zero_extend:DI (mem:QI (plus:DI
3118 (match_operand:DI 1 "register_operand" "+r")
3119 (match_operand:DI 2 "int5_operand" "L")))))
3120 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3123 [(set_attr "type" "load")
3124 (set_attr "length" "4")])
3127 [(set (match_operand:SI 0 "register_operand" "=r")
3128 (zero_extend:SI (mem:QI (plus:SI
3129 (match_operand:SI 1 "register_operand" "+r")
3130 (match_operand:SI 2 "int5_operand" "L")))))
3131 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3133 "{ldbs|ldb},mb %2(%1),%0"
3134 [(set_attr "type" "load")
3135 (set_attr "length" "4")])
3138 [(set (match_operand:SI 0 "register_operand" "=r")
3139 (zero_extend:SI (mem:QI (plus:DI
3140 (match_operand:DI 1 "register_operand" "+r")
3141 (match_operand:DI 2 "int5_operand" "L")))))
3142 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3145 [(set_attr "type" "load")
3146 (set_attr "length" "4")])
3149 [(set (match_operand:HI 0 "register_operand" "=r")
3150 (zero_extend:HI (mem:QI (plus:SI
3151 (match_operand:SI 1 "register_operand" "+r")
3152 (match_operand:SI 2 "int5_operand" "L")))))
3153 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3155 "{ldbs|ldb},mb %2(%1),%0"
3156 [(set_attr "type" "load")
3157 (set_attr "length" "4")])
3160 [(set (match_operand:HI 0 "register_operand" "=r")
3161 (zero_extend:HI (mem:QI (plus:DI
3162 (match_operand:DI 1 "register_operand" "+r")
3163 (match_operand:DI 2 "int5_operand" "L")))))
3164 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3167 [(set_attr "type" "load")
3168 (set_attr "length" "4")])
3171 [(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "+r")
3172 (match_operand:SI 1 "int5_operand" "L")))
3173 (match_operand:QI 2 "reg_or_0_operand" "rM"))
3175 (plus:SI (match_dup 0) (match_dup 1)))]
3177 "{stbs|stb},mb %r2,%1(%0)"
3178 [(set_attr "type" "store")
3179 (set_attr "length" "4")])
3182 [(set (mem:QI (plus:DI (match_operand:DI 0 "register_operand" "+r")
3183 (match_operand:DI 1 "int5_operand" "L")))
3184 (match_operand:QI 2 "reg_or_0_operand" "rM"))
3186 (plus:DI (match_dup 0) (match_dup 1)))]
3189 [(set_attr "type" "store")
3190 (set_attr "length" "4")])
3192 ;; The definition of this insn does not really explain what it does,
3193 ;; but it should suffice that anything generated as this insn will be
3194 ;; recognized as a movmemsi operation, and that it will not successfully
3195 ;; combine with anything.
3196 (define_expand "movmemsi"
3197 [(parallel [(set (match_operand:BLK 0 "" "")
3198 (match_operand:BLK 1 "" ""))
3199 (clobber (match_dup 4))
3200 (clobber (match_dup 5))
3201 (clobber (match_dup 6))
3202 (clobber (match_dup 7))
3203 (clobber (match_dup 8))
3204 (use (match_operand:SI 2 "arith_operand" ""))
3205 (use (match_operand:SI 3 "const_int_operand" ""))])]
3206 "!TARGET_64BIT && optimize > 0"
3211 /* HP provides very fast block move library routine for the PA;
3212 this routine includes:
3214 4x4 byte at a time block moves,
3215 1x4 byte at a time with alignment checked at runtime with
3216 attempts to align the source and destination as needed
3219 With that in mind, here's the heuristics to try and guess when
3220 the inlined block move will be better than the library block
3223 If the size isn't constant, then always use the library routines.
3225 If the size is large in respect to the known alignment, then use
3226 the library routines.
3228 If the size is small in respect to the known alignment, then open
3229 code the copy (since that will lead to better scheduling).
3231 Else use the block move pattern. */
3233 /* Undetermined size, use the library routine. */
3234 if (GET_CODE (operands[2]) != CONST_INT)
3237 size = INTVAL (operands[2]);
3238 align = INTVAL (operands[3]);
3239 align = align > 4 ? 4 : align;
3241 /* If size/alignment is large, then use the library routines. */
3242 if (size / align > 16)
3245 /* This does happen, but not often enough to worry much about. */
3246 if (size / align < MOVE_RATIO)
3249 /* Fall through means we're going to use our block move pattern. */
3251 = replace_equiv_address (operands[0],
3252 copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
3254 = replace_equiv_address (operands[1],
3255 copy_to_mode_reg (SImode, XEXP (operands[1], 0)));
3256 operands[4] = gen_reg_rtx (SImode);
3257 operands[5] = gen_reg_rtx (SImode);
3258 operands[6] = gen_reg_rtx (SImode);
3259 operands[7] = gen_reg_rtx (SImode);
3260 operands[8] = gen_reg_rtx (SImode);
3263 ;; The operand constraints are written like this to support both compile-time
3264 ;; and run-time determined byte counts. The expander and output_block_move
3265 ;; only support compile-time determined counts at this time.
3267 ;; If the count is run-time determined, the register with the byte count
3268 ;; is clobbered by the copying code, and therefore it is forced to operand 2.
3270 ;; We used to clobber operands 0 and 1. However, a change to regrename.c
3271 ;; broke this semantic for pseudo registers. We can't use match_scratch
3272 ;; as this requires two registers in the class R1_REGS when the MEMs for
3273 ;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are
3274 ;; forced to internally copy operands 0 and 1 to operands 7 and 8,
3275 ;; respectively. We then split or peephole optimize after reload.
3276 (define_insn "movmemsi_prereload"
3277 [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
3278 (mem:BLK (match_operand:SI 1 "register_operand" "r,r")))
3279 (clobber (match_operand:SI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3280 (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
3281 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
3282 (clobber (match_operand:SI 7 "register_operand" "=&r,&r")) ;item tmp3
3283 (clobber (match_operand:SI 8 "register_operand" "=&r,&r")) ;item tmp4
3284 (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count
3285 (use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment
3288 [(set_attr "type" "multi,multi")])
3291 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3292 (match_operand:BLK 1 "memory_operand" ""))
3293 (clobber (match_operand:SI 2 "register_operand" ""))
3294 (clobber (match_operand:SI 3 "register_operand" ""))
3295 (clobber (match_operand:SI 6 "register_operand" ""))
3296 (clobber (match_operand:SI 7 "register_operand" ""))
3297 (clobber (match_operand:SI 8 "register_operand" ""))
3298 (use (match_operand:SI 4 "arith_operand" ""))
3299 (use (match_operand:SI 5 "const_int_operand" ""))])]
3300 "!TARGET_64BIT && reload_completed && !flag_peephole2
3301 && GET_CODE (operands[0]) == MEM
3302 && register_operand (XEXP (operands[0], 0), SImode)
3303 && GET_CODE (operands[1]) == MEM
3304 && register_operand (XEXP (operands[1], 0), SImode)"
3305 [(set (match_dup 7) (match_dup 9))
3306 (set (match_dup 8) (match_dup 10))
3307 (parallel [(set (match_dup 0) (match_dup 1))
3308 (clobber (match_dup 2))
3309 (clobber (match_dup 3))
3310 (clobber (match_dup 6))
3311 (clobber (match_dup 7))
3312 (clobber (match_dup 8))
3318 operands[9] = XEXP (operands[0], 0);
3319 operands[10] = XEXP (operands[1], 0);
3320 operands[0] = replace_equiv_address (operands[0], operands[7]);
3321 operands[1] = replace_equiv_address (operands[1], operands[8]);
3325 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3326 (match_operand:BLK 1 "memory_operand" ""))
3327 (clobber (match_operand:SI 2 "register_operand" ""))
3328 (clobber (match_operand:SI 3 "register_operand" ""))
3329 (clobber (match_operand:SI 6 "register_operand" ""))
3330 (clobber (match_operand:SI 7 "register_operand" ""))
3331 (clobber (match_operand:SI 8 "register_operand" ""))
3332 (use (match_operand:SI 4 "arith_operand" ""))
3333 (use (match_operand:SI 5 "const_int_operand" ""))])]
3335 && GET_CODE (operands[0]) == MEM
3336 && register_operand (XEXP (operands[0], 0), SImode)
3337 && GET_CODE (operands[1]) == MEM
3338 && register_operand (XEXP (operands[1], 0), SImode)"
3339 [(parallel [(set (match_dup 0) (match_dup 1))
3340 (clobber (match_dup 2))
3341 (clobber (match_dup 3))
3342 (clobber (match_dup 6))
3343 (clobber (match_dup 7))
3344 (clobber (match_dup 8))
3350 rtx addr = XEXP (operands[0], 0);
3351 if (dead_or_set_p (curr_insn, addr))
3355 emit_insn (gen_rtx_SET (VOIDmode, operands[7], addr));
3356 operands[0] = replace_equiv_address (operands[0], operands[7]);
3359 addr = XEXP (operands[1], 0);
3360 if (dead_or_set_p (curr_insn, addr))
3364 emit_insn (gen_rtx_SET (VOIDmode, operands[8], addr));
3365 operands[1] = replace_equiv_address (operands[1], operands[8]);
3369 (define_insn "movmemsi_postreload"
3370 [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r,r"))
3371 (mem:BLK (match_operand:SI 1 "register_operand" "+r,r")))
3372 (clobber (match_operand:SI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3373 (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
3374 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
3375 (clobber (match_dup 0))
3376 (clobber (match_dup 1))
3377 (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count
3378 (use (match_operand:SI 5 "const_int_operand" "n,n")) ;alignment
3380 "!TARGET_64BIT && reload_completed"
3381 "* return output_block_move (operands, !which_alternative);"
3382 [(set_attr "type" "multi,multi")])
3384 (define_expand "movmemdi"
3385 [(parallel [(set (match_operand:BLK 0 "" "")
3386 (match_operand:BLK 1 "" ""))
3387 (clobber (match_dup 4))
3388 (clobber (match_dup 5))
3389 (clobber (match_dup 6))
3390 (clobber (match_dup 7))
3391 (clobber (match_dup 8))
3392 (use (match_operand:DI 2 "arith_operand" ""))
3393 (use (match_operand:DI 3 "const_int_operand" ""))])]
3394 "TARGET_64BIT && optimize > 0"
3399 /* HP provides very fast block move library routine for the PA;
3400 this routine includes:
3402 4x4 byte at a time block moves,
3403 1x4 byte at a time with alignment checked at runtime with
3404 attempts to align the source and destination as needed
3407 With that in mind, here's the heuristics to try and guess when
3408 the inlined block move will be better than the library block
3411 If the size isn't constant, then always use the library routines.
3413 If the size is large in respect to the known alignment, then use
3414 the library routines.
3416 If the size is small in respect to the known alignment, then open
3417 code the copy (since that will lead to better scheduling).
3419 Else use the block move pattern. */
3421 /* Undetermined size, use the library routine. */
3422 if (GET_CODE (operands[2]) != CONST_INT)
3425 size = INTVAL (operands[2]);
3426 align = INTVAL (operands[3]);
3427 align = align > 8 ? 8 : align;
3429 /* If size/alignment is large, then use the library routines. */
3430 if (size / align > 16)
3433 /* This does happen, but not often enough to worry much about. */
3434 if (size / align < MOVE_RATIO)
3437 /* Fall through means we're going to use our block move pattern. */
3439 = replace_equiv_address (operands[0],
3440 copy_to_mode_reg (DImode, XEXP (operands[0], 0)));
3442 = replace_equiv_address (operands[1],
3443 copy_to_mode_reg (DImode, XEXP (operands[1], 0)));
3444 operands[4] = gen_reg_rtx (DImode);
3445 operands[5] = gen_reg_rtx (DImode);
3446 operands[6] = gen_reg_rtx (DImode);
3447 operands[7] = gen_reg_rtx (DImode);
3448 operands[8] = gen_reg_rtx (DImode);
3451 ;; The operand constraints are written like this to support both compile-time
3452 ;; and run-time determined by