[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150205071734.GA3203@gmail.com>
Date: Thu, 5 Feb 2015 08:17:34 +0100
From: Ingo Molnar <mingo@...nel.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
jsrhbz@...argh.force9.co.uk,
christoph.muellner@...obroma-systems.com, linux@...ck-us.net,
linux@...musvillemoes.dk, paulmck@...ux.vnet.ibm.com,
tglx@...utronix.de, akpm@...ux-foundation.org,
maxime.coquelin@...com, linux-kernel@...r.kernel.org,
martink@...teo.de, tytso@....edu, linux-tip-commits@...r.kernel.org
Subject: Re: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions
* H. Peter Anvin <hpa@...or.com> wrote:
> On 01/19/2015 02:04 AM, Peter Zijlstra wrote:
> > On Mon, Jan 19, 2015 at 07:54:22AM +1200, Linus Torvalds wrote:
> >> Why?
> >>
> >> The 8- and 16- bit versions are the same as the 32-bit one.
> >> This seems pointless. If you want something where the sign
> >> is in bit 3, they all return the same value, just the return
> >> type differs, but that's really a *caller* thing, no?
> >
> > Even for the 8bit ones? Since we have the *H and *L register
> > we have more 8 bit regs than we have 16/32 bit regs and it
> > might just be worth it.
>
> Fewer, actually. gcc doesn't really use the H registers much,
Is that true for other compilers as well?
> and instead considers 8-bit values to occupy the whole
> register, but that means only four are available in 32-bit
> mode.
So where are we with this? Should I consider:
7e9358073d3f ("bitops: Add sign_extend8(), 16 and 64 functions")
NAK-ed due to having marginal benefits, or due to having no
benefits whatsoever?
How about the two patch series from Martin Keppling - that does
seem to be both beneficial and correct, agreed?
Thanks,
Ingo
--
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