32 bit relative branch instructions

Pierre Saucourt-Harmel (r54698) pierre.saucourt-harmel@motorola.com
Fri Apr 20 08:46:00 GMT 2001


andy@softbookpress.com wrote:
Looks like this might do. Where can I get more info
on this new option ?
Thx
Andy
Hello Andy.
24 bits are very large for embedded applications (16 Mbytes) but certain
calls (from ROM to RAM) need
a 32 bits address capability.
As all ARM instructions (but not Thumb) are coded into 32-bits words,
any of them is capable to address a 4 Gbytes space. But a combination
of instruction does.
I don't know how to tell gcc to generate long branch but in assembler,
its look like:
...
mov lr, pc             
-> to save the return address into the lr
ldr pc, myLongBranch    -> long branch call
...
myLongbranch:
   .word longBranchFunc -> function to call that needs
a long branch
You probably need to push the old lr to the stack before saving the
return address and restore this lr after the long branch call.
Regards.
Pierre.
 
 
>>Gcc for arm generates 24 bit branch instructions  I wonder if
there's a
>>flag ( or maybe a patch exists) that would allow me to tell it to
generate
>>32 bit relative branch instructions.
>
>Eh?  The ARM doesn't have a 32-bit branch instruction.
>The "-mlong-calls" option in the GCC trunk and 3.0 branch (though
not 2.95.x)
>might do what you want, though.
>
>p.
------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com




More information about the crossgcc mailing list