eal/x86: fix build with gcc 5.3.1
authorMichael Qiu <michael.qiu@intel.com>
Thu, 28 Jan 2016 07:30:34 +0000 (15:30 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 28 Jan 2016 08:33:50 +0000 (09:33 +0100)
In fedora 22 with GCC version 5.3.1, when compile,
will result an error:

    include/rte_memcpy.h:309:7: error: "RTE_MACHINE_CPUFLAG_AVX2"
                                is not defined [-Werror=undef]
    #elif RTE_MACHINE_CPUFLAG_AVX2

Fixes: 9484092baad3 ("eal/x86: optimize memcpy for AVX512 platforms")

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
Acked-by: Zhihong Wang <zhihong.wang@intel.com>
app/test/test_memcpy_perf.c
lib/librte_eal/common/include/arch/x86/rte_memcpy.h

index 73babec..f150d8d 100644 (file)
@@ -81,7 +81,7 @@ static size_t buf_sizes[TEST_VALUE_RANGE];
 /* Data is aligned on this many bytes (power of 2) */
 #ifdef RTE_MACHINE_CPUFLAG_AVX512F
 #define ALIGNMENT_UNIT          64
-#elif RTE_MACHINE_CPUFLAG_AVX2
+#elif defined RTE_MACHINE_CPUFLAG_AVX2
 #define ALIGNMENT_UNIT          32
 #else /* RTE_MACHINE_CPUFLAG */
 #define ALIGNMENT_UNIT          16
index d965957..8e2c53c 100644 (file)
@@ -306,7 +306,7 @@ COPY_BLOCK_128_BACK63:
        goto COPY_BLOCK_128_BACK63;
 }
 
-#elif RTE_MACHINE_CPUFLAG_AVX2
+#elif defined RTE_MACHINE_CPUFLAG_AVX2
 
 /**
  * AVX2 implementation below