From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B910A2E8A for ; Thu, 24 Jul 2014 22:40:07 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 24 Jul 2014 13:41:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,726,1400050800"; d="scan'208";a="575039475" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by fmsmga002.fm.intel.com with ESMTP; 24 Jul 2014 13:41:35 -0700 Received: from orsmsx160.amr.corp.intel.com (10.22.226.43) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 24 Jul 2014 13:41:34 -0700 Received: from orsmsx102.amr.corp.intel.com ([169.254.1.116]) by ORSMSX160.amr.corp.intel.com ([169.254.13.215]) with mapi id 14.03.0123.003; Thu, 24 Jul 2014 13:41:34 -0700 From: "Venkatesan, Venky" To: Neil Horman , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ixgbe: convert sse intrinsics to use __builtin variants Thread-Index: AQHPp2zuXF3ijItr/ECGQVXVOWRTrZuvr5XA Date: Thu, 24 Jul 2014 20:41:33 +0000 Message-ID: <1FD9B82B8BF2CF418D9A1000154491D97414563E@ORSMSX102.amr.corp.intel.com> References: <1406226211-1364-1-git-send-email-nhorman@tuxdriver.com> In-Reply-To: <1406226211-1364-1-git-send-email-nhorman@tuxdriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] ixgbe: convert sse intrinsics to use __builtin variants 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: , X-List-Received-Date: Thu, 24 Jul 2014 20:40:08 -0000 Neil,=20 Nice patch! One question - what gcc versions did you try this out on? We'll= round out with checking the other versions.=20 Regards,=20 -Venky -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Neil Horman Sent: Thursday, July 24, 2014 11:24 AM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH] ixgbe: convert sse intrinsics to use __builtin = variants The ixgbe pmd currently can't be built without enabling sse instructions at= compile time. While sse extensions provide better performance, theres no = reason that we can't still create builds to run on systems that don't suppo= rt sse. If we modify the ixgbe code to use the __builtin_shuffle and __bui= ltin_popcountll functions, I've confirmed that the gcc compiler emits the a= ppropriate sse instructions when the provided -march parameter indicates a = machine that includes sse support, and emits generic code when see isn't av= ailable. Signed-off-by: Neil Horman CC: Thomas Monjalon --- lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/i= xgbe_rxtx_vec.c index 09e19a3..5747072 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -38,8 +38,6 @@ #include "ixgbe_ethdev.h" #include "ixgbe_rxtx.h" =20 -#include - #ifndef __INTEL_COMPILER #pragma GCC diagnostic ignored "-Wcast-qual" #endif @@ -294,8 +292,8 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **r= x_pkts, rte_compiler_barrier(); =20 /* D.1 pkt 3,4 convert format from desc to pktmbuf */ - pkt_mb4 =3D _mm_shuffle_epi8(descs[3], shuf_msk); - pkt_mb3 =3D _mm_shuffle_epi8(descs[2], shuf_msk); + pkt_mb4 =3D __builtin_shuffle(descs[3], shuf_msk); + pkt_mb3 =3D __builtin_shuffle(descs[2], shuf_msk); =20 /* C.1 4=3D>2 filter staterr info only */ sterr_tmp2 =3D _mm_unpackhi_epi32(descs[3], descs[2]); @@ -310,8 +308,8 = @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, pkt_mb3 =3D _mm_add_epi16(pkt_mb3, in_port); =20 /* D.1 pkt 1,2 convert format from desc to pktmbuf */ - pkt_mb2 =3D _mm_shuffle_epi8(descs[1], shuf_msk); - pkt_mb1 =3D _mm_shuffle_epi8(descs[0], shuf_msk); + pkt_mb2 =3D __builtin_shuffle(descs[1], shuf_msk); + pkt_mb1 =3D __builtin_shuffle(descs[0], shuf_msk); =20 /* C.2 get 4 pkts staterr value */ zero =3D _mm_xor_si128(dd_check, dd_check); @@ -338,7 +336,7 @@ ixgbe_re= cv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, pkt_mb1); =20 /* C.4 calc avaialbe number of desc */ - var =3D _mm_popcnt_u64(_mm_cvtsi128_si64(staterr)); + var =3D __builtin_popcountll(_mm_cvtsi128_si64(staterr)); nb_pkts_recd +=3D var; if (likely(var !=3D RTE_IXGBE_DESCS_PER_LOOP)) break; -- 1.8.3.1