This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH] Fix passing double float complex arguments in sparc64


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


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