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

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

Thread Previous | Thread Next
From:
Tomasz Konojacki
Date:
October 15, 2018 03:28
Subject:
Re: [perl #133511] [PATCH] tiny optimization of pp_divide
Message ID:
20181015052805.DF6B.5C4F47F8@xenu.pl
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.
Thread Previous | Thread Next


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