[erlang-patches] Float endianness in 15B

Lukas Larsson lukas@REDACTED
Wed Jul 18 09:39:53 CEST 2012


Hello,

The patch just ran through our nightly build and a couple of issues 
popped up.

It seems that the ac script does not correct detect double endianess on 
big endian platforms. The configure on all of our sparc and ppc machines 
detected double word ordering as middle-endian.

Also don't think an error should be thrown in configure if we cannot 
detect the double endianess. Instead a warning should be issued and 
configure should continue with the assumption that the doubles are not 
middle-endian. There are a number of options that already do this and I 
think it makes sense here as we can never detect it in a cross environment.

Lukas

On 17/07/12 10:14, Michael Sperber wrote:
> Lukas Larsson <lukas@REDACTED> writes:
>
>> Sorry for the long delay, we just now got our ARM machines
>> working. Unfortunately it does not seem to use PDP endian floats. So I
>> hope that it is ok with you to do some more work on your end.
> Of course.  Thanks for looking into this!
>
>> Does the compiler you use set __BYTE_ORDER to __PDP_ENDIAN in
>> endian.h?
> No, it's __LITTLE_ENDIAN.  And that's the correct setting for integers.
> The problem is that the information from endian.h is not enough to
> determine float endianness.
>
>> If so could you update the ac function to check that first?
>> If we can rely on the define it will make the check work better when
>> cross compiling.
> Good point.  (Especially as we used to cross-compile before switching to
> building under qemu.)  I'm afraid I don't know a good solution.  Maybe
> we do need to look at the architecture name after all.  I'd be happy to
> code up an alternative if we can agree on the direction.
>
>> Also it would be great to have a testcase for this, would you mind a
>> small testcase to erts/emulator/test/float_SUITE.erl ?
> Good point.  I believe the floating-point test suite didn't pass the
> existing tests, but of course that was coincidental.  Here's the test
> suite:
>
> https://github.com/mikesperber/otp/commit/cab9edd0a6f1fad2c3ec9661b39627756ad9d2ba
>
> Please let me if there's anything else I can do to move this along.
>





More information about the erlang-patches mailing list