public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Koning, Paul" <Paul.Koning@dell.com>
To: "cassio.neri@gmail.com" <cassio.neri@gmail.com>,
	Cassio Neri via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] libstdc++: More efficient std::chrono::year::leap.
Date: Fri, 21 May 2021 18:05:14 +0000	[thread overview]
Message-ID: <34C4F25A-6333-4C08-BBFF-8E86A5A9B764@dell.com> (raw)
In-Reply-To: <CAOfgUPgc+4fZ65GtcprdiM+ObP6o-avP85frLzY0A1uqZHOoUg@mail.gmail.com>



> On May 21, 2021, at 1:46 PM, Cassio Neri via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> Simple change to std::chrono::year::is_leap. If a year is multiple of 100,
> then it's divisible by 400 if and only if it's divisible by 16. The latter
> allows for better code generation.

I wonder if the optimizer could be taught to do that.

The change seems correct but it is very confusing; at the very least the reasoning you gave should be stated in a comment on that check.

	paul



  reply	other threads:[~2021-05-21 18:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 17:46 Cassio Neri
2021-05-21 18:05 ` Koning, Paul [this message]
2021-05-21 18:44   ` Cassio Neri
2021-06-23 11:45     ` Jonathan Wakely
2021-06-23 13:16       ` Jonathan Wakely
2021-06-23 17:51         ` Jonathan Wakely
2021-06-23 17:52           ` Jonathan Wakely
2021-06-24 11:42             ` Cassio Neri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34C4F25A-6333-4C08-BBFF-8E86A5A9B764@dell.com \
    --to=paul.koning@dell.com \
    --cc=cassio.neri@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).