string-486.h? these routines aren't currently used (see string.h), and
certainly could be written in a better (ie more readable) way.
It obviously doesn't make sense to mark a register as clobbered when
you're returning a value in it - so strstr is ok wrt that. (it has
other problems though, like having ecx/esi both as inputs and clobbers).
http://egcs.cygnus.com/faq.html#asmclobber
> strstr
> constrains its result to "a" but is that enough? strrchr has an "a"
> constraint and it explicitly lists "ax" as well.
if a register contains a result it obviously could have been modified
- listing it also as a clobbered register is wrong.
> Why the differences?
asm constraints used to be documented differently is earlier gcc versions...
> Is "ax" optional as a third constraint when input or output is "a" or
> should we always specify a third constraint of "ax", just to be on the
> safe side?
when an input is modified, you have to declare it as an output too;
with a scratch variable, if necessary. see string.h for examples
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/