This is the mail archive of the gdb-patches@sources.redhat.com 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] i386 register shuffle


At 16:31 27/12/2001 , Mark Kettenis a écrit:
>This is a first step towards cleaning up the register numbering scheme
>used for the i386.  All possible numberings are now parametrized by
>FP0_REGNUM and gdbarch_tdep (current_gdbarch)->num_xmm_regs.  This
>patch makes i386-tdep.h the definitive source for information about
>the register layout.

Mark, when you remove a macro, wouldn't it be better to substitute 
this macro where it is by its new equivalent?
I still find 5 references to LAST_FPU_CTRL_REGNUM macro
in the src/gdb dir.
go32-nat.c:469:  else if (regno <= LAST_FPU_CTRL_REGNUM)
go32-nat.c:494:  else if (regno <= LAST_FPU_CTRL_REGNUM)
i386-linux-nat.c:96:  (FP0_REGNUM <= (regno) && (regno) <= LAST_FPU_CTRL_REGNUM)
i386v4-nat.c:184:  for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++)
i386v4-nat.c:219:  for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++)

Which means that go32 native target doesn't compile anymore
one again.

Moreover, I don't really understand 
Use XMM0_REGNUM instead of LAST_FPU_CTRL_REGNUM.
This is really not a good change in my opinion:

if anyone one day decides to change the order of the i386 registers,
to for instance put the mxcsr reg before the xmm regs,
then the

   for (i = FP0_REGNUM; i < XMM0_REGNUM; i++)
     i387_supply_register (i, fsave);
will become wrong...

Wouldn't it be more logical to at least define a LAST_FP_REGUM?


Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


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