This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More 128 bit floating point stuff for PA64
- From: Jeff Law <law at porcupine dot slc dot redhat dot com>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: gcc at gcc dot gnu dot org, dave dot anglin at nrc dot ca
- Date: Fri, 06 Sep 2002 14:49:27 -0600
- Subject: Re: More 128 bit floating point stuff for PA64
- Reply-to: law at redhat dot com
In message <200209062024.NAA05869@hpsje.cup.hp.com>, Steve Ellcey writes:
>I have been doing some more mix-and-match testing between the HP 64 bit
>compiler and GCC and I think that the code for returning 128 bit floats
>is wrong but I am not sure exactly how to fix it. I believe the problem
>is in FUNCTION_VALUE (pa.h) which is:
>
>
>/* On the HP-PA the value is found in register(s) 28(-29), unless
> the mode is SF or DF. Then the value is returned in fr4 (32, ) */
>
>/* This must perform the same promotions as PROMOTE_MODE, else
> PROMOTE_FUNCTION_RETURN will not work correctly. */
>#define FUNCTION_VALUE(VALTYPE, FUNC) \
> gen_rtx_REG (((INTEGRAL_TYPE_P (VALTYPE) \
> && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \
> || POINTER_TYPE_P (VALTYPE)) \
> ? word_mode : TYPE_MODE (VALTYPE), \
> TREE_CODE (VALTYPE) == REAL_TYPE && !TARGET_SOFT_FLOAT ? 32 :
>28)
>
>What I want to say is that if it is REAL_TYPE but is long double (128
>bits) then use register 28 instead of register 32 but I have a very hard
>time parsing this macro and figuring out the right way to do that test,
>can anyone give me some words of wisdom.
Change from an ugly macro into a real function call. Instead of using
horrid ternary operators, use if-else.
Basically rewrite it to be readable/sensible. It's certainly not performance
critical.
jeff