rtl.h (mem_for_const_double): New declaration.

* 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
This commit is contained in:
Richard Kenner 2001-11-06 14:47:43 +00:00 committed by Richard Kenner
parent bfd82dbfc7
commit 03f5402658
8 changed files with 47 additions and 18 deletions

View File

@ -1,5 +1,12 @@
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.

View File

@ -206,7 +206,7 @@
(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")])

View File

@ -625,10 +625,11 @@ do { register int i; \
#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

View File

@ -310,10 +310,11 @@ do { \
#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

View File

@ -1459,11 +1459,11 @@ __transfer_from_trampoline () \
#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

View File

@ -278,10 +278,11 @@ int switch_table_difference_label_flag;
#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

View File

@ -1273,6 +1273,7 @@ extern rtx gen_sequence PARAMS ((void));
/* 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 */

View File

@ -3756,6 +3756,24 @@ record_constant_rtx (mode, x)
return ptr;
}
/* 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. */