This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: think-o: ARM register byte ps VS fps?
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Thu, 18 Apr 2002 10:56:39 +0100
- Subject: Re: think-o: ARM register byte ps VS fps?
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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.