[PATCH] enhance register parsing in .cfi_* handling

H.J. Lu hjl.tools@gmail.com
Mon Feb 11 15:47:00 GMT 2008


On Mon, Feb 11, 2008 at 03:35:24PM +0000, Jan Beulich wrote:
> >>> "H.J. Lu" <hjl.tools@gmail.com> 11.02.08 16:26 >>>
> >On Mon, Feb 11, 2008 at 10:51:34AM +0000, Jan Beulich wrote:
> >> --- 2008-02-11/opcodes/i386-opc.h	2008-02-11 08:33:30.000000000 +0100
> >> +++ 2008-02-11/opcodes/i386-opc.h	2008-02-11 10:27:10.000000000 +0100
> >> @@ -489,15 +489,16 @@ typedef struct
> >>  {
> >>    char *reg_name;
> >>    i386_operand_type reg_type;
> >> -  unsigned int reg_flags;
> >> +  unsigned char reg_flags;
> >>  #define RegRex	    0x1  /* Extended register.  */
> >>  #define RegRex64    0x2  /* Extended 8 bit register.  */
> >> -  unsigned int reg_num;
> >> -#define RegRip	((unsigned int ) ~0)
> >> +  unsigned char reg_num;
> >> +#define RegRip	((unsigned char ) ~0)
> >>  #define RegEip	(RegRip - 1)
> >>  /* EIZ and RIZ are fake index registers.  */
> >>  #define RegEiz	(RegEip - 1)
> >>  #define RegRiz	(RegEiz - 1)
> >> +  signed char dw2_regnum[2];
> >>  }
> >>  reg_entry;
> >>  
> >
> >Do we really need to save a few bytes here? Can we use int instead
> >char?
> 
> Of course all these fields could be left as (or made) int-s, but I really
> think that for read-only tables it is more efficient to keep them as
> small as possible (in particular, with the change as I did it the structure
> size doesn't change, so the only growth comes from that added table
> elements). But of course, if you insist...

char is fine with me.  Thanks.


H.J.



More information about the Binutils mailing list