Thanks Jonathan.
Here are some benchmarks (assembly in [1]):
https://quick-bench.com/q/jclBXmi4QLDcRMLuuVpxTUsFmQw
Unfortunately, quick-bench times out unless some implementations are
commented out. You can copy the code and run it locally (needs google
benchmark) to get the full picture.
I real
On 23/06/21 18:51 +0100, Jonathan Wakely wrote:
Here's what I've committed. Tested x86_64-linux and powerpc64le-linux.
Pushed to trunk.
commit b92d12d3fe3f1aa56d190d960e40c62869a6cfbb
Author: Cassio Neri
Date: Wed Jun 23 15:32:16 2021
libstdc++: More efficient std::chrono::year::leap
On 23/06/21 14:16 +0100, Jonathan Wakely wrote:
On 23/06/21 12:45 +0100, Jonathan Wakely wrote:
On 21/05/21 19:44 +0100, Cassio Neri via Libstdc++ wrote:
I've checked the generated code and the compiler doesn't figure out
the logic. I added a comment to explain.
(Revised patch below and attach
On 23/06/21 12:45 +0100, Jonathan Wakely wrote:
On 21/05/21 19:44 +0100, Cassio Neri via Libstdc++ wrote:
I've checked the generated code and the compiler doesn't figure out
the logic. I added a comment to explain.
(Revised patch below and attached.)
Best wishes,
Cassio.
---
Simple change to
On 21/05/21 19:44 +0100, Cassio Neri via Libstdc++ wrote:
I've checked the generated code and the compiler doesn't figure out
the logic. I added a comment to explain.
(Revised patch below and attached.)
Best wishes,
Cassio.
---
Simple change to std::chrono::year::is_leap. If a year is multipl
I've checked the generated code and the compiler doesn't figure out
the logic. I added a comment to explain.
(Revised patch below and attached.)
Best wishes,
Cassio.
---
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 div
> On May 21, 2021, at 1:46 PM, Cassio Neri via Gcc-patches
> 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