develooper Front page | perl.perl5.porters | Postings from November 2018

[perl #133511] [PATCH] tiny optimization of pp_divide

From:
Tony Cook via RT
Date:
November 2, 2018 04:16
Subject:
[perl #133511] [PATCH] tiny optimization of pp_divide
Message ID:
rt-4.0.24-15334-1541132167-978.133511-15-0@perl.org
On Sun, 14 Oct 2018 20:28:28 -0700, me@xenu.pl wrote:
> On Thu, 11 Oct 2018 16:57:30 -0700
> "Tony Cook via RT" <perlbug-followup@perl.org> wrote:
> 
> > Perhaps it could use a comment indicating that many modern optimizing
> > compilers combine the div and mod into one instruction.
> >
> > I could see myself seeing that code in a few years and wondering it
> > was using a (relatively) slow[1] div rather than a mul.
> >
> > If I go to an older compiler like clang 4.0.1, I end up with two div
> > instructions with your patch rather than a div and a mul.
> >
> > Tony
> >
> > [1] see the latencies for mul vs div on SkylakeX at
> > https://www.agner.org/optimize/instruction_tables.pdf for example.
> 
> Patch with a comment is attached.

Thanks, applied as f196658042490a6287fc178f0bc20fd5558ac54b.

Tony


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133511



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About