[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.wbt93pu4pw9a85@mpn-glaptop>
Date: Tue, 27 Mar 2012 19:12:51 +0200
From: "Michal Nazarewicz" <mpn@...gle.com>
To: "Andrew Morton" <akpm@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>
Cc: "Denys Vlasenko" <vda.linux@...glemail.com>,
linux-kernel@...r.kernel.org,
"Douglas W Jones" <jones@...uiowa.edu>,
"Michal Nazarewicz" <mnazarewicz@...gle.com>
Subject: Re: [PATCH 1/1] vsprintf: optimize decimal conversion (again)
On Mon, 26 Mar 2012 22:20:52 +0200, H. Peter Anvin <hpa@...or.com> wrote:
> On 03/26/2012 01:13 PM, Andrew Morton wrote:
>> On Mon, 26 Mar 2012 21:56:38 +0200
>> Denys Vlasenko <vda.linux@...glemail.com> wrote:
>>
>>>>> +#if BITS_PER_LONG != 32 || (~(0ULL)>>1) != ((1ULL<<63)-1)
>>>>
>>>> What's this for?
>>>
>>> The second check should be just BITS_PER_LONG_LONG != 64,
>>> but we don't have BITS_PER_LONG_LONG.
>>
>> So let's add BITS_PER_LONG_LONG rather than hacking around its absence!
>
> First of all, the #if is wrong: the preprocessor doesn't support data
> types and does all arithmetic at (u)intmax_t precision.
Maybe a regular “if” instead of macro would suffice here? Compiler should
be smart enough to optimise out the dead path.
> As far as BITS_PER_LONG_LONG, there are tons of places in the kernel
> which already require that long long is exactly 64 bits. That may or
> may not be a good thing, but for right now one could simply:
>
> #define BITS_PER_LONG_LONG 64
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn@...gle.com>--------------ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists