+2007-08-08 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips-protos.h (SYMBOL_GENERAL): Rename to...
+ (SYMBOL_ABSOLUTE): ...this.
+ (SYMBOL_SMALL_DATA): Rename to...
+ (SYMBOL_GP_RELATIVE): ...this.
+ (SYMBOL_CONSTANT_POOL): Rename to...
+ (SYMBOL_PC_RELATIVE): ...this.
+ * config/mips/mips.c (mips_classify_symbol, mips_symbolic_constant_p)
+ (mips_symbolic_address_p, mips_symbol_insns, override_options)
+ (mips_rewrite_small_data_p, mips_use_anchors_for_symbol_p): Update
+ after above changes.
+ * config/mips/predicates.md (const_call_insn_operand): Likewise.
+ (general_symbolic_operand): Rename to...
+ (absolute_symbolic_operand): ...this.
+ * config/mips/mips.md: Update after above changes.
+
2007-08-08 Vladimir Yanovsky <yanov@il.ibm.com>
Revital Eres <eres@il.ibm.com>
if (GET_CODE (x) == LABEL_REF)
{
if (TARGET_MIPS16)
- return SYMBOL_CONSTANT_POOL;
+ return SYMBOL_PC_RELATIVE;
if (TARGET_ABICALLS && !TARGET_ABSOLUTE_ABICALLS)
return SYMBOL_GOT_PAGE_OFST;
- return SYMBOL_GENERAL;
+ return SYMBOL_ABSOLUTE;
}
gcc_assert (GET_CODE (x) == SYMBOL_REF);
if (CONSTANT_POOL_ADDRESS_P (x))
{
if (TARGET_MIPS16)
- return SYMBOL_CONSTANT_POOL;
+ return SYMBOL_PC_RELATIVE;
if (!TARGET_EMBEDDED_DATA
&& GET_MODE_SIZE (get_pool_mode (x)) <= mips_section_threshold)
- return SYMBOL_SMALL_DATA;
+ return SYMBOL_GP_RELATIVE;
}
/* Do not use small-data accesses for weak symbols; they may end up
being zero. */
if (SYMBOL_REF_SMALL_P (x)
&& !SYMBOL_REF_WEAK (x))
- return SYMBOL_SMALL_DATA;
+ return SYMBOL_GP_RELATIVE;
if (TARGET_ABICALLS)
{
/* Don't use GOT accesses for locally-binding symbols; we can use
%hi and %lo instead. */
if (TARGET_ABSOLUTE_ABICALLS && mips_symbol_binds_local_p (x))
- return SYMBOL_GENERAL;
+ return SYMBOL_ABSOLUTE;
/* There are three cases to consider:
return SYMBOL_GOT_PAGE_OFST;
}
- return SYMBOL_GENERAL;
+ return SYMBOL_ABSOLUTE;
}
/* Return true if OFFSET is within the range [0, ALIGN), where ALIGN
relocations. */
switch (*symbol_type)
{
- case SYMBOL_GENERAL:
+ case SYMBOL_ABSOLUTE:
case SYMBOL_64_HIGH:
case SYMBOL_64_MID:
case SYMBOL_64_LOW:
/* In other cases the relocations can handle any offset. */
return true;
- case SYMBOL_CONSTANT_POOL:
+ case SYMBOL_PC_RELATIVE:
/* Allow constant pool references to be converted to LABEL+CONSTANT.
In this case, we no longer have access to the underlying constant,
but the original symbol-based access was known to be valid. */
/* Fall through. */
- case SYMBOL_SMALL_DATA:
+ case SYMBOL_GP_RELATIVE:
/* Make sure that the offset refers to something within the
same object block. This should guarantee that the final
PC- or GP-relative offset is within the 16-bit limit. */
{
switch (symbol_type)
{
- case SYMBOL_GENERAL:
+ case SYMBOL_ABSOLUTE:
return !TARGET_MIPS16;
- case SYMBOL_SMALL_DATA:
+ case SYMBOL_GP_RELATIVE:
return true;
- case SYMBOL_CONSTANT_POOL:
+ case SYMBOL_PC_RELATIVE:
/* PC-relative addressing is only available for lw and ld. */
return GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8;
{
switch (type)
{
- case SYMBOL_GENERAL:
+ case SYMBOL_ABSOLUTE:
/* In mips16 code, general symbols must be fetched from the
constant pool. */
if (TARGET_MIPS16)
symbols we just need a preparatory lui. */
return (ABI_HAS_64BIT_SYMBOLS ? 6 : 2);
- case SYMBOL_SMALL_DATA:
+ case SYMBOL_GP_RELATIVE:
case SYMBOL_HALF:
return 1;
- case SYMBOL_CONSTANT_POOL:
+ case SYMBOL_PC_RELATIVE:
/* This case is for mips16 only. Assume we'll need an
extended instruction. */
return 2;
mips_hi_relocs[SYMBOL_64_LOW] = "%hi(";
mips_lo_relocs[SYMBOL_64_LOW] = "%lo(";
- mips_split_p[SYMBOL_GENERAL] = true;
- mips_lo_relocs[SYMBOL_GENERAL] = "%lo(";
+ mips_split_p[SYMBOL_ABSOLUTE] = true;
+ mips_lo_relocs[SYMBOL_ABSOLUTE] = "%lo(";
}
}
else
{
if (TARGET_EXPLICIT_RELOCS || mips_split_addresses)
{
- mips_split_p[SYMBOL_GENERAL] = true;
- mips_hi_relocs[SYMBOL_GENERAL] = "%hi(";
- mips_lo_relocs[SYMBOL_GENERAL] = "%lo(";
+ mips_split_p[SYMBOL_ABSOLUTE] = true;
+ mips_hi_relocs[SYMBOL_ABSOLUTE] = "%hi(";
+ mips_lo_relocs[SYMBOL_ABSOLUTE] = "%lo(";
}
}
if (TARGET_MIPS16)
{
/* The high part is provided by a pseudo copy of $gp. */
- mips_split_p[SYMBOL_SMALL_DATA] = true;
- mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gprel(";
+ mips_split_p[SYMBOL_GP_RELATIVE] = true;
+ mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gprel(";
}
if (TARGET_EXPLICIT_RELOCS)
{
/* Small data constants are kept whole until after reload,
then lowered by mips_rewrite_small_data. */
- mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gp_rel(";
+ mips_lo_relocs[SYMBOL_GP_RELATIVE] = "%gp_rel(";
mips_split_p[SYMBOL_GOT_PAGE_OFST] = true;
if (TARGET_NEWABI)
return (TARGET_EXPLICIT_RELOCS
&& mips_symbolic_constant_p (x, &symbol_type)
- && symbol_type == SYMBOL_SMALL_DATA);
+ && symbol_type == SYMBOL_GP_RELATIVE);
}
{
switch (mips_classify_symbol (symbol))
{
- case SYMBOL_CONSTANT_POOL:
- case SYMBOL_SMALL_DATA:
+ case SYMBOL_PC_RELATIVE:
+ case SYMBOL_GP_RELATIVE:
return false;
default:
[(set_attr "type" "store")
(set_attr "mode" "<MODE>")])
-;; An instruction to calculate the high part of a 64-bit SYMBOL_GENERAL.
+;; An instruction to calculate the high part of a 64-bit SYMBOL_ABSOLUTE.
;; The required value is:
;;
;; (%highest(op1) << 48) + (%higher(op1) << 32) + (%hi(op1) << 16)
;; to take effect.
(define_insn_and_split "*lea_high64"
[(set (match_operand:DI 0 "register_operand" "=d")
- (high:DI (match_operand:DI 1 "general_symbolic_operand" "")))]
+ (high:DI (match_operand:DI 1 "absolute_symbolic_operand" "")))]
"TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS"
"#"
"&& epilogue_completed"
;; daddu op1,op1,op0
(define_peephole2
[(set (match_operand:DI 1 "register_operand")
- (high:DI (match_operand:DI 2 "general_symbolic_operand")))
+ (high:DI (match_operand:DI 2 "absolute_symbolic_operand")))
(match_scratch:DI 0 "d")]
"TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS"
[(set (match_dup 1) (high:DI (match_dup 3)))
})
;; On most targets, the expansion of (lo_sum (high X) X) for a 64-bit
-;; SYMBOL_GENERAL X will take 6 cycles. This next pattern allows combine
+;; SYMBOL_ABSOLUTE X will take 6 cycles. This next pattern allows combine
;; to merge the HIGH and LO_SUM parts of a move if the HIGH part is only
;; used once. We can then use the sequence:
;;
;; which takes 4 cycles on most superscalar targets.
(define_insn_and_split "*lea64"
[(set (match_operand:DI 0 "register_operand" "=d")
- (match_operand:DI 1 "general_symbolic_operand" ""))
+ (match_operand:DI 1 "absolute_symbolic_operand" ""))
(clobber (match_scratch:DI 2 "=&d"))]
"TARGET_EXPLICIT_RELOCS && ABI_HAS_64BIT_SYMBOLS && cse_not_expected"
"#"
(match_dup 4)] UNSPEC_LOAD_GOT))]
{
operands[2] = pic_offset_table_rtx;
- operands[3] = mips_unspec_address (operands[0], SYMBOL_GENERAL);
+ operands[3] = mips_unspec_address (operands[0], SYMBOL_ABSOLUTE);
operands[4] = mips_unspec_address (operands[1], SYMBOL_HALF);
})