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

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

Thread Previous | Thread Next
Tomasz Konojacki
October 15, 2018 03:28
Re: [perl #133511] [PATCH] tiny optimization of pp_divide
Message ID:
On Thu, 11 Oct 2018 16:57:30 -0700
"Tony Cook via RT" <> 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 for example.

Patch with a comment is attached.
Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About