DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Ondřej Bílka" <neleai@seznam.cz>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v3] Implement memcmp using SIMD intrinsics
Date: Fri, 12 Jun 2015 10:03:35 +0100	[thread overview]
Message-ID: <20150612090334.GA496@bricha3-MOBL3> (raw)
In-Reply-To: <20150612083056.GA18090@domone>

On Fri, Jun 12, 2015 at 10:30:56AM +0200, Ondřej Bílka wrote:
> On Mon, May 18, 2015 at 01:01:42PM -0700, Ravi Kerur wrote:
> > Background:
> > After preliminary discussion with John (Zhihong) and Tim from Intel it was
> > decided that it would be beneficial to use AVX/SSE intrinsics for memcmp
> > similar to memcpy that had been implemeneted. In addition, we decided to use
> > librte_hash as a test candidate to test both functionality and performance.
> > 
> > Further discussions lead to complete functionality implementation of memory
> > comparison and v3 code reflects that.
> > 
> > Test was conducted on Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, Ubuntu 14.04,
> > x86_64, 16GB DDR3 system.
> > 
> > Ravi Kerur (1):
> >   Implement memcmp using Intel SIMD instrinsics.
> 
> As my previous mail got lost I am resending it. 
> 
> In short you shouldn't
> use sse2/avx2 for memcmp at all. In 95% of calls you find inequality in
> first 8 bytes so sse2 adds just unnecessary overhead versus checking
> these with.
> 
> 190:   48 8b 4e 08             mov    0x8(%rsi),%rcx
> 194:   48 39 4f 08             cmp    %rcx,0x8(%rdi)
> 198:   75 f3                   jne    18d <memeq30+0xd>
> 
> Also as you have full memcmp does in your gcc optimize out 
> if (memcmp(x,y)) 
> like in mine?
> 
> So run also implementation below in your benchmark, my guess is it will
> be faster.
> 
<snip for brevity>

Thanks for the contribution. It's very informative!

/Bruce

  reply	other threads:[~2015-06-12  9:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 20:01 Ravi Kerur
2015-05-18 20:01 ` [dpdk-dev] [PATCH v3] Implement memcmp using Intel SIMD instrinsics Ravi Kerur
2015-10-14  0:32   ` Stephen Hemminger
2016-01-28  3:08   ` [dpdk-dev] [dpdk-dev, " Zhihong Wang
2016-02-19 17:50     ` Ravi Kerur
2016-02-23 12:22       ` Wang, Zhihong
2016-02-24  4:00         ` Ravi Kerur
2015-06-12  8:30 ` [dpdk-dev] [PATCH v3] Implement memcmp using SIMD intrinsics Ondřej Bílka
2015-06-12  9:03   ` Bruce Richardson [this message]
2015-06-15 20:47   ` Ravi Kerur

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=20150612090334.GA496@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=neleai@seznam.cz \
    /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;
as well as URLs for NNTP newsgroup(s).