DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: yipeng1.wang@intel.com, sameh.gobriel@intel.com,
	bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com
Cc: dev@dpdk.org, jerinj@marvell.com, Honnappa.Nagarahalli@arm.com,
	nd@arm.com, Ruifeng Wang <ruifeng.wang@arm.com>
Subject: [dpdk-dev] [PATCH v1] hash: simplify signature compare neon process
Date: Mon, 29 Apr 2019 18:02:07 +0800	[thread overview]
Message-ID: <1556532127-46557-1-git-send-email-ruifeng.wang@arm.com> (raw)

Replaced multiple neon instructions with single equivalent instruction.
This made simpler code and a bit higher performance.
Hash bulk lookup had 0.1% ~ 3% performance gain in tests on ARM A72
platforms.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
 lib/librte_hash/rte_cuckoo_hash.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 261267b..f17819e 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -1656,7 +1656,6 @@ compare_signatures(uint32_t *prim_hash_matches, uint32_t *sec_hash_matches,
 #elif defined(RTE_MACHINE_CPUFLAG_NEON)
 	case RTE_HASH_COMPARE_NEON: {
 		uint16x8_t vmat, vsig, x;
-		uint64x2_t x64;
 		int16x8_t shift = {-15, -13, -11, -9, -7, -5, -3, -1};
 
 		vsig = vld1q_dup_u16((uint16_t const *)&sig);
@@ -1664,16 +1663,13 @@ compare_signatures(uint32_t *prim_hash_matches, uint32_t *sec_hash_matches,
 		vmat = vceqq_u16(vsig,
 			vld1q_u16((uint16_t const *)prim_bkt->sig_current));
 		x = vshlq_u16(vandq_u16(vmat, vdupq_n_u16(0x8000)), shift);
-		x64 = vpaddlq_u32(vpaddlq_u16(x));
-		*prim_hash_matches = (uint32_t)(vgetq_lane_u64(x64, 0) +
-			vgetq_lane_u64(x64, 1));
+		*prim_hash_matches = (uint32_t)(vaddvq_u16(x));
 		/* Compare all signatures in the secondary bucket */
 		vmat = vceqq_u16(vsig,
 			vld1q_u16((uint16_t const *)sec_bkt->sig_current));
 		x = vshlq_u16(vandq_u16(vmat, vdupq_n_u16(0x8000)), shift);
-		x64 = vpaddlq_u32(vpaddlq_u16(x));
-		*sec_hash_matches = (uint32_t)(vgetq_lane_u64(x64, 0) +
-			vgetq_lane_u64(x64, 1)); }
+		*sec_hash_matches = (uint32_t)(vaddvq_u16(x));
+		}
 		break;
 #endif
 	default:
-- 
2.7.4

             reply	other threads:[~2019-04-29 10:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 10:02 Ruifeng Wang [this message]
2019-04-29 10:02 ` Ruifeng Wang
2019-05-03 20:40 ` Thomas Monjalon
2019-05-03 20:40   ` Thomas Monjalon
2019-05-22  0:28 ` Wang, Yipeng1
2019-06-05 17:25   ` Thomas Monjalon
2019-06-04 16:58 Jerin Jacob Kollanukkaran

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=1556532127-46557-1-git-send-email-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=nd@arm.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=yipeng1.wang@intel.com \
    /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).