All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Oleksii Kurochko" <oleksii.kurochko@gmail.com>,
	"Shawn Anastasio" <sanastasio@raptorengineering.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of hweightl()
Date: Tue, 27 Aug 2024 15:32:38 +0100	[thread overview]
Message-ID: <d63df810-3f95-4c99-90fd-e509c26fc4fe@citrix.com> (raw)
In-Reply-To: <c54f7015-abe1-4834-83e3-29a2cc854d85@citrix.com>

On 27/08/2024 2:25 pm, Andrew Cooper wrote:
> On 27/08/2024 2:00 pm, Jan Beulich wrote:
>> On 27.08.2024 13:50, Andrew Cooper wrote:
>>> On 26/08/2024 12:55 pm, Jan Beulich wrote:
>>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> Again, this is modelled after f[fl]s64() which have the same
>>> expectations about the BITS_PER_LONG != 64 case.
>> Both of them are fine afaict. fls64() has an explicit intermediate
>> variable of type uint32_t, and ffs64() has a (uint32_t)x as part
>> of the conditional expression achieving the intended effect.
>>
>> Anyway, why not use hweight32() instead of hweightl() here? That'll
>> make things very explicit.
> hweight32() doesn't exist until the next patch in the series.
>
> Although looking at the end result, I can't figure out why I thought it
> was necessary to transform hweight64 first.
>
> I'll swap this patch and the next one, and then use hweight32().

I've found out why.

The hweight32() patch is the one that deletes generic_hweight32(), but
generic_hweight64() uses it.

I can work around this, but it means keeping generic_hweight32() around
and deleting it in the hweight64() patch.

~Andrew


  reply	other threads:[~2024-08-27 14:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22 23:06 [PATCH 0/9] xen/bitops: hweight() cleanup/improvements Andrew Cooper
2024-08-22 23:06 ` [PATCH 1/9] xen/bitops: Reinstate the please tidy message Andrew Cooper
2024-08-22 23:06 ` [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper Andrew Cooper
2024-08-26 10:30   ` Jan Beulich
2024-08-27 12:01     ` Andrew Cooper
2024-08-27 12:50       ` Jan Beulich
2024-08-27 14:13         ` Andrew Cooper
2024-08-22 23:06 ` [PATCH 3/9] xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set() Andrew Cooper
2024-08-26 10:37   ` Jan Beulich
2024-08-27  9:44     ` Andrew Cooper
2024-08-22 23:06 ` [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}() Andrew Cooper
2024-08-26 10:39   ` Jan Beulich
2024-08-27  9:49     ` Andrew Cooper
2024-08-27 10:11       ` Jan Beulich
2024-08-27 12:04         ` Andrew Cooper
2024-08-22 23:06 ` [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and hweightl() Andrew Cooper
2024-08-26 11:40   ` Jan Beulich
2024-08-27 10:39     ` Andrew Cooper
2024-08-27 11:41       ` Jan Beulich
2024-08-27 12:30         ` Andrew Cooper
2024-08-22 23:06 ` [PATCH 6/9] xen/bitops: Drop hweight_long() and use hweightl() Andrew Cooper
2024-08-26 11:51   ` Jan Beulich
2024-08-22 23:06 ` [PATCH 7/9] xen/bitops: Implement hweight64() in terms of hweightl() Andrew Cooper
2024-08-26 11:55   ` Jan Beulich
2024-08-27 11:50     ` Andrew Cooper
2024-08-27 13:00       ` Jan Beulich
2024-08-27 13:25         ` Andrew Cooper
2024-08-27 14:32           ` Andrew Cooper [this message]
2024-08-27 15:01             ` Jan Beulich
2024-08-22 23:06 ` [PATCH 8/9] xen/bitops: Implement hweight32() " Andrew Cooper
2024-08-26 11:59   ` Jan Beulich
2024-08-27 12:05     ` Andrew Cooper
2024-08-22 23:06 ` [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available Andrew Cooper
2024-08-23 15:35   ` Nicola Vetrini
2024-08-23 15:38     ` Andrew Cooper
2024-08-26 13:07   ` Jan Beulich
2024-08-27 11:17     ` Andrew Cooper
2024-08-27 12:47       ` Jan Beulich
2024-08-27 14:59         ` Andrew Cooper
2024-08-27 15:04           ` Jan Beulich

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=d63df810-3f95-4c99-90fd-e509c26fc4fe@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=oleksii.kurochko@gmail.com \
    --cc=roger.pau@citrix.com \
    --cc=sanastasio@raptorengineering.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.