+/* Describes how a symbol is used.
+
+ SYMBOL_CONTEXT_CALL
+ The symbol is used as the target of a call instruction.
+
+ SYMBOL_CONTEXT_LEA
+ The symbol is used in a load-address operation.
+
+ SYMBOL_CONTEXT_MEM
+ The symbol is used as the address in a MEM. */
+enum mips_symbol_context {
+ SYMBOL_CONTEXT_CALL,
+ SYMBOL_CONTEXT_LEA,
+ SYMBOL_CONTEXT_MEM
+};
+
+/* Classifies a SYMBOL_REF, LABEL_REF or UNSPEC address.
+
+ SYMBOL_ABSOLUTE
+ The symbol's value will be calculated using absolute relocations,
+ such as %hi and %lo.
+
+ SYMBOL_GP_RELATIVE
+ The symbol's value will be calculated by adding a 16-bit offset
+ from $gp.
+
+ SYMBOL_PC_RELATIVE
+ The symbol's value will be calculated using a MIPS16 PC-relative
+ calculation.
+
+ SYMBOL_FORCE_TO_MEM
+ The symbol's value must be forced to memory and loaded from there.
+
+ SYMBOL_GOT_PAGE_OFST
+ The symbol's value will be calculated by loading an address
+ from the GOT and then applying a 16-bit offset.
+
+ SYMBOL_GOT_DISP
+ The symbol's value will be loaded directly from the GOT.
+
+ SYMBOL_GOTOFF_PAGE
+ An UNSPEC wrapper around a SYMBOL_GOT_PAGE_OFST. It represents the
+ offset from _gp of the GOT entry.
+
+ SYMBOL_GOTOFF_DISP
+ An UNSPEC wrapper around a SYMBOL_GOT_DISP. It represents the
+ the offset from _gp of the symbol's GOT entry.
+
+ SYMBOL_GOTOFF_CALL
+ Like SYMBOL_GOTOFF_DISP, but used when calling a global function.
+ The GOT entry is allowed to point to a stub rather than to the
+ function itself.
+
+ SYMBOL_GOTOFF_LOADGP
+ An UNSPEC wrapper around a function's address. It represents the
+ offset of _gp from the start of the function.
+
+ SYMBOL_TLS
+ A thread-local symbol.
+
+ SYMBOL_TLSGD
+ SYMBOL_TLSLDM
+ SYMBOL_DTPREL
+ SYMBOL_GOTTPREL
+ SYMBOL_TPREL
+ UNSPEC wrappers around SYMBOL_TLS, corresponding to the
+ thread-local storage relocation operators.
+
+ SYMBOL_32_HIGH
+ For a 32-bit symbolic address X, this is the value of %hi(X).
+
+ SYMBOL_64_HIGH
+ For a 64-bit symbolic address X, this is the value of
+ (%highest(X) << 16) + %higher(X).
+
+ SYMBOL_64_MID
+ For a 64-bit symbolic address X, this is the value of
+ (%higher(X) << 16) + %hi(X).
+
+ SYMBOL_64_LOW
+ For a 64-bit symbolic address X, this is the value of
+ (%hi(X) << 16) + %lo(X).
+
+ SYMBOL_HALF
+ An UNSPEC wrapper around any kind of address. It represents the
+ low 16 bits of that address. */
+enum mips_symbol_type {
+ SYMBOL_ABSOLUTE,
+ SYMBOL_GP_RELATIVE,
+ SYMBOL_PC_RELATIVE,
+ SYMBOL_FORCE_TO_MEM,
+ SYMBOL_GOT_PAGE_OFST,
+ SYMBOL_GOT_DISP,
+ SYMBOL_GOTOFF_PAGE,
+ SYMBOL_GOTOFF_DISP,
+ SYMBOL_GOTOFF_CALL,
+ SYMBOL_GOTOFF_LOADGP,
+ SYMBOL_TLS,
+ SYMBOL_TLSGD,
+ SYMBOL_TLSLDM,
+ SYMBOL_DTPREL,
+ SYMBOL_GOTTPREL,
+ SYMBOL_TPREL,
+ SYMBOL_32_HIGH,
+ SYMBOL_64_HIGH,
+ SYMBOL_64_MID,
+ SYMBOL_64_LOW,
+ SYMBOL_HALF
+};
+#define NUM_SYMBOL_TYPES (SYMBOL_HALF + 1)
+
+/* Identifiers a style of $gp initialization sequence.
+
+ LOADGP_NONE
+ No initialization sequence is needed.
+
+ LOADGP_OLDABI
+ The o32 and o64 PIC sequence (the kind traditionally generated
+ by .cpload).
+
+ LOADGP_NEWABI
+ The n32 and n64 PIC sequence (the kind traditionally generated
+ by .cpsetup).
+
+ LOADGP_ABSOLUTE
+ The GNU absolute sequence, as generated by loadgp_absolute.
+
+ LOADGP_RTP
+ The VxWorks RTP PIC sequence, as generated by loadgp_rtp. */
+enum mips_loadgp_style {
+ LOADGP_NONE,
+ LOADGP_OLDABI,
+ LOADGP_NEWABI,
+ LOADGP_ABSOLUTE,
+ LOADGP_RTP
+};
+
+struct mips16e_save_restore_info;
+
+/* Classifies a type of call.
+
+ MIPS_CALL_NORMAL
+ A normal call or call_value pattern.
+
+ MIPS_CALL_SIBCALL
+ A sibcall or sibcall_value pattern.
+
+ MIPS_CALL_EPILOGUE
+ A call inserted in the epilogue. */
+enum mips_call_type {
+ MIPS_CALL_NORMAL,
+ MIPS_CALL_SIBCALL,
+ MIPS_CALL_EPILOGUE
+};
+
+extern bool mips_symbolic_constant_p (rtx, enum mips_symbol_context,
+ enum mips_symbol_type *);
+extern int mips_regno_mode_ok_for_base_p (int, enum machine_mode, bool);
+extern bool mips_stack_address_p (rtx, enum machine_mode);
+extern int mips_address_insns (rtx, enum machine_mode, bool);