aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@redhat.com>2004-09-22 07:27:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2004-09-22 07:27:51 +0000
commite1aeeae90eceed7dff8fb37292df258456f6fdd7 (patch)
tree2e5e35824327f3e5e98e7612cacbdafe29848686 /gcc
parentc3002ae940495b847bf703e44a3c40a669e3df8c (diff)
downloadgcc-e1aeeae90eceed7dff8fb37292df258456f6fdd7.zip
gcc-e1aeeae90eceed7dff8fb37292df258456f6fdd7.tar.gz
gcc-e1aeeae90eceed7dff8fb37292df258456f6fdd7.tar.bz2
mips.c (mips_function_value): For o32, o64, n32 and n64, use FPRs for scalar, complex and vector types only.
* config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64, use FPRs for scalar, complex and vector types only. From-SVN: r87848
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0902a1d..dce4039 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-22 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_function_value): For o32, o64, n32 and n64,
+ use FPRs for scalar, complex and vector types only.
+
2004-09-21 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (opt_stats): Move so that it lives just after
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index c564f4e..a1de622 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -6764,6 +6764,13 @@ mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
}
}
+
+ /* For EABI, the class of return register depends entirely on MODE.
+ For example, "struct { some_type x; }" and "union { some_type x; }"
+ are returned in the same way as a bare "some_type" would be.
+ Other ABIs only use FPRs for scalar, complex or vector types. */
+ if (mips_abi != ABI_EABI && !FLOAT_TYPE_P (valtype))
+ return gen_rtx_REG (mode, GP_RETURN);
}
if ((GET_MODE_CLASS (mode) == MODE_FLOAT