From: "H. Peter Anvin" <hpa@zytor.com>
To: Joe Perches <joe@perches.com>, linux-arch <linux-arch@vger.kernel.org>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, james.t.kukunas@intel.com,
hpa@linux.intel.com,
Linus Torvalds <torvalds@linux-foundation.org>,
David Miller <davem@davemloft.net>
Subject: Re: [tip:x86/asm] x86, bitops: Change bitops to be native operand size
Date: Sun, 10 Nov 2013 18:06:26 -0800 [thread overview]
Message-ID: <52803BA2.2080908@zytor.com> (raw)
In-Reply-To: <1384123457.3081.33.camel@joe-AO722>
On 11/10/2013 02:44 PM, Joe Perches wrote:
> (adding linux-arch, and possible patch below)
>
> On Sun, 2013-11-10 at 14:10 -0800, H. Peter Anvin wrote:
>> Yes, on the generic it is int.
>>
>> The problem is in part that some architectures have bitop
>> instructions with specific behavior.
>
> I think that all bitop indices should be changed
> to unsigned (int or long, probably long) for all
> arches.
>
> Is there any impediment to that?
>
It is at the very best misleading. On x86 bit indicies will be signed
no matter what the data type says, and having an unsigned data type
being interpreted as signed seems like really dangerous.
On the other hand, for the generic implementation unsigned long makes sense.
We might need a bitindex_t or something like that for it to be clean.
-hpa
next prev parent reply other threads:[~2013-11-11 2:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tip-z61ofiwe90xeyb461o72h8ya@git.kernel.org>
[not found] ` <1384117768.3081.10.camel@joe-AO722>
[not found] ` <5ac67859-a0b2-47f5-bdc2-c2a52b8d6885@email.android.com>
2013-11-10 22:44 ` [tip:x86/asm] x86, bitops: Change bitops to be native operand size Joe Perches
2013-11-10 22:44 ` Joe Perches
2013-11-11 2:06 ` H. Peter Anvin [this message]
2013-11-11 2:22 ` Joe Perches
2013-11-11 23:34 ` H. Peter Anvin
2013-11-12 2:54 ` Joe Perches
2013-11-12 3:15 ` Linus Torvalds
2013-11-12 4:08 ` Joe Perches
2013-11-12 8:52 ` Geert Uytterhoeven
2013-11-30 23:16 ` Rob Landley
2013-11-30 23:16 ` Rob Landley
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=52803BA2.2080908@zytor.com \
--to=hpa@zytor.com \
--cc=davem@davemloft.net \
--cc=hpa@linux.intel.com \
--cc=james.t.kukunas@intel.com \
--cc=joe@perches.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).