Problem with 64 bit FP under ARM

Martin Sandiford <>
Tue Aug 26 13:21:35 CEST 2003


Hi Bjorn,

On Tue, 26 Aug 2003, Bjorn Gustavsson wrote:

> Martin Sandiford <> writes:
> 
> > 1> <<1.0:64/float>>.
> > <<63,240,0,0,0,0,0,0>>
> > (Pretty much as expected for a little endian machine)
> 
> This is the expected result on ANY machine.

Sorry, misspoke myself.  Should be "..as expected for the beam VM"?

> It would be interesting if you could post the result of:
> <<1.0:64/native-float>>

Eshell V5.3  (abort with ^G)
1> <<1.0:64/native-float>>.
<<0,0,240,63,0,0,0,0>>
2> <<1.0:64/float>>.
<<0,0,0,0,63,240,0,0>>

I've since found out (by reading the manuals!) that there is a 
bug/feature in the ARM core < v5 in that it always stores floats in 
big endian quad order.  SA1110 is little endian and v4 core, so this
is where the problem is occurring.

I have a fix for erts/emulator/beam/erl_bits.c that swaps the quads 
in erts_bs_(put|get)_float(), but I'm wondering if there are any other 
interfaces to the outside world that might need attention?

Martin



More information about the erlang-questions mailing list