From: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] eal: add u64 bit variant for reciprocal
Date: Wed, 30 Aug 2017 09:35:43 +0530 [thread overview]
Message-ID: <20170830040540.GA23207@PBHAGAVATULA-LT> (raw)
In-Reply-To: <20170829123800.066ee293@xeon-e3>
On Tue, Aug 29, 2017 at 12:38:00PM -0700, Stephen Hemminger wrote:
> On Wed, 30 Aug 2017 00:16:18 +0530
> Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> 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
next prev parent reply other threads:[~2017-08-30 4:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 18:46 [dpdk-dev] [PATCH 1/2] eal: introduce integer divide through reciprocal Pavan Nikhilesh
2017-08-29 18:46 ` [dpdk-dev] [PATCH 2/2] eal: add u64 bit variant for reciprocal Pavan Nikhilesh
2017-08-29 19:35 ` Stephen Hemminger
2017-08-29 19:38 ` Stephen Hemminger
2017-08-30 4:05 ` Pavan Nikhilesh Bhagavatula [this message]
2017-12-04 13:22 ` [dpdk-dev] [PATCH v7 1/3] eal: introduce integer divide through reciprocal Pavan Nikhilesh
2017-12-04 13:22 ` [dpdk-dev] [PATCH v7 2/3] eal: add u64 bit variant for reciprocal Pavan Nikhilesh
2017-12-04 13:22 ` [dpdk-dev] [PATCH v7 3/3] test: add tests for reciprocal based division Pavan Nikhilesh
2018-01-18 23:49 ` Thomas Monjalon
2018-01-25 22:35 ` Thomas Monjalon
2018-01-11 16:01 ` [dpdk-dev] [PATCH v7 1/3] eal: introduce integer divide through reciprocal Dumitrescu, Cristian
2018-01-26 5:04 ` [dpdk-dev] [PATCH v8 " Pavan Nikhilesh
2018-01-26 5:04 ` [dpdk-dev] [PATCH v8 2/3] eal: add u64 bit variant for reciprocal Pavan Nikhilesh
2018-01-29 6:42 ` Hemant Agrawal
2018-01-29 7:54 ` Pavan Nikhilesh
2018-01-29 8:14 ` Hemant Agrawal
2018-10-28 0:06 ` Ferruh Yigit
2018-01-26 5:04 ` [dpdk-dev] [PATCH v8 3/3] test: add tests for reciprocal based division Pavan Nikhilesh
2018-01-27 21:39 ` [dpdk-dev] [PATCH v8 1/3] eal: introduce integer divide through reciprocal Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170830040540.GA23207@PBHAGAVATULA-LT \
--to=pbhagavatula@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).