Re: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip:core/types] bitops: Add sign_extend8(), 16 and 64 functions
- From: "H. Peter Anvin" <hpa@xxxxxxxxx>
- Date: Wed, 21 Jan 2015 12:22:19 -0800
- Cc: jsrhbz@xxxxxxxxxxxxxxxxxxxx, christoph.muellner@xxxxxxxxxxxxxxxxxxxxx, linux@xxxxxxxxxxxx, linux@xxxxxxxxxxxxxxxxxx, paulmck@xxxxxxxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, maxime.coquelin@xxxxxx, linux-kernel@xxxxxxxxxxxxxxx, martink@xxxxxxxxx, tytso@xxxxxxx, linux-tip-commits@xxxxxxxxxxxxxxx
- In-reply-to: <20150119100439.GN25256@twins.programming.kicks-ass.net>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
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, and
instead considers 8-bit values to occupy the whole register, but that
means only four are available in 32-bit mode.
-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]