From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavan Nikhilesh Bhagavatula Subject: Re: [PATCH 2/2] eal: add u64 bit variant for reciprocal Date: Wed, 30 Aug 2017 09:35:43 +0530 Message-ID: <20170830040540.GA23207@PBHAGAVATULA-LT> References: <1504032378-5483-1-git-send-email-pbhagavatula@caviumnetworks.com> <1504032378-5483-2-git-send-email-pbhagavatula@caviumnetworks.com> <20170829123800.066ee293@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Stephen Hemminger Return-path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0069.outbound.protection.outlook.com [104.47.34.69]) by dpdk.org (Postfix) with ESMTP id 22D54100F for ; Wed, 30 Aug 2017 06:06:08 +0200 (CEST) Content-Disposition: inline In-Reply-To: <20170829123800.066ee293@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Aug 29, 2017 at 12:38:00PM -0700, Stephen Hemminger wrote: > On Wed, 30 Aug 2017 00:16:18 +0530 > Pavan Nikhilesh wrote: > Hi Stephen, > > +static inline uint64_t > > +mullhi_u64(uint64_t x, uint64_t y) > > { > > - uint32_t t = (uint32_t)(((uint64_t)a * R.m) >> 32); > > + __uint128_t xl = x; > > + __uint128_t yl = y; > > + __uint128_t rl = xl * yl; > > + return (uint64_t)(rl >> 64); > > +} > > Cast in return not necessary. And cast when setting t not necessary. > Please blank line after declarations. > > Also you don't need to cast both sides of multiply. Some compilers maybe > able to optimize 128 bit * 64 bit. Thanks for the inputs, will do the required changes along with removing license in v2. -Pavan