summaryrefslogtreecommitdiff
path: root/gcc/rtl.def
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-28 03:28:18 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-28 03:28:18 +0000
commit026d38685a306238520bd2dc743b94e66ecf450f (patch)
treebfe845d7fbc0991a92a6a103f30e8889f0bd0a62 /gcc/rtl.def
parent89ada49235886dd26d5c0d710132c9f66e1493f4 (diff)
downloadgcc-026d38685a306238520bd2dc743b94e66ecf450f.tar.gz
* rtl.def (define_constraint, define_register_constraint)
(define_memory_constraint, define_address_constraint): New MD forms. * gensupport.c (process_rtx): Put define_constraint etc on the predicate queue. * genpreds.c (process_define_predicate): Adjust comment. Validate the name, and call validate_exp to validate the expression. (mark_mode_tests, write_extract_subexp): Can assume correct input. (write_predicate_expr): Likewise. NAME argument no longer necessary; all callers changed. (validate_exp, needs_variable, struct constraint_data) (constraints_by_letter_table, first_constraint, last_constraint_ptr) (FOR_ALL_CONSTRAINTS, generic_constraint_letters, const_int_constraints) (const_dbl_constraints, constraint_max_namelen) (have_register_constraints, have_memory_constraints) (have_address_constraints, have_address_constraints) (have_extra_constraints, have_const_int_constraints) (have_const_dbl_constraints, mangle, add_constraint) (process_define_constraint, process_define_register_constraint) (write_enum_constraint_num, write_lookup_constraint) (write_insn_constraint_len, write_regclass_for_constraint) (write_constraint_satisfied_p, write_insn_const_int_ok_for_constraint) (write_insn_extra_memory_constraint) (write_insn_extra_address_constraint) (write_satisfies_constraint_fns): New. (write_tm_preds_h): If we have new-style constraint definitions, prototype the functions generated from them, and define the old constraint interface (still used by generic code) in terms of those functions. (write_insn_preds_c): If we have new-style constraint definitions, generate all relevant functions from those definitions. (main): Handle define_constraint etc. * genoutput.c (struct constraint_data, indep_constraints) (mdep_constraint_letters, constraints_by_letter_table, note_constraint) (mdep_constraint_len): New data structures and functions, defined #ifdef USE_MD_CONSTRAINTS. (check_constraint_len): Don't define #ifdef USE_MD_CONSTRAINTS. (validate_insn_alternatives): If USE_MD_CONSTRAINTS is defined, use new logic to validate operand constraints against constraint definitions. (main): Process define_constraint etc. if USE_MD_CONSTRAINTS is defined. * defaults.h: If none of the old-style constraint macros are defined, define USE_MD_CONSTRAINTS; do not provide defaults for any old-style macros; and poison REG_CLASS_FROM_LETTER, CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P, and EXTRA_CONSTRAINT. * recog.c (reg_fits_class_p): If cl is NO_REGS, return 0 immediately. * doc/md.texi: Document new constraint-definition mechanism and the C interface it provides. Remove references to old mechanism elsewhere in the document. (Machine Constraints): Use pathnames relative to gcc directory, i.e. config/ARCH/FILE. Change i386 section to refer to config/i386/predicates.md; update that section to match docstrings. * doc/tm.texi: Move all documentation of the old constraint- definition macros to their own section, clearly mark as obsolete. * config/i386/predicates.md (R, q, Q, l, a, b, c, d, S, D, A, f, t) (u, y, x, Y, I, J, K, L, M, N, O, G, C, e, Z): New constraint definitions. * config/i386/i386.h (REG_CLASS_FROM_LETTER, CONST_OK_FOR_LETTER_P) (CONST_DOUBLE_OK_FOR_LETTER_P, EXTRA_CONSTRAINT): Delete. * config/i386/i386.md (*movdf_nointeger): Remove stray 'H' from constraint strings. (splits and peepholes): Use satisfies_constraint_*. * config/i386/i386.c (memory_address_length) (ix86_attr_length_immediate_default): Use satisfies_constraint_*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111508 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.def')
-rw-r--r--gcc/rtl.def55
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/rtl.def b/gcc/rtl.def
index 8710f54890f..84b24bc543b 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -874,6 +874,61 @@ DEF_RTL_EXPR(DEFINE_COND_EXEC, "define_cond_exec", "Ess", RTX_EXTRA)
DEF_RTL_EXPR(DEFINE_PREDICATE, "define_predicate", "ses", RTX_EXTRA)
DEF_RTL_EXPR(DEFINE_SPECIAL_PREDICATE, "define_special_predicate", "ses", RTX_EXTRA)
+/* Definition of a register operand constraint. This simply maps the
+ constraint string to a register class.
+
+ Operand:
+ 0: The name of the constraint (often, but not always, a single letter).
+ 1: A C expression which evaluates to the appropriate register class for
+ this constraint. If this is not just a constant, it should look only
+ at -m switches and the like.
+ 2: A docstring for this constraint, in Texinfo syntax; not currently
+ used, in future will be incorporated into the manual's list of
+ machine-specific operand constraints. */
+DEF_RTL_EXPR(DEFINE_REGISTER_CONSTRAINT, "define_register_constraint", "sss", RTX_EXTRA)
+
+/* Definition of a non-register operand constraint. These look at the
+ operand and decide whether it fits the constraint.
+
+ DEFINE_CONSTRAINT gets no special treatment if it fails to match.
+ It is appropriate for constant-only constraints, and most others.
+
+ DEFINE_MEMORY_CONSTRAINT tells reload that this constraint can be made
+ to match, if it doesn't already, by converting the operand to the form
+ (mem (reg X)) where X is a base register. It is suitable for constraints
+ that describe a subset of all memory references.
+
+ DEFINE_ADDRESS_CONSTRAINT tells reload that this constraint can be made
+ to match, if it doesn't already, by converting the operand to the form
+ (reg X) where X is a base register. It is suitable for constraints that
+ describe a subset of all address references.
+
+ When in doubt, use plain DEFINE_CONSTRAINT.
+
+ Operand:
+ 0: The name of the constraint (often, but not always, a single letter).
+ 1: A docstring for this constraint, in Texinfo syntax; not currently
+ used, in future will be incorporated into the manual's list of
+ machine-specific operand constraints.
+ 2: A boolean expression which computes whether or not the constraint
+ matches. It should follow the same rules as a define_predicate
+ expression, including the bit about specifying the set of RTX codes
+ that could possibly match. MATCH_TEST subexpressions may make use of
+ these variables:
+ `op' - the RTL object defining the operand.
+ `mode' - the mode of `op'.
+ `ival' - INTVAL(op), if op is a CONST_INT.
+ `hval' - CONST_DOUBLE_HIGH(op), if op is an integer CONST_DOUBLE.
+ `lval' - CONST_DOUBLE_LOW(op), if op is an integer CONST_DOUBLE.
+ `rval' - CONST_DOUBLE_REAL_VALUE(op), if op is a floating-point
+ CONST_DOUBLE.
+ Do not use ival/hval/lval/rval if op is not the appropriate kind of
+ RTL object. */
+DEF_RTL_EXPR(DEFINE_CONSTRAINT, "define_constraint", "sse", RTX_EXTRA)
+DEF_RTL_EXPR(DEFINE_MEMORY_CONSTRAINT, "define_memory_constraint", "sse", RTX_EXTRA)
+DEF_RTL_EXPR(DEFINE_ADDRESS_CONSTRAINT, "define_address_constraint", "sse", RTX_EXTRA)
+
+
/* Constructions for CPU pipeline description described by NDFAs. */
/* (define_cpu_unit string [string]) describes cpu functional