summaryrefslogtreecommitdiff
path: root/absl/random
Commit message (Collapse)AuthorAge
* Migrate most RAW_LOGs and RAW_CHECKs in tests to regular LOG and CHECK.Gravatar Andy Getzendanner2023-05-23
| | | | | | | | | | | The non-RAW_ versions provide better output but weren't available when most of these tests were written. There are just a couple spots where RAW_ is actually needed, e.g. signal handlers and malloc hooks. Also fix a couple warnings in layout_test.cc newly surfaced because the optimizer understands CHECK_XX differently than INTERNAL_CHECK. PiperOrigin-RevId: 534584435 Change-Id: I8d36fa809ffdaae5a3813064bd602cb8611c1613
* Add a declaration for __cpuid for the IntelLLVM compiler.Gravatar niranjan-nilakantan2023-05-23
| | | | | | | | | | | | Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1452 __cpuid is declared in intrin.h, but is excluded on non-Windows platforms. We add this declaration to compensate. Fixes #1358 PiperOrigin-RevId: 534449804 Change-Id: I91027f79d8d52c4da428d5c3a53e2cec00825c13
* Rollback of add a declaration for __cpuid for the IntelLLVM compiler.Gravatar Abseil Team2023-05-22
| | | | | PiperOrigin-RevId: 534213948 Change-Id: I56b897060b9afe9d3d338756c80e52f421653b55
* Merge pull request #1452 from niranjan-nilakantan:niranjan-nilakantan/issue1358Gravatar Copybara-Service2023-05-22
|\ | | | | | | | | PiperOrigin-RevId: 534179290 Change-Id: I9ad24518cc6a336fbaf602269fb01319491c8b60
| * Add a declaration for __cpuid for the IntelLLVM compiler.Gravatar Niranjan Nilakantan2023-05-18
|/ | | | | | | | __cpuid is declared in intrin.h, but is "excluded" on non-Windows platforms. We add this declaration to compensate. Fixes #1358
* YuleSimon/SkewedLow: Cleanup/move benchmarks and overload tests.Gravatar Laramie Leavitt2023-05-10
| | | | | PiperOrigin-RevId: 530999471 Change-Id: Ifca68cd53be629088244eaa3560d43fd81090747
* Fix spelling mistakesGravatar Vertexwahn2023-05-02
|
* Fix spelling mistakesGravatar Vertexwahn2023-04-27
|
* Fix some spelling mistakesGravatar Vertexwahn2023-04-24
|
* Prefer copy_n and fill_n over copy and fill where appropriate.Gravatar Rose2023-04-19
| | | | This lets us avoid having to do the addition manually.
* Changes necessary to support clang-clGravatar Derek Mauro2023-03-30
| | | | | | | | This change fixes -Wimplicit-const-int-float-conversion warnings by making the conversions explicit. PiperOrigin-RevId: 520707623 Change-Id: Ib6917469120cd7458257195cbf39beb3fd397543
* Fix an implicit truncation warning under MSVC 32-bitGravatar Derek Mauro2023-03-20
| | | | | | | | | | Since the return value of `NumBits()` will always fit into `size_t`, use an explicit cast to silence the implicit conversion warning. Fixes #1384 PiperOrigin-RevId: 518041598 Change-Id: If2f2456db4b27b78e9ea9e026dce610953bd5bfb
* Pass correct flags for mingw to use bcryptGravatar Fahrzin Hemmati2023-01-25
|
* Replace the tag "no_test_msvc_x64" with "no_test_lexan" in absl.Gravatar Abseil Team2023-01-12
| | | | | PiperOrigin-RevId: 501644407 Change-Id: Ie98d22e4983cfbd9cad2176925774d624d4702cf
* Improve BitGen stability documentationGravatar Abseil Team2023-01-11
| | | | | | | | | | | | | | Several problems with the previous documentation: * It said it's stable "within the same binary" but not stable "across multiple binary invocations". Those statements contradict each other. * It said "in the same binary will not produce the same sequence of variates within the same binary", which is repetitive since it says "in the same binary" twice. * The comments about the seed sequence were not all next to each other, they were split apart by a rand.req.urng comment. * It implied that process stability is all you get, whereas generally you also get changelist stability. * It said you can use a seed sequence with SharedBitGen, but you can't. * It said there is more info in std_seed_seq.h , but there isn't. PiperOrigin-RevId: 501389708 Change-Id: I5e3dbc3548cc051265b8d004191c23147eccecc3
* Adding BigQuery package to randen_engine visibilityGravatar Abseil Team2022-12-08
| | | | | | | See cl/490546476 for details. PiperOrigin-RevId: 494047255 Change-Id: Ic2f88d976fa9a70ff104c47e9daf682ab7d0b7d2
* Add missing includeGravatar Tom Hughes2022-11-16
| | | | | PiperOrigin-RevId: 488955034 Change-Id: I143f3632b295098bc6ea5c6aedf7446dd91c668b
* Fix typosGravatar Tom Hughes2022-11-15
| | | | | PiperOrigin-RevId: 488799458 Change-Id: I1aaaa60c5be3260055a6f5773f78cb4043a60ac8
* Use the `-l` form for MinGW-specific link dependenciesGravatar Russell Johnston2022-10-15
| | | | | This corrects the generated .pc files, so these libs match the other libs already included there.
* Fix "unsafe narrowing" warnings in absl, 12/12.Gravatar Abseil Team2022-10-13
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL enables these warnings and fixes the remaining known issues.) Bug: chromium:1292951 PiperOrigin-RevId: 480981210 Change-Id: I92d5023c6833e24d6aa29b10d433116329972f41
* Fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Abseil Team2022-09-12
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 473868797 Change-Id: Ibe0b76e33f9e001d59862beaac54fb47bacd39b2
* Remove the ABSL_HAVE_INTRINSIC_INT128 test from pcg_engine.hGravatar Derek Mauro2022-09-02
| | | | | | | | In the time since pcg_engine.h was written, absl::uint128 was fixed to generate identical code to __uint128_t PiperOrigin-RevId: 471789541 Change-Id: Ibd1afc3e5e6d57af27cdd6a21171c96ea333161c
* Rollback of fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Derek Mauro2022-09-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 471561809 Change-Id: I7abd6d83706f5ca135f1ce3458192a498a6280b9
* Fix "unsafe narrowing" warnings in absl, 8/n.Gravatar Abseil Team2022-09-01
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in */internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 471549854 Change-Id: Id685d0e4666212926f4e001b8ef4930b6a33a4cc
* Fix "unsafe narrowing" warnings in absl, 3/n.Gravatar Abseil Team2022-08-04
| | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL focuses on .cc files in dirs n-t, except string.) Bug: chromium:1292951 PiperOrigin-RevId: 465287204 Change-Id: I0fe98ff78bf3c08d86992019eb626755f8b6803e
* Make exponential_distribution_test a bigger test (timeout small -> moderate).Gravatar Abseil Team2022-07-07
| | | | | | | | | | | This test indicates it has a 90% chance of timing out at its current 60 second limit. Stats over 1000 runs: max = 102.5s, min = 40.4s, avg = 71.1s, dev = 11.2s Note that if you run this test locally from a workstation without flags, it'll take maybe 3 to 5 seconds. However, the test is run with config of android_arm, which seems to drastically change the execution time. PiperOrigin-RevId: 459503103 Change-Id: I7b7aaa2db7880370f47d1a83d295a3234f738a18
* explicit_seed_seq_test: work around/disable bogus warnings in GCC 12Gravatar Derek Mauro2022-06-15
| | | | | PiperOrigin-RevId: 455129922 Change-Id: I3b2a62cbf50057b3ea9b73c2edb44271dc46986c
* Make absl::StdSeedSeq an alias for std::seed_seqGravatar Laramie Leavitt2022-06-14
| | | | | PiperOrigin-RevId: 454969441 Change-Id: Ic18d91243ed3aa661ebf47a4c0ea96057aa4092d
* Obey ABSL_DEFAULT_LINKOPTS for all cc_library targetsGravatar Jeremy Nimmer2022-06-06
| | | | | | | A few targets were missing `linkopts = ...` and so were not obeying the project-wide default settings. Omit any changes to cctz for now, because it's vendored from another project.
* Rework NonsecureURBGBase seed sequence.Gravatar Laramie Leavitt2022-06-02
| | | | | | | | | Decompose RandenPoolSeedSeq from NonsecureURBGBase. Adjust how the RandenPoolSeedSeq detects contiguous buffers passed to the generate function. Previously it made incorrect assumptions regarding the contiguous concept, which have been replaced with some type-based tests for a small number of known contiguous random access iterator types, including raw pointers. PiperOrigin-RevId: 452564114 Change-Id: Idab1df9dd078d8e5c565c7fa7ccb9c0d3d392ad2
* Disable tests on some platforms where they currently fail.Gravatar Tom Rybka2022-06-02
| | | | | PiperOrigin-RevId: 452542838 Change-Id: I45d80b220c0450d27423bb23504e95c25811877b
* Internal changeGravatar Abseil Team2022-05-12
| | | | | PiperOrigin-RevId: 448361090 Change-Id: Iec6063b88a778dfe815081612650eaa456503265
* Fix build with uclibc-ng (#1145)Gravatar Fabrice Fontaine2022-03-30
| | | | | | | | | | | | | | uclibc-ng doesn't provide getauxval which results in the following build failure on arm or ppc with any user of abseil-cpp such as grpc: /home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/buildroot/autobuild/instance-0/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libabsl_random_internal_randen_hwaes.so.2111.0.0: undefined reference to `getauxval' To fix this build failure, check that __UCLIBC__ is not defined before using getauxval (as Babel is not able to check function availability) Fixes: - http://autobuild.buildroot.org/results/775f3ca3dedebff29e212b29dfa896b7613b7a02 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Export of internal Abseil changesGravatar Abseil Team2022-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- d3b99682554d339c42556680f4d65f83226005e2 by Martijn Vels <mvels@google.com>: Inline CycleClock code and remove branch for x86 CycleClockSource function This CL removes the relaxed load for x86 as there is no acquire price to pay on x86. It inlines the UnscaledCycleClock::Now() which is a single RTDSC op for x86, and likewise inlines CycleClock::Now() for x86. The inlining should mostly have secondary benefits such as reducing spills on outlined calls. LTO may eventually hoist these functions inline for the hotspots, but it doesn't hurt to default inline this for all builds and let the compiler decide on the first pass. The perlab benchmark is noisy for the plain BM_Now, but the other benchmarks and the run on my local machine are clear. ------------- Local Benchy Benchmark name old cpu/op new cpu/op delta BM_Now 3.41ns ± 1% 2.30ns ± 2% -32.52% (p=0.000 n=50+50) BM_NowWithRegisterPresure 4.96ns ± 2% 4.19ns ± 2% -15.57% (p=0.000 n=56+55) BM_NowWithCallback 3.30ns ± 2% 1.91ns ± 2% -42.00% (p=0.000 n=47+60) ------------- Perflab Benchy Benchmark name old cpu/op new cpu/op delta BM_Now 8.20ns ±13% 4.32ns ±83% ~ (p=0.413 n=4+5) BM_NowWithRegisterPresure 7.91ns ± 1% 3.68ns ± 2% -53.45% (p=0.029 n=4+4) BM_NowWithCallback 2.66ns ±13% 1.58ns ± 0% -40.51% (p=0.008 n=5+5) PiperOrigin-RevId: 434474766 Change-Id: I991d987ae9233e50f09606c874055cf4c5a56300 -- b38330686a0af176a2679163e4d2fa1b90e2f667 by Laramie Leavitt <lar@google.com>: Style, comment, and test updates * Remove a redundant assert in uniform_real_distribution. * Update comment in internal/generate_real.h * Style updates to uniform_real_distribution_test mainly replacing TypeParam with real_type, using aliases for some limits, etc. * Add a few more minor tests. PiperOrigin-RevId: 433902174 Change-Id: Id75be8e24be2fb8f6aea05feec13e3ef320a7254 -- ab2da6047ff7f5dae3add3779fcddf73b03feabf by Abseil Team <absl-team@google.com>: Remove declaration of method whose definition was previously removed. PiperOrigin-RevId: 433507828 Change-Id: I0130b689813125250f7de2664e767e181f676c89 -- df0c87f4ec2c010691931c1bef9d26470a6e63a2 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 433289136 Change-Id: Iba157dc83ed99dafd17a2223d2504e49f8afbb9e -- 7445fa312f2995772900eda82467325b3401a17d by Martijn Vels <mvels@google.com>: Optimize CordReader logic now that CONCAT is removed This CL cleans up various helper functions and logic remaining from previous complex CONCAT logic that is no longer needed, simplifying the CordReader logic. PiperOrigin-RevId: 433208748 Change-Id: I5f7b1883573c44e7c6f8af12c3cddbd197cb134d GitOrigin-RevId: d3b99682554d339c42556680f4d65f83226005e2
* Export of internal Abseil changesGravatar Abseil Team2022-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- f0b7d230a90c82c6fee7adcb46a213d2582b6a7b by Martijn Vels <mvels@google.com>: Optimize substring logic now that CONCAT is removed This CL adds a static Substring() method to CordRepSubstring, and implements substring logic in cord.cc in terms of the new function. This cleans up various helper functions and logic remaining from previous complex CONCAT logic that is no longer needed. PiperOrigin-RevId: 431756805 Change-Id: I39c875b5af119916780e68598c7fc619fb2e8476 -- fa7d1bedf0e1244303844869a332c2a5dbd9ac0f by Derek Mauro <dmauro@google.com>: Allow macro expansion within ABSL_FLAG and ABSL_DECLARE_FLAG args PiperOrigin-RevId: 431721184 Change-Id: I6e19713fb541205d796f940998db5ee25178d55e -- 1b328badd92304ed1c634f23e1c191be57b7bb15 by Laramie Leavitt <lar@google.com>: Add #include for std:: types PiperOrigin-RevId: 431546757 Change-Id: I75efbcd3c77e6f53e4db66494101d30d670d988e -- e25323b299d4d3840218702860f537cdd2a3926f by Thomas Köppe <tkoeppe@google.com>: Add hashing support for pointers to member. Also add tests for function pointers to the existing "pointer" test. PiperOrigin-RevId: 431067588 Change-Id: I3686010635d9fee34c47a418b72402e10737cdbc -- ab27b012a61cf10109fd51932b3b0b05ee78f32f by Laramie Leavitt <lar@google.com>: Avoid use of std::pow in ChiSquare test. PiperOrigin-RevId: 431015830 Change-Id: Idd767ff2f51009ee171de48757207b38330ffea3 -- 28c359135d89061177958580fe4a7493802499cb by Laramie Leavitt <lar@google.com>: Add #include <type_traits> for std::false_type PiperOrigin-RevId: 431005757 Change-Id: I85a6a918778601e19512aaea744424cf39018521 -- a920730f23669479d92e3a696d65d0bc3a5b1de1 by Laramie Leavitt <lar@google.com>: #include <utility> for std::declval PiperOrigin-RevId: 431004934 Change-Id: I295237b2d44e9a15e4083698ea121b68ce0a1bb7 GitOrigin-RevId: f0b7d230a90c82c6fee7adcb46a213d2582b6a7b
* Export of internal Abseil changesGravatar Abseil Team2022-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ed829ac612f090375427c3488827c6e74deb2e3f by Derek Mauro <dmauro@google.com>: Update latest GCC/Clang Linux tests to Bazel 5.0.0 and CMake 3.22.2 PiperOrigin-RevId: 429369775 -- 76952303c4d942288c4e7657ffb5893cec54a132 by Martijn Vels <mvels@google.com>: Optimize Cord::ChunkIterator now that CordRepConcat is removed PiperOrigin-RevId: 429321455 -- dcd0d287793649aba9b98268c5783e449a34749f by Martijn Vels <mvels@google.com>: Add IsDataEdge() and DataEdgeValue() helper functions. This moves repetitive logic accessing data edges into its own header, and more strongly defines the notion of what a data edge is, enforcing the internal invariants. This will also be incorporated in optimized Cord iteration logic once CordRepConcat is totally removed from the Cord code. PiperOrigin-RevId: 429307248 -- 6a0903962155988085bf8656743fda9c4cdcba6c by Abseil Team <absl-team@google.com>: Make it clear that the probability function given for the zipf distribution is unnormalized, i.e., sum(p(x) for x = 0..k) != 100%. Quoting Section 7 of the paper cited in the comments, where this formula comes from (emphasis mine): "We will consider the two parameter generalization as defined in Dagpunar [1988] with the *unnormalized* probability function ..." PiperOrigin-RevId: 429068258 -- 3899ff6d444ba755148bc521a6ee031d9e9d4485 by Abseil Team <absl-team@google.com>: Internal Changes PiperOrigin-RevId: 428644856 -- 319de702d2b537cbb76c4c71277ae89b349b162e by Benjamin Barenblat <bbaren@google.com>: Support symbolization on PA-RISC Null out supervisor bits in PA-RISC addresses before symbolizing, and handle function descriptor tables correctly. Change symbolize_test.cc to use 32-bit aligned addresses, allowing that test to pass on PA-RISC. PiperOrigin-RevId: 428590564 GitOrigin-RevId: ed829ac612f090375427c3488827c6e74deb2e3f Change-Id: Ie01ff3b9365fd45e5a55f858038552679f3180d3
* Export of internal Abseil changesGravatar Abseil Team2022-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- ceee18732f9499d3a53d46d5974f12ea0774b900 by Abseil Team <absl-team@google.com>: Remove division from the profile guided optimization PiperOrigin-RevId: 428444108 -- fc27059f1b0c0b4cb8ddd9a7a88220af52c0c755 by Evan Brown <ezb@google.com>: Rename btree_node::leaf to is_leaf and also add is_internal for readability improvements. PiperOrigin-RevId: 428076422 -- 6a90d18477cc3a6de84282b6e38d6f294aa72748 by Evan Brown <ezb@google.com>: In sanitizer mode, add generation integers to b-tree nodes and iterators and validate that iterators have not been invalidated already when they're used. Even though generation integers are stored in all nodes, we only use the one stored in the root node for validation. The reason we keep one in all the nodes is that nodes can become a root node after they are allocated. Also change the order of args in init_leaf to not violate the style guide. PiperOrigin-RevId: 428054226 -- ede4a0f676f43e7003fd2599c263d55222e760ba by Martijn Vels <mvels@google.com>: Physically remove CordRepConcat This CL removes all uses of CordRepConcat. This change is executed by removing all the dead 'btree_enabled()' and 'IsConcat' branches, and all subsequent dead code. This change explicitly does not optimize any of the remaining code other than the most trivial ones such as removing 'stack' loop vars and loops. PiperOrigin-RevId: 428002308 -- 7cc83d96118149cf1aa1258a066b8fd4517df5f6 by Evan Brown <ezb@google.com>: Change btree_iterator from a struct to a class. Motivation: btree_iterator has private members and invariants so it should be a class. Also merge two private sections. PiperOrigin-RevId: 427768836 -- 524d478b0af422e1a867a8823d9fbad149030360 by Martijn Vels <mvels@google.com>: Physically block the creation of new CordRepConcat nodes. This change removes CordRepConcat creation, issuing a FATAL errors on the (practically impossible) call path on broken invariants. This change is deliberately limited in impact, subsequent changes will be more voluminous ripping out the (now dead) CordRepConcat code. PiperOrigin-RevId: 427741022 -- e21eb354c1bb358ea8b64d0e3fbb378e87b8b8c4 by Derek Mauro <dmauro@google.com>: Update the implementation of ABSL_DEPRECATED to work with GCC, and recommend using the standard attribute [[deprecated]] for C++14 and newer GCC users that are experiencing new warnings can silence them with -Wno-deprecated-declatations. GCC users that want to see the warnings but not error on them can use -Wno-error=deprecated-declarations. PiperOrigin-RevId: 427228952 -- 0ab4ee5660f3a072054dc4ab5056925c26977c7a by Laramie Leavitt <lar@google.com>: Change comment to avoid overflow. PiperOrigin-RevId: 427090218 GitOrigin-RevId: ceee18732f9499d3a53d46d5974f12ea0774b900 Change-Id: Ida00477b6a3d02a8b7bb467be7621b618385d1e9
* Export of internal Abseil changesGravatar Abseil Team2022-01-27
| | | | | | | | | | | | -- dab53ef01a1c8ceebd1347a4918a0def0d7d4ce5 by Derek Mauro <dmauro@google.com>: Migrate away from the remaining usages of GoogleTest's legacy TestCase API and use the new TestSuite API instead PiperOrigin-RevId: 424668744 GitOrigin-RevId: dab53ef01a1c8ceebd1347a4918a0def0d7d4ce5 Change-Id: I599de09f3349d18c2d74795b1f867fa6c99c3eed
* Export of internal Abseil changesGravatar Abseil Team2022-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 75504b9d2eb7560359b98b69136d071f980e04f2 by Abseil Team <absl-team@google.com>: Fix typos in documentation. PiperOrigin-RevId: 423376798 -- bf87e5de48a868f49a57d516be027e6e3a3cc3bd by Gennadiy Rozental <rogeeff@google.com>: Correct WEAK attribute enabling condition. ABSL_ATTRIBUTE_WEAK is present if: compiler has built-in attribute weak OR we are using gcc (and not clang) AND we are not on windows OR we use windows clang version >= 9.0.0 AND we are not on MinGW PiperOrigin-RevId: 423357629 -- a01a8f1b7ea3da4ec349db452162a3333953dd9d by Abseil Team <absl-team@google.com>: There are magic numbers in the expected load factors and probe lengths, and they seem to be wrong especially under msvc. Even under the linux tool chain, these tests fail occasionally. Fix the magic numbers to make the tests succeed. PiperOrigin-RevId: 423320829 -- fd109295a1425ca1cb2b69fe34a294b6189542c0 by Laramie Leavitt <lar@google.com>: Manually align buffers in randen_engine. In C++ it's implementation defined whether types with extended alignment are supported. randen_engine uses vector intrinsics with 16-byte alignment requirements in some instances, so internally we allocate an extra 8 bytes to manually align to 16. No detectable performance impact. PiperOrigin-RevId: 423109265 GitOrigin-RevId: 75504b9d2eb7560359b98b69136d071f980e04f2 Change-Id: I8c5ab2269ff6d9e89d3b4d0e95d36ddb6ce8096e
* Export of internal Abseil changesGravatar Abseil Team2022-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 0db7f4046f9b59c0f8c3df2f0eb7fd88fc328439 by Abseil Team <absl-team@google.com>: Revise documentation of bit_cast: * Removes inappropriate examples (round-tripping pointers, serialization), for which reinterpret_cast is more appropriate. * Removes mention of "bit representation", which is not an explicit notion in C++. The best we get is "byte representation". * Removes a circular defition of "bitcast" as itself, and instead explains what it does. * Removes the mathism "for some values of", which is probably not totally accessible to a general audience, and in any case needless verbiage. * Fixes comments in the example. * Replaces some colloquialisms with simpler, more direct language. PiperOrigin-RevId: 421791786 -- e04e64df55d93c1b9a09c0483b97cc4d8763260d by Derek Mauro <dmauro@google.com>: Update Docker image to use GCC 11.2, Clang 14 (prerelease), CMake 3.22.1, and Bazel 4.2.2 PiperOrigin-RevId: 421658559 -- d002bb3dc5cd1fc5b4cbd79a450efc894caa567c by Chris Kennelly <ckennelly@google.com>: Add a small microbenchmark for absl::bit_width. PiperOrigin-RevId: 421604852 -- 131b057d1b76ecd7170421b48d661bb958ff676b by Evan Brown <ezb@google.com>: Adds a disabled test for EBO in nested `CompressedTuple`s. PiperOrigin-RevId: 421413134 -- e34c7876d3a1212d90c73c030ccae6169b682d43 by Jorg Brown <jorg@google.com>: Show users a better error message if they pass a pointer to absl::Uniform. PiperOrigin-RevId: 421090472 GitOrigin-RevId: 0db7f4046f9b59c0f8c3df2f0eb7fd88fc328439 Change-Id: I5a004e8d17e974fa4897a09d1466ae8fc65dfdbb
* cmake: make `random_mocking_bit_gen` library public. (#1084)Gravatar Andrei Polushin2022-01-07
| | | | | | | An external project may depend on an Abseil `TESTONLY` library like `absl::random_mocking_bit_gen`. Such a library should not be excluded from build when Abseil's own tests are not built. fixes #997
* Export of internal Abseil changesGravatar Abseil Team2022-01-05
| | | | | | | | | | | | | | | | | | -- 04e8fdf6a37d31f9364ca0f70bf663ee972481c6 by Abseil Team <absl-team@google.com>: Another implicit sign conversion found and removed. PiperOrigin-RevId: 419718762 -- dbb6bca7d3cfa9ce79e70d0ed3d0354a4e3a0983 by Abseil Team <absl-team@google.com>: Fix sign conversions so that absl/status/status.h can compile with -Wconversion -Wsign-compare PiperOrigin-RevId: 419658075 GitOrigin-RevId: 04e8fdf6a37d31f9364ca0f70bf663ee972481c6 Change-Id: I18441488cc84f573c2818ee241c387e1953d5105
* Export of internal Abseil changesGravatar Abseil Team2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | -- 620668e56950d7cfc39db2cd321adf265199ad77 by Abseil Team <absl-team@google.com>: absl::random compiles (at least for some cases) with -Wconversion -Wsign-compare PiperOrigin-RevId: 419595521 -- 746651e5fbcab6080d25c4eef8617fc289a448f6 by Abseil Team <absl-team@google.com>: Annotate FlagImpl storage buffer Flag type can contain legit uninitialized bits, e.g. padding. When the code calls bit_cast as int64_t, it will contain those bits as well. Then when we pass the int into the store it's UB for C++ and will be reported by the new msan. PiperOrigin-RevId: 418666492 GitOrigin-RevId: 620668e56950d7cfc39db2cd321adf265199ad77 Change-Id: Idd1190f5c98a0a13c4019f3d92cec0313822084c
* Export of internal Abseil changesGravatar Abseil Team2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 07240ca7822d007cdcc79f2c40bd58b2c2010348 by Abseil Team <absl-team@google.com>: Correct the comment from "AlphaNum" to "Arg". PiperOrigin-RevId: 416139192 -- adcba4a6b3763626e1db7b1e8c108b3114903557 by Martijn Vels <mvels@google.com>: Fix NewExternalRep() to require data being non-empty, and remove nullptr return. PiperOrigin-RevId: 416135865 -- c0d14cd918fb16f15d1d84de9284b5c5ecc1f8f2 by Abseil Team <absl-team@google.com>: Fix doc comment for absl::ascii_isprint(). The comment was incorrectly saying that it includes all whitespace. It doesn't; the only whitespace char it includes is ' '. PiperOrigin-RevId: 416112524 -- d83327800159c07002b6865e21232a12463e02dd by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 416099978 -- baf11e9ca42ca9140cdbf8075f971db8d65b1195 by Ilya Tokar <tokarip@google.com>: Prevent compiler from optimizing Group_Match* benchmarks away. Currently we benchmark single store of precomputed value. Not all affected benchmarks show performance changes: BM_Group_Match 0.53ns ± 1% 0.53ns ± 0% -0.42% (p=0.038 n=10+10) BM_Group_MatchEmpty 0.26ns ± 1% 0.26ns ± 1% ~ (p=1.000 n=10+10) BM_Group_MatchEmptyOrDeleted 0.26ns ± 1% 0.26ns ± 1% ~ (p=0.121 n=10+10) BM_Group_CountLeadingEmptyOrDeleted 0.26ns ± 1% 0.45ns ± 0% +70.05% (p=0.000 n=10+8) BM_Group_MatchFirstEmptyOrDeleted 0.26ns ± 0% 0.44ns ± 1% +65.91% (p=0.000 n=8+9) But inspecting the generated code shows the difference, e. g. BM_Group_MatchFirstEmptyOrDeleted Before: add $0xffffffffffffffff,%rbx jne 30 After: pcmpeqd %xmm0,%xmm0 pcmpgtb -0x30(%rbp),%xmm0 pmovmskb %xmm0,%eax add: 0x23$0xffffffffffffffff,%rbx jne 40 PiperOrigin-RevId: 416083515 -- 122fbff893dc4571b3e75e4b241eb4495b925610 by Abseil Team <absl-team@google.com>: Put namespace guard in ABSL_DECLARE_FLAG to make declaring a flag in a namespace a compiler error instead of a linker error. PiperOrigin-RevId: 416036072 -- 020fd8a20f5fa319e948846e003391fcb9e03868 by Ilya Tokar <tokarip@google.com>: Make Cord::InlineRep::set_data unconditionally zero out memory. Currently there is a single case where we don't zero out memory as an optimization. Unconditional zeroing doesn't show any changes in benchmarks, except for the unrelated improvement: BM_CordPartialCopyToCord/1M/1 12.6ns ± 4% 12.6ns ± 4% ~ (p=0.857 n=16+19) BM_CordPartialCopyToCord/1M/128 44.9ns ± 7% 45.0ns ± 3% ~ (p=0.468 n=18+17) BM_CordPartialCopyToCord/1M/1k 64.5ns ± 4% 61.4ns ± 4% -4.82% (p=0.000 n=19+17) BM_CordPartialCopyToCord/1M/8k 139ns ± 3% 128ns ±15% -7.76% (p=0.009 n=17+20) BM_CordPartialCopyToCord/1M/16k 193ns ± 6% 168ns ± 6% -13.17% (p=0.000 n=17+17) BM_CordPartialCopyToCord/4M/16k 199ns ± 4% 177ns ± 4% -11.36% (p=0.000 n=17+18) BM_CordPartialCopyToCord/4M/32k 275ns ± 3% 250ns ± 4% -9.00% (p=0.000 n=18+18) BM_CordPartialCopyToCord/4M/64k 291ns ± 4% 266ns ± 5% -8.53% (p=0.000 n=18+16) BM_CordPartialCopyToCord/4M/128k 322ns ± 5% 291ns ± 4% -9.43% (p=0.000 n=20+18) BM_CordPartialCopyToCord/8M/32k 281ns ± 5% 251ns ± 4% -10.38% (p=0.000 n=20+16) BM_CordPartialCopyToCord/8M/64k 293ns ± 6% 267ns ± 4% -8.87% (p=0.000 n=16+19) BM_CordPartialCopyToCord/8M/128k 334ns ± 3% 305ns ± 2% -8.56% (p=0.000 n=17+16) This is clearly an alignmnet effect since number of the executed instructions is the same: M_CordPartialCopyToCord/1M/1 155 ± 0% 155 ± 0% ~ (all samples are equal) BM_CordPartialCopyToCord/1M/128 446 ± 0% 446 ± 0% ~ (p=0.332 n=36+39) BM_CordPartialCopyToCord/1M/1k 473 ± 0% 473 ± 0% ~ (p=0.969 n=40+40) BM_CordPartialCopyToCord/1M/8k 808 ± 0% 808 ± 0% ~ (p=0.127 n=40+39) BM_CordPartialCopyToCord/1M/16k 957 ± 0% 957 ± 0% ~ (p=0.532 n=40+40) BM_CordPartialCopyToCord/4M/16k 952 ± 0% 952 ± 0% ~ (p=0.686 n=39+39) BM_CordPartialCopyToCord/4M/32k 1.12k ± 0% 1.12k ± 0% ~ (p=0.690 n=40+40) BM_CordPartialCopyToCord/4M/64k 1.23k ± 0% 1.23k ± 0% ~ (p=0.182 n=40+39) BM_CordPartialCopyToCord/4M/128k 1.44k ± 0% 1.44k ± 0% ~ (p=0.711 n=40+40) BM_CordPartialCopyToCord/8M/32k 1.12k ± 0% 1.12k ± 0% ~ (p=0.697 n=40+40) BM_CordPartialCopyToCord/8M/64k 1.23k ± 0% 1.23k ± 0% +0.00% (p=0.049 n=40+40) BM_CordPartialCopyToCord/8M/128k 1.44k ± 0% 1.44k ± 0% ~ (p=0.507 n=40+40) This makes code simpler and doesn't regress performance. PiperOrigin-RevId: 415560574 -- 37305b2690b31682088749e4d62f40d7095bdc54 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 415558737 -- 86aaed569b9e743c1eb813a5f48def978a793db3 by Martijn Vels <mvels@google.com>: Internal change PiperOrigin-RevId: 415515201 -- 6cdb8786cdcb4fa0b8a4b72fc98940877d1fdeff by Abseil Team <absl-team@google.com>: Update SubmitMutexProfileData to accept wait_cycles instead of wait_timestamp PiperOrigin-RevId: 415360871 -- 9f979d307aa16ad09f214e04876cbe84395c0901 by Abseil Team <absl-team@google.com>: absl::flat_hash_set compiles with -Wconversion -Wsign-compare PiperOrigin-RevId: 415357498 -- 9eceb14174708f15e61259d449b214a8a4c7f9e7 by Abseil Team <absl-team@google.com>: Fix AddressIsReadable for the corner case of (aligned) addr == NULL. PiperOrigin-RevId: 415307792 -- 1a39ffe55898375e2d7f88c17c99db5a1b95b313 by Martijn Vels <mvels@google.com>: Internal change PiperOrigin-RevId: 415162872 -- 64378549b110d5f5762185a5906c520fba70f0e7 by Abseil Team <absl-team@google.com>: Fix a typo in the comments PiperOrigin-RevId: 415088461 -- 41aae8322e913b82710153c22b97c611fdb6e1fb by Abseil Team <absl-team@google.com>: Switch from `connect` to `rt_sigreturn` -- the latter is much less problematic for system call sandboxes. PiperOrigin-RevId: 415073965 -- 870c5e3388b6a35611bff538626fe7a1c8c87171 by Abseil Team <absl-team@google.com>: Add ABSL_HAVE_HWADDRESS_SANITIZER and ABSL_HAVE_LEAK_SANITIZER PiperOrigin-RevId: 414871189 -- f213ed60a66b58da7ac40555adfb1d529ff0a4db by Derek Mauro <dmauro@google.com>: Remove reference to __SANITIZE_MEMORY__, which does not exist It appears to have been copied by pattern matching from the ASAN/TSAN code blocks. https://github.com/gcc-mirror/gcc/blob/f47662204de27f7685699eeef89aa173ccf32d85/gcc/cppbuiltin.c#L79-L126 PiperOrigin-RevId: 414806587 -- b152891e73ab515f397ceb53f66c8ee2f33863ea by Abseil Team <absl-team@google.com>: Rollback previous commit: SYS_open is not defined in certain environments. PiperOrigin-RevId: 414521820 -- 5a1cbb282331023902e1374dd0d920c4effbe47f by Abseil Team <absl-team@google.com>: Use syscall(SYS_open, ...) instead of open() to avoid possible symbol interposition. Also add some warning notes. PiperOrigin-RevId: 414508186 -- 1824d6593612710aafdc599a89b0adced7d787f6 by Abseil Team <absl-team@google.com>: Correct aarch64 macro check The macro is __aarch64__, not __arch64__. PiperOrigin-RevId: 414446225 -- a1536a57b64dfd53945d33a01cfc08b18c99c97b by Abseil Team <absl-team@google.com>: Fix backwards comment in the last commit. PiperOrigin-RevId: 414281214 -- 11ac021ba779513667a31cf2563ddafc57d6d913 by Abseil Team <absl-team@google.com>: AddressIsReadable() didn't work correctly on ARM when the given pointer was misaligned at the end of the page. Fix that by aligning the pointer on an 8-byte boundary before checking it. PiperOrigin-RevId: 414203863 GitOrigin-RevId: 07240ca7822d007cdcc79f2c40bd58b2c2010348 Change-Id: If5f129194d59f5c9e5d84efd8cd9e17a70e072ab
* Export of internal Abseil changesGravatar Abseil Team2021-11-22
| | | | | | | | | | | -- a0847bf19789c97689f1a8b0133a53b8af5e5caa by Samuel Benzaquen <sbenza@google.com>: Add support for absl::(u)int128 to random distributions and generators. PiperOrigin-RevId: 411565479 GitOrigin-RevId: a0847bf19789c97689f1a8b0133a53b8af5e5caa Change-Id: Ide434bdd93fcab8e90f791796498de14833b667c
* Fix Randen and PCG on Big Endian platforms (#1031)Gravatar Milad Fa2021-10-29
|
* Export of internal Abseil changesGravatar Abseil Team2021-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 05a099a580753f8e96cee38572e94dcdc079361b by Abseil Team <absl-team@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 405966217 -- c6b81e9ebc183d8389f14ecd091c8bad08cfe0aa by Abseil Team <absl-team@google.com>: Add `inline_element_size` to hashtablez (so that we can compute the weighted load factors properly e.g., in b/187896534). PiperOrigin-RevId: 405917711 -- 3e3673de4e54e4142c54b09e1644dfa3de4bb296 by Abseil Team <absl-team@google.com>: align indent of code comment in mutex.h PiperOrigin-RevId: 405871997 -- 2248301a5b14f8d2be5b2e9088f3528a353ea491 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 405639236 -- bc7d3c56fdad3dde4b89324af142529f2afe5f1b by Abseil Team <absl-team@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 405508045 -- 66472387276ef02505d99195747be862768bb35b by Laramie Leavitt <lar@google.com>: Also use uint8_t golden values in randen_test.cc This makes randen_test, randen_slow_test, and randen_hwaes_test essentially identical, as is the intent. PiperOrigin-RevId: 405484423 GitOrigin-RevId: 05a099a580753f8e96cee38572e94dcdc079361b Change-Id: I3dd5b0cfdb98d6e1ab02266194ba67d15428c2f8
* Export of internal Abseil changesGravatar Abseil Team2021-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- 30bbe72e8c32d8680bbe6c8473a884d485e9f684 by Laramie Leavitt <lar@google.com>: Convert randen golden test to use byte arrays. PiperOrigin-RevId: 404948438 -- 4690d9ebd2c518708ad155e913b2140ebdf01234 by Laramie Leavitt <lar@google.com>: Add golden tests for internal::ExplicitSeedSeeq against stable std:: random URBGs. PiperOrigin-RevId: 404912608 -- 52e9b24276ee3a21cc8a026f9d152ef8ced7f507 by Derek Mauro <dmauro@google.com>: Internal change PiperOrigin-RevId: 404861043 -- 9e966a2a680970fd27d927cc6420e333b1378b1e by Abseil Team <absl-team@google.com>: Roll back import of CCTZ from GitHub. PiperOrigin-RevId: 404343587 -- 9c4eedec00105b8288c0b91d96434aea08b8e3c3 by Abseil Team <absl-team@google.com>: Import of CCTZ from GitHub. PiperOrigin-RevId: 404314597 -- f171375fd7bec35cc34815be8faf5e000828b7bb by Abseil Team <absl-team@google.com>: Internal change PiperOrigin-RevId: 404098156 GitOrigin-RevId: 30bbe72e8c32d8680bbe6c8473a884d485e9f684 Change-Id: Ic7b5a3c0659e321e2f642800930a8de014253e2a
* Remove bazelbuild/rules_cc dependency (#1038)Gravatar Vertexwahn2021-10-14
|
* Include immintrin.h instead of wmmintrin.h (#1015)Gravatar Stan Hu2021-09-13
| | | | | | | | | | | | | | | | | | | immintrin.h is the de-factor standard header for clang and GCC to include Intel intrinsics. Using this header avoids requiring the compiler to use the `-maes` and `-msse4.1` compiler options on systems that may not have AES or SSE instruction support. clang: As seen in https://github.com/llvm-mirror/clang/blob/master/lib/Headers/immintrin.h, specific intrinsic header files are conditionally included depending on whether the feature is available. gcc: As seen in https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/immintrin.h, gcc includes all intrinsic header files, but each individual file guards against the feature not being available. This came out of an investigation in https://github.com/grpc/grpc/pull/27121.