1 ;; Machine description for GNU compiler, VAX Version
2 ;; Copyright (C) 1987, 1988, 1991, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
3 ;; 2002, 2004, 2005 Free Software Foundation, Inc.
5 ;; This file is part of GCC.
7 ;; GCC 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 ;; GCC 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 GCC; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 ;; Boston, MA 02110-1301, USA.
23 ;;- Instruction patterns. When multiple patterns apply,
24 ;;- the first one in the file is chosen.
26 ;;- See file "rtl.def" for documentation on define_insn, match_*, et al.
28 ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
29 ;;- updates for most instructions.
31 ;; UNSPEC_VOLATILE usage:
34 [(VUNSPEC_BLOCKAGE 0) ; `blockage' insn to prevent scheduling across an
36 (VUNSPEC_SYNC_ISTREAM 1) ; sequence of insns to sync the I-stream
37 (VAX_AP_REGNUM 12) ; Register 12 contains the argument pointer
38 (VAX_FP_REGNUM 13) ; Register 13 contains the frame pointer
39 (VAX_SP_REGNUM 14) ; Register 14 contains the stack pointer
40 (VAX_PC_REGNUM 15) ; Register 15 contains the program counter
44 ;; Integer modes supported on VAX, with a mapping from machine mode
45 ;; to mnemonic suffix. DImode is always a special case.
46 (define_mode_macro VAXint [QI HI SI])
47 (define_mode_attr isfx [(QI "b") (HI "w") (SI "l")])
49 ;; Similar for float modes supported on VAX.
50 (define_mode_macro VAXfp [SF DF])
51 (define_mode_attr fsfx [(SF "f") (DF "%#")])
53 ;; Some output patterns want integer immediates with a prefix...
54 (define_mode_attr iprefx [(QI "B") (HI "H") (SI "N")])
56 ;; We don't want to allow a constant operand for test insns because
57 ;; (set (cc0) (const_int foo)) has no mode information. Such insns will
58 ;; be folded while optimizing anyway.
60 (define_insn "tst<mode>"
62 (match_operand:VAXint 0 "nonimmediate_operand" "g"))]
64 "tst<VAXint:isfx> %0")
66 (define_insn "tst<mode>"
68 (match_operand:VAXfp 0 "general_operand" "gF"))]
72 (define_insn "cmp<mode>"
74 (compare (match_operand:VAXint 0 "nonimmediate_operand" "g")
75 (match_operand:VAXint 1 "general_operand" "g")))]
77 "cmp<VAXint:isfx> %0,%1")
79 (define_insn "cmp<mode>"
81 (compare (match_operand:VAXfp 0 "general_operand" "gF,gF")
82 (match_operand:VAXfp 1 "general_operand" "G,gF")))]
86 cmp<VAXfp:fsfx> %0,%1")
88 (define_insn "*bit<mode>"
90 (and:VAXint (match_operand:VAXint 0 "general_operand" "g")
91 (match_operand:VAXint 1 "general_operand" "g")))]
93 "bit<VAXint:isfx> %0,%1")
95 ;; The VAX has no sCOND insns. It does have add/subtract with carry
96 ;; which could be used to implement the sltu and sgeu patterns. However,
97 ;; to do this properly requires a complete rewrite of the compare insns
98 ;; to keep them together with the sltu/sgeu insns until after the
99 ;; reload pass is complete. The previous implementation didn't do this
100 ;; and has been deleted.
103 (define_insn "mov<mode>"
104 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g")
105 (match_operand:VAXfp 1 "general_operand" "G,gF"))]
109 mov<VAXfp:fsfx> %1,%0")
111 ;; Some VAXen don't support this instruction.
112 ;;(define_insn "movti"
113 ;; [(set (match_operand:TI 0 "general_operand" "=g")
114 ;; (match_operand:TI 1 "general_operand" "g"))]
119 [(set (match_operand:DI 0 "nonimmediate_operand" "=g,g")
120 (match_operand:DI 1 "general_operand" "I,g"))]
126 ;; The VAX move instructions have space-time tradeoffs. On a MicroVAX
127 ;; register-register mov instructions take 3 bytes and 2 CPU cycles. clrl
128 ;; takes 2 bytes and 3 cycles. mov from constant to register takes 2 cycles
129 ;; if the constant is smaller than 4 bytes, 3 cycles for a longword
130 ;; constant. movz, mneg, and mcom are as fast as mov, so movzwl is faster
131 ;; than movl for positive constants that fit in 16 bits but not 6 bits. cvt
132 ;; instructions take 4 cycles. inc takes 3 cycles. The machine description
133 ;; is willing to trade 1 byte for 1 cycle (clrl instead of movl $0; cvtwl
136 ;; Cycle counts for other models may vary (on a VAX 750 they are similar,
137 ;; but on a VAX 9000 most move and add instructions with one constant
138 ;; operand take 1 cycle).
140 ;; Loads of constants between 64 and 128 used to be done with
141 ;; "addl3 $63,#,dst" but this is slower than movzbl and takes as much space.
143 (define_insn "mov<mode>"
144 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
145 (match_operand:VAXint 1 "general_operand" "g"))]
147 "* return vax_output_int_move (insn, operands, <MODE>mode);")
149 (define_insn "movstricthi"
150 [(set (strict_low_part (match_operand:HI 0 "register_operand" "+g"))
151 (match_operand:HI 1 "general_operand" "g"))]
155 if (GET_CODE (operands[1]) == CONST_INT)
157 int i = INTVAL (operands[1]);
160 else if ((unsigned int)i < 64)
161 return \"movw %1,%0\";
162 else if ((unsigned int)~i < 64)
163 return \"mcomw %H1,%0\";
164 else if ((unsigned int)i < 256)
165 return \"movzbw %1,%0\";
167 return \"movw %1,%0\";
170 (define_insn "movstrictqi"
171 [(set (strict_low_part (match_operand:QI 0 "register_operand" "+g"))
172 (match_operand:QI 1 "general_operand" "g"))]
176 if (GET_CODE (operands[1]) == CONST_INT)
178 int i = INTVAL (operands[1]);
181 else if ((unsigned int)~i < 64)
182 return \"mcomb %B1,%0\";
184 return \"movb %1,%0\";
187 ;; This is here to accept 4 arguments and pass the first 3 along
188 ;; to the movmemhi1 pattern that really does the work.
189 (define_expand "movmemhi"
190 [(set (match_operand:BLK 0 "general_operand" "=g")
191 (match_operand:BLK 1 "general_operand" "g"))
192 (use (match_operand:HI 2 "general_operand" "g"))
193 (match_operand 3 "" "")]
196 emit_insn (gen_movmemhi1 (operands[0], operands[1], operands[2]));
200 ;; The definition of this insn does not really explain what it does,
201 ;; but it should suffice
202 ;; that anything generated as this insn will be recognized as one
203 ;; and that it won't successfully combine with anything.
204 (define_insn "movmemhi1"
205 [(set (match_operand:BLK 0 "memory_operand" "=m")
206 (match_operand:BLK 1 "memory_operand" "m"))
207 (use (match_operand:HI 2 "general_operand" "g"))
213 (clobber (reg:SI 5))]
217 ;; Extension and truncation insns.
219 (define_insn "truncsiqi2"
220 [(set (match_operand:QI 0 "nonimmediate_operand" "=g")
221 (truncate:QI (match_operand:SI 1 "nonimmediate_operand" "g")))]
225 (define_insn "truncsihi2"
226 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
227 (truncate:HI (match_operand:SI 1 "nonimmediate_operand" "g")))]
231 (define_insn "trunchiqi2"
232 [(set (match_operand:QI 0 "nonimmediate_operand" "=g")
233 (truncate:QI (match_operand:HI 1 "nonimmediate_operand" "g")))]
237 (define_insn "extendhisi2"
238 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
239 (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))]
243 (define_insn "extendqihi2"
244 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
245 (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))]
249 (define_insn "extendqisi2"
250 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
251 (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))]
255 (define_insn "extendsfdf2"
256 [(set (match_operand:DF 0 "nonimmediate_operand" "=g")
257 (float_extend:DF (match_operand:SF 1 "general_operand" "gF")))]
261 (define_insn "truncdfsf2"
262 [(set (match_operand:SF 0 "nonimmediate_operand" "=g")
263 (float_truncate:SF (match_operand:DF 1 "general_operand" "gF")))]
267 (define_insn "zero_extendhisi2"
268 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
269 (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))]
273 (define_insn "zero_extendqihi2"
274 [(set (match_operand:HI 0 "nonimmediate_operand" "=g")
275 (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))]
279 (define_insn "zero_extendqisi2"
280 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
281 (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))]
285 ;; Fix-to-float conversion insns.
287 (define_insn "float<VAXint:mode><VAXfp:mode>2"
288 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g")
289 (float:VAXfp (match_operand:VAXint 1 "nonimmediate_operand" "g")))]
291 "cvt<VAXint:isfx><VAXfp:fsfx> %1,%0")
293 ;; Float-to-fix conversion insns.
295 (define_insn "fix_trunc<VAXfp:mode><VAXint:mode>2"
296 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
297 (fix:VAXint (fix:VAXfp (match_operand:VAXfp 1 "general_operand" "gF"))))]
299 "cvt<VAXfp:fsfx><VAXint:isfx> %1,%0")
301 ;;- All kinds of add instructions.
303 (define_insn "add<mode>3"
304 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g")
305 (plus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF")
306 (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))]
309 add<VAXfp:fsfx>2 %2,%0
310 add<VAXfp:fsfx>2 %1,%0
311 add<VAXfp:fsfx>3 %1,%2,%0")
313 (define_insn "add<mode>3"
314 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
315 (plus:VAXint (match_operand:VAXint 1 "general_operand" "g")
316 (match_operand:VAXint 2 "general_operand" "g")))]
318 "* return vax_output_int_add (insn, operands, <MODE>mode);")
320 ;; The add-with-carry (adwc) instruction only accepts two operands.
321 (define_insn "adddi3"
322 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro>,ro>")
323 (plus:DI (match_operand:DI 1 "general_operand" "%0,ro>")
324 (match_operand:DI 2 "general_operand" "Fro,F")))]
332 split_quadword_operands (operands, low, 3);
334 if (rtx_equal_p (operands[0], operands[1]))
336 if (low[2] == const0_rtx)
337 /* Should examine operand, punt if not POST_INC. */
338 pattern = \"tstl %0\", carry = 0;
339 else if (low[2] == const1_rtx)
340 pattern = \"incl %0\";
342 pattern = \"addl2 %2,%0\";
346 if (low[2] == const0_rtx)
347 pattern = \"movl %1,%0\", carry = 0;
349 pattern = \"addl3 %2,%1,%0\";
352 output_asm_insn (pattern, low);
354 /* If CARRY is 0, we don't have any carry value to worry about. */
355 return get_insn_template (CODE_FOR_addsi3, insn);
356 /* %0 = C + %1 + %2 */
357 if (!rtx_equal_p (operands[0], operands[1]))
358 output_asm_insn ((operands[1] == const0_rtx
360 : \"movl %1,%0\"), operands);
361 return \"adwc %2,%0\";
364 ;;- All kinds of subtract instructions.
366 (define_insn "sub<mode>3"
367 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g")
368 (minus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF")
369 (match_operand:VAXfp 2 "general_operand" "gF,gF")))]
372 sub<VAXfp:fsfx>2 %2,%0
373 sub<VAXfp:fsfx>3 %2,%1,%0")
375 (define_insn "sub<mode>3"
376 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g")
377 (minus:VAXint (match_operand:VAXint 1 "general_operand" "0,g")
378 (match_operand:VAXint 2 "general_operand" "g,g")))]
381 sub<VAXint:isfx>2 %2,%0
382 sub<VAXint:isfx>3 %2,%1,%0")
384 ;; The subtract-with-carry (sbwc) instruction only takes two operands.
385 (define_insn "subdi3"
386 [(set (match_operand:DI 0 "nonimmediate_operand" "=or>,or>")
387 (minus:DI (match_operand:DI 1 "general_operand" "0,or>")
388 (match_operand:DI 2 "general_operand" "For,F")))]
396 split_quadword_operands (operands, low, 3);
397 /* Subtract low parts. */
398 if (rtx_equal_p (operands[0], operands[1]))
400 if (low[2] == const0_rtx)
401 pattern = 0, carry = 0;
402 else if (low[2] == constm1_rtx)
403 pattern = \"decl %0\";
405 pattern = \"subl2 %2,%0\";
409 if (low[2] == constm1_rtx)
410 pattern = \"decl %0\";
411 else if (low[2] == const0_rtx)
412 pattern = get_insn_template (CODE_FOR_movsi, insn), carry = 0;
414 pattern = \"subl3 %2,%1,%0\";
417 output_asm_insn (pattern, low);
420 if (!rtx_equal_p (operands[0], operands[1]))
421 return \"movl %1,%0\;sbwc %2,%0\";
422 return \"sbwc %2,%0\";
423 /* %0 = %2 - %1 - C */
425 return get_insn_template (CODE_FOR_subsi3, insn);
428 ;;- Multiply instructions.
430 (define_insn "mul<mode>3"
431 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g")
432 (mult:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF")
433 (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))]
436 mul<VAXfp:fsfx>2 %2,%0
437 mul<VAXfp:fsfx>2 %1,%0
438 mul<VAXfp:fsfx>3 %1,%2,%0")
440 (define_insn "mul<mode>3"
441 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g")
442 (mult:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g")
443 (match_operand:VAXint 2 "general_operand" "g,0,g")))]
446 mul<VAXint:isfx>2 %2,%0
447 mul<VAXint:isfx>2 %1,%0
448 mul<VAXint:isfx>3 %1,%2,%0")
450 (define_insn "mulsidi3"
451 [(set (match_operand:DI 0 "nonimmediate_operand" "=g")
452 (mult:DI (sign_extend:DI
453 (match_operand:SI 1 "nonimmediate_operand" "g"))
455 (match_operand:SI 2 "nonimmediate_operand" "g"))))]
460 [(set (match_operand:DI 0 "nonimmediate_operand" "=g")
462 (mult:DI (sign_extend:DI
463 (match_operand:SI 1 "nonimmediate_operand" "g"))
465 (match_operand:SI 2 "nonimmediate_operand" "g")))
466 (sign_extend:DI (match_operand:SI 3 "nonimmediate_operand" "g"))))]
470 ;; 'F' constraint means type CONST_DOUBLE
472 [(set (match_operand:DI 0 "nonimmediate_operand" "=g")
474 (mult:DI (sign_extend:DI
475 (match_operand:SI 1 "nonimmediate_operand" "g"))
477 (match_operand:SI 2 "nonimmediate_operand" "g")))
478 (match_operand:DI 3 "immediate_operand" "F")))]
479 "GET_CODE (operands[3]) == CONST_DOUBLE
480 && CONST_DOUBLE_HIGH (operands[3]) == (CONST_DOUBLE_LOW (operands[3]) >> 31)"
483 if (CONST_DOUBLE_HIGH (operands[3]))
484 operands[3] = GEN_INT (CONST_DOUBLE_LOW (operands[3]));
485 return \"emul %1,%2,%3,%0\";
488 ;;- Divide instructions.
490 (define_insn "div<mode>3"
491 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g")
492 (div:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF")
493 (match_operand:VAXfp 2 "general_operand" "gF,gF")))]
496 div<VAXfp:fsfx>2 %2,%0
497 div<VAXfp:fsfx>3 %2,%1,%0")
499 (define_insn "div<mode>3"
500 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g")
501 (div:VAXint (match_operand:VAXint 1 "general_operand" "0,g")
502 (match_operand:VAXint 2 "general_operand" "g,g")))]
505 div<VAXint:isfx>2 %2,%0
506 div<VAXint:isfx>3 %2,%1,%0")
508 ;This is left out because it is very slow;
509 ;we are better off programming around the "lack" of this insn.
510 ;(define_insn "divmoddisi4"
511 ; [(set (match_operand:SI 0 "general_operand" "=g")
512 ; (div:SI (match_operand:DI 1 "general_operand" "g")
513 ; (match_operand:SI 2 "general_operand" "g")))
514 ; (set (match_operand:SI 3 "general_operand" "=g")
515 ; (mod:SI (match_operand:DI 1 "general_operand" "g")
516 ; (match_operand:SI 2 "general_operand" "g")))]
518 ; "ediv %2,%1,%0,%3")
520 ;; Bit-and on the VAX is done with a clear-bits insn.
521 (define_expand "and<mode>3"
522 [(set (match_operand:VAXint 0 "nonimmediate_operand" "")
523 (and:VAXint (not:VAXint (match_operand:VAXint 1 "general_operand" ""))
524 (match_operand:VAXint 2 "general_operand" "")))]
528 rtx op1 = operands[1];
530 /* If there is a constant argument, complement that one. */
531 if (GET_CODE (operands[2]) == CONST_INT && GET_CODE (op1) != CONST_INT)
533 operands[1] = operands[2];
538 if (GET_CODE (op1) == CONST_INT)
539 operands[1] = GEN_INT (~INTVAL (op1));
541 operands[1] = expand_unop (<MODE>mode, one_cmpl_optab, op1, 0, 1);
544 (define_insn "*and<mode>"
545 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g")
546 (and:VAXint (not:VAXint (match_operand:VAXint 1 "general_operand" "g,g"))
547 (match_operand:VAXint 2 "general_operand" "0,g")))]
550 bic<VAXint:isfx>2 %1,%0
551 bic<VAXint:isfx>3 %1,%2,%0")
553 ;; The following used to be needed because constant propagation can
554 ;; create them starting from the bic insn patterns above. This is no
555 ;; longer a problem. However, having these patterns allows optimization
556 ;; opportunities in combine.c.
558 (define_insn "*and<mode>_const_int"
559 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g")
560 (and:VAXint (match_operand:VAXint 1 "general_operand" "0,g")
561 (match_operand:VAXint 2 "const_int_operand" "n,n")))]
564 bic<VAXint:isfx>2 %<VAXint:iprefx>2,%0
565 bic<VAXint:isfx>3 %<VAXint:iprefx>2,%1,%0")
568 ;;- Bit set instructions.
570 (define_insn "ior<mode>3"
571 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g")
572 (ior:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g")
573 (match_operand:VAXint 2 "general_operand" "g,0,g")))]
576 bis<VAXint:isfx>2 %2,%0
577 bis<VAXint:isfx>2 %1,%0
578 bis<VAXint:isfx>3 %2,%1,%0")
580 ;;- xor instructions.
582 (define_insn "xor<mode>3"
583 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g")
584 (xor:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g")
585 (match_operand:VAXint 2 "general_operand" "g,0,g")))]
588 xor<VAXint:isfx>2 %2,%0
589 xor<VAXint:isfx>2 %1,%0
590 xor<VAXint:isfx>3 %2,%1,%0")
593 (define_insn "neg<mode>2"
594 [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g")
595 (neg:VAXfp (match_operand:VAXfp 1 "general_operand" "gF")))]
597 "mneg<VAXfp:fsfx> %1,%0")
599 (define_insn "neg<mode>2"
600 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
601 (neg:VAXint (match_operand:VAXint 1 "general_operand" "g")))]
603 "mneg<VAXint:isfx> %1,%0")
605 (define_insn "one_cmpl<mode>2"
606 [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g")
607 (not:VAXint (match_operand:VAXint 1 "general_operand" "g")))]
609 "mcom<VAXint:isfx> %1,%0")
612 ;; Arithmetic right shift on the VAX works by negating the shift count,
613 ;; then emitting a right shift with the shift count negated. This means
614 ;; that all actual shift counts in the RTL will be positive. This
615 ;; prevents converting shifts to ZERO_EXTRACTs with negative positions,
616 ;; which isn't valid.
617 (define_expand "ashrsi3"
618 [(set (match_operand:SI 0 "general_operand" "=g")
619 (ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
620 (match_operand:QI 2 "general_operand" "g")))]
624 if (GET_CODE (operands[2]) != CONST_INT)
625 operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
629 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
630 (ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
631 (match_operand:QI 2 "const_int_operand" "n")))]
636 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
637 (ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
638 (neg:QI (match_operand:QI 2 "general_operand" "g"))))]
642 (define_insn "ashlsi3"
643 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
644 (ashift:SI (match_operand:SI 1 "general_operand" "g")
645 (match_operand:QI 2 "general_operand" "g")))]
649 if (operands[2] == const1_rtx && rtx_equal_p (operands[0], operands[1]))
650 return \"addl2 %0,%0\";
651 if (REG_P (operands[1])
652 && GET_CODE (operands[2]) == CONST_INT)
654 int i = INTVAL (operands[2]);
656 return \"addl3 %1,%1,%0\";
658 return \"moval 0[%1],%0\";
660 return \"movad 0[%1],%0\";
662 return \"ashl %2,%1,%0\";
665 ;; Arithmetic right shift on the VAX works by negating the shift count.
666 (define_expand "ashrdi3"
667 [(set (match_operand:DI 0 "general_operand" "=g")
668 (ashiftrt:DI (match_operand:DI 1 "general_operand" "g")
669 (match_operand:QI 2 "general_operand" "g")))]
673 operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
676 (define_insn "ashldi3"
677 [(set (match_operand:DI 0 "nonimmediate_operand" "=g")
678 (ashift:DI (match_operand:DI 1 "general_operand" "g")
679 (match_operand:QI 2 "general_operand" "g")))]
684 [(set (match_operand:DI 0 "nonimmediate_operand" "=g")
685 (ashiftrt:DI (match_operand:DI 1 "general_operand" "g")
686 (neg:QI (match_operand:QI 2 "general_operand" "g"))))]
690 ;; We used to have expand_shift handle logical right shifts by using extzv,
691 ;; but this make it very difficult to do lshrdi3. Since the VAX is the
692 ;; only machine with this kludge, it's better to just do this with a
693 ;; define_expand and remove that case from expand_shift.
695 (define_expand "lshrsi3"
697 (minus:QI (const_int 32)
699 (set (match_operand:SI 0 "general_operand" "=g")
700 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
702 (match_operand:SI 2 "register_operand" "g")))]
706 operands[3] = gen_reg_rtx (QImode);
707 operands[4] = gen_lowpart (QImode, operands[2]);
710 ;; Rotate right on the VAX works by negating the shift count.
711 (define_expand "rotrsi3"
712 [(set (match_operand:SI 0 "general_operand" "=g")
713 (rotatert:SI (match_operand:SI 1 "general_operand" "g")
714 (match_operand:QI 2 "general_operand" "g")))]
718 if (GET_CODE (operands[2]) != CONST_INT)
719 operands[2] = gen_rtx_NEG (QImode, negate_rtx (QImode, operands[2]));
722 (define_insn "rotlsi3"
723 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
724 (rotate:SI (match_operand:SI 1 "general_operand" "g")
725 (match_operand:QI 2 "general_operand" "g")))]
730 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
731 (rotatert:SI (match_operand:SI 1 "general_operand" "g")
732 (match_operand:QI 2 "const_int_operand" "n")))]
737 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
738 (rotatert:SI (match_operand:SI 1 "general_operand" "g")
739 (neg:QI (match_operand:QI 2 "general_operand" "g"))))]
743 ;This insn is probably slower than a multiply and an add.
745 ; [(set (match_operand:SI 0 "general_operand" "=g")
746 ; (mult:SI (plus:SI (match_operand:SI 1 "general_operand" "g")
747 ; (match_operand:SI 2 "general_operand" "g"))
748 ; (match_operand:SI 3 "general_operand" "g")))]
750 ; "index %1,$0x80000000,$0x7fffffff,%3,%2,%0")
752 ;; Special cases of bit-field insns which we should
753 ;; recognize in preference to the general case.
754 ;; These handle aligned 8-bit and 16-bit fields,
755 ;; which can usually be done with move instructions.
758 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+ro")
759 (match_operand:QI 1 "const_int_operand" "n")
760 (match_operand:SI 2 "const_int_operand" "n"))
761 (match_operand:SI 3 "general_operand" "g"))]
762 "(INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16)
763 && INTVAL (operands[2]) % INTVAL (operands[1]) == 0
764 && (REG_P (operands[0])
765 || !mode_dependent_address_p (XEXP (operands[0], 0)))"
768 if (REG_P (operands[0]))
770 if (INTVAL (operands[2]) != 0)
771 return \"insv %3,%2,%1,%0\";
775 = adjust_address (operands[0],
776 INTVAL (operands[1]) == 8 ? QImode : HImode,
777 INTVAL (operands[2]) / 8);
780 if (INTVAL (operands[1]) == 8)
781 return \"movb %3,%0\";
782 return \"movw %3,%0\";
786 [(set (match_operand:SI 0 "nonimmediate_operand" "=&g")
787 (zero_extract:SI (match_operand:SI 1 "register_operand" "ro")
788 (match_operand:QI 2 "const_int_operand" "n")
789 (match_operand:SI 3 "const_int_operand" "n")))]
790 "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
791 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
792 && (REG_P (operands[1])
793 || !mode_dependent_address_p (XEXP (operands[1], 0)))"
796 if (REG_P (operands[1]))
798 if (INTVAL (operands[3]) != 0)
799 return \"extzv %3,%2,%1,%0\";
803 = adjust_address (operands[1],
804 INTVAL (operands[2]) == 8 ? QImode : HImode,
805 INTVAL (operands[3]) / 8);
807 if (INTVAL (operands[2]) == 8)
808 return \"movzbl %1,%0\";
809 return \"movzwl %1,%0\";
813 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
814 (sign_extract:SI (match_operand:SI 1 "register_operand" "ro")
815 (match_operand:QI 2 "const_int_operand" "n")
816 (match_operand:SI 3 "const_int_operand" "n")))]
817 "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)
818 && INTVAL (operands[3]) % INTVAL (operands[2]) == 0
819 && (REG_P (operands[1])
820 || !mode_dependent_address_p (XEXP (operands[1], 0)))"
823 if (REG_P (operands[1]))
825 if (INTVAL (operands[3]) != 0)
826 return \"extv %3,%2,%1,%0\";
830 = adjust_address (operands[1],
831 INTVAL (operands[2]) == 8 ? QImode : HImode,
832 INTVAL (operands[3]) / 8);
834 if (INTVAL (operands[2]) == 8)
835 return \"cvtbl %1,%0\";
836 return \"cvtwl %1,%0\";
839 ;; Register-only SImode cases of bit-field insns.
844 (sign_extract:SI (match_operand:SI 0 "register_operand" "r")
845 (match_operand:QI 1 "general_operand" "g")
846 (match_operand:SI 2 "general_operand" "g"))
847 (match_operand:SI 3 "general_operand" "g")))]
854 (zero_extract:SI (match_operand:SI 0 "register_operand" "r")
855 (match_operand:QI 1 "general_operand" "g")
856 (match_operand:SI 2 "general_operand" "g"))
857 (match_operand:SI 3 "general_operand" "g")))]
861 ;; When the field position and size are constant and the destination
862 ;; is a register, extv and extzv are much slower than a rotate followed
863 ;; by a bicl or sign extension. Because we might end up choosing ext[z]v
864 ;; anyway, we can't allow immediate values for the primary source operand.
867 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
868 (sign_extract:SI (match_operand:SI 1 "register_operand" "ro")
869 (match_operand:QI 2 "general_operand" "g")
870 (match_operand:SI 3 "general_operand" "g")))]
874 if (GET_CODE (operands[3]) != CONST_INT || GET_CODE (operands[2]) != CONST_INT
875 || !REG_P (operands[0])
876 || (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16))
877 return \"extv %3,%2,%1,%0\";
878 if (INTVAL (operands[2]) == 8)
879 return \"rotl %R3,%1,%0\;cvtbl %0,%0\";
880 return \"rotl %R3,%1,%0\;cvtwl %0,%0\";
884 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
885 (zero_extract:SI (match_operand:SI 1 "register_operand" "ro")
886 (match_operand:QI 2 "general_operand" "g")
887 (match_operand:SI 3 "general_operand" "g")))]
891 if (GET_CODE (operands[3]) != CONST_INT || GET_CODE (operands[2]) != CONST_INT
892 || !REG_P (operands[0]))
893 return \"extzv %3,%2,%1,%0\";
894 if (INTVAL (operands[2]) == 8)
895 return \"rotl %R3,%1,%0\;movzbl %0,%0\";
896 if (INTVAL (operands[2]) == 16)
897 return \"rotl %R3,%1,%0\;movzwl %0,%0\";
898 if (INTVAL (operands[3]) & 31)
899 return \"rotl %R3,%1,%0\;bicl2 %M2,%0\";
900 if (rtx_equal_p (operands[0], operands[1]))
901 return \"bicl2 %M2,%0\";
902 return \"bicl3 %M2,%1,%0\";
905 ;; Non-register cases.
906 ;; nonimmediate_operand is used to make sure that mode-ambiguous cases
907 ;; don't match these (and therefore match the cases above instead).
912 (sign_extract:SI (match_operand:QI 0 "memory_operand" "m")
913 (match_operand:QI 1 "general_operand" "g")
914 (match_operand:SI 2 "general_operand" "g"))
915 (match_operand:SI 3 "general_operand" "g")))]
922 (zero_extract:SI (match_operand:QI 0 "nonimmediate_operand" "rm")
923 (match_operand:QI 1 "general_operand" "g")
924 (match_operand:SI 2 "general_operand" "g"))
925 (match_operand:SI 3 "general_operand" "g")))]
930 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
931 (sign_extract:SI (match_operand:QI 1 "memory_operand" "m")
932 (match_operand:QI 2 "general_operand" "g")
933 (match_operand:SI 3 "general_operand" "g")))]
937 if (!REG_P (operands[0]) || GET_CODE (operands[2]) != CONST_INT
938 || GET_CODE (operands[3]) != CONST_INT
939 || (INTVAL (operands[2]) != 8 && INTVAL (operands[2]) != 16)
940 || INTVAL (operands[2]) + INTVAL (operands[3]) > 32
941 || side_effects_p (operands[1])
942 || (MEM_P (operands[1])
943 && mode_dependent_address_p (XEXP (operands[1], 0))))
944 return \"extv %3,%2,%1,%0\";
945 if (INTVAL (operands[2]) == 8)
946 return \"rotl %R3,%1,%0\;cvtbl %0,%0\";
947 return \"rotl %R3,%1,%0\;cvtwl %0,%0\";
950 (define_expand "extzv"
951 [(set (match_operand:SI 0 "general_operand" "")
952 (zero_extract:SI (match_operand:SI 1 "general_operand" "")
953 (match_operand:QI 2 "general_operand" "")
954 (match_operand:SI 3 "general_operand" "")))]
959 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
960 (zero_extract:SI (match_operand:QI 1 "memory_operand" "m")
961 (match_operand:QI 2 "general_operand" "g")
962 (match_operand:SI 3 "general_operand" "g")))]
966 if (!REG_P (operands[0]) || GET_CODE (operands[2]) != CONST_INT
967 || GET_CODE (operands[3]) != CONST_INT
968 || INTVAL (operands[2]) + INTVAL (operands[3]) > 32
969 || side_effects_p (operands[1])
970 || (MEM_P (operands[1])
971 && mode_dependent_address_p (XEXP (operands[1], 0))))
972 return \"extzv %3,%2,%1,%0\";
973 if (INTVAL (operands[2]) == 8)
974 return \"rotl %R3,%1,%0\;movzbl %0,%0\";
975 if (INTVAL (operands[2]) == 16)
976 return \"rotl %R3,%1,%0\;movzwl %0,%0\";
977 return \"rotl %R3,%1,%0\;bicl2 %M2,%0\";
980 (define_expand "insv"
981 [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "")
982 (match_operand:QI 1 "general_operand" "")
983 (match_operand:SI 2 "general_operand" ""))
984 (match_operand:SI 3 "general_operand" ""))]
989 [(set (zero_extract:SI (match_operand:QI 0 "memory_operand" "+g")
990 (match_operand:QI 1 "general_operand" "g")
991 (match_operand:SI 2 "general_operand" "g"))
992 (match_operand:SI 3 "general_operand" "g"))]
997 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
998 (match_operand:QI 1 "general_operand" "g")
999 (match_operand:SI 2 "general_operand" "g"))
1000 (match_operand:SI 3 "general_operand" "g"))]
1004 ;; Unconditional jump
1007 (label_ref (match_operand 0 "" "")))]
1011 ;; Conditional jumps
1012 (define_code_macro any_cond [eq ne gt lt gtu ltu ge le geu leu])
1014 (define_insn "b<code>"
1016 (if_then_else (any_cond (cc0)
1018 (label_ref (match_operand 0 "" ""))
1021 "* return vax_output_conditional_branch (<CODE>);")
1023 ;; Recognize reversed jumps.
1026 (if_then_else (match_operator 0 "comparison_operator"
1030 (label_ref (match_operand 1 "" ""))))]
1032 "j%C0 %l1") ; %C0 negates condition
1034 ;; Recognize jbs, jlbs, jbc and jlbc instructions. Note that the operand
1035 ;; of jlbs and jlbc insns are SImode in the hardware. However, if it is
1036 ;; memory, we use QImode in the insn. So we can't use those instructions
1037 ;; for mode-dependent addresses.
1042 (ne (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,g")
1044 (match_operand:SI 1 "general_operand" "I,g"))
1046 (label_ref (match_operand 2 "" ""))
1056 (eq (zero_extract:SI (match_operand:QI 0 "memory_operand" "Q,g")
1058 (match_operand:SI 1 "general_operand" "I,g"))
1060 (label_ref (match_operand 2 "" ""))
1070 (ne (zero_extract:SI (match_operand:SI 0 "register_operand" "r,r")
1072 (match_operand:SI 1 "general_operand" "I,g"))
1074 (label_ref (match_operand 2 "" ""))
1084 (eq (zero_extract:SI (match_operand:SI 0 "register_operand" "r,r")
1086 (match_operand:SI 1 "general_operand" "I,g"))
1088 (label_ref (match_operand 2 "" ""))
1095 ;; Subtract-and-jump and Add-and-jump insns.
1096 ;; These are not used when output is for the Unix assembler
1097 ;; because it does not know how to modify them to reach far.
1099 ;; Normal sob insns.
1104 (gt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g")
1107 (label_ref (match_operand 1 "" ""))
1110 (plus:SI (match_dup 0)
1118 (ge (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g")
1121 (label_ref (match_operand 1 "" ""))
1124 (plus:SI (match_dup 0)
1129 ;; Normal aob insns. Define a version for when operands[1] is a constant.
1133 (lt (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g")
1135 (match_operand:SI 1 "general_operand" "g"))
1136 (label_ref (match_operand 2 "" ""))
1139 (plus:SI (match_dup 0)
1142 "jaoblss %1,%0,%l2")
1147 (lt (match_operand:SI 0 "nonimmediate_operand" "+g")
1148 (match_operand:SI 1 "general_operand" "g"))
1149 (label_ref (match_operand 2 "" ""))
1152 (plus:SI (match_dup 0)
1154 "!TARGET_UNIX_ASM && GET_CODE (operands[1]) == CONST_INT"
1155 "jaoblss %P1,%0,%l2")
1160 (le (plus:SI (match_operand:SI 0 "nonimmediate_operand" "+g")
1162 (match_operand:SI 1 "general_operand" "g"))
1163 (label_ref (match_operand 2 "" ""))
1166 (plus:SI (match_dup 0)
1169 "jaobleq %1,%0,%l2")
1174 (le (match_operand:SI 0 "nonimmediate_operand" "+g")
1175 (match_operand:SI 1 "general_operand" "g"))
1176 (label_ref (match_operand 2 "" ""))
1179 (plus:SI (match_dup 0)
1181 "!TARGET_UNIX_ASM && GET_CODE (operands[1]) == CONST_INT"
1182 "jaobleq %P1,%0,%l2")
1184 ;; Something like a sob insn, but compares against -1.
1185 ;; This finds `while (foo--)' which was changed to `while (--foo != -1)'.
1190 (ne (match_operand:SI 0 "nonimmediate_operand" "+g")
1192 (label_ref (match_operand 1 "" ""))
1195 (plus:SI (match_dup 0)
1198 "decl %0\;jgequ %l1")
1200 (define_expand "call_pop"
1201 [(parallel [(call (match_operand:QI 0 "memory_operand" "")
1202 (match_operand:SI 1 "const_int_operand" ""))
1203 (set (reg:SI VAX_SP_REGNUM)
1204 (plus:SI (reg:SI VAX_SP_REGNUM)
1205 (match_operand:SI 3 "immediate_operand" "")))])]
1208 gcc_assert (INTVAL (operands[3]) <= 255 * 4 && INTVAL (operands[3]) % 4 == 0);
1210 /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size
1211 during EH unwinding. We must include the argument count pushed by
1212 the calls instruction. */
1213 operands[1] = GEN_INT (INTVAL (operands[3]) + 4);
1216 (define_insn "*call_pop"
1217 [(call (match_operand:QI 0 "memory_operand" "m")
1218 (match_operand:SI 1 "const_int_operand" "n"))
1219 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM)
1220 (match_operand:SI 2 "immediate_operand" "i")))]
1223 operands[1] = GEN_INT ((INTVAL (operands[1]) - 4) / 4);
1224 return "calls %1,%0";
1227 (define_expand "call_value_pop"
1228 [(parallel [(set (match_operand 0 "" "")
1229 (call (match_operand:QI 1 "memory_operand" "")
1230 (match_operand:SI 2 "const_int_operand" "")))
1231 (set (reg:SI VAX_SP_REGNUM)
1232 (plus:SI (reg:SI VAX_SP_REGNUM)
1233 (match_operand:SI 4 "immediate_operand" "")))])]
1236 gcc_assert (INTVAL (operands[4]) <= 255 * 4 && INTVAL (operands[4]) % 4 == 0);
1238 /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size
1239 during EH unwinding. We must include the argument count pushed by
1240 the calls instruction. */
1241 operands[2] = GEN_INT (INTVAL (operands[4]) + 4);
1244 (define_insn "*call_value_pop"
1245 [(set (match_operand 0 "" "")
1246 (call (match_operand:QI 1 "memory_operand" "m")
1247 (match_operand:SI 2 "const_int_operand" "n")))
1248 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM)
1249 (match_operand:SI 3 "immediate_operand" "i")))]
1253 operands[2] = GEN_INT ((INTVAL (operands[2]) - 4) / 4);
1254 return \"calls %2,%1\";
1257 (define_expand "call"
1258 [(call (match_operand:QI 0 "memory_operand" "")
1259 (match_operand:SI 1 "const_int_operand" ""))]
1263 /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size
1264 during EH unwinding. We must include the argument count pushed by
1265 the calls instruction. */
1266 operands[1] = GEN_INT (INTVAL (operands[1]) + 4);
1269 (define_insn "*call"
1270 [(call (match_operand:QI 0 "memory_operand" "m")
1271 (match_operand:SI 1 "const_int_operand" ""))]
1275 (define_expand "call_value"
1276 [(set (match_operand 0 "" "")
1277 (call (match_operand:QI 1 "memory_operand" "")
1278 (match_operand:SI 2 "const_int_operand" "")))]
1282 /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size
1283 during EH unwinding. We must include the argument count pushed by
1284 the calls instruction. */
1285 operands[2] = GEN_INT (INTVAL (operands[2]) + 4);
1288 (define_insn "*call_value"
1289 [(set (match_operand 0 "" "")
1290 (call (match_operand:QI 1 "memory_operand" "m")
1291 (match_operand:SI 2 "const_int_operand" "")))]
1295 ;; Call subroutine returning any type.
1297 (define_expand "untyped_call"
1298 [(parallel [(call (match_operand 0 "" "")
1300 (match_operand 1 "" "")
1301 (match_operand 2 "" "")])]
1307 emit_call_insn (gen_call_pop (operands[0], const0_rtx, NULL, const0_rtx));
1309 for (i = 0; i < XVECLEN (operands[2], 0); i++)
1311 rtx set = XVECEXP (operands[2], 0, i);
1312 emit_move_insn (SET_DEST (set), SET_SRC (set));
1315 /* The optimizer does not know that the call sets the function value
1316 registers we stored in the result block. We avoid problems by
1317 claiming that all hard registers are used and clobbered at this
1319 emit_insn (gen_blockage ());
1324 ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and
1325 ;; all of memory. This blocks insns from being moved across this point.
1327 (define_insn "blockage"
1328 [(unspec_volatile [(const_int 0)] VUNSPEC_BLOCKAGE)]
1332 (define_insn "return"
1337 (define_expand "epilogue"
1342 emit_jump_insn (gen_return ());
1351 ;; This had a wider constraint once, and it had trouble.
1352 ;; If you are tempted to try `g', please don't--it's not worth
1353 ;; the risk we will reopen the same bug.
1354 (define_insn "indirect_jump"
1355 [(set (pc) (match_operand:SI 0 "register_operand" "r"))]
1359 ;; This is here to accept 5 arguments (as passed by expand_end_case)
1360 ;; and pass the first 4 along to the casesi1 pattern that really does
1361 ;; the actual casesi work. We emit a jump here to the default label
1362 ;; _before_ the casesi so that we can be sure that the casesi never
1364 ;; This is suboptimal perhaps, but so is much of the rest of this
1365 ;; machine description. For what it's worth, HPPA uses the same trick.
1367 ;; operand 0 is index
1368 ;; operand 1 is the minimum bound (a const_int)
1369 ;; operand 2 is the maximum bound - minimum bound + 1 (also a const_int)
1370 ;; operand 3 is CODE_LABEL for the table;
1371 ;; operand 4 is the CODE_LABEL to go to if index out of range (ie. default).
1374 ;; i = index - minimum_bound
1375 ;; if (i > (maximum_bound - minimum_bound + 1) goto default;
1376 ;; casesi (i, 0, table);
1378 (define_expand "casesi"
1379 [(match_operand:SI 0 "general_operand" "")
1380 (match_operand:SI 1 "general_operand" "")
1381 (match_operand:SI 2 "general_operand" "")
1382 (match_operand 3 "" "")
1383 (match_operand 4 "" "")]
1386 /* i = index - minimum_bound;
1387 But only if the lower bound is not already zero. */
1388 if (operands[1] != const0_rtx)
1390 rtx index = gen_reg_rtx (SImode);
1391 emit_insn (gen_addsi3 (index,
1393 GEN_INT (-INTVAL (operands[1]))));
1394 operands[0] = index;
1397 /* if (i > (maximum_bound - minimum_bound + 1) goto default; */
1398 emit_insn (gen_cmpsi (operands[0], operands[2]));
1399 emit_jump_insn (gen_bgtu (operands[4]));
1401 /* casesi (i, 0, table); */
1402 emit_jump_insn (gen_casesi1 (operands[0], operands[2], operands[3]));
1406 ;; This insn is a bit of a lier. It actually falls through if no case
1407 ;; matches. But, we prevent that from ever happening by emitting a jump
1408 ;; before this, see the define_expand above.
1409 (define_insn "casesi1"
1410 [(match_operand:SI 1 "const_int_operand" "n")
1412 (plus:SI (sign_extend:SI
1413 (mem:HI (plus:SI (mult:SI (match_operand:SI 0 "general_operand" "g")
1416 (label_ref:SI (match_operand 2 "" ""))))]
1420 ;;- load or push effective address
1421 ;; These come after the move and add/sub patterns
1422 ;; because we don't want pushl $1 turned into pushad 1.
1423 ;; or addl3 r1,r2,r3 turned into movab 0(r1)[r2],r3.
1425 ;; It does not work to use constraints to distinguish pushes from moves,
1426 ;; because < matches any autodecrement, not just a push.
1429 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1430 (match_operand:QI 1 "address_operand" "p"))]
1434 if (push_operand (operands[0], SImode))
1435 return \"pushab %a1\";
1437 return \"movab %a1,%0\";
1441 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1442 (match_operand:HI 1 "address_operand" "p"))]
1446 if (push_operand (operands[0], SImode))
1447 return \"pushaw %a1\";
1449 return \"movaw %a1,%0\";
1453 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1454 (match_operand:SI 1 "address_operand" "p"))]
1458 if (push_operand (operands[0], SImode))
1459 return \"pushal %a1\";
1461 return \"moval %a1,%0\";
1465 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1466 (match_operand:DI 1 "address_operand" "p"))]
1470 if (push_operand (operands[0], SImode))
1471 return \"pushaq %a1\";
1473 return \"movaq %a1,%0\";
1477 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1478 (match_operand:SF 1 "address_operand" "p"))]
1482 if (push_operand (operands[0], SImode))
1483 return \"pushaf %a1\";
1485 return \"movaf %a1,%0\";
1489 [(set (match_operand:SI 0 "nonimmediate_operand" "=g")
1490 (match_operand:DF 1 "address_operand" "p"))]
1494 if (push_operand (operands[0], SImode))
1495 return \"pushad %a1\";
1497 return \"movad %a1,%0\";
1500 ;; These used to be peepholes, but it is more straightforward to do them
1501 ;; as single insns. However, we must force the output to be a register
1502 ;; if it is not an offsettable address so that we know that we can assign
1505 ;; If we had a good way of evaluating the relative costs, these could be
1506 ;; machine-independent.
1508 ;; Optimize extzv ...,z; andl2 ...,z
1509 ;; or ashl ...,z; andl2 ...,z
1510 ;; with other operands constant. This is what the combiner converts the
1511 ;; above sequences to before attempting to recognize the new insn.
1514 [(set (match_operand:SI 0 "nonimmediate_operand" "=ro")
1515 (and:SI (ashiftrt:SI (match_operand:SI 1 "general_operand" "g")
1516 (match_operand:QI 2 "const_int_operand" "n"))
1517 (match_operand:SI 3 "const_int_operand" "n")))]
1518 "(INTVAL (operands[3]) & ~((1 << (32 - INTVAL (operands[2]))) - 1)) == 0"
1521 unsigned long mask1 = INTVAL (operands[3]);
1522 unsigned long mask2 = (1 << (32 - INTVAL (operands[2]))) - 1;
1524 if ((mask1 & mask2) != mask1)
1525 operands[3] = GEN_INT (mask1 & mask2);
1527 return \"rotl %R2,%1,%0\;bicl2 %N3,%0\";
1530 ;; left-shift and mask
1531 ;; The only case where `ashl' is better is if the mask only turns off
1532 ;; bits that the ashl would anyways, in which case it should have been
1536 [(set (match_operand:SI 0 "nonimmediate_operand" "=ro")
1537 (and:SI (ashift:SI (match_operand:SI 1 "general_operand" "g")
1538 (match_operand:QI 2 "const_int_operand" "n"))
1539 (match_operand:SI 3 "const_int_operand" "n")))]
1544 = GEN_INT (INTVAL (operands[3]) & ~((1 << INTVAL (operands[2])) - 1));
1545 return \"rotl %2,%1,%0\;bicl2 %N3,%0\";
1548 ;; Instruction sequence to sync the VAX instruction stream.
1549 (define_insn "sync_istream"
1550 [(unspec_volatile [(const_int 0)] VUNSPEC_SYNC_ISTREAM)]
1552 "movpsl -(%|sp)\;pushal 1(%|pc)\;rei")