Problem with 64 bit FP under ARM
Matthias Lang
matthias@REDACTED
Sat Aug 23 10:55:01 CEST 2003
Martin Sandiford writes:
> (Running under Linux on x86):
> 1> <<1.0:64/float>>.
> <<63,240,0,0,0,0,0,0>>
> (Pretty much as expected for a little endian machine)
>
> (Running under Linux on ARM):
> 1> <<1.0:64/float>>.
> <<0,0,0,0,63,240,0,0>>
> (Looks a bit like little endian, only the quads are swapped)
I run erlang r8b on linux on a big-endian PowerPC embedded system
with floating point emulation:
1> <<1.0:64/float>>.
<<63,240,0,0,0,0,0,0>>
I know very little about floating point arithmetic. I don't know if
that's "correct" or not, I'm just giving you another data point. The
Erlang build system isn't really built for cross-compiling, I had to
do a fair bit of manual tweaking to get things to work. I assume
you've checked what happened during autoconf, e.g. that you have
ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
> This essentially means that any code compiled with floating point
> constants in it will not run on the other machine. It might also mean
> other issues as well, but this is where I first discovered the
> problem.
If you provide an example which fails I'll try it.
> I'm thinking it maybe could be a problem with the FP emulator?
Are you using the in-kernel FP emulation or the gcc 'soft-float'? See
also:
http://codepoet.org/lists/busybox/2003-June/008547.html
Matthias
More information about the erlang-questions
mailing list