Re: [Tinycc-devel] ARM hardfloat prolog

2013-05-02 Thread Daniel Glöckner
On Thu, May 02, 2013 at 01:02:19PM +0200, Thomas Preud'homme wrote:
 Do you know where big-endian is used and by who? There once was a port of 
 Debian for ARM big endian but it never got much traction so it seems to me 
 there is not much interest for such a port anyway.

No, I don't think I've seen a big endian ARM running Linux or BSD.
But I know that there are TMS570 Cortex-R4 hard wired to big endian.

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] ARM hardfloat prolog

2013-05-01 Thread Daniel Glöckner
Hi Thomas,

I saw that you used the following line to store the floating point
arguments that have been passed in fpu register:

o(0xED2D0A00|nf); /* save s0-s15 on stack if needed */

In my 2nd edition ARM ARM this maps to the FSTMS instruction and there
is a note allowing implementations to keep the values in an internal
representation and just convert them to IEEE format for storing to
memory. So I don't think we can use this instruction to store double
arguments and need one FSTMS/FSTMD for each run of consecutive fpu
registers of same precision to be stored. Or have read otherwise?

Best regards,

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] ARM hardfloat prolog

2013-05-01 Thread Thomas Preud'homme
Le mercredi 1 mai 2013 16:59:25, Daniel Glöckner a écrit :
 Hi Thomas,
 
 I saw that you used the following line to store the floating point
 arguments that have been passed in fpu register:
 
 o(0xED2D0A00|nf); /* save s0-s15 on stack if needed */
 
 In my 2nd edition ARM ARM this maps to the FSTMS instruction and there
 is a note allowing implementations to keep the values in an internal
 representation and just convert them to IEEE format for storing to
 memory. So I don't think we can use this instruction to store double
 arguments and need one FSTMS/FSTMD for each run of consecutive fpu
 registers of same precision to be stored. Or have read otherwise?

Nope, I didn't see that line. Please go ahead if you want to fix it, otherwise 
I'll do it later (I'm working right now).

 
 Best regards,
 
   Daniel

Best regards,

Thomas


signature.asc
Description: This is a digitally signed message part.
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] ARM hardfloat prolog

2013-05-01 Thread Daniel Glöckner
On Wed, May 01, 2013 at 05:02:54PM +0200, Thomas Preud'homme wrote:
 Le mercredi 1 mai 2013 16:59:25, Daniel Glöckner a écrit :
  In my 2nd edition ARM ARM this maps to the FSTMS instruction and there
  is a note allowing implementations to keep the values in an internal
  representation and just convert them to IEEE format for storing to
  memory. So I don't think we can use this instruction to store double
  arguments and need one FSTMS/FSTMD for each run of consecutive fpu
  registers of same precision to be stored. Or have read otherwise?
 
 Nope, I didn't see that line. Please go ahead if you want to fix it, 
 otherwise 
 I'll do it later (I'm working right now).

I did some more research.

ARM ARM 2nd edition (= Issue E) has several paragraphs below figure 2-1
in chapter C2 talking about that no assumptions can be made as to how
single-precision registers overlap double-precision registers and that
the value of double-precision registers after their corresponding single-
precision registers have been loaded with a value becomes UNPREDICTABLE.

Issue I, which can be downloaded after registering with ARM, replaces
that half page of text with
The mapping between a double-precision register and its pair of
single-precision registers is as follows:
- S2n lies in the least significant half of Dn
- S2n+1 lies in the most significant half of Dn.

So we are safe with the current implementation, at least on little-endian
ARM. On big-endian ARM the halves will have the wrong order if we don't
use FSTMD, but there is a lot more that needs to be done until we support
big-endian ARM.

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel