This is the mail archive of the gdb@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: think-o: ARM register byte ps VS fps?


> Hello,
> 
> I'm looking at the code:
> 
> static int
> arm_register_byte (int regnum)
> {
>    if (regnum < ARM_F0_REGNUM)
>      return regnum * INT_REGISTER_RAW_SIZE;
>    else if (regnum < ARM_PS_REGNUM)
>      return (NUM_GREGS * INT_REGISTER_RAW_SIZE
> 	    + (regnum - ARM_F0_REGNUM) * FP_REGISTER_RAW_SIZE);
>    else
>      return (NUM_GREGS * INT_REGISTER_RAW_SIZE
> 	    + NUM_FREGS * FP_REGISTER_RAW_SIZE
> 	    + (regnum - ARM_FPS_REGNUM) * STATUS_REGISTER_SIZE);
> }
> 
> where:
> 
> #define ARM_FPS_REGNUM 24	/* floating point status register */
> #define ARM_PS_REGNUM 25	/* Contains processor status */
> 
> While I suspect it ``works'', would ``(regnum < ARM_FPS_REGNUM)'' be better?
> 
> enjoy,
> Andrew
> 

Rewriting it as a table of constants would probably be better still.

I'll add it to my (copious) todo list.

R.


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