Post by Joerg SonnenbergerPost by Matt ThomasPost by Ignatios SouvatzisPost by Joerg SonnenbergerPost by олÑга кÑÑжановÑкаÑYes, if you wish to run, scientific software on it.
Scientific software can and should use fenv(3) too...
What about the precision part in fpget...(3)'s BUGS section?
" These interfaces are deprecated and the ones in
fenv(3) should be used, although the interfaces in fenv(3) don't support
getting or setting the precision."
except setting the precision is only valid for x86 (and anything else
supporting 80-bit FP).
Well, probably aimed at controlling the x86 fpu.
Other hardware could easily support 80+bit by using different opcodes
(like some vax), so not have a settable precision.
Post by Joerg Sonnenberger...and likely to give unexpected results at least for amd64.
amd64 is 'interesting'.
'long double' uses the x87 FP stack and instructions, so is subject
to the precision being set to less than 80bits - so it could the same
precision as 'float'.
However some instructions (like fscale and the trig/log ones) are
not in the SSE2 set - so the values have to be moved between the xmm
and x87 registers. If you need 2 (or more) x87 instructions it is best
to use 'long double' for the intermediate values to avoid the memory
accesses and long instruction sequences.
David
--
David Laight: ***@l8s.co.uk