Re: Question about missing "cld" in x86 string assembly code

From: Linus Torvalds
Date: Sat Dec 17 2011 - 13:39:47 EST


On Sat, Dec 17, 2011 at 9:08 AM, Brian Gerst <brgerst@xxxxxxxxx> wrote:
>
> The i386 ELF ABI states "The direction flag must be set to the
> ‘‘forward’’ (that is, zero) direction before entry and upon exit from
> a function."  Therefore it can be assumed to be clear, unless
> explicitly set.

The exception, of course, being bootup, fault and interrupt handlers,
and after we've called out to foreign code (ie BIOS).

So there *are* a few cld's sprinkled around, they are just fairly rare.

Linus
--
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/