1 ;;- Machine description for HP PA-RISC architecture for GCC compiler
2 ;; Copyright (C) 1992-2024 Free Software Foundation, Inc.
3 ;; Contributed by the Center for Software Science at the University
6 ;; This file is part of GCC.
8 ;; GCC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 3, or (at your option)
13 ;; GCC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GCC; see the file COPYING3. If not see
20 ;; <http://www.gnu.org/licenses/>.
22 ;; This machine description is inspired by sparc.md and to a lesser
25 ;; Possible improvements:
27 ;; * With PA1.1, most computational instructions can conditionally nullify
28 ;; the execution of the following instruction. A nullified instruction
29 ;; does not cause the instruction pipeline to stall, making it a very
30 ;; efficient alternative to e.g. branching or conditional moves.
32 ;; Nullification is performed conditionally based on the outcome of a
33 ;; test specified in the opcode. The test result is stored in PSW[N]
34 ;; and can only be used to nullify the instruction following immediately
35 ;; after the test. For example:
39 ;; sub,< %r26,%r25,%r28
40 ;; sub %r28,%r25,%r28 ; %r28 == 0
41 ;; sub,> %r26,%r25,%r29
42 ;; sub %r29,%r25,%r29 ; %r29 == 5
44 ;; This could be tricky to implement because the result of the test has
45 ;; to be propagated one instruction forward, which, in the worst case,
46 ;; would involve (1) adding a fake register for PSW[N]; (2) adding the
47 ;; variants of the computational instructions that set or consume this
48 ;; fake register. The cond_exec infrastructure is probably not helpful
51 ;; * PA-RISC includes a set of conventions for branch instruction usage
52 ;; to indicate whether a particular branch is more likely to be taken
53 ;; or not taken. For example, the prediction for CMPB instructions
54 ;; (CMPB,cond,n r1,r2,target) depends on the direction of the branch
55 ;; (forward or backward) and on the order of the operands:
57 ;; | branch | operand | branch |
58 ;; | direction | compare | prediction |
59 ;; +-----------+----------+------------+
60 ;; | backward | r1 < r2 | taken |
61 ;; | backward | r1 >= r2 | not taken |
62 ;; | forward | r1 < r2 | not taken |
63 ;; | forward | r1 >= r2 | taken |
65 ;; By choosing instructions and operand order carefully, the compiler
66 ;; could give the CPU branch predictor some help.
69 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
71 ;; Uses of UNSPEC in this file:
73 (define_c_enum "unspec"
74 [UNSPEC_CFFC ; canonicalize_funcptr_for_compare
75 UNSPEC_GOTO ; indirect_goto
92 (define_c_enum "unspecv"
93 [UNSPECV_BLOCKAGE ; blockage
94 UNSPECV_DCACHE ; dcacheflush
95 UNSPECV_ICACHE ; icacheflush
96 UNSPECV_OPC ; outline_prologue_call
97 UNSPECV_OEC ; outline_epilogue_call
98 UNSPECV_LONGJMP ; builtin_longjmp
99 UNSPECV_GET_FPSR ; get floating-point status register
100 UNSPECV_SET_FPSR ; set floating-point status register
103 ;; Maximum pc-relative branch offsets.
105 ;; These numbers are a bit smaller than the maximum allowable offsets
106 ;; so that a few instructions may be inserted before the actual branch.
109 [(MAX_12BIT_OFFSET 8184) ; 12-bit branch
110 (MAX_17BIT_OFFSET 262100) ; 17-bit branch
121 ;; Mode and code iterators
123 ;; This mode iterator allows :P to be used for patterns that operate on
124 ;; pointer-sized quantities. Exactly one of the two alternatives will match.
125 (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
127 ;; This attribute defines the condition prefix for word and double word
128 ;; add, compare, subtract and logical instructions.
129 (define_mode_attr dwc [(SI "") (DI "*")])
131 ;; Insn type. Used to default other attribute values.
133 ;; type "unary" insns have one input operand (1) and one output operand (0)
134 ;; type "binary" insns have two input operands (1,2) and one output (0)
137 "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,sh_func_adrs,parallel_branch,fpstore_load,store_fpload,trap"
138 (const_string "binary"))
140 (define_attr "pa_combine_type"
141 "fmpy,faddsub,uncond_branch,addmove,none"
142 (const_string "none"))
144 ;; Processor type (for scheduling, not code generation) -- this attribute
145 ;; must exactly match the processor_type enumeration in pa.h.
147 ;; FIXME: Add 800 scheduling for completeness?
149 (define_attr "cpu" "700,7100,7100LC,7200,7300,8000" (const (symbol_ref "pa_cpu_attr")))
151 ;; Length (in # of bytes).
152 (define_attr "length" ""
153 (cond [(eq_attr "type" "load,fpload")
154 (if_then_else (match_operand 1 "symbolic_memory_operand" "")
155 (const_int 8) (const_int 4))
157 (eq_attr "type" "store,fpstore")
158 (if_then_else (match_operand 0 "symbolic_memory_operand" "")
159 (const_int 8) (const_int 4))
161 (eq_attr "type" "binary,shift,nullshift")
162 (if_then_else (match_operand 2 "arith14_operand" "")
163 (const_int 4) (const_int 12))
165 (eq_attr "type" "move,unary,shift,nullshift")
166 (if_then_else (match_operand 1 "arith14_operand" "")
167 (const_int 4) (const_int 8))]
171 (define_asm_attributes
172 [(set_attr "length" "4")
173 (set_attr "type" "multi")])
175 ;; Attributes for instruction and branch scheduling
177 ;; For conditional branches. Frame related instructions are not allowed
178 ;; because they confuse the unwind support.
179 (define_attr "in_branch_delay" "false,true"
180 (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch,trap")
181 (eq_attr "length" "4")
182 (not (match_test "RTX_FRAME_RELATED_P (insn)")))
183 (const_string "true")
184 (const_string "false")))
186 ;; Disallow instructions which use the FPU since they will tie up the FPU
187 ;; even if the instruction is nullified.
188 (define_attr "in_nullified_branch_delay" "false,true"
189 (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch,trap")
190 (eq_attr "length" "4")
191 (not (match_test "RTX_FRAME_RELATED_P (insn)")))
192 (const_string "true")
193 (const_string "false")))
195 ;; For calls and millicode calls.
196 (define_attr "in_call_delay" "false,true"
197 (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch,trap")
198 (eq_attr "length" "4")
199 (not (match_test "RTX_FRAME_RELATED_P (insn)")))
200 (const_string "true")
201 (const_string "false")))
203 ;; Call delay slot description.
204 (define_delay (eq_attr "type" "call")
205 [(eq_attr "in_call_delay" "true") (nil) (nil)])
207 ;; Sibcall delay slot description.
208 (define_delay (eq_attr "type" "sibcall")
209 [(eq_attr "in_call_delay" "true") (nil) (nil)])
211 ;; Millicode call delay slot description.
212 (define_delay (eq_attr "type" "milli")
213 [(eq_attr "in_call_delay" "true") (nil) (nil)])
215 ;; Return and other similar instructions.
216 (define_delay (eq_attr "type" "branch,parallel_branch")
217 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
219 ;; Floating point conditional branch delay slot description.
220 (define_delay (eq_attr "type" "fbranch")
221 [(eq_attr "in_branch_delay" "true")
222 (eq_attr "in_nullified_branch_delay" "true")
225 ;; Integer conditional branch delay slot description.
226 ;; Nullification of conditional branches on the PA is dependent on the
227 ;; direction of the branch. Forward branches nullify true and
228 ;; backward branches nullify false. If the direction is unknown
229 ;; then nullification is not allowed.
230 (define_delay (eq_attr "type" "cbranch")
231 [(eq_attr "in_branch_delay" "true")
232 (and (eq_attr "in_nullified_branch_delay" "true")
233 (attr_flag "forward"))
234 (and (eq_attr "in_nullified_branch_delay" "true")
235 (attr_flag "backward"))])
237 (define_delay (eq_attr "type" "uncond_branch")
238 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
240 ;; Memory. Disregarding Cache misses, the Mustang memory times are:
241 ;; load: 2, fpload: 3
242 ;; store, fpstore: 3, no D-cache operations should be scheduled.
244 ;; The Timex (aka 700) has two floating-point units: ALU, and MUL/DIV/SQRT.
246 ;; Instruction Time Unit Minimum Distance (unit contention)
253 ;; fmpyadd 3 ALU,MPY 2
254 ;; fmpysub 3 ALU,MPY 2
255 ;; fmpycfxt 3 ALU,MPY 2
258 ;; fdiv,sgl 10 MPY 10
259 ;; fdiv,dbl 12 MPY 12
260 ;; fsqrt,sgl 14 MPY 14
261 ;; fsqrt,dbl 18 MPY 18
263 ;; We don't model fmpyadd/fmpysub properly as those instructions
264 ;; keep both the FP ALU and MPY units busy. Given that these
265 ;; processors are obsolete, I'm not going to spend the time to
266 ;; model those instructions correctly.
268 (define_automaton "pa700")
269 (define_cpu_unit "dummy_700,mem_700,fpalu_700,fpmpy_700" "pa700")
271 (define_insn_reservation "W0" 4
272 (and (eq_attr "type" "fpcc")
273 (eq_attr "cpu" "700"))
276 (define_insn_reservation "W1" 3
277 (and (eq_attr "type" "fpalu")
278 (eq_attr "cpu" "700"))
281 (define_insn_reservation "W2" 3
282 (and (eq_attr "type" "fpmulsgl,fpmuldbl")
283 (eq_attr "cpu" "700"))
286 (define_insn_reservation "W3" 10
287 (and (eq_attr "type" "fpdivsgl")
288 (eq_attr "cpu" "700"))
291 (define_insn_reservation "W4" 12
292 (and (eq_attr "type" "fpdivdbl")
293 (eq_attr "cpu" "700"))
296 (define_insn_reservation "W5" 14
297 (and (eq_attr "type" "fpsqrtsgl")
298 (eq_attr "cpu" "700"))
301 (define_insn_reservation "W6" 18
302 (and (eq_attr "type" "fpsqrtdbl")
303 (eq_attr "cpu" "700"))
306 (define_insn_reservation "W7" 2
307 (and (eq_attr "type" "load")
308 (eq_attr "cpu" "700"))
311 (define_insn_reservation "W8" 2
312 (and (eq_attr "type" "fpload")
313 (eq_attr "cpu" "700"))
316 (define_insn_reservation "W9" 3
317 (and (eq_attr "type" "store")
318 (eq_attr "cpu" "700"))
321 (define_insn_reservation "W10" 3
322 (and (eq_attr "type" "fpstore")
323 (eq_attr "cpu" "700"))
326 (define_insn_reservation "W11" 5
327 (and (eq_attr "type" "fpstore_load")
328 (eq_attr "cpu" "700"))
331 (define_insn_reservation "W12" 6
332 (and (eq_attr "type" "store_fpload")
333 (eq_attr "cpu" "700"))
336 (define_insn_reservation "W13" 1
337 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,load,fpload,store,fpstore,fpstore_load,store_fpload")
338 (eq_attr "cpu" "700"))
341 ;; We have a bypass for all computations in the FP unit which feed an
342 ;; FP store as long as the sizes are the same.
343 (define_bypass 2 "W1,W2" "W10,W11" "pa_fpstore_bypass_p")
344 (define_bypass 9 "W3" "W10,W11" "pa_fpstore_bypass_p")
345 (define_bypass 11 "W4" "W10,W11" "pa_fpstore_bypass_p")
346 (define_bypass 13 "W5" "W10,W11" "pa_fpstore_bypass_p")
347 (define_bypass 17 "W6" "W10,W11" "pa_fpstore_bypass_p")
349 ;; We have an "anti-bypass" for FP loads which feed an FP store.
350 (define_bypass 4 "W8,W12" "W10,W11" "pa_fpstore_bypass_p")
352 ;; Function units for the 7100 and 7150. The 7100/7150 can dual-issue
353 ;; floating point computations with non-floating point computations (fp loads
354 ;; and stores are not fp computations).
356 ;; Memory. Disregarding Cache misses, memory loads take two cycles; stores also
357 ;; take two cycles, during which no Dcache operations should be scheduled.
358 ;; Any special cases are handled in pa_adjust_cost. The 7100, 7150 and 7100LC
359 ;; all have the same memory characteristics if one disregards cache misses.
361 ;; The 7100/7150 has three floating-point units: ALU, MUL, and DIV.
362 ;; There's no value in modeling the ALU and MUL separately though
363 ;; since there can never be a functional unit conflict given the
364 ;; latency and issue rates for those units.
367 ;; Instruction Time Unit Minimum Distance (unit contention)
374 ;; fmpyadd 2 ALU,MPY 1
375 ;; fmpysub 2 ALU,MPY 1
376 ;; fmpycfxt 2 ALU,MPY 1
380 ;; fdiv,dbl 15 DIV 15
382 ;; fsqrt,dbl 15 DIV 15
384 (define_automaton "pa7100")
385 (define_cpu_unit "i_7100, f_7100,fpmac_7100,fpdivsqrt_7100,mem_7100" "pa7100")
387 (define_insn_reservation "X0" 2
388 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
389 (eq_attr "cpu" "7100"))
392 (define_insn_reservation "X1" 8
393 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl")
394 (eq_attr "cpu" "7100"))
395 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*7")
397 (define_insn_reservation "X2" 15
398 (and (eq_attr "type" "fpdivdbl,fpsqrtdbl")
399 (eq_attr "cpu" "7100"))
400 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*14")
402 (define_insn_reservation "X3" 2
403 (and (eq_attr "type" "load")
404 (eq_attr "cpu" "7100"))
407 (define_insn_reservation "X4" 2
408 (and (eq_attr "type" "fpload")
409 (eq_attr "cpu" "7100"))
412 (define_insn_reservation "X5" 2
413 (and (eq_attr "type" "store")
414 (eq_attr "cpu" "7100"))
415 "i_7100+mem_7100,mem_7100")
417 (define_insn_reservation "X6" 2
418 (and (eq_attr "type" "fpstore")
419 (eq_attr "cpu" "7100"))
420 "i_7100+mem_7100,mem_7100")
422 (define_insn_reservation "X7" 4
423 (and (eq_attr "type" "fpstore_load")
424 (eq_attr "cpu" "7100"))
425 "i_7100+mem_7100,mem_7100*3")
427 (define_insn_reservation "X8" 4
428 (and (eq_attr "type" "store_fpload")
429 (eq_attr "cpu" "7100"))
430 "i_7100+mem_7100,mem_7100*3")
432 (define_insn_reservation "X9" 1
433 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,fpstore_load,store_fpload")
434 (eq_attr "cpu" "7100"))
437 ;; We have a bypass for all computations in the FP unit which feed an
438 ;; FP store as long as the sizes are the same.
439 (define_bypass 1 "X0" "X6,X7" "pa_fpstore_bypass_p")
440 (define_bypass 7 "X1" "X6,X7" "pa_fpstore_bypass_p")
441 (define_bypass 14 "X2" "X6,X7" "pa_fpstore_bypass_p")
443 ;; We have an "anti-bypass" for FP loads which feed an FP store.
444 (define_bypass 3 "X4,X8" "X6,X7" "pa_fpstore_bypass_p")
446 ;; The 7100LC has three floating-point units: ALU, MUL, and DIV.
447 ;; There's no value in modeling the ALU and MUL separately though
448 ;; since there can never be a functional unit conflict that
449 ;; can be avoided given the latency, issue rates and mandatory
450 ;; one cycle cpu-wide lock for a double precision fp multiply.
453 ;; Instruction Time Unit Minimum Distance (unit contention)
460 ;; fmpyadd,sgl 2 ALU,MPY 1
461 ;; fmpyadd,dbl 3 ALU,MPY 2
462 ;; fmpysub,sgl 2 ALU,MPY 1
463 ;; fmpysub,dbl 3 ALU,MPY 2
464 ;; fmpycfxt,sgl 2 ALU,MPY 1
465 ;; fmpycfxt,dbl 3 ALU,MPY 2
470 ;; fdiv,dbl 15 DIV 15
472 ;; fsqrt,dbl 15 DIV 15
474 ;; The PA7200 is just like the PA7100LC except that there is
475 ;; no store-store penalty.
477 ;; The PA7300 is just like the PA7200 except that there is
478 ;; no store-load penalty.
480 ;; Note there are some aspects of the 7100LC we are not modeling
481 ;; at the moment. I'll be reviewing the 7100LC scheduling info
482 ;; shortly and updating this description.
486 ;; other issue modeling
488 (define_automaton "pa7100lc")
489 (define_cpu_unit "i0_7100lc, i1_7100lc, f_7100lc" "pa7100lc")
490 (define_cpu_unit "fpmac_7100lc" "pa7100lc")
491 (define_cpu_unit "mem_7100lc" "pa7100lc")
493 ;; Double precision multiplies lock the entire CPU for one
494 ;; cycle. There is no way to avoid this lock and trying to
495 ;; schedule around the lock is pointless and thus there is no
496 ;; value in trying to model this lock.
498 ;; Not modeling the lock allows us to treat fp multiplies just
499 ;; like any other FP alu instruction. It allows for a smaller
500 ;; DFA and may reduce register pressure.
501 (define_insn_reservation "Y0" 2
502 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
503 (eq_attr "cpu" "7100LC,7200,7300"))
504 "f_7100lc,fpmac_7100lc")
506 ;; fp division and sqrt instructions lock the entire CPU for
507 ;; 7 cycles (single precision) or 14 cycles (double precision).
508 ;; There is no way to avoid this lock and trying to schedule
509 ;; around the lock is pointless and thus there is no value in
510 ;; trying to model this lock. Not modeling the lock allows
511 ;; for a smaller DFA and may reduce register pressure.
512 (define_insn_reservation "Y1" 1
513 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl")
514 (eq_attr "cpu" "7100LC,7200,7300"))
517 (define_insn_reservation "Y2" 2
518 (and (eq_attr "type" "load")
519 (eq_attr "cpu" "7100LC,7200,7300"))
520 "i1_7100lc+mem_7100lc")
522 (define_insn_reservation "Y3" 2
523 (and (eq_attr "type" "fpload")
524 (eq_attr "cpu" "7100LC,7200,7300"))
525 "i1_7100lc+mem_7100lc")
527 (define_insn_reservation "Y4" 2
528 (and (eq_attr "type" "store")
529 (eq_attr "cpu" "7100LC"))
530 "i1_7100lc+mem_7100lc,mem_7100lc")
532 (define_insn_reservation "Y5" 2
533 (and (eq_attr "type" "fpstore")
534 (eq_attr "cpu" "7100LC"))
535 "i1_7100lc+mem_7100lc,mem_7100lc")
537 (define_insn_reservation "Y6" 4
538 (and (eq_attr "type" "fpstore_load")
539 (eq_attr "cpu" "7100LC"))
540 "i1_7100lc+mem_7100lc,mem_7100lc*3")
542 (define_insn_reservation "Y7" 4
543 (and (eq_attr "type" "store_fpload")
544 (eq_attr "cpu" "7100LC"))
545 "i1_7100lc+mem_7100lc,mem_7100lc*3")
547 (define_insn_reservation "Y8" 1
548 (and (eq_attr "type" "shift,nullshift")
549 (eq_attr "cpu" "7100LC,7200,7300"))
552 (define_insn_reservation "Y9" 1
553 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift")
554 (eq_attr "cpu" "7100LC,7200,7300"))
555 "(i0_7100lc|i1_7100lc)")
557 ;; The 7200 has a store-load penalty
558 (define_insn_reservation "Y10" 2
559 (and (eq_attr "type" "store")
560 (eq_attr "cpu" "7200"))
561 "i1_7100lc,mem_7100lc")
563 (define_insn_reservation "Y11" 2
564 (and (eq_attr "type" "fpstore")
565 (eq_attr "cpu" "7200"))
566 "i1_7100lc,mem_7100lc")
568 (define_insn_reservation "Y12" 4
569 (and (eq_attr "type" "fpstore_load")
570 (eq_attr "cpu" "7200"))
571 "i1_7100lc,mem_7100lc,i1_7100lc+mem_7100lc")
573 (define_insn_reservation "Y13" 4
574 (and (eq_attr "type" "store_fpload")
575 (eq_attr "cpu" "7200"))
576 "i1_7100lc,mem_7100lc,i1_7100lc+mem_7100lc")
578 ;; The 7300 has no penalty for store-store or store-load
579 (define_insn_reservation "Y14" 2
580 (and (eq_attr "type" "store")
581 (eq_attr "cpu" "7300"))
584 (define_insn_reservation "Y15" 2
585 (and (eq_attr "type" "fpstore")
586 (eq_attr "cpu" "7300"))
589 (define_insn_reservation "Y16" 4
590 (and (eq_attr "type" "fpstore_load")
591 (eq_attr "cpu" "7300"))
592 "i1_7100lc,i1_7100lc+mem_7100lc")
594 (define_insn_reservation "Y17" 4
595 (and (eq_attr "type" "store_fpload")
596 (eq_attr "cpu" "7300"))
597 "i1_7100lc,i1_7100lc+mem_7100lc")
599 ;; We have an "anti-bypass" for FP loads which feed an FP store.
600 (define_bypass 3 "Y3,Y7,Y13,Y17" "Y5,Y6,Y11,Y12,Y15,Y16" "pa_fpstore_bypass_p")
602 ;; Scheduling for the PA8000 is somewhat different than scheduling for a
603 ;; traditional architecture.
605 ;; The PA8000 has a large (56) entry reorder buffer that is split between
606 ;; memory and non-memory operations.
608 ;; The PA8000 can issue two memory and two non-memory operations per cycle to
609 ;; the function units, with the exception of branches and multi-output
610 ;; instructions. The PA8000 can retire two non-memory operations per cycle
611 ;; and two memory operations per cycle, only one of which may be a store.
613 ;; Given the large reorder buffer, the processor can hide most latencies.
614 ;; According to HP, they've got the best results by scheduling for retirement
615 ;; bandwidth with limited latency scheduling for floating point operations.
616 ;; Latency for integer operations and memory references is ignored.
619 ;; We claim floating point operations have a 2 cycle latency and are
620 ;; fully pipelined, except for div and sqrt which are not pipelined and
621 ;; take from 17 to 31 cycles to complete.
623 ;; It's worth noting that there is no way to saturate all the functional
624 ;; units on the PA8000 as there is not enough issue bandwidth.
626 (define_automaton "pa8000")
627 (define_cpu_unit "inm0_8000, inm1_8000, im0_8000, im1_8000" "pa8000")
628 (define_cpu_unit "rnm0_8000, rnm1_8000, rm0_8000, rm1_8000" "pa8000")
629 (define_cpu_unit "store_8000" "pa8000")
630 (define_cpu_unit "f0_8000, f1_8000" "pa8000")
631 (define_cpu_unit "fdivsqrt0_8000, fdivsqrt1_8000" "pa8000")
632 (define_reservation "inm_8000" "inm0_8000 | inm1_8000")
633 (define_reservation "im_8000" "im0_8000 | im1_8000")
634 (define_reservation "rnm_8000" "rnm0_8000 | rnm1_8000")
635 (define_reservation "rm_8000" "rm0_8000 | rm1_8000")
636 (define_reservation "f_8000" "f0_8000 | f1_8000")
637 (define_reservation "fdivsqrt_8000" "fdivsqrt0_8000 | fdivsqrt1_8000")
639 ;; We can issue any two memops per cycle, but we can only retire
640 ;; one memory store per cycle. We assume that the reorder buffer
641 ;; will hide any memory latencies per HP's recommendation.
642 (define_insn_reservation "Z0" 0
644 (eq_attr "type" "load,fpload")
645 (eq_attr "cpu" "8000"))
648 (define_insn_reservation "Z1" 0
650 (eq_attr "type" "store,fpstore")
651 (eq_attr "cpu" "8000"))
652 "im_8000,rm_8000+store_8000")
654 (define_insn_reservation "Z2" 0
655 (and (eq_attr "type" "fpstore_load,store_fpload")
656 (eq_attr "cpu" "8000"))
657 "im_8000,rm_8000+store_8000,im_8000,rm_8000")
659 ;; We can issue and retire two non-memory operations per cycle with
660 ;; a few exceptions (branches). This group catches those we want
661 ;; to assume have zero latency.
662 (define_insn_reservation "Z3" 0
664 (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl,fpstore_load,store_fpload")
665 (eq_attr "cpu" "8000"))
668 ;; Branches use both slots in the non-memory issue and
670 (define_insn_reservation "Z4" 0
672 (eq_attr "type" "uncond_branch,branch,cbranch,fbranch,call,sibcall,dyncall,multi,milli,sh_func_adrs,parallel_branch")
673 (eq_attr "cpu" "8000"))
674 "inm0_8000+inm1_8000,rnm0_8000+rnm1_8000")
676 ;; We partial latency schedule the floating point units.
677 ;; They can issue/retire two at a time in the non-memory
678 ;; units. We fix their latency at 2 cycles and they
679 ;; are fully pipelined.
680 (define_insn_reservation "Z5" 1
682 (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
683 (eq_attr "cpu" "8000"))
684 "inm_8000,f_8000,rnm_8000")
686 ;; The fdivsqrt units are not pipelined and have a very long latency.
687 ;; To keep the DFA from exploding, we do not show all the
688 ;; reservations for the divsqrt unit.
689 (define_insn_reservation "Z6" 17
691 (eq_attr "type" "fpdivsgl,fpsqrtsgl")
692 (eq_attr "cpu" "8000"))
693 "inm_8000,fdivsqrt_8000*6,rnm_8000")
695 (define_insn_reservation "Z7" 31
697 (eq_attr "type" "fpdivdbl,fpsqrtdbl")
698 (eq_attr "cpu" "8000"))
699 "inm_8000,fdivsqrt_8000*6,rnm_8000")
701 ;; Operand and operator predicates and constraints
703 (include "predicates.md")
704 (include "constraints.md")
706 ;; Compare instructions.
707 ;; This controls RTL generation and register allocation.
711 (match_operator:CCFP 2 "comparison_operator"
712 [(match_operand:SF 0 "reg_or_0_operand" "fG")
713 (match_operand:SF 1 "reg_or_0_operand" "fG")]))]
714 "! TARGET_SOFT_FLOAT"
715 "fcmp,sgl,%Y2 %f0,%f1"
716 [(set_attr "length" "4")
717 (set_attr "type" "fpcc")])
721 (match_operator:CCFP 2 "comparison_operator"
722 [(match_operand:DF 0 "reg_or_0_operand" "fG")
723 (match_operand:DF 1 "reg_or_0_operand" "fG")]))]
724 "! TARGET_SOFT_FLOAT"
725 "fcmp,dbl,%Y2 %f0,%f1"
726 [(set_attr "length" "4")
727 (set_attr "type" "fpcc")])
729 ;; Provide a means to emit the movccfp0 and movccfp1 optimization
730 ;; placeholders. This is necessary in rare situations when a
731 ;; placeholder is re-emitted (see PR 8705).
733 (define_expand "movccfp"
735 (match_operand 0 "const_int_operand" ""))]
736 "! TARGET_SOFT_FLOAT"
739 if ((unsigned HOST_WIDE_INT) INTVAL (operands[0]) > 1)
743 ;; The following patterns are optimization placeholders. In almost
744 ;; all cases, the user of the condition code will be simplified and the
745 ;; original condition code setting insn should be eliminated.
747 (define_insn "*movccfp0"
750 "! TARGET_SOFT_FLOAT"
751 "fcmp,dbl,= %%fr0,%%fr0"
752 [(set_attr "length" "4")
753 (set_attr "type" "fpcc")])
755 (define_insn "*movccfp1"
758 "! TARGET_SOFT_FLOAT"
759 "fcmp,dbl,!= %%fr0,%%fr0"
760 [(set_attr "length" "4")
761 (set_attr "type" "fpcc")])
765 (define_expand "cstoresi4"
766 [(set (match_operand:SI 0 "register_operand")
767 (match_operator:SI 1 "ordered_comparison_operator"
768 [(match_operand:SI 2 "reg_or_0_operand" "")
769 (match_operand:SI 3 "arith5_operand" "")]))]
773 ;; Instruction canonicalization puts immediate operands second, which
774 ;; is the reverse of what we want.
777 [(set (match_operand:SI 0 "register_operand" "=r")
778 (match_operator:SI 3 "ordered_comparison_operator"
779 [(match_operand:SI 1 "reg_or_0_operand" "rM")
780 (match_operand:SI 2 "arith11_operand" "rI")]))]
782 "{com%I2clr|cmp%I2clr},%B3 %2,%r1,%0\;ldi 1,%0"
783 [(set_attr "type" "binary")
784 (set_attr "length" "8")])
787 [(set (match_operand:DI 0 "register_operand" "=r")
788 (match_operator:DI 3 "ordered_comparison_operator"
789 [(match_operand:DI 1 "reg_or_0_operand" "rM")
790 (match_operand:DI 2 "arith11_operand" "rI")]))]
792 "cmp%I2clr,*%B3 %2,%r1,%0\;ldi 1,%0"
793 [(set_attr "type" "binary")
794 (set_attr "length" "8")])
796 (define_insn "iorscc"
797 [(set (match_operand:SI 0 "register_operand" "=r")
798 (ior:SI (match_operator:SI 3 "ordered_comparison_operator"
799 [(match_operand:SI 1 "reg_or_0_operand" "rM")
800 (match_operand:SI 2 "arith11_operand" "rI")])
801 (match_operator:SI 6 "ordered_comparison_operator"
802 [(match_operand:SI 4 "reg_or_0_operand" "rM")
803 (match_operand:SI 5 "arith11_operand" "rI")])))]
805 "{com%I2clr|cmp%I2clr},%S3 %2,%r1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%r4,%0\;ldi 1,%0"
806 [(set_attr "type" "binary")
807 (set_attr "length" "12")])
810 [(set (match_operand:DI 0 "register_operand" "=r")
811 (ior:DI (match_operator:DI 3 "ordered_comparison_operator"
812 [(match_operand:DI 1 "reg_or_0_operand" "rM")
813 (match_operand:DI 2 "arith11_operand" "rI")])
814 (match_operator:DI 6 "ordered_comparison_operator"
815 [(match_operand:DI 4 "reg_or_0_operand" "rM")
816 (match_operand:DI 5 "arith11_operand" "rI")])))]
818 "cmp%I2clr,*%S3 %2,%r1,%%r0\;cmp%I5clr,*%B6 %5,%r4,%0\;ldi 1,%0"
819 [(set_attr "type" "binary")
820 (set_attr "length" "12")])
822 ;; Combiner patterns for common operations performed with the output
823 ;; from an scc insn (negscc and incscc).
824 (define_insn "negscc"
825 [(set (match_operand:SI 0 "register_operand" "=r")
826 (neg:SI (match_operator:SI 3 "ordered_comparison_operator"
827 [(match_operand:SI 1 "reg_or_0_operand" "rM")
828 (match_operand:SI 2 "arith11_operand" "rI")])))]
830 "{com%I2clr|cmp%I2clr},%B3 %2,%r1,%0\;ldi -1,%0"
831 [(set_attr "type" "binary")
832 (set_attr "length" "8")])
835 [(set (match_operand:DI 0 "register_operand" "=r")
836 (neg:DI (match_operator:DI 3 "ordered_comparison_operator"
837 [(match_operand:DI 1 "reg_or_0_operand" "rM")
838 (match_operand:DI 2 "arith11_operand" "rI")])))]
840 "cmp%I2clr,*%B3 %2,%r1,%0\;ldi -1,%0"
841 [(set_attr "type" "binary")
842 (set_attr "length" "8")])
844 ;; Patterns for adding/subtracting the result of a boolean expression from
845 ;; a register. First we have special patterns that make use of the carry
846 ;; bit, and output only two instructions. For the cases we can't in
847 ;; general do in two instructions, the incscc pattern at the end outputs
848 ;; two or three instructions.
851 [(set (match_operand:SI 0 "register_operand" "=r")
852 (plus:SI (leu:SI (match_operand:SI 2 "register_operand" "r")
853 (match_operand:SI 3 "arith11_operand" "rI"))
854 (match_operand:SI 1 "register_operand" "r")))]
856 "sub%I3 %3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
857 [(set_attr "type" "binary")
858 (set_attr "length" "8")])
861 [(set (match_operand:DI 0 "register_operand" "=r")
862 (plus:DI (leu:DI (match_operand:DI 2 "register_operand" "r")
863 (match_operand:DI 3 "arith11_operand" "rI"))
864 (match_operand:DI 1 "register_operand" "r")))]
866 "sub%I3 %3,%2,%%r0\;add,dc %%r0,%1,%0"
867 [(set_attr "type" "binary")
868 (set_attr "length" "8")])
870 ; This need only accept registers for op3, since canonicalization
871 ; replaces geu with gtu when op3 is an integer.
873 [(set (match_operand:SI 0 "register_operand" "=r")
874 (plus:SI (geu:SI (match_operand:SI 2 "register_operand" "r")
875 (match_operand:SI 3 "register_operand" "r"))
876 (match_operand:SI 1 "register_operand" "r")))]
878 "sub %2,%3,%%r0\;{addc|add,c} %%r0,%1,%0"
879 [(set_attr "type" "binary")
880 (set_attr "length" "8")])
883 [(set (match_operand:DI 0 "register_operand" "=r")
884 (plus:DI (geu:DI (match_operand:DI 2 "register_operand" "r")
885 (match_operand:DI 3 "register_operand" "r"))
886 (match_operand:DI 1 "register_operand" "r")))]
888 "sub %2,%3,%%r0\;add,dc %%r0,%1,%0"
889 [(set_attr "type" "binary")
890 (set_attr "length" "8")])
892 ; Match only integers for op3 here. This is used as canonical form of the
893 ; geu pattern when op3 is an integer. Don't match registers since we can't
894 ; make better code than the general incscc pattern.
896 [(set (match_operand:SI 0 "register_operand" "=r")
897 (plus:SI (gtu:SI (match_operand:SI 2 "register_operand" "r")
898 (match_operand:SI 3 "int11_operand" "I"))
899 (match_operand:SI 1 "register_operand" "r")))]
901 "addi %k3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
902 [(set_attr "type" "binary")
903 (set_attr "length" "8")])
906 [(set (match_operand:DI 0 "register_operand" "=r")
907 (plus:DI (gtu:DI (match_operand:DI 2 "register_operand" "r")
908 (match_operand:DI 3 "int11_operand" "I"))
909 (match_operand:DI 1 "register_operand" "r")))]
911 "addi %k3,%2,%%r0\;add,dc %%r0,%1,%0"
912 [(set_attr "type" "binary")
913 (set_attr "length" "8")])
915 (define_insn "incscc"
916 [(set (match_operand:SI 0 "register_operand" "=r,r")
917 (plus:SI (match_operator:SI 4 "ordered_comparison_operator"
918 [(match_operand:SI 2 "register_operand" "r,r")
919 (match_operand:SI 3 "arith11_operand" "rI,rI")])
920 (match_operand:SI 1 "register_operand" "0,?r")))]
923 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi 1,%0,%0
924 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
925 [(set_attr "type" "binary,binary")
926 (set_attr "length" "8,12")])
929 [(set (match_operand:DI 0 "register_operand" "=r,r")
930 (plus:DI (match_operator:DI 4 "ordered_comparison_operator"
931 [(match_operand:DI 2 "register_operand" "r,r")
932 (match_operand:DI 3 "arith11_operand" "rI,rI")])
933 (match_operand:DI 1 "register_operand" "0,?r")))]
936 cmp%I3clr,*%B4 %3,%2,%%r0\;addi 1,%0,%0
937 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
938 [(set_attr "type" "binary,binary")
939 (set_attr "length" "8,12")])
942 [(set (match_operand:SI 0 "register_operand" "=r")
943 (minus:SI (match_operand:SI 1 "register_operand" "r")
944 (gtu:SI (match_operand:SI 2 "register_operand" "r")
945 (match_operand:SI 3 "arith11_operand" "rI"))))]
947 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
948 [(set_attr "type" "binary")
949 (set_attr "length" "8")])
952 [(set (match_operand:DI 0 "register_operand" "=r")
953 (minus:DI (match_operand:DI 1 "register_operand" "r")
954 (gtu:DI (match_operand:DI 2 "register_operand" "r")
955 (match_operand:DI 3 "arith11_operand" "rI"))))]
957 "sub%I3 %3,%2,%%r0\;sub,db %1,%%r0,%0"
958 [(set_attr "type" "binary")
959 (set_attr "length" "8")])
962 [(set (match_operand:SI 0 "register_operand" "=r")
963 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
964 (gtu:SI (match_operand:SI 2 "register_operand" "r")
965 (match_operand:SI 3 "arith11_operand" "rI")))
966 (match_operand:SI 4 "register_operand" "r")))]
968 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
969 [(set_attr "type" "binary")
970 (set_attr "length" "8")])
973 [(set (match_operand:DI 0 "register_operand" "=r")
974 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
975 (gtu:DI (match_operand:DI 2 "register_operand" "r")
976 (match_operand:DI 3 "arith11_operand" "rI")))
977 (match_operand:DI 4 "register_operand" "r")))]
979 "sub%I3 %3,%2,%%r0\;sub,db %1,%4,%0"
980 [(set_attr "type" "binary")
981 (set_attr "length" "8")])
983 ; This need only accept registers for op3, since canonicalization
984 ; replaces ltu with leu when op3 is an integer.
986 [(set (match_operand:SI 0 "register_operand" "=r")
987 (minus:SI (match_operand:SI 1 "register_operand" "r")
988 (ltu:SI (match_operand:SI 2 "register_operand" "r")
989 (match_operand:SI 3 "register_operand" "r"))))]
991 "sub %2,%3,%%r0\;{subb|sub,b} %1,%%r0,%0"
992 [(set_attr "type" "binary")
993 (set_attr "length" "8")])
996 [(set (match_operand:DI 0 "register_operand" "=r")
997 (minus:DI (match_operand:DI 1 "register_operand" "r")
998 (ltu:DI (match_operand:DI 2 "register_operand" "r")
999 (match_operand:DI 3 "register_operand" "r"))))]
1001 "sub %2,%3,%%r0\;sub,db %1,%%r0,%0"
1002 [(set_attr "type" "binary")
1003 (set_attr "length" "8")])
1006 [(set (match_operand:SI 0 "register_operand" "=r")
1007 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1008 (ltu:SI (match_operand:SI 2 "register_operand" "r")
1009 (match_operand:SI 3 "register_operand" "r")))
1010 (match_operand:SI 4 "register_operand" "r")))]
1012 "sub %2,%3,%%r0\;{subb|sub,b} %1,%4,%0"
1013 [(set_attr "type" "binary")
1014 (set_attr "length" "8")])
1017 [(set (match_operand:DI 0 "register_operand" "=r")
1018 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1019 (ltu:DI (match_operand:DI 2 "register_operand" "r")
1020 (match_operand:DI 3 "register_operand" "r")))
1021 (match_operand:DI 4 "register_operand" "r")))]
1023 "sub %2,%3,%%r0\;sub,db %1,%4,%0"
1024 [(set_attr "type" "binary")
1025 (set_attr "length" "8")])
1027 ; Match only integers for op3 here. This is used as canonical form of the
1028 ; ltu pattern when op3 is an integer. Don't match registers since we can't
1029 ; make better code than the general incscc pattern.
1031 [(set (match_operand:SI 0 "register_operand" "=r")
1032 (minus:SI (match_operand:SI 1 "register_operand" "r")
1033 (leu:SI (match_operand:SI 2 "register_operand" "r")
1034 (match_operand:SI 3 "int11_operand" "I"))))]
1036 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
1037 [(set_attr "type" "binary")
1038 (set_attr "length" "8")])
1041 [(set (match_operand:DI 0 "register_operand" "=r")
1042 (minus:DI (match_operand:DI 1 "register_operand" "r")
1043 (leu:DI (match_operand:DI 2 "register_operand" "r")
1044 (match_operand:DI 3 "int11_operand" "I"))))]
1046 "addi %k3,%2,%%r0\;sub,db %1,%%r0,%0"
1047 [(set_attr "type" "binary")
1048 (set_attr "length" "8")])
1051 [(set (match_operand:SI 0 "register_operand" "=r")
1052 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1053 (leu:SI (match_operand:SI 2 "register_operand" "r")
1054 (match_operand:SI 3 "int11_operand" "I")))
1055 (match_operand:SI 4 "register_operand" "r")))]
1057 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
1058 [(set_attr "type" "binary")
1059 (set_attr "length" "8")])
1062 [(set (match_operand:DI 0 "register_operand" "=r")
1063 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1064 (leu:DI (match_operand:DI 2 "register_operand" "r")
1065 (match_operand:DI 3 "int11_operand" "I")))
1066 (match_operand:DI 4 "register_operand" "r")))]
1068 "addi %k3,%2,%%r0\;sub,db %1,%4,%0"
1069 [(set_attr "type" "binary")
1070 (set_attr "length" "8")])
1072 (define_insn "decscc"
1073 [(set (match_operand:SI 0 "register_operand" "=r,r")
1074 (minus:SI (match_operand:SI 1 "register_operand" "0,?r")
1075 (match_operator:SI 4 "ordered_comparison_operator"
1076 [(match_operand:SI 2 "register_operand" "r,r")
1077 (match_operand:SI 3 "arith11_operand" "rI,rI")])))]
1080 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi -1,%0,%0
1081 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1082 [(set_attr "type" "binary,binary")
1083 (set_attr "length" "8,12")])
1086 [(set (match_operand:DI 0 "register_operand" "=r,r")
1087 (minus:DI (match_operand:DI 1 "register_operand" "0,?r")
1088 (match_operator:DI 4 "ordered_comparison_operator"
1089 [(match_operand:DI 2 "register_operand" "r,r")
1090 (match_operand:DI 3 "arith11_operand" "rI,rI")])))]
1093 cmp%I3clr,*%B4 %3,%2,%%r0\;addi -1,%0,%0
1094 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1095 [(set_attr "type" "binary,binary")
1096 (set_attr "length" "8,12")])
1098 ; Patterns for max and min. (There is no need for an earlyclobber in the
1099 ; last alternative since the middle alternative will match if op0 == op1.)
1101 (define_insn "sminsi3"
1102 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1103 (smin:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1104 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1107 {comclr|cmpclr},> %2,%0,%%r0\;copy %2,%0
1108 {comiclr|cmpiclr},> %2,%0,%%r0\;ldi %2,%0
1109 {comclr|cmpclr},> %1,%r2,%0\;copy %1,%0"
1110 [(set_attr "type" "multi,multi,multi")
1111 (set_attr "length" "8,8,8")])
1113 (define_insn "smindi3"
1114 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1115 (smin:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1116 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1119 cmpclr,*> %2,%0,%%r0\;copy %2,%0
1120 cmpiclr,*> %2,%0,%%r0\;ldi %2,%0
1121 cmpclr,*> %1,%r2,%0\;copy %1,%0"
1122 [(set_attr "type" "multi,multi,multi")
1123 (set_attr "length" "8,8,8")])
1125 (define_insn "uminsi3"
1126 [(set (match_operand:SI 0 "register_operand" "=r,r")
1127 (umin:SI (match_operand:SI 1 "register_operand" "%0,0")
1128 (match_operand:SI 2 "arith11_operand" "r,I")))]
1131 {comclr|cmpclr},>> %2,%0,%%r0\;copy %2,%0
1132 {comiclr|cmpiclr},>> %2,%0,%%r0\;ldi %2,%0"
1133 [(set_attr "type" "multi,multi")
1134 (set_attr "length" "8,8")])
1136 (define_insn "umindi3"
1137 [(set (match_operand:DI 0 "register_operand" "=r,r")
1138 (umin:DI (match_operand:DI 1 "register_operand" "%0,0")
1139 (match_operand:DI 2 "arith11_operand" "r,I")))]
1142 cmpclr,*>> %2,%0,%%r0\;copy %2,%0
1143 cmpiclr,*>> %2,%0,%%r0\;ldi %2,%0"
1144 [(set_attr "type" "multi,multi")
1145 (set_attr "length" "8,8")])
1147 (define_insn "smaxsi3"
1148 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1149 (smax:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1150 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1153 {comclr|cmpclr},< %2,%0,%%r0\;copy %2,%0
1154 {comiclr|cmpiclr},< %2,%0,%%r0\;ldi %2,%0
1155 {comclr|cmpclr},< %1,%r2,%0\;copy %1,%0"
1156 [(set_attr "type" "multi,multi,multi")
1157 (set_attr "length" "8,8,8")])
1159 (define_insn "smaxdi3"
1160 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1161 (smax:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1162 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1165 cmpclr,*< %2,%0,%%r0\;copy %2,%0
1166 cmpiclr,*< %2,%0,%%r0\;ldi %2,%0
1167 cmpclr,*< %1,%r2,%0\;copy %1,%0"
1168 [(set_attr "type" "multi,multi,multi")
1169 (set_attr "length" "8,8,8")])
1171 (define_insn "umaxsi3"
1172 [(set (match_operand:SI 0 "register_operand" "=r,r")
1173 (umax:SI (match_operand:SI 1 "register_operand" "%0,0")
1174 (match_operand:SI 2 "arith11_operand" "r,I")))]
1177 {comclr|cmpclr},<< %2,%0,%%r0\;copy %2,%0
1178 {comiclr|cmpiclr},<< %2,%0,%%r0\;ldi %2,%0"
1179 [(set_attr "type" "multi,multi")
1180 (set_attr "length" "8,8")])
1182 (define_insn "umaxdi3"
1183 [(set (match_operand:DI 0 "register_operand" "=r,r")
1184 (umax:DI (match_operand:DI 1 "register_operand" "%0,0")
1185 (match_operand:DI 2 "arith11_operand" "r,I")))]
1188 cmpclr,*<< %2,%0,%%r0\;copy %2,%0
1189 cmpiclr,*<< %2,%0,%%r0\;ldi %2,%0"
1190 [(set_attr "type" "multi,multi")
1191 (set_attr "length" "8,8")])
1193 (define_insn "absqi2"
1194 [(set (match_operand:QI 0 "register_operand" "=r")
1195 (abs:QI (match_operand:QI 1 "register_operand" "r")))]
1197 "{extrs|extrw,s},>= %1,31,8,%0\;subi 0,%0,%0"
1198 [(set_attr "type" "multi")
1199 (set_attr "length" "8")])
1201 (define_insn "abshi2"
1202 [(set (match_operand:HI 0 "register_operand" "=r")
1203 (abs:HI (match_operand:HI 1 "register_operand" "r")))]
1205 "{extrs|extrw,s},>= %1,31,16,%0\;subi 0,%0,%0"
1206 [(set_attr "type" "multi")
1207 (set_attr "length" "8")])
1209 (define_insn "abssi2"
1210 [(set (match_operand:SI 0 "register_operand" "=r")
1211 (abs:SI (match_operand:SI 1 "register_operand" "r")))]
1213 "or,>= %%r0,%1,%0\;subi 0,%0,%0"
1214 [(set_attr "type" "multi")
1215 (set_attr "length" "8")])
1217 (define_insn "absdi2"
1218 [(set (match_operand:DI 0 "register_operand" "=r")
1219 (abs:DI (match_operand:DI 1 "register_operand" "r")))]
1221 "or,*>= %%r0,%1,%0\;subi 0,%0,%0"
1222 [(set_attr "type" "multi")
1223 (set_attr "length" "8")])
1225 (define_insn "bswaphi2"
1226 [(set (match_operand:HI 0 "register_operand" "=&r")
1227 (bswap:HI (match_operand:HI 1 "register_operand" "r")))]
1229 "{extru|extrw,u} %1,23,8,%0\;{dep|depw} %1,23,8,%0"
1230 [(set_attr "type" "multi")
1231 (set_attr "length" "8")])
1233 (define_insn "bswapsi2"
1234 [(set (match_operand:SI 0 "register_operand" "=&r")
1235 (bswap:SI (match_operand:SI 1 "register_operand" "r")))]
1237 "{shd|shrpw} %1,%1,16,%0\;{dep|depw} %0,15,8,%0\;{shd|shrpw} %1,%0,8,%0"
1238 [(set_attr "type" "multi")
1239 (set_attr "length" "12")])
1241 (define_insn "bswapdi2"
1242 [(set (match_operand:DI 0 "register_operand" "=&r")
1243 (bswap:DI (match_operand:DI 1 "register_operand" "r")))
1244 (clobber (match_scratch:DI 2 "=r"))]
1246 "permh,3210 %1,%2\;hshl %2,8,%0\;hshr,u %2,8,%2\;or %0,%2,%0"
1247 [(set_attr "type" "multi")
1248 (set_attr "length" "16")])
1250 ;;; Experimental conditional move patterns
1252 (define_expand "movsicc"
1253 [(set (match_operand:SI 0 "register_operand" "")
1255 (match_operand 1 "ordered_comparison_operator" "")
1256 (match_operand:SI 2 "reg_or_cint_move_operand" "")
1257 (match_operand:SI 3 "reg_or_cint_move_operand" "")))]
1261 if (GET_MODE (XEXP (operands[1], 0)) != SImode
1262 || GET_MODE (XEXP (operands[1], 0)) != GET_MODE (XEXP (operands[1], 1)))
1266 ;; We used to accept any register for op1.
1268 ;; However, it loses sometimes because the compiler will end up using
1269 ;; different registers for op0 and op1 in some critical cases. local-alloc
1270 ;; will not tie op0 and op1 because op0 is used in multiple basic blocks.
1272 ;; If/when global register allocation supports tying we should allow any
1273 ;; register for op1 again.
1275 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1277 (match_operator 2 "ordered_comparison_operator"
1278 [(match_operand:SI 3 "register_operand" "r,r,r,r")
1279 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI")])
1280 (match_operand:SI 1 "reg_or_cint_move_operand" "0,J,N,K")
1284 {com%I4clr|cmp%I4clr},%S2 %4,%3,%%r0\;ldi 0,%0
1285 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldi %1,%0
1286 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldil L'%1,%0
1287 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;{zdepi|depwi,z} %Z1,%0"
1288 [(set_attr "type" "multi,multi,multi,nullshift")
1289 (set_attr "length" "8,8,8,8")])
1292 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1294 (match_operator 5 "ordered_comparison_operator"
1295 [(match_operand:SI 3 "register_operand" "r,r,r,r,r,r,r,r")
1296 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1297 (match_operand:SI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1298 (match_operand:SI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1301 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;copy %2,%0
1302 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldi %2,%0
1303 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldil L'%2,%0
1304 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;{zdepi|depwi,z} %Z2,%0
1305 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;copy %1,%0
1306 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldi %1,%0
1307 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldil L'%1,%0
1308 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;{zdepi|depwi,z} %Z1,%0"
1309 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1310 (set_attr "length" "8,8,8,8,8,8,8,8")])
1312 (define_expand "movdicc"
1313 [(set (match_operand:DI 0 "register_operand" "")
1315 (match_operand 1 "ordered_comparison_operator" "")
1316 (match_operand:DI 2 "reg_or_cint_move_operand" "")
1317 (match_operand:DI 3 "reg_or_cint_move_operand" "")))]
1321 if (GET_MODE (XEXP (operands[1], 0)) != DImode
1322 || GET_MODE (XEXP (operands[1], 0)) != GET_MODE (XEXP (operands[1], 1)))
1326 ; We need the first constraint alternative in order to avoid
1327 ; earlyclobbers on all other alternatives.
1329 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r")
1331 (match_operator 2 "ordered_comparison_operator"
1332 [(match_operand:DI 3 "register_operand" "r,r,r,r,r")
1333 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI")])
1334 (match_operand:DI 1 "reg_or_cint_move_operand" "0,r,J,N,K")
1338 cmp%I4clr,*%S2 %4,%3,%%r0\;ldi 0,%0
1339 cmp%I4clr,*%B2 %4,%3,%0\;copy %1,%0
1340 cmp%I4clr,*%B2 %4,%3,%0\;ldi %1,%0
1341 cmp%I4clr,*%B2 %4,%3,%0\;ldil L'%1,%0
1342 cmp%I4clr,*%B2 %4,%3,%0\;depdi,z %z1,%0"
1343 [(set_attr "type" "multi,multi,multi,multi,nullshift")
1344 (set_attr "length" "8,8,8,8,8")])
1347 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1349 (match_operator 5 "ordered_comparison_operator"
1350 [(match_operand:DI 3 "register_operand" "r,r,r,r,r,r,r,r")
1351 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1352 (match_operand:DI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1353 (match_operand:DI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1356 cmp%I4clr,*%S5 %4,%3,%%r0\;copy %2,%0
1357 cmp%I4clr,*%S5 %4,%3,%%r0\;ldi %2,%0
1358 cmp%I4clr,*%S5 %4,%3,%%r0\;ldil L'%2,%0
1359 cmp%I4clr,*%S5 %4,%3,%%r0\;depdi,z %z2,%0
1360 cmp%I4clr,*%B5 %4,%3,%%r0\;copy %1,%0
1361 cmp%I4clr,*%B5 %4,%3,%%r0\;ldi %1,%0
1362 cmp%I4clr,*%B5 %4,%3,%%r0\;ldil L'%1,%0
1363 cmp%I4clr,*%B5 %4,%3,%%r0\;depdi,z %z1,%0"
1364 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1365 (set_attr "length" "8,8,8,8,8,8,8,8")])
1367 ;; Conditional Branches
1369 (define_expand "cbranchdi4"
1371 (if_then_else (match_operator 0 "ordered_comparison_operator"
1372 [(match_operand:DI 1 "reg_or_0_operand" "")
1373 (match_operand:DI 2 "register_operand" "")])
1374 (label_ref (match_operand 3 "" ""))
1379 (define_expand "cbranchsi4"
1381 (if_then_else (match_operator 0 "ordered_comparison_operator"
1382 [(match_operand:SI 1 "reg_or_0_operand" "")
1383 (match_operand:SI 2 "arith5_operand" "")])
1384 (label_ref (match_operand 3 "" ""))
1389 (define_expand "cbranchsf4"
1391 (if_then_else (match_operator 0 "comparison_operator"
1392 [(match_operand:SF 1 "reg_or_0_operand" "")
1393 (match_operand:SF 2 "reg_or_0_operand" "")])
1394 (label_ref (match_operand 3 "" ""))
1396 "! TARGET_SOFT_FLOAT"
1399 pa_emit_bcond_fp (operands);
1404 (define_expand "cbranchdf4"
1406 (if_then_else (match_operator 0 "comparison_operator"
1407 [(match_operand:DF 1 "reg_or_0_operand" "")
1408 (match_operand:DF 2 "reg_or_0_operand" "")])
1409 (label_ref (match_operand 3 "" ""))
1411 "! TARGET_SOFT_FLOAT"
1414 pa_emit_bcond_fp (operands);
1418 ;; Match the branch patterns.
1421 ;; Note a long backward conditional branch with an annulled delay slot
1422 ;; has a length of 12.
1426 (match_operator 3 "ordered_comparison_operator"
1427 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1428 (match_operand:SI 2 "arith5_operand" "rL")])
1429 (label_ref (match_operand 0 "" ""))
1434 return pa_output_cbranch (operands, 0, insn);
1436 [(set_attr "type" "cbranch")
1437 (set (attr "length")
1438 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1439 (const_int MAX_12BIT_OFFSET))
1441 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1442 (const_int MAX_17BIT_OFFSET))
1444 (match_test "TARGET_PORTABLE_RUNTIME")
1446 (not (match_test "flag_pic"))
1450 ;; Match the negated branch.
1455 (match_operator 3 "ordered_comparison_operator"
1456 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1457 (match_operand:SI 2 "arith5_operand" "rL")])
1459 (label_ref (match_operand 0 "" ""))))]
1463 return pa_output_cbranch (operands, 1, insn);
1465 [(set_attr "type" "cbranch")
1466 (set (attr "length")
1467 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1468 (const_int MAX_12BIT_OFFSET))
1470 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1471 (const_int MAX_17BIT_OFFSET))
1473 (match_test "TARGET_PORTABLE_RUNTIME")
1475 (not (match_test "flag_pic"))
1482 (match_operator 3 "ordered_comparison_operator"
1483 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1484 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1485 (label_ref (match_operand 0 "" ""))
1490 return pa_output_cbranch (operands, 0, insn);
1492 [(set_attr "type" "cbranch")
1493 (set (attr "length")
1494 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1495 (const_int MAX_12BIT_OFFSET))
1497 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1498 (const_int MAX_17BIT_OFFSET))
1500 (match_test "TARGET_PORTABLE_RUNTIME")
1502 (not (match_test "flag_pic"))
1506 ;; Match the negated branch.
1511 (match_operator 3 "ordered_comparison_operator"
1512 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1513 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1515 (label_ref (match_operand 0 "" ""))))]
1519 return pa_output_cbranch (operands, 1, insn);
1521 [(set_attr "type" "cbranch")
1522 (set (attr "length")
1523 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1524 (const_int MAX_12BIT_OFFSET))
1526 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1527 (const_int MAX_17BIT_OFFSET))
1529 (match_test "TARGET_PORTABLE_RUNTIME")
1531 (not (match_test "flag_pic"))
1537 (match_operator 3 "cmpib_comparison_operator"
1538 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1539 (match_operand:DI 2 "arith5_operand" "rL")])
1540 (label_ref (match_operand 0 "" ""))
1545 return pa_output_cbranch (operands, 0, insn);
1547 [(set_attr "type" "cbranch")
1548 (set (attr "length")
1549 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1550 (const_int MAX_12BIT_OFFSET))
1552 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1553 (const_int MAX_17BIT_OFFSET))
1555 (match_test "TARGET_PORTABLE_RUNTIME")
1557 (not (match_test "flag_pic"))
1561 ;; Match the negated branch.
1566 (match_operator 3 "cmpib_comparison_operator"
1567 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1568 (match_operand:DI 2 "arith5_operand" "rL")])
1570 (label_ref (match_operand 0 "" ""))))]
1574 return pa_output_cbranch (operands, 1, insn);
1576 [(set_attr "type" "cbranch")
1577 (set (attr "length")
1578 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1579 (const_int MAX_12BIT_OFFSET))
1581 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1582 (const_int MAX_17BIT_OFFSET))
1584 (match_test "TARGET_PORTABLE_RUNTIME")
1586 (not (match_test "flag_pic"))
1590 ;; Branch on Bit patterns.
1594 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1596 (match_operand:SI 1 "uint5_operand" ""))
1598 (label_ref (match_operand 2 "" ""))
1603 return pa_output_bb (operands, 0, insn, 0);
1605 [(set_attr "type" "cbranch")
1606 (set (attr "length")
1607 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1608 (const_int MAX_12BIT_OFFSET))
1610 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1611 (const_int MAX_17BIT_OFFSET))
1613 (match_test "TARGET_PORTABLE_RUNTIME")
1615 (not (match_test "flag_pic"))
1622 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1624 (match_operand:DI 1 "uint32_operand" ""))
1626 (label_ref (match_operand 2 "" ""))
1631 return pa_output_bb (operands, 0, insn, 0);
1633 [(set_attr "type" "cbranch")
1634 (set (attr "length")
1635 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1636 (const_int MAX_12BIT_OFFSET))
1638 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1639 (const_int MAX_17BIT_OFFSET))
1641 (match_test "TARGET_PORTABLE_RUNTIME")
1643 (not (match_test "flag_pic"))
1650 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1652 (match_operand:SI 1 "uint5_operand" ""))
1655 (label_ref (match_operand 2 "" ""))))]
1659 return pa_output_bb (operands, 1, insn, 0);
1661 [(set_attr "type" "cbranch")
1662 (set (attr "length")
1663 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1664 (const_int MAX_12BIT_OFFSET))
1666 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1667 (const_int MAX_17BIT_OFFSET))
1669 (match_test "TARGET_PORTABLE_RUNTIME")
1671 (not (match_test "flag_pic"))
1678 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1680 (match_operand:DI 1 "uint32_operand" ""))
1683 (label_ref (match_operand 2 "" ""))))]
1687 return pa_output_bb (operands, 1, insn, 0);
1689 [(set_attr "type" "cbranch")
1690 (set (attr "length")
1691 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1692 (const_int MAX_12BIT_OFFSET))
1694 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1695 (const_int MAX_17BIT_OFFSET))
1697 (match_test "TARGET_PORTABLE_RUNTIME")
1699 (not (match_test "flag_pic"))
1706 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1708 (match_operand:SI 1 "uint5_operand" ""))
1710 (label_ref (match_operand 2 "" ""))
1715 return pa_output_bb (operands, 0, insn, 1);
1717 [(set_attr "type" "cbranch")
1718 (set (attr "length")
1719 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1720 (const_int MAX_12BIT_OFFSET))
1722 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1723 (const_int MAX_17BIT_OFFSET))
1725 (match_test "TARGET_PORTABLE_RUNTIME")
1727 (not (match_test "flag_pic"))
1734 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1736 (match_operand:DI 1 "uint32_operand" ""))
1738 (label_ref (match_operand 2 "" ""))
1743 return pa_output_bb (operands, 0, insn, 1);
1745 [(set_attr "type" "cbranch")
1746 (set (attr "length")
1747 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1748 (const_int MAX_12BIT_OFFSET))
1750 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1751 (const_int MAX_17BIT_OFFSET))
1753 (match_test "TARGET_PORTABLE_RUNTIME")
1755 (not (match_test "flag_pic"))
1762 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1764 (match_operand:SI 1 "uint5_operand" ""))
1767 (label_ref (match_operand 2 "" ""))))]
1771 return pa_output_bb (operands, 1, insn, 1);
1773 [(set_attr "type" "cbranch")
1774 (set (attr "length")
1775 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1776 (const_int MAX_12BIT_OFFSET))
1778 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1779 (const_int MAX_17BIT_OFFSET))
1781 (match_test "TARGET_PORTABLE_RUNTIME")
1783 (not (match_test "flag_pic"))
1790 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1792 (match_operand:DI 1 "uint32_operand" ""))
1795 (label_ref (match_operand 2 "" ""))))]
1799 return pa_output_bb (operands, 1, insn, 1);
1801 [(set_attr "type" "cbranch")
1802 (set (attr "length")
1803 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1804 (const_int MAX_12BIT_OFFSET))
1806 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1807 (const_int MAX_17BIT_OFFSET))
1809 (match_test "TARGET_PORTABLE_RUNTIME")
1811 (not (match_test "flag_pic"))
1815 ;; Branch on Variable Bit patterns.
1819 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1821 (match_operand:SI 1 "register_operand" "q"))
1823 (label_ref (match_operand 2 "" ""))
1828 return pa_output_bvb (operands, 0, insn, 0);
1830 [(set_attr "type" "cbranch")
1831 (set (attr "length")
1832 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1833 (const_int MAX_12BIT_OFFSET))
1835 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1836 (const_int MAX_17BIT_OFFSET))
1838 (match_test "TARGET_PORTABLE_RUNTIME")
1840 (not (match_test "flag_pic"))
1847 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1849 (match_operand:DI 1 "register_operand" "q"))
1851 (label_ref (match_operand 2 "" ""))
1856 return pa_output_bvb (operands, 0, insn, 0);
1858 [(set_attr "type" "cbranch")
1859 (set (attr "length")
1860 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1861 (const_int MAX_12BIT_OFFSET))
1863 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1864 (const_int MAX_17BIT_OFFSET))
1866 (match_test "TARGET_PORTABLE_RUNTIME")
1868 (not (match_test "flag_pic"))
1875 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1877 (match_operand:SI 1 "register_operand" "q"))
1880 (label_ref (match_operand 2 "" ""))))]
1884 return pa_output_bvb (operands, 1, insn, 0);
1886 [(set_attr "type" "cbranch")
1887 (set (attr "length")
1888 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1889 (const_int MAX_12BIT_OFFSET))
1891 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1892 (const_int MAX_17BIT_OFFSET))
1894 (match_test "TARGET_PORTABLE_RUNTIME")
1896 (not (match_test "flag_pic"))
1903 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1905 (match_operand:DI 1 "register_operand" "q"))
1908 (label_ref (match_operand 2 "" ""))))]
1912 return pa_output_bvb (operands, 1, insn, 0);
1914 [(set_attr "type" "cbranch")
1915 (set (attr "length")
1916 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1917 (const_int MAX_12BIT_OFFSET))
1919 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1920 (const_int MAX_17BIT_OFFSET))
1922 (match_test "TARGET_PORTABLE_RUNTIME")
1924 (not (match_test "flag_pic"))
1931 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1933 (match_operand:SI 1 "register_operand" "q"))
1935 (label_ref (match_operand 2 "" ""))
1940 return pa_output_bvb (operands, 0, insn, 1);
1942 [(set_attr "type" "cbranch")
1943 (set (attr "length")
1944 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1945 (const_int MAX_12BIT_OFFSET))
1947 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1948 (const_int MAX_17BIT_OFFSET))
1950 (match_test "TARGET_PORTABLE_RUNTIME")
1952 (not (match_test "flag_pic"))
1959 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1961 (match_operand:DI 1 "register_operand" "q"))
1963 (label_ref (match_operand 2 "" ""))
1968 return pa_output_bvb (operands, 0, insn, 1);
1970 [(set_attr "type" "cbranch")
1971 (set (attr "length")
1972 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1973 (const_int MAX_12BIT_OFFSET))
1975 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1976 (const_int MAX_17BIT_OFFSET))
1978 (match_test "TARGET_PORTABLE_RUNTIME")
1980 (not (match_test "flag_pic"))
1987 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1989 (match_operand:SI 1 "register_operand" "q"))
1992 (label_ref (match_operand 2 "" ""))))]
1996 return pa_output_bvb (operands, 1, insn, 1);
1998 [(set_attr "type" "cbranch")
1999 (set (attr "length")
2000 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2001 (const_int MAX_12BIT_OFFSET))
2003 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2004 (const_int MAX_17BIT_OFFSET))
2006 (match_test "TARGET_PORTABLE_RUNTIME")
2008 (not (match_test "flag_pic"))
2015 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2017 (match_operand:DI 1 "register_operand" "q"))
2020 (label_ref (match_operand 2 "" ""))))]
2024 return pa_output_bvb (operands, 1, insn, 1);
2026 [(set_attr "type" "cbranch")
2027 (set (attr "length")
2028 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2029 (const_int MAX_12BIT_OFFSET))
2031 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2032 (const_int MAX_17BIT_OFFSET))
2034 (match_test "TARGET_PORTABLE_RUNTIME")
2036 (not (match_test "flag_pic"))
2040 ;; Floating point branches
2042 ;; ??? Nullification is handled differently from other branches.
2043 ;; If nullification is specified, the delay slot is nullified on any
2044 ;; taken branch regardless of branch direction.
2046 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2047 (label_ref (match_operand 0 "" ""))
2049 "!TARGET_SOFT_FLOAT"
2052 int length = get_attr_length (insn);
2054 int nullify, xdelay;
2057 return \"ftest\;b%* %l0\";
2059 if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
2063 xoperands[0] = GEN_INT (length - 8);
2069 xoperands[0] = GEN_INT (length - 4);
2073 output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b,n .+%0\", xoperands);
2075 output_asm_insn (\"ftest\;add,tr %%r0,%%r0,%%r0\;b .+%0\", xoperands);
2076 return pa_output_lbranch (operands[0], insn, xdelay);
2078 [(set_attr "type" "fbranch")
2079 (set (attr "length")
2080 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
2081 (const_int MAX_17BIT_OFFSET))
2083 (match_test "TARGET_PORTABLE_RUNTIME")
2085 (not (match_test "flag_pic"))
2090 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2092 (label_ref (match_operand 0 "" ""))))]
2093 "!TARGET_SOFT_FLOAT"
2096 int length = get_attr_length (insn);
2098 int nullify, xdelay;
2101 return \"ftest\;add,tr %%r0,%%r0,%%r0\;b%* %0\";
2103 if (dbr_sequence_length () == 0 || INSN_ANNULLED_BRANCH_P (insn))
2107 xoperands[0] = GEN_INT (length - 4);
2113 xoperands[0] = GEN_INT (length);
2117 output_asm_insn (\"ftest\;b,n .+%0\", xoperands);
2119 output_asm_insn (\"ftest\;b .+%0\", xoperands);
2120 return pa_output_lbranch (operands[0], insn, xdelay);
2122 [(set_attr "type" "fbranch")
2123 (set (attr "length")
2124 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
2125 (const_int MAX_17BIT_OFFSET))
2127 (match_test "TARGET_PORTABLE_RUNTIME")
2129 (not (match_test "flag_pic"))
2133 ;; Move instructions
2135 (define_expand "movsi"
2136 [(set (match_operand:SI 0 "general_operand" "")
2137 (match_operand:SI 1 "general_operand" ""))]
2141 if (pa_emit_move_sequence (operands, SImode, 0))
2145 ;; Handle SImode input reloads requiring %r1 as a scratch register.
2146 (define_expand "reload_insi_r1"
2147 [(set (match_operand:SI 0 "register_operand" "=Z")
2148 (match_operand:SI 1 "non_hard_reg_operand" ""))
2149 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
2153 if (pa_emit_move_sequence (operands, SImode, operands[2]))
2156 /* We don't want the clobber emitted, so handle this ourselves. */
2157 emit_insn (gen_rtx_SET (operands[0], operands[1]));
2161 ;; Handle SImode input reloads requiring a general register as a
2162 ;; scratch register.
2163 (define_expand "reload_insi"
2164 [(set (match_operand:SI 0 "register_operand" "=Z")
2165 (match_operand:SI 1 "non_hard_reg_operand" ""))
2166 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2170 if (pa_emit_move_sequence (operands, SImode, operands[2]))
2173 /* We don't want the clobber emitted, so handle this ourselves. */
2174 emit_insn (gen_rtx_SET (operands[0], operands[1]));
2178 ;; Handle SImode output reloads requiring a general register as a
2179 ;; scratch register.
2180 (define_expand "reload_outsi"
2181 [(set (match_operand:SI 0 "non_hard_reg_operand" "")
2182 (match_operand:SI 1 "register_operand" "Z"))
2183 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2187 if (pa_emit_move_sequence (operands, SImode, operands[2]))
2190 /* We don't want the clobber emitted, so handle this ourselves. */
2191 emit_insn (gen_rtx_SET (operands[0], operands[1]));
2196 [(set (match_operand:SI 0 "move_dest_operand"
2197 "=r,r,r,r,r,r,Q,!*q,!r,!*f,*f,T,?r,?*f")
2198 (match_operand:SI 1 "move_src_operand"
2199 "A,r,J,N,K,RQ,rM,!rM,!*q,!*fM,RT,*f,*f,r"))]
2200 "(register_operand (operands[0], SImode)
2201 || reg_or_0_operand (operands[1], SImode))
2202 && !TARGET_SOFT_FLOAT
2209 {zdepi|depwi,z} %Z1,%0
2213 {mfctl|mfctl,w} %%sar,%0
2217 {fstws|fstw} %1,-16(%%sp)\n\t{ldws|ldw} -16(%%sp),%0
2218 {stws|stw} %1,-16(%%sp)\n\t{fldws|fldw} -16(%%sp),%0"
2219 [(set_attr "type" "load,move,move,move,shift,load,store,move,move,fpalu,fpload,fpstore,fpstore_load,store_fpload")
2220 (set_attr "pa_combine_type" "addmove")
2221 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,8,8")])
2224 [(set (match_operand:SI 0 "move_dest_operand"
2225 "=r,r,r,r,r,r,Q,!*q,!r,!*f,*f,T,?r,?*f")
2226 (match_operand:SI 1 "move_src_operand"
2227 "A,r,J,N,K,RQ,rM,!rM,!*q,!*fM,RT,*f,*f,r"))]
2228 "(register_operand (operands[0], SImode)
2229 || reg_or_0_operand (operands[1], SImode))
2230 && !TARGET_SOFT_FLOAT
2237 {zdepi|depwi,z} %Z1,%0
2241 {mfctl|mfctl,w} %%sar,%0
2245 fstw %1,-40(%%sp)\n\tldw -40(%%sp),%0
2246 stw %1,-40(%%sp)\n\tfldw -40(%%sp),%0"
2247 [(set_attr "type" "load,move,move,move,shift,load,store,move,move,fpalu,fpload,fpstore,fpstore_load,store_fpload")
2248 (set_attr "pa_combine_type" "addmove")
2249 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,8,8")])
2252 [(set (match_operand:SI 0 "move_dest_operand"
2253 "=r,r,r,r,r,r,Q,!*q,!r")
2254 (match_operand:SI 1 "move_src_operand"
2255 "A,r,J,N,K,RQ,rM,!rM,!*q"))]
2256 "(register_operand (operands[0], SImode)
2257 || reg_or_0_operand (operands[1], SImode))
2258 && TARGET_SOFT_FLOAT
2265 {zdepi|depwi,z} %Z1,%0
2269 {mfctl|mfctl,w} %%sar,%0"
2270 [(set_attr "type" "load,move,move,move,shift,load,store,move,move")
2271 (set_attr "pa_combine_type" "addmove")
2272 (set_attr "length" "4,4,4,4,4,4,4,4,4")])
2275 [(set (match_operand:SI 0 "indexed_memory_operand" "=R")
2276 (match_operand:SI 1 "register_operand" "f"))]
2278 && !TARGET_DISABLE_INDEXING
2279 && reload_completed"
2281 [(set_attr "type" "fpstore")
2282 (set_attr "pa_combine_type" "addmove")
2283 (set_attr "length" "4")])
2285 ; Rewrite RTL using a REG+D store. This will allow the insn that
2286 ; computes the address to be deleted if the register it sets is dead.
2288 [(set (match_operand:SI 0 "register_operand" "")
2289 (plus:SI (match_operand:SI 1 "register_operand" "")
2290 (match_operand:SI 2 "const_int_operand" "")))
2291 (set (mem:SI (match_dup 0))
2292 (match_operand:SI 3 "register_operand" ""))]
2295 && GENERAL_REGNO_P (REGNO (operands[0]))
2296 && GENERAL_REGNO_P (REGNO (operands[3]))
2297 && REGNO (operands[0]) != REGNO (operands[3])
2298 && base14_operand (operands[2], E_SImode)"
2299 [(set (mem:SI (plus:SI (match_dup 1) (match_dup 2))) (match_dup 3))
2300 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
2303 ; Rewrite RTL using a REG+D load. This will allow the insn that
2304 ; computes the address to be deleted if the register it sets is dead.
2306 [(set (match_operand:SI 0 "register_operand" "")
2307 (plus:SI (match_operand:SI 1 "register_operand" "")
2308 (match_operand:SI 2 "const_int_operand" "")))
2309 (set (match_operand:SI 3 "register_operand" "")
2310 (mem:SI (match_dup 0)))]
2313 && GENERAL_REGNO_P (REGNO (operands[0]))
2314 && GENERAL_REGNO_P (REGNO (operands[3]))
2315 && REGNO (operands[0]) != REGNO (operands[3])
2316 && REGNO (operands[1]) != REGNO (operands[3])
2317 && base14_operand (operands[2], E_SImode)"
2318 [(set (match_dup 3) (mem:SI (plus:SI (match_dup 1) (match_dup 2))))
2319 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
2323 [(set (match_operand:SI 0 "register_operand" "")
2324 (plus:SI (match_operand:SI 1 "register_operand" "")
2325 (match_operand:SI 2 "const_int_operand" "")))
2326 (set (match_operand:SI 3 "register_operand" "")
2327 (mem:SI (match_dup 0)))]
2330 && GENERAL_REGNO_P (REGNO (operands[0]))
2331 && GENERAL_REGNO_P (REGNO (operands[3]))
2332 && REGNO (operands[0]) == REGNO (operands[3])
2333 && base14_operand (operands[2], E_SImode)"
2334 [(set (match_dup 3) (mem:SI (plus:SI (match_dup 1) (match_dup 2))))]
2337 ; Rewrite RTL using an indexed store. This will allow the insn that
2338 ; computes the address to be deleted if the register it sets is dead.
2340 [(set (match_operand:SI 0 "register_operand" "")
2341 (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "")
2343 (match_operand:SI 2 "register_operand" "")))
2344 (set (mem:SI (match_dup 0))
2345 (match_operand:SI 3 "register_operand" ""))]
2347 && !TARGET_DISABLE_INDEXING
2348 && REG_OK_FOR_BASE_P (operands[2])
2349 && FP_REGNO_P (REGNO (operands[3]))"
2350 [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
2352 (set (match_dup 0) (plus:SI (ashift:SI (match_dup 1) (const_int 2))
2357 [(set (match_operand:DI 0 "register_operand" "")
2358 (plus:DI (ashift:DI (match_operand:DI 1 "register_operand" "")
2360 (match_operand:DI 2 "register_operand" "")))
2361 (set (mem:SI (match_dup 0))
2362 (match_operand:SI 3 "register_operand" ""))]
2364 && !TARGET_DISABLE_INDEXING
2366 && REG_OK_FOR_BASE_P (operands[2])
2367 && FP_REGNO_P (REGNO (operands[3]))"
2368 [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
2370 (set (match_dup 0) (plus:DI (ashift:DI (match_dup 1) (const_int 2))
2375 [(set (match_operand:SI 0 "register_operand" "")
2376 (plus:SI (match_operand:SI 1 "register_operand" "")
2377 (match_operand:SI 2 "register_operand" "")))
2378 (set (mem:SI (match_dup 0))
2379 (match_operand:SI 3 "register_operand" ""))]
2381 && !TARGET_DISABLE_INDEXING
2382 && TARGET_NO_SPACE_REGS
2383 && REG_OK_FOR_INDEX_P (operands[1])
2384 && REG_OK_FOR_BASE_P (operands[2])
2385 && FP_REGNO_P (REGNO (operands[3]))"
2386 [(set (mem:SI (plus:SI (match_dup 1) (match_dup 2)))
2388 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
2392 [(set (match_operand:SI 0 "register_operand" "")
2393 (plus:SI (match_operand:SI 1 "register_operand" "")
2394 (match_operand:SI 2 "register_operand" "")))
2395 (set (mem:SI (match_dup 0))
2396 (match_operand:SI 3 "register_operand" ""))]
2398 && !TARGET_DISABLE_INDEXING
2399 && TARGET_NO_SPACE_REGS
2400 && REG_OK_FOR_BASE_P (operands[1])
2401 && REG_OK_FOR_INDEX_P (operands[2])
2402 && FP_REGNO_P (REGNO (operands[3]))"
2403 [(set (mem:SI (plus:SI (match_dup 2) (match_dup 1)))
2405 (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
2409 [(set (match_operand:DI 0 "register_operand" "")
2410 (plus:DI (match_operand:DI 1 "register_operand" "")
2411 (match_operand:DI 2 "register_operand" "")))
2412 (set (mem:SI (match_dup 0))
2413 (match_operand:SI 3 "register_operand" ""))]
2415 && !TARGET_DISABLE_INDEXING
2417 && TARGET_NO_SPACE_REGS
2418 && REG_OK_FOR_INDEX_P (operands[1])
2419 && REG_OK_FOR_BASE_P (operands[2])
2420 && FP_REGNO_P (REGNO (operands[3]))"
2421 [(set (mem:SI (plus:DI (match_dup 1) (match_dup 2)))
2423 (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
2427 [(set (match_operand:DI 0 "register_operand" "")
2428 (plus:DI (match_operand:DI 1 "register_operand" "")
2429 (match_operand:DI 2 "register_operand" "")))
2430 (set (mem:SI (match_dup 0))
2431 (match_operand:SI 3 "register_operand" ""))]
2433 && !TARGET_DISABLE_INDEXING
2435 && TARGET_NO_SPACE_REGS
2436 && REG_OK_FOR_BASE_P (operands[1])
2437 && REG_OK_FOR_INDEX_P (operands[2])
2438 && FP_REGNO_P (REGNO (operands[3]))"
2439 [(set (mem:SI (plus:DI (match_dup 2) (match_dup 1)))
2441 (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
2445 [(set (match_operand:SI 0 "move_dest_operand"
2446 "=r,r,r,r,r,r,Q,!*q,!r")
2447 (match_operand:SI 1 "move_src_operand"
2448 "A,r,J,N,K,RQ,rM,!rM,!*q"))]
2449 "(register_operand (operands[0], SImode)
2450 || reg_or_0_operand (operands[1], SImode))
2451 && TARGET_SOFT_FLOAT"
2457 {zdepi|depwi,z} %Z1,%0
2461 {mfctl|mfctl,w} %%sar,%0"
2462 [(set_attr "type" "load,move,move,move,move,load,store,move,move")
2463 (set_attr "pa_combine_type" "addmove")
2464 (set_attr "length" "4,4,4,4,4,4,4,4,4")])
2466 ;; Load or store with base-register modification.
2468 [(set (match_operand:SI 0 "register_operand" "=r")
2469 (mem:SI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2470 (match_operand:DI 2 "int5_operand" "L"))))
2472 (plus:DI (match_dup 1) (match_dup 2)))]
2475 [(set_attr "type" "load")
2476 (set_attr "length" "4")])
2478 ; And a zero extended variant.
2480 [(set (match_operand:DI 0 "register_operand" "=r")
2481 (zero_extend:DI (mem:SI
2483 (match_operand:DI 1 "register_operand" "+r")
2484 (match_operand:DI 2 "int5_operand" "L")))))
2486 (plus:DI (match_dup 1) (match_dup 2)))]
2489 [(set_attr "type" "load")
2490 (set_attr "length" "4")])
2492 (define_expand "pre_load"
2493 [(parallel [(set (match_operand:SI 0 "register_operand" "")
2494 (mem (plus (match_operand 1 "register_operand" "")
2495 (match_operand 2 "pre_cint_operand" ""))))
2497 (plus (match_dup 1) (match_dup 2)))])]
2503 emit_insn (gen_pre_ldd (operands[0], operands[1], operands[2]));
2506 emit_insn (gen_pre_ldw (operands[0], operands[1], operands[2]));
2510 (define_insn "pre_ldw"
2511 [(set (match_operand:SI 0 "register_operand" "=r")
2512 (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2513 (match_operand:SI 2 "pre_cint_operand" ""))))
2515 (plus:SI (match_dup 1) (match_dup 2)))]
2519 if (INTVAL (operands[2]) < 0)
2520 return \"{ldwm|ldw,mb} %2(%1),%0\";
2521 return \"{ldws|ldw},mb %2(%1),%0\";
2523 [(set_attr "type" "load")
2524 (set_attr "length" "4")])
2526 (define_insn "pre_ldd"
2527 [(set (match_operand:DI 0 "register_operand" "=r")
2528 (mem:DI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2529 (match_operand:DI 2 "pre_cint_operand" ""))))
2531 (plus:DI (match_dup 1) (match_dup 2)))]
2534 [(set_attr "type" "load")
2535 (set_attr "length" "4")])
2538 [(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "+r")
2539 (match_operand:SI 1 "pre_cint_operand" "")))
2540 (match_operand:SI 2 "reg_or_0_operand" "rM"))
2542 (plus:SI (match_dup 0) (match_dup 1)))]
2546 if (INTVAL (operands[1]) < 0)
2547 return \"{stwm|stw,mb} %r2,%1(%0)\";
2548 return \"{stws|stw},mb %r2,%1(%0)\";
2550 [(set_attr "type" "store")
2551 (set_attr "length" "4")])
2554 [(set (match_operand:SI 0 "register_operand" "=r")
2555 (mem:SI (match_operand:SI 1 "register_operand" "+r")))
2557 (plus:SI (match_dup 1)
2558 (match_operand:SI 2 "post_cint_operand" "")))]
2562 if (INTVAL (operands[2]) > 0)
2563 return \"{ldwm|ldw,ma} %2(%1),%0\";
2564 return \"{ldws|ldw},ma %2(%1),%0\";
2566 [(set_attr "type" "load")
2567 (set_attr "length" "4")])
2569 (define_expand "post_store"
2570 [(parallel [(set (mem (match_operand 0 "register_operand" ""))
2571 (match_operand 1 "reg_or_0_operand" ""))
2574 (match_operand 2 "post_cint_operand" "")))])]
2580 emit_insn (gen_post_std (operands[0], operands[1], operands[2]));
2583 emit_insn (gen_post_stw (operands[0], operands[1], operands[2]));
2587 (define_insn "post_stw"
2588 [(set (mem:SI (match_operand:SI 0 "register_operand" "+r"))
2589 (match_operand:SI 1 "reg_or_0_operand" "rM"))
2591 (plus:SI (match_dup 0)
2592 (match_operand:SI 2 "post_cint_operand" "")))]
2596 if (INTVAL (operands[2]) > 0)
2597 return \"{stwm|stw,ma} %r1,%2(%0)\";
2598 return \"{stws|stw},ma %r1,%2(%0)\";
2600 [(set_attr "type" "store")
2601 (set_attr "length" "4")])
2603 (define_insn "post_std"
2604 [(set (mem:DI (match_operand:DI 0 "register_operand" "+r"))
2605 (match_operand:DI 1 "reg_or_0_operand" "rM"))
2607 (plus:DI (match_dup 0)
2608 (match_operand:DI 2 "post_cint_operand" "")))]
2611 [(set_attr "type" "store")
2612 (set_attr "length" "4")])
2614 ;; For loading the address of a label while generating PIC code.
2615 ;; Note since this pattern can be created at reload time (via movsi), all
2616 ;; the same rules for movsi apply here. (no new pseudos, no temporaries).
2618 [(set (match_operand 0 "pmode_register_operand" "=a")
2619 (match_operand 1 "pic_label_operand" ""))]
2625 xoperands[0] = operands[0];
2626 xoperands[1] = operands[1];
2628 if (GET_CODE (operands[1]) == LABEL_REF
2629 && !LABEL_REF_NONLOCAL_P (operands[1]))
2631 xoperands[2] = gen_label_rtx ();
2632 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
2633 CODE_LABEL_NUMBER (xoperands[2]));
2634 output_asm_insn (\"mfia %0\", xoperands);
2636 /* If we're trying to load the address of a label that happens to be
2637 close, then we can use a shorter sequence. */
2638 if (INSN_ADDRESSES_SET_P ()
2639 && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
2640 - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
2641 output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
2644 output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
2645 output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
2650 /* Load using linkage table. */
2653 output_asm_insn (\"addil LT%%%1,%%r27\", xoperands);
2654 output_asm_insn (\"ldd RT%%%1(%0),%0\", xoperands);
2658 output_asm_insn (\"addil LT%%%1,%%r19\", xoperands);
2659 output_asm_insn (\"ldw RT%%%1(%0),%0\", xoperands);
2664 [(set_attr "type" "multi")
2665 (set_attr "length" "12")]) ; 8 or 12
2668 [(set (match_operand 0 "pmode_register_operand" "=a")
2669 (match_operand 1 "pic_label_operand" ""))]
2675 xoperands[0] = operands[0];
2676 xoperands[1] = operands[1];
2678 if (GET_CODE (operands[1]) == LABEL_REF
2679 && !LABEL_REF_NONLOCAL_P (operands[1]))
2681 xoperands[2] = gen_label_rtx ();
2682 output_asm_insn (\"bl .+8,%0\", xoperands);
2683 output_asm_insn (\"depi 0,31,2,%0\", xoperands);
2684 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
2685 CODE_LABEL_NUMBER (xoperands[2]));
2687 /* If we're trying to load the address of a label that happens to be
2688 close, then we can use a shorter sequence. */
2689 if (INSN_ADDRESSES_SET_P ()
2690 && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
2691 - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
2692 output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
2695 output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
2696 output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
2701 /* Load using linkage table. */
2702 output_asm_insn (\"addil LT%%%1,%%r19\", xoperands);
2703 output_asm_insn (\"ldw RT%%%1(%0),%0\", xoperands);
2707 [(set_attr "type" "multi")
2708 (set_attr "length" "16")]) ; 12 or 16
2711 [(set (match_operand:SI 0 "register_operand" "=a")
2712 (plus:SI (match_operand:SI 1 "register_operand" "r")
2713 (high:SI (match_operand 2 "" ""))))]
2714 "symbolic_operand (operands[2], Pmode)
2715 && ! function_label_operand (operands[2], Pmode)
2718 [(set_attr "type" "binary")
2719 (set_attr "length" "4")])
2722 [(set (match_operand:DI 0 "register_operand" "=a")
2723 (plus:DI (match_operand:DI 1 "register_operand" "r")
2724 (high:DI (match_operand 2 "" ""))))]
2725 "symbolic_operand (operands[2], Pmode)
2726 && ! function_label_operand (operands[2], Pmode)
2730 [(set_attr "type" "binary")
2731 (set_attr "length" "4")])
2734 [(set (match_operand:SI 0 "register_operand" "=r")
2735 (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
2736 (unspec:SI [(match_operand 2 "" "")] UNSPEC_DLTIND14R)))]
2737 "symbolic_operand (operands[2], Pmode)
2738 && ! function_label_operand (operands[2], Pmode)
2741 [(set_attr "type" "binary")
2742 (set_attr "length" "4")])
2745 [(set (match_operand:DI 0 "register_operand" "=r")
2746 (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
2747 (unspec:DI [(match_operand 2 "" "")] UNSPEC_DLTIND14R)))]
2748 "symbolic_operand (operands[2], Pmode)
2749 && ! function_label_operand (operands[2], Pmode)
2753 [(set_attr "type" "binary")
2754 (set_attr "length" "4")])
2756 ;; Always use addil rather than ldil;add sequences. This allows the
2757 ;; HP linker to eliminate the dp relocation if the symbolic operand
2758 ;; lives in the TEXT space.
2760 [(set (match_operand:SI 0 "register_operand" "=a")
2761 (high:SI (match_operand 1 "" "")))]
2762 "symbolic_operand (operands[1], Pmode)
2763 && ! function_label_operand (operands[1], Pmode)
2764 && ! read_only_operand (operands[1], Pmode)
2768 if (TARGET_LONG_LOAD_STORE)
2769 return \"addil NLR'%H1,%%r27\;ldo N'%H1(%%r1),%%r1\";
2771 return \"addil LR'%H1,%%r27\";
2773 [(set_attr "type" "binary")
2774 (set (attr "length")
2775 (if_then_else (not (match_test "TARGET_LONG_LOAD_STORE"))
2780 ;; This is for use in the prologue/epilogue code. We need it
2781 ;; to add large constants to a stack pointer or frame pointer.
2782 ;; Because of the additional %r1 pressure, we probably do not
2783 ;; want to use this in general code, so make it available
2784 ;; only after reload.
2786 [(set (match_operand:SI 0 "register_operand" "=!a,*r")
2787 (plus:SI (match_operand:SI 1 "register_operand" "r,r")
2788 (high:SI (match_operand 2 "const_int_operand" ""))))]
2792 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2793 [(set_attr "type" "binary,binary")
2794 (set_attr "length" "4,8")])
2797 [(set (match_operand:DI 0 "register_operand" "=!a,*r")
2798 (plus:DI (match_operand:DI 1 "register_operand" "r,r")
2799 (high:DI (match_operand 2 "const_int_operand" ""))))]
2800 "reload_completed && TARGET_64BIT"
2803 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2804 [(set_attr "type" "binary,binary")
2805 (set_attr "length" "4,8")])
2808 [(set (match_operand:SI 0 "register_operand" "=r")
2809 (high:SI (match_operand 1 "" "")))]
2810 "(!flag_pic || !symbolic_operand (operands[1], Pmode))
2811 && !pa_is_function_label_plus_const (operands[1])"
2814 if (symbolic_operand (operands[1], Pmode))
2815 return \"ldil LR'%H1,%0\";
2817 return \"ldil L'%G1,%0\";
2819 [(set_attr "type" "move")
2820 (set_attr "length" "4")])
2823 [(set (match_operand:DI 0 "register_operand" "=r")
2824 (high:DI (match_operand 1 "const_int_operand" "")))]
2827 [(set_attr "type" "move")
2828 (set_attr "length" "4")])
2831 [(set (match_operand:DI 0 "register_operand" "=r")
2832 (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
2833 (match_operand:DI 2 "const_int_operand" "i")))]
2836 [(set_attr "type" "move")
2837 (set_attr "length" "4")])
2840 [(set (match_operand:SI 0 "register_operand" "=r")
2841 (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
2842 (match_operand:SI 2 "immediate_operand" "i")))]
2843 "!pa_is_function_label_plus_const (operands[2])"
2846 gcc_assert (!flag_pic || !symbolic_operand (operands[2], Pmode));
2848 if (symbolic_operand (operands[2], Pmode))
2849 return \"ldo RR'%G2(%1),%0\";
2851 return \"ldo R'%G2(%1),%0\";
2853 [(set_attr "type" "move")
2854 (set_attr "length" "4")])
2856 ;; Now that a symbolic_address plus a constant is broken up early
2857 ;; in the compilation phase (for better CSE) we need a special
2858 ;; combiner pattern to load the symbolic address plus the constant
2859 ;; in only 2 instructions. (For cases where the symbolic address
2860 ;; was not a common subexpression.)
2862 [(set (match_operand:SI 0 "register_operand" "")
2863 (match_operand:SI 1 "symbolic_operand" ""))
2864 (clobber (match_operand:SI 2 "register_operand" ""))]
2865 "! (flag_pic && pic_label_operand (operands[1], SImode))"
2866 [(set (match_dup 2) (high:SI (match_dup 1)))
2867 (set (match_dup 0) (lo_sum:SI (match_dup 2) (match_dup 1)))]
2870 ;; hppa_legitimize_address goes to a great deal of trouble to
2871 ;; create addresses which use indexing. In some cases, this
2872 ;; is a lose because there isn't any store instructions which
2873 ;; allow indexed addresses (with integer register source).
2875 ;; These define_splits try to turn a 3 insn store into
2876 ;; a 2 insn store with some creative RTL rewriting.
2878 [(set (mem:SI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2879 (match_operand:SI 1 "mem_shadd_operand" ""))
2880 (plus:SI (match_operand:SI 2 "register_operand" "")
2881 (match_operand:SI 3 "const_int_operand" ""))))
2882 (match_operand:SI 4 "register_operand" ""))
2883 (clobber (match_operand:SI 5 "register_operand" ""))]
2885 [(set (match_dup 5) (plus:SI (ashift:SI (match_dup 0) (match_dup 1))
2887 (set (mem:SI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2890 operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));
2895 [(set (mem:HI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2896 (match_operand:SI 1 "mem_shadd_operand" ""))
2897 (plus:SI (match_operand:SI 2 "register_operand" "")
2898 (match_operand:SI 3 "const_int_operand" ""))))
2899 (match_operand:HI 4 "register_operand" ""))
2900 (clobber (match_operand:SI 5 "register_operand" ""))]
2902 [(set (match_dup 5) (plus:SI (ashift:SI (match_dup 0) (match_dup 1))
2904 (set (mem:HI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2907 operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));
2912 [(set (mem:QI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2913 (match_operand:SI 1 "mem_shadd_operand" ""))
2914 (plus:SI (match_operand:SI 2 "register_operand" "")
2915 (match_operand:SI 3 "const_int_operand" ""))))
2916 (match_operand:QI 4 "register_operand" ""))
2917 (clobber (match_operand:SI 5 "register_operand" ""))]
2919 [(set (match_dup 5) (plus:SI (ashift:SI (match_dup 0) (match_dup 1))
2921 (set (mem:QI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2924 operands[1] = GEN_INT (exact_log2 (INTVAL (operands[1])));
2928 (define_expand "movhi"
2929 [(set (match_operand:HI 0 "general_operand" "")
2930 (match_operand:HI 1 "general_operand" ""))]
2934 if (pa_emit_move_sequence (operands, HImode, 0))
2938 ;; Handle HImode input reloads requiring a general register as a
2939 ;; scratch register.
2940 (define_expand "reload_inhi"
2941 [(set (match_operand:HI 0 "register_operand" "=Z")
2942 (match_operand:HI 1 "non_hard_reg_operand" ""))
2943 (clobber (match_operand:HI 2 "register_operand" "=&r"))]
2947 if (pa_emit_move_sequence (operands, HImode, operands[2]))
2950 /* We don't want the clobber emitted, so handle this ourselves. */
2951 emit_insn (gen_rtx_SET (operands[0], operands[1]));
2955 ;; Handle HImode output reloads requiring a general register as a
2956 ;; scratch register.
2957 (define_expand "reload_outhi"
2958 [(set (match_operand:HI 0 "non_hard_reg_operand" "")
2959 (match_operand:HI 1 "register_operand" "Z"))
2960 (clobber (match_operand:HI 2 "register_operand" "=&r"))]
2964 if (pa_emit_move_sequence (operands, HImode, operands[2]))
2967 /* We don't want the clobber emitted, so handle this ourselves. */
2968 emit_insn (gen_rtx_SET (operands[0], operands[1]));
2973 [(set (match_operand:HI 0 "move_dest_operand"
2974 "=r,r,r,r,r,Q,!*q,!r")
2975 (match_operand:HI 1 "move_src_operand"
2976 "r,J,N,K,RQ,rM,!rM,!*q"))]
2977 "(register_operand (operands[0], HImode)
2978 || reg_or_0_operand (operands[1], HImode))"
2983 {zdepi|depwi,z} %Z1,%0
2987 {mfctl|mfctl,w} %sar,%0"
2988 [(set_attr "type" "move,move,move,shift,load,store,move,move")
2989 (set_attr "pa_combine_type" "addmove")
2990 (set_attr "length" "4,4,4,4,4,4,4,4")])
2993 [(set (match_operand:HI 0 "register_operand" "=r")
2994 (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2995 (match_operand:SI 2 "int5_operand" "L"))))
2997 (plus:SI (match_dup 1) (match_dup 2)))]
2999 "{ldhs|ldh},mb %2(%1),%0"
3000 [(set_attr "type" "load")
3001 (set_attr "length" "4")])
3004 [(set (match_operand:HI 0 "register_operand" "=r")
3005 (mem:HI (plus:DI (match_operand:DI 1 "register_operand" "+r")
3006 (match_operand:DI 2 "int5_operand" "L"))))
3008 (plus:DI (match_dup 1) (match_dup 2)))]
3011 [(set_attr "type" "load")
3012 (set_attr "length" "4")])
3014 ; And a zero extended variant.
3016 [(set (match_operand:DI 0 "register_operand" "=r")
3017 (zero_extend:DI (mem:HI
3019 (match_operand:DI 1 "register_operand" "+r")
3020 (match_operand:DI 2 "int5_operand" "L")))))
3022 (plus:DI (match_dup 1) (match_dup 2)))]
3025 [(set_attr "type" "load")
3026 (set_attr "length" "4")])
3029 [(set (match_operand:SI 0 "register_operand" "=r")
3030 (zero_extend:SI (mem:HI
3032 (match_operand:SI 1 "register_operand" "+r")
3033 (match_operand:SI 2 "int5_operand" "L")))))
3035 (plus:SI (match_dup 1) (match_dup 2)))]
3037 "{ldhs|ldh},mb %2(%1),%0"
3038 [(set_attr "type" "load")
3039 (set_attr "length" "4")])
3042 [(set (match_operand:SI 0 "register_operand" "=r")
3043 (zero_extend:SI (mem:HI
3045 (match_operand:DI 1 "register_operand" "+r")
3046 (match_operand:DI 2 "int5_operand" "L")))))
3048 (plus:DI (match_dup 1) (match_dup 2)))]
3051 [(set_attr "type" "load")
3052 (set_attr "length" "4")])
3055 [(set (mem:HI (plus:SI (match_operand:SI 0 "register_operand" "+r")
3056 (match_operand:SI 1 "int5_operand" "L")))
3057 (match_operand:HI 2 "reg_or_0_operand" "rM"))
3059 (plus:SI (match_dup 0) (match_dup 1)))]
3061 "{sths|sth},mb %r2,%1(%0)"
3062 [(set_attr "type" "store")
3063 (set_attr "length" "4")])
3066 [(set (mem:HI (plus:DI (match_operand:DI 0 "register_operand" "+r")
3067 (match_operand:DI 1 "int5_operand" "L")))
3068 (match_operand:HI 2 "reg_or_0_operand" "rM"))
3070 (plus:DI (match_dup 0) (match_dup 1)))]
3073 [(set_attr "type" "store")
3074 (set_attr "length" "4")])
3076 (define_insn "addhi3"
3077 [(set (match_operand:HI 0 "register_operand" "=r,r")
3078 (plus:HI (match_operand:HI 1 "register_operand" "%r,r")
3079 (match_operand:HI 2 "arith14_operand" "r,J")))]
3082 {addl|add,l} %1,%2,%0
3084 [(set_attr "type" "binary,binary")
3085 (set_attr "pa_combine_type" "addmove")
3086 (set_attr "length" "4,4")])
3088 (define_expand "movqi"
3089 [(set (match_operand:QI 0 "general_operand" "")
3090 (match_operand:QI 1 "general_operand" ""))]
3094 if (pa_emit_move_sequence (operands, QImode, 0))
3098 ;; Handle QImode input reloads requiring a general register as a
3099 ;; scratch register.
3100 (define_expand "reload_inqi"
3101 [(set (match_operand:QI 0 "register_operand" "=Z")
3102 (match_operand:QI 1 "non_hard_reg_operand" ""))
3103 (clobber (match_operand:QI 2 "register_operand" "=&r"))]
3107 if (pa_emit_move_sequence (operands, QImode, operands[2]))
3110 /* We don't want the clobber emitted, so handle this ourselves. */
3111 emit_insn (gen_rtx_SET (operands[0], operands[1]));
3115 ;; Handle QImode output reloads requiring a general register as a
3116 ;; scratch register.
3117 (define_expand "reload_outqi"
3118 [(set (match_operand:QI 0 "non_hard_reg_operand" "")
3119 (match_operand:QI 1 "register_operand" "Z"))
3120 (clobber (match_operand:QI 2 "register_operand" "=&r"))]
3124 if (pa_emit_move_sequence (operands, QImode, operands[2]))
3127 /* We don't want the clobber emitted, so handle this ourselves. */
3128 emit_insn (gen_rtx_SET (operands[0], operands[1]));
3133 [(set (match_operand:QI 0 "move_dest_operand"
3134 "=r,r,r,r,r,Q,!*q,!r")
3135 (match_operand:QI 1 "move_src_operand"
3136 "r,J,N,K,RQ,rM,!rM,!*q"))]
3137 "(register_operand (operands[0], QImode)
3138 || reg_or_0_operand (operands[1], QImode))"
3143 {zdepi|depwi,z} %Z1,%0
3147 {mfctl|mfctl,w} %%sar,%0"
3148 [(set_attr "type" "move,move,move,shift,load,store,move,move")
3149 (set_attr "pa_combine_type" "addmove")
3150 (set_attr "length" "4,4,4,4,4,4,4,4")])
3153 [(set (match_operand:QI 0 "register_operand" "=r")
3154 (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r")
3155 (match_operand:SI 2 "int5_operand" "L"))))
3156 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3158 "{ldbs|ldb},mb %2(%1),%0"
3159 [(set_attr "type" "load")
3160 (set_attr "length" "4")])
3163 [(set (match_operand:QI 0 "register_operand" "=r")
3164 (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "+r")
3165 (match_operand:DI 2 "int5_operand" "L"))))
3166 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3169 [(set_attr "type" "load")
3170 (set_attr "length" "4")])
3172 ; Now the same thing with zero extensions.
3174 [(set (match_operand:DI 0 "register_operand" "=r")
3175 (zero_extend:DI (mem:QI (plus:DI
3176 (match_operand:DI 1 "register_operand" "+r")
3177 (match_operand:DI 2 "int5_operand" "L")))))
3178 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3181 [(set_attr "type" "load")
3182 (set_attr "length" "4")])
3185 [(set (match_operand:SI 0 "register_operand" "=r")
3186 (zero_extend:SI (mem:QI (plus:SI
3187 (match_operand:SI 1 "register_operand" "+r")
3188 (match_operand:SI 2 "int5_operand" "L")))))
3189 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3191 "{ldbs|ldb},mb %2(%1),%0"
3192 [(set_attr "type" "load")
3193 (set_attr "length" "4")])
3196 [(set (match_operand:SI 0 "register_operand" "=r")
3197 (zero_extend:SI (mem:QI (plus:DI
3198 (match_operand:DI 1 "register_operand" "+r")
3199 (match_operand:DI 2 "int5_operand" "L")))))
3200 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3203 [(set_attr "type" "load")
3204 (set_attr "length" "4")])
3207 [(set (match_operand:HI 0 "register_operand" "=r")
3208 (zero_extend:HI (mem:QI (plus:SI
3209 (match_operand:SI 1 "register_operand" "+r")
3210 (match_operand:SI 2 "int5_operand" "L")))))
3211 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
3213 "{ldbs|ldb},mb %2(%1),%0"
3214 [(set_attr "type" "load")
3215 (set_attr "length" "4")])
3218 [(set (match_operand:HI 0 "register_operand" "=r")
3219 (zero_extend:HI (mem:QI (plus:DI
3220 (match_operand:DI 1 "register_operand" "+r")
3221 (match_operand:DI 2 "int5_operand" "L")))))
3222 (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
3225 [(set_attr "type" "load")
3226 (set_attr "length" "4")])
3229 [(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "+r")
3230 (match_operand:SI 1 "int5_operand" "L")))
3231 (match_operand:QI 2 "reg_or_0_operand" "rM"))
3233 (plus:SI (match_dup 0) (match_dup 1)))]
3235 "{stbs|stb},mb %r2,%1(%0)"
3236 [(set_attr "type" "store")
3237 (set_attr "length" "4")])
3240 [(set (mem:QI (plus:DI (match_operand:DI 0 "register_operand" "+r")
3241 (match_operand:DI 1 "int5_operand" "L")))
3242 (match_operand:QI 2 "reg_or_0_operand" "rM"))
3244 (plus:DI (match_dup 0) (match_dup 1)))]
3247 [(set_attr "type" "store")
3248 (set_attr "length" "4")])
3250 ;; The definition of this insn does not really explain what it does,
3251 ;; but it should suffice that anything generated as this insn will be
3252 ;; recognized as a cpymemsi operation, and that it will not successfully
3253 ;; combine with anything.
3254 (define_expand "cpymemsi"
3255 [(parallel [(set (match_operand:BLK 0 "" "")
3256 (match_operand:BLK 1 "" ""))
3257 (clobber (match_dup 4))
3258 (clobber (match_dup 5))
3259 (clobber (match_dup 6))
3260 (clobber (match_dup 7))
3261 (clobber (match_dup 8))
3262 (use (match_operand:SI 2 "arith14_operand" ""))
3263 (use (match_operand:SI 3 "const_int_operand" ""))])]
3264 "!TARGET_64BIT && optimize > 0"
3269 /* HP provides very fast block move library routine for the PA;
3270 this routine includes:
3272 4x4 byte at a time block moves,
3273 1x4 byte at a time with alignment checked at runtime with
3274 attempts to align the source and destination as needed
3277 With that in mind, here's the heuristics to try and guess when
3278 the inlined block move will be better than the library block
3281 If the size isn't constant, then always use the library routines.
3283 If the size is large in respect to the known alignment, then use
3284 the library routines.
3286 If the size is small in respect to the known alignment, then open
3287 code the copy (since that will lead to better scheduling).
3289 Else use the block move pattern. */
3291 /* Undetermined size, use the library routine. */
3292 if (GET_CODE (operands[2]) != CONST_INT)
3295 size = INTVAL (operands[2]);
3296 align = INTVAL (operands[3]);
3297 align = align > 4 ? 4 : (align ? align : 1);
3299 /* If size/alignment is large, then use the library routines. */
3300 if (size / align > 16)
3303 /* This does happen, but not often enough to worry much about. */
3304 if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ()))
3307 /* Fall through means we're going to use our block move pattern. */
3309 = replace_equiv_address (operands[0],
3310 copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
3312 = replace_equiv_address (operands[1],
3313 copy_to_mode_reg (SImode, XEXP (operands[1], 0)));
3314 operands[4] = gen_reg_rtx (SImode);
3315 operands[5] = gen_reg_rtx (SImode);
3316 operands[6] = gen_reg_rtx (SImode);
3317 operands[7] = gen_reg_rtx (SImode);
3318 operands[8] = gen_reg_rtx (SImode);
3321 ;; The operand constraints are written like this to support both compile-time
3322 ;; and run-time determined byte counts. The expander and pa_output_block_move
3323 ;; only support compile-time determined counts at this time.
3325 ;; If the count is run-time determined, the register with the byte count
3326 ;; is clobbered by the copying code, and therefore it is forced to operand 2.
3328 ;; We used to clobber operands 0 and 1. However, a change to regrename.cc
3329 ;; broke this semantic for pseudo registers. We can't use match_scratch
3330 ;; as this requires two registers in the class R1_REGS when the MEMs for
3331 ;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are
3332 ;; forced to internally copy operands 0 and 1 to operands 7 and 8,
3333 ;; respectively. We then split or peephole optimize after reload.
3334 (define_insn "cpymemsi_prereload"
3335 [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
3336 (mem:BLK (match_operand:SI 1 "register_operand" "r,r")))
3337 (clobber (match_operand:SI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3338 (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
3339 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
3340 (clobber (match_operand:SI 7 "register_operand" "=&r,&r")) ;item tmp3
3341 (clobber (match_operand:SI 8 "register_operand" "=&r,&r")) ;item tmp4
3342 (use (match_operand:SI 4 "arith14_operand" "J,2")) ;byte count
3343 (use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment
3346 [(set_attr "type" "multi,multi")])
3349 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3350 (match_operand:BLK 1 "memory_operand" ""))
3351 (clobber (match_operand:SI 2 "register_operand" ""))
3352 (clobber (match_operand:SI 3 "register_operand" ""))
3353 (clobber (match_operand:SI 6 "register_operand" ""))
3354 (clobber (match_operand:SI 7 "register_operand" ""))
3355 (clobber (match_operand:SI 8 "register_operand" ""))
3356 (use (match_operand:SI 4 "arith14_operand" ""))
3357 (use (match_operand:SI 5 "const_int_operand" ""))])]
3358 "!TARGET_64BIT && reload_completed && !flag_peephole2
3359 && GET_CODE (operands[0]) == MEM
3360 && register_operand (XEXP (operands[0], 0), SImode)
3361 && GET_CODE (operands[1]) == MEM
3362 && register_operand (XEXP (operands[1], 0), SImode)"
3363 [(set (match_dup 7) (match_dup 9))
3364 (set (match_dup 8) (match_dup 10))
3365 (parallel [(set (match_dup 0) (match_dup 1))
3366 (clobber (match_dup 2))
3367 (clobber (match_dup 3))
3368 (clobber (match_dup 6))
3369 (clobber (match_dup 7))
3370 (clobber (match_dup 8))
3376 operands[9] = XEXP (operands[0], 0);
3377 operands[10] = XEXP (operands[1], 0);
3378 operands[0] = replace_equiv_address (operands[0], operands[7]);
3379 operands[1] = replace_equiv_address (operands[1], operands[8]);
3383 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3384 (match_operand:BLK 1 "memory_operand" ""))
3385 (clobber (match_operand:SI 2 "register_operand" ""))
3386 (clobber (match_operand:SI 3 "register_operand" ""))
3387 (clobber (match_operand:SI 6 "register_operand" ""))
3388 (clobber (match_operand:SI 7 "register_operand" ""))
3389 (clobber (match_operand:SI 8 "register_operand" ""))
3390 (use (match_operand:SI 4 "arith14_operand" ""))
3391 (use (match_operand:SI 5 "const_int_operand" ""))])]
3393 && GET_CODE (operands[0]) == MEM
3394 && register_operand (XEXP (operands[0], 0), SImode)
3395 && GET_CODE (operands[1]) == MEM
3396 && register_operand (XEXP (operands[1], 0), SImode)"
3397 [(parallel [(set (match_dup 0) (match_dup 1))
3398 (clobber (match_dup 2))
3399 (clobber (match_dup 3))
3400 (clobber (match_dup 6))
3401 (clobber (match_dup 7))
3402 (clobber (match_dup 8))
3408 rtx addr = XEXP (operands[0], 0);
3409 if (dead_or_set_p (curr_insn, addr))
3413 emit_insn (gen_rtx_SET (operands[7], addr));
3414 operands[0] = replace_equiv_address (operands[0], operands[7]);
3417 addr = XEXP (operands[1], 0);
3418 if (dead_or_set_p (curr_insn, addr))
3422 emit_insn (gen_rtx_SET (operands[8], addr));
3423 operands[1] = replace_equiv_address (operands[1], operands[8]);
3427 (define_insn "cpymemsi_postreload"
3428 [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r,r"))
3429 (mem:BLK (match_operand:SI 1 "register_operand" "+r,r")))
3430 (clobber (match_operand:SI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3431 (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
3432 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
3433 (clobber (match_dup 0))
3434 (clobber (match_dup 1))
3435 (use (match_operand:SI 4 "arith14_operand" "J,2")) ;byte count
3436 (use (match_operand:SI 5 "const_int_operand" "n,n")) ;alignment
3438 "!TARGET_64BIT && reload_completed"
3439 "* return pa_output_block_move (operands, !which_alternative);"
3440 [(set_attr "type" "multi,multi")])
3442 (define_expand "cpymemdi"
3443 [(parallel [(set (match_operand:BLK 0 "" "")
3444 (match_operand:BLK 1 "" ""))
3445 (clobber (match_dup 4))
3446 (clobber (match_dup 5))
3447 (clobber (match_dup 6))
3448 (clobber (match_dup 7))
3449 (clobber (match_dup 8))
3450 (use (match_operand:DI 2 "arith14_operand" ""))
3451 (use (match_operand:DI 3 "const_int_operand" ""))])]
3452 "TARGET_64BIT && optimize > 0"
3457 /* HP provides very fast block move library routine for the PA;
3458 this routine includes:
3460 4x4 byte at a time block moves,
3461 1x4 byte at a time with alignment checked at runtime with
3462 attempts to align the source and destination as needed
3465 With that in mind, here's the heuristics to try and guess when
3466 the inlined block move will be better than the library block
3469 If the size isn't constant, then always use the library routines.
3471 If the size is large in respect to the known alignment, then use
3472 the library routines.
3474 If the size is small in respect to the known alignment, then open
3475 code the copy (since that will lead to better scheduling).
3477 Else use the block move pattern. */
3479 /* Undetermined size, use the library routine. */
3480 if (GET_CODE (operands[2]) != CONST_INT)
3483 size = INTVAL (operands[2]);
3484 align = INTVAL (operands[3]);
3485 align = align > 8 ? 8 : (align ? align : 1);
3487 /* If size/alignment is large, then use the library routines. */
3488 if (size / align > 16)
3491 /* This does happen, but not often enough to worry much about. */
3492 if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ()))
3495 /* Fall through means we're going to use our block move pattern. */
3497 = replace_equiv_address (operands[0],
3498 copy_to_mode_reg (DImode, XEXP (operands[0], 0)));
3500 = replace_equiv_address (operands[1],
3501 copy_to_mode_reg (DImode, XEXP (operands[1], 0)));
3502 operands[4] = gen_reg_rtx (DImode);
3503 operands[5] = gen_reg_rtx (DImode);
3504 operands[6] = gen_reg_rtx (DImode);
3505 operands[7] = gen_reg_rtx (DImode);
3506 operands[8] = gen_reg_rtx (DImode);
3509 ;; The operand constraints are written like this to support both compile-time
3510 ;; and run-time determined byte counts. The expander and pa_output_block_move
3511 ;; only support compile-time determined counts at this time.
3513 ;; If the count is run-time determined, the register with the byte count
3514 ;; is clobbered by the copying code, and therefore it is forced to operand 2.
3516 ;; We used to clobber operands 0 and 1. However, a change to regrename.cc
3517 ;; broke this semantic for pseudo registers. We can't use match_scratch
3518 ;; as this requires two registers in the class R1_REGS when the MEMs for
3519 ;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are
3520 ;; forced to internally copy operands 0 and 1 to operands 7 and 8,
3521 ;; respectively. We then split or peephole optimize after reload.
3522 (define_insn "cpymemdi_prereload"
3523 [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
3524 (mem:BLK (match_operand:DI 1 "register_operand" "r,r")))
3525 (clobber (match_operand:DI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3526 (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1
3527 (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2
3528 (clobber (match_operand:DI 7 "register_operand" "=&r,&r")) ;item tmp3
3529 (clobber (match_operand:DI 8 "register_operand" "=&r,&r")) ;item tmp4
3530 (use (match_operand:DI 4 "arith14_operand" "J,2")) ;byte count
3531 (use (match_operand:DI 5 "const_int_operand" "n,n"))] ;alignment
3534 [(set_attr "type" "multi,multi")])
3537 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3538 (match_operand:BLK 1 "memory_operand" ""))
3539 (clobber (match_operand:DI 2 "register_operand" ""))
3540 (clobber (match_operand:DI 3 "register_operand" ""))
3541 (clobber (match_operand:DI 6 "register_operand" ""))
3542 (clobber (match_operand:DI 7 "register_operand" ""))
3543 (clobber (match_operand:DI 8 "register_operand" ""))
3544 (use (match_operand:DI 4 "arith14_operand" ""))
3545 (use (match_operand:DI 5 "const_int_operand" ""))])]
3546 "TARGET_64BIT && reload_completed && !flag_peephole2
3547 && GET_CODE (operands[0]) == MEM
3548 && register_operand (XEXP (operands[0], 0), DImode)
3549 && GET_CODE (operands[1]) == MEM
3550 && register_operand (XEXP (operands[1], 0), DImode)"
3551 [(set (match_dup 7) (match_dup 9))
3552 (set (match_dup 8) (match_dup 10))
3553 (parallel [(set (match_dup 0) (match_dup 1))
3554 (clobber (match_dup 2))
3555 (clobber (match_dup 3))
3556 (clobber (match_dup 6))
3557 (clobber (match_dup 7))
3558 (clobber (match_dup 8))
3564 operands[9] = XEXP (operands[0], 0);
3565 operands[10] = XEXP (operands[1], 0);
3566 operands[0] = replace_equiv_address (operands[0], operands[7]);
3567 operands[1] = replace_equiv_address (operands[1], operands[8]);
3571 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3572 (match_operand:BLK 1 "memory_operand" ""))
3573 (clobber (match_operand:DI 2 "register_operand" ""))
3574 (clobber (match_operand:DI 3 "register_operand" ""))
3575 (clobber (match_operand:DI 6 "register_operand" ""))
3576 (clobber (match_operand:DI 7 "register_operand" ""))
3577 (clobber (match_operand:DI 8 "register_operand" ""))
3578 (use (match_operand:DI 4 "arith14_operand" ""))
3579 (use (match_operand:DI 5 "const_int_operand" ""))])]
3581 && GET_CODE (operands[0]) == MEM
3582 && register_operand (XEXP (operands[0], 0), DImode)
3583 && GET_CODE (operands[1]) == MEM
3584 && register_operand (XEXP (operands[1], 0), DImode)"
3585 [(parallel [(set (match_dup 0) (match_dup 1))
3586 (clobber (match_dup 2))
3587 (clobber (match_dup 3))
3588 (clobber (match_dup 6))
3589 (clobber (match_dup 7))
3590 (clobber (match_dup 8))
3596 rtx addr = XEXP (operands[0], 0);
3597 if (dead_or_set_p (curr_insn, addr))
3601 emit_insn (gen_rtx_SET (operands[7], addr));
3602 operands[0] = replace_equiv_address (operands[0], operands[7]);
3605 addr = XEXP (operands[1], 0);
3606 if (dead_or_set_p (curr_insn, addr))
3610 emit_insn (gen_rtx_SET (operands[8], addr));
3611 operands[1] = replace_equiv_address (operands[1], operands[8]);
3615 (define_insn "cpymemdi_postreload"
3616 [(set (mem:BLK (match_operand:DI 0 "register_operand" "+r,r"))
3617 (mem:BLK (match_operand:DI 1 "register_operand" "+r,r")))
3618 (clobber (match_operand:DI 2 "register_operand" "=&r,&r")) ;loop cnt/tmp
3619 (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1
3620 (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2
3621 (clobber (match_dup 0))
3622 (clobber (match_dup 1))
3623 (use (match_operand:DI 4 "arith14_operand" "J,2")) ;byte count
3624 (use (match_operand:DI 5 "const_int_operand" "n,n")) ;alignment
3626 "TARGET_64BIT && reload_completed"
3627 "* return pa_output_block_move (operands, !which_alternative);"
3628 [(set_attr "type" "multi,multi")])
3630 (define_expand "setmemsi"
3631 [(parallel [(set (match_operand:BLK 0 "" "")
3632 (match_operand 2 "const_int_operand" ""))
3633 (clobber (match_dup 4))
3634 (clobber (match_dup 5))
3635 (use (match_operand:SI 1 "arith14_operand" ""))
3636 (use (match_operand:SI 3 "const_int_operand" ""))])]
3637 "!TARGET_64BIT && optimize > 0"
3642 /* If value to set is not zero, use the library routine. */
3643 if (operands[2] != const0_rtx)
3646 /* Undetermined size, use the library routine. */
3647 if (GET_CODE (operands[1]) != CONST_INT)
3650 size = INTVAL (operands[1]);
3651 align = INTVAL (operands[3]);
3652 align = align > 4 ? 4 : align;
3654 /* If size/alignment is large, then use the library routines. */
3655 if (size / align > 16)
3658 /* This does happen, but not often enough to worry much about. */
3659 if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ()))
3662 /* Fall through means we're going to use our block clear pattern. */
3664 = replace_equiv_address (operands[0],
3665 copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
3666 operands[4] = gen_reg_rtx (SImode);
3667 operands[5] = gen_reg_rtx (SImode);
3670 (define_insn "clrmemsi_prereload"
3671 [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
3673 (clobber (match_operand:SI 1 "register_operand" "=&r,&r")) ;loop cnt/tmp
3674 (clobber (match_operand:SI 4 "register_operand" "=&r,&r")) ;tmp1
3675 (use (match_operand:SI 2 "arith14_operand" "J,1")) ;byte count
3676 (use (match_operand:SI 3 "const_int_operand" "n,n"))] ;alignment
3679 [(set_attr "type" "multi,multi")])
3682 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3684 (clobber (match_operand:SI 1 "register_operand" ""))
3685 (clobber (match_operand:SI 4 "register_operand" ""))
3686 (use (match_operand:SI 2 "arith14_operand" ""))
3687 (use (match_operand:SI 3 "const_int_operand" ""))])]
3688 "!TARGET_64BIT && reload_completed && !flag_peephole2
3689 && GET_CODE (operands[0]) == MEM
3690 && register_operand (XEXP (operands[0], 0), SImode)"
3691 [(set (match_dup 4) (match_dup 5))
3692 (parallel [(set (match_dup 0) (const_int 0))
3693 (clobber (match_dup 1))
3694 (clobber (match_dup 4))
3700 operands[5] = XEXP (operands[0], 0);
3701 operands[0] = replace_equiv_address (operands[0], operands[4]);
3705 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3707 (clobber (match_operand:SI 1 "register_operand" ""))
3708 (clobber (match_operand:SI 4 "register_operand" ""))
3709 (use (match_operand:SI 2 "arith14_operand" ""))
3710 (use (match_operand:SI 3 "const_int_operand" ""))])]
3712 && GET_CODE (operands[0]) == MEM
3713 && register_operand (XEXP (operands[0], 0), SImode)"
3714 [(parallel [(set (match_dup 0) (const_int 0))
3715 (clobber (match_dup 1))
3716 (clobber (match_dup 4))
3722 rtx addr = XEXP (operands[0], 0);
3723 if (dead_or_set_p (curr_insn, addr))
3727 emit_insn (gen_rtx_SET (operands[4], addr));
3728 operands[0] = replace_equiv_address (operands[0], operands[4]);
3732 (define_insn "clrmemsi_postreload"
3733 [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r,r"))
3735 (clobber (match_operand:SI 1 "register_operand" "=&r,&r")) ;loop cnt/tmp
3736 (clobber (match_dup 0))
3737 (use (match_operand:SI 2 "arith14_operand" "J,1")) ;byte count
3738 (use (match_operand:SI 3 "const_int_operand" "n,n")) ;alignment
3740 "!TARGET_64BIT && reload_completed"
3741 "* return pa_output_block_clear (operands, !which_alternative);"
3742 [(set_attr "type" "multi,multi")])
3744 (define_expand "setmemdi"
3745 [(parallel [(set (match_operand:BLK 0 "" "")
3746 (match_operand 2 "const_int_operand" ""))
3747 (clobber (match_dup 4))
3748 (clobber (match_dup 5))
3749 (use (match_operand:DI 1 "arith14_operand" ""))
3750 (use (match_operand:DI 3 "const_int_operand" ""))])]
3751 "TARGET_64BIT && optimize > 0"
3756 /* If value to set is not zero, use the library routine. */
3757 if (operands[2] != const0_rtx)
3760 /* Undetermined size, use the library routine. */
3761 if (GET_CODE (operands[1]) != CONST_INT)
3764 size = INTVAL (operands[1]);
3765 align = INTVAL (operands[3]);
3766 align = align > 8 ? 8 : align;
3768 /* If size/alignment is large, then use the library routines. */
3769 if (size / align > 16)
3772 /* This does happen, but not often enough to worry much about. */
3773 if (size / align < MOVE_RATIO (optimize_insn_for_speed_p ()))
3776 /* Fall through means we're going to use our block clear pattern. */
3778 = replace_equiv_address (operands[0],
3779 copy_to_mode_reg (DImode, XEXP (operands[0], 0)));
3780 operands[4] = gen_reg_rtx (DImode);
3781 operands[5] = gen_reg_rtx (DImode);
3784 (define_insn "clrmemdi_prereload"
3785 [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
3787 (clobber (match_operand:DI 1 "register_operand" "=&r,&r")) ;loop cnt/tmp
3788 (clobber (match_operand:DI 4 "register_operand" "=&r,&r")) ;item tmp1
3789 (use (match_operand:DI 2 "arith14_operand" "J,1")) ;byte count
3790 (use (match_operand:DI 3 "const_int_operand" "n,n"))] ;alignment
3793 [(set_attr "type" "multi,multi")])
3796 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3798 (clobber (match_operand:DI 1 "register_operand" ""))
3799 (clobber (match_operand:DI 4 "register_operand" ""))
3800 (use (match_operand:DI 2 "arith14_operand" ""))
3801 (use (match_operand:DI 3 "const_int_operand" ""))])]
3802 "TARGET_64BIT && reload_completed && !flag_peephole2
3803 && GET_CODE (operands[0]) == MEM
3804 && register_operand (XEXP (operands[0], 0), DImode)"
3805 [(set (match_dup 4) (match_dup 5))
3806 (parallel [(set (match_dup 0) (const_int 0))
3807 (clobber (match_dup 1))
3808 (clobber (match_dup 4))
3814 operands[5] = XEXP (operands[0], 0);
3815 operands[0] = replace_equiv_address (operands[0], operands[4]);
3819 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
3821 (clobber (match_operand:DI 1 "register_operand" ""))
3822 (clobber (match_operand:DI 4 "register_operand" ""))
3823 (use (match_operand:DI 2 "arith14_operand" ""))
3824 (use (match_operand:DI 3 "const_int_operand" ""))])]
3826 && GET_CODE (operands[0]) == MEM
3827 && register_operand (XEXP (operands[0], 0), DImode)"
3828 [(parallel [(set (match_dup 0) (const_int 0))
3829 (clobber (match_dup 1))
3830 (clobber (match_dup 4))
3836 rtx addr = XEXP (operands[0], 0);
3837 if (dead_or_set_p (curr_insn, addr))
3841 emit_insn (gen_rtx_SET (operands[4], addr));
3842 operands[0] = replace_equiv_address (operands[0], operands[4]);
3846 (define_insn "clrmemdi_postreload"
3847 [(set (mem:BLK (match_operand:DI 0 "register_operand" "+r,r"))
3849 (clobber (match_operand:DI 1 "register_operand" "=&r,&r")) ;loop cnt/tmp
3850 (clobber (match_dup 0))
3851 (use (match_operand:DI 2 "arith14_operand" "J,1")) ;byte count
3852 (use (match_operand:DI 3 "const_int_operand" "n,n")) ;alignment
3854 "TARGET_64BIT && reload_completed"
3855 "* return pa_output_block_clear (operands, !which_alternative);"
3856 [(set_attr "type" "multi,multi")])
3858 ;; Floating point move insns
3860 (define_expand "movdf"
3861 [(set (match_operand:DF 0 "general_operand" "")
3862 (match_operand:DF 1 "general_operand" ""))]
3866 if (pa_emit_move_sequence (operands, DFmode, 0))
3870 ;; Handle DFmode input reloads requiring %r1 as a scratch register.
3871 (define_expand "reload_indf_r1"
3872 [(set (match_operand:DF 0 "register_operand" "=Z")
3873 (match_operand:DF 1 "non_hard_reg_operand" ""))
3874 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
3878 if (pa_emit_move_sequence (operands, DFmode, operands[2]))
3881 /* We don't want the clobber emitted, so handle this ourselves. */
3882 emit_insn (gen_rtx_SET (operands[0], operands[1]));
3886 ;; Handle DFmode input reloads requiring a general register as a
3887 ;; scratch register.
3888 (define_expand "reload_indf"
3889 [(set (match_operand:DF 0 "register_operand" "=Z")
3890 (match_operand:DF 1 "non_hard_reg_operand" ""))
3891 (clobber (match_operand:DF 2 "register_operand" "=&r"))]
3895 if (pa_emit_move_sequence (operands, DFmode, operands[2]))
3898 /* We don't want the clobber emitted, so handle this ourselves. */
3899 emit_insn (gen_rtx_SET (operands[0], operands[1]));
3903 ;; Handle DFmode output reloads requiring a general register as a
3904 ;; scratch register.
3905 (define_expand "reload_outdf"
3906 [(set (match_operand:DF 0 "non_hard_reg_operand" "")
3907 (match_operand:DF 1 "register_operand" "Z"))
3908 (clobber (match_operand:DF 2 "register_operand" "=&r"))]
3912 if (pa_emit_move_sequence (operands, DFmode, operands[2]))
3915 /* We don't want the clobber emitted, so handle this ourselves. */
3916 emit_insn (gen_rtx_SET (operands[0], operands[1]));
3921 [(set (match_operand:DF 0 "move_dest_operand"
3922 "=f,*r,T,?o,?Q,f,*r,*r,?*r,?f")
3923 (match_operand:DF 1 "reg_or_0_or_mem_operand"
3924 "fG,*rG,f,*r,*r,RT,o,RQ,f,*r"))]
3925 "(register_operand (operands[0], DFmode)
3926 || reg_or_0_operand (operands[1], DFmode))
3927 && !(GET_CODE (operands[1]) == CONST_DOUBLE
3928 && GET_CODE (operands[0]) == MEM)
3930 && !TARGET_SOFT_FLOAT"
3933 if ((FP_REG_P (operands[0]) || FP_REG_P (operands[1])
3934 || operands[1] == CONST0_RTX (DFmode))
3935 && !(REG_P (operands[0]) && REG_P (operands[1])
3936 && FP_REG_P (operands[0]) ^ FP_REG_P (operands[1])))
3937 return pa_output_fp_move_double (operands);
3938 return pa_output_move_double (operands);
3940 [(set_attr "type" "fpalu,move,fpstore,store,store,fpload,load,load,fpstore_load,store_fpload")
3941 (set_attr "length" "4,8,4,8,16,4,8,16,12,12")])
3944 [(set (match_operand:DF 0 "indexed_memory_operand" "=R")
3945 (match_operand:DF 1 "reg_or_0_operand" "f"))]
3947 && !TARGET_DISABLE_INDEXING
3948 && reload_completed"
3950 [(set_attr "type" "fpstore")
3951 (set_attr "pa_combine_type" "addmove")
3952 (set_attr "length" "4")])
3955 [(set (match_operand:SI 0 "register_operand" "")
3956 (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "")
3958 (match_operand:SI 2 "register_operand" "")))
3959 (set (mem:DF (match_dup 0))
3960 (match_operand:DF 3 "register_operand" ""))]
3962 && !TARGET_DISABLE_INDEXING
3963 && REG_OK_FOR_BASE_P (operands[2])
3964 && FP_REGNO_P (REGNO (operands[3]))"
3965 [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2)))
3967 (set (match_dup 0) (plus:SI (ashift:SI (match_dup 1) (const_int 3))
3972 [(set (match_operand:SI 0 "register_operand" "")
3973 (plus:SI (match_operand:SI 2 "register_operand" "")
3974 (ashift:SI (match_operand:SI 1 "register_operand" "")
3976 (set (mem:DF (match_dup 0))
3977 (match_operand:DF 3 "register_operand" ""))]
3979 && !TARGET_DISABLE_INDEXING
3980 && REG_OK_FOR_BASE_P (operands[2])
3981 && FP_REGNO_P (REGNO (operands[3]))"
3982 [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2)))
3984 (set (match_dup 0) (plus:SI (ashift:SI (match_dup 1) (const_int 3))
3989 [(set (match_operand:DI 0 "register_operand" "")
3990 (plus:DI (ashift:DI (match_operand:DI 1 "register_operand" "")
3992 (match_operand:DI 2 "register_operand" "")))
3993 (set (mem:DF (match_dup 0))
3994 (match_operand:DF 3 "register_operand" ""))]
3996 && !TARGET_DISABLE_INDEXING
3998 && REG_OK_FOR_BASE_P (operands[2])
3999 && FP_REGNO_P (REGNO (operands[3]))"
4000 [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
4002 (set (match_dup 0) (plus:DI (ashift:DI (match_dup 1) (const_int 3))
4007 [(set (match_operand:DI 0 "register_operand" "")
4008 (plus:DI (match_operand:DI 2 "register_operand" "")
4009 (ashift:DI (match_operand:DI 1 "register_operand" "")
4011 (set (mem:DF (match_dup 0))
4012 (match_operand:DF 3 "register_operand" ""))]
4014 && !TARGET_DISABLE_INDEXING
4016 && REG_OK_FOR_BASE_P (operands[2])
4017 && FP_REGNO_P (REGNO (operands[3]))"
4018 [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
4020 (set (match_dup 0) (plus:DI (ashift:DI (match_dup 1) (const_int 3))
4025 [(set (match_operand:SI 0 "register_operand" "")
4026 (plus:SI (match_operand:SI 1 "register_operand" "")
4027 (match_operand:SI 2 "register_operand" "")))
4028 (set (mem:DF (match_dup 0))
4029 (match_operand:DF 3 "register_operand" ""))]
4031 && !TARGET_DISABLE_INDEXING
4032 && TARGET_NO_SPACE_REGS
4033 && REG_OK_FOR_INDEX_P (operands[1])
4034 && REG_OK_FOR_BASE_P (operands[2])
4035 && FP_REGNO_P (REGNO (operands[3]))"
4036 [(set (mem:DF (plus:SI (match_dup 1) (match_dup 2)))
4038 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
4042 [(set (match_operand:SI 0 "register_operand" "")
4043 (plus:SI (match_operand:SI 1 "register_operand" "")
4044 (match_operand:SI 2 "register_operand" "")))
4045 (set (mem:DF (match_dup 0))
4046 (match_operand:DF 3 "register_operand" ""))]
4048 && !TARGET_DISABLE_INDEXING
4049 && TARGET_NO_SPACE_REGS
4050 && REG_OK_FOR_BASE_P (operands[1])
4051 && REG_OK_FOR_INDEX_P (operands[2])
4052 && FP_REGNO_P (REGNO (operands[3]))"
4053 [(set (mem:DF (plus:SI (match_dup 2) (match_dup 1)))
4055 (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
4059 [(set (match_operand:DI 0 "register_operand" "")
4060 (plus:DI (match_operand:DI 1 "register_operand" "")
4061 (match_operand:DI 2 "register_operand" "")))
4062 (set (mem:DF (match_dup 0))
4063 (match_operand:DF 3 "register_operand" ""))]
4065 && !TARGET_DISABLE_INDEXING
4067 && TARGET_NO_SPACE_REGS
4068 && REG_OK_FOR_INDEX_P (operands[1])
4069 && REG_OK_FOR_BASE_P (operands[2])
4070 && FP_REGNO_P (REGNO (operands[3]))"
4071 [(set (mem:DF (plus:DI (match_dup 1) (match_dup 2)))
4073 (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
4077 [(set (match_operand:DI 0 "register_operand" "")
4078 (plus:DI (match_operand:DI 1 "register_operand" "")
4079 (match_operand:DI 2 "register_operand" "")))
4080 (set (mem:DF (match_dup 0))
4081 (match_operand:DF 3 "register_operand" ""))]
4083 && !TARGET_DISABLE_INDEXING
4085 && TARGET_NO_SPACE_REGS
4086 && REG_OK_FOR_BASE_P (operands[1])
4087 && REG_OK_FOR_INDEX_P (operands[2])
4088 && FP_REGNO_P (REGNO (operands[3]))"
4089 [(set (mem:DF (plus:DI (match_dup 2) (match_dup 1)))
4091 (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
4095 [(set (match_operand:DF 0 "move_dest_operand"
4097 (match_operand:DF 1 "reg_or_0_or_mem_operand"
4099 "(register_operand (operands[0], DFmode)
4100 || reg_or_0_operand (operands[1], DFmode))
4102 && TARGET_SOFT_FLOAT"
4105 return pa_output_move_double (operands);
4107 [(set_attr "type" "move,store,store,load,load")
4108 (set_attr "length" "8,8,16,8,16")])
4111 [(set (match_operand:DF 0 "move_dest_operand"
4112 "=!*r,*r,*r,*r,*r,Q,f,f,T,?*r,?f")
4113 (match_operand:DF 1 "move_src_operand"
4114 "!*rG,J,N,K,RQ,*rG,fG,RT,f,f,*r"))]
4115 "(register_operand (operands[0], DFmode)
4116 || reg_or_0_operand (operands[1], DFmode))
4117 && !TARGET_SOFT_FLOAT && TARGET_64BIT"
4128 fstd %1,-40(%%sp)\n\tldd -40(%%sp),%0
4129 std %1,-40(%%sp)\n\tfldd -40(%%sp),%0"
4130 [(set_attr "type" "move,move,move,shift,load,store,fpalu,fpload,fpstore,fpstore_load,store_fpload")
4131 (set_attr "pa_combine_type" "addmove")
4132 (set_attr "length" "4,4,4,4,4,4,4,4,4,8,8")])
4135 [(set (match_operand:DF 0 "move_dest_operand"
4136 "=!*r,*r,*r,*r,*r,Q")
4137 (match_operand:DF 1 "move_src_operand"
4138 "!*rG,J,N,K,RQ,*rG"))]
4139 "(register_operand (operands[0], DFmode)
4140 || reg_or_0_operand (operands[1], DFmode))
4141 && TARGET_SOFT_FLOAT && TARGET_64BIT"
4149 [(set_attr "type" "move,move,move,shift,load,store")
4150 (set_attr "pa_combine_type" "addmove")
4151 (set_attr "length" "4,4,4,4,4,4")])
4154 (define_expand "movdi"
4155 [(set (match_operand:DI 0 "general_operand" "")
4156 (match_operand:DI 1 "general_operand" ""))]
4160 if (pa_emit_move_sequence (operands, DImode, 0))
4164 ;; Handle DImode input reloads requiring %r1 as a scratch register.
4165 (define_expand "reload_indi_r1"
4166 [(set (match_operand:DI 0 "register_operand" "=Z")
4167 (match_operand:DI 1 "non_hard_reg_operand" ""))
4168 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
4172 if (pa_emit_move_sequence (operands, DImode, operands[2]))
4175 /* We don't want the clobber emitted, so handle this ourselves. */
4176 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4180 ;; Handle DImode input reloads requiring a general register as a
4181 ;; scratch register.
4182 (define_expand "reload_indi"
4183 [(set (match_operand:DI 0 "register_operand" "=Z")
4184 (match_operand:DI 1 "non_hard_reg_operand" ""))
4185 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
4189 if (pa_emit_move_sequence (operands, DImode, operands[2]))
4192 /* We don't want the clobber emitted, so handle this ourselves. */
4193 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4197 ;; Handle DImode output reloads requiring a general register as a
4198 ;; scratch register.
4199 (define_expand "reload_outdi"
4200 [(set (match_operand:DI 0 "non_hard_reg_operand" "")
4201 (match_operand:DI 1 "register_operand" "Z"))
4202 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
4206 if (pa_emit_move_sequence (operands, DImode, operands[2]))
4209 /* We don't want the clobber emitted, so handle this ourselves. */
4210 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4215 [(set (match_operand:DI 0 "register_operand" "=r")
4216 (high:DI (match_operand 1 "" "")))]
4220 rtx op0 = operands[0];
4221 rtx op1 = operands[1];
4223 switch (GET_CODE (op1))
4226 #if HOST_BITS_PER_WIDE_INT <= 32
4227 operands[0] = operand_subword (op0, 1, 0, DImode);
4228 output_asm_insn (\"ldil L'%1,%0\", operands);
4230 operands[0] = operand_subword (op0, 0, 0, DImode);
4231 if (INTVAL (op1) < 0)
4232 output_asm_insn (\"ldi -1,%0\", operands);
4234 output_asm_insn (\"ldi 0,%0\", operands);
4236 operands[0] = operand_subword (op0, 1, 0, DImode);
4237 operands[1] = GEN_INT (INTVAL (op1) & 0xffffffff);
4238 output_asm_insn (\"ldil L'%1,%0\", operands);
4240 operands[0] = operand_subword (op0, 0, 0, DImode);
4241 operands[1] = GEN_INT (INTVAL (op1) >> 32);
4242 output_asm_insn (pa_singlemove_string (operands), operands);
4247 operands[0] = operand_subword (op0, 1, 0, DImode);
4248 operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1));
4249 output_asm_insn (\"ldil L'%1,%0\", operands);
4251 operands[0] = operand_subword (op0, 0, 0, DImode);
4252 operands[1] = GEN_INT (CONST_DOUBLE_HIGH (op1));
4253 output_asm_insn (pa_singlemove_string (operands), operands);
4261 [(set_attr "type" "move")
4262 (set_attr "length" "12")])
4265 [(set (match_operand:DI 0 "move_dest_operand"
4266 "=r,o,Q,r,r,r,*f,*f,T,?r,?*f")
4267 (match_operand:DI 1 "move_src_operand"
4268 "rM,r,r,o*R,Q,i,*fM,RT,*f,*f,r"))]
4269 "(register_operand (operands[0], DImode)
4270 || reg_or_0_operand (operands[1], DImode))
4272 && !TARGET_SOFT_FLOAT"
4275 if ((FP_REG_P (operands[0]) || FP_REG_P (operands[1])
4276 || operands[1] == CONST0_RTX (DFmode))
4277 && !(REG_P (operands[0]) && REG_P (operands[1])
4278 && FP_REG_P (operands[0]) ^ FP_REG_P (operands[1])))
4279 return pa_output_fp_move_double (operands);
4280 return pa_output_move_double (operands);
4283 "move,store,store,load,load,multi,fpalu,fpload,fpstore,fpstore_load,store_fpload")
4284 (set_attr "length" "8,8,16,8,16,16,4,4,4,12,12")])
4287 [(set (match_operand:DI 0 "move_dest_operand"
4288 "=r,r,r,r,r,r,Q,!*q,!r,!*f,*f,T,?r,?*f")
4289 (match_operand:DI 1 "move_src_operand"
4290 "A,r,J,N,K,RQ,rM,!rM,!*q,!*fM,RT,*f,*f,r"))]
4291 "(register_operand (operands[0], DImode)
4292 || reg_or_0_operand (operands[1], DImode))
4293 && !TARGET_SOFT_FLOAT && TARGET_64BIT"
4303 {mfctl|mfctl,w} %%sar,%0
4307 fstd %1,-40(%%sp)\n\tldd -40(%%sp),%0
4308 std %1,-40(%%sp)\n\tfldd -40(%%sp),%0"
4309 [(set_attr "type" "load,move,move,move,shift,load,store,move,move,fpalu,fpload,fpstore,fpstore_load,store_fpload")
4310 (set_attr "pa_combine_type" "addmove")
4311 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4,4,8,8")])
4314 [(set (match_operand:DI 0 "move_dest_operand"
4315 "=r,r,r,r,r,r,Q,!*q,!r")
4316 (match_operand:DI 1 "move_src_operand"
4317 "A,r,J,N,K,RQ,rM,!rM,!*q"))]
4318 "(register_operand (operands[0], DImode)
4319 || reg_or_0_operand (operands[1], DImode))
4320 && TARGET_SOFT_FLOAT && TARGET_64BIT"
4330 {mfctl|mfctl,w} %%sar,%0"
4331 [(set_attr "type" "load,move,move,move,shift,load,store,move,move")
4332 (set_attr "pa_combine_type" "addmove")
4333 (set_attr "length" "4,4,4,4,4,4,4,4,4")])
4336 [(set (match_operand:DI 0 "indexed_memory_operand" "=R")
4337 (match_operand:DI 1 "register_operand" "f"))]
4340 && !TARGET_DISABLE_INDEXING
4341 && reload_completed"
4343 [(set_attr "type" "fpstore")
4344 (set_attr "pa_combine_type" "addmove")
4345 (set_attr "length" "4")])
4348 [(set (match_operand:DI 0 "register_operand" "")
4349 (plus:DI (ashift:DI (match_operand:DI 1 "register_operand" "")
4351 (match_operand:DI 2 "register_operand" "")))
4352 (set (mem:DI (match_dup 0))
4353 (match_operand:DI 3 "register_operand" ""))]
4355 && !TARGET_DISABLE_INDEXING
4357 && REG_OK_FOR_BASE_P (operands[2])
4358 && FP_REGNO_P (REGNO (operands[3]))"
4359 [(set (mem:DI (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
4361 (set (match_dup 0) (plus:DI (ashift:DI (match_dup 1) (const_int 3))
4366 [(set (match_operand:DI 0 "register_operand" "")
4367 (plus:DI (match_operand:DI 1 "register_operand" "")
4368 (match_operand:DI 2 "register_operand" "")))
4369 (set (mem:DI (match_dup 0))
4370 (match_operand:DI 3 "register_operand" ""))]
4372 && !TARGET_DISABLE_INDEXING
4374 && TARGET_NO_SPACE_REGS
4375 && REG_OK_FOR_INDEX_P (operands[1])
4376 && REG_OK_FOR_BASE_P (operands[2])
4377 && FP_REGNO_P (REGNO (operands[3]))"
4378 [(set (mem:DI (plus:DI (match_dup 1) (match_dup 2)))
4380 (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
4384 [(set (match_operand:DI 0 "register_operand" "")
4385 (plus:DI (match_operand:DI 1 "register_operand" "")
4386 (match_operand:DI 2 "register_operand" "")))
4387 (set (mem:DI (match_dup 0))
4388 (match_operand:DI 3 "register_operand" ""))]
4390 && !TARGET_DISABLE_INDEXING
4392 && TARGET_NO_SPACE_REGS
4393 && REG_OK_FOR_BASE_P (operands[1])
4394 && REG_OK_FOR_INDEX_P (operands[2])
4395 && FP_REGNO_P (REGNO (operands[3]))"
4396 [(set (mem:DI (plus:DI (match_dup 2) (match_dup 1)))
4398 (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
4402 [(set (match_operand:DI 0 "move_dest_operand"
4404 (match_operand:DI 1 "general_operand"
4406 "(register_operand (operands[0], DImode)
4407 || reg_or_0_operand (operands[1], DImode))
4409 && TARGET_SOFT_FLOAT"
4412 return pa_output_move_double (operands);
4414 [(set_attr "type" "move,store,store,load,load,multi")
4415 (set_attr "length" "8,8,16,8,16,16")])
4418 [(set (match_operand:DI 0 "register_operand" "=r,&r")
4419 (lo_sum:DI (match_operand:DI 1 "register_operand" "0,r")
4420 (match_operand:DI 2 "immediate_operand" "i,i")))]
4424 /* Don't output a 64-bit constant, since we can't trust the assembler to
4425 handle it correctly. */
4426 if (GET_CODE (operands[2]) == CONST_DOUBLE)
4427 operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
4428 else if (HOST_BITS_PER_WIDE_INT > 32
4429 && GET_CODE (operands[2]) == CONST_INT)
4430 operands[2] = GEN_INT (INTVAL (operands[2]) & 0xffffffff);
4431 if (which_alternative == 1)
4432 output_asm_insn (\"copy %1,%0\", operands);
4433 return \"ldo R'%G2(%R1),%R0\";
4435 [(set_attr "type" "move,move")
4436 (set_attr "length" "4,8")])
4438 (define_expand "movsf"
4439 [(set (match_operand:SF 0 "general_operand" "")
4440 (match_operand:SF 1 "general_operand" ""))]
4444 if (pa_emit_move_sequence (operands, SFmode, 0))
4448 ;; Handle SFmode input reloads requiring %r1 as a scratch register.
4449 (define_expand "reload_insf_r1"
4450 [(set (match_operand:SF 0 "register_operand" "=Z")
4451 (match_operand:SF 1 "non_hard_reg_operand" ""))
4452 (clobber (match_operand:SI 2 "register_operand" "=&a"))]
4456 if (pa_emit_move_sequence (operands, SFmode, operands[2]))
4459 /* We don't want the clobber emitted, so handle this ourselves. */
4460 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4464 ;; Handle SFmode input reloads requiring a general register as a
4465 ;; scratch register.
4466 (define_expand "reload_insf"
4467 [(set (match_operand:SF 0 "register_operand" "=Z")
4468 (match_operand:SF 1 "non_hard_reg_operand" ""))
4469 (clobber (match_operand:SF 2 "register_operand" "=&r"))]
4473 if (pa_emit_move_sequence (operands, SFmode, operands[2]))
4476 /* We don't want the clobber emitted, so handle this ourselves. */
4477 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4481 ;; Handle SFmode output reloads requiring a general register as a
4482 ;; scratch register.
4483 (define_expand "reload_outsf"
4484 [(set (match_operand:SF 0 "non_hard_reg_operand" "")
4485 (match_operand:SF 1 "register_operand" "Z"))
4486 (clobber (match_operand:SF 2 "register_operand" "=&r"))]
4490 if (pa_emit_move_sequence (operands, SFmode, operands[2]))
4493 /* We don't want the clobber emitted, so handle this ourselves. */
4494 emit_insn (gen_rtx_SET (operands[0], operands[1]));
4499 [(set (match_operand:SF 0 "move_dest_operand"
4500 "=f,!*r,f,*r,T,Q,?*r,?f")
4501 (match_operand:SF 1 "reg_or_0_or_mem_operand"
4502 "fG,!*rG,RT,RQ,f,*rG,f,*r"))]
4503 "(register_operand (operands[0], SFmode)
4504 || reg_or_0_operand (operands[1], SFmode))
4505 && !TARGET_SOFT_FLOAT
4514 {fstws|fstw} %1,-16(%%sp)\n\t{ldws|ldw} -16(%%sp),%0
4515 {stws|stw} %1,-16(%%sp)\n\t{fldws|fldw} -16(%%sp),%0"
4516 [(set_attr "type" "fpalu,move,fpload,load,fpstore,store,fpstore_load,store_fpload")
4517 (set_attr "pa_combine_type" "addmove")
4518 (set_attr "length" "4,4,4,4,4,4,8,8")])
4521 [(set (match_operand:SF 0 "move_dest_operand"
4522 "=f,!*r,f,*r,T,Q,?*r,?f")
4523 (match_operand:SF 1 "reg_or_0_or_mem_operand"
4524 "fG,!*rG,RT,RQ,f,*rG,f,*r"))]
4525 "(register_operand (operands[0], SFmode)
4526 || reg_or_0_operand (operands[1], SFmode))
4527 && !TARGET_SOFT_FLOAT
4536 fstw %1,-40(%%sp)\n\tldw -40(%%sp),%0
4537 stw %1,-40(%%sp)\n\tfldw -40(%%sp),%0"
4538 [(set_attr "type" "fpalu,move,fpload,load,fpstore,store,fpstore_load,store_fpload")
4539 (set_attr "pa_combine_type" "addmove")
4540 (set_attr "length" "4,4,4,4,4,4,8,8")])
4543 [(set (match_operand:SF 0 "move_dest_operand"
4545 (match_operand:SF 1 "reg_or_0_or_mem_operand"
4547 "(register_operand (operands[0], SFmode)
4548 || reg_or_0_operand (operands[1], SFmode))
4549 && TARGET_SOFT_FLOAT
4555 [(set_attr "type" "move,load,store")
4556 (set_attr "pa_combine_type" "addmove")
4557 (set_attr "length" "4,4,4")])
4560 [(set (match_operand:SF 0 "indexed_memory_operand" "=R")
4561 (match_operand:SF 1 "register_operand" "f"))]
4563 && !TARGET_DISABLE_INDEXING
4564 && reload_completed"
4566 [(set_attr "type" "fpstore")
4567 (set_attr "pa_combine_type" "addmove")
4568 (set_attr "length" "4")])
4571 [(set (match_operand:SI 0 "register_operand" "")
4572 (plus:SI (match_operand:SI 1 "register_operand" "")
4573 (match_operand:SI 2 "const_int_operand" "")))
4574 (set (mem:SF (match_dup 0))
4575 (match_operand:SF 3 "register_operand" ""))]
4578 && GENERAL_REGNO_P (REGNO (operands[0]))
4579 && GENERAL_REGNO_P (REGNO (operands[3]))
4580 && REGNO (operands[0]) != REGNO (operands[3])
4581 && base14_operand (operands[2], E_SImode)"
4582 [(set (mem:SF (plus:SI (match_dup 1) (match_dup 2))) (match_dup 3))
4583 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
4587 [(set (match_operand:SI 0 "register_operand" "")
4588 (plus:SI (match_operand:SI 1 "register_operand" "")
4589 (match_operand:SI 2 "const_int_operand" "")))
4590 (set (match_operand:SF 3 "register_operand" "")
4591 (mem:SF (match_dup 0)))]
4594 && GENERAL_REGNO_P (REGNO (operands[0]))
4595 && GENERAL_REGNO_P (REGNO (operands[3]))
4596 && REGNO (operands[0]) != REGNO (operands[3])
4597 && REGNO (operands[1]) != REGNO (operands[3])
4598 && base14_operand (operands[2], E_SImode)"
4599 [(set (match_dup 3) (mem:SF (plus:SI (match_dup 1) (match_dup 2))))
4600 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
4604 [(set (match_operand:SI 0 "register_operand" "")
4605 (plus:SI (match_operand:SI 1 "register_operand" "")
4606 (match_operand:SI 2 "const_int_operand" "")))
4607 (set (match_operand:SF 3 "register_operand" "")
4608 (mem:SF (match_dup 0)))]
4611 && GENERAL_REGNO_P (REGNO (operands[0]))
4612 && GENERAL_REGNO_P (REGNO (operands[3]))
4613 && REGNO (operands[0]) == REGNO (operands[3])
4614 && base14_operand (operands[2], E_SImode)"
4615 [(set (match_dup 3) (mem:SF (plus:SI (match_dup 1) (match_dup 2))))]
4619 [(set (match_operand:SI 0 "register_operand" "")
4620 (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "")
4622 (match_operand:SI 2 "register_operand" "")))
4623 (set (mem:SF (match_dup 0))
4624 (match_operand:SF 3 "register_operand" ""))]
4626 && !TARGET_DISABLE_INDEXING
4627 && REG_OK_FOR_BASE_P (operands[2])
4628 && FP_REGNO_P (REGNO (operands[3]))"
4629 [(set (mem:SF (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
4631 (set (match_dup 0) (plus:SI (ashift:SI (match_dup 1) (const_int 2))
4636 [(set (match_operand:DI 0 "register_operand" "")
4637 (plus:DI (ashift:DI (match_operand:DI 1 "register_operand" "")
4639 (match_operand:DI 2 "register_operand" "")))
4640 (set (mem:SF (match_dup 0))
4641 (match_operand:SF 3 "register_operand" ""))]
4643 && !TARGET_DISABLE_INDEXING
4645 && REG_OK_FOR_BASE_P (operands[2])
4646 && FP_REGNO_P (REGNO (operands[3]))"
4647 [(set (mem:SF (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
4649 (set (match_dup 0) (plus:DI (ashift:DI (match_dup 1) (const_int 2))
4654 [(set (match_operand:SI 0 "register_operand" "")
4655 (plus:SI (match_operand:SI 1 "register_operand" "")
4656 (match_operand:SI 2 "register_operand" "")))
4657 (set (mem:SF (match_dup 0))
4658 (match_operand:SF 3 "register_operand" ""))]
4660 && !TARGET_DISABLE_INDEXING
4661 && TARGET_NO_SPACE_REGS
4662 && REG_OK_FOR_INDEX_P (operands[1])
4663 && REG_OK_FOR_BASE_P (operands[2])
4664 && FP_REGNO_P (REGNO (operands[3]))"
4665 [(set (mem:SF (plus:SI (match_dup 1) (match_dup 2)))
4667 (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
4671 [(set (match_operand:SI 0 "register_operand" "")
4672 (plus:SI (match_operand:SI 1 "register_operand" "")
4673 (match_operand:SI 2 "register_operand" "")))
4674 (set (mem:SF (match_dup 0))
4675 (match_operand:SF 3 "register_operand" ""))]
4677 && !TARGET_DISABLE_INDEXING
4678 && TARGET_NO_SPACE_REGS
4679 && REG_OK_FOR_BASE_P (operands[1])
4680 && REG_OK_FOR_INDEX_P (operands[2])
4681 && FP_REGNO_P (REGNO (operands[3]))"
4682 [(set (mem:SF (plus:SI (match_dup 2) (match_dup 1)))
4684 (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
4688 [(set (match_operand:DI 0 "register_operand" "")
4689 (plus:DI (match_operand:DI 1 "register_operand" "")
4690 (match_operand:DI 2 "register_operand" "")))
4691 (set (mem:SF (match_dup 0))
4692 (match_operand:SF 3 "register_operand" ""))]
4694 && !TARGET_DISABLE_INDEXING
4696 && TARGET_NO_SPACE_REGS
4697 && REG_OK_FOR_INDEX_P (operands[1])
4698 && REG_OK_FOR_BASE_P (operands[2])
4699 && FP_REGNO_P (REGNO (operands[3]))"
4700 [(set (mem:SF (plus:DI (match_dup 1) (match_dup 2)))
4702 (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
4706 [(set (match_operand:DI 0 "register_operand" "")
4707 (plus:DI (match_operand:DI 1 "register_operand" "")
4708 (match_operand:DI 2 "register_operand" "")))
4709 (set (mem:SF (match_dup 0))
4710 (match_operand:SF 3 "register_operand" ""))]
4712 && !TARGET_DISABLE_INDEXING
4714 && TARGET_NO_SPACE_REGS
4715 && REG_OK_FOR_BASE_P (operands[1])
4716 && REG_OK_FOR_INDEX_P (operands[2])
4717 && FP_REGNO_P (REGNO (operands[3]))"
4718 [(set (mem:SF (plus:DI (match_dup 2) (match_dup 1)))
4720 (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
4724 [(set (match_operand:SF 0 "move_dest_operand"
4726 (match_operand:SF 1 "reg_or_0_or_mem_operand"
4728 "(register_operand (operands[0], SFmode)
4729 || reg_or_0_operand (operands[1], SFmode))
4730 && TARGET_SOFT_FLOAT"
4735 [(set_attr "type" "move,load,store")
4736 (set_attr "pa_combine_type" "addmove")
4737 (set_attr "length" "4,4,4")])
4741 ;;- zero extension instructions
4742 ;; We have define_expand for zero extension patterns to make sure the
4743 ;; operands get loaded into registers. The define_insns accept
4744 ;; memory operands. This gives us better overall code than just
4745 ;; having a pattern that does or does not accept memory operands.
4747 (define_expand "zero_extendqihi2"
4748 [(set (match_operand:HI 0 "register_operand" "")
4750 (match_operand:QI 1 "register_operand" "")))]
4755 [(set (match_operand:HI 0 "register_operand" "=r,r")
4757 (match_operand:QI 1 "move_src_operand" "r,RQ")))]
4758 "GET_CODE (operands[1]) != CONST_INT"
4760 {extru|extrw,u} %1,31,8,%0
4762 [(set_attr "type" "shift,load")
4763 (set_attr "length" "4,4")])
4765 (define_expand "zero_extendqisi2"
4766 [(set (match_operand:SI 0 "register_operand" "")
4768 (match_operand:QI 1 "register_operand" "")))]
4773 [(set (match_operand:SI 0 "register_operand" "=r,r")
4775 (match_operand:QI 1 "move_src_operand" "r,RQ")))]
4776 "GET_CODE (operands[1]) != CONST_INT"
4778 {extru|extrw,u} %1,31,8,%0
4780 [(set_attr "type" "shift,load")
4781 (set_attr "length" "4,4")])
4783 (define_expand "zero_extendhisi2"
4784 [(set (match_operand:SI 0 "register_operand" "")
4786 (match_operand:HI 1 "register_operand" "")))]
4791 [(set (match_operand:SI 0 "register_operand" "=r,r")
4793 (match_operand:HI 1 "move_src_operand" "r,RQ")))]
4794 "GET_CODE (operands[1]) != CONST_INT"
4796 {extru|extrw,u} %1,31,16,%0
4798 [(set_attr "type" "shift,load")
4799 (set_attr "length" "4,4")])
4801 (define_expand "zero_extendqidi2"
4802 [(set (match_operand:DI 0 "register_operand" "")
4804 (match_operand:QI 1 "register_operand" "")))]
4809 [(set (match_operand:DI 0 "register_operand" "=r,r")
4811 (match_operand:QI 1 "move_src_operand" "r,RQ")))]
4812 "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
4816 [(set_attr "type" "shift,load")
4817 (set_attr "length" "4,4")])
4819 (define_expand "zero_extendhidi2"
4820 [(set (match_operand:DI 0 "register_operand" "")
4822 (match_operand:HI 1 "register_operand" "")))]
4827 [(set (match_operand:DI 0 "register_operand" "=r,r")
4829 (match_operand:HI 1 "move_src_operand" "r,RQ")))]
4830 "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
4834 [(set_attr "type" "shift,load")
4835 (set_attr "length" "4,4")])
4837 (define_expand "zero_extendsidi2"
4838 [(set (match_operand:DI 0 "register_operand" "")
4840 (match_operand:SI 1 "register_operand" "")))]
4845 [(set (match_operand:DI 0 "register_operand" "=r,r")
4847 (match_operand:SI 1 "move_src_operand" "r,RQ")))]
4848 "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
4852 [(set_attr "type" "shift,load")
4853 (set_attr "length" "4,4")])
4855 ;;- sign extension instructions
4857 (define_insn "extendhisi2"
4858 [(set (match_operand:SI 0 "register_operand" "=r")
4859 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
4861 "{extrs|extrw,s} %1,31,16,%0"
4862 [(set_attr "type" "shift")
4863 (set_attr "length" "4")])
4865 (define_insn "extendqihi2"
4866 [(set (match_operand:HI 0 "register_operand" "=r")
4867 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
4869 "{extrs|extrw,s} %1,31,8,%0"
4870 [(set_attr "type" "shift")
4871 (set_attr "length" "4")])
4873 (define_insn "extendqisi2"
4874 [(set (match_operand:SI 0 "register_operand" "=r")
4875 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
4877 "{extrs|extrw,s} %1,31,8,%0"
4878 [(set_attr "type" "shift")
4879 (set_attr "length" "4")])
4881 (define_insn "extendqidi2"
4882 [(set (match_operand:DI 0 "register_operand" "=r")
4883 (sign_extend:DI (match_operand:QI 1 "register_operand" "r")))]
4885 "extrd,s %1,63,8,%0"
4886 [(set_attr "type" "shift")
4887 (set_attr "length" "4")])
4889 (define_insn "extendhidi2"
4890 [(set (match_operand:DI 0 "register_operand" "=r")
4891 (sign_extend:DI (match_operand:HI 1 "register_operand" "r")))]
4893 "extrd,s %1,63,16,%0"
4894 [(set_attr "type" "shift")
4895 (set_attr "length" "4")])
4897 (define_insn "extendsidi2"
4898 [(set (match_operand:DI 0 "register_operand" "=r")
4899 (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))]
4901 "extrd,s %1,63,32,%0"
4902 [(set_attr "type" "shift")
4903 (set_attr "length" "4")])
4906 ;; Conversions between float and double.
4908 (define_insn "extendsfdf2"
4909 [(set (match_operand:DF 0 "register_operand" "=f")
4911 (match_operand:SF 1 "register_operand" "f")))]
4912 "! TARGET_SOFT_FLOAT"
4913 "{fcnvff|fcnv},sgl,dbl %1,%0"
4914 [(set_attr "type" "fpalu")
4915 (set_attr "length" "4")])
4917 (define_insn "truncdfsf2"
4918 [(set (match_operand:SF 0 "register_operand" "=f")
4920 (match_operand:DF 1 "register_operand" "f")))]
4921 "! TARGET_SOFT_FLOAT"
4922 "{fcnvff|fcnv},dbl,sgl %1,%0"
4923 [(set_attr "type" "fpalu")
4924 (set_attr "length" "4")])
4926 ;; Conversion between fixed point and floating point.
4927 ;; Note that among the fix-to-float insns
4928 ;; the ones that start with SImode come first.
4929 ;; That is so that an operand that is a CONST_INT
4930 ;; (and therefore lacks a specific machine mode).
4931 ;; will be recognized as SImode (which is always valid)
4932 ;; rather than as QImode or HImode.
4934 ;; This pattern forces (set (reg:SF ...) (float:SF (const_int ...)))
4935 ;; to be reloaded by putting the constant into memory.
4936 ;; It must come before the more general floatsisf2 pattern.
4938 [(set (match_operand:SF 0 "register_operand" "=f")
4939 (float:SF (match_operand:SI 1 "const_int_operand" "m")))]
4940 "! TARGET_SOFT_FLOAT"
4941 "fldw%F1 %1,%0\;{fcnvxf,sgl,sgl|fcnv,w,sgl} %0,%0"
4942 [(set_attr "type" "fpalu")
4943 (set_attr "length" "8")])
4945 (define_insn "floatsisf2"
4946 [(set (match_operand:SF 0 "register_operand" "=f")
4947 (float:SF (match_operand:SI 1 "register_operand" "f")))]
4948 "! TARGET_SOFT_FLOAT"
4949 "{fcnvxf,sgl,sgl|fcnv,w,sgl} %1,%0"
4950 [(set_attr "type" "fpalu")
4951 (set_attr "length" "4")])
4953 ;; This pattern forces (set (reg:DF ...) (float:DF (const_int ...)))
4954 ;; to be reloaded by putting the constant into memory.
4955 ;; It must come before the more general floatsidf2 pattern.
4957 [(set (match_operand:DF 0 "register_operand" "=f")
4958 (float:DF (match_operand:SI 1 "const_int_operand" "m")))]
4959 "! TARGET_SOFT_FLOAT"
4960 "fldw%F1 %1,%0\;{fcnvxf,sgl,dbl|fcnv,w,dbl} %0,%0"
4961 [(set_attr "type" "fpalu")
4962 (set_attr "length" "8")])
4964 (define_insn "floatsidf2"
4965 [(set (match_operand:DF 0 "register_operand" "=f")
4966 (float:DF (match_operand:SI 1 "register_operand" "f")))]
4967 "! TARGET_SOFT_FLOAT"
4968 "{fcnvxf,sgl,dbl|fcnv,w,dbl} %1,%0"
4969 [(set_attr "type" "fpalu")
4970 (set_attr "length" "4")])
4972 (define_expand "floatunssisf2"
4973 [(set (subreg:SI (match_dup 2) 4)
4974 (match_operand:SI 1 "register_operand" ""))
4975 (set (subreg:SI (match_dup 2) 0)
4977 (set (match_operand:SF 0 "register_operand" "")
4978 (float:SF (match_dup 2)))]
4979 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
4984 emit_insn (gen_floatunssisf2_pa20 (operands[0], operands[1]));
4987 operands[2] = gen_reg_rtx (DImode);
4990 (define_expand "floatunssidf2"
4991 [(set (subreg:SI (match_dup 2) 4)
4992 (match_operand:SI 1 "register_operand" ""))
4993 (set (subreg:SI (match_dup 2) 0)
4995 (set (match_operand:DF 0 "register_operand" "")
4996 (float:DF (match_dup 2)))]
4997 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
5002 emit_insn (gen_floatunssidf2_pa20 (operands[0], operands[1]));
5005 operands[2] = gen_reg_rtx (DImode);
5008 (define_insn "floatdisf2"
5009 [(set (match_operand:SF 0 "register_operand" "=f")
5010 (float:SF (match_operand:DI 1 "register_operand" "f")))]
5011 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
5012 "{fcnvxf,dbl,sgl|fcnv,dw,sgl} %1,%0"
5013 [(set_attr "type" "fpalu")
5014 (set_attr "length" "4")])
5016 (define_insn "floatdidf2"
5017 [(set (match_operand:DF 0 "register_operand" "=f")
5018 (float:DF (match_operand:DI 1 "register_operand" "f")))]
5019 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
5020 "{fcnvxf,dbl,dbl|fcnv,dw,dbl} %1,%0"
5021 [(set_attr "type" "fpalu")
5022 (set_attr "length" "4")])
5024 ;; Convert a float to an actual integer.
5025 ;; Truncation is performed as part of the conversion.
5027 (define_insn "fix_truncsfsi2"
5028 [(set (match_operand:SI 0 "register_operand" "=f")
5029 (fix:SI (match_operand:SF 1 "register_operand" "f")))]
5030 "! TARGET_SOFT_FLOAT"
5031 "{fcnvfxt,sgl,sgl|fcnv,t,sgl,w} %1,%0"
5032 [(set_attr "type" "fpalu")
5033 (set_attr "length" "4")])
5035 (define_insn "fix_truncdfsi2"
5036 [(set (match_operand:SI 0 "register_operand" "=f")
5037 (fix:SI (match_operand:DF 1 "register_operand" "f")))]
5038 "! TARGET_SOFT_FLOAT"
5039 "{fcnvfxt,dbl,sgl|fcnv,t,dbl,w} %1,%0"
5040 [(set_attr "type" "fpalu")
5041 (set_attr "length" "4")])
5043 (define_insn "fix_truncsfdi2"
5044 [(set (match_operand:DI 0 "register_operand" "=f")
5045 (fix:DI (match_operand:SF 1 "register_operand" "f")))]
5046 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
5047 "{fcnvfxt,sgl,dbl|fcnv,t,sgl,dw} %1,%0"
5048 [(set_attr "type" "fpalu")
5049 (set_attr "length" "4")])
5051 (define_insn "fix_truncdfdi2"
5052 [(set (match_operand:DI 0 "register_operand" "=f")
5053 (fix:DI (match_operand:DF 1 "register_operand" "f")))]
5054 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
5055 "{fcnvfxt,dbl,dbl|fcnv,t,dbl,dw} %1,%0"
5056 [(set_attr "type" "fpalu")
5057 (set_attr "length" "4")])
5059 (define_insn "floatunssidf2_pa20"
5060 [(set (match_operand:DF 0 "register_operand" "=f")
5061 (unsigned_float:DF (match_operand:SI 1 "register_operand" "f")))]
5062 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5064 [(set_attr "type" "fpalu")
5065 (set_attr "length" "4")])
5067 (define_insn "floatunssisf2_pa20"
5068 [(set (match_operand:SF 0 "register_operand" "=f")
5069 (unsigned_float:SF (match_operand:SI 1 "register_operand" "f")))]
5070 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5072 [(set_attr "type" "fpalu")
5073 (set_attr "length" "4")])
5075 (define_insn "floatunsdisf2"
5076 [(set (match_operand:SF 0 "register_operand" "=f")
5077 (unsigned_float:SF (match_operand:DI 1 "register_operand" "f")))]
5078 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5079 "fcnv,udw,sgl %1,%0"
5080 [(set_attr "type" "fpalu")
5081 (set_attr "length" "4")])
5083 (define_insn "floatunsdidf2"
5084 [(set (match_operand:DF 0 "register_operand" "=f")
5085 (unsigned_float:DF (match_operand:DI 1 "register_operand" "f")))]
5086 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5087 "fcnv,udw,dbl %1,%0"
5088 [(set_attr "type" "fpalu")
5089 (set_attr "length" "4")])
5091 (define_insn "fixuns_truncsfsi2"
5092 [(set (match_operand:SI 0 "register_operand" "=f")
5093 (unsigned_fix:SI (match_operand:SF 1 "register_operand" "f")))]
5094 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5095 "fcnv,t,sgl,uw %1,%0"
5096 [(set_attr "type" "fpalu")
5097 (set_attr "length" "4")])
5099 (define_insn "fixuns_truncdfsi2"
5100 [(set (match_operand:SI 0 "register_operand" "=f")
5101 (unsigned_fix:SI (match_operand:DF 1 "register_operand" "f")))]
5102 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5103 "fcnv,t,dbl,uw %1,%0"
5104 [(set_attr "type" "fpalu")
5105 (set_attr "length" "4")])
5107 (define_insn "fixuns_truncsfdi2"
5108 [(set (match_operand:DI 0 "register_operand" "=f")
5109 (unsigned_fix:DI (match_operand:SF 1 "register_operand" "f")))]
5110 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5111 "fcnv,t,sgl,udw %1,%0"
5112 [(set_attr "type" "fpalu")
5113 (set_attr "length" "4")])
5115 (define_insn "fixuns_truncdfdi2"
5116 [(set (match_operand:DI 0 "register_operand" "=f")
5117 (unsigned_fix:DI (match_operand:DF 1 "register_operand" "f")))]
5118 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5119 "fcnv,t,dbl,udw %1,%0"
5120 [(set_attr "type" "fpalu")
5121 (set_attr "length" "4")])
5123 ;;- arithmetic instructions
5125 (define_expand "adddi3"
5126 [(set (match_operand:DI 0 "register_operand" "")
5127 (plus:DI (match_operand:DI 1 "register_operand" "")
5128 (match_operand:DI 2 "adddi3_operand" "")))]
5133 [(set (match_operand:DI 0 "register_operand" "=r")
5134 (plus:DI (match_operand:DI 1 "register_operand" "%r")
5135 (match_operand:DI 2 "arith11_operand" "rI")))]
5139 if (GET_CODE (operands[2]) == CONST_INT)
5141 if (INTVAL (operands[2]) >= 0)
5142 return \"addi %2,%R1,%R0\;{addc|add,c} %1,%%r0,%0\";
5144 return \"addi %2,%R1,%R0\;{subb|sub,b} %1,%%r0,%0\";
5147 return \"add %R2,%R1,%R0\;{addc|add,c} %2,%1,%0\";
5149 [(set_attr "type" "binary")
5150 (set_attr "length" "8")])
5153 [(set (match_operand:DI 0 "register_operand" "=r,r")
5154 (plus:DI (match_operand:DI 1 "register_operand" "%r,r")
5155 (match_operand:DI 2 "arith14_operand" "r,J")))]
5160 [(set_attr "type" "binary,binary")
5161 (set_attr "pa_combine_type" "addmove")
5162 (set_attr "length" "4,4")])
5165 [(set (match_operand:DI 0 "register_operand" "=r")
5166 (plus:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
5167 (match_operand:DI 2 "register_operand" "r")))]
5170 [(set_attr "type" "binary")
5171 (set_attr "length" "4")])
5174 [(set (match_operand:SI 0 "register_operand" "=r")
5175 (plus:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
5176 (match_operand:SI 2 "register_operand" "r")))]
5179 [(set_attr "type" "binary")
5180 (set_attr "length" "4")])
5182 (define_expand "addvdi3"
5183 [(parallel [(set (match_operand:DI 0 "register_operand" "")
5184 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "")
5185 (match_operand:DI 2 "arith11_operand" "")))
5186 (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1))
5187 (sign_extend:TI (match_dup 2)))
5188 (sign_extend:TI (plus:DI (match_dup 1)
5195 operands[2] = force_reg (DImode, operands[2]);
5199 [(set (match_operand:DI 0 "register_operand" "=r")
5200 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM")
5201 (match_operand:DI 2 "register_operand" "r")))
5202 (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1))
5203 (sign_extend:TI (match_dup 2)))
5204 (sign_extend:TI (plus:DI (match_dup 1)
5208 "add,tsv,* %2,%1,%0"
5209 [(set_attr "type" "binary")
5210 (set_attr "length" "4")])
5213 [(set (match_operand:DI 0 "register_operand" "=r")
5214 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM")
5215 (match_operand:DI 2 "arith11_operand" "rI")))
5216 (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1))
5217 (sign_extend:TI (match_dup 2)))
5218 (sign_extend:TI (plus:DI (match_dup 1)
5224 if (GET_CODE (operands[2]) == CONST_INT)
5226 if (INTVAL (operands[2]) >= 0)
5227 return \"addi %2,%R1,%R0\;{addco|add,c,tsv} %1,%%r0,%0\";
5229 return \"addi %2,%R1,%R0\;{subbo|sub,b,tsv} %1,%%r0,%0\";
5232 return \"add %R2,%R1,%R0\;{addco|add,c,tsv} %2,%1,%0\";
5234 [(set_attr "type" "binary")
5235 (set_attr "length" "8")])
5237 ;; define_splits to optimize cases of adding a constant integer
5238 ;; to a register when the constant does not fit in 14 bits. */
5240 [(set (match_operand:SI 0 "register_operand" "")
5241 (plus:SI (match_operand:SI 1 "register_operand" "")
5242 (match_operand:SI 2 "const_int_operand" "")))
5243 (clobber (match_operand:SI 4 "register_operand" ""))]
5244 "! pa_cint_ok_for_move (UINTVAL (operands[2]))
5245 && VAL_14_BITS_P (INTVAL (operands[2]) >> 1)"
5246 [(set (match_dup 4) (plus:SI (match_dup 1) (match_dup 2)))
5247 (set (match_dup 0) (plus:SI (match_dup 4) (match_dup 3)))]
5250 int val = INTVAL (operands[2]);
5251 int low = (val < 0) ? -0x2000 : 0x1fff;
5252 int rest = val - low;
5254 operands[2] = GEN_INT (rest);
5255 operands[3] = GEN_INT (low);
5259 [(set (match_operand:SI 0 "register_operand" "")
5260 (plus:SI (match_operand:SI 1 "register_operand" "")
5261 (match_operand:SI 2 "const_int_operand" "")))
5262 (clobber (match_operand:SI 4 "register_operand" ""))]
5263 "! pa_cint_ok_for_move (UINTVAL (operands[2]))"
5264 [(set (match_dup 4) (match_dup 2))
5265 (set (match_dup 0) (plus:SI (ashift:SI (match_dup 4) (match_dup 3))
5269 unsigned HOST_WIDE_INT intval = UINTVAL (operands[2]);
5271 /* Try dividing the constant by 2, then 4, and finally 8 to see
5272 if we can get a constant which can be loaded into a register
5273 in a single instruction (pa_cint_ok_for_move).
5275 If that fails, try to negate the constant and subtract it
5276 from our input operand. */
5277 if (intval % 2 == 0 && pa_cint_ok_for_move (intval / 2))
5279 operands[2] = GEN_INT (intval / 2);
5280 operands[3] = const1_rtx;
5282 else if (intval % 4 == 0 && pa_cint_ok_for_move (intval / 4))
5284 operands[2] = GEN_INT (intval / 4);
5285 operands[3] = const2_rtx;
5287 else if (intval % 8 == 0 && pa_cint_ok_for_move (intval / 8))
5289 operands[2] = GEN_INT (intval / 8);
5290 operands[3] = GEN_INT (3);
5292 else if (pa_cint_ok_for_move (-intval))
5294 emit_insn (gen_rtx_SET (operands[4], GEN_INT (-intval)));
5295 emit_insn (gen_subsi3 (operands[0], operands[1], operands[4]));
5302 (define_insn "addsi3"
5303 [(set (match_operand:SI 0 "register_operand" "=r,r")
5304 (plus:SI (match_operand:SI 1 "register_operand" "%r,r")
5305 (match_operand:SI 2 "arith14_operand" "r,J")))]
5308 {addl|add,l} %1,%2,%0
5310 [(set_attr "type" "binary,binary")
5311 (set_attr "pa_combine_type" "addmove")
5312 (set_attr "length" "4,4")])
5314 (define_insn "addvsi3"
5315 [(set (match_operand:SI 0 "register_operand" "=r,r")
5316 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rM,rM")
5317 (match_operand:SI 2 "arith11_operand" "r,I")))
5318 (trap_if (ne (plus:DI (sign_extend:DI (match_dup 1))
5319 (sign_extend:DI (match_dup 2)))
5320 (sign_extend:DI (plus:SI (match_dup 1)
5325 {addo|add,tsv} %2,%1,%0
5326 {addio|addi,tsv} %2,%1,%0"
5327 [(set_attr "type" "binary,binary")
5328 (set_attr "length" "4,4")])
5330 (define_expand "subdi3"
5331 [(set (match_operand:DI 0 "register_operand" "")
5332 (minus:DI (match_operand:DI 1 "arith11_operand" "")
5333 (match_operand:DI 2 "reg_or_0_operand" "")))]
5338 [(set (match_operand:DI 0 "register_operand" "=r,r,!q")
5339 (minus:DI (match_operand:DI 1 "arith11_operand" "r,I,!U")
5340 (match_operand:DI 2 "reg_or_0_operand" "rM,rM,!rM")))]
5346 [(set_attr "type" "binary,binary,move")
5347 (set_attr "length" "4,4,4")])
5350 [(set (match_operand:DI 0 "register_operand" "=r,&r")
5351 (minus:DI (match_operand:DI 1 "arith11_operand" "r,I")
5352 (match_operand:DI 2 "reg_or_0_operand" "rM,rM")))]
5356 if (GET_CODE (operands[1]) == CONST_INT)
5358 if (INTVAL (operands[1]) >= 0)
5359 return \"subi %1,%R2,%R0\;{subb|sub,b} %%r0,%2,%0\";
5361 return \"ldi -1,%0\;subi %1,%R2,%R0\;{subb|sub,b} %0,%2,%0\";
5364 return \"sub %R1,%R2,%R0\;{subb|sub,b} %1,%2,%0\";
5366 [(set_attr "type" "binary")
5367 (set (attr "length")
5368 (if_then_else (eq_attr "alternative" "0")
5370 (if_then_else (ge (symbol_ref "INTVAL (operands[1])")
5375 (define_expand "subvdi3"
5376 [(parallel [(set (match_operand:DI 0 "register_operand" "")
5377 (minus:DI (match_operand:DI 1 "arith11_operand" "")
5378 (match_operand:DI 2 "reg_or_0_operand" "")))
5379 (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1))
5380 (sign_extend:TI (match_dup 2)))
5381 (sign_extend:TI (minus:DI (match_dup 1)
5388 operands[1] = force_reg (DImode, operands[1]);
5392 [(set (match_operand:DI 0 "register_operand" "=r")
5393 (minus:DI (match_operand:DI 1 "register_operand" "r")
5394 (match_operand:DI 2 "reg_or_0_operand" "rM")))
5395 (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1))
5396 (sign_extend:TI (match_dup 2)))
5397 (sign_extend:TI (minus:DI (match_dup 1)
5401 "sub,tsv,* %1,%2,%0"
5402 [(set_attr "type" "binary")
5403 (set_attr "length" "4")])
5406 [(set (match_operand:DI 0 "register_operand" "=r,&r")
5407 (minus:DI (match_operand:DI 1 "arith11_operand" "r,I")
5408 (match_operand:DI 2 "reg_or_0_operand" "rM,rM")))
5409 (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1))
5410 (sign_extend:TI (match_dup 2)))
5411 (sign_extend:TI (minus:DI (match_dup 1)
5417 if (GET_CODE (operands[1]) == CONST_INT)
5419 if (INTVAL (operands[1]) >= 0)
5420 return \"subi %1,%R2,%R0\;{subbo|sub,b,tsv} %%r0,%2,%0\";
5422 return \"ldi -1,%0\;subi %1,%R2,%R0\;{subbo|sub,b,tsv} %0,%2,%0\";
5425 return \"sub %R1,%R2,%R0\;{subbo|sub,b,tsv} %1,%2,%0\";
5427 [(set_attr "type" "binary,binary")
5428 (set (attr "length")
5429 (if_then_else (eq_attr "alternative" "0")
5431 (if_then_else (ge (symbol_ref "INTVAL (operands[1])")
5436 (define_expand "subsi3"
5437 [(set (match_operand:SI 0 "register_operand" "")
5438 (minus:SI (match_operand:SI 1 "arith11_operand" "")
5439 (match_operand:SI 2 "register_operand" "")))]
5444 [(set (match_operand:SI 0 "register_operand" "=r,r")
5445 (minus:SI (match_operand:SI 1 "arith11_operand" "r,I")
5446 (match_operand:SI 2 "register_operand" "r,r")))]
5451 [(set_attr "type" "binary,binary")
5452 (set_attr "length" "4,4")])
5455 [(set (match_operand:SI 0 "register_operand" "=r,r,!q")
5456 (minus:SI (match_operand:SI 1 "arith11_operand" "r,I,!S")
5457 (match_operand:SI 2 "register_operand" "r,r,!r")))]
5463 [(set_attr "type" "binary,binary,move")
5464 (set_attr "length" "4,4,4")])
5466 (define_insn "subvsi3"
5467 [(set (match_operand:SI 0 "register_operand" "=r,r")
5468 (minus:SI (match_operand:SI 1 "arith11_operand" "rM,I")
5469 (match_operand:SI 2 "reg_or_0_operand" "rM,rM")))
5470 (trap_if (ne (minus:DI (sign_extend:DI (match_dup 1))
5471 (sign_extend:DI (match_dup 2)))
5472 (sign_extend:DI (minus:SI (match_dup 1)
5477 {subo|sub,tsv} %1,%2,%0
5478 {subio|subi,tsv} %1,%2,%0"
5479 [(set_attr "type" "binary,binary")
5480 (set_attr "length" "4,4")])
5482 (define_insn "addti3"
5483 [(set (match_operand:TI 0 "register_operand" "=r")
5484 (plus:TI (match_operand:TI 1 "register_operand" "r")
5485 (match_operand:TI 2 "register_operand" "r")))]
5489 operands[3] = gen_lowpart (DImode, operands[0]);
5490 operands[4] = gen_lowpart (DImode, operands[1]);
5491 operands[5] = gen_lowpart (DImode, operands[2]);
5492 operands[0] = gen_highpart (DImode, operands[0]);
5493 operands[1] = gen_highpart (DImode, operands[1]);
5494 operands[2] = gen_highpart (DImode, operands[2]);
5495 return \"add %4,%5,%3\;add,dc %1,%2,%0\";
5497 [(set_attr "type" "multi")
5498 (set_attr "length" "8")])
5500 (define_insn "addvti3"
5501 [(set (match_operand:TI 0 "register_operand" "=r")
5502 (plus:TI (match_operand:TI 1 "register_operand" "r")
5503 (match_operand:TI 2 "register_operand" "r")))
5504 (trap_if (ne (plus:OI (sign_extend:OI (match_dup 1))
5505 (sign_extend:OI (match_dup 2)))
5506 (sign_extend:OI (plus:TI (match_dup 1)
5512 operands[3] = gen_lowpart (DImode, operands[0]);
5513 operands[4] = gen_lowpart (DImode, operands[1]);
5514 operands[5] = gen_lowpart (DImode, operands[2]);
5515 operands[0] = gen_highpart (DImode, operands[0]);
5516 operands[1] = gen_highpart (DImode, operands[1]);
5517 operands[2] = gen_highpart (DImode, operands[2]);
5518 return \"add %4,%5,%3\;add,dc,tsv %1,%2,%0\";
5520 [(set_attr "type" "multi")
5521 (set_attr "length" "8")])
5523 (define_insn "subti3"
5524 [(set (match_operand:TI 0 "register_operand" "=r")
5525 (minus:TI (match_operand:TI 1 "register_operand" "r")
5526 (match_operand:TI 2 "register_operand" "r")))]
5530 operands[3] = gen_lowpart (DImode, operands[0]);
5531 operands[4] = gen_lowpart (DImode, operands[1]);
5532 operands[5] = gen_lowpart (DImode, operands[2]);
5533 operands[0] = gen_highpart (DImode, operands[0]);
5534 operands[1] = gen_highpart (DImode, operands[1]);
5535 operands[2] = gen_highpart (DImode, operands[2]);
5536 return \"sub %4,%5,%3\;sub,db %1,%2,%0\";
5538 [(set_attr "type" "multi")
5539 (set_attr "length" "8")])
5541 (define_insn "subvti3"
5542 [(set (match_operand:TI 0 "register_operand" "=r")
5543 (minus:TI (match_operand:TI 1 "register_operand" "r")
5544 (match_operand:TI 2 "register_operand" "r")))
5545 (trap_if (ne (minus:OI (sign_extend:OI (match_dup 1))
5546 (sign_extend:OI (match_dup 2)))
5547 (sign_extend:OI (minus:TI (match_dup 1)
5553 operands[3] = gen_lowpart (DImode, operands[0]);
5554 operands[4] = gen_lowpart (DImode, operands[1]);
5555 operands[5] = gen_lowpart (DImode, operands[2]);
5556 operands[0] = gen_highpart (DImode, operands[0]);
5557 operands[1] = gen_highpart (DImode, operands[1]);
5558 operands[2] = gen_highpart (DImode, operands[2]);
5559 return \"sub %4,%5,%3\;sub,db,tsv %1,%2,%0\";
5561 [(set_attr "type" "multi")
5562 (set_attr "length" "8")])
5564 ;; Trap instructions.
5567 [(trap_if (const_int 1) (const_int 0))]
5569 "{addit|addi,tc},<> 1,%%r0,%%r0"
5570 [(set_attr "type" "trap")
5571 (set_attr "length" "4")])
5573 ;; Clobbering a "register_operand" instead of a match_scratch
5574 ;; in operand3 of millicode calls avoids spilling %r1 and
5575 ;; produces better code.
5577 ;; The mulsi3 insns set up registers for the millicode call.
5578 (define_expand "mulsi3"
5579 [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
5580 (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
5581 (parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
5582 (clobber (match_dup 3))
5583 (clobber (reg:SI 26))
5584 (clobber (reg:SI 25))
5585 (clobber (match_dup 4))])
5586 (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))]
5590 operands[4] = gen_rtx_REG (SImode, TARGET_64BIT ? 2 : 31);
5591 if (TARGET_PA_11 && !TARGET_SOFT_FLOAT && !TARGET_SOFT_MULT)
5593 rtx scratch = gen_reg_rtx (DImode);
5594 operands[1] = force_reg (SImode, operands[1]);
5595 operands[2] = force_reg (SImode, operands[2]);
5596 emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2]));
5597 emit_insn (gen_movsi (operands[0],
5598 gen_rtx_SUBREG (SImode, scratch,
5599 GET_MODE_SIZE (SImode))));
5602 operands[3] = gen_reg_rtx (SImode);
5605 (define_insn "umulsidi3"
5606 [(set (match_operand:DI 0 "register_operand" "=f")
5607 (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "f"))
5608 (zero_extend:DI (match_operand:SI 2 "register_operand" "f"))))]
5609 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT && ! TARGET_SOFT_MULT"
5611 [(set_attr "type" "fpmuldbl")
5612 (set_attr "length" "4")])
5615 [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
5616 (clobber (match_operand:SI 0 "register_operand" "=a"))
5617 (clobber (reg:SI 26))
5618 (clobber (reg:SI 25))
5619 (clobber (reg:SI 31))]
5621 "* return pa_output_mul_insn (0, insn);"
5622 [(set_attr "type" "milli")
5623 (set (attr "length")
5624 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5625 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5628 [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
5629 (clobber (match_operand:SI 0 "register_operand" "=a"))
5630 (clobber (reg:SI 26))
5631 (clobber (reg:SI 25))
5632 (clobber (reg:SI 2))]
5634 "* return pa_output_mul_insn (0, insn);"
5635 [(set_attr "type" "milli")
5636 (set (attr "length")
5637 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5638 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5640 (define_expand "muldi3"
5641 [(set (match_operand:DI 0 "register_operand" "")
5642 (mult:DI (match_operand:DI 1 "register_operand" "")
5643 (match_operand:DI 2 "register_operand" "")))]
5646 && ! TARGET_SOFT_FLOAT
5647 && ! TARGET_SOFT_MULT"
5650 rtx low_product = gen_reg_rtx (DImode);
5651 rtx cross_product1 = gen_reg_rtx (DImode);
5652 rtx cross_product2 = gen_reg_rtx (DImode);
5653 rtx op1l, op1r, op2l, op2r;
5657 rtx op1shifted = gen_reg_rtx (DImode);
5658 rtx op2shifted = gen_reg_rtx (DImode);
5660 emit_move_insn (op1shifted, gen_rtx_LSHIFTRT (DImode, operands[1],
5662 emit_move_insn (op2shifted, gen_rtx_LSHIFTRT (DImode, operands[2],
5664 op1r = force_reg (SImode, gen_rtx_SUBREG (SImode, operands[1], 4));
5665 op2r = force_reg (SImode, gen_rtx_SUBREG (SImode, operands[2], 4));
5666 op1l = force_reg (SImode, gen_rtx_SUBREG (SImode, op1shifted, 4));
5667 op2l = force_reg (SImode, gen_rtx_SUBREG (SImode, op2shifted, 4));
5671 op1r = force_reg (SImode, gen_lowpart (SImode, operands[1]));
5672 op2r = force_reg (SImode, gen_lowpart (SImode, operands[2]));
5673 op1l = force_reg (SImode, gen_highpart (SImode, operands[1]));
5674 op2l = force_reg (SImode, gen_highpart (SImode, operands[2]));
5677 /* Emit multiplies for the cross products. */
5678 emit_insn (gen_umulsidi3 (cross_product1, op2r, op1l));
5679 emit_insn (gen_umulsidi3 (cross_product2, op2l, op1r));
5681 /* Emit a multiply for the low sub-word. */
5682 emit_insn (gen_umulsidi3 (low_product, copy_rtx (op2r), copy_rtx (op1r)));
5686 rtx cross_scratch = gen_reg_rtx (DImode);
5687 rtx cross_product = gen_reg_rtx (DImode);
5689 /* Sum the cross products and shift them into proper position. */
5690 emit_insn (gen_adddi3 (cross_scratch, cross_product1, cross_product2));
5691 emit_insn (gen_ashldi3 (cross_product, cross_scratch, GEN_INT (32)));
5693 /* Add the cross product to the low product and store the result
5694 into the output operand . */
5695 emit_insn (gen_adddi3 (operands[0], cross_product, low_product));
5699 rtx cross_scratch = gen_reg_rtx (SImode);
5701 /* Sum cross products. */
5702 emit_move_insn (cross_scratch,
5703 gen_rtx_PLUS (SImode,
5704 gen_lowpart (SImode, cross_product1),
5705 gen_lowpart (SImode, cross_product2)));
5706 emit_move_insn (gen_lowpart (SImode, operands[0]),
5707 gen_lowpart (SImode, low_product));
5708 emit_move_insn (gen_highpart (SImode, operands[0]),
5709 gen_rtx_PLUS (SImode,
5710 gen_highpart (SImode, low_product),
5716 ;;; Division and mod.
5717 (define_expand "divsi3"
5718 [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
5719 (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
5720 (parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25)))
5721 (clobber (match_dup 3))
5722 (clobber (match_dup 4))
5723 (clobber (reg:SI 26))
5724 (clobber (reg:SI 25))
5725 (clobber (match_dup 5))])
5726 (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))]
5730 operands[3] = gen_reg_rtx (SImode);
5733 operands[5] = gen_rtx_REG (SImode, 2);
5734 operands[4] = operands[5];
5738 operands[5] = gen_rtx_REG (SImode, 31);
5739 operands[4] = gen_reg_rtx (SImode);
5741 if (GET_CODE (operands[2]) == CONST_INT && pa_emit_hpdiv_const (operands, 0))
5747 (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
5748 (clobber (match_operand:SI 1 "register_operand" "=a"))
5749 (clobber (match_operand:SI 2 "register_operand" "=&r"))
5750 (clobber (reg:SI 26))
5751 (clobber (reg:SI 25))
5752 (clobber (reg:SI 31))]
5755 return pa_output_div_insn (operands, 0, insn);"
5756 [(set_attr "type" "milli")
5757 (set (attr "length")
5758 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5759 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5763 (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
5764 (clobber (match_operand:SI 1 "register_operand" "=a"))
5765 (clobber (match_operand:SI 2 "register_operand" "=&r"))
5766 (clobber (reg:SI 26))
5767 (clobber (reg:SI 25))
5768 (clobber (reg:SI 2))]
5771 return pa_output_div_insn (operands, 0, insn);"
5772 [(set_attr "type" "milli")
5773 (set (attr "length")
5774 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5775 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5777 (define_expand "udivsi3"
5778 [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
5779 (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
5780 (parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25)))
5781 (clobber (match_dup 3))
5782 (clobber (match_dup 4))
5783 (clobber (reg:SI 26))
5784 (clobber (reg:SI 25))
5785 (clobber (match_dup 5))])
5786 (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))]
5790 operands[3] = gen_reg_rtx (SImode);
5794 operands[5] = gen_rtx_REG (SImode, 2);
5795 operands[4] = operands[5];
5799 operands[5] = gen_rtx_REG (SImode, 31);
5800 operands[4] = gen_reg_rtx (SImode);
5802 if (GET_CODE (operands[2]) == CONST_INT && pa_emit_hpdiv_const (operands, 1))
5808 (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
5809 (clobber (match_operand:SI 1 "register_operand" "=a"))
5810 (clobber (match_operand:SI 2 "register_operand" "=&r"))
5811 (clobber (reg:SI 26))
5812 (clobber (reg:SI 25))
5813 (clobber (reg:SI 31))]
5816 return pa_output_div_insn (operands, 1, insn);"
5817 [(set_attr "type" "milli")
5818 (set (attr "length")
5819 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5820 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5824 (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
5825 (clobber (match_operand:SI 1 "register_operand" "=a"))
5826 (clobber (match_operand:SI 2 "register_operand" "=&r"))
5827 (clobber (reg:SI 26))
5828 (clobber (reg:SI 25))
5829 (clobber (reg:SI 2))]
5832 return pa_output_div_insn (operands, 1, insn);"
5833 [(set_attr "type" "milli")
5834 (set (attr "length")
5835 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5836 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5838 (define_expand "modsi3"
5839 [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
5840 (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
5841 (parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
5842 (clobber (match_dup 3))
5843 (clobber (match_dup 4))
5844 (clobber (reg:SI 26))
5845 (clobber (reg:SI 25))
5846 (clobber (match_dup 5))])
5847 (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))]
5853 operands[5] = gen_rtx_REG (SImode, 2);
5854 operands[4] = operands[5];
5858 operands[5] = gen_rtx_REG (SImode, 31);
5859 operands[4] = gen_reg_rtx (SImode);
5861 operands[3] = gen_reg_rtx (SImode);
5865 [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
5866 (clobber (match_operand:SI 0 "register_operand" "=a"))
5867 (clobber (match_operand:SI 1 "register_operand" "=&r"))
5868 (clobber (reg:SI 26))
5869 (clobber (reg:SI 25))
5870 (clobber (reg:SI 31))]
5873 return pa_output_mod_insn (0, insn);"
5874 [(set_attr "type" "milli")
5875 (set (attr "length")
5876 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5877 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5880 [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
5881 (clobber (match_operand:SI 0 "register_operand" "=a"))
5882 (clobber (match_operand:SI 1 "register_operand" "=&r"))
5883 (clobber (reg:SI 26))
5884 (clobber (reg:SI 25))
5885 (clobber (reg:SI 2))]
5888 return pa_output_mod_insn (0, insn);"
5889 [(set_attr "type" "milli")
5890 (set (attr "length")
5891 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5892 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5894 (define_expand "umodsi3"
5895 [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
5896 (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
5897 (parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
5898 (clobber (match_dup 3))
5899 (clobber (match_dup 4))
5900 (clobber (reg:SI 26))
5901 (clobber (reg:SI 25))
5902 (clobber (match_dup 5))])
5903 (set (match_operand:SI 0 "move_dest_operand" "") (reg:SI 29))]
5909 operands[5] = gen_rtx_REG (SImode, 2);
5910 operands[4] = operands[5];
5914 operands[5] = gen_rtx_REG (SImode, 31);
5915 operands[4] = gen_reg_rtx (SImode);
5917 operands[3] = gen_reg_rtx (SImode);
5921 [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
5922 (clobber (match_operand:SI 0 "register_operand" "=a"))
5923 (clobber (match_operand:SI 1 "register_operand" "=&r"))
5924 (clobber (reg:SI 26))
5925 (clobber (reg:SI 25))
5926 (clobber (reg:SI 31))]
5929 return pa_output_mod_insn (1, insn);"
5930 [(set_attr "type" "milli")
5931 (set (attr "length")
5932 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5933 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5936 [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
5937 (clobber (match_operand:SI 0 "register_operand" "=a"))
5938 (clobber (match_operand:SI 1 "register_operand" "=&r"))
5939 (clobber (reg:SI 26))
5940 (clobber (reg:SI 25))
5941 (clobber (reg:SI 2))]
5944 return pa_output_mod_insn (1, insn);"
5945 [(set_attr "type" "milli")
5946 (set (attr "length")
5947 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
5948 (symbol_ref "pa_attr_length_millicode_call (insn)")))])
5950 ;;- and instructions
5951 ;; We define DImode `and` so with DImode `not` we can get
5952 ;; DImode `andn`. Other combinations are possible.
5954 (define_expand "anddi3"
5955 [(set (match_operand:DI 0 "register_operand" "")
5956 (and:DI (match_operand:DI 1 "register_operand" "")
5957 (match_operand:DI 2 "and_operand" "")))]
5962 [(set (match_operand:DI 0 "register_operand" "=r,r")
5963 (and:DI (match_operand:DI 1 "register_operand" "%?r,0")
5964 (match_operand:DI 2 "and_operand" "rO,P")))]
5966 "* return pa_output_64bit_and (operands); "
5967 [(set_attr "type" "binary")
5968 (set_attr "length" "4")])
5970 ; The ? for op1 makes reload prefer zdepi instead of loading a huge
5971 ; constant with ldil;ldo.
5972 (define_insn "andsi3"
5973 [(set (match_operand:SI 0 "register_operand" "=r,r")
5974 (and:SI (match_operand:SI 1 "register_operand" "%?r,0")
5975 (match_operand:SI 2 "and_operand" "rO,P")))]
5977 "* return pa_output_and (operands); "
5978 [(set_attr "type" "binary,shift")
5979 (set_attr "length" "4,4")])
5982 [(set (match_operand:DI 0 "register_operand" "=r")
5983 (and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
5984 (match_operand:DI 2 "register_operand" "r")))]
5987 [(set_attr "type" "binary")
5988 (set_attr "length" "4")])
5991 [(set (match_operand:SI 0 "register_operand" "=r")
5992 (and:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
5993 (match_operand:SI 2 "register_operand" "r")))]
5996 [(set_attr "type" "binary")
5997 (set_attr "length" "4")])
5999 (define_expand "iordi3"
6000 [(set (match_operand:DI 0 "register_operand" "")
6001 (ior:DI (match_operand:DI 1 "register_operand" "")
6002 (match_operand:DI 2 "reg_or_cint_ior_operand" "")))]
6007 [(set (match_operand:DI 0 "register_operand" "=r,r")
6008 (ior:DI (match_operand:DI 1 "register_operand" "0,0")
6009 (match_operand:DI 2 "cint_ior_operand" "M,i")))]
6011 "* return pa_output_64bit_ior (operands); "
6012 [(set_attr "type" "binary,shift")
6013 (set_attr "length" "4,4")])
6016 [(set (match_operand:DI 0 "register_operand" "=r")
6017 (ior:DI (match_operand:DI 1 "register_operand" "%r")
6018 (match_operand:DI 2 "register_operand" "r")))]
6021 [(set_attr "type" "binary")
6022 (set_attr "length" "4")])
6024 ;; Need a define_expand because we've run out of CONST_OK... characters.
6025 (define_expand "iorsi3"
6026 [(set (match_operand:SI 0 "register_operand" "")
6027 (ior:SI (match_operand:SI 1 "register_operand" "")
6028 (match_operand:SI 2 "reg_or_cint_ior_operand" "")))]
6033 [(set (match_operand:SI 0 "register_operand" "=r,r")
6034 (ior:SI (match_operand:SI 1 "register_operand" "0,0")
6035 (match_operand:SI 2 "cint_ior_operand" "M,i")))]
6037 "* return pa_output_ior (operands); "
6038 [(set_attr "type" "binary,shift")
6039 (set_attr "length" "4,4")])
6042 [(set (match_operand:SI 0 "register_operand" "=r")
6043 (ior:SI (match_operand:SI 1 "register_operand" "%r")
6044 (match_operand:SI 2 "register_operand" "r")))]
6047 [(set_attr "type" "binary")
6048 (set_attr "length" "4")])
6050 (define_expand "xordi3"
6051 [(set (match_operand:DI 0 "register_operand" "")
6052 (xor:DI (match_operand:DI 1 "register_operand" "")
6053 (match_operand:DI 2 "register_operand" "")))]
6058 [(set (match_operand:DI 0 "register_operand" "=r")
6059 (xor:DI (match_operand:DI 1 "register_operand" "%r")
6060 (match_operand:DI 2 "register_operand" "r")))]
6063 [(set_attr "type" "binary")
6064 (set_attr "length" "4")])
6066 (define_insn "xorsi3"
6067 [(set (match_operand:SI 0 "register_operand" "=r")
6068 (xor:SI (match_operand:SI 1 "register_operand" "%r")
6069 (match_operand:SI 2 "register_operand" "r")))]
6072 [(set_attr "type" "binary")
6073 (set_attr "length" "4")])
6075 (define_expand "negdi2"
6076 [(set (match_operand:DI 0 "register_operand" "")
6077 (neg:DI (match_operand:DI 1 "register_operand" "")))]
6082 [(set (match_operand:DI 0 "register_operand" "=r")
6083 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
6085 "sub %%r0,%R1,%R0\;{subb|sub,b} %%r0,%1,%0"
6086 [(set_attr "type" "multi")
6087 (set_attr "length" "8")])
6090 [(set (match_operand:DI 0 "register_operand" "=r")
6091 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
6094 [(set_attr "type" "unary")
6095 (set_attr "length" "4")])
6097 (define_insn "negti2"
6098 [(set (match_operand:TI 0 "register_operand" "=r")
6099 (neg:TI (match_operand:TI 1 "register_operand" "r")))]
6103 operands[2] = gen_lowpart (DImode, operands[0]);
6104 operands[3] = gen_lowpart (DImode, operands[1]);
6105 operands[0] = gen_highpart (DImode, operands[0]);
6106 operands[1] = gen_highpart (DImode, operands[1]);
6107 return \"sub %%r0,%3,%2\;sub,db %%r0,%1,%0\";
6109 [(set_attr "type" "multi")
6110 (set_attr "length" "8")])
6112 (define_expand "negvdi2"
6113 [(parallel [(set (match_operand:DI 0 "register_operand" "")
6114 (neg:DI (match_operand:DI 1 "register_operand" "")))
6115 (trap_if (ne (neg:TI (sign_extend:TI (match_dup 1)))
6116 (sign_extend:TI (neg:DI (match_dup 1))))
6122 [(set (match_operand:DI 0 "register_operand" "=r")
6123 (neg:DI (match_operand:DI 1 "register_operand" "r")))
6124 (trap_if (ne (neg:TI (sign_extend:TI (match_dup 1)))
6125 (sign_extend:TI (neg:DI (match_dup 1))))
6128 "sub %%r0,%R1,%R0\;{subbo|sub,b,tsv} %%r0,%1,%0"
6129 [(set_attr "type" "multi")
6130 (set_attr "length" "8")])
6133 [(set (match_operand:DI 0 "register_operand" "=r")
6134 (neg:DI (match_operand:DI 1 "register_operand" "r")))
6135 (trap_if (ne (neg:TI (sign_extend:TI (match_dup 1)))
6136 (sign_extend:TI (neg:DI (match_dup 1))))
6139 "sub,tsv %%r0,%1,%0"
6140 [(set_attr "type" "unary")
6141 (set_attr "length" "4")])
6143 (define_insn "negvti2"
6144 [(set (match_operand:TI 0 "register_operand" "=r")
6145 (neg:TI (match_operand:TI 1 "register_operand" "r")))
6146 (trap_if (ne (neg:OI (sign_extend:OI (match_dup 1)))
6147 (sign_extend:OI (neg:TI (match_dup 1))))
6152 operands[2] = gen_lowpart (DImode, operands[0]);
6153 operands[3] = gen_lowpart (DImode, operands[1]);
6154 operands[0] = gen_highpart (DImode, operands[0]);
6155 operands[1] = gen_highpart (DImode, operands[1]);
6156 return \"sub %%r0,%3,%2\;sub,db,tsv %%r0,%1,%0\";
6158 [(set_attr "type" "multi")
6159 (set_attr "length" "8")])
6161 (define_insn "negsi2"
6162 [(set (match_operand:SI 0 "register_operand" "=r")
6163 (neg:SI (match_operand:SI 1 "register_operand" "r")))]
6166 [(set_attr "type" "unary")
6167 (set_attr "length" "4")])
6169 (define_insn "negvsi2"
6170 [(set (match_operand:SI 0 "register_operand" "=r")
6171 (neg:SI (match_operand:SI 1 "register_operand" "r")))
6172 (trap_if (ne (neg:DI (sign_extend:DI (match_dup 1)))
6173 (sign_extend:DI (neg:SI (match_dup 1))))
6176 "{subo|sub,tsv} %%r0,%1,%0"
6177 [(set_attr "type" "unary")
6178 (set_attr "length" "4")])
6180 (define_expand "one_cmpldi2"
6181 [(set (match_operand:DI 0 "register_operand" "")
6182 (not:DI (match_operand:DI 1 "register_operand" "")))]
6189 [(set (match_operand:DI 0 "register_operand" "=r")
6190 (not:DI (match_operand:DI 1 "register_operand" "r")))]
6192 "uaddcm %%r0,%1,%0\;uaddcm %%r0,%R1,%R0"
6193 [(set_attr "type" "unary")
6194 (set_attr "length" "8")])
6197 [(set (match_operand:DI 0 "register_operand" "=r")
6198 (not:DI (match_operand:DI 1 "register_operand" "r")))]
6201 [(set_attr "type" "unary")
6202 (set_attr "length" "4")])
6204 (define_insn "one_cmplsi2"
6205 [(set (match_operand:SI 0 "register_operand" "=r")
6206 (not:SI (match_operand:SI 1 "register_operand" "r")))]
6209 [(set_attr "type" "unary")
6210 (set_attr "length" "4")])
6212 ;; Floating point arithmetic instructions.
6214 (define_insn "adddf3"
6215 [(set (match_operand:DF 0 "register_operand" "=f")
6216 (plus:DF (match_operand:DF 1 "register_operand" "f")
6217 (match_operand:DF 2 "register_operand" "f")))]
6218 "! TARGET_SOFT_FLOAT"
6220 [(set_attr "type" "fpalu")
6221 (set_attr "pa_combine_type" "faddsub")
6222 (set_attr "length" "4")])
6224 (define_insn "addsf3"
6225 [(set (match_operand:SF 0 "register_operand" "=f")
6226 (plus:SF (match_operand:SF 1 "register_operand" "f")
6227 (match_operand:SF 2 "register_operand" "f")))]
6228 "! TARGET_SOFT_FLOAT"
6230 [(set_attr "type" "fpalu")
6231 (set_attr "pa_combine_type" "faddsub")
6232 (set_attr "length" "4")])
6234 (define_insn "subdf3"
6235 [(set (match_operand:DF 0 "register_operand" "=f")
6236 (minus:DF (match_operand:DF 1 "register_operand" "f")
6237 (match_operand:DF 2 "register_operand" "f")))]
6238 "! TARGET_SOFT_FLOAT"
6240 [(set_attr "type" "fpalu")
6241 (set_attr "pa_combine_type" "faddsub")
6242 (set_attr "length" "4")])
6244 (define_insn "subsf3"
6245 [(set (match_operand:SF 0 "register_operand" "=f")
6246 (minus:SF (match_operand:SF 1 "register_operand" "f")
6247 (match_operand:SF 2 "register_operand" "f")))]
6248 "! TARGET_SOFT_FLOAT"
6250 [(set_attr "type" "fpalu")
6251 (set_attr "pa_combine_type" "faddsub")
6252 (set_attr "length" "4")])
6254 (define_insn "muldf3"
6255 [(set (match_operand:DF 0 "register_operand" "=f")
6256 (mult:DF (match_operand:DF 1 "register_operand" "f")
6257 (match_operand:DF 2 "register_operand" "f")))]
6258 "! TARGET_SOFT_FLOAT"
6260 [(set_attr "type" "fpmuldbl")
6261 (set_attr "pa_combine_type" "fmpy")
6262 (set_attr "length" "4")])
6264 (define_insn "mulsf3"
6265 [(set (match_operand:SF 0 "register_operand" "=f")
6266 (mult:SF (match_operand:SF 1 "register_operand" "f")
6267 (match_operand:SF 2 "register_operand" "f")))]
6268 "! TARGET_SOFT_FLOAT"
6270 [(set_attr "type" "fpmulsgl")
6271 (set_attr "pa_combine_type" "fmpy")
6272 (set_attr "length" "4")])
6274 (define_insn "divdf3"
6275 [(set (match_operand:DF 0 "register_operand" "=f")
6276 (div:DF (match_operand:DF 1 "register_operand" "f")
6277 (match_operand:DF 2 "register_operand" "f")))]
6278 "! TARGET_SOFT_FLOAT"
6280 [(set_attr "type" "fpdivdbl")
6281 (set_attr "length" "4")])
6283 (define_insn "divsf3"
6284 [(set (match_operand:SF 0 "register_operand" "=f")
6285 (div:SF (match_operand:SF 1 "register_operand" "f")
6286 (match_operand:SF 2 "register_operand" "f")))]
6287 "! TARGET_SOFT_FLOAT"
6289 [(set_attr "type" "fpdivsgl")
6290 (set_attr "length" "4")])
6292 ;; Processors prior to PA 2.0 don't have a fneg instruction. Fast
6293 ;; negation can be done by subtracting from plus zero. However, this
6294 ;; violates the IEEE standard when negating plus and minus zero.
6295 ;; The slow path toggles the sign bit in the general registers.
6296 (define_expand "negdf2"
6297 [(set (match_operand:DF 0 "register_operand" "")
6298 (neg:DF (match_operand:DF 1 "register_operand" "")))]
6299 "!TARGET_SOFT_FLOAT"
6301 if (TARGET_PA_20 || !flag_signed_zeros)
6302 emit_insn (gen_negdf2_fast (operands[0], operands[1]));
6304 emit_insn (gen_negdf2_slow (operands[0], operands[1]));
6308 (define_insn "negdf2_slow"
6309 [(set (match_operand:DF 0 "register_operand" "=r")
6310 (neg:DF (match_operand:DF 1 "register_operand" "r")))]
6311 "!TARGET_SOFT_FLOAT && !TARGET_PA_20"
6314 if (rtx_equal_p (operands[0], operands[1]))
6315 return \"and,< %1,%1,%0\;depi,tr 1,0,1,%0\;depi 0,0,1,%0\";
6317 return \"and,< %1,%1,%0\;depi,tr 1,0,1,%0\;depi 0,0,1,%0\;copy %R1,%R0\";
6319 [(set_attr "type" "multi")
6320 (set (attr "length")
6321 (if_then_else (match_test "rtx_equal_p (operands[0], operands[1])")
6325 (define_insn "negdf2_fast"
6326 [(set (match_operand:DF 0 "register_operand" "=f")
6327 (neg:DF (match_operand:DF 1 "register_operand" "f")))]
6328 "!TARGET_SOFT_FLOAT"
6332 return \"fneg,dbl %1,%0\";
6334 return \"fsub,dbl %%fr0,%1,%0\";
6336 [(set_attr "type" "fpalu")
6337 (set_attr "length" "4")])
6339 (define_expand "negsf2"
6340 [(set (match_operand:SF 0 "register_operand" "")
6341 (neg:SF (match_operand:SF 1 "register_operand" "")))]
6342 "!TARGET_SOFT_FLOAT"
6344 if (TARGET_PA_20 || !flag_signed_zeros)
6345 emit_insn (gen_negsf2_fast (operands[0], operands[1]));
6347 emit_insn (gen_negsf2_slow (operands[0], operands[1]));
6351 (define_insn "negsf2_slow"
6352 [(set (match_operand:SF 0 "register_operand" "=r")
6353 (neg:SF (match_operand:SF 1 "register_operand" "r")))]
6354 "!TARGET_SOFT_FLOAT && !TARGET_PA_20"
6355 "and,< %1,%1,%0\;depi,tr 1,0,1,%0\;depi 0,0,1,%0"
6356 [(set_attr "type" "multi")
6357 (set_attr "length" "12")])
6359 (define_insn "negsf2_fast"
6360 [(set (match_operand:SF 0 "register_operand" "=f")
6361 (neg:SF (match_operand:SF 1 "register_operand" "f")))]
6362 "!TARGET_SOFT_FLOAT"
6366 return \"fneg,sgl %1,%0\";
6368 return \"fsub,sgl %%fr0,%1,%0\";
6370 [(set_attr "type" "fpalu")
6371 (set_attr "length" "4")])
6373 (define_insn "absdf2"
6374 [(set (match_operand:DF 0 "register_operand" "=f")
6375 (abs:DF (match_operand:DF 1 "register_operand" "f")))]
6376 "! TARGET_SOFT_FLOAT"
6378 [(set_attr "type" "fpalu")
6379 (set_attr "length" "4")])
6381 (define_insn "abssf2"
6382 [(set (match_operand:SF 0 "register_operand" "=f")
6383 (abs:SF (match_operand:SF 1 "register_operand" "f")))]
6384 "! TARGET_SOFT_FLOAT"
6386 [(set_attr "type" "fpalu")
6387 (set_attr "length" "4")])
6389 (define_insn "sqrtdf2"
6390 [(set (match_operand:DF 0 "register_operand" "=f")
6391 (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
6392 "! TARGET_SOFT_FLOAT"
6394 [(set_attr "type" "fpsqrtdbl")
6395 (set_attr "length" "4")])
6397 (define_insn "sqrtsf2"
6398 [(set (match_operand:SF 0 "register_operand" "=f")
6399 (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
6400 "! TARGET_SOFT_FLOAT"
6402 [(set_attr "type" "fpsqrtsgl")
6403 (set_attr "length" "4")])
6405 ;; PA 2.0 floating point instructions
6408 (define_insn "fmadf4"
6409 [(set (match_operand:DF 0 "register_operand" "=f")
6410 (fma:DF (match_operand:DF 1 "register_operand" "f")
6411 (match_operand:DF 2 "register_operand" "f")
6412 (match_operand:DF 3 "register_operand" "f")))]
6413 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6414 "fmpyfadd,dbl %1,%2,%3,%0"
6415 [(set_attr "type" "fpmuldbl")
6416 (set_attr "length" "4")])
6418 (define_insn "fmasf4"
6419 [(set (match_operand:SF 0 "register_operand" "=f")
6420 (fma:SF (match_operand:SF 1 "register_operand" "f")
6421 (match_operand:SF 2 "register_operand" "f")
6422 (match_operand:SF 3 "register_operand" "f")))]
6423 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6424 "fmpyfadd,sgl %1,%2,%3,%0"
6425 [(set_attr "type" "fpmulsgl")
6426 (set_attr "length" "4")])
6428 ; fmpynfadd patterns
6429 (define_insn "fnmadf4"
6430 [(set (match_operand:DF 0 "register_operand" "=f")
6431 (fma:DF (neg:DF (match_operand:DF 1 "register_operand" "f"))
6432 (match_operand:DF 2 "register_operand" "f")
6433 (match_operand:DF 3 "register_operand" "f")))]
6434 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6435 "fmpynfadd,dbl %1,%2,%3,%0"
6436 [(set_attr "type" "fpmuldbl")
6437 (set_attr "length" "4")])
6439 (define_insn "fnmasf4"
6440 [(set (match_operand:SF 0 "register_operand" "=f")
6441 (fma:SF (neg:SF (match_operand:SF 1 "register_operand" "f"))
6442 (match_operand:SF 2 "register_operand" "f")
6443 (match_operand:SF 3 "register_operand" "f")))]
6444 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6445 "fmpynfadd,sgl %1,%2,%3,%0"
6446 [(set_attr "type" "fpmulsgl")
6447 (set_attr "length" "4")])
6451 [(set (match_operand:DF 0 "register_operand" "=f")
6452 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))]
6453 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6455 [(set_attr "type" "fpalu")
6456 (set_attr "length" "4")])
6459 [(set (match_operand:SF 0 "register_operand" "=f")
6460 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))]
6461 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
6463 [(set_attr "type" "fpalu")
6464 (set_attr "length" "4")])
6467 [(set (match_operand:DF 0 "register_operand" "=f")
6468 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
6469 (set (match_operand:DF 2 "register_operand" "=&f") (abs:DF (match_dup 1)))]
6470 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
6471 && ! reg_overlap_mentioned_p (operands[2], operands[1]))"
6473 [(set_attr "type" "fpalu")
6474 (set_attr "length" "8")])
6477 [(set (match_operand:DF 0 "register_operand" "")
6478 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" ""))))
6479 (set (match_operand:DF 2 "register_operand" "") (abs:DF (match_dup 1)))]
6480 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
6481 [(set (match_dup 2) (abs:DF (match_dup 1)))
6482 (set (match_dup 0) (neg:DF (abs:DF (match_dup 1))))]
6486 [(set (match_operand:SF 0 "register_operand" "=f")
6487 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
6488 (set (match_operand:SF 2 "register_operand" "=&f") (abs:SF (match_dup 1)))]
6489 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
6490 && ! reg_overlap_mentioned_p (operands[2], operands[1]))"
6492 [(set_attr "type" "fpalu")
6493 (set_attr "length" "8")])
6496 [(set (match_operand:SF 0 "register_operand" "")
6497 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" ""))))
6498 (set (match_operand:SF 2 "register_operand" "") (abs:SF (match_dup 1)))]
6499 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
6500 [(set (match_dup 2) (abs:SF (match_dup 1)))
6501 (set (match_dup 0) (neg:SF (abs:SF (match_dup 1))))]
6504 ;; Negating a multiply can be faked by adding zero in a fused multiply-add
6505 ;; instruction if we can ignore the sign of zero.
6507 [(set (match_operand:DF 0 "register_operand" "=f")
6508 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
6509 (match_operand:DF 2 "register_operand" "f"))))]
6510 "!TARGET_SOFT_FLOAT && TARGET_PA_20 && !flag_signed_zeros"
6511 "fmpynfadd,dbl %1,%2,%%fr0,%0"
6512 [(set_attr "type" "fpmuldbl")
6513 (set_attr "length" "4")])
6516 [(set (match_operand:SF 0 "register_operand" "=f")
6517 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
6518 (match_operand:SF 2 "register_operand" "f"))))]
6519 "!TARGET_SOFT_FLOAT && TARGET_PA_20 && !flag_signed_zeros"
6520 "fmpynfadd,sgl %1,%2,%%fr0,%0"
6521 [(set_attr "type" "fpmuldbl")
6522 (set_attr "length" "4")])
6525 [(set (match_operand:DF 0 "register_operand" "=f")
6526 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
6527 (match_operand:DF 2 "register_operand" "f"))))
6528 (set (match_operand:DF 3 "register_operand" "=&f")
6529 (mult:DF (match_dup 1) (match_dup 2)))]
6530 "(!TARGET_SOFT_FLOAT && TARGET_PA_20 && !flag_signed_zeros
6531 && ! (reg_overlap_mentioned_p (operands[3], operands[1])
6532 || reg_overlap_mentioned_p (operands[3], operands[2])))"
6534 [(set_attr "type" "fpmuldbl")
6535 (set_attr "length" "8")])
6538 [(set (match_operand:DF 0 "register_operand" "")
6539 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "")
6540 (match_operand:DF 2 "register_operand" ""))))
6541 (set (match_operand:DF 3 "register_operand" "")
6542 (mult:DF (match_dup 1) (match_dup 2)))]
6543 "!TARGET_SOFT_FLOAT && TARGET_PA_20 && !flag_signed_zeros"
6544 [(set (match_dup 3) (mult:DF (match_dup 1) (match_dup 2)))
6545 (set (match_dup 0) (neg:DF (mult:DF (match_dup 1) (match_dup 2))))]
6549 [(set (match_operand:SF 0 "register_operand" "=f")
6550 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
6551 (match_operand:SF 2 "register_operand" "f"))))
6552 (set (match_operand:SF 3 "register_operand" "=&f")
6553 (mult:SF (match_dup 1) (match_dup 2)))]
6554 "(!TARGET_SOFT_FLOAT && TARGET_PA_20 && !flag_signed_zeros
6555 && ! (reg_overlap_mentioned_p (operands[3], operands[1])
6556 || reg_overlap_mentioned_p (operands[3], operands[2])))"
6558 [(set_attr "type" "fpmuldbl")
6559 (set_attr "length" "8")])
6562 [(set (match_operand:SF 0 "register_operand" "")
6563 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "")
6564 (match_operand:SF 2 "register_operand" ""))))
6565 (set (match_operand:SF 3 "register_operand" "")
6566 (mult:SF (match_dup 1) (match_dup 2)))]
6567 "!TARGET_SOFT_FLOAT && TARGET_PA_20&& !flag_signed_zeros"
6568 [(set (match_dup 3) (mult:SF (match_dup 1) (match_dup 2)))
6569 (set (match_dup 0) (neg:SF (mult:SF (match_dup 1) (match_dup 2))))]
6572 ;;- Shift instructions
6574 ;; Optimized special case of shifting.
6577 [(set (match_operand:SI 0 "register_operand" "=r")
6578 (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
6582 [(set_attr "type" "load")
6583 (set_attr "length" "4")])
6586 [(set (match_operand:SI 0 "register_operand" "=r")
6587 (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
6591 [(set_attr "type" "load")
6592 (set_attr "length" "4")])
6595 [(set (match_operand:SI 0 "register_operand" "=r")
6596 (plus:SI (ashift:SI (match_operand:SI 2 "register_operand" "r")
6597 (match_operand:SI 3 "shadd_operand" ""))
6598 (match_operand:SI 1 "register_operand" "r")))]
6600 "{sh%o3addl %2,%1,%0|shladd,l %2,%o3,%1,%0} "
6601 [(set_attr "type" "binary")
6602 (set_attr "length" "4")])
6605 [(set (match_operand:SI 0 "register_operand" "=r")
6606 (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
6607 (match_operand:SI 3 "mem_shadd_operand" ""))
6608 (match_operand:SI 1 "register_operand" "r")))]
6612 int shift_val = exact_log2 (INTVAL (operands[3]));
6613 operands[3] = GEN_INT (shift_val);
6614 return \"{sh%o3addl %2,%1,%0|shladd,l %2,%o3,%1,%0}\";
6616 [(set_attr "type" "binary")
6617 (set_attr "length" "4")])
6620 [(set (match_operand:DI 0 "register_operand" "=r")
6621 (plus:DI (ashift:DI (match_operand:DI 2 "register_operand" "r")
6622 (match_operand:DI 3 "shadd_operand" ""))
6623 (match_operand:DI 1 "register_operand" "r")))]
6625 "shladd,l %2,%o3,%1,%0"
6626 [(set_attr "type" "binary")
6627 (set_attr "length" "4")])
6630 [(set (match_operand:DI 0 "register_operand" "=r")
6631 (plus:DI (mult:DI (match_operand:DI 2 "register_operand" "r")
6632 (match_operand:DI 3 "mem_shadd_operand" ""))
6633 (match_operand:DI 1 "register_operand" "r")))]
6637 int shift_val = exact_log2 (INTVAL (operands[3]));
6638 operands[3] = GEN_INT (shift_val);
6639 return \"shladd,l %2,%o3,%1,%0\";
6641 [(set_attr "type" "binary")
6642 (set_attr "length" "4")])
6644 (define_expand "ashlsi3"
6645 [(set (match_operand:SI 0 "register_operand" "")
6646 (ashift:SI (match_operand:SI 1 "lhs_lshift_operand" "")
6647 (match_operand:SI 2 "arith32_operand" "")))]
6651 if (GET_CODE (operands[2]) != CONST_INT)
6653 rtx temp = gen_reg_rtx (SImode);
6654 emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
6655 if (GET_CODE (operands[1]) == CONST_INT)
6656 emit_insn (gen_zvdep_imm32 (operands[0], operands[1], temp));
6658 emit_insn (gen_zvdep32 (operands[0], operands[1], temp));
6661 /* Make sure both inputs are not constants,
6662 there are no patterns for that. */
6663 operands[1] = force_reg (SImode, operands[1]);
6667 [(set (match_operand:SI 0 "register_operand" "=r")
6668 (ashift:SI (match_operand:SI 1 "register_operand" "r")
6669 (match_operand:SI 2 "const_int_operand" "n")))]
6671 "{zdep|depw,z} %1,%P2,%L2,%0"
6672 [(set_attr "type" "shift")
6673 (set_attr "length" "4")])
6675 ; Match cases of op1 a CONST_INT here that zvdep_imm32 doesn't handle.
6676 ; Doing it like this makes slightly better code since reload can
6677 ; replace a register with a known value in range -16..15 with a
6678 ; constant. Ideally, we would like to merge zvdep32 and zvdep_imm32,
6679 ; but since we have no more CONST_OK... characters, that is not
6681 (define_insn "zvdep32"
6682 [(set (match_operand:SI 0 "register_operand" "=r,r")
6683 (ashift:SI (match_operand:SI 1 "arith5_operand" "r,L")
6684 (minus:SI (const_int 31)
6685 (match_operand:SI 2 "register_operand" "q,q"))))]
6688 {zvdep %1,32,%0|depw,z %1,%%sar,32,%0}
6689 {zvdepi %1,32,%0|depwi,z %1,%%sar,32,%0}"
6690 [(set_attr "type" "shift,shift")
6691 (set_attr "length" "4,4")])
6693 (define_insn "zvdep_imm32"
6694 [(set (match_operand:SI 0 "register_operand" "=r")
6695 (ashift:SI (match_operand:SI 1 "lhs_lshift_cint_operand" "")
6696 (minus:SI (const_int 31)
6697 (match_operand:SI 2 "register_operand" "q"))))]
6701 unsigned HOST_WIDE_INT x = UINTVAL (operands[1]);
6702 operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
6703 operands[1] = GEN_INT ((x & 0xf) - 0x10);
6704 return \"{zvdepi %1,%2,%0|depwi,z %1,%%sar,%2,%0}\";
6706 [(set_attr "type" "shift")
6707 (set_attr "length" "4")])
6709 (define_insn "vdepi_ior"
6710 [(set (match_operand:SI 0 "register_operand" "=r")
6711 (ior:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "")
6712 (minus:SI (const_int 31)
6713 (match_operand:SI 2 "register_operand" "q")))
6714 (match_operand:SI 3 "register_operand" "0")))]
6715 ; accept ...0001...1, can this be generalized?
6716 "exact_log2 (INTVAL (operands[1]) + 1) > 0"
6719 HOST_WIDE_INT x = INTVAL (operands[1]);
6720 operands[2] = GEN_INT (exact_log2 (x + 1));
6721 return \"{vdepi -1,%2,%0|depwi -1,%%sar,%2,%0}\";
6723 [(set_attr "type" "shift")
6724 (set_attr "length" "4")])
6726 (define_insn "vdepi_and"
6727 [(set (match_operand:SI 0 "register_operand" "=r")
6728 (and:SI (rotate:SI (match_operand:SI 1 "const_int_operand" "")
6729 (minus:SI (const_int 31)
6730 (match_operand:SI 2 "register_operand" "q")))
6731 (match_operand:SI 3 "register_operand" "0")))]
6732 ; this can be generalized...!
6733 "INTVAL (operands[1]) == -2"
6736 HOST_WIDE_INT x = INTVAL (operands[1]);
6737 operands[2] = GEN_INT (exact_log2 ((~x) + 1));
6738 return \"{vdepi 0,%2,%0|depwi 0,%%sar,%2,%0}\";
6740 [(set_attr "type" "shift")
6741 (set_attr "length" "4")])
6743 (define_expand "ashldi3"
6744 [(set (match_operand:DI 0 "register_operand" "")
6745 (ashift:DI (match_operand:DI 1 "lhs_lshift_operand" "")
6746 (match_operand:DI 2 "arith32_operand" "")))]
6752 if (REG_P (operands[0]) && GET_CODE (operands[2]) == CONST_INT)
6754 unsigned HOST_WIDE_INT shift = UINTVAL (operands[2]);
6755 if (shift >= 1 && shift <= 31)
6757 rtx dst = operands[0];
6758 rtx src = force_reg (DImode, operands[1]);
6759 emit_insn (gen_shd_internal (gen_highpart (SImode, dst),
6760 gen_lowpart (SImode, src),
6762 gen_highpart (SImode, src),
6764 emit_insn (gen_ashlsi3 (gen_lowpart (SImode, dst),
6765 gen_lowpart (SImode, src),
6770 /* Fallback to using optabs.cc's expand_doubleword_shift. */
6773 if (GET_CODE (operands[2]) != CONST_INT)
6775 rtx temp = gen_reg_rtx (DImode);
6776 emit_insn (gen_subdi3 (temp, GEN_INT (63), operands[2]));
6777 if (GET_CODE (operands[1]) == CONST_INT)
6778 emit_insn (gen_zvdep_imm64 (operands[0], operands[1], temp));
6780 emit_insn (gen_zvdep64 (operands[0], operands[1], temp));
6783 /* Make sure both inputs are not constants,
6784 there are no patterns for that. */
6785 operands[1] = force_reg (DImode, operands[1]);
6788 (define_expand "ashlti3"
6789 [(set (match_operand:TI 0 "register_operand" "")
6790 (ashift:TI (match_operand:TI 1 "lhs_lshift_operand" "")
6791 (match_operand:TI 2 "arith32_operand" "")))]
6794 if (REG_P (operands[0]) && GET_CODE (operands[2]) == CONST_INT)
6796 unsigned HOST_WIDE_INT shift = UINTVAL (operands[2]);
6797 rtx dst = operands[0];
6798 rtx src = force_reg (TImode, operands[1]);
6799 if (shift >= 1 && shift <= 63)
6801 emit_insn (gen_shrpd_internal (gen_highpart (DImode, dst),
6802 gen_lowpart (DImode, src),
6804 gen_highpart (DImode, src),
6806 emit_insn (gen_ashldi3 (gen_lowpart (DImode, dst),
6807 gen_lowpart (DImode, src),
6811 else if (shift >= 64 && shift <= 127)
6813 emit_insn (gen_ashldi3 (gen_highpart (DImode, dst),
6814 gen_lowpart (DImode, src),
6815 GEN_INT (shift - 64)));
6816 emit_move_insn (gen_lowpart (DImode, dst), GEN_INT (0));
6820 /* Fallback to using optabs.cc's expand_doubleword_shift. */
6825 [(set (match_operand:DI 0 "register_operand" "=r")
6826 (ashift:DI (match_operand:DI 1 "register_operand" "r")
6827 (match_operand:DI 2 "const_int_operand" "n")))]
6829 "depd,z %1,%p2,%Q2,%0"
6830 [(set_attr "type" "shift")
6831 (set_attr "length" "4")])
6833 ; Match cases of op1 a CONST_INT here that zvdep_imm64 doesn't handle.
6834 ; Doing it like this makes slightly better code since reload can
6835 ; replace a register with a known value in range -16..15 with a
6836 ; constant. Ideally, we would like to merge zvdep64 and zvdep_imm64,
6837 ; but since we have no more CONST_OK... characters, that is not
6839 (define_insn "zvdep64"
6840 [(set (match_operand:DI 0 "register_operand" "=r,r")
6841 (ashift:DI (match_operand:DI 1 "arith5_operand" "r,L")
6842 (minus:DI (const_int 63)
6843 (match_operand:DI 2 "register_operand" "q,q"))))]
6846 depd,z %1,%%sar,64,%0
6847 depdi,z %1,%%sar,64,%0"
6848 [(set_attr "type" "shift,shift")
6849 (set_attr "length" "4,4")])
6851 (define_insn "zvdep_imm64"
6852 [(set (match_operand:DI 0 "register_operand" "=r")
6853 (ashift:DI (match_operand:DI 1 "lhs_lshift_cint_operand" "")
6854 (minus:DI (const_int 63)
6855 (match_operand:DI 2 "register_operand" "q"))))]
6859 unsigned HOST_WIDE_INT x = UINTVAL (operands[1]);
6860 operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
6861 operands[1] = GEN_INT ((x & 0x1f) - 0x20);
6862 return \"depdi,z %1,%%sar,%2,%0\";
6864 [(set_attr "type" "shift")
6865 (set_attr "length" "4")])
6868 [(set (match_operand:DI 0 "register_operand" "=r")
6869 (ior:DI (ashift:DI (match_operand:DI 1 "const_int_operand" "")
6870 (minus:DI (const_int 63)
6871 (match_operand:DI 2 "register_operand" "q")))
6872 (match_operand:DI 3 "register_operand" "0")))]
6873 ; accept ...0001...1, can this be generalized?
6874 "TARGET_64BIT && exact_log2 (INTVAL (operands[1]) + 1) > 0"
6877 HOST_WIDE_INT x = INTVAL (operands[1]);
6878 operands[2] = GEN_INT (exact_log2 (x + 1));
6879 return \"depdi -1,%%sar,%2,%0\";
6881 [(set_attr "type" "shift")
6882 (set_attr "length" "4")])
6885 [(set (match_operand:DI 0 "register_operand" "=r")
6886 (and:DI (rotate:DI (match_operand:DI 1 "const_int_operand" "")
6887 (minus:DI (const_int 63)
6888 (match_operand:DI 2 "register_operand" "q")))
6889 (match_operand:DI 3 "register_operand" "0")))]
6890 ; this can be generalized...!
6891 "TARGET_64BIT && INTVAL (operands[1]) == -2"
6894 HOST_WIDE_INT x = INTVAL (operands[1]);
6895 operands[2] = GEN_INT (exact_log2 ((~x) + 1));
6896 return \"depdi 0,%%sar,%2,%0\";
6898 [(set_attr "type" "shift")
6899 (set_attr "length" "4")])
6901 (define_expand "ashrsi3"
6902 [(set (match_operand:SI 0 "register_operand" "")
6903 (ashiftrt:SI (match_operand:SI 1 "register_operand" "")
6904 (match_operand:SI 2 "arith32_operand" "")))]
6908 if (GET_CODE (operands[2]) != CONST_INT)
6910 rtx temp = gen_reg_rtx (SImode);
6911 emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
6912 emit_insn (gen_vextrs32 (operands[0], operands[1], temp));
6918 [(set (match_operand:SI 0 "register_operand" "=r")
6919 (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
6920 (match_operand:SI 2 "const_int_operand" "n")))]
6922 "{extrs|extrw,s} %1,%P2,%L2,%0"
6923 [(set_attr "type" "shift")
6924 (set_attr "length" "4")])
6926 (define_insn "vextrs32"
6927 [(set (match_operand:SI 0 "register_operand" "=r")
6928 (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
6929 (minus:SI (const_int 31)
6930 (match_operand:SI 2 "register_operand" "q"))))]
6932 "{vextrs %1,32,%0|extrw,s %1,%%sar,32,%0}"
6933 [(set_attr "type" "shift")
6934 (set_attr "length" "4")])
6936 (define_expand "ashrdi3"
6937 [(set (match_operand:DI 0 "register_operand" "")
6938 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
6939 (match_operand:DI 2 "arith32_operand" "")))]
6943 if (GET_CODE (operands[2]) != CONST_INT)
6945 rtx temp = gen_reg_rtx (DImode);
6946 emit_insn (gen_subdi3 (temp, GEN_INT (63), operands[2]));
6947 emit_insn (gen_vextrs64 (operands[0], operands[1], temp));
6953 [(set (match_operand:DI 0 "register_operand" "=r")
6954 (ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
6955 (match_operand:DI 2 "const_int_operand" "n")))]
6957 "extrd,s %1,%p2,%Q2,%0"
6958 [(set_attr "type" "shift")
6959 (set_attr "length" "4")])
6961 (define_insn "vextrs64"
6962 [(set (match_operand:DI 0 "register_operand" "=r")
6963 (ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
6964 (minus:DI (const_int 63)
6965 (match_operand:DI 2 "register_operand" "q"))))]
6967 "extrd,s %1,%%sar,64,%0"
6968 [(set_attr "type" "shift")
6969 (set_attr "length" "4")])
6971 (define_insn "lshrsi3"
6972 [(set (match_operand:SI 0 "register_operand" "=r,r")
6973 (lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
6974 (match_operand:SI 2 "shift5_operand" "q,n")))]
6977 {vshd %%r0,%1,%0|shrpw %%r0,%1,%%sar,%0}
6978 {extru|extrw,u} %1,%P2,%L2,%0"
6979 [(set_attr "type" "shift")
6980 (set_attr "length" "4")])
6982 (define_insn "lshrdi3"
6983 [(set (match_operand:DI 0 "register_operand" "=r,r")
6984 (lshiftrt:DI (match_operand:DI 1 "register_operand" "r,r")
6985 (match_operand:DI 2 "shift6_operand" "q,n")))]
6988 shrpd %%r0,%1,%%sar,%0
6989 extrd,u %1,%p2,%Q2,%0"
6990 [(set_attr "type" "shift")
6991 (set_attr "length" "4")])
6993 ; Shift right pair word 0 to 31 bits.
6994 (define_insn "*shrpsi4_1"
6995 [(set (match_operand:SI 0 "register_operand" "=r")
6996 (match_operator:SI 4 "plus_xor_ior_operator"
6997 [(ashift:SI (match_operand:SI 1 "register_operand" "r")
6998 (minus:SI (const_int 32)
6999 (match_operand:SI 3 "register_operand" "q")))
7000 (lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
7003 "{vshd %1,%2,%0|shrpw %1,%2,%%sar,%0}"
7004 [(set_attr "type" "shift")
7005 (set_attr "length" "4")])
7007 (define_insn "*shrpsi4_2"
7008 [(set (match_operand:SI 0 "register_operand" "=r")
7009 (match_operator:SI 4 "plus_xor_ior_operator"
7010 [(lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
7011 (match_operand:SI 3 "register_operand" "q"))
7012 (ashift:SI (match_operand:SI 1 "register_operand" "r")
7013 (minus:SI (const_int 32)
7016 "{vshd %1,%2,%0|shrpw %1,%2,%%sar,%0}"
7017 [(set_attr "type" "shift")
7018 (set_attr "length" "4")])
7020 ; Shift right pair doubleword 0 to 63 bits.
7021 (define_insn "*shrpdi4_1"
7022 [(set (match_operand:DI 0 "register_operand" "=r")
7023 (match_operator:DI 4 "plus_xor_ior_operator"
7024 [(ashift:DI (match_operand:DI 1 "register_operand" "r")
7025 (minus:DI (const_int 64)
7026 (match_operand:DI 3 "register_operand" "q")))
7027 (lshiftrt:DI (match_operand:DI 2 "register_operand" "r")
7030 "shrpd %1,%2,%%sar,%0"
7031 [(set_attr "type" "shift")
7032 (set_attr "length" "4")])
7034 (define_insn "*shrpdi4_2"
7035 [(set (match_operand:DI 0 "register_operand" "=r")
7036 (match_operator:DI 4 "plus_xor_ior_operator"
7037 [(lshiftrt:DI (match_operand:DI 2 "register_operand" "r")
7038 (match_operand:DI 3 "shift6_operand" "q"))
7039 (ashift:DI (match_operand:SI 1 "register_operand" "r")
7040 (minus:DI (const_int 64)
7043 "shrpd %1,%2,%%sar,%0"
7044 [(set_attr "type" "shift")
7045 (set_attr "length" "4")])
7047 (define_insn "*shrpdi4_3"
7048 [(set (match_operand:DI 0 "register_operand" "=r")
7049 (match_operator:DI 5 "plus_xor_ior_operator"
7050 [(ashift:DI (match_operand:DI 1 "register_operand" "r")
7051 (match_operand:DI 3 "const_int_operand" "n"))
7052 (lshiftrt:DI (match_operand:DI 2 "register_operand" "r")
7053 (match_operand:DI 4 "const_int_operand" "n"))]))]
7055 && INTVAL (operands[3]) + INTVAL (operands[4]) == 64"
7057 [(set_attr "type" "shift")
7058 (set_attr "length" "4")])
7060 (define_insn "*shrpdi4_4"
7061 [(set (match_operand:DI 0 "register_operand" "=r")
7062 (match_operator:DI 5 "plus_xor_ior_operator"
7063 [(lshiftrt:DI (match_operand:DI 2 "register_operand" "r")
7064 (match_operand:DI 4 "const_int_operand" "n"))
7065 (ashift:DI (match_operand:DI 1 "register_operand" "r")
7066 (match_operand:DI 3 "const_int_operand" "n"))]))]
7068 && INTVAL (operands[3]) + INTVAL (operands[4]) == 64"
7070 [(set_attr "type" "shift")
7071 (set_attr "length" "4")])
7073 (define_insn "rotrsi3"
7074 [(set (match_operand:SI 0 "register_operand" "=r,r")
7075 (rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
7076 (match_operand:SI 2 "shift5_operand" "q,n")))]
7080 if (GET_CODE (operands[2]) == CONST_INT)
7082 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
7083 return \"{shd|shrpw} %1,%1,%2,%0\";
7086 return \"{vshd %1,%1,%0|shrpw %1,%1,%%sar,%0}\";
7088 [(set_attr "type" "shift")
7089 (set_attr "length" "4")])
7091 (define_expand "rotlsi3"
7092 [(set (match_operand:SI 0 "register_operand" "")
7093 (rotate:SI (match_operand:SI 1 "register_operand" "")
7094 (match_operand:SI 2 "arith32_operand" "")))]
7098 if (GET_CODE (operands[2]) != CONST_INT)
7100 rtx temp = gen_reg_rtx (SImode);
7101 emit_insn (gen_subsi3 (temp, GEN_INT (32), operands[2]));
7102 emit_insn (gen_rotrsi3 (operands[0], operands[1], temp));
7105 /* Else expand normally. */
7108 (define_insn "*rotlsi3_internal"
7109 [(set (match_operand:SI 0 "register_operand" "=r")
7110 (rotate:SI (match_operand:SI 1 "register_operand" "r")
7111 (match_operand:SI 2 "const_int_operand" "n")))]
7115 operands[2] = GEN_INT ((32 - INTVAL (operands[2])) & 31);
7116 return \"{shd|shrpw} %1,%1,%2,%0\";
7118 [(set_attr "type" "shift")
7119 (set_attr "length" "4")])
7121 (define_insn "rotrdi3"
7122 [(set (match_operand:DI 0 "register_operand" "=r,r")
7123 (rotatert:DI (match_operand:DI 1 "register_operand" "r,r")
7124 (match_operand:DI 2 "shift6_operand" "q,n")))]
7128 if (GET_CODE (operands[2]) == CONST_INT)
7130 operands[2] = GEN_INT (INTVAL (operands[2]) & 63);
7131 return \"shrpd %1,%1,%2,%0\";
7134 return \"shrpd %1,%1,%%sar,%0\";
7136 [(set_attr "type" "shift")
7137 (set_attr "length" "4")])
7139 (define_expand "rotldi3"
7140 [(set (match_operand:DI 0 "register_operand" "")
7141 (rotate:DI (match_operand:DI 1 "register_operand" "")
7142 (match_operand:DI 2 "arith32_operand" "")))]
7146 if (GET_CODE (operands[2]) != CONST_INT)
7148 rtx temp = gen_reg_rtx (DImode);
7149 emit_insn (gen_subdi3 (temp, GEN_INT (64), operands[2]));
7150 emit_insn (gen_rotrdi3 (operands[0], operands[1], temp));
7153 /* Else expand normally. */
7156 (define_insn "*rotldi3_internal"
7157 [(set (match_operand:DI 0 "register_operand" "=r")
7158 (rotate:DI (match_operand:DI 1 "register_operand" "r")
7159 (match_operand:DI 2 "const_int_operand" "n")))]
7163 operands[2] = GEN_INT ((64 - INTVAL (operands[2])) & 63);
7164 return \"shrpd %1,%1,%2,%0\";
7166 [(set_attr "type" "shift")
7167 (set_attr "length" "4")])
7170 [(set (match_operand:SI 0 "register_operand" "=r")
7171 (match_operator:SI 5 "plus_xor_ior_operator"
7172 [(ashift:SI (match_operand:SI 1 "register_operand" "r")
7173 (match_operand:SI 3 "const_int_operand" "n"))
7174 (lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
7175 (match_operand:SI 4 "const_int_operand" "n"))]))]
7176 "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
7177 "{shd|shrpw} %1,%2,%4,%0"
7178 [(set_attr "type" "shift")
7179 (set_attr "length" "4")])
7182 [(set (match_operand:SI 0 "register_operand" "=r")
7183 (match_operator:SI 5 "plus_xor_ior_operator"
7184 [(lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
7185 (match_operand:SI 4 "const_int_operand" "n"))
7186 (ashift:SI (match_operand:SI 1 "register_operand" "r")
7187 (match_operand:SI 3 "const_int_operand" "n"))]))]
7188 "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
7189 "{shd|shrpw} %1,%2,%4,%0"
7190 [(set_attr "type" "shift")
7191 (set_attr "length" "4")])
7193 (define_expand "shd_internal"
7194 [(set (match_operand:SI 0 "register_operand")
7196 (lshiftrt:SI (match_operand:SI 1 "register_operand")
7197 (match_operand:SI 2 "const_int_operand"))
7198 (ashift:SI (match_operand:SI 3 "register_operand")
7199 (match_operand:SI 4 "const_int_operand"))))]
7202 (define_expand "shrpd_internal"
7203 [(set (match_operand:DI 0 "register_operand")
7205 (lshiftrt:DI (match_operand:DI 1 "register_operand")
7206 (match_operand:DI 2 "const_int_operand"))
7207 (ashift:DI (match_operand:DI 3 "register_operand")
7208 (match_operand:DI 4 "const_int_operand"))))]
7212 [(set (match_operand:SI 0 "register_operand" "=r")
7213 (and:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
7214 (match_operand:SI 2 "const_int_operand" ""))
7215 (match_operand:SI 3 "const_int_operand" "")))]
7216 "exact_log2 (1 + (INTVAL (operands[3]) >> (INTVAL (operands[2]) & 31))) > 0"
7219 int cnt = INTVAL (operands[2]) & 31;
7220 operands[3] = GEN_INT (exact_log2 (1 + (INTVAL (operands[3]) >> cnt)));
7221 operands[2] = GEN_INT (31 - cnt);
7222 return \"{zdep|depw,z} %1,%2,%3,%0\";
7224 [(set_attr "type" "shift")
7225 (set_attr "length" "4")])
7227 ;; Unconditional and other jump instructions.
7229 ;; Trivial return used when no epilogue is needed.
7230 (define_insn "return"
7233 "pa_can_use_return_insn ()"
7237 return \"bve%* (%%r2)\";
7238 return \"bv%* %%r0(%%r2)\";
7240 [(set_attr "type" "branch")
7241 (set_attr "length" "4")])
7243 ;; This is used for most returns.
7244 (define_insn "return_internal"
7251 return \"bve%* (%%r2)\";
7252 return \"bv%* %%r0(%%r2)\";
7254 [(set_attr "type" "branch")
7255 (set_attr "length" "4")])
7257 ;; This is used for eh returns which bypass the return stub.
7258 (define_insn "return_external_pic"
7260 (clobber (reg:SI 1))
7262 "!TARGET_NO_SPACE_REGS
7264 && flag_pic && crtl->calls_eh_return"
7265 "ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
7266 [(set_attr "type" "branch")
7267 (set_attr "length" "12")])
7269 (define_expand "prologue"
7272 "pa_expand_prologue ();DONE;")
7274 (define_expand "sibcall_epilogue"
7279 pa_expand_epilogue ();
7283 (define_expand "epilogue"
7290 /* Try to use the trivial return first. Else use the full epilogue. */
7291 if (pa_can_use_return_insn ())
7295 pa_expand_epilogue ();
7297 /* EH returns bypass the normal return stub. Thus, we must do an
7298 interspace branch to return from functions that call eh_return.
7299 This is only a problem for returns from shared code on ports
7300 using space registers. */
7301 if (!TARGET_NO_SPACE_REGS
7303 && flag_pic && crtl->calls_eh_return)
7304 x = gen_return_external_pic ();
7306 x = gen_return_internal ();
7312 ; Used by hppa_profile_hook to load the starting address of the current
7313 ; function; operand 1 contains the address of the label in operand 3
7314 (define_insn "load_offset_label_address"
7315 [(set (match_operand:SI 0 "register_operand" "=r")
7316 (plus:SI (match_operand:SI 1 "register_operand" "r")
7317 (minus:SI (match_operand:SI 2 "" "")
7318 (label_ref:SI (match_operand 3 "" "")))))]
7321 [(set_attr "type" "multi")
7322 (set_attr "length" "4")])
7324 ; Output a code label and load its address.
7325 (define_insn "lcla1"
7326 [(set (match_operand:SI 0 "register_operand" "=r")
7327 (label_ref:SI (match_operand 1 "" "")))
7332 output_asm_insn (\"bl .+8,%0\;depi 0,31,2,%0\", operands);
7333 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
7334 CODE_LABEL_NUMBER (operands[1]));
7337 [(set_attr "type" "multi")
7338 (set_attr "length" "8")])
7340 (define_insn "lcla2"
7341 [(set (match_operand:SI 0 "register_operand" "=r")
7342 (label_ref:SI (match_operand 1 "" "")))
7347 (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
7348 CODE_LABEL_NUMBER (operands[1]));
7351 [(set_attr "type" "move")
7352 (set_attr "length" "4")])
7354 (define_insn "blockage"
7355 [(unspec_volatile [(const_int 2)] UNSPECV_BLOCKAGE)]
7358 [(set_attr "length" "0")])
7361 [(set (pc) (label_ref (match_operand 0 "" "")))]
7365 /* An unconditional branch which can reach its target. */
7366 if (get_attr_length (insn) < 16)
7369 return pa_output_lbranch (operands[0], insn, 1);
7371 [(set_attr "type" "uncond_branch")
7372 (set_attr "pa_combine_type" "uncond_branch")
7373 (set (attr "length")
7374 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
7375 (const_int MAX_17BIT_OFFSET))
7377 (match_test "TARGET_PORTABLE_RUNTIME")
7379 (not (match_test "flag_pic"))
7383 ;;; Hope this is only within a function...
7384 (define_insn "indirect_jump"
7385 [(set (pc) (match_operand 0 "pmode_register_operand" "r"))]
7388 [(set_attr "type" "branch")
7389 (set_attr "length" "4")])
7391 ;;; An indirect jump can be optimized to a direct jump. GAS for the
7392 ;;; SOM target doesn't allow branching to a label inside a function.
7393 ;;; We also don't correctly compute branch distances for labels
7394 ;;; outside the current function. Thus, we use an indirect jump can't
7395 ;;; be optimized to a direct jump for all targets. We assume that
7396 ;;; the branch target is in the same space (i.e., nested function
7397 ;;; jumping to a label in an outer function in the same translation
7399 (define_expand "nonlocal_goto"
7400 [(use (match_operand 0 "general_operand" ""))
7401 (use (match_operand 1 "general_operand" ""))
7402 (use (match_operand 2 "general_operand" ""))
7403 (use (match_operand 3 "general_operand" ""))]
7406 rtx lab = operands[1];
7407 rtx stack = operands[2];
7408 rtx fp = operands[3];
7410 emit_clobber (gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode)));
7411 emit_clobber (gen_rtx_MEM (BLKmode, hard_frame_pointer_rtx));
7413 lab = copy_to_reg (lab);
7415 /* Restore the stack and frame pointers. */
7416 fp = copy_to_reg (fp);
7417 emit_stack_restore (SAVE_NONLOCAL, stack);
7419 /* Ensure the frame pointer move is not optimized. */
7420 emit_insn (gen_blockage ());
7421 emit_clobber (hard_frame_pointer_rtx);
7422 emit_move_insn (hard_frame_pointer_rtx, fp);
7424 emit_use (hard_frame_pointer_rtx);
7425 emit_use (stack_pointer_rtx);
7427 /* Nonlocal goto jumps are only used between functions in the same
7428 translation unit. Thus, we can avoid the extra overhead of an
7430 emit_jump_insn (gen_indirect_goto (lab));
7435 (define_insn "indirect_goto"
7436 [(unspec [(match_operand 0 "register_operand" "r")] UNSPEC_GOTO)]
7437 "GET_MODE (operands[0]) == word_mode"
7439 [(set_attr "type" "branch")
7440 (set_attr "length" "4")])
7442 ;; Subroutines of "casesi".
7443 ;; operand 0 is index
7444 ;; operand 1 is the minimum bound
7445 ;; operand 2 is the maximum bound - minimum bound + 1
7446 ;; operand 3 is CODE_LABEL for the table;
7447 ;; operand 4 is the CODE_LABEL to go to if index out of range.
7449 (define_expand "casesi"
7450 [(match_operand:SI 0 "general_operand" "")
7451 (match_operand:SI 1 "const_int_operand" "")
7452 (match_operand:SI 2 "const_int_operand" "")
7453 (match_operand 3 "" "")
7454 (match_operand 4 "" "")]
7458 if (GET_CODE (operands[0]) != REG)
7459 operands[0] = force_reg (SImode, operands[0]);
7461 if (operands[1] != const0_rtx)
7463 rtx index = gen_reg_rtx (SImode);
7465 operands[1] = gen_int_mode (-INTVAL (operands[1]), SImode);
7466 if (!INT_14_BITS (operands[1]))
7467 operands[1] = force_reg (SImode, operands[1]);
7468 emit_insn (gen_addsi3 (index, operands[0], operands[1]));
7469 operands[0] = index;
7472 if (!INT_5_BITS (operands[2]))
7473 operands[2] = force_reg (SImode, operands[2]);
7475 /* This branch prevents us finding an insn for the delay slot of the
7476 following vectored branch. It might be possible to use the delay
7477 slot if an index value of -1 was used to transfer to the out-of-range
7478 label. In order to do this, we would have to output the -1 vector
7479 element after the delay insn. The casesi output code would have to
7480 check if the casesi insn is in a delay branch sequence and output
7481 the delay insn if one is found. If this was done, then it might
7482 then be worthwhile to split the casesi patterns to improve scheduling.
7483 However, it's not clear that all this extra complexity is worth
7486 rtx test = gen_rtx_GTU (VOIDmode, operands[0], operands[2]);
7487 emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2], operands[4]));
7490 /* In 64bit mode we must make sure to wipe the upper bits of the register
7491 just in case the addition overflowed or we had random bits in the
7492 high part of the register. */
7495 rtx index = gen_reg_rtx (DImode);
7497 emit_insn (gen_extendsidi2 (index, operands[0]));
7498 operands[0] = index;
7502 emit_jump_insn (gen_casesi64p (operands[0], operands[3]));
7504 emit_jump_insn (gen_casesi32p (operands[0], operands[3]));
7506 emit_jump_insn (gen_casesi32 (operands[0], operands[3]));
7510 ;;; 32-bit code, absolute branch table.
7511 (define_insn "casesi32"
7512 [(set (pc) (mem:SI (plus:SI
7513 (mult:SI (match_operand:SI 0 "register_operand" "r")
7515 (label_ref (match_operand 1 "" "")))))
7516 (clobber (match_scratch:SI 2 "=&r"))]
7518 "ldil L'%l1,%2\;ldo R'%l1(%2),%2\;{ldwx|ldw},s %0(%2),%2\;bv,n %%r0(%2)"
7519 [(set_attr "type" "multi")
7520 (set_attr "length" "16")])
7522 ;;; 32-bit code, relative branch table.
7523 (define_insn "casesi32p"
7524 [(set (pc) (mem:SI (plus:SI
7525 (mult:SI (match_operand:SI 0 "register_operand" "r")
7527 (label_ref (match_operand 1 "" "")))))
7528 (clobber (match_scratch:SI 2 "=&r"))
7529 (clobber (match_scratch:SI 3 "=&r"))]
7531 "{bl .+8,%2\;depi 0,31,2,%2|mfia %2}\;ldo {%l1-.|%l1+4-.}(%2),%2\;\
7532 {ldwx|ldw},s %0(%2),%3\;{addl|add,l} %2,%3,%3\;bv,n %%r0(%3)"
7533 [(set_attr "type" "multi")
7534 (set (attr "length")
7535 (if_then_else (match_test "TARGET_PA_20")
7539 ;;; 64-bit code, 32-bit relative branch table.
7540 (define_insn "casesi64p"
7541 [(set (pc) (mem:DI (plus:DI
7542 (mult:DI (match_operand:DI 0 "register_operand" "r")
7544 (label_ref (match_operand 1 "" "")))))
7545 (clobber (match_scratch:DI 2 "=&r"))
7546 (clobber (match_scratch:DI 3 "=&r"))]
7548 "mfia %2\;ldo %l1+4-.(%2),%2\;ldw,s %0(%2),%3\;extrd,s %3,63,32,%3\;\
7549 add,l %2,%3,%3\;bv,n %%r0(%3)"
7550 [(set_attr "type" "multi")
7551 (set_attr "length" "24")])
7555 ;;- jump to subroutine
7557 (define_expand "call"
7558 [(parallel [(call (match_operand:SI 0 "" "")
7559 (match_operand 1 "" ""))
7560 (clobber (reg:SI 2))])]
7565 rtx nb = operands[1];
7567 if (TARGET_PORTABLE_RUNTIME)
7568 op = force_reg (SImode, XEXP (operands[0], 0));
7571 op = XEXP (operands[0], 0);
7573 /* Generate indirect long calls to non-local functions. */
7574 if (TARGET_LONG_CALLS && GET_CODE (op) == SYMBOL_REF)
7576 tree call_decl = SYMBOL_REF_DECL (op);
7577 if (!(call_decl && targetm.binds_local_p (call_decl)))
7578 op = force_reg (word_mode, op);
7584 if (!virtuals_instantiated)
7585 emit_move_insn (arg_pointer_rtx,
7586 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
7590 /* The loop pass can generate new libcalls after the virtual
7591 registers are instantiated when fpregs are disabled because
7592 the only method that we have for doing DImode multiplication
7593 is with a libcall. This could be trouble if we haven't
7594 allocated enough space for the outgoing arguments. */
7595 gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
7597 emit_move_insn (arg_pointer_rtx,
7598 gen_rtx_PLUS (word_mode, stack_pointer_rtx,
7599 GEN_INT (STACK_POINTER_OFFSET + 64)));
7603 /* Use two different patterns for calls to explicitly named functions
7604 and calls through function pointers. This is necessary as these two
7605 types of calls use different calling conventions, and CSE might try
7606 to change the named call into an indirect call in some cases (using
7607 two patterns keeps CSE from performing this optimization).
7609 We now use even more call patterns as there was a subtle bug in
7610 attempting to restore the pic register after a call using a simple
7611 move insn. During reload, a instruction involving a pseudo register
7612 with no explicit dependence on the PIC register can be converted
7613 to an equivalent load from memory using the PIC register. If we
7614 emit a simple move to restore the PIC register in the initial rtl
7615 generation, then it can potentially be repositioned during scheduling.
7616 and an instruction that eventually uses the PIC register may end up
7617 between the call and the PIC register restore.
7619 This only worked because there is a post call group of instructions
7620 that are scheduled with the call. These instructions are included
7621 in the same basic block as the call. However, calls can throw in
7622 C++ code and a basic block has to terminate at the call if the call
7623 can throw. This results in the PIC register restore being scheduled
7624 independently from the call. So, we now hide the save and restore
7625 of the PIC register in the call pattern until after reload. Then,
7626 we split the moves out. A small side benefit is that we now don't
7627 need to have a use of the PIC register in the return pattern and
7628 the final save/restore operation is not needed.
7630 I elected to just use register %r4 in the PIC patterns instead
7631 of trying to force hppa_pic_save_rtx () to a callee saved register.
7632 This might have required a new register class and constraint. It
7633 was also simpler to just handle the restore from a register than a
7637 rtx r4 = gen_rtx_REG (word_mode, 4);
7638 if (GET_CODE (op) == SYMBOL_REF)
7639 emit_call_insn (gen_call_symref_64bit (op, nb, r4));
7642 op = force_reg (word_mode, op);
7643 emit_call_insn (gen_call_reg_64bit (op, nb, r4));
7648 if (GET_CODE (op) == SYMBOL_REF)
7652 rtx r4 = gen_rtx_REG (word_mode, 4);
7653 emit_call_insn (gen_call_symref_pic (op, nb, r4));
7656 emit_call_insn (gen_call_symref (op, nb));
7660 rtx tmpreg = gen_rtx_REG (word_mode, 22);
7661 emit_move_insn (tmpreg, force_reg (word_mode, op));
7664 rtx r4 = gen_rtx_REG (word_mode, 4);
7665 emit_call_insn (gen_call_reg_pic (nb, r4));
7668 emit_call_insn (gen_call_reg (nb));
7675 ;; We use function calls to set the attribute length of calls and millicode
7676 ;; calls. This is necessary because of the large variety of call sequences.
7677 ;; Implementing the calculation in rtl is difficult as well as ugly. As
7678 ;; we need the same calculation in several places, maintenance becomes a
7681 ;; However, this has a subtle impact on branch shortening. When the
7682 ;; expression used to set the length attribute of an instruction depends
7683 ;; on a relative address (e.g., pc or a branch address), genattrtab
7684 ;; notes that the insn's length is variable, and attempts to determine a
7685 ;; worst-case default length and code to compute an insn's current length.
7687 ;; The use of a function call hides the variable dependence of our calls
7688 ;; and millicode calls. The result is genattrtab doesn't treat the operation
7689 ;; as variable and it only generates code for the default case using our
7690 ;; function call. Because of this, calls and millicode calls have a fixed
7691 ;; length in the branch shortening pass, and some branches will use a longer
7692 ;; code sequence than necessary. However, the length of any given call
7693 ;; will still reflect its final code location and it may be shorter than
7694 ;; the initial length estimate.
7696 ;; It's possible to trick genattrtab by adding an expression involving `pc'
7697 ;; in the set. However, when genattrtab hits a function call in its attempt
7698 ;; to compute the default length, it marks the result as unknown and sets
7699 ;; the default result to MAX_INT ;-( One possible fix that would allow
7700 ;; calls to participate in branch shortening would be to make the call to
7701 ;; insn_default_length a target option. Then, we could massage unknown
7702 ;; results. Another fix might be to change genattrtab so that it just does
7703 ;; the call in the variable case as it already does for the fixed case.
7705 (define_insn "call_symref"
7706 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7707 (match_operand 1 "" "i"))
7708 (clobber (reg:SI 1))
7709 (clobber (reg:SI 2))
7710 (use (const_int 0))]
7711 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
7714 pa_output_arg_descriptor (insn);
7715 return pa_output_call (insn, operands[0], 0);
7717 [(set_attr "type" "call")
7718 (set (attr "length")
7719 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
7720 (symbol_ref "pa_attr_length_call (insn, 0)")))])
7722 (define_insn "call_symref_pic"
7723 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7724 (match_operand 1 "" "i"))
7725 (clobber (reg:SI 1))
7726 (clobber (reg:SI 2))
7727 (clobber (match_operand 2))
7729 (use (const_int 0))]
7730 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
7733 ;; Split out the PIC register save and restore after reload. As the
7734 ;; split is done after reload, there are some situations in which we
7735 ;; unnecessarily save and restore %r4. This happens when there is a
7736 ;; single call and the PIC register is not used after the call.
7738 ;; The split has to be done since call_from_call_insn () can't handle
7739 ;; the pattern as is. Noreturn calls are special because they have to
7740 ;; terminate the basic block. The split has to contain more than one
7743 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7744 (match_operand 1 "" ""))
7745 (clobber (reg:SI 1))
7746 (clobber (reg:SI 2))
7747 (clobber (match_operand 2))
7749 (use (const_int 0))])]
7750 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
7751 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
7752 [(set (match_dup 2) (reg:SI 19))
7753 (parallel [(call (mem:SI (match_dup 0))
7755 (clobber (reg:SI 1))
7756 (clobber (reg:SI 2))
7758 (use (const_int 0))])]
7762 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7763 (match_operand 1 "" ""))
7764 (clobber (reg:SI 1))
7765 (clobber (reg:SI 2))
7766 (clobber (match_operand 2))
7768 (use (const_int 0))])]
7769 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
7770 [(set (match_dup 2) (reg:SI 19))
7771 (parallel [(call (mem:SI (match_dup 0))
7773 (clobber (reg:SI 1))
7774 (clobber (reg:SI 2))
7776 (use (const_int 0))])
7777 (set (reg:SI 19) (match_dup 2))]
7780 (define_insn "*call_symref_pic_post_reload"
7781 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7782 (match_operand 1 "" "i"))
7783 (clobber (reg:SI 1))
7784 (clobber (reg:SI 2))
7786 (use (const_int 0))]
7787 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
7790 pa_output_arg_descriptor (insn);
7791 return pa_output_call (insn, operands[0], 0);
7793 [(set_attr "type" "call")
7794 (set (attr "length")
7795 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
7796 (symbol_ref "pa_attr_length_call (insn, 0)")))])
7798 ;; This pattern is split if it is necessary to save and restore the
7800 (define_insn "call_symref_64bit"
7801 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7802 (match_operand 1 "" "i"))
7803 (clobber (reg:DI 1))
7804 (clobber (reg:DI 2))
7805 (clobber (match_operand 2))
7808 (use (const_int 0))]
7812 ;; Split out the PIC register save and restore after reload. As the
7813 ;; split is done after reload, there are some situations in which we
7814 ;; unnecessarily save and restore %r4. This happens when there is a
7815 ;; single call and the PIC register is not used after the call.
7817 ;; The split has to be done since call_from_call_insn () can't handle
7818 ;; the pattern as is. Noreturn calls are special because they have to
7819 ;; terminate the basic block. The split has to contain more than one
7822 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7823 (match_operand 1 "" ""))
7824 (clobber (reg:DI 1))
7825 (clobber (reg:DI 2))
7826 (clobber (match_operand 2))
7829 (use (const_int 0))])]
7830 "TARGET_64BIT && reload_completed
7831 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
7832 [(set (match_dup 2) (reg:DI 27))
7833 (parallel [(call (mem:SI (match_dup 0))
7835 (clobber (reg:DI 1))
7836 (clobber (reg:DI 2))
7839 (use (const_int 0))])]
7843 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7844 (match_operand 1 "" ""))
7845 (clobber (reg:DI 1))
7846 (clobber (reg:DI 2))
7847 (clobber (match_operand 2))
7850 (use (const_int 0))])]
7851 "TARGET_64BIT && reload_completed"
7852 [(set (match_dup 2) (reg:DI 27))
7853 (parallel [(call (mem:SI (match_dup 0))
7855 (clobber (reg:DI 1))
7856 (clobber (reg:DI 2))
7859 (use (const_int 0))])
7860 (set (reg:DI 27) (match_dup 2))]
7863 (define_insn "*call_symref_64bit_post_reload"
7864 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
7865 (match_operand 1 "" "i"))
7866 (clobber (reg:DI 1))
7867 (clobber (reg:DI 2))
7870 (use (const_int 0))]
7874 return pa_output_call (insn, operands[0], 0);
7876 [(set_attr "type" "call")
7877 (set (attr "length")
7878 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
7879 (symbol_ref "pa_attr_length_call (insn, 0)")))])
7881 (define_insn "call_reg"
7882 [(call (mem:SI (reg:SI 22))
7883 (match_operand 0 "" "i"))
7884 (clobber (reg:SI 1))
7885 (clobber (reg:SI 2))
7886 (use (const_int 1))]
7890 return pa_output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
7892 [(set_attr "type" "dyncall")
7893 (set (attr "length")
7894 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
7895 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
7897 ;; This pattern is split if it is necessary to save and restore the
7899 (define_insn "call_reg_pic"
7900 [(call (mem:SI (reg:SI 22))
7901 (match_operand 0 "" "i"))
7902 (clobber (reg:SI 1))
7903 (clobber (reg:SI 2))
7904 (clobber (match_operand 1))
7906 (use (const_int 1))]
7910 ;; Split out the PIC register save and restore after reload. As the
7911 ;; split is done after reload, there are some situations in which we
7912 ;; unnecessarily save and restore %r4. This happens when there is a
7913 ;; single call and the PIC register is not used after the call.
7915 ;; The split has to be done since call_from_call_insn () can't handle
7916 ;; the pattern as is. Noreturn calls are special because they have to
7917 ;; terminate the basic block. The split has to contain more than one
7920 [(parallel [(call (mem:SI (reg:SI 22))
7921 (match_operand 0 "" ""))
7922 (clobber (reg:SI 1))
7923 (clobber (reg:SI 2))
7924 (clobber (match_operand 1))
7926 (use (const_int 1))])]
7927 "!TARGET_64BIT && reload_completed
7928 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
7929 [(set (match_dup 1) (reg:SI 19))
7930 (parallel [(call (mem:SI (reg:SI 22))
7932 (clobber (reg:SI 1))
7933 (clobber (reg:SI 2))
7935 (use (const_int 1))])]
7939 [(parallel [(call (mem:SI (reg:SI 22))
7940 (match_operand 0 "" ""))
7941 (clobber (reg:SI 1))
7942 (clobber (reg:SI 2))
7943 (clobber (match_operand 1))
7945 (use (const_int 1))])]
7946 "!TARGET_64BIT && reload_completed"
7947 [(set (match_dup 1) (reg:SI 19))
7948 (parallel [(call (mem:SI (reg:SI 22))
7950 (clobber (reg:SI 1))
7951 (clobber (reg:SI 2))
7953 (use (const_int 1))])
7954 (set (reg:SI 19) (match_dup 1))]
7957 (define_insn "*call_reg_pic_post_reload"
7958 [(call (mem:SI (reg:SI 22))
7959 (match_operand 0 "" "i"))
7960 (clobber (reg:SI 1))
7961 (clobber (reg:SI 2))
7963 (use (const_int 1))]
7967 return pa_output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
7969 [(set_attr "type" "dyncall")
7970 (set (attr "length")
7971 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
7972 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
7974 ;; This pattern is split if it is necessary to save and restore the
7976 (define_insn "call_reg_64bit"
7977 [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
7978 (match_operand 1 "" "i"))
7979 (clobber (reg:DI 2))
7980 (clobber (match_operand 2))
7983 (use (const_int 1))]
7987 ;; Split out the PIC register save and restore after reload. As the
7988 ;; split is done after reload, there are some situations in which we
7989 ;; unnecessarily save and restore %r4. This happens when there is a
7990 ;; single call and the PIC register is not used after the call.
7992 ;; The split has to be done since call_from_call_insn () can't handle
7993 ;; the pattern as is. Noreturn calls are special because they have to
7994 ;; terminate the basic block. The split has to contain more than one
7997 [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
7998 (match_operand 1 "" ""))
7999 (clobber (reg:DI 2))
8000 (clobber (match_operand 2))
8003 (use (const_int 1))])]
8004 "TARGET_64BIT && reload_completed
8005 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8006 [(set (match_dup 2) (reg:DI 27))
8007 (parallel [(call (mem:SI (match_dup 0))
8009 (clobber (reg:DI 2))
8012 (use (const_int 1))])]
8016 [(parallel [(call (mem:SI (match_operand 0 "register_operand" ""))
8017 (match_operand 1 "" ""))
8018 (clobber (reg:DI 2))
8019 (clobber (match_operand 2))
8022 (use (const_int 1))])]
8023 "TARGET_64BIT && reload_completed"
8024 [(set (match_dup 2) (reg:DI 27))
8025 (parallel [(call (mem:SI (match_dup 0))
8027 (clobber (reg:DI 2))
8030 (use (const_int 1))])
8031 (set (reg:DI 27) (match_dup 2))]
8034 (define_insn "*call_reg_64bit_post_reload"
8035 [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
8036 (match_operand 1 "" "i"))
8037 (clobber (reg:DI 2))
8040 (use (const_int 1))]
8044 return pa_output_indirect_call (insn, operands[0]);
8046 [(set_attr "type" "dyncall")
8047 (set (attr "length")
8048 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 12)]
8049 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
8051 (define_expand "call_value"
8052 [(parallel [(set (match_operand 0 "" "")
8053 (call (match_operand:SI 1 "" "")
8054 (match_operand 2 "" "")))
8055 (clobber (reg:SI 2))])]
8059 rtx dst = operands[0];
8060 rtx nb = operands[2];
8061 bool call_powf = false;
8063 if (TARGET_PORTABLE_RUNTIME)
8064 op = force_reg (SImode, XEXP (operands[1], 0));
8067 op = XEXP (operands[1], 0);
8068 if (GET_CODE (op) == SYMBOL_REF)
8070 /* Handle special call to buggy powf function. */
8071 if (TARGET_HPUX && !TARGET_SOFT_FLOAT
8072 && !strcmp (targetm.strip_name_encoding (XSTR (op, 0)), "powf"))
8075 /* Generate indirect long calls to non-local functions. */
8076 else if (TARGET_LONG_CALLS)
8078 tree call_decl = SYMBOL_REF_DECL (op);
8079 if (!(call_decl && targetm.binds_local_p (call_decl)))
8080 op = force_reg (word_mode, op);
8087 if (!virtuals_instantiated)
8088 emit_move_insn (arg_pointer_rtx,
8089 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
8093 /* The loop pass can generate new libcalls after the virtual
8094 registers are instantiated when fpregs are disabled because
8095 the only method that we have for doing DImode multiplication
8096 is with a libcall. This could be trouble if we haven't
8097 allocated enough space for the outgoing arguments. */
8098 gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
8100 emit_move_insn (arg_pointer_rtx,
8101 gen_rtx_PLUS (word_mode, stack_pointer_rtx,
8102 GEN_INT (STACK_POINTER_OFFSET + 64)));
8106 /* Use two different patterns for calls to explicitly named functions
8107 and calls through function pointers. This is necessary as these two
8108 types of calls use different calling conventions, and CSE might try
8109 to change the named call into an indirect call in some cases (using
8110 two patterns keeps CSE from performing this optimization).
8112 We now use even more call patterns as there was a subtle bug in
8113 attempting to restore the pic register after a call using a simple
8114 move insn. During reload, a instruction involving a pseudo register
8115 with no explicit dependence on the PIC register can be converted
8116 to an equivalent load from memory using the PIC register. If we
8117 emit a simple move to restore the PIC register in the initial rtl
8118 generation, then it can potentially be repositioned during scheduling.
8119 and an instruction that eventually uses the PIC register may end up
8120 between the call and the PIC register restore.
8122 This only worked because there is a post call group of instructions
8123 that are scheduled with the call. These instructions are included
8124 in the same basic block as the call. However, calls can throw in
8125 C++ code and a basic block has to terminate at the call if the call
8126 can throw. This results in the PIC register restore being scheduled
8127 independently from the call. So, we now hide the save and restore
8128 of the PIC register in the call pattern until after reload. Then,
8129 we split the moves out. A small side benefit is that we now don't
8130 need to have a use of the PIC register in the return pattern and
8131 the final save/restore operation is not needed.
8133 I elected to just use register %r4 in the PIC patterns instead
8134 of trying to force hppa_pic_save_rtx () to a callee saved register.
8135 This might have required a new register class and constraint. It
8136 was also simpler to just handle the restore from a register than a
8140 rtx r4 = gen_rtx_REG (word_mode, 4);
8141 if (GET_CODE (op) == SYMBOL_REF)
8144 emit_call_insn (gen_call_val_powf_64bit (dst, op, nb, r4));
8146 emit_call_insn (gen_call_val_symref_64bit (dst, op, nb, r4));
8150 op = force_reg (word_mode, op);
8151 emit_call_insn (gen_call_val_reg_64bit (dst, op, nb, r4));
8156 if (GET_CODE (op) == SYMBOL_REF)
8160 rtx r4 = gen_rtx_REG (word_mode, 4);
8163 emit_call_insn (gen_call_val_powf_pic (dst, op, nb, r4));
8165 emit_call_insn (gen_call_val_symref_pic (dst, op, nb, r4));
8170 emit_call_insn (gen_call_val_powf (dst, op, nb));
8172 emit_call_insn (gen_call_val_symref (dst, op, nb));
8177 rtx tmpreg = gen_rtx_REG (word_mode, 22);
8178 emit_move_insn (tmpreg, force_reg (word_mode, op));
8181 rtx r4 = gen_rtx_REG (word_mode, 4);
8182 emit_call_insn (gen_call_val_reg_pic (dst, nb, r4));
8185 emit_call_insn (gen_call_val_reg (dst, nb));
8192 (define_insn "call_val_symref"
8193 [(set (match_operand 0 "" "")
8194 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8195 (match_operand 2 "" "i")))
8196 (clobber (reg:SI 1))
8197 (clobber (reg:SI 2))
8198 (use (const_int 0))]
8199 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8202 pa_output_arg_descriptor (insn);
8203 return pa_output_call (insn, operands[1], 0);
8205 [(set_attr "type" "call")
8206 (set (attr "length")
8207 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8208 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8210 ;; powf function clobbers %fr12
8211 (define_insn "call_val_powf"
8212 [(set (match_operand 0 "" "")
8213 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8214 (match_operand 2 "" "i")))
8215 (clobber (reg:SI 1))
8216 (clobber (reg:SI 2))
8217 (clobber (reg:DF 48))
8218 (use (const_int 1))]
8219 "TARGET_HPUX && !TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8222 pa_output_arg_descriptor (insn);
8223 return pa_output_call (insn, operands[1], 0);
8225 [(set_attr "type" "call")
8226 (set (attr "length")
8227 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8228 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8230 (define_insn "call_val_symref_pic"
8231 [(set (match_operand 0 "" "")
8232 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8233 (match_operand 2 "" "i")))
8234 (clobber (reg:SI 1))
8235 (clobber (reg:SI 2))
8236 (clobber (match_operand 3))
8238 (use (const_int 0))]
8239 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8242 ;; Split out the PIC register save and restore after reload. As the
8243 ;; split is done after reload, there are some situations in which we
8244 ;; unnecessarily save and restore %r4. This happens when there is a
8245 ;; single call and the PIC register is not used after the call.
8247 ;; The split has to be done since call_from_call_insn () can't handle
8248 ;; the pattern as is. Noreturn calls are special because they have to
8249 ;; terminate the basic block. The split has to contain more than one
8252 [(parallel [(set (match_operand 0 "" "")
8253 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8254 (match_operand 2 "" "")))
8255 (clobber (reg:SI 1))
8256 (clobber (reg:SI 2))
8257 (clobber (match_operand 3))
8259 (use (const_int 0))])]
8260 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
8261 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8262 [(set (match_dup 3) (reg:SI 19))
8263 (parallel [(set (match_dup 0)
8264 (call (mem:SI (match_dup 1))
8266 (clobber (reg:SI 1))
8267 (clobber (reg:SI 2))
8269 (use (const_int 0))])]
8273 [(parallel [(set (match_operand 0 "" "")
8274 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8275 (match_operand 2 "" "")))
8276 (clobber (reg:SI 1))
8277 (clobber (reg:SI 2))
8278 (clobber (match_operand 3))
8280 (use (const_int 0))])]
8281 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
8282 [(set (match_dup 3) (reg:SI 19))
8283 (parallel [(set (match_dup 0)
8284 (call (mem:SI (match_dup 1))
8286 (clobber (reg:SI 1))
8287 (clobber (reg:SI 2))
8289 (use (const_int 0))])
8290 (set (reg:SI 19) (match_dup 3))]
8293 (define_insn "*call_val_symref_pic_post_reload"
8294 [(set (match_operand 0 "" "")
8295 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8296 (match_operand 2 "" "i")))
8297 (clobber (reg:SI 1))
8298 (clobber (reg:SI 2))
8300 (use (const_int 0))]
8301 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8304 pa_output_arg_descriptor (insn);
8305 return pa_output_call (insn, operands[1], 0);
8307 [(set_attr "type" "call")
8308 (set (attr "length")
8309 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8310 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8312 ;; powf function clobbers %fr12
8313 (define_insn "call_val_powf_pic"
8314 [(set (match_operand 0 "" "")
8315 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8316 (match_operand 2 "" "i")))
8317 (clobber (reg:SI 1))
8318 (clobber (reg:SI 2))
8319 (clobber (reg:DF 48))
8320 (clobber (match_operand 3))
8322 (use (const_int 1))]
8323 "TARGET_HPUX && !TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8326 ;; Split out the PIC register save and restore after reload. As the
8327 ;; split is done after reload, there are some situations in which we
8328 ;; unnecessarily save and restore %r4. This happens when there is a
8329 ;; single call and the PIC register is not used after the call.
8331 ;; The split has to be done since call_from_call_insn () can't handle
8332 ;; the pattern as is. Noreturn calls are special because they have to
8333 ;; terminate the basic block. The split has to contain more than one
8336 [(parallel [(set (match_operand 0 "" "")
8337 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8338 (match_operand 2 "" "")))
8339 (clobber (reg:SI 1))
8340 (clobber (reg:SI 2))
8341 (clobber (reg:DF 48))
8342 (clobber (match_operand 3))
8344 (use (const_int 1))])]
8345 "TARGET_HPUX && !TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed
8346 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8347 [(set (match_dup 3) (reg:SI 19))
8348 (parallel [(set (match_dup 0)
8349 (call (mem:SI (match_dup 1))
8351 (clobber (reg:SI 1))
8352 (clobber (reg:SI 2))
8353 (clobber (reg:DF 48))
8355 (use (const_int 1))])]
8359 [(parallel [(set (match_operand 0 "" "")
8360 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8361 (match_operand 2 "" "")))
8362 (clobber (reg:SI 1))
8363 (clobber (reg:SI 2))
8364 (clobber (reg:DF 48))
8365 (clobber (match_operand 3))
8367 (use (const_int 1))])]
8368 "TARGET_HPUX && !TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
8369 [(set (match_dup 3) (reg:SI 19))
8370 (parallel [(set (match_dup 0)
8371 (call (mem:SI (match_dup 1))
8373 (clobber (reg:SI 1))
8374 (clobber (reg:SI 2))
8375 (clobber (reg:DF 48))
8377 (use (const_int 1))])
8378 (set (reg:SI 19) (match_dup 3))]
8381 (define_insn "*call_val_powf_pic_post_reload"
8382 [(set (match_operand 0 "" "")
8383 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8384 (match_operand 2 "" "i")))
8385 (clobber (reg:SI 1))
8386 (clobber (reg:SI 2))
8387 (clobber (reg:DF 48))
8389 (use (const_int 1))]
8390 "TARGET_HPUX && !TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8393 pa_output_arg_descriptor (insn);
8394 return pa_output_call (insn, operands[1], 0);
8396 [(set_attr "type" "call")
8397 (set (attr "length")
8398 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8399 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8401 ;; This pattern is split if it is necessary to save and restore the
8403 (define_insn "call_val_symref_64bit"
8404 [(set (match_operand 0 "" "")
8405 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8406 (match_operand 2 "" "i")))
8407 (clobber (reg:DI 1))
8408 (clobber (reg:DI 2))
8409 (clobber (match_operand 3))
8412 (use (const_int 0))]
8416 ;; Split out the PIC register save and restore after reload. As the
8417 ;; split is done after reload, there are some situations in which we
8418 ;; unnecessarily save and restore %r4. This happens when there is a
8419 ;; single call and the PIC register is not used after the call.
8421 ;; The split has to be done since call_from_call_insn () can't handle
8422 ;; the pattern as is. Noreturn calls are special because they have to
8423 ;; terminate the basic block. The split has to contain more than one
8426 [(parallel [(set (match_operand 0 "" "")
8427 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8428 (match_operand 2 "" "")))
8429 (clobber (reg:DI 1))
8430 (clobber (reg:DI 2))
8431 (clobber (match_operand 3))
8434 (use (const_int 0))])]
8435 "TARGET_64BIT && reload_completed
8436 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8437 [(set (match_dup 3) (reg:DI 27))
8438 (parallel [(set (match_dup 0)
8439 (call (mem:SI (match_dup 1))
8441 (clobber (reg:DI 1))
8442 (clobber (reg:DI 2))
8445 (use (const_int 0))])]
8449 [(parallel [(set (match_operand 0 "" "")
8450 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8451 (match_operand 2 "" "")))
8452 (clobber (reg:DI 1))
8453 (clobber (reg:DI 2))
8454 (clobber (match_operand 3))
8457 (use (const_int 0))])]
8458 "TARGET_64BIT && reload_completed"
8459 [(set (match_dup 3) (reg:DI 27))
8460 (parallel [(set (match_dup 0)
8461 (call (mem:SI (match_dup 1))
8463 (clobber (reg:DI 1))
8464 (clobber (reg:DI 2))
8467 (use (const_int 0))])
8468 (set (reg:DI 27) (match_dup 3))]
8471 (define_insn "*call_val_symref_64bit_post_reload"
8472 [(set (match_operand 0 "" "")
8473 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8474 (match_operand 2 "" "i")))
8475 (clobber (reg:DI 1))
8476 (clobber (reg:DI 2))
8479 (use (const_int 0))]
8483 return pa_output_call (insn, operands[1], 0);
8485 [(set_attr "type" "call")
8486 (set (attr "length")
8487 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8488 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8490 ;; powf function clobbers %fr12
8491 (define_insn "call_val_powf_64bit"
8492 [(set (match_operand 0 "" "")
8493 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8494 (match_operand 2 "" "i")))
8495 (clobber (reg:DI 1))
8496 (clobber (reg:DI 2))
8497 (clobber (reg:DF 40))
8498 (clobber (match_operand 3))
8501 (use (const_int 1))]
8502 "TARGET_64BIT && TARGET_HPUX"
8505 ;; Split out the PIC register save and restore after reload. As the
8506 ;; split is done after reload, there are some situations in which we
8507 ;; unnecessarily save and restore %r4. This happens when there is a
8508 ;; single call and the PIC register is not used after the call.
8510 ;; The split has to be done since call_from_call_insn () can't handle
8511 ;; the pattern as is. Noreturn calls are special because they have to
8512 ;; terminate the basic block. The split has to contain more than one
8515 [(parallel [(set (match_operand 0 "" "")
8516 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8517 (match_operand 2 "" "")))
8518 (clobber (reg:DI 1))
8519 (clobber (reg:DI 2))
8520 (clobber (reg:DF 40))
8521 (clobber (match_operand 3))
8524 (use (const_int 1))])]
8525 "TARGET_64BIT && TARGET_HPUX && reload_completed
8526 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8527 [(set (match_dup 3) (reg:DI 27))
8528 (parallel [(set (match_dup 0)
8529 (call (mem:SI (match_dup 1))
8531 (clobber (reg:DI 1))
8532 (clobber (reg:DI 2))
8533 (clobber (reg:DF 40))
8536 (use (const_int 1))])]
8540 [(parallel [(set (match_operand 0 "" "")
8541 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8542 (match_operand 2 "" "")))
8543 (clobber (reg:DI 1))
8544 (clobber (reg:DI 2))
8545 (clobber (reg:DF 40))
8546 (clobber (match_operand 3))
8549 (use (const_int 1))])]
8550 "TARGET_64BIT && TARGET_HPUX && reload_completed"
8551 [(set (match_dup 3) (reg:DI 27))
8552 (parallel [(set (match_dup 0)
8553 (call (mem:SI (match_dup 1))
8555 (clobber (reg:DI 1))
8556 (clobber (reg:DI 2))
8557 (clobber (reg:DF 40))
8560 (use (const_int 1))])
8561 (set (reg:DI 27) (match_dup 3))]
8564 (define_insn "*call_val_powf_64bit_post_reload"
8565 [(set (match_operand 0 "" "")
8566 (call (mem:SI (match_operand 1 "call_operand_address" ""))
8567 (match_operand 2 "" "i")))
8568 (clobber (reg:DI 1))
8569 (clobber (reg:DI 2))
8570 (clobber (reg:DF 40))
8573 (use (const_int 1))]
8574 "TARGET_64BIT && TARGET_HPUX"
8577 return pa_output_call (insn, operands[1], 0);
8579 [(set_attr "type" "call")
8580 (set (attr "length")
8581 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8582 (symbol_ref "pa_attr_length_call (insn, 0)")))])
8584 (define_insn "call_val_reg"
8585 [(set (match_operand 0 "" "")
8586 (call (mem:SI (reg:SI 22))
8587 (match_operand 1 "" "i")))
8588 (clobber (reg:SI 1))
8589 (clobber (reg:SI 2))
8590 (use (const_int 1))]
8594 return pa_output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
8596 [(set_attr "type" "dyncall")
8597 (set (attr "length")
8598 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8599 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
8601 ;; This pattern is split if it is necessary to save and restore the
8603 (define_insn "call_val_reg_pic"
8604 [(set (match_operand 0 "" "")
8605 (call (mem:SI (reg:SI 22))
8606 (match_operand 1 "" "i")))
8607 (clobber (reg:SI 1))
8608 (clobber (reg:SI 2))
8609 (clobber (match_operand 2))
8611 (use (const_int 1))]
8615 ;; Split out the PIC register save and restore after reload. As the
8616 ;; split is done after reload, there are some situations in which we
8617 ;; unnecessarily save and restore %r4. This happens when there is a
8618 ;; single call and the PIC register is not used after the call.
8620 ;; The split has to be done since call_from_call_insn () can't handle
8621 ;; the pattern as is. Noreturn calls are special because they have to
8622 ;; terminate the basic block. The split has to contain more than one
8625 [(parallel [(set (match_operand 0 "" "")
8626 (call (mem:SI (reg:SI 22))
8627 (match_operand 1 "" "")))
8628 (clobber (reg:SI 1))
8629 (clobber (reg:SI 2))
8630 (clobber (match_operand 2))
8632 (use (const_int 1))])]
8633 "!TARGET_64BIT && reload_completed
8634 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8635 [(set (match_dup 2) (reg:SI 19))
8636 (parallel [(set (match_dup 0)
8637 (call (mem:SI (reg:SI 22))
8639 (clobber (reg:SI 1))
8640 (clobber (reg:SI 2))
8642 (use (const_int 1))])]
8646 [(parallel [(set (match_operand 0 "" "")
8647 (call (mem:SI (reg:SI 22))
8648 (match_operand 1 "" "")))
8649 (clobber (reg:SI 1))
8650 (clobber (reg:SI 2))
8651 (clobber (match_operand 2))
8653 (use (const_int 1))])]
8654 "!TARGET_64BIT && reload_completed"
8655 [(set (match_dup 2) (reg:SI 19))
8656 (parallel [(set (match_dup 0)
8657 (call (mem:SI (reg:SI 22))
8659 (clobber (reg:SI 1))
8660 (clobber (reg:SI 2))
8662 (use (const_int 1))])
8663 (set (reg:SI 19) (match_dup 2))]
8666 (define_insn "*call_val_reg_pic_post_reload"
8667 [(set (match_operand 0 "" "")
8668 (call (mem:SI (reg:SI 22))
8669 (match_operand 1 "" "i")))
8670 (clobber (reg:SI 1))
8671 (clobber (reg:SI 2))
8673 (use (const_int 1))]
8677 return pa_output_indirect_call (insn, gen_rtx_REG (word_mode, 22));
8679 [(set_attr "type" "dyncall")
8680 (set (attr "length")
8681 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
8682 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
8684 ;; This pattern is split if it is necessary to save and restore the
8686 (define_insn "call_val_reg_64bit"
8687 [(set (match_operand 0 "" "")
8688 (call (mem:SI (match_operand:DI 1 "register_operand" "r"))
8689 (match_operand 2 "" "i")))
8690 (clobber (reg:DI 2))
8691 (clobber (match_operand 3))
8694 (use (const_int 1))]
8698 ;; Split out the PIC register save and restore after reload. As the
8699 ;; split is done after reload, there are some situations in which we
8700 ;; unnecessarily save and restore %r4. This happens when there is a
8701 ;; single call and the PIC register is not used after the call.
8703 ;; The split has to be done since call_from_call_insn () can't handle
8704 ;; the pattern as is. Noreturn calls are special because they have to
8705 ;; terminate the basic block. The split has to contain more than one
8708 [(parallel [(set (match_operand 0 "" "")
8709 (call (mem:SI (match_operand:DI 1 "register_operand" ""))
8710 (match_operand 2 "" "")))
8711 (clobber (reg:DI 2))
8712 (clobber (match_operand 3))
8715 (use (const_int 1))])]
8716 "TARGET_64BIT && reload_completed
8717 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
8718 [(set (match_dup 3) (reg:DI 27))
8719 (parallel [(set (match_dup 0)
8720 (call (mem:SI (match_dup 1))
8722 (clobber (reg:DI 2))
8725 (use (const_int 1))])]
8729 [(parallel [(set (match_operand 0 "" "")
8730 (call (mem:SI (match_operand:DI 1 "register_operand" ""))
8731 (match_operand 2 "" "")))
8732 (clobber (reg:DI 2))
8733 (clobber (match_operand 3))
8736 (use (const_int 1))])]
8737 "TARGET_64BIT && reload_completed"
8738 [(set (match_dup 3) (reg:DI 27))
8739 (parallel [(set (match_dup 0)
8740 (call (mem:SI (match_dup 1))
8742 (clobber (reg:DI 2))
8745 (use (const_int 1))])
8746 (set (reg:DI 27) (match_dup 3))]
8749 (define_insn "*call_val_reg_64bit_post_reload"
8750 [(set (match_operand 0 "" "")
8751 (call (mem:SI (match_operand:DI 1 "register_operand" "r"))
8752 (match_operand 2 "" "i")))
8753 (clobber (reg:DI 2))
8756 (use (const_int 1))]
8760 return pa_output_indirect_call (insn, operands[1]);
8762 [(set_attr "type" "dyncall")
8763 (set (attr "length")
8764 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 12)]
8765 (symbol_ref "pa_attr_length_indirect_call (insn)")))])
8767 /* Expand special pc-relative call to _mcount. */
8769 (define_expand "call_mcount"
8770 [(parallel [(call (match_operand:SI 0 "" "")
8771 (match_operand 1 "" ""))
8774 (minus:SI (match_operand 2 "" "")
8775 (plus:SI (pc) (const_int 4)))))
8776 (clobber (reg:SI 2))])]
8777 "!TARGET_PORTABLE_RUNTIME"
8780 rtx op = XEXP (operands[0], 0);
8781 rtx nb = operands[1];
8782 rtx lab = operands[2];
8786 rtx r4 = gen_rtx_REG (word_mode, 4);
8787 emit_move_insn (arg_pointer_rtx,
8788 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
8790 emit_call_insn (gen_call_mcount_64bit (op, nb, lab, r4));
8796 rtx r4 = gen_rtx_REG (word_mode, 4);
8797 emit_call_insn (gen_call_mcount_pic (op, nb, lab, r4));
8800 emit_call_insn (gen_call_mcount_nonpic (op, nb, lab));
8806 (define_insn "call_mcount_nonpic"
8807 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8808 (match_operand 1 "" "i"))
8811 (minus:SI (match_operand 2 "" "")
8812 (plus:SI (pc) (const_int 4)))))
8813 (clobber (reg:SI 2))]
8814 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8817 pa_output_arg_descriptor (insn);
8818 return \"{bl|b,l} %0,%%r2\;ldo %2-.-4(%%r2),%%r25\";
8820 [(set_attr "type" "multi")
8821 (set_attr "length" "8")])
8823 (define_insn "call_mcount_pic"
8824 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8825 (match_operand 1 "" "i"))
8828 (minus:SI (match_operand 2 "" "")
8829 (plus:SI (pc) (const_int 4)))))
8830 (clobber (reg:SI 2))
8831 (clobber (match_operand 3))
8833 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8837 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8838 (match_operand 1 "" ""))
8841 (minus:SI (match_operand 2 "" "")
8842 (plus:SI (pc) (const_int 4)))))
8843 (clobber (reg:SI 2))
8844 (clobber (match_operand 3))
8845 (use (reg:SI 19))])]
8846 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && reload_completed"
8847 [(set (match_dup 3) (reg:SI 19))
8848 (parallel [(call (mem:SI (match_dup 0))
8852 (minus:SI (match_dup 2)
8853 (plus:SI (pc) (const_int 4)))))
8854 (clobber (reg:SI 2))
8856 (set (reg:SI 19) (match_dup 3))]
8859 (define_insn "*call_mcount_pic_post_reload"
8860 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8861 (match_operand 1 "" "i"))
8864 (minus:SI (match_operand 2 "" "")
8865 (plus:SI (pc) (const_int 4)))))
8866 (clobber (reg:SI 2))
8868 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
8871 pa_output_arg_descriptor (insn);
8872 return \"{bl|b,l} %0,%%r2\;ldo %2-.-4(%%r2),%%r25\";
8874 [(set_attr "type" "multi")
8875 (set_attr "length" "8")])
8877 (define_insn "call_mcount_64bit"
8878 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8879 (match_operand 1 "" "i"))
8882 (minus:SI (match_operand 2 "" "")
8883 (plus:SI (pc) (const_int 4)))))
8884 (clobber (reg:DI 2))
8885 (clobber (match_operand 3))
8892 [(parallel [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8893 (match_operand 1 "" ""))
8896 (minus:SI (match_operand 2 "" "")
8897 (plus:SI (pc) (const_int 4)))))
8898 (clobber (reg:DI 2))
8899 (clobber (match_operand 3))
8901 (use (reg:DI 29))])]
8902 "TARGET_64BIT && reload_completed"
8903 [(set (match_dup 3) (reg:DI 27))
8904 (parallel [(call (mem:SI (match_dup 0))
8908 (minus:SI (match_dup 2)
8909 (plus:SI (pc) (const_int 4)))))
8910 (clobber (reg:DI 2))
8913 (set (reg:DI 27) (match_dup 3))]
8916 (define_insn "*call_mcount_64bit_post_reload"
8917 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
8918 (match_operand 1 "" "i"))
8921 (minus:SI (match_operand 2 "" "")
8922 (plus:SI (pc) (const_int 4)))))
8923 (clobber (reg:DI 2))
8927 "{bl|b,l} %0,%%r2\;ldo %2-.-4(%%r2),%%r25"
8928 [(set_attr "type" "multi")
8929 (set_attr "length" "8")])
8931 ;; Call subroutine returning any type.
8933 (define_expand "untyped_call"
8934 [(parallel [(call (match_operand 0 "" "")
8936 (match_operand 1 "" "")
8937 (match_operand 2 "" "")])]
8943 emit_call_insn (gen_call (operands[0], const0_rtx));
8945 for (i = 0; i < XVECLEN (operands[2], 0); i++)
8947 rtx set = XVECEXP (operands[2], 0, i);
8948 emit_move_insn (SET_DEST (set), SET_SRC (set));
8951 /* The optimizer does not know that the call sets the function value
8952 registers we stored in the result block. We avoid problems by
8953 claiming that all hard registers are used and clobbered at this
8955 emit_insn (gen_blockage ());
8960 (define_expand "sibcall"
8961 [(call (match_operand:SI 0 "" "")
8962 (match_operand 1 "" ""))]
8963 "!TARGET_PORTABLE_RUNTIME"
8967 rtx nb = operands[1];
8969 op = XEXP (operands[0], 0);
8973 if (!virtuals_instantiated)
8974 emit_move_insn (arg_pointer_rtx,
8975 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
8979 /* The loop pass can generate new libcalls after the virtual
8980 registers are instantiated when fpregs are disabled because
8981 the only method that we have for doing DImode multiplication
8982 is with a libcall. This could be trouble if we haven't
8983 allocated enough space for the outgoing arguments. */
8984 gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
8986 emit_move_insn (arg_pointer_rtx,
8987 gen_rtx_PLUS (word_mode, stack_pointer_rtx,
8988 GEN_INT (STACK_POINTER_OFFSET + 64)));
8992 /* Indirect sibling calls are not allowed. */
8994 call_insn = gen_sibcall_internal_symref_64bit (op, operands[1]);
8996 call_insn = gen_sibcall_internal_symref (op, operands[1]);
8998 call_insn = emit_call_insn (call_insn);
9001 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
9003 /* We don't have to restore the PIC register. */
9005 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
9010 (define_insn "sibcall_internal_symref"
9011 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
9012 (match_operand 1 "" "i"))
9013 (clobber (reg:SI 1))
9015 (use (const_int 0))]
9016 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
9019 pa_output_arg_descriptor (insn);
9020 return pa_output_call (insn, operands[0], 1);
9022 [(set_attr "type" "sibcall")
9023 (set (attr "length")
9024 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
9025 (symbol_ref "pa_attr_length_call (insn, 1)")))])
9027 (define_insn "sibcall_internal_symref_64bit"
9028 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
9029 (match_operand 1 "" "i"))
9030 (clobber (reg:DI 1))
9032 (use (const_int 0))]
9036 return pa_output_call (insn, operands[0], 1);
9038 [(set_attr "type" "sibcall")
9039 (set (attr "length")
9040 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
9041 (symbol_ref "pa_attr_length_call (insn, 1)")))])
9043 (define_expand "sibcall_value"
9044 [(set (match_operand 0 "" "")
9045 (call (match_operand:SI 1 "" "")
9046 (match_operand 2 "" "")))]
9047 "!TARGET_PORTABLE_RUNTIME"
9051 rtx nb = operands[1];
9053 op = XEXP (operands[1], 0);
9057 if (!virtuals_instantiated)
9058 emit_move_insn (arg_pointer_rtx,
9059 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
9063 /* The loop pass can generate new libcalls after the virtual
9064 registers are instantiated when fpregs are disabled because
9065 the only method that we have for doing DImode multiplication
9066 is with a libcall. This could be trouble if we haven't
9067 allocated enough space for the outgoing arguments. */
9068 gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
9070 emit_move_insn (arg_pointer_rtx,
9071 gen_rtx_PLUS (word_mode, stack_pointer_rtx,
9072 GEN_INT (STACK_POINTER_OFFSET + 64)));
9076 /* Indirect sibling calls are not allowed. */
9079 = gen_sibcall_value_internal_symref_64bit (operands[0], op, operands[2]);
9082 = gen_sibcall_value_internal_symref (operands[0], op, operands[2]);
9084 call_insn = emit_call_insn (call_insn);
9087 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
9089 /* We don't have to restore the PIC register. */
9091 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
9096 (define_insn "sibcall_value_internal_symref"
9097 [(set (match_operand 0 "" "")
9098 (call (mem:SI (match_operand 1 "call_operand_address" ""))
9099 (match_operand 2 "" "i")))
9100 (clobber (reg:SI 1))
9102 (use (const_int 0))]
9103 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
9106 pa_output_arg_descriptor (insn);
9107 return pa_output_call (insn, operands[1], 1);
9109 [(set_attr "type" "sibcall")
9110 (set (attr "length")
9111 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
9112 (symbol_ref "pa_attr_length_call (insn, 1)")))])
9114 (define_insn "sibcall_value_internal_symref_64bit"
9115 [(set (match_operand 0 "" "")
9116 (call (mem:SI (match_operand 1 "call_operand_address" ""))
9117 (match_operand 2 "" "i")))
9118 (clobber (reg:DI 1))
9120 (use (const_int 0))]
9124 return pa_output_call (insn, operands[1], 1);
9126 [(set_attr "type" "sibcall")
9127 (set (attr "length")
9128 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 8)]
9129 (symbol_ref "pa_attr_length_call (insn, 1)")))])
9135 [(set_attr "type" "move")
9136 (set_attr "length" "4")])
9138 ;;; EH does longjmp's from and within the data section. Thus,
9139 ;;; an interspace branch is required for the longjmp implementation.
9140 ;;; Registers r1 and r2 are used as scratch registers for the jump
9142 (define_expand "interspace_jump"
9144 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
9145 (clobber (match_dup 1))])]
9149 operands[1] = gen_rtx_REG (word_mode, 2);
9153 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
9154 (clobber (reg:SI 2))]
9155 "TARGET_PA_20 && !TARGET_64BIT"
9157 [(set_attr "type" "branch")
9158 (set_attr "length" "4")])
9161 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
9162 (clobber (reg:SI 2))]
9163 "TARGET_NO_SPACE_REGS && !TARGET_64BIT"
9165 [(set_attr "type" "branch")
9166 (set_attr "length" "4")])
9169 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
9170 (clobber (reg:SI 2))]
9172 "ldsid (%%sr0,%0),%%r2\;mtsp %%r2,%%sr0\;be%* 0(%%sr0,%0)"
9173 [(set_attr "type" "branch")
9174 (set_attr "length" "12")])
9177 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
9178 (clobber (reg:DI 2))]
9181 [(set_attr "type" "branch")
9182 (set_attr "length" "4")])
9184 (define_expand "builtin_longjmp"
9185 [(unspec_volatile [(match_operand 0 "register_operand" "r")] UNSPECV_LONGJMP)]
9189 /* The elements of the buffer are, in order: */
9190 rtx fp = gen_rtx_MEM (Pmode, operands[0]);
9191 rtx lab = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0],
9192 POINTER_SIZE / BITS_PER_UNIT));
9193 rtx stack = gen_rtx_MEM (Pmode, plus_constant (Pmode, operands[0],
9194 (POINTER_SIZE * 2) / BITS_PER_UNIT));
9195 rtx pv = gen_rtx_REG (Pmode, 1);
9197 emit_clobber (gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode)));
9198 emit_clobber (gen_rtx_MEM (BLKmode, hard_frame_pointer_rtx));
9200 /* Load the label we are jumping through into r1 so that we know
9201 where to look for it when we get back to setjmp's function for
9202 restoring the gp. */
9203 emit_move_insn (pv, lab);
9205 /* Restore the stack and frame pointers. */
9206 fp = copy_to_reg (fp);
9207 emit_stack_restore (SAVE_NONLOCAL, stack);
9209 /* Ensure the frame pointer move is not optimized. */
9210 emit_insn (gen_blockage ());
9211 emit_clobber (hard_frame_pointer_rtx);
9212 emit_move_insn (hard_frame_pointer_rtx, fp);
9214 emit_use (hard_frame_pointer_rtx);
9215 emit_use (stack_pointer_rtx);
9217 /* Prevent the insns above from being scheduled into the delay slot
9218 of the interspace jump because the space register could change. */
9219 emit_insn (gen_blockage ());
9221 emit_jump_insn (gen_interspace_jump (pv));
9226 ;;; Operands 2 and 3 are assumed to be CONST_INTs.
9227 (define_expand "extzvsi"
9228 [(set (match_operand:SI 0 "register_operand" "")
9229 (zero_extract:SI (match_operand:SI 1 "register_operand" "")
9230 (match_operand:SI 2 "uint5_operand" "")
9231 (match_operand:SI 3 "uint5_operand" "")))]
9235 unsigned HOST_WIDE_INT len = UINTVAL (operands[2]);
9236 unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]);
9238 /* PA extraction insns don't support zero length bitfields or fields
9239 extending beyond the left or right-most bits. Also, the predicate
9240 rejects lengths equal to a word as they are better handled by
9241 the move patterns. */
9242 if (len == 0 || pos + len > 32)
9245 /* From mips.md: extract_bit_field doesn't verify that our source
9246 matches the predicate, so check it again here. */
9247 if (!register_operand (operands[1], VOIDmode))
9250 emit_insn (gen_extzv_32 (operands[0], operands[1],
9251 operands[2], operands[3]));
9255 (define_insn "extzv_32"
9256 [(set (match_operand:SI 0 "register_operand" "=r")
9257 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
9258 (match_operand:SI 2 "uint5_operand" "")
9259 (match_operand:SI 3 "uint5_operand" "")))]
9260 "UINTVAL (operands[2]) > 0
9261 && UINTVAL (operands[2]) + UINTVAL (operands[3]) <= 32"
9262 "{extru|extrw,u} %1,%3+%2-1,%2,%0"
9263 [(set_attr "type" "shift")
9264 (set_attr "length" "4")])
9267 [(set (match_operand:SI 0 "register_operand" "=r")
9268 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
9270 (match_operand:SI 2 "register_operand" "q")))]
9272 "{vextru %1,1,%0|extrw,u %1,%%sar,1,%0}"
9273 [(set_attr "type" "shift")
9274 (set_attr "length" "4")])
9276 (define_expand "extzvdi"
9277 [(set (match_operand:DI 0 "register_operand" "")
9278 (zero_extract:DI (match_operand:DI 1 "register_operand" "")
9279 (match_operand:DI 2 "uint6_operand" "")
9280 (match_operand:DI 3 "uint6_operand" "")))]
9284 unsigned HOST_WIDE_INT len = UINTVAL (operands[2]);
9285 unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]);
9287 /* PA extraction insns don't support zero length bitfields or fields
9288 extending beyond the left or right-most bits. Also, the predicate
9289 rejects lengths equal to a doubleword as they are better handled by
9290 the move patterns. */
9291 if (len == 0 || pos + len > 64)
9294 /* From mips.md: extract_bit_field doesn't verify that our source
9295 matches the predicate, so check it again here. */
9296 if (!register_operand (operands[1], VOIDmode))
9299 emit_insn (gen_extzv_64 (operands[0], operands[1],
9300 operands[2], operands[3]));
9304 (define_insn "extzv_64"
9305 [(set (match_operand:DI 0 "register_operand" "=r")
9306 (zero_extract:DI (match_operand:DI 1 "register_operand" "r")
9307 (match_operand:DI 2 "uint6_operand" "")
9308 (match_operand:DI 3 "uint6_operand" "")))]
9310 && UINTVAL (operands[2]) > 0
9311 && UINTVAL (operands[2]) + UINTVAL (operands[3]) <= 64"
9312 "extrd,u %1,%3+%2-1,%2,%0"
9313 [(set_attr "type" "shift")
9314 (set_attr "length" "4")])
9317 [(set (match_operand:DI 0 "register_operand" "=r")
9318 (zero_extract:DI (match_operand:DI 1 "register_operand" "r")
9320 (match_operand:DI 2 "register_operand" "q")))]
9322 "extrd,u %1,%%sar,1,%0"
9323 [(set_attr "type" "shift")
9324 (set_attr "length" "4")])
9326 ;;; Operands 2 and 3 are assumed to be CONST_INTs.
9327 (define_expand "extvsi"
9328 [(set (match_operand:SI 0 "register_operand" "")
9329 (sign_extract:SI (match_operand:SI 1 "register_operand" "")
9330 (match_operand:SI 2 "uint5_operand" "")
9331 (match_operand:SI 3 "uint5_operand" "")))]
9335 unsigned HOST_WIDE_INT len = UINTVAL (operands[2]);
9336 unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]);
9338 /* PA extraction insns don't support zero length bitfields or fields
9339 extending beyond the left or right-most bits. Also, the predicate
9340 rejects lengths equal to a word as they are better handled by
9341 the move patterns. */
9342 if (len == 0 || pos + len > 32)
9345 /* From mips.md: extract_bit_field doesn't verify that our source
9346 matches the predicate, so check it again here. */
9347 if (!register_operand (operands[1], VOIDmode))
9350 emit_insn (gen_extv_32 (operands[0], operands[1],
9351 operands[2], operands[3]));
9355 (define_insn "extv_32"
9356 [(set (match_operand:SI 0 "register_operand" "=r")
9357 (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
9358 (match_operand:SI 2 "uint5_operand" "")
9359 (match_operand:SI 3 "uint5_operand" "")))]
9360 "UINTVAL (operands[2]) > 0
9361 && UINTVAL (operands[2]) + UINTVAL (operands[3]) <= 32"
9362 "{extrs|extrw,s} %1,%3+%2-1,%2,%0"
9363 [(set_attr "type" "shift")
9364 (set_attr "length" "4")])
9367 [(set (match_operand:SI 0 "register_operand" "=r")
9368 (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
9370 (match_operand:SI 2 "register_operand" "q")))]
9372 "{vextrs %1,1,%0|extrw,s %1,%%sar,1,%0}"
9373 [(set_attr "type" "shift")
9374 (set_attr "length" "4")])
9376 (define_expand "extvdi"
9377 [(set (match_operand:DI 0 "register_operand" "")
9378 (sign_extract:DI (match_operand:DI 1 "register_operand" "")
9379 (match_operand:DI 2 "uint6_operand" "")
9380 (match_operand:DI 3 "uint6_operand" "")))]
9384 unsigned HOST_WIDE_INT len = UINTVAL (operands[2]);
9385 unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]);
9387 /* PA extraction insns don't support zero length bitfields or fields
9388 extending beyond the left or right-most bits. Also, the predicate
9389 rejects lengths equal to a doubleword as they are better handled by
9390 the move patterns. */
9391 if (len == 0 || pos + len > 64)
9394 /* From mips.md: extract_bit_field doesn't verify that our source
9395 matches the predicate, so check it again here. */
9396 if (!register_operand (operands[1], VOIDmode))
9399 emit_insn (gen_extv_64 (operands[0], operands[1],
9400 operands[2], operands[3]));
9404 (define_insn "extv_64"
9405 [(set (match_operand:DI 0 "register_operand" "=r")
9406 (sign_extract:DI (match_operand:DI 1 "register_operand" "r")
9407 (match_operand:DI 2 "uint6_operand" "")
9408 (match_operand:DI 3 "uint6_operand" "")))]
9410 && UINTVAL (operands[2]) > 0
9411 && UINTVAL (operands[2]) + UINTVAL (operands[3]) <= 64"
9412 "extrd,s %1,%3+%2-1,%2,%0"
9413 [(set_attr "type" "shift")
9414 (set_attr "length" "4")])
9417 [(set (match_operand:DI 0 "register_operand" "=r")
9418 (sign_extract:DI (match_operand:DI 1 "register_operand" "r")
9420 (match_operand:DI 2 "register_operand" "q")))]
9422 "extrd,s %1,%%sar,1,%0"
9423 [(set_attr "type" "shift")
9424 (set_attr "length" "4")])
9426 ;;; Operands 1 and 2 are assumed to be CONST_INTs.
9427 (define_expand "insvsi"
9428 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "")
9429 (match_operand:SI 1 "uint5_operand" "")
9430 (match_operand:SI 2 "uint5_operand" ""))
9431 (match_operand:SI 3 "arith5_operand" ""))]
9435 unsigned HOST_WIDE_INT len = UINTVAL (operands[1]);
9436 unsigned HOST_WIDE_INT pos = UINTVAL (operands[2]);
9438 /* PA insertion insns don't support zero length bitfields or fields
9439 extending beyond the left or right-most bits. Also, the predicate
9440 rejects lengths equal to a word as they are better handled by
9441 the move patterns. */
9442 if (len <= 0 || pos + len > 32)
9445 /* From mips.md: insert_bit_field doesn't verify that our destination
9446 matches the predicate, so check it again here. */
9447 if (!register_operand (operands[0], VOIDmode))
9450 emit_insn (gen_insv_32 (operands[0], operands[1],
9451 operands[2], operands[3]));
9455 (define_insn "insv_32"
9456 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r")
9457 (match_operand:SI 1 "uint5_operand" "")
9458 (match_operand:SI 2 "uint5_operand" ""))
9459 (match_operand:SI 3 "arith5_operand" "r,L"))]
9460 "UINTVAL (operands[1]) > 0
9461 && UINTVAL (operands[1]) + UINTVAL (operands[2]) <= 32"
9463 {dep|depw} %3,%2+%1-1,%1,%0
9464 {depi|depwi} %3,%2+%1-1,%1,%0"
9465 [(set_attr "type" "shift,shift")
9466 (set_attr "length" "4,4")])
9468 ;; Optimize insertion of const_int values of type 1...1xxxx.
9470 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
9471 (match_operand:SI 1 "uint5_operand" "")
9472 (match_operand:SI 2 "uint5_operand" ""))
9473 (match_operand:SI 3 "const_int_operand" ""))]
9474 "(INTVAL (operands[3]) & 0x10) != 0 &&
9475 (~INTVAL (operands[3]) & ((1L << INTVAL (operands[1])) - 1) & ~0xf) == 0"
9478 operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
9479 return \"{depi|depwi} %3,%2+%1-1,%1,%0\";
9481 [(set_attr "type" "shift")
9482 (set_attr "length" "4")])
9484 (define_expand "insvdi"
9485 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "")
9486 (match_operand:DI 1 "uint6_operand" "")
9487 (match_operand:DI 2 "uint6_operand" ""))
9488 (match_operand:DI 3 "arith5_operand" ""))]
9492 unsigned HOST_WIDE_INT len = UINTVAL (operands[1]);
9493 unsigned HOST_WIDE_INT pos = UINTVAL (operands[2]);
9495 /* PA insertion insns don't support zero length bitfields or fields
9496 extending beyond the left or right-most bits. Also, the predicate
9497 rejects lengths equal to a doubleword as they are better handled by
9498 the move patterns. */
9499 if (len <= 0 || pos + len > 64)
9502 /* From mips.md: insert_bit_field doesn't verify that our destination
9503 matches the predicate, so check it again here. */
9504 if (!register_operand (operands[0], VOIDmode))
9507 emit_insn (gen_insv_64 (operands[0], operands[1],
9508 operands[2], operands[3]));
9512 (define_insn "insv_64"
9513 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r,r")
9514 (match_operand:DI 1 "uint6_operand" "")
9515 (match_operand:DI 2 "uint6_operand" ""))
9516 (match_operand:DI 3 "arith5_operand" "r,L"))]
9518 && UINTVAL (operands[1]) > 0
9519 && UINTVAL (operands[1]) + UINTVAL (operands[2]) <= 64"
9521 depd %3,%2+%1-1,%1,%0
9522 depdi %3,%2+%1-1,%1,%0"
9523 [(set_attr "type" "shift,shift")
9524 (set_attr "length" "4,4")])
9526 ;; Optimize insertion of const_int values of type 1...1xxxx.
9528 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r")
9529 (match_operand:DI 1 "uint6_operand" "")
9530 (match_operand:DI 2 "uint6_operand" ""))
9531 (match_operand:DI 3 "const_int_operand" ""))]
9532 "(INTVAL (operands[3]) & 0x10) != 0
9534 && (~INTVAL (operands[3]) & ((1L << INTVAL (operands[1])) - 1) & ~0xf) == 0"
9537 operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
9538 return \"depdi %3,%2+%1-1,%1,%0\";
9540 [(set_attr "type" "shift")
9541 (set_attr "length" "4")])
9544 [(set (match_operand:DI 0 "register_operand" "=r")
9545 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
9548 "depd,z %1,31,32,%0"
9549 [(set_attr "type" "shift")
9550 (set_attr "length" "4")])
9552 ;; This insn is used for some loop tests, typically loops reversed when
9553 ;; strength reduction is used. It is actually created when the instruction
9554 ;; combination phase combines the special loop test. Since this insn
9555 ;; is both a jump insn and has an output, it must deal with its own
9556 ;; reloads, hence the `Q' constraints. The `!' constraints direct reload
9557 ;; to not choose the register alternatives in the event a reload is needed.
9558 (define_insn "decrement_and_branch_until_zero"
9561 (match_operator 2 "ordered_comparison_operator"
9563 (match_operand:SI 0 "reg_before_reload_operand" "+!r,!*f,*Q")
9564 (match_operand:SI 1 "int5_operand" "L,L,L"))
9566 (label_ref (match_operand 3 "" ""))
9569 (plus:SI (match_dup 0) (match_dup 1)))
9570 (clobber (match_scratch:SI 4 "=X,r,&r"))]
9572 "* return pa_output_dbra (operands, insn, which_alternative); "
9573 ;; Do not expect to understand this the first time through.
9574 [(set_attr "type" "cbranch,multi,multi")
9575 (set (attr "length")
9576 (if_then_else (eq_attr "alternative" "0")
9577 ;; Loop counter in register case
9578 ;; Short branch has length of 4
9579 ;; Long branch has length of 8, 20, 24 or 28
9580 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9581 (const_int MAX_12BIT_OFFSET))
9583 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9584 (const_int MAX_17BIT_OFFSET))
9586 (match_test "TARGET_PORTABLE_RUNTIME")
9588 (not (match_test "flag_pic"))
9592 ;; Loop counter in FP reg case.
9593 ;; Extra goo to deal with additional reload insns.
9594 (if_then_else (eq_attr "alternative" "1")
9595 (if_then_else (lt (match_dup 3) (pc))
9596 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
9597 (const_int MAX_12BIT_OFFSET))
9599 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
9600 (const_int MAX_17BIT_OFFSET))
9602 (match_test "TARGET_PORTABLE_RUNTIME")
9604 (not (match_test "flag_pic"))
9607 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9608 (const_int MAX_12BIT_OFFSET))
9610 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9611 (const_int MAX_17BIT_OFFSET))
9613 (match_test "TARGET_PORTABLE_RUNTIME")
9615 (not (match_test "flag_pic"))
9619 ;; Loop counter in memory case.
9620 ;; Extra goo to deal with additional reload insns.
9621 (if_then_else (lt (match_dup 3) (pc))
9622 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9623 (const_int MAX_12BIT_OFFSET))
9625 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9626 (const_int MAX_17BIT_OFFSET))
9628 (match_test "TARGET_PORTABLE_RUNTIME")
9630 (not (match_test "flag_pic"))
9633 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9634 (const_int MAX_12BIT_OFFSET))
9636 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9637 (const_int MAX_17BIT_OFFSET))
9639 (match_test "TARGET_PORTABLE_RUNTIME")
9641 (not (match_test "flag_pic"))
9643 (const_int 36))))))])
9648 (match_operator 2 "movb_comparison_operator"
9649 [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
9650 (label_ref (match_operand 3 "" ""))
9652 (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*Q,!*q")
9655 "* return pa_output_movb (operands, insn, which_alternative, 0); "
9656 ;; Do not expect to understand this the first time through.
9657 [(set_attr "type" "cbranch,multi,multi,multi")
9658 (set (attr "length")
9659 (if_then_else (eq_attr "alternative" "0")
9660 ;; Loop counter in register case
9661 ;; Short branch has length of 4
9662 ;; Long branch has length of 8, 20, 24 or 28
9663 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9664 (const_int MAX_12BIT_OFFSET))
9666 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9667 (const_int MAX_17BIT_OFFSET))
9669 (match_test "TARGET_PORTABLE_RUNTIME")
9671 (not (match_test "flag_pic"))
9675 ;; Loop counter in FP reg case.
9676 ;; Extra goo to deal with additional reload insns.
9677 (if_then_else (eq_attr "alternative" "1")
9678 (if_then_else (lt (match_dup 3) (pc))
9679 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9680 (const_int MAX_12BIT_OFFSET))
9682 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9683 (const_int MAX_17BIT_OFFSET))
9685 (match_test "TARGET_PORTABLE_RUNTIME")
9687 (not (match_test "flag_pic"))
9690 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9691 (const_int MAX_12BIT_OFFSET))
9693 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9694 (const_int MAX_17BIT_OFFSET))
9696 (match_test "TARGET_PORTABLE_RUNTIME")
9698 (not (match_test "flag_pic"))
9702 ;; Loop counter in memory or sar case.
9703 ;; Extra goo to deal with additional reload insns.
9704 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9705 (const_int MAX_12BIT_OFFSET))
9707 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9708 (const_int MAX_17BIT_OFFSET))
9710 (match_test "TARGET_PORTABLE_RUNTIME")
9712 (not (match_test "flag_pic"))
9714 (const_int 32)))))])
9716 ;; Handle negated branch.
9720 (match_operator 2 "movb_comparison_operator"
9721 [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
9723 (label_ref (match_operand 3 "" ""))))
9724 (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*Q,!*q")
9727 "* return pa_output_movb (operands, insn, which_alternative, 1); "
9728 ;; Do not expect to understand this the first time through.
9729 [(set_attr "type" "cbranch,multi,multi,multi")
9730 (set (attr "length")
9731 (if_then_else (eq_attr "alternative" "0")
9732 ;; Loop counter in register case
9733 ;; Short branch has length of 4
9734 ;; Long branch has length of 8
9735 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9736 (const_int MAX_12BIT_OFFSET))
9738 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9739 (const_int MAX_17BIT_OFFSET))
9741 (match_test "TARGET_PORTABLE_RUNTIME")
9743 (not (match_test "flag_pic"))
9747 ;; Loop counter in FP reg case.
9748 ;; Extra goo to deal with additional reload insns.
9749 (if_then_else (eq_attr "alternative" "1")
9750 (if_then_else (lt (match_dup 3) (pc))
9751 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9752 (const_int MAX_12BIT_OFFSET))
9754 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
9755 (const_int MAX_17BIT_OFFSET))
9757 (match_test "TARGET_PORTABLE_RUNTIME")
9759 (not (match_test "flag_pic"))
9762 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9763 (const_int MAX_12BIT_OFFSET))
9765 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9766 (const_int MAX_17BIT_OFFSET))
9768 (match_test "TARGET_PORTABLE_RUNTIME")
9770 (not (match_test "flag_pic"))
9774 ;; Loop counter in memory or SAR case.
9775 ;; Extra goo to deal with additional reload insns.
9776 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9777 (const_int MAX_12BIT_OFFSET))
9779 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9780 (const_int MAX_17BIT_OFFSET))
9782 (match_test "TARGET_PORTABLE_RUNTIME")
9784 (not (match_test "flag_pic"))
9786 (const_int 32)))))])
9789 [(set (pc) (label_ref (match_operand 3 "" "" )))
9790 (set (match_operand:SI 0 "ireg_operand" "=r")
9791 (plus:SI (match_operand:SI 1 "ireg_operand" "r")
9792 (match_operand:SI 2 "ireg_or_int5_operand" "rL")))]
9793 "(reload_completed && operands[0] == operands[1]) || operands[0] == operands[2]"
9796 return pa_output_parallel_addb (operands, insn);
9798 [(set_attr "type" "parallel_branch")
9799 (set (attr "length")
9800 (cond [(lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9801 (const_int MAX_12BIT_OFFSET))
9803 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
9804 (const_int MAX_17BIT_OFFSET))
9806 (match_test "TARGET_PORTABLE_RUNTIME")
9808 (not (match_test "flag_pic"))
9813 [(set (pc) (label_ref (match_operand 2 "" "" )))
9814 (set (match_operand:SF 0 "ireg_operand" "=r")
9815 (match_operand:SF 1 "ireg_or_int5_operand" "rL"))]
9819 return pa_output_parallel_movb (operands, insn);
9821 [(set_attr "type" "parallel_branch")
9822 (set (attr "length")
9823 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9824 (const_int MAX_12BIT_OFFSET))
9826 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9827 (const_int MAX_17BIT_OFFSET))
9829 (match_test "TARGET_PORTABLE_RUNTIME")
9831 (not (match_test "flag_pic"))
9836 [(set (pc) (label_ref (match_operand 2 "" "" )))
9837 (set (match_operand:SI 0 "ireg_operand" "=r")
9838 (match_operand:SI 1 "ireg_or_int5_operand" "rL"))]
9842 return pa_output_parallel_movb (operands, insn);
9844 [(set_attr "type" "parallel_branch")
9845 (set (attr "length")
9846 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9847 (const_int MAX_12BIT_OFFSET))
9849 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9850 (const_int MAX_17BIT_OFFSET))
9852 (match_test "TARGET_PORTABLE_RUNTIME")
9854 (not (match_test "flag_pic"))
9859 [(set (pc) (label_ref (match_operand 2 "" "" )))
9860 (set (match_operand:HI 0 "ireg_operand" "=r")
9861 (match_operand:HI 1 "ireg_or_int5_operand" "rL"))]
9865 return pa_output_parallel_movb (operands, insn);
9867 [(set_attr "type" "parallel_branch")
9868 (set (attr "length")
9869 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9870 (const_int MAX_12BIT_OFFSET))
9872 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9873 (const_int MAX_17BIT_OFFSET))
9875 (match_test "TARGET_PORTABLE_RUNTIME")
9877 (not (match_test "flag_pic"))
9882 [(set (pc) (label_ref (match_operand 2 "" "" )))
9883 (set (match_operand:QI 0 "ireg_operand" "=r")
9884 (match_operand:QI 1 "ireg_or_int5_operand" "rL"))]
9888 return pa_output_parallel_movb (operands, insn);
9890 [(set_attr "type" "parallel_branch")
9891 (set (attr "length")
9892 (cond [(lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9893 (const_int MAX_12BIT_OFFSET))
9895 (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
9896 (const_int MAX_17BIT_OFFSET))
9898 (match_test "TARGET_PORTABLE_RUNTIME")
9900 (not (match_test "flag_pic"))
9905 [(set (match_operand 0 "register_operand" "=f")
9906 (mult (match_operand 1 "register_operand" "f")
9907 (match_operand 2 "register_operand" "f")))
9908 (set (match_operand 3 "register_operand" "+f")
9909 (plus (match_operand 4 "register_operand" "f")
9910 (match_operand 5 "register_operand" "f")))]
9911 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
9912 && reload_completed && pa_fmpyaddoperands (operands)"
9915 if (GET_MODE (operands[0]) == DFmode)
9917 if (rtx_equal_p (operands[3], operands[5]))
9918 return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
9920 return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
9924 if (rtx_equal_p (operands[3], operands[5]))
9925 return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
9927 return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
9930 [(set_attr "type" "fpalu")
9931 (set_attr "length" "4")])
9934 [(set (match_operand 3 "register_operand" "+f")
9935 (plus (match_operand 4 "register_operand" "f")
9936 (match_operand 5 "register_operand" "f")))
9937 (set (match_operand 0 "register_operand" "=f")
9938 (mult (match_operand 1 "register_operand" "f")
9939 (match_operand 2 "register_operand" "f")))]
9940 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
9941 && reload_completed && pa_fmpyaddoperands (operands)"
9944 if (GET_MODE (operands[0]) == DFmode)
9946 if (rtx_equal_p (operands[3], operands[5]))
9947 return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
9949 return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
9953 if (rtx_equal_p (operands[3], operands[5]))
9954 return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
9956 return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
9959 [(set_attr "type" "fpalu")
9960 (set_attr "length" "4")])
9963 [(set (match_operand 0 "register_operand" "=f")
9964 (mult (match_operand 1 "register_operand" "f")
9965 (match_operand 2 "register_operand" "f")))
9966 (set (match_operand 3 "register_operand" "+f")
9967 (minus (match_operand 4 "register_operand" "f")
9968 (match_operand 5 "register_operand" "f")))]
9969 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
9970 && reload_completed && pa_fmpysuboperands (operands)"
9973 if (GET_MODE (operands[0]) == DFmode)
9974 return \"fmpysub,dbl %1,%2,%0,%5,%3\";
9976 return \"fmpysub,sgl %1,%2,%0,%5,%3\";
9978 [(set_attr "type" "fpalu")
9979 (set_attr "length" "4")])
9982 [(set (match_operand 3 "register_operand" "+f")
9983 (minus (match_operand 4 "register_operand" "f")
9984 (match_operand 5 "register_operand" "f")))
9985 (set (match_operand 0 "register_operand" "=f")
9986 (mult (match_operand 1 "register_operand" "f")
9987 (match_operand 2 "register_operand" "f")))]
9988 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
9989 && reload_completed && pa_fmpysuboperands (operands)"
9992 if (GET_MODE (operands[0]) == DFmode)
9993 return \"fmpysub,dbl %1,%2,%0,%5,%3\";
9995 return \"fmpysub,sgl %1,%2,%0,%5,%3\";
9997 [(set_attr "type" "fpalu")
9998 (set_attr "length" "4")])
10000 ;; The following two patterns are used by the trampoline code for nested
10001 ;; functions. They flush the I and D cache lines from the start address
10002 ;; (operand0) to the end address (operand1). No lines are flushed if the
10003 ;; end address is less than the start address (unsigned).
10005 ;; Because the range of memory flushed is variable and the size of a MEM
10006 ;; can only be a CONST_INT, the patterns specify that they perform an
10007 ;; unspecified volatile operation on all memory.
10009 ;; The address range for an icache flush must lie within a single
10010 ;; space on targets with non-equivalent space registers.
10012 ;; Operand 0 contains the start address.
10013 ;; Operand 1 contains the end address.
10014 ;; Operand 2 contains the line length to use.
10015 (define_insn "dcacheflush<P:mode>"
10017 (unspec_volatile [(mem:BLK (scratch))] UNSPECV_DCACHE)
10018 (use (match_operand 0 "pmode_register_operand" "r"))
10019 (use (match_operand 1 "pmode_register_operand" "r"))
10020 (use (match_operand 2 "pmode_register_operand" "r"))
10021 (clobber (match_scratch:P 3 "=&0"))]
10023 "cmpb,<dwc><<=,n %3,%1,.\;fdc,m %2(%3)\;sync"
10024 [(set_attr "type" "multi")
10025 (set_attr "length" "12")])
10027 (define_insn "icacheflush<P:mode>"
10029 (unspec_volatile [(mem:BLK (scratch))] UNSPECV_ICACHE)
10030 (use (match_operand 0 "pmode_register_operand" "r"))
10031 (use (match_operand 1 "pmode_register_operand" "r"))
10032 (use (match_operand 2 "pmode_register_operand" "r"))
10033 (clobber (match_operand 3 "pmode_register_operand" "=&r"))
10034 (clobber (match_operand 4 "pmode_register_operand" "=&r"))
10035 (clobber (match_scratch:P 5 "=&0"))]
10037 "mfsp %%sr0,%4\;ldsid (%5),%3\;mtsp %3,%%sr0\;cmpb,<dwc><<=,n %5,%1,.\;fic,m %2(%%sr0,%5)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop"
10038 [(set_attr "type" "multi")
10039 (set_attr "length" "52")])
10041 (define_expand "clear_cache"
10042 [(match_operand 0 "pmode_register_operand")
10043 (match_operand 1 "pmode_register_operand")]
10046 rtx line_length = gen_reg_rtx (Pmode);
10048 emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE));
10050 emit_insn (gen_icacheflushdi (operands[0], operands[1], line_length,
10051 gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
10053 emit_insn (gen_icacheflushsi (operands[0], operands[1], line_length,
10054 gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));
10058 ;; An out-of-line prologue.
10059 (define_insn "outline_prologue_call"
10060 [(unspec_volatile [(const_int 0)] UNSPECV_OPC)
10061 (clobber (reg:SI 31))
10062 (clobber (reg:SI 22))
10063 (clobber (reg:SI 21))
10064 (clobber (reg:SI 20))
10065 (clobber (reg:SI 19))
10066 (clobber (reg:SI 1))]
10071 /* We need two different versions depending on whether or not we
10072 need a frame pointer. Also note that we return to the instruction
10073 immediately after the branch rather than two instructions after the
10074 break as normally is the case. */
10075 if (frame_pointer_needed)
10077 /* Must import the magic millicode routine(s). */
10078 output_asm_insn (\".IMPORT __outline_prologue_fp,MILLICODE\", NULL);
10080 if (TARGET_PORTABLE_RUNTIME)
10082 output_asm_insn (\"ldil L'__outline_prologue_fp,%%r31\", NULL);
10083 output_asm_insn (\"ble,n R'__outline_prologue_fp(%%sr0,%%r31)\",
10087 output_asm_insn (\"{bl|b,l},n __outline_prologue_fp,%%r31\", NULL);
10091 /* Must import the magic millicode routine(s). */
10092 output_asm_insn (\".IMPORT __outline_prologue,MILLICODE\", NULL);
10094 if (TARGET_PORTABLE_RUNTIME)
10096 output_asm_insn (\"ldil L'__outline_prologue,%%r31\", NULL);
10097 output_asm_insn (\"ble,n R'__outline_prologue(%%sr0,%%r31)\", NULL);
10100 output_asm_insn (\"{bl|b,l},n __outline_prologue,%%r31\", NULL);
10104 [(set_attr "type" "multi")
10105 (set_attr "length" "8")])
10107 ;; An out-of-line epilogue.
10108 (define_insn "outline_epilogue_call"
10109 [(unspec_volatile [(const_int 1)] UNSPECV_OEC)
10112 (clobber (reg:SI 31))
10113 (clobber (reg:SI 22))
10114 (clobber (reg:SI 21))
10115 (clobber (reg:SI 20))
10116 (clobber (reg:SI 19))
10117 (clobber (reg:SI 2))
10118 (clobber (reg:SI 1))]
10123 /* We need two different versions depending on whether or not we
10124 need a frame pointer. Also note that we return to the instruction
10125 immediately after the branch rather than two instructions after the
10126 break as normally is the case. */
10127 if (frame_pointer_needed)
10129 /* Must import the magic millicode routine. */
10130 output_asm_insn (\".IMPORT __outline_epilogue_fp,MILLICODE\", NULL);
10132 /* The out-of-line prologue will make sure we return to the right
10134 if (TARGET_PORTABLE_RUNTIME)
10136 output_asm_insn (\"ldil L'__outline_epilogue_fp,%%r31\", NULL);
10137 output_asm_insn (\"ble,n R'__outline_epilogue_fp(%%sr0,%%r31)\",
10141 output_asm_insn (\"{bl|b,l},n __outline_epilogue_fp,%%r31\", NULL);
10145 /* Must import the magic millicode routine. */
10146 output_asm_insn (\".IMPORT __outline_epilogue,MILLICODE\", NULL);
10148 /* The out-of-line prologue will make sure we return to the right
10150 if (TARGET_PORTABLE_RUNTIME)
10152 output_asm_insn (\"ldil L'__outline_epilogue,%%r31\", NULL);
10153 output_asm_insn (\"ble,n R'__outline_epilogue(%%sr0,%%r31)\", NULL);
10156 output_asm_insn (\"{bl|b,l},n __outline_epilogue,%%r31\", NULL);
10160 [(set_attr "type" "multi")
10161 (set_attr "length" "8")])
10163 ;; Given a function pointer, canonicalize it so it can be
10164 ;; reliably compared to another function pointer. */
10165 (define_expand "canonicalize_funcptr_for_compare"
10166 [(set (reg:SI 26) (match_operand:SI 1 "register_operand" ""))
10167 (parallel [(set (reg:SI 29) (unspec:SI [(reg:SI 26)] UNSPEC_CFFC))
10168 (clobber (match_dup 2))
10169 (clobber (reg:SI 26))
10170 (clobber (reg:SI 22))
10171 (clobber (reg:SI 31))])
10172 (set (match_operand:SI 0 "register_operand" "")
10174 "!TARGET_PORTABLE_RUNTIME && !TARGET_64BIT"
10179 rtx canonicalize_funcptr_for_compare_libfunc
10180 = init_one_libfunc (CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL);
10182 emit_library_call_value (canonicalize_funcptr_for_compare_libfunc,
10183 operands[0], LCT_NORMAL, Pmode,
10184 operands[1], Pmode);
10188 operands[2] = gen_reg_rtx (SImode);
10189 if (GET_CODE (operands[1]) != REG)
10191 rtx tmp = gen_reg_rtx (Pmode);
10192 emit_move_insn (tmp, operands[1]);
10197 (define_insn "*$$sh_func_adrs"
10198 [(set (reg:SI 29) (unspec:SI [(reg:SI 26)] UNSPEC_CFFC))
10199 (clobber (match_operand:SI 0 "register_operand" "=a"))
10200 (clobber (reg:SI 26))
10201 (clobber (reg:SI 22))
10202 (clobber (reg:SI 31))]
10206 int length = get_attr_length (insn);
10209 xoperands[0] = GEN_INT (length - 8);
10210 xoperands[1] = GEN_INT (length - 16);
10212 /* Must import the magic millicode routine. */
10213 output_asm_insn (\".IMPORT $$sh_func_adrs,MILLICODE\", NULL);
10215 /* This is absolutely amazing.
10217 First, copy our input parameter into %r29 just in case we don't
10218 need to call $$sh_func_adrs. */
10219 output_asm_insn (\"copy %%r26,%%r29\", NULL);
10220 output_asm_insn (\"{extru|extrw,u} %%r26,31,2,%%r31\", NULL);
10222 /* Next, examine the low two bits in %r26, if they aren't 0x2, then
10223 we use %r26 unchanged. */
10224 output_asm_insn (\"{comib|cmpib},<>,n 2,%%r31,.+%0\", xoperands);
10225 output_asm_insn (\"ldi 4096,%%r31\", NULL);
10227 /* Next, compare %r26 with 4096, if %r26 is less than or equal to
10228 4096, then again we use %r26 unchanged. */
10229 output_asm_insn (\"{comb|cmpb},<<,n %%r26,%%r31,.+%1\", xoperands);
10231 /* Finally, call $$sh_func_adrs to extract the function's real add24. */
10232 return pa_output_millicode_call (insn,
10233 gen_rtx_SYMBOL_REF (SImode,
10234 \"$$sh_func_adrs\"));
10236 [(set_attr "type" "sh_func_adrs")
10237 (set (attr "length")
10238 (cond [(and (const_int 0) (eq (const_int 0) (pc))) (const_int 28)]
10239 (plus (symbol_ref "pa_attr_length_millicode_call (insn)")
10240 (const_int 20))))])
10242 ;; On the PA, the PIC register is call clobbered, so it must
10243 ;; be saved & restored around calls by the caller. If the call
10244 ;; doesn't return normally (nonlocal goto, or an exception is
10245 ;; thrown), then the code at the exception handler label must
10246 ;; restore the PIC register.
10247 (define_expand "exception_receiver"
10252 /* On the 64-bit port, we need a blockage because there is
10253 confusion regarding the dependence of the restore on the
10254 frame pointer. As a result, the frame pointer and pic
10255 register restores sometimes are interchanged erroneously. */
10257 emit_insn (gen_blockage ());
10258 /* Restore the PIC register using hppa_pic_save_rtx (). The
10259 PIC register is not saved in the frame in 64-bit ABI. */
10260 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
10261 emit_insn (gen_blockage ());
10265 (define_expand "builtin_setjmp_receiver"
10266 [(label_ref (match_operand 0 "" ""))]
10271 emit_insn (gen_blockage ());
10272 /* Restore the PIC register. Hopefully, this will always be from
10273 a stack slot. The only registers that are valid after a
10274 builtin_longjmp are the stack and frame pointers. */
10275 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
10276 emit_insn (gen_blockage ());
10280 ;; Allocate new stack space and update the saved stack pointer in the
10281 ;; frame marker. The HP C compilers also copy additional words in the
10282 ;; frame marker. The 64-bit compiler copies words at -48, -32 and -24.
10283 ;; The 32-bit compiler copies the word at -16 (Static Link). We
10284 ;; currently don't copy these values.
10286 ;; Since the copy of the frame marker can't be done atomically, I
10287 ;; suspect that using it for unwind purposes may be somewhat unreliable.
10288 ;; The HP compilers appear to raise the stack and copy the frame
10289 ;; marker in a strict instruction sequence. This suggests that the
10290 ;; unwind library may check for an alloca sequence when ALLOCA_FRAME
10291 ;; is set in the callinfo data. We currently don't set ALLOCA_FRAME
10292 ;; as GAS doesn't support it, or try to keep the instructions emitted
10293 ;; here in strict sequence.
10294 (define_expand "allocate_stack"
10295 [(match_operand 0 "" "")
10296 (match_operand 1 "" "")]
10302 /* Since the stack grows upward, we need to store virtual_stack_dynamic_rtx
10303 in operand 0 before adjusting the stack. */
10304 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
10305 anti_adjust_stack (operands[1]);
10306 if (TARGET_HPUX_UNWIND_LIBRARY)
10308 addr = gen_rtx_PLUS (word_mode, stack_pointer_rtx,
10309 GEN_INT (TARGET_64BIT ? -8 : -4));
10310 emit_move_insn (gen_rtx_MEM (word_mode, addr), hard_frame_pointer_rtx);
10312 if (!TARGET_64BIT && flag_pic)
10314 rtx addr = gen_rtx_PLUS (word_mode, stack_pointer_rtx, GEN_INT (-32));
10315 emit_move_insn (gen_rtx_MEM (word_mode, addr), pic_offset_table_rtx);
10320 (define_expand "prefetch"
10321 [(match_operand 0 "address_operand" "")
10322 (match_operand 1 "const_int_operand" "")
10323 (match_operand 2 "const_int_operand" "")]
10326 operands[0] = copy_addr_to_reg (operands[0]);
10327 emit_insn (gen_prefetch_20 (operands[0], operands[1], operands[2]));
10331 (define_insn "prefetch_20"
10332 [(prefetch (match_operand 0 "pmode_register_operand" "r")
10333 (match_operand:SI 1 "const_int_operand" "n")
10334 (match_operand:SI 2 "const_int_operand" "n"))]
10337 /* The SL cache-control completer indicates good spatial locality but
10338 poor temporal locality. The ldw instruction with a target of general
10339 register 0 prefetches a cache line for a read. The ldd instruction
10340 prefetches a cache line for a write. */
10341 static const char * const instr[2][2] = {
10343 "ldw,sl 0(%0),%%r0",
10344 "ldd,sl 0(%0),%%r0"
10351 int read_or_write = INTVAL (operands[1]) == 0 ? 0 : 1;
10352 int locality = INTVAL (operands[2]) == 0 ? 0 : 1;
10354 return instr [locality][read_or_write];
10356 [(set_attr "type" "load")
10357 (set_attr "length" "4")])
10360 (define_insn "tgd_load"
10361 [(set (match_operand:SI 0 "register_operand" "=r")
10362 (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD))
10363 (clobber (reg:SI R1_REGNUM))
10364 (use (reg:SI R27_REGNUM))]
10368 return \"addil LR'%1-$tls_gdidx$,%%r27\;ldo RR'%1-$tls_gdidx$(%%r1),%0\";
10370 [(set_attr "type" "multi")
10371 (set_attr "length" "8")])
10373 (define_expand "tgd_load_pic"
10374 [(set (match_operand 0 "register_operand")
10375 (unspec [(match_operand 1 "tgd_symbolic_operand")] UNSPEC_TLSGD_PIC))
10376 (clobber (reg R1_REGNUM))]
10380 emit_insn (gen_tgd_load_picdi (operands[0], operands[1]));
10382 emit_insn (gen_tgd_load_picsi (operands[0], operands[1]));
10386 (define_insn "tgd_load_picsi"
10387 [(set (match_operand:SI 0 "register_operand" "=r")
10388 (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC))
10389 (clobber (reg:SI R1_REGNUM))
10390 (use (reg:SI R19_REGNUM))]
10394 return \"addil LT'%1-$tls_gdidx$,%%r19\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
10396 [(set_attr "type" "multi")
10397 (set_attr "length" "8")])
10399 (define_insn "tgd_load_picdi"
10400 [(set (match_operand:DI 0 "register_operand" "=r")
10401 (unspec:DI [(match_operand 1 "tgd_symbolic_operand" "")] UNSPEC_TLSGD_PIC))
10402 (clobber (reg:DI R1_REGNUM))
10403 (use (reg:DI R27_REGNUM))]
10407 return \"addil LT'%1-$tls_gdidx$,%%r27\;ldo RT'%1-$tls_gdidx$(%%r1),%0\";
10409 [(set_attr "type" "multi")
10410 (set_attr "length" "8")])
10412 (define_insn "tld_load"
10413 [(set (match_operand:SI 0 "register_operand" "=r")
10414 (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM))
10415 (clobber (reg:SI R1_REGNUM))
10416 (use (reg:SI R27_REGNUM))]
10420 return \"addil LR'%1-$tls_ldidx$,%%r27\;ldo RR'%1-$tls_ldidx$(%%r1),%0\";
10422 [(set_attr "type" "multi")
10423 (set_attr "length" "8")])
10425 (define_expand "tld_load_pic"
10426 [(set (match_operand 0 "register_operand")
10427 (unspec [(match_operand 1 "tld_symbolic_operand")] UNSPEC_TLSLDM_PIC))
10428 (clobber (reg R1_REGNUM))]
10432 emit_insn (gen_tld_load_picdi (operands[0], operands[1]));
10434 emit_insn (gen_tld_load_picsi (operands[0], operands[1]));
10438 (define_insn "tld_load_picsi"
10439 [(set (match_operand:SI 0 "register_operand" "=r")
10440 (unspec:SI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC))
10441 (clobber (reg:SI R1_REGNUM))
10442 (use (reg:SI R19_REGNUM))]
10446 return \"addil LT'%1-$tls_ldidx$,%%r19\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
10448 [(set_attr "type" "multi")
10449 (set_attr "length" "8")])
10451 (define_insn "tld_load_picdi"
10452 [(set (match_operand:DI 0 "register_operand" "=r")
10453 (unspec:DI [(match_operand 1 "tld_symbolic_operand" "")] UNSPEC_TLSLDM_PIC))
10454 (clobber (reg:DI R1_REGNUM))
10455 (use (reg:DI R27_REGNUM))]
10459 return \"addil LT'%1-$tls_ldidx$,%%r27\;ldo RT'%1-$tls_ldidx$(%%r1),%0\";
10461 [(set_attr "type" "multi")
10462 (set_attr "length" "8")])
10464 (define_expand "tld_offset_load"
10465 [(set (match_operand 0 "register_operand")
10466 (plus (unspec [(match_operand 1 "tld_symbolic_operand")]
10468 (match_operand 2 "register_operand")))
10469 (clobber (reg R1_REGNUM))]
10473 emit_insn (gen_tld_offset_loaddi (operands[0], operands[1], operands[2]));
10475 emit_insn (gen_tld_offset_loadsi (operands[0], operands[1], operands[2]));
10479 (define_insn "tld_offset_load<P:mode>"
10480 [(set (match_operand:P 0 "register_operand" "=r")
10481 (plus:P (unspec:P [(match_operand 1 "tld_symbolic_operand" "")]
10483 (match_operand:P 2 "register_operand" "r")))
10484 (clobber (reg:P R1_REGNUM))]
10488 return \"addil LR'%1-$tls_dtpoff$,%2\;ldo RR'%1-$tls_dtpoff$(%%r1),%0\";
10490 [(set_attr "type" "multi")
10491 (set_attr "length" "8")])
10493 (define_expand "tp_load"
10494 [(set (match_operand 0 "register_operand")
10495 (unspec [(const_int 0)] UNSPEC_TP))]
10499 emit_insn (gen_tp_loaddi (operands[0]));
10501 emit_insn (gen_tp_loadsi (operands[0]));
10505 (define_insn "tp_load<P:mode>"
10506 [(set (match_operand:P 0 "register_operand" "=r")
10507 (unspec:P [(const_int 0)] UNSPEC_TP))]
10510 [(set_attr "type" "multi")
10511 (set_attr "length" "4")])
10513 (define_insn "tie_load"
10514 [(set (match_operand:SI 0 "register_operand" "=r")
10515 (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE))
10516 (clobber (reg:SI R1_REGNUM))
10517 (use (reg:SI R27_REGNUM))]
10521 return \"addil LR'%1-$tls_ieoff$,%%r27\;ldw RR'%1-$tls_ieoff$(%%r1),%0\";
10523 [(set_attr "type" "multi")
10524 (set_attr "length" "8")])
10526 (define_expand "tie_load_pic"
10527 [(set (match_operand 0 "register_operand")
10528 (unspec [(match_operand 1 "tie_symbolic_operand")] UNSPEC_TLSIE_PIC))
10529 (clobber (reg R1_REGNUM))]
10533 emit_insn (gen_tie_load_picdi (operands[0], operands[1]));
10535 emit_insn (gen_tie_load_picsi (operands[0], operands[1]));
10539 (define_insn "tie_load_picsi"
10540 [(set (match_operand:SI 0 "register_operand" "=r")
10541 (unspec:SI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC))
10542 (clobber (reg:SI R1_REGNUM))
10543 (use (reg:SI R19_REGNUM))]
10547 return \"addil LT'%1-$tls_ieoff$,%%r19\;ldw RT'%1-$tls_ieoff$(%%r1),%0\";
10549 [(set_attr "type" "multi")
10550 (set_attr "length" "8")])
10552 (define_insn "tie_load_picdi"
10553 [(set (match_operand:DI 0 "register_operand" "=r")
10554 (unspec:DI [(match_operand 1 "tie_symbolic_operand" "")] UNSPEC_TLSIE_PIC))
10555 (clobber (reg:DI R1_REGNUM))
10556 (use (reg:DI R27_REGNUM))]
10560 return \"addil LT'%1-$tls_ieoff$,%%r27\;ldd RT'%1-$tls_ieoff$(%%r1),%0\";
10562 [(set_attr "type" "multi")
10563 (set_attr "length" "8")])
10565 (define_expand "tle_load"
10566 [(set (match_operand 0 "register_operand")
10567 (plus (unspec [(match_operand 1 "tle_symbolic_operand")]
10569 (match_operand 2 "register_operand")))
10570 (clobber (reg R1_REGNUM))]
10574 emit_insn (gen_tle_loaddi (operands[0], operands[1], operands[2]));
10576 emit_insn (gen_tle_loadsi (operands[0], operands[1], operands[2]));
10580 (define_insn "tle_load<P:mode>"
10581 [(set (match_operand:P 0 "register_operand" "=r")
10582 (plus:P (unspec:P [(match_operand 1 "tle_symbolic_operand" "")]
10584 (match_operand:P 2 "register_operand" "r")))
10585 (clobber (reg:P R1_REGNUM))]
10587 "addil LR'%1-$tls_leoff$,%2\;ldo RR'%1-$tls_leoff$(%%r1),%0"
10588 [(set_attr "type" "multi")
10589 (set_attr "length" "8")])
10591 ;; Atomic instructions
10593 ;; All memory loads and stores access storage atomically except
10594 ;; for one exception. The STORE BYTES, STORE DOUBLE BYTES, and
10595 ;; doubleword loads and stores are not guaranteed to be atomic
10596 ;; when referencing the I/O address space.
10598 ;; Atomic and sync libcalls use different lock sets. Great care is
10599 ;; needed if both are used in a single application.
10601 ;; Atomic load and store libcalls are enabled by the -matomic-libcalls
10602 ;; option. This option is not enabled by default as the generated
10603 ;; libcalls depend on libatomic which is not built until the end of
10604 ;; the gcc build. For loads, we only need an atomic libcall for DImode.
10605 ;; Sync libcalls are not generated when atomic libcalls are enabled.
10607 ;; Sync libcalls are enabled by default when supported. They can be
10608 ;; disabled by the -fno-sync-libcalls option. Sync libcalls always
10609 ;; use a single memory store in their implementation, even for DImode.
10610 ;; DImode stores are done using either std or fstd. Thus, we only
10611 ;; need a sync load libcall for DImode when we don't have an atomic
10612 ;; processor load available for the mode (TARGET_SOFT_FLOAT).
10614 ;; Implement atomic QImode store using exchange.
10616 (define_expand "atomic_storeqi"
10617 [(match_operand:QI 0 "memory_operand") ;; memory
10618 (match_operand:QI 1 "register_operand") ;; val out
10619 (match_operand:SI 2 "const_int_operand")] ;; model
10624 if (TARGET_SYNC_LIBCALLS)
10626 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10627 libfunc = optab_libfunc (sync_lock_test_and_set_optab, QImode);
10628 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10629 operands[1], QImode);
10633 if (TARGET_ATOMIC_LIBCALLS)
10635 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10636 libfunc = init_one_libfunc ("__atomic_exchange_1");
10637 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10638 operands[1], QImode);
10645 ;; Implement atomic HImode store using exchange.
10647 (define_expand "atomic_storehi"
10648 [(match_operand:HI 0 "memory_operand") ;; memory
10649 (match_operand:HI 1 "register_operand") ;; val out
10650 (match_operand:SI 2 "const_int_operand")] ;; model
10655 if (TARGET_SYNC_LIBCALLS)
10657 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10658 libfunc = optab_libfunc (sync_lock_test_and_set_optab, HImode);
10659 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10660 operands[1], HImode);
10664 if (TARGET_ATOMIC_LIBCALLS)
10666 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10667 libfunc = init_one_libfunc ("__atomic_exchange_2");
10668 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10669 operands[1], HImode);
10676 ;; Implement atomic SImode store using exchange.
10678 (define_expand "atomic_storesi"
10679 [(match_operand:SI 0 "memory_operand") ;; memory
10680 (match_operand:SI 1 "register_operand") ;; val out
10681 (match_operand:SI 2 "const_int_operand")] ;; model
10686 if (TARGET_SYNC_LIBCALLS)
10688 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10689 libfunc = optab_libfunc (sync_lock_test_and_set_optab, SImode);
10690 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10691 operands[1], SImode);
10695 if (TARGET_ATOMIC_LIBCALLS)
10697 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10698 libfunc = init_one_libfunc ("__atomic_exchange_4");
10699 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10700 operands[1], SImode);
10707 ;; Implement atomic DImode load.
10709 ;; We need an atomic or sync libcall whenever the processor load or
10710 ;; store used for DImode is not atomic. The 32-bit libatomic
10711 ;; implementation uses a pair of stw instructions. They are not
10712 ;; atomic, so we need to call __atomic_load_8. The linux libgcc
10713 ;; sync implementation uses a std or fstd instruction. They are
10714 ;; atomic, so we only need to call __sync_load_8 when the load
10715 ;; operation would not be atomic (e.g., 32-bit TARGET_SOFT_FLOAT).
10717 (define_expand "atomic_loaddi"
10718 [(match_operand:DI 0 "register_operand") ;; val out
10719 (match_operand:DI 1 "memory_operand") ;; memory
10720 (match_operand:SI 2 "const_int_operand")] ;; model
10723 enum memmodel model;
10729 if (TARGET_SYNC_LIBCALLS && MAX_SYNC_LIBFUNC_SIZE >= 8 && TARGET_SOFT_FLOAT)
10731 addr = convert_memory_address (Pmode, XEXP (operands[1], 0));
10732 libfunc = init_one_libfunc ("__sync_load_8");
10733 emit_library_call_value (libfunc, operands[0], LCT_NORMAL, DImode,
10738 if (TARGET_ATOMIC_LIBCALLS && TARGET_SOFT_FLOAT)
10740 addr = convert_memory_address (Pmode, XEXP (operands[1], 0));
10741 libfunc = init_one_libfunc ("__atomic_load_8");
10742 emit_library_call_value (libfunc, operands[0], LCT_NORMAL, DImode,
10747 if (TARGET_SOFT_FLOAT)
10750 /* Fallback to processor load with barriers. */
10751 model = memmodel_from_int (INTVAL (operands[2]));
10752 operands[1] = force_reg (Pmode, XEXP (operands[1], 0));
10753 if (is_mm_seq_cst (model))
10754 expand_mem_thread_fence (model);
10755 emit_insn (gen_atomic_loaddi_1 (operands[0], operands[1]));
10756 expand_mem_thread_fence (model);
10760 (define_insn "atomic_loaddi_1"
10761 [(set (match_operand:DI 0 "register_operand" "=r")
10762 (mem:DI (match_operand:SI 1 "register_operand" "r")))
10763 (clobber (match_scratch:DI 2 "=f"))]
10764 "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
10765 "{fldds|fldd} 0(%1),%2\n\t{fstds|fstd} %2,-16(%%sp)\n\t{ldws|ldw} -16(%%sp),%0\n\t{ldws|ldw} -12(%%sp),%R0"
10766 [(set_attr "type" "move")
10767 (set_attr "length" "16")])
10769 ;; Implement atomic DImode store.
10771 (define_expand "atomic_storedi"
10772 [(match_operand:DI 0 "memory_operand") ;; memory
10773 (match_operand:DI 1 "reg_or_cint_move_operand") ;; val out
10774 (match_operand:SI 2 "const_int_operand")] ;; model
10777 enum memmodel model;
10780 if (TARGET_SYNC_LIBCALLS && MAX_SYNC_LIBFUNC_SIZE >= 8)
10782 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10783 libfunc = optab_libfunc (sync_lock_test_and_set_optab, DImode);
10784 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10785 operands[1], DImode);
10789 if (TARGET_ATOMIC_LIBCALLS)
10791 addr = convert_memory_address (Pmode, XEXP (operands[0], 0));
10792 libfunc = init_one_libfunc ("__atomic_exchange_8");
10793 emit_library_call (libfunc, LCT_NORMAL, VOIDmode, addr, Pmode,
10794 operands[1], DImode);
10798 if (TARGET_64BIT || TARGET_SOFT_FLOAT)
10801 /* Fallback to processor store with barriers. */
10802 model = memmodel_from_int (INTVAL (operands[2]));
10803 operands[0] = force_reg (Pmode, XEXP (operands[0], 0));
10804 if (operands[1] != CONST0_RTX (DImode))
10805 operands[1] = force_reg (DImode, operands[1]);
10806 expand_mem_thread_fence (model);
10807 emit_insn (gen_atomic_storedi_1 (operands[0], operands[1]));
10808 if (is_mm_seq_cst (model))
10809 expand_mem_thread_fence (model);
10813 (define_insn "atomic_storedi_1"
10814 [(set (mem:DI (match_operand:SI 0 "register_operand" "r,r"))
10815 (match_operand:DI 1 "reg_or_0_operand" "M,r"))
10816 (clobber (match_scratch:DI 2 "=f,f"))]
10817 "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
10819 fcpy,dbl %%fr0,%2\n\t{fstds|fstd} %2,0(%0)
10820 {stws|stw} %1,-16(%%sp)\n\t{stws|stw} %R1,-12(%%sp)\n\t{fldds|fldd} -16(%%sp),%2\n\t{fstds|fstd} %2,0(%0)"
10821 [(set_attr "type" "move,move")
10822 (set_attr "length" "8,16")])
10824 ;; PA 2.0 hardware supports out-of-order execution of loads and stores, so
10825 ;; we need memory barriers to enforce program order for memory references
10826 ;; when the TLB and PSW O bits are not set. We assume all PA 2.0 systems
10827 ;; are weakly ordered since neither HP-UX or Linux set the PSW O bit. Since
10828 ;; we want PA 1.x code to be PA 2.0 compatible, we also need barriers when
10829 ;; generating PA 1.x code even though all PA 1.x systems are strongly ordered.
10831 ;; When barriers are needed, we use a strongly ordered ldcw instruction as
10832 ;; the barrier. All PA 2.0 targets accept the "co" cache control hint but
10833 ;; only PA8800 and PA8900 processors implement the cacheable hint. In
10834 ;; that case, we can avoid aligning the ldcw address. In spite of its
10835 ;; description, it is not clear that the sync instruction works as a barrier.
10837 (define_expand "memory_barrier"
10839 [(set (match_dup 0) (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
10840 (clobber (match_dup 1))])]
10843 /* We don't need a barrier if the target uses ordered memory references. */
10844 if (TARGET_ORDERED)
10846 operands[1] = gen_reg_rtx (Pmode);
10847 operands[0] = gen_rtx_MEM (BLKmode, operands[1]);
10848 MEM_VOLATILE_P (operands[0]) = 1;
10851 (define_insn "*memory_barrier_coherent"
10852 [(set (match_operand:BLK 0 "" "")
10853 (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
10854 (clobber (match_operand 1 "pmode_register_operand" "=r"))]
10855 "TARGET_PA_20 && TARGET_COHERENT_LDCW"
10856 "ldcw,co 0(%%sp),%1"
10857 [(set_attr "type" "binary")
10858 (set_attr "length" "4")])
10860 (define_insn "*memory_barrier_64"
10861 [(set (match_operand:BLK 0 "" "")
10862 (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
10863 (clobber (match_operand 1 "pmode_register_operand" "=&r"))]
10865 "ldo 15(%%sp),%1\n\tdepd %%r0,63,3,%1\n\tldcw,co 0(%1),%1"
10866 [(set_attr "type" "binary")
10867 (set_attr "length" "12")])
10869 (define_insn "*memory_barrier_32"
10870 [(set (match_operand:BLK 0 "" "")
10871 (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
10872 (clobber (match_operand 1 "pmode_register_operand" "=&r"))]
10874 "ldo 15(%%sp),%1\n\t{dep|depw} %%r0,31,3,%1\n\t{ldcw|ldcw,co} 0(%1),%1"
10875 [(set_attr "type" "binary")
10876 (set_attr "length" "12")])
10878 ;; Get floating-point status register.
10880 (define_expand "get_fpsr"
10881 [(set (match_operand:SI 0 "register_operand" "=r")
10882 (unspec_volatile:SI [(const_int 0)] UNSPECV_GET_FPSR))]
10885 if (TARGET_SOFT_FLOAT)
10889 emit_insn (gen_get_fpsr_64 (operands[0]));
10891 emit_insn (gen_get_fpsr_32 (operands[0]));
10895 ;; The floating-point status register is stored to an unused slot in
10896 ;; the frame marker and then loaded to register operand 0. The final
10897 ;; floating-point load restores the T bit in the status register.
10899 ;; The final load might be avoided if a word mode store was used to
10900 ;; store the status register. It is unclear why we need a double-word
10901 ;; store. I suspect PA 1.0 didn't support single-word stores of the
10902 ;; status register.
10904 (define_insn "get_fpsr_32"
10905 [(set (match_operand:SI 0 "register_operand" "=r")
10906 (unspec_volatile:SI [(const_int 0)] UNSPECV_GET_FPSR))]
10907 "!TARGET_SOFT_FLOAT && !TARGET_64BIT"
10908 "{fstds|fstd} %%fr0,-16(%%sp)\n\tldw -16(%%sp),%0\n\t{fldds|fldd} -16(%%sp),%%fr0"
10909 [(set_attr "type" "fpstore_load")
10910 (set_attr "length" "12")])
10912 ;; The 64-bit pattern is similar to the 32-bit pattern except we need
10913 ;; compute the address of the frame location as long displacements aren't
10914 ;; supported on Linux targets.
10916 (define_insn "get_fpsr_64"
10917 [(set (match_operand:SI 0 "register_operand" "=r")
10918 (unspec_volatile:SI [(const_int 0)] UNSPECV_GET_FPSR))
10919 (clobber (match_scratch:DI 1 "=&r"))]
10920 "!TARGET_SOFT_FLOAT && TARGET_64BIT"
10921 "ldo -40(%%sp),%1\n\tfstd %%fr0,0(%1)\n\tldw 0(%1),%0\n\tfldd 0(%1),%%fr0"
10922 [(set_attr "type" "fpstore_load")
10923 (set_attr "length" "16")])
10925 ;; Set floating-point status register.
10927 (define_expand "set_fpsr"
10928 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] UNSPECV_SET_FPSR)]
10931 if (TARGET_SOFT_FLOAT)
10935 emit_insn (gen_set_fpsr_64 (operands[0]));
10937 emit_insn (gen_set_fpsr_32 (operands[0]));
10941 ;; The old T bit is extracted and stored in the new status register.
10943 (define_insn "set_fpsr_32"
10944 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] UNSPECV_SET_FPSR)
10945 (clobber (match_scratch:SI 1 "=&r"))]
10946 "!TARGET_SOFT_FLOAT && !TARGET_64BIT"
10947 "{fstds|fstd} %%fr0,-16(%%sp)\n\tldw -16(%%sp),%1\n\t{extru|extrw,u} %1,25,1,%1\n\t{dep|depw} %1,25,1,%0\n\tstw %0,-16(%%sp)\n\t{fldds|fldd} -16(%%sp),%%fr0"
10948 [(set_attr "type" "store_fpload")
10949 (set_attr "length" "24")])
10951 (define_insn "set_fpsr_64"
10952 [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")] UNSPECV_SET_FPSR)
10953 (clobber (match_scratch:DI 1 "=&r"))
10954 (clobber (match_scratch:SI 2 "=&r"))]
10955 "!TARGET_SOFT_FLOAT && TARGET_64BIT"
10956 "ldo -40(%%sp),%1\n\tfstd %%fr0,0(%1)\n\tldw 0(%1),%2\n\textrw,u %2,25,1,%2\n\tdepw %2,25,1,%0\n\tstw %0,0(%1)\n\tfldd 0(%1),%%fr0"
10957 [(set_attr "type" "store_fpload")
10958 (set_attr "length" "28")])