/* Register Transfer Language (RTL) definitions for GNU C-Compiler
- Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91-95, 1996 Free Software Foundation, Inc.
This file is part of GNU CC.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include "machmode.h"
#undef FFS /* Some systems predefine this symbol; don't let it interfere. */
#undef FLOAT /* Likewise. */
+#undef ABS /* Likewise. */
+#undef PC /* Likewise. */
+
+#ifndef TREE_CODE
+union tree_node;
+#endif
/* Register Transfer Language EXPRESSIONS CODES */
/* The cast here, saves many elsewhere. */
extern int rtx_length[];
-#define GET_RTX_LENGTH(CODE) (rtx_length[(int)(CODE)])
+#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
extern char *rtx_name[];
-#define GET_RTX_NAME(CODE) (rtx_name[(int)(CODE)])
+#define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
extern char *rtx_format[];
-#define GET_RTX_FORMAT(CODE) (rtx_format[(int)(CODE)])
+#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
extern char rtx_class[];
-#define GET_RTX_CLASS(CODE) (rtx_class[(int)(CODE)])
+#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
\f
/* Common union for an element of an rtx. */
typedef struct rtx_def
{
#ifdef ONLY_INT_FIELDS
+#ifdef CODE_FIELD_BUG
+ unsigned int code : 16;
+#else
unsigned short code;
+#endif
#else
/* The kind of expression this is. */
enum rtx_code code : 16;
/* 1 in a MEM or REG if value of this expression will never change
during the current function, even though it is not
manifestly constant.
+ 1 in a SUBREG if it is from a promoted variable that is unsigned.
1 in a SYMBOL_REF if it addresses something in the per-function
constants pool.
1 in a CALL_INSN if it is a const call.
if it is deleted.
1 in a REG expression if corresponds to a variable declared by the user.
0 for an internally generated temporary.
- In a SYMBOL_REF, this flag is used for machine-specific purposes. */
+ In a SYMBOL_REF, this flag is used for machine-specific purposes.
+ In a LABEL_REF or in a REG_LABEL note, this is LABEL_REF_NONLOCAL_P. */
unsigned int volatil : 1;
/* 1 in a MEM referring to a field of a structure (not a union!).
0 if the MEM was a variable or the result of a * operator in C;
1 if it was the result of a . or -> operator (on a struct) in C.
1 in a REG if the register is used only in exit code a loop.
+ 1 in a SUBREG expression if was generated from a variable with a
+ promoted mode.
1 in a CODE_LABEL if the label is used for nonlocal gotos
and must not be deleted even if its count is zero.
1 in a LABEL_REF if this is a reference to a label outside the
rtunion fld[1];
} *rtx;
-/* Add prototype support. */
-#ifndef PROTO
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define PROTO(ARGS) ARGS
-#else
-#define PROTO(ARGS) ()
-#endif
-#endif
+#include "gansidecl.h"
#define NULL_RTX (rtx) 0
-/* Define a generic NULL if one hasn't already been defined. */
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-#ifndef GENERIC_PTR
-#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-#define GENERIC_PTR void *
-#else
-#define GENERIC_PTR char *
-#endif
-#endif
-
-#ifndef NULL_PTR
-#define NULL_PTR ((GENERIC_PTR)0)
-#endif
-
/* Define macros to access the `code' field of the rtx. */
#ifdef SHORT_ENUM_BUG
/* Names for REG_NOTE's in EXPR_LIST insn's. */
extern char *reg_note_name[];
-#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
+#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
+
+/* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
+ USE and CLOBBER expressions.
+ USE expressions list the registers filled with arguments that
+ are passed to the function.
+ CLOBBER expressions document the registers explicitly clobbered
+ by this CALL_INSN.
+ Pseudo registers can not be mentioned in this list. */
+#define CALL_INSN_FUNCTION_USAGE(INSN) ((INSN)->fld[7].rtx)
/* The label-number of a code-label. The assembler label
is made from `L' and the label-number printed in decimal.
#define NOTE_LINE_NUMBER(INSN) ((INSN)->fld[4].rtint)
/* Codes that appear in the NOTE_LINE_NUMBER field
- for kinds of notes that are not line numbers. */
+ for kinds of notes that are not line numbers.
-/* This note indicates the end of the real body of the function,
- after moving the parms into their homes, etc. */
-#define NOTE_INSN_FUNCTION_BEG 0
+ Notice that we do not try to use zero here for any of
+ the special note codes because sometimes the source line
+ actually can be zero! This happens (for example) when we
+ are generating code for the per-translation-unit constructor
+ and destructor routines for some C++ translation unit.
+
+ If you should change any of the following values, or if you
+ should add a new value here, don't forget to change the
+ note_insn_name array in rtl.c. */
/* This note is used to get rid of an insn
when it isn't safe to patch the insn out of the chain. */
#define NOTE_INSN_EPILOGUE_BEG -11
/* Generated in place of user-declared labels when they are deleted. */
#define NOTE_INSN_DELETED_LABEL -12
-/* Don't forget to change note_insn_name in rtl.c. */
+/* This note indicates the start of the real body of the function,
+ i.e. the point just after all of the parms have been moved into
+ their homes, etc. */
+#define NOTE_INSN_FUNCTION_BEG -13
+/* These note where exception handling regions begin and end. */
+#define NOTE_INSN_EH_REGION_BEG -14
+#define NOTE_INSN_EH_REGION_END -15
#if 0 /* These are not used, and I don't know what they were for. --rms. */
of LABEL_REFs that point at it, so unused labels can be deleted. */
#define LABEL_NUSES(LABEL) ((LABEL)->fld[5].rtint)
+/* The rest is used instead of the above, in a CODE_LABEL,
+ if bytecode is being output.
+ We make the slightly kludgy assumption that a LABEL has enough slots
+ to hold these things. That happens to be true. */
+
+/* For static or external objects. */
+#define BYTECODE_LABEL(X) (XEXP ((X), 0))
+
+/* For goto labels inside bytecode functions. */
+#define BYTECODE_BC_LABEL(X) (*(struct bc_label **) &XEXP ((X), 1))
+
/* In jump.c, each JUMP_INSN can point to a label that it can jump to,
so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
be decremented and possibly the label can be deleted. */
#define SUBREG_REG(RTX) ((RTX)->fld[0].rtx)
#define SUBREG_WORD(RTX) ((RTX)->fld[1].rtint)
+/* 1 if the REG contained in SUBREG_REG is already known to be
+ sign- or zero-extended from the mode of the SUBREG to the mode of
+ the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the
+ extension.
+
+ When used as a LHS, is means that this extension must be done
+ when assigning to SUBREG_REG. */
+
+#define SUBREG_PROMOTED_VAR_P(RTX) ((RTX)->in_struct)
+#define SUBREG_PROMOTED_UNSIGNED_P(RTX) ((RTX)->unchanging)
+
/* Access various components of an ASM_OPERANDS rtx. */
#define ASM_OPERANDS_TEMPLATE(RTX) XSTR ((RTX), 0)
#define LABEL_OUTSIDE_LOOP_P(RTX) ((RTX)->in_struct)
/* For a LABEL_REF, 1 means it is for a nonlocal label. */
+/* Likewise in an EXPR_LIST for a REG_LABEL note. */
#define LABEL_REF_NONLOCAL_P(RTX) ((RTX)->volatil)
/* For a CODE_LABEL, 1 means always consider this label to be needed. */
with the preceding insn. */
#define SCHED_GROUP_P(INSN) ((INSN)->in_struct)
+/* During sched, for the LOG_LINKS of an insn, these cache the adjusted
+ cost of the dependence link. The cost of executing an instruction
+ may vary based on how the results are used. LINK_COST_ZERO is 1 when
+ the cost through the link varies and is unchanged (i.e., the link has
+ zero additional cost). LINK_COST_FREE is 1 when the cost through the
+ link is zero (i.e., the link makes the cost free). In other cases,
+ the adjustment to the cost is recomputed each time it is needed. */
+#define LINK_COST_ZERO(X) ((X)->jump)
+#define LINK_COST_FREE(X) ((X)->call)
+
/* For a SET rtx, SET_DEST is the place that is set
and SET_SRC is the value it is set to. */
#define SET_DEST(RTX) ((RTX)->fld[0].rtx)
FUNCTION_ARGS_SIZE is the size of the argument block in the stack.
POPS_ARGS is the number of bytes of input arguments popped by the function
STACK_SLOT_LIST is the list of stack slots.
+ FORCED_LABELS is the list of labels whose address was taken.
FUNCTION_FLAGS are where single-bit flags are saved.
OUTGOING_ARGS_SIZE is the size of the largest outgoing stack parameter list.
ORIGINAL_ARG_VECTOR is a vector of the original DECL_RTX values
for the function arguments.
ORIGINAL_DECL_INITIAL is a pointer to the original DECL_INITIAL for the
function.
+ INLINE_REGNO_REG_RTX, INLINE_REGNO_POINTER_FLAG, and
+ INLINE_REGNO_POINTER_ALIGN are pointers to the corresponding arrays.
We want this to lay down like an INSN. The PREV_INSN field
is always NULL. The NEXT_INSN field always points to the
#define FUNCTION_ARGS_SIZE(RTX) ((RTX)->fld[8].rtint)
#define POPS_ARGS(RTX) ((RTX)->fld[9].rtint)
#define STACK_SLOT_LIST(RTX) ((RTX)->fld[10].rtx)
-#define FUNCTION_FLAGS(RTX) ((RTX)->fld[11].rtint)
-#define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[12].rtint)
-#define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[13].rtvec)
-#define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[14].rtx)
+#define FORCED_LABELS(RTX) ((RTX)->fld[11].rtx)
+#define FUNCTION_FLAGS(RTX) ((RTX)->fld[12].rtint)
+#define OUTGOING_ARGS_SIZE(RTX) ((RTX)->fld[13].rtint)
+#define ORIGINAL_ARG_VECTOR(RTX) ((RTX)->fld[14].rtvec)
+#define ORIGINAL_DECL_INITIAL(RTX) ((RTX)->fld[15].rtx)
+#define INLINE_REGNO_REG_RTX(RTX) ((RTX)->fld[16].rtvec)
+#define INLINE_REGNO_POINTER_FLAG(RTX) ((RTX)->fld[17].rtstr)
+#define INLINE_REGNO_POINTER_ALIGN(RTX) ((RTX)->fld[18].rtstr)
/* In FUNCTION_FLAGS we save some variables computed when emitting the code
for the function and which must be `or'ed into the current flag values when
extern rtx plus_constant_wide PROTO((rtx, HOST_WIDE_INT));
extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
-#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (N))
+#define GEN_INT(N) gen_rtx (CONST_INT, VOIDmode, (HOST_WIDE_INT) (N))
-#if 0
-/* We cannot define prototypes for the variable argument functions,
- since they have not been ANSI-fied, and an ANSI compiler would
- complain when compiling the definition of these functions. */
+extern rtx bc_gen_rtx ();
-extern rtx gen_rtx PROTO((enum rtx_code, enum machine_mode, ...));
-extern rtvec gen_rtvec PROTO((int, ...));
+extern rtx gen_rtx PVPROTO((enum rtx_code,
+ enum machine_mode, ...));
+extern rtvec gen_rtvec PVPROTO((int, ...));
-#else
-extern rtx gen_rtx ();
-extern rtvec gen_rtvec ();
-#endif
-
-#ifdef BUFSIZ /* stdio.h has been included */
-extern rtx read_rtx PROTO((FILE *));
-#else
-extern rtx read_rtx ();
-#endif
+extern rtx read_rtx STDIO_PROTO((FILE *));
#if 0
/* At present, don't prototype xrealloc, since all of the callers don't
cast their pointers to char *, and all of the xrealloc's don't use
void * yet. */
-extern char *xrealloc PROTO((void *, unsigned));
+extern char *xmalloc PROTO((size_t));
+extern char *xrealloc PROTO((void *, size_t));
#else
+extern char *xmalloc ();
extern char *xrealloc ();
#endif
-extern char *xmalloc PROTO((unsigned));
extern char *oballoc PROTO((int));
extern char *permalloc PROTO((int));
extern void free PROTO((void *));
extern rtvec rtvec_alloc PROTO((int));
extern rtx find_reg_note PROTO((rtx, enum reg_note, rtx));
extern rtx find_regno_note PROTO((rtx, enum reg_note, int));
+extern int find_reg_fusage PROTO((rtx, enum rtx_code, rtx));
+extern int find_regno_fusage PROTO((rtx, enum rtx_code, int));
extern HOST_WIDE_INT get_integer_term PROTO((rtx));
extern rtx get_related_value PROTO((rtx));
extern rtx single_set PROTO((rtx));
extern rtx copy_most_rtx PROTO((rtx, rtx));
extern rtx replace_rtx PROTO((rtx, rtx, rtx));
extern rtvec gen_rtvec_v PROTO((int, rtx *));
+extern rtvec gen_rtvec_vv PROTO((int, rtunion *));
extern rtx gen_reg_rtx PROTO((enum machine_mode));
extern rtx gen_label_rtx PROTO((void));
-extern rtx gen_inline_header_rtx PROTO((rtx, rtx, int, int, int, int, int, int, rtx, int, int, rtvec, rtx));
+extern rtx gen_inline_header_rtx PROTO((rtx, rtx, int, int, int, int,
+ int, int, rtx, rtx, int, int,
+ rtvec, rtx,
+ rtvec, char *, char *));
extern rtx gen_lowpart_common PROTO((enum machine_mode, rtx));
extern rtx gen_lowpart PROTO((enum machine_mode, rtx));
extern rtx gen_lowpart_if_possible PROTO((enum machine_mode, rtx));
+extern rtx gen_highpart PROTO((enum machine_mode, rtx));
+extern rtx gen_realpart PROTO((enum machine_mode, rtx));
+extern rtx gen_imagpart PROTO((enum machine_mode, rtx));
extern rtx operand_subword PROTO((rtx, int, int, enum machine_mode));
extern rtx operand_subword_force PROTO((rtx, int, enum machine_mode));
extern int subreg_lowpart_p PROTO((rtx));
extern rtx make_safe_from PROTO((rtx, rtx));
+extern rtx convert_memory_address PROTO((enum machine_mode, rtx));
extern rtx memory_address PROTO((enum machine_mode, rtx));
extern rtx get_insns PROTO((void));
extern rtx get_last_insn PROTO((void));
extern rtx get_pool_constant PROTO((rtx));
extern enum machine_mode get_pool_mode PROTO((rtx));
extern int get_pool_offset PROTO((rtx));
+extern rtx simplify_subtraction PROTO((rtx));
extern rtx assign_stack_local PROTO((enum machine_mode, int, int));
extern rtx assign_stack_temp PROTO((enum machine_mode, int, int));
+extern rtx assign_temp PROTO((union tree_node *, int,
+ int, int));
extern rtx protect_from_queue PROTO((rtx, int));
extern void emit_queue PROTO((void));
extern rtx emit_move_insn PROTO((rtx, rtx));
extern rtx emit_insn PROTO((rtx));
extern rtx emit_insns PROTO((rtx));
extern rtx emit_insns_before PROTO((rtx, rtx));
+extern rtx emit_insns_after PROTO((rtx, rtx));
extern rtx emit_jump_insn PROTO((rtx));
extern rtx emit_call_insn PROTO((rtx));
extern rtx emit_label PROTO((rtx));
extern rtx gen_bge PROTO((rtx));
extern rtx gen_ble PROTO((rtx));
extern rtx eliminate_constant_term PROTO((rtx, rtx *));
+extern rtx expand_complex_abs PROTO((enum machine_mode, rtx, rtx, int));
+extern enum machine_mode choose_hard_reg_mode PROTO((int, int));
/* Maximum number of parallel sets and clobbers in any insn in this fn.
Always at least 3, since the combiner could put that many togetherm
go through these unique rtx objects. */
extern rtx stack_pointer_rtx;
extern rtx frame_pointer_rtx;
+extern rtx hard_frame_pointer_rtx;
extern rtx arg_pointer_rtx;
extern rtx pic_offset_table_rtx;
extern rtx struct_value_rtx;
extern rtx static_chain_rtx;
extern rtx static_chain_incoming_rtx;
+/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
+ is used to represent the frame pointer. This is because the
+ hard frame pointer and the automatic variables are separated by an amount
+ that cannot be determined until after register allocation. We can assume
+ that in this case ELIMINABLE_REGS will be defined, one action of which
+ will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */
+#ifndef HARD_FRAME_POINTER_REGNUM
+#define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
+#endif
+
/* Virtual registers are used during RTL generation to refer to locations into
the stack frame when the actual location isn't known until RTL generation
is complete. The routine instantiate_virtual_regs replaces these with
#define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
-/* If FRAME_GROWS_DOWNWARDS, this points to immediately above the first
+/* If FRAME_GROWS_DOWNWARD, this points to immediately above the first
variable on the stack. Otherwise, it points to the first variable on
the stack. */
expr.h to be included for the enumeration. */
extern rtx expand_expr ();
-extern rtx immed_real_const_1();
-#ifdef TREE_CODE
-/* rtl.h and tree.h were included. */
-extern rtx output_constant_def PROTO((tree));
-extern rtx immed_real_const PROTO((tree));
-extern rtx immed_real_const_1 PROTO((REAL_VALUE_TYPE, enum machine_mode));
-extern tree make_tree PROTO((tree, rtx));
+extern rtx output_constant_def PROTO((union tree_node *));
+extern rtx immed_real_const PROTO((union tree_node *));
+extern union tree_node *make_tree PROTO((union tree_node *, rtx));
-#else
-extern rtx output_constant_def ();
-extern rtx immed_real_const ();
-extern rtx immed_real_const_1 ();
-#endif
+/* Abort routines */
+extern void fatal_insn_not_found PROTO((rtx));
+extern void fatal_insn PROTO((char *, rtx));
/* Define a default value for STORE_FLAG_VALUE. */
/* Indexed by pseudo register number, gives the rtx for that pseudo.
Allocated in parallel with regno_pointer_flag. */
extern rtx *regno_reg_rtx;
+
+/* Vector indexed by regno; contains the alignment in bytes for a
+ register that contains a pointer, if known. */
+extern char *regno_pointer_align;
+#define REGNO_POINTER_ALIGN(REGNO) regno_pointer_align[REGNO]
+
+/* Translates rtx code to tree code, for those codes needed by
+ REAL_ARITHMETIC. The function returns an int because the caller may not
+ know what `enum tree_code' means. */
+
+extern int rtx_to_tree_code PROTO((enum rtx_code));