dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/support read_float.c,1.1.1.1,1.2 write_


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/support read_float.c,1.1.1.1,1.2 write_float.c,1.1,1.2
Date: Fri, 14 Mar 2003 16:57:28 -0500

Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv8056/support

Modified Files:
        read_float.c write_float.c 
Log Message:


Recognise mixed-endian encodings for double for the ARM architecture.


Index: read_float.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/read_float.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** read_float.c        13 Aug 2001 05:25:00 -0000      1.1.1.1
--- read_float.c        14 Mar 2003 21:57:26 -0000      1.2
***************
*** 78,82 ****
                convert.bytes[7] = buf[7];
        }
!       else
        {
                /* Big-endian host CPU, so flip the bytes */
--- 78,82 ----
                convert.bytes[7] = buf[7];
        }
!       else if(convert.bytes[3] != 0x3F)
        {
                /* Big-endian host CPU, so flip the bytes */
***************
*** 89,92 ****
--- 89,104 ----
                convert.bytes[1] = buf[6];
                convert.bytes[0] = buf[7];
+       }
+       else
+       {
+               /* Mixed-endian host CPU (e.g. ARM) */
+               convert.bytes[4] = buf[0];
+               convert.bytes[5] = buf[1];
+               convert.bytes[6] = buf[2];
+               convert.bytes[7] = buf[3];
+               convert.bytes[0] = buf[4];
+               convert.bytes[1] = buf[5];
+               convert.bytes[2] = buf[6];
+               convert.bytes[3] = buf[7];
        }
        return (ILNativeFloat)(convert.value);

Index: write_float.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/write_float.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** write_float.c       24 Sep 2001 07:13:40 -0000      1.1
--- write_float.c       14 Mar 2003 21:57:26 -0000      1.2
***************
*** 80,84 ****
                buf[7] = convert.bytes[7];
        }
!       else
        {
                /* Big-endian host CPU, so flip the bytes */
--- 80,84 ----
                buf[7] = convert.bytes[7];
        }
!       else if(convert.bytes[3] != 0x3F)
        {
                /* Big-endian host CPU, so flip the bytes */
***************
*** 92,95 ****
--- 92,108 ----
                buf[1] = convert.bytes[6];
                buf[0] = convert.bytes[7];
+       }
+       else
+       {
+               /* Mixed-endian host CPU (e.g. ARM) */
+               convert.value = value;
+               buf[4] = convert.bytes[0];
+               buf[5] = convert.bytes[1];
+               buf[6] = convert.bytes[2];
+               buf[7] = convert.bytes[3];
+               buf[0] = convert.bytes[4];
+               buf[1] = convert.bytes[5];
+               buf[2] = convert.bytes[6];
+               buf[3] = convert.bytes[7];
        }
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]