Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29271 ディスカッション

80 bit variables for intense math functions?

vibrantcascade
ビギナー
868件の閲覧回数
Is it possible in ifort to somehow retain 80 bit precision in variables to prevent rounding losses? The performance hit going from double to quad precision is huge, and if I could get an extra 4 or 5 digits of precision without a performance hit due to the math being done in 80 bit anyhow it would greatly help my program.

I know some fortran compilers support real*10 or real(kind=10) but I can't seem to find the equivalent in ifort.
I've tried -double-size 80 as well to no avail.

Is there by chance a hidden feature which allows me to make all my double precision variables 80 bits or am I out of luck?
0 件の賞賛
2 返答(返信)
TimP
名誉コントリビューター III
868件の閲覧回数
ifort doesn't have kind=10. With -mia32 and -pc80 (32-bit mode only) you can get some expression evaluation in that mode, but not for stored results.
jimdempseyatthecove
名誉コントリビューター III
868件の閲覧回数
You could create a user defined type of 80-bits...
and define operator functions for this type which calls C functions that perform the FPU operations.
Actual implementation may be harder. E.g. trig functions will balk at using your type, but you can write your own functions which call out to your C routines. Though execution is via function call it is likely much faster than emulation.

Jim Dempsey
返信