From cbf464bd936b926a34bbc04e8ccd39afd4c5815a Mon Sep 17 00:00:00 2001 From: zack Date: Thu, 12 Aug 2004 07:49:00 +0000 Subject: * genpreds.c: Add capability to generate predicate bodies as well as function prototypes. Write function prototypes for the generic predicates too. (process_define_predicate, write_tm_preds_h, write_insn_preds_c) (write_predicate_subfunction, mark_mode_tests, add_mode_tests) (write_match_code, write_predicate_expr, write_one_predicate_function) (parse_option): New functions. (output_predicate_decls): Delete. (main): Read the machine description, process DEFINE_PREDICATE or DEFINE_SPECIAL_PREDICATE patterns, write tm-preds.h or insn-preds.c as appropriate. * genrecog.c (struct decision_test): Replace index with struct pred_data pointer. (next_index): Remove, unused. (pred_table, preds, special_mode_pred_table): Delete. (compute_predicate_codes, process_define_predicate): New functions. (validate_pattern, add_to_sequence, write_switch): Update for new data structures. (main): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. Check both error_count and have_error. * gensupport.c (in_fname, first_predicate): New globals. (define_pred_queue, define_pred_tail): New RTL-pattern queue. (predicate_table, last_predicate, old_pred_table) (old_special_pred_table): New statics. (hash_struct_pred_data, eq_struct_pred_data, lookup_predicate) (add_predicate, init_predicate_table): New functions. (process_rtx): Handle DEFINE_PREDICATE and DEFINE_SPECIAL_PREDICATE. (init_md_reader_args_cb): Use the global in_fname. No need to zero it or max_include_len. Call init_predicate_table. (read_rtx): Run the predicate queue after the attribute queue but before all the others. * gensupport.h (in_fname, struct pred_data, first_predicate) (lookup_predicate, add_predicate, FOR_ALL_PREDICATES): Declare. * rtl.def (MATCH_CODE, MATCH_TEST, DEFINE_PREDICATE) (DEFINE_SPECIAL_PREDICATE): New RTL codes. * dummy-conditions.c: Don't include bconfig.h, system.h, coretypes.h, tm.h, or system.h. Do include stddef.h. Duplicate declaration of struct c_test from gensupport.h. * Makefile.in (OBJS-common): Add insn-preds.o. (STAGESTUFF, .PRECIOUS): Add insn-preds.c. (insn-preds.c, insn-preds.o): New rules. (s-preds): Also generate insn-preds.c. (dummy-conditions.o, genpreds$(build_exeext), genpreds.o): Update dependencies. (print-rtl.o, print-rtl1.o): Correct dependencies. * recog.h: Delete prototypes of predicate functions. * doc/md.texi (Predicates): New section with complete documentation of operand/operator predicates. Remove some incomplete documentation of predicates from other places. * doc/tm.texi (Misc): Move SPECIAL_MODE_PREDICATES next to PREDICATE_CODES; indicate that both are deprecated in favor of define_predicate/define_special_predicate. * config/ia64/ia64.c: All predicate function definitions moved to ia64.md, except (small_addr_symbolic_operand, tls_symbolic_operand): Delete. (ia64_expand_load_address, ia64_expand_move): Check SYMBOL_REF_TLS_MODEL directly, don't use tls_symbolic_operand. * config/ia64/ia64.md: All predicates now defined here. (symbolic_operand): Is now a special predicate. * config/ia64/ia64.h: Declare ia64_section_threshold. (PREDICATE_CODES): Delete. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85855 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/dummy-conditions.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'gcc/dummy-conditions.c') diff --git a/gcc/dummy-conditions.c b/gcc/dummy-conditions.c index eb3fb417314..95db257bd09 100644 --- a/gcc/dummy-conditions.c +++ b/gcc/dummy-conditions.c @@ -1,5 +1,5 @@ /* Support for calculating constant conditions. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2004 Free Software Foundation, Inc. This file is part of GCC. @@ -18,16 +18,22 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "bconfig.h" -#include "system.h" -#include "coretypes.h" -#include "tm.h" -#include "gensupport.h" +#include /* for size_t */ /* MD generators that are run before insn-conditions.c exists should link against this file instead. Currently that is genconditions and genconstants. */ +/* In order to avoid dragging in all the headers that are needed to + declare things that gensupport.h uses, we duplicate the declaration + of struct c_test here. (In particular we do not want to have to + include tm.h nor rtl.h in this file.) */ +struct c_test +{ + const char *expr; + int value; +}; + /* Empty conditions table to prevent link errors. */ const struct c_test insn_conditions[1] = { { 0, 0 } }; const size_t n_insn_conditions = 0; -- cgit v1.2.1