Re: hpgcc arm doubles in memory
- From: Wes <wjltemp-gg@xxxxxxxxx>
- Date: Mon, 14 Jan 2008 09:52:25 -0800 (PST)
On Jan 13, 10:31 pm, Claudio Lapilli <pleasedonts...@xxxxxxx> wrote:
It's not so common, I don't think a lot of people are aware of this,
and it's very strange but that's how the gcc
compiler for ARM treats doubles: (2) 32-bit words stored in big-endian
format. I ran across this issue when trying to implement direct
conversion of 'doubles' to calculator reals.
That's just what I was experimenting with.
If the ARM processor is set in big endian mode,
you would have a "true" big-endian representation.
I noticed this by compiling with -mbig-endian -save-temps and looking
at the assembly .s file.
This is a very weird behavior that should have been avoided (maybe a
compiler switch to use either fully little endian or fully big-endian
but not this mix).
Sounds to me like it was more of an ARM issue than a gcc issue. If I
understand correctly, the optional ARM floating point hardware had
this mixed-endian behavior. The linux gcc arm compiler produces code
that it uses this hardware if available and emulation if it is not, so
that the same executable can run on both machines. This requires gcc
to follow ARM's word order convention. Although I suppose if you knew
it was always going to be emulated, you could do whatever you wanted
with the word order.
It reminds me of the 8088/286/386 days when the 8087/287/387
coprocessors where optional. The MS-C compiler had options to
generating code which either:
a) required the coprocessor
b) used the coprocessor if present and emulated it if not present
c) used a faster non-coprocessor-compatible software code
(I remember the day I put a 287 coprocessor in my 286-10MHz screamer
-- fractals had met their match.)
-wes
.
- References:
- hpgcc arm doubles in memory
- From: Wes
- Re: hpgcc arm doubles in memory
- From: Claudio Lapilli
- hpgcc arm doubles in memory
- Prev by Date: Re: any place to find RAM card for 48SX?
- Next by Date: Re: Conn4x language
- Previous by thread: Re: hpgcc arm doubles in memory
- Next by thread: Re: External Ballistic Drop Program for HP-48
- Index(es):
Relevant Pages
|