Re: nasm over gas?

From: Ricardo Bugalho
Date: Fri Sep 12 2003 - 12:28:31 EST


On Fri, 2003-09-12 at 16:26, insecure wrote:

> > You're quite right, but the I-Cache is a non issue: this code will be
> Please disable icache on your CPU ;)
[snip]
> How can you know that it won't evict useful code?

a) the code is at the beginning of the program
b) its only run once

Therefore, its impact on i-cache is a non-issue. I wasn't disscussing
the merits of a i-cache.

> > You can complain about the time it gets to fetch the code from
> > RAM though.
>
> Thanks for the tip. I missed that!

Welcome.

> It makes perfectly fine point that gcc code is not good.
> It just wasted 8 bytes in a rather simple code sequence.

First of all, it would have been nice to see the relevant code and
optimization flags.

I'll assume the goal is speed, not code size. Lets look at that piece of
code:
a) its only run once, so it doesn't benefict of caching
b) there are no loads there, so it can't be prefetched while the CPU
waits for loads
And thats what makes its performance benefict of smaller code size.
But its also irrelevant to global performance. And I can't even imagin
any code that meets a) and b) and is relevant for performance.
In modern, general purpose, computer systems, code size is irrelevant.
It has been for 15 years and its not going to change.
And I'm not going to complaint about the compiler making a bad decision
on such a irrelevant case and one that is not worth re-writing in
assembly.

--
Ricardo

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