This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: In the NONSTOP implementation why dose gdb use register r0 and r1 as temp registers for rn and rd ?
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: xingxing pan <forandom at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Mon, 3 May 2010 11:58:17 -0400
- Subject: Re: In the NONSTOP implementation why dose gdb use register r0 and r1 as temp registers for rn and rd ?
- References: <n2s77f815bd1005022227tc4c6422cj35ca8fd96df840f1@mail.gmail.com>
On Mon, May 03, 2010 at 01:27:53PM +0800, xingxing pan wrote:
> hey guys, I'm porting NONSTOP to an ARM similar architechure. I found
> the following comments in the source.
>
> Instruction is of form:
> <op><cond> rd, [rn,] #imm
> Rewrite as:
> Preparation:
> tmp1, tmp2 <- r0,r1
> r0,r1 <- rd,rn
> Insn: <op><cond> r0,r1 #imm
> Cleanup: rd <- r0; r0<-tmp1;r1<-tmp2
>
> why dose gdb use register r0 and r1? why not use rd and rn directly?
> Thank you!
It was simpler to always use the same registers. That way you don't
have to worry about, for instance, which registers to save and restore
or whether rd and rn overlap. You could do it either way.
--
Daniel Jacobowitz
CodeSourcery