From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 72E6E18F for ; Tue, 5 Aug 2014 17:24:29 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 Aug 2014 08:26:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,805,1400050800"; d="scan'208";a="554051456" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by orsmga001.jf.intel.com with ESMTP; 05 Aug 2014 08:26:49 -0700 Received: from irsmsx109.ger.corp.intel.com (163.33.3.23) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.195.1; Tue, 5 Aug 2014 16:26:28 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.240]) by IRSMSX109.ger.corp.intel.com ([169.254.13.200]) with mapi id 14.03.0195.001; Tue, 5 Aug 2014 16:26:28 +0100 From: "Ananyev, Konstantin" To: Neil Horman , "dev@dpdk.org" Thread-Topic: [PATCH] acl: If build does not support sse4.2, emulate missing instructions with C code Thread-Index: AQHPr/nfSvxellfhhkCY1e7bjysdIJvCBOJw Date: Tue, 5 Aug 2014 15:26:27 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772582134F98D@IRSMSX105.ger.corp.intel.com> References: <1407166558-9532-1-git-send-email-nhorman@tuxdriver.com> In-Reply-To: <1407166558-9532-1-git-send-email-nhorman@tuxdriver.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] acl: If build does not support sse4.2, emulate missing instructions with C code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List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