ARM-ELF-GCC

Started by Gus April 29, 2004
Hello,

I am trying to see if ARM-ELF-GCC is good enough for release code or
it is just a way to start.

Did anyone do comparason on GCC and other complers, like IAR for
example?
Does GCC have a lot of bugs?

Here is what I found when I tried a small program!
//////// C code ////////////
REGISTER;
///////////////////////////
The prevous line will translate with 4 assembly lines knowing only 3
is needed. If REGISTER is at address 0x80001000 The compiler is
loading Rx with 0x80000000 then it is adding 0x1000 to Rx then it is
using Rx as a location to place 10.

Why it is doing the add step? Am I missing something here?

All the best,
Gus



An Engineer's Guide to the LPC2100 Series

Hi Gus,

> I am trying to see if ARM-ELF-GCC is good enough for release code or
> it is just a way to start.

I've used GCC to compile the linux kernel and some user mode apps (not
on an LPC2xxx, but on an ARM926 processor). So far everything seems to
be working fine.

> Here is what I found when I tried a small program!
> //////// C code ////////////
> REGISTER;
> ///////////////////////////
> The prevous line will translate with 4 assembly lines knowing only 3
> is needed. If REGISTER is at address 0x80001000 The compiler is
> loading Rx with 0x80000000 then it is adding 0x1000 to Rx then it is
> using Rx as a location to place 10.
>
> Why it is doing the add step? Am I missing something here?

Because the ARM doesn't have a load register with immediate 32 bit value
instruction.

It can do a load immediate and shift of an 8 bit immediate value. So
loading 0x80000000 is doable as a single instruction.

In order to load 0x80001000 as a single isntruction, the 0x80001000
would need to be stored in memory and you'd have to load the register
from memory.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/