Your mpfr_t <-> __float128 conversions
FX
fxcoudert@gmail.com
Tue Feb 22 09:10:00 GMT 2011
Dear Brad,
> Hope I'm not bothering you, but I found the thread you had started on converting between __float128 types and mpfr_t types, and I was just wondering: did you ever finish that project? I'm currently trying to figure out how to do the same (except in the opposite direction as you, getting a __float128 out of an mpfr_t), and I'd rather not reinvent the wheel if you had success and wouldn't mind sharing your code.
Sorry for taking so long to answer. No, I never quite got to finalizing this project, because I ended up lifting quad-prec math functions from glibc instead of using MPFR as fallback. Tobias Burnus and Jakub Jelinek then worked on polishing this code and integrating it in GCC as libquad, which is now evolving on its own.
However, before I removed it, I had a set of working conversion functions between mpfr_t and __float128 (both ways). I attach three headers used to do that. quad.h and quad-imp.h define relevant structures, prototypes and macros, while the conversion code itself can be found in quad-mpfr.h.
FX
PS: because I received at least two other requests for these conversion routines, I am CC'ing this email to the Fortran list, so it is publicly available. And if it matters, let it be on the record that you can do whatever you want with this code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quad-imp.h
Type: application/octet-stream
Size: 3369 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110222/f9abf99e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quad.h
Type: application/octet-stream
Size: 4042 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110222/f9abf99e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quad-mpfr.h
Type: application/octet-stream
Size: 2537 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20110222/f9abf99e/attachment-0002.obj>
More information about the Fortran
mailing list