Re: nasm over gas?

From: Jörn Engel
Date: Fri Sep 05 2003 - 06:43:06 EST


On Thu, 4 September 2003 12:42:45 +0200, Fruhwirth Clemens wrote:
>
> I recently posted a module for twofish which implements the algorithm in
> assembler (http://marc.theaimsgroup.com/?l=linux-kernel&m=106210815132365&w=2)
>
> Unfortunately the assembler used is masm. I'd like to change that. Netwide
> Assembler (nasm) is the assembler of my choice since it focuses on
> portablity and has a more powerful macro facility (macros are heavily used
> by 2fish_86.asm). But as I'd like to make my work useful (aim for an
> inclusion in the kernel) I noticed that this would be the first module to
> depend on nasm. Everything else uses gas.

Orthogonally to the nasm/gas question, there are the problems or
performance and maintenance.

Do some benchmarks on lots of different machines and measure the
performance of the asm and c code. If it's faster on PPro but not on
PIII or Athlon, forget about it.

How big is the .text of the asm and c variant? If the text of yours
is much bigger, you just traded 2fish performance for general
performance. Everything else will suffer from cache misses. Forget
your microbenchmark, your variant will make the machine slower.

How many bugs are in your code? Are there any buffer overflows or
other security holes? How can you be sure about it? (Most people
aren't sure about c either, but it is much easier to check.)

If your code fails on any one of these questions, forget about it. If
it survives them, post your results and have someone else verify them.


As to nasm/gas, you will have a hard time to explain, why joe user
needs yet another tool to compile his own kernel. There may be good
arguments in favor, but they better be good, else translate to gas.

Jörn

--
Homo Sapiens is a goal, not a description.
-- unknown
-
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/