microsoft/STL

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

已關閉

#6,352 建立於 2026年7月2日

 (1 則留言) (0 個反應) (0 位負責人)C++ (1,422 個分叉)batch import
enhancementhelp wantedperformance

倉庫指標

星標
 (9,475 顆星)
PR 合併指標
 (平均合併 6天 13小時) (30 天內合併 6 個 PR)

描述

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

貢獻者指南