Re: Problem with porting PARI/GP to arm: double (float) format
In message <20010524233356.A13206@yellowpig>
Bill Allombert <allomber@math.u-bordeaux.fr> wrote:
> the relevant code look like
>
> #if PARI_BYTE_ORDER == LITTLE_ENDIAN
> # define INDEX0 1
> # define INDEX1 0
> #elif PARI_BYTE_ORDER == BIG_ENDIAN
> # define INDEX0 0
> # define INDEX1 1
> #else
> error... unknown machine
> #endif
[snip]
> GEN is the pari generic type.
>
> Upstream author know about this problem and believe that the solution is
> that correct #define for arm are
>
> # define INDEX0 1
> # define INDEX1 0
> (so as if it was big-endian).
>
> I test it and it works.
>
> Can someone explain me what happen, so that I work out a good patch ?
The solution is correct. Despite ARM systems usually being small
endian, the word ordering of double floating point values is as you'd
expect on a big endian machine. This typically affects things like
compilers, which need a fix similar to what you have here.
Peter
--
------------------------------------------------------------------------
Peter Naulls - peter@erble.freeserve.co.uk
RISC OS Projects Initiative - http://chocky.mine.nu/initiative/
Java for RISC OS and ARM - http://www.java.riscos.org.uk/
Debian Linux on RiscPCs - http://chocky.mine.nu/debian/
------------------------------------------------------------------------
Reply to: