1 ;; Machine description for DEC Alpha for GNU C compiler
2 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 ;; 2000, 2001 Free Software Foundation, Inc.
4 ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
23 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
25 ;; Uses of UNSPEC in this file:
41 (UNSPECV_SETJMPR 2) ; builtin_setjmp_receiver
42 (UNSPECV_LONGJMP 3) ; builtin_longjmp
44 (UNSPECV_PSPL 5) ; prologue_stack_probe_loop
46 (UNSPECV_EHR 7) ; exception_receiver
50 (UNSPECV_FORCE_MOV 11)
53 ;; Processor type -- this attribute must exactly match the processor_type
54 ;; enumeration in alpha.h.
56 (define_attr "cpu" "ev4,ev5,ev6"
57 (const (symbol_ref "alpha_cpu")))
59 ;; Define an insn type attribute. This is used in function unit delay
60 ;; computations, among other purposes. For the most part, we use the names
61 ;; defined in the EV4 documentation, but add a few that we have to know about
65 "ild,fld,ldsym,ist,fst,ibr,fbr,jsr,iadd,ilog,shift,icmov,fcmov,icmp,imul,\
66 fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi"
67 (const_string "iadd"))
69 ;; Describe a user's asm statement.
70 (define_asm_attributes
71 [(set_attr "type" "multi")])
73 ;; Define the operand size an insn operates on. Used primarily by mul
74 ;; and div operations that have size dependant timings.
76 (define_attr "opsize" "si,di,udi"
79 ;; The TRAP attribute marks instructions that may generate traps
80 ;; (which are imprecise and may need a trapb if software completion
83 (define_attr "trap" "no,yes"
86 ;; The ROUND_SUFFIX attribute marks which instructions require a
87 ;; rounding-mode suffix. The value NONE indicates no suffix,
88 ;; the value NORMAL indicates a suffix controled by alpha_fprm.
90 (define_attr "round_suffix" "none,normal,c"
91 (const_string "none"))
93 ;; The TRAP_SUFFIX attribute marks instructions requiring a trap-mode suffix:
95 ;; SU accepts only /su (cmpt et al)
96 ;; SUI accepts only /sui (cvtqt and cvtqs)
97 ;; V_SV accepts /v and /sv (cvtql only)
98 ;; V_SV_SVI accepts /v, /sv and /svi (cvttq only)
99 ;; U_SU_SUI accepts /u, /su and /sui (most fp instructions)
101 ;; The actual suffix emitted is controled by alpha_fptm.
103 (define_attr "trap_suffix" "none,su,sui,v_sv,v_sv_svi,u_su_sui"
104 (const_string "none"))
106 ;; The length of an instruction sequence in bytes.
108 (define_attr "length" ""
111 ;; On EV4 there are two classes of resources to consider: resources needed
112 ;; to issue, and resources needed to execute. IBUS[01] are in the first
113 ;; category. ABOX, BBOX, EBOX, FBOX, IMUL & FDIV make up the second.
114 ;; (There are a few other register-like resources, but ...)
116 ; First, describe all of the issue constraints with single cycle delays.
117 ; All insns need a bus, but all except loads require one or the other.
118 (define_function_unit "ev4_ibus0" 1 0
119 (and (eq_attr "cpu" "ev4")
120 (eq_attr "type" "fst,fbr,iadd,imul,ilog,shift,icmov,icmp"))
123 (define_function_unit "ev4_ibus1" 1 0
124 (and (eq_attr "cpu" "ev4")
125 (eq_attr "type" "ist,ibr,jsr,fadd,fcmov,fcpys,fmul,fdiv,misc"))
128 ; Memory delivers its result in three cycles. Actually return one and
129 ; take care of this in adjust_cost, since we want to handle user-defined
131 (define_function_unit "ev4_abox" 1 0
132 (and (eq_attr "cpu" "ev4")
133 (eq_attr "type" "ild,fld,ldsym,ist,fst"))
136 ; Branches have no delay cost, but do tie up the unit for two cycles.
137 (define_function_unit "ev4_bbox" 1 1
138 (and (eq_attr "cpu" "ev4")
139 (eq_attr "type" "ibr,fbr,jsr"))
142 ; Arithmetic insns are normally have their results available after
143 ; two cycles. There are a number of exceptions. They are encoded in
144 ; ADJUST_COST. Some of the other insns have similar exceptions.
145 (define_function_unit "ev4_ebox" 1 0
146 (and (eq_attr "cpu" "ev4")
147 (eq_attr "type" "iadd,ilog,shift,icmov,icmp,misc"))
150 (define_function_unit "imul" 1 0
151 (and (eq_attr "cpu" "ev4")
152 (and (eq_attr "type" "imul")
153 (eq_attr "opsize" "si")))
156 (define_function_unit "imul" 1 0
157 (and (eq_attr "cpu" "ev4")
158 (and (eq_attr "type" "imul")
159 (eq_attr "opsize" "!si")))
162 (define_function_unit "ev4_fbox" 1 0
163 (and (eq_attr "cpu" "ev4")
164 (eq_attr "type" "fadd,fmul,fcpys,fcmov"))
167 (define_function_unit "fdiv" 1 0
168 (and (eq_attr "cpu" "ev4")
169 (and (eq_attr "type" "fdiv")
170 (eq_attr "opsize" "si")))
173 (define_function_unit "fdiv" 1 0
174 (and (eq_attr "cpu" "ev4")
175 (and (eq_attr "type" "fdiv")
176 (eq_attr "opsize" "di")))
179 ;; EV5 scheduling. EV5 can issue 4 insns per clock.
181 ;; EV5 has two asymetric integer units. Model this with E0 & E1 along
182 ;; with the combined resource EBOX.
184 (define_function_unit "ev5_ebox" 2 0
185 (and (eq_attr "cpu" "ev5")
186 (eq_attr "type" "!fbr,fcmov,fadd,fmul,fcpys,fdiv"))
189 ; Memory takes at least 2 clocks. Return one from here and fix up with
190 ; user-defined latencies in adjust_cost.
191 (define_function_unit "ev5_ebox" 2 0
192 (and (eq_attr "cpu" "ev5")
193 (eq_attr "type" "ild,fld,ldsym"))
196 ; Loads can dual issue with one another, but loads and stores do not mix.
197 (define_function_unit "ev5_e0" 1 0
198 (and (eq_attr "cpu" "ev5")
199 (eq_attr "type" "ild,fld,ldsym"))
201 [(eq_attr "type" "ist,fst")])
203 ; Stores, shifts, multiplies can only issue to E0
204 (define_function_unit "ev5_e0" 1 0
205 (and (eq_attr "cpu" "ev5")
206 (eq_attr "type" "ist,fst,shift,imul"))
209 ; Motion video insns also issue only to E0, and take two ticks.
210 (define_function_unit "ev5_e0" 1 0
211 (and (eq_attr "cpu" "ev5")
212 (eq_attr "type" "mvi"))
215 ; Conditional moves always take 2 ticks.
216 (define_function_unit "ev5_ebox" 2 0
217 (and (eq_attr "cpu" "ev5")
218 (eq_attr "type" "icmov"))
221 ; Branches can only issue to E1
222 (define_function_unit "ev5_e1" 1 0
223 (and (eq_attr "cpu" "ev5")
224 (eq_attr "type" "ibr,jsr"))
227 ; Multiplies also use the integer multiplier.
228 ; ??? How to: "No instruction can be issued to pipe E0 exactly two
229 ; cycles before an integer multiplication completes."
230 (define_function_unit "imul" 1 0
231 (and (eq_attr "cpu" "ev5")
232 (and (eq_attr "type" "imul")
233 (eq_attr "opsize" "si")))
236 (define_function_unit "imul" 1 0
237 (and (eq_attr "cpu" "ev5")
238 (and (eq_attr "type" "imul")
239 (eq_attr "opsize" "di")))
242 (define_function_unit "imul" 1 0
243 (and (eq_attr "cpu" "ev5")
244 (and (eq_attr "type" "imul")
245 (eq_attr "opsize" "udi")))
248 ;; Similarly for the FPU we have two asymetric units. But fcpys can issue
249 ;; on either so we have to play the game again.
251 (define_function_unit "ev5_fbox" 2 0
252 (and (eq_attr "cpu" "ev5")
253 (eq_attr "type" "fadd,fcmov,fmul,fcpys,fbr,fdiv"))
256 (define_function_unit "ev5_fm" 1 0
257 (and (eq_attr "cpu" "ev5")
258 (eq_attr "type" "fmul"))
261 ; Add and cmov as you would expect; fbr never produces a result;
262 ; fdiv issues through fa to the divider,
263 (define_function_unit "ev5_fa" 1 0
264 (and (eq_attr "cpu" "ev5")
265 (eq_attr "type" "fadd,fcmov,fbr,fdiv"))
268 ; ??? How to: "No instruction can be issued to pipe FA exactly five
269 ; cycles before a floating point divide completes."
270 (define_function_unit "fdiv" 1 0
271 (and (eq_attr "cpu" "ev5")
272 (and (eq_attr "type" "fdiv")
273 (eq_attr "opsize" "si")))
274 15 15) ; 15 to 31 data dependant
276 (define_function_unit "fdiv" 1 0
277 (and (eq_attr "cpu" "ev5")
278 (and (eq_attr "type" "fdiv")
279 (eq_attr "opsize" "di")))
280 22 22) ; 22 to 60 data dependant
282 ;; EV6 scheduling. EV6 can issue 4 insns per clock.
284 ;; EV6 has two symmetric pairs ("clusters") of two asymetric integer units
285 ;; ("upper" and "lower"), yielding pipe names U0, U1, L0, L1.
287 ;; Conditional moves decompose into two independant primitives, each
288 ;; taking one cycle. Since ev6 is out-of-order, we can't see anything
290 (define_function_unit "ev6_ebox" 4 0
291 (and (eq_attr "cpu" "ev6")
292 (eq_attr "type" "icmov"))
295 (define_function_unit "ev6_ebox" 4 0
296 (and (eq_attr "cpu" "ev6")
297 (eq_attr "type" "!fbr,fcmov,fadd,fmul,fcpys,fdiv,fsqrt"))
300 ;; Integer loads take at least 3 clocks, and only issue to lower units.
301 ;; Return one from here and fix up with user-defined latencies in adjust_cost.
302 (define_function_unit "ev6_l" 2 0
303 (and (eq_attr "cpu" "ev6")
304 (eq_attr "type" "ild,ldsym,ist,fst"))
307 ;; FP loads take at least 4 clocks. Return two from here...
308 (define_function_unit "ev6_l" 2 0
309 (and (eq_attr "cpu" "ev6")
310 (eq_attr "type" "fld"))
313 ;; Motion video insns also issue only to U0, and take three ticks.
314 (define_function_unit "ev6_u0" 1 0
315 (and (eq_attr "cpu" "ev6")
316 (eq_attr "type" "mvi"))
319 (define_function_unit "ev6_u" 2 0
320 (and (eq_attr "cpu" "ev6")
321 (eq_attr "type" "mvi"))
324 ;; Shifts issue to either upper pipe.
325 (define_function_unit "ev6_u" 2 0
326 (and (eq_attr "cpu" "ev6")
327 (eq_attr "type" "shift"))
330 ;; Multiplies issue only to U1, and all take 7 ticks.
331 ;; Rather than create a new function unit just for U1, reuse IMUL
332 (define_function_unit "imul" 1 0
333 (and (eq_attr "cpu" "ev6")
334 (eq_attr "type" "imul"))
337 (define_function_unit "ev6_u" 2 0
338 (and (eq_attr "cpu" "ev6")
339 (eq_attr "type" "imul"))
342 ;; Branches issue to either upper pipe
343 (define_function_unit "ev6_u" 2 0
344 (and (eq_attr "cpu" "ev6")
345 (eq_attr "type" "ibr"))
348 ;; Calls only issue to L0.
349 (define_function_unit "ev6_l0" 1 0
350 (and (eq_attr "cpu" "ev6")
351 (eq_attr "type" "jsr"))
354 (define_function_unit "ev6_l" 2 0
355 (and (eq_attr "cpu" "ev6")
356 (eq_attr "type" "jsr"))
359 ;; Ftoi/itof only issue to lower pipes
360 (define_function_unit "ev6_l" 2 0
361 (and (eq_attr "cpu" "ev6")
362 (eq_attr "type" "ftoi"))
365 (define_function_unit "ev6_l" 2 0
366 (and (eq_attr "cpu" "ev6")
367 (eq_attr "type" "itof"))
370 ;; For the FPU we are very similar to EV5, except there's no insn that
371 ;; can issue to fm & fa, so we get to leave that out.
373 (define_function_unit "ev6_fm" 1 0
374 (and (eq_attr "cpu" "ev6")
375 (eq_attr "type" "fmul"))
378 (define_function_unit "ev6_fa" 1 0
379 (and (eq_attr "cpu" "ev6")
380 (eq_attr "type" "fadd,fcpys,fbr,fdiv,fsqrt"))
383 (define_function_unit "ev6_fa" 1 0
384 (and (eq_attr "cpu" "ev6")
385 (eq_attr "type" "fcmov"))
388 (define_function_unit "fdiv" 1 0
389 (and (eq_attr "cpu" "ev6")
390 (and (eq_attr "type" "fdiv")
391 (eq_attr "opsize" "si")))
394 (define_function_unit "fdiv" 1 0
395 (and (eq_attr "cpu" "ev6")
396 (and (eq_attr "type" "fdiv")
397 (eq_attr "opsize" "di")))
400 (define_function_unit "fsqrt" 1 0
401 (and (eq_attr "cpu" "ev6")
402 (and (eq_attr "type" "fsqrt")
403 (eq_attr "opsize" "si")))
406 (define_function_unit "fsqrt" 1 0
407 (and (eq_attr "cpu" "ev6")
408 (and (eq_attr "type" "fsqrt")
409 (eq_attr "opsize" "di")))
412 ; ??? The FPU communicates with memory and the integer register file
413 ; via two fp store units. We need a slot in the fst immediately, and
414 ; a slot in LOW after the operand data is ready. At which point the
415 ; data may be moved either to the store queue or the integer register
416 ; file and the insn retired.
419 ;; First define the arithmetic insns. Note that the 32-bit forms also
422 ;; Handle 32-64 bit extension from memory to a floating point register
423 ;; specially, since this ocurrs frequently in int->double conversions.
425 ;; Note that while we must retain the =f case in the insn for reload's
426 ;; benefit, it should be eliminated after reload, so we should never emit
427 ;; code for that case. But we don't reject the possibility.
429 (define_expand "extendsidi2"
430 [(set (match_operand:DI 0 "register_operand" "")
431 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))]
435 (define_insn "*extendsidi2_nofix"
436 [(set (match_operand:DI 0 "register_operand" "=r,r,*f,?*f")
438 (match_operand:SI 1 "nonimmediate_operand" "r,m,*f,m")))]
444 lds %0,%1\;cvtlq %0,%0"
445 [(set_attr "type" "iadd,ild,fadd,fld")
446 (set_attr "length" "*,*,*,8")])
448 (define_insn "*extendsidi2_fix"
449 [(set (match_operand:DI 0 "register_operand" "=r,r,r,*f,?*f")
451 (match_operand:SI 1 "nonimmediate_operand" "r,m,*f,*f,m")))]
458 lds %0,%1\;cvtlq %0,%0"
459 [(set_attr "type" "iadd,ild,ftoi,fadd,fld")
460 (set_attr "length" "*,*,*,*,8")])
462 ;; Due to issues with CLASS_CANNOT_CHANGE_SIZE, we cannot use a subreg here.
464 [(set (match_operand:DI 0 "hard_fp_register_operand" "")
465 (sign_extend:DI (match_operand:SI 1 "memory_operand" "")))]
467 [(set (match_dup 2) (match_dup 1))
468 (set (match_dup 0) (sign_extend:DI (match_dup 2)))]
469 "operands[2] = gen_rtx_REG (SImode, REGNO (operands[0]));")
471 ;; Optimize sign-extension of SImode loads. This shows up in the wake of
472 ;; reload when converting fp->int.
475 [(set (match_operand:SI 0 "hard_int_register_operand" "")
476 (match_operand:SI 1 "memory_operand" ""))
477 (set (match_operand:DI 2 "hard_int_register_operand" "")
478 (sign_extend:DI (match_dup 0)))]
479 "true_regnum (operands[0]) == true_regnum (operands[2])
480 || peep2_reg_dead_p (2, operands[0])"
482 (sign_extend:DI (match_dup 1)))]
486 [(set (match_operand:SI 0 "hard_int_register_operand" "")
487 (match_operand:SI 1 "hard_fp_register_operand" ""))
488 (set (match_operand:DI 2 "hard_int_register_operand" "")
489 (sign_extend:DI (match_dup 0)))]
491 && (true_regnum (operands[0]) == true_regnum (operands[2])
492 || peep2_reg_dead_p (2, operands[0]))"
494 (sign_extend:DI (match_dup 1)))]
498 [(set (match_operand:DI 0 "hard_fp_register_operand" "")
499 (sign_extend:DI (match_operand:SI 1 "hard_fp_register_operand" "")))
500 (set (match_operand:DI 2 "hard_int_register_operand" "")
502 "TARGET_FIX && peep2_reg_dead_p (2, operands[0])"
504 (sign_extend:DI (match_dup 1)))]
507 ;; Do addsi3 the way expand_binop would do if we didn't have one. This
508 ;; generates better code. We have the anonymous addsi3 pattern below in
509 ;; case combine wants to make it.
510 (define_expand "addsi3"
511 [(set (match_operand:SI 0 "register_operand" "")
512 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "")
513 (match_operand:SI 2 "add_operand" "")))]
518 rtx op1 = gen_lowpart (DImode, operands[1]);
519 rtx op2 = gen_lowpart (DImode, operands[2]);
521 if (! cse_not_expected)
523 rtx tmp = gen_reg_rtx (DImode);
524 emit_insn (gen_adddi3 (tmp, op1, op2));
525 emit_move_insn (gen_lowpart (DImode, operands[0]), tmp);
528 emit_insn (gen_adddi3 (gen_lowpart (DImode, operands[0]), op1, op2));
533 (define_insn "*addsi_internal"
534 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
535 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ,rJ,rJ")
536 (match_operand:SI 2 "add_operand" "rI,O,K,L")))]
545 [(set (match_operand:SI 0 "register_operand" "")
546 (plus:SI (match_operand:SI 1 "register_operand" "")
547 (match_operand:SI 2 "const_int_operand" "")))]
548 "! add_operand (operands[2], SImode)"
549 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
550 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
552 HOST_WIDE_INT val = INTVAL (operands[2]);
553 HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
554 HOST_WIDE_INT rest = val - low;
556 operands[3] = GEN_INT (rest);
557 operands[4] = GEN_INT (low);
560 (define_insn "*addsi_se"
561 [(set (match_operand:DI 0 "register_operand" "=r,r")
563 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ")
564 (match_operand:SI 2 "sext_add_operand" "rI,O"))))]
571 [(set (match_operand:DI 0 "register_operand" "")
573 (plus:SI (match_operand:SI 1 "reg_not_elim_operand" "")
574 (match_operand:SI 2 "const_int_operand" ""))))
575 (clobber (match_operand:SI 3 "reg_not_elim_operand" ""))]
576 "! sext_add_operand (operands[2], SImode) && INTVAL (operands[2]) > 0
577 && INTVAL (operands[2]) % 4 == 0"
578 [(set (match_dup 3) (match_dup 4))
579 (set (match_dup 0) (sign_extend:DI (plus:SI (mult:SI (match_dup 3)
583 HOST_WIDE_INT val = INTVAL (operands[2]) / 4;
589 operands[4] = GEN_INT (val);
590 operands[5] = GEN_INT (mult);
594 [(set (match_operand:DI 0 "register_operand" "")
596 (plus:SI (match_operator:SI 1 "comparison_operator"
597 [(match_operand 2 "" "")
598 (match_operand 3 "" "")])
599 (match_operand:SI 4 "add_operand" ""))))
600 (clobber (match_operand:DI 5 "register_operand" ""))]
602 [(set (match_dup 5) (match_dup 6))
603 (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 7) (match_dup 4))))]
605 operands[6] = gen_rtx_fmt_ee (GET_CODE (operands[1]), DImode,
606 operands[2], operands[3]);
607 operands[7] = gen_lowpart (SImode, operands[5]);
610 (define_insn "addvsi3"
611 [(set (match_operand:SI 0 "register_operand" "=r,r")
612 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ")
613 (match_operand:SI 2 "sext_add_operand" "rI,O")))
614 (trap_if (ne (plus:DI (sign_extend:DI (match_dup 1))
615 (sign_extend:DI (match_dup 2)))
616 (sign_extend:DI (plus:SI (match_dup 1)
624 (define_expand "adddi3"
625 [(set (match_operand:DI 0 "register_operand" "")
626 (plus:DI (match_operand:DI 1 "register_operand" "")
627 (match_operand:DI 2 "add_operand" "")))]
631 ;; We used to expend quite a lot of effort choosing addq/subq/lda.
632 ;; With complications like
634 ;; The NT stack unwind code can't handle a subq to adjust the stack
635 ;; (that's a bug, but not one we can do anything about). As of NT4.0 SP3,
636 ;; the exception handling code will loop if a subq is used and an
639 ;; The 19980616 change to emit prologues as RTL also confused some
640 ;; versions of GDB, which also interprets prologues. This has been
641 ;; fixed as of GDB 4.18, but it does not harm to unconditionally
644 ;; and the fact that the three insns schedule exactly the same, it's
645 ;; just not worth the effort.
647 (define_insn "*adddi_internal"
648 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
649 (plus:DI (match_operand:DI 1 "register_operand" "%r,r,r")
650 (match_operand:DI 2 "add_operand" "r,K,L")))]
657 ;; ??? Allow large constants when basing off the frame pointer or some
658 ;; virtual register that may eliminate to the frame pointer. This is
659 ;; done because register elimination offsets will change the hi/lo split,
660 ;; and if we split before reload, we will require additional instructions.
662 (define_insn "*adddi_fp_hack"
663 [(set (match_operand:DI 0 "register_operand" "=r")
664 (plus:DI (match_operand:DI 1 "reg_no_subreg_operand" "r")
665 (match_operand:DI 2 "const_int_operand" "n")))]
666 "NONSTRICT_REG_OK_FP_BASE_P (operands[1])
667 && INTVAL (operands[2]) >= 0
668 /* This is the largest constant an lda+ldah pair can add, minus
669 an upper bound on the displacement between SP and AP during
670 register elimination. See INITIAL_ELIMINATION_OFFSET. */
671 && INTVAL (operands[2])
673 - FIRST_PSEUDO_REGISTER * UNITS_PER_WORD
674 - ALPHA_ROUND(current_function_outgoing_args_size)
675 - (ALPHA_ROUND (get_frame_size ()
676 + max_reg_num () * UNITS_PER_WORD
677 + current_function_pretend_args_size)
678 - current_function_pretend_args_size))"
681 ;; Don't do this if we are adjusting SP since we don't want to do it
682 ;; in two steps. Don't split FP sources for the reason listed above.
684 [(set (match_operand:DI 0 "register_operand" "")
685 (plus:DI (match_operand:DI 1 "register_operand" "")
686 (match_operand:DI 2 "const_int_operand" "")))]
687 "! add_operand (operands[2], DImode)
688 && operands[0] != stack_pointer_rtx
689 && operands[1] != frame_pointer_rtx
690 && operands[1] != arg_pointer_rtx"
691 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
692 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
694 HOST_WIDE_INT val = INTVAL (operands[2]);
695 HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
696 HOST_WIDE_INT rest = val - low;
698 operands[4] = GEN_INT (low);
699 if (CONST_OK_FOR_LETTER_P (rest, 'L'))
700 operands[3] = GEN_INT (rest);
701 else if (! no_new_pseudos)
703 operands[3] = gen_reg_rtx (DImode);
704 emit_move_insn (operands[3], operands[2]);
705 emit_insn (gen_adddi3 (operands[0], operands[1], operands[3]));
712 (define_insn "*saddl"
713 [(set (match_operand:SI 0 "register_operand" "=r,r")
714 (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r")
715 (match_operand:SI 2 "const48_operand" "I,I"))
716 (match_operand:SI 3 "sext_add_operand" "rI,O")))]
722 (define_insn "*saddl_se"
723 [(set (match_operand:DI 0 "register_operand" "=r,r")
725 (plus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r,r")
726 (match_operand:SI 2 "const48_operand" "I,I"))
727 (match_operand:SI 3 "sext_add_operand" "rI,O"))))]
734 [(set (match_operand:DI 0 "register_operand" "")
736 (plus:SI (mult:SI (match_operator:SI 1 "comparison_operator"
737 [(match_operand 2 "" "")
738 (match_operand 3 "" "")])
739 (match_operand:SI 4 "const48_operand" ""))
740 (match_operand:SI 5 "sext_add_operand" ""))))
741 (clobber (match_operand:DI 6 "reg_not_elim_operand" ""))]
743 [(set (match_dup 6) (match_dup 7))
745 (sign_extend:DI (plus:SI (mult:SI (match_dup 8) (match_dup 4))
748 operands[7] = gen_rtx_fmt_ee (GET_CODE (operands[1]), DImode,
749 operands[2], operands[3]);
750 operands[8] = gen_lowpart (SImode, operands[6]);
753 (define_insn "*saddq"
754 [(set (match_operand:DI 0 "register_operand" "=r,r")
755 (plus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r,r")
756 (match_operand:DI 2 "const48_operand" "I,I"))
757 (match_operand:DI 3 "sext_add_operand" "rI,O")))]
763 (define_insn "addvdi3"
764 [(set (match_operand:DI 0 "register_operand" "=r,r")
765 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ")
766 (match_operand:DI 2 "sext_add_operand" "rI,O")))
767 (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1))
768 (sign_extend:TI (match_dup 2)))
769 (sign_extend:TI (plus:DI (match_dup 1)
777 (define_insn "negsi2"
778 [(set (match_operand:SI 0 "register_operand" "=r")
779 (neg:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))]
783 (define_insn "*negsi_se"
784 [(set (match_operand:DI 0 "register_operand" "=r")
785 (sign_extend:DI (neg:SI
786 (match_operand:SI 1 "reg_or_8bit_operand" "rI"))))]
790 (define_insn "negvsi2"
791 [(set (match_operand:SI 0 "register_operand" "=r")
792 (neg:SI (match_operand:SI 1 "register_operand" "r")))
793 (trap_if (ne (neg:DI (sign_extend:DI (match_dup 1)))
794 (sign_extend:DI (neg:SI (match_dup 1))))
799 (define_insn "negdi2"
800 [(set (match_operand:DI 0 "register_operand" "=r")
801 (neg:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))]
805 (define_insn "negvdi2"
806 [(set (match_operand:DI 0 "register_operand" "=r")
807 (neg:DI (match_operand:DI 1 "register_operand" "r")))
808 (trap_if (ne (neg:TI (sign_extend:TI (match_dup 1)))
809 (sign_extend:TI (neg:DI (match_dup 1))))
814 (define_expand "subsi3"
815 [(set (match_operand:SI 0 "register_operand" "")
816 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
817 (match_operand:SI 2 "reg_or_8bit_operand" "")))]
822 rtx op1 = gen_lowpart (DImode, operands[1]);
823 rtx op2 = gen_lowpart (DImode, operands[2]);
825 if (! cse_not_expected)
827 rtx tmp = gen_reg_rtx (DImode);
828 emit_insn (gen_subdi3 (tmp, op1, op2));
829 emit_move_insn (gen_lowpart (DImode, operands[0]), tmp);
832 emit_insn (gen_subdi3 (gen_lowpart (DImode, operands[0]), op1, op2));
837 (define_insn "*subsi_internal"
838 [(set (match_operand:SI 0 "register_operand" "=r")
839 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
840 (match_operand:SI 2 "reg_or_8bit_operand" "rI")))]
844 (define_insn "*subsi_se"
845 [(set (match_operand:DI 0 "register_operand" "=r")
846 (sign_extend:DI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
847 (match_operand:SI 2 "reg_or_8bit_operand" "rI"))))]
851 (define_insn "subvsi3"
852 [(set (match_operand:SI 0 "register_operand" "=r")
853 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
854 (match_operand:SI 2 "reg_or_8bit_operand" "rI")))
855 (trap_if (ne (minus:DI (sign_extend:DI (match_dup 1))
856 (sign_extend:DI (match_dup 2)))
857 (sign_extend:DI (minus:SI (match_dup 1)
863 (define_insn "subdi3"
864 [(set (match_operand:DI 0 "register_operand" "=r")
865 (minus:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
866 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))]
870 (define_insn "*ssubl"
871 [(set (match_operand:SI 0 "register_operand" "=r")
872 (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r")
873 (match_operand:SI 2 "const48_operand" "I"))
874 (match_operand:SI 3 "reg_or_8bit_operand" "rI")))]
878 (define_insn "*ssubl_se"
879 [(set (match_operand:DI 0 "register_operand" "=r")
881 (minus:SI (mult:SI (match_operand:SI 1 "reg_not_elim_operand" "r")
882 (match_operand:SI 2 "const48_operand" "I"))
883 (match_operand:SI 3 "reg_or_8bit_operand" "rI"))))]
887 (define_insn "*ssubq"
888 [(set (match_operand:DI 0 "register_operand" "=r")
889 (minus:DI (mult:DI (match_operand:DI 1 "reg_not_elim_operand" "r")
890 (match_operand:DI 2 "const48_operand" "I"))
891 (match_operand:DI 3 "reg_or_8bit_operand" "rI")))]
895 (define_insn "subvdi3"
896 [(set (match_operand:DI 0 "register_operand" "=r")
897 (minus:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
898 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))
899 (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1))
900 (sign_extend:TI (match_dup 2)))
901 (sign_extend:TI (minus:DI (match_dup 1)
907 (define_insn "mulsi3"
908 [(set (match_operand:SI 0 "register_operand" "=r")
909 (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
910 (match_operand:SI 2 "reg_or_8bit_operand" "rI")))]
913 [(set_attr "type" "imul")
914 (set_attr "opsize" "si")])
916 (define_insn "*mulsi_se"
917 [(set (match_operand:DI 0 "register_operand" "=r")
919 (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
920 (match_operand:SI 2 "reg_or_8bit_operand" "rI"))))]
923 [(set_attr "type" "imul")
924 (set_attr "opsize" "si")])
926 (define_insn "mulvsi3"
927 [(set (match_operand:SI 0 "register_operand" "=r")
928 (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
929 (match_operand:SI 2 "reg_or_8bit_operand" "rI")))
930 (trap_if (ne (mult:DI (sign_extend:DI (match_dup 1))
931 (sign_extend:DI (match_dup 2)))
932 (sign_extend:DI (mult:SI (match_dup 1)
937 [(set_attr "type" "imul")
938 (set_attr "opsize" "si")])
940 (define_insn "muldi3"
941 [(set (match_operand:DI 0 "register_operand" "=r")
942 (mult:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ")
943 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))]
946 [(set_attr "type" "imul")])
948 (define_insn "mulvdi3"
949 [(set (match_operand:DI 0 "register_operand" "=r")
950 (mult:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ")
951 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))
952 (trap_if (ne (mult:TI (sign_extend:TI (match_dup 1))
953 (sign_extend:TI (match_dup 2)))
954 (sign_extend:TI (mult:DI (match_dup 1)
959 [(set_attr "type" "imul")])
961 (define_insn "umuldi3_highpart"
962 [(set (match_operand:DI 0 "register_operand" "=r")
965 (mult:TI (zero_extend:TI
966 (match_operand:DI 1 "reg_or_0_operand" "%rJ"))
968 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))
972 [(set_attr "type" "imul")
973 (set_attr "opsize" "udi")])
975 (define_insn "*umuldi3_highpart_const"
976 [(set (match_operand:DI 0 "register_operand" "=r")
979 (mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand" "r"))
980 (match_operand:TI 2 "cint8_operand" "I"))
984 [(set_attr "type" "imul")
985 (set_attr "opsize" "udi")])
987 ;; The divide and remainder operations always take their inputs from
988 ;; r24 and r25, put their output in r27, and clobber r23 and r28.
990 ;; ??? Force sign-extension here because some versions of OSF/1 don't
991 ;; do the right thing if the inputs are not properly sign-extended.
992 ;; But Linux, for instance, does not have this problem. Is it worth
993 ;; the complication here to eliminate the sign extension?
994 ;; Interix/NT has the same sign-extension problem.
996 (define_expand "divsi3"
998 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
1000 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
1001 (parallel [(set (reg:DI 27)
1002 (sign_extend:DI (div:SI (reg:DI 24) (reg:DI 25))))
1003 (clobber (reg:DI 23))
1004 (clobber (reg:DI 28))])
1005 (set (match_operand:SI 0 "nonimmediate_operand" "")
1006 (subreg:SI (reg:DI 27) 0))]
1007 "! TARGET_ABI_OPEN_VMS"
1010 (define_expand "udivsi3"
1012 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
1014 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
1015 (parallel [(set (reg:DI 27)
1016 (sign_extend:DI (udiv:SI (reg:DI 24) (reg:DI 25))))
1017 (clobber (reg:DI 23))
1018 (clobber (reg:DI 28))])
1019 (set (match_operand:SI 0 "nonimmediate_operand" "")
1020 (subreg:SI (reg:DI 27) 0))]
1021 "! TARGET_ABI_OPEN_VMS"
1024 (define_expand "modsi3"
1026 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
1028 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
1029 (parallel [(set (reg:DI 27)
1030 (sign_extend:DI (mod:SI (reg:DI 24) (reg:DI 25))))
1031 (clobber (reg:DI 23))
1032 (clobber (reg:DI 28))])
1033 (set (match_operand:SI 0 "nonimmediate_operand" "")
1034 (subreg:SI (reg:DI 27) 0))]
1035 "! TARGET_ABI_OPEN_VMS"
1038 (define_expand "umodsi3"
1040 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "")))
1042 (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "")))
1043 (parallel [(set (reg:DI 27)
1044 (sign_extend:DI (umod:SI (reg:DI 24) (reg:DI 25))))
1045 (clobber (reg:DI 23))
1046 (clobber (reg:DI 28))])
1047 (set (match_operand:SI 0 "nonimmediate_operand" "")
1048 (subreg:SI (reg:DI 27) 0))]
1049 "! TARGET_ABI_OPEN_VMS"
1052 (define_expand "divdi3"
1053 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
1054 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
1055 (parallel [(set (reg:DI 27)
1058 (clobber (reg:DI 23))
1059 (clobber (reg:DI 28))])
1060 (set (match_operand:DI 0 "nonimmediate_operand" "")
1062 "! TARGET_ABI_OPEN_VMS"
1065 (define_expand "udivdi3"
1066 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
1067 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
1068 (parallel [(set (reg:DI 27)
1069 (udiv:DI (reg:DI 24)
1071 (clobber (reg:DI 23))
1072 (clobber (reg:DI 28))])
1073 (set (match_operand:DI 0 "nonimmediate_operand" "")
1075 "! TARGET_ABI_OPEN_VMS"
1078 (define_expand "moddi3"
1079 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
1080 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
1081 (parallel [(set (reg:DI 27)
1084 (clobber (reg:DI 23))
1085 (clobber (reg:DI 28))])
1086 (set (match_operand:DI 0 "nonimmediate_operand" "")
1088 "! TARGET_ABI_OPEN_VMS"
1091 (define_expand "umoddi3"
1092 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
1093 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
1094 (parallel [(set (reg:DI 27)
1095 (umod:DI (reg:DI 24)
1097 (clobber (reg:DI 23))
1098 (clobber (reg:DI 28))])
1099 (set (match_operand:DI 0 "nonimmediate_operand" "")
1101 "! TARGET_ABI_OPEN_VMS"
1104 ;; Lengths of 8 for ldq $t12,__divq($gp); jsr $t9,($t12),__divq as
1105 ;; expanded by the assembler.
1107 (define_insn "*divmodsi_internal_er"
1109 (sign_extend:DI (match_operator:SI 0 "divmod_operator"
1110 [(reg:DI 24) (reg:DI 25)])))
1111 (clobber (reg:DI 23))
1112 (clobber (reg:DI 28))]
1113 "TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
1114 "ldq $27,__%E0($29)\t\t!literal!%#\;jsr $23,($27),__%E0\t\t!lituse_jsr!%#"
1115 [(set_attr "type" "jsr")
1116 (set_attr "length" "8")])
1118 (define_insn "*divmodsi_internal"
1120 (sign_extend:DI (match_operator:SI 0 "divmod_operator"
1121 [(reg:DI 24) (reg:DI 25)])))
1122 (clobber (reg:DI 23))
1123 (clobber (reg:DI 28))]
1124 "! TARGET_ABI_OPEN_VMS"
1126 [(set_attr "type" "jsr")
1127 (set_attr "length" "8")])
1129 (define_insn "*divmoddi_internal_er"
1131 (match_operator:DI 0 "divmod_operator"
1132 [(reg:DI 24) (reg:DI 25)]))
1133 (clobber (reg:DI 23))
1134 (clobber (reg:DI 28))]
1135 "TARGET_EXPLICIT_RELOCS && ! TARGET_ABI_OPEN_VMS"
1136 "ldq $27,__%E0($29)\t\t!literal!%#\;jsr $23,($27),__%E0\t\t!lituse_jsr!%#"
1137 [(set_attr "type" "jsr")
1138 (set_attr "length" "8")])
1140 (define_insn "*divmoddi_internal"
1142 (match_operator:DI 0 "divmod_operator"
1143 [(reg:DI 24) (reg:DI 25)]))
1144 (clobber (reg:DI 23))
1145 (clobber (reg:DI 28))]
1146 "! TARGET_ABI_OPEN_VMS"
1148 [(set_attr "type" "jsr")
1149 (set_attr "length" "8")])
1151 ;; Next are the basic logical operations. These only exist in DImode.
1153 (define_insn "anddi3"
1154 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
1155 (and:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ")
1156 (match_operand:DI 2 "and_operand" "rI,N,MH")))]
1162 [(set_attr "type" "ilog,ilog,shift")])
1164 ;; There are times when we can split an AND into two AND insns. This occurs
1165 ;; when we can first clear any bytes and then clear anything else. For
1166 ;; example "I & 0xffff07" is "(I & 0xffffff) & 0xffffffffffffff07".
1167 ;; Only do this when running on 64-bit host since the computations are
1168 ;; too messy otherwise.
1171 [(set (match_operand:DI 0 "register_operand" "")
1172 (and:DI (match_operand:DI 1 "register_operand" "")
1173 (match_operand:DI 2 "const_int_operand" "")))]
1174 "HOST_BITS_PER_WIDE_INT == 64 && ! and_operand (operands[2], DImode)"
1175 [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 3)))
1176 (set (match_dup 0) (and:DI (match_dup 0) (match_dup 4)))]
1178 unsigned HOST_WIDE_INT mask1 = INTVAL (operands[2]);
1179 unsigned HOST_WIDE_INT mask2 = mask1;
1182 /* For each byte that isn't all zeros, make it all ones. */
1183 for (i = 0; i < 64; i += 8)
1184 if ((mask1 & ((HOST_WIDE_INT) 0xff << i)) != 0)
1185 mask1 |= (HOST_WIDE_INT) 0xff << i;
1187 /* Now turn on any bits we've just turned off. */
1190 operands[3] = GEN_INT (mask1);
1191 operands[4] = GEN_INT (mask2);
1194 (define_expand "zero_extendqihi2"
1195 [(set (match_operand:HI 0 "register_operand" "")
1196 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))]
1200 operands[1] = force_reg (QImode, operands[1]);
1203 (define_insn "*zero_extendqihi2_bwx"
1204 [(set (match_operand:HI 0 "register_operand" "=r,r")
1205 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
1210 [(set_attr "type" "ilog,ild")])
1212 (define_insn "*zero_extendqihi2_nobwx"
1213 [(set (match_operand:HI 0 "register_operand" "=r")
1214 (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1217 [(set_attr "type" "ilog")])
1219 (define_expand "zero_extendqisi2"
1220 [(set (match_operand:SI 0 "register_operand" "")
1221 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
1225 operands[1] = force_reg (QImode, operands[1]);
1228 (define_insn "*zero_extendqisi2_bwx"
1229 [(set (match_operand:SI 0 "register_operand" "=r,r")
1230 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
1235 [(set_attr "type" "ilog,ild")])
1237 (define_insn "*zero_extendqisi2_nobwx"
1238 [(set (match_operand:SI 0 "register_operand" "=r")
1239 (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1242 [(set_attr "type" "ilog")])
1244 (define_expand "zero_extendqidi2"
1245 [(set (match_operand:DI 0 "register_operand" "")
1246 (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "")))]
1250 operands[1] = force_reg (QImode, operands[1]);
1253 (define_insn "*zero_extendqidi2_bwx"
1254 [(set (match_operand:DI 0 "register_operand" "=r,r")
1255 (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
1260 [(set_attr "type" "ilog,ild")])
1262 (define_insn "*zero_extendqidi2_nobwx"
1263 [(set (match_operand:DI 0 "register_operand" "=r")
1264 (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))]
1267 [(set_attr "type" "ilog")])
1269 (define_expand "zero_extendhisi2"
1270 [(set (match_operand:SI 0 "register_operand" "")
1271 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
1275 operands[1] = force_reg (HImode, operands[1]);
1278 (define_insn "*zero_extendhisi2_bwx"
1279 [(set (match_operand:SI 0 "register_operand" "=r,r")
1280 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
1285 [(set_attr "type" "shift,ild")])
1287 (define_insn "*zero_extendhisi2_nobwx"
1288 [(set (match_operand:SI 0 "register_operand" "=r")
1289 (zero_extend:SI (match_operand:HI 1 "register_operand" "r")))]
1292 [(set_attr "type" "shift")])
1294 (define_expand "zero_extendhidi2"
1295 [(set (match_operand:DI 0 "register_operand" "")
1296 (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "")))]
1300 operands[1] = force_reg (HImode, operands[1]);
1303 (define_insn "*zero_extendhidi2_bwx"
1304 [(set (match_operand:DI 0 "register_operand" "=r,r")
1305 (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
1310 [(set_attr "type" "shift,ild")])
1312 (define_insn "*zero_extendhidi2_nobwx"
1313 [(set (match_operand:DI 0 "register_operand" "=r")
1314 (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))]
1317 [(set_attr "type" "shift")])
1319 (define_insn "zero_extendsidi2"
1320 [(set (match_operand:DI 0 "register_operand" "=r")
1321 (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
1324 [(set_attr "type" "shift")])
1326 (define_insn "andnotdi3"
1327 [(set (match_operand:DI 0 "register_operand" "=r")
1328 (and:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI"))
1329 (match_operand:DI 2 "reg_or_0_operand" "rJ")))]
1332 [(set_attr "type" "ilog")])
1334 (define_insn "iordi3"
1335 [(set (match_operand:DI 0 "register_operand" "=r,r")
1336 (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ")
1337 (match_operand:DI 2 "or_operand" "rI,N")))]
1342 [(set_attr "type" "ilog")])
1344 (define_insn "one_cmpldi2"
1345 [(set (match_operand:DI 0 "register_operand" "=r")
1346 (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))]
1349 [(set_attr "type" "ilog")])
1351 (define_insn "*iornot"
1352 [(set (match_operand:DI 0 "register_operand" "=r")
1353 (ior:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI"))
1354 (match_operand:DI 2 "reg_or_0_operand" "rJ")))]
1357 [(set_attr "type" "ilog")])
1359 (define_insn "xordi3"
1360 [(set (match_operand:DI 0 "register_operand" "=r,r")
1361 (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ")
1362 (match_operand:DI 2 "or_operand" "rI,N")))]
1367 [(set_attr "type" "ilog")])
1369 (define_insn "*xornot"
1370 [(set (match_operand:DI 0 "register_operand" "=r")
1371 (not:DI (xor:DI (match_operand:DI 1 "register_operand" "%rJ")
1372 (match_operand:DI 2 "register_operand" "rI"))))]
1375 [(set_attr "type" "ilog")])
1377 ;; Handle the FFS insn iff we support CIX.
1379 (define_expand "ffsdi2"
1381 (unspec:DI [(match_operand:DI 1 "register_operand" "")] UNSPEC_CTTZ))
1383 (plus:DI (match_dup 2) (const_int 1)))
1384 (set (match_operand:DI 0 "register_operand" "")
1385 (if_then_else:DI (eq (match_dup 1) (const_int 0))
1386 (const_int 0) (match_dup 3)))]
1389 operands[2] = gen_reg_rtx (DImode);
1390 operands[3] = gen_reg_rtx (DImode);
1393 (define_insn "*cttz"
1394 [(set (match_operand:DI 0 "register_operand" "=r")
1395 (unspec:DI [(match_operand:DI 1 "register_operand" "r")] UNSPEC_CTTZ))]
1398 ; EV6 calls all mvi and cttz/ctlz/popc class imisc, so just
1399 ; reuse the existing type name.
1400 [(set_attr "type" "mvi")])
1402 ;; Next come the shifts and the various extract and insert operations.
1404 (define_insn "ashldi3"
1405 [(set (match_operand:DI 0 "register_operand" "=r,r")
1406 (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ")
1407 (match_operand:DI 2 "reg_or_6bit_operand" "P,rS")))]
1410 switch (which_alternative)
1413 if (operands[2] == const1_rtx)
1414 return "addq %r1,%r1,%0";
1416 return "s%P2addq %r1,0,%0";
1418 return "sll %r1,%2,%0";
1423 [(set_attr "type" "iadd,shift")])
1425 ;; ??? The following pattern is made by combine, but earlier phases
1426 ;; (specifically flow) can't handle it. This occurs in jump.c. Deal
1427 ;; with this in a better way at some point.
1429 ;; [(set (match_operand:DI 0 "register_operand" "=r")
1431 ;; (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1432 ;; (match_operand:DI 2 "const_int_operand" "P"))
1434 ;; "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3"
1436 ;; if (operands[2] == const1_rtx)
1437 ;; return "addl %r1,%r1,%0";
1439 ;; return "s%P2addl %r1,0,%0";
1441 ;; [(set_attr "type" "iadd")])
1443 (define_insn "lshrdi3"
1444 [(set (match_operand:DI 0 "register_operand" "=r")
1445 (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1446 (match_operand:DI 2 "reg_or_6bit_operand" "rS")))]
1449 [(set_attr "type" "shift")])
1451 (define_insn "ashrdi3"
1452 [(set (match_operand:DI 0 "register_operand" "=r")
1453 (ashiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1454 (match_operand:DI 2 "reg_or_6bit_operand" "rS")))]
1457 [(set_attr "type" "shift")])
1459 (define_expand "extendqihi2"
1461 (ashift:DI (match_operand:QI 1 "some_operand" "")
1463 (set (match_operand:HI 0 "register_operand" "")
1464 (ashiftrt:DI (match_dup 2)
1470 emit_insn (gen_extendqihi2x (operands[0],
1471 force_reg (QImode, operands[1])));
1475 /* If we have an unaligned MEM, extend to DImode (which we do
1476 specially) and then copy to the result. */
1477 if (unaligned_memory_operand (operands[1], HImode))
1479 rtx temp = gen_reg_rtx (DImode);
1481 emit_insn (gen_extendqidi2 (temp, operands[1]));
1482 emit_move_insn (operands[0], gen_lowpart (HImode, temp));
1486 operands[0] = gen_lowpart (DImode, operands[0]);
1487 operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1]));
1488 operands[2] = gen_reg_rtx (DImode);
1491 (define_insn "extendqidi2x"
1492 [(set (match_operand:DI 0 "register_operand" "=r")
1493 (sign_extend:DI (match_operand:QI 1 "register_operand" "r")))]
1496 [(set_attr "type" "shift")])
1498 (define_insn "extendhidi2x"
1499 [(set (match_operand:DI 0 "register_operand" "=r")
1500 (sign_extend:DI (match_operand:HI 1 "register_operand" "r")))]
1503 [(set_attr "type" "shift")])
1505 (define_insn "extendqisi2x"
1506 [(set (match_operand:SI 0 "register_operand" "=r")
1507 (sign_extend:SI (match_operand:QI 1 "register_operand" "r")))]
1510 [(set_attr "type" "shift")])
1512 (define_insn "extendhisi2x"
1513 [(set (match_operand:SI 0 "register_operand" "=r")
1514 (sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
1517 [(set_attr "type" "shift")])
1519 (define_insn "extendqihi2x"
1520 [(set (match_operand:HI 0 "register_operand" "=r")
1521 (sign_extend:HI (match_operand:QI 1 "register_operand" "r")))]
1524 [(set_attr "type" "shift")])
1526 (define_expand "extendqisi2"
1528 (ashift:DI (match_operand:QI 1 "some_operand" "")
1530 (set (match_operand:SI 0 "register_operand" "")
1531 (ashiftrt:DI (match_dup 2)
1537 emit_insn (gen_extendqisi2x (operands[0],
1538 force_reg (QImode, operands[1])));
1542 /* If we have an unaligned MEM, extend to a DImode form of
1543 the result (which we do specially). */
1544 if (unaligned_memory_operand (operands[1], QImode))
1546 rtx temp = gen_reg_rtx (DImode);
1548 emit_insn (gen_extendqidi2 (temp, operands[1]));
1549 emit_move_insn (operands[0], gen_lowpart (SImode, temp));
1553 operands[0] = gen_lowpart (DImode, operands[0]);
1554 operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1]));
1555 operands[2] = gen_reg_rtx (DImode);
1558 (define_expand "extendqidi2"
1560 (ashift:DI (match_operand:QI 1 "some_operand" "")
1562 (set (match_operand:DI 0 "register_operand" "")
1563 (ashiftrt:DI (match_dup 2)
1569 emit_insn (gen_extendqidi2x (operands[0],
1570 force_reg (QImode, operands[1])));
1574 if (unaligned_memory_operand (operands[1], QImode))
1577 = gen_unaligned_extendqidi (operands[0],
1578 get_unaligned_address (operands[1], 1));
1580 alpha_set_memflags (seq, operands[1]);
1585 operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1]));
1586 operands[2] = gen_reg_rtx (DImode);
1589 (define_expand "extendhisi2"
1591 (ashift:DI (match_operand:HI 1 "some_operand" "")
1593 (set (match_operand:SI 0 "register_operand" "")
1594 (ashiftrt:DI (match_dup 2)
1600 emit_insn (gen_extendhisi2x (operands[0],
1601 force_reg (HImode, operands[1])));
1605 /* If we have an unaligned MEM, extend to a DImode form of
1606 the result (which we do specially). */
1607 if (unaligned_memory_operand (operands[1], HImode))
1609 rtx temp = gen_reg_rtx (DImode);
1611 emit_insn (gen_extendhidi2 (temp, operands[1]));
1612 emit_move_insn (operands[0], gen_lowpart (SImode, temp));
1616 operands[0] = gen_lowpart (DImode, operands[0]);
1617 operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1]));
1618 operands[2] = gen_reg_rtx (DImode);
1621 (define_expand "extendhidi2"
1623 (ashift:DI (match_operand:HI 1 "some_operand" "")
1625 (set (match_operand:DI 0 "register_operand" "")
1626 (ashiftrt:DI (match_dup 2)
1632 emit_insn (gen_extendhidi2x (operands[0],
1633 force_reg (HImode, operands[1])));
1637 if (unaligned_memory_operand (operands[1], HImode))
1640 = gen_unaligned_extendhidi (operands[0],
1641 get_unaligned_address (operands[1], 2));
1643 alpha_set_memflags (seq, operands[1]);
1648 operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1]));
1649 operands[2] = gen_reg_rtx (DImode);
1652 ;; Here's how we sign extend an unaligned byte and halfword. Doing this
1653 ;; as a pattern saves one instruction. The code is similar to that for
1654 ;; the unaligned loads (see below).
1656 ;; Operand 1 is the address + 1 (+2 for HI), operand 0 is the result.
1657 (define_expand "unaligned_extendqidi"
1658 [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))
1660 (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -1))
1663 (ashift:DI (match_dup 3)
1664 (minus:DI (const_int 64)
1666 (and:DI (match_dup 2) (const_int 7))
1668 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
1669 (ashiftrt:DI (match_dup 4) (const_int 56)))]
1672 operands[2] = gen_reg_rtx (DImode);
1673 operands[3] = gen_reg_rtx (DImode);
1674 operands[4] = gen_reg_rtx (DImode);
1677 (define_expand "unaligned_extendhidi"
1678 [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))
1680 (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -2))
1683 (ashift:DI (match_dup 3)
1684 (minus:DI (const_int 64)
1686 (and:DI (match_dup 2) (const_int 7))
1688 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
1689 (ashiftrt:DI (match_dup 4) (const_int 48)))]
1692 operands[2] = gen_reg_rtx (DImode);
1693 operands[3] = gen_reg_rtx (DImode);
1694 operands[4] = gen_reg_rtx (DImode);
1697 (define_insn "*extxl_const"
1698 [(set (match_operand:DI 0 "register_operand" "=r")
1699 (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1700 (match_operand:DI 2 "mode_width_operand" "n")
1701 (match_operand:DI 3 "mul8_operand" "I")))]
1703 "ext%M2l %r1,%s3,%0"
1704 [(set_attr "type" "shift")])
1706 (define_insn "extxl"
1707 [(set (match_operand:DI 0 "register_operand" "=r")
1708 (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1709 (match_operand:DI 2 "mode_width_operand" "n")
1710 (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI")
1714 [(set_attr "type" "shift")])
1716 ;; Combine has some strange notion of preserving existing undefined behaviour
1717 ;; in shifts larger than a word size. So capture these patterns that it
1718 ;; should have turned into zero_extracts.
1720 (define_insn "*extxl_1"
1721 [(set (match_operand:DI 0 "register_operand" "=r")
1722 (and:DI (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1723 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1725 (match_operand:DI 3 "mode_mask_operand" "n")))]
1728 [(set_attr "type" "shift")])
1730 (define_insn "*extql_2"
1731 [(set (match_operand:DI 0 "register_operand" "=r")
1732 (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1733 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1737 [(set_attr "type" "shift")])
1739 (define_insn "extqh"
1740 [(set (match_operand:DI 0 "register_operand" "=r")
1742 (match_operand:DI 1 "reg_or_0_operand" "rJ")
1743 (minus:DI (const_int 64)
1746 (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1751 [(set_attr "type" "shift")])
1753 (define_insn "extlh"
1754 [(set (match_operand:DI 0 "register_operand" "=r")
1756 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1757 (const_int 2147483647))
1758 (minus:DI (const_int 64)
1761 (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1766 [(set_attr "type" "shift")])
1768 (define_insn "extwh"
1769 [(set (match_operand:DI 0 "register_operand" "=r")
1771 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1773 (minus:DI (const_int 64)
1776 (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1781 [(set_attr "type" "shift")])
1783 ;; This converts an extXl into an extXh with an appropriate adjustment
1784 ;; to the address calculation.
1787 ;; [(set (match_operand:DI 0 "register_operand" "")
1788 ;; (ashift:DI (zero_extract:DI (match_operand:DI 1 "register_operand" "")
1789 ;; (match_operand:DI 2 "mode_width_operand" "")
1790 ;; (ashift:DI (match_operand:DI 3 "" "")
1792 ;; (match_operand:DI 4 "const_int_operand" "")))
1793 ;; (clobber (match_operand:DI 5 "register_operand" ""))]
1794 ;; "INTVAL (operands[4]) == 64 - INTVAL (operands[2])"
1795 ;; [(set (match_dup 5) (match_dup 6))
1796 ;; (set (match_dup 0)
1797 ;; (ashift:DI (zero_extract:DI (match_dup 1) (match_dup 2)
1798 ;; (ashift:DI (plus:DI (match_dup 5)
1804 ;; operands[6] = plus_constant (operands[3],
1805 ;; INTVAL (operands[2]) / BITS_PER_UNIT);
1806 ;; operands[7] = GEN_INT (- INTVAL (operands[2]) / BITS_PER_UNIT);
1809 (define_insn "*insbl_const"
1810 [(set (match_operand:DI 0 "register_operand" "=r")
1811 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
1812 (match_operand:DI 2 "mul8_operand" "I")))]
1815 [(set_attr "type" "shift")])
1817 (define_insn "*inswl_const"
1818 [(set (match_operand:DI 0 "register_operand" "=r")
1819 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r"))
1820 (match_operand:DI 2 "mul8_operand" "I")))]
1823 [(set_attr "type" "shift")])
1825 (define_insn "*insll_const"
1826 [(set (match_operand:DI 0 "register_operand" "=r")
1827 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
1828 (match_operand:DI 2 "mul8_operand" "I")))]
1831 [(set_attr "type" "shift")])
1833 (define_insn "insbl"
1834 [(set (match_operand:DI 0 "register_operand" "=r")
1835 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
1836 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1840 [(set_attr "type" "shift")])
1842 (define_insn "inswl"
1843 [(set (match_operand:DI 0 "register_operand" "=r")
1844 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r"))
1845 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1849 [(set_attr "type" "shift")])
1851 (define_insn "insll"
1852 [(set (match_operand:DI 0 "register_operand" "=r")
1853 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
1854 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1858 [(set_attr "type" "shift")])
1860 (define_insn "insql"
1861 [(set (match_operand:DI 0 "register_operand" "=r")
1862 (ashift:DI (match_operand:DI 1 "register_operand" "r")
1863 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1867 [(set_attr "type" "shift")])
1869 ;; Combine has this sometimes habit of moving the and outside of the
1870 ;; shift, making life more interesting.
1872 (define_insn "*insxl"
1873 [(set (match_operand:DI 0 "register_operand" "=r")
1874 (and:DI (ashift:DI (match_operand:DI 1 "register_operand" "r")
1875 (match_operand:DI 2 "mul8_operand" "I"))
1876 (match_operand:DI 3 "immediate_operand" "i")))]
1877 "HOST_BITS_PER_WIDE_INT == 64
1878 && GET_CODE (operands[3]) == CONST_INT
1879 && (((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2])
1880 == (unsigned HOST_WIDE_INT) INTVAL (operands[3]))
1881 || ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2])
1882 == (unsigned HOST_WIDE_INT) INTVAL (operands[3]))
1883 || ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2])
1884 == (unsigned HOST_WIDE_INT) INTVAL (operands[3])))"
1886 #if HOST_BITS_PER_WIDE_INT == 64
1887 if ((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2])
1888 == (unsigned HOST_WIDE_INT) INTVAL (operands[3]))
1889 return "insbl %1,%s2,%0";
1890 if ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2])
1891 == (unsigned HOST_WIDE_INT) INTVAL (operands[3]))
1892 return "inswl %1,%s2,%0";
1893 if ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2])
1894 == (unsigned HOST_WIDE_INT) INTVAL (operands[3]))
1895 return "insll %1,%s2,%0";
1899 [(set_attr "type" "shift")])
1901 ;; We do not include the insXh insns because they are complex to express
1902 ;; and it does not appear that we would ever want to generate them.
1904 ;; Since we need them for block moves, though, cop out and use unspec.
1906 (define_insn "insxh"
1907 [(set (match_operand:DI 0 "register_operand" "=r")
1908 (unspec:DI [(match_operand:DI 1 "register_operand" "r")
1909 (match_operand:DI 2 "mode_width_operand" "n")
1910 (match_operand:DI 3 "reg_or_8bit_operand" "rI")]
1914 [(set_attr "type" "shift")])
1916 (define_insn "mskxl"
1917 [(set (match_operand:DI 0 "register_operand" "=r")
1918 (and:DI (not:DI (ashift:DI
1919 (match_operand:DI 2 "mode_mask_operand" "n")
1921 (match_operand:DI 3 "reg_or_8bit_operand" "rI")
1923 (match_operand:DI 1 "reg_or_0_operand" "rJ")))]
1926 [(set_attr "type" "shift")])
1928 ;; We do not include the mskXh insns because it does not appear we would
1929 ;; ever generate one.
1931 ;; Again, we do for block moves and we use unspec again.
1933 (define_insn "mskxh"
1934 [(set (match_operand:DI 0 "register_operand" "=r")
1935 (unspec:DI [(match_operand:DI 1 "register_operand" "r")
1936 (match_operand:DI 2 "mode_width_operand" "n")
1937 (match_operand:DI 3 "reg_or_8bit_operand" "rI")]
1941 [(set_attr "type" "shift")])
1943 ;; Prefer AND + NE over LSHIFTRT + AND.
1945 (define_insn_and_split "*ze_and_ne"
1946 [(set (match_operand:DI 0 "register_operand" "=r")
1947 (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1949 (match_operand 2 "const_int_operand" "I")))]
1950 "(unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 8"
1952 "(unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 8"
1954 (and:DI (match_dup 1) (match_dup 3)))
1956 (ne:DI (match_dup 0) (const_int 0)))]
1957 "operands[3] = GEN_INT (1 << INTVAL (operands[2]));")
1959 ;; Floating-point operations. All the double-precision insns can extend
1960 ;; from single, so indicate that. The exception are the ones that simply
1961 ;; play with the sign bits; it's not clear what to do there.
1963 (define_insn "abssf2"
1964 [(set (match_operand:SF 0 "register_operand" "=f")
1965 (abs:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
1968 [(set_attr "type" "fcpys")])
1970 (define_insn "*nabssf2"
1971 [(set (match_operand:SF 0 "register_operand" "=f")
1972 (neg:SF (abs:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))]
1975 [(set_attr "type" "fadd")])
1977 (define_insn "absdf2"
1978 [(set (match_operand:DF 0 "register_operand" "=f")
1979 (abs:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1982 [(set_attr "type" "fcpys")])
1984 (define_insn "*nabsdf2"
1985 [(set (match_operand:DF 0 "register_operand" "=f")
1986 (neg:DF (abs:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG"))))]
1989 [(set_attr "type" "fadd")])
1991 (define_expand "abstf2"
1992 [(parallel [(set (match_operand:TF 0 "register_operand" "")
1993 (neg:TF (match_operand:TF 1 "reg_or_fp0_operand" "")))
1994 (use (match_dup 2))])]
1995 "TARGET_HAS_XFLOATING_LIBS"
1997 #if HOST_BITS_PER_WIDE_INT >= 64
1998 operands[2] = force_reg (DImode, GEN_INT (0x8000000000000000));
2000 operands[2] = force_reg (DImode, immed_double_const (0, 0x80000000, DImode));
2004 (define_insn_and_split "*abstf_internal"
2005 [(set (match_operand:TF 0 "register_operand" "=r")
2006 (abs:TF (match_operand:TF 1 "reg_or_fp0_operand" "rG")))
2007 (use (match_operand:DI 2 "register_operand" "r"))]
2008 "TARGET_HAS_XFLOATING_LIBS"
2010 "&& reload_completed"
2012 "alpha_split_tfmode_frobsign (operands, gen_andnotdi3); DONE;")
2014 (define_insn "negsf2"
2015 [(set (match_operand:SF 0 "register_operand" "=f")
2016 (neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
2019 [(set_attr "type" "fadd")])
2021 (define_insn "negdf2"
2022 [(set (match_operand:DF 0 "register_operand" "=f")
2023 (neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2026 [(set_attr "type" "fadd")])
2028 (define_expand "negtf2"
2029 [(parallel [(set (match_operand:TF 0 "register_operand" "")
2030 (neg:TF (match_operand:TF 1 "reg_or_fp0_operand" "")))
2031 (use (match_dup 2))])]
2032 "TARGET_HAS_XFLOATING_LIBS"
2034 #if HOST_BITS_PER_WIDE_INT >= 64
2035 operands[2] = force_reg (DImode, GEN_INT (0x8000000000000000));
2037 operands[2] = force_reg (DImode, immed_double_const (0, 0x80000000, DImode));
2041 (define_insn_and_split "*negtf_internal"
2042 [(set (match_operand:TF 0 "register_operand" "=r")
2043 (neg:TF (match_operand:TF 1 "reg_or_fp0_operand" "rG")))
2044 (use (match_operand:DI 2 "register_operand" "r"))]
2045 "TARGET_HAS_XFLOATING_LIBS"
2047 "&& reload_completed"
2049 "alpha_split_tfmode_frobsign (operands, gen_xordi3); DONE;")
2051 (define_insn "*addsf_ieee"
2052 [(set (match_operand:SF 0 "register_operand" "=&f")
2053 (plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
2054 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2055 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2056 "add%,%/ %R1,%R2,%0"
2057 [(set_attr "type" "fadd")
2058 (set_attr "trap" "yes")
2059 (set_attr "round_suffix" "normal")
2060 (set_attr "trap_suffix" "u_su_sui")])
2062 (define_insn "addsf3"
2063 [(set (match_operand:SF 0 "register_operand" "=f")
2064 (plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
2065 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2067 "add%,%/ %R1,%R2,%0"
2068 [(set_attr "type" "fadd")
2069 (set_attr "trap" "yes")
2070 (set_attr "round_suffix" "normal")
2071 (set_attr "trap_suffix" "u_su_sui")])
2073 (define_insn "*adddf_ieee"
2074 [(set (match_operand:DF 0 "register_operand" "=&f")
2075 (plus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
2076 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2077 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2078 "add%-%/ %R1,%R2,%0"
2079 [(set_attr "type" "fadd")
2080 (set_attr "trap" "yes")
2081 (set_attr "round_suffix" "normal")
2082 (set_attr "trap_suffix" "u_su_sui")])
2084 (define_insn "adddf3"
2085 [(set (match_operand:DF 0 "register_operand" "=f")
2086 (plus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
2087 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2089 "add%-%/ %R1,%R2,%0"
2090 [(set_attr "type" "fadd")
2091 (set_attr "trap" "yes")
2092 (set_attr "round_suffix" "normal")
2093 (set_attr "trap_suffix" "u_su_sui")])
2095 (define_insn "*adddf_ext1"
2096 [(set (match_operand:DF 0 "register_operand" "=f")
2097 (plus:DF (float_extend:DF
2098 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2099 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2100 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2101 "add%-%/ %R1,%R2,%0"
2102 [(set_attr "type" "fadd")
2103 (set_attr "trap" "yes")
2104 (set_attr "round_suffix" "normal")
2105 (set_attr "trap_suffix" "u_su_sui")])
2107 (define_insn "*adddf_ext2"
2108 [(set (match_operand:DF 0 "register_operand" "=f")
2109 (plus:DF (float_extend:DF
2110 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
2112 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2113 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2114 "add%-%/ %R1,%R2,%0"
2115 [(set_attr "type" "fadd")
2116 (set_attr "trap" "yes")
2117 (set_attr "round_suffix" "normal")
2118 (set_attr "trap_suffix" "u_su_sui")])
2120 (define_expand "addtf3"
2121 [(use (match_operand 0 "register_operand" ""))
2122 (use (match_operand 1 "general_operand" ""))
2123 (use (match_operand 2 "general_operand" ""))]
2124 "TARGET_HAS_XFLOATING_LIBS"
2125 "alpha_emit_xfloating_arith (PLUS, operands); DONE;")
2127 ;; Define conversion operators between DFmode and SImode, using the cvtql
2128 ;; instruction. To allow combine et al to do useful things, we keep the
2129 ;; operation as a unit until after reload, at which point we split the
2132 ;; Note that we (attempt to) only consider this optimization when the
2133 ;; ultimate destination is memory. If we will be doing further integer
2134 ;; processing, it is cheaper to do the truncation in the int regs.
2136 (define_insn "*cvtql"
2137 [(set (match_operand:SI 0 "register_operand" "=f")
2138 (unspec:SI [(match_operand:DI 1 "reg_or_fp0_operand" "fG")]
2142 [(set_attr "type" "fadd")
2143 (set_attr "trap" "yes")
2144 (set_attr "trap_suffix" "v_sv")])
2146 (define_insn_and_split "*fix_truncdfsi_ieee"
2147 [(set (match_operand:SI 0 "memory_operand" "=m")
2148 (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0))
2149 (clobber (match_scratch:DI 2 "=&f"))
2150 (clobber (match_scratch:SI 3 "=&f"))]
2151 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2153 "&& reload_completed"
2154 [(set (match_dup 2) (fix:DI (match_dup 1)))
2155 (set (match_dup 3) (unspec:SI [(match_dup 2)] UNSPEC_CVTQL))
2156 (set (match_dup 0) (match_dup 3))]
2158 [(set_attr "type" "fadd")
2159 (set_attr "trap" "yes")])
2161 (define_insn_and_split "*fix_truncdfsi_internal"
2162 [(set (match_operand:SI 0 "memory_operand" "=m")
2163 (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0))
2164 (clobber (match_scratch:DI 2 "=f"))]
2165 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2167 "&& reload_completed"
2168 [(set (match_dup 2) (fix:DI (match_dup 1)))
2169 (set (match_dup 3) (unspec:SI [(match_dup 2)] UNSPEC_CVTQL))
2170 (set (match_dup 0) (match_dup 3))]
2171 ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG.
2172 "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));"
2173 [(set_attr "type" "fadd")
2174 (set_attr "trap" "yes")])
2176 (define_insn "*fix_truncdfdi_ieee"
2177 [(set (match_operand:DI 0 "reg_no_subreg_operand" "=&f")
2178 (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2179 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2181 [(set_attr "type" "fadd")
2182 (set_attr "trap" "yes")
2183 (set_attr "round_suffix" "c")
2184 (set_attr "trap_suffix" "v_sv_svi")])
2186 (define_insn "fix_truncdfdi2"
2187 [(set (match_operand:DI 0 "reg_no_subreg_operand" "=f")
2188 (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2191 [(set_attr "type" "fadd")
2192 (set_attr "trap" "yes")
2193 (set_attr "round_suffix" "c")
2194 (set_attr "trap_suffix" "v_sv_svi")])
2196 ;; Likewise between SFmode and SImode.
2198 (define_insn_and_split "*fix_truncsfsi_ieee"
2199 [(set (match_operand:SI 0 "memory_operand" "=m")
2200 (subreg:SI (fix:DI (float_extend:DF
2201 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0))
2202 (clobber (match_scratch:DI 2 "=&f"))
2203 (clobber (match_scratch:SI 3 "=&f"))]
2204 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2206 "&& reload_completed"
2207 [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1))))
2208 (set (match_dup 3) (unspec:SI [(match_dup 2)] UNSPEC_CVTQL))
2209 (set (match_dup 0) (match_dup 3))]
2211 [(set_attr "type" "fadd")
2212 (set_attr "trap" "yes")])
2214 (define_insn_and_split "*fix_truncsfsi_internal"
2215 [(set (match_operand:SI 0 "memory_operand" "=m")
2216 (subreg:SI (fix:DI (float_extend:DF
2217 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0))
2218 (clobber (match_scratch:DI 2 "=f"))]
2219 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2221 "&& reload_completed"
2222 [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1))))
2223 (set (match_dup 3) (unspec:SI [(match_dup 2)] UNSPEC_CVTQL))
2224 (set (match_dup 0) (match_dup 3))]
2225 ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG.
2226 "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));"
2227 [(set_attr "type" "fadd")
2228 (set_attr "trap" "yes")])
2230 (define_insn "*fix_truncsfdi_ieee"
2231 [(set (match_operand:DI 0 "reg_no_subreg_operand" "=&f")
2232 (fix:DI (float_extend:DF
2233 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))]
2234 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2236 [(set_attr "type" "fadd")
2237 (set_attr "trap" "yes")
2238 (set_attr "round_suffix" "c")
2239 (set_attr "trap_suffix" "v_sv_svi")])
2241 (define_insn "fix_truncsfdi2"
2242 [(set (match_operand:DI 0 "reg_no_subreg_operand" "=f")
2243 (fix:DI (float_extend:DF
2244 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))]
2247 [(set_attr "type" "fadd")
2248 (set_attr "trap" "yes")
2249 (set_attr "round_suffix" "c")
2250 (set_attr "trap_suffix" "v_sv_svi")])
2252 (define_expand "fix_trunctfdi2"
2253 [(use (match_operand:DI 0 "register_operand" ""))
2254 (use (match_operand:TF 1 "general_operand" ""))]
2255 "TARGET_HAS_XFLOATING_LIBS"
2256 "alpha_emit_xfloating_cvt (FIX, operands); DONE;")
2258 (define_insn "*floatdisf_ieee"
2259 [(set (match_operand:SF 0 "register_operand" "=&f")
2260 (float:SF (match_operand:DI 1 "reg_no_subreg_operand" "f")))]
2261 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2263 [(set_attr "type" "fadd")
2264 (set_attr "trap" "yes")
2265 (set_attr "round_suffix" "normal")
2266 (set_attr "trap_suffix" "sui")])
2268 (define_insn "floatdisf2"
2269 [(set (match_operand:SF 0 "register_operand" "=f")
2270 (float:SF (match_operand:DI 1 "reg_no_subreg_operand" "f")))]
2273 [(set_attr "type" "fadd")
2274 (set_attr "trap" "yes")
2275 (set_attr "round_suffix" "normal")
2276 (set_attr "trap_suffix" "sui")])
2278 (define_insn "*floatdidf_ieee"
2279 [(set (match_operand:DF 0 "register_operand" "=&f")
2280 (float:DF (match_operand:DI 1 "reg_no_subreg_operand" "f")))]
2281 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2283 [(set_attr "type" "fadd")
2284 (set_attr "trap" "yes")
2285 (set_attr "round_suffix" "normal")
2286 (set_attr "trap_suffix" "sui")])
2288 (define_insn "floatdidf2"
2289 [(set (match_operand:DF 0 "register_operand" "=f")
2290 (float:DF (match_operand:DI 1 "reg_no_subreg_operand" "f")))]
2293 [(set_attr "type" "fadd")
2294 (set_attr "trap" "yes")
2295 (set_attr "round_suffix" "normal")
2296 (set_attr "trap_suffix" "sui")])
2298 (define_expand "floatditf2"
2299 [(use (match_operand:TF 0 "register_operand" ""))
2300 (use (match_operand:DI 1 "general_operand" ""))]
2301 "TARGET_HAS_XFLOATING_LIBS"
2302 "alpha_emit_xfloating_cvt (FLOAT, operands); DONE;")
2304 (define_expand "floatunsdisf2"
2305 [(use (match_operand:SF 0 "register_operand" ""))
2306 (use (match_operand:DI 1 "register_operand" ""))]
2308 "alpha_emit_floatuns (operands); DONE;")
2310 (define_expand "floatunsdidf2"
2311 [(use (match_operand:DF 0 "register_operand" ""))
2312 (use (match_operand:DI 1 "register_operand" ""))]
2314 "alpha_emit_floatuns (operands); DONE;")
2316 (define_expand "floatunsditf2"
2317 [(use (match_operand:TF 0 "register_operand" ""))
2318 (use (match_operand:DI 1 "general_operand" ""))]
2319 "TARGET_HAS_XFLOATING_LIBS"
2320 "alpha_emit_xfloating_cvt (UNSIGNED_FLOAT, operands); DONE;")
2322 (define_expand "extendsfdf2"
2323 [(set (match_operand:DF 0 "register_operand" "")
2324 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "")))]
2327 if (alpha_fptm >= ALPHA_FPTM_SU)
2328 operands[1] = force_reg (SFmode, operands[1]);
2331 (define_insn "*extendsfdf2_ieee"
2332 [(set (match_operand:DF 0 "register_operand" "=&f")
2333 (float_extend:DF (match_operand:SF 1 "register_operand" "f")))]
2334 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2336 [(set_attr "type" "fadd")
2337 (set_attr "trap" "yes")])
2339 (define_insn "*extendsfdf2_internal"
2340 [(set (match_operand:DF 0 "register_operand" "=f,f,m")
2341 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m,f")))]
2342 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2347 [(set_attr "type" "fcpys,fld,fst")])
2349 (define_expand "extendsftf2"
2350 [(use (match_operand:TF 0 "register_operand" ""))
2351 (use (match_operand:SF 1 "general_operand" ""))]
2352 "TARGET_HAS_XFLOATING_LIBS"
2354 rtx tmp = gen_reg_rtx (DFmode);
2355 emit_insn (gen_extendsfdf2 (tmp, operands[1]));
2356 emit_insn (gen_extenddftf2 (operands[0], tmp));
2360 (define_expand "extenddftf2"
2361 [(use (match_operand:TF 0 "register_operand" ""))
2362 (use (match_operand:DF 1 "general_operand" ""))]
2363 "TARGET_HAS_XFLOATING_LIBS"
2364 "alpha_emit_xfloating_cvt (FLOAT_EXTEND, operands); DONE;")
2366 (define_insn "*truncdfsf2_ieee"
2367 [(set (match_operand:SF 0 "register_operand" "=&f")
2368 (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2369 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2371 [(set_attr "type" "fadd")
2372 (set_attr "trap" "yes")
2373 (set_attr "round_suffix" "normal")
2374 (set_attr "trap_suffix" "u_su_sui")])
2376 (define_insn "truncdfsf2"
2377 [(set (match_operand:SF 0 "register_operand" "=f")
2378 (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2381 [(set_attr "type" "fadd")
2382 (set_attr "trap" "yes")
2383 (set_attr "round_suffix" "normal")
2384 (set_attr "trap_suffix" "u_su_sui")])
2386 (define_expand "trunctfdf2"
2387 [(use (match_operand:DF 0 "register_operand" ""))
2388 (use (match_operand:TF 1 "general_operand" ""))]
2389 "TARGET_HAS_XFLOATING_LIBS"
2390 "alpha_emit_xfloating_cvt (FLOAT_TRUNCATE, operands); DONE;")
2392 (define_expand "trunctfsf2"
2393 [(use (match_operand:SF 0 "register_operand" ""))
2394 (use (match_operand:TF 1 "general_operand" ""))]
2395 "TARGET_FP && TARGET_HAS_XFLOATING_LIBS"
2397 rtx tmpf, sticky, arg, lo, hi;
2399 tmpf = gen_reg_rtx (DFmode);
2400 sticky = gen_reg_rtx (DImode);
2401 arg = copy_to_mode_reg (TFmode, operands[1]);
2402 lo = gen_lowpart (DImode, arg);
2403 hi = gen_highpart (DImode, arg);
2405 /* Convert the low word of the TFmode value into a sticky rounding bit,
2406 then or it into the low bit of the high word. This leaves the sticky
2407 bit at bit 48 of the fraction, which is representable in DFmode,
2408 which prevents rounding error in the final conversion to SFmode. */
2410 emit_insn (gen_rtx_SET (VOIDmode, sticky,
2411 gen_rtx_NE (DImode, lo, const0_rtx)));
2412 emit_insn (gen_iordi3 (hi, hi, sticky));
2413 emit_insn (gen_trunctfdf2 (tmpf, arg));
2414 emit_insn (gen_truncdfsf2 (operands[0], tmpf));
2418 (define_insn "*divsf3_ieee"
2419 [(set (match_operand:SF 0 "register_operand" "=&f")
2420 (div:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
2421 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2422 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2423 "div%,%/ %R1,%R2,%0"
2424 [(set_attr "type" "fdiv")
2425 (set_attr "opsize" "si")
2426 (set_attr "trap" "yes")
2427 (set_attr "round_suffix" "normal")
2428 (set_attr "trap_suffix" "u_su_sui")])
2430 (define_insn "divsf3"
2431 [(set (match_operand:SF 0 "register_operand" "=f")
2432 (div:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
2433 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2435 "div%,%/ %R1,%R2,%0"
2436 [(set_attr "type" "fdiv")
2437 (set_attr "opsize" "si")
2438 (set_attr "trap" "yes")
2439 (set_attr "round_suffix" "normal")
2440 (set_attr "trap_suffix" "u_su_sui")])
2442 (define_insn "*divdf3_ieee"
2443 [(set (match_operand:DF 0 "register_operand" "=&f")
2444 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2445 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2446 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2447 "div%-%/ %R1,%R2,%0"
2448 [(set_attr "type" "fdiv")
2449 (set_attr "trap" "yes")
2450 (set_attr "round_suffix" "normal")
2451 (set_attr "trap_suffix" "u_su_sui")])
2453 (define_insn "divdf3"
2454 [(set (match_operand:DF 0 "register_operand" "=f")
2455 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2456 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2458 "div%-%/ %R1,%R2,%0"
2459 [(set_attr "type" "fdiv")
2460 (set_attr "trap" "yes")
2461 (set_attr "round_suffix" "normal")
2462 (set_attr "trap_suffix" "u_su_sui")])
2464 (define_insn "*divdf_ext1"
2465 [(set (match_operand:DF 0 "register_operand" "=f")
2466 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2467 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2468 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2469 "div%-%/ %R1,%R2,%0"
2470 [(set_attr "type" "fdiv")
2471 (set_attr "trap" "yes")
2472 (set_attr "round_suffix" "normal")
2473 (set_attr "trap_suffix" "u_su_sui")])
2475 (define_insn "*divdf_ext2"
2476 [(set (match_operand:DF 0 "register_operand" "=f")
2477 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2479 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2480 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2481 "div%-%/ %R1,%R2,%0"
2482 [(set_attr "type" "fdiv")
2483 (set_attr "trap" "yes")
2484 (set_attr "round_suffix" "normal")
2485 (set_attr "trap_suffix" "u_su_sui")])
2487 (define_insn "*divdf_ext3"
2488 [(set (match_operand:DF 0 "register_operand" "=f")
2489 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2490 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2491 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2492 "div%-%/ %R1,%R2,%0"
2493 [(set_attr "type" "fdiv")
2494 (set_attr "trap" "yes")
2495 (set_attr "round_suffix" "normal")
2496 (set_attr "trap_suffix" "u_su_sui")])
2498 (define_expand "divtf3"
2499 [(use (match_operand 0 "register_operand" ""))
2500 (use (match_operand 1 "general_operand" ""))
2501 (use (match_operand 2 "general_operand" ""))]
2502 "TARGET_HAS_XFLOATING_LIBS"
2503 "alpha_emit_xfloating_arith (DIV, operands); DONE;")
2505 (define_insn "*mulsf3_ieee"
2506 [(set (match_operand:SF 0 "register_operand" "=&f")
2507 (mult:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
2508 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2509 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2510 "mul%,%/ %R1,%R2,%0"
2511 [(set_attr "type" "fmul")
2512 (set_attr "trap" "yes")
2513 (set_attr "round_suffix" "normal")
2514 (set_attr "trap_suffix" "u_su_sui")])
2516 (define_insn "mulsf3"
2517 [(set (match_operand:SF 0 "register_operand" "=f")
2518 (mult:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
2519 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2521 "mul%,%/ %R1,%R2,%0"
2522 [(set_attr "type" "fmul")
2523 (set_attr "trap" "yes")
2524 (set_attr "round_suffix" "normal")
2525 (set_attr "trap_suffix" "u_su_sui")])
2527 (define_insn "*muldf3_ieee"
2528 [(set (match_operand:DF 0 "register_operand" "=&f")
2529 (mult:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
2530 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2531 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2532 "mul%-%/ %R1,%R2,%0"
2533 [(set_attr "type" "fmul")
2534 (set_attr "trap" "yes")
2535 (set_attr "round_suffix" "normal")
2536 (set_attr "trap_suffix" "u_su_sui")])
2538 (define_insn "muldf3"
2539 [(set (match_operand:DF 0 "register_operand" "=f")
2540 (mult:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
2541 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2543 "mul%-%/ %R1,%R2,%0"
2544 [(set_attr "type" "fmul")
2545 (set_attr "trap" "yes")
2546 (set_attr "round_suffix" "normal")
2547 (set_attr "trap_suffix" "u_su_sui")])
2549 (define_insn "*muldf_ext1"
2550 [(set (match_operand:DF 0 "register_operand" "=f")
2551 (mult:DF (float_extend:DF
2552 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2553 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2554 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2555 "mul%-%/ %R1,%R2,%0"
2556 [(set_attr "type" "fmul")
2557 (set_attr "trap" "yes")
2558 (set_attr "round_suffix" "normal")
2559 (set_attr "trap_suffix" "u_su_sui")])
2561 (define_insn "*muldf_ext2"
2562 [(set (match_operand:DF 0 "register_operand" "=f")
2563 (mult:DF (float_extend:DF
2564 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
2566 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2567 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2568 "mul%-%/ %R1,%R2,%0"
2569 [(set_attr "type" "fmul")
2570 (set_attr "trap" "yes")
2571 (set_attr "round_suffix" "normal")
2572 (set_attr "trap_suffix" "u_su_sui")])
2574 (define_expand "multf3"
2575 [(use (match_operand 0 "register_operand" ""))
2576 (use (match_operand 1 "general_operand" ""))
2577 (use (match_operand 2 "general_operand" ""))]
2578 "TARGET_HAS_XFLOATING_LIBS"
2579 "alpha_emit_xfloating_arith (MULT, operands); DONE;")
2581 (define_insn "*subsf3_ieee"
2582 [(set (match_operand:SF 0 "register_operand" "=&f")
2583 (minus:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
2584 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2585 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2586 "sub%,%/ %R1,%R2,%0"
2587 [(set_attr "type" "fadd")
2588 (set_attr "trap" "yes")
2589 (set_attr "round_suffix" "normal")
2590 (set_attr "trap_suffix" "u_su_sui")])
2592 (define_insn "subsf3"
2593 [(set (match_operand:SF 0 "register_operand" "=f")
2594 (minus:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
2595 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
2597 "sub%,%/ %R1,%R2,%0"
2598 [(set_attr "type" "fadd")
2599 (set_attr "trap" "yes")
2600 (set_attr "round_suffix" "normal")
2601 (set_attr "trap_suffix" "u_su_sui")])
2603 (define_insn "*subdf3_ieee"
2604 [(set (match_operand:DF 0 "register_operand" "=&f")
2605 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2606 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2607 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
2608 "sub%-%/ %R1,%R2,%0"
2609 [(set_attr "type" "fadd")
2610 (set_attr "trap" "yes")
2611 (set_attr "round_suffix" "normal")
2612 (set_attr "trap_suffix" "u_su_sui")])
2614 (define_insn "subdf3"
2615 [(set (match_operand:DF 0 "register_operand" "=f")
2616 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2617 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2619 "sub%-%/ %R1,%R2,%0"
2620 [(set_attr "type" "fadd")
2621 (set_attr "trap" "yes")
2622 (set_attr "round_suffix" "normal")
2623 (set_attr "trap_suffix" "u_su_sui")])
2625 (define_insn "*subdf_ext1"
2626 [(set (match_operand:DF 0 "register_operand" "=f")
2627 (minus:DF (float_extend:DF
2628 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2629 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
2630 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2631 "sub%-%/ %R1,%R2,%0"
2632 [(set_attr "type" "fadd")
2633 (set_attr "trap" "yes")
2634 (set_attr "round_suffix" "normal")
2635 (set_attr "trap_suffix" "u_su_sui")])
2637 (define_insn "*subdf_ext2"
2638 [(set (match_operand:DF 0 "register_operand" "=f")
2639 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
2641 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2642 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2643 "sub%-%/ %R1,%R2,%0"
2644 [(set_attr "type" "fadd")
2645 (set_attr "trap" "yes")
2646 (set_attr "round_suffix" "normal")
2647 (set_attr "trap_suffix" "u_su_sui")])
2649 (define_insn "*subdf_ext3"
2650 [(set (match_operand:DF 0 "register_operand" "=f")
2651 (minus:DF (float_extend:DF
2652 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
2654 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
2655 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
2656 "sub%-%/ %R1,%R2,%0"
2657 [(set_attr "type" "fadd")
2658 (set_attr "trap" "yes")
2659 (set_attr "round_suffix" "normal")
2660 (set_attr "trap_suffix" "u_su_sui")])
2662 (define_expand "subtf3"
2663 [(use (match_operand 0 "register_operand" ""))
2664 (use (match_operand 1 "general_operand" ""))
2665 (use (match_operand 2 "general_operand" ""))]
2666 "TARGET_HAS_XFLOATING_LIBS"
2667 "alpha_emit_xfloating_arith (MINUS, operands); DONE;")
2669 (define_insn "*sqrtsf2_ieee"
2670 [(set (match_operand:SF 0 "register_operand" "=&f")
2671 (sqrt:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
2672 "TARGET_FP && TARGET_FIX && alpha_fptm >= ALPHA_FPTM_SU"
2674 [(set_attr "type" "fsqrt")
2675 (set_attr "opsize" "si")
2676 (set_attr "trap" "yes")
2677 (set_attr "round_suffix" "normal")
2678 (set_attr "trap_suffix" "u_su_sui")])
2680 (define_insn "sqrtsf2"
2681 [(set (match_operand:SF 0 "register_operand" "=f")
2682 (sqrt:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
2683 "TARGET_FP && TARGET_FIX"
2685 [(set_attr "type" "fsqrt")
2686 (set_attr "opsize" "si")
2687 (set_attr "trap" "yes")
2688 (set_attr "round_suffix" "normal")
2689 (set_attr "trap_suffix" "u_su_sui")])
2691 (define_insn "*sqrtdf2_ieee"
2692 [(set (match_operand:DF 0 "register_operand" "=&f")
2693 (sqrt:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2694 "TARGET_FP && TARGET_FIX && alpha_fptm >= ALPHA_FPTM_SU"
2696 [(set_attr "type" "fsqrt")
2697 (set_attr "trap" "yes")
2698 (set_attr "round_suffix" "normal")
2699 (set_attr "trap_suffix" "u_su_sui")])
2701 (define_insn "sqrtdf2"
2702 [(set (match_operand:DF 0 "register_operand" "=f")
2703 (sqrt:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
2704 "TARGET_FP && TARGET_FIX"
2706 [(set_attr "type" "fsqrt")
2707 (set_attr "trap" "yes")
2708 (set_attr "round_suffix" "normal")
2709 (set_attr "trap_suffix" "u_su_sui")])
2711 ;; Next are all the integer comparisons, and conditional moves and branches
2712 ;; and some of the related define_expand's and define_split's.
2714 (define_insn "*setcc_internal"
2715 [(set (match_operand 0 "register_operand" "=r")
2716 (match_operator 1 "alpha_comparison_operator"
2717 [(match_operand:DI 2 "register_operand" "r")
2718 (match_operand:DI 3 "reg_or_8bit_operand" "rI")]))]
2719 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
2720 && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
2721 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
2723 [(set_attr "type" "icmp")])
2725 ;; Yes, we can technically support reg_or_8bit_operand in operand 2,
2726 ;; but that's non-canonical rtl and allowing that causes inefficiencies
2728 (define_insn "*setcc_swapped_internal"
2729 [(set (match_operand 0 "register_operand" "=r")
2730 (match_operator 1 "alpha_swapped_comparison_operator"
2731 [(match_operand:DI 2 "register_operand" "r")
2732 (match_operand:DI 3 "reg_or_0_operand" "rJ")]))]
2733 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
2734 && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
2735 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
2737 [(set_attr "type" "icmp")])
2739 ;; Use match_operator rather than ne directly so that we can match
2740 ;; multiple integer modes.
2741 (define_insn "*setne_internal"
2742 [(set (match_operand 0 "register_operand" "=r")
2743 (match_operator 1 "signed_comparison_operator"
2744 [(match_operand:DI 2 "register_operand" "r")
2746 "GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_INT
2747 && GET_MODE_SIZE (GET_MODE (operands[0])) <= 8
2748 && GET_CODE (operands[1]) == NE
2749 && GET_MODE (operands[0]) == GET_MODE (operands[1])"
2751 [(set_attr "type" "icmp")])
2753 ;; The mode folding trick can't be used with const_int operands, since
2754 ;; reload needs to know the proper mode.
2756 ;; Use add_operand instead of the more seemingly natural reg_or_8bit_operand
2757 ;; in order to create more pairs of constants. As long as we're allowing
2758 ;; two constants at the same time, and will have to reload one of them...
2760 (define_insn "*movqicc_internal"
2761 [(set (match_operand:QI 0 "register_operand" "=r,r,r,r")
2763 (match_operator 2 "signed_comparison_operator"
2764 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
2765 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
2766 (match_operand:QI 1 "add_operand" "rI,0,rI,0")
2767 (match_operand:QI 5 "add_operand" "0,rI,0,rI")))]
2768 "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
2774 [(set_attr "type" "icmov")])
2776 (define_insn "*movhicc_internal"
2777 [(set (match_operand:HI 0 "register_operand" "=r,r,r,r")
2779 (match_operator 2 "signed_comparison_operator"
2780 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
2781 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
2782 (match_operand:HI 1 "add_operand" "rI,0,rI,0")
2783 (match_operand:HI 5 "add_operand" "0,rI,0,rI")))]
2784 "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
2790 [(set_attr "type" "icmov")])
2792 (define_insn "*movsicc_internal"
2793 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
2795 (match_operator 2 "signed_comparison_operator"
2796 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
2797 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
2798 (match_operand:SI 1 "add_operand" "rI,0,rI,0")
2799 (match_operand:SI 5 "add_operand" "0,rI,0,rI")))]
2800 "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
2806 [(set_attr "type" "icmov")])
2808 (define_insn "*movdicc_internal"
2809 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r")
2811 (match_operator 2 "signed_comparison_operator"
2812 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
2813 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
2814 (match_operand:DI 1 "add_operand" "rI,0,rI,0")
2815 (match_operand:DI 5 "add_operand" "0,rI,0,rI")))]
2816 "(operands[3] == const0_rtx || operands[4] == const0_rtx)"
2822 [(set_attr "type" "icmov")])
2824 (define_insn "*movqicc_lbc"
2825 [(set (match_operand:QI 0 "register_operand" "=r,r")
2827 (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2831 (match_operand:QI 1 "reg_or_8bit_operand" "rI,0")
2832 (match_operand:QI 3 "reg_or_8bit_operand" "0,rI")))]
2837 [(set_attr "type" "icmov")])
2839 (define_insn "*movhicc_lbc"
2840 [(set (match_operand:HI 0 "register_operand" "=r,r")
2842 (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2846 (match_operand:HI 1 "reg_or_8bit_operand" "rI,0")
2847 (match_operand:HI 3 "reg_or_8bit_operand" "0,rI")))]
2852 [(set_attr "type" "icmov")])
2854 (define_insn "*movsicc_lbc"
2855 [(set (match_operand:SI 0 "register_operand" "=r,r")
2857 (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2861 (match_operand:SI 1 "reg_or_8bit_operand" "rI,0")
2862 (match_operand:SI 3 "reg_or_8bit_operand" "0,rI")))]
2867 [(set_attr "type" "icmov")])
2869 (define_insn "*movdicc_lbc"
2870 [(set (match_operand:DI 0 "register_operand" "=r,r")
2872 (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2876 (match_operand:DI 1 "reg_or_8bit_operand" "rI,0")
2877 (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))]
2882 [(set_attr "type" "icmov")])
2884 (define_insn "*movqicc_lbs"
2885 [(set (match_operand:QI 0 "register_operand" "=r,r")
2887 (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2891 (match_operand:QI 1 "reg_or_8bit_operand" "rI,0")
2892 (match_operand:QI 3 "reg_or_8bit_operand" "0,rI")))]
2897 [(set_attr "type" "icmov")])
2899 (define_insn "*movhicc_lbs"
2900 [(set (match_operand:HI 0 "register_operand" "=r,r")
2902 (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2906 (match_operand:HI 1 "reg_or_8bit_operand" "rI,0")
2907 (match_operand:HI 3 "reg_or_8bit_operand" "0,rI")))]
2912 [(set_attr "type" "icmov")])
2914 (define_insn "*movsicc_lbs"
2915 [(set (match_operand:SI 0 "register_operand" "=r,r")
2917 (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2921 (match_operand:SI 1 "reg_or_8bit_operand" "rI,0")
2922 (match_operand:SI 3 "reg_or_8bit_operand" "0,rI")))]
2927 [(set_attr "type" "icmov")])
2929 (define_insn "*movdicc_lbs"
2930 [(set (match_operand:DI 0 "register_operand" "=r,r")
2932 (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
2936 (match_operand:DI 1 "reg_or_8bit_operand" "rI,0")
2937 (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))]
2942 [(set_attr "type" "icmov")])
2944 ;; For ABS, we have two choices, depending on whether the input and output
2945 ;; registers are the same or not.
2946 (define_expand "absdi2"
2947 [(set (match_operand:DI 0 "register_operand" "")
2948 (abs:DI (match_operand:DI 1 "register_operand" "")))]
2951 if (rtx_equal_p (operands[0], operands[1]))
2952 emit_insn (gen_absdi2_same (operands[0], gen_reg_rtx (DImode)));
2954 emit_insn (gen_absdi2_diff (operands[0], operands[1]));
2958 (define_expand "absdi2_same"
2959 [(set (match_operand:DI 1 "register_operand" "")
2960 (neg:DI (match_operand:DI 0 "register_operand" "")))
2962 (if_then_else:DI (ge (match_dup 0) (const_int 0))
2968 (define_expand "absdi2_diff"
2969 [(set (match_operand:DI 0 "register_operand" "")
2970 (neg:DI (match_operand:DI 1 "register_operand" "")))
2972 (if_then_else:DI (lt (match_dup 1) (const_int 0))
2979 [(set (match_operand:DI 0 "register_operand" "")
2980 (abs:DI (match_dup 0)))
2981 (clobber (match_operand:DI 1 "register_operand" ""))]
2983 [(set (match_dup 1) (neg:DI (match_dup 0)))
2984 (set (match_dup 0) (if_then_else:DI (ge (match_dup 0) (const_int 0))
2985 (match_dup 0) (match_dup 1)))]
2989 [(set (match_operand:DI 0 "register_operand" "")
2990 (abs:DI (match_operand:DI 1 "register_operand" "")))]
2991 "! rtx_equal_p (operands[0], operands[1])"
2992 [(set (match_dup 0) (neg:DI (match_dup 1)))
2993 (set (match_dup 0) (if_then_else:DI (lt (match_dup 1) (const_int 0))
2994 (match_dup 0) (match_dup 1)))]
2998 [(set (match_operand:DI 0 "register_operand" "")
2999 (neg:DI (abs:DI (match_dup 0))))
3000 (clobber (match_operand:DI 1 "register_operand" ""))]
3002 [(set (match_dup 1) (neg:DI (match_dup 0)))
3003 (set (match_dup 0) (if_then_else:DI (le (match_dup 0) (const_int 0))
3004 (match_dup 0) (match_dup 1)))]
3008 [(set (match_operand:DI 0 "register_operand" "")
3009 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" ""))))]
3010 "! rtx_equal_p (operands[0], operands[1])"
3011 [(set (match_dup 0) (neg:DI (match_dup 1)))
3012 (set (match_dup 0) (if_then_else:DI (gt (match_dup 1) (const_int 0))
3013 (match_dup 0) (match_dup 1)))]
3016 (define_insn "sminqi3"
3017 [(set (match_operand:QI 0 "register_operand" "=r")
3018 (smin:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
3019 (match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
3022 [(set_attr "type" "mvi")])
3024 (define_insn "uminqi3"
3025 [(set (match_operand:QI 0 "register_operand" "=r")
3026 (umin:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
3027 (match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
3030 [(set_attr "type" "mvi")])
3032 (define_insn "smaxqi3"
3033 [(set (match_operand:QI 0 "register_operand" "=r")
3034 (smax:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
3035 (match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
3038 [(set_attr "type" "mvi")])
3040 (define_insn "umaxqi3"
3041 [(set (match_operand:QI 0 "register_operand" "=r")
3042 (umax:QI (match_operand:QI 1 "reg_or_0_operand" "%rJ")
3043 (match_operand:QI 2 "reg_or_8bit_operand" "rI")))]
3046 [(set_attr "type" "mvi")])
3048 (define_insn "sminhi3"
3049 [(set (match_operand:HI 0 "register_operand" "=r")
3050 (smin:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
3051 (match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
3054 [(set_attr "type" "mvi")])
3056 (define_insn "uminhi3"
3057 [(set (match_operand:HI 0 "register_operand" "=r")
3058 (umin:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
3059 (match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
3062 [(set_attr "type" "mvi")])
3064 (define_insn "smaxhi3"
3065 [(set (match_operand:HI 0 "register_operand" "=r")
3066 (smax:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
3067 (match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
3070 [(set_attr "type" "mvi")])
3072 (define_insn "umaxhi3"
3073 [(set (match_operand:HI 0 "register_operand" "=r")
3074 (umax:HI (match_operand:HI 1 "reg_or_0_operand" "%rJ")
3075 (match_operand:HI 2 "reg_or_8bit_operand" "rI")))]
3078 [(set_attr "type" "shift")])
3080 (define_expand "smaxdi3"
3082 (le:DI (match_operand:DI 1 "reg_or_0_operand" "")
3083 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3084 (set (match_operand:DI 0 "register_operand" "")
3085 (if_then_else:DI (eq (match_dup 3) (const_int 0))
3086 (match_dup 1) (match_dup 2)))]
3088 { operands[3] = gen_reg_rtx (DImode); })
3091 [(set (match_operand:DI 0 "register_operand" "")
3092 (smax:DI (match_operand:DI 1 "reg_or_0_operand" "")
3093 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3094 (clobber (match_operand:DI 3 "register_operand" ""))]
3095 "operands[2] != const0_rtx"
3096 [(set (match_dup 3) (le:DI (match_dup 1) (match_dup 2)))
3097 (set (match_dup 0) (if_then_else:DI (eq (match_dup 3) (const_int 0))
3098 (match_dup 1) (match_dup 2)))]
3101 (define_insn "*smax_const0"
3102 [(set (match_operand:DI 0 "register_operand" "=r")
3103 (smax:DI (match_operand:DI 1 "register_operand" "0")
3107 [(set_attr "type" "icmov")])
3109 (define_expand "smindi3"
3111 (lt:DI (match_operand:DI 1 "reg_or_0_operand" "")
3112 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3113 (set (match_operand:DI 0 "register_operand" "")
3114 (if_then_else:DI (ne (match_dup 3) (const_int 0))
3115 (match_dup 1) (match_dup 2)))]
3117 { operands[3] = gen_reg_rtx (DImode); })
3120 [(set (match_operand:DI 0 "register_operand" "")
3121 (smin:DI (match_operand:DI 1 "reg_or_0_operand" "")
3122 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3123 (clobber (match_operand:DI 3 "register_operand" ""))]
3124 "operands[2] != const0_rtx"
3125 [(set (match_dup 3) (lt:DI (match_dup 1) (match_dup 2)))
3126 (set (match_dup 0) (if_then_else:DI (ne (match_dup 3) (const_int 0))
3127 (match_dup 1) (match_dup 2)))]
3130 (define_insn "*smin_const0"
3131 [(set (match_operand:DI 0 "register_operand" "=r")
3132 (smin:DI (match_operand:DI 1 "register_operand" "0")
3136 [(set_attr "type" "icmov")])
3138 (define_expand "umaxdi3"
3140 (leu:DI (match_operand:DI 1 "reg_or_0_operand" "")
3141 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3142 (set (match_operand:DI 0 "register_operand" "")
3143 (if_then_else:DI (eq (match_dup 3) (const_int 0))
3144 (match_dup 1) (match_dup 2)))]
3146 "operands[3] = gen_reg_rtx (DImode);")
3149 [(set (match_operand:DI 0 "register_operand" "")
3150 (umax:DI (match_operand:DI 1 "reg_or_0_operand" "")
3151 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3152 (clobber (match_operand:DI 3 "register_operand" ""))]
3153 "operands[2] != const0_rtx"
3154 [(set (match_dup 3) (leu:DI (match_dup 1) (match_dup 2)))
3155 (set (match_dup 0) (if_then_else:DI (eq (match_dup 3) (const_int 0))
3156 (match_dup 1) (match_dup 2)))]
3159 (define_expand "umindi3"
3161 (ltu:DI (match_operand:DI 1 "reg_or_0_operand" "")
3162 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3163 (set (match_operand:DI 0 "register_operand" "")
3164 (if_then_else:DI (ne (match_dup 3) (const_int 0))
3165 (match_dup 1) (match_dup 2)))]
3167 "operands[3] = gen_reg_rtx (DImode);")
3170 [(set (match_operand:DI 0 "register_operand" "")
3171 (umin:DI (match_operand:DI 1 "reg_or_0_operand" "")
3172 (match_operand:DI 2 "reg_or_8bit_operand" "")))
3173 (clobber (match_operand:DI 3 "register_operand" ""))]
3174 "operands[2] != const0_rtx"
3175 [(set (match_dup 3) (ltu:DI (match_dup 1) (match_dup 2)))
3176 (set (match_dup 0) (if_then_else:DI (ne (match_dup 3) (const_int 0))
3177 (match_dup 1) (match_dup 2)))]
3180 (define_insn "*bcc_normal"
3183 (match_operator 1 "signed_comparison_operator"
3184 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
3186 (label_ref (match_operand 0 "" ""))
3190 [(set_attr "type" "ibr")])
3192 (define_insn "*bcc_reverse"
3195 (match_operator 1 "signed_comparison_operator"
3196 [(match_operand:DI 2 "register_operand" "r")
3200 (label_ref (match_operand 0 "" ""))))]
3203 [(set_attr "type" "ibr")])
3205 (define_insn "*blbs_normal"
3208 (ne (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
3212 (label_ref (match_operand 0 "" ""))
3216 [(set_attr "type" "ibr")])
3218 (define_insn "*blbc_normal"
3221 (eq (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
3225 (label_ref (match_operand 0 "" ""))
3229 [(set_attr "type" "ibr")])
3235 (match_operator 1 "comparison_operator"
3236 [(zero_extract:DI (match_operand:DI 2 "register_operand" "")
3238 (match_operand:DI 3 "const_int_operand" ""))
3240 (label_ref (match_operand 0 "" ""))
3242 (clobber (match_operand:DI 4 "register_operand" ""))])]
3243 "INTVAL (operands[3]) != 0"
3245 (lshiftrt:DI (match_dup 2) (match_dup 3)))
3247 (if_then_else (match_op_dup 1
3248 [(zero_extract:DI (match_dup 4)
3252 (label_ref (match_dup 0))
3256 ;; The following are the corresponding floating-point insns. Recall
3257 ;; we need to have variants that expand the arguments from SFmode
3260 (define_insn "*cmpdf_ieee"
3261 [(set (match_operand:DF 0 "register_operand" "=&f")
3262 (match_operator:DF 1 "alpha_fp_comparison_operator"
3263 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
3264 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
3265 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
3266 "cmp%-%C1%/ %R2,%R3,%0"
3267 [(set_attr "type" "fadd")
3268 (set_attr "trap" "yes")
3269 (set_attr "trap_suffix" "su")])
3271 (define_insn "*cmpdf_internal"
3272 [(set (match_operand:DF 0 "register_operand" "=f")
3273 (match_operator:DF 1 "alpha_fp_comparison_operator"
3274 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
3275 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
3276 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
3277 "cmp%-%C1%/ %R2,%R3,%0"
3278 [(set_attr "type" "fadd")
3279 (set_attr "trap" "yes")
3280 (set_attr "trap_suffix" "su")])
3282 (define_insn "*cmpdf_ieee_ext1"
3283 [(set (match_operand:DF 0 "register_operand" "=&f")
3284 (match_operator:DF 1 "alpha_fp_comparison_operator"
3286 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
3287 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
3288 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
3289 "cmp%-%C1%/ %R2,%R3,%0"
3290 [(set_attr "type" "fadd")
3291 (set_attr "trap" "yes")
3292 (set_attr "trap_suffix" "su")])
3294 (define_insn "*cmpdf_ext1"
3295 [(set (match_operand:DF 0 "register_operand" "=f")
3296 (match_operator:DF 1 "alpha_fp_comparison_operator"
3298 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
3299 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
3300 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
3301 "cmp%-%C1%/ %R2,%R3,%0"
3302 [(set_attr "type" "fadd")
3303 (set_attr "trap" "yes")
3304 (set_attr "trap_suffix" "su")])
3306 (define_insn "*cmpdf_ieee_ext2"
3307 [(set (match_operand:DF 0 "register_operand" "=&f")
3308 (match_operator:DF 1 "alpha_fp_comparison_operator"
3309 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
3311 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
3312 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
3313 "cmp%-%C1%/ %R2,%R3,%0"
3314 [(set_attr "type" "fadd")
3315 (set_attr "trap" "yes")
3316 (set_attr "trap_suffix" "su")])
3318 (define_insn "*cmpdf_ext2"
3319 [(set (match_operand:DF 0 "register_operand" "=f")
3320 (match_operator:DF 1 "alpha_fp_comparison_operator"
3321 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
3323 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
3324 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
3325 "cmp%-%C1%/ %R2,%R3,%0"
3326 [(set_attr "type" "fadd")
3327 (set_attr "trap" "yes")
3328 (set_attr "trap_suffix" "su")])
3330 (define_insn "*cmpdf_ieee_ext3"
3331 [(set (match_operand:DF 0 "register_operand" "=&f")
3332 (match_operator:DF 1 "alpha_fp_comparison_operator"
3334 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
3336 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
3337 "TARGET_FP && alpha_fptm >= ALPHA_FPTM_SU"
3338 "cmp%-%C1%/ %R2,%R3,%0"
3339 [(set_attr "type" "fadd")
3340 (set_attr "trap" "yes")
3341 (set_attr "trap_suffix" "su")])
3343 (define_insn "*cmpdf_ext3"
3344 [(set (match_operand:DF 0 "register_operand" "=f")
3345 (match_operator:DF 1 "alpha_fp_comparison_operator"
3347 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
3349 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
3350 "TARGET_FP && alpha_fptm < ALPHA_FPTM_SU"
3351 "cmp%-%C1%/ %R2,%R3,%0"
3352 [(set_attr "type" "fadd")
3353 (set_attr "trap" "yes")
3354 (set_attr "trap_suffix" "su")])
3356 (define_insn "*movdfcc_internal"
3357 [(set (match_operand:DF 0 "register_operand" "=f,f")
3359 (match_operator 3 "signed_comparison_operator"
3360 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
3361 (match_operand:DF 2 "fp0_operand" "G,G")])
3362 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
3363 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
3367 fcmov%D3 %R4,%R5,%0"
3368 [(set_attr "type" "fcmov")])
3370 (define_insn "*movsfcc_internal"
3371 [(set (match_operand:SF 0 "register_operand" "=f,f")
3373 (match_operator 3 "signed_comparison_operator"
3374 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
3375 (match_operand:DF 2 "fp0_operand" "G,G")])
3376 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
3377 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
3381 fcmov%D3 %R4,%R5,%0"
3382 [(set_attr "type" "fcmov")])
3384 (define_insn "*movdfcc_ext1"
3385 [(set (match_operand:DF 0 "register_operand" "=f,f")
3387 (match_operator 3 "signed_comparison_operator"
3388 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
3389 (match_operand:DF 2 "fp0_operand" "G,G")])
3390 (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
3391 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
3395 fcmov%D3 %R4,%R5,%0"
3396 [(set_attr "type" "fcmov")])
3398 (define_insn "*movdfcc_ext2"
3399 [(set (match_operand:DF 0 "register_operand" "=f,f")
3401 (match_operator 3 "signed_comparison_operator"
3403 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
3404 (match_operand:DF 2 "fp0_operand" "G,G")])
3405 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
3406 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
3410 fcmov%D3 %R4,%R5,%0"
3411 [(set_attr "type" "fcmov")])
3413 (define_insn "*movdfcc_ext3"
3414 [(set (match_operand:SF 0 "register_operand" "=f,f")
3416 (match_operator 3 "signed_comparison_operator"
3418 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
3419 (match_operand:DF 2 "fp0_operand" "G,G")])
3420 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
3421 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
3425 fcmov%D3 %R4,%R5,%0"
3426 [(set_attr "type" "fcmov")])
3428 (define_insn "*movdfcc_ext4"
3429 [(set (match_operand:DF 0 "register_operand" "=f,f")
3431 (match_operator 3 "signed_comparison_operator"
3433 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
3434 (match_operand:DF 2 "fp0_operand" "G,G")])
3435 (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
3436 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
3440 fcmov%D3 %R4,%R5,%0"
3441 [(set_attr "type" "fcmov")])
3443 (define_expand "maxdf3"
3445 (le:DF (match_operand:DF 1 "reg_or_fp0_operand" "")
3446 (match_operand:DF 2 "reg_or_fp0_operand" "")))
3447 (set (match_operand:DF 0 "register_operand" "")
3448 (if_then_else:DF (eq (match_dup 3) (match_dup 4))
3449 (match_dup 1) (match_dup 2)))]
3452 operands[3] = gen_reg_rtx (DFmode);
3453 operands[4] = CONST0_RTX (DFmode);
3456 (define_expand "mindf3"
3458 (lt:DF (match_operand:DF 1 "reg_or_fp0_operand" "")
3459 (match_operand:DF 2 "reg_or_fp0_operand" "")))
3460 (set (match_operand:DF 0 "register_operand" "")
3461 (if_then_else:DF (ne (match_dup 3) (match_dup 4))
3462 (match_dup 1) (match_dup 2)))]
3465 operands[3] = gen_reg_rtx (DFmode);
3466 operands[4] = CONST0_RTX (DFmode);
3469 (define_expand "maxsf3"
3471 (le:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))
3472 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" ""))))
3473 (set (match_operand:SF 0 "register_operand" "")
3474 (if_then_else:SF (eq (match_dup 3) (match_dup 4))
3475 (match_dup 1) (match_dup 2)))]
3478 operands[3] = gen_reg_rtx (DFmode);
3479 operands[4] = CONST0_RTX (DFmode);
3482 (define_expand "minsf3"
3484 (lt:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))
3485 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" ""))))
3486 (set (match_operand:SF 0 "register_operand" "")
3487 (if_then_else:SF (ne (match_dup 3) (match_dup 4))
3488 (match_dup 1) (match_dup 2)))]
3491 operands[3] = gen_reg_rtx (DFmode);
3492 operands[4] = CONST0_RTX (DFmode);
3495 (define_insn "*fbcc_normal"
3498 (match_operator 1 "signed_comparison_operator"
3499 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
3500 (match_operand:DF 3 "fp0_operand" "G")])
3501 (label_ref (match_operand 0 "" ""))
3505 [(set_attr "type" "fbr")])
3507 (define_insn "*fbcc_ext_normal"
3510 (match_operator 1 "signed_comparison_operator"
3512 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
3513 (match_operand:DF 3 "fp0_operand" "G")])
3514 (label_ref (match_operand 0 "" ""))
3518 [(set_attr "type" "fbr")])
3520 ;; These are the main define_expand's used to make conditional branches
3523 (define_expand "cmpdf"
3524 [(set (cc0) (compare (match_operand:DF 0 "reg_or_fp0_operand" "")
3525 (match_operand:DF 1 "reg_or_fp0_operand" "")))]
3528 alpha_compare.op0 = operands[0];
3529 alpha_compare.op1 = operands[1];
3530 alpha_compare.fp_p = 1;
3534 (define_expand "cmptf"
3535 [(set (cc0) (compare (match_operand:TF 0 "general_operand" "")
3536 (match_operand:TF 1 "general_operand" "")))]
3537 "TARGET_HAS_XFLOATING_LIBS"
3539 alpha_compare.op0 = operands[0];
3540 alpha_compare.op1 = operands[1];
3541 alpha_compare.fp_p = 1;
3545 (define_expand "cmpdi"
3546 [(set (cc0) (compare (match_operand:DI 0 "general_operand" "")
3547 (match_operand:DI 1 "general_operand" "")))]
3550 alpha_compare.op0 = operands[0];
3551 alpha_compare.op1 = operands[1];
3552 alpha_compare.fp_p = 0;
3556 (define_expand "beq"
3558 (if_then_else (match_dup 1)
3559 (label_ref (match_operand 0 "" ""))
3562 "{ operands[1] = alpha_emit_conditional_branch (EQ); }")
3564 (define_expand "bne"
3566 (if_then_else (match_dup 1)
3567 (label_ref (match_operand 0 "" ""))
3570 "{ operands[1] = alpha_emit_conditional_branch (NE); }")
3572 (define_expand "blt"
3574 (if_then_else (match_dup 1)
3575 (label_ref (match_operand 0 "" ""))
3578 "{ operands[1] = alpha_emit_conditional_branch (LT); }")
3580 (define_expand "ble"
3582 (if_then_else (match_dup 1)
3583 (label_ref (match_operand 0 "" ""))
3586 "{ operands[1] = alpha_emit_conditional_branch (LE); }")
3588 (define_expand "bgt"
3590 (if_then_else (match_dup 1)
3591 (label_ref (match_operand 0 "" ""))
3594 "{ operands[1] = alpha_emit_conditional_branch (GT); }")
3596 (define_expand "bge"
3598 (if_then_else (match_dup 1)
3599 (label_ref (match_operand 0 "" ""))
3602 "{ operands[1] = alpha_emit_conditional_branch (GE); }")
3604 (define_expand "bltu"
3606 (if_then_else (match_dup 1)
3607 (label_ref (match_operand 0 "" ""))
3610 "{ operands[1] = alpha_emit_conditional_branch (LTU); }")
3612 (define_expand "bleu"
3614 (if_then_else (match_dup 1)
3615 (label_ref (match_operand 0 "" ""))
3618 "{ operands[1] = alpha_emit_conditional_branch (LEU); }")
3620 (define_expand "bgtu"
3622 (if_then_else (match_dup 1)
3623 (label_ref (match_operand 0 "" ""))
3626 "{ operands[1] = alpha_emit_conditional_branch (GTU); }")
3628 (define_expand "bgeu"
3630 (if_then_else (match_dup 1)
3631 (label_ref (match_operand 0 "" ""))
3634 "{ operands[1] = alpha_emit_conditional_branch (GEU); }")
3636 (define_expand "bunordered"
3638 (if_then_else (match_dup 1)
3639 (label_ref (match_operand 0 "" ""))
3642 "{ operands[1] = alpha_emit_conditional_branch (UNORDERED); }")
3644 (define_expand "bordered"
3646 (if_then_else (match_dup 1)
3647 (label_ref (match_operand 0 "" ""))
3650 "{ operands[1] = alpha_emit_conditional_branch (ORDERED); }")
3652 (define_expand "seq"
3653 [(set (match_operand:DI 0 "register_operand" "")
3656 "{ if ((operands[1] = alpha_emit_setcc (EQ)) == NULL_RTX) FAIL; }")
3658 (define_expand "sne"
3659 [(set (match_operand:DI 0 "register_operand" "")
3662 "{ if ((operands[1] = alpha_emit_setcc (NE)) == NULL_RTX) FAIL; }")
3664 (define_expand "slt"
3665 [(set (match_operand:DI 0 "register_operand" "")
3668 "{ if ((operands[1] = alpha_emit_setcc (LT)) == NULL_RTX) FAIL; }")
3670 (define_expand "sle"
3671 [(set (match_operand:DI 0 "register_operand" "")
3674 "{ if ((operands[1] = alpha_emit_setcc (LE)) == NULL_RTX) FAIL; }")
3676 (define_expand "sgt"
3677 [(set (match_operand:DI 0 "register_operand" "")
3680 "{ if ((operands[1] = alpha_emit_setcc (GT)) == NULL_RTX) FAIL; }")
3682 (define_expand "sge"
3683 [(set (match_operand:DI 0 "register_operand" "")
3686 "{ if ((operands[1] = alpha_emit_setcc (GE)) == NULL_RTX) FAIL; }")
3688 (define_expand "sltu"
3689 [(set (match_operand:DI 0 "register_operand" "")
3692 "{ if ((operands[1] = alpha_emit_setcc (LTU)) == NULL_RTX) FAIL; }")
3694 (define_expand "sleu"
3695 [(set (match_operand:DI 0 "register_operand" "")
3698 "{ if ((operands[1] = alpha_emit_setcc (LEU)) == NULL_RTX) FAIL; }")
3700 (define_expand "sgtu"
3701 [(set (match_operand:DI 0 "register_operand" "")
3704 "{ if ((operands[1] = alpha_emit_setcc (GTU)) == NULL_RTX) FAIL; }")
3706 (define_expand "sgeu"
3707 [(set (match_operand:DI 0 "register_operand" "")
3710 "{ if ((operands[1] = alpha_emit_setcc (GEU)) == NULL_RTX) FAIL; }")
3712 (define_expand "sunordered"
3713 [(set (match_operand:DI 0 "register_operand" "")
3716 "{ if ((operands[1] = alpha_emit_setcc (UNORDERED)) == NULL_RTX) FAIL; }")
3718 (define_expand "sordered"
3719 [(set (match_operand:DI 0 "register_operand" "")
3722 "{ if ((operands[1] = alpha_emit_setcc (ORDERED)) == NULL_RTX) FAIL; }")
3724 ;; These are the main define_expand's used to make conditional moves.
3726 (define_expand "movsicc"
3727 [(set (match_operand:SI 0 "register_operand" "")
3728 (if_then_else:SI (match_operand 1 "comparison_operator" "")
3729 (match_operand:SI 2 "reg_or_8bit_operand" "")
3730 (match_operand:SI 3 "reg_or_8bit_operand" "")))]
3733 if ((operands[1] = alpha_emit_conditional_move (operands[1], SImode)) == 0)
3737 (define_expand "movdicc"
3738 [(set (match_operand:DI 0 "register_operand" "")
3739 (if_then_else:DI (match_operand 1 "comparison_operator" "")
3740 (match_operand:DI 2 "reg_or_8bit_operand" "")
3741 (match_operand:DI 3 "reg_or_8bit_operand" "")))]
3744 if ((operands[1] = alpha_emit_conditional_move (operands[1], DImode)) == 0)
3748 (define_expand "movsfcc"
3749 [(set (match_operand:SF 0 "register_operand" "")
3750 (if_then_else:SF (match_operand 1 "comparison_operator" "")
3751 (match_operand:SF 2 "reg_or_8bit_operand" "")
3752 (match_operand:SF 3 "reg_or_8bit_operand" "")))]
3755 if ((operands[1] = alpha_emit_conditional_move (operands[1], SFmode)) == 0)
3759 (define_expand "movdfcc"
3760 [(set (match_operand:DF 0 "register_operand" "")
3761 (if_then_else:DF (match_operand 1 "comparison_operator" "")
3762 (match_operand:DF 2 "reg_or_8bit_operand" "")
3763 (match_operand:DF 3 "reg_or_8bit_operand" "")))]
3766 if ((operands[1] = alpha_emit_conditional_move (operands[1], DFmode)) == 0)
3770 ;; These define_split definitions are used in cases when comparisons have
3771 ;; not be stated in the correct way and we need to reverse the second
3772 ;; comparison. For example, x >= 7 has to be done as x < 6 with the
3773 ;; comparison that tests the result being reversed. We have one define_split
3774 ;; for each use of a comparison. They do not match valid insns and need
3775 ;; not generate valid insns.
3777 ;; We can also handle equality comparisons (and inequality comparisons in
3778 ;; cases where the resulting add cannot overflow) by doing an add followed by
3779 ;; a comparison with zero. This is faster since the addition takes one
3780 ;; less cycle than a compare when feeding into a conditional move.
3781 ;; For this case, we also have an SImode pattern since we can merge the add
3782 ;; and sign extend and the order doesn't matter.
3784 ;; We do not do this for floating-point, since it isn't clear how the "wrong"
3785 ;; operation could have been generated.
3788 [(set (match_operand:DI 0 "register_operand" "")
3790 (match_operator 1 "comparison_operator"
3791 [(match_operand:DI 2 "reg_or_0_operand" "")
3792 (match_operand:DI 3 "reg_or_cint_operand" "")])
3793 (match_operand:DI 4 "reg_or_cint_operand" "")
3794 (match_operand:DI 5 "reg_or_cint_operand" "")))
3795 (clobber (match_operand:DI 6 "register_operand" ""))]
3796 "operands[3] != const0_rtx"
3797 [(set (match_dup 6) (match_dup 7))
3799 (if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]
3801 enum rtx_code code = GET_CODE (operands[1]);
3802 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
3804 /* If we are comparing for equality with a constant and that constant
3805 appears in the arm when the register equals the constant, use the
3806 register since that is more likely to match (and to produce better code
3809 if (code == EQ && GET_CODE (operands[3]) == CONST_INT
3810 && rtx_equal_p (operands[4], operands[3]))
3811 operands[4] = operands[2];
3813 else if (code == NE && GET_CODE (operands[3]) == CONST_INT
3814 && rtx_equal_p (operands[5], operands[3]))
3815 operands[5] = operands[2];
3817 if (code == NE || code == EQ
3818 || (extended_count (operands[2], DImode, unsignedp) >= 1
3819 && extended_count (operands[3], DImode, unsignedp) >= 1))
3821 if (GET_CODE (operands[3]) == CONST_INT)
3822 operands[7] = gen_rtx_PLUS (DImode, operands[2],
3823 GEN_INT (- INTVAL (operands[3])));
3825 operands[7] = gen_rtx_MINUS (DImode, operands[2], operands[3]);
3827 operands[8] = gen_rtx_fmt_ee (code, VOIDmode, operands[6], const0_rtx);
3830 else if (code == EQ || code == LE || code == LT
3831 || code == LEU || code == LTU)
3833 operands[7] = gen_rtx_fmt_ee (code, DImode, operands[2], operands[3]);
3834 operands[8] = gen_rtx_NE (VOIDmode, operands[6], const0_rtx);
3838 operands[7] = gen_rtx_fmt_ee (reverse_condition (code), DImode,
3839 operands[2], operands[3]);
3840 operands[8] = gen_rtx_EQ (VOIDmode, operands[6], const0_rtx);
3845 [(set (match_operand:DI 0 "register_operand" "")
3847 (match_operator 1 "comparison_operator"
3848 [(match_operand:SI 2 "reg_or_0_operand" "")
3849 (match_operand:SI 3 "reg_or_cint_operand" "")])
3850 (match_operand:DI 4 "reg_or_8bit_operand" "")
3851 (match_operand:DI 5 "reg_or_8bit_operand" "")))
3852 (clobber (match_operand:DI 6 "register_operand" ""))]
3853 "operands[3] != const0_rtx
3854 && (GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE)"
3855 [(set (match_dup 6) (match_dup 7))
3857 (if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]
3859 enum rtx_code code = GET_CODE (operands[1]);
3860 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
3863 if ((code != NE && code != EQ
3864 && ! (extended_count (operands[2], DImode, unsignedp) >= 1
3865 && extended_count (operands[3], DImode, unsignedp) >= 1)))
3868 if (GET_CODE (operands[3]) == CONST_INT)
3869 tem = gen_rtx_PLUS (SImode, operands[2],
3870 GEN_INT (- INTVAL (operands[3])));
3872 tem = gen_rtx_MINUS (SImode, operands[2], operands[3]);
3874 operands[7] = gen_rtx_SIGN_EXTEND (DImode, tem);
3875 operands[8] = gen_rtx_fmt_ee (GET_CODE (operands[1]), VOIDmode,
3876 operands[6], const0_rtx);
3882 (match_operator 1 "comparison_operator"
3883 [(match_operand:DI 2 "reg_or_0_operand" "")
3884 (match_operand:DI 3 "reg_or_cint_operand" "")])
3885 (label_ref (match_operand 0 "" ""))
3887 (clobber (match_operand:DI 4 "register_operand" ""))]
3888 "operands[3] != const0_rtx"
3889 [(set (match_dup 4) (match_dup 5))
3890 (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]
3892 enum rtx_code code = GET_CODE (operands[1]);
3893 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
3895 if (code == NE || code == EQ
3896 || (extended_count (operands[2], DImode, unsignedp) >= 1
3897 && extended_count (operands[3], DImode, unsignedp) >= 1))
3899 if (GET_CODE (operands[3]) == CONST_INT)
3900 operands[5] = gen_rtx_PLUS (DImode, operands[2],
3901 GEN_INT (- INTVAL (operands[3])));
3903 operands[5] = gen_rtx_MINUS (DImode, operands[2], operands[3]);
3905 operands[6] = gen_rtx_fmt_ee (code, VOIDmode, operands[4], const0_rtx);
3908 else if (code == EQ || code == LE || code == LT
3909 || code == LEU || code == LTU)
3911 operands[5] = gen_rtx_fmt_ee (code, DImode, operands[2], operands[3]);
3912 operands[6] = gen_rtx_NE (VOIDmode, operands[4], const0_rtx);
3916 operands[5] = gen_rtx_fmt_ee (reverse_condition (code), DImode,
3917 operands[2], operands[3]);
3918 operands[6] = gen_rtx_EQ (VOIDmode, operands[4], const0_rtx);
3925 (match_operator 1 "comparison_operator"
3926 [(match_operand:SI 2 "reg_or_0_operand" "")
3927 (match_operand:SI 3 "const_int_operand" "")])
3928 (label_ref (match_operand 0 "" ""))
3930 (clobber (match_operand:DI 4 "register_operand" ""))]
3931 "operands[3] != const0_rtx
3932 && (GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE)"
3933 [(set (match_dup 4) (match_dup 5))
3934 (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]
3938 if (GET_CODE (operands[3]) == CONST_INT)
3939 tem = gen_rtx_PLUS (SImode, operands[2],
3940 GEN_INT (- INTVAL (operands[3])));
3942 tem = gen_rtx_MINUS (SImode, operands[2], operands[3]);
3944 operands[5] = gen_rtx_SIGN_EXTEND (DImode, tem);
3945 operands[6] = gen_rtx_fmt_ee (GET_CODE (operands[1]), VOIDmode,
3946 operands[4], const0_rtx);
3949 ;; We can convert such things as "a > 0xffff" to "t = a & ~ 0xffff; t != 0".
3950 ;; This eliminates one, and sometimes two, insns when the AND can be done
3953 [(set (match_operand:DI 0 "register_operand" "")
3954 (match_operator:DI 1 "comparison_operator"
3955 [(match_operand:DI 2 "register_operand" "")
3956 (match_operand:DI 3 "const_int_operand" "")]))
3957 (clobber (match_operand:DI 4 "register_operand" ""))]
3958 "exact_log2 (INTVAL (operands[3]) + 1) >= 0
3959 && (GET_CODE (operands[1]) == GTU
3960 || GET_CODE (operands[1]) == LEU
3961 || ((GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == LE)
3962 && extended_count (operands[2], DImode, 1) > 0))"
3963 [(set (match_dup 4) (and:DI (match_dup 2) (match_dup 5)))
3964 (set (match_dup 0) (match_dup 6))]
3966 operands[5] = GEN_INT (~ INTVAL (operands[3]));
3967 operands[6] = gen_rtx_fmt_ee (((GET_CODE (operands[1]) == GTU
3968 || GET_CODE (operands[1]) == GT)
3970 DImode, operands[4], const0_rtx);
3973 ;; Prefer to use cmp and arithmetic when possible instead of a cmove.
3976 [(set (match_operand 0 "register_operand" "")
3977 (if_then_else (match_operator 1 "signed_comparison_operator"
3978 [(match_operand:DI 2 "reg_or_0_operand" "")
3980 (match_operand 3 "const_int_operand" "")
3981 (match_operand 4 "const_int_operand" "")))]
3985 if (alpha_split_conditional_move (GET_CODE (operands[1]), operands[0],
3986 operands[2], operands[3], operands[4]))
3992 ;; ??? Why combine is allowed to create such non-canonical rtl, I don't know.
3993 ;; Oh well, we match it in movcc, so it must be partially our fault.
3995 [(set (match_operand 0 "register_operand" "")
3996 (if_then_else (match_operator 1 "signed_comparison_operator"
3998 (match_operand:DI 2 "reg_or_0_operand" "")])
3999 (match_operand 3 "const_int_operand" "")
4000 (match_operand 4 "const_int_operand" "")))]
4004 if (alpha_split_conditional_move (swap_condition (GET_CODE (operands[1])),
4005 operands[0], operands[2], operands[3],
4012 (define_insn_and_split "*cmp_sadd_di"
4013 [(set (match_operand:DI 0 "register_operand" "=r")
4014 (plus:DI (if_then_else:DI
4015 (match_operator 1 "alpha_zero_comparison_operator"
4016 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4018 (match_operand:DI 3 "const48_operand" "I")
4020 (match_operand:DI 4 "sext_add_operand" "rIO")))
4021 (clobber (match_scratch:DI 5 "=r"))]
4024 "! no_new_pseudos || reload_completed"
4026 (match_op_dup:DI 1 [(match_dup 2) (const_int 0)]))
4028 (plus:DI (mult:DI (match_dup 5) (match_dup 3))
4031 if (! no_new_pseudos)
4032 operands[5] = gen_reg_rtx (DImode);
4033 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4034 operands[5] = operands[0];
4037 (define_insn_and_split "*cmp_sadd_si"
4038 [(set (match_operand:SI 0 "register_operand" "=r")
4039 (plus:SI (if_then_else:SI
4040 (match_operator 1 "alpha_zero_comparison_operator"
4041 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4043 (match_operand:SI 3 "const48_operand" "I")
4045 (match_operand:SI 4 "sext_add_operand" "rIO")))
4046 (clobber (match_scratch:SI 5 "=r"))]
4049 "! no_new_pseudos || reload_completed"
4051 (match_op_dup:SI 1 [(match_dup 2) (const_int 0)]))
4053 (plus:SI (mult:SI (match_dup 5) (match_dup 3))
4056 if (! no_new_pseudos)
4057 operands[5] = gen_reg_rtx (DImode);
4058 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4059 operands[5] = operands[0];
4062 (define_insn_and_split "*cmp_sadd_sidi"
4063 [(set (match_operand:DI 0 "register_operand" "=r")
4065 (plus:SI (if_then_else:SI
4066 (match_operator 1 "alpha_zero_comparison_operator"
4067 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4069 (match_operand:SI 3 "const48_operand" "I")
4071 (match_operand:SI 4 "sext_add_operand" "rIO"))))
4072 (clobber (match_scratch:SI 5 "=r"))]
4075 "! no_new_pseudos || reload_completed"
4077 (match_op_dup:SI 1 [(match_dup 2) (const_int 0)]))
4079 (sign_extend:DI (plus:SI (mult:SI (match_dup 5) (match_dup 3))
4082 if (! no_new_pseudos)
4083 operands[5] = gen_reg_rtx (DImode);
4084 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4085 operands[5] = operands[0];
4088 (define_insn_and_split "*cmp_ssub_di"
4089 [(set (match_operand:DI 0 "register_operand" "=r")
4090 (minus:DI (if_then_else:DI
4091 (match_operator 1 "alpha_zero_comparison_operator"
4092 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4094 (match_operand:DI 3 "const48_operand" "I")
4096 (match_operand:DI 4 "reg_or_8bit_operand" "rI")))
4097 (clobber (match_scratch:DI 5 "=r"))]
4100 "! no_new_pseudos || reload_completed"
4102 (match_op_dup:DI 1 [(match_dup 2) (const_int 0)]))
4104 (minus:DI (mult:DI (match_dup 5) (match_dup 3))
4107 if (! no_new_pseudos)
4108 operands[5] = gen_reg_rtx (DImode);
4109 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4110 operands[5] = operands[0];
4113 (define_insn_and_split "*cmp_ssub_si"
4114 [(set (match_operand:SI 0 "register_operand" "=r")
4115 (minus:SI (if_then_else:SI
4116 (match_operator 1 "alpha_zero_comparison_operator"
4117 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4119 (match_operand:SI 3 "const48_operand" "I")
4121 (match_operand:SI 4 "reg_or_8bit_operand" "rI")))
4122 (clobber (match_scratch:SI 5 "=r"))]
4125 "! no_new_pseudos || reload_completed"
4127 (match_op_dup:SI 1 [(match_dup 2) (const_int 0)]))
4129 (minus:SI (mult:SI (match_dup 5) (match_dup 3))
4132 if (! no_new_pseudos)
4133 operands[5] = gen_reg_rtx (DImode);
4134 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4135 operands[5] = operands[0];
4138 (define_insn_and_split "*cmp_ssub_sidi"
4139 [(set (match_operand:DI 0 "register_operand" "=r")
4141 (minus:SI (if_then_else:SI
4142 (match_operator 1 "alpha_zero_comparison_operator"
4143 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
4145 (match_operand:SI 3 "const48_operand" "I")
4147 (match_operand:SI 4 "reg_or_8bit_operand" "rI"))))
4148 (clobber (match_scratch:SI 5 "=r"))]
4151 "! no_new_pseudos || reload_completed"
4153 (match_op_dup:SI 1 [(match_dup 2) (const_int 0)]))
4155 (sign_extend:DI (minus:SI (mult:SI (match_dup 5) (match_dup 3))
4158 if (! no_new_pseudos)
4159 operands[5] = gen_reg_rtx (DImode);
4160 else if (reg_overlap_mentioned_p (operands[5], operands[4]))
4161 operands[5] = operands[0];
4164 ;; Here are the CALL and unconditional branch insns. Calls on NT and OSF
4165 ;; work differently, so we have different patterns for each.
4167 (define_expand "call"
4168 [(use (match_operand:DI 0 "" ""))
4169 (use (match_operand 1 "" ""))
4170 (use (match_operand 2 "" ""))
4171 (use (match_operand 3 "" ""))]
4174 if (TARGET_ABI_WINDOWS_NT)
4175 emit_call_insn (gen_call_nt (operands[0], operands[1]));
4176 else if (TARGET_ABI_OPEN_VMS)
4177 emit_call_insn (gen_call_vms (operands[0], operands[2]));
4179 emit_call_insn (gen_call_osf (operands[0], operands[1]));
4183 (define_expand "sibcall"
4184 [(call (mem:DI (match_operand 0 "" ""))
4185 (match_operand 1 "" ""))]
4188 if (GET_CODE (operands[0]) != MEM)
4190 operands[0] = XEXP (operands[0], 0);
4193 (define_expand "call_osf"
4194 [(parallel [(call (mem:DI (match_operand 0 "" ""))
4195 (match_operand 1 "" ""))
4196 (clobber (reg:DI 27))
4197 (clobber (reg:DI 26))])]
4200 if (GET_CODE (operands[0]) != MEM)
4203 operands[0] = XEXP (operands[0], 0);
4205 if (GET_CODE (operands[0]) != SYMBOL_REF
4206 && ! (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == 27))
4208 rtx tem = gen_rtx_REG (DImode, 27);
4209 emit_move_insn (tem, operands[0]);
4214 (define_expand "call_nt"
4215 [(parallel [(call (mem:DI (match_operand 0 "" ""))
4216 (match_operand 1 "" ""))
4217 (clobber (reg:DI 26))])]
4220 if (GET_CODE (operands[0]) != MEM)
4223 operands[0] = XEXP (operands[0], 0);
4224 if (GET_CODE (operands[0]) != SYMBOL_REF && GET_CODE (operands[0]) != REG)
4225 operands[0] = force_reg (DImode, operands[0]);
4229 ;; call openvms/alpha
4230 ;; op 0: symbol ref for called function
4231 ;; op 1: next_arg_reg (argument information value for R25)
4233 (define_expand "call_vms"
4234 [(parallel [(call (mem:DI (match_operand 0 "" ""))
4235 (match_operand 1 "" ""))
4239 (clobber (reg:DI 27))])]
4242 if (GET_CODE (operands[0]) != MEM)
4245 operands[0] = XEXP (operands[0], 0);
4247 /* Always load AI with argument information, then handle symbolic and
4248 indirect call differently. Load RA and set operands[2] to PV in
4251 emit_move_insn (gen_rtx_REG (DImode, 25), operands[1]);
4252 if (GET_CODE (operands[0]) == SYMBOL_REF)
4254 rtx linkage = alpha_need_linkage (XSTR (operands[0], 0), 0);
4256 emit_move_insn (gen_rtx_REG (Pmode, 26), gen_rtx_MEM (Pmode, linkage));
4258 = validize_mem (gen_rtx_MEM (Pmode, plus_constant (linkage, 8)));
4262 emit_move_insn (gen_rtx_REG (Pmode, 26),
4263 gen_rtx_MEM (Pmode, plus_constant (operands[0], 8)));
4264 operands[2] = operands[0];
4269 (define_expand "call_value"
4270 [(use (match_operand 0 "" ""))
4271 (use (match_operand:DI 1 "" ""))
4272 (use (match_operand 2 "" ""))
4273 (use (match_operand 3 "" ""))
4274 (use (match_operand 4 "" ""))]
4277 if (TARGET_ABI_WINDOWS_NT)
4278 emit_call_insn (gen_call_value_nt (operands[0], operands[1], operands[2]));
4279 else if (TARGET_ABI_OPEN_VMS)
4280 emit_call_insn (gen_call_value_vms (operands[0], operands[1],
4283 emit_call_insn (gen_call_value_osf (operands[0], operands[1],
4288 (define_expand "sibcall_value"
4289 [(set (match_operand 0 "" "")
4290 (call (mem:DI (match_operand 1 "" ""))
4291 (match_operand 2 "" "")))]
4294 if (GET_CODE (operands[1]) != MEM)
4296 operands[1] = XEXP (operands[1], 0);
4299 (define_expand "call_value_osf"
4300 [(parallel [(set (match_operand 0 "" "")
4301 (call (mem:DI (match_operand 1 "" ""))
4302 (match_operand 2 "" "")))
4303 (clobber (reg:DI 27))
4304 (clobber (reg:DI 26))])]
4307 if (GET_CODE (operands[1]) != MEM)
4310 operands[1] = XEXP (operands[1], 0);
4312 if (GET_CODE (operands[1]) != SYMBOL_REF
4313 && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
4315 rtx tem = gen_rtx_REG (DImode, 27);
4316 emit_move_insn (tem, operands[1]);
4321 (define_expand "call_value_nt"
4322 [(parallel [(set (match_operand 0 "" "")
4323 (call (mem:DI (match_operand 1 "" ""))
4324 (match_operand 2 "" "")))
4325 (clobber (reg:DI 26))])]
4328 if (GET_CODE (operands[1]) != MEM)
4331 operands[1] = XEXP (operands[1], 0);
4332 if (GET_CODE (operands[1]) != SYMBOL_REF && GET_CODE (operands[1]) != REG)
4333 operands[1] = force_reg (DImode, operands[1]);
4336 (define_expand "call_value_vms"
4337 [(parallel [(set (match_operand 0 "" "")
4338 (call (mem:DI (match_operand:DI 1 "" ""))
4339 (match_operand 2 "" "")))
4343 (clobber (reg:DI 27))])]
4346 if (GET_CODE (operands[1]) != MEM)
4349 operands[1] = XEXP (operands[1], 0);
4351 /* Always load AI with argument information, then handle symbolic and
4352 indirect call differently. Load RA and set operands[3] to PV in
4355 emit_move_insn (gen_rtx_REG (DImode, 25), operands[2]);
4356 if (GET_CODE (operands[1]) == SYMBOL_REF)
4358 rtx linkage = alpha_need_linkage (XSTR (operands[1], 0), 0);
4360 emit_move_insn (gen_rtx_REG (Pmode, 26), gen_rtx_MEM (Pmode, linkage));
4362 = validize_mem (gen_rtx_MEM (Pmode, plus_constant (linkage, 8)));
4366 emit_move_insn (gen_rtx_REG (Pmode, 26),
4367 gen_rtx_MEM (Pmode, plus_constant (operands[1], 8)));
4368 operands[3] = operands[1];
4372 (define_insn "*call_osf_1_er_noreturn"
4373 [(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
4374 (match_operand 1 "" ""))
4375 (clobber (reg:DI 27))
4376 (clobber (reg:DI 26))]
4377 "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF
4378 && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
4382 ldq $27,%0($29)\t\t!literal!%#\;jsr $26,($27),%0\t\t!lituse_jsr!%#"
4383 [(set_attr "type" "jsr")
4384 (set_attr "length" "*,*,8")])
4386 (define_insn "*call_osf_1_er"
4387 [(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
4388 (match_operand 1 "" ""))
4389 (clobber (reg:DI 27))
4390 (clobber (reg:DI 26))]
4391 "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
4393 jsr $26,($27),0\;ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*
4395 ldq $27,%0($29)\t\t!literal!%#\;jsr $26,($27),%0\t\t!lituse_jsr!%#\;ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*"
4396 [(set_attr "type" "jsr")
4397 (set_attr "length" "12,*,16")])
4399 (define_insn "*call_osf_1_noreturn"
4400 [(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
4401 (match_operand 1 "" ""))
4402 (clobber (reg:DI 27))
4403 (clobber (reg:DI 26))]
4404 "TARGET_ABI_OSF && find_reg_note (insn, REG_NORETURN, NULL_RTX)"
4409 [(set_attr "type" "jsr")
4410 (set_attr "length" "*,*,8")])
4412 (define_insn "*call_osf_1"
4413 [(call (mem:DI (match_operand:DI 0 "call_operand" "c,R,i"))
4414 (match_operand 1 "" ""))
4415 (clobber (reg:DI 27))
4416 (clobber (reg:DI 26))]
4419 jsr $26,($27),0\;ldgp $29,0($26)
4421 jsr $26,%0\;ldgp $29,0($26)"
4422 [(set_attr "type" "jsr")
4423 (set_attr "length" "12,*,16")])
4425 (define_insn "*sibcall_osf_1"
4426 [(call (mem:DI (match_operand:DI 0 "current_file_function_operand" "R"))
4427 (match_operand 1 "" ""))]
4430 [(set_attr "type" "jsr")])
4432 (define_insn "*call_nt_1"
4433 [(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,i"))
4434 (match_operand 1 "" ""))
4435 (clobber (reg:DI 26))]
4436 "TARGET_ABI_WINDOWS_NT"
4441 [(set_attr "type" "jsr")
4442 (set_attr "length" "*,*,12")])
4444 (define_insn "*call_vms_1"
4445 [(call (mem:DI (match_operand:DI 0 "call_operand" "r,i"))
4446 (match_operand 1 "" ""))
4447 (use (match_operand:DI 2 "nonimmediate_operand" "r,m"))
4450 (clobber (reg:DI 27))]
4451 "TARGET_ABI_OPEN_VMS"
4453 mov %2,$27\;jsr $26,0\;ldq $27,0($29)
4454 ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)"
4455 [(set_attr "type" "jsr")
4456 (set_attr "length" "12,16")])
4458 ;; Call subroutine returning any type.
4460 (define_expand "untyped_call"
4461 [(parallel [(call (match_operand 0 "" "")
4463 (match_operand 1 "" "")
4464 (match_operand 2 "" "")])]
4469 emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, const0_rtx));
4471 for (i = 0; i < XVECLEN (operands[2], 0); i++)
4473 rtx set = XVECEXP (operands[2], 0, i);
4474 emit_move_insn (SET_DEST (set), SET_SRC (set));
4477 /* The optimizer does not know that the call sets the function value
4478 registers we stored in the result block. We avoid problems by
4479 claiming that all hard registers are used and clobbered at this
4481 emit_insn (gen_blockage ());
4486 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
4487 ;; all of memory. This blocks insns from being moved across this point.
4489 (define_insn "blockage"
4490 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)]
4493 [(set_attr "length" "0")])
4497 (label_ref (match_operand 0 "" "")))]
4500 [(set_attr "type" "ibr")])
4502 (define_expand "return"
4507 (define_insn "*return_internal"
4511 [(set_attr "type" "ibr")])
4513 (define_insn "indirect_jump"
4514 [(set (pc) (match_operand:DI 0 "register_operand" "r"))]
4517 [(set_attr "type" "ibr")])
4519 (define_expand "tablejump"
4520 [(use (match_operand:SI 0 "register_operand" ""))
4521 (use (match_operand:SI 1 "" ""))]
4524 if (TARGET_ABI_WINDOWS_NT)
4525 emit_jump_insn (gen_tablejump_nt (operands[0], operands[1]));
4526 else if (TARGET_ABI_OPEN_VMS)
4527 emit_jump_insn (gen_tablejump_vms (operands[0], operands[1]));
4529 emit_jump_insn (gen_tablejump_osf (operands[0], operands[1]));
4534 (define_expand "tablejump_osf"
4536 (sign_extend:DI (match_operand:SI 0 "register_operand" "")))
4538 (plus:DI (reg:DI 29) (match_dup 3)))
4539 (parallel [(set (pc)
4541 (use (label_ref (match_operand 1 "" "")))])]
4543 { operands[3] = gen_reg_rtx (DImode); })
4545 (define_expand "tablejump_nt"
4547 (sign_extend:DI (match_operand:SI 0 "register_operand" "")))
4548 (parallel [(set (pc)
4550 (use (label_ref (match_operand 1 "" "")))])]
4552 { operands[3] = gen_reg_rtx (DImode); })
4555 ;; tablejump, openVMS way
4557 ;; op 1: label preceding jump-table
4559 (define_expand "tablejump_vms"
4561 (match_operand:DI 0 "register_operand" ""))
4563 (plus:DI (match_dup 2)
4564 (label_ref (match_operand 1 "" ""))))]
4566 { operands[2] = gen_reg_rtx (DImode); })
4568 (define_insn "*tablejump_osf_nt_internal"
4570 (match_operand:DI 0 "register_operand" "r"))
4571 (use (label_ref (match_operand 1 "" "")))]
4572 "(TARGET_ABI_OSF || TARGET_ABI_WINDOWS_NT)
4573 && alpha_tablejump_addr_vec (insn)"
4575 operands[2] = alpha_tablejump_best_label (insn);
4576 return "jmp $31,(%0),%2";
4578 [(set_attr "type" "ibr")])
4581 ;; op 0 is table offset
4582 ;; op 1 is table label
4585 (define_insn "*tablejump_vms_internal"
4587 (plus (match_operand:DI 0 "register_operand" "r")
4588 (label_ref (match_operand 1 "" ""))))]
4589 "TARGET_ABI_OPEN_VMS"
4591 [(set_attr "type" "ibr")])
4593 ;; Cache flush. Used by INITIALIZE_TRAMPOLINE. 0x86 is PAL_imb, but we don't
4594 ;; want to have to include pal.h in our .s file.
4596 ;; Technically the type for call_pal is jsr, but we use that for determining
4597 ;; if we need a GP. Use ibr instead since it has the same EV5 scheduling
4600 [(unspec_volatile [(const_int 0)] UNSPECV_IMB)]
4603 [(set_attr "type" "ibr")])
4605 ;; Finally, we have the basic data motion insns. The byte and word insns
4606 ;; are done via define_expand. Start with the floating-point insns, since
4607 ;; they are simpler.
4609 (define_insn "*movsf_nofix"
4610 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,*r,*r,m,m")
4611 (match_operand:SF 1 "input_operand" "fG,m,*rG,m,fG,*r"))]
4612 "TARGET_FPREGS && ! TARGET_FIX
4613 && (register_operand (operands[0], SFmode)
4614 || reg_or_fp0_operand (operands[1], SFmode))"
4622 [(set_attr "type" "fcpys,fld,ilog,ild,fst,ist")])
4624 (define_insn "*movsf_fix"
4625 [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,*r,*r,m,m,f,*r")
4626 (match_operand:SF 1 "input_operand" "fG,m,*rG,m,fG,*r,*r,f"))]
4627 "TARGET_FPREGS && TARGET_FIX
4628 && (register_operand (operands[0], SFmode)
4629 || reg_or_fp0_operand (operands[1], SFmode))"
4639 [(set_attr "type" "fcpys,fld,ilog,ild,fst,ist,itof,ftoi")])
4641 (define_insn "*movsf_nofp"
4642 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m")
4643 (match_operand:SF 1 "input_operand" "rG,m,r"))]
4645 && (register_operand (operands[0], SFmode)
4646 || reg_or_fp0_operand (operands[1], SFmode))"
4651 [(set_attr "type" "ilog,ild,ist")])
4653 (define_insn "*movdf_nofix"
4654 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,*r,*r,m,m")
4655 (match_operand:DF 1 "input_operand" "fG,m,*rG,m,fG,*r"))]
4656 "TARGET_FPREGS && ! TARGET_FIX
4657 && (register_operand (operands[0], DFmode)
4658 || reg_or_fp0_operand (operands[1], DFmode))"
4666 [(set_attr "type" "fcpys,fld,ilog,ild,fst,ist")])
4668 (define_insn "*movdf_fix"
4669 [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,*r,*r,m,m,f,*r")
4670 (match_operand:DF 1 "input_operand" "fG,m,*rG,m,fG,*r,*r,f"))]
4671 "TARGET_FPREGS && TARGET_FIX
4672 && (register_operand (operands[0], DFmode)
4673 || reg_or_fp0_operand (operands[1], DFmode))"
4683 [(set_attr "type" "fcpys,fld,ilog,ild,fst,ist,itof,ftoi")])
4685 (define_insn "*movdf_nofp"
4686 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m")
4687 (match_operand:DF 1 "input_operand" "rG,m,r"))]
4689 && (register_operand (operands[0], DFmode)
4690 || reg_or_fp0_operand (operands[1], DFmode))"
4695 [(set_attr "type" "ilog,ild,ist")])
4697 ;; Subregs suck for register allocation. Pretend we can move TFmode
4698 ;; data between general registers until after reload.
4700 (define_insn_and_split "*movtf_internal"
4701 [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o")
4702 (match_operand:TF 1 "input_operand" "roG,rG"))]
4703 "register_operand (operands[0], TFmode)
4704 || reg_or_fp0_operand (operands[1], TFmode)"
4707 [(set (match_dup 0) (match_dup 2))
4708 (set (match_dup 1) (match_dup 3))]
4710 alpha_split_tfmode_pair (operands);
4711 if (reg_overlap_mentioned_p (operands[0], operands[3]))
4714 tmp = operands[0], operands[0] = operands[1], operands[1] = tmp;
4715 tmp = operands[2], operands[2] = operands[3], operands[3] = tmp;
4719 (define_expand "movsf"
4720 [(set (match_operand:SF 0 "nonimmediate_operand" "")
4721 (match_operand:SF 1 "general_operand" ""))]
4724 if (GET_CODE (operands[0]) == MEM
4725 && ! reg_or_fp0_operand (operands[1], SFmode))
4726 operands[1] = force_reg (SFmode, operands[1]);
4729 (define_expand "movdf"
4730 [(set (match_operand:DF 0 "nonimmediate_operand" "")
4731 (match_operand:DF 1 "general_operand" ""))]
4734 if (GET_CODE (operands[0]) == MEM
4735 && ! reg_or_fp0_operand (operands[1], DFmode))
4736 operands[1] = force_reg (DFmode, operands[1]);
4739 (define_expand "movtf"
4740 [(set (match_operand:TF 0 "nonimmediate_operand" "")
4741 (match_operand:TF 1 "general_operand" ""))]
4744 if (GET_CODE (operands[0]) == MEM
4745 && ! reg_or_fp0_operand (operands[1], TFmode))
4746 operands[1] = force_reg (TFmode, operands[1]);
4749 (define_insn "*movsi_nofix"
4750 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,m,*f,*f,m")
4751 (match_operand:SI 1 "input_operand" "rJ,K,L,m,rJ,*fJ,m,*f"))]
4752 "TARGET_ABI_OSF && ! TARGET_FIX
4753 && (register_operand (operands[0], SImode)
4754 || reg_or_0_operand (operands[1], SImode))"
4764 [(set_attr "type" "ilog,iadd,iadd,ild,ist,fcpys,fld,fst")])
4766 (define_insn "*movsi_fix"
4767 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,m,*f,*f,m,r,*f")
4768 (match_operand:SI 1 "input_operand" "rJ,K,L,m,rJ,*fJ,m,*f,*f,r"))]
4769 "TARGET_ABI_OSF && TARGET_FIX
4770 && (register_operand (operands[0], SImode)
4771 || reg_or_0_operand (operands[1], SImode))"
4783 [(set_attr "type" "ilog,iadd,iadd,ild,ist,fcpys,fld,fst,ftoi,itof")])
4785 (define_insn "*movsi_nt_vms"
4786 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,r,m,*f,*f,m")
4787 (match_operand:SI 1 "input_operand" "rJ,K,L,s,m,rJ,*fJ,m,*f"))]
4788 "(TARGET_ABI_WINDOWS_NT || TARGET_ABI_OPEN_VMS)
4789 && (register_operand (operands[0], SImode)
4790 || reg_or_0_operand (operands[1], SImode))"
4801 [(set_attr "type" "ilog,iadd,iadd,ldsym,ild,ist,fcpys,fld,fst")])
4803 (define_insn "*movhi_nobwx"
4804 [(set (match_operand:HI 0 "register_operand" "=r,r")
4805 (match_operand:HI 1 "input_operand" "rJ,n"))]
4807 && (register_operand (operands[0], HImode)
4808 || register_operand (operands[1], HImode))"
4812 [(set_attr "type" "ilog,iadd")])
4814 (define_insn "*movhi_bwx"
4815 [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m")
4816 (match_operand:HI 1 "input_operand" "rJ,n,m,rJ"))]
4818 && (register_operand (operands[0], HImode)
4819 || reg_or_0_operand (operands[1], HImode))"
4825 [(set_attr "type" "ilog,iadd,ild,ist")])
4827 (define_insn "*movqi_nobwx"
4828 [(set (match_operand:QI 0 "register_operand" "=r,r")
4829 (match_operand:QI 1 "input_operand" "rJ,n"))]
4831 && (register_operand (operands[0], QImode)
4832 || register_operand (operands[1], QImode))"
4836 [(set_attr "type" "ilog,iadd")])
4838 (define_insn "*movqi_bwx"
4839 [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,r,m")
4840 (match_operand:QI 1 "input_operand" "rJ,n,m,rJ"))]
4842 && (register_operand (operands[0], QImode)
4843 || reg_or_0_operand (operands[1], QImode))"
4849 [(set_attr "type" "ilog,iadd,ild,ist")])
4851 ;; We do two major things here: handle mem->mem and construct long
4854 (define_expand "movsi"
4855 [(set (match_operand:SI 0 "nonimmediate_operand" "")
4856 (match_operand:SI 1 "general_operand" ""))]
4859 if (alpha_expand_mov (SImode, operands))
4863 ;; Split a load of a large constant into the appropriate two-insn
4867 [(set (match_operand:SI 0 "register_operand" "")
4868 (match_operand:SI 1 "const_int_operand" ""))]
4869 "! add_operand (operands[1], SImode)"
4870 [(set (match_dup 0) (match_dup 2))
4871 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))]
4874 = alpha_emit_set_const (operands[0], SImode, INTVAL (operands[1]), 2);
4876 if (tem == operands[0])
4882 (define_insn "*movdi_er_low"
4883 [(set (match_operand:DI 0 "register_operand" "=r")
4884 (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
4885 (match_operand:DI 2 "local_symbolic_operand" "")))]
4886 "TARGET_EXPLICIT_RELOCS"
4887 "lda %0,%2(%1)\t\t!gprellow")
4889 (define_insn "*movdi_er_nofix"
4890 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,r,r,m,*f,*f,Q")
4891 (match_operand:DI 1 "input_operand" "rJ,K,L,T,s,m,rJ,*fJ,Q,*f"))]
4892 "TARGET_EXPLICIT_RELOCS && ! TARGET_FIX
4893 && (register_operand (operands[0], DImode)
4894 || reg_or_0_operand (operands[1], DImode))
4895 && ! local_symbolic_operand (operands[1], DImode)"
4901 ldq %0,%1($29)\t\t!literal
4907 [(set_attr "type" "ilog,iadd,iadd,iadd,ldsym,ild,ist,fcpys,fld,fst")])
4909 (define_insn "*movdi_nofix"
4910 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,r,m,*f,*f,Q")
4911 (match_operand:DI 1 "input_operand" "rJ,K,L,s,m,rJ,*fJ,Q,*f"))]
4912 "! TARGET_EXPLICIT_RELOCS && ! TARGET_FIX
4913 && (register_operand (operands[0], DImode)
4914 || reg_or_0_operand (operands[1], DImode))"
4925 [(set_attr "type" "ilog,iadd,iadd,ldsym,ild,ist,fcpys,fld,fst")])
4927 (define_insn "*movdi_er_fix"
4928 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,r,r,m,*f,*f,Q,r,*f")
4929 (match_operand:DI 1 "input_operand" "rJ,K,L,T,s,m,rJ,*fJ,Q,*f,*f,r"))]
4930 "TARGET_EXPLICIT_RELOCS && TARGET_FIX
4931 && (register_operand (operands[0], DImode)
4932 || reg_or_0_operand (operands[1], DImode))
4933 && ! local_symbolic_operand (operands[1], DImode)"
4939 ldq %0,%1($29)\t\t!literal
4947 [(set_attr "type" "ilog,iadd,iadd,iadd,ldsym,ild,ist,fcpys,fld,fst,ftoi,itof")])
4949 (define_insn "*movdi_fix"
4950 [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,r,m,*f,*f,Q,r,*f")
4951 (match_operand:DI 1 "input_operand" "rJ,K,L,s,m,rJ,*fJ,Q,*f,*f,r"))]
4952 "! TARGET_EXPLICIT_RELOCS && TARGET_FIX
4953 && (register_operand (operands[0], DImode)
4954 || reg_or_0_operand (operands[1], DImode))"
4967 [(set_attr "type" "ilog,iadd,iadd,ldsym,ild,ist,fcpys,fld,fst,ftoi,itof")])
4969 ;; VMS needs to set up "vms_base_regno" for unwinding. This move
4970 ;; often appears dead to the life analysis code, at which point we
4971 ;; abort for emitting dead prologue instructions. Force this live.
4973 (define_insn "force_movdi"
4974 [(set (match_operand:DI 0 "register_operand" "=r")
4975 (unspec_volatile:DI [(match_operand:DI 1 "register_operand" "r")]
4976 UNSPECV_FORCE_MOV))]
4979 [(set_attr "type" "ilog")])
4981 ;; We do three major things here: handle mem->mem, put 64-bit constants in
4982 ;; memory, and construct long 32-bit constants.
4984 (define_expand "movdi"
4985 [(set (match_operand:DI 0 "nonimmediate_operand" "")
4986 (match_operand:DI 1 "general_operand" ""))]
4989 if (alpha_expand_mov (DImode, operands))
4993 ;; Split a load of a large constant into the appropriate two-insn
4997 [(set (match_operand:DI 0 "register_operand" "")
4998 (match_operand:DI 1 "const_int_operand" ""))]
4999 "! add_operand (operands[1], DImode)"
5000 [(set (match_dup 0) (match_dup 2))
5001 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
5004 = alpha_emit_set_const (operands[0], DImode, INTVAL (operands[1]), 2);
5006 if (tem == operands[0])
5012 ;; These are the partial-word cases.
5014 ;; First we have the code to load an aligned word. Operand 0 is the register
5015 ;; in which to place the result. It's mode is QImode or HImode. Operand 1
5016 ;; is an SImode MEM at the low-order byte of the proper word. Operand 2 is the
5017 ;; number of bits within the word that the value is. Operand 3 is an SImode
5018 ;; scratch register. If operand 0 is a hard register, operand 3 may be the
5019 ;; same register. It is allowed to conflict with operand 1 as well.
5021 (define_expand "aligned_loadqi"
5022 [(set (match_operand:SI 3 "register_operand" "")
5023 (match_operand:SI 1 "memory_operand" ""))
5024 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
5025 (zero_extract:DI (subreg:DI (match_dup 3) 0)
5027 (match_operand:DI 2 "const_int_operand" "")))]
5032 (define_expand "aligned_loadhi"
5033 [(set (match_operand:SI 3 "register_operand" "")
5034 (match_operand:SI 1 "memory_operand" ""))
5035 (set (subreg:DI (match_operand:HI 0 "register_operand" "") 0)
5036 (zero_extract:DI (subreg:DI (match_dup 3) 0)
5038 (match_operand:DI 2 "const_int_operand" "")))]
5043 ;; Similar for unaligned loads, where we use the sequence from the
5044 ;; Alpha Architecture manual.
5046 ;; Operand 1 is the address. Operands 2 and 3 are temporaries, where
5047 ;; operand 3 can overlap the input and output registers.
5049 (define_expand "unaligned_loadqi"
5050 [(set (match_operand:DI 2 "register_operand" "")
5051 (mem:DI (and:DI (match_operand:DI 1 "address_operand" "")
5053 (set (match_operand:DI 3 "register_operand" "")
5055 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
5056 (zero_extract:DI (match_dup 2)
5058 (ashift:DI (match_dup 3) (const_int 3))))]
5062 (define_expand "unaligned_loadhi"
5063 [(set (match_operand:DI 2 "register_operand" "")
5064 (mem:DI (and:DI (match_operand:DI 1 "address_operand" "")
5066 (set (match_operand:DI 3 "register_operand" "")
5068 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
5069 (zero_extract:DI (match_dup 2)
5071 (ashift:DI (match_dup 3) (const_int 3))))]
5075 ;; Storing an aligned byte or word requires two temporaries. Operand 0 is the
5076 ;; aligned SImode MEM. Operand 1 is the register containing the
5077 ;; byte or word to store. Operand 2 is the number of bits within the word that
5078 ;; the value should be placed. Operands 3 and 4 are SImode temporaries.
5080 (define_expand "aligned_store"
5081 [(set (match_operand:SI 3 "register_operand" "")
5082 (match_operand:SI 0 "memory_operand" ""))
5083 (set (subreg:DI (match_dup 3) 0)
5084 (and:DI (subreg:DI (match_dup 3) 0) (match_dup 5)))
5085 (set (subreg:DI (match_operand:SI 4 "register_operand" "") 0)
5086 (ashift:DI (zero_extend:DI (match_operand 1 "register_operand" ""))
5087 (match_operand:DI 2 "const_int_operand" "")))
5088 (set (subreg:DI (match_dup 4) 0)
5089 (ior:DI (subreg:DI (match_dup 4) 0) (subreg:DI (match_dup 3) 0)))
5090 (set (match_dup 0) (match_dup 4))]
5093 operands[5] = GEN_INT (~ (GET_MODE_MASK (GET_MODE (operands[1]))
5094 << INTVAL (operands[2])));
5097 ;; For the unaligned byte and halfword cases, we use code similar to that
5098 ;; in the ;; Architecture book, but reordered to lower the number of registers
5099 ;; required. Operand 0 is the address. Operand 1 is the data to store.
5100 ;; Operands 2, 3, and 4 are DImode temporaries, where operands 2 and 4 may
5101 ;; be the same temporary, if desired. If the address is in a register,
5102 ;; operand 2 can be that register.
5104 (define_expand "unaligned_storeqi"
5105 [(set (match_operand:DI 3 "register_operand" "")
5106 (mem:DI (and:DI (match_operand:DI 0 "address_operand" "")
5108 (set (match_operand:DI 2 "register_operand" "")
5111 (and:DI (not:DI (ashift:DI (const_int 255)
5112 (ashift:DI (match_dup 2) (const_int 3))))
5114 (set (match_operand:DI 4 "register_operand" "")
5115 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" ""))
5116 (ashift:DI (match_dup 2) (const_int 3))))
5117 (set (match_dup 4) (ior:DI (match_dup 4) (match_dup 3)))
5118 (set (mem:DI (and:DI (match_dup 0) (const_int -8)))
5123 (define_expand "unaligned_storehi"
5124 [(set (match_operand:DI 3 "register_operand" "")
5125 (mem:DI (and:DI (match_operand:DI 0 "address_operand" "")
5127 (set (match_operand:DI 2 "register_operand" "")
5130 (and:DI (not:DI (ashift:DI (const_int 65535)
5131 (ashift:DI (match_dup 2) (const_int 3))))
5133 (set (match_operand:DI 4 "register_operand" "")
5134 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" ""))
5135 (ashift:DI (match_dup 2) (const_int 3))))
5136 (set (match_dup 4) (ior:DI (match_dup 4) (match_dup 3)))
5137 (set (mem:DI (and:DI (match_dup 0) (const_int -8)))
5142 ;; Here are the define_expand's for QI and HI moves that use the above
5143 ;; patterns. We have the normal sets, plus the ones that need scratch
5144 ;; registers for reload.
5146 (define_expand "movqi"
5147 [(set (match_operand:QI 0 "nonimmediate_operand" "")
5148 (match_operand:QI 1 "general_operand" ""))]
5152 ? alpha_expand_mov (QImode, operands)
5153 : alpha_expand_mov_nobwx (QImode, operands))
5157 (define_expand "movhi"
5158 [(set (match_operand:HI 0 "nonimmediate_operand" "")
5159 (match_operand:HI 1 "general_operand" ""))]
5163 ? alpha_expand_mov (HImode, operands)
5164 : alpha_expand_mov_nobwx (HImode, operands))
5168 ;; Here are the versions for reload. Note that in the unaligned cases
5169 ;; we know that the operand must not be a pseudo-register because stack
5170 ;; slots are always aligned references.
5172 (define_expand "reload_inqi"
5173 [(parallel [(match_operand:QI 0 "register_operand" "=r")
5174 (match_operand:QI 1 "any_memory_operand" "m")
5175 (match_operand:TI 2 "register_operand" "=&r")])]
5180 if (GET_CODE (operands[1]) != MEM)
5183 if (aligned_memory_operand (operands[1], QImode))
5185 seq = gen_reload_inqi_help (operands[0], operands[1],
5186 gen_rtx_REG (SImode, REGNO (operands[2])));
5192 /* It is possible that one of the registers we got for operands[2]
5193 might coincide with that of operands[0] (which is why we made
5194 it TImode). Pick the other one to use as our scratch. */
5195 if (REGNO (operands[0]) == REGNO (operands[2]))
5196 scratch = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
5198 scratch = gen_rtx_REG (DImode, REGNO (operands[2]));
5200 addr = get_unaligned_address (operands[1], 0);
5201 seq = gen_unaligned_loadqi (operands[0], addr, scratch,
5202 gen_rtx_REG (DImode, REGNO (operands[0])));
5203 alpha_set_memflags (seq, operands[1]);
5209 (define_expand "reload_inhi"
5210 [(parallel [(match_operand:HI 0 "register_operand" "=r")
5211 (match_operand:HI 1 "any_memory_operand" "m")
5212 (match_operand:TI 2 "register_operand" "=&r")])]
5217 if (GET_CODE (operands[1]) != MEM)
5220 if (aligned_memory_operand (operands[1], HImode))
5222 seq = gen_reload_inhi_help (operands[0], operands[1],
5223 gen_rtx_REG (SImode, REGNO (operands[2])));
5229 /* It is possible that one of the registers we got for operands[2]
5230 might coincide with that of operands[0] (which is why we made
5231 it TImode). Pick the other one to use as our scratch. */
5232 if (REGNO (operands[0]) == REGNO (operands[2]))
5233 scratch = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
5235 scratch = gen_rtx_REG (DImode, REGNO (operands[2]));
5237 addr = get_unaligned_address (operands[1], 0);
5238 seq = gen_unaligned_loadhi (operands[0], addr, scratch,
5239 gen_rtx_REG (DImode, REGNO (operands[0])));
5240 alpha_set_memflags (seq, operands[1]);
5246 (define_expand "reload_outqi"
5247 [(parallel [(match_operand:QI 0 "any_memory_operand" "=m")
5248 (match_operand:QI 1 "register_operand" "r")
5249 (match_operand:TI 2 "register_operand" "=&r")])]
5252 if (GET_CODE (operands[0]) != MEM)
5255 if (aligned_memory_operand (operands[0], QImode))
5257 emit_insn (gen_reload_outqi_help
5258 (operands[0], operands[1],
5259 gen_rtx_REG (SImode, REGNO (operands[2])),
5260 gen_rtx_REG (SImode, REGNO (operands[2]) + 1)));
5264 rtx addr = get_unaligned_address (operands[0], 0);
5265 rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2]));
5266 rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
5267 rtx scratch3 = scratch1;
5270 if (GET_CODE (addr) == REG)
5273 seq = gen_unaligned_storeqi (addr, operands[1], scratch1,
5274 scratch2, scratch3);
5275 alpha_set_memflags (seq, operands[0]);
5281 (define_expand "reload_outhi"
5282 [(parallel [(match_operand:HI 0 "any_memory_operand" "=m")
5283 (match_operand:HI 1 "register_operand" "r")
5284 (match_operand:TI 2 "register_operand" "=&r")])]
5287 if (GET_CODE (operands[0]) != MEM)
5290 if (aligned_memory_operand (operands[0], HImode))
5292 emit_insn (gen_reload_outhi_help
5293 (operands[0], operands[1],
5294 gen_rtx_REG (SImode, REGNO (operands[2])),
5295 gen_rtx_REG (SImode, REGNO (operands[2]) + 1)));
5299 rtx addr = get_unaligned_address (operands[0], 0);
5300 rtx scratch1 = gen_rtx_REG (DImode, REGNO (operands[2]));
5301 rtx scratch2 = gen_rtx_REG (DImode, REGNO (operands[2]) + 1);
5302 rtx scratch3 = scratch1;
5305 if (GET_CODE (addr) == REG)
5308 seq = gen_unaligned_storehi (addr, operands[1], scratch1,
5309 scratch2, scratch3);
5310 alpha_set_memflags (seq, operands[0]);
5316 ;; Helpers for the above. The way reload is structured, we can't
5317 ;; always get a proper address for a stack slot during reload_foo
5318 ;; expansion, so we must delay our address manipulations until after.
5320 (define_insn "reload_inqi_help"
5321 [(set (match_operand:QI 0 "register_operand" "=r")
5322 (match_operand:QI 1 "memory_operand" "m"))
5323 (clobber (match_operand:SI 2 "register_operand" "=r"))]
5324 "! TARGET_BWX && (reload_in_progress || reload_completed)"
5327 (define_insn "reload_inhi_help"
5328 [(set (match_operand:HI 0 "register_operand" "=r")
5329 (match_operand:HI 1 "memory_operand" "m"))
5330 (clobber (match_operand:SI 2 "register_operand" "=r"))]
5331 "! TARGET_BWX && (reload_in_progress || reload_completed)"
5334 (define_insn "reload_outqi_help"
5335 [(set (match_operand:QI 0 "memory_operand" "=m")
5336 (match_operand:QI 1 "register_operand" "r"))
5337 (clobber (match_operand:SI 2 "register_operand" "=r"))
5338 (clobber (match_operand:SI 3 "register_operand" "=r"))]
5339 "! TARGET_BWX && (reload_in_progress || reload_completed)"
5342 (define_insn "reload_outhi_help"
5343 [(set (match_operand:HI 0 "memory_operand" "=m")
5344 (match_operand:HI 1 "register_operand" "r"))
5345 (clobber (match_operand:SI 2 "register_operand" "=r"))
5346 (clobber (match_operand:SI 3 "register_operand" "=r"))]
5347 "! TARGET_BWX && (reload_in_progress || reload_completed)"
5351 [(set (match_operand:QI 0 "register_operand" "")
5352 (match_operand:QI 1 "memory_operand" ""))
5353 (clobber (match_operand:SI 2 "register_operand" ""))]
5354 "! TARGET_BWX && reload_completed"
5357 rtx aligned_mem, bitnum;
5358 get_aligned_mem (operands[1], &aligned_mem, &bitnum);
5359 emit_insn (gen_aligned_loadqi (operands[0], aligned_mem, bitnum,
5365 [(set (match_operand:HI 0 "register_operand" "")
5366 (match_operand:HI 1 "memory_operand" ""))
5367 (clobber (match_operand:SI 2 "register_operand" ""))]
5368 "! TARGET_BWX && reload_completed"
5371 rtx aligned_mem, bitnum;
5372 get_aligned_mem (operands[1], &aligned_mem, &bitnum);
5373 emit_insn (gen_aligned_loadhi (operands[0], aligned_mem, bitnum,
5379 [(set (match_operand:QI 0 "memory_operand" "")
5380 (match_operand:QI 1 "register_operand" ""))
5381 (clobber (match_operand:SI 2 "register_operand" ""))
5382 (clobber (match_operand:SI 3 "register_operand" ""))]
5383 "! TARGET_BWX && reload_completed"
5386 rtx aligned_mem, bitnum;
5387 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
5388 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
5389 operands[2], operands[3]));
5394 [(set (match_operand:HI 0 "memory_operand" "")
5395 (match_operand:HI 1 "register_operand" ""))
5396 (clobber (match_operand:SI 2 "register_operand" ""))
5397 (clobber (match_operand:SI 3 "register_operand" ""))]
5398 "! TARGET_BWX && reload_completed"
5401 rtx aligned_mem, bitnum;
5402 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
5403 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
5404 operands[2], operands[3]));
5408 ;; Bit field extract patterns which use ext[wlq][lh]
5410 (define_expand "extv"
5411 [(set (match_operand:DI 0 "register_operand" "")
5412 (sign_extract:DI (match_operand:QI 1 "memory_operand" "")
5413 (match_operand:DI 2 "immediate_operand" "")
5414 (match_operand:DI 3 "immediate_operand" "")))]
5417 /* We can do 16, 32 and 64 bit fields, if aligned on byte boundaries. */
5418 if (INTVAL (operands[3]) % 8 != 0
5419 || (INTVAL (operands[2]) != 16
5420 && INTVAL (operands[2]) != 32
5421 && INTVAL (operands[2]) != 64))
5424 /* From mips.md: extract_bit_field doesn't verify that our source
5425 matches the predicate, so we force it to be a MEM here. */
5426 if (GET_CODE (operands[1]) != MEM)
5429 alpha_expand_unaligned_load (operands[0], operands[1],
5430 INTVAL (operands[2]) / 8,
5431 INTVAL (operands[3]) / 8, 1);
5435 (define_expand "extzv"
5436 [(set (match_operand:DI 0 "register_operand" "")
5437 (zero_extract:DI (match_operand:DI 1 "nonimmediate_operand" "")
5438 (match_operand:DI 2 "immediate_operand" "")
5439 (match_operand:DI 3 "immediate_operand" "")))]
5442 /* We can do 8, 16, 32 and 64 bit fields, if aligned on byte boundaries. */
5443 if (INTVAL (operands[3]) % 8 != 0
5444 || (INTVAL (operands[2]) != 8
5445 && INTVAL (operands[2]) != 16
5446 && INTVAL (operands[2]) != 32
5447 && INTVAL (operands[2]) != 64))
5450 if (GET_CODE (operands[1]) == MEM)
5452 /* Fail 8 bit fields, falling back on a simple byte load. */
5453 if (INTVAL (operands[2]) == 8)
5456 alpha_expand_unaligned_load (operands[0], operands[1],
5457 INTVAL (operands[2]) / 8,
5458 INTVAL (operands[3]) / 8, 0);
5463 (define_expand "insv"
5464 [(set (zero_extract:DI (match_operand:QI 0 "memory_operand" "")
5465 (match_operand:DI 1 "immediate_operand" "")
5466 (match_operand:DI 2 "immediate_operand" ""))
5467 (match_operand:DI 3 "register_operand" ""))]
5470 /* We can do 16, 32 and 64 bit fields, if aligned on byte boundaries. */
5471 if (INTVAL (operands[2]) % 8 != 0
5472 || (INTVAL (operands[1]) != 16
5473 && INTVAL (operands[1]) != 32
5474 && INTVAL (operands[1]) != 64))
5477 /* From mips.md: store_bit_field doesn't verify that our source
5478 matches the predicate, so we force it to be a MEM here. */
5479 if (GET_CODE (operands[0]) != MEM)
5482 alpha_expand_unaligned_store (operands[0], operands[3],
5483 INTVAL (operands[1]) / 8,
5484 INTVAL (operands[2]) / 8);
5488 ;; Block move/clear, see alpha.c for more details.
5489 ;; Argument 0 is the destination
5490 ;; Argument 1 is the source
5491 ;; Argument 2 is the length
5492 ;; Argument 3 is the alignment
5494 (define_expand "movstrqi"
5495 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
5496 (match_operand:BLK 1 "memory_operand" ""))
5497 (use (match_operand:DI 2 "immediate_operand" ""))
5498 (use (match_operand:DI 3 "immediate_operand" ""))])]
5501 if (alpha_expand_block_move (operands))
5507 (define_expand "clrstrqi"
5508 [(parallel [(set (match_operand:BLK 0 "memory_operand" "")
5510 (use (match_operand:DI 1 "immediate_operand" ""))
5511 (use (match_operand:DI 2 "immediate_operand" ""))])]
5514 if (alpha_expand_block_clear (operands))
5520 ;; Subroutine of stack space allocation. Perform a stack probe.
5521 (define_expand "probe_stack"
5522 [(set (match_dup 1) (match_operand:DI 0 "const_int_operand" ""))]
5525 operands[1] = gen_rtx_MEM (DImode, plus_constant (stack_pointer_rtx,
5526 INTVAL (operands[0])));
5527 MEM_VOLATILE_P (operands[1]) = 1;
5529 operands[0] = const0_rtx;
5532 ;; This is how we allocate stack space. If we are allocating a
5533 ;; constant amount of space and we know it is less than 4096
5534 ;; bytes, we need do nothing.
5536 ;; If it is more than 4096 bytes, we need to probe the stack
5538 (define_expand "allocate_stack"
5540 (plus:DI (reg:DI 30)
5541 (match_operand:DI 1 "reg_or_cint_operand" "")))
5542 (set (match_operand:DI 0 "register_operand" "=r")
5546 if (GET_CODE (operands[1]) == CONST_INT
5547 && INTVAL (operands[1]) < 32768)
5549 if (INTVAL (operands[1]) >= 4096)
5551 /* We do this the same way as in the prologue and generate explicit
5552 probes. Then we update the stack by the constant. */
5556 emit_insn (gen_probe_stack (GEN_INT (- probed)));
5557 while (probed + 8192 < INTVAL (operands[1]))
5558 emit_insn (gen_probe_stack (GEN_INT (- (probed += 8192))));
5560 if (probed + 4096 < INTVAL (operands[1]))
5561 emit_insn (gen_probe_stack (GEN_INT (- INTVAL(operands[1]))));
5564 operands[1] = GEN_INT (- INTVAL (operands[1]));
5565 operands[2] = virtual_stack_dynamic_rtx;
5570 rtx loop_label = gen_label_rtx ();
5571 rtx want = gen_reg_rtx (Pmode);
5572 rtx tmp = gen_reg_rtx (Pmode);
5575 emit_insn (gen_subdi3 (want, stack_pointer_rtx,
5576 force_reg (Pmode, operands[1])));
5577 emit_insn (gen_adddi3 (tmp, stack_pointer_rtx, GEN_INT (-4096)));
5579 if (GET_CODE (operands[1]) != CONST_INT)
5581 out_label = gen_label_rtx ();
5582 emit_insn (gen_cmpdi (want, tmp));
5583 emit_jump_insn (gen_bgeu (out_label));
5586 emit_label (loop_label);
5587 memref = gen_rtx_MEM (DImode, tmp);
5588 MEM_VOLATILE_P (memref) = 1;
5589 emit_move_insn (memref, const0_rtx);
5590 emit_insn (gen_adddi3 (tmp, tmp, GEN_INT(-8192)));
5591 emit_insn (gen_cmpdi (tmp, want));
5592 emit_jump_insn (gen_bgtu (loop_label));
5594 memref = gen_rtx_MEM (DImode, want);
5595 MEM_VOLATILE_P (memref) = 1;
5596 emit_move_insn (memref, const0_rtx);
5599 emit_label (out_label);
5601 emit_move_insn (stack_pointer_rtx, want);
5602 emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
5607 ;; This is used by alpha_expand_prolog to do the same thing as above,
5608 ;; except we cannot at that time generate new basic blocks, so we hide
5609 ;; the loop in this one insn.
5611 (define_insn "prologue_stack_probe_loop"
5612 [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")
5613 (match_operand:DI 1 "register_operand" "r")]
5617 operands[2] = gen_label_rtx ();
5618 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
5619 CODE_LABEL_NUMBER (operands[2]));
5621 return "stq $31,-8192(%1)\;subq %0,1,%0\;lda %1,-8192(%1)\;bne %0,%l2";
5623 [(set_attr "length" "16")
5624 (set_attr "type" "multi")])
5626 (define_expand "prologue"
5627 [(clobber (const_int 0))]
5630 alpha_expand_prologue ();
5634 ;; These take care of emitting the ldgp insn in the prologue. This will be
5635 ;; an lda/ldah pair and we want to align them properly. So we have two
5636 ;; unspec_volatile insns, the first of which emits the ldgp assembler macro
5637 ;; and the second of which emits nothing. However, both are marked as type
5638 ;; IADD (the default) so the alignment code in alpha.c does the right thing
5641 (define_expand "prologue_ldgp"
5642 [(unspec_volatile [(const_int 0)] UNSPECV_LDGP1)
5643 (unspec_volatile [(const_int 0)] UNSPECV_LDGP2)]
5647 (define_insn "*prologue_ldgp_1_er"
5648 [(unspec_volatile [(const_int 0)] UNSPECV_LDGP1)]
5649 "TARGET_EXPLICIT_RELOCS"
5650 "ldah $29,0($27)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*\n$%~..ng:")
5652 (define_insn "*prologue_ldgp_1"
5653 [(unspec_volatile [(const_int 0)] UNSPECV_LDGP1)]
5655 "ldgp $29,0($27)\n$%~..ng:")
5657 (define_insn "*prologue_ldgp_2"
5658 [(unspec_volatile [(const_int 0)] UNSPECV_LDGP2)]
5662 ;; The _mcount profiling hook has special calling conventions, and
5663 ;; does not clobber all the registers that a normal call would. So
5664 ;; hide the fact this is a call at all.
5666 (define_insn "prologue_mcount"
5667 [(unspec_volatile [(const_int 0)] UNSPECV_MCOUNT)]
5669 "lda $28,_mcount\;jsr $28,($28),_mcount"
5670 [(set_attr "type" "multi")
5671 (set_attr "length" "8")])
5673 (define_insn "init_fp"
5674 [(set (match_operand:DI 0 "register_operand" "=r")
5675 (match_operand:DI 1 "register_operand" "r"))
5676 (clobber (mem:BLK (match_operand:DI 2 "register_operand" "=r")))]
5680 (define_expand "epilogue"
5684 alpha_expand_epilogue ();
5687 (define_expand "sibcall_epilogue"
5691 alpha_expand_epilogue ();
5695 ;; In creating a large stack frame, NT _must_ use ldah+lda to load
5696 ;; the frame size into a register. We use this pattern to ensure
5697 ;; we get lda instead of addq.
5698 (define_insn "nt_lda"
5699 [(set (match_operand:DI 0 "register_operand" "=r")
5700 (unspec:DI [(match_dup 0)
5701 (match_operand:DI 1 "const_int_operand" "n")]
5706 (define_expand "builtin_longjmp"
5707 [(use (match_operand:DI 0 "register_operand" "r"))]
5710 /* The elements of the buffer are, in order: */
5711 rtx fp = gen_rtx_MEM (Pmode, operands[0]);
5712 rtx lab = gen_rtx_MEM (Pmode, plus_constant (operands[0], 8));
5713 rtx stack = gen_rtx_MEM (Pmode, plus_constant (operands[0], 16));
5714 rtx pv = gen_rtx_REG (Pmode, 27);
5716 /* This bit is the same as expand_builtin_longjmp. */
5717 emit_move_insn (hard_frame_pointer_rtx, fp);
5718 emit_move_insn (pv, lab);
5719 emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
5720 emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
5721 emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
5723 /* Load the label we are jumping through into $27 so that we know
5724 where to look for it when we get back to setjmp's function for
5725 restoring the gp. */
5726 emit_jump_insn (gen_builtin_longjmp_internal (pv));
5731 ;; This is effectively a copy of indirect_jump, but constrained such
5732 ;; that register renaming cannot foil our cunning plan with $27.
5733 (define_insn "builtin_longjmp_internal"
5735 (unspec_volatile [(match_operand:DI 0 "register_operand" "c")]
5739 [(set_attr "type" "ibr")])
5741 (define_insn "*builtin_setjmp_receiver_sub_label_er"
5742 [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
5743 "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF && TARGET_AS_CAN_SUBTRACT_LABELS"
5744 "\n$LSJ%=:\;ldah $29,0($27)\t\t!gpdisp!%*\;lda $29,$LSJ%=-%l0($29)\t\t!gpdisp!%*"
5745 [(set_attr "length" "8")
5746 (set_attr "type" "multi")])
5748 (define_insn "*builtin_setjmp_receiver_sub_label"
5749 [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
5750 "TARGET_ABI_OSF && TARGET_AS_CAN_SUBTRACT_LABELS"
5751 "\n$LSJ%=:\;ldgp $29,$LSJ%=-%l0($27)"
5752 [(set_attr "length" "8")
5753 (set_attr "type" "multi")])
5755 (define_insn "*builtin_setjmp_receiver_er"
5756 [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
5757 "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
5758 "br $29,$LSJ%=\n$LSJ%=:\;ldah $29,0($29)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*"
5759 [(set_attr "length" "12")
5760 (set_attr "type" "multi")])
5762 (define_insn "builtin_setjmp_receiver"
5763 [(unspec_volatile [(label_ref (match_operand 0 "" ""))] UNSPECV_SETJMPR)]
5765 "br $29,$LSJ%=\n$LSJ%=:\;ldgp $29,0($29)"
5766 [(set_attr "length" "12")
5767 (set_attr "type" "multi")])
5769 (define_expand "exception_receiver"
5770 [(unspec_volatile [(match_dup 0)] UNSPECV_EHR)]
5773 if (TARGET_LD_BUGGY_LDGP)
5774 operands[0] = alpha_gp_save_rtx ();
5776 operands[0] = const0_rtx;
5779 (define_insn "*exception_receiver_1_er"
5780 [(unspec_volatile [(const_int 0)] UNSPECV_EHR)]
5781 "TARGET_EXPLICIT_RELOCS && ! TARGET_LD_BUGGY_LDGP"
5782 "ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*"
5783 [(set_attr "length" "8")
5784 (set_attr "type" "multi")])
5786 (define_insn "*exception_receiver_1"
5787 [(unspec_volatile [(const_int 0)] UNSPECV_EHR)]
5788 "! TARGET_LD_BUGGY_LDGP"
5790 [(set_attr "length" "8")
5791 (set_attr "type" "multi")])
5793 ;; ??? We don't represent the usage of $29 properly in address loads
5794 ;; and function calls. This leads to the following move being deleted
5795 ;; as dead code unless it is represented as a volatile unspec.
5797 (define_insn "*exception_receiver_2"
5798 [(unspec_volatile [(match_operand:DI 0 "nonimmediate_operand" "r,m")]
5800 "TARGET_LD_BUGGY_LDGP"
5804 [(set_attr "type" "ilog,ild")])
5806 (define_expand "nonlocal_goto_receiver"
5807 [(unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
5808 (set (reg:DI 27) (mem:DI (reg:DI 29)))
5809 (unspec_volatile [(const_int 0)] UNSPECV_BLOCKAGE)
5811 "TARGET_ABI_OPEN_VMS"
5814 (define_insn "arg_home"
5815 [(unspec [(const_int 0)] UNSPEC_ARG_HOME)
5830 (clobber (mem:BLK (const_int 0)))
5831 (clobber (reg:DI 24))
5832 (clobber (reg:DI 25))
5833 (clobber (reg:DI 0))]
5834 "TARGET_ABI_OPEN_VMS"
5835 "lda $0,OTS$HOME_ARGS\;ldq $0,8($0)\;jsr $0,OTS$HOME_ARGS"
5836 [(set_attr "length" "16")
5837 (set_attr "type" "multi")])
5839 ;; Close the trap shadow of preceeding instructions. This is generated
5842 (define_insn "trapb"
5843 [(unspec_volatile [(const_int 0)] UNSPECV_TRAPB)]
5846 [(set_attr "type" "misc")])
5848 ;; No-op instructions used by machine-dependant reorg to preserve
5849 ;; alignment for instruction issue.
5855 [(set_attr "type" "ilog")])
5861 [(set_attr "type" "fcpys")])
5868 (define_insn "realign"
5869 [(unspec_volatile [(match_operand 0 "immediate_operand" "i")]
5872 ".align %0 #realign")
5874 ;; The call patterns are at the end of the file because their
5875 ;; wildcard operand0 interferes with nice recognition.
5877 (define_insn "*call_value_osf_1_er"
5878 [(set (match_operand 0 "" "")
5879 (call (mem:DI (match_operand:DI 1 "call_operand" "c,R,i"))
5880 (match_operand 2 "" "")))
5881 (clobber (reg:DI 27))
5882 (clobber (reg:DI 26))]
5883 "TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
5885 jsr $26,($27),0\;ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*
5887 ldq $27,%1($29)\t\t!literal!%#\;jsr $26,($27),%1\t\t!lituse_jsr!%#\;ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*"
5888 [(set_attr "type" "jsr")
5889 (set_attr "length" "12,*,16")])
5891 (define_insn "*call_value_osf_1"
5892 [(set (match_operand 0 "" "")
5893 (call (mem:DI (match_operand:DI 1 "call_operand" "c,R,i"))
5894 (match_operand 2 "" "")))
5895 (clobber (reg:DI 27))
5896 (clobber (reg:DI 26))]
5899 jsr $26,($27),0\;ldgp $29,0($26)
5901 jsr $26,%1\;ldgp $29,0($26)"
5902 [(set_attr "type" "jsr")
5903 (set_attr "length" "12,*,16")])
5905 (define_insn "*sibcall_value_osf_1"
5906 [(set (match_operand 0 "" "")
5907 (call (mem:DI (match_operand:DI 1 "current_file_function_operand" "R"))
5908 (match_operand 2 "" "")))]
5911 [(set_attr "type" "jsr")])
5913 (define_insn "*call_value_nt_1"
5914 [(set (match_operand 0 "" "")
5915 (call (mem:DI (match_operand:DI 1 "call_operand" "r,R,i"))
5916 (match_operand 2 "" "")))
5917 (clobber (reg:DI 26))]
5918 "TARGET_ABI_WINDOWS_NT"
5923 [(set_attr "type" "jsr")
5924 (set_attr "length" "*,*,12")])
5926 (define_insn "*call_value_vms_1"
5927 [(set (match_operand 0 "" "")
5928 (call (mem:DI (match_operand:DI 1 "call_operand" "r,i"))
5929 (match_operand 2 "" "")))
5930 (use (match_operand:DI 3 "nonimmediate_operand" "r,m"))
5933 (clobber (reg:DI 27))]
5934 "TARGET_ABI_OPEN_VMS"
5936 mov %3,$27\;jsr $26,0\;ldq $27,0($29)
5937 ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)"
5938 [(set_attr "type" "jsr")
5939 (set_attr "length" "12,16")])