]> git.droids-corp.org - dpdk.git/commitdiff
hash: compile ARMv8 CRC32 support conditionally
authorAshwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Fri, 12 May 2017 05:45:43 +0000 (22:45 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 3 Jul 2017 20:27:42 +0000 (22:27 +0200)
Compile the armv8a CRC32 support only if the machine
has the CRC extensions i.e if RTE_MACHINE_CPUFLAG_CRC32
is defined.

Removed the .arch assembly directives as these are no
more necessary.

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
lib/librte_hash/Makefile
lib/librte_hash/rte_crc_arm64.h
lib/librte_hash/rte_hash_crc.h

index d856aa26d73dc484cb81c38124e1077e869160be..9cf13a0458f01b04c3fd1086b69eab1f1a63663c 100644 (file)
@@ -49,8 +49,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_HASH) += rte_fbk_hash.c
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include := rte_hash.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_hash_crc.h
 ifeq ($(CONFIG_RTE_ARCH_ARM64),y)
+ifneq ($(findstring RTE_MACHINE_CPUFLAG_CRC32,$(CFLAGS)),)
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_crc_arm64.h
 endif
+endif
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_jhash.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_thash.h
 SYMLINK-$(CONFIG_RTE_LIBRTE_HASH)-include += rte_fbk_hash.h
index 2abe42ab8c3b7a58f83139ed48bafb338b3569a4..c4d0e2139b9eda1c353e64a7c9bbaae8389026a3 100644 (file)
@@ -52,7 +52,6 @@ extern "C" {
 static inline uint32_t
 crc32c_arm64_u8(uint8_t data, uint32_t init_val)
 {
-       asm(".arch armv8-a+crc");
        __asm__ volatile(
                        "crc32cb %w[crc], %w[crc], %w[value]"
                        : [crc] "+r" (init_val)
@@ -63,7 +62,6 @@ crc32c_arm64_u8(uint8_t data, uint32_t init_val)
 static inline uint32_t
 crc32c_arm64_u16(uint16_t data, uint32_t init_val)
 {
-       asm(".arch armv8-a+crc");
        __asm__ volatile(
                        "crc32ch %w[crc], %w[crc], %w[value]"
                        : [crc] "+r" (init_val)
@@ -74,7 +72,6 @@ crc32c_arm64_u16(uint16_t data, uint32_t init_val)
 static inline uint32_t
 crc32c_arm64_u32(uint32_t data, uint32_t init_val)
 {
-       asm(".arch armv8-a+crc");
        __asm__ volatile(
                        "crc32cw %w[crc], %w[crc], %w[value]"
                        : [crc] "+r" (init_val)
@@ -85,7 +82,6 @@ crc32c_arm64_u32(uint32_t data, uint32_t init_val)
 static inline uint32_t
 crc32c_arm64_u64(uint64_t data, uint32_t init_val)
 {
-       asm(".arch armv8-a+crc");
        __asm__ volatile(
                        "crc32cx %w[crc], %w[crc], %x[value]"
                        : [crc] "+r" (init_val)
index b8a0cbefb7047fd1b4597d85daa98dd32be3defb..e8635e77ea2a08deeb5f8e9c4f14bb16f45207e9 100644 (file)
@@ -453,7 +453,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)
 
 static uint8_t crc32_alg = CRC32_SW;
 
-#if defined(RTE_ARCH_ARM64)
+#if defined(RTE_ARCH_ARM64) && defined(RTE_MACHINE_CPUFLAG_CRC32)
 #include "rte_crc_arm64.h"
 #else