1 ;; Machine description for DEC Alpha for GNU C compiler
2 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
3 ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
5 ;; This file is part of GNU CC.
7 ;; GNU CC is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 2, or (at your option)
12 ;; GNU CC is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU CC; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
20 ;; Boston, MA 02111-1307, USA.
22 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
24 ;; Define an insn type attribute. This is used in function unit delay
25 ;; computations, among other purposes. For the most part, we use the names
26 ;; defined in the EV4 documentation, but add a few that we have to know about
30 "ld,st,ibr,fbr,jsr,iaddlog,shiftcm,icmp,imull,imulq,fpop,fdivs,fdivt,ldsym,isubr"
31 (const_string "shiftcm"))
33 ;; The TRAP_TYPE attribute marks instructions that may generate traps
34 ;; (which are imprecise and may need a trapb if software complention
36 (define_attr "trap" "yes,no" (const_string "no"))
38 ;; We include four function units: ABOX, which computes the address,
39 ;; BBOX, used for branches, EBOX, used for integer operations, and FBOX,
40 ;; used for FP operations.
42 ;; We assume that we have been successful in getting double issues and
43 ;; hence multiply all costs by two insns per cycle. The minimum time in
44 ;; a function unit is 2 cycle, which will tend to produce the double
47 ;; Memory delivers its result in three cycles.
48 (define_function_unit "abox" 1 0 (eq_attr "type" "ld,ldsym,st") 6 2)
50 ;; Branches have no delay cost, but do tie up the unit for two cycles.
51 (define_function_unit "bbox" 1 1 (eq_attr "type" "ibr,fbr,jsr") 4 4)
53 ;; Arithmetic insns are normally have their results available after two
54 ;; cycles. There are a number of exceptions. They are encoded in
55 ;; ADJUST_COST. Some of the other insns have similar exceptions.
57 (define_function_unit "ebox" 1 0 (eq_attr "type" "iaddlog,shiftcm,icmp") 4 2)
59 ;; These really don't take up the integer pipeline, but they do occupy
60 ;; IBOX1; we approximate here.
62 (define_function_unit "ebox" 1 0 (eq_attr "type" "imull") 42 2)
63 (define_function_unit "ebox" 1 0 (eq_attr "type" "imulq") 46 2)
65 (define_function_unit "imult" 1 0 (eq_attr "type" "imull") 42 38)
66 (define_function_unit "imult" 1 0 (eq_attr "type" "imulq") 46 42)
68 (define_function_unit "fbox" 1 0 (eq_attr "type" "fpop") 12 2)
70 (define_function_unit "fbox" 1 0 (eq_attr "type" "fdivs") 68 0)
71 (define_function_unit "fbox" 1 0 (eq_attr "type" "fdivt") 126 0)
73 (define_function_unit "divider" 1 0 (eq_attr "type" "fdivs") 68 60)
74 (define_function_unit "divider" 1 0 (eq_attr "type" "fdivt") 126 118)
76 ;; First define the arithmetic insns. Note that the 32-bit forms also
79 ;; Note that we can do sign extensions in both FP and integer registers.
80 ;; However, the result must be in the same type of register as the input.
81 ;; The register preferencing code can't handle this case very well, so, for
82 ;; now, don't let the FP case show up here for preferencing. Also,
83 ;; sign-extends in FP registers take two instructions.
84 (define_insn "extendsidi2"
85 [(set (match_operand:DI 0 "register_operand" "=r,r,*f")
86 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "r,m,*f")))]
91 cvtql %1,%0\;cvtlq %0,%0"
92 [(set_attr "type" "iaddlog,ld,fpop")])
94 ;; Do addsi3 the way expand_binop would do if we didn't have one. This
95 ;; generates better code. We have the anonymous addsi3 pattern below in
96 ;; case combine wants to make it.
97 (define_expand "addsi3"
98 [(set (match_operand:SI 0 "register_operand" "")
99 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "")
100 (match_operand:SI 2 "add_operand" "")))]
103 { emit_insn (gen_rtx (SET, VOIDmode, gen_lowpart (DImode, operands[0]),
104 gen_rtx (PLUS, DImode,
105 gen_lowpart (DImode, operands[1]),
106 gen_lowpart (DImode, operands[2]))));
111 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
112 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ,rJ,rJ")
113 (match_operand:SI 2 "add_operand" "rI,O,K,L")))]
120 [(set_attr "type" "iaddlog")])
123 [(set (match_operand:SI 0 "register_operand" "")
124 (plus:SI (match_operand:SI 1 "register_operand" "")
125 (match_operand:SI 2 "const_int_operand" "")))]
126 "! add_operand (operands[2], SImode)"
127 [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3)))
128 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
131 HOST_WIDE_INT val = INTVAL (operands[2]);
132 HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
133 HOST_WIDE_INT rest = val - low;
135 operands[3] = GEN_INT (rest);
136 operands[4] = GEN_INT (low);
140 [(set (match_operand:DI 0 "register_operand" "=r,r")
142 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ")
143 (match_operand:SI 2 "sext_add_operand" "rI,O"))))]
148 [(set_attr "type" "iaddlog")])
151 [(set (match_operand:DI 0 "register_operand" "")
153 (plus:SI (match_operand:SI 1 "register_operand" "")
154 (match_operand:SI 2 "const_int_operand" ""))))
155 (clobber (match_operand:SI 3 "register_operand" ""))]
156 "! sext_add_operand (operands[2], SImode) && INTVAL (operands[2]) > 0
157 && INTVAL (operands[2]) % 4 == 0"
158 [(set (match_dup 3) (match_dup 4))
159 (set (match_dup 0) (sign_extend:DI (plus:SI (mult:SI (match_dup 3)
164 HOST_WIDE_INT val = INTVAL (operands[2]) / 4;
170 operands[4] = GEN_INT (val);
171 operands[5] = GEN_INT (mult);
175 [(set (match_operand:DI 0 "register_operand" "")
177 (plus:SI (match_operator:SI 1 "comparison_operator"
178 [(match_operand 2 "" "")
179 (match_operand 3 "" "")])
180 (match_operand:SI 4 "add_operand" ""))))
181 (clobber (match_operand:DI 5 "register_operand" ""))]
183 [(set (match_dup 5) (match_dup 6))
184 (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 7) (match_dup 4))))]
187 operands[6] = gen_rtx (GET_CODE (operands[1]), DImode,
188 operands[2], operands[3]);
189 operands[7] = gen_lowpart (SImode, operands[5]);
192 (define_insn "adddi3"
193 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r")
194 (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ,rJ")
195 (match_operand:DI 2 "add_operand" "rI,O,K,L")))]
202 [(set_attr "type" "iaddlog")])
204 ;; Don't do this if we are adjusting SP since we don't want to do
207 [(set (match_operand:DI 0 "register_operand" "")
208 (plus:DI (match_operand:DI 1 "register_operand" "")
209 (match_operand:DI 2 "const_int_operand" "")))]
210 "! add_operand (operands[2], DImode)
211 && REGNO (operands[0]) != STACK_POINTER_REGNUM"
212 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3)))
213 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
216 HOST_WIDE_INT val = INTVAL (operands[2]);
217 HOST_WIDE_INT low = (val & 0xffff) - 2 * (val & 0x8000);
218 HOST_WIDE_INT rest = val - low;
220 operands[3] = GEN_INT (rest);
221 operands[4] = GEN_INT (low);
225 [(set (match_operand:SI 0 "register_operand" "=r,r")
226 (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ,rJ")
227 (match_operand:SI 2 "const48_operand" "I,I"))
228 (match_operand:SI 3 "sext_add_operand" "rI,O")))]
233 [(set_attr "type" "iaddlog")])
236 [(set (match_operand:DI 0 "register_operand" "=r,r")
238 (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ,rJ")
239 (match_operand:SI 2 "const48_operand" "I,I"))
240 (match_operand:SI 3 "sext_add_operand" "rI,O"))))]
245 [(set_attr "type" "iaddlog")])
248 [(set (match_operand:DI 0 "register_operand" "")
250 (plus:SI (mult:SI (match_operator:SI 1 "comparison_operator"
251 [(match_operand 2 "" "")
252 (match_operand 3 "" "")])
253 (match_operand:SI 4 "const48_operand" ""))
254 (match_operand:SI 5 "add_operand" ""))))
255 (clobber (match_operand:DI 6 "register_operand" ""))]
257 [(set (match_dup 6) (match_dup 7))
259 (sign_extend:DI (plus:SI (mult:SI (match_dup 8) (match_dup 4))
263 operands[7] = gen_rtx (GET_CODE (operands[1]), DImode,
264 operands[2], operands[3]);
265 operands[8] = gen_lowpart (SImode, operands[6]);
269 [(set (match_operand:DI 0 "register_operand" "=r,r")
270 (plus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ")
271 (match_operand:DI 2 "const48_operand" "I,I"))
272 (match_operand:DI 3 "reg_or_8bit_operand" "rI,O")))]
277 [(set_attr "type" "iaddlog")])
279 ;; These variants of the above insns can occur if the third operand
280 ;; is the frame pointer. This is a kludge, but there doesn't
281 ;; seem to be a way around it. Only recognize them while reloading.
284 [(set (match_operand:DI 0 "some_operand" "=&r")
285 (plus:DI (plus:DI (match_operand:DI 1 "some_operand" "r")
286 (match_operand:DI 2 "some_operand" "r"))
287 (match_operand:DI 3 "some_operand" "rIOKL")))]
290 [(set_attr "type" "iaddlog")])
293 [(set (match_operand:DI 0 "register_operand" "")
294 (plus:DI (plus:DI (match_operand:DI 1 "register_operand" "")
295 (match_operand:DI 2 "register_operand" ""))
296 (match_operand:DI 3 "add_operand" "")))]
298 [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))
299 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
303 [(set (match_operand:SI 0 "some_operand" "=&r")
304 (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "some_operand" "rJ")
305 (match_operand:SI 2 "const48_operand" "I"))
306 (match_operand:SI 3 "some_operand" "r"))
307 (match_operand:SI 4 "some_operand" "rIOKL")))]
310 [(set_attr "type" "iaddlog")])
313 [(set (match_operand:SI 0 "register_operand" "r")
314 (plus:SI (plus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "")
315 (match_operand:SI 2 "const48_operand" ""))
316 (match_operand:SI 3 "register_operand" ""))
317 (match_operand:SI 4 "add_operand" "rIOKL")))]
320 (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
321 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))]
325 [(set (match_operand:DI 0 "some_operand" "=&r")
328 (mult:SI (match_operand:SI 1 "some_operand" "rJ")
329 (match_operand:SI 2 "const48_operand" "I"))
330 (match_operand:SI 3 "some_operand" "r"))
331 (match_operand:SI 4 "some_operand" "rIOKL"))))]
334 [(set_attr "type" "iaddlog")])
337 [(set (match_operand:DI 0 "register_operand" "")
340 (mult:SI (match_operand:SI 1 "reg_or_0_operand" "")
341 (match_operand:SI 2 "const48_operand" ""))
342 (match_operand:SI 3 "register_operand" ""))
343 (match_operand:SI 4 "add_operand" ""))))]
346 (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3)))
347 (set (match_dup 0) (sign_extend:DI (plus:SI (match_dup 5) (match_dup 4))))]
349 { operands[5] = gen_lowpart (SImode, operands[0]);
353 [(set (match_operand:DI 0 "some_operand" "=&r")
354 (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "some_operand" "rJ")
355 (match_operand:DI 2 "const48_operand" "I"))
356 (match_operand:DI 3 "some_operand" "r"))
357 (match_operand:DI 4 "some_operand" "rIOKL")))]
360 [(set_attr "type" "iaddlog")])
363 [(set (match_operand:DI 0 "register_operand" "=")
364 (plus:DI (plus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "")
365 (match_operand:DI 2 "const48_operand" ""))
366 (match_operand:DI 3 "register_operand" ""))
367 (match_operand:DI 4 "add_operand" "")))]
370 (plus:DI (mult:DI (match_dup 1) (match_dup 2)) (match_dup 3)))
371 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))]
374 (define_insn "negsi2"
375 [(set (match_operand:SI 0 "register_operand" "=r")
376 (neg:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))]
379 [(set_attr "type" "iaddlog")])
382 [(set (match_operand:DI 0 "register_operand" "=r")
383 (sign_extend:DI (neg:SI
384 (match_operand:SI 1 "reg_or_8bit_operand" "rI"))))]
387 [(set_attr "type" "iaddlog")])
389 (define_insn "negdi2"
390 [(set (match_operand:DI 0 "register_operand" "=r")
391 (neg:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))]
394 [(set_attr "type" "iaddlog")])
396 (define_expand "subsi3"
397 [(set (match_operand:SI 0 "register_operand" "")
398 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "")
399 (match_operand:SI 2 "reg_or_8bit_operand" "")))]
402 { emit_insn (gen_rtx (SET, VOIDmode, gen_lowpart (DImode, operands[0]),
403 gen_rtx (MINUS, DImode,
404 gen_lowpart (DImode, operands[1]),
405 gen_lowpart (DImode, operands[2]))));
411 [(set (match_operand:SI 0 "register_operand" "=r")
412 (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
413 (match_operand:SI 2 "reg_or_8bit_operand" "rI")))]
416 [(set_attr "type" "iaddlog")])
419 [(set (match_operand:DI 0 "register_operand" "=r")
420 (sign_extend:DI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
421 (match_operand:SI 2 "reg_or_8bit_operand" "rI"))))]
424 [(set_attr "type" "iaddlog")])
426 (define_insn "subdi3"
427 [(set (match_operand:DI 0 "register_operand" "=r")
428 (minus:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
429 (match_operand:DI 2 "reg_or_8bit_operand" "rI")))]
432 [(set_attr "type" "iaddlog")])
435 [(set (match_operand:SI 0 "register_operand" "=r")
436 (minus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
437 (match_operand:SI 2 "const48_operand" "I"))
438 (match_operand:SI 3 "reg_or_8bit_operand" "rI")))]
441 [(set_attr "type" "iaddlog")])
444 [(set (match_operand:DI 0 "register_operand" "=r")
446 (minus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")
447 (match_operand:SI 2 "const48_operand" "I"))
448 (match_operand:SI 3 "reg_or_8bit_operand" "rI"))))]
451 [(set_attr "type" "iaddlog")])
454 [(set (match_operand:DI 0 "register_operand" "=r")
455 (minus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
456 (match_operand:DI 2 "const48_operand" "I"))
457 (match_operand:DI 3 "reg_or_8bit_operand" "rI")))]
460 [(set_attr "type" "iaddlog")])
462 (define_insn "mulsi3"
463 [(set (match_operand:SI 0 "register_operand" "=r")
464 (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
465 (match_operand:SI 2 "reg_or_0_operand" "rJ")))]
468 [(set_attr "type" "imull")])
471 [(set (match_operand:DI 0 "register_operand" "=r")
472 (sign_extend:DI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")
473 (match_operand:SI 2 "reg_or_0_operand" "rJ"))))]
476 [(set_attr "type" "imull")])
478 (define_insn "muldi3"
479 [(set (match_operand:DI 0 "register_operand" "=r")
480 (mult:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ")
481 (match_operand:DI 2 "reg_or_0_operand" "rJ")))]
484 [(set_attr "type" "imulq")])
486 (define_insn "umuldi3_highpart"
487 [(set (match_operand:DI 0 "register_operand" "=r")
490 (mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand" "r"))
491 (zero_extend:TI (match_operand:DI 2 "register_operand" "r")))
495 [(set_attr "type" "imulq")])
498 [(set (match_operand:DI 0 "register_operand" "=r")
501 (mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand" "r"))
502 (match_operand:TI 2 "cint8_operand" "I"))
506 [(set_attr "type" "imulq")])
508 ;; The divide and remainder operations always take their inputs from
509 ;; r24 and r25, put their output in r27, and clobber r23 and r28.
511 (define_expand "divsi3"
512 [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
513 (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
514 (parallel [(set (reg:SI 27)
517 (clobber (reg:DI 23))
518 (clobber (reg:DI 28))])
519 (set (match_operand:SI 0 "general_operand" "")
524 (define_expand "udivsi3"
525 [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
526 (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
527 (parallel [(set (reg:SI 27)
530 (clobber (reg:DI 23))
531 (clobber (reg:DI 28))])
532 (set (match_operand:SI 0 "general_operand" "")
537 (define_expand "modsi3"
538 [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
539 (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
540 (parallel [(set (reg:SI 27)
543 (clobber (reg:DI 23))
544 (clobber (reg:DI 28))])
545 (set (match_operand:SI 0 "general_operand" "")
550 (define_expand "umodsi3"
551 [(set (reg:SI 24) (match_operand:SI 1 "input_operand" ""))
552 (set (reg:SI 25) (match_operand:SI 2 "input_operand" ""))
553 (parallel [(set (reg:SI 27)
556 (clobber (reg:DI 23))
557 (clobber (reg:DI 28))])
558 (set (match_operand:SI 0 "general_operand" "")
563 (define_expand "divdi3"
564 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
565 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
566 (parallel [(set (reg:DI 27)
569 (clobber (reg:DI 23))
570 (clobber (reg:DI 28))])
571 (set (match_operand:DI 0 "general_operand" "")
576 (define_expand "udivdi3"
577 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
578 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
579 (parallel [(set (reg:DI 27)
582 (clobber (reg:DI 23))
583 (clobber (reg:DI 28))])
584 (set (match_operand:DI 0 "general_operand" "")
589 (define_expand "moddi3"
590 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
591 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
592 (parallel [(set (reg:DI 27)
595 (clobber (reg:DI 23))
596 (clobber (reg:DI 28))])
597 (set (match_operand:DI 0 "general_operand" "")
602 (define_expand "umoddi3"
603 [(set (reg:DI 24) (match_operand:DI 1 "input_operand" ""))
604 (set (reg:DI 25) (match_operand:DI 2 "input_operand" ""))
605 (parallel [(set (reg:DI 27)
608 (clobber (reg:DI 23))
609 (clobber (reg:DI 28))])
610 (set (match_operand:DI 0 "general_operand" "")
617 (match_operator:SI 1 "divmod_operator"
618 [(reg:SI 24) (reg:SI 25)]))
619 (clobber (reg:DI 23))
620 (clobber (reg:DI 28))]
623 [(set_attr "type" "isubr")])
627 (match_operator:DI 1 "divmod_operator"
628 [(reg:DI 24) (reg:DI 25)]))
629 (clobber (reg:DI 23))
630 (clobber (reg:DI 28))]
633 [(set_attr "type" "isubr")])
635 ;; Next are the basic logical operations. These only exist in DImode.
637 (define_insn "anddi3"
638 [(set (match_operand:DI 0 "register_operand" "=r,r,r")
639 (and:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ")
640 (match_operand:DI 2 "and_operand" "rI,N,MH")))]
646 [(set_attr "type" "iaddlog,iaddlog,shiftcm")])
648 ;; There are times when we can split an AND into two AND insns. This occurs
649 ;; when we can first clear any bytes and then clear anything else. For
650 ;; example "I & 0xffff07" is "(I & 0xffffff) & 0xffffffffffffff07".
651 ;; Only do this when running on 64-bit host since the computations are
652 ;; too messy otherwise.
655 [(set (match_operand:DI 0 "register_operand" "")
656 (and:DI (match_operand:DI 1 "register_operand" "")
657 (match_operand:DI 2 "const_int_operand" "")))]
658 "HOST_BITS_PER_WIDE_INT == 64 && ! and_operand (operands[2], DImode)"
659 [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 3)))
660 (set (match_dup 0) (and:DI (match_dup 0) (match_dup 4)))]
663 unsigned HOST_WIDE_INT mask1 = INTVAL (operands[2]);
664 unsigned HOST_WIDE_INT mask2 = mask1;
667 /* For each byte that isn't all zeros, make it all ones. */
668 for (i = 0; i < 64; i += 8)
669 if ((mask1 & ((HOST_WIDE_INT) 0xff << i)) != 0)
670 mask1 |= (HOST_WIDE_INT) 0xff << i;
672 /* Now turn on any bits we've just turned off. */
675 operands[3] = GEN_INT (mask1);
676 operands[4] = GEN_INT (mask2);
679 (define_insn "zero_extendqihi2"
680 [(set (match_operand:HI 0 "register_operand" "=r")
681 (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))]
684 [(set_attr "type" "iaddlog")])
686 (define_insn "zero_extendqisi2"
687 [(set (match_operand:SI 0 "register_operand" "=r")
688 (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))]
691 [(set_attr "type" "iaddlog")])
693 (define_insn "zero_extendqidi2"
694 [(set (match_operand:DI 0 "register_operand" "=r")
695 (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))]
698 [(set_attr "type" "iaddlog")])
700 (define_insn "zero_extendhisi2"
701 [(set (match_operand:SI 0 "register_operand" "=r")
702 (zero_extend:SI (match_operand:HI 1 "register_operand" "r")))]
705 [(set_attr "type" "iaddlog")])
707 (define_insn "zero_extendhidi2"
708 [(set (match_operand:DI 0 "register_operand" "=r")
709 (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))]
712 [(set_attr "type" "iaddlog")])
714 (define_insn "zero_extendsidi2"
715 [(set (match_operand:DI 0 "register_operand" "=r")
716 (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
719 [(set_attr "type" "iaddlog")])
722 [(set (match_operand:DI 0 "register_operand" "=r")
723 (and:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI"))
724 (match_operand:DI 2 "reg_or_0_operand" "rJ")))]
727 [(set_attr "type" "iaddlog")])
729 (define_insn "iordi3"
730 [(set (match_operand:DI 0 "register_operand" "=r,r")
731 (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ")
732 (match_operand:DI 2 "or_operand" "rI,N")))]
737 [(set_attr "type" "iaddlog")])
739 (define_insn "one_cmpldi2"
740 [(set (match_operand:DI 0 "register_operand" "=r")
741 (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))]
744 [(set_attr "type" "iaddlog")])
747 [(set (match_operand:DI 0 "register_operand" "=r")
748 (ior:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI"))
749 (match_operand:DI 2 "reg_or_0_operand" "rJ")))]
752 [(set_attr "type" "iaddlog")])
754 (define_insn "xordi3"
755 [(set (match_operand:DI 0 "register_operand" "=r,r")
756 (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ")
757 (match_operand:DI 2 "or_operand" "rI,N")))]
762 [(set_attr "type" "iaddlog")])
765 [(set (match_operand:DI 0 "register_operand" "=r")
766 (not:DI (xor:DI (match_operand:DI 1 "register_operand" "%rJ")
767 (match_operand:DI 2 "register_operand" "rI"))))]
770 [(set_attr "type" "iaddlog")])
772 ;; Next come the shifts and the various extract and insert operations.
774 (define_insn "ashldi3"
775 [(set (match_operand:DI 0 "register_operand" "=r,r")
776 (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ")
777 (match_operand:DI 2 "reg_or_6bit_operand" "P,rI")))]
781 switch (which_alternative)
784 if (operands[2] == const1_rtx)
785 return \"addq %r1,%r1,%0\";
787 return \"s%P2addq %r1,0,%0\";
789 return \"sll %r1,%2,%0\";
792 [(set_attr "type" "iaddlog,shiftcm")])
794 ;; ??? The following pattern is made by combine, but earlier phases
795 ;; (specifically flow) can't handle it. This occurs in jump.c. Deal
796 ;; with this in a better way at some point.
798 ;; [(set (match_operand:DI 0 "register_operand" "=r")
800 ;; (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
801 ;; (match_operand:DI 2 "const_int_operand" "P"))
803 ;; "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3"
806 ;; if (operands[2] == const1_rtx)
807 ;; return \"addl %r1,%r1,%0\";
809 ;; return \"s%P2addl %r1,0,%0\";
811 ;; [(set_attr "type" "iaddlog")])
813 (define_insn "lshrdi3"
814 [(set (match_operand:DI 0 "register_operand" "=r")
815 (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
816 (match_operand:DI 2 "reg_or_6bit_operand" "rI")))]
820 (define_insn "ashrdi3"
821 [(set (match_operand:DI 0 "register_operand" "=r")
822 (ashiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
823 (match_operand:DI 2 "reg_or_6bit_operand" "rI")))]
827 (define_expand "extendqihi2"
829 (ashift:DI (match_operand:QI 1 "reg_or_unaligned_mem_operand" "")
831 (set (match_operand:HI 0 "register_operand" "")
832 (ashiftrt:DI (match_dup 2)
837 /* If we have a MEM (must be unaligned), extend to DImode (which we do
838 specially) and then copy to the result. */
839 if (GET_CODE (operands[1]) == MEM)
841 rtx temp = gen_reg_rtx (DImode);
843 emit_insn (gen_extendqidi2 (temp, operands[1]));
844 emit_move_insn (operands[0], gen_lowpart (HImode, temp));
848 operands[0] = gen_lowpart (DImode, operands[0]);
849 operands[1] = gen_lowpart (DImode, operands[1]);
850 operands[2] = gen_reg_rtx (DImode);
853 (define_expand "extendqisi2"
855 (ashift:DI (match_operand:QI 1 "reg_or_unaligned_mem_operand" "")
857 (set (match_operand:SI 0 "register_operand" "")
858 (ashiftrt:DI (match_dup 2)
863 /* If we have a MEM (must be unaligned), extend to a DImode form of
864 the result (which we do specially). */
865 if (GET_CODE (operands[1]) == MEM)
867 rtx temp = gen_reg_rtx (DImode);
869 emit_insn (gen_extendqidi2 (temp, operands[1]));
870 emit_move_insn (operands[0], gen_lowpart (SImode, temp));
874 operands[0] = gen_lowpart (DImode, operands[0]);
875 operands[1] = gen_lowpart (DImode, operands[1]);
876 operands[2] = gen_reg_rtx (DImode);
879 (define_expand "extendqidi2"
881 (ashift:DI (match_operand:QI 1 "reg_or_unaligned_mem_operand" "")
883 (set (match_operand:DI 0 "register_operand" "")
884 (ashiftrt:DI (match_dup 2)
888 { extern rtx get_unaligned_address ();
889 if (GET_CODE (operands[1]) == MEM)
892 = gen_unaligned_extendqidi (operands[0],
893 get_unaligned_address (operands[1], 1));
895 alpha_set_memflags (seq, operands[1]);
900 operands[1] = gen_lowpart (DImode, operands[1]);
901 operands[2] = gen_reg_rtx (DImode);
904 (define_expand "extendhisi2"
906 (ashift:DI (match_operand:HI 1 "reg_or_unaligned_mem_operand" "")
908 (set (match_operand:SI 0 "register_operand" "")
909 (ashiftrt:DI (match_dup 2)
914 /* If we have a MEM (must be unaligned), extend to a DImode form of
915 the result (which we do specially). */
916 if (GET_CODE (operands[1]) == MEM)
918 rtx temp = gen_reg_rtx (DImode);
920 emit_insn (gen_extendhidi2 (temp, operands[1]));
921 emit_move_insn (operands[0], gen_lowpart (SImode, temp));
925 operands[0] = gen_lowpart (DImode, operands[0]);
926 operands[1] = gen_lowpart (DImode, operands[1]);
927 operands[2] = gen_reg_rtx (DImode);
930 (define_expand "extendhidi2"
932 (ashift:DI (match_operand:HI 1 "reg_or_unaligned_mem_operand" "")
934 (set (match_operand:DI 0 "register_operand" "")
935 (ashiftrt:DI (match_dup 2)
939 { extern rtx get_unaligned_address ();
940 if (GET_CODE (operands[1]) == MEM)
943 = gen_unaligned_extendhidi (operands[0],
944 get_unaligned_address (operands[1], 2));
946 alpha_set_memflags (seq, operands[1]);
951 operands[1] = gen_lowpart (DImode, operands[1]);
952 operands[2] = gen_reg_rtx (DImode);
955 ;; Here's how we sign extend an unaligned byte and halfword. Doing this
956 ;; as a pattern saves one instruction. The code is similar to that for
957 ;; the unaligned loads (see below).
959 ;; Operand 1 is the address + 1 (+2 for HI), operand 0 is the result.
960 (define_expand "unaligned_extendqidi"
961 [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))
963 (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -1))
966 (ashift:DI (match_dup 3)
967 (minus:DI (const_int 56)
969 (and:DI (plus:DI (match_dup 2) (const_int -1))
972 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
973 (ashiftrt:DI (match_dup 4) (const_int 56)))]
976 { operands[2] = gen_reg_rtx (DImode);
977 operands[3] = gen_reg_rtx (DImode);
978 operands[4] = gen_reg_rtx (DImode);
981 (define_expand "unaligned_extendhidi"
982 [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))
984 (mem:DI (and:DI (plus:DI (match_dup 2) (const_int -2))
987 (ashift:DI (match_dup 3)
988 (minus:DI (const_int 56)
990 (and:DI (plus:DI (match_dup 2) (const_int -1))
993 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
994 (ashiftrt:DI (match_dup 4) (const_int 48)))]
997 { operands[2] = gen_reg_rtx (DImode);
998 operands[3] = gen_reg_rtx (DImode);
999 operands[4] = gen_reg_rtx (DImode);
1003 [(set (match_operand:DI 0 "register_operand" "=r")
1004 (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1005 (match_operand:DI 2 "mode_width_operand" "n")
1006 (match_operand:DI 3 "mul8_operand" "I")))]
1008 "ext%M2l %r1,%s3,%0")
1011 [(set (match_operand:DI 0 "register_operand" "=r")
1012 (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1013 (match_operand:DI 2 "mode_width_operand" "n")
1014 (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI")
1017 "ext%M2l %r1,%3,%0")
1020 [(set (match_operand:DI 0 "register_operand" "=r")
1022 (match_operand:DI 1 "reg_or_0_operand" "rJ")
1023 (minus:DI (const_int 56)
1026 (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1034 [(set (match_operand:DI 0 "register_operand" "=r")
1036 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1037 (const_int 2147483647))
1038 (minus:DI (const_int 56)
1041 (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1049 [(set (match_operand:DI 0 "register_operand" "=r")
1051 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1053 (minus:DI (const_int 56)
1056 (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1063 ;; This converts an extXl into an extXh with an appropriate adjustment
1064 ;; to the address calculation.
1067 ;; [(set (match_operand:DI 0 "register_operand" "")
1068 ;; (ashift:DI (zero_extract:DI (match_operand:DI 1 "register_operand" "")
1069 ;; (match_operand:DI 2 "mode_width_operand" "")
1070 ;; (ashift:DI (match_operand:DI 3 "" "")
1072 ;; (match_operand:DI 4 "const_int_operand" "")))
1073 ;; (clobber (match_operand:DI 5 "register_operand" ""))]
1074 ;; "INTVAL (operands[4]) == 64 - INTVAL (operands[2])"
1075 ;; [(set (match_dup 5) (match_dup 6))
1076 ;; (set (match_dup 0)
1077 ;; (ashift:DI (zero_extract:DI (match_dup 1) (match_dup 2)
1078 ;; (ashift:DI (plus:DI (match_dup 5)
1084 ;; operands[6] = plus_constant (operands[3],
1085 ;; INTVAL (operands[2]) / BITS_PER_UNIT);
1086 ;; operands[7] = GEN_INT (- INTVAL (operands[2]) / BITS_PER_UNIT);
1090 [(set (match_operand:DI 0 "register_operand" "=r")
1091 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
1092 (match_operand:DI 2 "mul8_operand" "I")))]
1097 [(set (match_operand:DI 0 "register_operand" "=r")
1098 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r"))
1099 (match_operand:DI 2 "mul8_operand" "I")))]
1104 [(set (match_operand:DI 0 "register_operand" "=r")
1105 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
1106 (match_operand:DI 2 "mul8_operand" "I")))]
1111 [(set (match_operand:DI 0 "register_operand" "=r")
1112 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" "r"))
1113 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1119 [(set (match_operand:DI 0 "register_operand" "=r")
1120 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r"))
1121 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1127 [(set (match_operand:DI 0 "register_operand" "=r")
1128 (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r"))
1129 (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")
1134 ;; We do not include the insXh insns because they are complex to express
1135 ;; and it does not appear that we would ever want to generate them.
1138 [(set (match_operand:DI 0 "register_operand" "=r")
1139 (and:DI (not:DI (ashift:DI
1140 (match_operand:DI 2 "mode_mask_operand" "n")
1142 (match_operand:DI 3 "reg_or_8bit_operand" "rI")
1144 (match_operand:DI 1 "reg_or_0_operand" "rJ")))]
1146 "msk%U2l %r1,%3,%0")
1148 ;; We do not include the mskXh insns because it does not appear we would ever
1151 ;; Floating-point operations. All the double-precision insns can extend
1152 ;; from single, so indicate that. The exception are the ones that simply
1153 ;; play with the sign bits; it's not clear what to do there.
1155 (define_insn "abssf2"
1156 [(set (match_operand:SF 0 "register_operand" "=f")
1157 (abs:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
1160 [(set_attr "type" "fpop")])
1162 (define_insn "absdf2"
1163 [(set (match_operand:DF 0 "register_operand" "=f")
1164 (abs:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1167 [(set_attr "type" "fpop")])
1169 (define_insn "negsf2"
1170 [(set (match_operand:SF 0 "register_operand" "=f")
1171 (neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))]
1174 [(set_attr "type" "fpop")])
1176 (define_insn "negdf2"
1177 [(set (match_operand:DF 0 "register_operand" "=f")
1178 (neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1181 [(set_attr "type" "fpop")])
1184 [(set (match_operand:SF 0 "register_operand" "=&f")
1185 (plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
1186 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1187 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1188 "adds%)%& %R1,%R2,%0"
1189 [(set_attr "type" "fpop")
1190 (set_attr "trap" "yes")])
1192 (define_insn "addsf3"
1193 [(set (match_operand:SF 0 "register_operand" "=f")
1194 (plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
1195 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1197 "adds%)%& %R1,%R2,%0"
1198 [(set_attr "type" "fpop")
1199 (set_attr "trap" "yes")])
1202 [(set (match_operand:DF 0 "register_operand" "=&f")
1203 (plus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
1204 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1205 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1206 "addt%)%& %R1,%R2,%0"
1207 [(set_attr "type" "fpop")
1208 (set_attr "trap" "yes")])
1210 (define_insn "adddf3"
1211 [(set (match_operand:DF 0 "register_operand" "=f")
1212 (plus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
1213 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1215 "addt%)%& %R1,%R2,%0"
1216 [(set_attr "type" "fpop")
1217 (set_attr "trap" "yes")])
1220 [(set (match_operand:DF 0 "register_operand" "=&f")
1221 (plus:DF (float_extend:DF
1222 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1223 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1224 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1225 "addt%)%& %R1,%R2,%0"
1226 [(set_attr "type" "fpop")
1227 (set_attr "trap" "yes")])
1230 [(set (match_operand:DF 0 "register_operand" "=f")
1231 (plus:DF (float_extend:DF
1232 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1233 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1235 "addt%)%& %R1,%R2,%0"
1236 [(set_attr "type" "fpop")
1237 (set_attr "trap" "yes")])
1240 [(set (match_operand:DF 0 "register_operand" "=&f")
1241 (plus:DF (float_extend:DF
1242 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
1244 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1245 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1246 "addt%)%& %R1,%R2,%0"
1247 [(set_attr "type" "fpop")
1248 (set_attr "trap" "yes")])
1251 [(set (match_operand:DF 0 "register_operand" "=f")
1252 (plus:DF (float_extend:DF
1253 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
1255 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1257 "addt%)%& %R1,%R2,%0"
1258 [(set_attr "type" "fpop")
1259 (set_attr "trap" "yes")])
1261 (define_insn "fix_truncdfdi2"
1262 [(set (match_operand:DI 0 "register_operand" "=f")
1263 (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1266 [(set_attr "type" "fpop")])
1268 (define_insn "fix_truncsfdi2"
1269 [(set (match_operand:DI 0 "register_operand" "=f")
1270 (fix:DI (float_extend:DF
1271 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))]
1274 [(set_attr "type" "fpop")])
1277 [(set (match_operand:SF 0 "register_operand" "=&f")
1278 (float:SF (match_operand:DI 1 "register_operand" "f")))]
1279 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1281 [(set_attr "type" "fpop")
1282 (set_attr "trap" "yes")])
1284 (define_insn "floatdisf2"
1285 [(set (match_operand:SF 0 "register_operand" "=f")
1286 (float:SF (match_operand:DI 1 "register_operand" "f")))]
1289 [(set_attr "type" "fpop")
1290 (set_attr "trap" "yes")])
1293 [(set (match_operand:DF 0 "register_operand" "=&f")
1294 (float:DF (match_operand:DI 1 "register_operand" "f")))]
1295 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1297 [(set_attr "type" "fpop")
1298 (set_attr "trap" "yes")])
1300 (define_insn "floatdidf2"
1301 [(set (match_operand:DF 0 "register_operand" "=f")
1302 (float:DF (match_operand:DI 1 "register_operand" "f")))]
1305 [(set_attr "type" "fpop")
1306 (set_attr "trap" "yes")])
1309 [(set (match_operand:DF 0 "register_operand" "=&f,f")
1310 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
1311 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1315 [(set_attr "type" "fpop,ld")
1316 (set_attr "trap" "yes")])
1318 (define_insn "extendsfdf2"
1319 [(set (match_operand:DF 0 "register_operand" "=f,f")
1320 (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))]
1325 [(set_attr "type" "fpop,ld")
1326 (set_attr "trap" "yes")])
1329 [(set (match_operand:SF 0 "register_operand" "=&f")
1330 (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1331 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1333 [(set_attr "type" "fpop")
1334 (set_attr "trap" "yes")])
1336 (define_insn "truncdfsf2"
1337 [(set (match_operand:SF 0 "register_operand" "=f")
1338 (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))]
1341 [(set_attr "type" "fpop")
1342 (set_attr "trap" "yes")])
1345 [(set (match_operand:SF 0 "register_operand" "=&f")
1346 (div:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
1347 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1348 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1349 "divs%)%& %R1,%R2,%0"
1350 [(set_attr "type" "fdivs")
1351 (set_attr "trap" "yes")])
1353 (define_insn "divsf3"
1354 [(set (match_operand:SF 0 "register_operand" "=f")
1355 (div:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
1356 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1358 "divs%)%& %R1,%R2,%0"
1359 [(set_attr "type" "fdivs")
1360 (set_attr "trap" "yes")])
1363 [(set (match_operand:DF 0 "register_operand" "=&f")
1364 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1365 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1366 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1367 "divt%)%& %R1,%R2,%0"
1368 [(set_attr "type" "fdivt")
1369 (set_attr "trap" "yes")])
1371 (define_insn "divdf3"
1372 [(set (match_operand:DF 0 "register_operand" "=f")
1373 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1374 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1376 "divt%)%& %R1,%R2,%0"
1377 [(set_attr "type" "fdivt")
1378 (set_attr "trap" "yes")])
1381 [(set (match_operand:DF 0 "register_operand" "=&f")
1382 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1383 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1384 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1385 "divt%)%& %R1,%R2,%0"
1386 [(set_attr "type" "fdivt")
1387 (set_attr "trap" "yes")])
1390 [(set (match_operand:DF 0 "register_operand" "=f")
1391 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1392 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1394 "divt%)%& %R1,%R2,%0"
1395 [(set_attr "type" "fdivt")
1396 (set_attr "trap" "yes")])
1399 [(set (match_operand:DF 0 "register_operand" "=&f")
1400 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1402 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1403 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1404 "divt%)%& %R1,%R2,%0"
1405 [(set_attr "type" "fdivt")
1406 (set_attr "trap" "yes")])
1409 [(set (match_operand:DF 0 "register_operand" "=f")
1410 (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1412 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1414 "divt%)%& %R1,%R2,%0"
1415 [(set_attr "type" "fdivt")
1416 (set_attr "trap" "yes")])
1419 [(set (match_operand:DF 0 "register_operand" "=&f")
1420 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1421 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1422 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1423 "divt%)%& %R1,%R2,%0"
1424 [(set_attr "type" "fdivt")
1425 (set_attr "trap" "yes")])
1428 [(set (match_operand:DF 0 "register_operand" "=f")
1429 (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1430 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1432 "divt%)%& %R1,%R2,%0"
1433 [(set_attr "type" "fdivt")
1434 (set_attr "trap" "yes")])
1437 [(set (match_operand:SF 0 "register_operand" "=&f")
1438 (mult:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
1439 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1440 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1441 "muls%)%& %R1,%R2,%0"
1442 [(set_attr "type" "fpop")
1443 (set_attr "trap" "yes")])
1445 (define_insn "mulsf3"
1446 [(set (match_operand:SF 0 "register_operand" "=f")
1447 (mult:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")
1448 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1450 "muls%)%& %R1,%R2,%0"
1451 [(set_attr "type" "fpop")
1452 (set_attr "trap" "yes")])
1455 [(set (match_operand:DF 0 "register_operand" "=&f")
1456 (mult:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
1457 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1458 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1459 "mult%)%& %R1,%R2,%0"
1460 [(set_attr "type" "fpop")
1461 (set_attr "trap" "yes")])
1463 (define_insn "muldf3"
1464 [(set (match_operand:DF 0 "register_operand" "=f")
1465 (mult:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG")
1466 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1468 "mult%)%& %R1,%R2,%0"
1469 [(set_attr "type" "fpop")
1470 (set_attr "trap" "yes")])
1473 [(set (match_operand:DF 0 "register_operand" "=&f")
1474 (mult:DF (float_extend:DF
1475 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1476 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1477 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1478 "mult%)%& %R1,%R2,%0"
1479 [(set_attr "type" "fpop")
1480 (set_attr "trap" "yes")])
1483 [(set (match_operand:DF 0 "register_operand" "=f")
1484 (mult:DF (float_extend:DF
1485 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1486 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1488 "mult%)%& %R1,%R2,%0"
1489 [(set_attr "type" "fpop")
1490 (set_attr "trap" "yes")])
1493 [(set (match_operand:DF 0 "register_operand" "=&f")
1494 (mult:DF (float_extend:DF
1495 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
1497 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1498 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1499 "mult%)%& %R1,%R2,%0"
1500 [(set_attr "type" "fpop")
1501 (set_attr "trap" "yes")])
1504 [(set (match_operand:DF 0 "register_operand" "=f")
1505 (mult:DF (float_extend:DF
1506 (match_operand:SF 1 "reg_or_fp0_operand" "%fG"))
1508 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1510 "mult%)%& %R1,%R2,%0"
1511 [(set_attr "type" "fpop")
1512 (set_attr "trap" "yes")])
1515 [(set (match_operand:SF 0 "register_operand" "=&f")
1516 (minus:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
1517 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1518 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1519 "subs%)%& %R1,%R2,%0"
1520 [(set_attr "type" "fpop")
1521 (set_attr "trap" "yes")])
1523 (define_insn "subsf3"
1524 [(set (match_operand:SF 0 "register_operand" "=f")
1525 (minus:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")
1526 (match_operand:SF 2 "reg_or_fp0_operand" "fG")))]
1528 "subs%)%& %R1,%R2,%0"
1529 [(set_attr "type" "fpop")
1530 (set_attr "trap" "yes")])
1533 [(set (match_operand:DF 0 "register_operand" "=&f")
1534 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1535 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1536 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1537 "subt%)%& %R1,%R2,%0"
1538 [(set_attr "type" "fpop")
1539 (set_attr "trap" "yes")])
1541 (define_insn "subdf3"
1542 [(set (match_operand:DF 0 "register_operand" "=f")
1543 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1544 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1546 "subt%)%& %R1,%R2,%0"
1547 [(set_attr "type" "fpop")
1548 (set_attr "trap" "yes")])
1551 [(set (match_operand:DF 0 "register_operand" "=&f")
1552 (minus:DF (float_extend:DF
1553 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1554 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1555 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1556 "subt%)%& %R1,%R2,%0"
1557 [(set_attr "type" "fpop")
1558 (set_attr "trap" "yes")])
1561 [(set (match_operand:DF 0 "register_operand" "=f")
1562 (minus:DF (float_extend:DF
1563 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1564 (match_operand:DF 2 "reg_or_fp0_operand" "fG")))]
1566 "subt%)%& %R1,%R2,%0"
1567 [(set_attr "type" "fpop")
1568 (set_attr "trap" "yes")])
1571 [(set (match_operand:DF 0 "register_operand" "=&f")
1572 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1574 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1575 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1576 "subt%)%& %R1,%R2,%0"
1577 [(set_attr "type" "fpop")
1578 (set_attr "trap" "yes")])
1581 [(set (match_operand:DF 0 "register_operand" "=f")
1582 (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")
1584 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1586 "subt%)%& %R1,%R2,%0"
1587 [(set_attr "type" "fpop")
1588 (set_attr "trap" "yes")])
1591 [(set (match_operand:DF 0 "register_operand" "=&f")
1592 (minus:DF (float_extend:DF
1593 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1595 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1596 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
1597 "subt%)%& %R1,%R2,%0"
1598 [(set_attr "type" "fpop")
1599 (set_attr "trap" "yes")])
1602 [(set (match_operand:DF 0 "register_operand" "=f")
1603 (minus:DF (float_extend:DF
1604 (match_operand:SF 1 "reg_or_fp0_operand" "fG"))
1606 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))]
1608 "subt%)%& %R1,%R2,%0"
1609 [(set_attr "type" "fpop")
1610 (set_attr "trap" "yes")])
1612 ;; Next are all the integer comparisons, and conditional moves and branches
1613 ;; and some of the related define_expand's and define_split's.
1616 [(set (match_operand:DI 0 "register_operand" "=r")
1617 (match_operator:DI 1 "alpha_comparison_operator"
1618 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
1619 (match_operand:DI 3 "reg_or_8bit_operand" "rI")]))]
1622 [(set_attr "type" "icmp")])
1624 ;; There are three important special-case that don't fit the above pattern
1625 ;; but which we want to handle here.
1628 [(set (match_operand:DI 0 "register_operand" "=r")
1629 (ne:DI (match_operand:DI 1 "register_operand" "r")
1633 [(set_attr "type" "icmp")])
1636 [(set (match_operand:DI 0 "register_operand" "=r")
1637 (gt:DI (match_operand:DI 1 "register_operand" "r")
1641 [(set_attr "type" "icmp")])
1644 [(set (match_operand:DI 0 "register_operand" "=r")
1645 (ge:DI (match_operand:DI 1 "register_operand" "r")
1649 [(set_attr "type" "icmp")])
1651 ;; This pattern exists so conditional moves of SImode values are handled.
1652 ;; Comparisons are still done in DImode though.
1655 [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
1657 (match_operator 2 "signed_comparison_operator"
1658 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
1659 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
1660 (match_operand:SI 1 "reg_or_8bit_operand" "rI,0,rI,0")
1661 (match_operand:SI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
1662 "operands[3] == const0_rtx || operands[4] == const0_rtx"
1670 [(set (match_operand:DI 0 "register_operand" "=r,r,r,r")
1672 (match_operator 2 "signed_comparison_operator"
1673 [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ,J,J")
1674 (match_operand:DI 4 "reg_or_0_operand" "J,J,rJ,rJ")])
1675 (match_operand:DI 1 "reg_or_8bit_operand" "rI,0,rI,0")
1676 (match_operand:DI 5 "reg_or_8bit_operand" "0,rI,0,rI")))]
1677 "operands[3] == const0_rtx || operands[4] == const0_rtx"
1685 [(set (match_operand:DI 0 "register_operand" "=r,r")
1687 (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
1691 (match_operand:DI 1 "reg_or_8bit_operand" "rI,0")
1692 (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))]
1699 [(set (match_operand:DI 0 "register_operand" "=r,r")
1701 (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ")
1705 (match_operand:DI 1 "reg_or_8bit_operand" "rI,0")
1706 (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))]
1712 ;; This form is added since combine thinks that an IF_THEN_ELSE with both
1713 ;; arms constant is a single insn, so it won't try to form it if combine
1714 ;; knows they are really two insns. This occurs in divides by powers
1718 [(set (match_operand:DI 0 "register_operand" "=r")
1720 (match_operator 2 "signed_comparison_operator"
1721 [(match_operand:DI 3 "reg_or_0_operand" "rJ")
1723 (plus:DI (match_dup 0)
1724 (match_operand:DI 1 "reg_or_8bit_operand" "rI"))
1726 (clobber (match_scratch:DI 4 "=&r"))]
1728 "addq %0,%1,%4\;cmov%C2 %r3,%4,%0")
1731 [(set (match_operand:DI 0 "register_operand" "")
1733 (match_operator 2 "signed_comparison_operator"
1734 [(match_operand:DI 3 "reg_or_0_operand" "")
1736 (plus:DI (match_dup 0)
1737 (match_operand:DI 1 "reg_or_8bit_operand" ""))
1739 (clobber (match_operand:DI 4 "register_operand" ""))]
1741 [(set (match_dup 4) (plus:DI (match_dup 0) (match_dup 1)))
1742 (set (match_dup 0) (if_then_else:DI (match_op_dup 2
1745 (match_dup 4) (match_dup 0)))]
1750 [(set (match_operand:DI 0 "register_operand" "")
1752 (match_operator 1 "comparison_operator"
1753 [(zero_extract:DI (match_operand:DI 2 "register_operand" "")
1755 (match_operand:DI 3 "const_int_operand" ""))
1757 (match_operand:DI 4 "reg_or_8bit_operand" "")
1758 (match_operand:DI 5 "reg_or_8bit_operand" "")))
1759 (clobber (match_operand:DI 6 "register_operand" ""))])]
1760 "INTVAL (operands[3]) != 0"
1762 (lshiftrt:DI (match_dup 2) (match_dup 3)))
1764 (if_then_else:DI (match_op_dup 1
1765 [(zero_extract:DI (match_dup 6)
1773 ;; For ABS, we have two choices, depending on whether the input and output
1774 ;; registers are the same or not.
1775 (define_expand "absdi2"
1776 [(set (match_operand:DI 0 "register_operand" "")
1777 (abs:DI (match_operand:DI 1 "register_operand" "")))]
1780 { if (rtx_equal_p (operands[0], operands[1]))
1781 emit_insn (gen_absdi2_same (operands[0], gen_reg_rtx (DImode)));
1783 emit_insn (gen_absdi2_diff (operands[0], operands[1]));
1788 (define_expand "absdi2_same"
1789 [(set (match_operand:DI 1 "register_operand" "")
1790 (neg:DI (match_operand:DI 0 "register_operand" "")))
1792 (if_then_else:DI (ge (match_dup 0) (const_int 0))
1798 (define_expand "absdi2_diff"
1799 [(set (match_operand:DI 0 "register_operand" "")
1800 (neg:DI (match_operand:DI 1 "register_operand" "")))
1802 (if_then_else:DI (lt (match_dup 1) (const_int 0))
1809 [(set (match_operand:DI 0 "register_operand" "")
1810 (abs:DI (match_dup 0)))
1811 (clobber (match_operand:DI 2 "register_operand" ""))]
1813 [(set (match_dup 1) (neg:DI (match_dup 0)))
1814 (set (match_dup 0) (if_then_else:DI (ge (match_dup 0) (const_int 0))
1815 (match_dup 0) (match_dup 1)))]
1819 [(set (match_operand:DI 0 "register_operand" "")
1820 (abs:DI (match_operand:DI 1 "register_operand" "")))]
1821 "! rtx_equal_p (operands[0], operands[1])"
1822 [(set (match_dup 0) (neg:DI (match_dup 1)))
1823 (set (match_dup 0) (if_then_else:DI (lt (match_dup 1) (const_int 0))
1824 (match_dup 0) (match_dup 1)))]
1828 [(set (match_operand:DI 0 "register_operand" "")
1829 (neg:DI (abs:DI (match_dup 0))))
1830 (clobber (match_operand:DI 2 "register_operand" ""))]
1832 [(set (match_dup 1) (neg:DI (match_dup 0)))
1833 (set (match_dup 0) (if_then_else:DI (le (match_dup 0) (const_int 0))
1834 (match_dup 0) (match_dup 1)))]
1838 [(set (match_operand:DI 0 "register_operand" "")
1839 (neg:DI (abs:DI (match_operand:DI 1 "register_operand" ""))))]
1840 "! rtx_equal_p (operands[0], operands[1])"
1841 [(set (match_dup 0) (neg:DI (match_dup 1)))
1842 (set (match_dup 0) (if_then_else:DI (gt (match_dup 1) (const_int 0))
1843 (match_dup 0) (match_dup 1)))]
1846 (define_expand "smaxdi3"
1848 (le:DI (match_operand:DI 1 "reg_or_0_operand" "")
1849 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1850 (set (match_operand:DI 0 "register_operand" "")
1851 (if_then_else:DI (eq (match_dup 3) (const_int 0))
1852 (match_dup 1) (match_dup 2)))]
1855 { operands[3] = gen_reg_rtx (DImode);
1859 [(set (match_operand:DI 0 "register_operand" "")
1860 (smax:DI (match_operand:DI 1 "reg_or_0_operand" "")
1861 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1862 (clobber (match_operand:DI 3 "register_operand" ""))]
1863 "operands[2] != const0_rtx"
1864 [(set (match_dup 3) (le:DI (match_dup 1) (match_dup 2)))
1865 (set (match_dup 0) (if_then_else:DI (eq (match_dup 3) (const_int 0))
1866 (match_dup 1) (match_dup 2)))]
1870 [(set (match_operand:DI 0 "register_operand" "=r")
1871 (smax:DI (match_operand:DI 1 "register_operand" "0")
1876 (define_expand "smindi3"
1878 (lt:DI (match_operand:DI 1 "reg_or_0_operand" "")
1879 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1880 (set (match_operand:DI 0 "register_operand" "")
1881 (if_then_else:DI (ne (match_dup 3) (const_int 0))
1882 (match_dup 1) (match_dup 2)))]
1885 { operands[3] = gen_reg_rtx (DImode);
1889 [(set (match_operand:DI 0 "register_operand" "")
1890 (smin:DI (match_operand:DI 1 "reg_or_0_operand" "")
1891 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1892 (clobber (match_operand:DI 3 "register_operand" ""))]
1893 "operands[2] != const0_rtx"
1894 [(set (match_dup 3) (lt:DI (match_dup 1) (match_dup 2)))
1895 (set (match_dup 0) (if_then_else:DI (ne (match_dup 3) (const_int 0))
1896 (match_dup 1) (match_dup 2)))]
1900 [(set (match_operand:DI 0 "register_operand" "=r")
1901 (smin:DI (match_operand:DI 1 "register_operand" "0")
1906 (define_expand "umaxdi3"
1908 (leu:DI (match_operand:DI 1 "reg_or_0_operand" "")
1909 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1910 (set (match_operand:DI 0 "register_operand" "")
1911 (if_then_else:DI (eq (match_dup 3) (const_int 0))
1912 (match_dup 1) (match_dup 2)))]
1915 { operands[3] = gen_reg_rtx (DImode);
1919 [(set (match_operand:DI 0 "register_operand" "")
1920 (umax:DI (match_operand:DI 1 "reg_or_0_operand" "")
1921 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1922 (clobber (match_operand:DI 3 "register_operand" ""))]
1923 "operands[2] != const0_rtx"
1924 [(set (match_dup 3) (leu:DI (match_dup 1) (match_dup 2)))
1925 (set (match_dup 0) (if_then_else:DI (eq (match_dup 3) (const_int 0))
1926 (match_dup 1) (match_dup 2)))]
1929 (define_expand "umindi3"
1931 (ltu:DI (match_operand:DI 1 "reg_or_0_operand" "")
1932 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1933 (set (match_operand:DI 0 "register_operand" "")
1934 (if_then_else:DI (ne (match_dup 3) (const_int 0))
1935 (match_dup 1) (match_dup 2)))]
1938 { operands[3] = gen_reg_rtx (DImode);
1942 [(set (match_operand:DI 0 "register_operand" "")
1943 (umin:DI (match_operand:DI 1 "reg_or_0_operand" "")
1944 (match_operand:DI 2 "reg_or_8bit_operand" "")))
1945 (clobber (match_operand:DI 3 "register_operand" ""))]
1946 "operands[2] != const0_rtx"
1947 [(set (match_dup 3) (ltu:DI (match_dup 1) (match_dup 2)))
1948 (set (match_dup 0) (if_then_else:DI (ne (match_dup 3) (const_int 0))
1949 (match_dup 1) (match_dup 2)))]
1955 (match_operator 1 "signed_comparison_operator"
1956 [(match_operand:DI 2 "reg_or_0_operand" "rJ")
1958 (label_ref (match_operand 0 "" ""))
1962 [(set_attr "type" "ibr")])
1967 (ne (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1971 (label_ref (match_operand 0 "" ""))
1975 [(set_attr "type" "ibr")])
1980 (eq (zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")
1984 (label_ref (match_operand 0 "" ""))
1988 [(set_attr "type" "ibr")])
1994 (match_operator 1 "comparison_operator"
1995 [(zero_extract:DI (match_operand:DI 2 "register_operand" "")
1997 (match_operand:DI 3 "const_int_operand" ""))
1999 (label_ref (match_operand 0 "" ""))
2001 (clobber (match_operand:DI 4 "register_operand" ""))])]
2002 "INTVAL (operands[3]) != 0"
2004 (lshiftrt:DI (match_dup 2) (match_dup 3)))
2006 (if_then_else (match_op_dup 1
2007 [(zero_extract:DI (match_dup 4)
2011 (label_ref (match_dup 0))
2015 ;; The following are the corresponding floating-point insns. Recall
2016 ;; we need to have variants that expand the arguments from SF mode
2020 [(set (match_operand:DF 0 "register_operand" "=&f")
2021 (match_operator:DF 1 "alpha_comparison_operator"
2022 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
2023 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
2024 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2025 "cmpt%C1%' %R2,%R3,%0"
2026 [(set_attr "type" "fpop")
2027 (set_attr "trap" "yes")])
2030 [(set (match_operand:DF 0 "register_operand" "=f")
2031 (match_operator:DF 1 "alpha_comparison_operator"
2032 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
2033 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
2035 "cmpt%C1%' %R2,%R3,%0"
2036 [(set_attr "type" "fpop")
2037 (set_attr "trap" "yes")])
2040 [(set (match_operand:DF 0 "register_operand" "=&f")
2041 (match_operator:DF 1 "alpha_comparison_operator"
2043 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
2044 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
2045 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2046 "cmpt%C1%' %R2,%R3,%0"
2047 [(set_attr "type" "fpop")
2048 (set_attr "trap" "yes")])
2051 [(set (match_operand:DF 0 "register_operand" "=f")
2052 (match_operator:DF 1 "alpha_comparison_operator"
2054 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
2055 (match_operand:DF 3 "reg_or_fp0_operand" "fG")]))]
2057 "cmpt%C1%' %R2,%R3,%0"
2058 [(set_attr "type" "fpop")
2059 (set_attr "trap" "yes")])
2062 [(set (match_operand:DF 0 "register_operand" "=&f")
2063 (match_operator:DF 1 "alpha_comparison_operator"
2064 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
2066 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
2067 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2068 "cmpt%C1%' %R2,%R3,%0"
2069 [(set_attr "type" "fpop")
2070 (set_attr "trap" "yes")])
2073 [(set (match_operand:DF 0 "register_operand" "=f")
2074 (match_operator:DF 1 "alpha_comparison_operator"
2075 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
2077 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
2079 "cmpt%C1%' %R2,%R3,%0"
2080 [(set_attr "type" "fpop")
2081 (set_attr "trap" "yes")])
2084 [(set (match_operand:DF 0 "register_operand" "=&f")
2085 (match_operator:DF 1 "alpha_comparison_operator"
2087 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
2089 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
2090 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2091 "cmpt%C1%' %R2,%R3,%0"
2092 [(set_attr "type" "fpop")
2093 (set_attr "trap" "yes")])
2096 [(set (match_operand:DF 0 "register_operand" "=f")
2097 (match_operator:DF 1 "alpha_comparison_operator"
2099 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
2101 (match_operand:SF 3 "reg_or_fp0_operand" "fG"))]))]
2103 "cmpt%C1%' %R2,%R3,%0"
2104 [(set_attr "type" "fpop")
2105 (set_attr "trap" "yes")])
2108 [(set (match_operand:DF 0 "register_operand" "=&f,f")
2110 (match_operator 3 "signed_comparison_operator"
2111 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
2112 (match_operand:DF 2 "fp0_operand" "G,G")])
2113 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
2114 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2115 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2118 fcmov%D3 %R4,%R5,%0"
2119 [(set_attr "type" "fpop")])
2122 [(set (match_operand:DF 0 "register_operand" "=f,f")
2124 (match_operator 3 "signed_comparison_operator"
2125 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
2126 (match_operand:DF 2 "fp0_operand" "G,G")])
2127 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
2128 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2132 fcmov%D3 %R4,%R5,%0"
2133 [(set_attr "type" "fpop")])
2136 [(set (match_operand:SF 0 "register_operand" "=&f,f")
2138 (match_operator 3 "signed_comparison_operator"
2139 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
2140 (match_operand:DF 2 "fp0_operand" "G,G")])
2141 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
2142 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
2143 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2146 fcmov%D3 %R4,%R5,%0"
2147 [(set_attr "type" "fpop")])
2150 [(set (match_operand:SF 0 "register_operand" "=f,f")
2152 (match_operator 3 "signed_comparison_operator"
2153 [(match_operand:DF 4 "reg_or_fp0_operand" "fG,fG")
2154 (match_operand:DF 2 "fp0_operand" "G,G")])
2155 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
2156 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
2160 fcmov%D3 %R4,%R5,%0"
2161 [(set_attr "type" "fpop")])
2164 [(set (match_operand:DF 0 "register_operand" "=&f,f")
2166 (match_operator 3 "signed_comparison_operator"
2167 [(match_operand:DF 1 "reg_or_fp0_operand" "fG,fG")
2168 (match_operand:DF 2 "fp0_operand" "G,G")])
2169 (float_extend:DF (match_operand:SF 4 "reg_or_fp0_operand" "fG,0"))
2170 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2171 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2174 fcmov%D3 %R4,%R5,%0"
2175 [(set_attr "type" "fpop")])
2178 [(set (match_operand:DF 0 "register_operand" "=&f,f")
2180 (match_operator 3 "signed_comparison_operator"
2182 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2183 (match_operand:DF 2 "fp0_operand" "G,G")])
2184 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
2185 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2186 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2189 fcmov%D3 %R4,%R5,%0"
2190 [(set_attr "type" "fpop")])
2193 [(set (match_operand:DF 0 "register_operand" "=f,f")
2195 (match_operator 3 "signed_comparison_operator"
2196 [(match_operand:DF 1 "reg_or_fp0_operand" "fG,fG")
2197 (match_operand:DF 2 "fp0_operand" "G,G")])
2198 (float_extend:DF (match_operand:SF 4 "reg_or_fp0_operand" "fG,0"))
2199 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2203 fcmov%D3 %R4,%R5,%0"
2204 [(set_attr "type" "fpop")])
2207 [(set (match_operand:DF 0 "register_operand" "=f,f")
2209 (match_operator 3 "signed_comparison_operator"
2211 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2212 (match_operand:DF 2 "fp0_operand" "G,G")])
2213 (match_operand:DF 1 "reg_or_fp0_operand" "fG,0")
2214 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2218 fcmov%D3 %R4,%R5,%0"
2219 [(set_attr "type" "fpop")])
2222 [(set (match_operand:SF 0 "register_operand" "=&f,f")
2224 (match_operator 3 "signed_comparison_operator"
2226 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2227 (match_operand:DF 2 "fp0_operand" "G,G")])
2228 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
2229 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
2230 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2233 fcmov%D3 %R4,%R5,%0"
2234 [(set_attr "type" "fpop")])
2237 [(set (match_operand:SF 0 "register_operand" "=f,f")
2239 (match_operator 3 "signed_comparison_operator"
2241 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2242 (match_operand:DF 2 "fp0_operand" "G,G")])
2243 (match_operand:SF 1 "reg_or_fp0_operand" "fG,0")
2244 (match_operand:SF 5 "reg_or_fp0_operand" "0,fG")))]
2248 fcmov%D3 %R4,%R5,%0"
2249 [(set_attr "type" "fpop")])
2252 [(set (match_operand:DF 0 "register_operand" "=&f,f")
2254 (match_operator 3 "signed_comparison_operator"
2256 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2257 (match_operand:DF 2 "fp0_operand" "G,G")])
2258 (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
2259 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2260 "TARGET_FP && (alpha_tp == ALPHA_TP_INSN)"
2263 fcmov%D3 %R4,%R5,%0"
2264 [(set_attr "type" "fpop")])
2267 [(set (match_operand:DF 0 "register_operand" "=f,f")
2269 (match_operator 3 "signed_comparison_operator"
2271 (match_operand:SF 4 "reg_or_fp0_operand" "fG,fG"))
2272 (match_operand:DF 2 "fp0_operand" "G,G")])
2273 (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG,0"))
2274 (match_operand:DF 5 "reg_or_fp0_operand" "0,fG")))]
2278 fcmov%D3 %R4,%R5,%0"
2279 [(set_attr "type" "fpop")])
2281 (define_expand "maxdf3"
2283 (le:DF (match_operand:DF 1 "reg_or_fp0_operand" "")
2284 (match_operand:DF 2 "reg_or_fp0_operand" "")))
2285 (set (match_operand:DF 0 "register_operand" "")
2286 (if_then_else:DF (eq (match_dup 3) (match_dup 4))
2287 (match_dup 1) (match_dup 2)))]
2290 { operands[3] = gen_reg_rtx (DFmode);
2291 operands[4] = CONST0_RTX (DFmode);
2294 (define_expand "mindf3"
2296 (lt:DF (match_operand:DF 1 "reg_or_fp0_operand" "")
2297 (match_operand:DF 2 "reg_or_fp0_operand" "")))
2298 (set (match_operand:DF 0 "register_operand" "")
2299 (if_then_else:DF (ne (match_dup 3) (match_dup 4))
2300 (match_dup 1) (match_dup 2)))]
2303 { operands[3] = gen_reg_rtx (DFmode);
2304 operands[4] = CONST0_RTX (DFmode);
2307 (define_expand "maxsf3"
2309 (le:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))
2310 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" ""))))
2311 (set (match_operand:SF 0 "register_operand" "")
2312 (if_then_else:SF (eq (match_dup 3) (match_dup 4))
2313 (match_dup 1) (match_dup 2)))]
2316 { operands[3] = gen_reg_rtx (DFmode);
2317 operands[4] = CONST0_RTX (DFmode);
2320 (define_expand "minsf3"
2322 (lt:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))
2323 (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" ""))))
2324 (set (match_operand:SF 0 "register_operand" "")
2325 (if_then_else:SF (ne (match_dup 3) (match_dup 4))
2326 (match_dup 1) (match_dup 2)))]
2329 { operands[3] = gen_reg_rtx (DFmode);
2330 operands[4] = CONST0_RTX (DFmode);
2336 (match_operator 1 "signed_comparison_operator"
2337 [(match_operand:DF 2 "reg_or_fp0_operand" "fG")
2338 (match_operand:DF 3 "fp0_operand" "G")])
2339 (label_ref (match_operand 0 "" ""))
2343 [(set_attr "type" "fbr")])
2348 (match_operator 1 "signed_comparison_operator"
2350 (match_operand:SF 2 "reg_or_fp0_operand" "fG"))
2351 (match_operand:DF 3 "fp0_operand" "G")])
2352 (label_ref (match_operand 0 "" ""))
2356 [(set_attr "type" "fbr")])
2358 ;; These are the main define_expand's used to make conditional branches
2361 (define_expand "cmpdf"
2362 [(set (cc0) (compare (match_operand:DF 0 "reg_or_fp0_operand" "")
2363 (match_operand:DF 1 "reg_or_fp0_operand" "")))]
2367 alpha_compare_op0 = operands[0];
2368 alpha_compare_op1 = operands[1];
2369 alpha_compare_fp_p = 1;
2373 (define_expand "cmpdi"
2374 [(set (cc0) (compare (match_operand:DI 0 "reg_or_0_operand" "")
2375 (match_operand:DI 1 "reg_or_8bit_operand" "")))]
2379 alpha_compare_op0 = operands[0];
2380 alpha_compare_op1 = operands[1];
2381 alpha_compare_fp_p = 0;
2385 (define_expand "beq"
2386 [(set (match_dup 1) (match_dup 2))
2388 (if_then_else (match_dup 3)
2389 (label_ref (match_operand 0 "" ""))
2394 enum machine_mode mode;
2395 enum rtx_code compare_code, branch_code;
2397 if (alpha_compare_fp_p)
2398 mode = DFmode, compare_code = EQ, branch_code = NE;
2401 mode = DImode, compare_code = MINUS, branch_code = EQ;
2402 if (GET_CODE (alpha_compare_op1) == CONST_INT)
2404 compare_code = PLUS;
2405 alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
2409 operands[1] = gen_reg_rtx (mode);
2410 operands[2] = gen_rtx (compare_code, mode,
2411 alpha_compare_op0, alpha_compare_op1);
2412 operands[3] = gen_rtx (branch_code, VOIDmode,
2413 operands[1], CONST0_RTX (mode));
2416 (define_expand "bne"
2417 [(set (match_dup 1) (match_dup 2))
2419 (if_then_else (match_dup 3)
2420 (label_ref (match_operand 0 "" ""))
2425 enum machine_mode mode;
2426 enum rtx_code compare_code, branch_code;
2428 if (alpha_compare_fp_p)
2429 mode = DFmode, compare_code = EQ, branch_code = EQ;
2432 mode = DImode, compare_code = MINUS, branch_code = NE;
2433 if (GET_CODE (alpha_compare_op1) == CONST_INT)
2435 compare_code = PLUS;
2436 alpha_compare_op1 = GEN_INT (- INTVAL (alpha_compare_op1));
2440 operands[1] = gen_reg_rtx (mode);
2441 operands[2] = gen_rtx (compare_code, mode,
2442 alpha_compare_op0, alpha_compare_op1);
2443 operands[3] = gen_rtx (branch_code, VOIDmode,
2444 operands[1], CONST0_RTX (mode));
2447 (define_expand "blt"
2448 [(set (match_dup 1) (match_dup 2))
2450 (if_then_else (match_dup 3)
2451 (label_ref (match_operand 0 "" ""))
2456 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
2457 operands[1] = gen_reg_rtx (mode);
2458 operands[2] = gen_rtx (LT, mode, alpha_compare_op0, alpha_compare_op1);
2459 operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (mode));
2462 (define_expand "ble"
2463 [(set (match_dup 1) (match_dup 2))
2465 (if_then_else (match_dup 3)
2466 (label_ref (match_operand 0 "" ""))
2471 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
2472 operands[1] = gen_reg_rtx (mode);
2473 operands[2] = gen_rtx (LE, mode, alpha_compare_op0, alpha_compare_op1);
2474 operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (mode));
2477 (define_expand "bgt"
2478 [(set (match_dup 1) (match_dup 2))
2480 (if_then_else (match_dup 3)
2481 (label_ref (match_operand 0 "" ""))
2486 if (alpha_compare_fp_p)
2488 operands[1] = gen_reg_rtx (DFmode);
2489 operands[2] = gen_rtx (LT, DFmode, alpha_compare_op1, alpha_compare_op0);
2490 operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));
2494 operands[1] = gen_reg_rtx (DImode);
2495 operands[2] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
2496 operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
2500 (define_expand "bge"
2501 [(set (match_dup 1) (match_dup 2))
2503 (if_then_else (match_dup 3)
2504 (label_ref (match_operand 0 "" ""))
2509 if (alpha_compare_fp_p)
2511 operands[1] = gen_reg_rtx (DFmode);
2512 operands[2] = gen_rtx (LE, DFmode, alpha_compare_op1, alpha_compare_op0);
2513 operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));
2517 operands[1] = gen_reg_rtx (DImode);
2518 operands[2] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
2519 operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
2523 (define_expand "bltu"
2524 [(set (match_dup 1) (match_dup 2))
2526 (if_then_else (match_dup 3)
2527 (label_ref (match_operand 0 "" ""))
2532 operands[1] = gen_reg_rtx (DImode);
2533 operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
2534 operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);
2537 (define_expand "bleu"
2538 [(set (match_dup 1) (match_dup 2))
2540 (if_then_else (match_dup 3)
2541 (label_ref (match_operand 0 "" ""))
2546 operands[1] = gen_reg_rtx (DImode);
2547 operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
2548 operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);
2551 (define_expand "bgtu"
2552 [(set (match_dup 1) (match_dup 2))
2554 (if_then_else (match_dup 3)
2555 (label_ref (match_operand 0 "" ""))
2560 operands[1] = gen_reg_rtx (DImode);
2561 operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
2562 operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
2565 (define_expand "bgeu"
2566 [(set (match_dup 1) (match_dup 2))
2568 (if_then_else (match_dup 3)
2569 (label_ref (match_operand 0 "" ""))
2574 operands[1] = gen_reg_rtx (DImode);
2575 operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
2576 operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);
2579 (define_expand "seq"
2580 [(set (match_operand:DI 0 "register_operand" "")
2585 if (alpha_compare_fp_p)
2588 operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
2591 (define_expand "sne"
2592 [(set (match_operand:DI 0 "register_operand" "")
2594 (set (match_dup 0) (xor:DI (match_dup 0) (const_int 1)))]
2598 if (alpha_compare_fp_p)
2601 operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
2604 (define_expand "slt"
2605 [(set (match_operand:DI 0 "register_operand" "")
2610 if (alpha_compare_fp_p)
2613 operands[1] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
2616 (define_expand "sle"
2617 [(set (match_operand:DI 0 "register_operand" "")
2622 if (alpha_compare_fp_p)
2625 operands[1] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
2628 (define_expand "sgt"
2629 [(set (match_operand:DI 0 "register_operand" "")
2634 if (alpha_compare_fp_p)
2637 operands[1] = gen_rtx (LT, DImode, force_reg (DImode, alpha_compare_op1),
2641 (define_expand "sge"
2642 [(set (match_operand:DI 0 "register_operand" "")
2647 if (alpha_compare_fp_p)
2650 operands[1] = gen_rtx (LE, DImode, force_reg (DImode, alpha_compare_op1),
2654 (define_expand "sltu"
2655 [(set (match_operand:DI 0 "register_operand" "")
2660 if (alpha_compare_fp_p)
2663 operands[1] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
2666 (define_expand "sleu"
2667 [(set (match_operand:DI 0 "register_operand" "")
2672 if (alpha_compare_fp_p)
2675 operands[1] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
2678 (define_expand "sgtu"
2679 [(set (match_operand:DI 0 "register_operand" "")
2684 if (alpha_compare_fp_p)
2687 operands[1] = gen_rtx (LTU, DImode, force_reg (DImode, alpha_compare_op1),
2691 (define_expand "sgeu"
2692 [(set (match_operand:DI 0 "register_operand" "")
2697 if (alpha_compare_fp_p)
2700 operands[1] = gen_rtx (LEU, DImode, force_reg (DImode, alpha_compare_op1),
2704 ;; These are the main define_expand's used to make conditional moves.
2706 (define_expand "movsicc"
2707 [(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
2708 (set (match_operand:SI 0 "register_operand" "")
2709 (if_then_else:DI (match_dup 5)
2710 (match_operand:SI 2 "reg_or_8bit_operand" "")
2711 (match_operand:SI 3 "reg_or_8bit_operand" "")))]
2716 enum rtx_code code = GET_CODE (operands[1]), code2 = NE;
2718 if (alpha_compare_fp_p)
2722 case EQ: case LE: case LT:
2723 op0 = alpha_compare_op0;
2724 op1 = alpha_compare_op1;
2728 op0 = alpha_compare_op0;
2729 op1 = alpha_compare_op1;
2733 op0 = force_reg (DImode, alpha_compare_op1);
2734 op1 = alpha_compare_op0;
2738 op0 = force_reg (DImode, alpha_compare_op1);
2739 op1 = alpha_compare_op0;
2744 operands[1] = gen_rtx (code, DImode, op0, op1);
2745 operands[4] = gen_reg_rtx (DImode);
2746 operands[5] = gen_rtx (code2, VOIDmode, operands[4], CONST0_RTX (DImode));
2749 (define_expand "movdicc"
2750 [(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
2751 (set (match_operand:DI 0 "register_operand" "")
2752 (if_then_else:DI (match_dup 5)
2753 (match_operand:DI 2 "reg_or_8bit_operand" "")
2754 (match_operand:DI 3 "reg_or_8bit_operand" "")))]
2759 enum rtx_code code = GET_CODE (operands[1]), code2 = NE;
2761 if (alpha_compare_fp_p)
2765 case EQ: case LE: case LT:
2766 op0 = alpha_compare_op0;
2767 op1 = alpha_compare_op1;
2771 op0 = alpha_compare_op0;
2772 op1 = alpha_compare_op1;
2776 op0 = force_reg (DImode, alpha_compare_op1);
2777 op1 = alpha_compare_op0;
2781 op0 = force_reg (DImode, alpha_compare_op1);
2782 op1 = alpha_compare_op0;
2787 operands[1] = gen_rtx (code, DImode, op0, op1);
2788 operands[4] = gen_reg_rtx (DImode);
2789 operands[5] = gen_rtx (code2, VOIDmode, operands[4], CONST0_RTX (DImode));
2792 (define_expand "movsfcc"
2793 [(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
2794 (set (match_operand:SF 0 "register_operand" "")
2795 (if_then_else:SF (match_dup 5)
2796 (match_operand:SF 2 "reg_or_fp0_operand" "")
2797 (match_operand:SF 3 "reg_or_fp0_operand" "")))]
2802 enum rtx_code code = GET_CODE (operands[1]), code2 = NE;
2804 if (!alpha_compare_fp_p)
2808 case EQ: case LE: case LT:
2809 op0 = alpha_compare_op0;
2810 op1 = alpha_compare_op1;
2813 /* There isn't a cmptne insn. */
2815 op0 = alpha_compare_op0;
2816 op1 = alpha_compare_op1;
2820 op0 = force_reg (DFmode, alpha_compare_op1);
2821 op1 = alpha_compare_op0;
2825 op0 = force_reg (DFmode, alpha_compare_op1);
2826 op1 = alpha_compare_op0;
2831 operands[1] = gen_rtx (code, DFmode, op0, op1);
2832 operands[4] = gen_reg_rtx (DFmode);
2833 operands[5] = gen_rtx (code2, VOIDmode, operands[4], CONST0_RTX (DFmode));
2836 (define_expand "movdfcc"
2837 [(set (match_dup 4) (match_operand 1 "comparison_operator" ""))
2838 (set (match_operand:DF 0 "register_operand" "")
2839 (if_then_else:DF (match_dup 5)
2840 (match_operand:DF 2 "reg_or_fp0_operand" "")
2841 (match_operand:DF 3 "reg_or_fp0_operand" "")))]
2846 enum rtx_code code = GET_CODE (operands[1]), code2 = NE;
2848 if (!alpha_compare_fp_p)
2852 case EQ: case LE: case LT:
2853 op0 = alpha_compare_op0;
2854 op1 = alpha_compare_op1;
2857 /* There isn't a cmptne insn. */
2859 op0 = alpha_compare_op0;
2860 op1 = alpha_compare_op1;
2864 op0 = force_reg (DFmode, alpha_compare_op1);
2865 op1 = alpha_compare_op0;
2869 op0 = force_reg (DFmode, alpha_compare_op1);
2870 op1 = alpha_compare_op0;
2875 operands[1] = gen_rtx (code, DFmode, op0, op1);
2876 operands[4] = gen_reg_rtx (DFmode);
2877 operands[5] = gen_rtx (code2, VOIDmode, operands[4], CONST0_RTX (DFmode));
2880 ;; These define_split definitions are used in cases when comparisons have
2881 ;; not be stated in the correct way and we need to reverse the second
2882 ;; comparison. For example, x >= 7 has to be done as x < 6 with the
2883 ;; comparison that tests the result being reversed. We have one define_split
2884 ;; for each use of a comparison. They do not match valid insns and need
2885 ;; not generate valid insns.
2887 ;; We can also handle equality comparisons (and inequality comparisons in
2888 ;; cases where the resulting add cannot overflow) by doing an add followed by
2889 ;; a comparison with zero. This is faster since the addition takes one
2890 ;; less cycle than a compare when feeding into a conditional move.
2891 ;; For this case, we also have an SImode pattern since we can merge the add
2892 ;; and sign extend and the order doesn't matter.
2894 ;; We do not do this for floating-point, since it isn't clear how the "wrong"
2895 ;; operation could have been generated.
2898 [(set (match_operand:DI 0 "register_operand" "")
2900 (match_operator 1 "comparison_operator"
2901 [(match_operand:DI 2 "reg_or_0_operand" "")
2902 (match_operand:DI 3 "reg_or_cint_operand" "")])
2903 (match_operand:DI 4 "reg_or_cint_operand" "")
2904 (match_operand:DI 5 "reg_or_cint_operand" "")))
2905 (clobber (match_operand:DI 6 "register_operand" ""))]
2906 "operands[3] != const0_rtx"
2907 [(set (match_dup 6) (match_dup 7))
2909 (if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]
2911 { enum rtx_code code = GET_CODE (operands[1]);
2912 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
2914 /* If we are comparing for equality with a constant and that constant
2915 appears in the arm when the register equals the constant, use the
2916 register since that is more likely to match (and to produce better code
2919 if (code == EQ && GET_CODE (operands[3]) == CONST_INT
2920 && rtx_equal_p (operands[4], operands[3]))
2921 operands[4] = operands[2];
2923 else if (code == NE && GET_CODE (operands[3]) == CONST_INT
2924 && rtx_equal_p (operands[5], operands[3]))
2925 operands[5] = operands[2];
2927 if (code == NE || code == EQ
2928 || (extended_count (operands[2], DImode, unsignedp) >= 1
2929 && extended_count (operands[3], DImode, unsignedp) >= 1))
2931 if (GET_CODE (operands[3]) == CONST_INT)
2932 operands[7] = gen_rtx (PLUS, DImode, operands[2],
2933 GEN_INT (- INTVAL (operands[3])));
2935 operands[7] = gen_rtx (MINUS, DImode, operands[2], operands[3]);
2937 operands[8] = gen_rtx (code, VOIDmode, operands[6], const0_rtx);
2940 else if (code == EQ || code == LE || code == LT
2941 || code == LEU || code == LTU)
2943 operands[7] = gen_rtx (code, DImode, operands[2], operands[3]);
2944 operands[8] = gen_rtx (NE, VOIDmode, operands[6], const0_rtx);
2948 operands[7] = gen_rtx (reverse_condition (code), DImode, operands[2],
2950 operands[8] = gen_rtx (EQ, VOIDmode, operands[6], const0_rtx);
2955 [(set (match_operand:DI 0 "register_operand" "")
2957 (match_operator 1 "comparison_operator"
2958 [(match_operand:SI 2 "reg_or_0_operand" "")
2959 (match_operand:SI 3 "reg_or_cint_operand" "")])
2960 (match_operand:DI 4 "reg_or_8bit_operand" "")
2961 (match_operand:DI 5 "reg_or_8bit_operand" "")))
2962 (clobber (match_operand:DI 6 "register_operand" ""))]
2963 "operands[3] != const0_rtx
2964 && (GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE)"
2965 [(set (match_dup 6) (match_dup 7))
2967 (if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]
2969 { enum rtx_code code = GET_CODE (operands[1]);
2970 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
2973 if ((code != NE && code != EQ
2974 && ! (extended_count (operands[2], DImode, unsignedp) >= 1
2975 && extended_count (operands[3], DImode, unsignedp) >= 1)))
2978 if (GET_CODE (operands[3]) == CONST_INT)
2979 tem = gen_rtx (PLUS, SImode, operands[2],
2980 GEN_INT (- INTVAL (operands[3])));
2982 tem = gen_rtx (MINUS, SImode, operands[2], operands[3]);
2984 operands[7] = gen_rtx (SIGN_EXTEND, DImode, tem);
2985 operands[8] = gen_rtx (GET_CODE (operands[1]), VOIDmode, operands[6],
2992 (match_operator 1 "comparison_operator"
2993 [(match_operand:DI 2 "reg_or_0_operand" "")
2994 (match_operand:DI 3 "reg_or_cint_operand" "")])
2995 (label_ref (match_operand 0 "" ""))
2997 (clobber (match_operand:DI 4 "register_operand" ""))]
2998 "operands[3] != const0_rtx"
2999 [(set (match_dup 4) (match_dup 5))
3000 (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]
3002 { enum rtx_code code = GET_CODE (operands[1]);
3003 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
3005 if (code == NE || code == EQ
3006 || (extended_count (operands[2], DImode, unsignedp) >= 1
3007 && extended_count (operands[3], DImode, unsignedp) >= 1))
3009 if (GET_CODE (operands[3]) == CONST_INT)
3010 operands[5] = gen_rtx (PLUS, DImode, operands[2],
3011 GEN_INT (- INTVAL (operands[3])));
3013 operands[5] = gen_rtx (MINUS, DImode, operands[2], operands[3]);
3015 operands[6] = gen_rtx (code, VOIDmode, operands[4], const0_rtx);
3018 else if (code == EQ || code == LE || code == LT
3019 || code == LEU || code == LTU)
3021 operands[5] = gen_rtx (code, DImode, operands[2], operands[3]);
3022 operands[6] = gen_rtx (NE, VOIDmode, operands[4], const0_rtx);
3026 operands[5] = gen_rtx (reverse_condition (code), DImode, operands[2],
3028 operands[6] = gen_rtx (EQ, VOIDmode, operands[4], const0_rtx);
3035 (match_operator 1 "comparison_operator"
3036 [(match_operand:SI 2 "reg_or_0_operand" "")
3037 (match_operand:SI 3 "const_int_operand" "")])
3038 (label_ref (match_operand 0 "" ""))
3040 (clobber (match_operand:DI 4 "register_operand" ""))]
3041 "operands[3] != const0_rtx
3042 && (GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE)"
3043 [(set (match_dup 4) (match_dup 5))
3044 (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]
3048 if (GET_CODE (operands[3]) == CONST_INT)
3049 tem = gen_rtx (PLUS, SImode, operands[2],
3050 GEN_INT (- INTVAL (operands[3])));
3052 tem = gen_rtx (MINUS, SImode, operands[2], operands[3]);
3054 operands[5] = gen_rtx (SIGN_EXTEND, DImode, tem);
3055 operands[6] = gen_rtx (GET_CODE (operands[1]), VOIDmode,
3056 operands[4], const0_rtx);
3059 ;; We can convert such things as "a > 0xffff" to "t = a & ~ 0xffff; t != 0".
3060 ;; This eliminates one, and sometimes two, insns when the AND can be done
3063 [(set (match_operand:DI 0 "register_operand" "")
3064 (match_operator 1 "comparison_operator"
3065 [(match_operand:DI 2 "register_operand" "")
3066 (match_operand:DI 3 "const_int_operand" "")]))
3067 (clobber (match_operand:DI 4 "register_operand" ""))]
3068 "exact_log2 (INTVAL (operands[3]) + 1) >= 0
3069 && (GET_CODE (operands[1]) == GTU
3070 || GET_CODE (operands[1]) == LEU
3071 || ((GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == LE)
3072 && extended_count (operands[2], DImode, 1) > 0))"
3073 [(set (match_dup 4) (and:DI (match_dup 2) (match_dup 5)))
3074 (set (match_dup 0) (match_dup 6))]
3077 operands[5] = GEN_INT (~ INTVAL (operands[3]));
3078 operands[6] = gen_rtx (((GET_CODE (operands[1]) == GTU
3079 || GET_CODE (operands[1]) == GT)
3081 DImode, operands[4], const0_rtx);
3084 ;; Here are the CALL and unconditional branch insns. Calls on NT and OSF
3085 ;; work differently, so we have different patterns for each.
3087 (define_expand "call"
3088 [(use (match_operand:DI 0 "" ""))
3089 (use (match_operand 1 "" ""))]
3093 emit_call_insn (gen_call_nt (operands[0], operands[1]));
3095 emit_call_insn (gen_call_osf (operands[0], operands[1]));
3100 (define_expand "call_osf"
3101 [(parallel [(call (mem:DI (match_operand 0 "" ""))
3102 (match_operand 1 "" ""))
3103 (clobber (reg:DI 27))
3104 (clobber (reg:DI 26))])]
3107 { if (GET_CODE (operands[0]) != MEM)
3110 operands[0] = XEXP (operands[0], 0);
3112 if (GET_CODE (operands[0]) != SYMBOL_REF
3113 && ! (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == 27))
3115 rtx tem = gen_rtx (REG, DImode, 27);
3116 emit_move_insn (tem, operands[0]);
3121 (define_expand "call_nt"
3122 [(parallel [(call (mem:DI (match_operand:DI 0 "" ""))
3123 (match_operand 1 "" ""))
3124 (clobber (reg:DI 26))])]
3127 { if (GET_CODE (operands[0]) != MEM)
3129 operands[0] = XEXP (operands[0], 0);
3131 if (GET_CODE (operands[1]) != SYMBOL_REF
3132 && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
3134 rtx tem = gen_rtx (REG, DImode, 27);
3135 emit_move_insn (tem, operands[1]);
3140 (define_expand "call_value"
3141 [(use (match_operand 0 "" ""))
3142 (use (match_operand:DI 1 "" ""))
3143 (use (match_operand 2 "" ""))]
3147 emit_call_insn (gen_call_value_nt (operands[0], operands[1], operands[2]));
3149 emit_call_insn (gen_call_value_osf (operands[0], operands[1],
3154 (define_expand "call_value_osf"
3155 [(parallel [(set (match_operand 0 "" "")
3156 (call (mem:DI (match_operand 1 "" ""))
3157 (match_operand 2 "" "")))
3158 (clobber (reg:DI 27))
3159 (clobber (reg:DI 26))])]
3162 { if (GET_CODE (operands[1]) != MEM)
3165 operands[1] = XEXP (operands[1], 0);
3167 if (GET_CODE (operands[1]) != SYMBOL_REF
3168 && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
3170 rtx tem = gen_rtx (REG, DImode, 27);
3171 emit_move_insn (tem, operands[1]);
3176 (define_expand "call_value_nt"
3177 [(parallel [(set (match_operand 0 "" "")
3178 (call (mem:DI (match_operand:DI 1 "" ""))
3179 (match_operand 2 "" "")))
3180 (clobber (reg:DI 26))])]
3183 { if (GET_CODE (operands[1]) != MEM)
3186 operands[1] = XEXP (operands[1], 0);
3187 if (GET_CODE (operands[1]) != SYMBOL_REF
3188 && ! (GET_CODE (operands[1]) == REG && REGNO (operands[1]) == 27))
3190 rtx tem = gen_rtx (REG, DImode, 27);
3191 emit_move_insn (tem, operands[1]);
3197 [(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,i"))
3198 (match_operand 1 "" ""))
3199 (clobber (reg:DI 27))
3200 (clobber (reg:DI 26))]
3201 "! WINDOWS_NT && alpha_tp == ALPHA_TP_INSN"
3203 jsr $26,($27),0\;trapb\;ldgp $29,4($26)
3204 bsr $26,%0..ng\;trapb
3205 jsr $26,%0\;trapb\;ldgp $29,4($26)"
3206 [(set_attr "type" "jsr,jsr,ibr")])
3209 [(call (mem:DI (match_operand:DI 0 "call_operand" "r,R,i"))
3210 (match_operand 1 "" ""))
3211 (clobber (reg:DI 27))
3212 (clobber (reg:DI 26))]
3215 jsr $26,($27),0\;ldgp $29,0($26)
3217 jsr $26,%0\;ldgp $29,0($26)"
3218 [(set_attr "type" "jsr,jsr,ibr")])
3221 [(call (mem:DI (match_operand:DI 0 "call_operand" "r,i"))
3222 (match_operand 1 "" ""))
3223 (clobber (reg:DI 26))]
3228 [(set_attr "type" "jsr")])
3231 [(set (match_operand 0 "register_operand" "=rf,rf,rf")
3232 (call (mem:DI (match_operand:DI 1 "call_operand" "r,R,i"))
3233 (match_operand 2 "" "")))
3234 (clobber (reg:DI 27))
3235 (clobber (reg:DI 26))]
3236 "! WINDOWS_NT && alpha_tp == ALPHA_TP_INSN"
3238 jsr $26,($27),0\;trapb\;ldgp $29,4($26)
3239 bsr $26,%1..ng\;trapb
3240 jsr $26,%1\;trapb\;ldgp $29,4($26)"
3241 [(set_attr "type" "jsr,jsr,ibr")])
3244 [(set (match_operand 0 "register_operand" "=rf,rf,rf")
3245 (call (mem:DI (match_operand:DI 1 "call_operand" "r,R,i"))
3246 (match_operand 2 "" "")))
3247 (clobber (reg:DI 27))
3248 (clobber (reg:DI 26))]
3251 jsr $26,($27),0\;ldgp $29,0($26)
3253 jsr $26,%1\;ldgp $29,0($26)"
3254 [(set_attr "type" "jsr,jsr,ibr")])
3257 [(set (match_operand 0 "register_operand" "=rf,rf")
3258 (call (mem:DI (match_operand:DI 1 "call_operand" "r,i"))
3259 (match_operand 2 "" "")))
3260 (clobber (reg:DI 26))]
3265 [(set_attr "type" "jsr")])
3267 ;; Call subroutine returning any type.
3269 (define_expand "untyped_call"
3270 [(parallel [(call (match_operand 0 "" "")
3272 (match_operand 1 "" "")
3273 (match_operand 2 "" "")])]
3279 emit_call_insn (gen_call (operands[0], const0_rtx, NULL, const0_rtx));
3281 for (i = 0; i < XVECLEN (operands[2], 0); i++)
3283 rtx set = XVECEXP (operands[2], 0, i);
3284 emit_move_insn (SET_DEST (set), SET_SRC (set));
3287 /* The optimizer does not know that the call sets the function value
3288 registers we stored in the result block. We avoid problems by
3289 claiming that all hard registers are used and clobbered at this
3291 emit_insn (gen_blockage ());
3296 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
3297 ;; all of memory. This blocks insns from being moved across this point.
3299 (define_insn "blockage"
3300 [(unspec_volatile [(const_int 0)] 1)]
3306 (label_ref (match_operand 0 "" "")))]
3309 [(set_attr "type" "ibr")])
3311 (define_insn "return"
3315 [(set_attr "type" "ibr")])
3317 (define_insn "indirect_jump"
3318 [(set (pc) (match_operand:DI 0 "register_operand" "r"))]
3321 [(set_attr "type" "ibr")])
3327 [(set_attr "type" "iaddlog")])
3329 (define_expand "tablejump"
3330 [(use (match_operand:SI 0 "register_operand" ""))
3331 (use (match_operand:SI 1 "" ""))]
3336 emit_jump_insn (gen_tablejump_nt (operands[0], operands[1]));
3338 emit_jump_insn (gen_tablejump_osf (operands[0], operands[1]));
3343 (define_expand "tablejump_osf"
3345 (sign_extend:DI (match_operand:SI 0 "register_operand" "")))
3346 (parallel [(set (pc)
3347 (plus:DI (match_dup 3)
3348 (label_ref:DI (match_operand 1 "" ""))))
3349 (clobber (match_scratch:DI 2 "=r"))])]
3352 { operands[3] = gen_reg_rtx (DImode); }")
3354 (define_expand "tablejump_nt"
3356 (sign_extend:DI (match_operand:SI 0 "register_operand" "")))
3357 (parallel [(set (pc)
3359 (use (label_ref (match_operand 1 "" "")))])]
3362 { operands[3] = gen_reg_rtx (DImode); }")
3366 (plus:DI (match_operand:DI 0 "register_operand" "r")
3367 (label_ref:DI (match_operand 1 "" ""))))
3368 (clobber (match_scratch:DI 2 "=r"))]
3369 "! WINDOWS_NT && next_active_insn (insn) != 0
3370 && GET_CODE (PATTERN (next_active_insn (insn))) == ADDR_DIFF_VEC
3371 && PREV_INSN (next_active_insn (insn)) == operands[1]"
3373 { rtx best_label = 0;
3374 rtx jump_table_insn = next_active_insn (operands[1]);
3376 if (GET_CODE (jump_table_insn) == JUMP_INSN
3377 && GET_CODE (PATTERN (jump_table_insn)) == ADDR_DIFF_VEC)
3379 rtx jump_table = PATTERN (jump_table_insn);
3380 int n_labels = XVECLEN (jump_table, 1);
3381 int best_count = -1;
3384 for (i = 0; i < n_labels; i++)
3388 for (j = i + 1; j < n_labels; j++)
3389 if (XEXP (XVECEXP (jump_table, 1, i), 0)
3390 == XEXP (XVECEXP (jump_table, 1, j), 0))
3393 if (count > best_count)
3394 best_count = count, best_label = XVECEXP (jump_table, 1, i);
3400 operands[3] = best_label;
3401 return \"addq %0,$29,%2\;jmp $31,(%2),%3\";
3404 return \"addq %0,$29,%2\;jmp $31,(%2),0\";
3406 [(set_attr "type" "ibr")])
3410 (match_operand:DI 0 "register_operand" "r"))
3411 (use (label_ref (match_operand 1 "" "")))]
3412 "WINDOWS_NT && next_active_insn (insn) != 0
3413 && GET_CODE (PATTERN (next_active_insn (insn))) == ADDR_DIFF_VEC
3414 && PREV_INSN (next_active_insn (insn)) == operands[1]"
3416 { rtx best_label = 0;
3417 rtx jump_table_insn = next_active_insn (operands[1]);
3419 if (GET_CODE (jump_table_insn) == JUMP_INSN
3420 && GET_CODE (PATTERN (jump_table_insn)) == ADDR_DIFF_VEC)
3422 rtx jump_table = PATTERN (jump_table_insn);
3423 int n_labels = XVECLEN (jump_table, 1);
3424 int best_count = -1;
3427 for (i = 0; i < n_labels; i++)
3431 for (j = i + 1; j < n_labels; j++)
3432 if (XEXP (XVECEXP (jump_table, 1, i), 0)
3433 == XEXP (XVECEXP (jump_table, 1, j), 0))
3436 if (count > best_count)
3437 best_count = count, best_label = XVECEXP (jump_table, 1, i);
3443 operands[2] = best_label;
3444 return \"jmp $31,(%0),%2\";
3447 return \"jmp $31,(%0),0\";
3449 [(set_attr "type" "ibr")])
3451 ;; Cache flush. Used by INITIALIZE_TRAMPOLINE. 0x86 is PAL_imb, but we don't
3452 ;; want to have to include pal.h in our .s file.
3454 [(unspec_volatile [(const_int 0)] 0)]
3458 ;; Finally, we have the basic data motion insns. The byte and word insns
3459 ;; are done via define_expand. Start with the floating-point insns, since
3460 ;; they are simpler.
3463 [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m,f,f,f,m")
3464 (match_operand:SF 1 "input_operand" "rG,m,rG,f,G,m,fG"))]
3465 "register_operand (operands[0], SFmode)
3466 || reg_or_fp0_operand (operands[1], SFmode)"
3475 [(set_attr "type" "iaddlog,ld,st,fpop,fpop,ld,st")])
3478 [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m,f,f,f,m")
3479 (match_operand:DF 1 "input_operand" "rG,m,rG,f,G,m,fG"))]
3480 "register_operand (operands[0], DFmode)
3481 || reg_or_fp0_operand (operands[1], DFmode)"
3490 [(set_attr "type" "iaddlog,ld,st,fpop,fpop,ld,st")])
3492 (define_expand "movsf"
3493 [(set (match_operand:SF 0 "nonimmediate_operand" "")
3494 (match_operand:SF 1 "general_operand" ""))]
3498 if (GET_CODE (operands[0]) == MEM
3499 && ! reg_or_fp0_operand (operands[1], SFmode))
3500 operands[1] = force_reg (SFmode, operands[1]);
3503 (define_expand "movdf"
3504 [(set (match_operand:DF 0 "nonimmediate_operand" "")
3505 (match_operand:DF 1 "general_operand" ""))]
3509 if (GET_CODE (operands[0]) == MEM
3510 && ! reg_or_fp0_operand (operands[1], DFmode))
3511 operands[1] = force_reg (DFmode, operands[1]);
3515 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,r,r,m,f,f,f,m")
3516 (match_operand:SI 1 "input_operand" "r,J,I,K,L,m,rJ,f,J,m,fG"))]
3517 "! WINDOWS_NT && (register_operand (operands[0], SImode)
3518 || reg_or_0_operand (operands[1], SImode))"
3531 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,iaddlog,ld,st,fpop,fpop,ld,st")])
3534 [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,r,r,r,r,m,f,f,f,m")
3535 (match_operand:SI 1 "input_operand" "r,J,I,K,L,s,m,rJ,f,J,m,fG"))]
3536 "WINDOWS_NT && (register_operand (operands[0], SImode)
3537 || reg_or_0_operand (operands[1], SImode))"
3551 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,iaddlog,ldsym,ld,st,fpop,fpop,ld,st")])
3554 [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,r,f,f")
3555 (match_operand:HI 1 "input_operand" "r,J,I,n,f,J"))]
3556 "register_operand (operands[0], HImode)
3557 || register_operand (operands[1], HImode)"
3565 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,fpop,fpop")])
3568 [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,r,r,f,f")
3569 (match_operand:QI 1 "input_operand" "r,J,I,n,f,J"))]
3570 "register_operand (operands[0], QImode)
3571 || register_operand (operands[1], QImode)"
3579 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,fpop,fpop")])
3581 ;; We do two major things here: handle mem->mem and construct long
3584 (define_expand "movsi"
3585 [(set (match_operand:SI 0 "general_operand" "")
3586 (match_operand:SI 1 "general_operand" ""))]
3590 if (GET_CODE (operands[0]) == MEM
3591 && ! reg_or_0_operand (operands[1], SImode))
3592 operands[1] = force_reg (SImode, operands[1]);
3594 if (! CONSTANT_P (operands[1]) || input_operand (operands[1], SImode))
3596 else if (GET_CODE (operands[1]) == CONST_INT)
3599 = alpha_emit_set_const (operands[0], SImode, INTVAL (operands[1]), 3);
3600 if (rtx_equal_p (operands[0], operands[1]))
3605 ;; Split a load of a large constant into the appropriate two-insn
3609 [(set (match_operand:SI 0 "register_operand" "")
3610 (match_operand:SI 1 "const_int_operand" ""))]
3611 "! add_operand (operands[1], SImode)"
3612 [(set (match_dup 0) (match_dup 2))
3613 (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))]
3616 = alpha_emit_set_const (operands[0], SImode, INTVAL (operands[1]), 2);
3618 if (tem == operands[0])
3625 [(set (match_operand:DI 0 "general_operand" "=r,r,r,r,r,r,r,m,f,f,f,Q")
3626 (match_operand:DI 1 "input_operand" "r,J,I,K,L,s,m,rJ,f,J,Q,fG"))]
3627 "register_operand (operands[0], DImode)
3628 || reg_or_0_operand (operands[1], DImode)"
3642 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,iaddlog,ldsym,ld,st,fpop,fpop,ld,st")])
3644 ;; We do three major things here: handle mem->mem, put 64-bit constants in
3645 ;; memory, and construct long 32-bit constants.
3647 (define_expand "movdi"
3648 [(set (match_operand:DI 0 "general_operand" "")
3649 (match_operand:DI 1 "general_operand" ""))]
3655 if (GET_CODE (operands[0]) == MEM
3656 && ! reg_or_0_operand (operands[1], DImode))
3657 operands[1] = force_reg (DImode, operands[1]);
3659 if (! CONSTANT_P (operands[1]) || input_operand (operands[1], DImode))
3661 else if (GET_CODE (operands[1]) == CONST_INT
3662 && (tem = alpha_emit_set_const (operands[0], DImode,
3663 INTVAL (operands[1]), 3)) != 0)
3665 if (rtx_equal_p (tem, operands[0]))
3670 else if (CONSTANT_P (operands[1]))
3672 operands[1] = force_const_mem (DImode, operands[1]);
3673 if (reload_in_progress)
3675 emit_move_insn (operands[0], XEXP (operands[1], 0));
3676 operands[1] = copy_rtx (operands[1]);
3677 XEXP (operands[1], 0) = operands[0];
3680 operands[1] = validize_mem (operands[1]);
3686 ;; Split a load of a large constant into the appropriate two-insn
3690 [(set (match_operand:DI 0 "register_operand" "")
3691 (match_operand:DI 1 "const_int_operand" ""))]
3692 "! add_operand (operands[1], DImode)"
3693 [(set (match_dup 0) (match_dup 2))
3694 (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
3697 = alpha_emit_set_const (operands[0], DImode, INTVAL (operands[1]), 2);
3699 if (tem == operands[0])
3705 ;; These are the partial-word cases.
3707 ;; First we have the code to load an aligned word. Operand 0 is the register
3708 ;; in which to place the result. It's mode is QImode or HImode. Operand 1
3709 ;; is an SImode MEM at the low-order byte of the proper word. Operand 2 is the
3710 ;; number of bits within the word that the value is. Operand 3 is an SImode
3711 ;; scratch register. If operand 0 is a hard register, operand 3 may be the
3712 ;; same register. It is allowed to conflict with operand 1 as well.
3714 (define_expand "aligned_loadqi"
3715 [(set (match_operand:SI 3 "register_operand" "")
3716 (match_operand:SI 1 "memory_operand" ""))
3717 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
3718 (zero_extract:DI (subreg:DI (match_dup 3) 0)
3720 (match_operand:DI 2 "const_int_operand" "")))]
3725 (define_expand "aligned_loadhi"
3726 [(set (match_operand:SI 3 "register_operand" "")
3727 (match_operand:SI 1 "memory_operand" ""))
3728 (set (subreg:DI (match_operand:HI 0 "register_operand" "") 0)
3729 (zero_extract:DI (subreg:DI (match_dup 3) 0)
3731 (match_operand:DI 2 "const_int_operand" "")))]
3736 ;; Similar for unaligned loads, where we use the sequence from the
3737 ;; Alpha Architecture manual.
3739 ;; Operand 1 is the address. Operands 2 and 3 are temporaries, where
3740 ;; operand 3 can overlap the input and output registers.
3742 (define_expand "unaligned_loadqi"
3743 [(set (match_operand:DI 2 "register_operand" "")
3744 (mem:DI (and:DI (match_operand:DI 1 "address_operand" "")
3746 (set (match_operand:DI 3 "register_operand" "")
3748 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
3749 (zero_extract:DI (match_dup 2)
3751 (ashift:DI (match_dup 3) (const_int 3))))]
3755 (define_expand "unaligned_loadhi"
3756 [(set (match_operand:DI 2 "register_operand" "")
3757 (mem:DI (and:DI (match_operand:DI 1 "address_operand" "")
3759 (set (match_operand:DI 3 "register_operand" "")
3761 (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)
3762 (zero_extract:DI (match_dup 2)
3764 (ashift:DI (match_dup 3) (const_int 3))))]
3768 ;; Storing an aligned byte or word requires two temporaries. Operand 0 is the
3769 ;; aligned SImode MEM. Operand 1 is the register containing the
3770 ;; byte or word to store. Operand 2 is the number of bits within the word that
3771 ;; the value should be placed. Operands 3 and 4 are SImode temporaries.
3773 (define_expand "aligned_store"
3774 [(set (match_operand:SI 3 "register_operand" "")
3775 (match_operand:SI 0 "memory_operand" ""))
3776 (set (subreg:DI (match_dup 3) 0)
3777 (and:DI (subreg:DI (match_dup 3) 0) (match_dup 5)))
3778 (set (subreg:DI (match_operand:SI 4 "register_operand" "") 0)
3779 (ashift:DI (zero_extend:DI (match_operand 1 "register_operand" ""))
3780 (match_operand:DI 2 "const_int_operand" "")))
3781 (set (subreg:DI (match_dup 4) 0)
3782 (ior:DI (subreg:DI (match_dup 4) 0) (subreg:DI (match_dup 3) 0)))
3783 (set (match_dup 0) (match_dup 4))]
3786 { operands[5] = GEN_INT (~ (GET_MODE_MASK (GET_MODE (operands[1]))
3787 << INTVAL (operands[2])));
3790 ;; For the unaligned byte and halfword cases, we use code similar to that
3791 ;; in the ;; Architecture book, but reordered to lower the number of registers
3792 ;; required. Operand 0 is the address. Operand 1 is the data to store.
3793 ;; Operands 2, 3, and 4 are DImode temporaries, where operands 2 and 4 may
3794 ;; be the same temporary, if desired. If the address is in a register,
3795 ;; operand 2 can be that register.
3797 (define_expand "unaligned_storeqi"
3798 [(set (match_operand:DI 3 "register_operand" "")
3799 (mem:DI (and:DI (match_operand:DI 0 "address_operand" "")
3801 (set (match_operand:DI 2 "register_operand" "")
3804 (and:DI (not:DI (ashift:DI (const_int 255)
3805 (ashift:DI (match_dup 2) (const_int 3))))
3807 (set (match_operand:DI 4 "register_operand" "")
3808 (ashift:DI (zero_extend:DI (match_operand:QI 1 "register_operand" ""))
3809 (ashift:DI (match_dup 2) (const_int 3))))
3810 (set (match_dup 4) (ior:DI (match_dup 4) (match_dup 3)))
3811 (set (mem:DI (and:DI (match_dup 0) (const_int -8)))
3816 (define_expand "unaligned_storehi"
3817 [(set (match_operand:DI 3 "register_operand" "")
3818 (mem:DI (and:DI (match_operand:DI 0 "address_operand" "")
3820 (set (match_operand:DI 2 "register_operand" "")
3823 (and:DI (not:DI (ashift:DI (const_int 65535)
3824 (ashift:DI (match_dup 2) (const_int 3))))
3826 (set (match_operand:DI 4 "register_operand" "")
3827 (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" ""))
3828 (ashift:DI (match_dup 2) (const_int 3))))
3829 (set (match_dup 4) (ior:DI (match_dup 4) (match_dup 3)))
3830 (set (mem:DI (and:DI (match_dup 0) (const_int -8)))
3835 ;; Here are the define_expand's for QI and HI moves that use the above
3836 ;; patterns. We have the normal sets, plus the ones that need scratch
3837 ;; registers for reload.
3839 (define_expand "movqi"
3840 [(set (match_operand:QI 0 "general_operand" "")
3841 (match_operand:QI 1 "general_operand" ""))]
3844 { extern rtx get_unaligned_address ();
3846 /* If the output is not a register, the input must be. */
3847 if (GET_CODE (operands[0]) == MEM)
3848 operands[1] = force_reg (QImode, operands[1]);
3850 /* Handle four memory cases, unaligned and aligned for either the input
3851 or the output. The only case where we can be called during reload is
3852 for aligned loads; all other cases require temporaries. */
3854 if (GET_CODE (operands[1]) == MEM
3855 || (GET_CODE (operands[1]) == SUBREG
3856 && GET_CODE (SUBREG_REG (operands[1])) == MEM)
3857 || (reload_in_progress && GET_CODE (operands[1]) == REG
3858 && REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER)
3859 || (reload_in_progress && GET_CODE (operands[1]) == SUBREG
3860 && GET_CODE (SUBREG_REG (operands[1])) == REG
3861 && REGNO (SUBREG_REG (operands[1])) >= FIRST_PSEUDO_REGISTER))
3863 if (aligned_memory_operand (operands[1], QImode))
3865 rtx aligned_mem, bitnum;
3866 rtx scratch = (reload_in_progress
3867 ? gen_rtx (REG, SImode, REGNO (operands[0]))
3868 : gen_reg_rtx (SImode));
3870 get_aligned_mem (operands[1], &aligned_mem, &bitnum);
3872 emit_insn (gen_aligned_loadqi (operands[0], aligned_mem, bitnum,
3877 /* Don't pass these as parameters since that makes the generated
3878 code depend on parameter evaluation order which will cause
3879 bootstrap failures. */
3881 rtx temp1 = gen_reg_rtx (DImode);
3882 rtx temp2 = gen_reg_rtx (DImode);
3884 = gen_unaligned_loadqi (operands[0],
3885 get_unaligned_address (operands[1], 0),
3888 alpha_set_memflags (seq, operands[1]);
3895 else if (GET_CODE (operands[0]) == MEM
3896 || (GET_CODE (operands[0]) == SUBREG
3897 && GET_CODE (SUBREG_REG (operands[0])) == MEM)
3898 || (reload_in_progress && GET_CODE (operands[0]) == REG
3899 && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)
3900 || (reload_in_progress && GET_CODE (operands[0]) == SUBREG
3901 && GET_CODE (SUBREG_REG (operands[0])) == REG
3902 && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER))
3904 if (aligned_memory_operand (operands[0], QImode))
3906 rtx aligned_mem, bitnum;
3907 rtx temp1 = gen_reg_rtx (SImode);
3908 rtx temp2 = gen_reg_rtx (SImode);
3910 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
3912 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
3917 rtx temp1 = gen_reg_rtx (DImode);
3918 rtx temp2 = gen_reg_rtx (DImode);
3919 rtx temp3 = gen_reg_rtx (DImode);
3921 = gen_unaligned_storeqi (get_unaligned_address (operands[0], 0),
3922 operands[1], temp1, temp2, temp3);
3924 alpha_set_memflags (seq, operands[0]);
3931 (define_expand "movhi"
3932 [(set (match_operand:HI 0 "general_operand" "")
3933 (match_operand:HI 1 "general_operand" ""))]
3936 { extern rtx get_unaligned_address ();
3938 /* If the output is not a register, the input must be. */
3939 if (GET_CODE (operands[0]) == MEM)
3940 operands[1] = force_reg (HImode, operands[1]);
3942 /* Handle four memory cases, unaligned and aligned for either the input
3943 or the output. The only case where we can be called during reload is
3944 for aligned loads; all other cases require temporaries. */
3946 if (GET_CODE (operands[1]) == MEM
3947 || (GET_CODE (operands[1]) == SUBREG
3948 && GET_CODE (SUBREG_REG (operands[1])) == MEM)
3949 || (reload_in_progress && GET_CODE (operands[1]) == REG
3950 && REGNO (operands[1]) >= FIRST_PSEUDO_REGISTER)
3951 || (reload_in_progress && GET_CODE (operands[1]) == SUBREG
3952 && GET_CODE (SUBREG_REG (operands[1])) == REG
3953 && REGNO (SUBREG_REG (operands[1])) >= FIRST_PSEUDO_REGISTER))
3955 if (aligned_memory_operand (operands[1], HImode))
3957 rtx aligned_mem, bitnum;
3958 rtx scratch = (reload_in_progress
3959 ? gen_rtx (REG, SImode, REGNO (operands[0]))
3960 : gen_reg_rtx (SImode));
3962 get_aligned_mem (operands[1], &aligned_mem, &bitnum);
3964 emit_insn (gen_aligned_loadhi (operands[0], aligned_mem, bitnum,
3969 /* Don't pass these as parameters since that makes the generated
3970 code depend on parameter evaluation order which will cause
3971 bootstrap failures. */
3973 rtx temp1 = gen_reg_rtx (DImode);
3974 rtx temp2 = gen_reg_rtx (DImode);
3976 = gen_unaligned_loadhi (operands[0],
3977 get_unaligned_address (operands[1], 0),
3980 alpha_set_memflags (seq, operands[1]);
3987 else if (GET_CODE (operands[0]) == MEM
3988 || (GET_CODE (operands[0]) == SUBREG
3989 && GET_CODE (SUBREG_REG (operands[0])) == MEM)
3990 || (reload_in_progress && GET_CODE (operands[0]) == REG
3991 && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER)
3992 || (reload_in_progress && GET_CODE (operands[0]) == SUBREG
3993 && GET_CODE (SUBREG_REG (operands[0])) == REG
3994 && REGNO (operands[0]) >= FIRST_PSEUDO_REGISTER))
3996 if (aligned_memory_operand (operands[0], HImode))
3998 rtx aligned_mem, bitnum;
3999 rtx temp1 = gen_reg_rtx (SImode);
4000 rtx temp2 = gen_reg_rtx (SImode);
4002 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
4004 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
4009 rtx temp1 = gen_reg_rtx (DImode);
4010 rtx temp2 = gen_reg_rtx (DImode);
4011 rtx temp3 = gen_reg_rtx (DImode);
4013 = gen_unaligned_storehi (get_unaligned_address (operands[0], 0),
4014 operands[1], temp1, temp2, temp3);
4016 alpha_set_memflags (seq, operands[0]);
4024 ;; Here are the versions for reload. Note that in the unaligned cases
4025 ;; we know that the operand must not be a pseudo-register because stack
4026 ;; slots are always aligned references.
4028 (define_expand "reload_inqi"
4029 [(parallel [(match_operand:QI 0 "register_operand" "=r")
4030 (match_operand:QI 1 "unaligned_memory_operand" "m")
4031 (match_operand:TI 2 "register_operand" "=&r")])]
4034 { extern rtx get_unaligned_address ();
4035 rtx addr = get_unaligned_address (operands[1], 0);
4036 /* It is possible that one of the registers we got for operands[2]
4037 might coincide with that of operands[0] (which is why we made
4038 it TImode). Pick the other one to use as our scratch. */
4039 rtx scratch = gen_rtx (REG, DImode,
4040 REGNO (operands[0]) == REGNO (operands[2])
4041 ? REGNO (operands[2]) + 1 : REGNO (operands[2]));
4042 rtx seq = gen_unaligned_loadqi (operands[0], addr, scratch,
4043 gen_rtx (REG, DImode, REGNO (operands[0])));
4045 alpha_set_memflags (seq, operands[1]);
4050 (define_expand "reload_inhi"
4051 [(parallel [(match_operand:HI 0 "register_operand" "=r")
4052 (match_operand:HI 1 "unaligned_memory_operand" "m")
4053 (match_operand:TI 2 "register_operand" "=&r")])]
4056 { extern rtx get_unaligned_address ();
4057 rtx addr = get_unaligned_address (operands[1], 0);
4058 /* It is possible that one of the registers we got for operands[2]
4059 might coincide with that of operands[0] (which is why we made
4060 it TImode). Pick the other one to use as our scratch. */
4061 rtx scratch = gen_rtx (REG, DImode,
4062 REGNO (operands[0]) == REGNO (operands[2])
4063 ? REGNO (operands[2]) + 1 : REGNO (operands[2]));
4064 rtx seq = gen_unaligned_loadhi (operands[0], addr, scratch,
4065 gen_rtx (REG, DImode, REGNO (operands[0])));
4067 alpha_set_memflags (seq, operands[1]);
4072 (define_expand "reload_outqi"
4073 [(parallel [(match_operand:QI 0 "any_memory_operand" "=m")
4074 (match_operand:QI 1 "register_operand" "r")
4075 (match_operand:TI 2 "register_operand" "=&r")])]
4078 { extern rtx get_unaligned_address ();
4080 if (aligned_memory_operand (operands[0], QImode))
4082 rtx aligned_mem, bitnum;
4084 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
4086 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
4087 gen_rtx (REG, SImode, REGNO (operands[2])),
4088 gen_rtx (REG, SImode,
4089 REGNO (operands[2]) + 1)));
4093 rtx addr = get_unaligned_address (operands[0], 0);
4094 rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[2]));
4095 rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[2]) + 1);
4096 rtx scratch3 = scratch1;
4099 if (GET_CODE (addr) == REG)
4102 seq = gen_unaligned_storeqi (addr, operands[1], scratch1,
4103 scratch2, scratch3);
4104 alpha_set_memflags (seq, operands[0]);
4111 (define_expand "reload_outhi"
4112 [(parallel [(match_operand:HI 0 "any_memory_operand" "=m")
4113 (match_operand:HI 1 "register_operand" "r")
4114 (match_operand:TI 2 "register_operand" "=&r")])]
4117 { extern rtx get_unaligned_address ();
4119 if (aligned_memory_operand (operands[0], HImode))
4121 rtx aligned_mem, bitnum;
4123 get_aligned_mem (operands[0], &aligned_mem, &bitnum);
4125 emit_insn (gen_aligned_store (aligned_mem, operands[1], bitnum,
4126 gen_rtx (REG, SImode, REGNO (operands[2])),
4127 gen_rtx (REG, SImode,
4128 REGNO (operands[2]) + 1)));
4132 rtx addr = get_unaligned_address (operands[0], 0);
4133 rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[2]));
4134 rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[2]) + 1);
4135 rtx scratch3 = scratch1;
4138 if (GET_CODE (addr) == REG)
4141 seq = gen_unaligned_storehi (addr, operands[1], scratch1,
4142 scratch2, scratch3);
4143 alpha_set_memflags (seq, operands[0]);
4150 ;; Subroutine of stack space allocation. Perform a stack probe.
4151 (define_expand "probe_stack"
4152 [(set (match_dup 1) (match_operand:DI 0 "const_int_operand" ""))]
4156 operands[1] = gen_rtx (MEM, DImode, plus_constant (stack_pointer_rtx,
4157 INTVAL (operands[0])));
4158 MEM_VOLATILE_P (operands[1]) = 1;
4160 operands[0] = const0_rtx;
4163 ;; This is how we allocate stack space. If we are allocating a
4164 ;; constant amount of space and we know it is less than 4096
4165 ;; bytes, we need do nothing.
4167 ;; If it is more than 4096 bytes, we need to probe the stack
4169 (define_expand "allocate_stack"
4171 (plus:DI (reg:DI 30)
4172 (match_operand:DI 0 "reg_or_cint_operand" "")))]
4176 if (GET_CODE (operands[0]) == CONST_INT
4177 && INTVAL (operands[0]) < 32768)
4179 if (INTVAL (operands[0]) >= 4096)
4181 /* We do this the same way as in the prologue and generate explicit
4182 probes. Then we update the stack by the constant. */
4186 emit_insn (gen_probe_stack (GEN_INT (- probed)));
4187 while (probed + 8192 < INTVAL (operands[0]))
4188 emit_insn (gen_probe_stack (GEN_INT (- (probed += 8192))));
4190 if (probed + 4096 < INTVAL (operands[0]))
4191 emit_insn (gen_probe_stack (GEN_INT (- INTVAL(operands[0]))));
4194 operands[0] = GEN_INT (- INTVAL (operands[0]));
4199 rtx loop_label = gen_label_rtx ();
4200 rtx want = gen_reg_rtx (Pmode);
4201 rtx tmp = gen_reg_rtx (Pmode);
4204 emit_insn (gen_subdi3 (want, stack_pointer_rtx,
4205 force_reg (Pmode, operands[0])));
4206 emit_insn (gen_adddi3 (tmp, stack_pointer_rtx, GEN_INT (-4096)));
4208 if (GET_CODE (operands[0]) != CONST_INT)
4210 out_label = gen_label_rtx ();
4211 emit_insn (gen_cmpdi (want, tmp));
4212 emit_jump_insn (gen_bgeu (out_label));
4215 emit_label (loop_label);
4216 memref = gen_rtx (MEM, DImode, tmp);
4217 MEM_VOLATILE_P (memref) = 1;
4218 emit_move_insn (memref, const0_rtx);
4219 emit_insn (gen_adddi3 (tmp, tmp, GEN_INT(-8192)));
4220 emit_insn (gen_cmpdi (tmp, want));
4221 emit_jump_insn (gen_bgtu (loop_label));
4222 memref = gen_rtx (MEM, DImode, want);
4223 MEM_VOLATILE_P (memref) = 1;
4224 emit_move_insn (memref, const0_rtx);
4227 emit_label (out_label);
4229 emit_move_insn (stack_pointer_rtx, want);