[PATCH v2] libstdc++: implement Philox Engine [PR119794]

1nfocalypse 1nfocalypse@protonmail.com
Thu May 22 00:07:15 GMT 2025


Implements Philox Engine (P2075R6) and associated tests.

v2 corrects a multiline comment left in error in serialize.cc, and additionally corrects a bug hidden by said comment, where the stream was given the output of 'y()' instead of 'y', causing state to be incorrectly passed. Lastly, it fixes numerous whitespace issues found in the original patch. My apologies for not noticing prior to the submission of the original patch, which can now be disregarded.

To reiterate from the original email, the template unpacking functions are placed in a private classifier prior to the public one due to an ordering bug, where in order to function correctly, they must be placed prior to the bulk of the header. This is counter to the style recommendations, but I was unable to obtain functionality any other way. Additionally, while SIMD instructions are not utilized, and I do not think that they would integrate well with how the generator's state is currently handled, some structure choices could be made that may make them of interest.

Lastly, since word width can be specified, and thus atypical, maximum value is calculated via some bit manipulation rather than numeric_limits, since the specified width may differ from the width of the type used.

Built/tested on x86_64-linux-gnu.

- 1nfocalypse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250522/6e732aff/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PATCH-v2-libstdc-implement-Philox-Engine-PR119794.patch
Type: text/x-patch
Size: 47331 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20250522/6e732aff/attachment-0001.bin>


More information about the Libstdc++ mailing list