Re: Printing decimal128 types out of registers

Thiago Jung Bauermann
2008-01-17T19:36:50Z

On Thu, 2008-01-17 at 17:03 -0200, Luis Machado wrote:
> Hi,
>
> The patch to handle DFP expressions had some overlapping with this
> patch, and since this was a bit old already, follows a refreshed version
> for HEAD.
>
> The patch remains essentially the same, with a few fixes. Running the
> testsuite showed no regressions on 32-bit/64-bit ppc.
>
> Is this OK to go in?

A few comments, mostly formatting:

> + /* These are the e500 pseudo-registers. */
> + if (tdep->ppc_ev0_regnum >= 0
> + && regnum >= tdep->ppc_ev0_regnum
> + && regnum < tdep->ppc_ev0_regnum + 32)
> + return rs6000_builtin_type_vec64 (gdbarch);
> +
> + /* These are the ppc decimal128 pseudo-registers. */
> + if (tdep->ppc_dl0_regnum >= 0
> + && regnum >= tdep->ppc_dl0_regnum
> + && regnum < tdep->ppc_dl0_regnum + 16)
> + return builtin_type (current_gdbarch)->builtin_declong;;
>
> + /* These are the e500 pseudo-registers. */
> + if (tdep->ppc_ev0_regnum < 0
> + && regnum < tdep->ppc_ev0_regnum
> + && regnum >= tdep->ppc_ev0_regnum + 32)
> + return -1;
> +
> + /* These are the ppc decimal128 pseudo-registers. */
> + if (tdep->ppc_dl0_regnum < 0
> + && regnum < tdep->ppc_dl0_regnum
> + && regnum >= tdep->ppc_dl0_regnum + 16)
> + return -1;

The return statements above are too indented.

> - int have_fpu = 1, have_spe = 0, have_mq = 0, have_altivec = 0;
> + int have_fpu = 1, have_spe = 0, have_mq = 0, have_altivec = 0,
> + have_dfp128 = 0;

have_dfp128 shouldn't be aligned with int. Not sure which column it
should be though.

> + else
> + if (have_dfp128)
> + {
> + set_gdbarch_pseudo_register_read (gdbarch,
ppc_pseudo_register_read);
> + set_gdbarch_pseudo_register_write (gdbarch,
ppc_pseudo_register_write);
> + }
>
> +
> + if (have_spe)
> + set_gdbarch_num_pseudo_regs (gdbarch, 32);
> + else
> + if (have_dfp128)
> + set_gdbarch_num_pseudo_regs (gdbarch, 16);

IMHO, "else" should be immediately followed by if, not put in a
separate line.

> Index: gdb/features/rs6000/powerpc-64.c
> [...]
> Index: gdb/features/rs6000/powerpc-32.c

These files are generated. You should edit the XML and regenerate.

--
[]'s
Thiago Jung Bauermann