This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: rs6000: remove some uses of DEPRECATED_REGISTER_BYTE
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 1 Jun 2004 15:38:57 -0700
- Subject: Re: RFA: rs6000: remove some uses of DEPRECATED_REGISTER_BYTE
- Organization: Red Hat
- References: <vt23c5uy6cs.fsf@zenia.home><20040521131604.13e7228b@saguaro><vt2k6z5h1pp.fsf@zenia.home>
On 21 May 2004 17:09:22 -0500
Jim Blandy <jimb@redhat.com> wrote:
> Kevin Buettner <kevinb@redhat.com> writes:
>
> > On 20 May 2004 19:24:51 -0500
> > Jim Blandy <jimb@redhat.com> wrote:
> >
> > > 2004-05-20 Jim Blandy <jimb@redhat.com>
> > >
> > > * 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.
Sorry for taking so long on this one...
I'm okaying your original patch since it's a faithful conversion of
deprecated to non-deprecated code. We can revisit the matter of
whether convert_typed_floating() should be used or not at a later
date.
Kevin