Re: Linux-asm (was A patch for linux 2.1.127)

Riccardo Facchetti (fizban@tin.it)
Sun, 15 Nov 1998 13:28:40 +0100 (MET)


On Sat, 14 Nov 1998, Richard B. Johnson wrote:

> It is important to me. I want you to read my paper and review my
> assembly code. Then I want you to tell me if you think I should
> write an Intel extension to GAS or if you think my talents would
> be better served by writing some assembly-language for some Linux-
> kernel procedures.

I have read your paper, the C code and the Assembly code.

No problems understanding C code but Assembly ... I have programmed in 16
bit Intel Assembly long time ago (but I am not a real Assembly programmer)
and I am able to follow (sort of) the instruction paths. IMHO the real
problem is that Assembly need an Assembly programmer to be fully
understood and mantained while C is much more easy to mantain. Even more,
an Assembly programmer can mantain C code while a C programmer may not be
able to mantain asm code. We need a portable and mantainable kernel. Of
course I can imagine that for some well defined code paths (like fast
default cases) or counting functions (like checksumming) asm equivalents
can be the best solution, but there is a limit at this one too:
fast asm code for i386 != i486 != P5 != P6 so there should be something
like:

#if defined(i386)
#include "fasti386.S"
#elif defined(i486)
#include "fasti486.S"
#elif defined(P5)
#include "fastP5.S"
#elif defined(P6)
#include "fastP6.S"
else
#include "slow.c"
#endif

and we need someone that is willing to mantain all the different
implementations in C and in asm and maybe write new ones for P7, P8 etc
etc. To add more complexity someone should provide Alpha assembly version
and MIPS and SPARC32 and SPARC64 and motorola etc etc. This is okay for
something like checksumming but IMHO it will be a real pain if someone
will come out rewriting e.g. filesystem code in Assembly.
In this case I say slow C code is better than superfast Assembly code.

OTOH I've enjoyed your paper Assembly Language, good work :)

Ciao,
Riccardo.

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