[dpdk-dev,v3,03/12] hash: check SSE flags only on x86 builds

Message ID 1436172698-21749-4-git-send-email-zlu@ezchip.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Zhigang Lu July 6, 2015, 8:51 a.m. UTC
  This is necessary because the required CPU flags may not be defined on
other architectures.

Change-Id: I14d3f9f625b2e7567123f1c97095f8d06abd674b
Signed-off-by: Zhigang Lu <zlu@ezchip.com>
---
 lib/librte_hash/rte_hash_crc.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Bruce Richardson July 6, 2015, 3:32 p.m. UTC | #1
On Mon, Jul 06, 2015 at 04:51:28PM +0800, Zhigang Lu wrote:
> This is necessary because the required CPU flags may not be defined on
> other architectures.
> 
> Change-Id: I14d3f9f625b2e7567123f1c97095f8d06abd674b
> Signed-off-by: Zhigang Lu <zlu@ezchip.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  

Patch

diff --git a/lib/librte_hash/rte_hash_crc.h b/lib/librte_hash/rte_hash_crc.h
index abdbd9a..1f6f5bf 100644
--- a/lib/librte_hash/rte_hash_crc.h
+++ b/lib/librte_hash/rte_hash_crc.h
@@ -425,12 +425,14 @@  static inline void
 rte_hash_crc_set_alg(uint8_t alg)
 {
 	switch (alg) {
+#if defined(RTE_ARCH_I686) || defined(RTE_ARCH_X86_64)
 	case CRC32_SSE42_x64:
 		if (! rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T))
 			alg = CRC32_SSE42;
 	case CRC32_SSE42:
 		if (! rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2))
 			alg = CRC32_SW;
+#endif
 	case CRC32_SW:
 		crc32_alg = alg;
 	default: