From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: rs6000: remove some uses of DEPRECATED_REGISTER_BYTE Date: Fri, 21 May 2004 22:09:00 -0000 Message-id: References: <20040521131604.13e7228b@saguaro> X-SW-Source: 2004-05/msg00651.html Kevin Buettner writes: > On 20 May 2004 19:24:51 -0500 > Jim Blandy wrote: > > > 2004-05-20 Jim Blandy > > > > * rs6000-tdep.c (rs6000_push_dummy_call): Remove uses of > > DEPRECATED_REGISTER_BYTE and deprecated_registers. > > Would you mind revising the patch to call convert_typed_floating() > for the floating point cases? I think that will obviate the need > for some of the memset/memcpy calls. (See ppc_sysv_abi_push_dummy_call() > in ppc-sysv-tdep.c.) > > It looks okay otherwise... So, wait, does this mean that the existing code like this is wrong? if (TYPE_CODE (type) == TYPE_CODE_FLT) { /* Floating point arguments are passed in fpr's, as well as gpr's. There are 13 fpr's reserved for passing parameters. At this point there is no way we would run out of them. */ if (len > 8) printf_unfiltered ("Fatal Error: a floating point parameter " "#%d with a size > 8 is found!\n", argno); memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (tdep->ppc_fp0_regnum + 1 + f_argno)], VALUE_CONTENTS (arg), len); ++f_argno; } This code takes a floating-point value, of whatever size, and just copies it into the left end of the floating-point register. My PPC book says "Every instruction that interprets the contents of an FPR as a floating-point value uses the floating-point double format for this interpretation." Calls to unprototyped functions would promote arguments to double anyway, so this isn't a big deal there, but it seems bogus for prototyped functions.