Thursday, August 18, 2005, 3:18:56 PM, Frank wrote:

> I repeated the test using the value 1.2345678 in order to be
> able to identify the position of each byte:

> linux i386:

> 1bde8342cac0f33f
> 0100000000000000

> linux arm:

> cac0f33f1bde8342
> 0100000000000000

> So, it indeed looks like 32bits based middle-endian or something

Right. So for your ARM FP library, the code goes from

    case 6:   /* 8-byte signed integer */
    case 7: { /* IEEE floating point */
      u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
      u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
      x = (x<<32) | y;
      if( serial_type==6 ){
        pMem->i = *(i64*)&x;
        pMem->flags = MEM_Int;
      }else{
        pMem->r = *(double*)&x;
        pMem->flags = MEM_Real;
      }

to

    case 6:   /* 8-byte signed integer */
      u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
      u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
      x = (x<<32) | y;
      pMem->i = *(i64*)&x;
      pMem->flags = MEM_Int;
      break;
    case 7: { /* IEEE floating point */
      u64 x = (buf[0]<<24) | (buf[1]<<16) | (buf[2]<<8) | buf[3];
      u32 y = (buf[4]<<24) | (buf[5]<<16) | (buf[6]<<8) | buf[7];
      x = (y<<32) | x;
      pMem->r = *(double*)&x;
      pMem->flags = MEM_Real;

e

Reply via email to