aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/mips/abi64.h12
-rw-r--r--gcc/config/mips/elf64.h7
-rw-r--r--gcc/config/mips/mips-protos.h2
-rw-r--r--gcc/config/mips/mips.c18
-rw-r--r--gcc/config/mips/mips.h2
-rw-r--r--gcc/config/mips/mips.md8
6 files changed, 32 insertions, 17 deletions
diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h
index 6535717..42ea208 100644
--- a/gcc/config/mips/abi64.h
+++ b/gcc/config/mips/abi64.h
@@ -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)
diff --git a/gcc/config/mips/elf64.h b/gcc/config/mips/elf64.h
index 130dbe7..f0ac813 100644
--- a/gcc/config/mips/elf64.h
+++ b/gcc/config/mips/elf64.h
@@ -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. */
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 1acf3c1..e8b83bc 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -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 *,
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 773462f..536f683 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -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. */
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 88042b6..28ab83c 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -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
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 19049af..c31bc70 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -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")