<br><br><div class="gmail_quote">On Wed, Feb 29, 2012 at 1:09 PM, Francesc Alted <span dir="ltr"><<a href="mailto:francesc@continuum.io">francesc@continuum.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Feb 29, 2012, at 11:52 AM, Pierre Haessig wrote:<br>
<br>
> Hi,<br>
><br>
> Le 29/02/2012 16:22, Paweł Biernat a écrit :<br>
>> Is there any way to interact with Fortran's real(16) (supported by gcc<br>
>> and Intel's ifort) data type from numpy? By real(16) I mean the<br>
>> binary128 type as in IEEE 754. (In C this data type is experimentally<br>
>> supported as __float128 (gcc) and _Quad (Intel's icc).)<br>
> I googled a bit this "__float128". It seems a fairly new addition (GCC<br>
> 4.6, released March 2011).<br>
> The related point in the changelog [1] is :<br>
><br>
> "GCC now ships with the LGPL-licensed libquadmath library, which<br>
> provides quad-precision mathematical functions for targets with a<br>
> __float128 datatype. __float128 is available for targets on 32-bit x86,<br>
> x86-64 and Itanium architectures. The libquadmath library is<br>
> automatically built on such targets when building the Fortran compiler."<br>
<br>
</div>Great find!<br>
<div class="im"><br>
> It seems this __float128 is newcomer in the "picture of data types" that<br>
> Matthew just mentioned.<br>
> As David says, arithmetic with such a 128 bits data type is probably not<br>
> "hardwired" in most processors (I mean Intel & friends) which are<br>
> limited to 80 bits ("long doubles") so it may be a bit slow. However,<br>
> this GCC implementation with libquadmath seems to create some level of<br>
> abstraction. Maybe this is one acceptably good way for a real "IEEE<br>
> float 128" dtype in numpy ?<br>
<br>
</div>That would be really nice.  The problem here is two-folded:<br>
<br>
* Backwards-compatibility.  float128 should represent a different data-type than before, so we probably should find a new name (and charcode!) for quad-precision.  Maybe quad128?<br>
<br>
* Compiler-dependency.  The new type will be only available on platforms that has GCC 4.6 or above.  Again, using the new name for this should be fine.  On platforms/compilers not supporting the quad128 thing, it should not be defined.<br>

<br>
Uh, I foresee many portability problems for people using this, but perhaps it is worth the mess.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br>The quad precision library has been there for a while, and quad precision is also supported by the Intel compiler. I don't know about MSVC. Intel has been working on adding quad precision to their hardware for several years and there is an IEEE spec for it, so some day it will be here, but it isn't here yet. It's a bit sad, I could use quad precision in FORTRAN on a VAX 25 years ago. Mind, I only needed it once ;) I suppose lack of pressing need accounts for the delay.<br>
<br>Chuck<br></div><br></div>