This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch: ppc make FUNCTION_VALUE a function
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 17 May 2003 12:59:03 -0400
- Subject: Re: patch: ppc make FUNCTION_VALUE a function
- References: <200305151946.PAA27932@makai.watson.ibm.com>
This patch simplifies the logic of the new function for the
REAL_TYPE case.
* rs6000.c (rs6000_function_value): Simplify REAL_TYPE logic.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.477
diff -c -p -r1.477 rs6000.c
*** rs6000.c 16 May 2003 23:45:42 -0000 1.477
--- rs6000.c 17 May 2003 16:54:56 -0000
*************** rtx
*** 14352,14358 ****
rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
! unsigned int regno = GP_ARG_RETURN;
if ((INTEGRAL_TYPE_P (valtype)
&& TYPE_PRECISION (valtype) < BITS_PER_WORD)
--- 14352,14358 ----
rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
{
enum machine_mode mode;
! unsigned int regno;
if ((INTEGRAL_TYPE_P (valtype)
&& TYPE_PRECISION (valtype) < BITS_PER_WORD)
*************** rs6000_function_value (tree valtype, tre
*** 14361,14374 ****
else
mode = TYPE_MODE (valtype);
! if (TREE_CODE (valtype) == REAL_TYPE)
! {
! if (TARGET_HARD_FLOAT && TARGET_FPRS)
! regno = FP_ARG_RETURN;
! else if (TARGET_SPE_ABI && !TARGET_FPRS)
! regno = GP_ARG_RETURN;
! }
! else if (TARGET_ALTIVEC && TREE_CODE (valtype) == VECTOR_TYPE)
regno = ALTIVEC_ARG_RETURN;
else
regno = GP_ARG_RETURN;
--- 14361,14369 ----
else
mode = TYPE_MODE (valtype);
! if (TREE_CODE (valtype) == REAL_TYPE && TARGET_HARD_FLOAT && TARGET_FPRS)
! regno = FP_ARG_RETURN;
! else if (TREE_CODE (valtype) == VECTOR_TYPE && TARGET_ALTIVEC)
regno = ALTIVEC_ARG_RETURN;
else
regno = GP_ARG_RETURN;