1 ;; GCC machine description for Matsushita MN10300
2 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 ;; Contributed by Jeff Law (law@cygnus.com).
6 ;; This file is part of GNU CC.
8 ;; GNU CC is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; GNU CC is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU CC; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
23 ;; The original PO technology requires these to be ordered by speed,
24 ;; so that assigner will pick the fastest.
26 ;; See file "rtl.def" for documentation on define_insn, match_*, et. al.
28 ;; Condition code settings.
29 ;; none - insn does not affect cc
30 ;; none_0hit - insn does not affect cc but it does modify operand 0
31 ;; This attribute is used to keep track of when operand 0 changes.
32 ;; See the description of NOTICE_UPDATE_CC for more info.
33 ;; set - insn sets flags z,n. v is unusable c is set to 0.
34 ;; (c may not really be set to 0 but that's ok, we don't need it anyway).
35 ;; set_zn_c0 - insn sets z,n to usable values. v is unknown. c may or may not
36 ;; be known (if it isn't that's ok, we don't need it anyway).
37 ;; compare - compare instruction
38 ;; invert -- like compare, but flags are inverted.
39 ;; clobber - value of cc is unknown
40 (define_attr "cc" "none,none_0hit,tst,set_zn_c0,compare,clobber,invert"
41 (const_string "clobber"))
43 ;; ----------------------------------------------------------------------
45 ;; ----------------------------------------------------------------------
49 (define_expand "movqi"
50 [(set (match_operand:QI 0 "general_operand" "")
51 (match_operand:QI 1 "general_operand" ""))]
55 /* One of the ops has to be in a register */
56 if (!register_operand (operand0, QImode)
57 && !register_operand (operand1, QImode))
58 operands[1] = copy_to_mode_reg (QImode, operand1);
62 [(set (match_operand:QI 0 "general_operand" "=d,a,d,d,a,d,a,d,m")
63 (match_operand:QI 1 "general_operand" "0,0,I,a,d,di,ia,m,d"))]
64 "register_operand (operands[0], QImode)
65 || register_operand (operands[1], QImode)"
76 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
80 (define_expand "movhi"
81 [(set (match_operand:HI 0 "general_operand" "")
82 (match_operand:HI 1 "general_operand" ""))]
86 /* One of the ops has to be in a register */
87 if (!register_operand (operand1, HImode)
88 && !register_operand (operand0, HImode))
89 operands[1] = copy_to_mode_reg (HImode, operand1);
93 [(set (match_operand:HI 0 "general_operand" "=d,a,d,d,a,d,a,d,m")
94 (match_operand:HI 1 "general_operand" "0,0,I,a,d,di,ia,m,d"))]
95 "register_operand (operands[0], HImode)
96 || register_operand (operands[1], HImode)"
107 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
111 (define_expand "movsi"
112 [(set (match_operand:SI 0 "general_operand" "")
113 (match_operand:SI 1 "general_operand" ""))]
117 /* One of the ops has to be in a register */
118 if (!register_operand (operand1, SImode)
119 && !register_operand (operand0, SImode))
120 operands[1] = copy_to_mode_reg (SImode, operand1);
124 [(set (match_operand:SI 0 "general_operand" "=d,a,d,dm,dm,am,am,d,d,a,a,aR,x")
125 (match_operand:SI 1 "general_operand" "0,0,I,d,a,d,a,dim,aim,dim,aim,x,aR"))]
126 "register_operand (operands[0], SImode)
127 || register_operand (operands[1], SImode)"
142 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
144 (define_expand "movsf"
145 [(set (match_operand:SF 0 "general_operand" "")
146 (match_operand:SF 1 "general_operand" ""))]
150 /* One of the ops has to be in a register */
151 if (!register_operand (operand1, SFmode)
152 && !register_operand (operand0, SFmode))
153 operands[1] = copy_to_mode_reg (SFmode, operand1);
157 [(set (match_operand:SF 0 "general_operand" "=d,a,d,dam,da")
158 (match_operand:SF 1 "general_operand" "0,0,G,da,daim"))]
159 "register_operand (operands[0], SFmode)
160 || register_operand (operands[1], SFmode)"
167 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit")])
169 (define_expand "movdi"
170 [(set (match_operand:DI 0 "general_operand" "")
171 (match_operand:DI 1 "general_operand" ""))]
175 /* One of the ops has to be in a register */
176 if (!register_operand (operand1, DImode)
177 && !register_operand (operand0, DImode))
178 operands[1] = copy_to_mode_reg (DImode, operand1);
182 [(set (match_operand:DI 0 "general_operand" "=d,a,d,dm,dm,am,am,d,d,a,a")
183 (match_operand:DI 1 "general_operand" "0,0,I,d,a,d,a,dim,aim,dim,aim"))]
184 "register_operand (operands[0], DImode)
185 || register_operand (operands[1], DImode)"
190 mov %L1,%L0\;mov %H1,%H0
191 mov %L1,%L0\;mov %H1,%H0
192 mov %L1,%L0\;mov %H1,%H0
193 mov %L1,%L0\;mov %H1,%H0
194 mov %L1,%L0\;mov %H1,%H0
195 mov %L1,%L0\;mov %H1,%H0
196 mov %L1,%L0\;mov %H1,%H0
197 mov %L1,%L0\;mov %H1,%H0"
198 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
200 (define_expand "movdf"
201 [(set (match_operand:DF 0 "general_operand" "")
202 (match_operand:DF 1 "general_operand" ""))]
206 /* One of the ops has to be in a register */
207 if (!register_operand (operand1, DFmode)
208 && !register_operand (operand0, DFmode))
209 operands[1] = copy_to_mode_reg (DFmode, operand1);
213 [(set (match_operand:DF 0 "general_operand" "=d,a,d,dm,dm,am,am,d,d,a,a")
214 (match_operand:DF 1 "general_operand" "0,0,G,d,a,d,a,dim,aim,dim,aim"))]
215 "register_operand (operands[0], DFmode)
216 || register_operand (operands[1], DFmode)"
221 mov %L1,%L0\;mov %H1,%H0
222 mov %L1,%L0\;mov %H1,%H0
223 mov %L1,%L0\;mov %H1,%H0
224 mov %L1,%L0\;mov %H1,%H0
225 mov %L1,%L0\;mov %H1,%H0
226 mov %L1,%L0\;mov %H1,%H0
227 mov %L1,%L0\;mov %H1,%H0
228 mov %L1,%L0\;mov %H1,%H0"
229 [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
233 ;; ----------------------------------------------------------------------
235 ;; ----------------------------------------------------------------------
237 ;; Go ahead and define tstsi so we can eliminate redundant tst insns
238 ;; when we start trying to optimize this port.
240 [(set (cc0) (match_operand:SI 0 "register_operand" "da"))]
243 [(set_attr "cc" "tst")])
247 (compare (match_operand:SI 0 "register_operand" "!*d*a,da")
248 (match_operand:SI 1 "nonmemory_operand" "!*0,dai")))]
253 [(set_attr "cc" "invert,compare")])
255 ;; ----------------------------------------------------------------------
257 ;; ----------------------------------------------------------------------
259 (define_expand "addsi3"
260 [(set (match_operand:SI 0 "register_operand" "")
261 (plus:SI (match_operand:SI 1 "register_operand" "")
262 (match_operand:SI 2 "nonmemory_operand" "")))]
266 /* We can't add a variable amount directly to the stack pointer;
267 so do so via a temporary register. */
268 if (operands[0] == stack_pointer_rtx
269 && GET_CODE (operands[1]) != CONST_INT
270 && GET_CODE (operands[2]) != CONST_INT)
272 rtx temp = gen_reg_rtx (SImode);
273 emit_move_insn (temp, gen_rtx (PLUS, SImode, operands[1], operands[2]));
274 emit_move_insn (operands[0], temp);
280 [(set (match_operand:SI 0 "register_operand" "=d,a,a,da,x")
281 (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0,0,0")
282 (match_operand:SI 2 "nonmemory_operand" "J,J,L,dai,i")))]
290 [(set_attr "cc" "set_zn_c0,none_0hit,none_0hit,set_zn_c0,none_0hit")])
292 (define_expand "adddi3"
293 [(set (reg:DI 0) (match_operand:DI 1 "register_operand" ""))
294 (set (reg:DI 2) (match_operand:DI 2 "nonmemory_operand" ""))
295 (set (reg:DI 0) (plus:DI (reg:DI 0) (reg:DI 2)))
296 (set (match_operand:DI 0 "register_operand" "") (reg:DI 0))]
300 if (GET_CODE (operands[2]) == CONST_INT)
302 rtx reg0 = gen_rtx (REG, DImode, 0);
304 emit_move_insn (reg0, operands[1]);
305 emit_insn (gen_adddi3_const (operands[2]));
306 emit_move_insn (operands[0], reg0);
311 ;; The general adddi3 pattern.
313 [(set (reg:DI 0) (plus:DI (reg:DI 0) (reg:DI 2)))]
315 "add d2,d0\;addc d3,d1"
316 [(set_attr "cc" "clobber")])
318 ;; adddi3 with on operand being a constant.
319 (define_insn "adddi3_const"
321 (plus:DI (reg:DI 0) (match_operand:DI 0 "const_int_operand" "i")))
322 (clobber (reg:DI 2))]
326 long value = INTVAL (operands[0]);
329 return \"mov -1,d2\;add %0,d0\;addc d2,d1\";
331 return \"clr d2\;add %0,d0\;addc d2,d1\";
333 [(set_attr "cc" "clobber")])
334 ;; ----------------------------------------------------------------------
335 ;; SUBTRACT INSTRUCTIONS
336 ;; ----------------------------------------------------------------------
338 (define_insn "subsi3"
339 [(set (match_operand:SI 0 "register_operand" "=da")
340 (minus:SI (match_operand:SI 1 "register_operand" "0")
341 (match_operand:SI 2 "nonmemory_operand" "dai")))]
344 [(set_attr "cc" "set_zn_c0")])
346 (define_expand "negsi2"
347 [(set (match_operand:SI 0 "register_operand" "")
348 (neg:SI (match_operand:SI 1 "register_operand" "")))]
352 rtx target = gen_reg_rtx (SImode);
354 emit_move_insn (target, GEN_INT (0));
355 emit_insn (gen_subsi3 (target, target, operands[1]));
356 emit_move_insn (operands[0], target);
360 (define_expand "subdi3"
361 [(set (reg:DI 0) (match_operand:DI 1 "register_operand" ""))
362 (set (reg:DI 2) (match_operand:DI 2 "nonmemory_operand" ""))
363 (set (reg:DI 0) (minus:DI (reg:DI 0) (reg:DI 2)))
364 (set (match_operand:DI 0 "register_operand" "") (reg:DI 0))]
369 [(set (reg:DI 0) (minus:DI (reg:DI 0) (reg:DI 2)))]
371 "sub d2,d0\;subc d3,d1"
372 [(set_attr "cc" "clobber")])
374 ;; ----------------------------------------------------------------------
375 ;; MULTIPLY INSTRUCTIONS
376 ;; ----------------------------------------------------------------------
378 (define_insn "mulsi3"
379 [(set (match_operand:SI 0 "register_operand" "=d")
380 (mult:SI (match_operand:SI 1 "register_operand" "%0")
381 (match_operand:SI 2 "register_operand" "d")))]
384 [(set_attr "cc" "set_zn_c0")])
386 (define_insn "divsi3"
387 [(set (match_operand:SI 0 "register_operand" "=d")
388 (div:SI (match_operand:SI 1 "register_operand" "0")
389 (match_operand:SI 2 "register_operand" "d")))]
392 [(set_attr "cc" "set_zn_c0")])
394 (define_expand "udivsi3"
395 [(set (match_operand:SI 0 "register_operand" "")
396 (udiv:SI (match_operand:SI 1 "register_operand" "")
397 (match_operand:SI 2 "register_operand" "")))]
401 rtx reg = gen_reg_rtx (SImode);
402 emit_move_insn (reg, GEN_INT (0));
403 emit_insn (gen_clear_mdr (reg));
407 [(set (match_operand:SI 0 "register_operand" "=d")
408 (udiv:SI (match_operand:SI 1 "register_operand" "0")
409 (match_operand:SI 2 "register_operand" "d")))]
412 [(set_attr "cc" "set_zn_c0")])
414 (define_insn "clear_mdr"
415 [(unspec_volatile [(const_int 2)] 0)
416 (use (match_operand:SI 0 "register_operand" "d"))]
419 [(set_attr "cc" "none")])
421 ;; ----------------------------------------------------------------------
423 ;; ----------------------------------------------------------------------
425 (define_insn "andsi3"
426 [(set (match_operand:SI 0 "register_operand" "=d,d")
427 (and:SI (match_operand:SI 1 "register_operand" "%0,0")
428 (match_operand:SI 2 "nonmemory_operand" "N,di")))]
432 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xff)
434 if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xffff)
436 return \"and %2,%0\";
438 [(set_attr "cc" "none_0hit,set_zn_c0")])
440 ;; ----------------------------------------------------------------------
442 ;; ----------------------------------------------------------------------
444 (define_insn "iorsi3"
445 [(set (match_operand:SI 0 "register_operand" "=d")
446 (ior:SI (match_operand:SI 1 "register_operand" "%0")
447 (match_operand:SI 2 "nonmemory_operand" "di")))]
450 [(set_attr "cc" "set_zn_c0")])
452 ;; ----------------------------------------------------------------------
454 ;; ----------------------------------------------------------------------
456 (define_insn "xorsi3"
457 [(set (match_operand:SI 0 "register_operand" "=d")
458 (xor:SI (match_operand:SI 1 "register_operand" "%0")
459 (match_operand:SI 2 "nonmemory_operand" "di")))]
462 [(set_attr "cc" "set_zn_c0")])
464 ;; ----------------------------------------------------------------------
466 ;; ----------------------------------------------------------------------
468 (define_insn "one_cmplsi2"
469 [(set (match_operand:SI 0 "register_operand" "=d")
470 (not:SI (match_operand:SI 1 "register_operand" "0")))]
473 [(set_attr "cc" "set_zn_c0")])
475 ;; -----------------------------------------------------------------
477 ;; -----------------------------------------------------------------
480 ;; These set/clear memory in byte sized chunks.
482 ;; They are no smaller/faster than loading the value into a register
483 ;; and storing the register, but they don't need a scratch register
484 ;; which may allow for better code generation.
486 [(set (match_operand:QI 0 "general_operand" "=R,d") (const_int 0))]
491 [(set_attr "cc" "clobber")])
494 [(set (match_operand:QI 0 "general_operand" "=R,d") (const_int -1))]
499 [(set_attr "cc" "clobber,none_0hit")])
502 [(set (match_operand:QI 0 "general_operand" "=R,d")
504 (and:SI (subreg:SI (match_dup 0) 0)
505 (match_operand:SI 1 "const_int_operand" "i,i")) 0))]
510 [(set_attr "cc" "clobber,set_zn_c0")])
513 [(set (match_operand:QI 0 "general_operand" "=R,d")
515 (ior:SI (subreg:SI (match_dup 0) 0)
516 (match_operand:SI 1 "const_int_operand" "i,i")) 0))]
521 [(set_attr "cc" "clobber")])
525 (zero_extract:SI (match_operand:SI 0 "register_operand" "d")
526 (match_operand 1 "const_int_operand" "")
527 (match_operand 2 "const_int_operand" "")))]
531 int len = INTVAL (operands[1]);
532 int bit = INTVAL (operands[2]);
543 xoperands[0] = operands[0];
544 xoperands[1] = GEN_INT (mask);
545 output_asm_insn (\"btst %1,%0\", xoperands);
548 [(set_attr "cc" "set_zn_c0")])
552 (zero_extract:SI (match_operand:QI 0 "general_operand" "R,d")
553 (match_operand 1 "const_int_operand" "")
554 (match_operand 2 "const_int_operand" "")))]
555 "INTVAL (operands[1]) <= 8 && INTVAL (operands[2]) <= 7"
558 int len = INTVAL (operands[1]);
559 int bit = INTVAL (operands[2]);
570 xoperands[0] = operands[0];
571 xoperands[1] = GEN_INT (mask);
572 if (GET_CODE (operands[0]) == REG)
573 output_asm_insn (\"btst %1,%0\", xoperands);
575 output_asm_insn (\"btst %1,%A0\", xoperands);
578 [(set_attr "cc" "set_zn_c0")])
581 [(set (cc0) (and:SI (match_operand:SI 0 "register_operand" "d")
582 (match_operand:SI 1 "const_int_operand" "")))]
585 [(set_attr "cc" "set_zn_c0")])
590 (subreg:SI (match_operand:QI 0 "general_operand" "R,d") 0)
591 (match_operand:SI 1 "const_int_operand" "")))]
596 [(set_attr "cc" "set_zn_c0")])
598 ;; -----------------------------------------------------------------
599 ;; -----------------------------------------------------------------
601 ;; -----------------------------------------------------------------
602 ;; It's probably worth the time to define setcc type insns too
605 ;; ----------------------------------------------------------------------
607 ;; ----------------------------------------------------------------------
609 ;; Conditional jump instructions
613 (if_then_else (le (cc0)
615 (label_ref (match_operand 0 "" ""))
620 (define_expand "bleu"
622 (if_then_else (leu (cc0)
624 (label_ref (match_operand 0 "" ""))
631 (if_then_else (ge (cc0)
633 (label_ref (match_operand 0 "" ""))
638 (define_expand "bgeu"
640 (if_then_else (geu (cc0)
642 (label_ref (match_operand 0 "" ""))
649 (if_then_else (lt (cc0)
651 (label_ref (match_operand 0 "" ""))
656 (define_expand "bltu"
658 (if_then_else (ltu (cc0)
660 (label_ref (match_operand 0 "" ""))
667 (if_then_else (gt (cc0)
669 (label_ref (match_operand 0 "" ""))
674 (define_expand "bgtu"
676 (if_then_else (gtu (cc0)
678 (label_ref (match_operand 0 "" ""))
685 (if_then_else (eq (cc0)
687 (label_ref (match_operand 0 "" ""))
694 (if_then_else (ne (cc0)
696 (label_ref (match_operand 0 "" ""))
703 (if_then_else (match_operator 1 "comparison_operator"
704 [(cc0) (const_int 0)])
705 (label_ref (match_operand 0 "" ""))
710 if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0
711 && (GET_CODE (operands[1]) == GT
712 || GET_CODE (operands[1]) == GE
713 || GET_CODE (operands[1]) == LE
714 || GET_CODE (operands[1]) == LT))
718 [(set_attr "cc" "none")])
722 (if_then_else (match_operator 1 "comparison_operator"
723 [(cc0) (const_int 0)])
725 (label_ref (match_operand 0 "" ""))))]
729 if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0
730 && (GET_CODE (operands[1]) == GT
731 || GET_CODE (operands[1]) == GE
732 || GET_CODE (operands[1]) == LE
733 || GET_CODE (operands[1]) == LT))
737 [(set_attr "cc" "none")])
739 ;; Unconditional and other jump instructions.
743 (label_ref (match_operand 0 "" "")))]
746 [(set_attr "cc" "none")])
748 (define_insn "indirect_jump"
749 [(set (pc) (match_operand:SI 0 "register_operand" "a"))]
752 [(set_attr "cc" "none")])
754 (define_insn "tablejump"
755 [(set (pc) (match_operand:SI 0 "register_operand" "a"))
756 (use (label_ref (match_operand 1 "" "")))]
759 [(set_attr "cc" "none")])
761 ;; Call subroutine with no return value.
763 (define_expand "call"
764 [(call (match_operand:QI 0 "general_operand" "")
765 (match_operand:SI 1 "general_operand" ""))]
769 if (! call_address_operand (XEXP (operands[0], 0)))
770 XEXP (operands[0], 0) = force_reg (SImode, XEXP (operands[0], 0));
771 emit_call_insn (gen_call_internal (XEXP (operands[0], 0), operands[1]));
775 (define_insn "call_internal"
776 [(call (mem:QI (match_operand:SI 0 "call_address_operand" "aS"))
777 (match_operand:SI 1 "general_operand" "g"))]
780 [(set_attr "cc" "clobber")])
782 ;; Call subroutine, returning value in operand 0
783 ;; (which must be a hard register).
785 (define_expand "call_value"
786 [(set (match_operand 0 "" "")
787 (call (match_operand:QI 1 "general_operand" "")
788 (match_operand:SI 2 "general_operand" "")))]
792 if (! call_address_operand (XEXP (operands[1], 0)))
793 XEXP (operands[1], 0) = force_reg (SImode, XEXP (operands[1], 0));
794 emit_call_insn (gen_call_value_internal (operands[0],
795 XEXP (operands[1], 0),
800 (define_insn "call_value_internal"
801 [(set (match_operand 0 "" "=d")
802 (call (mem:QI (match_operand:SI 1 "call_address_operand" "aS"))
803 (match_operand:SI 2 "general_operand" "g")))]
806 [(set_attr "cc" "clobber")])
812 [(set_attr "cc" "none")])
814 ;; ----------------------------------------------------------------------
815 ;; EXTEND INSTRUCTIONS
816 ;; ----------------------------------------------------------------------
818 (define_insn "zero_extendqisi2"
819 [(set (match_operand:SI 0 "general_operand" "=d,d,d")
821 (match_operand:QI 1 "general_operand" "0,d,m")))]
827 [(set_attr "cc" "none_0hit")])
829 (define_insn "zero_extendhisi2"
830 [(set (match_operand:SI 0 "general_operand" "=d,d,d")
832 (match_operand:HI 1 "general_operand" "0,d,m")))]
838 [(set_attr "cc" "none_0hit")])
840 ;;- sign extension instructions
842 (define_insn "extendqisi2"
843 [(set (match_operand:SI 0 "general_operand" "=d,d")
845 (match_operand:QI 1 "general_operand" "0,d")))]
850 [(set_attr "cc" "none_0hit")])
852 (define_insn "extendhisi2"
853 [(set (match_operand:SI 0 "general_operand" "=d,d")
855 (match_operand:HI 1 "general_operand" "0,d")))]
860 [(set_attr "cc" "none_0hit")])
862 ;; ----------------------------------------------------------------------
864 ;; ----------------------------------------------------------------------
866 (define_insn "ashlsi3"
867 [(set (match_operand:SI 0 "register_operand" "=da,d,a,d,a,d,a,d")
869 (match_operand:SI 1 "register_operand" "0,0,0,0,0,0,0,0")
870 (match_operand:QI 2 "nonmemory_operand" "J,K,K,M,M,L,L,di")))]
877 add %0,%0\;add %0,%0\;add %0,%0
879 add %0,%0\;add %0,%0\;add %0,%0\;add %0,%0
881 [(set_attr "cc" "set_zn_c0")])
883 (define_insn "lshrsi3"
884 [(set (match_operand:SI 0 "register_operand" "=d")
886 (match_operand:SI 1 "register_operand" "0")
887 (match_operand:QI 2 "nonmemory_operand" "di")))]
890 [(set_attr "cc" "set_zn_c0")])
892 (define_insn "ashrsi3"
893 [(set (match_operand:SI 0 "register_operand" "=d")
895 (match_operand:SI 1 "register_operand" "0")
896 (match_operand:QI 2 "nonmemory_operand" "di")))]
899 [(set_attr "cc" "set_zn_c0")])
901 ;; ----------------------------------------------------------------------
903 ;; ----------------------------------------------------------------------
904 (define_expand "prologue"
907 "expand_prologue (); DONE;")
909 (define_expand "epilogue"
918 (define_insn "return_internal"
922 [(set_attr "cc" "clobber")])
924 ;; This insn restores the callee saved registers and does a return, it
925 ;; can also deallocate stack space.
926 (define_insn "return_internal_regs"
928 (match_operand:SI 0 "const_int_operand" "i")
931 "ret [d2,d3,a2,a3],%0"
932 [(set_attr "cc" "clobber")])
934 (define_insn "store_movm"
937 "movm [d2,d3,a2,a3],(sp)"
938 [(set_attr "cc" "clobber")])
940 (define_insn "return"
942 "can_use_return_insn ()"
944 [(set_attr "cc" "clobber")])
946 ;; Try to combine consecutive updates of the stack pointer (or any
947 ;; other register for that matter).
949 [(set (match_operand:SI 0 "register_operand" "=dax")
950 (plus:SI (match_dup 0)
951 (match_operand 1 "const_int_operand" "")))
953 (plus:SI (match_dup 0)
954 (match_operand 2 "const_int_operand" "")))]
958 operands[1] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[1]));
959 return \"add %1,%0\";
961 [(set_attr "cc" "clobber")])
964 ;; We had patterns to check eq/ne, but the they don't work because
965 ;; 0x80000000 + 0x80000000 = 0x0 with a carry out.
967 ;; The Z flag and C flag would be set, and we have no way to
968 ;; check for the Z flag set and C flag clear.
970 ;; This will work on the mn10200 because we can check the ZX flag
971 ;; if the comparison is in HImode.
973 [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
974 (set (pc) (if_then_else (ge (cc0) (const_int 0))
975 (match_operand 1 "" "")
977 "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
979 [(set_attr "cc" "clobber")])
982 [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
983 (set (pc) (if_then_else (lt (cc0) (const_int 0))
984 (match_operand 1 "" "")
986 "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
988 [(set_attr "cc" "clobber")])
991 [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
992 (set (pc) (if_then_else (ge (cc0) (const_int 0))
994 (match_operand 1 "" "")))]
995 "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
997 [(set_attr "cc" "clobber")])
1000 [(set (cc0) (match_operand:SI 0 "register_operand" "d"))
1001 (set (pc) (if_then_else (lt (cc0) (const_int 0))
1003 (match_operand 1 "" "")))]
1004 "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
1006 [(set_attr "cc" "clobber")])