This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix passing double float complex arguments in sparc64
- From: Joel Brobecker <brobecker at adacore dot com>
- To: "Jose E. Marchesi" <jose dot marchesi at oracle dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 8 Feb 2014 06:47:29 +0400
- Subject: Re: [PATCH] Fix passing double float complex arguments in sparc64
- Authentication-results: sourceware.org; auth=none
- References: <87d2jid9kk dot fsf at oracle dot com> <87mwi5s7me dot fsf at oracle dot com>
Hi Jose,
Sorry about the delay....
> 2013-10-15 Jose E. Marchesi <jose.marchesi@oracle.com>
>
> * sparc64-tdep.c (sparc64_store_arguments): Do not align complex
> double float arguments to 16-byte in the argument slots.
One remark and a question...
> if (regnum != -1)
> {
> regcache_cooked_write (regcache, regnum, valbuf);
> + if (sparc64_complex_floating_p (type)
> + && (len == 16)
> + && (regnum < SPARC64_D30_REGNUM))
> + regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
I think this part should be moved next to where complex_floating_point
types are handled in terms of setting regnum. It seems to be the way
things are done for other situations like this.
> /* If we're storing the value in a floating-point register,
> also store it in the corresponding %0 register(s). */
> if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D10_REGNUM)
> {
> + int dregnum = regnum;
> gdb_assert (element < 6);
> regnum = SPARC_O0_REGNUM + element;
> regcache_cooked_write (regcache, regnum, valbuf);
> + if (sparc64_complex_floating_p (type)
> + && (len == 16)
> + && (dregnum < SPARC64_D10_REGNUM))
> + regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
I think the same is true of this hunk, no? Also, I don't see the reason
why you're defining a new variable dregnum which is just a copy of
regnum.
--
Joel