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: [RFA] Put SPE verification in macro.


> From: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Date: Wed, 30 Jan 2008 13:09:19 -0200
> 
> Hi,
> 
> This patch is a small cleanup which makes my revised version of the DFP
> pseudo-registers patch more readable. I put the mantra used to check if
> a given register number is an SPE pseudo-register in a macro and used it
> whenever possible.
> 
> The only case the macro isnt't a direct replacement was this:
> 
> @@ -179,9 +184,7 @@ spe_register_p (struct gdbarch *gdbarch,
>    struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> 
>    /* Is it a reference to EV0 -- EV31, and do we have those?  */
> -  if (tdep->ppc_ev0_regnum >= 0
> -      && tdep->ppc_ev31_regnum >= 0
> -      && tdep->ppc_ev0_regnum <= regno && regno <=
> tdep->ppc_ev31_regnum)
> +  if (IS_SPE_PSEUDOREG (tdep, regno))
>      return 1;
> 
> The above code checks if ppc_ev31_regnum is >= 0 and if regno <=
> ppc_ev31_regnum. Since ppc_ev31_regnum is set in the same place and
> condition that ppc_ev0_regnum is set, and that ppc_ev31_regnum's value
> is ppc_ev0_regnum + 31, those checks are equivalent to the ones made by
> the new macro.

This makes ppc_ev31_regnum completely redundant isn't it?  Could you
remove it?


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