lkml.org 
[lkml]   [2013]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [LLVMdev] [PATCH] x86/asm: avoid mnemonics without type suffix
On 07/14/2013 12:49 PM, Linus Torvalds wrote:
> On Sun, Jul 14, 2013 at 12:30 PM, Tim Northover <t.p.northover@gmail.com> wrote:
>>
>> I don't think you've actually tested that, have you? (x86-64)
>
> Oh, you're right, for constants > 5 bits you have that other thing
> going on. I didn't think about the fact that the constant changed in
> the middle of the thread (it started out as 1).
>
> We use the gcc constraint "I" (0-31) in the kernel for this reason.
>
> Linus

This is also why the Intel manuals point out that "some assemblers" can
take things like:

bt[l] $63,(%rsi)

... and turn it into:

btl $31,4(%rsi)

This is definitely the friendly thing to do toward the human programmer.
Unfortunately gas doesn't, nor does e.g. NASM.

-hpa




\
 
 \ /
  Last update: 2013-07-15 21:21    [W:0.054 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site