Commit 8c94f366 by Zack Weinberg Committed by Zack Weinberg

r110127@banpei: zack | 2006-01-22 14:49:27 -0800

 r110127@banpei:  zack | 2006-01-22 14:49:27 -0800
 	* genattrtab.c: Don't include genattrtab.h.  Define ATTR_NONE
 	and ATTR_SPECIAL (from genattrtab.h).  Don't define num_dfa_decls
 	nor any of the random handful of variables that used to be necessary
 	when this program was linked with rtlanal.o.  Prune set of forward
 	function declarations.
 	(struct attr_desc): Remove static_p field.
 	(hash_obstack, temp_obstack, attr_hash_table, attr_printf)
 	(check_attr_test, make_internal_attr, make_numeric_value): Make static.
 	(attr_string): Do not read the character one past the length of
 	the string.
 	(write_attr_get, find_attr, make_internal_attr): Don't touch static_p.
 	(struct insn_reserv, all_insn_reservs, last_insn_reserv_p)
 	(n_insn_reservs, gen_insn_reserv, struct bypass_list, all_bypasses)
 	(n_bypasses, gen_bypass_1, gen_bypass, process_bypasses)
 	(make_automaton_attrs): New.
 	(main): Do not call into genautomata.  Call local gen_bypass
 	and gen_insn_reserv as appropriate.  Call make_automaton_attrs.
 	Remove special case for insn_alts.
 	* genautomata.c: Include gensupport.h; not genattrtab.h nor
 	varray.h (leftover from previous change).  Prune set of forward
 	function declarations.  Remove state_alts fields from all
 	structures.  Remove state_alts_table from struct automaton.
 	Make everything except main static.  Do not maintain num_dfa_decls.
 	Do not maintain state_alts fields of various structures.
 	(process_decls): Don't validate condexp for dm_insn_reserv decls.
 	(add_arc): Remove state_alts argument.  All callers updated.
 	(output_reserved_units_table): Emit #ifdef here...
 	(output_tables): ...not here.  Don't generate state_alts tables.
 	(expand_automata): Don't generate attributes.
 	(write_automata): Don't generate state_alts functions.
 	(main): New function.
 	(it_is_empty_reserv_sets, output_state_alts_full_vect_name)
 	(output_state_alts_comb_vect_name, output_state_alts_check_vect_name)
 	(AUTOMATON_STATE_ALTS_MACRO_NAME, INTERNAL_STATE_ALTS_FUNC_NAME)
 	(STATE_ALTS_FUNC_NAME, INSN_DEFAULT_LATENCY_FUNC_NAME)
 	(BYPASS_P_FUNC_NAME, output_state_alts_table)
 	(output_automata_list_state_alts_code, output_internal_state_alts_func)
 	(output_state_alts_func, make_insn_alts_attr, make_bypass_attr)
 	(make_internal_dfa_insn_code_attr, make_default_insn_latency_attr):
 	Delete.
 	* genattr.c: Declare internal_dfa_insn_code in insn-attr.h.
 	* genattrtab.h: Delete file.
 	* Makefile.in (OBJS-common): Add insn-automata.o.
 	(insn-automata.o): New rule.
 	(simple_generated_c): Add insn-automata.c.
 	(build/genattrtab.o, build/genautomata.o): Update dependencies.
 	(genprogmd): Add automata.
 	(build/genattrtab): Needs no extra objects nor libraries.
 	(build/genautomata): Needs build/vec.o and -lm.

