gcc/libstdc++-v3/testsuite/26_numerics
Jonathan Wakely a2d196e75c libstdc++: Use RDRAND as fallback if RDSEED keeps failing (PR 94087)
It's not difficult for multiple threads to drain the entropy available
to the RDSEED instruction, at which point we throw an exception. This
change will try to use RDRAND after RDSEED fails repeatedly, and only
throw if RDRAND also fails repeatedly. This doesn't guarantee a random
value can always be read, but reduces the likelihood of failure when
using the RDSEED instruction.

	PR libstdc++/94087
	* src/c++11/random.cc (__x86_rdseed): Allow fallback function to be
	passed in.
	(__x86_rdseed_rdrand): New function that uses rdseed with rdrand
	fallback.
	(random_device::_M_init): Use __x86_rdseed_rdrand when both
	instructions are available.
	* testsuite/26_numerics/random/random_device/94087.cc: New test.
2020-05-19 23:04:45 +01:00
..
accumulate libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
adjacent_difference libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
bit libstdc++ P1956R1 On the names of low-level bit manipulation functions 2020-02-17 17:09:18 +00:00
complex Update copyright years. 2020-01-01 12:51:42 +01:00
endian Update copyright years. 2020-01-01 12:51:42 +01:00
exclusive_scan libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
gcd Update copyright years. 2020-01-01 12:51:42 +01:00
headers libstdc++: Update the <numeric> synopsis test to latest standard 2020-02-28 15:08:14 -05:00
inclusive_scan libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
inner_product libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
iota libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
lcm Update copyright years. 2020-01-01 12:51:42 +01:00
midpoint libstdc++: midpoint should not constrain T is complete (LWG 3200) 2020-02-19 15:28:45 +00:00
numbers Update copyright years. 2020-01-01 12:51:42 +01:00
partial_sum libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
pstl/numeric_ops Synchronize libstdc++ PSTL with upstream LLVM PSTL 2019-06-07 22:01:16 +00:00
random libstdc++: Use RDRAND as fallback if RDSEED keeps failing (PR 94087) 2020-05-19 23:04:45 +01:00
reduce libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
slice libstdc++: Add comparison operators to types from Numerics clause 2020-04-08 16:51:59 +01:00
slice_array Update copyright years. 2020-01-01 12:51:42 +01:00
transform_exclusive_scan libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
transform_inclusive_scan libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
transform_reduce libstdc++: P1645R1 constexpr for <numeric> algorithms 2020-02-26 10:23:17 -05:00
valarray Update copyright years. 2020-01-01 12:51:42 +01:00
lerp.cc Update copyright years. 2020-01-01 12:51:42 +01:00