This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: Switching to and from ARM/Thumb


On Tuesday 18 January 2005 01:45, Daniel Jacobowitz wrote:
> > > .code32
> > > arm_to_thumb:
> > > #ifdef __ARMv4T__
> > >  add ip, pc, #1
> > >  bx ip
> > > #else
> > >  sub pc, pc, #1
> > > #endif
> > > thumb_code:
> >
> > If this is used in inline assembler, does gcc need to be informed of
> > ip being trashed?
>
> Definitely.  I admit I've never seen the arm-to-thumb sequence done
> quite that way before... I knew loads interworked and mov didn't so I
> would have assumed that sub didn't either.

Whoops, I missed that.  After rereading the relevant documentation I concur 
that "sub pc, pc, #1" will not have the desired effect.

Paul


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