From: Stephen Hemminger <stephen@networkplumber.org>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Cc: dev@dpdk.org, cristian.dumitrescu@intel.com
Subject: Re: [dpdk-dev] [PATCH 2/2] eal: add u64 bit variant for reciprocal
Date: Tue, 29 Aug 2017 12:38:00 -0700 [thread overview]
Message-ID: <20170829123800.066ee293@xeon-e3> (raw)
In-Reply-To: <1504032378-5483-2-git-send-email-pbhagavatula@caviumnetworks.com>
On Wed, 30 Aug 2017 00:16:18 +0530
Pavan Nikhilesh <pbhagavatula@caviumnetworks.com> wrote:
> +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.
next prev parent reply other threads:[~2017-08-29 19:38 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 [this message]
2017-08-30 4:05 ` Pavan Nikhilesh Bhagavatula
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=20170829123800.066ee293@xeon-e3 \
--to=stephen@networkplumber.org \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=pbhagavatula@caviumnetworks.com \
/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).