[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200605230610.bizp2j23ivyma5rn@master>
Date: Fri, 5 Jun 2020 23:06:10 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Wei Yang <richard.weiyang@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [Patch v2] lib: test get_count_order/long in test_bitops.c
On Thu, Jun 04, 2020 at 02:51:40PM +0200, Geert Uytterhoeven wrote:
>Hi Wei,
>
>On Thu, Jun 4, 2020 at 2:28 PM Wei Yang <richard.weiyang@...il.com> wrote:
[...]
>>
>> You mean
>>
>> {0x0000000000000003, 2},
>> {0x0000000000000004, 2},
>> {0x0000000000001fff, 13},
>> {0x0000000000002000, 13},
>> {0x0000000050000000, 31},
>> {0x0000000080000000, 31},
>> {0x0000000080003000, 32},
>
>Yes, those values. And those should work with get_count_order_long()
>on both 32-bit and 64-bit.
Hi, Geert
To be frank, I am afraid I lack some of the skill to achieve this. Maybe you
could give some guide.
get_count_order_long() takes one parameter, which is of type unsigned long.
This one has different size on 32bit and 64bit platform. On 32bit platform,
those value would be truncated.
Would you mind giving me a hint on this?
What we may achieve is like the implementation of fls_long(). This one check
the size of unsigned long on running, and choose different function. We could
use ifdef to check the size of unsigned long and use different data to feed
get_count_order_long(). But I don't find a way to feed get_count_order_long()
with 64bit data on 32bit platform.
>
>Gr{oetje,eeting}s,
>
> Geert
>
>--
>Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
>
>In personal conversations with technical people, I call myself a hacker. But
>when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
--
Wei Yang
Help you, Help me
Powered by blists - more mailing lists