As usual you are completely wrong. Clobbers can be used ONLY for
registers that do not already appear in either the input or output
list. In this case, it is the input registers that are modified. You
have to use notation that makes that explicit.
The correct way to write this asm statement with GCC 2.95 or later is
asm volatile
("rep; stosl"
: "+D" (d), "+c" (l) /* read and write edi, ecx */
: "a" (b)
: "memory");
With earlier versions you have to use a more verbose notation.
Some further notes:
rep stosl doesn't change %eax, so a plain input parameter can be used
for that argument.
GCC assumes that any asm with output parameters has no side effects.
The memory clobber doesn't count. Therefore, it will notice that d
and l are not used again and delete the whole asm statement, unless
you qualify it with 'volatile'.
There is no point in using __asm__ instead of asm, unless you are
writing code which has to compile with -pedantic on.
zw
-
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/