From: Eric Christopher Date: Sat, 16 Mar 2002 08:00:45 +0000 (+0000) Subject: mips.md (movdf_internal2): Add two new move constraints. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=544013420c53ecbf89c104e838b70062231c0013;p=gcc.git mips.md (movdf_internal2): Add two new move constraints. 2002-03-15 Eric Christopher * 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 --- diff --git a/gcc/config/mips/abi64.h b/gcc/config/mips/abi64.h index 653571792ed..42ea208855a 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 130dbe747bc..f0ac8133cfe 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 1acf3c1c2c6..e8b83bc1395 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 773462fc728..536f683a312 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 88042b67f40..28ab83c2123 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 19049af2ee3..c31bc70a28a 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")