This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More 128 bit floating point stuff for PA64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]