DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: "Amber, Kumar" <kumar.amber@intel.com>,
	"Wang, Yipeng1" <yipeng1.wang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Richardson, Bruce" <bruce.richardson@intel.com>,
	"Gobriel, Sameh" <sameh.gobriel@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1] lib/hash: support non sse42 cpu architecture
Date: Thu, 25 Mar 2021 09:06:53 +0100	[thread overview]
Message-ID: <9326090.qLjmXhQq0I@thomas> (raw)
In-Reply-To: <BYAPR11MB3494B0E963D33CE19D0C0A32C3639@BYAPR11MB3494.namprd11.prod.outlook.com>

24/03/2021 23:59, Wang, Yipeng1:
> From: kumar amber
> > 
> > add _SSE42_ flag to enable compilation of
> > sse42 specific instructions only on supported architecture
> > 
> > Signed-off-by: kumar amber <kumar.amber@intel.com>
> > ---
> >  lib/librte_hash/rte_hash_crc.h | 16 ++++++++--------
> >  1 file changed, 8 insertions(+), 8 deletions(-)
> > 
> > diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
> > index 3e131aa6bb..e9f063780c 100644
> > --- a/lib/librte_hash/rte_hash_crc.h
> > +++ b/lib/librte_hash/rte_hash_crc.h
> > @@ -358,7 +358,7 @@ crc32c_2words(uint64_t data, uint32_t init_val)
> >  	return crc;
> >  }
> > 
> > -#if defined(RTE_ARCH_X86)
> > +#if defined(RTE_ARCH_X86) && defined(__SSE42__)
> >  static inline uint32_t
> >  crc32c_sse42_u8(uint8_t data, uint32_t init_val)  { @@ -404,7 +404,7 @@
> > crc32c_sse42_u64_mimic(uint64_t data, uint64_t init_val)  }  #endif
> 
> ...
> 
> > -#if defined RTE_ARCH_X86
> > +#if defined(RTE_ARCH_X86) && defined(__SSE42__)
> >  	if (likely(crc32_alg & CRC32_SSE42))
> >  		return crc32c_sse42_u64_mimic(data, init_val);  #endif
> > --
> > 2.25.1
> 
> [Wang, Yipeng] 
> Hi, Kumar, thanks for the patch.
> I think the minimum required machine for x86 is sse4.2 compatible already. So I wonder if we really need this.

Yes, that's why I don't understand this patch.

> Also, I think the right way to check machine flag in DPDK should be:
> #If defined (RTE_MACHINE_CPUFLAG_SSE4_2)

These macros have been removed in DPDK 20.11.

> Instead of using compiler dependent macro.

Compiler macros are well standardized, it is OK.



  reply	other threads:[~2021-03-25  8:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12  7:24 kumar amber
2021-03-24 21:20 ` Thomas Monjalon
2021-03-24 22:59 ` Wang, Yipeng1
2021-03-25  8:06   ` Thomas Monjalon [this message]
2021-04-08 22:41     ` Thomas Monjalon
2021-04-08 23:01       ` Stephen Hemminger
2021-04-09  3:17       ` Amber, Kumar

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=9326090.qLjmXhQq0I@thomas \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=kumar.amber@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).