GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

Libstdc++: Map 64-bit long double to double on SSE

libstdc++ now maps 64-bit `long double` to `double` on SSE when using the `-mlong-double-64` option.

When compiling for x86 with the -mlong-double-64 option, where long double is ABI-compatible with double, this commit ensures that the __intrinsic_type used by the libstdc++ SIMD extensions is a vector of double. This mapping ensures correct behavior and ABI compliance for SIMD operations involving long double when it is configured to be 64-bit.

In Details

The libstdc++ <experimental/simd> defines vector types exposing SIMD capabilities. When compiling for x86 with -mlong-double-64, the ABI maps long double onto a 64-bit double. This commit adjusts the underlying __intrinsic_type in <experimental/bits/simd.h> to ensure that the SIMD vectors correctly use double in this configuration. The interaction here isn't immediately obvious unless you're familiar with the x86's type ABI and the libstdc++ SIMD extensions.

For Context

SIMD (Single Instruction, Multiple Data) is a type of parallel processing where one instruction operates on multiple data points simultaneously, which can significantly speed up certain types of computations. The C++ standard library includes experimental SIMD support, which defines vector types that map to SIMD instructions on supported architectures. On x86 platforms, the long double type can be configured to be either 80-bit or 64-bit. When configured as 64-bit, it becomes ABI-compatible with double. This change ensures that the underlying SIMD vector types correctly use double when long double is configured in this way. This affects code using the experimental SIMD features in libstdc++ on x86 platforms, especially when using long double.

Filed Under: libstdc++simdx86long doubleabi