Commit 54401342 by Eric Christopher

mips.md (movdf_internal2): Add two new move constraints.

2002-03-15  Eric Christopher  <echristo@redhat.com>

	* config/mips/mips.md (movdf_internal2): Add two new move constraints.
	Fix register preference on last change.
	* config/mips/mips.c (mips_return_in_memory): New function.
	* config/mips/mips.h (RETURN_IN_MEMORY): Use.
	* config/mips/mips-protos.h: Declare.
	* config/mips/abi64.h (RETURN_IN_MEMORY): Remove. Add to above.
	* config/mips/elf64.h: Add #ifndef/#endif brackets around defaults.

From-SVN: r50869
parent 1ac458d4
......@@ -99,18 +99,6 @@ Boston, MA 02111-1307, USA. */
&& (FUNCTION_ARG_PADDING (MODE, TYPE) \
== (BYTES_BIG_ENDIAN ? upward : downward)))))
/* Under the old (i.e., 32 and O64 ABIs) all BLKmode objects are
returned in memory. Under the new (N32 and 64-bit MIPS ABIs) small
structures are returned in a register. Objects with varying size
must still be returned in memory, of course. */
#undef RETURN_IN_MEMORY
#define RETURN_IN_MEMORY(TYPE) \
((mips_abi == ABI_32 || mips_abi == ABI_O64) \
? TYPE_MODE (TYPE) == BLKmode \
: ((int_size_in_bytes (TYPE) \
> (2 * UNITS_PER_WORD)) \
|| (int_size_in_bytes (TYPE) == -1)))
#undef FUNCTION_VALUE
#define FUNCTION_VALUE(VALTYPE, FUNC) mips_function_value (VALTYPE, FUNC)
......
......@@ -22,11 +22,18 @@ Boston, MA 02111-1307, USA. */
#define OBJECT_FORMAT_ELF
/* Default to -mips3. */
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT MASK_FLOAT64|MASK_64BIT
#endif
#ifndef MIPS_ISA_DEFAULT
#define MIPS_ISA_DEFAULT 3
#endif
/* This should change to n32 when it is supported in gas. */
#ifndef MIPS_ABI_DEFAULT
#define MIPS_ABI_DEFAULT ABI_O64
#endif
/* Until we figure out what MIPS ELF targets normally use, just do
stabs in ELF. */
......
......@@ -53,6 +53,8 @@ extern struct rtx_def *mips_function_value PARAMS ((tree, tree));
extern unsigned int mips_hard_regno_nregs PARAMS ((int,
enum machine_mode));
extern int mips_return_in_memory PARAMS ((tree));
extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *,
enum machine_mode, tree, int));
extern void function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
......
......@@ -10035,6 +10035,24 @@ mips_hard_regno_nregs (regno, mode)
return ((GET_MODE_SIZE (mode) + UNITS_PER_FPREG - 1) / UNITS_PER_FPREG);
}
int
mips_return_in_memory (type)
tree type;
{
/* Under the old (i.e., 32 and O64 ABIs) all BLKmode objects are
returned in memory. Under the new (N32 and 64-bit MIPS ABIs) small
structures are returned in a register. Objects with varying size
must still be returned in memory, of course. */
if (mips_abi == ABI_32 || mips_abi == ABI_O64)
return (TYPE_MODE (type) == BLKmode);
else
return ((int_size_in_bytes (type) > (2 * UNITS_PER_WORD))
|| (int_size_in_bytes (type) == -1));
}
#ifdef TARGET_IRIX6
/* Output assembly to switch to section NAME with attribute FLAGS. */
......
......@@ -2751,7 +2751,7 @@ extern struct mips_frame_info current_frame_info;
to give us MIPS cc compatibility. */
#define RETURN_IN_MEMORY(TYPE) \
(TYPE_MODE (TYPE) == BLKmode)
mips_return_in_memory (TYPE)
#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
......
......@@ -6286,17 +6286,17 @@ move\\t%0,%z4\\n\\
(set_attr "length" "4,8,4,4,8,8,8,8,4,8,4,4")])
(define_insn "movdf_internal2"
[(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,R,To,*d")
(match_operand:DF 1 "general_operand" "dG,R,ToF,d,d,*f"))]
[(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,R,To,d,f,f")
(match_operand:DF 1 "general_operand" "dG,R,ToF,d,d,f,d,f"))]
"(TARGET_SOFT_FLOAT || TARGET_SINGLE_FLOAT) && !TARGET_MIPS16
&& (register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)
|| (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0)
|| operands[1] == CONST0_RTX (DFmode))"
"* return mips_move_2words (operands, insn); "
[(set_attr "type" "move,load,load,store,store,xfer")
[(set_attr "type" "move,load,load,store,store,xfer,load,move")
(set_attr "mode" "DF")
(set_attr "length" "8,8,16,8,16,8")])
(set_attr "length" "8,8,16,8,16,8,8,4")])
(define_insn ""
[(set (match_operand:DF 0 "nonimmediate_operand" "=d,y,d,d,d,R,To")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment