From patchwork Sun Dec 14 18:10:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ananyev, Konstantin" X-Patchwork-Id: 1988 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 53A95808A; Sun, 14 Dec 2014 19:12:23 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0A190805D for ; Sun, 14 Dec 2014 19:11:36 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 14 Dec 2014 10:11:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,576,1413270000"; d="scan'208";a="647472101" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 14 Dec 2014 10:11:23 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sBEIBM32032752; Sun, 14 Dec 2014 18:11:22 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id sBEIBMpI013192; Sun, 14 Dec 2014 18:11:22 GMT Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id sBEIBMDP013187; Sun, 14 Dec 2014 18:11:22 GMT From: Konstantin Ananyev To: dev@dpdk.org Date: Sun, 14 Dec 2014 18:10:59 +0000 Message-Id: <1418580659-12595-18-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1418580659-12595-1-git-send-email-konstantin.ananyev@intel.com> References: <1418580659-12595-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH 17/17] libte_acl: fix compilation issues with RTE_LIBRTE_ACL_STANDALONE=y. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Konstantin Ananyev --- lib/librte_acl/rte_acl_osdep_alone.h | 47 ++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/lib/librte_acl/rte_acl_osdep_alone.h b/lib/librte_acl/rte_acl_osdep_alone.h index a84b6f9..58c4f6a 100644 --- a/lib/librte_acl/rte_acl_osdep_alone.h +++ b/lib/librte_acl/rte_acl_osdep_alone.h @@ -57,6 +57,10 @@ #include #endif +#if defined(__AVX__) +#include +#endif + #else #include @@ -128,8 +132,8 @@ typedef __m128i xmm_t; #define XMM_SIZE (sizeof(xmm_t)) #define XMM_MASK (XMM_SIZE - 1) -typedef union rte_mmsse { - xmm_t m; +typedef union rte_xmm { + xmm_t x; uint8_t u8[XMM_SIZE / sizeof(uint8_t)]; uint16_t u16[XMM_SIZE / sizeof(uint16_t)]; uint32_t u32[XMM_SIZE / sizeof(uint32_t)]; @@ -137,6 +141,33 @@ typedef union rte_mmsse { double pd[XMM_SIZE / sizeof(double)]; } rte_xmm_t; +#ifdef __AVX__ + +typedef __m256i ymm_t; + +#define YMM_SIZE (sizeof(ymm_t)) +#define YMM_MASK (YMM_SIZE - 1) + +typedef union rte_ymm { + ymm_t y; + xmm_t x[YMM_SIZE / sizeof(xmm_t)]; + uint8_t u8[YMM_SIZE / sizeof(uint8_t)]; + uint16_t u16[YMM_SIZE / sizeof(uint16_t)]; + uint32_t u32[YMM_SIZE / sizeof(uint32_t)]; + uint64_t u64[YMM_SIZE / sizeof(uint64_t)]; + double pd[YMM_SIZE / sizeof(double)]; +} rte_ymm_t; + +#endif /* __AVX__ */ + +#ifdef RTE_ARCH_I686 +#define _mm_cvtsi128_si64(a) ({ \ + rte_xmm_t m; \ + m.x = (a); \ + (m.u64[0]); \ +}) +#endif + /* * rte_cycles related. */ @@ -214,6 +245,13 @@ rte_rdtsc(void) /* * rte_tailq related. */ + +struct rte_tailq_entry { + TAILQ_ENTRY(rte_tailq_entry) next; /**< Pointer entries for a tailq list + */ + void *data; /**< Pointer to the data referenced by this tailq entry */ +}; + static inline void * rte_dummy_tailq(void) { @@ -248,6 +286,7 @@ rte_zmalloc_socket(__rte_unused const char *type, size_t size, unsigned align, void *ptr; int rc; + align = (align != 0) ? align : RTE_CACHE_LINE_SIZE; rc = posix_memalign(&ptr, align, size); if (rc != 0) { rte_errno = rc; @@ -258,6 +297,8 @@ rte_zmalloc_socket(__rte_unused const char *type, size_t size, unsigned align, return ptr; } +#define rte_zmalloc(type, sz, align) rte_zmalloc_socket(type, sz, align, 0) + /* * rte_debug related */ @@ -271,6 +312,8 @@ rte_zmalloc_socket(__rte_unused const char *type, size_t size, unsigned align, exit(err); \ } while (0) +#define rte_cpu_get_flag_enabled(x) (0) + #ifdef __cplusplus } #endif