Re: [PATCH] get rid of "+m" constraint in i386 rwsems

From: Horst von Brand
Date: Thu May 06 2004 - 14:27:18 EST


Russell King <rmk+lkml@xxxxxxxxxxxxxxxx> said:

[...]

> After reading Richard's post, I wonder if, in the case of:
>
> "=m" (x) : "m" (x)
>
> whether assembly should assume that %0 is the same as %1. Do they
> just happen to be the same thing? I'm thinking of the case where
> there may be two different ways GCC may reference the same memory
> location.

It also might be a "memory location" that isn't really in memory (a local
variable whose value resides in one register up to your asm() fragment, and
from then on in another one or in memory; it might also be useful to load a
value into a register from memory and restore it into memory after sundry
manipulations, and even from a different register, much later).

Today's compilers don't necessarily do things the way a naive understanding
of the source language would say they do. Ever wonder why nobody uses
"register" anymore (compilers are smarter than binding one value to a
register today), and why fiddling with pointers when accessing arrays is
not standard fare (compilers optimize the (bulky, slow) array accesses via
indices out as a matter of course)?
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/