1 /* Generate code from machine description to emit insns as rtl.
2 Copyright (C) 1987, 1988, 1991, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
3 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
24 #include "coretypes.h"
29 #include "gensupport.h"
32 static int insn_code_number
;
33 static int insn_index_number
;
35 /* Data structure for recording the patterns of insns that have CLOBBERs.
36 We use this to output a function that adds these CLOBBERs to a
37 previously-allocated PARALLEL expression. */
41 struct clobber_ent
*insns
;
44 struct clobber_pat
*next
;
48 /* Records one insn that uses the clobber list. */
52 int code_number
; /* Counts only insns. */
53 struct clobber_ent
*next
;
56 static void print_code (RTX_CODE
);
57 static void gen_exp (rtx
, enum rtx_code
, char *);
58 static void gen_insn (rtx
, int);
59 static void gen_expand (rtx
);
60 static void gen_split (rtx
);
61 static void output_add_clobbers (void);
62 static void output_added_clobbers_hard_reg_p (void);
63 static void gen_rtx_scratch (rtx
, enum rtx_code
);
64 static void output_peephole2_scratches (rtx
);
68 print_code (RTX_CODE code
)
71 for (p1
= GET_RTX_NAME (code
); *p1
; p1
++)
72 putchar (TOUPPER(*p1
));
76 gen_rtx_scratch (rtx x
, enum rtx_code subroutine_type
)
78 if (subroutine_type
== DEFINE_PEEPHOLE2
)
80 printf ("operand%d", XINT (x
, 0));
84 printf ("gen_rtx_SCRATCH (%smode)", GET_MODE_NAME (GET_MODE (x
)));
88 /* Print a C expression to construct an RTX just like X,
89 substituting any operand references appearing within. */
92 gen_exp (rtx x
, enum rtx_code subroutine_type
, char *used
)
113 if (used
[XINT (x
, 0)])
115 printf ("copy_rtx (operand%d)", XINT (x
, 0));
118 used
[XINT (x
, 0)] = 1;
120 printf ("operand%d", XINT (x
, 0));
124 printf ("gen_rtx_fmt_");
125 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
127 printf (" (GET_CODE (operand%d), ", XINT (x
, 0));
128 if (GET_MODE (x
) == VOIDmode
)
129 printf ("GET_MODE (operand%d)", XINT (x
, 0));
131 printf ("%smode", GET_MODE_NAME (GET_MODE (x
)));
132 for (i
= 0; i
< XVECLEN (x
, 1); i
++)
135 gen_exp (XVECEXP (x
, 1, i
), subroutine_type
, used
);
141 printf ("gen_rtx_fmt_");
142 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
144 printf (" (GET_CODE (operand%d)", XINT (x
, 0));
145 printf (", %smode", GET_MODE_NAME (GET_MODE (x
)));
146 for (i
= 0; i
< XVECLEN (x
, 2); i
++)
149 gen_exp (XVECEXP (x
, 2, i
), subroutine_type
, used
);
156 printf ("operand%d", XINT (x
, 0));
160 gen_rtx_scratch (x
, subroutine_type
);
164 fatal ("ADDRESS expression code used in named instruction pattern");
170 if (REG_P (XEXP (x
, 0)))
172 printf ("gen_hard_reg_clobber (%smode, %i)", GET_MODE_NAME (GET_MODE (XEXP (x
, 0))),
173 REGNO (XEXP (x
, 0)));
184 printf ("const0_rtx");
185 else if (INTVAL (x
) == 1)
186 printf ("const1_rtx");
187 else if (INTVAL (x
) == -1)
188 printf ("constm1_rtx");
189 else if (-MAX_SAVED_CONST_INT
<= INTVAL (x
)
190 && INTVAL (x
) <= MAX_SAVED_CONST_INT
)
191 printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]",
193 else if (INTVAL (x
) == STORE_FLAG_VALUE
)
194 printf ("const_true_rtx");
197 printf ("GEN_INT (");
198 printf (HOST_WIDE_INT_PRINT_DEC_C
, INTVAL (x
));
205 /* These shouldn't be written in MD files. Instead, the appropriate
206 routines in varasm.c should be called. */
215 printf (" (%smode", GET_MODE_NAME (GET_MODE (x
)));
217 fmt
= GET_RTX_FORMAT (code
);
218 len
= GET_RTX_LENGTH (code
);
219 for (i
= 0; i
< len
; i
++)
227 gen_exp (XEXP (x
, i
), subroutine_type
, used
);
231 printf ("%u", XINT (x
, i
));
235 printf ("\"%s\"", XSTR (x
, i
));
241 printf ("gen_rtvec (%d", XVECLEN (x
, i
));
242 for (j
= 0; j
< XVECLEN (x
, i
); j
++)
245 gen_exp (XVECEXP (x
, i
, j
), subroutine_type
, used
);
258 /* Generate the `gen_...' function for a DEFINE_INSN. */
261 gen_insn (rtx insn
, int lineno
)
263 struct pattern_stats stats
;
266 /* See if the pattern for this insn ends with a group of CLOBBERs of (hard)
267 registers or MATCH_SCRATCHes. If so, store away the information for
272 int has_hard_reg
= 0;
274 for (i
= XVECLEN (insn
, 1) - 1; i
> 0; i
--)
276 if (GET_CODE (XVECEXP (insn
, 1, i
)) != CLOBBER
)
279 if (REG_P (XEXP (XVECEXP (insn
, 1, i
), 0)))
281 else if (GET_CODE (XEXP (XVECEXP (insn
, 1, i
), 0)) != MATCH_SCRATCH
)
285 if (i
!= XVECLEN (insn
, 1) - 1)
287 struct clobber_pat
*p
;
288 struct clobber_ent
*link
= XNEW (struct clobber_ent
);
291 link
->code_number
= insn_code_number
;
293 /* See if any previous CLOBBER_LIST entry is the same as this
296 for (p
= clobber_list
; p
; p
= p
->next
)
298 if (p
->first_clobber
!= i
+ 1
299 || XVECLEN (p
->pattern
, 1) != XVECLEN (insn
, 1))
302 for (j
= i
+ 1; j
< XVECLEN (insn
, 1); j
++)
304 rtx old_rtx
= XEXP (XVECEXP (p
->pattern
, 1, j
), 0);
305 rtx new_rtx
= XEXP (XVECEXP (insn
, 1, j
), 0);
307 /* OLD and NEW_INSN are the same if both are to be a SCRATCH
309 or if both are registers of the same mode and number. */
310 if (! (GET_MODE (old_rtx
) == GET_MODE (new_rtx
)
311 && ((GET_CODE (old_rtx
) == MATCH_SCRATCH
312 && GET_CODE (new_rtx
) == MATCH_SCRATCH
)
313 || (REG_P (old_rtx
) && REG_P (new_rtx
)
314 && REGNO (old_rtx
) == REGNO (new_rtx
)))))
318 if (j
== XVECLEN (insn
, 1))
324 p
= XNEW (struct clobber_pat
);
328 p
->first_clobber
= i
+ 1;
329 p
->next
= clobber_list
;
330 p
->has_hard_reg
= has_hard_reg
;
334 link
->next
= p
->insns
;
339 /* Don't mention instructions whose names are the null string
340 or begin with '*'. They are in the machine description just
342 if (XSTR (insn
, 0)[0] == 0 || XSTR (insn
, 0)[0] == '*')
345 printf ("/* %s:%d */\n", read_md_filename
, lineno
);
347 /* Find out how many operands this function has. */
348 get_pattern_stats (&stats
, XVEC (insn
, 1));
349 if (stats
.max_dup_opno
> stats
.max_opno
)
350 fatal ("match_dup operand number has no match_operand");
352 /* Output the function name and argument declarations. */
353 printf ("rtx\ngen_%s (", XSTR (insn
, 0));
354 if (stats
.num_generator_args
)
355 for (i
= 0; i
< stats
.num_generator_args
; i
++)
357 printf (",\n\trtx operand%d ATTRIBUTE_UNUSED", i
);
359 printf ("rtx operand%d ATTRIBUTE_UNUSED", i
);
365 /* Output code to construct and return the rtl for the instruction body. */
367 if (XVECLEN (insn
, 1) == 1)
370 gen_exp (XVECEXP (insn
, 1, 0), DEFINE_INSN
, NULL
);
375 char *used
= XCNEWVEC (char, stats
.num_generator_args
);
377 printf (" return gen_rtx_PARALLEL (VOIDmode, gen_rtvec (%d",
380 for (i
= 0; i
< XVECLEN (insn
, 1); i
++)
383 gen_exp (XVECEXP (insn
, 1, i
), DEFINE_INSN
, used
);
385 printf ("));\n}\n\n");
390 /* Generate the `gen_...' function for a DEFINE_EXPAND. */
393 gen_expand (rtx expand
)
395 struct pattern_stats stats
;
399 if (strlen (XSTR (expand
, 0)) == 0)
400 fatal ("define_expand lacks a name");
401 if (XVEC (expand
, 1) == 0)
402 fatal ("define_expand for %s lacks a pattern", XSTR (expand
, 0));
404 /* Find out how many operands this function has. */
405 get_pattern_stats (&stats
, XVEC (expand
, 1));
407 /* Output the function name and argument declarations. */
408 printf ("rtx\ngen_%s (", XSTR (expand
, 0));
409 if (stats
.num_generator_args
)
410 for (i
= 0; i
< stats
.num_generator_args
; i
++)
412 printf (",\n\trtx operand%d", i
);
414 printf ("rtx operand%d", i
);
420 /* If we don't have any C code to write, only one insn is being written,
421 and no MATCH_DUPs are present, we can just return the desired insn
422 like we do for a DEFINE_INSN. This saves memory. */
423 if ((XSTR (expand
, 3) == 0 || *XSTR (expand
, 3) == '\0')
424 && stats
.max_opno
>= stats
.max_dup_opno
425 && XVECLEN (expand
, 1) == 1)
428 gen_exp (XVECEXP (expand
, 1, 0), DEFINE_EXPAND
, NULL
);
433 /* For each operand referred to only with MATCH_DUPs,
434 make a local variable. */
435 for (i
= stats
.num_generator_args
; i
<= stats
.max_dup_opno
; i
++)
436 printf (" rtx operand%d;\n", i
);
437 for (; i
<= stats
.max_scratch_opno
; i
++)
438 printf (" rtx operand%d ATTRIBUTE_UNUSED;\n", i
);
439 printf (" rtx _val = 0;\n");
440 printf (" start_sequence ();\n");
442 /* The fourth operand of DEFINE_EXPAND is some code to be executed
443 before the actual construction.
444 This code expects to refer to `operands'
445 just as the output-code in a DEFINE_INSN does,
446 but here `operands' is an automatic array.
447 So copy the operand values there before executing it. */
448 if (XSTR (expand
, 3) && *XSTR (expand
, 3))
451 if (stats
.num_operand_vars
> 0)
452 printf (" rtx operands[%d];\n", stats
.num_operand_vars
);
454 /* Output code to copy the arguments into `operands'. */
455 for (i
= 0; i
< stats
.num_generator_args
; i
++)
456 printf (" operands[%d] = operand%d;\n", i
, i
);
458 /* Output the special code to be executed before the sequence
460 print_md_ptr_loc (XSTR (expand
, 3));
461 printf ("%s\n", XSTR (expand
, 3));
463 /* Output code to copy the arguments back out of `operands'
464 (unless we aren't going to use them at all). */
465 if (XVEC (expand
, 1) != 0)
467 for (i
= 0; i
< stats
.num_operand_vars
; i
++)
469 printf (" operand%d = operands[%d];\n", i
, i
);
470 printf (" (void) operand%d;\n", i
);
476 /* Output code to construct the rtl for the instruction bodies.
477 Use emit_insn to add them to the sequence being accumulated.
478 But don't do this if the user's code has set `no_more' nonzero. */
480 used
= XCNEWVEC (char, stats
.num_operand_vars
);
482 for (i
= 0; i
< XVECLEN (expand
, 1); i
++)
484 rtx next
= XVECEXP (expand
, 1, i
);
485 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
486 || (GET_CODE (next
) == PARALLEL
487 && ((GET_CODE (XVECEXP (next
, 0, 0)) == SET
488 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
489 || GET_CODE (XVECEXP (next
, 0, 0)) == RETURN
))
490 || GET_CODE (next
) == RETURN
)
491 printf (" emit_jump_insn (");
492 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
493 || GET_CODE (next
) == CALL
494 || (GET_CODE (next
) == PARALLEL
495 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
496 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
497 || (GET_CODE (next
) == PARALLEL
498 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
499 printf (" emit_call_insn (");
500 else if (LABEL_P (next
))
501 printf (" emit_label (");
502 else if (GET_CODE (next
) == MATCH_OPERAND
503 || GET_CODE (next
) == MATCH_DUP
504 || GET_CODE (next
) == MATCH_OPERATOR
505 || GET_CODE (next
) == MATCH_OP_DUP
506 || GET_CODE (next
) == MATCH_PARALLEL
507 || GET_CODE (next
) == MATCH_PAR_DUP
508 || GET_CODE (next
) == PARALLEL
)
511 printf (" emit_insn (");
512 gen_exp (next
, DEFINE_EXPAND
, used
);
514 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
515 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
516 printf (" emit_barrier ();");
521 /* Call `get_insns' to extract the list of all the
522 insns emitted within this gen_... function. */
524 printf (" _val = get_insns ();\n");
525 printf (" end_sequence ();\n");
526 printf (" return _val;\n}\n\n");
529 /* Like gen_expand, but generates insns resulting from splitting SPLIT. */
532 gen_split (rtx split
)
534 struct pattern_stats stats
;
536 const char *const name
=
537 ((GET_CODE (split
) == DEFINE_PEEPHOLE2
) ? "peephole2" : "split");
541 if (XVEC (split
, 0) == 0)
542 fatal ("define_%s (definition %d) lacks a pattern", name
,
544 else if (XVEC (split
, 2) == 0)
545 fatal ("define_%s (definition %d) lacks a replacement pattern", name
,
548 /* Find out how many operands this function has. */
550 get_pattern_stats (&stats
, XVEC (split
, 2));
551 unused
= (stats
.num_operand_vars
== 0 ? " ATTRIBUTE_UNUSED" : "");
552 used
= XCNEWVEC (char, stats
.num_operand_vars
);
554 /* Output the prototype, function name and argument declarations. */
555 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
557 printf ("extern rtx gen_%s_%d (rtx, rtx *);\n",
558 name
, insn_code_number
);
559 printf ("rtx\ngen_%s_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
560 name
, insn_code_number
, unused
);
564 printf ("extern rtx gen_split_%d (rtx, rtx *);\n", insn_code_number
);
565 printf ("rtx\ngen_split_%d (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands%s)\n",
566 insn_code_number
, unused
);
570 /* Declare all local variables. */
571 for (i
= 0; i
< stats
.num_operand_vars
; i
++)
572 printf (" rtx operand%d;\n", i
);
573 printf (" rtx _val = 0;\n");
575 if (GET_CODE (split
) == DEFINE_PEEPHOLE2
)
576 output_peephole2_scratches (split
);
578 printf (" start_sequence ();\n");
580 /* The fourth operand of DEFINE_SPLIT is some code to be executed
581 before the actual construction. */
585 print_md_ptr_loc (XSTR (split
, 3));
586 printf ("%s\n", XSTR (split
, 3));
589 /* Output code to copy the arguments back out of `operands' */
590 for (i
= 0; i
< stats
.num_operand_vars
; i
++)
592 printf (" operand%d = operands[%d];\n", i
, i
);
593 printf (" (void) operand%d;\n", i
);
596 /* Output code to construct the rtl for the instruction bodies.
597 Use emit_insn to add them to the sequence being accumulated.
598 But don't do this if the user's code has set `no_more' nonzero. */
600 for (i
= 0; i
< XVECLEN (split
, 2); i
++)
602 rtx next
= XVECEXP (split
, 2, i
);
603 if ((GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
)
604 || (GET_CODE (next
) == PARALLEL
605 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
606 && GET_CODE (SET_DEST (XVECEXP (next
, 0, 0))) == PC
)
607 || GET_CODE (next
) == RETURN
)
608 printf (" emit_jump_insn (");
609 else if ((GET_CODE (next
) == SET
&& GET_CODE (SET_SRC (next
)) == CALL
)
610 || GET_CODE (next
) == CALL
611 || (GET_CODE (next
) == PARALLEL
612 && GET_CODE (XVECEXP (next
, 0, 0)) == SET
613 && GET_CODE (SET_SRC (XVECEXP (next
, 0, 0))) == CALL
)
614 || (GET_CODE (next
) == PARALLEL
615 && GET_CODE (XVECEXP (next
, 0, 0)) == CALL
))
616 printf (" emit_call_insn (");
617 else if (LABEL_P (next
))
618 printf (" emit_label (");
619 else if (GET_CODE (next
) == MATCH_OPERAND
620 || GET_CODE (next
) == MATCH_OPERATOR
621 || GET_CODE (next
) == MATCH_PARALLEL
622 || GET_CODE (next
) == MATCH_OP_DUP
623 || GET_CODE (next
) == MATCH_DUP
624 || GET_CODE (next
) == PARALLEL
)
627 printf (" emit_insn (");
628 gen_exp (next
, GET_CODE (split
), used
);
630 if (GET_CODE (next
) == SET
&& GET_CODE (SET_DEST (next
)) == PC
631 && GET_CODE (SET_SRC (next
)) == LABEL_REF
)
632 printf (" emit_barrier ();");
635 /* Call `get_insns' to make a list of all the
636 insns emitted within this gen_... function. */
638 printf (" _val = get_insns ();\n");
639 printf (" end_sequence ();\n");
640 printf (" return _val;\n}\n\n");
645 /* Write a function, `add_clobbers', that is given a PARALLEL of sufficient
646 size for the insn and an INSN_CODE, and inserts the required CLOBBERs at
647 the end of the vector. */
650 output_add_clobbers (void)
652 struct clobber_pat
*clobber
;
653 struct clobber_ent
*ent
;
656 printf ("\n\nvoid\nadd_clobbers (rtx pattern ATTRIBUTE_UNUSED, int insn_code_number)\n");
658 printf (" switch (insn_code_number)\n");
661 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
663 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
664 printf (" case %d:\n", ent
->code_number
);
666 for (i
= clobber
->first_clobber
; i
< XVECLEN (clobber
->pattern
, 1); i
++)
668 printf (" XVECEXP (pattern, 0, %d) = ", i
);
669 gen_exp (XVECEXP (clobber
->pattern
, 1, i
),
670 GET_CODE (clobber
->pattern
), NULL
);
674 printf (" break;\n\n");
677 printf (" default:\n");
678 printf (" gcc_unreachable ();\n");
683 /* Write a function, `added_clobbers_hard_reg_p' that is given an insn_code
684 number that will have clobbers added (as indicated by `recog') and returns
685 1 if those include a clobber of a hard reg or 0 if all of them just clobber
689 output_added_clobbers_hard_reg_p (void)
691 struct clobber_pat
*clobber
;
692 struct clobber_ent
*ent
;
695 printf ("\n\nint\nadded_clobbers_hard_reg_p (int insn_code_number)\n");
697 printf (" switch (insn_code_number)\n");
700 for (clobber_p
= 0; clobber_p
<= 1; clobber_p
++)
703 for (clobber
= clobber_list
; clobber
; clobber
= clobber
->next
)
704 if (clobber
->has_hard_reg
== clobber_p
)
705 for (ent
= clobber
->insns
; ent
; ent
= ent
->next
)
707 printf (" case %d:\n", ent
->code_number
);
712 printf (" return %d;\n\n", clobber_p
);
715 printf (" default:\n");
716 printf (" gcc_unreachable ();\n");
721 /* Generate code to invoke find_free_register () as needed for the
722 scratch registers used by the peephole2 pattern in SPLIT. */
725 output_peephole2_scratches (rtx split
)
731 for (i
= 0; i
< XVECLEN (split
, 0); i
++)
733 rtx elt
= XVECEXP (split
, 0, i
);
734 if (GET_CODE (elt
) == MATCH_SCRATCH
)
736 int last_insn_nr
= insn_nr
;
737 int cur_insn_nr
= insn_nr
;
739 for (j
= i
+ 1; j
< XVECLEN (split
, 0); j
++)
740 if (GET_CODE (XVECEXP (split
, 0, j
)) == MATCH_DUP
)
742 if (XINT (XVECEXP (split
, 0, j
), 0) == XINT (elt
, 0))
743 last_insn_nr
= cur_insn_nr
;
745 else if (GET_CODE (XVECEXP (split
, 0, j
)) != MATCH_SCRATCH
)
750 printf (" HARD_REG_SET _regs_allocated;\n");
751 printf (" CLEAR_HARD_REG_SET (_regs_allocated);\n");
755 printf (" if ((operands[%d] = peep2_find_free_register (%d, %d, \"%s\", %smode, &_regs_allocated)) == NULL_RTX)\n\
758 insn_nr
, last_insn_nr
,
760 GET_MODE_NAME (GET_MODE (elt
)));
763 else if (GET_CODE (elt
) != MATCH_DUP
)
769 main (int argc
, char **argv
)
773 progname
= "genemit";
775 if (!init_rtx_reader_args (argc
, argv
))
776 return (FATAL_EXIT_CODE
);
778 /* Assign sequential codes to all entries in the machine description
779 in parallel with the tables in insn-output.c. */
781 insn_code_number
= 0;
782 insn_index_number
= 0;
784 printf ("/* Generated automatically by the program `genemit'\n\
785 from the machine description file `md'. */\n\n");
787 printf ("#include \"config.h\"\n");
788 printf ("#include \"system.h\"\n");
789 printf ("#include \"coretypes.h\"\n");
790 printf ("#include \"tm.h\"\n");
791 printf ("#include \"rtl.h\"\n");
792 printf ("#include \"tm_p.h\"\n");
793 printf ("#include \"function.h\"\n");
794 printf ("#include \"expr.h\"\n");
795 printf ("#include \"optabs.h\"\n");
796 printf ("#include \"dfp.h\"\n");
797 printf ("#include \"flags.h\"\n");
798 printf ("#include \"output.h\"\n");
799 printf ("#include \"insn-config.h\"\n");
800 printf ("#include \"hard-reg-set.h\"\n");
801 printf ("#include \"recog.h\"\n");
802 printf ("#include \"resource.h\"\n");
803 printf ("#include \"reload.h\"\n");
804 printf ("#include \"diagnostic-core.h\"\n");
805 printf ("#include \"regs.h\"\n");
806 printf ("#include \"tm-constrs.h\"\n");
807 printf ("#include \"ggc.h\"\n");
808 printf ("#include \"basic-block.h\"\n");
809 printf ("#include \"integrate.h\"\n\n");
810 printf ("#define FAIL return (end_sequence (), _val)\n");
811 printf ("#define DONE return (_val = get_insns (), end_sequence (), _val)\n\n");
813 /* Read the machine description. */
819 desc
= read_md_rtx (&line_no
, &insn_code_number
);
823 switch (GET_CODE (desc
))
826 gen_insn (desc
, line_no
);
830 printf ("/* %s:%d */\n", read_md_filename
, line_no
);
835 printf ("/* %s:%d */\n", read_md_filename
, line_no
);
839 case DEFINE_PEEPHOLE2
:
840 printf ("/* %s:%d */\n", read_md_filename
, line_no
);
850 /* Write out the routines to add CLOBBERs to a pattern and say whether they
851 clobber a hard reg. */
852 output_add_clobbers ();
853 output_added_clobbers_hard_reg_p ();
856 return (ferror (stdout
) != 0 ? FATAL_EXIT_CODE
: SUCCESS_EXIT_CODE
);