From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Tim Northover <t.p.northover@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Andi Kleen <ak@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
LLVMdev <llvmdev@cs.uiuc.edu>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [LLVMdev] [PATCH] x86/asm: avoid mnemonics without type suffix
Date: Sun, 14 Jul 2013 12:41:06 -0700 [thread overview]
Message-ID: <51E2FED2.7010306@goop.org> (raw)
In-Reply-To: <CAFHTzf+O7sdeETp5nsnoQDFeg-zE4q6Kmq9rHPZEr5z2jm2zxg@mail.gmail.com>
On 07/14/2013 12:30 PM, Tim Northover wrote:
>> And that is why I think you should just consider "bt $x,y" to be
>> trivially the same thing and not at all ambiguous. Because there is
>> ABSOLUTELY ZERO ambiguity when people write
>>
>> bt $63, mem
>>
>> Zero. Nada. None. The semantics are *exactly* the same for btl and btq
>> in this case, so why would you want the user to specify one or the
>> other?
> I don't think you've actually tested that, have you? (x86-64)
>
> int main() {
> long val = 0xffffffff;
> char res;
>
> asm("btl $63, %1\n\tsetc %0" : "=r"(res) : "m"(val));
> printf("%d\n", res);
>
> asm("btq $63, %1\n\tsetc %0" : "=r"(res) : "m"(val));
> printf("%d\n", res);
> }
Blerk. It doesn't undermine the original point - that gas can
unambiguously choose the right operation size for a constant bit offset
- but yes, the operation size is meaningful in the case of a immediate
bit offset. Its pretty nasty of Intel to hide that detail in Table 3-2,
far from the instructions which use it...
J
>
> Tim.
>
next prev parent reply other threads:[~2013-07-14 19:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-14 12:56 [PATCH] x86/asm: avoid mnemonics without type suffix Ramkumar Ramachandra
2013-07-14 17:19 ` Linus Torvalds
2013-07-14 18:26 ` Ramkumar Ramachandra
2013-07-14 18:34 ` Linus Torvalds
2013-07-14 18:49 ` Ramkumar Ramachandra
2013-07-14 18:35 ` [LLVMdev] " Tim Northover
2013-07-14 19:09 ` Linus Torvalds
2013-07-14 19:30 ` Tim Northover
2013-07-14 19:41 ` Jeremy Fitzhardinge [this message]
2013-07-14 19:49 ` Linus Torvalds
2013-07-15 18:40 ` H. Peter Anvin
2013-07-15 18:56 ` Linus Torvalds
2013-07-15 19:00 ` H. Peter Anvin
2013-07-15 19:00 ` Linus Torvalds
2013-07-14 19:23 ` Jeremy Fitzhardinge
2013-07-14 19:29 ` Linus Torvalds
2013-07-15 18:40 ` H. Peter Anvin
2013-07-14 19:23 ` Jeremy Fitzhardinge
2013-07-14 21:14 ` Andi Kleen
2013-07-15 18:42 ` H. Peter Anvin
2013-07-15 18:47 ` H. Peter Anvin
2013-07-15 18:58 ` Linus Torvalds
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=51E2FED2.7010306@goop.org \
--to=jeremy@goop.org \
--cc=ak@linux.intel.com \
--cc=artagnon@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvmdev@cs.uiuc.edu \
--cc=mingo@kernel.org \
--cc=t.p.northover@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.