1 ;;- Machine description for DEC Alpha for GNU C compiler
2 ;; Copyright (C)
1992 Free Software Foundation, Inc.
3 ;; Contributed by Richard Kenner (kenner@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,
675 Mass Ave, Cambridge, MA
02139, USA.
21 ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al.
23 ;; Define an insn type attribute. This is used in function unit delay
24 ;; computations, among other purposes. For the most part, we use the names
25 ;; defined in the EV4 documentation, but add a few that we have to know about
29 "ld,st,ibr,fbr,jsr,iaddlog,shiftcm,icmp,imull,imulq,fpop,fdivs,fdivt,ldsym"
30 (const_string "shiftcm"))
32 ;; We include four function units: ABOX, which computes the address,
33 ;; BBOX, used for branches, EBOX, used for integer operations, and FBOX,
34 ;; used for FP operations.
36 ;; We assume that we have been successful in getting double issues and
37 ;; hence multiply all costs by two insns per cycle. The minimum time in
38 ;; a function unit is
2 cycle, which will tend to produce the double
41 ;; Memory delivers its result in three cycles.
42 (define_function_unit "abox"
1 0 (eq_attr "type" "ld,ldsym,st")
6 2)
44 ;; Branches have no delay cost, but do tie up the unit for two cycles.
45 (define_function_unit "bbox"
1 1 (eq_attr "type" "ibr,fbr,jsr")
4 4)
47 ;; Arithmetic insns are normally have their results available after two
48 ;; cycles. There are a number of exceptions. They are encoded in
49 ;; ADJUST_COST. Some of the other insns have similar exceptions.
51 (define_function_unit "ebox"
1 0 (eq_attr "type" "iaddlog,shiftcm,icmp")
4 2)
53 ;; These really don't take up the integer pipeline, but they do occupy
54 ;; IBOX1; we approximate here.
56 (define_function_unit "ebox"
1 0 (eq_attr "type" "imull")
42 2)
57 (define_function_unit "ebox"
1 0 (eq_attr "type" "imulq")
46 2)
59 (define_function_unit "imult"
1 0 (eq_attr "type" "imull")
42 38)
60 (define_function_unit "imult"
1 0 (eq_attr "type" "imulq")
46 42)
62 (define_function_unit "fbox"
1 0 (eq_attr "type" "fpop")
12 2)
64 (define_function_unit "fbox"
1 0 (eq_attr "type" "fdivs")
68 0)
65 (define_function_unit "fbox"
1 0 (eq_attr "type" "fdivt")
126 0)
67 (define_function_unit "divider"
1 0 (eq_attr "type" "fdivs")
68 60)
68 (define_function_unit "divider"
1 0 (eq_attr "type" "fdivt")
126 118)
70 ;; First define the arithmetic insns. Note that the
32-bit forms also
73 ;; Note that we can do sign extensions in both FP and integer registers.
74 ;; However, the result must be in the same type of register as the input.
75 ;; The register preferencing code can't handle this case very well, so, for
76 ;; now, don't let the FP case show up here for preferencing.
77 (define_insn "extendsidi2"
78 [(set (match_operand:DI
0 "register_operand" "=r,r,f")
79 (sign_extend:DI (match_operand:SI
1 "nonimmediate_operand" "r,m,f")))]
85 [(set_attr "type" "iaddlog,ld,fpop")])
88 [(set (match_operand:SI
0 "register_operand" "=r,r,r")
89 (plus:SI (match_operand:SI
1 "reg_or_0_operand" "%rJ,%rJ,%rJ")
90 (match_operand:SI
2 "add_operand" "rI,K,L")))]
96 [(set_attr "type" "iaddlog")])
99 [(set (match_operand:SI
0 "register_operand" "")
100 (plus:SI (match_operand:SI
1 "register_operand" "")
101 (match_operand:SI
2 "const_int_operand" "")))]
102 "! add_operand (operands[
2], SImode)"
103 [(set (match_dup
0) (plus:SI (match_dup
1) (match_dup
3)))
104 (set (match_dup
0) (plus:SI (match_dup
0) (match_dup
4)))]
107 HOST_WIDE_INT val = INTVAL (operands[
2]);
108 HOST_WIDE_INT low = (val &
0xffff) -
2 * (val &
0x8000);
109 HOST_WIDE_INT rest = val - low;
111 operands[
3] = GEN_INT (rest);
112 operands[
4] = GEN_INT (low);
116 [(set (match_operand:DI
0 "register_operand" "=r,r")
118 (plus:SI (match_operand:SI
1 "reg_or_0_operand" "%rJ,rJ")
119 (match_operand:SI
2 "sext_add_operand" "rI,O"))))]
124 [(set_attr "type" "iaddlog")])
126 (define_insn "adddi3"
127 [(set (match_operand:DI
0 "register_operand" "=r,r,r")
128 (plus:DI (match_operand:DI
1 "reg_or_0_operand" "%rJ,%rJ,%rJ")
129 (match_operand:DI
2 "add_operand" "rI,K,L")))]
135 [(set_attr "type" "iaddlog")])
138 [(set (match_operand:DI
0 "register_operand" "")
139 (plus:DI (match_operand:DI
1 "register_operand" "")
140 (match_operand:DI
2 "const_int_operand" "")))]
141 "! add_operand (operands[
2], DImode)"
142 [(set (match_dup
0) (plus:DI (match_dup
1) (match_dup
3)))
143 (set (match_dup
0) (plus:DI (match_dup
0) (match_dup
4)))]
146 HOST_WIDE_INT val = INTVAL (operands[
2]);
147 HOST_WIDE_INT low = (val &
0xffff) -
2 * (val &
0x8000);
148 HOST_WIDE_INT rest = val - low;
150 operands[
3] = GEN_INT (rest);
151 operands[
4] = GEN_INT (low);
155 [(set (match_operand:SI
0 "register_operand" "=r")
156 (plus:SI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
157 (match_operand:SI
2 "const48_operand" "I"))
158 (match_operand:SI
3 "reg_or_8bit_operand" "rI")))]
161 [(set_attr "type" "iaddlog")])
164 [(set (match_operand:DI
0 "register_operand" "=r")
166 (plus:SI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
167 (match_operand:SI
2 "const48_operand" "I"))
168 (match_operand:SI
3 "reg_or_8bit_operand" "rI"))))]
171 [(set_attr "type" "iaddlog")])
174 [(set (match_operand:DI
0 "register_operand" "=r")
175 (plus:DI (mult:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
176 (match_operand:DI
2 "const48_operand" "I"))
177 (match_operand:DI
3 "reg_or_8bit_operand" "rI")))]
180 [(set_attr "type" "iaddlog")])
182 ;; These variants of the above insns can occur if the third operand
183 ;; is the frame pointer. This is a kludge, but there doesn't
184 ;; seem to be a way around it. Only recognize them while reloading.
187 [(set (match_operand:SI
0 "register_operand" "=&r")
188 (plus:SI (plus:SI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
189 (match_operand:SI
2 "const48_operand" "I"))
190 (match_operand:SI
3 "register_operand" "r"))
191 (match_operand:SI
4 "const_int_operand" "rI")))]
193 "s%
2addl %r1,%
3,%
0\;addl %
0,%
4,%
0"
194 [(set_attr "type" "iaddlog")])
197 [(set (match_operand:DI
0 "register_operand" "=&r")
200 (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
201 (match_operand:SI
2 "const48_operand" "I"))
202 (match_operand:SI
3 "register_operand" "r"))
203 (match_operand:SI
4 "const_int_operand" "rI"))))]
205 "s%
2addl %r1,%
3,%
0\;addl %
0,%
4,%
0"
206 [(set_attr "type" "iaddlog")])
209 [(set (match_operand:DI
0 "register_operand" "=&r")
210 (plus:DI (plus:DI (mult:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
211 (match_operand:DI
2 "const48_operand" "I"))
212 (match_operand:DI
3 "register_operand" "r"))
213 (match_operand:DI
4 "const_int_operand" "rI")))]
215 "s%
2addq %r1,%
3,%
0\;addq %
0,%
4,%
0"
216 [(set_attr "type" "iaddlog")])
218 (define_insn "negsi2"
219 [(set (match_operand:SI
0 "register_operand" "=r")
220 (neg:SI (match_operand:SI
1 "reg_or_8bit_operand" "rI")))]
223 [(set_attr "type" "iaddlog")])
226 [(set (match_operand:DI
0 "register_operand" "=r")
227 (sign_extend:DI (neg:SI
228 (match_operand:SI
1 "reg_or_8bit_operand" "rI"))))]
231 [(set_attr "type" "iaddlog")])
233 (define_insn "negdi2"
234 [(set (match_operand:DI
0 "register_operand" "=r")
235 (neg:DI (match_operand:DI
1 "reg_or_8bit_operand" "rI")))]
238 [(set_attr "type" "iaddlog")])
240 (define_insn "subsi3"
241 [(set (match_operand:SI
0 "register_operand" "=r")
242 (minus:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
243 (match_operand:SI
2 "reg_or_8bit_operand" "rI")))]
246 [(set_attr "type" "iaddlog")])
249 [(set (match_operand:DI
0 "register_operand" "=r")
250 (sign_extend:DI (minus:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
251 (match_operand:SI
2 "reg_or_8bit_operand" "rI"))))]
254 [(set_attr "type" "iaddlog")])
256 (define_insn "subdi3"
257 [(set (match_operand:DI
0 "register_operand" "=r")
258 (minus:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
259 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
262 [(set_attr "type" "iaddlog")])
265 [(set (match_operand:SI
0 "register_operand" "=r")
266 (minus:SI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
267 (match_operand:SI
2 "const48_operand" "I"))
268 (match_operand:SI
3 "reg_or_8bit_operand" "rI")))]
271 [(set_attr "type" "iaddlog")])
274 [(set (match_operand:DI
0 "register_operand" "=r")
276 (minus:SI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "rJ")
277 (match_operand:SI
2 "const48_operand" "I"))
278 (match_operand:SI
3 "reg_or_8bit_operand" "rI"))))]
281 [(set_attr "type" "iaddlog")])
284 [(set (match_operand:DI
0 "register_operand" "=r")
285 (minus:DI (mult:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
286 (match_operand:DI
2 "const48_operand" "I"))
287 (match_operand:DI
3 "reg_or_8bit_operand" "rI")))]
290 [(set_attr "type" "iaddlog")])
292 (define_insn "mulsi3"
293 [(set (match_operand:SI
0 "register_operand" "=r")
294 (mult:SI (match_operand:SI
1 "reg_or_0_operand" "%rJ")
295 (match_operand:SI
2 "reg_or_8bit_operand" "rI")))]
298 [(set_attr "type" "imull")])
301 [(set (match_operand:DI
0 "register_operand" "=r")
302 (sign_extend:DI (mult:SI (match_operand:SI
1 "reg_or_0_operand" "%rJ")
303 (match_operand:SI
2 "reg_or_8bit_operand" "rI"))))]
306 [(set_attr "type" "imull")])
308 (define_insn "muldi3"
309 [(set (match_operand:DI
0 "register_operand" "=r")
310 (mult:DI (match_operand:DI
1 "reg_or_0_operand" "%rJ")
311 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
314 [(set_attr "type" "imulq")])
316 ;; The divide and remainder operations always take their inputs from
317 ;; r24 and r25, put their output in r27, and clobber r23 and r28.
319 (define_expand "divsi3"
320 [(parallel [(set (reg:SI
27)
321 (div:SI (match_operand:SI
1 "general_operand" "")
322 (match_operand:SI
2 "general_operand" "")))
323 (clobber (reg:DI
23))
324 (clobber (reg:DI
28))])
325 (set (match_operand:SI
0 "general_operand" "")
329 { rtx in0 = gen_rtx (REG, SImode,
24);
330 rtx in1 = gen_rtx (REG, SImode,
25);
332 emit_move_insn (in0, operands[
1]);
333 emit_move_insn (in1, operands[
2]);
334 operands[
1] = in0, operands[
2] = in1;
337 (define_expand "udivsi3"
338 [(parallel [(set (reg:SI
27)
339 (udiv:SI (match_operand:SI
1 "general_operand" "")
340 (match_operand:SI
2 "general_operand" "")))
341 (clobber (reg:DI
23))
342 (clobber (reg:DI
28))])
343 (set (match_operand:SI
0 "general_operand" "")
347 { rtx in0 = gen_rtx (REG, SImode,
24);
348 rtx in1 = gen_rtx (REG, SImode,
25);
350 emit_move_insn (in0, operands[
1]);
351 emit_move_insn (in1, operands[
2]);
352 operands[
1] = in0, operands[
2] = in1;
355 (define_expand "modsi3"
356 [(parallel [(set (reg:SI
27)
357 (mod:SI (match_operand:SI
1 "general_operand" "")
358 (match_operand:SI
2 "general_operand" "")))
359 (clobber (reg:DI
23))
360 (clobber (reg:DI
28))])
361 (set (match_operand:SI
0 "general_operand" "")
365 { rtx in0 = gen_rtx (REG, SImode,
24);
366 rtx in1 = gen_rtx (REG, SImode,
25);
368 emit_move_insn (in0, operands[
1]);
369 emit_move_insn (in1, operands[
2]);
370 operands[
1] = in0, operands[
2] = in1;
373 (define_expand "umodsi3"
374 [(parallel [(set (reg:SI
27)
375 (umod:SI (match_operand:SI
1 "general_operand" "")
376 (match_operand:SI
2 "general_operand" "")))
377 (clobber (reg:DI
23))
378 (clobber (reg:DI
28))])
379 (set (match_operand:SI
0 "general_operand" "")
383 { rtx in0 = gen_rtx (REG, SImode,
24);
384 rtx in1 = gen_rtx (REG, SImode,
25);
386 emit_move_insn (in0, operands[
1]);
387 emit_move_insn (in1, operands[
2]);
388 operands[
1] = in0, operands[
2] = in1;
391 (define_expand "divdi3"
392 [(parallel [(set (reg:DI
27)
393 (div:DI (match_operand:DI
1 "general_operand" "")
394 (match_operand:DI
2 "general_operand" "")))
395 (clobber (reg:DI
23))
396 (clobber (reg:DI
28))])
397 (set (match_operand:DI
0 "general_operand" "")
401 { rtx in0 = gen_rtx (REG, DImode,
24);
402 rtx in1 = gen_rtx (REG, DImode,
25);
404 emit_move_insn (in0, operands[
1]);
405 emit_move_insn (in1, operands[
2]);
406 operands[
1] = in0, operands[
2] = in1;
409 (define_expand "udivdi3"
410 [(parallel [(set (reg:DI
27)
411 (udiv:DI (match_operand:DI
1 "general_operand" "")
412 (match_operand:DI
2 "general_operand" "")))
413 (clobber (reg:DI
23))
414 (clobber (reg:DI
28))])
415 (set (match_operand:DI
0 "general_operand" "")
419 { rtx in0 = gen_rtx (REG, DImode,
24);
420 rtx in1 = gen_rtx (REG, DImode,
25);
422 emit_move_insn (in0, operands[
1]);
423 emit_move_insn (in1, operands[
2]);
424 operands[
1] = in0, operands[
2] = in1;
427 (define_expand "moddi3"
428 [(parallel [(set (reg:DI
27)
429 (mod:DI (match_operand:DI
1 "general_operand" "")
430 (match_operand:DI
2 "general_operand" "")))
431 (clobber (reg:DI
23))
432 (clobber (reg:DI
28))])
433 (set (match_operand:DI
0 "general_operand" "")
437 { rtx in0 = gen_rtx (REG, DImode,
24);
438 rtx in1 = gen_rtx (REG, DImode,
25);
440 emit_move_insn (in0, operands[
1]);
441 emit_move_insn (in1, operands[
2]);
442 operands[
1] = in0, operands[
2] = in1;
445 (define_expand "umoddi3"
446 [(parallel [(set (reg:DI
27)
447 (umod:DI (match_operand:DI
1 "general_operand" "")
448 (match_operand:DI
2 "general_operand" "")))
449 (clobber (reg:DI
23))
450 (clobber (reg:DI
28))])
451 (set (match_operand:DI
0 "general_operand" "")
455 { rtx in0 = gen_rtx (REG, DImode,
24);
456 rtx in1 = gen_rtx (REG, DImode,
25);
458 emit_move_insn (in0, operands[
1]);
459 emit_move_insn (in1, operands[
2]);
460 operands[
1] = in0, operands[
2] = in1;
465 (match_operator:SI
1 "divmod_operator"
466 [(reg:SI
24) (reg:SI
25)]))
467 (clobber (reg:DI
23))
468 (clobber (reg:DI
28))]
474 (match_operator:DI
1 "divmod_operator"
475 [(reg:DI
24) (reg:DI
25)]))
476 (clobber (reg:DI
23))
477 (clobber (reg:DI
28))]
481 ;; Next are the basic logical operations. These only exist in DImode.
483 (define_insn "anddi3"
484 [(set (match_operand:DI
0 "register_operand" "=r,r,r")
485 (and:DI (match_operand:DI
1 "reg_or_0_operand" "%rJ,rJ,rJ")
486 (match_operand:DI
2 "and_operand" "rI,N,MH")))]
492 [(set_attr "type" "iaddlog,iaddlog,shiftcm")])
494 ;; There are times when we can split and AND into two AND insns. This occurs
495 ;; when we can first clear any bytes and then clear anything else. For
496 ;; example "I &
0xffff07" is "(I &
0xffffff) &
0xffffffffffffff07".
497 ;; Only to this when running on
64-bit host since the computations are
498 ;; too messy otherwise.
501 [(set (match_operand:DI
0 "register_operand" "")
502 (and:DI (match_operand:DI
1 "register_operand" "")
503 (match_operand:DI
2 "const_int_operand" "")))]
504 "HOST_BITS_PER_WIDE_INT ==
64 && ! and_operand (operands[
2], DImode)"
505 [(set (match_dup
0) (and:DI (match_dup
1) (match_dup
3)))
506 (set (match_dup
0) (and:DI (match_dup
0) (match_dup
4)))]
509 unsigned HOST_WIDE_INT mask1 = INTVAL (operands[
2]);
510 unsigned HOST_WIDE_INT mask2 = mask1;
513 /* For each byte that isn't all zeros, make it all ones. */
514 for (i =
0; i <
64; i +=
8)
515 if ((mask1 & ((HOST_WIDE_INT)
0xff << i)) !=
0)
516 mask1 |= (HOST_WIDE_INT)
0xff << i;
518 /* Now turn on any bits we've just turned off. */
521 operands[
3] = GEN_INT (mask1);
522 operands[
4] = GEN_INT (mask2);
525 (define_insn "zero_extendqihi2"
526 [(set (match_operand:HI
0 "register_operand" "=r")
527 (zero_extend:HI (match_operand:QI
1 "register_operand" "r")))]
530 [(set_attr "type" "iaddlog")])
532 (define_insn "zero_extendqisi2"
533 [(set (match_operand:SI
0 "register_operand" "=r")
534 (zero_extend:SI (match_operand:QI
1 "register_operand" "r")))]
537 [(set_attr "type" "iaddlog")])
539 (define_insn "zero_extendqidi2"
540 [(set (match_operand:DI
0 "register_operand" "=r")
541 (zero_extend:DI (match_operand:QI
1 "register_operand" "r")))]
544 [(set_attr "type" "iaddlog")])
546 (define_insn "zero_extendhisi2"
547 [(set (match_operand:SI
0 "register_operand" "=r")
548 (zero_extend:SI (match_operand:HI
1 "register_operand" "r")))]
551 [(set_attr "type" "iaddlog")])
553 (define_insn "zero_extendhidi2"
554 [(set (match_operand:DI
0 "register_operand" "=r")
555 (zero_extend:DI (match_operand:HI
1 "register_operand" "r")))]
558 [(set_attr "type" "iaddlog")])
560 (define_insn "zero_extendsidi2"
561 [(set (match_operand:DI
0 "register_operand" "=r")
562 (zero_extend:DI (match_operand:SI
1 "register_operand" "r")))]
565 [(set_attr "type" "iaddlog")])
568 [(set (match_operand:DI
0 "register_operand" "=r")
569 (and:DI (not:DI (match_operand:DI
1 "reg_or_8bit_operand" "rI"))
570 (match_operand:DI
2 "reg_or_0_operand" "rJ")))]
573 [(set_attr "type" "iaddlog")])
575 (define_insn "iordi3"
576 [(set (match_operand:DI
0 "register_operand" "=r")
577 (ior:DI (match_operand:DI
1 "reg_or_0_operand" "%rJ")
578 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
581 [(set_attr "type" "iaddlog")])
583 (define_insn "one_cmpldi2"
584 [(set (match_operand:DI
0 "register_operand" "=r")
585 (not:DI (match_operand:DI
1 "reg_or_8bit_operand" "rI")))]
588 [(set_attr "type" "iaddlog")])
591 [(set (match_operand:DI
0 "register_operand" "=r")
592 (ior:DI (not:DI (match_operand:DI
1 "reg_or_8bit_operand" "rI"))
593 (match_operand:DI
2 "reg_or_0_operand" "rJ")))]
596 [(set_attr "type" "iaddlog")])
598 (define_insn "xordi3"
599 [(set (match_operand:DI
0 "register_operand" "=r")
600 (xor:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
601 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
604 [(set_attr "type" "iaddlog")])
607 [(set (match_operand:DI
0 "register_operand" "=r")
608 (not:DI (xor:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
609 (match_operand:DI
2 "reg_or_8bit_operand" "rI"))))]
612 [(set_attr "type" "iaddlog")])
614 ;; Next come the shifts and the various extract and insert operations.
616 (define_insn "ashldi3"
617 [(set (match_operand:DI
0 "register_operand" "=r,r")
618 (ashift:DI (match_operand:DI
1 "reg_or_0_operand" "rJ,rJ")
619 (match_operand:DI
2 "reg_or_8bit_operand" "P,rI")))]
623 switch (which_alternative)
626 if (operands[
2] == const1_rtx)
627 return
\"addq %r1,%r1,%
0\";
629 return
\"s%P2addq %r1,
0,%
0\";
631 return
\"sll %r1,%
2,%
0\";
634 [(set_attr "type" "iaddlog,shiftcm")])
636 ;; This is the same as (sign_extend (shift X [
123])).
638 [(set (match_operand:DI
0 "register_operand" "=r")
639 (ashiftrt:DI (ashift:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
640 (match_operand:DI
2 "const_int_operand" "i"))
642 "INTVAL (operands[
2]) >=
33 && INTVAL (operands[
2]) <=
35"
645 switch (INTVAL (operands[
2]))
648 return
\"addl %r1,%r1,%
0\";
650 return
\"s4addl %r1,
0,%
0\";
652 return
\"s8addl %r1,
0,%
0\";
657 [(set_attr "type" "iaddlog")])
659 (define_insn "lshrdi3"
660 [(set (match_operand:DI
0 "register_operand" "=r")
661 (lshiftrt:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
662 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
666 (define_insn "ashrdi3"
667 [(set (match_operand:DI
0 "register_operand" "=r")
668 (ashiftrt:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
669 (match_operand:DI
2 "reg_or_8bit_operand" "rI")))]
673 (define_expand "extendqihi2"
675 (ashift:DI (match_operand:QI
1 "register_operand" "")
677 (set (match_operand:HI
0 "register_operand" "")
678 (ashiftrt:DI (match_dup
2)
682 { operands[
0] = gen_lowpart (DImode, operands[
0]);
683 operands[
1] = gen_lowpart (DImode, operands[
1]);
684 operands[
2] = gen_reg_rtx (DImode);
687 (define_expand "extendqisi2"
689 (ashift:DI (match_operand:QI
1 "register_operand" "")
691 (set (match_operand:SI
0 "register_operand" "")
692 (ashiftrt:DI (match_dup
2)
696 { operands[
0] = gen_lowpart (DImode, operands[
0]);
697 operands[
1] = gen_lowpart (DImode, operands[
1]);
698 operands[
2] = gen_reg_rtx (DImode);
701 (define_expand "extendqidi2"
703 (ashift:DI (match_operand:QI
1 "register_operand" "")
705 (set (match_operand:DI
0 "register_operand" "")
706 (ashiftrt:DI (match_dup
2)
710 { operands[
1] = gen_lowpart (DImode, operands[
1]);
711 operands[
2] = gen_reg_rtx (DImode);
714 (define_expand "extendhisi2"
716 (ashift:DI (match_operand:HI
1 "register_operand" "")
718 (set (match_operand:SI
0 "register_operand" "")
719 (ashiftrt:DI (match_dup
2)
723 { operands[
0] = gen_lowpart (DImode, operands[
0]);
724 operands[
1] = gen_lowpart (DImode, operands[
1]);
725 operands[
2] = gen_reg_rtx (DImode);
728 (define_expand "extendhidi2"
730 (ashift:DI (match_operand:HI
1 "register_operand" "")
732 (set (match_operand:DI
0 "register_operand" "")
733 (ashiftrt:DI (match_dup
2)
737 { operands[
1] = gen_lowpart (DImode, operands[
1]);
738 operands[
2] = gen_reg_rtx (DImode);
742 [(set (match_operand:DI
0 "register_operand" "=r")
743 (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
744 (match_operand:DI
2 "mode_width_operand" "n")
745 (match_operand:DI
3 "mul8_operand" "I")))]
747 "ext%M2l %r1,%s3,%
0")
750 [(set (match_operand:DI
0 "register_operand" "=r")
751 (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
752 (match_operand:DI
2 "mode_width_operand" "n")
753 (ashift:DI (match_operand:DI
3 "reg_or_8bit_operand" "rI")
759 [(set (match_operand:DI
0 "register_operand" "=r")
761 (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
765 (match_operand:DI
2 "reg_or_8bit_operand" "rI")
773 [(set (match_operand:DI
0 "register_operand" "=r")
775 (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
779 (match_operand:DI
2 "reg_or_8bit_operand" "rI")
787 [(set (match_operand:DI
0 "register_operand" "=r")
789 (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
793 (match_operand:DI
2 "reg_or_8bit_operand" "rI")
800 ;; This converts an extXl into an extXh with an appropriate adjustment
801 ;; to the address calculation.
804 [(set (match_operand:DI
0 "register_operand" "")
805 (ashift:DI (zero_extract:DI (match_operand:DI
1 "register_operand" "")
806 (match_operand:DI
2 "mode_width_operand" "")
807 (ashift:DI (match_operand:DI
3 "" "")
809 (match_operand:DI
4 "const_int_operand" "")))
810 (clobber (match_operand:DI
5 "register_operand" ""))]
811 "INTVAL (operands[
4]) ==
64 - INTVAL (operands[
2])"
812 [(set (match_dup
5) (match_dup
6))
814 (ashift:DI (zero_extract:DI (match_dup
1) (match_dup
2)
815 (ashift:DI (plus:DI (match_dup
5)
821 operands[
6] = plus_constant (operands[
3],
822 INTVAL (operands[
2]) / BITS_PER_UNIT);
823 operands[
7] = GEN_INT (- INTVAL (operands[
2]) / BITS_PER_UNIT);
827 [(set (match_operand:DI
0 "register_operand" "=r")
828 (ashift:DI (zero_extend:DI (match_operand:QI
1 "register_operand" "r"))
829 (match_operand:DI
2 "mul8_operand" "I")))]
834 [(set (match_operand:DI
0 "register_operand" "=r")
835 (ashift:DI (zero_extend:DI (match_operand:HI
1 "register_operand" "r"))
836 (match_operand:DI
2 "mul8_operand" "I")))]
841 [(set (match_operand:DI
0 "register_operand" "=r")
842 (ashift:DI (zero_extend:DI (match_operand:SI
1 "register_operand" "r"))
843 (match_operand:DI
2 "mul8_operand" "I")))]
848 [(set (match_operand:DI
0 "register_operand" "=r")
849 (ashift:DI (zero_extend:DI (match_operand:QI
1 "register_operand" "r"))
850 (ashift:DI (match_operand:DI
2 "reg_or_8bit_operand" "rI")
856 [(set (match_operand:DI
0 "register_operand" "=r")
857 (ashift:DI (zero_extend:DI (match_operand:HI
1 "register_operand" "r"))
858 (ashift:DI (match_operand:DI
2 "reg_or_8bit_operand" "rI")
864 [(set (match_operand:DI
0 "register_operand" "=r")
865 (ashift:DI (zero_extend:DI (match_operand:SI
1 "register_operand" "r"))
866 (ashift:DI (match_operand:DI
2 "reg_or_8bit_operand" "rI")
871 ;; We do not include the insXh insns because they are complex to express
872 ;; and it does not appear that we would ever want to generate them.
875 [(set (match_operand:DI
0 "register_operand" "=r")
877 (match_operand:DI
2 "mode_mask_operand" "n")
878 (ashift:DI (match_operand:DI
3 "reg_or_8bit_operand" "rI")
880 (match_operand:DI
1 "reg_or_0_operand" "rJ")))]
884 ;; We do not include the mskXh insns because it does not appear we would ever
887 ;; Floating-point operations. All the double-precision insns can extend
888 ;; from single, so indicate that. The exception are the ones that simply
889 ;; play with the sign bits; it's not clear what to do there.
891 (define_insn "abssf2"
892 [(set (match_operand:SF
0 "register_operand" "=f")
893 (abs:SF (match_operand:SF
1 "reg_or_fp0_operand" "fG")))]
896 [(set_attr "type" "fpop")])
898 (define_insn "absdf2"
899 [(set (match_operand:DF
0 "register_operand" "=f")
900 (abs:DF (match_operand:DF
1 "reg_or_fp0_operand" "fG")))]
903 [(set_attr "type" "fpop")])
905 (define_insn "negsf2"
906 [(set (match_operand:SF
0 "register_operand" "=f")
907 (neg:SF (match_operand:SF
1 "reg_or_fp0_operand" "fG")))]
910 [(set_attr "type" "fpop")])
912 (define_insn "negdf2"
913 [(set (match_operand:DF
0 "register_operand" "=f")
914 (neg:DF (match_operand:DF
1 "reg_or_fp0_operand" "fG")))]
917 [(set_attr "type" "fpop")])
919 (define_insn "addsf3"
920 [(set (match_operand:SF
0 "register_operand" "=f")
921 (plus:SF (match_operand:SF
1 "reg_or_fp0_operand" "%fG")
922 (match_operand:SF
2 "reg_or_fp0_operand" "fG")))]
925 [(set_attr "type" "fpop")])
927 (define_insn "adddf3"
928 [(set (match_operand:DF
0 "register_operand" "=f")
929 (plus:DF (match_operand:DF
1 "reg_or_fp0_operand" "%fG")
930 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
933 [(set_attr "type" "fpop")])
936 [(set (match_operand:DF
0 "register_operand" "=f")
937 (plus:DF (float_extend:DF
938 (match_operand:SF
1 "reg_or_fp0_operand" "%fG"))
939 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
942 [(set_attr "type" "fpop")])
945 [(set (match_operand:DF
0 "register_operand" "=f")
946 (plus:DF (float_extend:DF
947 (match_operand:SF
1 "reg_or_fp0_operand" "%fG"))
949 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
952 [(set_attr "type" "fpop")])
954 (define_insn "fix_truncdfdi2"
955 [(set (match_operand:DI
0 "register_operand" "=f")
956 (fix:DI (match_operand:DF
1 "reg_or_fp0_operand" "fG")))]
959 [(set_attr "type" "fpop")])
961 (define_insn "fix_truncsfdi2"
962 [(set (match_operand:DI
0 "register_operand" "=f")
963 (fix:DI (float_extend:DF
964 (match_operand:SF
1 "reg_or_fp0_operand" "fG"))))]
967 [(set_attr "type" "fpop")])
969 (define_insn "floatdisf2"
970 [(set (match_operand:SF
0 "register_operand" "=f")
971 (float:SF (match_operand:DI
1 "register_operand" "f")))]
974 [(set_attr "type" "fpop")])
976 (define_insn "floatdidf2"
977 [(set (match_operand:DF
0 "register_operand" "=f")
978 (float:DF (match_operand:DI
1 "register_operand" "f")))]
981 [(set_attr "type" "fpop")])
983 (define_insn "extendsfdf2"
984 [(set (match_operand:DF
0 "register_operand" "=f,f")
985 (float_extend:DF (match_operand:SF
1 "nonimmediate_operand" "f,m")))]
990 [(set_attr "type" "fpop,ld")])
992 (define_insn "truncdfsf2"
993 [(set (match_operand:SF
0 "register_operand" "=f")
994 (float_truncate:SF (match_operand:DF
1 "reg_or_fp0_operand" "fG")))]
997 [(set_attr "type" "fpop")])
999 (define_insn "divsf3"
1000 [(set (match_operand:SF
0 "register_operand" "=f")
1001 (div:SF (match_operand:SF
1 "reg_or_fp0_operand" "fG")
1002 (match_operand:SF
2 "reg_or_fp0_operand" "fG")))]
1005 [(set_attr "type" "fdivs")])
1007 (define_insn "divdf3"
1008 [(set (match_operand:DF
0 "register_operand" "=f")
1009 (div:DF (match_operand:DF
1 "reg_or_fp0_operand" "fG")
1010 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1013 [(set_attr "type" "fdivt")])
1016 [(set (match_operand:DF
0 "register_operand" "=f")
1017 (div:DF (float_extend:DF (match_operand:SF
1 "reg_or_fp0_operand" "fG"))
1018 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1021 [(set_attr "type" "fdivt")])
1024 [(set (match_operand:DF
0 "register_operand" "=f")
1025 (div:DF (match_operand:DF
1 "reg_or_fp0_operand" "fG")
1027 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
1030 [(set_attr "type" "fdivt")])
1033 [(set (match_operand:DF
0 "register_operand" "=f")
1034 (div:DF (float_extend:DF (match_operand:SF
1 "reg_or_fp0_operand" "fG"))
1035 (float_extend:DF (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
1038 [(set_attr "type" "fdivt")])
1040 (define_insn "mulsf3"
1041 [(set (match_operand:SF
0 "register_operand" "=f")
1042 (mult:SF (match_operand:SF
1 "reg_or_fp0_operand" "fG")
1043 (match_operand:SF
2 "reg_or_fp0_operand" "fG")))]
1046 [(set_attr "type" "fpop")])
1048 (define_insn "muldf3"
1049 [(set (match_operand:DF
0 "register_operand" "=f")
1050 (mult:DF (match_operand:DF
1 "reg_or_fp0_operand" "fG")
1051 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1054 [(set_attr "type" "fpop")])
1057 [(set (match_operand:DF
0 "register_operand" "=f")
1058 (mult:DF (float_extend:DF
1059 (match_operand:SF
1 "reg_or_fp0_operand" "fG"))
1060 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1063 [(set_attr "type" "fpop")])
1066 [(set (match_operand:DF
0 "register_operand" "=f")
1067 (mult:DF (float_extend:DF
1068 (match_operand:SF
1 "reg_or_fp0_operand" "fG"))
1070 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
1073 [(set_attr "type" "fpop")])
1075 (define_insn "subsf3"
1076 [(set (match_operand:SF
0 "register_operand" "=f")
1077 (minus:SF (match_operand:SF
1 "reg_or_fp0_operand" "%fG")
1078 (match_operand:SF
2 "reg_or_fp0_operand" "fG")))]
1081 [(set_attr "type" "fpop")])
1083 (define_insn "subdf3"
1084 [(set (match_operand:DF
0 "register_operand" "=f")
1085 (minus:DF (match_operand:DF
1 "reg_or_fp0_operand" "%fG")
1086 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1089 [(set_attr "type" "fpop")])
1092 [(set (match_operand:DF
0 "register_operand" "=f")
1093 (minus:DF (float_extend:DF
1094 (match_operand:SF
1 "reg_or_fp0_operand" "%fG"))
1095 (match_operand:DF
2 "reg_or_fp0_operand" "fG")))]
1098 [(set_attr "type" "fpop")])
1101 [(set (match_operand:DF
0 "register_operand" "=f")
1102 (minus:DF (match_operand:DF
1 "reg_or_fp0_operand" "%fG")
1104 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
1107 [(set_attr "type" "fpop")])
1110 [(set (match_operand:DF
0 "register_operand" "=f")
1111 (minus:DF (float_extend:DF
1112 (match_operand:SF
1 "reg_or_fp0_operand" "%fG"))
1114 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))))]
1117 [(set_attr "type" "fpop")])
1119 ;; Next are all the integer comparisons, and conditional moves and branches
1120 ;; and some of the related define_expand's and define_split's.
1123 [(set (match_operand:DI
0 "register_operand" "=r")
1124 (match_operator:DI
1 "alpha_comparison_operator"
1125 [(match_operand:DI
2 "reg_or_0_operand" "rJ")
1126 (match_operand:DI
3 "reg_or_8bit_operand" "rI")]))]
1129 [(set_attr "type" "icmp")])
1132 [(set (match_operand:DI
0 "register_operand" "=r,r")
1134 (match_operator
2 "signed_comparison_operator"
1135 [(match_operand:DI
3 "reg_or_0_operand" "rJ,rJ")
1137 (match_operand:DI
1 "reg_or_8bit_operand" "rI,
0")
1138 (match_operand:DI
4 "reg_or_8bit_operand" "
0,rI")))]
1145 [(set (match_operand:DI
0 "register_operand" "=r,r")
1147 (eq (zero_extract:DI (match_operand:DI
2 "reg_or_0_operand" "rJ,rJ")
1151 (match_operand:DI
1 "reg_or_8bit_operand" "rI,
0")
1152 (match_operand:DI
3 "reg_or_8bit_operand" "
0,rI")))]
1159 [(set (match_operand:DI
0 "register_operand" "=r,r")
1161 (ne (zero_extract:DI (match_operand:DI
2 "reg_or_0_operand" "rJ,rJ")
1165 (match_operand:DI
1 "reg_or_8bit_operand" "rI,
0")
1166 (match_operand:DI
3 "reg_or_8bit_operand" "
0,rI")))]
1172 ;; This form is added since combine thinks that an IF_THEN_ELSE with both
1173 ;; arms constant is a single insn, so it won't try to form it if combine
1174 ;; knows they are really two insns. This occurs in divides by powers
1178 [(set (match_operand:DI
0 "register_operand" "=r")
1180 (match_operator
2 "signed_comparison_operator"
1181 [(match_operand:DI
3 "reg_or_0_operand" "rJ")
1183 (plus:DI (match_dup
0)
1184 (match_operand:DI
1 "reg_or_8bit_operand" "rI"))
1186 (clobber (match_scratch:DI
4 "=&r"))]
1188 "addq %
0,%
1,%
4\;cmov%C2 %r3,%
4,%
0")
1191 [(set (match_operand:DI
0 "register_operand" "")
1193 (match_operator
2 "signed_comparison_operator"
1194 [(match_operand:DI
3 "reg_or_0_operand" "")
1196 (plus:DI (match_dup
0)
1197 (match_operand:DI
1 "reg_or_8bit_operand" ""))
1199 (clobber (match_operand:DI
4 "register_operand" ""))]
1201 [(set (match_dup
4) (plus:DI (match_dup
0) (match_dup
1)))
1202 (set (match_dup
0) (if_then_else:DI (match_op_dup
2
1205 (match_dup
4) (match_dup
0)))]
1210 [(set (match_operand:DI
0 "register_operand" "")
1212 (match_operator
1 "comparison_operator"
1213 [(zero_extract:DI (match_operand:DI
2 "register_operand" "")
1215 (match_operand:DI
3 "const_int_operand" ""))
1217 (match_operand:DI
4 "reg_or_8bit_operand" "")
1218 (match_operand:DI
5 "reg_or_8bit_operand" "")))
1219 (clobber (match_operand:DI
6 "register_operand" ""))])]
1220 "INTVAL (operands[
3]) !=
0"
1222 (lshiftrt:DI (match_dup
2) (match_dup
3)))
1224 (if_then_else:DI (match_op_dup
1
1225 [(zero_extract:DI (match_dup
6)
1233 ;; For ABS, we have two choices, depending on whether the input and output
1234 ;; registers are the same or not.
1235 (define_expand "absdi2"
1236 [(set (match_operand:DI
0 "register_operand" "")
1237 (abs:DI (match_operand:DI
1 "register_operand" "")))]
1240 { if (rtx_equal_p (operands[
0], operands[
1]))
1241 emit_insn (gen_absdi2_same (operands[
0], gen_reg_rtx (DImode)));
1243 emit_insn (gen_absdi2_diff (operands[
0], operands[
1]));
1248 (define_expand "absdi2_same"
1249 [(set (match_operand:DI
1 "register_operand" "")
1250 (neg:DI (match_operand:DI
0 "register_operand" "")))
1252 (if_then_else:DI (ge (match_dup
0) (const_int
0))
1258 (define_expand "absdi2_diff"
1259 [(set (match_operand:DI
0 "register_operand" "")
1260 (neg:DI (match_operand:DI
1 "register_operand" "")))
1262 (if_then_else:DI (lt (match_dup
1) (const_int
0))
1269 [(set (match_operand:DI
0 "register_operand" "")
1270 (abs:DI (match_dup
0)))
1271 (clobber (match_operand:DI
2 "register_operand" ""))]
1273 [(set (match_dup
1) (neg:DI (match_dup
0)))
1274 (set (match_dup
0) (if_then_else:DI (ge (match_dup
0) (const_int
0))
1275 (match_dup
0) (match_dup
1)))]
1279 [(set (match_operand:DI
0 "register_operand" "")
1280 (abs:DI (match_operand:DI
1 "register_operand" "")))]
1281 "! rtx_equal_p (operands[
0], operands[
1])"
1282 [(set (match_dup
0) (neg:DI (match_dup
1)))
1283 (set (match_dup
0) (if_then_else:DI (lt (match_dup
1) (const_int
0))
1284 (match_dup
0) (match_dup
1)))]
1288 [(set (match_operand:DI
0 "register_operand" "")
1289 (neg:DI (abs:DI (match_dup
0))))
1290 (clobber (match_operand:DI
2 "register_operand" ""))]
1292 [(set (match_dup
1) (neg:DI (match_dup
0)))
1293 (set (match_dup
0) (if_then_else:DI (le (match_dup
0) (const_int
0))
1294 (match_dup
0) (match_dup
1)))]
1298 [(set (match_operand:DI
0 "register_operand" "")
1299 (neg:DI (abs:DI (match_operand:DI
1 "register_operand" ""))))]
1300 "! rtx_equal_p (operands[
0], operands[
1])"
1301 [(set (match_dup
0) (neg:DI (match_dup
1)))
1302 (set (match_dup
0) (if_then_else:DI (gt (match_dup
1) (const_int
0))
1303 (match_dup
0) (match_dup
1)))]
1306 (define_expand "smaxdi3"
1308 (le:DI (match_operand:DI
1 "reg_or_0_operand" "")
1309 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1310 (set (match_operand:DI
0 "register_operand" "")
1311 (if_then_else:DI (eq (match_dup
3) (const_int
0))
1312 (match_dup
1) (match_dup
2)))]
1315 { operands[
3] = gen_reg_rtx (DImode);
1319 [(set (match_operand:DI
0 "register_operand" "")
1320 (smax:DI (match_operand:DI
1 "reg_or_0_operand" "")
1321 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1322 (clobber (match_operand:DI
3 "register_operand" ""))]
1323 "operands[
2] != const0_rtx"
1324 [(set (match_dup
3) (le:DI (match_dup
1) (match_dup
2)))
1325 (set (match_dup
0) (if_then_else:DI (eq (match_dup
3) (const_int
0))
1326 (match_dup
1) (match_dup
2)))]
1330 [(set (match_operand:DI
0 "register_operand" "=r")
1331 (smax:DI (match_operand:DI
1 "register_operand" "
0")
1336 (define_expand "smindi3"
1338 (lt:DI (match_operand:DI
1 "reg_or_0_operand" "")
1339 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1340 (set (match_operand:DI
0 "register_operand" "")
1341 (if_then_else:DI (ne (match_dup
3) (const_int
0))
1342 (match_dup
1) (match_dup
2)))]
1345 { operands[
3] = gen_reg_rtx (DImode);
1349 [(set (match_operand:DI
0 "register_operand" "")
1350 (smin:DI (match_operand:DI
1 "reg_or_0_operand" "")
1351 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1352 (clobber (match_operand:DI
3 "register_operand" ""))]
1353 "operands[
2] != const0_rtx"
1354 [(set (match_dup
3) (lt:DI (match_dup
1) (match_dup
2)))
1355 (set (match_dup
0) (if_then_else:DI (ne (match_dup
3) (const_int
0))
1356 (match_dup
1) (match_dup
2)))]
1360 [(set (match_operand:DI
0 "register_operand" "=r")
1361 (smin:DI (match_operand:DI
1 "register_operand" "
0")
1366 (define_expand "umaxdi3"
1368 (leu:DI (match_operand:DI
1 "reg_or_0_operand" "")
1369 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1370 (set (match_operand:DI
0 "register_operand" "")
1371 (if_then_else:DI (eq (match_dup
3) (const_int
0))
1372 (match_dup
1) (match_dup
2)))]
1375 { operands[
3] = gen_reg_rtx (DImode);
1379 [(set (match_operand:DI
0 "register_operand" "")
1380 (umax:DI (match_operand:DI
1 "reg_or_0_operand" "")
1381 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1382 (clobber (match_operand:DI
3 "register_operand" ""))]
1383 "operands[
2] != const0_rtx"
1384 [(set (match_dup
3) (leu:DI (match_dup
1) (match_dup
2)))
1385 (set (match_dup
0) (if_then_else:DI (eq (match_dup
3) (const_int
0))
1386 (match_dup
1) (match_dup
2)))]
1389 (define_expand "umindi3"
1391 (ltu:DI (match_operand:DI
1 "reg_or_0_operand" "")
1392 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1393 (set (match_operand:DI
0 "register_operand" "")
1394 (if_then_else:DI (ne (match_dup
3) (const_int
0))
1395 (match_dup
1) (match_dup
2)))]
1398 { operands[
3] = gen_reg_rtx (DImode);
1402 [(set (match_operand:DI
0 "register_operand" "")
1403 (umin:DI (match_operand:DI
1 "reg_or_0_operand" "")
1404 (match_operand:DI
2 "reg_or_8bit_operand" "")))
1405 (clobber (match_operand:DI
3 "register_operand" ""))]
1406 "operands[
2] != const0_rtx"
1407 [(set (match_dup
3) (ltu:DI (match_dup
1) (match_dup
2)))
1408 (set (match_dup
0) (if_then_else:DI (ne (match_dup
3) (const_int
0))
1409 (match_dup
1) (match_dup
2)))]
1415 (match_operator
1 "signed_comparison_operator"
1416 [(match_operand:DI
2 "reg_or_0_operand" "rJ")
1418 (label_ref (match_operand
0 "" ""))
1422 [(set_attr "type" "ibr")])
1427 (ne (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
1431 (label_ref (match_operand
0 "" ""))
1435 [(set_attr "type" "ibr")])
1440 (eq (zero_extract:DI (match_operand:DI
1 "reg_or_0_operand" "rJ")
1444 (label_ref (match_operand
0 "" ""))
1448 [(set_attr "type" "ibr")])
1454 (match_operator
1 "comparison_operator"
1455 [(zero_extract:DI (match_operand:DI
2 "register_operand" "")
1457 (match_operand:DI
3 "const_int_operand" ""))
1459 (label_ref (match_operand
0 "" ""))
1461 (clobber (match_operand:DI
4 "register_operand" ""))])]
1462 "INTVAL (operands[
3]) !=
0"
1464 (lshiftrt:DI (match_dup
2) (match_dup
3)))
1466 (if_then_else (match_op_dup
1
1467 [(zero_extract:DI (match_dup
4)
1471 (label_ref (match_dup
0))
1475 ;; The following are the corresponding floating-point insns. Recall
1476 ;; we need to have variants that expand the arguments from SF mode
1480 [(set (match_operand:DF
0 "register_operand" "=f")
1481 (match_operator:DF
1 "alpha_comparison_operator"
1482 [(match_operand:DF
2 "reg_or_fp0_operand" "fG")
1483 (match_operand:DF
3 "reg_or_fp0_operand" "fG")]))]
1485 "cmpt%C1 %R2,%R3,%
0"
1486 [(set_attr "type" "fpop")])
1489 [(set (match_operand:DF
0 "register_operand" "=f")
1490 (match_operator:DF
1 "alpha_comparison_operator"
1492 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))
1493 (match_operand:DF
3 "reg_or_fp0_operand" "fG")]))]
1495 "cmpt%C1 %R2,%R3,%
0"
1496 [(set_attr "type" "fpop")])
1499 [(set (match_operand:DF
0 "register_operand" "=f")
1500 (match_operator:DF
1 "alpha_comparison_operator"
1501 [(match_operand:DF
2 "reg_or_fp0_operand" "fG")
1503 (match_operand:SF
3 "reg_or_fp0_operand" "fG"))]))]
1505 "cmpt%C1 %R2,%R3,%
0"
1506 [(set_attr "type" "fpop")])
1509 [(set (match_operand:DF
0 "register_operand" "=f")
1510 (match_operator:DF
1 "alpha_comparison_operator"
1512 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))
1514 (match_operand:SF
3 "reg_or_fp0_operand" "fG"))]))]
1516 "cmpt%C1 %R2,%R3,%
0"
1517 [(set_attr "type" "fpop")])
1520 [(set (match_operand:DF
0 "register_operand" "=f,f")
1522 (match_operator
3 "signed_comparison_operator"
1523 [(match_operand:DF
4 "reg_or_fp0_operand" "fG,fG")
1524 (match_operand:DF
2 "fp0_operand" "G,G")])
1525 (match_operand:DF
1 "reg_or_fp0_operand" "fG,
0")
1526 (match_operand:DF
5 "reg_or_fp0_operand" "
0,fG")))]
1530 fcmov%D3 %R4,%R5,%
0"
1531 [(set_attr "type" "fpop")])
1534 [(set (match_operand:SF
0 "register_operand" "=f,f")
1536 (match_operator
3 "signed_comparison_operator"
1537 [(match_operand:DF
4 "reg_or_fp0_operand" "fG,fG")
1538 (match_operand:DF
2 "fp0_operand" "G,G")])
1539 (match_operand:SF
1 "reg_or_fp0_operand" "fG,
0")
1540 (match_operand:SF
5 "reg_or_fp0_operand" "
0,fG")))]
1544 fcmov%D3 %R4,%R5,%
0"
1545 [(set_attr "type" "fpop")])
1548 [(set (match_operand:DF
0 "register_operand" "=f,f")
1550 (match_operator
3 "signed_comparison_operator"
1551 [(match_operand:DF
1 "reg_or_fp0_operand" "fG,fG")
1552 (match_operand:DF
2 "fp0_operand" "G,G")])
1553 (float_extend:DF (match_operand:SF
4 "reg_or_fp0_operand" "fG,
0"))
1554 (match_operand:DF
5 "reg_or_fp0_operand" "
0,fG")))]
1558 fcmov%D3 %R4,%R5,%
0"
1559 [(set_attr "type" "fpop")])
1562 [(set (match_operand:DF
0 "register_operand" "=f,f")
1564 (match_operator
3 "signed_comparison_operator"
1566 (match_operand:SF
4 "reg_or_fp0_operand" "fG,fG"))
1567 (match_operand:DF
2 "fp0_operand" "G,G")])
1568 (match_operand:DF
1 "reg_or_fp0_operand" "fG,
0")
1569 (match_operand:DF
5 "reg_or_fp0_operand" "
0,fG")))]
1573 fcmov%D3 %R4,%R5,%
0"
1574 [(set_attr "type" "fpop")])
1577 [(set (match_operand:SF
0 "register_operand" "=f,f")
1579 (match_operator
3 "signed_comparison_operator"
1581 (match_operand:SF
4 "reg_or_fp0_operand" "fG,fG"))
1582 (match_operand:DF
2 "fp0_operand" "G,G")])
1583 (match_operand:SF
1 "reg_or_fp0_operand" "fG,
0")
1584 (match_operand:SF
5 "reg_or_fp0_operand" "
0,fG")))]
1588 fcmov%D3 %R4,%R5,%
0"
1589 [(set_attr "type" "fpop")])
1592 [(set (match_operand:DF
0 "register_operand" "=f,f")
1594 (match_operator
3 "signed_comparison_operator"
1596 (match_operand:SF
4 "reg_or_fp0_operand" "fG,fG"))
1597 (match_operand:DF
2 "fp0_operand" "G,G")])
1598 (float_extend:DF (match_operand:SF
1 "reg_or_fp0_operand" "fG,
0"))
1599 (match_operand:DF
5 "reg_or_fp0_operand" "
0,fG")))]
1603 fcmov%D3 %R4,%R5,%
0"
1604 [(set_attr "type" "fpop")])
1606 (define_expand "smaxdf3"
1608 (le:DF (match_operand:DF
1 "reg_or_fp0_operand" "")
1609 (match_operand:DF
2 "reg_or_fp0_operand" "")))
1610 (set (match_operand:DF
0 "register_operand" "")
1611 (if_then_else:DF (eq (match_dup
3) (const_int
0))
1612 (match_dup
1) (match_dup
2)))]
1615 { operands[
3] = gen_reg_rtx (DFmode);
1618 (define_expand "smindf3"
1620 (lt:DF (match_operand:DF
1 "reg_or_fp0_operand" "")
1621 (match_operand:DF
2 "reg_or_fp0_operand" "")))
1622 (set (match_operand:DF
0 "register_operand" "")
1623 (if_then_else:DF (ne (match_dup
3) (const_int
0))
1624 (match_dup
1) (match_dup
2)))]
1627 { operands[
3] = gen_reg_rtx (DFmode);
1630 (define_expand "smaxsf3"
1632 (le:DF (match_operand:SF
1 "reg_or_fp0_operand" "")
1633 (float_extend:DF (match_operand:SF
2 "reg_or_fp0_operand" ""))))
1634 (set (match_operand:SF
0 "register_operand" "")
1635 (if_then_else:SF (eq (match_dup
3) (const_int
0))
1636 (match_dup
1) (match_dup
2)))]
1639 { operands[
3] = gen_reg_rtx (SFmode);
1642 (define_expand "sminsf3"
1644 (lt:DF (match_operand:SF
1 "reg_or_fp0_operand" "")
1645 (float_extend:DF (match_operand:SF
2 "reg_or_fp0_operand" ""))))
1646 (set (match_operand:SF
0 "register_operand" "")
1647 (if_then_else:SF (ne (match_dup
3) (const_int
0))
1648 (match_dup
1) (match_dup
2)))]
1651 { operands[
3] = gen_reg_rtx (SFmode);
1657 (match_operator
1 "signed_comparison_operator"
1658 [(match_operand:DF
2 "reg_or_fp0_operand" "fG")
1659 (match_operand:DF
3 "fp0_operand" "G")])
1660 (label_ref (match_operand
0 "" ""))
1664 [(set_attr "type" "fbr")])
1669 (match_operator
1 "signed_comparison_operator"
1671 (match_operand:SF
2 "reg_or_fp0_operand" "fG"))
1672 (match_operand:DF
3 "fp0_operand" "G")])
1673 (label_ref (match_operand
0 "" ""))
1677 [(set_attr "type" "fbr")])
1679 ;; These are the main define_expand's used to make conditional branches
1682 (define_expand "cmpdf"
1683 [(set (cc0) (compare (match_operand:DF
0 "reg_or_fp0_operand" "")
1684 (match_operand:DF
1 "reg_or_fp0_operand" "")))]
1688 alpha_compare_op0 = operands[
0];
1689 alpha_compare_op1 = operands[
1];
1690 alpha_compare_fp_p =
1;
1694 (define_expand "cmpdi"
1695 [(set (cc0) (compare (match_operand:DI
0 "reg_or_0_operand" "")
1696 (match_operand:DI
1 "reg_or_8bit_operand" "")))]
1700 alpha_compare_op0 = operands[
0];
1701 alpha_compare_op1 = operands[
1];
1702 alpha_compare_fp_p =
0;
1706 (define_expand "beq"
1707 [(set (match_dup
1) (match_dup
2))
1709 (if_then_else (match_dup
3)
1710 (label_ref (match_operand
0 "" ""))
1715 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
1716 operands[
1] = gen_reg_rtx (mode);
1717 operands[
2] = gen_rtx (EQ, mode, alpha_compare_op0, alpha_compare_op1);
1718 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], CONST0_RTX (mode));
1721 (define_expand "bne"
1722 [(set (match_dup
1) (match_dup
2))
1724 (if_then_else (match_dup
3)
1725 (label_ref (match_operand
0 "" ""))
1730 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
1731 operands[
1] = gen_reg_rtx (mode);
1732 operands[
2] = gen_rtx (EQ, mode, alpha_compare_op0, alpha_compare_op1);
1733 operands[
3] = gen_rtx (EQ, VOIDmode, operands[
1], CONST0_RTX (mode));
1736 (define_expand "blt"
1737 [(set (match_dup
1) (match_dup
2))
1739 (if_then_else (match_dup
3)
1740 (label_ref (match_operand
0 "" ""))
1745 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
1746 operands[
1] = gen_reg_rtx (mode);
1747 operands[
2] = gen_rtx (LT, mode, alpha_compare_op0, alpha_compare_op1);
1748 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], CONST0_RTX (mode));
1751 (define_expand "ble"
1752 [(set (match_dup
1) (match_dup
2))
1754 (if_then_else (match_dup
3)
1755 (label_ref (match_operand
0 "" ""))
1760 enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;
1761 operands[
1] = gen_reg_rtx (mode);
1762 operands[
2] = gen_rtx (LE, mode, alpha_compare_op0, alpha_compare_op1);
1763 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], CONST0_RTX (mode));
1766 (define_expand "bgt"
1767 [(set (match_dup
1) (match_dup
2))
1769 (if_then_else (match_dup
3)
1770 (label_ref (match_operand
0 "" ""))
1775 if (alpha_compare_fp_p)
1777 operands[
1] = gen_reg_rtx (DFmode);
1778 operands[
2] = gen_rtx (LT, DFmode, alpha_compare_op1, alpha_compare_op0);
1779 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], CONST0_RTX (DFmode));
1783 operands[
1] = gen_reg_rtx (DImode);
1784 operands[
2] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
1785 operands[
3] = gen_rtx (EQ, VOIDmode, operands[
1], const0_rtx);
1789 (define_expand "bge"
1790 [(set (match_dup
1) (match_dup
2))
1792 (if_then_else (match_dup
3)
1793 (label_ref (match_operand
0 "" ""))
1798 if (alpha_compare_fp_p)
1800 operands[
1] = gen_reg_rtx (DFmode);
1801 operands[
2] = gen_rtx (LE, DFmode, alpha_compare_op1, alpha_compare_op0);
1802 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], CONST0_RTX (DFmode));
1806 operands[
1] = gen_reg_rtx (DImode);
1807 operands[
2] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
1808 operands[
3] = gen_rtx (EQ, VOIDmode, operands[
1], const0_rtx);
1812 (define_expand "bltu"
1813 [(set (match_dup
1) (match_dup
2))
1815 (if_then_else (match_dup
3)
1816 (label_ref (match_operand
0 "" ""))
1821 operands[
1] = gen_reg_rtx (DImode);
1822 operands[
2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
1823 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], const0_rtx);
1826 (define_expand "bleu"
1827 [(set (match_dup
1) (match_dup
2))
1829 (if_then_else (match_dup
3)
1830 (label_ref (match_operand
0 "" ""))
1835 operands[
1] = gen_reg_rtx (DImode);
1836 operands[
2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
1837 operands[
3] = gen_rtx (NE, VOIDmode, operands[
1], const0_rtx);
1840 (define_expand "bgtu"
1841 [(set (match_dup
1) (match_dup
2))
1843 (if_then_else (match_dup
3)
1844 (label_ref (match_operand
0 "" ""))
1849 operands[
1] = gen_reg_rtx (DImode);
1850 operands[
2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
1851 operands[
3] = gen_rtx (EQ, VOIDmode, operands[
1], const0_rtx);
1854 (define_expand "bgeu"
1855 [(set (match_dup
1) (match_dup
2))
1857 (if_then_else (match_dup
3)
1858 (label_ref (match_operand
0 "" ""))
1863 operands[
1] = gen_reg_rtx (DImode);
1864 operands[
2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
1865 operands[
3] = gen_rtx (EQ, VOIDmode, operands[
1], const0_rtx);
1868 (define_expand "seq"
1869 [(set (match_operand:DI
0 "register_operand" "")
1874 if (alpha_compare_fp_p)
1877 operands[
1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
1880 (define_expand "sne"
1881 [(set (match_operand:DI
0 "register_operand" "")
1883 (set (match_dup
0) (xor:DI (match_dup
0) (const_int
1)))]
1887 if (alpha_compare_fp_p)
1890 operands[
1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);
1893 (define_expand "slt"
1894 [(set (match_operand:DI
0 "register_operand" "")
1899 if (alpha_compare_fp_p)
1902 operands[
1] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);
1905 (define_expand "sle"
1906 [(set (match_operand:DI
0 "register_operand" "")
1911 if (alpha_compare_fp_p)
1914 operands[
1] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);
1917 (define_expand "sgt"
1918 [(set (match_operand:DI
0 "register_operand" "")
1923 if (alpha_compare_fp_p)
1926 operands[
1] = gen_rtx (LT, DImode, force_reg (DImode, alpha_compare_op1),
1930 (define_expand "sge"
1931 [(set (match_operand:DI
0 "register_operand" "")
1936 if (alpha_compare_fp_p)
1939 operands[
1] = gen_rtx (LE, DImode, force_reg (DImode, alpha_compare_op1),
1943 (define_expand "sltu"
1944 [(set (match_operand:DI
0 "register_operand" "")
1949 if (alpha_compare_fp_p)
1952 operands[
1] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);
1955 (define_expand "sleu"
1956 [(set (match_operand:DI
0 "register_operand" "")
1961 if (alpha_compare_fp_p)
1964 operands[
1] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);
1967 (define_expand "sgtu"
1968 [(set (match_operand:DI
0 "register_operand" "")
1973 if (alpha_compare_fp_p)
1976 operands[
1] = gen_rtx (LTU, DImode, force_reg (DImode, alpha_compare_op1),
1980 (define_expand "sgeu"
1981 [(set (match_operand:DI
0 "register_operand" "")
1986 if (alpha_compare_fp_p)
1989 operands[
1] = gen_rtx (LEU, DImode, force_reg (DImode, alpha_compare_op1),
1993 ;; These define_split definitions are used in cases when comparisons have
1994 ;; not be stated in the correct way and we need to reverse the second
1995 ;; comparison. For example, x >=
7 has to be done as x <
6 with the
1996 ;; comparison that tests the result being reversed. We have one define_split
1997 ;; for each use of a comparison. They do not match valid insns and need
1998 ;; not generate valid insns.
2000 ;; We can also handle equality comparisons (and inequality comparisons in
2001 ;; cases where the resulting add cannot overflow) with out-of-range numbers by
2002 ;; doing an add followed by a comparison with zero. For this case, we
2003 ;; also have an SImode pattern since we can merge the add and sign
2004 ;; extend and the order doesn't matter.
2006 ;; We do not do this for floating-point, since it isn't clear how the "wrong"
2007 ;; operation could have been generated.
2010 [(set (match_operand:DI
0 "register_operand" "")
2012 (match_operator
1 "comparison_operator"
2013 [(match_operand:DI
2 "reg_or_0_operand" "")
2014 (match_operand:DI
3 "reg_or_cint_operand" "")])
2015 (match_operand:DI
4 "reg_or_cint_operand" "")
2016 (match_operand:DI
5 "reg_or_cint_operand" "")))
2017 (clobber (match_operand:DI
6 "register_operand" ""))]
2018 "operands[
3] != const0_rtx"
2019 [(set (match_dup
6) (match_dup
7))
2021 (if_then_else:DI (match_dup
8) (match_dup
4) (match_dup
5)))]
2023 { enum rtx_code code = GET_CODE (operands[
1]);
2024 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
2026 /* If we are comparing for equality with a constant and that constant
2027 appears in the arm when the register equals the constant, use the
2028 register since that is more likely to match (and to produce better code
2031 if (code == EQ && GET_CODE (operands[
3]) == CONST_INT
2032 && rtx_equal_p (operands[
4], operands[
3]))
2033 operands[
4] = operands[
2];
2035 else if (code == NE && GET_CODE (operands[
3]) == CONST_INT
2036 && rtx_equal_p (operands[
5], operands[
3]))
2037 operands[
5] = operands[
2];
2039 if ((code == NE || code == EQ
2040 || (extended_count (operands[
2], DImode, unsignedp) >=
1
2041 && extended_count (operands[
3], DImode, unsignedp) >=
1))
2042 && GET_CODE (operands[
3]) == CONST_INT
2043 && (unsigned) INTVAL (operands[
3]) >
255)
2045 operands[
7] = gen_rtx (PLUS, DImode, operands[
2],
2046 GEN_INT (- INTVAL (operands[
3])));
2047 operands[
8] = gen_rtx (code, VOIDmode, operands[
6], const0_rtx);
2050 else if (code == EQ || code == LE || code == LT
2051 || code == LEU || code == LTU)
2053 operands[
7] = gen_rtx (code, DImode, operands[
2], operands[
3]);
2054 operands[
8] = gen_rtx (NE, VOIDmode, operands[
6], const0_rtx);
2058 operands[
7] = gen_rtx (reverse_condition (code), DImode, operands[
2],
2060 operands[
8] = gen_rtx (EQ, VOIDmode, operands[
6], const0_rtx);
2065 [(set (match_operand:DI
0 "register_operand" "")
2067 (match_operator
1 "comparison_operator"
2068 [(match_operand:SI
2 "reg_or_0_operand" "")
2069 (match_operand:SI
3 "const_int_operand" "")])
2070 (match_operand:DI
4 "reg_or_8bit_operand" "")
2071 (match_operand:DI
5 "reg_or_8bit_operand" "")))
2072 (clobber (match_operand:DI
6 "register_operand" ""))]
2073 "(unsigned) INTVAL (operands[
3]) >
255"
2074 [(set (match_dup
6) (match_dup
7))
2076 (if_then_else:DI (match_dup
8) (match_dup
4) (match_dup
5)))]
2078 { enum rtx_code code = GET_CODE (operands[
1]);
2079 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
2081 if ((code != NE && code != EQ
2082 && ! (extended_count (operands[
2], DImode, unsignedp) >=
1
2083 && extended_count (operands[
3], DImode, unsignedp) >=
1)))
2086 operands[
7] = gen_rtx (SIGN_EXTEND, DImode,
2087 gen_rtx (PLUS, SImode, operands[
2],
2088 GEN_INT (- INTVAL (operands[
3]))));
2089 operands[
8] = gen_rtx (GET_CODE (operands[
1]), VOIDmode, operands[
6],
2096 (match_operator
1 "comparison_operator"
2097 [(match_operand:DI
2 "reg_or_0_operand" "")
2098 (match_operand:DI
3 "reg_or_cint_operand" "")])
2099 (label_ref (match_operand
0 "" ""))
2101 (clobber (match_operand:DI
4 "register_operand" ""))]
2102 "operands[
3] != const0_rtx"
2103 [(set (match_dup
4) (match_dup
5))
2104 (set (pc) (if_then_else (match_dup
6) (label_ref (match_dup
0)) (pc)))]
2106 { enum rtx_code code = GET_CODE (operands[
1]);
2107 int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);
2109 if ((code == NE || code == EQ
2110 || (extended_count (operands[
2], DImode, unsignedp) >=
1
2111 && extended_count (operands[
3], DImode, unsignedp) >=
1))
2112 && GET_CODE (operands[
3]) == CONST_INT
2113 && (unsigned) INTVAL (operands[
3]) >
255)
2115 operands[
5] = gen_rtx (PLUS, DImode, operands[
2],
2116 GEN_INT (- INTVAL (operands[
3])));
2117 operands[
6] = gen_rtx (code, VOIDmode, operands[
4], const0_rtx);
2120 else if (code == EQ || code == LE || code == LT
2121 || code == LEU || code == LTU)
2123 operands[
5] = gen_rtx (code, DImode, operands[
2], operands[
3]);
2124 operands[
6] = gen_rtx (NE, VOIDmode, operands[
4], const0_rtx);
2128 operands[
5] = gen_rtx (reverse_condition (code), DImode, operands[
2],
2130 operands[
6] = gen_rtx (EQ, VOIDmode, operands[
4], const0_rtx);
2137 (match_operator
1 "comparison_operator"
2138 [(match_operand:SI
2 "reg_or_0_operand" "")
2139 (match_operand:SI
3 "const_int_operand" "")])
2140 (label_ref (match_operand
0 "" ""))
2142 (clobber (match_operand:DI
4 "register_operand" ""))]
2143 "INTVAL (operands[
3]) <
0
2144 && (GET_CODE (operands[
1]) == EQ || GET_CODE (operands[
1]) == NE)"
2145 [(set (match_dup
4) (match_dup
5))
2146 (set (pc) (if_then_else (match_dup
6) (label_ref (match_dup
0)) (pc)))]
2148 { operands[
5] = gen_rtx (SIGN_EXTEND, DImode,
2149 gen_rtx (PLUS, SImode, operands[
2],
2150 GEN_INT (- INTVAL (operands[
3]))));
2151 operands[
6] = gen_rtx (GET_CODE (operands[
1]), VOIDmode,
2152 operands[
4], const0_rtx);
2155 ;; Here are the CALL and unconditional branch insns.
2157 (define_expand "call"
2158 [(parallel [(call (mem:DI (match_dup
2))
2159 (match_operand
1 "" ""))
2160 (use (match_operand:DI
0 "" ""))
2161 (clobber (reg:DI
26))])]
2164 { if (GET_CODE (operands[
0]) != MEM)
2166 operands[
0] = XEXP (operands[
0],
0);
2168 operands[
2] = gen_rtx (REG, DImode,
27);
2169 emit_move_insn (operands[
2], operands[
0]);
2171 if (GET_CODE (operands[
0]) != SYMBOL_REF)
2172 operands[
0] = const0_rtx;
2175 (define_expand "call_value"
2176 [(parallel [(set (match_operand
0 "" "")
2177 (call (mem:DI (match_dup
3))
2178 (match_operand
2 "" "")))
2179 (use (match_operand:DI
1 "" ""))
2180 (clobber (reg:DI
26))])]
2183 { if (GET_CODE (operands[
1]) != MEM)
2186 operands[
1] = XEXP (operands[
1],
0);
2188 operands[
3] = gen_rtx (REG, DImode,
27);
2189 emit_move_insn (operands[
3], operands[
1]);
2191 if (GET_CODE (operands[
1]) != SYMBOL_REF)
2192 operands[
1] = const0_rtx;
2196 [(call (mem:DI (reg:DI
27))
2197 (match_operand
0 "" ""))
2198 (use (match_operand:DI
1 "" ""))
2199 (clobber (reg:DI
26))]
2202 { if (alpha_gp_dead_after (insn))
2203 return
\"jsr $
26,($
27),%
1\";
2205 return
\"jsr $
26,($
27),%
1\;ldgp $
29,
0($
26)
\";
2207 [(set_attr "type" "jsr")])
2210 [(set (match_operand
0 "register_operand" "=rf")
2211 (call (mem:DI (reg:DI
27))
2212 (match_operand
1 "" "")))
2213 (use (match_operand:DI
2 "" ""))
2214 (clobber (reg:DI
26))]
2217 { if (alpha_gp_dead_after (insn))
2218 return
\"jsr $
26,($
27),%
2\";
2220 return
\"jsr $
26,($
27),%
2\;ldgp $
29,
0($
26)
\";
2222 [(set_attr "type" "jsr")])
2225 [(call (mem:DI (match_operand
1 "current_function_operand" "i"))
2226 (match_operand
0 "" ""))
2228 (clobber (reg:DI
26))]
2231 [(set_attr "type" "ibr")])
2234 [(set (match_operand
0 "register_operand" "=rf")
2235 (call (mem:DI (match_operand
1 "current_function_operand" "i"))
2236 (match_operand
2 "" "")))
2238 (clobber (reg:DI
26))]
2241 [(set_attr "type" "ibr")])
2245 (label_ref (match_operand
0 "" "")))]
2248 [(set_attr "type" "ibr")])
2250 (define_insn "return"
2254 [(set_attr "type" "ibr")])
2256 (define_insn "indirect_jump"
2257 [(set (pc) (match_operand:DI
0 "register_operand" "r"))]
2260 [(set_attr "type" "ibr")])
2266 [(set_attr "type" "iaddlog")])
2268 (define_expand "tablejump"
2270 (sign_extend:DI (match_operand:SI
0 "register_operand" "")))
2271 (parallel [(set (pc) (plus:DI (match_dup
3) (reg:DI
29)))
2272 (use (label_ref (match_operand
1 "" "")))
2273 (clobber (match_scratch:DI
2 "=r"))])]
2276 { operands[
3] = gen_reg_rtx (DImode); }")
2280 (plus:DI (match_operand:DI
0 "register_operand" "r")
2282 (use (label_ref (match_operand
1 "" "")))
2283 (clobber (match_scratch:DI
2 "=r"))]
2286 { rtx best_label =
0;
2287 rtx jump_table_insn = next_active_insn (operands[
1]);
2289 if (GET_CODE (jump_table_insn) == JUMP_INSN
2290 && GET_CODE (PATTERN (jump_table_insn)) == ADDR_VEC)
2292 rtx jump_table = PATTERN (jump_table_insn);
2293 int n_labels = XVECLEN (jump_table,
0);
2294 int best_count = -
1;
2297 for (i =
0; i < n_labels; i++)
2301 for (j = i +
1; j < n_labels; j++)
2302 if (XEXP (XVECEXP (jump_table,
0, i),
0)
2303 == XEXP (XVECEXP (jump_table,
0, j),
0))
2306 if (count > best_count)
2307 best_count = count, best_label = XVECEXP (jump_table,
0, i);
2313 operands[
3] = best_label;
2314 return
\"addq %
0,$
29,%
2\;jmp $
31,(%
2),%
3\";
2317 return
\"addq %
0,$
29,%
2\;jmp $
31,(%
2),
0\";
2319 [(set_attr "type" "ibr")])
2321 ;; Cache flush. Used by INITIALIZE_TRAMPOLINE.
0x86 is PAL_imb, but we don't
2322 ;; want to have to include pal.h in our .s file.
2324 [(unspec_volatile [(const_int
0)]
0)]
2328 ;; Finally, we have the basic data motion insns. The byte and word insns
2329 ;; are done via define_expand. Start with the floating-point insns, since
2330 ;; they are simpler.
2333 [(set (match_operand:SF
0 "nonimmediate_operand" "=r,r,m,f,f,f,m")
2334 (match_operand:SF
1 "input_operand" "r,m,rG,f,G,m,fG"))]
2335 "register_operand (operands[
0], SFmode)
2336 || reg_or_fp0_operand (operands[
1], SFmode)"
2345 [(set_attr "type" "iaddlog,ld,st,fpop,fpop,ld,st")])
2348 [(set (match_operand:DF
0 "nonimmediate_operand" "=r,r,m,f,f,f,m")
2349 (match_operand:DF
1 "input_operand" "r,m,rG,f,G,m,fG"))]
2350 "register_operand (operands[
0], DFmode)
2351 || reg_or_fp0_operand (operands[
1], DFmode)"
2360 [(set_attr "type" "iaddlog,ld,st,fpop,fpop,ld,st")])
2362 (define_expand "movsf"
2363 [(set (match_operand:SF
0 "nonimmediate_operand" "")
2364 (match_operand:SF
1 "general_operand" ""))]
2368 if (GET_CODE (operands[
0]) == MEM
2369 && ! reg_or_fp0_operand (operands[
1], SFmode))
2370 operands[
1] = force_reg (SFmode, operands[
1]);
2373 (define_expand "movdf"
2374 [(set (match_operand:DF
0 "nonimmediate_operand" "")
2375 (match_operand:DF
1 "general_operand" ""))]
2379 if (GET_CODE (operands[
0]) == MEM
2380 && ! reg_or_fp0_operand (operands[
1], DFmode))
2381 operands[
1] = force_reg (DFmode, operands[
1]);
2384 ;; There is a problem with
32-bit values in FP registers. We keep such
2385 ;; values in the register as a quadword. This is done on loads by using
2386 ;; the cvtlq instruction. On stores, we can't do anything directly from
2387 ;; floating-point registers. Disallow such an operation and let reload
2388 ;; use an integer register instead. Don't encourage
32-bit values to
2389 ;; be placed in FP registers at all.
2392 [(set (match_operand:SI
0 "nonimmediate_operand" "=r,r,r,r,r,r,m,*f,*f,*f")
2393 (match_operand:SI
1 "input_operand" "r,J,I,K,L,m,rJ,*f,J,m"))]
2394 "register_operand (operands[
0], SImode)
2395 || reg_or_0_operand (operands[
1], SImode)"
2406 lds %
0,%
1\;cvtlq %
0,%
0"
2407 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,iaddlog,ld,st,fpop,fpop,ld")])
2410 [(set (match_operand:HI
0 "nonimmediate_operand" "=r,r,r,r,f,f")
2411 (match_operand:HI
1 "input_operand" "r,J,I,n,f,J"))]
2412 "register_operand (operands[
0], HImode)
2413 || register_operand (operands[
1], HImode)"
2421 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,fpop,fpop")])
2424 [(set (match_operand:QI
0 "nonimmediate_operand" "=r,r,r,r,f,f")
2425 (match_operand:QI
1 "input_operand" "r,J,I,n,f,J"))]
2426 "register_operand (operands[
0], QImode)
2427 || register_operand (operands[
1], QImode)"
2435 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,fpop,fpop")])
2437 ;; We do two major things here: handle mem->mem and construct long
2440 (define_expand "movsi"
2441 [(set (match_operand:SI
0 "general_operand" "")
2442 (match_operand:SI
1 "general_operand" ""))]
2446 if (GET_CODE (operands[
0]) == MEM
2447 && ! reg_or_0_operand (operands[
1], SImode))
2448 operands[
1] = force_reg (SImode, operands[
1]);
2450 if (! CONSTANT_P (operands[
1]) || input_operand (operands[
1], SImode))
2452 else if (GET_CODE (operands[
1]) == CONST_INT)
2454 if (alpha_emit_set_const (operands[
0], INTVAL (operands[
1]),
3))
2461 ;; Split a load of a large constant into the appropriate two-insn
2465 [(set (match_operand:SI
0 "register_operand" "")
2466 (match_operand:SI
1 "const_int_operand" ""))]
2467 "! add_operand (operands[
1], SImode)"
2468 [(set (match_dup
0) (match_dup
2))
2469 (set (match_dup
0) (plus:SI (match_dup
0) (match_dup
3)))]
2471 { if (alpha_emit_set_const (operands[
0], INTVAL (operands[
1]),
2))
2478 [(set (match_operand:DI
0 "general_operand" "=r,r,r,r,r,r,r,m,f,f,f,m")
2479 (match_operand:DI
1 "input_operand" "r,J,I,K,L,s,m,rJ,f,J,m,fG"))]
2480 "register_operand (operands[
0], DImode)
2481 || reg_or_0_operand (operands[
1], DImode)"
2495 [(set_attr "type" "iaddlog,iaddlog,iaddlog,iaddlog,iaddlog,ldsym,ld,st,fpop,fpop,ld,st")])
2497 ;; We do three major things here: handle mem->mem, put
64-bit constants in
2498 ;; memory, and construct long
32-bit constants.
2500 (define_expand "movdi"
2501 [(set (match_operand:DI
0 "general_operand" "")
2502 (match_operand:DI
1 "general_operand" ""))]
2506 if (GET_CODE (operands[
0]) == MEM
2507 && ! reg_or_0_operand (operands[
1], DImode))
2508 operands[
1] = force_reg (DImode, operands[
1]);
2510 if (! CONSTANT_P (operands[
1]) || input_operand (operands[
1], DImode))
2512 else if (GET_CODE (operands[
1]) == CONST_INT
2513 && alpha_emit_set_const (operands[
0], INTVAL (operands[
1]),
3))
2515 else if (CONSTANT_P (operands[
1]))
2517 operands[
1] = force_const_mem (DImode, operands[
1]);
2518 if (reload_in_progress)
2520 emit_move_insn (operands[
0], XEXP (operands[
1],
0));
2521 XEXP (operands[
1],
0) = operands[
0];
2524 operands[
1] = validize_mem (operands[
1]);
2530 ;; Split a load of a large constant into the appropriate two-insn
2534 [(set (match_operand:DI
0 "register_operand" "")
2535 (match_operand:DI
1 "const_int_operand" ""))]
2536 "! add_operand (operands[
1], DImode)"
2537 [(set (match_dup
0) (match_dup
2))
2538 (set (match_dup
0) (plus:DI (match_dup
0) (match_dup
3)))]
2540 { if (alpha_emit_set_const (operands[
0], INTVAL (operands[
1]),
2))
2546 ;; These are the partial-word cases.
2548 ;; First we have the code to load an aligned word. Operand
0 is the register
2549 ;; in which to place the result. It's mode is QImode or HImode. Operand
1
2550 ;; is an SImode MEM at the low-order byte of the proper word. Operand
2 is the
2551 ;; number of bits within the word that the value is. Operand
3 is an SImode
2552 ;; scratch register. If operand
0 is a hard register, operand
3 may be the
2553 ;; same register. It is allowed to conflict with operand
1 as well.
2555 (define_expand "aligned_loadqi"
2556 [(set (match_operand:SI
3 "register_operand" "")
2557 (match_operand:SI
1 "memory_operand" ""))
2558 (set (subreg:DI (match_operand:QI
0 "register_operand" "")
0)
2559 (zero_extract:DI (subreg:DI (match_dup
3)
0)
2561 (match_operand:DI
2 "const_int_operand" "")))]
2566 (define_expand "aligned_loadhi"
2567 [(set (match_operand:SI
3 "register_operand" "")
2568 (match_operand:SI
1 "memory_operand" ""))
2569 (set (subreg:DI (match_operand:HI
0 "register_operand" "")
0)
2570 (zero_extract:DI (subreg:DI (match_dup
3)
0)
2572 (match_operand:DI
2 "const_int_operand" "")))]
2577 ;; Similar for unaligned loads. For QImode, we use the sequence from the
2578 ;; Alpha Architecture manual. However, for HImode, we do not. HImode pointers
2579 ;; are normally aligned to the byte boundary, so an HImode object cannot
2580 ;; cross a longword boundary. We could use a sequence similar to that for
2581 ;; QImode, but that would fail if the pointer, was, in fact, not aligned.
2582 ;; Instead, we clear bit
1 in the address and do an ldl. If the low-order
2583 ;; bit was not aligned, this will trap and the trap handler will do what is
2586 ;; Here operand
1 is the address. Operands
2 and
3 are temporaries, where
2587 ;; operand
3 can overlap the input and output registers.
2589 (define_expand "unaligned_loadqi"
2590 [(set (match_operand:DI
2 "register_operand" "")
2591 (mem:DI (and:DI (match_operand:DI
1 "address_operand" "")
2593 (set (match_operand:DI
3 "register_operand" "")
2595 (set (subreg:DI (match_operand:QI
0 "register_operand" "")
0)
2596 (zero_extract:DI (match_dup
2)
2598 (ashift:DI (match_dup
3) (const_int
3))))]
2602 ;; For this, the address must already be in a register. We also need two
2603 ;; DImode temporaries, neither of which may overlap the input (and hence the
2604 ;; output, since they might be the same register), but both of which may
2607 (define_expand "unaligned_loadhi"
2608 [(set (match_operand:DI
2 "register_operand" "")
2609 (and:DI (match_operand:DI
1 "register_operand" "")
2611 (set (match_operand:DI
3 "register_operand" "")
2612 (mem:DI (match_dup
2)))
2613 (set (subreg:DI (match_operand:HI
0 "register_operand" "")
0)
2614 (zero_extract:DI (match_dup
3)
2616 (ashift:DI (match_dup
1) (const_int
3))))]
2620 ;; Storing an aligned byte or word requires two temporaries. Operand
0 is the
2621 ;; aligned SImode MEM. Operand
1 is the register containing the
2622 ;; byte or word to store. Operand
2 is the number of bits within the word that
2623 ;; the value should be placed. Operands
3 and
4 are SImode temporaries.
2625 (define_expand "aligned_store"
2626 [(set (match_operand:SI
3 "register_operand" "")
2627 (match_operand:SI
0 "memory_operand" ""))
2628 (set (subreg:DI (match_dup
3)
0)
2629 (and:DI (subreg:DI (match_dup
3)
0) (match_dup
5)))
2630 (set (subreg:DI (match_operand:SI
4 "register_operand" "")
0)
2631 (ashift:DI (zero_extend:DI (match_operand
1 "register_operand" ""))
2632 (match_operand:DI
2 "const_int_operand" "")))
2633 (set (subreg:DI (match_dup
4)
0)
2634 (ior:DI (subreg:DI (match_dup
4)
0) (subreg:DI (match_dup
3)
0)))
2635 (set (match_dup
0) (match_dup
4))]
2638 { operands[
5] = GEN_INT (~ (GET_MODE_MASK (GET_MODE (operands[
1]))
2639 << INTVAL (operands[
2])));
2642 ;; For the unaligned byte case, we use code similar to that in the
2643 ;; Architecture book, but reordered to lower the number of registers
2644 ;; required. Operand
0 is the address. Operand
1 is the data to store.
2645 ;; Operands
2,
3, and
4 are DImode temporaries, where the last two may
2646 ;; be the same temporary, if desired. If the address is in a register,
2647 ;; operand
2 can be that register.
2649 (define_expand "unaligned_storeqi"
2650 [(set (match_operand:DI
3 "register_operand" "")
2651 (mem:DI (and:DI (match_operand:DI
0 "address_operand" "")
2653 (set (match_operand:DI
2 "register_operand" "")
2656 (and:DI (ashift:DI (const_int
255)
2657 (ashift:DI (match_dup
2) (const_int
3)))
2659 (set (match_operand:DI
4 "register_operand" "")
2660 (ashift:DI (zero_extend:DI (match_operand:QI
1 "register_operand" ""))
2661 (ashift:DI (match_dup
2) (const_int
3))))
2662 (set (match_dup
4) (ior:DI (match_dup
4) (match_dup
3)))
2663 (set (mem:DI (and:DI (match_dup
0) (const_int -
8)))
2668 ;; This is the code for storing into an unaligned short. It uses the same
2669 ;; trick as loading from an unaligned short. It needs lots of temporaries.
2670 ;; However, during reload, we only have two registers available. So we
2671 ;; repeat code so that only two temporaries are available. During RTL
2672 ;; generation, we can use different pseudos for each temporary and CSE
2673 ;; will remove the redundancies. During reload, we have to settle with
2674 ;; what we get. Luckily, unaligned accesses of this kind produced during
2675 ;; reload are quite rare.
2677 ;; Operand
0 is the address of the memory location. Operand
1 contains the
2678 ;; data to store. The rest of the operands are all temporaries, with
2679 ;; various overlap possibilities during reload. See reload_outhi for
2680 ;; details of this use.
2682 (define_expand "unaligned_storehi"
2683 [(set (match_operand:DI
2 "register_operand" "")
2684 (match_operand:DI
0 "address_operand" ""))
2685 (set (match_operand:DI
3 "register_operand" "")
2686 (and:DI (match_dup
2) (const_int -
7)))
2687 (set (match_operand:DI
4 "register_operand" "")
2688 (mem:DI (match_dup
3)))
2689 (set (match_operand:DI
5 "register_operand" "")
2690 (and:DI (ashift:DI (const_int
65535)
2691 (ashift:DI (match_dup
2) (const_int
3)))
2693 (set (match_operand:DI
6 "register_operand" "")
2694 (ashift:DI (zero_extend:DI (match_operand:HI
1 "register_operand" ""))
2695 (ashift:DI (match_dup
2) (const_int
3))))
2696 (set (match_operand:DI
7 "register_operand" "")
2697 (ior:DI (match_dup
5) (match_dup
6)))
2698 (set (match_operand:DI
8 "register_operand" "") (match_dup
0))
2699 (set (match_operand:DI
9 "register_operand" "")
2700 (and:DI (match_dup
8) (const_int -
7)))
2701 (set (mem:DI (match_dup
9)) (match_dup
7))]
2705 ;; Here are the define_expand's for QI and HI moves that use the above
2706 ;; patterns. We have the normal sets, plus the ones that need scratch
2707 ;; registers for reload.
2709 (define_expand "movqi"
2710 [(set (match_operand:QI
0 "general_operand" "")
2711 (match_operand:QI
1 "general_operand" ""))]
2714 { extern rtx get_unaligned_address ();
2716 /* If the output is not a register, the input must be. */
2717 if (GET_CODE (operands[
0]) == MEM)
2718 operands[
1] = force_reg (QImode, operands[
1]);
2720 /* Handle four memory cases, unaligned and aligned for either the input
2721 or the output. The only case where we can be called during reload is
2722 for aligned loads; all other cases require temporaries. */
2724 if (GET_CODE (operands[
1]) == MEM
2725 || (GET_CODE (operands[
1]) == SUBREG
2726 && GET_CODE (SUBREG_REG (operands[
1])) == MEM)
2727 || (reload_in_progress && GET_CODE (operands[
1]) == REG
2728 && REGNO (operands[
1]) >= FIRST_PSEUDO_REGISTER)
2729 || (reload_in_progress && GET_CODE (operands[
1]) == SUBREG
2730 && GET_CODE (SUBREG_REG (operands[
1])) == REG
2731 && REGNO (SUBREG_REG (operands[
1])) >= FIRST_PSEUDO_REGISTER))
2733 if (aligned_memory_operand (operands[
1], QImode))
2735 rtx aligned_mem, bitnum;
2736 rtx scratch = (reload_in_progress
2737 ? gen_rtx (REG, SImode, REGNO (operands[
0]))
2738 : gen_reg_rtx (SImode));
2740 get_aligned_mem (operands[
1], &aligned_mem, &bitnum);
2742 emit_insn (gen_aligned_loadqi (operands[
0], aligned_mem, bitnum,
2747 /* Don't pass these as parameters since that makes the generated
2748 code depend on parameter evaluation order which will cause
2749 bootstrap failures. */
2751 rtx temp1 = gen_reg_rtx (DImode);
2752 rtx temp2 = gen_reg_rtx (DImode);
2753 rtx seq = gen_unaligned_loadqi (operands[
0],
2754 get_unaligned_address (operands[
1]),
2757 alpha_set_memflags (seq, operands[
1]);
2764 else if (GET_CODE (operands[
0]) == MEM
2765 || (GET_CODE (operands[
0]) == SUBREG
2766 && GET_CODE (SUBREG_REG (operands[
0])) == MEM)
2767 || (reload_in_progress && GET_CODE (operands[
0]) == REG
2768 && REGNO (operands[
0]) >= FIRST_PSEUDO_REGISTER)
2769 || (reload_in_progress && GET_CODE (operands[
0]) == SUBREG
2770 && GET_CODE (SUBREG_REG (operands[
0])) == REG
2771 && REGNO (operands[
0]) >= FIRST_PSEUDO_REGISTER))
2773 if (aligned_memory_operand (operands[
0], QImode))
2775 rtx aligned_mem, bitnum;
2776 rtx temp1 = gen_reg_rtx (SImode);
2777 rtx temp2 = gen_reg_rtx (SImode);
2779 get_aligned_mem (operands[
0], &aligned_mem, &bitnum);
2781 emit_insn (gen_aligned_store (aligned_mem, operands[
1], bitnum,
2786 rtx temp1 = gen_reg_rtx (DImode);
2787 rtx temp2 = gen_reg_rtx (DImode);
2788 rtx temp3 = gen_reg_rtx (DImode);
2789 rtx seq = gen_unaligned_storeqi (get_unaligned_address (operands[
0]),
2790 operands[
1], temp1, temp2, temp3);
2792 alpha_set_memflags (seq, operands[
0]);
2799 (define_expand "movhi"
2800 [(set (match_operand:HI
0 "general_operand" "")
2801 (match_operand:HI
1 "general_operand" ""))]
2804 { extern rtx get_unaligned_address ();
2806 /* If the output is not a register, the input must be. */
2807 if (GET_CODE (operands[
0]) == MEM)
2808 operands[
1] = force_reg (HImode, operands[
1]);
2810 /* Handle four memory cases, unaligned and aligned for either the input
2811 or the output. The only case where we can be called during reload is
2812 for aligned loads; all other cases require temporaries. */
2814 if (GET_CODE (operands[
1]) == MEM
2815 || (GET_CODE (operands[
1]) == SUBREG
2816 && GET_CODE (SUBREG_REG (operands[
1])) == MEM)
2817 || (reload_in_progress && GET_CODE (operands[
1]) == REG
2818 && REGNO (operands[
1]) >= FIRST_PSEUDO_REGISTER)
2819 || (reload_in_progress && GET_CODE (operands[
1]) == SUBREG
2820 && GET_CODE (SUBREG_REG (operands[
1])) == REG
2821 && REGNO (SUBREG_REG (operands[
1])) >= FIRST_PSEUDO_REGISTER))
2823 if (aligned_memory_operand (operands[
1], HImode))
2825 rtx aligned_mem, bitnum;
2826 rtx scratch = (reload_in_progress
2827 ? gen_rtx (REG, SImode, REGNO (operands[
0]))
2828 : gen_reg_rtx (SImode));
2830 get_aligned_mem (operands[
1], &aligned_mem, &bitnum);
2832 emit_insn (gen_aligned_loadhi (operands[
0], aligned_mem, bitnum,
2838 = force_reg (DImode,
2839 force_operand (get_unaligned_address (operands[
1]),
2841 rtx scratch1 = gen_reg_rtx (DImode);
2842 rtx scratch2 = gen_reg_rtx (DImode);
2843 rtx seq = gen_unaligned_loadhi (operands[
0], addr, scratch1,
2846 alpha_set_memflags (seq, operands[
1]);
2853 else if (GET_CODE (operands[
0]) == MEM
2854 || (GET_CODE (operands[
0]) == SUBREG
2855 && GET_CODE (SUBREG_REG (operands[
0])) == MEM)
2856 || (reload_in_progress && GET_CODE (operands[
0]) == REG
2857 && REGNO (operands[
0]) >= FIRST_PSEUDO_REGISTER)
2858 || (reload_in_progress && GET_CODE (operands[
0]) == SUBREG
2859 && GET_CODE (SUBREG_REG (operands[
0])) == REG
2860 && REGNO (operands[
0]) >= FIRST_PSEUDO_REGISTER))
2862 if (aligned_memory_operand (operands[
0], HImode))
2864 rtx aligned_mem, bitnum;
2865 rtx temp1 = gen_reg_rtx (SImode);
2866 rtx temp2 = gen_reg_rtx (SImode);
2868 get_aligned_mem (operands[
0], &aligned_mem, &bitnum);
2870 emit_insn (gen_aligned_store (aligned_mem, operands[
1], bitnum,
2875 rtx temp1 = gen_reg_rtx (DImode);
2876 rtx temp2 = gen_reg_rtx (DImode);
2877 rtx temp3 = gen_reg_rtx (DImode);
2878 rtx temp4 = gen_reg_rtx (DImode);
2879 rtx temp5 = gen_reg_rtx (DImode);
2880 rtx temp6 = gen_reg_rtx (DImode);
2881 rtx temp7 = gen_reg_rtx (DImode);
2882 rtx temp8 = gen_reg_rtx (DImode);
2883 rtx seq = gen_unaligned_storehi (get_unaligned_address (operands[
0]),
2884 operands[
1], temp1, temp2,temp3,
2885 temp4, temp5, temp6,temp7, temp8);
2887 alpha_set_memflags (seq, operands[
0]);
2895 ;; Here are the versions for reload. Note that in the unaligned cases
2896 ;; we know that the operand must not be a pseudo-register because stack
2897 ;; slots are always aligned references.
2899 (define_expand "reload_inqi"
2900 [(parallel [(match_operand:QI
0 "register_operand" "=r")
2901 (match_operand:QI
1 "unaligned_memory_operand" "m")
2902 (match_operand:DI
2 "register_operand" "=&r")])]
2905 { extern rtx get_unaligned_address ();
2906 rtx addr = get_unaligned_address (operands[
1]);
2907 rtx seq = gen_unaligned_loadqi (operands[
0], addr, operands[
2],
2908 gen_rtx (REG, DImode, REGNO (operands[
0])));
2910 alpha_set_memflags (seq, operands[
1]);
2915 (define_expand "reload_inhi"
2916 [(parallel [(match_operand:HI
0 "register_operand" "=r")
2917 (match_operand:HI
1 "unaligned_memory_operand" "m")
2918 (match_operand:TI
2 "register_operand" "=&r")])]
2921 { extern rtx get_unaligned_address ();
2922 rtx addr = get_unaligned_address (operands[
1]);
2923 rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[
2]));
2924 rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[
2]) +
1);
2927 if (GET_CODE (addr) != REG)
2929 emit_insn (gen_rtx (SET, VOIDmode, scratch2, addr));
2933 seq = gen_unaligned_loadhi (operands[
0], addr, scratch1, scratch1);
2934 alpha_set_memflags (seq, operands[
1]);
2939 (define_expand "reload_outqi"
2940 [(parallel [(match_operand:QI
0 "any_memory_operand" "=m")
2941 (match_operand:QI
1 "register_operand" "r")
2942 (match_operand:TI
2 "register_operand" "=&r")])]
2945 { extern rtx get_unaligned_address ();
2947 if (aligned_memory_operand (operands[
0], QImode))
2949 rtx aligned_mem, bitnum;
2951 get_aligned_mem (operands[
0], &aligned_mem, &bitnum);
2953 emit_insn (gen_aligned_store (aligned_mem, operands[
1], bitnum,
2954 gen_rtx (REG, SImode, REGNO (operands[
2])),
2955 gen_rtx (REG, SImode,
2956 REGNO (operands[
2]) +
1)));
2960 rtx addr = get_unaligned_address (operands[
0]);
2961 rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[
2]));
2962 rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[
2]) +
1);
2965 if (GET_CODE (addr) == REG)
2968 seq = gen_unaligned_storeqi (addr, operands[
1], scratch1,
2969 scratch2, scratch2);
2970 alpha_set_memflags (seq, operands[
0]);
2977 (define_expand "reload_outhi"
2978 [(parallel [(match_operand:HI
0 "any_memory_operand" "=m")
2979 (match_operand:HI
1 "register_operand" "r")
2980 (match_operand:TI
2 "register_operand" "=&r")])]
2983 { extern rtx get_unaligned_address ();
2985 if (aligned_memory_operand (operands[
0], HImode))
2987 rtx aligned_mem, bitnum;
2989 get_aligned_mem (operands[
0], &aligned_mem, &bitnum);
2991 emit_insn (gen_aligned_store (aligned_mem, operands[
1], bitnum,
2992 gen_rtx (REG, SImode, REGNO (operands[
2])),
2993 gen_rtx (REG, SImode,
2994 REGNO (operands[
2]) +
1)));
2998 rtx addr = get_unaligned_address (operands[
0]);
2999 rtx scratch1 = gen_rtx (REG, DImode, REGNO (operands[
2]));
3000 rtx scratch2 = gen_rtx (REG, DImode, REGNO (operands[
2]) +
1);
3001 rtx scratch_a = GET_CODE (addr) == REG ? addr : scratch1;
3004 seq = gen_unaligned_storehi (addr, operands[
1], scratch_a,
3005 scratch2, scratch2, scratch2,
3006 scratch1, scratch2, scratch_a,
3008 alpha_set_memflags (seq, operands[
0]);
3015 ;;- Local variables:
3017 ;;- comment-start: ";;- "
3018 ;;- eval: (set-syntax-table (copy-sequence (syntax-table)))
3019 ;;- eval: (modify-syntax-entry ?[ "(]")
3020 ;;- eval: (modify-syntax-entry ?] ")[")
3021 ;;- eval: (modify-syntax-entry ?{ "(}")
3022 ;;- eval: (modify-syntax-entry ?} "){")