Date: Fri, 16 Jan 2026 16:59:41 -0800
On Friday, 16 January 2026 09:28:48 Pacific Standard Time David Brown wrote:
> > BTW, this does mean the Standard Library <random> routines that use long
> > double are extremely slow.
>
> So x87 instructions and registers are used for long double in the x86,
> but SSE instructions (and xmm registers) are used for double and float,
> right?
Correct.
> Do you see much use for long double in real code?
No, I don't. Few people ever need the extra precision. And since on most other
platforms, it's the same as double, there's hardly a call to use it. There's
at least one (SPARC I think) where it is a 128-bit quad-precision FP, and it's
probably entirely SW-emulated.
But the Standard Library has a few required uses. So it's there. For example,
a friend was trying to create a normal distribution of FP16 (std::float16_t)
and it was using lots of x87 code.
> > BTW, this does mean the Standard Library <random> routines that use long
> > double are extremely slow.
>
> So x87 instructions and registers are used for long double in the x86,
> but SSE instructions (and xmm registers) are used for double and float,
> right?
Correct.
> Do you see much use for long double in real code?
No, I don't. Few people ever need the extra precision. And since on most other
platforms, it's the same as double, there's hardly a call to use it. There's
at least one (SPARC I think) where it is a 128-bit quad-precision FP, and it's
probably entirely SW-emulated.
But the Standard Library has a few required uses. So it's there. For example,
a friend was trying to create a normal distribution of FP16 (std::float16_t)
and it was using lots of x87 code.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Principal Engineer - Intel Data Center - Platform & Sys. Eng.
Received on 2026-01-17 00:59:53
