early clobber for audio.c

Michael L. Galbraith (mikeg@weiden.de)
Sun, 29 Mar 1998 13:54:56 +0200 (MET DST)


Hi Alan,

While tinkering with the new binutils (gas didn't like xlatb), I noticed
that the inlined version of translate_bytes() is a candidate for
conversion to early clobbers.

I also noticed that if __volatile__ is omitted, xlat doesn't show up in
the output at all. Is that an egcs bug, or is it (magically) possible to
optimize translate_bytes() totally away?

I _think_ that the following pseudocode_generator output is right.

-Mike

--- drivers/sound/audio.c.orig Wed Mar 18 18:54:39 1998
+++ drivers/sound/audio.c Sun Mar 29 11:47:54 1998
@@ -183,13 +183,15 @@
{
if (n > 0)
{
- __asm__("cld\n"
+ int __clobber0,__clobber1,__clobber2,__clobber3;
+ __asm__ __volatile__ ("cld\n"
"1:\tlodsb\n\t"
"xlatb\n\t"
"stosb\n\t"
- "loop 1b\n\t":
- : "b"((long) table), "c"(n), "D"((long) buff), "S"((long) buff)
- : "bx", "cx", "di", "si", "ax");
+ "loop 1b\n\t"
+ : "=&b"(__clobber0),"=&c"(__clobber1),"=&D"(__clobber2),"=&S"(__clobber3)
+ : "0"((long) table), "1"(n), "2"((long) buff), "3"((long) buff)
+ : "ax");
}
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu