1 ;;- Machine description for HP PA-RISC architecture for GNU C compiler
2 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
3 ;; 2002 Free Software Foundation, Inc.
4 ;; Contributed by the Center for Software Science at the University
7 ;; This file is part of GNU CC.
9 ;; GNU CC is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; GNU CC is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU CC; see the file COPYING. If not, write to
21 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
22 ;; Boston, MA 02111-1307, USA.
24 ;; This gcc Version 2 machine description is inspired by sparc.md and
27 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
29 ;; Insn type. Used to default other attribute values.
31 ;; type "unary" insns have one input operand (1) and one output operand (0)
32 ;; type "binary" insns have two input operands (1,2) and one output (0)
35 "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch"
36 (const_string "binary"))
38 (define_attr "pa_combine_type"
39 "fmpy,faddsub,uncond_branch,addmove,none"
40 (const_string "none"))
42 ;; Processor type (for scheduling, not code generation) -- this attribute
43 ;; must exactly match the processor_type enumeration in pa.h.
45 ;; FIXME: Add 800 scheduling for completeness?
47 (define_attr "cpu" "700,7100,7100LC,7200,7300,8000" (const (symbol_ref "pa_cpu_attr")))
49 ;; Length (in # of bytes).
50 (define_attr "length" ""
51 (cond [(eq_attr "type" "load,fpload")
52 (if_then_else (match_operand 1 "symbolic_memory_operand" "")
53 (const_int 8) (const_int 4))
55 (eq_attr "type" "store,fpstore")
56 (if_then_else (match_operand 0 "symbolic_memory_operand" "")
57 (const_int 8) (const_int 4))
59 (eq_attr "type" "binary,shift,nullshift")
60 (if_then_else (match_operand 2 "arith_operand" "")
61 (const_int 4) (const_int 12))
63 (eq_attr "type" "move,unary,shift,nullshift")
64 (if_then_else (match_operand 1 "arith_operand" "")
65 (const_int 4) (const_int 8))]
69 (define_asm_attributes
70 [(set_attr "length" "4")
71 (set_attr "type" "multi")])
73 ;; Attributes for instruction and branch scheduling
75 ;; For conditional branches.
76 (define_attr "in_branch_delay" "false,true"
77 (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
78 (eq_attr "length" "4"))
80 (const_string "false")))
82 ;; Disallow instructions which use the FPU since they will tie up the FPU
83 ;; even if the instruction is nullified.
84 (define_attr "in_nullified_branch_delay" "false,true"
85 (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch")
86 (eq_attr "length" "4"))
88 (const_string "false")))
90 ;; For calls and millicode calls. Allow unconditional branches in the
92 (define_attr "in_call_delay" "false,true"
93 (cond [(and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
94 (eq_attr "length" "4"))
96 (eq_attr "type" "uncond_branch")
97 (if_then_else (ne (symbol_ref "TARGET_JUMP_IN_DELAY")
100 (const_string "false"))]
101 (const_string "false")))
104 ;; Call delay slot description.
105 (define_delay (eq_attr "type" "call")
106 [(eq_attr "in_call_delay" "true") (nil) (nil)])
108 ;; millicode call delay slot description. Note it disallows delay slot
109 ;; when TARGET_PORTABLE_RUNTIME is true.
110 (define_delay (eq_attr "type" "milli")
111 [(and (eq_attr "in_call_delay" "true")
112 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME") (const_int 0)))
115 ;; Return and other similar instructions.
116 (define_delay (eq_attr "type" "branch,parallel_branch")
117 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
119 ;; Floating point conditional branch delay slot description and
120 (define_delay (eq_attr "type" "fbranch")
121 [(eq_attr "in_branch_delay" "true")
122 (eq_attr "in_nullified_branch_delay" "true")
125 ;; Integer conditional branch delay slot description.
126 ;; Nullification of conditional branches on the PA is dependent on the
127 ;; direction of the branch. Forward branches nullify true and
128 ;; backward branches nullify false. If the direction is unknown
129 ;; then nullification is not allowed.
130 (define_delay (eq_attr "type" "cbranch")
131 [(eq_attr "in_branch_delay" "true")
132 (and (eq_attr "in_nullified_branch_delay" "true")
133 (attr_flag "forward"))
134 (and (eq_attr "in_nullified_branch_delay" "true")
135 (attr_flag "backward"))])
137 (define_delay (and (eq_attr "type" "uncond_branch")
138 (eq (symbol_ref "following_call (insn)")
140 [(eq_attr "in_branch_delay" "true") (nil) (nil)])
142 ;; Memory. Disregarding Cache misses, the Mustang memory times are:
143 ;; load: 2, fpload: 3
144 ;; store, fpstore: 3, no D-cache operations should be scheduled.
146 ;; The Timex (aka 700) has two floating-point units: ALU, and MUL/DIV/SQRT.
148 ;; Instruction Time Unit Minimum Distance (unit contention)
155 ;; fmpyadd 3 ALU,MPY 2
156 ;; fmpysub 3 ALU,MPY 2
157 ;; fmpycfxt 3 ALU,MPY 2
160 ;; fdiv,sgl 10 MPY 10
161 ;; fdiv,dbl 12 MPY 12
162 ;; fsqrt,sgl 14 MPY 14
163 ;; fsqrt,dbl 18 MPY 18
165 ;; We don't model fmpyadd/fmpysub properly as those instructions
166 ;; keep both the FP ALU and MPY units busy. Given that these
167 ;; processors are obsolete, I'm not going to spend the time to
168 ;; model those instructions correctly.
170 (define_automaton "pa700")
171 (define_cpu_unit "dummy_700,mem_700,fpalu_700,fpmpy_700" "pa700")
173 (define_insn_reservation "W0" 4
174 (and (eq_attr "type" "fpcc")
175 (eq_attr "cpu" "700"))
178 (define_insn_reservation "W1" 3
179 (and (eq_attr "type" "fpalu")
180 (eq_attr "cpu" "700"))
183 (define_insn_reservation "W2" 3
184 (and (eq_attr "type" "fpmulsgl,fpmuldbl")
185 (eq_attr "cpu" "700"))
188 (define_insn_reservation "W3" 10
189 (and (eq_attr "type" "fpdivsgl")
190 (eq_attr "cpu" "700"))
193 (define_insn_reservation "W4" 12
194 (and (eq_attr "type" "fpdivdbl")
195 (eq_attr "cpu" "700"))
198 (define_insn_reservation "W5" 14
199 (and (eq_attr "type" "fpsqrtsgl")
200 (eq_attr "cpu" "700"))
203 (define_insn_reservation "W6" 18
204 (and (eq_attr "type" "fpsqrtdbl")
205 (eq_attr "cpu" "700"))
208 (define_insn_reservation "W7" 2
209 (and (eq_attr "type" "load")
210 (eq_attr "cpu" "700"))
213 (define_insn_reservation "W8" 2
214 (and (eq_attr "type" "fpload")
215 (eq_attr "cpu" "700"))
218 (define_insn_reservation "W9" 3
219 (and (eq_attr "type" "store")
220 (eq_attr "cpu" "700"))
223 (define_insn_reservation "W10" 3
224 (and (eq_attr "type" "fpstore")
225 (eq_attr "cpu" "700"))
228 (define_insn_reservation "W11" 1
229 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,load,fpload,store,fpstore")
230 (eq_attr "cpu" "700"))
233 ;; We have a bypass for all computations in the FP unit which feed an
234 ;; FP store as long as the sizes are the same.
235 (define_bypass 2 "W1,W2" "W10" "hppa_fpstore_bypass_p")
236 (define_bypass 9 "W3" "W10" "hppa_fpstore_bypass_p")
237 (define_bypass 11 "W4" "W10" "hppa_fpstore_bypass_p")
238 (define_bypass 13 "W5" "W10" "hppa_fpstore_bypass_p")
239 (define_bypass 17 "W6" "W10" "hppa_fpstore_bypass_p")
241 ;; We have an "anti-bypass" for FP loads which feed an FP store.
242 (define_bypass 4 "W8" "W10" "hppa_fpstore_bypass_p")
244 ;; Function units for the 7100 and 7150. The 7100/7150 can dual-issue
245 ;; floating point computations with non-floating point computations (fp loads
246 ;; and stores are not fp computations).
248 ;; Memory. Disregarding Cache misses, memory loads take two cycles; stores also
249 ;; take two cycles, during which no Dcache operations should be scheduled.
250 ;; Any special cases are handled in pa_adjust_cost. The 7100, 7150 and 7100LC
251 ;; all have the same memory characteristics if one disregards cache misses.
253 ;; The 7100/7150 has three floating-point units: ALU, MUL, and DIV.
254 ;; There's no value in modeling the ALU and MUL separately though
255 ;; since there can never be a functional unit conflict given the
256 ;; latency and issue rates for those units.
259 ;; Instruction Time Unit Minimum Distance (unit contention)
266 ;; fmpyadd 2 ALU,MPY 1
267 ;; fmpysub 2 ALU,MPY 1
268 ;; fmpycfxt 2 ALU,MPY 1
272 ;; fdiv,dbl 15 DIV 15
274 ;; fsqrt,dbl 15 DIV 15
276 (define_automaton "pa7100")
277 (define_cpu_unit "i_7100, f_7100,fpmac_7100,fpdivsqrt_7100,mem_7100" "pa7100")
279 (define_insn_reservation "X0" 2
280 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
281 (eq_attr "cpu" "7100"))
284 (define_insn_reservation "X1" 8
285 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl")
286 (eq_attr "cpu" "7100"))
287 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*7")
289 (define_insn_reservation "X2" 15
290 (and (eq_attr "type" "fpdivdbl,fpsqrtdbl")
291 (eq_attr "cpu" "7100"))
292 "f_7100+fpdivsqrt_7100,fpdivsqrt_7100*14")
294 (define_insn_reservation "X3" 2
295 (and (eq_attr "type" "load")
296 (eq_attr "cpu" "7100"))
299 (define_insn_reservation "X4" 2
300 (and (eq_attr "type" "fpload")
301 (eq_attr "cpu" "7100"))
304 (define_insn_reservation "X5" 2
305 (and (eq_attr "type" "store")
306 (eq_attr "cpu" "7100"))
307 "i_7100+mem_7100,mem_7100")
309 (define_insn_reservation "X6" 2
310 (and (eq_attr "type" "fpstore")
311 (eq_attr "cpu" "7100"))
312 "i_7100+mem_7100,mem_7100")
314 (define_insn_reservation "X7" 1
315 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore")
316 (eq_attr "cpu" "7100"))
319 ;; We have a bypass for all computations in the FP unit which feed an
320 ;; FP store as long as the sizes are the same.
321 (define_bypass 1 "X0" "X6" "hppa_fpstore_bypass_p")
322 (define_bypass 7 "X1" "X6" "hppa_fpstore_bypass_p")
323 (define_bypass 14 "X2" "X6" "hppa_fpstore_bypass_p")
325 ;; We have an "anti-bypass" for FP loads which feed an FP store.
326 (define_bypass 3 "X4" "X6" "hppa_fpstore_bypass_p")
328 ;; The 7100LC has three floating-point units: ALU, MUL, and DIV.
329 ;; There's no value in modeling the ALU and MUL separately though
330 ;; since there can never be a functional unit conflict that
331 ;; can be avoided given the latency, issue rates and mandatory
332 ;; one cycle cpu-wide lock for a double precision fp multiply.
335 ;; Instruction Time Unit Minimum Distance (unit contention)
342 ;; fmpyadd,sgl 2 ALU,MPY 1
343 ;; fmpyadd,dbl 3 ALU,MPY 2
344 ;; fmpysub,sgl 2 ALU,MPY 1
345 ;; fmpysub,dbl 3 ALU,MPY 2
346 ;; fmpycfxt,sgl 2 ALU,MPY 1
347 ;; fmpycfxt,dbl 3 ALU,MPY 2
352 ;; fdiv,dbl 15 DIV 15
354 ;; fsqrt,dbl 15 DIV 15
356 ;; The PA7200 is just like the PA7100LC except that there is
357 ;; no store-store penalty.
359 ;; The PA7300 is just like the PA7200 except that there is
360 ;; no store-load penalty.
362 ;; Note there are some aspects of the 7100LC we are not modeling
363 ;; at the moment. I'll be reviewing the 7100LC scheduling info
364 ;; shortly and updating this description.
368 ;; other issue modeling
370 (define_automaton "pa7100lc")
371 (define_cpu_unit "i0_7100lc, i1_7100lc, f_7100lc" "pa7100lc")
372 (define_cpu_unit "fpmac_7100lc" "pa7100lc")
373 (define_cpu_unit "mem_7100lc" "pa7100lc")
375 ;; Double precision multiplies lock the entire CPU for one
376 ;; cycle. There is no way to avoid this lock and trying to
377 ;; schedule around the lock is pointless and thus there is no
378 ;; value in trying to model this lock.
380 ;; Not modeling the lock allows us to treat fp multiplies just
381 ;; like any other FP alu instruction. It allows for a smaller
382 ;; DFA and may reduce register pressure.
383 (define_insn_reservation "Y0" 2
384 (and (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
385 (eq_attr "cpu" "7100LC,7200,7300"))
386 "f_7100lc,fpmac_7100lc")
388 ;; fp division and sqrt instructions lock the entire CPU for
389 ;; 7 cycles (single precision) or 14 cycles (double precision).
390 ;; There is no way to avoid this lock and trying to schedule
391 ;; around the lock is pointless and thus there is no value in
392 ;; trying to model this lock. Not modeling the lock allows
393 ;; for a smaller DFA and may reduce register pressure.
394 (define_insn_reservation "Y1" 1
395 (and (eq_attr "type" "fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl")
396 (eq_attr "cpu" "7100LC,7200,7300"))
399 (define_insn_reservation "Y2" 2
400 (and (eq_attr "type" "load")
401 (eq_attr "cpu" "7100LC,7200,7300"))
402 "i1_7100lc+mem_7100lc")
404 (define_insn_reservation "Y3" 2
405 (and (eq_attr "type" "fpload")
406 (eq_attr "cpu" "7100LC,7200,7300"))
407 "i1_7100lc+mem_7100lc")
409 (define_insn_reservation "Y4" 2
410 (and (eq_attr "type" "store")
411 (eq_attr "cpu" "7100LC"))
412 "i1_7100lc+mem_7100lc,mem_7100lc")
414 (define_insn_reservation "Y5" 2
415 (and (eq_attr "type" "fpstore")
416 (eq_attr "cpu" "7100LC"))
417 "i1_7100lc+mem_7100lc,mem_7100lc")
419 (define_insn_reservation "Y6" 1
420 (and (eq_attr "type" "shift,nullshift")
421 (eq_attr "cpu" "7100LC,7200,7300"))
424 (define_insn_reservation "Y7" 1
425 (and (eq_attr "type" "!fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpsqrtsgl,fpdivdbl,fpsqrtdbl,load,fpload,store,fpstore,shift,nullshift")
426 (eq_attr "cpu" "7100LC,7200,7300"))
427 "(i0_7100lc|i1_7100lc)")
429 ;; The 7200 has a store-load penalty
430 (define_insn_reservation "Y8" 2
431 (and (eq_attr "type" "store")
432 (eq_attr "cpu" "7200"))
433 "i1_7100lc,mem_7100lc")
435 (define_insn_reservation "Y9" 2
436 (and (eq_attr "type" "fpstore")
437 (eq_attr "cpu" "7200"))
438 "i1_7100lc,mem_7100lc")
440 ;; The 7300 has no penalty for store-store or store-load
441 (define_insn_reservation "Y10" 2
442 (and (eq_attr "type" "store")
443 (eq_attr "cpu" "7300"))
446 (define_insn_reservation "Y11" 2
447 (and (eq_attr "type" "fpstore")
448 (eq_attr "cpu" "7300"))
451 ;; We have an "anti-bypass" for FP loads which feed an FP store.
452 (define_bypass 3 "Y3" "Y5,Y9,Y11" "hppa_fpstore_bypass_p")
454 ;; Scheduling for the PA8000 is somewhat different than scheduling for a
455 ;; traditional architecture.
457 ;; The PA8000 has a large (56) entry reorder buffer that is split between
458 ;; memory and non-memory operations.
460 ;; The PA8000 can issue two memory and two non-memory operations per cycle to
461 ;; the function units, with the exception of branches and multi-output
462 ;; instructions. The PA8000 can retire two non-memory operations per cycle
463 ;; and two memory operations per cycle, only one of which may be a store.
465 ;; Given the large reorder buffer, the processor can hide most latencies.
466 ;; According to HP, they've got the best results by scheduling for retirement
467 ;; bandwidth with limited latency scheduling for floating point operations.
468 ;; Latency for integer operations and memory references is ignored.
471 ;; We claim floating point operations have a 2 cycle latency and are
472 ;; fully pipelined, except for div and sqrt which are not pipelined and
473 ;; take from 17 to 31 cycles to complete.
475 ;; It's worth noting that there is no way to saturate all the functional
476 ;; units on the PA8000 as there is not enough issue bandwidth.
478 (define_automaton "pa8000")
479 (define_cpu_unit "inm0_8000, inm1_8000, im0_8000, im1_8000" "pa8000")
480 (define_cpu_unit "rnm0_8000, rnm1_8000, rm0_8000, rm1_8000" "pa8000")
481 (define_cpu_unit "store_8000" "pa8000")
482 (define_cpu_unit "f0_8000, f1_8000" "pa8000")
483 (define_cpu_unit "fdivsqrt0_8000, fdivsqrt1_8000" "pa8000")
484 (define_reservation "inm_8000" "inm0_8000 | inm1_8000")
485 (define_reservation "im_8000" "im0_8000 | im1_8000")
486 (define_reservation "rnm_8000" "rnm0_8000 | rnm1_8000")
487 (define_reservation "rm_8000" "rm0_8000 | rm1_8000")
488 (define_reservation "f_8000" "f0_8000 | f1_8000")
489 (define_reservation "fdivsqrt_8000" "fdivsqrt0_8000 | fdivsqrt1_8000")
491 ;; We can issue any two memops per cycle, but we can only retire
492 ;; one memory store per cycle. We assume that the reorder buffer
493 ;; will hide any memory latencies per HP's recommendation.
494 (define_insn_reservation "Z0" 0
496 (eq_attr "type" "load,fpload")
497 (eq_attr "cpu" "8000"))
500 (define_insn_reservation "Z1" 0
502 (eq_attr "type" "store,fpstore")
503 (eq_attr "cpu" "8000"))
504 "im_8000,rm_8000+store_8000")
506 ;; We can issue and retire two non-memory operations per cycle with
507 ;; a few exceptions (branches). This group catches those we want
508 ;; to assume have zero latency.
509 (define_insn_reservation "Z2" 0
511 (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl")
512 (eq_attr "cpu" "8000"))
515 ;; Branches use both slots in the non-memory issue and
517 (define_insn_reservation "Z3" 0
519 (eq_attr "type" "uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
520 (eq_attr "cpu" "8000"))
521 "inm0_8000+inm1_8000,rnm0_8000+rnm1_8000")
523 ;; We partial latency schedule the floating point units.
524 ;; They can issue/retire two at a time in the non-memory
525 ;; units. We fix their latency at 2 cycles and they
526 ;; are fully pipelined.
527 (define_insn_reservation "Z4" 1
529 (eq_attr "type" "fpcc,fpalu,fpmulsgl,fpmuldbl")
530 (eq_attr "cpu" "8000"))
531 "inm_8000,f_8000,rnm_8000")
533 ;; The fdivsqrt units are not pipelined and have a very long latency.
534 ;; To keep the DFA from exploding, we do not show all the
535 ;; reservations for the divsqrt unit.
536 (define_insn_reservation "Z5" 17
538 (eq_attr "type" "fpdivsgl,fpsqrtsgl")
539 (eq_attr "cpu" "8000"))
540 "inm_8000,fdivsqrt_8000*6,rnm_8000")
542 (define_insn_reservation "Z6" 31
544 (eq_attr "type" "fpdivdbl,fpsqrtdbl")
545 (eq_attr "cpu" "8000"))
546 "inm_8000,fdivsqrt_8000*6,rnm_8000")
550 ;; Compare instructions.
551 ;; This controls RTL generation and register allocation.
553 ;; We generate RTL for comparisons and branches by having the cmpxx
554 ;; patterns store away the operands. Then, the scc and bcc patterns
555 ;; emit RTL for both the compare and the branch.
558 (define_expand "cmpdi"
560 (compare:CC (match_operand:DI 0 "reg_or_0_operand" "")
561 (match_operand:DI 1 "register_operand" "")))]
566 hppa_compare_op0 = operands[0];
567 hppa_compare_op1 = operands[1];
568 hppa_branch_type = CMP_SI;
572 (define_expand "cmpsi"
574 (compare:CC (match_operand:SI 0 "reg_or_0_operand" "")
575 (match_operand:SI 1 "arith5_operand" "")))]
579 hppa_compare_op0 = operands[0];
580 hppa_compare_op1 = operands[1];
581 hppa_branch_type = CMP_SI;
585 (define_expand "cmpsf"
587 (compare:CCFP (match_operand:SF 0 "reg_or_0_operand" "")
588 (match_operand:SF 1 "reg_or_0_operand" "")))]
589 "! TARGET_SOFT_FLOAT"
592 hppa_compare_op0 = operands[0];
593 hppa_compare_op1 = operands[1];
594 hppa_branch_type = CMP_SF;
598 (define_expand "cmpdf"
600 (compare:CCFP (match_operand:DF 0 "reg_or_0_operand" "")
601 (match_operand:DF 1 "reg_or_0_operand" "")))]
602 "! TARGET_SOFT_FLOAT"
605 hppa_compare_op0 = operands[0];
606 hppa_compare_op1 = operands[1];
607 hppa_branch_type = CMP_DF;
613 (match_operator:CCFP 2 "comparison_operator"
614 [(match_operand:SF 0 "reg_or_0_operand" "fG")
615 (match_operand:SF 1 "reg_or_0_operand" "fG")]))]
616 "! TARGET_SOFT_FLOAT"
617 "fcmp,sgl,%Y2 %f0,%f1"
618 [(set_attr "length" "4")
619 (set_attr "type" "fpcc")])
623 (match_operator:CCFP 2 "comparison_operator"
624 [(match_operand:DF 0 "reg_or_0_operand" "fG")
625 (match_operand:DF 1 "reg_or_0_operand" "fG")]))]
626 "! TARGET_SOFT_FLOAT"
627 "fcmp,dbl,%Y2 %f0,%f1"
628 [(set_attr "length" "4")
629 (set_attr "type" "fpcc")])
631 ;; The following two patterns are optimization placeholders. In almost
632 ;; all cases, the user of the condition code will be simplified and the
633 ;; original condition code setting insn should be eliminated.
635 (define_insn "*setccfp0"
638 "! TARGET_SOFT_FLOAT"
639 "fcmp,dbl,!= %%fr0,%%fr0"
640 [(set_attr "length" "4")
641 (set_attr "type" "fpcc")])
643 (define_insn "*setccfp1"
646 "! TARGET_SOFT_FLOAT"
647 "fcmp,dbl,= %%fr0,%%fr0"
648 [(set_attr "length" "4")
649 (set_attr "type" "fpcc")])
654 [(set (match_operand:SI 0 "register_operand" "")
660 /* fp scc patterns rarely match, and are not a win on the PA. */
661 if (hppa_branch_type != CMP_SI)
663 /* set up operands from compare. */
664 operands[1] = hppa_compare_op0;
665 operands[2] = hppa_compare_op1;
666 /* fall through and generate default code */
670 [(set (match_operand:SI 0 "register_operand" "")
676 /* fp scc patterns rarely match, and are not a win on the PA. */
677 if (hppa_branch_type != CMP_SI)
679 operands[1] = hppa_compare_op0;
680 operands[2] = hppa_compare_op1;
684 [(set (match_operand:SI 0 "register_operand" "")
690 /* fp scc patterns rarely match, and are not a win on the PA. */
691 if (hppa_branch_type != CMP_SI)
693 operands[1] = hppa_compare_op0;
694 operands[2] = hppa_compare_op1;
698 [(set (match_operand:SI 0 "register_operand" "")
704 /* fp scc patterns rarely match, and are not a win on the PA. */
705 if (hppa_branch_type != CMP_SI)
707 operands[1] = hppa_compare_op0;
708 operands[2] = hppa_compare_op1;
712 [(set (match_operand:SI 0 "register_operand" "")
718 /* fp scc patterns rarely match, and are not a win on the PA. */
719 if (hppa_branch_type != CMP_SI)
721 operands[1] = hppa_compare_op0;
722 operands[2] = hppa_compare_op1;
726 [(set (match_operand:SI 0 "register_operand" "")
732 /* fp scc patterns rarely match, and are not a win on the PA. */
733 if (hppa_branch_type != CMP_SI)
735 operands[1] = hppa_compare_op0;
736 operands[2] = hppa_compare_op1;
739 (define_expand "sltu"
740 [(set (match_operand:SI 0 "register_operand" "")
741 (ltu:SI (match_dup 1)
746 if (hppa_branch_type != CMP_SI)
748 operands[1] = hppa_compare_op0;
749 operands[2] = hppa_compare_op1;
752 (define_expand "sgtu"
753 [(set (match_operand:SI 0 "register_operand" "")
754 (gtu:SI (match_dup 1)
759 if (hppa_branch_type != CMP_SI)
761 operands[1] = hppa_compare_op0;
762 operands[2] = hppa_compare_op1;
765 (define_expand "sleu"
766 [(set (match_operand:SI 0 "register_operand" "")
767 (leu:SI (match_dup 1)
772 if (hppa_branch_type != CMP_SI)
774 operands[1] = hppa_compare_op0;
775 operands[2] = hppa_compare_op1;
778 (define_expand "sgeu"
779 [(set (match_operand:SI 0 "register_operand" "")
780 (geu:SI (match_dup 1)
785 if (hppa_branch_type != CMP_SI)
787 operands[1] = hppa_compare_op0;
788 operands[2] = hppa_compare_op1;
791 ;; Instruction canonicalization puts immediate operands second, which
792 ;; is the reverse of what we want.
795 [(set (match_operand:SI 0 "register_operand" "=r")
796 (match_operator:SI 3 "comparison_operator"
797 [(match_operand:SI 1 "register_operand" "r")
798 (match_operand:SI 2 "arith11_operand" "rI")]))]
800 "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi 1,%0"
801 [(set_attr "type" "binary")
802 (set_attr "length" "8")])
805 [(set (match_operand:DI 0 "register_operand" "=r")
806 (match_operator:DI 3 "comparison_operator"
807 [(match_operand:DI 1 "register_operand" "r")
808 (match_operand:DI 2 "arith11_operand" "rI")]))]
810 "cmp%I2clr,*%B3 %2,%1,%0\;ldi 1,%0"
811 [(set_attr "type" "binary")
812 (set_attr "length" "8")])
814 (define_insn "iorscc"
815 [(set (match_operand:SI 0 "register_operand" "=r")
816 (ior:SI (match_operator:SI 3 "comparison_operator"
817 [(match_operand:SI 1 "register_operand" "r")
818 (match_operand:SI 2 "arith11_operand" "rI")])
819 (match_operator:SI 6 "comparison_operator"
820 [(match_operand:SI 4 "register_operand" "r")
821 (match_operand:SI 5 "arith11_operand" "rI")])))]
823 "{com%I2clr|cmp%I2clr},%S3 %2,%1,%%r0\;{com%I5clr|cmp%I5clr},%B6 %5,%4,%0\;ldi 1,%0"
824 [(set_attr "type" "binary")
825 (set_attr "length" "12")])
828 [(set (match_operand:DI 0 "register_operand" "=r")
829 (ior:DI (match_operator:DI 3 "comparison_operator"
830 [(match_operand:DI 1 "register_operand" "r")
831 (match_operand:DI 2 "arith11_operand" "rI")])
832 (match_operator:DI 6 "comparison_operator"
833 [(match_operand:DI 4 "register_operand" "r")
834 (match_operand:DI 5 "arith11_operand" "rI")])))]
836 "cmp%I2clr,*%S3 %2,%1,%%r0\;cmp%I5clr,*%B6 %5,%4,%0\;ldi 1,%0"
837 [(set_attr "type" "binary")
838 (set_attr "length" "12")])
840 ;; Combiner patterns for common operations performed with the output
841 ;; from an scc insn (negscc and incscc).
842 (define_insn "negscc"
843 [(set (match_operand:SI 0 "register_operand" "=r")
844 (neg:SI (match_operator:SI 3 "comparison_operator"
845 [(match_operand:SI 1 "register_operand" "r")
846 (match_operand:SI 2 "arith11_operand" "rI")])))]
848 "{com%I2clr|cmp%I2clr},%B3 %2,%1,%0\;ldi -1,%0"
849 [(set_attr "type" "binary")
850 (set_attr "length" "8")])
853 [(set (match_operand:DI 0 "register_operand" "=r")
854 (neg:DI (match_operator:DI 3 "comparison_operator"
855 [(match_operand:DI 1 "register_operand" "r")
856 (match_operand:DI 2 "arith11_operand" "rI")])))]
858 "cmp%I2clr,*%B3 %2,%1,%0\;ldi -1,%0"
859 [(set_attr "type" "binary")
860 (set_attr "length" "8")])
862 ;; Patterns for adding/subtracting the result of a boolean expression from
863 ;; a register. First we have special patterns that make use of the carry
864 ;; bit, and output only two instructions. For the cases we can't in
865 ;; general do in two instructions, the incscc pattern at the end outputs
866 ;; two or three instructions.
869 [(set (match_operand:SI 0 "register_operand" "=r")
870 (plus:SI (leu:SI (match_operand:SI 2 "register_operand" "r")
871 (match_operand:SI 3 "arith11_operand" "rI"))
872 (match_operand:SI 1 "register_operand" "r")))]
874 "sub%I3 %3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
875 [(set_attr "type" "binary")
876 (set_attr "length" "8")])
879 [(set (match_operand:DI 0 "register_operand" "=r")
880 (plus:DI (leu:DI (match_operand:DI 2 "register_operand" "r")
881 (match_operand:DI 3 "arith11_operand" "rI"))
882 (match_operand:DI 1 "register_operand" "r")))]
884 "sub%I3 %3,%2,%%r0\;add,dc %%r0,%1,%0"
885 [(set_attr "type" "binary")
886 (set_attr "length" "8")])
888 ; This need only accept registers for op3, since canonicalization
889 ; replaces geu with gtu when op3 is an integer.
891 [(set (match_operand:SI 0 "register_operand" "=r")
892 (plus:SI (geu:SI (match_operand:SI 2 "register_operand" "r")
893 (match_operand:SI 3 "register_operand" "r"))
894 (match_operand:SI 1 "register_operand" "r")))]
896 "sub %2,%3,%%r0\;{addc|add,c} %%r0,%1,%0"
897 [(set_attr "type" "binary")
898 (set_attr "length" "8")])
901 [(set (match_operand:DI 0 "register_operand" "=r")
902 (plus:DI (geu:DI (match_operand:DI 2 "register_operand" "r")
903 (match_operand:DI 3 "register_operand" "r"))
904 (match_operand:DI 1 "register_operand" "r")))]
906 "sub %2,%3,%%r0\;add,dc %%r0,%1,%0"
907 [(set_attr "type" "binary")
908 (set_attr "length" "8")])
910 ; Match only integers for op3 here. This is used as canonical form of the
911 ; geu pattern when op3 is an integer. Don't match registers since we can't
912 ; make better code than the general incscc pattern.
914 [(set (match_operand:SI 0 "register_operand" "=r")
915 (plus:SI (gtu:SI (match_operand:SI 2 "register_operand" "r")
916 (match_operand:SI 3 "int11_operand" "I"))
917 (match_operand:SI 1 "register_operand" "r")))]
919 "addi %k3,%2,%%r0\;{addc|add,c} %%r0,%1,%0"
920 [(set_attr "type" "binary")
921 (set_attr "length" "8")])
924 [(set (match_operand:DI 0 "register_operand" "=r")
925 (plus:DI (gtu:DI (match_operand:DI 2 "register_operand" "r")
926 (match_operand:DI 3 "int11_operand" "I"))
927 (match_operand:DI 1 "register_operand" "r")))]
929 "addi %k3,%2,%%r0\;add,dc %%r0,%1,%0"
930 [(set_attr "type" "binary")
931 (set_attr "length" "8")])
933 (define_insn "incscc"
934 [(set (match_operand:SI 0 "register_operand" "=r,r")
935 (plus:SI (match_operator:SI 4 "comparison_operator"
936 [(match_operand:SI 2 "register_operand" "r,r")
937 (match_operand:SI 3 "arith11_operand" "rI,rI")])
938 (match_operand:SI 1 "register_operand" "0,?r")))]
941 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi 1,%0,%0
942 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
943 [(set_attr "type" "binary,binary")
944 (set_attr "length" "8,12")])
947 [(set (match_operand:DI 0 "register_operand" "=r,r")
948 (plus:DI (match_operator:DI 4 "comparison_operator"
949 [(match_operand:DI 2 "register_operand" "r,r")
950 (match_operand:DI 3 "arith11_operand" "rI,rI")])
951 (match_operand:DI 1 "register_operand" "0,?r")))]
954 cmp%I3clr,*%B4 %3,%2,%%r0\;addi 1,%0,%0
955 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr 1,%1,%0\;copy %1,%0"
956 [(set_attr "type" "binary,binary")
957 (set_attr "length" "8,12")])
960 [(set (match_operand:SI 0 "register_operand" "=r")
961 (minus:SI (match_operand:SI 1 "register_operand" "r")
962 (gtu:SI (match_operand:SI 2 "register_operand" "r")
963 (match_operand:SI 3 "arith11_operand" "rI"))))]
965 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
966 [(set_attr "type" "binary")
967 (set_attr "length" "8")])
970 [(set (match_operand:DI 0 "register_operand" "=r")
971 (minus:DI (match_operand:DI 1 "register_operand" "r")
972 (gtu:DI (match_operand:DI 2 "register_operand" "r")
973 (match_operand:DI 3 "arith11_operand" "rI"))))]
975 "sub%I3 %3,%2,%%r0\;sub,db %1,%%r0,%0"
976 [(set_attr "type" "binary")
977 (set_attr "length" "8")])
980 [(set (match_operand:SI 0 "register_operand" "=r")
981 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
982 (gtu:SI (match_operand:SI 2 "register_operand" "r")
983 (match_operand:SI 3 "arith11_operand" "rI")))
984 (match_operand:SI 4 "register_operand" "r")))]
986 "sub%I3 %3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
987 [(set_attr "type" "binary")
988 (set_attr "length" "8")])
991 [(set (match_operand:DI 0 "register_operand" "=r")
992 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
993 (gtu:DI (match_operand:DI 2 "register_operand" "r")
994 (match_operand:DI 3 "arith11_operand" "rI")))
995 (match_operand:DI 4 "register_operand" "r")))]
997 "sub%I3 %3,%2,%%r0\;sub,db %1,%4,%0"
998 [(set_attr "type" "binary")
999 (set_attr "length" "8")])
1001 ; This need only accept registers for op3, since canonicalization
1002 ; replaces ltu with leu when op3 is an integer.
1004 [(set (match_operand:SI 0 "register_operand" "=r")
1005 (minus:SI (match_operand:SI 1 "register_operand" "r")
1006 (ltu:SI (match_operand:SI 2 "register_operand" "r")
1007 (match_operand:SI 3 "register_operand" "r"))))]
1009 "sub %2,%3,%%r0\;{subb|sub,b} %1,%%r0,%0"
1010 [(set_attr "type" "binary")
1011 (set_attr "length" "8")])
1014 [(set (match_operand:DI 0 "register_operand" "=r")
1015 (minus:DI (match_operand:DI 1 "register_operand" "r")
1016 (ltu:DI (match_operand:DI 2 "register_operand" "r")
1017 (match_operand:DI 3 "register_operand" "r"))))]
1019 "sub %2,%3,%%r0\;sub,db %1,%%r0,%0"
1020 [(set_attr "type" "binary")
1021 (set_attr "length" "8")])
1024 [(set (match_operand:SI 0 "register_operand" "=r")
1025 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1026 (ltu:SI (match_operand:SI 2 "register_operand" "r")
1027 (match_operand:SI 3 "register_operand" "r")))
1028 (match_operand:SI 4 "register_operand" "r")))]
1030 "sub %2,%3,%%r0\;{subb|sub,b} %1,%4,%0"
1031 [(set_attr "type" "binary")
1032 (set_attr "length" "8")])
1035 [(set (match_operand:DI 0 "register_operand" "=r")
1036 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1037 (ltu:DI (match_operand:DI 2 "register_operand" "r")
1038 (match_operand:DI 3 "register_operand" "r")))
1039 (match_operand:DI 4 "register_operand" "r")))]
1041 "sub %2,%3,%%r0\;sub,db %1,%4,%0"
1042 [(set_attr "type" "binary")
1043 (set_attr "length" "8")])
1045 ; Match only integers for op3 here. This is used as canonical form of the
1046 ; ltu pattern when op3 is an integer. Don't match registers since we can't
1047 ; make better code than the general incscc pattern.
1049 [(set (match_operand:SI 0 "register_operand" "=r")
1050 (minus:SI (match_operand:SI 1 "register_operand" "r")
1051 (leu:SI (match_operand:SI 2 "register_operand" "r")
1052 (match_operand:SI 3 "int11_operand" "I"))))]
1054 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%%r0,%0"
1055 [(set_attr "type" "binary")
1056 (set_attr "length" "8")])
1059 [(set (match_operand:DI 0 "register_operand" "=r")
1060 (minus:DI (match_operand:DI 1 "register_operand" "r")
1061 (leu:DI (match_operand:DI 2 "register_operand" "r")
1062 (match_operand:DI 3 "int11_operand" "I"))))]
1064 "addi %k3,%2,%%r0\;sub,db %1,%%r0,%0"
1065 [(set_attr "type" "binary")
1066 (set_attr "length" "8")])
1069 [(set (match_operand:SI 0 "register_operand" "=r")
1070 (minus:SI (minus:SI (match_operand:SI 1 "register_operand" "r")
1071 (leu:SI (match_operand:SI 2 "register_operand" "r")
1072 (match_operand:SI 3 "int11_operand" "I")))
1073 (match_operand:SI 4 "register_operand" "r")))]
1075 "addi %k3,%2,%%r0\;{subb|sub,b} %1,%4,%0"
1076 [(set_attr "type" "binary")
1077 (set_attr "length" "8")])
1080 [(set (match_operand:DI 0 "register_operand" "=r")
1081 (minus:DI (minus:DI (match_operand:DI 1 "register_operand" "r")
1082 (leu:DI (match_operand:DI 2 "register_operand" "r")
1083 (match_operand:DI 3 "int11_operand" "I")))
1084 (match_operand:DI 4 "register_operand" "r")))]
1086 "addi %k3,%2,%%r0\;sub,db %1,%4,%0"
1087 [(set_attr "type" "binary")
1088 (set_attr "length" "8")])
1090 (define_insn "decscc"
1091 [(set (match_operand:SI 0 "register_operand" "=r,r")
1092 (minus:SI (match_operand:SI 1 "register_operand" "0,?r")
1093 (match_operator:SI 4 "comparison_operator"
1094 [(match_operand:SI 2 "register_operand" "r,r")
1095 (match_operand:SI 3 "arith11_operand" "rI,rI")])))]
1098 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi -1,%0,%0
1099 {com%I3clr|cmp%I3clr},%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1100 [(set_attr "type" "binary,binary")
1101 (set_attr "length" "8,12")])
1104 [(set (match_operand:DI 0 "register_operand" "=r,r")
1105 (minus:DI (match_operand:DI 1 "register_operand" "0,?r")
1106 (match_operator:DI 4 "comparison_operator"
1107 [(match_operand:DI 2 "register_operand" "r,r")
1108 (match_operand:DI 3 "arith11_operand" "rI,rI")])))]
1111 cmp%I3clr,*%B4 %3,%2,%%r0\;addi -1,%0,%0
1112 cmp%I3clr,*%B4 %3,%2,%%r0\;addi,tr -1,%1,%0\;copy %1,%0"
1113 [(set_attr "type" "binary,binary")
1114 (set_attr "length" "8,12")])
1116 ; Patterns for max and min. (There is no need for an earlyclobber in the
1117 ; last alternative since the middle alternative will match if op0 == op1.)
1119 (define_insn "sminsi3"
1120 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1121 (smin:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1122 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1125 {comclr|cmpclr},> %2,%0,%%r0\;copy %2,%0
1126 {comiclr|cmpiclr},> %2,%0,%%r0\;ldi %2,%0
1127 {comclr|cmpclr},> %1,%r2,%0\;copy %1,%0"
1128 [(set_attr "type" "multi,multi,multi")
1129 (set_attr "length" "8,8,8")])
1131 (define_insn "smindi3"
1132 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1133 (smin:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1134 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1137 cmpclr,*> %2,%0,%%r0\;copy %2,%0
1138 cmpiclr,*> %2,%0,%%r0\;ldi %2,%0
1139 cmpclr,*> %1,%r2,%0\;copy %1,%0"
1140 [(set_attr "type" "multi,multi,multi")
1141 (set_attr "length" "8,8,8")])
1143 (define_insn "uminsi3"
1144 [(set (match_operand:SI 0 "register_operand" "=r,r")
1145 (umin:SI (match_operand:SI 1 "register_operand" "%0,0")
1146 (match_operand:SI 2 "arith11_operand" "r,I")))]
1149 {comclr|cmpclr},>> %2,%0,%%r0\;copy %2,%0
1150 {comiclr|cmpiclr},>> %2,%0,%%r0\;ldi %2,%0"
1151 [(set_attr "type" "multi,multi")
1152 (set_attr "length" "8,8")])
1154 (define_insn "umindi3"
1155 [(set (match_operand:DI 0 "register_operand" "=r,r")
1156 (umin:DI (match_operand:DI 1 "register_operand" "%0,0")
1157 (match_operand:DI 2 "arith11_operand" "r,I")))]
1160 cmpclr,*>> %2,%0,%%r0\;copy %2,%0
1161 cmpiclr,*>> %2,%0,%%r0\;ldi %2,%0"
1162 [(set_attr "type" "multi,multi")
1163 (set_attr "length" "8,8")])
1165 (define_insn "smaxsi3"
1166 [(set (match_operand:SI 0 "register_operand" "=r,r,r")
1167 (smax:SI (match_operand:SI 1 "register_operand" "%0,0,r")
1168 (match_operand:SI 2 "arith11_operand" "r,I,M")))]
1171 {comclr|cmpclr},< %2,%0,%%r0\;copy %2,%0
1172 {comiclr|cmpiclr},< %2,%0,%%r0\;ldi %2,%0
1173 {comclr|cmpclr},< %1,%r2,%0\;copy %1,%0"
1174 [(set_attr "type" "multi,multi,multi")
1175 (set_attr "length" "8,8,8")])
1177 (define_insn "smaxdi3"
1178 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1179 (smax:DI (match_operand:DI 1 "register_operand" "%0,0,r")
1180 (match_operand:DI 2 "arith11_operand" "r,I,M")))]
1183 cmpclr,*< %2,%0,%%r0\;copy %2,%0
1184 cmpiclr,*< %2,%0,%%r0\;ldi %2,%0
1185 cmpclr,*< %1,%r2,%0\;copy %1,%0"
1186 [(set_attr "type" "multi,multi,multi")
1187 (set_attr "length" "8,8,8")])
1189 (define_insn "umaxsi3"
1190 [(set (match_operand:SI 0 "register_operand" "=r,r")
1191 (umax:SI (match_operand:SI 1 "register_operand" "%0,0")
1192 (match_operand:SI 2 "arith11_operand" "r,I")))]
1195 {comclr|cmpclr},<< %2,%0,%%r0\;copy %2,%0
1196 {comiclr|cmpiclr},<< %2,%0,%%r0\;ldi %2,%0"
1197 [(set_attr "type" "multi,multi")
1198 (set_attr "length" "8,8")])
1200 (define_insn "umaxdi3"
1201 [(set (match_operand:DI 0 "register_operand" "=r,r")
1202 (umax:DI (match_operand:DI 1 "register_operand" "%0,0")
1203 (match_operand:DI 2 "arith11_operand" "r,I")))]
1206 cmpclr,*<< %2,%0,%%r0\;copy %2,%0
1207 cmpiclr,*<< %2,%0,%%r0\;ldi %2,%0"
1208 [(set_attr "type" "multi,multi")
1209 (set_attr "length" "8,8")])
1211 (define_insn "abssi2"
1212 [(set (match_operand:SI 0 "register_operand" "=r")
1213 (abs:SI (match_operand:SI 1 "register_operand" "r")))]
1215 "or,>= %%r0,%1,%0\;subi 0,%0,%0"
1216 [(set_attr "type" "multi")
1217 (set_attr "length" "8")])
1219 (define_insn "absdi2"
1220 [(set (match_operand:DI 0 "register_operand" "=r")
1221 (abs:DI (match_operand:DI 1 "register_operand" "r")))]
1223 "or,*>= %%r0,%1,%0\;subi 0,%0,%0"
1224 [(set_attr "type" "multi")
1225 (set_attr "length" "8")])
1227 ;;; Experimental conditional move patterns
1229 (define_expand "movsicc"
1230 [(set (match_operand:SI 0 "register_operand" "")
1232 (match_operator 1 "comparison_operator"
1235 (match_operand:SI 2 "reg_or_cint_move_operand" "")
1236 (match_operand:SI 3 "reg_or_cint_move_operand" "")))]
1240 enum rtx_code code = GET_CODE (operands[1]);
1242 if (hppa_branch_type != CMP_SI)
1245 if (GET_MODE (hppa_compare_op0) != GET_MODE (hppa_compare_op1)
1246 || GET_MODE (hppa_compare_op0) != GET_MODE (operands[0]))
1249 /* operands[1] is currently the result of compare_from_rtx. We want to
1250 emit a compare of the original operands. */
1251 operands[1] = gen_rtx_fmt_ee (code, SImode, hppa_compare_op0, hppa_compare_op1);
1252 operands[4] = hppa_compare_op0;
1253 operands[5] = hppa_compare_op1;
1256 ;; We used to accept any register for op1.
1258 ;; However, it loses sometimes because the compiler will end up using
1259 ;; different registers for op0 and op1 in some critical cases. local-alloc
1260 ;; will not tie op0 and op1 because op0 is used in multiple basic blocks.
1262 ;; If/when global register allocation supports tying we should allow any
1263 ;; register for op1 again.
1265 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1267 (match_operator 2 "comparison_operator"
1268 [(match_operand:SI 3 "register_operand" "r,r,r,r")
1269 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI")])
1270 (match_operand:SI 1 "reg_or_cint_move_operand" "0,J,N,K")
1274 {com%I4clr|cmp%I4clr},%S2 %4,%3,%%r0\;ldi 0,%0
1275 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldi %1,%0
1276 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;ldil L'%1,%0
1277 {com%I4clr|cmp%I4clr},%B2 %4,%3,%0\;{zdepi|depwi,z} %Z1,%0"
1278 [(set_attr "type" "multi,multi,multi,nullshift")
1279 (set_attr "length" "8,8,8,8")])
1282 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1284 (match_operator 5 "comparison_operator"
1285 [(match_operand:SI 3 "register_operand" "r,r,r,r,r,r,r,r")
1286 (match_operand:SI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1287 (match_operand:SI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1288 (match_operand:SI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1291 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;copy %2,%0
1292 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldi %2,%0
1293 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;ldil L'%2,%0
1294 {com%I4clr|cmp%I4clr},%S5 %4,%3,%%r0\;{zdepi|depwi,z} %Z2,%0
1295 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;copy %1,%0
1296 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldi %1,%0
1297 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;ldil L'%1,%0
1298 {com%I4clr|cmp%I4clr},%B5 %4,%3,%%r0\;{zdepi|depwi,z} %Z1,%0"
1299 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1300 (set_attr "length" "8,8,8,8,8,8,8,8")])
1302 (define_expand "movdicc"
1303 [(set (match_operand:DI 0 "register_operand" "")
1305 (match_operator 1 "comparison_operator"
1308 (match_operand:DI 2 "reg_or_cint_move_operand" "")
1309 (match_operand:DI 3 "reg_or_cint_move_operand" "")))]
1313 enum rtx_code code = GET_CODE (operands[1]);
1315 if (hppa_branch_type != CMP_SI)
1318 if (GET_MODE (hppa_compare_op0) != GET_MODE (hppa_compare_op1)
1319 || GET_MODE (hppa_compare_op0) != GET_MODE (operands[0]))
1322 /* operands[1] is currently the result of compare_from_rtx. We want to
1323 emit a compare of the original operands. */
1324 operands[1] = gen_rtx_fmt_ee (code, DImode, hppa_compare_op0, hppa_compare_op1);
1325 operands[4] = hppa_compare_op0;
1326 operands[5] = hppa_compare_op1;
1329 ; We need the first constraint alternative in order to avoid
1330 ; earlyclobbers on all other alternatives.
1332 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r")
1334 (match_operator 2 "comparison_operator"
1335 [(match_operand:DI 3 "register_operand" "r,r,r,r,r")
1336 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI")])
1337 (match_operand:DI 1 "reg_or_cint_move_operand" "0,r,J,N,K")
1341 cmp%I4clr,*%S2 %4,%3,%%r0\;ldi 0,%0
1342 cmp%I4clr,*%B2 %4,%3,%0\;copy %1,%0
1343 cmp%I4clr,*%B2 %4,%3,%0\;ldi %1,%0
1344 cmp%I4clr,*%B2 %4,%3,%0\;ldil L'%1,%0
1345 cmp%I4clr,*%B2 %4,%3,%0\;depdi,z %z1,%0"
1346 [(set_attr "type" "multi,multi,multi,multi,nullshift")
1347 (set_attr "length" "8,8,8,8,8")])
1350 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r,r,r,r,r")
1352 (match_operator 5 "comparison_operator"
1353 [(match_operand:DI 3 "register_operand" "r,r,r,r,r,r,r,r")
1354 (match_operand:DI 4 "arith11_operand" "rI,rI,rI,rI,rI,rI,rI,rI")])
1355 (match_operand:DI 1 "reg_or_cint_move_operand" "0,0,0,0,r,J,N,K")
1356 (match_operand:DI 2 "reg_or_cint_move_operand" "r,J,N,K,0,0,0,0")))]
1359 cmp%I4clr,*%S5 %4,%3,%%r0\;copy %2,%0
1360 cmp%I4clr,*%S5 %4,%3,%%r0\;ldi %2,%0
1361 cmp%I4clr,*%S5 %4,%3,%%r0\;ldil L'%2,%0
1362 cmp%I4clr,*%S5 %4,%3,%%r0\;depdi,z %z2,%0
1363 cmp%I4clr,*%B5 %4,%3,%%r0\;copy %1,%0
1364 cmp%I4clr,*%B5 %4,%3,%%r0\;ldi %1,%0
1365 cmp%I4clr,*%B5 %4,%3,%%r0\;ldil L'%1,%0
1366 cmp%I4clr,*%B5 %4,%3,%%r0\;depdi,z %z1,%0"
1367 [(set_attr "type" "multi,multi,multi,nullshift,multi,multi,multi,nullshift")
1368 (set_attr "length" "8,8,8,8,8,8,8,8")])
1370 ;; Conditional Branches
1372 (define_expand "beq"
1374 (if_then_else (eq (match_dup 1) (match_dup 2))
1375 (label_ref (match_operand 0 "" ""))
1380 if (hppa_branch_type != CMP_SI)
1382 emit_insn (gen_cmp_fp (EQ, hppa_compare_op0, hppa_compare_op1));
1383 emit_bcond_fp (NE, operands[0]);
1386 /* set up operands from compare. */
1387 operands[1] = hppa_compare_op0;
1388 operands[2] = hppa_compare_op1;
1389 /* fall through and generate default code */
1392 (define_expand "bne"
1394 (if_then_else (ne (match_dup 1) (match_dup 2))
1395 (label_ref (match_operand 0 "" ""))
1400 if (hppa_branch_type != CMP_SI)
1402 emit_insn (gen_cmp_fp (NE, hppa_compare_op0, hppa_compare_op1));
1403 emit_bcond_fp (NE, operands[0]);
1406 operands[1] = hppa_compare_op0;
1407 operands[2] = hppa_compare_op1;
1410 (define_expand "bgt"
1412 (if_then_else (gt (match_dup 1) (match_dup 2))
1413 (label_ref (match_operand 0 "" ""))
1418 if (hppa_branch_type != CMP_SI)
1420 emit_insn (gen_cmp_fp (GT, hppa_compare_op0, hppa_compare_op1));
1421 emit_bcond_fp (NE, operands[0]);
1424 operands[1] = hppa_compare_op0;
1425 operands[2] = hppa_compare_op1;
1428 (define_expand "blt"
1430 (if_then_else (lt (match_dup 1) (match_dup 2))
1431 (label_ref (match_operand 0 "" ""))
1436 if (hppa_branch_type != CMP_SI)
1438 emit_insn (gen_cmp_fp (LT, hppa_compare_op0, hppa_compare_op1));
1439 emit_bcond_fp (NE, operands[0]);
1442 operands[1] = hppa_compare_op0;
1443 operands[2] = hppa_compare_op1;
1446 (define_expand "bge"
1448 (if_then_else (ge (match_dup 1) (match_dup 2))
1449 (label_ref (match_operand 0 "" ""))
1454 if (hppa_branch_type != CMP_SI)
1456 emit_insn (gen_cmp_fp (GE, hppa_compare_op0, hppa_compare_op1));
1457 emit_bcond_fp (NE, operands[0]);
1460 operands[1] = hppa_compare_op0;
1461 operands[2] = hppa_compare_op1;
1464 (define_expand "ble"
1466 (if_then_else (le (match_dup 1) (match_dup 2))
1467 (label_ref (match_operand 0 "" ""))
1472 if (hppa_branch_type != CMP_SI)
1474 emit_insn (gen_cmp_fp (LE, hppa_compare_op0, hppa_compare_op1));
1475 emit_bcond_fp (NE, operands[0]);
1478 operands[1] = hppa_compare_op0;
1479 operands[2] = hppa_compare_op1;
1482 (define_expand "bgtu"
1484 (if_then_else (gtu (match_dup 1) (match_dup 2))
1485 (label_ref (match_operand 0 "" ""))
1490 if (hppa_branch_type != CMP_SI)
1492 operands[1] = hppa_compare_op0;
1493 operands[2] = hppa_compare_op1;
1496 (define_expand "bltu"
1498 (if_then_else (ltu (match_dup 1) (match_dup 2))
1499 (label_ref (match_operand 0 "" ""))
1504 if (hppa_branch_type != CMP_SI)
1506 operands[1] = hppa_compare_op0;
1507 operands[2] = hppa_compare_op1;
1510 (define_expand "bgeu"
1512 (if_then_else (geu (match_dup 1) (match_dup 2))
1513 (label_ref (match_operand 0 "" ""))
1518 if (hppa_branch_type != CMP_SI)
1520 operands[1] = hppa_compare_op0;
1521 operands[2] = hppa_compare_op1;
1524 (define_expand "bleu"
1526 (if_then_else (leu (match_dup 1) (match_dup 2))
1527 (label_ref (match_operand 0 "" ""))
1532 if (hppa_branch_type != CMP_SI)
1534 operands[1] = hppa_compare_op0;
1535 operands[2] = hppa_compare_op1;
1538 (define_expand "bltgt"
1540 (if_then_else (ltgt (match_dup 1) (match_dup 2))
1541 (label_ref (match_operand 0 "" ""))
1546 if (hppa_branch_type == CMP_SI)
1548 emit_insn (gen_cmp_fp (LTGT, hppa_compare_op0, hppa_compare_op1));
1549 emit_bcond_fp (NE, operands[0]);
1553 (define_expand "bunle"
1555 (if_then_else (unle (match_dup 1) (match_dup 2))
1556 (label_ref (match_operand 0 "" ""))
1561 if (hppa_branch_type == CMP_SI)
1563 emit_insn (gen_cmp_fp (UNLE, hppa_compare_op0, hppa_compare_op1));
1564 emit_bcond_fp (NE, operands[0]);
1568 (define_expand "bunlt"
1570 (if_then_else (unlt (match_dup 1) (match_dup 2))
1571 (label_ref (match_operand 0 "" ""))
1576 if (hppa_branch_type == CMP_SI)
1578 emit_insn (gen_cmp_fp (UNLT, hppa_compare_op0, hppa_compare_op1));
1579 emit_bcond_fp (NE, operands[0]);
1583 (define_expand "bunge"
1585 (if_then_else (unge (match_dup 1) (match_dup 2))
1586 (label_ref (match_operand 0 "" ""))
1591 if (hppa_branch_type == CMP_SI)
1593 emit_insn (gen_cmp_fp (UNGE, hppa_compare_op0, hppa_compare_op1));
1594 emit_bcond_fp (NE, operands[0]);
1598 (define_expand "bungt"
1600 (if_then_else (ungt (match_dup 1) (match_dup 2))
1601 (label_ref (match_operand 0 "" ""))
1606 if (hppa_branch_type == CMP_SI)
1608 emit_insn (gen_cmp_fp (UNGT, hppa_compare_op0, hppa_compare_op1));
1609 emit_bcond_fp (NE, operands[0]);
1613 (define_expand "buneq"
1615 (if_then_else (uneq (match_dup 1) (match_dup 2))
1616 (label_ref (match_operand 0 "" ""))
1621 if (hppa_branch_type == CMP_SI)
1623 emit_insn (gen_cmp_fp (UNEQ, hppa_compare_op0, hppa_compare_op1));
1624 emit_bcond_fp (NE, operands[0]);
1628 (define_expand "bunordered"
1630 (if_then_else (unordered (match_dup 1) (match_dup 2))
1631 (label_ref (match_operand 0 "" ""))
1636 if (hppa_branch_type == CMP_SI)
1638 emit_insn (gen_cmp_fp (UNORDERED, hppa_compare_op0, hppa_compare_op1));
1639 emit_bcond_fp (NE, operands[0]);
1643 (define_expand "bordered"
1645 (if_then_else (ordered (match_dup 1) (match_dup 2))
1646 (label_ref (match_operand 0 "" ""))
1651 if (hppa_branch_type == CMP_SI)
1653 emit_insn (gen_cmp_fp (ORDERED, hppa_compare_op0, hppa_compare_op1));
1654 emit_bcond_fp (NE, operands[0]);
1658 ;; Match the branch patterns.
1661 ;; Note a long backward conditional branch with an annulled delay slot
1662 ;; has a length of 12.
1666 (match_operator 3 "comparison_operator"
1667 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1668 (match_operand:SI 2 "arith5_operand" "rL")])
1669 (label_ref (match_operand 0 "" ""))
1674 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1675 get_attr_length (insn), 0, insn);
1677 [(set_attr "type" "cbranch")
1678 (set (attr "length")
1679 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1682 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1685 (eq (symbol_ref "flag_pic") (const_int 0))
1689 ;; Match the negated branch.
1694 (match_operator 3 "comparison_operator"
1695 [(match_operand:SI 1 "reg_or_0_operand" "rM")
1696 (match_operand:SI 2 "arith5_operand" "rL")])
1698 (label_ref (match_operand 0 "" ""))))]
1702 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1703 get_attr_length (insn), 1, insn);
1705 [(set_attr "type" "cbranch")
1706 (set (attr "length")
1707 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1710 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1713 (eq (symbol_ref "flag_pic") (const_int 0))
1720 (match_operator 3 "comparison_operator"
1721 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1722 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1723 (label_ref (match_operand 0 "" ""))
1728 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1729 get_attr_length (insn), 0, insn);
1731 [(set_attr "type" "cbranch")
1732 (set (attr "length")
1733 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1736 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1739 (eq (symbol_ref "flag_pic") (const_int 0))
1743 ;; Match the negated branch.
1748 (match_operator 3 "comparison_operator"
1749 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1750 (match_operand:DI 2 "reg_or_0_operand" "rM")])
1752 (label_ref (match_operand 0 "" ""))))]
1756 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1757 get_attr_length (insn), 1, insn);
1759 [(set_attr "type" "cbranch")
1760 (set (attr "length")
1761 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1764 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1767 (eq (symbol_ref "flag_pic") (const_int 0))
1773 (match_operator 3 "cmpib_comparison_operator"
1774 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1775 (match_operand:DI 2 "arith5_operand" "rL")])
1776 (label_ref (match_operand 0 "" ""))
1781 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1782 get_attr_length (insn), 0, insn);
1784 [(set_attr "type" "cbranch")
1785 (set (attr "length")
1786 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1789 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1792 (eq (symbol_ref "flag_pic") (const_int 0))
1796 ;; Match the negated branch.
1801 (match_operator 3 "cmpib_comparison_operator"
1802 [(match_operand:DI 1 "reg_or_0_operand" "rM")
1803 (match_operand:DI 2 "arith5_operand" "rL")])
1805 (label_ref (match_operand 0 "" ""))))]
1809 return output_cbranch (operands, INSN_ANNULLED_BRANCH_P (insn),
1810 get_attr_length (insn), 1, insn);
1812 [(set_attr "type" "cbranch")
1813 (set (attr "length")
1814 (cond [(lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1817 (lt (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
1820 (eq (symbol_ref "flag_pic") (const_int 0))
1824 ;; Branch on Bit patterns.
1828 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1830 (match_operand:SI 1 "uint5_operand" ""))
1832 (label_ref (match_operand 2 "" ""))
1837 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1838 get_attr_length (insn), 0, insn, 0);
1840 [(set_attr "type" "cbranch")
1841 (set (attr "length")
1842 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1850 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1852 (match_operand:DI 1 "uint32_operand" ""))
1854 (label_ref (match_operand 2 "" ""))
1859 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1860 get_attr_length (insn), 0, insn, 0);
1862 [(set_attr "type" "cbranch")
1863 (set (attr "length")
1864 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1872 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1874 (match_operand:SI 1 "uint5_operand" ""))
1877 (label_ref (match_operand 2 "" ""))))]
1881 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1882 get_attr_length (insn), 1, insn, 0);
1884 [(set_attr "type" "cbranch")
1885 (set (attr "length")
1886 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1894 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1896 (match_operand:DI 1 "uint32_operand" ""))
1899 (label_ref (match_operand 2 "" ""))))]
1903 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1904 get_attr_length (insn), 1, insn, 0);
1906 [(set_attr "type" "cbranch")
1907 (set (attr "length")
1908 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1916 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1918 (match_operand:SI 1 "uint5_operand" ""))
1920 (label_ref (match_operand 2 "" ""))
1925 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1926 get_attr_length (insn), 0, insn, 1);
1928 [(set_attr "type" "cbranch")
1929 (set (attr "length")
1930 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1938 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1940 (match_operand:DI 1 "uint32_operand" ""))
1942 (label_ref (match_operand 2 "" ""))
1947 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1948 get_attr_length (insn), 0, insn, 1);
1950 [(set_attr "type" "cbranch")
1951 (set (attr "length")
1952 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1960 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
1962 (match_operand:SI 1 "uint5_operand" ""))
1965 (label_ref (match_operand 2 "" ""))))]
1969 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1970 get_attr_length (insn), 1, insn, 1);
1972 [(set_attr "type" "cbranch")
1973 (set (attr "length")
1974 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
1982 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
1984 (match_operand:DI 1 "uint32_operand" ""))
1987 (label_ref (match_operand 2 "" ""))))]
1991 return output_bb (operands, INSN_ANNULLED_BRANCH_P (insn),
1992 get_attr_length (insn), 1, insn, 1);
1994 [(set_attr "type" "cbranch")
1995 (set (attr "length")
1996 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2001 ;; Branch on Variable Bit patterns.
2005 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2007 (match_operand:SI 1 "register_operand" "q"))
2009 (label_ref (match_operand 2 "" ""))
2014 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2015 get_attr_length (insn), 0, insn, 0);
2017 [(set_attr "type" "cbranch")
2018 (set (attr "length")
2019 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2027 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2029 (match_operand:DI 1 "register_operand" "q"))
2031 (label_ref (match_operand 2 "" ""))
2036 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2037 get_attr_length (insn), 0, insn, 0);
2039 [(set_attr "type" "cbranch")
2040 (set (attr "length")
2041 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2049 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2051 (match_operand:SI 1 "register_operand" "q"))
2054 (label_ref (match_operand 2 "" ""))))]
2058 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2059 get_attr_length (insn), 1, insn, 0);
2061 [(set_attr "type" "cbranch")
2062 (set (attr "length")
2063 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2071 (ne (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2073 (match_operand:DI 1 "register_operand" "q"))
2076 (label_ref (match_operand 2 "" ""))))]
2080 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2081 get_attr_length (insn), 1, insn, 0);
2083 [(set_attr "type" "cbranch")
2084 (set (attr "length")
2085 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2093 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2095 (match_operand:SI 1 "register_operand" "q"))
2097 (label_ref (match_operand 2 "" ""))
2102 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2103 get_attr_length (insn), 0, insn, 1);
2105 [(set_attr "type" "cbranch")
2106 (set (attr "length")
2107 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2115 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2117 (match_operand:DI 1 "register_operand" "q"))
2119 (label_ref (match_operand 2 "" ""))
2124 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2125 get_attr_length (insn), 0, insn, 1);
2127 [(set_attr "type" "cbranch")
2128 (set (attr "length")
2129 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2137 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
2139 (match_operand:SI 1 "register_operand" "q"))
2142 (label_ref (match_operand 2 "" ""))))]
2146 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2147 get_attr_length (insn), 1, insn, 1);
2149 [(set_attr "type" "cbranch")
2150 (set (attr "length")
2151 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2159 (eq (zero_extract:DI (match_operand:DI 0 "register_operand" "r")
2161 (match_operand:DI 1 "register_operand" "q"))
2164 (label_ref (match_operand 2 "" ""))))]
2168 return output_bvb (operands, INSN_ANNULLED_BRANCH_P (insn),
2169 get_attr_length (insn), 1, insn, 1);
2171 [(set_attr "type" "cbranch")
2172 (set (attr "length")
2173 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
2178 ;; Floating point branches
2180 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2181 (label_ref (match_operand 0 "" ""))
2183 "! TARGET_SOFT_FLOAT"
2186 if (INSN_ANNULLED_BRANCH_P (insn))
2187 return \"ftest\;b,n %0\";
2189 return \"ftest\;b%* %0\";
2191 [(set_attr "type" "fbranch")
2192 (set_attr "length" "8")])
2195 [(set (pc) (if_then_else (ne (reg:CCFP 0) (const_int 0))
2197 (label_ref (match_operand 0 "" ""))))]
2198 "! TARGET_SOFT_FLOAT"
2201 if (INSN_ANNULLED_BRANCH_P (insn))
2202 return \"ftest\;add,tr %%r0,%%r0,%%r0\;b,n %0\";
2204 return \"ftest\;add,tr %%r0,%%r0,%%r0\;b%* %0\";
2206 [(set_attr "type" "fbranch")
2207 (set_attr "length" "12")])
2209 ;; Move instructions
2211 (define_expand "movsi"
2212 [(set (match_operand:SI 0 "general_operand" "")
2213 (match_operand:SI 1 "general_operand" ""))]
2217 if (emit_move_sequence (operands, SImode, 0))
2221 ;; Reloading an SImode or DImode value requires a scratch register if
2222 ;; going in to or out of float point registers.
2224 (define_expand "reload_insi"
2225 [(set (match_operand:SI 0 "register_operand" "=Z")
2226 (match_operand:SI 1 "non_hard_reg_operand" ""))
2227 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2231 if (emit_move_sequence (operands, SImode, operands[2]))
2234 /* We don't want the clobber emitted, so handle this ourselves. */
2235 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
2239 (define_expand "reload_outsi"
2240 [(set (match_operand:SI 0 "non_hard_reg_operand" "")
2241 (match_operand:SI 1 "register_operand" "Z"))
2242 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
2246 if (emit_move_sequence (operands, SImode, operands[2]))
2249 /* We don't want the clobber emitted, so handle this ourselves. */
2250 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
2255 [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
2256 "=r,r,r,r,r,r,Q,*q,!f,f,*TR")
2257 (match_operand:SI 1 "move_operand"
2258 "A,r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
2259 "(register_operand (operands[0], SImode)
2260 || reg_or_0_operand (operands[1], SImode))
2261 && ! TARGET_SOFT_FLOAT"
2267 {zdepi|depwi,z} %Z1,%0
2274 [(set_attr "type" "load,move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
2275 (set_attr "pa_combine_type" "addmove")
2276 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")])
2279 [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
2280 "=r,r,r,r,r,r,Q,*q")
2281 (match_operand:SI 1 "move_operand"
2282 "A,r,J,N,K,RQ,rM,rM"))]
2283 "(register_operand (operands[0], SImode)
2284 || reg_or_0_operand (operands[1], SImode))
2285 && TARGET_SOFT_FLOAT"
2291 {zdepi|depwi,z} %Z1,%0
2295 [(set_attr "type" "load,move,move,move,move,load,store,move")
2296 (set_attr "pa_combine_type" "addmove")
2297 (set_attr "length" "4,4,4,4,4,4,4,4")])
2300 [(set (match_operand:SI 0 "register_operand" "=r")
2301 (mem:SI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
2302 (match_operand:SI 2 "register_operand" "r"))))]
2303 "! TARGET_DISABLE_INDEXING"
2304 "{ldwx|ldw} %2(%1),%0"
2305 [(set_attr "type" "load")
2306 (set_attr "length" "4")])
2309 [(set (match_operand:SI 0 "register_operand" "=r")
2310 (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
2311 (match_operand:SI 2 "basereg_operand" "r"))))]
2312 "! TARGET_DISABLE_INDEXING"
2313 "{ldwx|ldw} %1(%2),%0"
2314 [(set_attr "type" "load")
2315 (set_attr "length" "4")])
2317 ;; Load or store with base-register modification.
2319 (define_expand "pre_load"
2320 [(parallel [(set (match_operand:SI 0 "register_operand" "")
2321 (mem (plus (match_operand 1 "register_operand" "")
2322 (match_operand 2 "pre_cint_operand" ""))))
2324 (plus (match_dup 1) (match_dup 2)))])]
2330 emit_insn (gen_pre_ldd (operands[0], operands[1], operands[2]));
2333 emit_insn (gen_pre_ldw (operands[0], operands[1], operands[2]));
2337 (define_insn "pre_ldw"
2338 [(set (match_operand:SI 0 "register_operand" "=r")
2339 (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2340 (match_operand:SI 2 "pre_cint_operand" ""))))
2342 (plus:SI (match_dup 1) (match_dup 2)))]
2346 if (INTVAL (operands[2]) < 0)
2347 return \"{ldwm|ldw,mb} %2(%1),%0\";
2348 return \"{ldws|ldw},mb %2(%1),%0\";
2350 [(set_attr "type" "load")
2351 (set_attr "length" "4")])
2353 (define_insn "pre_ldd"
2354 [(set (match_operand:DI 0 "register_operand" "=r")
2355 (mem:DI (plus:DI (match_operand:DI 1 "register_operand" "+r")
2356 (match_operand:DI 2 "pre_cint_operand" ""))))
2358 (plus:DI (match_dup 1) (match_dup 2)))]
2361 [(set_attr "type" "load")
2362 (set_attr "length" "4")])
2365 [(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "+r")
2366 (match_operand:SI 1 "pre_cint_operand" "")))
2367 (match_operand:SI 2 "reg_or_0_operand" "rM"))
2369 (plus:SI (match_dup 0) (match_dup 1)))]
2373 if (INTVAL (operands[1]) < 0)
2374 return \"{stwm|stw,mb} %r2,%1(%0)\";
2375 return \"{stws|stw},mb %r2,%1(%0)\";
2377 [(set_attr "type" "store")
2378 (set_attr "length" "4")])
2381 [(set (match_operand:SI 0 "register_operand" "=r")
2382 (mem:SI (match_operand:SI 1 "register_operand" "+r")))
2384 (plus:SI (match_dup 1)
2385 (match_operand:SI 2 "post_cint_operand" "")))]
2389 if (INTVAL (operands[2]) > 0)
2390 return \"{ldwm|ldw,ma} %2(%1),%0\";
2391 return \"{ldws|ldw},ma %2(%1),%0\";
2393 [(set_attr "type" "load")
2394 (set_attr "length" "4")])
2396 (define_expand "post_store"
2397 [(parallel [(set (mem (match_operand 0 "register_operand" ""))
2398 (match_operand 1 "reg_or_0_operand" ""))
2401 (match_operand 2 "post_cint_operand" "")))])]
2407 emit_insn (gen_post_std (operands[0], operands[1], operands[2]));
2410 emit_insn (gen_post_stw (operands[0], operands[1], operands[2]));
2414 (define_insn "post_stw"
2415 [(set (mem:SI (match_operand:SI 0 "register_operand" "+r"))
2416 (match_operand:SI 1 "reg_or_0_operand" "rM"))
2418 (plus:SI (match_dup 0)
2419 (match_operand:SI 2 "post_cint_operand" "")))]
2423 if (INTVAL (operands[2]) > 0)
2424 return \"{stwm|stw,ma} %r1,%2(%0)\";
2425 return \"{stws|stw},ma %r1,%2(%0)\";
2427 [(set_attr "type" "store")
2428 (set_attr "length" "4")])
2430 (define_insn "post_std"
2431 [(set (mem:DI (match_operand:DI 0 "register_operand" "+r"))
2432 (match_operand:DI 1 "reg_or_0_operand" "rM"))
2434 (plus:DI (match_dup 0)
2435 (match_operand:DI 2 "post_cint_operand" "")))]
2438 [(set_attr "type" "store")
2439 (set_attr "length" "4")])
2441 ;; For loading the address of a label while generating PIC code.
2442 ;; Note since this pattern can be created at reload time (via movsi), all
2443 ;; the same rules for movsi apply here. (no new pseudos, no temporaries).
2445 [(set (match_operand 0 "pmode_register_operand" "=a")
2446 (match_operand 1 "pic_label_operand" ""))]
2451 extern FILE *asm_out_file;
2453 xoperands[0] = operands[0];
2454 xoperands[1] = operands[1];
2455 if (TARGET_SOM || ! TARGET_GAS)
2456 xoperands[2] = gen_label_rtx ();
2458 output_asm_insn (\"{bl|b,l} .+8,%0\", xoperands);
2459 output_asm_insn (\"{depi|depwi} 0,31,2,%0\", xoperands);
2460 if (TARGET_SOM || ! TARGET_GAS)
2461 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
2462 CODE_LABEL_NUMBER (xoperands[2]));
2464 /* If we're trying to load the address of a label that happens to be
2465 close, then we can use a shorter sequence. */
2466 if (GET_CODE (operands[1]) == LABEL_REF
2467 && INSN_ADDRESSES_SET_P ()
2468 && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
2469 - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
2471 /* Prefixing with R% here is wrong, it extracts just 11 bits and is
2472 always non-negative. */
2473 if (TARGET_SOM || ! TARGET_GAS)
2474 output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
2476 output_asm_insn (\"ldo %1-$PIC_pcrel$0+8(%0),%0\", xoperands);
2480 if (TARGET_SOM || ! TARGET_GAS)
2482 output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
2483 output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
2487 output_asm_insn (\"addil L%%%1-$PIC_pcrel$0+8,%0\", xoperands);
2488 output_asm_insn (\"ldo R%%%1-$PIC_pcrel$0+12(%0),%0\",
2494 [(set_attr "type" "multi")
2495 (set_attr "length" "16")]) ; 12 or 16
2498 [(set (match_operand:SI 0 "register_operand" "=a")
2499 (plus:SI (match_operand:SI 1 "register_operand" "r")
2500 (high:SI (match_operand 2 "" ""))))]
2501 "symbolic_operand (operands[2], Pmode)
2502 && ! function_label_operand (operands[2], Pmode)
2505 [(set_attr "type" "binary")
2506 (set_attr "length" "4")])
2509 [(set (match_operand:DI 0 "register_operand" "=a")
2510 (plus:DI (match_operand:DI 1 "register_operand" "r")
2511 (high:DI (match_operand 2 "" ""))))]
2512 "symbolic_operand (operands[2], Pmode)
2513 && ! function_label_operand (operands[2], Pmode)
2517 [(set_attr "type" "binary")
2518 (set_attr "length" "4")])
2520 ;; Always use addil rather than ldil;add sequences. This allows the
2521 ;; HP linker to eliminate the dp relocation if the symbolic operand
2522 ;; lives in the TEXT space.
2524 [(set (match_operand:SI 0 "register_operand" "=a")
2525 (high:SI (match_operand 1 "" "")))]
2526 "symbolic_operand (operands[1], Pmode)
2527 && ! function_label_operand (operands[1], Pmode)
2528 && ! read_only_operand (operands[1], Pmode)
2532 if (TARGET_LONG_LOAD_STORE)
2533 return \"addil NLR'%H1,%%r27\;ldo N'%H1(%%r1),%%r1\";
2535 return \"addil LR'%H1,%%r27\";
2537 [(set_attr "type" "binary")
2538 (set (attr "length")
2539 (if_then_else (eq (symbol_ref "TARGET_LONG_LOAD_STORE") (const_int 0))
2544 ;; This is for use in the prologue/epilogue code. We need it
2545 ;; to add large constants to a stack pointer or frame pointer.
2546 ;; Because of the additional %r1 pressure, we probably do not
2547 ;; want to use this in general code, so make it available
2548 ;; only after reload.
2550 [(set (match_operand:SI 0 "register_operand" "=!a,*r")
2551 (plus:SI (match_operand:SI 1 "register_operand" "r,r")
2552 (high:SI (match_operand 2 "const_int_operand" ""))))]
2556 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2557 [(set_attr "type" "binary,binary")
2558 (set_attr "length" "4,8")])
2561 [(set (match_operand:DI 0 "register_operand" "=!a,*r")
2562 (plus:DI (match_operand:DI 1 "register_operand" "r,r")
2563 (high:DI (match_operand 2 "const_int_operand" ""))))]
2564 "reload_completed && TARGET_64BIT"
2567 ldil L'%G2,%0\;{addl|add,l} %0,%1,%0"
2568 [(set_attr "type" "binary,binary")
2569 (set_attr "length" "4,8")])
2572 [(set (match_operand:SI 0 "register_operand" "=r")
2573 (high:SI (match_operand 1 "" "")))]
2574 "(!flag_pic || !symbolic_operand (operands[1], Pmode))
2575 && !is_function_label_plus_const (operands[1])"
2578 if (symbolic_operand (operands[1], Pmode))
2579 return \"ldil LR'%H1,%0\";
2581 return \"ldil L'%G1,%0\";
2583 [(set_attr "type" "move")
2584 (set_attr "length" "4")])
2587 [(set (match_operand:DI 0 "register_operand" "=r")
2588 (high:DI (match_operand 1 "const_int_operand" "")))]
2591 [(set_attr "type" "move")
2592 (set_attr "length" "4")])
2595 [(set (match_operand:DI 0 "register_operand" "=r")
2596 (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
2597 (match_operand:DI 2 "const_int_operand" "i")))]
2600 [(set_attr "type" "move")
2601 (set_attr "length" "4")])
2604 [(set (match_operand:SI 0 "register_operand" "=r")
2605 (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
2606 (match_operand:SI 2 "immediate_operand" "i")))]
2607 "!is_function_label_plus_const (operands[2])"
2610 if (flag_pic && symbolic_operand (operands[2], Pmode))
2612 else if (symbolic_operand (operands[2], Pmode))
2613 return \"ldo RR'%G2(%1),%0\";
2615 return \"ldo R'%G2(%1),%0\";
2617 [(set_attr "type" "move")
2618 (set_attr "length" "4")])
2620 ;; Now that a symbolic_address plus a constant is broken up early
2621 ;; in the compilation phase (for better CSE) we need a special
2622 ;; combiner pattern to load the symbolic address plus the constant
2623 ;; in only 2 instructions. (For cases where the symbolic address
2624 ;; was not a common subexpression.)
2626 [(set (match_operand:SI 0 "register_operand" "")
2627 (match_operand:SI 1 "symbolic_operand" ""))
2628 (clobber (match_operand:SI 2 "register_operand" ""))]
2629 "! (flag_pic && pic_label_operand (operands[1], SImode))"
2630 [(set (match_dup 2) (high:SI (match_dup 1)))
2631 (set (match_dup 0) (lo_sum:SI (match_dup 2) (match_dup 1)))]
2634 ;; hppa_legitimize_address goes to a great deal of trouble to
2635 ;; create addresses which use indexing. In some cases, this
2636 ;; is a lose because there isn't any store instructions which
2637 ;; allow indexed addresses (with integer register source).
2639 ;; These define_splits try to turn a 3 insn store into
2640 ;; a 2 insn store with some creative RTL rewriting.
2642 [(set (mem:SI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2643 (match_operand:SI 1 "shadd_operand" ""))
2644 (plus:SI (match_operand:SI 2 "register_operand" "")
2645 (match_operand:SI 3 "const_int_operand" ""))))
2646 (match_operand:SI 4 "register_operand" ""))
2647 (clobber (match_operand:SI 5 "register_operand" ""))]
2649 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2651 (set (mem:SI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2655 [(set (mem:HI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2656 (match_operand:SI 1 "shadd_operand" ""))
2657 (plus:SI (match_operand:SI 2 "register_operand" "")
2658 (match_operand:SI 3 "const_int_operand" ""))))
2659 (match_operand:HI 4 "register_operand" ""))
2660 (clobber (match_operand:SI 5 "register_operand" ""))]
2662 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2664 (set (mem:HI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2668 [(set (mem:QI (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "")
2669 (match_operand:SI 1 "shadd_operand" ""))
2670 (plus:SI (match_operand:SI 2 "register_operand" "")
2671 (match_operand:SI 3 "const_int_operand" ""))))
2672 (match_operand:QI 4 "register_operand" ""))
2673 (clobber (match_operand:SI 5 "register_operand" ""))]
2675 [(set (match_dup 5) (plus:SI (mult:SI (match_dup 0) (match_dup 1))
2677 (set (mem:QI (plus:SI (match_dup 5) (match_dup 3))) (match_dup 4))]
2680 (define_expand "movhi"
2681 [(set (match_operand:HI 0 "general_operand" "")
2682 (match_operand:HI 1 "general_operand" ""))]
2686 if (emit_move_sequence (operands, HImode, 0))
2691 [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,*q,!*f")
2692 (match_operand:HI 1 "move_operand" "r,J,N,K,RQ,rM,rM,!*fM"))]
2693 "register_operand (operands[0], HImode)
2694 || reg_or_0_operand (operands[1], HImode)"
2699 {zdepi|depwi,z} %Z1,%0
2704 [(set_attr "type" "move,move,move,shift,load,store,move,fpalu")
2705 (set_attr "pa_combine_type" "addmove")
2706 (set_attr "length" "4,4,4,4,4,4,4,4")])
2709 [(set (match_operand:HI 0 "register_operand" "=r")
2710 (mem:HI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
2711 (match_operand:SI 2 "register_operand" "r"))))]
2712 "! TARGET_DISABLE_INDEXING"
2713 "{ldhx|ldh} %2(%1),%0"
2714 [(set_attr "type" "load")
2715 (set_attr "length" "4")])
2718 [(set (match_operand:HI 0 "register_operand" "=r")
2719 (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
2720 (match_operand:SI 2 "basereg_operand" "r"))))]
2721 "! TARGET_DISABLE_INDEXING"
2722 "{ldhx|ldh} %1(%2),%0"
2723 [(set_attr "type" "load")
2724 (set_attr "length" "4")])
2726 ; Now zero extended variants.
2728 [(set (match_operand:SI 0 "register_operand" "=r")
2729 (zero_extend:SI (mem:HI
2731 (match_operand:SI 1 "basereg_operand" "r")
2732 (match_operand:SI 2 "register_operand" "r")))))]
2733 "! TARGET_DISABLE_INDEXING"
2734 "{ldhx|ldh} %2(%1),%0"
2735 [(set_attr "type" "load")
2736 (set_attr "length" "4")])
2739 [(set (match_operand:SI 0 "register_operand" "=r")
2740 (zero_extend:SI (mem:HI
2742 (match_operand:SI 1 "register_operand" "r")
2743 (match_operand:SI 2 "basereg_operand" "r")))))]
2744 "! TARGET_DISABLE_INDEXING"
2745 "{ldhx|ldh} %1(%2),%0"
2746 [(set_attr "type" "load")
2747 (set_attr "length" "4")])
2750 [(set (match_operand:HI 0 "register_operand" "=r")
2751 (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2752 (match_operand:SI 2 "int5_operand" "L"))))
2754 (plus:SI (match_dup 1) (match_dup 2)))]
2756 "{ldhs|ldh},mb %2(%1),%0"
2757 [(set_attr "type" "load")
2758 (set_attr "length" "4")])
2760 ; And a zero extended variant.
2762 [(set (match_operand:SI 0 "register_operand" "=r")
2763 (zero_extend:SI (mem:HI
2765 (match_operand:SI 1 "register_operand" "+r")
2766 (match_operand:SI 2 "int5_operand" "L")))))
2768 (plus:SI (match_dup 1) (match_dup 2)))]
2770 "{ldhs|ldh},mb %2(%1),%0"
2771 [(set_attr "type" "load")
2772 (set_attr "length" "4")])
2775 [(set (mem:HI (plus:SI (match_operand:SI 0 "register_operand" "+r")
2776 (match_operand:SI 1 "int5_operand" "L")))
2777 (match_operand:HI 2 "reg_or_0_operand" "rM"))
2779 (plus:SI (match_dup 0) (match_dup 1)))]
2781 "{sths|sth},mb %r2,%1(%0)"
2782 [(set_attr "type" "store")
2783 (set_attr "length" "4")])
2786 [(set (match_operand:HI 0 "register_operand" "=r")
2787 (plus:HI (match_operand:HI 1 "register_operand" "r")
2788 (match_operand 2 "const_int_operand" "J")))]
2791 [(set_attr "type" "binary")
2792 (set_attr "pa_combine_type" "addmove")
2793 (set_attr "length" "4")])
2795 (define_expand "movqi"
2796 [(set (match_operand:QI 0 "general_operand" "")
2797 (match_operand:QI 1 "general_operand" ""))]
2801 if (emit_move_sequence (operands, QImode, 0))
2806 [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,*q,!*f")
2807 (match_operand:QI 1 "move_operand" "r,J,N,K,RQ,rM,rM,!*fM"))]
2808 "register_operand (operands[0], QImode)
2809 || reg_or_0_operand (operands[1], QImode)"
2814 {zdepi|depwi,z} %Z1,%0
2819 [(set_attr "type" "move,move,move,shift,load,store,move,fpalu")
2820 (set_attr "pa_combine_type" "addmove")
2821 (set_attr "length" "4,4,4,4,4,4,4,4")])
2824 [(set (match_operand:QI 0 "register_operand" "=r")
2825 (mem:QI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
2826 (match_operand:SI 2 "register_operand" "r"))))]
2827 "! TARGET_DISABLE_INDEXING"
2828 "{ldbx|ldb} %2(%1),%0"
2829 [(set_attr "type" "load")
2830 (set_attr "length" "4")])
2833 [(set (match_operand:QI 0 "register_operand" "=r")
2834 (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
2835 (match_operand:SI 2 "basereg_operand" "r"))))]
2836 "! TARGET_DISABLE_INDEXING"
2837 "{ldbx|ldb} %1(%2),%0"
2838 [(set_attr "type" "load")
2839 (set_attr "length" "4")])
2841 ; Indexed byte load with zero extension to SImode or HImode.
2843 [(set (match_operand:SI 0 "register_operand" "=r")
2844 (zero_extend:SI (mem:QI
2846 (match_operand:SI 1 "basereg_operand" "r")
2847 (match_operand:SI 2 "register_operand" "r")))))]
2848 "! TARGET_DISABLE_INDEXING"
2849 "{ldbx|ldb} %2(%1),%0"
2850 [(set_attr "type" "load")
2851 (set_attr "length" "4")])
2854 [(set (match_operand:SI 0 "register_operand" "=r")
2855 (zero_extend:SI (mem:QI
2857 (match_operand:SI 1 "register_operand" "r")
2858 (match_operand:SI 2 "basereg_operand" "r")))))]
2859 "! TARGET_DISABLE_INDEXING"
2860 "{ldbx|ldb} %1(%2),%0"
2861 [(set_attr "type" "load")
2862 (set_attr "length" "4")])
2865 [(set (match_operand:HI 0 "register_operand" "=r")
2866 (zero_extend:HI (mem:QI
2868 (match_operand:SI 1 "basereg_operand" "r")
2869 (match_operand:SI 2 "register_operand" "r")))))]
2870 "! TARGET_DISABLE_INDEXING"
2871 "{ldbx|ldb} %2(%1),%0"
2872 [(set_attr "type" "load")
2873 (set_attr "length" "4")])
2876 [(set (match_operand:HI 0 "register_operand" "=r")
2877 (zero_extend:HI (mem:QI
2879 (match_operand:SI 1 "register_operand" "r")
2880 (match_operand:SI 2 "basereg_operand" "r")))))]
2881 "! TARGET_DISABLE_INDEXING"
2882 "{ldbx|ldb} %1(%2),%0"
2883 [(set_attr "type" "load")
2884 (set_attr "length" "4")])
2887 [(set (match_operand:QI 0 "register_operand" "=r")
2888 (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r")
2889 (match_operand:SI 2 "int5_operand" "L"))))
2890 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
2892 "{ldbs|ldb},mb %2(%1),%0"
2893 [(set_attr "type" "load")
2894 (set_attr "length" "4")])
2896 ; Now the same thing with zero extensions.
2898 [(set (match_operand:SI 0 "register_operand" "=r")
2899 (zero_extend:SI (mem:QI (plus:SI
2900 (match_operand:SI 1 "register_operand" "+r")
2901 (match_operand:SI 2 "int5_operand" "L")))))
2902 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
2904 "{ldbs|ldb},mb %2(%1),%0"
2905 [(set_attr "type" "load")
2906 (set_attr "length" "4")])
2909 [(set (match_operand:HI 0 "register_operand" "=r")
2910 (zero_extend:HI (mem:QI (plus:SI
2911 (match_operand:SI 1 "register_operand" "+r")
2912 (match_operand:SI 2 "int5_operand" "L")))))
2913 (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
2915 "{ldbs|ldb},mb %2(%1),%0"
2916 [(set_attr "type" "load")
2917 (set_attr "length" "4")])
2920 [(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "+r")
2921 (match_operand:SI 1 "int5_operand" "L")))
2922 (match_operand:QI 2 "reg_or_0_operand" "rM"))
2924 (plus:SI (match_dup 0) (match_dup 1)))]
2926 "{stbs|stb},mb %r2,%1(%0)"
2927 [(set_attr "type" "store")
2928 (set_attr "length" "4")])
2930 ;; The definition of this insn does not really explain what it does,
2931 ;; but it should suffice
2932 ;; that anything generated as this insn will be recognized as one
2933 ;; and that it will not successfully combine with anything.
2934 (define_expand "movstrsi"
2935 [(parallel [(set (match_operand:BLK 0 "" "")
2936 (match_operand:BLK 1 "" ""))
2937 (clobber (match_dup 7))
2938 (clobber (match_dup 8))
2939 (clobber (match_dup 4))
2940 (clobber (match_dup 5))
2941 (clobber (match_dup 6))
2942 (use (match_operand:SI 2 "arith_operand" ""))
2943 (use (match_operand:SI 3 "const_int_operand" ""))])]
2949 /* HP provides very fast block move library routine for the PA;
2950 this routine includes:
2952 4x4 byte at a time block moves,
2953 1x4 byte at a time with alignment checked at runtime with
2954 attempts to align the source and destination as needed
2957 With that in mind, here's the heuristics to try and guess when
2958 the inlined block move will be better than the library block
2961 If the size isn't constant, then always use the library routines.
2963 If the size is large in respect to the known alignment, then use
2964 the library routines.
2966 If the size is small in repsect to the known alignment, then open
2967 code the copy (since that will lead to better scheduling).
2969 Else use the block move pattern. */
2971 /* Undetermined size, use the library routine. */
2972 if (GET_CODE (operands[2]) != CONST_INT)
2975 size = INTVAL (operands[2]);
2976 align = INTVAL (operands[3]);
2977 align = align > 4 ? 4 : align;
2979 /* If size/alignment > 8 (eg size is large in respect to alignment),
2980 then use the library routines. */
2981 if (size / align > 16)
2984 /* This does happen, but not often enough to worry much about. */
2985 if (size / align < MOVE_RATIO)
2988 /* Fall through means we're going to use our block move pattern. */
2990 = replace_equiv_address (operands[0],
2991 copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
2993 = replace_equiv_address (operands[1],
2994 copy_to_mode_reg (SImode, XEXP (operands[1], 0)));
2995 operands[4] = gen_reg_rtx (SImode);
2996 operands[5] = gen_reg_rtx (SImode);
2997 operands[6] = gen_reg_rtx (SImode);
2998 operands[7] = XEXP (operands[0], 0);
2999 operands[8] = XEXP (operands[1], 0);
3002 ;; The operand constraints are written like this to support both compile-time
3003 ;; and run-time determined byte count. If the count is run-time determined,
3004 ;; the register with the byte count is clobbered by the copying code, and
3005 ;; therefore it is forced to operand 2. If the count is compile-time
3006 ;; determined, we need two scratch registers for the unrolled code.
3007 (define_insn "movstrsi_internal"
3008 [(set (mem:BLK (match_operand:SI 0 "register_operand" "+r,r"))
3009 (mem:BLK (match_operand:SI 1 "register_operand" "+r,r")))
3010 (clobber (match_dup 0))
3011 (clobber (match_dup 1))
3012 (clobber (match_operand:SI 2 "register_operand" "=r,r")) ;loop cnt/tmp
3013 (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp
3014 (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
3015 (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count
3016 (use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment
3018 "* return output_block_move (operands, !which_alternative);"
3019 [(set_attr "type" "multi,multi")])
3021 ;; Floating point move insns
3023 ;; This pattern forces (set (reg:DF ...) (const_double ...))
3024 ;; to be reloaded by putting the constant into memory when
3025 ;; reg is a floating point register.
3027 ;; For integer registers we use ldil;ldo to set the appropriate
3030 ;; This must come before the movdf pattern, and it must be present
3031 ;; to handle obscure reloading cases.
3033 [(set (match_operand:DF 0 "register_operand" "=?r,f")
3034 (match_operand:DF 1 "" "?F,m"))]
3035 "GET_CODE (operands[1]) == CONST_DOUBLE
3036 && operands[1] != CONST0_RTX (DFmode)
3038 && ! TARGET_SOFT_FLOAT"
3039 "* return (which_alternative == 0 ? output_move_double (operands)
3040 : \"fldd%F1 %1,%0\");"
3041 [(set_attr "type" "move,fpload")
3042 (set_attr "length" "16,4")])
3044 (define_expand "movdf"
3045 [(set (match_operand:DF 0 "general_operand" "")
3046 (match_operand:DF 1 "general_operand" ""))]
3050 if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT)
3051 operands[1] = force_const_mem (DFmode, operands[1]);
3053 if (emit_move_sequence (operands, DFmode, 0))
3057 ;; Reloading an SImode or DImode value requires a scratch register if
3058 ;; going in to or out of float point registers.
3060 (define_expand "reload_indf"
3061 [(set (match_operand:DF 0 "register_operand" "=Z")
3062 (match_operand:DF 1 "non_hard_reg_operand" ""))
3063 (clobber (match_operand:DF 2 "register_operand" "=&r"))]
3067 if (emit_move_sequence (operands, DFmode, operands[2]))
3070 /* We don't want the clobber emitted, so handle this ourselves. */
3071 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3075 (define_expand "reload_outdf"
3076 [(set (match_operand:DF 0 "non_hard_reg_operand" "")
3077 (match_operand:DF 1 "register_operand" "Z"))
3078 (clobber (match_operand:DF 2 "register_operand" "=&r"))]
3082 if (emit_move_sequence (operands, DFmode, operands[2]))
3085 /* We don't want the clobber emitted, so handle this ourselves. */
3086 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3091 [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
3092 "=f,*r,RQ,?o,?Q,f,*r,*r")
3093 (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand"
3094 "fG,*rG,f,*r,*r,RQ,o,RQ"))]
3095 "(register_operand (operands[0], DFmode)
3096 || reg_or_0_operand (operands[1], DFmode))
3097 && ! (GET_CODE (operands[1]) == CONST_DOUBLE
3098 && GET_CODE (operands[0]) == MEM)
3100 && ! TARGET_SOFT_FLOAT"
3103 if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
3104 || operands[1] == CONST0_RTX (DFmode))
3105 return output_fp_move_double (operands);
3106 return output_move_double (operands);
3108 [(set_attr "type" "fpalu,move,fpstore,store,store,fpload,load,load")
3109 (set_attr "length" "4,8,4,8,16,4,8,16")])
3112 [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
3114 (match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand"
3116 "(register_operand (operands[0], DFmode)
3117 || reg_or_0_operand (operands[1], DFmode))
3119 && TARGET_SOFT_FLOAT"
3122 return output_move_double (operands);
3124 [(set_attr "type" "move,store,store,load,load")
3125 (set_attr "length" "8,8,16,8,16")])
3128 [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
3129 "=r,r,r,r,r,Q,*q,!f,f,*TR")
3130 (match_operand:DF 1 "move_operand"
3131 "r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
3132 "(register_operand (operands[0], DFmode)
3133 || reg_or_0_operand (operands[1], DFmode))
3134 && ! TARGET_SOFT_FLOAT && TARGET_64BIT"
3146 [(set_attr "type" "move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
3147 (set_attr "pa_combine_type" "addmove")
3148 (set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
3151 [(set (match_operand:DF 0 "register_operand" "=fx")
3152 (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
3153 (match_operand:SI 2 "register_operand" "r"))))]
3154 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3155 "{flddx|fldd} %2(%1),%0"
3156 [(set_attr "type" "fpload")
3157 (set_attr "length" "4")])
3160 [(set (match_operand:DF 0 "register_operand" "=fx")
3161 (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r")
3162 (match_operand:SI 2 "basereg_operand" "r"))))]
3163 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3164 "{flddx|fldd} %1(%2),%0"
3165 [(set_attr "type" "fpload")
3166 (set_attr "length" "4")])
3169 [(set (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
3170 (match_operand:SI 2 "register_operand" "r")))
3171 (match_operand:DF 0 "register_operand" "fx"))]
3172 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3173 "{fstdx|fstd} %0,%2(%1)"
3174 [(set_attr "type" "fpstore")
3175 (set_attr "length" "4")])
3178 [(set (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r")
3179 (match_operand:SI 2 "basereg_operand" "r")))
3180 (match_operand:DF 0 "register_operand" "fx"))]
3181 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3182 "{fstdx|fstd} %0,%1(%2)"
3183 [(set_attr "type" "fpstore")
3184 (set_attr "length" "4")])
3186 (define_expand "movdi"
3187 [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "")
3188 (match_operand:DI 1 "general_operand" ""))]
3192 if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT)
3193 operands[1] = force_const_mem (DImode, operands[1]);
3195 if (emit_move_sequence (operands, DImode, 0))
3199 (define_expand "reload_indi"
3200 [(set (match_operand:DI 0 "register_operand" "=Z")
3201 (match_operand:DI 1 "non_hard_reg_operand" ""))
3202 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
3206 if (emit_move_sequence (operands, DImode, operands[2]))
3209 /* We don't want the clobber emitted, so handle this ourselves. */
3210 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3214 (define_expand "reload_outdi"
3215 [(set (match_operand:DI 0 "non_hard_reg_operand" "")
3216 (match_operand:DI 1 "register_operand" "Z"))
3217 (clobber (match_operand:SI 2 "register_operand" "=&r"))]
3221 if (emit_move_sequence (operands, DImode, operands[2]))
3224 /* We don't want the clobber emitted, so handle this ourselves. */
3225 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3230 [(set (match_operand:DI 0 "register_operand" "=r")
3231 (high:DI (match_operand 1 "" "")))]
3235 rtx op0 = operands[0];
3236 rtx op1 = operands[1];
3238 if (GET_CODE (op1) == CONST_INT)
3240 operands[0] = operand_subword (op0, 1, 0, DImode);
3241 output_asm_insn (\"ldil L'%1,%0\", operands);
3243 operands[0] = operand_subword (op0, 0, 0, DImode);
3244 if (INTVAL (op1) < 0)
3245 output_asm_insn (\"ldi -1,%0\", operands);
3247 output_asm_insn (\"ldi 0,%0\", operands);
3250 else if (GET_CODE (op1) == CONST_DOUBLE)
3252 operands[0] = operand_subword (op0, 1, 0, DImode);
3253 operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1));
3254 output_asm_insn (\"ldil L'%1,%0\", operands);
3256 operands[0] = operand_subword (op0, 0, 0, DImode);
3257 operands[1] = GEN_INT (CONST_DOUBLE_HIGH (op1));
3258 output_asm_insn (singlemove_string (operands), operands);
3264 [(set_attr "type" "move")
3265 (set_attr "length" "8")])
3268 [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
3269 "=r,o,Q,r,r,r,f,f,*TR")
3270 (match_operand:DI 1 "general_operand"
3271 "rM,r,r,o*R,Q,i,fM,*TR,f"))]
3272 "(register_operand (operands[0], DImode)
3273 || reg_or_0_operand (operands[1], DImode))
3275 && ! TARGET_SOFT_FLOAT"
3278 if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
3279 || (operands[1] == CONST0_RTX (DImode)))
3280 return output_fp_move_double (operands);
3281 return output_move_double (operands);
3283 [(set_attr "type" "move,store,store,load,load,multi,fpalu,fpload,fpstore")
3284 (set_attr "length" "8,8,16,8,16,16,4,4,4")])
3287 [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
3288 "=r,r,r,r,r,r,Q,*q,!f,f,*TR")
3289 (match_operand:DI 1 "move_operand"
3290 "A,r,J,N,K,RQ,rM,rM,!fM,*RT,f"))]
3291 "(register_operand (operands[0], DImode)
3292 || reg_or_0_operand (operands[1], DImode))
3293 && ! TARGET_SOFT_FLOAT && TARGET_64BIT"
3306 [(set_attr "type" "load,move,move,move,shift,load,store,move,fpalu,fpload,fpstore")
3307 (set_attr "pa_combine_type" "addmove")
3308 (set_attr "length" "4,4,4,4,4,4,4,4,4,4,4")])
3311 [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
3313 (match_operand:DI 1 "general_operand"
3315 "(register_operand (operands[0], DImode)
3316 || reg_or_0_operand (operands[1], DImode))
3318 && TARGET_SOFT_FLOAT"
3321 return output_move_double (operands);
3323 [(set_attr "type" "move,store,store,load,load,multi")
3324 (set_attr "length" "8,8,16,8,16,16")])
3327 [(set (match_operand:DI 0 "register_operand" "=r,&r")
3328 (lo_sum:DI (match_operand:DI 1 "register_operand" "0,r")
3329 (match_operand:DI 2 "immediate_operand" "i,i")))]
3333 /* Don't output a 64 bit constant, since we can't trust the assembler to
3334 handle it correctly. */
3335 if (GET_CODE (operands[2]) == CONST_DOUBLE)
3336 operands[2] = GEN_INT (CONST_DOUBLE_LOW (operands[2]));
3337 if (which_alternative == 1)
3338 output_asm_insn (\"copy %1,%0\", operands);
3339 return \"ldo R'%G2(%R1),%R0\";
3341 [(set_attr "type" "move,move")
3342 (set_attr "length" "4,8")])
3344 ;; This pattern forces (set (reg:SF ...) (const_double ...))
3345 ;; to be reloaded by putting the constant into memory when
3346 ;; reg is a floating point register.
3348 ;; For integer registers we use ldil;ldo to set the appropriate
3351 ;; This must come before the movsf pattern, and it must be present
3352 ;; to handle obscure reloading cases.
3354 [(set (match_operand:SF 0 "register_operand" "=?r,f")
3355 (match_operand:SF 1 "" "?F,m"))]
3356 "GET_CODE (operands[1]) == CONST_DOUBLE
3357 && operands[1] != CONST0_RTX (SFmode)
3358 && ! TARGET_SOFT_FLOAT"
3359 "* return (which_alternative == 0 ? singlemove_string (operands)
3360 : \" fldw%F1 %1,%0\");"
3361 [(set_attr "type" "move,fpload")
3362 (set_attr "length" "8,4")])
3364 (define_expand "movsf"
3365 [(set (match_operand:SF 0 "general_operand" "")
3366 (match_operand:SF 1 "general_operand" ""))]
3370 if (emit_move_sequence (operands, SFmode, 0))
3374 ;; Reloading an SImode or DImode value requires a scratch register if
3375 ;; going in to or out of float point registers.
3377 (define_expand "reload_insf"
3378 [(set (match_operand:SF 0 "register_operand" "=Z")
3379 (match_operand:SF 1 "non_hard_reg_operand" ""))
3380 (clobber (match_operand:SF 2 "register_operand" "=&r"))]
3384 if (emit_move_sequence (operands, SFmode, operands[2]))
3387 /* We don't want the clobber emitted, so handle this ourselves. */
3388 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3392 (define_expand "reload_outsf"
3393 [(set (match_operand:SF 0 "non_hard_reg_operand" "")
3394 (match_operand:SF 1 "register_operand" "Z"))
3395 (clobber (match_operand:SF 2 "register_operand" "=&r"))]
3399 if (emit_move_sequence (operands, SFmode, operands[2]))
3402 /* We don't want the clobber emitted, so handle this ourselves. */
3403 emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
3408 [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand"
3410 (match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand"
3411 "fG,rG,RQ,RQ,f,rG"))]
3412 "(register_operand (operands[0], SFmode)
3413 || reg_or_0_operand (operands[1], SFmode))
3414 && ! TARGET_SOFT_FLOAT"
3422 [(set_attr "type" "fpalu,move,fpload,load,fpstore,store")
3423 (set_attr "pa_combine_type" "addmove")
3424 (set_attr "length" "4,4,4,4,4,4")])
3427 [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand"
3429 (match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand"
3431 "(register_operand (operands[0], SFmode)
3432 || reg_or_0_operand (operands[1], SFmode))
3433 && TARGET_SOFT_FLOAT"
3438 [(set_attr "type" "move,load,store")
3439 (set_attr "pa_combine_type" "addmove")
3440 (set_attr "length" "4,4,4")])
3443 [(set (match_operand:SF 0 "register_operand" "=fx")
3444 (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
3445 (match_operand:SI 2 "register_operand" "r"))))]
3446 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3447 "{fldwx|fldw} %2(%1),%0"
3448 [(set_attr "type" "fpload")
3449 (set_attr "length" "4")])
3452 [(set (match_operand:SF 0 "register_operand" "=fx")
3453 (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r")
3454 (match_operand:SI 2 "basereg_operand" "r"))))]
3455 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3456 "{fldwx|fldw} %1(%2),%0"
3457 [(set_attr "type" "fpload")
3458 (set_attr "length" "4")])
3461 [(set (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
3462 (match_operand:SI 2 "register_operand" "r")))
3463 (match_operand:SF 0 "register_operand" "fx"))]
3464 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3465 "{fstwx|fstw} %0,%2(%1)"
3466 [(set_attr "type" "fpstore")
3467 (set_attr "length" "4")])
3470 [(set (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r")
3471 (match_operand:SI 2 "basereg_operand" "r")))
3472 (match_operand:SF 0 "register_operand" "fx"))]
3473 "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
3474 "{fstwx|fstw} %0,%1(%2)"
3475 [(set_attr "type" "fpstore")
3476 (set_attr "length" "4")])
3479 ;;- zero extension instructions
3480 ;; We have define_expand for zero extension patterns to make sure the
3481 ;; operands get loaded into registers. The define_insns accept
3482 ;; memory operands. This gives us better overall code than just
3483 ;; having a pattern that does or does not accept memory operands.
3485 (define_expand "zero_extendhisi2"
3486 [(set (match_operand:SI 0 "register_operand" "")
3488 (match_operand:HI 1 "register_operand" "")))]
3493 [(set (match_operand:SI 0 "register_operand" "=r,r")
3495 (match_operand:HI 1 "move_operand" "r,RQ")))]
3496 "GET_CODE (operands[1]) != CONST_INT"
3498 {extru|extrw,u} %1,31,16,%0
3500 [(set_attr "type" "shift,load")
3501 (set_attr "length" "4,4")])
3503 (define_expand "zero_extendqihi2"
3504 [(set (match_operand:HI 0 "register_operand" "")
3506 (match_operand:QI 1 "register_operand" "")))]
3511 [(set (match_operand:HI 0 "register_operand" "=r,r")
3513 (match_operand:QI 1 "move_operand" "r,RQ")))]
3514 "GET_CODE (operands[1]) != CONST_INT"
3516 {extru|extrw,u} %1,31,8,%0
3518 [(set_attr "type" "shift,load")
3519 (set_attr "length" "4,4")])
3521 (define_expand "zero_extendqisi2"
3522 [(set (match_operand:SI 0 "register_operand" "")
3524 (match_operand:QI 1 "register_operand" "")))]
3529 [(set (match_operand:SI 0 "register_operand" "=r,r")
3531 (match_operand:QI 1 "move_operand" "r,RQ")))]
3532 "GET_CODE (operands[1]) != CONST_INT"
3534 {extru|extrw,u} %1,31,8,%0
3536 [(set_attr "type" "shift,load")
3537 (set_attr "length" "4,4")])
3539 (define_insn "zero_extendqidi2"
3540 [(set (match_operand:DI 0 "register_operand" "=r")
3541 (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))]
3543 "extrd,u %1,63,8,%0"
3544 [(set_attr "type" "shift")
3545 (set_attr "length" "4")])
3547 (define_insn "zero_extendhidi2"
3548 [(set (match_operand:DI 0 "register_operand" "=r")
3549 (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))]
3551 "extrd,u %1,63,16,%0"
3552 [(set_attr "type" "shift")
3553 (set_attr "length" "4")])
3555 (define_insn "zero_extendsidi2"
3556 [(set (match_operand:DI 0 "register_operand" "=r")
3557 (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
3559 "extrd,u %1,63,32,%0"
3560 [(set_attr "type" "shift")
3561 (set_attr "length" "4")])
3563 ;;- sign extension instructions
3565 (define_insn "extendhisi2"
3566 [(set (match_operand:SI 0 "register_operand" "=r")
3567 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
3569 "{extrs|extrw,s} %1,31,16,%0"
3570 [(set_attr "type" "shift")
3571 (set_attr "length" "4")])
3573 (define_insn "extendqihi2"
3574 [(set (match_operand:HI 0 "register_operand" "=r")
3575 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
3577 "{extrs|extrw,s} %1,31,8,%0"
3578 [(set_attr "type" "shift")
3579 (set_attr "length" "4")])
3581 (define_insn "extendqisi2"
3582 [(set (match_operand:SI 0 "register_operand" "=r")
3583 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
3585 "{extrs|extrw,s} %1,31,8,%0"
3586 [(set_attr "type" "shift")
3587 (set_attr "length" "4")])
3589 (define_insn "extendqidi2"
3590 [(set (match_operand:DI 0 "register_operand" "=r")
3591 (sign_extend:DI (match_operand:QI 1 "register_operand" "r")))]
3593 "extrd,s %1,63,8,%0"
3594 [(set_attr "type" "shift")
3595 (set_attr "length" "4")])
3597 (define_insn "extendhidi2"
3598 [(set (match_operand:DI 0 "register_operand" "=r")
3599 (sign_extend:DI (match_operand:HI 1 "register_operand" "r")))]
3601 "extrd,s %1,63,16,%0"
3602 [(set_attr "type" "shift")
3603 (set_attr "length" "4")])
3605 (define_insn "extendsidi2"
3606 [(set (match_operand:DI 0 "register_operand" "=r")
3607 (sign_extend:DI (match_operand:SI 1 "register_operand" "r")))]
3609 "extrd,s %1,63,32,%0"
3610 [(set_attr "type" "shift")
3611 (set_attr "length" "4")])
3614 ;; Conversions between float and double.
3616 (define_insn "extendsfdf2"
3617 [(set (match_operand:DF 0 "register_operand" "=f")
3619 (match_operand:SF 1 "register_operand" "f")))]
3620 "! TARGET_SOFT_FLOAT"
3621 "{fcnvff|fcnv},sgl,dbl %1,%0"
3622 [(set_attr "type" "fpalu")
3623 (set_attr "length" "4")])
3625 (define_insn "truncdfsf2"
3626 [(set (match_operand:SF 0 "register_operand" "=f")
3628 (match_operand:DF 1 "register_operand" "f")))]
3629 "! TARGET_SOFT_FLOAT"
3630 "{fcnvff|fcnv},dbl,sgl %1,%0"
3631 [(set_attr "type" "fpalu")
3632 (set_attr "length" "4")])
3634 ;; Conversion between fixed point and floating point.
3635 ;; Note that among the fix-to-float insns
3636 ;; the ones that start with SImode come first.
3637 ;; That is so that an operand that is a CONST_INT
3638 ;; (and therefore lacks a specific machine mode).
3639 ;; will be recognized as SImode (which is always valid)
3640 ;; rather than as QImode or HImode.
3642 ;; This pattern forces (set (reg:SF ...) (float:SF (const_int ...)))
3643 ;; to be reloaded by putting the constant into memory.
3644 ;; It must come before the more general floatsisf2 pattern.
3646 [(set (match_operand:SF 0 "register_operand" "=f")
3647 (float:SF (match_operand:SI 1 "const_int_operand" "m")))]
3648 "! TARGET_SOFT_FLOAT"
3649 "fldw%F1 %1,%0\;{fcnvxf,sgl,sgl|fcnv,w,sgl} %0,%0"
3650 [(set_attr "type" "fpalu")
3651 (set_attr "length" "8")])
3653 (define_insn "floatsisf2"
3654 [(set (match_operand:SF 0 "register_operand" "=f")
3655 (float:SF (match_operand:SI 1 "register_operand" "f")))]
3656 "! TARGET_SOFT_FLOAT"
3657 "{fcnvxf,sgl,sgl|fcnv,w,sgl} %1,%0"
3658 [(set_attr "type" "fpalu")
3659 (set_attr "length" "4")])
3661 ;; This pattern forces (set (reg:DF ...) (float:DF (const_int ...)))
3662 ;; to be reloaded by putting the constant into memory.
3663 ;; It must come before the more general floatsidf2 pattern.
3665 [(set (match_operand:DF 0 "register_operand" "=f")
3666 (float:DF (match_operand:SI 1 "const_int_operand" "m")))]
3667 "! TARGET_SOFT_FLOAT"
3668 "fldw%F1 %1,%0\;{fcnvxf,sgl,dbl|fcnv,w,dbl} %0,%0"
3669 [(set_attr "type" "fpalu")
3670 (set_attr "length" "8")])
3672 (define_insn "floatsidf2"
3673 [(set (match_operand:DF 0 "register_operand" "=f")
3674 (float:DF (match_operand:SI 1 "register_operand" "f")))]
3675 "! TARGET_SOFT_FLOAT"
3676 "{fcnvxf,sgl,dbl|fcnv,w,dbl} %1,%0"
3677 [(set_attr "type" "fpalu")
3678 (set_attr "length" "4")])
3680 (define_expand "floatunssisf2"
3681 [(set (subreg:SI (match_dup 2) 4)
3682 (match_operand:SI 1 "register_operand" ""))
3683 (set (subreg:SI (match_dup 2) 0)
3685 (set (match_operand:SF 0 "register_operand" "")
3686 (float:SF (match_dup 2)))]
3687 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3692 emit_insn (gen_floatunssisf2_pa20 (operands[0], operands[1]));
3695 operands[2] = gen_reg_rtx (DImode);
3698 (define_expand "floatunssidf2"
3699 [(set (subreg:SI (match_dup 2) 4)
3700 (match_operand:SI 1 "register_operand" ""))
3701 (set (subreg:SI (match_dup 2) 0)
3703 (set (match_operand:DF 0 "register_operand" "")
3704 (float:DF (match_dup 2)))]
3705 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3710 emit_insn (gen_floatunssidf2_pa20 (operands[0], operands[1]));
3713 operands[2] = gen_reg_rtx (DImode);
3716 (define_insn "floatdisf2"
3717 [(set (match_operand:SF 0 "register_operand" "=f")
3718 (float:SF (match_operand:DI 1 "register_operand" "f")))]
3719 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3720 "{fcnvxf,dbl,sgl|fcnv,dw,sgl} %1,%0"
3721 [(set_attr "type" "fpalu")
3722 (set_attr "length" "4")])
3724 (define_insn "floatdidf2"
3725 [(set (match_operand:DF 0 "register_operand" "=f")
3726 (float:DF (match_operand:DI 1 "register_operand" "f")))]
3727 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3728 "{fcnvxf,dbl,dbl|fcnv,dw,dbl} %1,%0"
3729 [(set_attr "type" "fpalu")
3730 (set_attr "length" "4")])
3732 ;; Convert a float to an actual integer.
3733 ;; Truncation is performed as part of the conversion.
3735 (define_insn "fix_truncsfsi2"
3736 [(set (match_operand:SI 0 "register_operand" "=f")
3737 (fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
3738 "! TARGET_SOFT_FLOAT"
3739 "{fcnvfxt,sgl,sgl|fcnv,t,sgl,w} %1,%0"
3740 [(set_attr "type" "fpalu")
3741 (set_attr "length" "4")])
3743 (define_insn "fix_truncdfsi2"
3744 [(set (match_operand:SI 0 "register_operand" "=f")
3745 (fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
3746 "! TARGET_SOFT_FLOAT"
3747 "{fcnvfxt,dbl,sgl|fcnv,t,dbl,w} %1,%0"
3748 [(set_attr "type" "fpalu")
3749 (set_attr "length" "4")])
3751 (define_insn "fix_truncsfdi2"
3752 [(set (match_operand:DI 0 "register_operand" "=f")
3753 (fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
3754 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3755 "{fcnvfxt,sgl,dbl|fcnv,t,sgl,dw} %1,%0"
3756 [(set_attr "type" "fpalu")
3757 (set_attr "length" "4")])
3759 (define_insn "fix_truncdfdi2"
3760 [(set (match_operand:DI 0 "register_operand" "=f")
3761 (fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
3762 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT"
3763 "{fcnvfxt,dbl,dbl|fcnv,t,dbl,dw} %1,%0"
3764 [(set_attr "type" "fpalu")
3765 (set_attr "length" "4")])
3767 (define_insn "floatunssidf2_pa20"
3768 [(set (match_operand:DF 0 "register_operand" "=f")
3769 (unsigned_float:DF (match_operand:SI 1 "register_operand" "f")))]
3770 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3772 [(set_attr "type" "fpalu")
3773 (set_attr "length" "4")])
3775 (define_insn "floatunssisf2_pa20"
3776 [(set (match_operand:SF 0 "register_operand" "=f")
3777 (unsigned_float:SF (match_operand:SI 1 "register_operand" "f")))]
3778 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3780 [(set_attr "type" "fpalu")
3781 (set_attr "length" "4")])
3783 (define_insn "floatunsdisf2"
3784 [(set (match_operand:SF 0 "register_operand" "=f")
3785 (unsigned_float:SF (match_operand:DI 1 "register_operand" "f")))]
3786 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3787 "fcnv,udw,sgl %1,%0"
3788 [(set_attr "type" "fpalu")
3789 (set_attr "length" "4")])
3791 (define_insn "floatunsdidf2"
3792 [(set (match_operand:DF 0 "register_operand" "=f")
3793 (unsigned_float:DF (match_operand:DI 1 "register_operand" "f")))]
3794 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3795 "fcnv,udw,dbl %1,%0"
3796 [(set_attr "type" "fpalu")
3797 (set_attr "length" "4")])
3799 (define_insn "fixuns_truncsfsi2"
3800 [(set (match_operand:SI 0 "register_operand" "=f")
3801 (unsigned_fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
3802 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3803 "fcnv,t,sgl,uw %1,%0"
3804 [(set_attr "type" "fpalu")
3805 (set_attr "length" "4")])
3807 (define_insn "fixuns_truncdfsi2"
3808 [(set (match_operand:SI 0 "register_operand" "=f")
3809 (unsigned_fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
3810 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3811 "fcnv,t,dbl,uw %1,%0"
3812 [(set_attr "type" "fpalu")
3813 (set_attr "length" "4")])
3815 (define_insn "fixuns_truncsfdi2"
3816 [(set (match_operand:DI 0 "register_operand" "=f")
3817 (unsigned_fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))]
3818 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3819 "fcnv,t,sgl,udw %1,%0"
3820 [(set_attr "type" "fpalu")
3821 (set_attr "length" "4")])
3823 (define_insn "fixuns_truncdfdi2"
3824 [(set (match_operand:DI 0 "register_operand" "=f")
3825 (unsigned_fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))]
3826 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
3827 "fcnv,t,dbl,udw %1,%0"
3828 [(set_attr "type" "fpalu")
3829 (set_attr "length" "4")])
3831 ;;- arithmetic instructions
3833 (define_expand "adddi3"
3834 [(set (match_operand:DI 0 "register_operand" "")
3835 (plus:DI (match_operand:DI 1 "register_operand" "")
3836 (match_operand:DI 2 "adddi3_operand" "")))]
3841 [(set (match_operand:DI 0 "register_operand" "=r")
3842 (plus:DI (match_operand:DI 1 "register_operand" "%r")
3843 (match_operand:DI 2 "arith11_operand" "rI")))]
3847 if (GET_CODE (operands[2]) == CONST_INT)
3849 if (INTVAL (operands[2]) >= 0)
3850 return \"addi %2,%R1,%R0\;{addc|add,c} %1,%%r0,%0\";
3852 return \"addi %2,%R1,%R0\;{subb|sub,b} %1,%%r0,%0\";
3855 return \"add %R2,%R1,%R0\;{addc|add,c} %2,%1,%0\";
3857 [(set_attr "type" "binary")
3858 (set_attr "length" "8")])
3861 [(set (match_operand:DI 0 "register_operand" "=r,r")
3862 (plus:DI (match_operand:DI 1 "register_operand" "%r,r")
3863 (match_operand:DI 2 "arith_operand" "r,J")))]
3866 {addl|add,l} %1,%2,%0
3868 [(set_attr "type" "binary,binary")
3869 (set_attr "pa_combine_type" "addmove")
3870 (set_attr "length" "4,4")])
3873 [(set (match_operand:DI 0 "register_operand" "=r")
3874 (plus:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
3875 (match_operand:DI 2 "register_operand" "r")))]
3878 [(set_attr "type" "binary")
3879 (set_attr "length" "4")])
3882 [(set (match_operand:SI 0 "register_operand" "=r")
3883 (plus:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
3884 (match_operand:SI 2 "register_operand" "r")))]
3887 [(set_attr "type" "binary")
3888 (set_attr "length" "4")])
3890 ;; define_splits to optimize cases of adding a constant integer
3891 ;; to a register when the constant does not fit in 14 bits. */
3893 [(set (match_operand:SI 0 "register_operand" "")
3894 (plus:SI (match_operand:SI 1 "register_operand" "")
3895 (match_operand:SI 2 "const_int_operand" "")))
3896 (clobber (match_operand:SI 4 "register_operand" ""))]
3897 "! cint_ok_for_move (INTVAL (operands[2]))
3898 && VAL_14_BITS_P (INTVAL (operands[2]) >> 1)"
3899 [(set (match_dup 4) (plus:SI (match_dup 1) (match_dup 2)))
3900 (set (match_dup 0) (plus:SI (match_dup 4) (match_dup 3)))]
3903 int val = INTVAL (operands[2]);
3904 int low = (val < 0) ? -0x2000 : 0x1fff;
3905 int rest = val - low;
3907 operands[2] = GEN_INT (rest);
3908 operands[3] = GEN_INT (low);
3912 [(set (match_operand:SI 0 "register_operand" "")
3913 (plus:SI (match_operand:SI 1 "register_operand" "")
3914 (match_operand:SI 2 "const_int_operand" "")))
3915 (clobber (match_operand:SI 4 "register_operand" ""))]
3916 "! cint_ok_for_move (INTVAL (operands[2]))"
3917 [(set (match_dup 4) (match_dup 2))
3918 (set (match_dup 0) (plus:SI (mult:SI (match_dup 4) (match_dup 3))
3922 HOST_WIDE_INT intval = INTVAL (operands[2]);
3924 /* Try dividing the constant by 2, then 4, and finally 8 to see
3925 if we can get a constant which can be loaded into a register
3926 in a single instruction (cint_ok_for_move).
3928 If that fails, try to negate the constant and subtract it
3929 from our input operand. */
3930 if (intval % 2 == 0 && cint_ok_for_move (intval / 2))
3932 operands[2] = GEN_INT (intval / 2);
3933 operands[3] = GEN_INT (2);
3935 else if (intval % 4 == 0 && cint_ok_for_move (intval / 4))
3937 operands[2] = GEN_INT (intval / 4);
3938 operands[3] = GEN_INT (4);
3940 else if (intval % 8 == 0 && cint_ok_for_move (intval / 8))
3942 operands[2] = GEN_INT (intval / 8);
3943 operands[3] = GEN_INT (8);
3945 else if (cint_ok_for_move (-intval))
3947 emit_insn (gen_rtx_SET (VOIDmode, operands[4], GEN_INT (-intval)));
3948 emit_insn (gen_subsi3 (operands[0], operands[1], operands[4]));
3955 (define_insn "addsi3"
3956 [(set (match_operand:SI 0 "register_operand" "=r,r")
3957 (plus:SI (match_operand:SI 1 "register_operand" "%r,r")
3958 (match_operand:SI 2 "arith_operand" "r,J")))]
3961 {addl|add,l} %1,%2,%0
3963 [(set_attr "type" "binary,binary")
3964 (set_attr "pa_combine_type" "addmove")
3965 (set_attr "length" "4,4")])
3967 (define_expand "subdi3"
3968 [(set (match_operand:DI 0 "register_operand" "")
3969 (minus:DI (match_operand:DI 1 "register_operand" "")
3970 (match_operand:DI 2 "register_operand" "")))]
3975 [(set (match_operand:DI 0 "register_operand" "=r")
3976 (minus:DI (match_operand:DI 1 "register_operand" "r")
3977 (match_operand:DI 2 "register_operand" "r")))]
3979 "sub %R1,%R2,%R0\;{subb|sub,b} %1,%2,%0"
3980 [(set_attr "type" "binary")
3981 (set_attr "length" "8")])
3984 [(set (match_operand:DI 0 "register_operand" "=r,r,q")
3985 (minus:DI (match_operand:DI 1 "arith11_operand" "r,I,U")
3986 (match_operand:DI 2 "register_operand" "r,r,r")))]
3992 [(set_attr "type" "binary,binary,move")
3993 (set_attr "length" "4,4,4")])
3995 (define_expand "subsi3"
3996 [(set (match_operand:SI 0 "register_operand" "")
3997 (minus:SI (match_operand:SI 1 "arith11_operand" "")
3998 (match_operand:SI 2 "register_operand" "")))]
4003 [(set (match_operand:SI 0 "register_operand" "=r,r")
4004 (minus:SI (match_operand:SI 1 "arith11_operand" "r,I")
4005 (match_operand:SI 2 "register_operand" "r,r")))]
4010 [(set_attr "type" "binary,binary")
4011 (set_attr "length" "4,4")])
4014 [(set (match_operand:SI 0 "register_operand" "=r,r,q")
4015 (minus:SI (match_operand:SI 1 "arith11_operand" "r,I,S")
4016 (match_operand:SI 2 "register_operand" "r,r,r")))]
4022 [(set_attr "type" "binary,binary,move")
4023 (set_attr "length" "4,4,4")])
4025 ;; Clobbering a "register_operand" instead of a match_scratch
4026 ;; in operand3 of millicode calls avoids spilling %r1 and
4027 ;; produces better code.
4029 ;; The mulsi3 insns set up registers for the millicode call.
4030 (define_expand "mulsi3"
4031 [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
4032 (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
4033 (parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
4034 (clobber (match_dup 3))
4035 (clobber (reg:SI 26))
4036 (clobber (reg:SI 25))
4037 (clobber (match_dup 4))])
4038 (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
4042 operands[4] = gen_rtx_REG (SImode, TARGET_64BIT ? 2 : 31);
4043 if (TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT)
4045 rtx scratch = gen_reg_rtx (DImode);
4046 operands[1] = force_reg (SImode, operands[1]);
4047 operands[2] = force_reg (SImode, operands[2]);
4048 emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2]));
4049 emit_insn (gen_rtx_SET (VOIDmode, operands[0],
4050 gen_rtx_SUBREG (SImode, scratch, GET_MODE_SIZE (SImode))));
4053 operands[3] = gen_reg_rtx (SImode);
4056 (define_insn "umulsidi3"
4057 [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
4058 (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "f"))
4059 (zero_extend:DI (match_operand:SI 2 "nonimmediate_operand" "f"))))]
4060 "TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT"
4062 [(set_attr "type" "fpmuldbl")
4063 (set_attr "length" "4")])
4066 [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
4067 (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "f"))
4068 (match_operand:DI 2 "uint32_operand" "f")))]
4069 "TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT && !TARGET_64BIT"
4071 [(set_attr "type" "fpmuldbl")
4072 (set_attr "length" "4")])
4075 [(set (match_operand:DI 0 "nonimmediate_operand" "=f")
4076 (mult:DI (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "f"))
4077 (match_operand:DI 2 "uint32_operand" "f")))]
4078 "TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT && TARGET_64BIT"
4080 [(set_attr "type" "fpmuldbl")
4081 (set_attr "length" "4")])
4084 [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
4085 (clobber (match_operand:SI 0 "register_operand" "=a"))
4086 (clobber (reg:SI 26))
4087 (clobber (reg:SI 25))
4088 (clobber (reg:SI 31))]
4090 "* return output_mul_insn (0, insn);"
4091 [(set_attr "type" "milli")
4092 (set (attr "length")
4094 ;; Target (or stub) within reach
4095 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
4097 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
4102 (ne (symbol_ref "flag_pic")
4106 ;; Out of reach PORTABLE_RUNTIME
4107 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
4111 ;; Out of reach, can use ble
4115 [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
4116 (clobber (match_operand:SI 0 "register_operand" "=a"))
4117 (clobber (reg:SI 26))
4118 (clobber (reg:SI 25))
4119 (clobber (reg:SI 2))]
4121 "* return output_mul_insn (0, insn);"
4122 [(set_attr "type" "milli")
4123 (set (attr "length") (const_int 4))])
4125 (define_expand "muldi3"
4126 [(set (match_operand:DI 0 "register_operand" "")
4127 (mult:DI (match_operand:DI 1 "register_operand" "")
4128 (match_operand:DI 2 "register_operand" "")))]
4129 "TARGET_64BIT && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT"
4132 rtx low_product = gen_reg_rtx (DImode);
4133 rtx cross_product1 = gen_reg_rtx (DImode);
4134 rtx cross_product2 = gen_reg_rtx (DImode);
4135 rtx cross_scratch = gen_reg_rtx (DImode);
4136 rtx cross_product = gen_reg_rtx (DImode);
4137 rtx op1l, op1r, op2l, op2r;
4138 rtx op1shifted, op2shifted;
4140 op1shifted = gen_reg_rtx (DImode);
4141 op2shifted = gen_reg_rtx (DImode);
4142 op1l = gen_reg_rtx (SImode);
4143 op1r = gen_reg_rtx (SImode);
4144 op2l = gen_reg_rtx (SImode);
4145 op2r = gen_reg_rtx (SImode);
4147 emit_move_insn (op1shifted, gen_rtx_LSHIFTRT (DImode, operands[1],
4149 emit_move_insn (op2shifted, gen_rtx_LSHIFTRT (DImode, operands[2],
4151 op1r = gen_rtx_SUBREG (SImode, operands[1], 4);
4152 op2r = gen_rtx_SUBREG (SImode, operands[2], 4);
4153 op1l = gen_rtx_SUBREG (SImode, op1shifted, 4);
4154 op2l = gen_rtx_SUBREG (SImode, op2shifted, 4);
4156 /* Emit multiplies for the cross products. */
4157 emit_insn (gen_umulsidi3 (cross_product1, op2r, op1l));
4158 emit_insn (gen_umulsidi3 (cross_product2, op2l, op1r));
4160 /* Emit a multiply for the low sub-word. */
4161 emit_insn (gen_umulsidi3 (low_product, op2r, op1r));
4163 /* Sum the cross products and shift them into proper position. */
4164 emit_insn (gen_adddi3 (cross_scratch, cross_product1, cross_product2));
4165 emit_insn (gen_ashldi3 (cross_product, cross_scratch, GEN_INT (32)));
4167 /* Add the cross product to the low product and store the result
4168 into the output operand . */
4169 emit_insn (gen_adddi3 (operands[0], cross_product, low_product));
4173 ;;; Division and mod.
4174 (define_expand "divsi3"
4175 [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
4176 (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
4177 (parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25)))
4178 (clobber (match_dup 3))
4179 (clobber (match_dup 4))
4180 (clobber (reg:SI 26))
4181 (clobber (reg:SI 25))
4182 (clobber (match_dup 5))])
4183 (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
4187 operands[3] = gen_reg_rtx (SImode);
4190 operands[5] = gen_rtx_REG (SImode, 2);
4191 operands[4] = operands[5];
4195 operands[5] = gen_rtx_REG (SImode, 31);
4196 operands[4] = gen_reg_rtx (SImode);
4198 if (GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const (operands, 0))
4204 (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
4205 (clobber (match_operand:SI 1 "register_operand" "=a"))
4206 (clobber (match_operand:SI 2 "register_operand" "=&r"))
4207 (clobber (reg:SI 26))
4208 (clobber (reg:SI 25))
4209 (clobber (reg:SI 31))]
4212 return output_div_insn (operands, 0, insn);"
4213 [(set_attr "type" "milli")
4214 (set (attr "length")
4216 ;; Target (or stub) within reach
4217 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
4219 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
4224 (ne (symbol_ref "flag_pic")
4228 ;; Out of reach PORTABLE_RUNTIME
4229 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
4233 ;; Out of reach, can use ble
4238 (div:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
4239 (clobber (match_operand:SI 1 "register_operand" "=a"))
4240 (clobber (match_operand:SI 2 "register_operand" "=&r"))
4241 (clobber (reg:SI 26))
4242 (clobber (reg:SI 25))
4243 (clobber (reg:SI 2))]
4246 return output_div_insn (operands, 0, insn);"
4247 [(set_attr "type" "milli")
4248 (set (attr "length") (const_int 4))])
4250 (define_expand "udivsi3"
4251 [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
4252 (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
4253 (parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25)))
4254 (clobber (match_dup 3))
4255 (clobber (match_dup 4))
4256 (clobber (reg:SI 26))
4257 (clobber (reg:SI 25))
4258 (clobber (match_dup 5))])
4259 (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
4263 operands[3] = gen_reg_rtx (SImode);
4266 operands[5] = gen_rtx_REG (SImode, 2);
4267 operands[4] = operands[5];
4271 operands[5] = gen_rtx_REG (SImode, 31);
4272 operands[4] = gen_reg_rtx (SImode);
4274 if (GET_CODE (operands[2]) == CONST_INT && emit_hpdiv_const (operands, 1))
4280 (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
4281 (clobber (match_operand:SI 1 "register_operand" "=a"))
4282 (clobber (match_operand:SI 2 "register_operand" "=&r"))
4283 (clobber (reg:SI 26))
4284 (clobber (reg:SI 25))
4285 (clobber (reg:SI 31))]
4288 return output_div_insn (operands, 1, insn);"
4289 [(set_attr "type" "milli")
4290 (set (attr "length")
4292 ;; Target (or stub) within reach
4293 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
4295 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
4300 (ne (symbol_ref "flag_pic")
4304 ;; Out of reach PORTABLE_RUNTIME
4305 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
4309 ;; Out of reach, can use ble
4314 (udiv:SI (reg:SI 26) (match_operand:SI 0 "div_operand" "")))
4315 (clobber (match_operand:SI 1 "register_operand" "=a"))
4316 (clobber (match_operand:SI 2 "register_operand" "=&r"))
4317 (clobber (reg:SI 26))
4318 (clobber (reg:SI 25))
4319 (clobber (reg:SI 2))]
4322 return output_div_insn (operands, 1, insn);"
4323 [(set_attr "type" "milli")
4324 (set (attr "length") (const_int 4))])
4326 (define_expand "modsi3"
4327 [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
4328 (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
4329 (parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
4330 (clobber (match_dup 3))
4331 (clobber (match_dup 4))
4332 (clobber (reg:SI 26))
4333 (clobber (reg:SI 25))
4334 (clobber (match_dup 5))])
4335 (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
4341 operands[5] = gen_rtx_REG (SImode, 2);
4342 operands[4] = operands[5];
4346 operands[5] = gen_rtx_REG (SImode, 31);
4347 operands[4] = gen_reg_rtx (SImode);
4349 operands[3] = gen_reg_rtx (SImode);
4353 [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
4354 (clobber (match_operand:SI 0 "register_operand" "=a"))
4355 (clobber (match_operand:SI 1 "register_operand" "=&r"))
4356 (clobber (reg:SI 26))
4357 (clobber (reg:SI 25))
4358 (clobber (reg:SI 31))]
4361 return output_mod_insn (0, insn);"
4362 [(set_attr "type" "milli")
4363 (set (attr "length")
4365 ;; Target (or stub) within reach
4366 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
4368 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
4373 (ne (symbol_ref "flag_pic")
4377 ;; Out of reach PORTABLE_RUNTIME
4378 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
4382 ;; Out of reach, can use ble
4386 [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
4387 (clobber (match_operand:SI 0 "register_operand" "=a"))
4388 (clobber (match_operand:SI 1 "register_operand" "=&r"))
4389 (clobber (reg:SI 26))
4390 (clobber (reg:SI 25))
4391 (clobber (reg:SI 2))]
4394 return output_mod_insn (0, insn);"
4395 [(set_attr "type" "milli")
4396 (set (attr "length") (const_int 4))])
4398 (define_expand "umodsi3"
4399 [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
4400 (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
4401 (parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
4402 (clobber (match_dup 3))
4403 (clobber (match_dup 4))
4404 (clobber (reg:SI 26))
4405 (clobber (reg:SI 25))
4406 (clobber (match_dup 5))])
4407 (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
4413 operands[5] = gen_rtx_REG (SImode, 2);
4414 operands[4] = operands[5];
4418 operands[5] = gen_rtx_REG (SImode, 31);
4419 operands[4] = gen_reg_rtx (SImode);
4421 operands[3] = gen_reg_rtx (SImode);
4425 [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
4426 (clobber (match_operand:SI 0 "register_operand" "=a"))
4427 (clobber (match_operand:SI 1 "register_operand" "=&r"))
4428 (clobber (reg:SI 26))
4429 (clobber (reg:SI 25))
4430 (clobber (reg:SI 31))]
4433 return output_mod_insn (1, insn);"
4434 [(set_attr "type" "milli")
4435 (set (attr "length")
4437 ;; Target (or stub) within reach
4438 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
4440 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
4445 (ne (symbol_ref "flag_pic")
4449 ;; Out of reach PORTABLE_RUNTIME
4450 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
4454 ;; Out of reach, can use ble
4458 [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
4459 (clobber (match_operand:SI 0 "register_operand" "=a"))
4460 (clobber (match_operand:SI 1 "register_operand" "=&r"))
4461 (clobber (reg:SI 26))
4462 (clobber (reg:SI 25))
4463 (clobber (reg:SI 2))]
4466 return output_mod_insn (1, insn);"
4467 [(set_attr "type" "milli")
4468 (set (attr "length") (const_int 4))])
4470 ;;- and instructions
4471 ;; We define DImode `and` so with DImode `not` we can get
4472 ;; DImode `andn`. Other combinations are possible.
4474 (define_expand "anddi3"
4475 [(set (match_operand:DI 0 "register_operand" "")
4476 (and:DI (match_operand:DI 1 "arith_double_operand" "")
4477 (match_operand:DI 2 "arith_double_operand" "")))]
4481 if (! register_operand (operands[1], DImode)
4482 || ! register_operand (operands[2], DImode))
4483 /* Let GCC break this into word-at-a-time operations. */
4488 [(set (match_operand:DI 0 "register_operand" "=r")
4489 (and:DI (match_operand:DI 1 "register_operand" "%r")
4490 (match_operand:DI 2 "register_operand" "r")))]
4492 "and %1,%2,%0\;and %R1,%R2,%R0"
4493 [(set_attr "type" "binary")
4494 (set_attr "length" "8")])
4497 [(set (match_operand:DI 0 "register_operand" "=r,r")
4498 (and:DI (match_operand:DI 1 "register_operand" "%?r,0")
4499 (match_operand:DI 2 "and_operand" "rO,P")))]
4501 "* return output_64bit_and (operands); "
4502 [(set_attr "type" "binary")
4503 (set_attr "length" "4")])
4505 ; The ? for op1 makes reload prefer zdepi instead of loading a huge
4506 ; constant with ldil;ldo.
4507 (define_insn "andsi3"
4508 [(set (match_operand:SI 0 "register_operand" "=r,r")
4509 (and:SI (match_operand:SI 1 "register_operand" "%?r,0")
4510 (match_operand:SI 2 "and_operand" "rO,P")))]
4512 "* return output_and (operands); "
4513 [(set_attr "type" "binary,shift")
4514 (set_attr "length" "4,4")])
4517 [(set (match_operand:DI 0 "register_operand" "=r")
4518 (and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
4519 (match_operand:DI 2 "register_operand" "r")))]
4521 "andcm %2,%1,%0\;andcm %R2,%R1,%R0"
4522 [(set_attr "type" "binary")
4523 (set_attr "length" "8")])
4526 [(set (match_operand:DI 0 "register_operand" "=r")
4527 (and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))
4528 (match_operand:DI 2 "register_operand" "r")))]
4531 [(set_attr "type" "binary")
4532 (set_attr "length" "4")])
4535 [(set (match_operand:SI 0 "register_operand" "=r")
4536 (and:SI (not:SI (match_operand:SI 1 "register_operand" "r"))
4537 (match_operand:SI 2 "register_operand" "r")))]
4540 [(set_attr "type" "binary")
4541 (set_attr "length" "4")])
4543 (define_expand "iordi3"
4544 [(set (match_operand:DI 0 "register_operand" "")
4545 (ior:DI (match_operand:DI 1 "arith_double_operand" "")
4546 (match_operand:DI 2 "arith_double_operand" "")))]
4550 if (! register_operand (operands[1], DImode)
4551 || ! register_operand (operands[2], DImode))
4552 /* Let GCC break this into word-at-a-time operations. */
4557 [(set (match_operand:DI 0 "register_operand" "=r")
4558 (ior:DI (match_operand:DI 1 "register_operand" "%r")
4559 (match_operand:DI 2 "register_operand" "r")))]
4561 "or %1,%2,%0\;or %R1,%R2,%R0"
4562 [(set_attr "type" "binary")
4563 (set_attr "length" "8")])
4566 [(set (match_operand:DI 0 "register_operand" "=r,r")
4567 (ior:DI (match_operand:DI 1 "register_operand" "0,0")
4568 (match_operand:DI 2 "ior_operand" "M,i")))]
4570 "* return output_64bit_ior (operands); "
4571 [(set_attr "type" "binary,shift")
4572 (set_attr "length" "4,4")])
4575 [(set (match_operand:DI 0 "register_operand" "=r")
4576 (ior:DI (match_operand:DI 1 "register_operand" "%r")
4577 (match_operand:DI 2 "register_operand" "r")))]
4580 [(set_attr "type" "binary")
4581 (set_attr "length" "4")])
4583 ;; Need a define_expand because we've run out of CONST_OK... characters.
4584 (define_expand "iorsi3"
4585 [(set (match_operand:SI 0 "register_operand" "")
4586 (ior:SI (match_operand:SI 1 "register_operand" "")
4587 (match_operand:SI 2 "arith32_operand" "")))]
4591 if (! (ior_operand (operands[2], SImode)
4592 || register_operand (operands[2], SImode)))
4593 operands[2] = force_reg (SImode, operands[2]);
4597 [(set (match_operand:SI 0 "register_operand" "=r,r")
4598 (ior:SI (match_operand:SI 1 "register_operand" "0,0")
4599 (match_operand:SI 2 "ior_operand" "M,i")))]
4601 "* return output_ior (operands); "
4602 [(set_attr "type" "binary,shift")
4603 (set_attr "length" "4,4")])
4606 [(set (match_operand:SI 0 "register_operand" "=r")
4607 (ior:SI (match_operand:SI 1 "register_operand" "%r")
4608 (match_operand:SI 2 "register_operand" "r")))]
4611 [(set_attr "type" "binary")
4612 (set_attr "length" "4")])
4614 (define_expand "xordi3"
4615 [(set (match_operand:DI 0 "register_operand" "")
4616 (xor:DI (match_operand:DI 1 "arith_double_operand" "")
4617 (match_operand:DI 2 "arith_double_operand" "")))]
4621 if (! register_operand (operands[1], DImode)
4622 || ! register_operand (operands[2], DImode))
4623 /* Let GCC break this into word-at-a-time operations. */
4628 [(set (match_operand:DI 0 "register_operand" "=r")
4629 (xor:DI (match_operand:DI 1 "register_operand" "%r")
4630 (match_operand:DI 2 "register_operand" "r")))]
4632 "xor %1,%2,%0\;xor %R1,%R2,%R0"
4633 [(set_attr "type" "binary")
4634 (set_attr "length" "8")])
4637 [(set (match_operand:DI 0 "register_operand" "=r")
4638 (xor:DI (match_operand:DI 1 "register_operand" "%r")
4639 (match_operand:DI 2 "register_operand" "r")))]
4642 [(set_attr "type" "binary")
4643 (set_attr "length" "4")])
4645 (define_insn "xorsi3"
4646 [(set (match_operand:SI 0 "register_operand" "=r")
4647 (xor:SI (match_operand:SI 1 "register_operand" "%r")
4648 (match_operand:SI 2 "register_operand" "r")))]
4651 [(set_attr "type" "binary")
4652 (set_attr "length" "4")])
4654 (define_expand "negdi2"
4655 [(set (match_operand:DI 0 "register_operand" "")
4656 (neg:DI (match_operand:DI 1 "register_operand" "")))]
4661 [(set (match_operand:DI 0 "register_operand" "=r")
4662 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
4664 "sub %%r0,%R1,%R0\;{subb|sub,b} %%r0,%1,%0"
4665 [(set_attr "type" "unary")
4666 (set_attr "length" "8")])
4669 [(set (match_operand:DI 0 "register_operand" "=r")
4670 (neg:DI (match_operand:DI 1 "register_operand" "r")))]
4673 [(set_attr "type" "unary")
4674 (set_attr "length" "4")])
4676 (define_insn "negsi2"
4677 [(set (match_operand:SI 0 "register_operand" "=r")
4678 (neg:SI (match_operand:SI 1 "register_operand" "r")))]
4681 [(set_attr "type" "unary")
4682 (set_attr "length" "4")])
4684 (define_expand "one_cmpldi2"
4685 [(set (match_operand:DI 0 "register_operand" "")
4686 (not:DI (match_operand:DI 1 "arith_double_operand" "")))]
4690 if (! register_operand (operands[1], DImode))
4695 [(set (match_operand:DI 0 "register_operand" "=r")
4696 (not:DI (match_operand:DI 1 "register_operand" "r")))]
4698 "uaddcm %%r0,%1,%0\;uaddcm %%r0,%R1,%R0"
4699 [(set_attr "type" "unary")
4700 (set_attr "length" "8")])
4703 [(set (match_operand:DI 0 "register_operand" "=r")
4704 (not:DI (match_operand:DI 1 "register_operand" "r")))]
4707 [(set_attr "type" "unary")
4708 (set_attr "length" "4")])
4710 (define_insn "one_cmplsi2"
4711 [(set (match_operand:SI 0 "register_operand" "=r")
4712 (not:SI (match_operand:SI 1 "register_operand" "r")))]
4715 [(set_attr "type" "unary")
4716 (set_attr "length" "4")])
4718 ;; Floating point arithmetic instructions.
4720 (define_insn "adddf3"
4721 [(set (match_operand:DF 0 "register_operand" "=f")
4722 (plus:DF (match_operand:DF 1 "register_operand" "f")
4723 (match_operand:DF 2 "register_operand" "f")))]
4724 "! TARGET_SOFT_FLOAT"
4726 [(set_attr "type" "fpalu")
4727 (set_attr "pa_combine_type" "faddsub")
4728 (set_attr "length" "4")])
4730 (define_insn "addsf3"
4731 [(set (match_operand:SF 0 "register_operand" "=f")
4732 (plus:SF (match_operand:SF 1 "register_operand" "f")
4733 (match_operand:SF 2 "register_operand" "f")))]
4734 "! TARGET_SOFT_FLOAT"
4736 [(set_attr "type" "fpalu")
4737 (set_attr "pa_combine_type" "faddsub")
4738 (set_attr "length" "4")])
4740 (define_insn "subdf3"
4741 [(set (match_operand:DF 0 "register_operand" "=f")
4742 (minus:DF (match_operand:DF 1 "register_operand" "f")
4743 (match_operand:DF 2 "register_operand" "f")))]
4744 "! TARGET_SOFT_FLOAT"
4746 [(set_attr "type" "fpalu")
4747 (set_attr "pa_combine_type" "faddsub")
4748 (set_attr "length" "4")])
4750 (define_insn "subsf3"
4751 [(set (match_operand:SF 0 "register_operand" "=f")
4752 (minus:SF (match_operand:SF 1 "register_operand" "f")
4753 (match_operand:SF 2 "register_operand" "f")))]
4754 "! TARGET_SOFT_FLOAT"
4756 [(set_attr "type" "fpalu")
4757 (set_attr "pa_combine_type" "faddsub")
4758 (set_attr "length" "4")])
4760 (define_insn "muldf3"
4761 [(set (match_operand:DF 0 "register_operand" "=f")
4762 (mult:DF (match_operand:DF 1 "register_operand" "f")
4763 (match_operand:DF 2 "register_operand" "f")))]
4764 "! TARGET_SOFT_FLOAT"
4766 [(set_attr "type" "fpmuldbl")
4767 (set_attr "pa_combine_type" "fmpy")
4768 (set_attr "length" "4")])
4770 (define_insn "mulsf3"
4771 [(set (match_operand:SF 0 "register_operand" "=f")
4772 (mult:SF (match_operand:SF 1 "register_operand" "f")
4773 (match_operand:SF 2 "register_operand" "f")))]
4774 "! TARGET_SOFT_FLOAT"
4776 [(set_attr "type" "fpmulsgl")
4777 (set_attr "pa_combine_type" "fmpy")
4778 (set_attr "length" "4")])
4780 (define_insn "divdf3"
4781 [(set (match_operand:DF 0 "register_operand" "=f")
4782 (div:DF (match_operand:DF 1 "register_operand" "f")
4783 (match_operand:DF 2 "register_operand" "f")))]
4784 "! TARGET_SOFT_FLOAT"
4786 [(set_attr "type" "fpdivdbl")
4787 (set_attr "length" "4")])
4789 (define_insn "divsf3"
4790 [(set (match_operand:SF 0 "register_operand" "=f")
4791 (div:SF (match_operand:SF 1 "register_operand" "f")
4792 (match_operand:SF 2 "register_operand" "f")))]
4793 "! TARGET_SOFT_FLOAT"
4795 [(set_attr "type" "fpdivsgl")
4796 (set_attr "length" "4")])
4798 ;; Processors prior to PA 2.0 don't have a fneg instruction. Fast
4799 ;; negation can be done by subtracting from plus zero. However, this
4800 ;; violates the IEEE standard when negating plus and minus zero.
4801 (define_expand "negdf2"
4802 [(parallel [(set (match_operand:DF 0 "register_operand" "")
4803 (neg:DF (match_operand:DF 1 "register_operand" "")))
4804 (use (match_dup 2))])]
4805 "! TARGET_SOFT_FLOAT"
4807 if (TARGET_PA_20 || flag_unsafe_math_optimizations)
4808 emit_insn (gen_negdf2_fast (operands[0], operands[1]));
4811 operands[2] = force_reg (DFmode,
4812 CONST_DOUBLE_FROM_REAL_VALUE (dconstm1, DFmode));
4813 emit_insn (gen_muldf3 (operands[0], operands[1], operands[2]));
4818 (define_insn "negdf2_fast"
4819 [(set (match_operand:DF 0 "register_operand" "=f")
4820 (neg:DF (match_operand:DF 1 "register_operand" "f")))]
4821 "! TARGET_SOFT_FLOAT && (TARGET_PA_20 || flag_unsafe_math_optimizations)"
4825 return \"fneg,dbl %1,%0\";
4827 return \"fsub,dbl %%fr0,%1,%0\";
4829 [(set_attr "type" "fpalu")
4830 (set_attr "length" "4")])
4832 (define_expand "negsf2"
4833 [(parallel [(set (match_operand:SF 0 "register_operand" "")
4834 (neg:SF (match_operand:SF 1 "register_operand" "")))
4835 (use (match_dup 2))])]
4836 "! TARGET_SOFT_FLOAT"
4838 if (TARGET_PA_20 || flag_unsafe_math_optimizations)
4839 emit_insn (gen_negsf2_fast (operands[0], operands[1]));
4842 operands[2] = force_reg (SFmode,
4843 CONST_DOUBLE_FROM_REAL_VALUE (dconstm1, SFmode));
4844 emit_insn (gen_mulsf3 (operands[0], operands[1], operands[2]));
4849 (define_insn "negsf2_fast"
4850 [(set (match_operand:SF 0 "register_operand" "=f")
4851 (neg:SF (match_operand:SF 1 "register_operand" "f")))]
4852 "! TARGET_SOFT_FLOAT && (TARGET_PA_20 || flag_unsafe_math_optimizations)"
4856 return \"fneg,sgl %1,%0\";
4858 return \"fsub,sgl %%fr0,%1,%0\";
4860 [(set_attr "type" "fpalu")
4861 (set_attr "length" "4")])
4863 (define_insn "absdf2"
4864 [(set (match_operand:DF 0 "register_operand" "=f")
4865 (abs:DF (match_operand:DF 1 "register_operand" "f")))]
4866 "! TARGET_SOFT_FLOAT"
4868 [(set_attr "type" "fpalu")
4869 (set_attr "length" "4")])
4871 (define_insn "abssf2"
4872 [(set (match_operand:SF 0 "register_operand" "=f")
4873 (abs:SF (match_operand:SF 1 "register_operand" "f")))]
4874 "! TARGET_SOFT_FLOAT"
4876 [(set_attr "type" "fpalu")
4877 (set_attr "length" "4")])
4879 (define_insn "sqrtdf2"
4880 [(set (match_operand:DF 0 "register_operand" "=f")
4881 (sqrt:DF (match_operand:DF 1 "register_operand" "f")))]
4882 "! TARGET_SOFT_FLOAT"
4884 [(set_attr "type" "fpsqrtdbl")
4885 (set_attr "length" "4")])
4887 (define_insn "sqrtsf2"
4888 [(set (match_operand:SF 0 "register_operand" "=f")
4889 (sqrt:SF (match_operand:SF 1 "register_operand" "f")))]
4890 "! TARGET_SOFT_FLOAT"
4892 [(set_attr "type" "fpsqrtsgl")
4893 (set_attr "length" "4")])
4895 ;; PA 2.0 floating point instructions
4899 [(set (match_operand:DF 0 "register_operand" "=f")
4900 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
4901 (match_operand:DF 2 "register_operand" "f"))
4902 (match_operand:DF 3 "register_operand" "f")))]
4903 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4904 "fmpyfadd,dbl %1,%2,%3,%0"
4905 [(set_attr "type" "fpmuldbl")
4906 (set_attr "length" "4")])
4909 [(set (match_operand:DF 0 "register_operand" "=f")
4910 (plus:DF (match_operand:DF 1 "register_operand" "f")
4911 (mult:DF (match_operand:DF 2 "register_operand" "f")
4912 (match_operand:DF 3 "register_operand" "f"))))]
4913 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4914 "fmpyfadd,dbl %2,%3,%1,%0"
4915 [(set_attr "type" "fpmuldbl")
4916 (set_attr "length" "4")])
4919 [(set (match_operand:SF 0 "register_operand" "=f")
4920 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
4921 (match_operand:SF 2 "register_operand" "f"))
4922 (match_operand:SF 3 "register_operand" "f")))]
4923 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4924 "fmpyfadd,sgl %1,%2,%3,%0"
4925 [(set_attr "type" "fpmulsgl")
4926 (set_attr "length" "4")])
4929 [(set (match_operand:SF 0 "register_operand" "=f")
4930 (plus:SF (match_operand:SF 1 "register_operand" "f")
4931 (mult:SF (match_operand:SF 2 "register_operand" "f")
4932 (match_operand:SF 3 "register_operand" "f"))))]
4933 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4934 "fmpyfadd,sgl %2,%3,%1,%0"
4935 [(set_attr "type" "fpmulsgl")
4936 (set_attr "length" "4")])
4938 ; fmpynfadd patterns
4940 [(set (match_operand:DF 0 "register_operand" "=f")
4941 (minus:DF (match_operand:DF 1 "register_operand" "f")
4942 (mult:DF (match_operand:DF 2 "register_operand" "f")
4943 (match_operand:DF 3 "register_operand" "f"))))]
4944 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4945 "fmpynfadd,dbl %2,%3,%1,%0"
4946 [(set_attr "type" "fpmuldbl")
4947 (set_attr "length" "4")])
4950 [(set (match_operand:SF 0 "register_operand" "=f")
4951 (minus:SF (match_operand:SF 1 "register_operand" "f")
4952 (mult:SF (match_operand:SF 2 "register_operand" "f")
4953 (match_operand:SF 3 "register_operand" "f"))))]
4954 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4955 "fmpynfadd,sgl %2,%3,%1,%0"
4956 [(set_attr "type" "fpmulsgl")
4957 (set_attr "length" "4")])
4961 [(set (match_operand:DF 0 "register_operand" "=f")
4962 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))]
4963 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4965 [(set_attr "type" "fpalu")
4966 (set_attr "length" "4")])
4969 [(set (match_operand:SF 0 "register_operand" "=f")
4970 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))]
4971 "TARGET_PA_20 && ! TARGET_SOFT_FLOAT"
4973 [(set_attr "type" "fpalu")
4974 (set_attr "length" "4")])
4976 ;; Generating a fused multiply sequence is a win for this case as it will
4977 ;; reduce the latency for the fused case without impacting the plain
4980 ;; Similar possibilities exist for fnegabs, shadd and other insns which
4981 ;; perform two operations with the result of the first feeding the second.
4983 [(set (match_operand:DF 0 "register_operand" "=f")
4984 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
4985 (match_operand:DF 2 "register_operand" "f"))
4986 (match_operand:DF 3 "register_operand" "f")))
4987 (set (match_operand:DF 4 "register_operand" "=&f")
4988 (mult:DF (match_dup 1) (match_dup 2)))]
4989 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
4990 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
4991 || reg_overlap_mentioned_p (operands[4], operands[2])))"
4993 [(set_attr "type" "fpmuldbl")
4994 (set_attr "length" "8")])
4996 ;; We want to split this up during scheduling since we want both insns
4997 ;; to schedule independently.
4999 [(set (match_operand:DF 0 "register_operand" "")
5000 (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "")
5001 (match_operand:DF 2 "register_operand" ""))
5002 (match_operand:DF 3 "register_operand" "")))
5003 (set (match_operand:DF 4 "register_operand" "")
5004 (mult:DF (match_dup 1) (match_dup 2)))]
5005 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5006 [(set (match_dup 4) (mult:DF (match_dup 1) (match_dup 2)))
5007 (set (match_dup 0) (plus:DF (mult:DF (match_dup 1) (match_dup 2))
5012 [(set (match_operand:SF 0 "register_operand" "=f")
5013 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
5014 (match_operand:SF 2 "register_operand" "f"))
5015 (match_operand:SF 3 "register_operand" "f")))
5016 (set (match_operand:SF 4 "register_operand" "=&f")
5017 (mult:SF (match_dup 1) (match_dup 2)))]
5018 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5019 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
5020 || reg_overlap_mentioned_p (operands[4], operands[2])))"
5022 [(set_attr "type" "fpmuldbl")
5023 (set_attr "length" "8")])
5025 ;; We want to split this up during scheduling since we want both insns
5026 ;; to schedule independently.
5028 [(set (match_operand:SF 0 "register_operand" "")
5029 (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "")
5030 (match_operand:SF 2 "register_operand" ""))
5031 (match_operand:SF 3 "register_operand" "")))
5032 (set (match_operand:SF 4 "register_operand" "")
5033 (mult:SF (match_dup 1) (match_dup 2)))]
5034 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5035 [(set (match_dup 4) (mult:SF (match_dup 1) (match_dup 2)))
5036 (set (match_dup 0) (plus:SF (mult:SF (match_dup 1) (match_dup 2))
5040 ;; Negating a multiply can be faked by adding zero in a fused multiply-add
5043 [(set (match_operand:DF 0 "register_operand" "=f")
5044 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
5045 (match_operand:DF 2 "register_operand" "f"))))]
5046 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5047 "fmpynfadd,dbl %1,%2,%%fr0,%0"
5048 [(set_attr "type" "fpmuldbl")
5049 (set_attr "length" "4")])
5052 [(set (match_operand:SF 0 "register_operand" "=f")
5053 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
5054 (match_operand:SF 2 "register_operand" "f"))))]
5055 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5056 "fmpynfadd,sgl %1,%2,%%fr0,%0"
5057 [(set_attr "type" "fpmuldbl")
5058 (set_attr "length" "4")])
5061 [(set (match_operand:DF 0 "register_operand" "=f")
5062 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
5063 (match_operand:DF 2 "register_operand" "f"))))
5064 (set (match_operand:DF 3 "register_operand" "=&f")
5065 (mult:DF (match_dup 1) (match_dup 2)))]
5066 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5067 && ! (reg_overlap_mentioned_p (operands[3], operands[1])
5068 || reg_overlap_mentioned_p (operands[3], operands[2])))"
5070 [(set_attr "type" "fpmuldbl")
5071 (set_attr "length" "8")])
5074 [(set (match_operand:DF 0 "register_operand" "")
5075 (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "")
5076 (match_operand:DF 2 "register_operand" ""))))
5077 (set (match_operand:DF 3 "register_operand" "")
5078 (mult:DF (match_dup 1) (match_dup 2)))]
5079 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5080 [(set (match_dup 3) (mult:DF (match_dup 1) (match_dup 2)))
5081 (set (match_dup 0) (neg:DF (mult:DF (match_dup 1) (match_dup 2))))]
5085 [(set (match_operand:SF 0 "register_operand" "=f")
5086 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
5087 (match_operand:SF 2 "register_operand" "f"))))
5088 (set (match_operand:SF 3 "register_operand" "=&f")
5089 (mult:SF (match_dup 1) (match_dup 2)))]
5090 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5091 && ! (reg_overlap_mentioned_p (operands[3], operands[1])
5092 || reg_overlap_mentioned_p (operands[3], operands[2])))"
5094 [(set_attr "type" "fpmuldbl")
5095 (set_attr "length" "8")])
5098 [(set (match_operand:SF 0 "register_operand" "")
5099 (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "")
5100 (match_operand:SF 2 "register_operand" ""))))
5101 (set (match_operand:SF 3 "register_operand" "")
5102 (mult:SF (match_dup 1) (match_dup 2)))]
5103 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5104 [(set (match_dup 3) (mult:SF (match_dup 1) (match_dup 2)))
5105 (set (match_dup 0) (neg:SF (mult:SF (match_dup 1) (match_dup 2))))]
5108 ;; Now fused multiplies with the result of the multiply negated.
5110 [(set (match_operand:DF 0 "register_operand" "=f")
5111 (plus:DF (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
5112 (match_operand:DF 2 "register_operand" "f")))
5113 (match_operand:DF 3 "register_operand" "f")))]
5114 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5115 "fmpynfadd,dbl %1,%2,%3,%0"
5116 [(set_attr "type" "fpmuldbl")
5117 (set_attr "length" "4")])
5120 [(set (match_operand:SF 0 "register_operand" "=f")
5121 (plus:SF (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
5122 (match_operand:SF 2 "register_operand" "f")))
5123 (match_operand:SF 3 "register_operand" "f")))]
5124 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5125 "fmpynfadd,sgl %1,%2,%3,%0"
5126 [(set_attr "type" "fpmuldbl")
5127 (set_attr "length" "4")])
5130 [(set (match_operand:DF 0 "register_operand" "=f")
5131 (plus:DF (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "f")
5132 (match_operand:DF 2 "register_operand" "f")))
5133 (match_operand:DF 3 "register_operand" "f")))
5134 (set (match_operand:DF 4 "register_operand" "=&f")
5135 (mult:DF (match_dup 1) (match_dup 2)))]
5136 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5137 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
5138 || reg_overlap_mentioned_p (operands[4], operands[2])))"
5140 [(set_attr "type" "fpmuldbl")
5141 (set_attr "length" "8")])
5144 [(set (match_operand:DF 0 "register_operand" "")
5145 (plus:DF (neg:DF (mult:DF (match_operand:DF 1 "register_operand" "")
5146 (match_operand:DF 2 "register_operand" "")))
5147 (match_operand:DF 3 "register_operand" "")))
5148 (set (match_operand:DF 4 "register_operand" "")
5149 (mult:DF (match_dup 1) (match_dup 2)))]
5150 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5151 [(set (match_dup 4) (mult:DF (match_dup 1) (match_dup 2)))
5152 (set (match_dup 0) (plus:DF (neg:DF (mult:DF (match_dup 1) (match_dup 2)))
5157 [(set (match_operand:SF 0 "register_operand" "=f")
5158 (plus:SF (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "f")
5159 (match_operand:SF 2 "register_operand" "f")))
5160 (match_operand:SF 3 "register_operand" "f")))
5161 (set (match_operand:SF 4 "register_operand" "=&f")
5162 (mult:SF (match_dup 1) (match_dup 2)))]
5163 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5164 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
5165 || reg_overlap_mentioned_p (operands[4], operands[2])))"
5167 [(set_attr "type" "fpmuldbl")
5168 (set_attr "length" "8")])
5171 [(set (match_operand:SF 0 "register_operand" "")
5172 (plus:SF (neg:SF (mult:SF (match_operand:SF 1 "register_operand" "")
5173 (match_operand:SF 2 "register_operand" "")))
5174 (match_operand:SF 3 "register_operand" "")))
5175 (set (match_operand:SF 4 "register_operand" "")
5176 (mult:SF (match_dup 1) (match_dup 2)))]
5177 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5178 [(set (match_dup 4) (mult:SF (match_dup 1) (match_dup 2)))
5179 (set (match_dup 0) (plus:SF (neg:SF (mult:SF (match_dup 1) (match_dup 2)))
5184 [(set (match_operand:DF 0 "register_operand" "=f")
5185 (minus:DF (match_operand:DF 3 "register_operand" "f")
5186 (mult:DF (match_operand:DF 1 "register_operand" "f")
5187 (match_operand:DF 2 "register_operand" "f"))))
5188 (set (match_operand:DF 4 "register_operand" "=&f")
5189 (mult:DF (match_dup 1) (match_dup 2)))]
5190 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5191 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
5192 || reg_overlap_mentioned_p (operands[4], operands[2])))"
5194 [(set_attr "type" "fpmuldbl")
5195 (set_attr "length" "8")])
5198 [(set (match_operand:DF 0 "register_operand" "")
5199 (minus:DF (match_operand:DF 3 "register_operand" "")
5200 (mult:DF (match_operand:DF 1 "register_operand" "")
5201 (match_operand:DF 2 "register_operand" ""))))
5202 (set (match_operand:DF 4 "register_operand" "")
5203 (mult:DF (match_dup 1) (match_dup 2)))]
5204 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5205 [(set (match_dup 4) (mult:DF (match_dup 1) (match_dup 2)))
5206 (set (match_dup 0) (minus:DF (match_dup 3)
5207 (mult:DF (match_dup 1) (match_dup 2))))]
5211 [(set (match_operand:SF 0 "register_operand" "=f")
5212 (minus:SF (match_operand:SF 3 "register_operand" "f")
5213 (mult:SF (match_operand:SF 1 "register_operand" "f")
5214 (match_operand:SF 2 "register_operand" "f"))))
5215 (set (match_operand:SF 4 "register_operand" "=&f")
5216 (mult:SF (match_dup 1) (match_dup 2)))]
5217 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5218 && ! (reg_overlap_mentioned_p (operands[4], operands[1])
5219 || reg_overlap_mentioned_p (operands[4], operands[2])))"
5221 [(set_attr "type" "fpmuldbl")
5222 (set_attr "length" "8")])
5225 [(set (match_operand:SF 0 "register_operand" "")
5226 (minus:SF (match_operand:SF 3 "register_operand" "")
5227 (mult:SF (match_operand:SF 1 "register_operand" "")
5228 (match_operand:SF 2 "register_operand" ""))))
5229 (set (match_operand:SF 4 "register_operand" "")
5230 (mult:SF (match_dup 1) (match_dup 2)))]
5231 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5232 [(set (match_dup 4) (mult:SF (match_dup 1) (match_dup 2)))
5233 (set (match_dup 0) (minus:SF (match_dup 3)
5234 (mult:SF (match_dup 1) (match_dup 2))))]
5238 [(set (match_operand:DF 0 "register_operand" "=f")
5239 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))))
5240 (set (match_operand:DF 2 "register_operand" "=&f") (abs:DF (match_dup 1)))]
5241 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5242 && ! reg_overlap_mentioned_p (operands[2], operands[1]))"
5244 [(set_attr "type" "fpalu")
5245 (set_attr "length" "8")])
5248 [(set (match_operand:DF 0 "register_operand" "")
5249 (neg:DF (abs:DF (match_operand:DF 1 "register_operand" ""))))
5250 (set (match_operand:DF 2 "register_operand" "") (abs:DF (match_dup 1)))]
5251 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5252 [(set (match_dup 2) (abs:DF (match_dup 1)))
5253 (set (match_dup 0) (neg:DF (abs:DF (match_dup 1))))]
5257 [(set (match_operand:SF 0 "register_operand" "=f")
5258 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))))
5259 (set (match_operand:SF 2 "register_operand" "=&f") (abs:SF (match_dup 1)))]
5260 "(! TARGET_SOFT_FLOAT && TARGET_PA_20
5261 && ! reg_overlap_mentioned_p (operands[2], operands[1]))"
5263 [(set_attr "type" "fpalu")
5264 (set_attr "length" "8")])
5267 [(set (match_operand:SF 0 "register_operand" "")
5268 (neg:SF (abs:SF (match_operand:SF 1 "register_operand" ""))))
5269 (set (match_operand:SF 2 "register_operand" "") (abs:SF (match_dup 1)))]
5270 "! TARGET_SOFT_FLOAT && TARGET_PA_20"
5271 [(set (match_dup 2) (abs:SF (match_dup 1)))
5272 (set (match_dup 0) (neg:SF (abs:SF (match_dup 1))))]
5275 ;;- Shift instructions
5277 ;; Optimized special case of shifting.
5280 [(set (match_operand:SI 0 "register_operand" "=r")
5281 (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
5285 [(set_attr "type" "load")
5286 (set_attr "length" "4")])
5289 [(set (match_operand:SI 0 "register_operand" "=r")
5290 (lshiftrt:SI (match_operand:SI 1 "memory_operand" "m")
5294 [(set_attr "type" "load")
5295 (set_attr "length" "4")])
5298 [(set (match_operand:SI 0 "register_operand" "=r")
5299 (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r")
5300 (match_operand:SI 3 "shadd_operand" ""))
5301 (match_operand:SI 1 "register_operand" "r")))]
5303 "{sh%O3addl %2,%1,%0|shladd,l %2,%O3,%1,%0} "
5304 [(set_attr "type" "binary")
5305 (set_attr "length" "4")])
5308 [(set (match_operand:DI 0 "register_operand" "=r")
5309 (plus:DI (mult:DI (match_operand:DI 2 "register_operand" "r")
5310 (match_operand:DI 3 "shadd_operand" ""))
5311 (match_operand:DI 1 "register_operand" "r")))]
5313 "shladd,l %2,%O3,%1,%0"
5314 [(set_attr "type" "binary")
5315 (set_attr "length" "4")])
5317 (define_expand "ashlsi3"
5318 [(set (match_operand:SI 0 "register_operand" "")
5319 (ashift:SI (match_operand:SI 1 "lhs_lshift_operand" "")
5320 (match_operand:SI 2 "arith32_operand" "")))]
5324 if (GET_CODE (operands[2]) != CONST_INT)
5326 rtx temp = gen_reg_rtx (SImode);
5327 emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
5328 if (GET_CODE (operands[1]) == CONST_INT)
5329 emit_insn (gen_zvdep_imm32 (operands[0], operands[1], temp));
5331 emit_insn (gen_zvdep32 (operands[0], operands[1], temp));
5334 /* Make sure both inputs are not constants,
5335 there are no patterns for that. */
5336 operands[1] = force_reg (SImode, operands[1]);
5340 [(set (match_operand:SI 0 "register_operand" "=r")
5341 (ashift:SI (match_operand:SI 1 "register_operand" "r")
5342 (match_operand:SI 2 "const_int_operand" "n")))]
5344 "{zdep|depw,z} %1,%P2,%L2,%0"
5345 [(set_attr "type" "shift")
5346 (set_attr "length" "4")])
5348 ; Match cases of op1 a CONST_INT here that zvdep_imm32 doesn't handle.
5349 ; Doing it like this makes slightly better code since reload can
5350 ; replace a register with a known value in range -16..15 with a
5351 ; constant. Ideally, we would like to merge zvdep32 and zvdep_imm32,
5352 ; but since we have no more CONST_OK... characters, that is not
5354 (define_insn "zvdep32"
5355 [(set (match_operand:SI 0 "register_operand" "=r,r")
5356 (ashift:SI (match_operand:SI 1 "arith5_operand" "r,L")
5357 (minus:SI (const_int 31)
5358 (match_operand:SI 2 "register_operand" "q,q"))))]
5361 {zvdep %1,32,%0|depw,z %1,%%sar,32,%0}
5362 {zvdepi %1,32,%0|depwi,z %1,%%sar,32,%0}"
5363 [(set_attr "type" "shift,shift")
5364 (set_attr "length" "4,4")])
5366 (define_insn "zvdep_imm32"
5367 [(set (match_operand:SI 0 "register_operand" "=r")
5368 (ashift:SI (match_operand:SI 1 "lhs_lshift_cint_operand" "")
5369 (minus:SI (const_int 31)
5370 (match_operand:SI 2 "register_operand" "q"))))]
5374 int x = INTVAL (operands[1]);
5375 operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
5376 operands[1] = GEN_INT ((x & 0xf) - 0x10);
5377 return \"{zvdepi %1,%2,%0|depwi,z %1,%%sar,%2,%0}\";
5379 [(set_attr "type" "shift")
5380 (set_attr "length" "4")])
5382 (define_insn "vdepi_ior"
5383 [(set (match_operand:SI 0 "register_operand" "=r")
5384 (ior:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "")
5385 (minus:SI (const_int 31)
5386 (match_operand:SI 2 "register_operand" "q")))
5387 (match_operand:SI 3 "register_operand" "0")))]
5388 ; accept ...0001...1, can this be generalized?
5389 "exact_log2 (INTVAL (operands[1]) + 1) >= 0"
5392 int x = INTVAL (operands[1]);
5393 operands[2] = GEN_INT (exact_log2 (x + 1));
5394 return \"{vdepi -1,%2,%0|depwi -1,%%sar,%2,%0}\";
5396 [(set_attr "type" "shift")
5397 (set_attr "length" "4")])
5399 (define_insn "vdepi_and"
5400 [(set (match_operand:SI 0 "register_operand" "=r")
5401 (and:SI (rotate:SI (match_operand:SI 1 "const_int_operand" "")
5402 (minus:SI (const_int 31)
5403 (match_operand:SI 2 "register_operand" "q")))
5404 (match_operand:SI 3 "register_operand" "0")))]
5405 ; this can be generalized...!
5406 "INTVAL (operands[1]) == -2"
5409 int x = INTVAL (operands[1]);
5410 operands[2] = GEN_INT (exact_log2 ((~x) + 1));
5411 return \"{vdepi 0,%2,%0|depwi 0,%%sar,%2,%0}\";
5413 [(set_attr "type" "shift")
5414 (set_attr "length" "4")])
5416 (define_expand "ashldi3"
5417 [(set (match_operand:DI 0 "register_operand" "")
5418 (ashift:DI (match_operand:DI 1 "lhs_lshift_operand" "")
5419 (match_operand:DI 2 "arith32_operand" "")))]
5423 if (GET_CODE (operands[2]) != CONST_INT)
5425 rtx temp = gen_reg_rtx (DImode);
5426 emit_insn (gen_subdi3 (temp, GEN_INT (63), operands[2]));
5427 if (GET_CODE (operands[1]) == CONST_INT)
5428 emit_insn (gen_zvdep_imm64 (operands[0], operands[1], temp));
5430 emit_insn (gen_zvdep64 (operands[0], operands[1], temp));
5433 /* Make sure both inputs are not constants,
5434 there are no patterns for that. */
5435 operands[1] = force_reg (DImode, operands[1]);
5439 [(set (match_operand:DI 0 "register_operand" "=r")
5440 (ashift:DI (match_operand:DI 1 "register_operand" "r")
5441 (match_operand:DI 2 "const_int_operand" "n")))]
5443 "depd,z %1,%p2,%Q2,%0"
5444 [(set_attr "type" "shift")
5445 (set_attr "length" "4")])
5447 ; Match cases of op1 a CONST_INT here that zvdep_imm64 doesn't handle.
5448 ; Doing it like this makes slightly better code since reload can
5449 ; replace a register with a known value in range -16..15 with a
5450 ; constant. Ideally, we would like to merge zvdep64 and zvdep_imm64,
5451 ; but since we have no more CONST_OK... characters, that is not
5453 (define_insn "zvdep64"
5454 [(set (match_operand:DI 0 "register_operand" "=r,r")
5455 (ashift:DI (match_operand:DI 1 "arith5_operand" "r,L")
5456 (minus:DI (const_int 63)
5457 (match_operand:DI 2 "register_operand" "q,q"))))]
5460 depd,z %1,%%sar,64,%0
5461 depdi,z %1,%%sar,64,%0"
5462 [(set_attr "type" "shift,shift")
5463 (set_attr "length" "4,4")])
5465 (define_insn "zvdep_imm64"
5466 [(set (match_operand:DI 0 "register_operand" "=r")
5467 (ashift:DI (match_operand:DI 1 "lhs_lshift_cint_operand" "")
5468 (minus:DI (const_int 63)
5469 (match_operand:DI 2 "register_operand" "q"))))]
5473 int x = INTVAL (operands[1]);
5474 operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1));
5475 operands[1] = GEN_INT ((x & 0x1f) - 0x20);
5476 return \"depdi,z %1,%%sar,%2,%0\";
5478 [(set_attr "type" "shift")
5479 (set_attr "length" "4")])
5482 [(set (match_operand:DI 0 "register_operand" "=r")
5483 (ior:DI (ashift:DI (match_operand:DI 1 "const_int_operand" "")
5484 (minus:DI (const_int 63)
5485 (match_operand:DI 2 "register_operand" "q")))
5486 (match_operand:DI 3 "register_operand" "0")))]
5487 ; accept ...0001...1, can this be generalized?
5488 "TARGET_64BIT && exact_log2 (INTVAL (operands[1]) + 1) >= 0"
5491 int x = INTVAL (operands[1]);
5492 operands[2] = GEN_INT (exact_log2 (x + 1));
5493 return \"depdi -1,%%sar,%2,%0\";
5495 [(set_attr "type" "shift")
5496 (set_attr "length" "4")])
5499 [(set (match_operand:DI 0 "register_operand" "=r")
5500 (and:DI (rotate:DI (match_operand:DI 1 "const_int_operand" "")
5501 (minus:DI (const_int 63)
5502 (match_operand:DI 2 "register_operand" "q")))
5503 (match_operand:DI 3 "register_operand" "0")))]
5504 ; this can be generalized...!
5505 "TARGET_64BIT && INTVAL (operands[1]) == -2"
5508 int x = INTVAL (operands[1]);
5509 operands[2] = GEN_INT (exact_log2 ((~x) + 1));
5510 return \"depdi 0,%%sar,%2,%0\";
5512 [(set_attr "type" "shift")
5513 (set_attr "length" "4")])
5515 (define_expand "ashrsi3"
5516 [(set (match_operand:SI 0 "register_operand" "")
5517 (ashiftrt:SI (match_operand:SI 1 "register_operand" "")
5518 (match_operand:SI 2 "arith32_operand" "")))]
5522 if (GET_CODE (operands[2]) != CONST_INT)
5524 rtx temp = gen_reg_rtx (SImode);
5525 emit_insn (gen_subsi3 (temp, GEN_INT (31), operands[2]));
5526 emit_insn (gen_vextrs32 (operands[0], operands[1], temp));
5532 [(set (match_operand:SI 0 "register_operand" "=r")
5533 (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
5534 (match_operand:SI 2 "const_int_operand" "n")))]
5536 "{extrs|extrw,s} %1,%P2,%L2,%0"
5537 [(set_attr "type" "shift")
5538 (set_attr "length" "4")])
5540 (define_insn "vextrs32"
5541 [(set (match_operand:SI 0 "register_operand" "=r")
5542 (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
5543 (minus:SI (const_int 31)
5544 (match_operand:SI 2 "register_operand" "q"))))]
5546 "{vextrs %1,32,%0|extrw,s %1,%%sar,32,%0}"
5547 [(set_attr "type" "shift")
5548 (set_attr "length" "4")])
5550 (define_expand "ashrdi3"
5551 [(set (match_operand:DI 0 "register_operand" "")
5552 (ashiftrt:DI (match_operand:DI 1 "register_operand" "")
5553 (match_operand:DI 2 "arith32_operand" "")))]
5557 if (GET_CODE (operands[2]) != CONST_INT)
5559 rtx temp = gen_reg_rtx (DImode);
5560 emit_insn (gen_subdi3 (temp, GEN_INT (63), operands[2]));
5561 emit_insn (gen_vextrs64 (operands[0], operands[1], temp));
5567 [(set (match_operand:DI 0 "register_operand" "=r")
5568 (ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
5569 (match_operand:DI 2 "const_int_operand" "n")))]
5571 "extrd,s %1,%p2,%Q2,%0"
5572 [(set_attr "type" "shift")
5573 (set_attr "length" "4")])
5575 (define_insn "vextrs64"
5576 [(set (match_operand:DI 0 "register_operand" "=r")
5577 (ashiftrt:DI (match_operand:DI 1 "register_operand" "r")
5578 (minus:DI (const_int 63)
5579 (match_operand:DI 2 "register_operand" "q"))))]
5581 "extrd,s %1,%%sar,64,%0"
5582 [(set_attr "type" "shift")
5583 (set_attr "length" "4")])
5585 (define_insn "lshrsi3"
5586 [(set (match_operand:SI 0 "register_operand" "=r,r")
5587 (lshiftrt:SI (match_operand:SI 1 "register_operand" "r,r")
5588 (match_operand:SI 2 "arith32_operand" "q,n")))]
5591 {vshd %%r0,%1,%0|shrpw %%r0,%1,%%sar,%0}
5592 {extru|extrw,u} %1,%P2,%L2,%0"
5593 [(set_attr "type" "shift")
5594 (set_attr "length" "4")])
5596 (define_insn "lshrdi3"
5597 [(set (match_operand:DI 0 "register_operand" "=r,r")
5598 (lshiftrt:DI (match_operand:DI 1 "register_operand" "r,r")
5599 (match_operand:DI 2 "arith32_operand" "q,n")))]
5602 shrpd %%r0,%1,%%sar,%0
5603 extrd,u %1,%p2,%Q2,%0"
5604 [(set_attr "type" "shift")
5605 (set_attr "length" "4")])
5607 (define_insn "rotrsi3"
5608 [(set (match_operand:SI 0 "register_operand" "=r,r")
5609 (rotatert:SI (match_operand:SI 1 "register_operand" "r,r")
5610 (match_operand:SI 2 "arith32_operand" "q,n")))]
5614 if (GET_CODE (operands[2]) == CONST_INT)
5616 operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
5617 return \"{shd|shrpw} %1,%1,%2,%0\";
5620 return \"{vshd %1,%1,%0|shrpw %1,%1,%%sar,%0}\";
5622 [(set_attr "type" "shift")
5623 (set_attr "length" "4")])
5625 (define_expand "rotlsi3"
5626 [(set (match_operand:SI 0 "register_operand" "")
5627 (rotate:SI (match_operand:SI 1 "register_operand" "")
5628 (match_operand:SI 2 "arith32_operand" "")))]
5632 if (GET_CODE (operands[2]) != CONST_INT)
5634 rtx temp = gen_reg_rtx (SImode);
5635 emit_insn (gen_subsi3 (temp, GEN_INT (32), operands[2]));
5636 emit_insn (gen_rotrsi3 (operands[0], operands[1], temp));
5639 /* Else expand normally. */
5643 [(set (match_operand:SI 0 "register_operand" "=r")
5644 (rotate:SI (match_operand:SI 1 "register_operand" "r")
5645 (match_operand:SI 2 "const_int_operand" "n")))]
5649 operands[2] = GEN_INT ((32 - INTVAL (operands[2])) & 31);
5650 return \"{shd|shrpw} %1,%1,%2,%0\";
5652 [(set_attr "type" "shift")
5653 (set_attr "length" "4")])
5656 [(set (match_operand:SI 0 "register_operand" "=r")
5657 (match_operator:SI 5 "plus_xor_ior_operator"
5658 [(ashift:SI (match_operand:SI 1 "register_operand" "r")
5659 (match_operand:SI 3 "const_int_operand" "n"))
5660 (lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
5661 (match_operand:SI 4 "const_int_operand" "n"))]))]
5662 "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
5663 "{shd|shrpw} %1,%2,%4,%0"
5664 [(set_attr "type" "shift")
5665 (set_attr "length" "4")])
5668 [(set (match_operand:SI 0 "register_operand" "=r")
5669 (match_operator:SI 5 "plus_xor_ior_operator"
5670 [(lshiftrt:SI (match_operand:SI 2 "register_operand" "r")
5671 (match_operand:SI 4 "const_int_operand" "n"))
5672 (ashift:SI (match_operand:SI 1 "register_operand" "r")
5673 (match_operand:SI 3 "const_int_operand" "n"))]))]
5674 "INTVAL (operands[3]) + INTVAL (operands[4]) == 32"
5675 "{shd|shrpw} %1,%2,%4,%0"
5676 [(set_attr "type" "shift")
5677 (set_attr "length" "4")])
5680 [(set (match_operand:SI 0 "register_operand" "=r")
5681 (and:SI (ashift:SI (match_operand:SI 1 "register_operand" "r")
5682 (match_operand:SI 2 "const_int_operand" ""))
5683 (match_operand:SI 3 "const_int_operand" "")))]
5684 "exact_log2 (1 + (INTVAL (operands[3]) >> (INTVAL (operands[2]) & 31))) >= 0"
5687 int cnt = INTVAL (operands[2]) & 31;
5688 operands[3] = GEN_INT (exact_log2 (1 + (INTVAL (operands[3]) >> cnt)));
5689 operands[2] = GEN_INT (31 - cnt);
5690 return \"{zdep|depw,z} %1,%2,%3,%0\";
5692 [(set_attr "type" "shift")
5693 (set_attr "length" "4")])
5695 ;; Unconditional and other jump instructions.
5697 ;; This can only be used in a leaf function, so we do
5698 ;; not need to use the PIC register when generating PIC code.
5699 (define_insn "return"
5703 "hppa_can_use_return_insn_p ()"
5707 return \"bve%* (%%r2)\";
5708 return \"bv%* %%r0(%%r2)\";
5710 [(set_attr "type" "branch")
5711 (set_attr "length" "4")])
5713 ;; Emit a different pattern for functions which have non-trivial
5714 ;; epilogues so as not to confuse jump and reorg.
5715 (define_insn "return_internal"
5723 return \"bve%* (%%r2)\";
5724 return \"bv%* %%r0(%%r2)\";
5726 [(set_attr "type" "branch")
5727 (set_attr "length" "4")])
5729 ;; Use the PIC register to ensure it's restored after a
5730 ;; call in PIC mode.
5731 (define_insn "return_internal_pic"
5733 (use (match_operand 0 "register_operand" "r"))
5735 "flag_pic && true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM"
5739 return \"bve%* (%%r2)\";
5740 return \"bv%* %%r0(%%r2)\";
5742 [(set_attr "type" "branch")
5743 (set_attr "length" "4")])
5745 ;; Use the PIC register to ensure it's restored after a
5746 ;; call in PIC mode. This is used for eh returns which
5747 ;; bypass the return stub.
5748 (define_insn "return_external_pic"
5750 (use (match_operand 0 "register_operand" "r"))
5752 (clobber (reg:SI 1))]
5754 && current_function_calls_eh_return
5755 && true_regnum (operands[0]) == PIC_OFFSET_TABLE_REGNUM"
5756 "ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
5757 [(set_attr "type" "branch")
5758 (set_attr "length" "12")])
5760 (define_expand "prologue"
5763 "hppa_expand_prologue ();DONE;")
5765 (define_expand "sibcall_epilogue"
5770 hppa_expand_epilogue ();
5774 (define_expand "epilogue"
5779 /* Try to use the trivial return first. Else use the full
5781 if (hppa_can_use_return_insn_p ())
5782 emit_jump_insn (gen_return ());
5787 hppa_expand_epilogue ();
5790 rtx pic = gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM);
5792 /* EH returns bypass the normal return stub. Thus, we must do an
5793 interspace branch to return from functions that call eh_return.
5794 This is only a problem for returns from shared code. */
5795 if (current_function_calls_eh_return)
5796 x = gen_return_external_pic (pic);
5798 x = gen_return_internal_pic (pic);
5801 x = gen_return_internal ();
5807 ;; Special because we use the value placed in %r2 by the bl instruction
5808 ;; from within its delay slot to set the value for the 2nd parameter to
5810 (define_insn "call_profiler"
5811 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
5812 (match_operand 1 "" ""))
5813 (use (match_operand 2 "" ""))
5816 (clobber (reg:SI 2))]
5822 output_arg_descriptor (insn);
5824 xoperands[0] = operands[0];
5825 xoperands[1] = operands[2];
5826 xoperands[2] = gen_label_rtx ();
5827 output_asm_insn (\"{bl|b,l} %0,%%r2\;ldo %1-%2(%%r2),%%r25\", xoperands);
5829 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
5830 CODE_LABEL_NUMBER (xoperands[2]));
5833 [(set_attr "type" "multi")
5834 (set_attr "length" "8")])
5836 (define_insn "blockage"
5837 [(unspec_volatile [(const_int 2)] 0)]
5840 [(set_attr "length" "0")])
5843 [(set (pc) (label_ref (match_operand 0 "" "")))]
5847 extern int optimize;
5849 if (GET_MODE (insn) == SImode)
5852 /* An unconditional branch which can reach its target. */
5853 if (get_attr_length (insn) != 24
5854 && get_attr_length (insn) != 16)
5857 /* An unconditional branch which can not reach its target.
5859 We need to be able to use %r1 as a scratch register; however,
5860 we can never be sure whether or not it's got a live value in
5861 it. Therefore, we must restore its original value after the
5864 To make matters worse, we don't have a stack slot which we
5865 can always clobber. sp-12/sp-16 shouldn't ever have a live
5866 value during a non-optimizing compilation, so we use those
5867 slots for now. We don't support very long branches when
5868 optimizing -- they should be quite rare when optimizing.
5870 Really the way to go long term is a register scavenger; goto
5871 the target of the jump and find a register which we can use
5872 as a scratch to hold the value in %r1. */
5874 /* We don't know how to register scavenge yet. */
5878 /* First store %r1 into the stack. */
5879 output_asm_insn (\"stw %%r1,-16(%%r30)\", operands);
5881 /* Now load the target address into %r1 and do an indirect jump
5882 to the value specified in %r1. Be careful to generate PIC
5887 xoperands[0] = operands[0];
5888 if (TARGET_SOM || ! TARGET_GAS)
5890 xoperands[1] = gen_label_rtx ();
5892 output_asm_insn (\"{bl|b,l} .+8,%%r1\\n\\taddil L'%l0-%l1,%%r1\",
5894 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
5895 CODE_LABEL_NUMBER (xoperands[1]));
5896 output_asm_insn (\"ldo R'%l0-%l1(%%r1),%%r1\", xoperands);
5900 output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands);
5901 output_asm_insn (\"addil L'%l0-$PIC_pcrel$0+4,%%r1\", xoperands);
5902 output_asm_insn (\"ldo R'%l0-$PIC_pcrel$0+8(%%r1),%%r1\", xoperands);
5904 output_asm_insn (\"bv %%r0(%%r1)\", xoperands);
5907 output_asm_insn (\"ldil L'%l0,%%r1\\n\\tbe R'%l0(%%sr4,%%r1)\", operands);;
5909 /* And restore the value of %r1 in the delay slot. We're not optimizing,
5910 so we know nothing else can be in the delay slot. */
5911 return \"ldw -16(%%r30),%%r1\";
5913 [(set_attr "type" "uncond_branch")
5914 (set_attr "pa_combine_type" "uncond_branch")
5915 (set (attr "length")
5916 (cond [(eq (symbol_ref "jump_in_call_delay (insn)") (const_int 1))
5917 (if_then_else (lt (abs (minus (match_dup 0)
5918 (plus (pc) (const_int 8))))
5922 (ge (abs (minus (match_dup 0) (plus (pc) (const_int 8))))
5924 (if_then_else (eq (symbol_ref "flag_pic") (const_int 0))
5929 ;; Subroutines of "casesi".
5930 ;; operand 0 is index
5931 ;; operand 1 is the minimum bound
5932 ;; operand 2 is the maximum bound - minimum bound + 1
5933 ;; operand 3 is CODE_LABEL for the table;
5934 ;; operand 4 is the CODE_LABEL to go to if index out of range.
5936 (define_expand "casesi"
5937 [(match_operand:SI 0 "general_operand" "")
5938 (match_operand:SI 1 "const_int_operand" "")
5939 (match_operand:SI 2 "const_int_operand" "")
5940 (match_operand 3 "" "")
5941 (match_operand 4 "" "")]
5945 if (GET_CODE (operands[0]) != REG)
5946 operands[0] = force_reg (SImode, operands[0]);
5948 if (operands[1] != const0_rtx)
5950 rtx reg = gen_reg_rtx (SImode);
5952 operands[1] = GEN_INT (-INTVAL (operands[1]));
5953 if (!INT_14_BITS (operands[1]))
5954 operands[1] = force_reg (SImode, operands[1]);
5955 emit_insn (gen_addsi3 (reg, operands[0], operands[1]));
5960 /* In 64bit mode we must make sure to wipe the upper bits of the register
5961 just in case the addition overflowed or we had random bits in the
5962 high part of the register. */
5965 rtx reg = gen_reg_rtx (DImode);
5966 emit_insn (gen_extendsidi2 (reg, operands[0]));
5967 operands[0] = gen_rtx_SUBREG (SImode, reg, 4);
5970 if (!INT_5_BITS (operands[2]))
5971 operands[2] = force_reg (SImode, operands[2]);
5973 emit_insn (gen_cmpsi (operands[0], operands[2]));
5974 emit_jump_insn (gen_bgtu (operands[4]));
5975 if (TARGET_BIG_SWITCH)
5977 rtx temp = gen_reg_rtx (SImode);
5978 emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[0], operands[0]));
5981 emit_jump_insn (gen_casesi0 (operands[0], operands[3]));
5985 (define_insn "casesi0"
5987 (mem:SI (plus:SI (pc)
5988 (match_operand:SI 0 "register_operand" "r")))
5989 (label_ref (match_operand 1 "" ""))))]
5992 [(set_attr "type" "multi")
5993 (set_attr "length" "8")])
5995 ;; Need nops for the calls because execution is supposed to continue
5996 ;; past; we don't want to nullify an instruction that we need.
5997 ;;- jump to subroutine
5999 (define_expand "call"
6000 [(parallel [(call (match_operand:SI 0 "" "")
6001 (match_operand 1 "" ""))
6002 (clobber (reg:SI 2))])]
6009 if (TARGET_PORTABLE_RUNTIME)
6010 op = force_reg (SImode, XEXP (operands[0], 0));
6012 op = XEXP (operands[0], 0);
6015 emit_move_insn (arg_pointer_rtx,
6016 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
6019 /* Use two different patterns for calls to explicitly named functions
6020 and calls through function pointers. This is necessary as these two
6021 types of calls use different calling conventions, and CSE might try
6022 to change the named call into an indirect call in some cases (using
6023 two patterns keeps CSE from performing this optimization). */
6024 if (GET_CODE (op) == SYMBOL_REF)
6025 call_insn = emit_call_insn (gen_call_internal_symref (op, operands[1]));
6026 else if (TARGET_64BIT)
6028 rtx tmpreg = force_reg (word_mode, op);
6029 call_insn = emit_call_insn (gen_call_internal_reg_64bit (tmpreg,
6034 rtx tmpreg = gen_rtx_REG (word_mode, 22);
6035 emit_move_insn (tmpreg, force_reg (word_mode, op));
6036 call_insn = emit_call_insn (gen_call_internal_reg (operands[1]));
6041 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
6043 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
6045 /* After each call we must restore the PIC register, even if it
6046 doesn't appear to be used. */
6047 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
6052 (define_insn "call_internal_symref"
6053 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
6054 (match_operand 1 "" "i"))
6055 (clobber (reg:SI 2))
6056 (use (const_int 0))]
6057 "! TARGET_PORTABLE_RUNTIME"
6060 output_arg_descriptor (insn);
6061 return output_call (insn, operands[0], 0);
6063 [(set_attr "type" "call")
6064 (set (attr "length")
6065 ;; If we're sure that we can either reach the target or that the
6066 ;; linker can use a long-branch stub, then the length is at most
6069 ;; For long-calls the length will be at most 68 bytes (non-pic)
6070 ;; or 84 bytes (pic). */
6071 ;; Else we have to use a long-call;
6072 (if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
6075 (if_then_else (eq (symbol_ref "flag_pic")
6080 (define_insn "call_internal_reg_64bit"
6081 [(call (mem:SI (match_operand:DI 0 "register_operand" "r"))
6082 (match_operand 1 "" "i"))
6083 (clobber (reg:SI 2))
6084 (use (const_int 1))]
6088 /* ??? Needs more work. Length computation, split into multiple insns,
6089 do not use %r22 directly, expose delay slot. */
6090 return \"ldd 16(%0),%%r2\;ldd 24(%0),%%r27\;bve,l (%%r2),%%r2\;nop\";
6092 [(set_attr "type" "dyncall")
6093 (set (attr "length") (const_int 16))])
6095 (define_insn "call_internal_reg"
6096 [(call (mem:SI (reg:SI 22))
6097 (match_operand 0 "" "i"))
6098 (clobber (reg:SI 2))
6099 (use (const_int 1))]
6105 /* First the special case for kernels, level 0 systems, etc. */
6106 if (TARGET_FAST_INDIRECT_CALLS)
6107 return \"ble 0(%%sr4,%%r22)\;copy %%r31,%%r2\";
6109 /* Now the normal case -- we can reach $$dyncall directly or
6110 we're sure that we can get there via a long-branch stub.
6112 No need to check target flags as the length uniquely identifies
6113 the remaining cases. */
6114 if (get_attr_length (insn) == 8)
6115 return \".CALL\\tARGW0=GR\;{bl|b,l} $$dyncall,%%r31\;copy %%r31,%%r2\";
6117 /* Long millicode call, but we are not generating PIC or portable runtime
6119 if (get_attr_length (insn) == 12)
6120 return \".CALL\\tARGW0=GR\;ldil L%%$$dyncall,%%r2\;ble R%%$$dyncall(%%sr4,%%r2)\;copy %%r31,%%r2\";
6122 /* Long millicode call for portable runtime. */
6123 if (get_attr_length (insn) == 20)
6124 return \"ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr %%r0,%%r2\;bv,n %%r0(%%r31)\;nop\";
6126 /* If we're generating PIC code. */
6127 xoperands[0] = operands[0];
6128 if (TARGET_SOM || ! TARGET_GAS)
6129 xoperands[1] = gen_label_rtx ();
6130 output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands);
6131 if (TARGET_SOM || ! TARGET_GAS)
6133 output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
6134 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
6135 CODE_LABEL_NUMBER (xoperands[1]));
6136 output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
6140 output_asm_insn (\"addil L%%$$dyncall-$PIC_pcrel$0+4,%%r1\", xoperands);
6141 output_asm_insn (\"ldo R%%$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1\",
6144 output_asm_insn (\"blr %%r0,%%r2\", xoperands);
6145 output_asm_insn (\"bv,n %%r0(%%r1)\\n\\tnop\", xoperands);
6148 [(set_attr "type" "dyncall")
6149 (set (attr "length")
6151 ;; First FAST_INDIRECT_CALLS
6152 (ne (symbol_ref "TARGET_FAST_INDIRECT_CALLS")
6156 ;; Target (or stub) within reach
6157 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
6159 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
6164 (ne (symbol_ref "flag_pic")
6168 ;; Out of reach PORTABLE_RUNTIME
6169 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
6173 ;; Out of reach, can use ble
6176 (define_expand "call_value"
6177 [(parallel [(set (match_operand 0 "" "")
6178 (call (match_operand:SI 1 "" "")
6179 (match_operand 2 "" "")))
6180 (clobber (reg:SI 2))])]
6187 if (TARGET_PORTABLE_RUNTIME)
6188 op = force_reg (word_mode, XEXP (operands[1], 0));
6190 op = XEXP (operands[1], 0);
6193 emit_move_insn (arg_pointer_rtx,
6194 gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
6197 /* Use two different patterns for calls to explicitly named functions
6198 and calls through function pointers. This is necessary as these two
6199 types of calls use different calling conventions, and CSE might try
6200 to change the named call into an indirect call in some cases (using
6201 two patterns keeps CSE from performing this optimization). */
6202 if (GET_CODE (op) == SYMBOL_REF)
6203 call_insn = emit_call_insn (gen_call_value_internal_symref (operands[0],
6206 else if (TARGET_64BIT)
6208 rtx tmpreg = force_reg (word_mode, op);
6210 = emit_call_insn (gen_call_value_internal_reg_64bit (operands[0],
6216 rtx tmpreg = gen_rtx_REG (word_mode, 22);
6217 emit_move_insn (tmpreg, force_reg (word_mode, op));
6218 call_insn = emit_call_insn (gen_call_value_internal_reg (operands[0],
6223 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
6225 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
6227 /* After each call we must restore the PIC register, even if it
6228 doesn't appear to be used. */
6229 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
6234 (define_insn "call_value_internal_symref"
6235 [(set (match_operand 0 "" "=rf")
6236 (call (mem:SI (match_operand 1 "call_operand_address" ""))
6237 (match_operand 2 "" "i")))
6238 (clobber (reg:SI 2))
6239 (use (const_int 0))]
6240 ;;- Don't use operand 1 for most machines.
6241 "! TARGET_PORTABLE_RUNTIME"
6244 output_arg_descriptor (insn);
6245 return output_call (insn, operands[1], 0);
6247 [(set_attr "type" "call")
6248 (set (attr "length")
6249 ;; If we're sure that we can either reach the target or that the
6250 ;; linker can use a long-branch stub, then the length is at most
6253 ;; For long-calls the length will be at most 68 bytes (non-pic)
6254 ;; or 84 bytes (pic). */
6255 ;; Else we have to use a long-call;
6256 (if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
6259 (if_then_else (eq (symbol_ref "flag_pic")
6264 (define_insn "call_value_internal_reg_64bit"
6265 [(set (match_operand 0 "" "=rf")
6266 (call (mem:SI (match_operand:DI 1 "register_operand" "r"))
6267 (match_operand 2 "" "i")))
6268 (clobber (reg:SI 2))
6269 (use (const_int 1))]
6273 /* ??? Needs more work. Length computation, split into multiple insns,
6274 do not use %r22 directly, expose delay slot. */
6275 return \"ldd 16(%1),%%r2\;ldd 24(%1),%%r27\;bve,l (%%r2),%%r2\;nop\";
6277 [(set_attr "type" "dyncall")
6278 (set (attr "length") (const_int 16))])
6280 (define_insn "call_value_internal_reg"
6281 [(set (match_operand 0 "" "=rf")
6282 (call (mem:SI (reg:SI 22))
6283 (match_operand 1 "" "i")))
6284 (clobber (reg:SI 2))
6285 (use (const_int 1))]
6291 /* First the special case for kernels, level 0 systems, etc. */
6292 if (TARGET_FAST_INDIRECT_CALLS)
6293 return \"ble 0(%%sr4,%%r22)\;copy %%r31,%%r2\";
6295 /* Now the normal case -- we can reach $$dyncall directly or
6296 we're sure that we can get there via a long-branch stub.
6298 No need to check target flags as the length uniquely identifies
6299 the remaining cases. */
6300 if (get_attr_length (insn) == 8)
6301 return \".CALL\\tARGW0=GR\;{bl|b,l} $$dyncall,%%r31\;copy %%r31,%%r2\";
6303 /* Long millicode call, but we are not generating PIC or portable runtime
6305 if (get_attr_length (insn) == 12)
6306 return \".CALL\\tARGW0=GR\;ldil L%%$$dyncall,%%r2\;ble R%%$$dyncall(%%sr4,%%r2)\;copy %%r31,%%r2\";
6308 /* Long millicode call for portable runtime. */
6309 if (get_attr_length (insn) == 20)
6310 return \"ldil L%%$$dyncall,%%r31\;ldo R%%$$dyncall(%%r31),%%r31\;blr %%r0,%%r2\;bv,n %%r0(%%r31)\;nop\";
6312 /* If we're generating PIC code. */
6313 xoperands[0] = operands[1];
6314 if (TARGET_SOM || ! TARGET_GAS)
6315 xoperands[1] = gen_label_rtx ();
6316 output_asm_insn (\"{bl|b,l} .+8,%%r1\", xoperands);
6317 if (TARGET_SOM || ! TARGET_GAS)
6319 output_asm_insn (\"addil L%%$$dyncall-%1,%%r1\", xoperands);
6320 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\",
6321 CODE_LABEL_NUMBER (xoperands[1]));
6322 output_asm_insn (\"ldo R%%$$dyncall-%1(%%r1),%%r1\", xoperands);
6326 output_asm_insn (\"addil L%%$$dyncall-$PIC_pcrel$0+4,%%r1\", xoperands);
6327 output_asm_insn (\"ldo R%%$$dyncall-$PIC_pcrel$0+8(%%r1),%%r1\",
6330 output_asm_insn (\"blr %%r0,%%r2\", xoperands);
6331 output_asm_insn (\"bv,n %%r0(%%r1)\\n\\tnop\", xoperands);
6334 [(set_attr "type" "dyncall")
6335 (set (attr "length")
6337 ;; First FAST_INDIRECT_CALLS
6338 (ne (symbol_ref "TARGET_FAST_INDIRECT_CALLS")
6342 ;; Target (or stub) within reach
6343 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
6345 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
6350 (ne (symbol_ref "flag_pic")
6354 ;; Out of reach PORTABLE_RUNTIME
6355 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
6359 ;; Out of reach, can use ble
6362 ;; Call subroutine returning any type.
6364 (define_expand "untyped_call"
6365 [(parallel [(call (match_operand 0 "" "")
6367 (match_operand 1 "" "")
6368 (match_operand 2 "" "")])]
6374 emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
6376 for (i = 0; i < XVECLEN (operands[2], 0); i++)
6378 rtx set = XVECEXP (operands[2], 0, i);
6379 emit_move_insn (SET_DEST (set), SET_SRC (set));
6382 /* The optimizer does not know that the call sets the function value
6383 registers we stored in the result block. We avoid problems by
6384 claiming that all hard registers are used and clobbered at this
6386 emit_insn (gen_blockage ());
6391 (define_expand "sibcall"
6392 [(parallel [(call (match_operand:SI 0 "" "")
6393 (match_operand 1 "" ""))
6394 (clobber (reg:SI 0))])]
6395 "! TARGET_PORTABLE_RUNTIME"
6401 op = XEXP (operands[0], 0);
6403 /* We do not allow indirect sibling calls. */
6404 call_insn = emit_call_insn (gen_sibcall_internal_symref (op, operands[1]));
6408 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
6410 /* After each call we must restore the PIC register, even if it
6411 doesn't appear to be used. */
6412 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
6417 (define_insn "sibcall_internal_symref"
6418 [(call (mem:SI (match_operand 0 "call_operand_address" ""))
6419 (match_operand 1 "" "i"))
6420 (clobber (reg:SI 0))
6422 (use (const_int 0))]
6423 "! TARGET_PORTABLE_RUNTIME"
6426 output_arg_descriptor (insn);
6427 return output_call (insn, operands[0], 1);
6429 [(set_attr "type" "call")
6430 (set (attr "length")
6431 ;; If we're sure that we can either reach the target or that the
6432 ;; linker can use a long-branch stub, then the length is at most
6435 ;; For long-calls the length will be at most 68 bytes (non-pic)
6436 ;; or 84 bytes (pic). */
6437 ;; Else we have to use a long-call;
6438 (if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
6441 (if_then_else (eq (symbol_ref "flag_pic")
6446 (define_expand "sibcall_value"
6447 [(parallel [(set (match_operand 0 "" "")
6448 (call (match_operand:SI 1 "" "")
6449 (match_operand 2 "" "")))
6450 (clobber (reg:SI 0))])]
6451 "! TARGET_PORTABLE_RUNTIME"
6457 op = XEXP (operands[1], 0);
6459 /* We do not allow indirect sibling calls. */
6460 call_insn = emit_call_insn (gen_sibcall_value_internal_symref (operands[0],
6465 use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
6467 /* After each call we must restore the PIC register, even if it
6468 doesn't appear to be used. */
6469 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
6474 (define_insn "sibcall_value_internal_symref"
6475 [(set (match_operand 0 "" "=rf")
6476 (call (mem:SI (match_operand 1 "call_operand_address" ""))
6477 (match_operand 2 "" "i")))
6478 (clobber (reg:SI 0))
6480 (use (const_int 0))]
6481 ;;- Don't use operand 1 for most machines.
6482 "! TARGET_PORTABLE_RUNTIME"
6485 output_arg_descriptor (insn);
6486 return output_call (insn, operands[1], 1);
6488 [(set_attr "type" "call")
6489 (set (attr "length")
6490 ;; If we're sure that we can either reach the target or that the
6491 ;; linker can use a long-branch stub, then the length is at most
6494 ;; For long-calls the length will be at most 68 bytes (non-pic)
6495 ;; or 84 bytes (pic). */
6496 ;; Else we have to use a long-call;
6497 (if_then_else (lt (plus (symbol_ref "total_code_bytes") (pc))
6500 (if_then_else (eq (symbol_ref "flag_pic")
6509 [(set_attr "type" "move")
6510 (set_attr "length" "4")])
6512 ;; These are just placeholders so we know where branch tables
6514 (define_insn "begin_brtab"
6519 /* Only GAS actually supports this pseudo-op. */
6521 return \".begin_brtab\";
6525 [(set_attr "type" "move")
6526 (set_attr "length" "0")])
6528 (define_insn "end_brtab"
6533 /* Only GAS actually supports this pseudo-op. */
6535 return \".end_brtab\";
6539 [(set_attr "type" "move")
6540 (set_attr "length" "0")])
6542 ;;; EH does longjmp's from and within the data section. Thus,
6543 ;;; an interspace branch is required for the longjmp implementation.
6544 ;;; Registers r1 and r2 are used as scratch registers for the jump.
6545 (define_expand "interspace_jump"
6547 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
6548 (clobber (match_dup 1))])]
6552 operands[1] = gen_rtx_REG (word_mode, 2);
6556 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
6557 (clobber (reg:SI 2))]
6559 "ldsid (%%sr0,%0),%%r2\; mtsp %%r2,%%sr0\; be%* 0(%%sr0,%0)"
6560 [(set_attr "type" "branch")
6561 (set_attr "length" "12")])
6564 [(set (pc) (match_operand 0 "pmode_register_operand" "a"))
6565 (clobber (reg:DI 2))]
6567 "ldsid (%%sr0,%0),%%r2\; mtsp %%r2,%%sr0\; be%* 0(%%sr0,%0)"
6568 [(set_attr "type" "branch")
6569 (set_attr "length" "12")])
6571 (define_expand "builtin_longjmp"
6572 [(unspec_volatile [(match_operand 0 "register_operand" "r")] 3)]
6576 /* The elements of the buffer are, in order: */
6577 rtx fp = gen_rtx_MEM (Pmode, operands[0]);
6578 rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0],
6579 POINTER_SIZE / BITS_PER_UNIT));
6580 rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0],
6581 (POINTER_SIZE * 2) / BITS_PER_UNIT));
6582 rtx pv = gen_rtx_REG (Pmode, 1);
6584 /* This bit is the same as expand_builtin_longjmp. */
6585 emit_move_insn (hard_frame_pointer_rtx, fp);
6586 emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
6587 emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
6588 emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
6590 /* Load the label we are jumping through into r1 so that we know
6591 where to look for it when we get back to setjmp's function for
6592 restoring the gp. */
6593 emit_move_insn (pv, lab);
6595 /* Prevent the insns above from being scheduled into the delay slot
6596 of the interspace jump because the space register could change. */
6597 emit_insn (gen_blockage ());
6599 emit_jump_insn (gen_interspace_jump (pv));
6604 ;;; Hope this is only within a function...
6605 (define_insn "indirect_jump"
6606 [(set (pc) (match_operand 0 "register_operand" "r"))]
6607 "GET_MODE (operands[0]) == word_mode"
6609 [(set_attr "type" "branch")
6610 (set_attr "length" "4")])
6612 (define_expand "extzv"
6613 [(set (match_operand 0 "register_operand" "")
6614 (zero_extract (match_operand 1 "register_operand" "")
6615 (match_operand 2 "uint32_operand" "")
6616 (match_operand 3 "uint32_operand" "")))]
6621 emit_insn (gen_extzv_64 (operands[0], operands[1],
6622 operands[2], operands[3]));
6624 emit_insn (gen_extzv_32 (operands[0], operands[1],
6625 operands[2], operands[3]));
6629 (define_insn "extzv_32"
6630 [(set (match_operand:SI 0 "register_operand" "=r")
6631 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
6632 (match_operand:SI 2 "uint5_operand" "")
6633 (match_operand:SI 3 "uint5_operand" "")))]
6635 "{extru|extrw,u} %1,%3+%2-1,%2,%0"
6636 [(set_attr "type" "shift")
6637 (set_attr "length" "4")])
6640 [(set (match_operand:SI 0 "register_operand" "=r")
6641 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
6643 (match_operand:SI 2 "register_operand" "q")))]
6645 "{vextru %1,1,%0|extrw,u %1,%%sar,1,%0}"
6646 [(set_attr "type" "shift")
6647 (set_attr "length" "4")])
6649 (define_insn "extzv_64"
6650 [(set (match_operand:DI 0 "register_operand" "=r")
6651 (zero_extract:DI (match_operand:DI 1 "register_operand" "r")
6652 (match_operand:DI 2 "uint32_operand" "")
6653 (match_operand:DI 3 "uint32_operand" "")))]
6655 "extrd,u %1,%3+%2-1,%2,%0"
6656 [(set_attr "type" "shift")
6657 (set_attr "length" "4")])
6660 [(set (match_operand:DI 0 "register_operand" "=r")
6661 (zero_extract:DI (match_operand:DI 1 "register_operand" "r")
6663 (match_operand:DI 2 "register_operand" "q")))]
6665 "extrd,u %1,%%sar,1,%0"
6666 [(set_attr "type" "shift")
6667 (set_attr "length" "4")])
6669 (define_expand "extv"
6670 [(set (match_operand 0 "register_operand" "")
6671 (sign_extract (match_operand 1 "register_operand" "")
6672 (match_operand 2 "uint32_operand" "")
6673 (match_operand 3 "uint32_operand" "")))]
6678 emit_insn (gen_extv_64 (operands[0], operands[1],
6679 operands[2], operands[3]));
6682 if (! uint5_operand (operands[2], SImode)
6683 || ! uint5_operand (operands[3], SImode))
6685 emit_insn (gen_extv_32 (operands[0], operands[1],
6686 operands[2], operands[3]));
6691 (define_insn "extv_32"
6692 [(set (match_operand:SI 0 "register_operand" "=r")
6693 (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
6694 (match_operand:SI 2 "uint5_operand" "")
6695 (match_operand:SI 3 "uint5_operand" "")))]
6697 "{extrs|extrw,s} %1,%3+%2-1,%2,%0"
6698 [(set_attr "type" "shift")
6699 (set_attr "length" "4")])
6702 [(set (match_operand:SI 0 "register_operand" "=r")
6703 (sign_extract:SI (match_operand:SI 1 "register_operand" "r")
6705 (match_operand:SI 2 "register_operand" "q")))]
6707 "{vextrs %1,1,%0|extrw,s %1,%%sar,1,%0}"
6708 [(set_attr "type" "shift")
6709 (set_attr "length" "4")])
6711 (define_insn "extv_64"
6712 [(set (match_operand:DI 0 "register_operand" "=r")
6713 (sign_extract:DI (match_operand:DI 1 "register_operand" "r")
6714 (match_operand:DI 2 "uint32_operand" "")
6715 (match_operand:DI 3 "uint32_operand" "")))]
6717 "extrd,s %1,%3+%2-1,%2,%0"
6718 [(set_attr "type" "shift")
6719 (set_attr "length" "4")])
6722 [(set (match_operand:DI 0 "register_operand" "=r")
6723 (sign_extract:DI (match_operand:DI 1 "register_operand" "r")
6725 (match_operand:DI 2 "register_operand" "q")))]
6727 "extrd,s %1,%%sar,1,%0"
6728 [(set_attr "type" "shift")
6729 (set_attr "length" "4")])
6731 ;; Only specify the mode operands 0, the rest are assumed to be word_mode.
6732 (define_expand "insv"
6733 [(set (zero_extract (match_operand 0 "register_operand" "")
6734 (match_operand 1 "uint32_operand" "")
6735 (match_operand 2 "uint32_operand" ""))
6736 (match_operand 3 "arith5_operand" ""))]
6741 emit_insn (gen_insv_64 (operands[0], operands[1],
6742 operands[2], operands[3]));
6744 emit_insn (gen_insv_32 (operands[0], operands[1],
6745 operands[2], operands[3]));
6749 (define_insn "insv_32"
6750 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r,r")
6751 (match_operand:SI 1 "uint5_operand" "")
6752 (match_operand:SI 2 "uint5_operand" ""))
6753 (match_operand:SI 3 "arith5_operand" "r,L"))]
6756 {dep|depw} %3,%2+%1-1,%1,%0
6757 {depi|depwi} %3,%2+%1-1,%1,%0"
6758 [(set_attr "type" "shift,shift")
6759 (set_attr "length" "4,4")])
6761 ;; Optimize insertion of const_int values of type 1...1xxxx.
6763 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
6764 (match_operand:SI 1 "uint5_operand" "")
6765 (match_operand:SI 2 "uint5_operand" ""))
6766 (match_operand:SI 3 "const_int_operand" ""))]
6767 "(INTVAL (operands[3]) & 0x10) != 0 &&
6768 (~INTVAL (operands[3]) & ((1L << INTVAL (operands[1])) - 1) & ~0xf) == 0"
6771 operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
6772 return \"{depi|depwi} %3,%2+%1-1,%1,%0\";
6774 [(set_attr "type" "shift")
6775 (set_attr "length" "4")])
6777 (define_insn "insv_64"
6778 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r,r")
6779 (match_operand:DI 1 "uint32_operand" "")
6780 (match_operand:DI 2 "uint32_operand" ""))
6781 (match_operand:DI 3 "arith32_operand" "r,L"))]
6784 depd %3,%2+%1-1,%1,%0
6785 depdi %3,%2+%1-1,%1,%0"
6786 [(set_attr "type" "shift,shift")
6787 (set_attr "length" "4,4")])
6789 ;; Optimize insertion of const_int values of type 1...1xxxx.
6791 [(set (zero_extract:DI (match_operand:DI 0 "register_operand" "+r")
6792 (match_operand:DI 1 "uint32_operand" "")
6793 (match_operand:DI 2 "uint32_operand" ""))
6794 (match_operand:DI 3 "const_int_operand" ""))]
6795 "(INTVAL (operands[3]) & 0x10) != 0
6797 && (~INTVAL (operands[3]) & ((1L << INTVAL (operands[1])) - 1) & ~0xf) == 0"
6800 operands[3] = GEN_INT ((INTVAL (operands[3]) & 0xf) - 0x10);
6801 return \"depdi %3,%2+%1-1,%1,%0\";
6803 [(set_attr "type" "shift")
6804 (set_attr "length" "4")])
6807 [(set (match_operand:DI 0 "register_operand" "=r")
6808 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
6811 "depd,z %1,31,32,%0"
6812 [(set_attr "type" "shift")
6813 (set_attr "length" "4")])
6815 ;; This insn is used for some loop tests, typically loops reversed when
6816 ;; strength reduction is used. It is actually created when the instruction
6817 ;; combination phase combines the special loop test. Since this insn
6818 ;; is both a jump insn and has an output, it must deal with its own
6819 ;; reloads, hence the `m' constraints. The `!' constraints direct reload
6820 ;; to not choose the register alternatives in the event a reload is needed.
6821 (define_insn "decrement_and_branch_until_zero"
6824 (match_operator 2 "comparison_operator"
6826 (match_operand:SI 0 "reg_before_reload_operand" "+!r,!*f,*m")
6827 (match_operand:SI 1 "int5_operand" "L,L,L"))
6829 (label_ref (match_operand 3 "" ""))
6832 (plus:SI (match_dup 0) (match_dup 1)))
6833 (clobber (match_scratch:SI 4 "=X,r,r"))]
6835 "* return output_dbra (operands, insn, which_alternative); "
6836 ;; Do not expect to understand this the first time through.
6837 [(set_attr "type" "cbranch,multi,multi")
6838 (set (attr "length")
6839 (if_then_else (eq_attr "alternative" "0")
6840 ;; Loop counter in register case
6841 ;; Short branch has length of 4
6842 ;; Long branch has length of 8
6843 (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6848 ;; Loop counter in FP reg case.
6849 ;; Extra goo to deal with additional reload insns.
6850 (if_then_else (eq_attr "alternative" "1")
6851 (if_then_else (lt (match_dup 3) (pc))
6853 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 24))))
6858 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6862 ;; Loop counter in memory case.
6863 ;; Extra goo to deal with additional reload insns.
6864 (if_then_else (lt (match_dup 3) (pc))
6866 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
6871 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6874 (const_int 16))))))])
6879 (match_operator 2 "movb_comparison_operator"
6880 [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
6881 (label_ref (match_operand 3 "" ""))
6883 (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q")
6886 "* return output_movb (operands, insn, which_alternative, 0); "
6887 ;; Do not expect to understand this the first time through.
6888 [(set_attr "type" "cbranch,multi,multi,multi")
6889 (set (attr "length")
6890 (if_then_else (eq_attr "alternative" "0")
6891 ;; Loop counter in register case
6892 ;; Short branch has length of 4
6893 ;; Long branch has length of 8
6894 (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6899 ;; Loop counter in FP reg case.
6900 ;; Extra goo to deal with additional reload insns.
6901 (if_then_else (eq_attr "alternative" "1")
6902 (if_then_else (lt (match_dup 3) (pc))
6904 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
6909 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6913 ;; Loop counter in memory or sar case.
6914 ;; Extra goo to deal with additional reload insns.
6916 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6919 (const_int 12)))))])
6921 ;; Handle negated branch.
6925 (match_operator 2 "movb_comparison_operator"
6926 [(match_operand:SI 1 "register_operand" "r,r,r,r") (const_int 0)])
6928 (label_ref (match_operand 3 "" ""))))
6929 (set (match_operand:SI 0 "reg_before_reload_operand" "=!r,!*f,*m,!*q")
6932 "* return output_movb (operands, insn, which_alternative, 1); "
6933 ;; Do not expect to understand this the first time through.
6934 [(set_attr "type" "cbranch,multi,multi,multi")
6935 (set (attr "length")
6936 (if_then_else (eq_attr "alternative" "0")
6937 ;; Loop counter in register case
6938 ;; Short branch has length of 4
6939 ;; Long branch has length of 8
6940 (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6945 ;; Loop counter in FP reg case.
6946 ;; Extra goo to deal with additional reload insns.
6947 (if_then_else (eq_attr "alternative" "1")
6948 (if_then_else (lt (match_dup 3) (pc))
6950 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 12))))
6955 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6959 ;; Loop counter in memory or SAR case.
6960 ;; Extra goo to deal with additional reload insns.
6962 (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6965 (const_int 12)))))])
6968 [(set (pc) (label_ref (match_operand 3 "" "" )))
6969 (set (match_operand:SI 0 "ireg_operand" "=r")
6970 (plus:SI (match_operand:SI 1 "ireg_operand" "r")
6971 (match_operand:SI 2 "ireg_or_int5_operand" "rL")))]
6972 "(reload_completed && operands[0] == operands[1]) || operands[0] == operands[2]"
6975 return output_parallel_addb (operands, get_attr_length (insn));
6977 [(set_attr "type" "parallel_branch")
6978 (set (attr "length")
6979 (if_then_else (lt (abs (minus (match_dup 3) (plus (pc) (const_int 8))))
6985 [(set (pc) (label_ref (match_operand 2 "" "" )))
6986 (set (match_operand:SF 0 "ireg_operand" "=r")
6987 (match_operand:SF 1 "ireg_or_int5_operand" "rL"))]
6991 return output_parallel_movb (operands, get_attr_length (insn));
6993 [(set_attr "type" "parallel_branch")
6994 (set (attr "length")
6995 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
7001 [(set (pc) (label_ref (match_operand 2 "" "" )))
7002 (set (match_operand:SI 0 "ireg_operand" "=r")
7003 (match_operand:SI 1 "ireg_or_int5_operand" "rL"))]
7007 return output_parallel_movb (operands, get_attr_length (insn));
7009 [(set_attr "type" "parallel_branch")
7010 (set (attr "length")
7011 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
7017 [(set (pc) (label_ref (match_operand 2 "" "" )))
7018 (set (match_operand:HI 0 "ireg_operand" "=r")
7019 (match_operand:HI 1 "ireg_or_int5_operand" "rL"))]
7023 return output_parallel_movb (operands, get_attr_length (insn));
7025 [(set_attr "type" "parallel_branch")
7026 (set (attr "length")
7027 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
7033 [(set (pc) (label_ref (match_operand 2 "" "" )))
7034 (set (match_operand:QI 0 "ireg_operand" "=r")
7035 (match_operand:QI 1 "ireg_or_int5_operand" "rL"))]
7039 return output_parallel_movb (operands, get_attr_length (insn));
7041 [(set_attr "type" "parallel_branch")
7042 (set (attr "length")
7043 (if_then_else (lt (abs (minus (match_dup 2) (plus (pc) (const_int 8))))
7049 [(set (match_operand 0 "register_operand" "=f")
7050 (mult (match_operand 1 "register_operand" "f")
7051 (match_operand 2 "register_operand" "f")))
7052 (set (match_operand 3 "register_operand" "+f")
7053 (plus (match_operand 4 "register_operand" "f")
7054 (match_operand 5 "register_operand" "f")))]
7055 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
7056 && reload_completed && fmpyaddoperands (operands)"
7059 if (GET_MODE (operands[0]) == DFmode)
7061 if (rtx_equal_p (operands[3], operands[5]))
7062 return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
7064 return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
7068 if (rtx_equal_p (operands[3], operands[5]))
7069 return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
7071 return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
7074 [(set_attr "type" "fpalu")
7075 (set_attr "length" "4")])
7078 [(set (match_operand 3 "register_operand" "+f")
7079 (plus (match_operand 4 "register_operand" "f")
7080 (match_operand 5 "register_operand" "f")))
7081 (set (match_operand 0 "register_operand" "=f")
7082 (mult (match_operand 1 "register_operand" "f")
7083 (match_operand 2 "register_operand" "f")))]
7084 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
7085 && reload_completed && fmpyaddoperands (operands)"
7088 if (GET_MODE (operands[0]) == DFmode)
7090 if (rtx_equal_p (operands[3], operands[5]))
7091 return \"fmpyadd,dbl %1,%2,%0,%4,%3\";
7093 return \"fmpyadd,dbl %1,%2,%0,%5,%3\";
7097 if (rtx_equal_p (operands[3], operands[5]))
7098 return \"fmpyadd,sgl %1,%2,%0,%4,%3\";
7100 return \"fmpyadd,sgl %1,%2,%0,%5,%3\";
7103 [(set_attr "type" "fpalu")
7104 (set_attr "length" "4")])
7107 [(set (match_operand 0 "register_operand" "=f")
7108 (mult (match_operand 1 "register_operand" "f")
7109 (match_operand 2 "register_operand" "f")))
7110 (set (match_operand 3 "register_operand" "+f")
7111 (minus (match_operand 4 "register_operand" "f")
7112 (match_operand 5 "register_operand" "f")))]
7113 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
7114 && reload_completed && fmpysuboperands (operands)"
7117 if (GET_MODE (operands[0]) == DFmode)
7118 return \"fmpysub,dbl %1,%2,%0,%5,%3\";
7120 return \"fmpysub,sgl %1,%2,%0,%5,%3\";
7122 [(set_attr "type" "fpalu")
7123 (set_attr "length" "4")])
7126 [(set (match_operand 3 "register_operand" "+f")
7127 (minus (match_operand 4 "register_operand" "f")
7128 (match_operand 5 "register_operand" "f")))
7129 (set (match_operand 0 "register_operand" "=f")
7130 (mult (match_operand 1 "register_operand" "f")
7131 (match_operand 2 "register_operand" "f")))]
7132 "TARGET_PA_11 && ! TARGET_SOFT_FLOAT
7133 && reload_completed && fmpysuboperands (operands)"
7136 if (GET_MODE (operands[0]) == DFmode)
7137 return \"fmpysub,dbl %1,%2,%0,%5,%3\";
7139 return \"fmpysub,sgl %1,%2,%0,%5,%3\";
7141 [(set_attr "type" "fpalu")
7142 (set_attr "length" "4")])
7144 ;; Clean up turds left by reload.
7146 [(set (match_operand 0 "reg_or_nonsymb_mem_operand" "")
7147 (match_operand 1 "register_operand" "fr"))
7148 (set (match_operand 2 "register_operand" "fr")
7150 "! TARGET_SOFT_FLOAT
7151 && GET_CODE (operands[0]) == MEM
7152 && ! MEM_VOLATILE_P (operands[0])
7153 && GET_MODE (operands[0]) == GET_MODE (operands[1])
7154 && GET_MODE (operands[0]) == GET_MODE (operands[2])
7155 && GET_MODE (operands[0]) == DFmode
7156 && GET_CODE (operands[1]) == REG
7157 && GET_CODE (operands[2]) == REG
7158 && ! side_effects_p (XEXP (operands[0], 0))
7159 && REGNO_REG_CLASS (REGNO (operands[1]))
7160 == REGNO_REG_CLASS (REGNO (operands[2]))"
7165 if (FP_REG_P (operands[1]))
7166 output_asm_insn (output_fp_move_double (operands), operands);
7168 output_asm_insn (output_move_double (operands), operands);
7170 if (rtx_equal_p (operands[1], operands[2]))
7173 xoperands[0] = operands[2];
7174 xoperands[1] = operands[1];
7176 if (FP_REG_P (xoperands[1]))
7177 output_asm_insn (output_fp_move_double (xoperands), xoperands);
7179 output_asm_insn (output_move_double (xoperands), xoperands);
7185 [(set (match_operand 0 "register_operand" "fr")
7186 (match_operand 1 "reg_or_nonsymb_mem_operand" ""))
7187 (set (match_operand 2 "register_operand" "fr")
7189 "! TARGET_SOFT_FLOAT
7190 && GET_CODE (operands[1]) == MEM
7191 && ! MEM_VOLATILE_P (operands[1])
7192 && GET_MODE (operands[0]) == GET_MODE (operands[1])
7193 && GET_MODE (operands[0]) == GET_MODE (operands[2])
7194 && GET_MODE (operands[0]) == DFmode
7195 && GET_CODE (operands[0]) == REG
7196 && GET_CODE (operands[2]) == REG
7197 && ! side_effects_p (XEXP (operands[1], 0))
7198 && REGNO_REG_CLASS (REGNO (operands[0]))
7199 == REGNO_REG_CLASS (REGNO (operands[2]))"
7204 if (FP_REG_P (operands[0]))
7205 output_asm_insn (output_fp_move_double (operands), operands);
7207 output_asm_insn (output_move_double (operands), operands);
7209 xoperands[0] = operands[2];
7210 xoperands[1] = operands[0];
7212 if (FP_REG_P (xoperands[1]))
7213 output_asm_insn (output_fp_move_double (xoperands), xoperands);
7215 output_asm_insn (output_move_double (xoperands), xoperands);
7220 ;; Flush the I and D cache line found at the address in operand 0.
7221 ;; This is used by the trampoline code for nested functions.
7222 ;; So long as the trampoline itself is less than 32 bytes this
7225 (define_insn "dcacheflush"
7226 [(unspec_volatile [(const_int 1)] 0)
7227 (use (mem:SI (match_operand 0 "pmode_register_operand" "r")))
7228 (use (mem:SI (match_operand 1 "pmode_register_operand" "r")))]
7230 "fdc 0(%0)\;fdc 0(%1)\;sync"
7231 [(set_attr "type" "multi")
7232 (set_attr "length" "12")])
7234 (define_insn "icacheflush"
7235 [(unspec_volatile [(const_int 2)] 0)
7236 (use (mem:SI (match_operand 0 "pmode_register_operand" "r")))
7237 (use (mem:SI (match_operand 1 "pmode_register_operand" "r")))
7238 (use (match_operand 2 "pmode_register_operand" "r"))
7239 (clobber (match_operand 3 "pmode_register_operand" "=&r"))
7240 (clobber (match_operand 4 "pmode_register_operand" "=&r"))]
7242 "mfsp %%sr0,%4\;ldsid (%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop"
7243 [(set_attr "type" "multi")
7244 (set_attr "length" "52")])
7246 ;; An out-of-line prologue.
7247 (define_insn "outline_prologue_call"
7248 [(unspec_volatile [(const_int 0)] 0)
7249 (clobber (reg:SI 31))
7250 (clobber (reg:SI 22))
7251 (clobber (reg:SI 21))
7252 (clobber (reg:SI 20))
7253 (clobber (reg:SI 19))
7254 (clobber (reg:SI 1))]
7258 extern int frame_pointer_needed;
7260 /* We need two different versions depending on whether or not we
7261 need a frame pointer. Also note that we return to the instruction
7262 immediately after the branch rather than two instructions after the
7263 break as normally is the case. */
7264 if (frame_pointer_needed)
7266 /* Must import the magic millicode routine(s). */
7267 output_asm_insn (\".IMPORT __outline_prologue_fp,MILLICODE\", NULL);
7269 if (TARGET_PORTABLE_RUNTIME)
7271 output_asm_insn (\"ldil L'__outline_prologue_fp,%%r31\", NULL);
7272 output_asm_insn (\"ble,n R'__outline_prologue_fp(%%sr0,%%r31)\",
7276 output_asm_insn (\"{bl|b,l},n __outline_prologue_fp,%%r31\", NULL);
7280 /* Must import the magic millicode routine(s). */
7281 output_asm_insn (\".IMPORT __outline_prologue,MILLICODE\", NULL);
7283 if (TARGET_PORTABLE_RUNTIME)
7285 output_asm_insn (\"ldil L'__outline_prologue,%%r31\", NULL);
7286 output_asm_insn (\"ble,n R'__outline_prologue(%%sr0,%%r31)\", NULL);
7289 output_asm_insn (\"{bl|b,l},n __outline_prologue,%%r31\", NULL);
7293 [(set_attr "type" "multi")
7294 (set_attr "length" "8")])
7296 ;; An out-of-line epilogue.
7297 (define_insn "outline_epilogue_call"
7298 [(unspec_volatile [(const_int 1)] 0)
7301 (clobber (reg:SI 31))
7302 (clobber (reg:SI 22))
7303 (clobber (reg:SI 21))
7304 (clobber (reg:SI 20))
7305 (clobber (reg:SI 19))
7306 (clobber (reg:SI 2))
7307 (clobber (reg:SI 1))]
7311 extern int frame_pointer_needed;
7313 /* We need two different versions depending on whether or not we
7314 need a frame pointer. Also note that we return to the instruction
7315 immediately after the branch rather than two instructions after the
7316 break as normally is the case. */
7317 if (frame_pointer_needed)
7319 /* Must import the magic millicode routine. */
7320 output_asm_insn (\".IMPORT __outline_epilogue_fp,MILLICODE\", NULL);
7322 /* The out-of-line prologue will make sure we return to the right
7324 if (TARGET_PORTABLE_RUNTIME)
7326 output_asm_insn (\"ldil L'__outline_epilogue_fp,%%r31\", NULL);
7327 output_asm_insn (\"ble,n R'__outline_epilogue_fp(%%sr0,%%r31)\",
7331 output_asm_insn (\"{bl|b,l},n __outline_epilogue_fp,%%r31\", NULL);
7335 /* Must import the magic millicode routine. */
7336 output_asm_insn (\".IMPORT __outline_epilogue,MILLICODE\", NULL);
7338 /* The out-of-line prologue will make sure we return to the right
7340 if (TARGET_PORTABLE_RUNTIME)
7342 output_asm_insn (\"ldil L'__outline_epilogue,%%r31\", NULL);
7343 output_asm_insn (\"ble,n R'__outline_epilogue(%%sr0,%%r31)\", NULL);
7346 output_asm_insn (\"{bl|b,l},n __outline_epilogue,%%r31\", NULL);
7350 [(set_attr "type" "multi")
7351 (set_attr "length" "8")])
7353 ;; Given a function pointer, canonicalize it so it can be
7354 ;; reliably compared to another function pointer. */
7355 (define_expand "canonicalize_funcptr_for_compare"
7356 [(set (reg:SI 26) (match_operand:SI 1 "register_operand" ""))
7357 (parallel [(set (reg:SI 29) (unspec:SI [(reg:SI 26)] 0))
7358 (clobber (match_dup 2))
7359 (clobber (reg:SI 26))
7360 (clobber (reg:SI 22))
7361 (clobber (reg:SI 31))])
7362 (set (match_operand:SI 0 "register_operand" "")
7364 "! TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && !TARGET_ELF32"
7367 operands[2] = gen_reg_rtx (SImode);
7368 if (GET_CODE (operands[1]) != REG)
7370 rtx tmp = gen_reg_rtx (Pmode);
7371 emit_move_insn (tmp, operands[1]);
7377 [(set (reg:SI 29) (unspec:SI [(reg:SI 26)] 0))
7378 (clobber (match_operand:SI 0 "register_operand" "=a"))
7379 (clobber (reg:SI 26))
7380 (clobber (reg:SI 22))
7381 (clobber (reg:SI 31))]
7385 /* Must import the magic millicode routine. */
7386 output_asm_insn (\".IMPORT $$sh_func_adrs,MILLICODE\", NULL);
7388 /* This is absolutely amazing.
7390 First, copy our input parameter into %r29 just in case we don't
7391 need to call $$sh_func_adrs. */
7392 output_asm_insn (\"copy %%r26,%%r29\", NULL);
7394 /* Next, examine the low two bits in %r26, if they aren't 0x2, then
7395 we use %r26 unchanged. */
7396 if (get_attr_length (insn) == 32)
7397 output_asm_insn (\"{extru|extrw,u} %%r26,31,2,%%r31\;{comib|cmpib},<>,n 2,%%r31,.+24\", NULL);
7398 else if (get_attr_length (insn) == 40)
7399 output_asm_insn (\"{extru|extrw,u} %%r26,31,2,%%r31\;{comib|cmpib},<>,n 2,%%r31,.+32\", NULL);
7400 else if (get_attr_length (insn) == 44)
7401 output_asm_insn (\"{extru|extrw,u} %%r26,31,2,%%r31\;{comib|cmpib},<>,n 2,%%r31,.+36\", NULL);
7403 output_asm_insn (\"{extru|extrw,u} %%r26,31,2,%%r31\;{comib|cmpib},<>,n 2,%%r31,.+20\", NULL);
7405 /* Next, compare %r26 with 4096, if %r26 is less than or equal to
7406 4096, then we use %r26 unchanged. */
7407 if (get_attr_length (insn) == 32)
7408 output_asm_insn (\"ldi 4096,%%r31\;{comb|cmpb},<<,n %%r26,%%r31,.+16\",
7410 else if (get_attr_length (insn) == 40)
7411 output_asm_insn (\"ldi 4096,%%r31\;{comb|cmpb},<<,n %%r26,%%r31,.+24\",
7413 else if (get_attr_length (insn) == 44)
7414 output_asm_insn (\"ldi 4096,%%r31\;{comb|cmpb},<<,n %%r26,%%r31,.+28\",
7417 output_asm_insn (\"ldi 4096,%%r31\;{comb|cmpb},<<,n %%r26,%%r31,.+12\",
7420 /* Else call $$sh_func_adrs to extract the function's real add24. */
7421 return output_millicode_call (insn,
7422 gen_rtx_SYMBOL_REF (SImode,
7423 \"$$sh_func_adrs\"));
7425 [(set_attr "type" "multi")
7426 (set (attr "length")
7428 ;; Target (or stub) within reach
7429 (and (lt (plus (symbol_ref "total_code_bytes") (pc))
7431 (eq (symbol_ref "TARGET_PORTABLE_RUNTIME")
7436 (ne (symbol_ref "flag_pic")
7440 ;; Out of reach PORTABLE_RUNTIME
7441 (ne (symbol_ref "TARGET_PORTABLE_RUNTIME")
7445 ;; Out of reach, can use ble
7448 ;; On the PA, the PIC register is call clobbered, so it must
7449 ;; be saved & restored around calls by the caller. If the call
7450 ;; doesn't return normally (nonlocal goto, or an exception is
7451 ;; thrown), then the code at the exception handler label must
7452 ;; restore the PIC register.
7453 (define_expand "exception_receiver"
7458 /* On the 64-bit port, we need a blockage because there is
7459 confusion regarding the dependence of the restore on the
7460 frame pointer. As a result, the frame pointer and pic
7461 register restores sometimes are interchanged erroneously. */
7463 emit_insn (gen_blockage ());
7464 /* Restore the PIC register using hppa_pic_save_rtx (). The
7465 PIC register is not saved in the frame in 64-bit ABI. */
7466 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
7470 (define_expand "builtin_setjmp_receiver"
7471 [(label_ref (match_operand 0 "" ""))]
7476 emit_insn (gen_blockage ());
7477 /* Restore the PIC register. Hopefully, this will always be from
7478 a stack slot. The only registers that are valid after a
7479 builtin_longjmp are the stack and frame pointers. */
7480 emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());