microsoft/STL

`<__msvc_int128.hpp>`, `<xcharconv_ryu.h>`: Consider unifying `_Base128::_UMul128()` and `__ryu_umul128()`

Open

#6,352 opened on 2026年7月2日

GitHub で見る
 (1 comment) (0 reactions) (0 assignees)C++ (1,422 forks)batch import
enhancementhelp wantedperformance

Repository metrics

Stars
 (9,475 stars)
PR merge metrics
 (平均マージ 6d 13h) (30d で 6 merged PRs)

説明

After #6281, <__msvc_int128.hpp>'s _Base128::_UMul128() (always available) and <xcharconv_ryu.h>'s __ryu_umul128() (requires C++17) will share the same x64 and ARM64 intrinsic optimizations, but they have different fallback codepaths for x86 (and constant evaluation).

We should consider centralizing on _Base128::_UMul128() (which would be an enhancement, avoiding code duplication) but first I'd like to know whether one of the fallbacks is faster for x86 (which would be a performance improvement if we take the faster one). Not that I actually care about x86 perf these days, but we shouldn't regress it.

https://github.com/microsoft/STL/blob/c430582bc1147f4c01973f6a051415110c4eb286/stl/inc/__msvc_int128.hpp#L163-L177 https://github.com/microsoft/STL/blob/c430582bc1147f4c01973f6a051415110c4eb286/stl/inc/xcharconv_ryu.h#L158-L187

コントリビューターガイド