I have medium size C99 program which uses long double
type (80bit) for floating-point computation. I want to improve precision with new GCC 4.6 extension __float128
. As I get, it is a software-emulated 128-bit precision math.
How should I convert my program from classic long double of 80-bit to quad floats of 128 bit with software emulation of full precision? What need I change? Compiler flags, sources?
My program have reading of full precision values with strtod
, doing a lot of different operations on them (like +-*/ sin, cos, exp and other from <math.h>
) and printf
-ing of them.
PS: despite that float128 is declared only for Fortran (REAL*16), the libquadmath is written in C and it uses float128. I'm unsure will GCC convert operations on float128 to runtime library or not and I'm unsure how to migrate from long double to __float128 in my sources.
PPS: There is a documentation on "C" language gcc mode: http://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
"GNU C compiler supports ... 128 bit (TFmode) floating types. Support for additional types includes the arithmetic operators: add, subtract, multiply, divide; unary arithmetic operators; relational operators; equality operators ... __float128 types are supported on i386, x86_64"
glibc/soft-fp
, e.g__subtf3()
koala.cs.pub.ro/lxr/#glibc+2.9/soft-fp/subtf3.c#L35 gcc.gnu.org/wiki/Software_floating_point – osgxstrtod
replacement. – Janus Troelsen