* rtl.h (mem_for_const_double): New declaration.
* varasm.c (mem_for_const_double): New function.
* config/convex/convex.md (movdf): Use it.
* config/m68k/hp320.h (LEGITIMATE_PIC_OPERAND_P): Likewise.
* config/m68k/linux.h, config/m68k/m68k.h: Likewise.
* config/m68k/m68kv4.h: Likewise.
From-SVN: r46808
Tue Nov 6 09:21:34 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * rtl.h (mem_for_const_double): New declaration.
+ * varasm.c (mem_for_const_double): New function.
+ * config/convex/convex.md (movdf): Use it.
+ * config/m68k/hp320.h (LEGITIMATE_PIC_OPERAND_P): Likewise.
+ * config/m68k/linux.h, config/m68k/m68k.h: Likewise.
+ * config/m68k/m68kv4.h: Likewise.
+
* config/alpha/alpha.h (SECONDARY_MEMORY_NEEDED): Adjust for addition
of new GP reg classes.
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=d")
(match_operand:DF 1 "const_double_operand" "F"))]
- "CONST_DOUBLE_MEM (operands[1]) == const0_rtx"
+ "mem_for_const_double (operands[1]) == 0"
"ld.u %u1,%0\;ld.w %v1,%0"
[(set_attr "type" "xalu")])
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
+ && GET_CODE (mem_for_const_double (X)) == MEM \
+ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
+ VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
/* hpux8 and later have C++ compatible include files, so do not
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
+ && GET_CODE (mem_for_const_double (X)) == MEM \
+ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
+ VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
/* Turn off function cse if we are doing PIC. We always want function
#define LEGITIMATE_PIC_OPERAND_P(X) \
((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), \
- VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
+ && GET_CODE (mem_for_const_double (X)) == MEM \
+ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
+ VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
#undef LEGITIMATE_PIC_OPERAND_P
#define LEGITIMATE_PIC_OPERAND_P(X) \
((! symbolic_operand (X, VOIDmode) \
- && ! (GET_CODE (X) == CONST_DOUBLE && CONST_DOUBLE_MEM (X) \
- && GET_CODE (CONST_DOUBLE_MEM (X)) == MEM \
- && symbolic_operand (XEXP (CONST_DOUBLE_MEM (X), 0), VOIDmode))) \
- || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
+ && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
+ && GET_CODE (mem_for_const_double (X)) == MEM \
+ && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
+ VOIDmode))) \
+ || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
|| PCREL_GENERAL_OPERAND_OK)
/* Turn off function cse if we are doing PIC. We always want function call
/* In varasm.c */
extern rtx immed_double_const PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode));
+extern rtx mem_for_const_double PARAMS ((rtx));
extern rtx force_const_mem PARAMS ((enum machine_mode, rtx));
/* In varasm.c */
return ptr;
}
\f
+/* Given a constant rtx X, return a MEM for the location in memory at which
+ this constant has been placed. Return 0 if it not has been placed yet. */
+
+rtx
+mem_for_const_double (x)
+ rtx x;
+{
+ enum machine_mode mode = GET_MODE (x);
+ struct constant_descriptor *desc;
+
+ for (desc = const_rtx_hash_table[const_hash_rtx (mode, x)]; desc;
+ desc = desc->next)
+ if (compare_constant_rtx (mode, x, desc))
+ return desc->rtl;
+
+ return 0;
+}
+
/* Given a constant rtx X, make (or find) a memory constant for its value
and return a MEM rtx to refer to it in memory. */