gcc/libstdc++-v3
Cassio Neri 3dfd5493cf libstdc++: More efficient date from days
This patch reimplements std::chrono::year_month_day::_S_from_days() which
retrieves a date from the number of elapsed days since 1970/01/01.  The new
implementation is based on Proposition 6.3 of Neri and Schneider, "Euclidean
Affine Functions and Applications to Calendar Algorithms" available at
https://arxiv.org/abs/2102.06959.

The aforementioned paper benchmarks the implementation against several
counterparts, including libc++'s (which is identical to the current
implementation).  The results, shown in Figure 4, indicate the new algorithm is
2.2 times faster than the current one.

The patch adds a test which loops through all integers in [-12687428, 11248737],
and for each of them, gets the corresponding date and compares the result
against its expected value.  The latter is calculated using a much simpler and
easy to understand algorithm but which is also much slower.

The interval used in the test covers the full range of values for which a
roundtrip must work [time.cal.ymd.members].  Despite its completeness the test
runs in a matter of seconds.

libstdc++-v3/ChangeLog:

	* include/std/chrono (year_month_day::_S_from_days): New
	implementation.
	* testsuite/std/time/year_month_day/3.cc: New test.
2021-02-24 17:58:47 +00:00
..
config libstdc++: Define std::to_chars overloads for __ieee128 [PR 98389] 2021-02-24 16:34:06 +00:00
doc libstdc++: Fix filesystem::rename on Windows [PR 98985] 2021-02-12 15:29:50 +00:00
include libstdc++: More efficient date from days 2021-02-24 17:58:47 +00:00
libsupc++ PR c++/99074 - crash in dynamic_cast<>() on null pointer 2021-02-23 14:14:20 -07:00
po Update copyright years. 2021-01-04 10:26:59 +01:00
python Update copyright years. 2021-01-04 10:26:59 +01:00
scripts libstdc++: Add simd testsuite 2021-01-27 16:37:26 +00:00
src libstdc++: Define std::to_chars overloads for __ieee128 [PR 98389] 2021-02-24 16:34:06 +00:00
testsuite libstdc++: More efficient date from days 2021-02-24 17:58:47 +00:00
acinclude.m4
aclocal.m4
ChangeLog Daily bump. 2021-02-24 00:16:26 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020 libstdc++: Fix typo in ChangeLog-2020 2021-01-13 11:02:13 +00:00
config.h.in
configure Update GNU/Hurd configure support 2021-01-05 16:04:14 -07:00
configure.ac
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am Update copyright years. 2021-01-04 10:26:59 +01:00
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.