From-SVN: r110123
parent 5f2f0edd
2006-01-22 Zack Weinberg <zackw@panix.com>
* genattrtab.c: Don't include genattrtab.h. Define ATTR_NONE
and ATTR_SPECIAL (from genattrtab.h). Don't define num_dfa_decls
nor any of the random handful of variables that used to be necessary
when this program was linked with rtlanal.o. Prune set of forward
function declarations.
(struct attr_desc): Remove static_p field.
(hash_obstack, temp_obstack, attr_hash_table, attr_printf)
(check_attr_test, make_internal_attr, make_numeric_value): Make static.
(attr_string): Do not read the character one past the length of
the string.
(write_attr_get, find_attr, make_internal_attr): Don't touch static_p.
(struct insn_reserv, all_insn_reservs, last_insn_reserv_p)
(n_insn_reservs, gen_insn_reserv, struct bypass_list, all_bypasses)
(n_bypasses, gen_bypass_1, gen_bypass, process_bypasses)
(make_automaton_attrs): New.
(main): Do not call into genautomata. Call local gen_bypass
and gen_insn_reserv as appropriate. Call make_automaton_attrs.
Remove special case for insn_alts.
* genautomata.c: Include gensupport.h; not genattrtab.h nor
varray.h (leftover from previous change). Prune set of forward
function declarations. Remove state_alts fields from all
structures. Remove state_alts_table from struct automaton.
Make everything except main static. Do not maintain num_dfa_decls.
Do not maintain state_alts fields of various structures.
(process_decls): Don't validate condexp for dm_insn_reserv decls.
(add_arc): Remove state_alts argument. All callers updated.
(output_reserved_units_table): Emit #ifdef here...
(output_tables): ...not here. Don't generate state_alts tables.
(expand_automata): Don't generate attributes.
(write_automata): Don't generate state_alts functions.
(main): New function.
(it_is_empty_reserv_sets, output_state_alts_full_vect_name)
(output_state_alts_comb_vect_name, output_state_alts_check_vect_name)
(AUTOMATON_STATE_ALTS_MACRO_NAME, INTERNAL_STATE_ALTS_FUNC_NAME)
(STATE_ALTS_FUNC_NAME, INSN_DEFAULT_LATENCY_FUNC_NAME)
(BYPASS_P_FUNC_NAME, output_state_alts_table)
(output_automata_list_state_alts_code, output_internal_state_alts_func)
(output_state_alts_func, make_insn_alts_attr, make_bypass_attr)
(make_internal_dfa_insn_code_attr, make_default_insn_latency_attr):
Delete.
* genattr.c: Declare internal_dfa_insn_code in insn-attr.h.
* genattrtab.h: Delete file.
* Makefile.in (OBJS-common): Add insn-automata.o.
(insn-automata.o): New rule.
(simple_generated_c): Add insn-automata.c.
(build/genattrtab.o, build/genautomata.o): Update dependencies.
(genprogmd): Add automata.
(build/genattrtab): Needs no extra objects nor libraries.
(build/genautomata): Needs build/vec.o and -lm.
2006-01-22 Zack Weinberg <zackw@panix.com>
* genautomata.c (process_state_longest_path, max_dfa_issue_rate)
(output_dfa_max_issue_rate, locked_states_num): Delete.
(struct automaton): Add locked_states field.
......
......@@ -981,7 +981,7 @@ OBJS-common = \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
loop.o mode-switching.o modulo-sched.o optabs.o options.o opts.o \
params.o postreload.o postreload-gcse.o predict.o \
insn-preds.o pointer-set.o \
insn-preds.o insn-automata.o pointer-set.o \
print-rtl.o print-tree.o profile.o value-prof.o var-tracking.o \
real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
......@@ -2639,6 +2639,8 @@ genrtl.o : genrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H)\
insn-attrtab.o : insn-attrtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) real.h output.h $(INSN_ATTR_H) \
insn-config.h toplev.h $(RECOG_H) $(TM_P_H) $(FLAGS_H)
insn-automata.o : insn-automata.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(INSN_ATTR_H)
insn-emit.o : insn-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(EXPR_H) real.h output.h insn-config.h $(OPTABS_H) \
reload.h $(RECOG_H) toplev.h $(FUNCTION_H) $(FLAGS_H) hard-reg-set.h \
......@@ -2675,9 +2677,9 @@ insn-recog.o : insn-recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
simple_generated_h = insn-attr.h insn-codes.h insn-config.h insn-flags.h
simple_generated_c = insn-attrtab.c insn-emit.c insn-extract.c \
insn-opinit.c insn-output.c insn-peep.c \
insn-recog.c
simple_generated_c = insn-attrtab.c insn-automata.c insn-emit.c \
insn-extract.c insn-opinit.c insn-output.c \
insn-peep.c insn-recog.c
$(simple_generated_h): insn-%.h: s-%; @true
......@@ -2906,10 +2908,10 @@ build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h gensupport.h
build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) \
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) \
gensupport.h genattrtab.h
gensupport.h
build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \
genattrtab.h $(HASHTAB_H)
$(HASHTAB_H) gensupport.h
build/gencheck.o : gencheck.c gencheck.h tree.def $(BCONFIG_H) $(GTM_H) \
$(SYSTEM_H) coretypes.h $(lang_tree_files)
build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
......@@ -2960,14 +2962,15 @@ build/gen%$(build_exeext): build/gen%.o $(BUILD_LIBDEPS)
$(filter-out $(BUILD_LIBDEPS), $^) $(BUILD_LIBS)
# All these programs use the MD reader ($(BUILD_RTL)).
genprogmd = attr attrtab codes conditions config constants emit extract \
flags mddeps opinit output peep preds recog
genprogmd = attr attrtab automata codes conditions config constants emit \
extract flags mddeps opinit output peep preds recog
$(genprogmd:%=build/gen%$(build_exeext)): $(BUILD_RTL) $(BUILD_ERRORS)
# These programs need files over and above what they get from the above list.
build/genextract$(build_exeext) : build/vec.o
build/genattrtab$(build_exeext) : build/genautomata.o build/vec.o
build/genattrtab$(build_exeext) : BUILD_LIBS += -lm
build/genautomata$(build_exeext) : build/vec.o
build/genautomata$(build_exeext) : BUILD_LIBS += -lm
# These programs are not linked with the MD reader.
build/gengenrtl$(build_exeext) : $(BUILD_ERRORS)
......
......@@ -174,6 +174,8 @@ main (int argc, char **argv)
printf ("#define CPU_UNITS_QUERY 0\n");
printf ("#endif\n\n");
/* Interface itself: */
printf ("/* Internal insn code number used by automata. */\n");
printf ("extern int internal_dfa_insn_code (rtx);\n\n");
printf ("/* Insn latency time defined in define_insn_reservation. */\n");
printf ("extern int insn_default_latency (rtx);\n\n");
printf ("/* Return nonzero if there is a bypass for given insn\n");
......
/* External definitions of source files of genattrtab.
Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* Name of function (attribute) to translate insn into number of insn
alternatives reservation. */
#define INSN_ALTS_FUNC_NAME "insn_alts"
/* Defined in genattrtab.c: */
extern rtx check_attr_test (rtx, int, int);
extern rtx make_numeric_value (int);
extern void make_internal_attr (const char *, rtx, int);
extern char *attr_printf (unsigned int, const char *, ...)
ATTRIBUTE_PRINTF_2;
extern int num_dfa_decls;
/* Defined in genautomata.c: */
extern void gen_cpu_unit (rtx);
extern void gen_query_cpu_unit (rtx);
extern void gen_bypass (rtx);
extern void gen_excl_set (rtx);
extern void gen_presence_set (rtx);
extern void gen_final_presence_set (rtx);
extern void gen_absence_set (rtx);
extern void gen_final_absence_set (rtx);
extern void gen_automaton (rtx);
extern void gen_automata_option (rtx);
extern void gen_reserv (rtx);
extern void gen_insn_reserv (rtx);
extern void initiate_automaton_gen (int, char **);
extern void expand_automata (void);
extern void write_automata (void);
/* Flags for make_internal_attr's `special' parameter. */
#define ATTR_NONE 0
#define ATTR_SPECIAL (1 << 0)
#define ATTR_STATIC (1 << 1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment