[libcxx-commits] [libcxx] [libc++] Add an ABI flag to optimize mersenne_twister_engine (PR #206423)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 29 01:38:47 PDT 2026
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/206423
>From 5885d85f5f23578013a797fc92e4efe190b67103 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Mon, 29 Jun 2026 10:00:42 +0200
Subject: [PATCH] [libc++] Add an ABI flag to optimize mersenne_twister_engine
---
libcxx/include/__configuration/abi.h | 1 +
.../__random/mersenne_twister_engine.h | 43 +-
libcxx/test/benchmarks/random.bench.cpp | 11 +
.../rand.eng.mers/ctor_result_type.pass.cpp | 189 +++++++--
.../rand.eng/rand.eng.mers/ctor_sseq.pass.cpp | 389 ++++++++++++------
5 files changed, 469 insertions(+), 164 deletions(-)
diff --git a/libcxx/include/__configuration/abi.h b/libcxx/include/__configuration/abi.h
index 51c82d99eec30..7a4c479fd1636 100644
--- a/libcxx/include/__configuration/abi.h
+++ b/libcxx/include/__configuration/abi.h
@@ -77,6 +77,7 @@
# define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
# define _LIBCPP_ABI_TRIVIALLY_COPYABLE_BIT_ITERATOR
# define _LIBCPP_ABI_USE_SMALL_DEQUE_BLOCK_SIZE
+# define _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
#elif _LIBCPP_ABI_VERSION == 1
// Feature macros for disabling pre ABI v1 features. All of these options
diff --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h
index ce82b3387dbd2..51970a40b7673 100644
--- a/libcxx/include/__random/mersenne_twister_engine.h
+++ b/libcxx/include/__random/mersenne_twister_engine.h
@@ -181,6 +181,9 @@ class mersenne_twister_engine {
for (size_t __i = 1; __i < __n; ++__i)
__x_[__i] = (__f * (__x_[__i - 1] ^ __rshift<__w - 2>(__x_[__i - 1])) + __i) & _Max;
__i_ = 0;
+#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ __update_all_states();
+#endif
}
template <class _Sseq, __enable_if_t<__is_seed_sequence_v<_Sseq, mersenne_twister_engine>, int> = 0>
_LIBCPP_HIDE_FROM_ABI void seed(_Sseq& __q) {
@@ -203,17 +206,43 @@ class mersenne_twister_engine {
return;
__x_[0] = result_type(1) << (__w - 1);
}
+#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ __update_all_states();
+#endif
+ }
+
+ void __update_state(size_t __i, size_t __k) {
+ const size_t __j = (__i + 1) % __n;
+ const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
+ const result_type __yp = (__x_[__i] & ~__mask) | (__x_[__j] & __mask);
+ __x_[__i] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
+ }
+
+ void __update_state(size_t __i) { __update_state(__i, (__i + __m) % __n); }
+
+ void __update_all_states() {
+ size_t __i = 0;
+ // This is split into two loops to help the compiler vectorize the code
+ for (; __i != (__n - __m); ++__i)
+ __update_state(__i);
+ for (size_t __j = 0; __i != __n; ++__i, ++__j)
+ __update_state(__i, __j);
}
// generating functions
[[__nodiscard__]] _LIBCPP_HIDE_FROM_ABI result_type operator()() {
- const size_t __j = (__i_ + 1) % __n;
- const result_type __mask = __r == _Dt ? result_type(~0) : (result_type(1) << __r) - result_type(1);
- const result_type __yp = (__x_[__i_] & ~__mask) | (__x_[__j] & __mask);
- const size_t __k = (__i_ + __m) % __n;
- __x_[__i_] = __x_[__k] ^ __rshift<1>(__yp) ^ (__a * (__yp & 1));
- result_type __z = __x_[__i_] ^ (__rshift<__u>(__x_[__i_]) & __d);
- __i_ = __j;
+#ifdef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ size_t __val = __x_[__i_];
+ if (++__i_ == __n) [[__unlikely__]] {
+ __update_all_states();
+ __i_ = 0;
+ }
+#else
+ __update_state(__i_);
+ size_t __val = __x_[__i_];
+ __i_ = (__i_ + 1) % __n;
+#endif
+ result_type __z = __val ^ (__rshift<__u>(__val) & __d);
__z ^= __lshift<__s>(__z) & __b;
__z ^= __lshift<__t>(__z) & __c;
return __z ^ __rshift<__l>(__z);
diff --git a/libcxx/test/benchmarks/random.bench.cpp b/libcxx/test/benchmarks/random.bench.cpp
index e6af4c3e26eaf..3f73504949f62 100644
--- a/libcxx/test/benchmarks/random.bench.cpp
+++ b/libcxx/test/benchmarks/random.bench.cpp
@@ -34,4 +34,15 @@ static void BM_SeedSeq_Generate(benchmark::State& state) {
}
BENCHMARK(BM_SeedSeq_Generate)->Ranges({{1, MAX_SEED_LEN}, {1, MAX_BUFFER_LEN}});
+template <class Engine>
+static void BM_engine(benchmark::State& state) {
+ Engine engine;
+
+ for (auto _ : state) {
+ benchmark::DoNotOptimize(engine());
+ }
+}
+BENCHMARK(BM_engine<std::mt19937_64>)->Name("std::mt19937_64::operator()");
+BENCHMARK(BM_engine<std::mt19937>)->Name("std::mt19937::operator()");
+
BENCHMARK_MAIN();
diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
index 02df0345525cb..b261f37450a81 100644
--- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_result_type.pass.cpp
@@ -26,23 +26,21 @@
#include "test_macros.h"
#if TEST_STD_VER >= 11
-#include "make_implicit.h"
-#include "test_convertible.h"
+# include "make_implicit.h"
+# include "test_convertible.h"
#endif
template <class T>
-std::string
-to_string(T const &e)
-{
- std::ostringstream os;
- os << e;
- return os.str();
+std::string to_string(T const& e) {
+ std::ostringstream os;
+ os << e;
+ return os.str();
}
-void
-test1()
-{
- const char* a = "0 1 1812433255 1900727105 1208447044 2481403966 4042607538 337614300 "
+void test1() {
+ const char* a =
+#ifndef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ "0 1 1812433255 1900727105 1208447044 2481403966 4042607538 337614300 "
"3232553940 1018809052 3202401494 1775180719 3192392114 594215549 184016991 "
"829906058 610491522 3879932251 3139825610 297902587 4075895579 2943625357 "
"3530655617 1423771745 2135928312 2891506774 1066338622 135451537 933040465 "
@@ -137,15 +135,82 @@ test1()
"2361884409 2860936803 683833250 3291277128 1686857206 1112632275 "
"1200680507 3342928196 2677058150 939442136 3407104669 2906783932 "
"3668048733 2030009470 1910839172 1234925283 3575831445 123595418 "
- "2362440495 3048484911 1796872496";
- std::mt19937 e1(0);
- assert(to_string(e1) == a);
+ "2362440495 3048484911 1796872496"
+#else
+ "2443250962 1093594115 1878467924 2709361018 1101979660 3904844661 676747479 2085143622 1056793272 3812477442 "
+ "2168787041 275552121 2696932952 3432054210 1657102335 3518946594 962584079 1051271004 3806145045 1414436097 "
+ "2032348584 1661738718 1116708477 2562755208 3176189976 696824676 2399811678 3992505346 569184356 2626558620 "
+ "136797809 4273176064 296167901 3430730584 331909803 1908676996 1950065095 604298543 3615988338 1570232852 "
+ "1028209748 1511467721 2411887154 4210753555 3096762720 423429618 659966766 2937509307 2222847265 378636552 "
+ "1142109618 2509241601 1521729757 888533219 250885260 2455816244 4046047811 1947467789 1395351953 2388948566 "
+ "934627940 194642258 1429256273 2139959677 1543740405 1569613451 4061840539 2075690423 824532376 844152077 "
+ "3218002536 897315311 823414659 1007534698 3139313867 2332794462 3675156583 722594429 3715123011 2656840676 "
+ "2373277715 1516144243 1538161999 1399719297 1448820876 3180842436 2020192709 3279498509 1048107540 3094290376 "
+ "3706920703 3810051683 4003871775 1069557309 151535004 667695756 861767313 1643171871 3649507728 3785763588 "
+ "737899497 2332908276 4082123854 1584539673 3929877280 1046086041 1304062606 2311324008 1190424879 538647603 "
+ "1728806718 148948582 659721465 2351006009 185647941 1825934330 2126619619 2230539295 3878421575 965937340 "
+ "2835563987 419858879 1527311104 2042333483 2745134265 3540517373 1100062165 2308613697 2690739856 2048293545 "
+ "2742876486 2408502115 53398423 3089771461 1398529613 2132477261 504134301 1535108421 1968507173 3412472770 "
+ "4048517196 3509143071 857063211 1429875570 4120479871 2786574360 2470799871 1644104875 2326863162 2033900387 "
+ "274888909 2629973384 1154405937 1839988197 2163830694 268733679 2928953965 387153042 3790900490 3202349717 "
+ "3799209681 2524871464 3801447311 3543081470 1801633977 3870370950 1581678156 358283485 4133385582 4052311650 "
+ "249498956 1712028623 3618329357 3395106946 2704820515 26653208 2437509555 4192186371 3639946838 2615917799 "
+ "294624699 463886267 2477203673 2514051526 4162882381 2937629358 3180524454 1388392394 2637132139 1999482082 "
+ "1870663339 2852309250 3489430700 1116063402 1673637188 1941955790 4081919937 2322920953 3500518887 2722575905 "
+ "405031829 3728964889 3464559963 665516555 1626835870 2523729468 238289561 497556937 2581429740 3456619478 "
+ "2601389837 820426192 268141532 2654829421 349692193 2426957585 1465734488 85095426 1080895536 2823366942 "
+ "379322515 2938986739 1561328720 2940081697 607513620 2724557130 2841377034 14123440 1085631349 1977859413 "
+ "1325586902 1690398943 2516154740 4144373551 555899232 1472707937 3318086852 719779833 3545481907 1384350857 "
+ "191709822 2924586997 3905397527 2528674757 2377804096 2742818576 4162971050 1916415976 2229076768 132706400 "
+ "1337415646 251604474 4168783505 819499074 1213291699 2098930479 1009044052 1060792037 2169940733 2973281031 "
+ "636656529 1946890813 367099469 4076624283 338339529 561343735 3309733580 3895891229 516195845 3075613489 "
+ "3076388119 4088758753 3895582245 1192445752 2923797073 2272605437 2964193665 943979628 3263904824 1852145108 "
+ "1911050628 1596880711 479795791 212699077 2172697748 1764175804 3951845064 2182587171 2396848133 2718837214 "
+ "2934177572 3638054152 914795167 1028977354 1744985339 1161407853 2069746822 3109934340 3666150054 729399111 "
+ "2911998815 152809615 417267263 1064343325 2751707923 1833270972 886939906 4054231201 1410366452 976142646 "
+ "1452795786 1904234879 4231894541 1505392175 3498767279 833704604 2100592828 688268099 1752675602 1975556664 "
+ "2102210733 698665709 1232104968 4051336323 1740516649 3131721670 3755143232 3433756601 138325540 1566724819 "
+ "3146312914 3262098346 1400757929 3821885720 356740291 4236900846 3962771215 3383537419 3432281817 3700484231 "
+ "1124512300 4040103150 2152814065 357241942 3507144572 3156778000 4029389048 1495464238 2710816120 618937484 "
+ "923913256 3233161411 3113338135 2380534800 2989134055 792458413 2073679910 2733527896 1078384210 2832175364 "
+ "501385130 1554930792 2339252603 535487294 2983664186 924228889 2127502206 2847205678 836935943 1902192892 "
+ "4094716961 3296730761 2307406435 281523156 728701372 3943302480 183005637 2660706047 2320033913 2011717602 "
+ "219970222 890345073 2479236311 653839655 38538414 3266308455 3726363269 1256762826 712114913 3499059198 "
+ "2847394904 3246075282 1299462737 830090526 369065487 3899451086 1825910875 2697294244 2553197317 2501134241 "
+ "930821716 2841281141 3920808923 3209045349 3381621736 2145077949 1958091404 371971179 3064957112 3151429184 "
+ "2833651995 1089438243 2146134351 1426568997 3528669710 1043897757 3052263589 3205925012 4076215371 2622476950 "
+ "2385717100 2179892838 3820135605 1574628644 177604240 1712062317 1192081671 1107476027 837376039 2818244460 "
+ "1382379731 2749207910 2644203474 1508860349 3006844699 3157252375 3789683778 1985542020 2309789126 1624089624 "
+ "3660683301 1432444043 1172735898 3271587635 841387671 3614623669 3002115850 1078807738 1095345284 1707086713 "
+ "4263485053 445506874 3148772337 2716917408 3836812085 1026228926 491069724 3983218285 2410582206 3821759029 "
+ "3789305873 1223256738 1677180485 1481771733 1670286271 2852111711 1628943665 2289772949 3483580787 2129860019 "
+ "3955695109 28974017 2289227173 1725243773 483357125 111587742 347631238 1805029491 839978009 339030914 "
+ "2442782449 1701726526 1481742442 3703534067 3796147861 235078546 3195450129 1420184214 998981944 163541155 "
+ "2087693215 3827554748 3003331872 1967967170 160190917 544473278 3884602428 4180513186 1603446876 2191744556 "
+ "1938251010 291242497 1764195107 4076051069 3860380798 806452940 2631256196 949838208 4096577802 1519225265 "
+ "2296800559 1015848400 2864792481 88004533 195132439 966918321 1451347413 2322994051 3585658769 1771598947 "
+ "3308395968 950148946 3846061568 564475171 1345892193 2439581032 2907206869 1297626422 3779454571 818255727 "
+ "705738065 3915384184 4133726754 2724859327 3773743817 326325901 2766390048 2562130418 1885210076 2622324981 "
+ "1727396790 1742653294 3133131942 3790857080 197042473 2868410679 1122976862 2264474389 3607393378 744386048 "
+ "3122128592 1101489146 4064675687 2818166901 2282076661 370818870 3053423257 2272652338 4077081984 4284213290 "
+ "1728304803 3902867896 1643530236 306212760 144705843 498541197 3103269575 4116304893 1646288275 2110757680 "
+ "4092919505 3390929578 1828116798 1847914177 1156754878 2985404552 3970881126 3035874635 2189824678 2637114092 "
+ "2588332748 3917818803 3302695646 1758418726 1934759438 3871576937 1360769189 1051808374 1881390541 757367126 "
+ "3253778407 1685049720 805311189 934898036 95682794 2052240235 3475933669 2213474191 3341273357 2443286051 "
+ "4272536794 696819230 878775027 3332634155 3405126958 2824772573 95284505 3040640920 2412859827 2959515765 "
+ "1764792340 1504924482 2116910326 2293943003 3199262907 1443740894 3900566588 343066614 1927475335 249220892 "
+ "2920636502 3593328327 2648828502 1678096082"
+#endif // _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ ;
+ std::mt19937 e1(0);
+ LIBCPP_ASSERT(to_string(e1) == a);
+ (void)a;
}
-void
-test2()
-{
- const char* a = "0 1 6364136223846793007 13885033948157127961 "
+void test2() {
+ const char* a =
+#ifndef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ "0 1 6364136223846793007 13885033948157127961 "
"15324573939901584278 12737837167382305846 15195339788985155882 "
"6554113247712070460 17235932740818599105 13007415075556305955 "
"6585479514541334743 8274505865835507625 1718218088692873364 "
@@ -248,9 +313,76 @@ test2()
"14091690436120485477 15763282477731738396 16394237160547425954 "
"5066318118328746621 13140493775100916989 6371148952471982853 "
"15150289760867914983 4931341382074091848 12635920082410445322 "
- "8498109357807439006 14836776625250834986";
- std::mt19937_64 e1(0);
- assert(to_string(e1) == a);
+ "8498109357807439006 14836776625250834986"
+#else
+ "4640967165370225016 475580846709610041 992132072322742490 2879266425597847059 9859212410995834590 "
+ "13110412116137766394 2786888605138474240 12527462973726820895 5232191189150589434 8148228587345305383 "
+ "15985190208517110588 17155057006866468333 5040233137627218077 12716217438209898279 7628670991140263350 "
+ "9633431818170735083 8029874679197696152 2546188705250129595 13105544608186384869 6197138528956131705 "
+ "2500767142257833113 4057403796030124452 4801410225133580521 12712510024708253355 1478853541812684571 "
+ "16899998798183024166 763564441705181102 13204668179160915419 6975570844831914277 12029362619687152075 "
+ "17592155920476593974 1391138604394782251 13557582389860889375 6018426101890403504 7401881601334221625 "
+ "281124061034155254 2261645520472923927 10254468173793190351 4336071085409420785 7075410027066751424 "
+ "7438312290102887001 15139389032212795768 12949861808476919158 5221320262711473213 18444574859163569422 "
+ "3327484732560520915 10371833210785813703 494705948341138486 313693460050824934 801700386546917424 "
+ "3333797513889190239 11734932229126290067 4001689285737041461 17077402128101531244 17161815342609821634 "
+ "4393649844836338524 17495132932599391165 16521868517739667677 5661222119201994079 12972222767581865814 "
+ "11571421678172213790 390646047509318948 11495394588801409501 6525248087626393555 8573656613713326328 "
+ "8142990904973493114 13660896775289126601 17864485770152980871 17445884582967639919 5024202147275854142 "
+ "671342157422491897 8265009237858722295 8608118008319642631 9219145998498351877 4556268366257199356 "
+ "6140599343918232709 1607043993756685523 16576680458922020446 2464344868820317239 11814083511457927881 "
+ "17322648412109813175 1813592025330691328 11477642670415214162 17070997401037634101 2303972879274470462 "
+ "11243326672568121379 3445882696291328363 12839802107382893721 12104481080282265364 2596243342696322386 "
+ "17790946661248112185 16074938231864255959 2956506024687822818 5581797792339843057 16395798806003821452 "
+ "1430185758107085903 18323996060167045894 9286586749315539711 11359324205220105656 13078829860258641519 "
+ "5216000878301612113 9168569275644144847 4001438364296785628 2620979336382597902 17733020247211834335 "
+ "9313982434870058041 14715751745255862275 2010565534563004422 3178715725792479308 1903043159754162676 "
+ "14115336913931799326 2521027868575181436 16014439786100458068 12367605516710589904 209714080394415764 "
+ "1624794657804038156 9935768631398762231 4151749392286673312 7107972358174928160 5660032753352365076 "
+ "18036755596310855736 10390782681895899933 1046990263302077358 7362677844682408358 9462769113228112518 "
+ "16297726431682095630 320526314299713717 3778064933596859787 10885323884409002007 2236973268193149682 "
+ "10878852310456567407 2570883140239125692 2789272264811335056 13059628436710418572 2738898868861677604 "
+ "13893534347610447431 5822583231449316688 6492049503818767408 6244748132635487608 8670290879871155016 "
+ "9029174311949188652 14279734151305645897 15912641926116463991 5242647656726280598 18355120933288718928 "
+ "6020122330537384578 14237586109975592522 4056743947737351776 11111921204484673848 2182608451873446153 "
+ "166740030032355275 6707804438883761942 946217821621517312 17920751901125513000 11238439424546078979 "
+ "9206370960702334859 10367106562255294642 16885700982121403407 5166729472772734774 12763662184890206104 "
+ "5517776110990532992 14067054651980895669 91103470530233291 13189720418381102366 13302941329281487681 "
+ "10033391968256035918 5361508361658563078 9633125940775192275 4070378705292966499 2578880557354159711 "
+ "8213829012818869727 14609024865720281973 5764529456700294955 4441867238869537141 4877335405025028278 "
+ "3719605268964114254 6912476600417191412 12213543493427784533 9772185674504838078 849905513166852628 "
+ "2288907677236569364 13249989292558739703 17027351938809896108 621729935073174643 11783397793000418128 "
+ "6535353235698302382 17474699882318514854 11002055139008150918 18416122529605421577 6901480652243894157 "
+ "10382683051257874235 4029870255315506009 2965992838295436717 6235535328826140656 12567736520515051239 "
+ "1747508188587454664 6183192989050178616 15953675909489391368 10361870655666472156 13992646052760132872 "
+ "18278663149537015721 2341145555999432211 6926699433818498172 13807760559474580665 14452983890116009870 "
+ "11892982856082687091 17809698859762328768 2068107465420962246 7113569128111994893 4401076180719847553 "
+ "11644868941271347491 13124811241626639928 13749911628127226656 17349042196015114201 17667020131618919593 "
+ "5882998107995308535 3994906988813734883 12471577435602039626 6541516905696908495 12651354739990156236 "
+ "2656551093809687944 8349751746116271717 16003262134315245189 16966957802441281611 9846484220369869695 "
+ "289040869684008784 12984844645788078807 15184274406289320733 8585588724744493207 17783251231435661237 "
+ "8433051731677026430 4615759437146530251 7622401495291460413 11623553053949964326 5539054352599742054 "
+ "8346732818944267068 2539102865177431249 12328004780676882137 14682995638339538937 17618899063173726898 "
+ "3560029508967023860 203715062184427611 4331882803273086182 11747937041982829018 14988651560527263167 "
+ "12178986862382858651 3296725696957964696 13476561205033500550 5411341409364572097 6178165960265458773 "
+ "6637587084784255540 2852138145128301044 285104174921779935 3890210696591283091 15859573696692819698 "
+ "4183398296224968094 169433174359854381 11697218950892752694 13577878976046486116 9712904827015064754 "
+ "7617616830643388997 12751433537134599555 12319041734951133946 10239102328951141680 7290886622313676141 "
+ "4739372139955959505 9070795802053402609 10714415902002968511 14446814812660765483 8195026527484180858 "
+ "10331449076861906227 11969763657717422129 11061711610463627412 3682504726309317968 186477037840564317 "
+ "10307292328882458385 11683537113360307954 11300920371008006928 12769285684201107347 14545522978223964713 "
+ "5045546601922369224 202539708050129846 9727300421085682838 10660376569580918468 1852104613210280002 "
+ "2448572796841074793 4275113756623070536 15430856097668330204 8147758262819931807 13018070382604356536 "
+ "1461468238838418536 6307427532280072746 14454983576432818303 16577253122736704814 11165141699850119488 "
+ "1871342067236738412 15245016873857982253 16807633505182897684 18414686740244106738 14154332998791555826 "
+ "2798471212441347211 3624302277914305292 12175243894993809691 18197954905920110263 869336096513266351 "
+ "17322661882612443490 11198026121992866897 3762399852280847282 3393029619669184773 12618712086407186791 "
+ "11601652706361609238 1815215914966060855"
+#endif // _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ ;
+ std::mt19937_64 e1(0);
+ LIBCPP_ASSERT(to_string(e1) == a);
+ (void)a;
}
template <class E, typename Arg>
@@ -262,13 +394,12 @@ void test_implicit() {
#endif
}
-int main(int, char**)
-{
- test1();
- test2();
+int main(int, char**) {
+ test1();
+ test2();
- test_implicit<std::mt19937, std::uint_fast32_t>();
- test_implicit<std::mt19937_64, std::uint_fast64_t>();
+ test_implicit<std::mt19937, std::uint_fast32_t>();
+ test_implicit<std::mt19937_64, std::uint_fast64_t>();
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp
index ff028929747a6..e0ee8ce39477d 100644
--- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.mers/ctor_sseq.pass.cpp
@@ -24,10 +24,10 @@
#include "test_macros.h"
-void
-test1()
-{
- const char* a = "358595400 4166558815 2016177162 3414480257 "
+void test1() {
+ const char* a =
+#ifndef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ "358595400 4166558815 2016177162 3414480257 "
"4027494649 3722317195 1190532340 3212207148 "
"3537847251 389019999 1098708832 3277907415 "
"1946784350 3608286140 2091419822 2227407035 "
@@ -182,134 +182,267 @@ test1()
"1468866696 2184812884 628246683 3385113037 "
"3041166140 3948531843 1176600829 228286131 "
"2447397608 712235937 3332826819 2676980703 "
- "4019468871 1952389952 1202638254 3625447051";
- unsigned as[] = {3, 5, 7};
- std::seed_seq sseq(as, as+3);
- std::mt19937 e1(sseq);
- std::ostringstream os;
- os << e1;
- assert(os.str() == a);
+ "4019468871 1952389952 1202638254 3625447051"
+#else
+ "358595400 4166558815 2016177162 3414480257 4027494649 3722317195 1190532340 3212207148 3537847251 389019999 "
+ "1098708832 3277907415 1946784350 3608286140 2091419822 2227407035 2229110723 1825348377 1276269279 314337202 "
+ "3182935337 1313150029 3118776508 3707918501 1900972958 4054820954 3973178248 906260237 1403942218 3139931556 "
+ "2807126524 3940936448 1316345796 631296613 2268418920 2914000794 3760588399 3226216036 880155129 4183611084 "
+ "211541083 3755352858 1331383234 3036493096 937478630 2092170412 777784402 93392729 3644029210 1681392086 "
+ "2427001226 3143870332 3703581502 2017505388 1706274541 1049329728 2452031492 3437261233 2581204087 1700889875 "
+ "1652573881 2127047692 3778506964 1960741508 2739602360 3395905609 2123355622 3041272975 784200748 3558951522 "
+ "1002787860 4063320888 1587315560 4042698976 659183308 3082256417 2808969567 2361418535 3468698782 750700970 "
+ "2991209851 3581521382 962022878 2518967363 1476525873 3865977235 2128790058 2380326689 1396773405 312559410 "
+ "1370621899 1154499924 2963101919 2182689761 2071851902 1661288848 2411351341 1362764020 1289894483 1951662807 "
+ "701821506 552267185 2356648449 3949188503 1748307081 87795201 3718396254 4112205936 2819888864 73923733 "
+ "2800033151 839258139 3801779069 3105962436 2111266436 1772784466 3692264298 4148810953 3147390749 3537518553 "
+ "1695044978 1430225842 1252346204 3465285434 3970017763 2920658411 2805151132 290569815 3802301355 1493420394 "
+ "1943029276 1667143611 1049665988 1710824905 220168517 3997946231 1014582791 4244598752 1147604069 2533886627 "
+ "598679964 761521020 431779255 3745982038 768658283 3598262505 1765664789 279538641 715144305 2371628432 "
+ "2655860083 1759010423 3568452003 1910107098 2801429529 3924547532 3862672436 3933725740 1764550618 130893617 "
+ "1460692387 4135312761 2075529299 2880227367 944557368 4166665482 2627749235 3732013815 1595900818 1553312393 "
+ "3529311831 3531462424 2431328342 4075369692 1609967709 3704537555 2067297464 397140475 920618678 2840795964 "
+ "4202512837 1286017648 7035910 1057207826 2325188262 191593698 3697383848 3029712831 2073681914 163454681 "
+ "1329637200 290077398 287239431 4205081522 1233889024 167173087 3267660257 3406068803 2382354609 1680046927 "
+ "125183503 3559536309 3208900974 2912148541 2882879316 1937001086 2919729069 892928802 4141691387 2507406586 "
+ "855548593 3418647837 4035646154 2410275591 248715645 3180757482 1880770722 362912336 2964920095 2319904154 "
+ "1493655850 4240733030 1834485846 1696040454 3329457927 1865824694 847759208 1587231623 3757294772 1161601118 "
+ "3630323833 3007722125 3726418007 2124238171 1205345 172659797 3040354211 885213338 1857049013 447922412 "
+ "719906299 1370059380 1922204800 3960090489 1658822644 1529626863 1565927273 3537718771 2733237258 2180221377 "
+ "921910745 2144937687 1727603895 1315635304 4023867791 2401834107 808854185 2408824497 343935326 185237544 "
+ "746732759 2641236122 4283215329 743609415 1134726665 3892851319 1302851263 3473445597 1326817414 2702766508 "
+ "1943179285 4025685468 932896770 199392138 2787362875 3450501893 3351567147 2461286528 2227605848 2993751114 "
+ "3988215720 1320573368 2866560199 4153194990 3007120042 3260751955 3171763740 2111121243 3962825228 102681859 "
+ "3368179132 802089147 4029273561 424939445 4178414761 2592125109 1960801088 2967746406 310701990 2364200202 "
+ "1320507009 3474372480 784693947 2952246664 1891935330 2048385105 3530082191 3238151038 3293189141 1316053288 "
+ "2087004409 740799958 1187748554 3607767334 1190185990 1408429481 657134359 221834425 3907725865 1068016389 "
+ "1402423875 2598612116 2046886300 2345022518 1196081924 357783981 4013683598 463491626 3269206482 3332444286 "
+ "886491955 2257342866 475911113 833576299 2893727564 2866985145 1413365115 2995166393 1486060436 161205225 "
+ "3181728373 3056027137 2040371876 2182305146 3028448628 2214316977 1266227021 876938740 276477469 752158077 "
+ "2182179045 1381698878 3424557652 666674427 968327842 2534296575 265105940 961112540 2641188117 2319139814 "
+ "1750453329 3450138343 678025317 1477566458 3773796420 2933993832 3326042905 4084805260 444182455 255333481 "
+ "785163068 2321290820 2893603234 3005520266 541104079 1383277090 2770755666 3764627833 583371929 2864949033 "
+ "1487681116 1811788361 240329486 3094213377 958509875 2564379085 1636995945 2070894127 2139004232 1747850055 "
+ "3841512327 3325011872 1161622604 639182193 3533652535 4022667522 761048999 3337743670 254221568 2784956233 "
+ "2990252814 4207922787 275707208 261819597 2071467265 4034945770 1999813410 3038921100 2200194573 1328217451 "
+ "2440612380 3862293692 2733976812 2750523058 2920082515 3809044908 4285231753 3131963297 3481602724 1396460739 "
+ "2011767965 2481047764 2958452120 3044188618 2217236658 3448605566 757716104 1818279145 2641228144 1312649639 "
+ "1194087684 3845229729 1747658356 874418803 1956637337 268670179 2083040240 2577671381 3375334655 2587828868 "
+ "1383012799 3583445685 2594576715 3282337104 4257972751 3440488071 3129180313 1830891395 1594931092 2680778339 "
+ "3984026324 1102770400 2315820258 1263467048 1133254110 2400676748 2251795328 1036154092 3313541051 2277356560 "
+ "1477696003 1417117088 3968537402 1404882202 2011058180 4114080985 1727459502 4100235708 2334509310 2829432554 "
+ "377936301 1519324520 3252826644 1193335837 1929125820 2165344238 4160556243 223340988 670907625 1485396519 "
+ "936389509 3813712964 2706450987 3132506320 875886515 557088991 2854916639 2955496008 2881696287 265169077 "
+ "3239923698 3649366121 4072165960 1233904959 225406526 1767368993 1894882500 2296582180 339255168 83200939 "
+ "2958376148 4100205346 1991250823 3806183082 2691709980 2642354997 3024056146 1681065839 3438299684 1638853652 "
+ "362567001 2307868899 988801086 1342833399 2303298376 1500039911 765489391 4080464497 4155444368 980472018 "
+ "2026981853 3460406995 391970367 667377014 4177754853 2657468948 3560690175 3030464357 2948380657 1208800977 "
+ "2316451404 4001932203 1977856863 4265848271 3116200050 3037586215 1335232764 930230766 1026089249 2482219415 "
+ "2613853154 1854543497 2909555107 3862874043 2609355500 907364682 383900687 358164223 232347546 2536276737 "
+ "3118482806 1254103998 2357334077 1204777304 1996643329 4046232717 2570520290 3173323380 1201411457 2361883023 "
+ "806087062 2984143714 2355127569 864220085 1787696713 1182652984 4200065581 100722519 2380458669 2429592313 "
+ "2618338302 1236529564 1747130196 3711661325 1114068102 510380433 93703089 2277774664 3220741441 1577998569 "
+ "2816701900 4206763045 2495239107 4080390459 1307072677 20360728 1468385549 96049834 3630657447 2809517346 "
+ "3396111678 3043831060 673178359 4256729562 1755211210 1969834535 498315110 3717726302 1544859987 2239930949 "
+ "1595372585 294525219 3961637067 3591840665 3324896933 2300077772 721255886 4197934760 1468866696 2184812884 "
+ "628246683 3385113037 3041166140 3948531843 1176600829 228286131 2447397608 712235937 3332826819 2676980703 "
+ "4019468871 1952389952 1202638254 3625447051"
+#endif // _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ ;
+ unsigned as[] = {3, 5, 7};
+ std::seed_seq sseq(as, as + 3);
+ std::mt19937 e1(sseq);
+ std::ostringstream os;
+ os << e1;
+ LIBCPP_ASSERT(os.str() == a);
+ (void)a;
}
-void
-test2()
-{
- const char* a = "17895233847644109640 14665081038668852234 15987230621890949369 "
- "13796324649827964148 1670828176732799955 14078505147839608672 "
- "15497470967856861790 9566640372296747182 7839811585250789315 "
- "1350068003782415071 5639936432479386921 15925388701147119804 "
- "17415323390466493342 3892358083553387400 13485903346102334794 "
- "16926193162581531132 2711398308226914244 12515538113016451944 "
- "13856492368211347055 17968472785843263993 16129117710261673051 "
- "13041638543181171650 8985803498136324582 401118717516975186 "
- "7221524024767248666 13502820261231663498 8665119664667372350 "
- "4506836866186850029 14762924585995667460 7305266389803732087 "
- "9135600275824854713 8421320656548229332 14585303533697565624 "
- "13062167967956981222 15285580395823625260 17451830328116466708 "
- "17363259891080004456 13238190509560321740 10142215382802200927 "
- "3224236118694175902 15382517208605932923 10818882444738383326 "
- "16604245792882032433 10223425285179753002 1342432445403828765 "
- "4958539418185107403 9374581143772158175 7135181273441366910 "
- "5853026900476841261 8382327930174454355 2371969498930803266 "
- "16961635468480846337 377077518789053577 17661790013255465310 "
- "317500018453124832 3604586262706855295 13340007089026272125 "
- "7614051306438090372 17819007364113857386 15193526497275633437 "
- "6142773218979108210 14883287611587512668 12544132362002344419 "
- "1247987855434921372 6414191755211735979 7160327288923375132 "
- "7347937017206972868 17171048313531629893 18230412825496997383 "
- "10882960195884354661 3270707876715241884 16088870345045208503 "
- "15454419782166694763 1200609322828949525 10186066554418904177 "
- "7554892242763986291 8203847521335919011 16855803304338943001 "
- "16895223408596071476 562183806034700250 17761033068687156643 "
- "12370482348384718931 17895691979506634040 16028877286272943475 "
- "6671425930002400146 15167515621662197335 17503579548680921174 "
- "15910867647138768989 1705705354110203064 12201125760909412022 "
- "5523403744441352645 4540673037752294406 822888669354888870 "
- "13012517529113958824 702032511346794490 1245872939048413008 "
- "18060687614291143943 718002942670251776 14628954120078526945 "
- "7215746609592654001 15288092036204733967 12507582747898016110 "
- "8319356319569362772 3835100005166188461 10769229288786702843 "
- "14682980657311687345 10352054841727718090 13661249361946024317 "
- "1558696616315734178 9963912474249467679 18213809676410642730 "
- "7284438284457478230 8013656044128665351 6817107912809760616 "
- "4989038816564331700 12918068165960947833 9123533477086273623 "
- "741568181450204257 3801962339733348259 1923812112542486965 "
- "5884360231397942779 17008459141377852544 6569697353326895092 "
- "15194386425456240489 9363979514988323850 9212437218544795097 "
- "5650610605870621879 10315798944006232463 10345822437227504297 "
- "795589193815296350 11344022765750598871 3193778122705907169 "
- "16719669104430190089 14918335244853046975 11608293761910939782 "
- "17290187430985633813 856382712722415618 14819792788008454203 "
- "10571145147196955435 12858063129221173592 5671819431516788648 "
- "17837836658827607239 14004823010100183722 9067196699747632668 "
- "441015230260308492 3444946658209715644 1825101023084664281 "
- "11133092574473850025 12746373758552339264 10154162549097295782 "
- "14922316177042921089 12679802872389794491 8797747037480461410 "
- "13907752811248535439 5652405835046458389 3181711594575177977 "
- "15495242712294857418 6049158560807439366 952771601159099159 "
- "4587095466254740009 11160954054611782211 10071795025240457628 "
- "1536670498623767300 1990681379653546894 14312739227381277138 "
- "9695213786215402291 3580182943401628617 12313607438786545484 "
- "12864141705426648443 692371170805382036 13125536612285239925 "
- "9372929234002877092 9510419002221032820 3766423210161674061 "
- "3230494342413727261 5934351496112072933 2863344864469097044 "
- "10884720908958139042 4127946927340597780 9960629658622711061 "
- "14818231351611083857 6346099615454582885 12601407558879514692 "
- "17544105005554819865 1096648950913019831 9969868157190185788 "
- "12908611252828823970 5941129863397152719 16168953427117105234 "
- "12304862402025196697 7781571759256122972 13289545261301048078 "
- "11013924305579914035 8894422550580466537 7506958826675805512 "
- "14280817252893250439 2745266616282182732 17277225453205013047 "
- "14335499905842065319 11961295941780577536 18072890757248426766 "
- "1124506606842606920 17329960125355005185 13052066741624159010 "
- "5704650516221677069 16588425097127709212 11813406583737887980 "
- "16359723311775411283 13451679937172566665 5997753207634594468 "
- "10656019008205694109 13074690560123889048 14811648124990806194 "
- "7809449463531558024 5637787273252434288 16515135932856030468 "
- "3755600163640125044 1153929634172103321 11071014283313196016 "
- "11114640359080035583 15390782025450330559 14097530518721927499 "
- "14776783751481098767 7863618667181998233 11513855295425132436 "
- "4736362806980864724 5426549653049482466 10310828122060887518 "
- "4450247941008370560 9781171949844602811 6086471549040450051 "
- "6033923116291003194 17669843285681524740 17610378273478865070 "
- "12152320288002263294 6525449125788834221 5125338396312613396 "
- "9300082688721166268 959242243476884691 6379729471368150249 "
- "16379772457647614853 13454012201619761707 2392678998182524851 "
- "12693758700673471007 1138892516507202079 15673908144065302514 "
- "5299581449349386824 7590792025124859454 9863745357571267780 "
- "357345312340746112 17610247870912740564 16347431861769737095 "
- "11348828299228888092 7220122803951857490 7038822841708464676 "
- "9912221445023094105 5767425533670320190 6442622362743049032 "
- "17525461567869579503 4211095256108567696 14862334876401617373 "
- "2866362449624104511 11413742225973279461 13015745308569358847 "
- "5191760666536228849 17188167935010684492 18321678815621002079 "
- "13046333455321624690 3995310719038261500 10661051209947341089 "
- "7965203671238327266 16590917686161852835 3897101637344795372 "
- "1538303624766151695 10893225639252940698 5386335660311332214 "
- "5174479122000384061 17378437193516866561 13629320139302700770 "
- "10144210341964027265 12816799659000064406 3711797003976467729 "
- "5079455890584507977 432599929275804205 10435019529328454317 "
- "5310854040535477246 15941464006450157396 2192067269367387270 "
- "9782967689631091633 6777452250210540865 18067909703113078220 "
- "17525143578810667971 87448662189824165 412530897284614413 "
- "12066785122245373863 13073154860645125438 18282514257379582711 "
- "8460374908111578570 15967512883067334502 9620430172798103891 "
- "1264976185047610409 15426838192579528907 9878758812321441445 "
- "18029992505662864846 9383699886128308360 14538949787806484635 "
- "16958815135940772668 980481467951972605 3059030058898313960 "
- "11497544574740915907 8385450996898478663 15571176518627282350";
- unsigned as[] = {3, 5, 7};
- std::seed_seq sseq(as, as+3);
- std::mt19937_64 e1(sseq);
- std::ostringstream os;
- os << e1;
- assert(os.str() == a);
+void test2() {
+ const char* a =
+#ifndef _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ "17895233847644109640 14665081038668852234 15987230621890949369 "
+ "13796324649827964148 1670828176732799955 14078505147839608672 "
+ "15497470967856861790 9566640372296747182 7839811585250789315 "
+ "1350068003782415071 5639936432479386921 15925388701147119804 "
+ "17415323390466493342 3892358083553387400 13485903346102334794 "
+ "16926193162581531132 2711398308226914244 12515538113016451944 "
+ "13856492368211347055 17968472785843263993 16129117710261673051 "
+ "13041638543181171650 8985803498136324582 401118717516975186 "
+ "7221524024767248666 13502820261231663498 8665119664667372350 "
+ "4506836866186850029 14762924585995667460 7305266389803732087 "
+ "9135600275824854713 8421320656548229332 14585303533697565624 "
+ "13062167967956981222 15285580395823625260 17451830328116466708 "
+ "17363259891080004456 13238190509560321740 10142215382802200927 "
+ "3224236118694175902 15382517208605932923 10818882444738383326 "
+ "16604245792882032433 10223425285179753002 1342432445403828765 "
+ "4958539418185107403 9374581143772158175 7135181273441366910 "
+ "5853026900476841261 8382327930174454355 2371969498930803266 "
+ "16961635468480846337 377077518789053577 17661790013255465310 "
+ "317500018453124832 3604586262706855295 13340007089026272125 "
+ "7614051306438090372 17819007364113857386 15193526497275633437 "
+ "6142773218979108210 14883287611587512668 12544132362002344419 "
+ "1247987855434921372 6414191755211735979 7160327288923375132 "
+ "7347937017206972868 17171048313531629893 18230412825496997383 "
+ "10882960195884354661 3270707876715241884 16088870345045208503 "
+ "15454419782166694763 1200609322828949525 10186066554418904177 "
+ "7554892242763986291 8203847521335919011 16855803304338943001 "
+ "16895223408596071476 562183806034700250 17761033068687156643 "
+ "12370482348384718931 17895691979506634040 16028877286272943475 "
+ "6671425930002400146 15167515621662197335 17503579548680921174 "
+ "15910867647138768989 1705705354110203064 12201125760909412022 "
+ "5523403744441352645 4540673037752294406 822888669354888870 "
+ "13012517529113958824 702032511346794490 1245872939048413008 "
+ "18060687614291143943 718002942670251776 14628954120078526945 "
+ "7215746609592654001 15288092036204733967 12507582747898016110 "
+ "8319356319569362772 3835100005166188461 10769229288786702843 "
+ "14682980657311687345 10352054841727718090 13661249361946024317 "
+ "1558696616315734178 9963912474249467679 18213809676410642730 "
+ "7284438284457478230 8013656044128665351 6817107912809760616 "
+ "4989038816564331700 12918068165960947833 9123533477086273623 "
+ "741568181450204257 3801962339733348259 1923812112542486965 "
+ "5884360231397942779 17008459141377852544 6569697353326895092 "
+ "15194386425456240489 9363979514988323850 9212437218544795097 "
+ "5650610605870621879 10315798944006232463 10345822437227504297 "
+ "795589193815296350 11344022765750598871 3193778122705907169 "
+ "16719669104430190089 14918335244853046975 11608293761910939782 "
+ "17290187430985633813 856382712722415618 14819792788008454203 "
+ "10571145147196955435 12858063129221173592 5671819431516788648 "
+ "17837836658827607239 14004823010100183722 9067196699747632668 "
+ "441015230260308492 3444946658209715644 1825101023084664281 "
+ "11133092574473850025 12746373758552339264 10154162549097295782 "
+ "14922316177042921089 12679802872389794491 8797747037480461410 "
+ "13907752811248535439 5652405835046458389 3181711594575177977 "
+ "15495242712294857418 6049158560807439366 952771601159099159 "
+ "4587095466254740009 11160954054611782211 10071795025240457628 "
+ "1536670498623767300 1990681379653546894 14312739227381277138 "
+ "9695213786215402291 3580182943401628617 12313607438786545484 "
+ "12864141705426648443 692371170805382036 13125536612285239925 "
+ "9372929234002877092 9510419002221032820 3766423210161674061 "
+ "3230494342413727261 5934351496112072933 2863344864469097044 "
+ "10884720908958139042 4127946927340597780 9960629658622711061 "
+ "14818231351611083857 6346099615454582885 12601407558879514692 "
+ "17544105005554819865 1096648950913019831 9969868157190185788 "
+ "12908611252828823970 5941129863397152719 16168953427117105234 "
+ "12304862402025196697 7781571759256122972 13289545261301048078 "
+ "11013924305579914035 8894422550580466537 7506958826675805512 "
+ "14280817252893250439 2745266616282182732 17277225453205013047 "
+ "14335499905842065319 11961295941780577536 18072890757248426766 "
+ "1124506606842606920 17329960125355005185 13052066741624159010 "
+ "5704650516221677069 16588425097127709212 11813406583737887980 "
+ "16359723311775411283 13451679937172566665 5997753207634594468 "
+ "10656019008205694109 13074690560123889048 14811648124990806194 "
+ "7809449463531558024 5637787273252434288 16515135932856030468 "
+ "3755600163640125044 1153929634172103321 11071014283313196016 "
+ "11114640359080035583 15390782025450330559 14097530518721927499 "
+ "14776783751481098767 7863618667181998233 11513855295425132436 "
+ "4736362806980864724 5426549653049482466 10310828122060887518 "
+ "4450247941008370560 9781171949844602811 6086471549040450051 "
+ "6033923116291003194 17669843285681524740 17610378273478865070 "
+ "12152320288002263294 6525449125788834221 5125338396312613396 "
+ "9300082688721166268 959242243476884691 6379729471368150249 "
+ "16379772457647614853 13454012201619761707 2392678998182524851 "
+ "12693758700673471007 1138892516507202079 15673908144065302514 "
+ "5299581449349386824 7590792025124859454 9863745357571267780 "
+ "357345312340746112 17610247870912740564 16347431861769737095 "
+ "11348828299228888092 7220122803951857490 7038822841708464676 "
+ "9912221445023094105 5767425533670320190 6442622362743049032 "
+ "17525461567869579503 4211095256108567696 14862334876401617373 "
+ "2866362449624104511 11413742225973279461 13015745308569358847 "
+ "5191760666536228849 17188167935010684492 18321678815621002079 "
+ "13046333455321624690 3995310719038261500 10661051209947341089 "
+ "7965203671238327266 16590917686161852835 3897101637344795372 "
+ "1538303624766151695 10893225639252940698 5386335660311332214 "
+ "5174479122000384061 17378437193516866561 13629320139302700770 "
+ "10144210341964027265 12816799659000064406 3711797003976467729 "
+ "5079455890584507977 432599929275804205 10435019529328454317 "
+ "5310854040535477246 15941464006450157396 2192067269367387270 "
+ "9782967689631091633 6777452250210540865 18067909703113078220 "
+ "17525143578810667971 87448662189824165 412530897284614413 "
+ "12066785122245373863 13073154860645125438 18282514257379582711 "
+ "8460374908111578570 15967512883067334502 9620430172798103891 "
+ "1264976185047610409 15426838192579528907 9878758812321441445 "
+ "18029992505662864846 9383699886128308360 14538949787806484635 "
+ "16958815135940772668 980481467951972605 3059030058898313960 "
+ "11497544574740915907 8385450996898478663 15571176518627282350"
+#else
+ "12332679912394435791 9453873875014225299 7194476751338084717 15353332195928478249 10481090450137100787 "
+ "16894768970350315699 9140706850585347923 17060753788370102662 5027480258542244180 4237901618226072654 "
+ "1625191769495810967 14151318192590258819 14578513270917221567 1340379920765042993 16984341741367590539 "
+ "17825705796225691974 10460633243946900672 15537248717777931667 18010309519743623944 11238461300079763233 "
+ "5212834616069799861 14803562233233663569 509073377271690301 9868447031443646872 18426739611230355604 "
+ "405337453835701754 2865140403182526171 17022743117531244315 15873574515363721317 1003946026159741321 "
+ "10106235397909731784 7501984743217763859 9608180616803748513 17321043653964822159 138792968844647510 "
+ "13940152250553688762 16186510718789785685 10788084171130680879 3336642670408666887 7310094463387030739 "
+ "5523088258140426915 1285026150975382598 13098435840364629682 6200633715587124711 5088226041080887554 "
+ "11020661496106860750 12793876732801641662 3576577317235426397 15183184978662083277 15861657920389428029 "
+ "470273426362791941 2574629887817053182 13272148377140358694 3004438593777107412 2652718879104414667 "
+ "1834027854782609871 10456539872813643760 6392289299447966013 9267269600134252311 10114120825136775101 "
+ "2198130084042867418 13999435202207229825 14893120434100842814 2852347522408045763 17948795049429383857 "
+ "17441093961240168873 5399621587997711172 12611952947737738867 6103704372959848527 738297531584281114 "
+ "16788685814043292624 6176291056095750530 16428159208694695523 4245608719980075114 12095265841295350099 "
+ "15191360055442418178 8708130367787597793 9264267659253066420 15969277182114773779 17035922951690056341 "
+ "9880719443672114132 15332192661202958624 14150490775662311299 4012807722045209888 8653700056821051719 "
+ "15242621354372282880 17096356791700814452 16018787795979380803 296068005088784708 4048466329605633785 "
+ "8059310313495723083 8563086889008277869 10184519287956394000 6827268421235011709 17346498307575607164 "
+ "6880036350466817261 16153597041588957084 15405131912393208395 12767350280822570901 1052885868672540599 "
+ "4188094412071243913 1126222035238982882 9191486289101564624 10803640833835240836 3601208394977378668 "
+ "4766334496475281242 7832706214999682994 16891444816728487342 17860841416138565015 12370215439434878681 "
+ "9232823972512380788 3640121802277180952 65633375613217608 13600365462550545275 17948579528827407927 "
+ "765525796436836449 13572020505370210613 11924972776661436983 4057541052165744297 17481588995966250594 "
+ "8006213088863539837 9739468715064136699 2716054689781779647 16549004007254321028 4910543003771498131 "
+ "13361071256636157603 15297097731894649703 17624276599277544080 15499557723143597570 17957222608348359804 "
+ "2778177927288936525 13637160153035836011 5098746756051510535 4146145678876364034 2247309035465090095 "
+ "9569124281048572866 12809922376030463313 15451507763993230705 17163206508771813131 17029710194125776618 "
+ "8061947308014036349 1058089520886506655 13597933493965622376 13504098358025602133 1333487301584903927 "
+ "8426860107195956174 3508319831781619992 13220104443771667566 15729810053761292123 4229931263400540722 "
+ "4166080451531777928 6512350709932085964 11707745856776186054 5335698181984744736 16601891716487755730 "
+ "14845047860332527819 13881061187353168588 2290627681380867569 15008794942145533328 9207539692861337313 "
+ "15854225885502222653 12652120737459513649 8391328319785893524 16218535624802384239 10635204123630136612 "
+ "14741489403103018051 1034273171946262577 2598761621738522071 10597540332677591413 11769725249744073186 "
+ "12729182262319592409 13143766812621949948 7337533679729790607 8700823377064447860 6528412901068836499 "
+ "12887771189408551435 6596057164621086436 9725510839601037147 12589333640740308830 8713351353100408409 "
+ "3200078174512985423 3001899537338861016 14245433087720289982 2342459702085298473 15840929965350904315 "
+ "5242384259319523672 6976265022106569670 4694429153464034874 4640016838764614916 11889897715595570593 "
+ "3752569812323601873 2900819842622530250 1859087250745968648 12106047926770169995 12635768141780418349 "
+ "460915272050913013 16909625031804250705 15219281218948426364 15473817896328511538 356510218273447008 "
+ "4322019207571293094 3044055123444388775 14541219878139834671 16010790916272798386 17663395908622954435 "
+ "12611516608169911627 16319922669204576197 16662253955344225107 16530145161795660660 13055268744196885107 "
+ "7863493504777224455 4884882190835979670 17860099797924912564 7963955360230183301 12071138257120882069 "
+ "18357891564140620935 12793730149183942271 14575396984169788025 3998777626616457896 16107243833817385461 "
+ "2800961891557584893 2799945392029798727 11053512580047143649 11067103105271293369 1968075203485277477 "
+ "3090469630341592171 14797167942499219775 1314244307340344386 5197117610141487191 14715472132315901058 "
+ "10223376637313339598 18090093248597656064 162846477809223606 18060308085200244427 4381704277003259436 "
+ "13919578743352454047 12290099036217748490 2399520646070724256 8630374525153030174 12607432526554525963 "
+ "13596968856308825531 4310477479909840944 5249608228653410962 3699954346213058725 287328857418258109 "
+ "6119686667148845021 5412656704791399252 4791204075127203599 14494596012449800144 6684909344487566871 "
+ "4578857374794350422 3320300604108137187 12579270049709840437 16704843247071205209 3817825700702948560 "
+ "5357944831944862632 1304382350048285997 10815164501630203260 438468935207234712 4455248787965292675 "
+ "16418065713664649114 16484487561423541185 10845743900807077540 376195122763577279 15264985897394715313 "
+ "7633016332459855519 18374759716909813581 7494762658573963878 12561201922274984497 17674342236666928778 "
+ "8885969173395223311 8755229097686715671 1319918912921290459 12669348064964076026 8347713925484594194 "
+ "7131861330014060437 18013870281775146388 18428665316372779146 14853358900946804630 11802355386662327119 "
+ "12234197935566505458 1562495104086441070 4789216534718205848 4797493321171570223 11489013455481650173 "
+ "15991479755025557462 5193680184864207374 538012454739572314 12691714223537549902 1625023157851387876 "
+ "15523181006631146535 5212032641878267513 314342477903124542 7039243305239188299 13660860177517273492 "
+ "279600177346432632 1242305966848399256 3754792367662117676 7456833993243708712 5524526481950173096 "
+ "12629250495102362491 12320658947410481525 8375636660933855231 14586189041466889258 3338611085276113663 "
+ "6796460652093029292 17977915623844806175 6678041303167794104 162629150799512142 12738967623757853162 "
+ "15873580300066345221 1661173500922285893"
+#endif // _LIBCPP_ABI_VECTORIZED_MERSENNE_TWISTER_ENGINE
+ ;
+ unsigned as[] = {3, 5, 7};
+ std::seed_seq sseq(as, as + 3);
+ std::mt19937_64 e1(sseq);
+ std::ostringstream os;
+ os << e1;
+ LIBCPP_ASSERT(os.str() == a);
+ (void)a;
}
-int main(int, char**)
-{
- test1();
- test2();
+int main(int, char**) {
+ test1();
+ test2();
return 0;
}
More information about the libcxx-commits
mailing list