3 ms·
If you need to use 128-bit floats for something, note that your processor probably supports them natively and that there are standard C/C++ types for them. (Th
by hedora 3y ago
If you need to use 128-bit floats for something, note that your processor probably supports them natively and that there are standard C/C++ types for them.
(The boost thing the article links says their quad precision type is “functionally equivalent” to standard types, but uses a different bit layout.)
- andrewf 3y agoI've read this a few places recently but I can't figure out how? https://godbolt.org/z/Mbjs73qar https://godbolt.org/z/Mbjs73qar -- using doubles I get AVX instructions but using 128-bit floats calls some very hefty runtime support functions.
- gpderetta 3y agoThere is no true quad support on x86. GCC implements double-double quads[1] via software emulation on many targets. [1] https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format#Double-double_arithmetic https://en.wikipedia.org/wiki/Quadruple-precision_floating-p...
- fanf2 3y agoYour processor probably doesn’t support quad precision floats in hardware unless it’s an IBM mainframe. https://en.m.wikipedia.org/wiki/Quadruple-precision_floating-point_format#Hardware_support https://en.m.wikipedia.org/wiki/Quadruple-precision_floating...
- aragilar 3y agoPower also supports it, and https://www.raptorcs.com/ https://www.raptorcs.com/ aren't mainframes.
- guenthert 3y agoWhich prompts the question, what is quad precision floating point arithmetic needed for that IBM considered it prudent to implement it in hardware of a mainframe? Who are the customers paying for such? Naively perhaps, I would expect that financial calculations (ought to) rely on fixed-point arithmetic and afaiu simulations of physical systems get away with double precision, if one is careful.
- carlmr 3y ago>afaiu simulations of physical systems get away with double precision, if one is careful. Doesn't this depend very much on the physical system in question. I could imagine that simulating chaotic systems needs a lot of precision. Simulation of n-body problems and others are mentioned [1]. [1] https://www-zeuthen.desy.de/acat05/talks/de_Dinechin.Florent.2/QuadAndMore.pdf https://www-zeuthen.desy.de/acat05/talks/de_Dinechin.Florent...
- lifthrasiir 3y agoStandard C/C++ types may still use a software implementation behind the scene, and this is almost always the case for std::float128_t.