From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Austin S Hemmelgarn <ahferroin7@gmail.com>,
netdev@vger.kernel.org, dborkman@redhat.com,
linux-kernel@vger.kernel.org, darkjames-ws@darkjames.pl
Subject: Re: [PATCH RFC] reciprocal_divide: correction/update of the algorithm
Date: Tue, 14 Jan 2014 21:10:42 +0100 [thread overview]
Message-ID: <20140114201042.GA13804@order.stressinduktion.org> (raw)
In-Reply-To: <1389729032.31367.262.camel@edumazet-glaptop2.roam.corp.google.com>
On Tue, Jan 14, 2014 at 11:50:32AM -0800, Eric Dumazet wrote:
> On Tue, 2014-01-14 at 14:22 -0500, Austin S Hemmelgarn wrote:
>
> > I disagree with the statement that current CPU's have reasonably fast
> > dividers. A lot of embedded processors and many low-end x86 CPU's do
> > not in-fact have any hardware divider, and usually provide it using
> > microcode based emulation if they provide it at all. The AMD Jaguar
> > micro-architecture in particular comes to mind, it uses an iterative
> > division algorithm provided by the microcode that only produces 2 bits
> > of quotient per cycle, even in the best case (2 8-bit integers and an
> > integral 8-bit quotient) this still takes 4 cycles, which is twice as
> > slow as any other math operation on the same processor.
>
> I doubt you run any BPF filter with a divide instruction in it on these
> platform.
>
> Get real, do not over optimize things where it does not matter.
If I read the instruction tables correctly, we could half the latency with
reciprocal divide even on haswell.
What a pitty that the Intel Architecture Code Analyzer does not support imul
nor div instruction. :(
next prev parent reply other threads:[~2014-01-14 20:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-13 21:42 Hannes Frederic Sowa
2014-01-14 18:02 ` Randy Dunlap
2014-01-15 15:02 ` Hannes Frederic Sowa
2014-01-14 18:07 ` Eric Dumazet
2014-01-14 19:22 ` Austin S Hemmelgarn
2014-01-14 19:50 ` Eric Dumazet
2014-01-14 20:10 ` Hannes Frederic Sowa [this message]
2014-01-14 20:53 ` Austin S Hemmelgarn
2014-01-14 22:45 ` Eric Dumazet
2014-01-14 23:25 ` Borislav Petkov
2014-01-15 2:51 ` Austin S. Hemmelgarn
2014-01-14 22:39 ` Hannes Frederic Sowa
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=20140114201042.GA13804@order.stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=ahferroin7@gmail.com \
--cc=darkjames-ws@darkjames.pl \
--cc=dborkman@redhat.com \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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
all inboxes | Powered by JetHome®