STL icon indicating copy to clipboard operation
STL copied to clipboard

P0543R3 Saturation Arithmetic

Open StephanTLavavej opened this issue 2 years ago • 2 comments

WG21-P0543R3 Saturation Arithmetic

Feature-test macro:

#define __cpp_lib_saturation_arithmetic 202311L

Note: We're focused on implementing the remaining library-only features in C++23. Until that's done, we will NOT be accepting PRs for C++26 features.

StephanTLavavej avatar Nov 12 '23 22:11 StephanTLavavej

https://github.com/cplusplus/draft/commit/2b1867a3404562c4261722e0a913cbcbf5a0a476 indicates that there's another new freestanding feature-test macro.

#define __cpp_lib_freestanding_numeric 202311L

frederick-vs-ja avatar Dec 22 '23 10:12 frederick-vs-ja

MSVC compiler intrinsics are expected to be available by the time we implement this:

_sat_add_i8
_sat_add_i16
_sat_add_i32
_sat_add_i64
_sat_add_u8
_sat_add_u16
_sat_add_u32
_sat_add_u64
_sat_sub_i8
_sat_sub_i16
_sat_sub_i32
_sat_sub_i64
_sat_sub_u8
_sat_sub_u16
_sat_sub_u32
_sat_sub_u64

We'll need to check whether they're available on all platforms (@kbrady-msft's MSVC-PR-548218 said that codegen is initially available for x64 only), and we may need to declare them in intrin.h or intrin0.inl.h before we begin using them.

StephanTLavavej avatar May 06 '24 21:05 StephanTLavavej