From patchwork Thu Jun 1 06:01:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangjin Han X-Patchwork-Id: 24937 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 14AD44CE4; Thu, 1 Jun 2017 08:01:43 +0200 (CEST) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by dpdk.org (Postfix) with ESMTP id AFC4A374C for ; Thu, 1 Jun 2017 08:01:40 +0200 (CEST) Received: by mail-pf0-f194.google.com with SMTP id u26so6662459pfd.2 for ; Wed, 31 May 2017 23:01:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Cp9GK8h8MmNBICyspwiwtYUFIo0GUT6IbNc7j4pAZ6w=; b=Qr5oNsTFliVWWWOiateDCVeCw4xUsnnGh2qkYYIXJKt3W21B5ox6yjqX+8/z0UK6fR qcF/nxZ/VTY6VAaOy4TJgrL6ndb5Psrz9zVI7qCpcv2/v2qRrvzaaUhuBCuLKF9tZl5r UZ1Roiq7MpLopW9dLwP2/13SyurvVidjxGaE1KyK/l2UY/z0HfeTcIlolovhjz8MWVC/ AKimg1tWFv7rZpWHKjDZf9FjTT7ZBW8qookTzJRjt6Ei/L+A+EhjTVEfOLhtHvA6s2e4 Gz42JUnBjFc6JCF22ESBHWaOAAp5YiN3IBsMyvINhItAzRSqWJSmseuxTemJYn6n7LeL EY5Q== X-Gm-Message-State: AODbwcAS+xNVSQNuQoHmcGUiN25Lb4xgZ8+jnhPEYkk3CmCk4xVFo1ua FBE/HxzKujBbHQ== X-Received: by 10.99.112.3 with SMTP id l3mr36422814pgc.13.1496296899913; Wed, 31 May 2017 23:01:39 -0700 (PDT) Received: from pandaria.us-west-2.compute.internal (ec2-54-69-216-171.us-west-2.compute.amazonaws.com. [54.69.216.171]) by smtp.gmail.com with ESMTPSA id q27sm34564200pfk.4.2017.05.31.23.01.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 23:01:39 -0700 (PDT) From: Sangjin Han To: bruce.richardson@intel.com Cc: dev@dpdk.org, Sangjin Han Date: Thu, 1 Jun 2017 06:01:35 +0000 Message-Id: <1496296895-9600-1-git-send-email-sangjin@eecs.berkeley.edu> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] lpm: fix build error on g++ with -O0 option X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When rte_lpm.h is used on x86, -O0 option (no optimization at all) given to g++ (not gcc) causes a compile error like this: error: the last argument must be an 8-bit immediate i24 = _mm_srli_si128(i24, sizeof(uint64_t)); -O0 option is useful for debugging and code coverage measurement, but this error prevents C++ programs from building. This patch replaces "sizeof(uint64_t)" with a constant literal "8" to work around the issue. Tested with g++ 5.4.1. Signed-off-by: Sangjin Han Acked-by: Bruce Richardson --- lib/librte_lpm/rte_lpm_sse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_lpm/rte_lpm_sse.h b/lib/librte_lpm/rte_lpm_sse.h index ef33c6a..2e17df3 100644 --- a/lib/librte_lpm/rte_lpm_sse.h +++ b/lib/librte_lpm/rte_lpm_sse.h @@ -78,7 +78,7 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], /* extract values from tbl24[] */ idx = _mm_cvtsi128_si64(i24); - i24 = _mm_srli_si128(i24, sizeof(uint64_t)); + i24 = _mm_srli_si128(i24, 8); ptbl = (const uint32_t *)&lpm->tbl24[(uint32_t)idx]; tbl[0] = *ptbl;