lkml.org 
[lkml]   [2003]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: const versus __attribute__((const))
H. Peter Anvin wrote:
> > It would be nice to have a way to declare an asm like "pure" not
> > "const", so that it's allowed to read memory but multiple calls can be
> > eliminated; I don't know of a way to express that.
>
> Just specify memory input operands.

Thanks. That's even more useful than "pure" because it implies the
asm only reads the explicitly passed memory operands.

Memory input operands don't work if you want the asm to read arbitrary
memory not mentioned in the inputs (like "pure" allows) or traverse
linked lists.

(A long time ago there was a question about whether GCC could ever
copy the value associated with an "m" operand to a stack slot, and
pass the address of the stack slot. After all, GCC _will_ copy the
value if the operand is an "r", and presumably gives mixed results
with "rm". We seem to have concluded that it never will).

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.055 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site