[fpc-pascal]Re: How to convert between double and extended? (Mattias Gaertner)

Dr. Rolf Jansen InstantWare at t-online.de
Sun Aug 15 10:04:45 CEST 2004


On Sun, 15 Aug 2004 03:03:08 +0200 Mattias Gaertner wrote:

> Where can I get information about the i386 extended and the ppc double
> format? Is it correct, that the ppc double is simply a reversed i386  
> double?

I don´t know about the i386 format. In the past I did extended  
conversions between i386 and M68k. It was simply done by reversing the  
ten bytes. So, I assume that the the same holds for double conversion  
between i386 and PPC too, since the double format of PPC and M68k is  
exactly the same.

For PowerPC you find a description of the format at the following page:

    
http://developer.apple.com/documentation/mac/PPCNumerics/PPCNumerics 
-18.html

which is part of a comprehensive description of the PPC Numerics in  
Apples documentation:

   http://developer.apple.com/documentation/mac/pdf/PPC_Numerics.sit.hqx

A more generic description of the PowerPC can be found here:

http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/ 
852569B20050FF778525699600719DF2/$file/6xx_pem.pdf

You will find the desired information at page 110.

I suggest to reverse the byte at the PPC side, and to "stream" the  
doubles to the i386 box, and to assign the double there to an extended  
variable. In this case there is no need for a special conversion  
routine between double and extended since this is handled by the math  
co-processor automatically.

Best regards

Rolf

__ InstantWare ______________________________________________________
  Dr. Rolf Jansen * Stephanienstraße 19 * D-76133 Karlsruhe * Germany

  http://InstantWare.bei.t-online.de/
_____________________________________________________________________





More information about the fpc-pascal mailing list