From: insecure <insecure@mail.od.ua>
To: Michael Frank <mhf@linuxmail.org>,
Yann Droneaud <yann.droneaud@mbda.fr>,
fruhwirth clemens <clemens-dated-1063536166.2852@endorphin.org>
Cc: linux-kernel@vger.kernel.org, "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Subject: Re: nasm over gas?
Date: Fri, 5 Sep 2003 20:28:37 +0300 [thread overview]
Message-ID: <200309052028.37367.insecure@mail.od.ua> (raw)
In-Reply-To: <200309052058.11982.mhf@linuxmail.org>
On Friday 05 September 2003 15:59, Michael Frank wrote:
> Just got another reply to this thread which helps to explain what I meant
> by "better coders in 98+% of applications"
>
> On Friday 05 September 2003 19:42, Jörn Engel wrote:
> > 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.
A random example form one small unrelated program (gcc 3.2):
main:
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $32, %esp
xorl %ebp, %ebp
cmpl $1, 52(%esp)
movl $0, 20(%esp)
movl $1000000, %edi <----
movl $1000000, 16(%esp) <----
movl $0, 12(%esp)
movl $.LC27, 8(%esp)
je .L274
movl $1, %esi
cmpl 52(%esp), %esi
jge .L272
No sane human will do that.
main:
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $32, %esp
xorl %ebp, %ebp
cmpl $1, 52(%esp)
movl $0, 20(%esp)
movl $1000000, %edi
movl %edi, 16(%esp) <-- save 4 bytes
movl %ebp, 12(%esp) <-- save 4 bytes
movl $.LC27, 8(%esp)
je .L274
movl $1, %esi
cmpl 52(%esp), %esi
jge .L272
And this is only from a cursory examination.
> There is another technical argument - which I am not very familiar with:
> Modern and future CPU's are optimized for high level languages, it is
> just too troublesome to arrange all the instructions best-case for the
> hardware to be well utilized.
You took marketspeak too seriously.
> Back to my original message, my implied definition of "Better coders"
> is the compromise between performance, development effort, stability
> and security (and more).
>
> It does not just refer to the best possible "perfect" code.
>
> Let me give you a example of "best possible code" (to the best of my
> ability):
>
> I do mostly embedded applications, years ago did consumer design for this
> kind of Hong Kong made $19.99 gimmicks ($6 FOB) priced to be purchased
> "on impulse" by joe consumer.
>
> For one of those gimmicks, I used a 4bit running on 1.5V with 1K
> instruction ROM and 64 nibbles RAM doing 32KIPS (32768 instructions per
> second) to establish the speed of a tennis ball it was built into.
> It required floating point calculations and display on a built-in
> LCD display with 64 segments.
>
> This takes __clever__ __optimized__ code, and is at least a week of work,
> and affordable only in high-volume applications.
>
> Consider, one week of work for what you can do in C using GLIBC within
> 1 hour or less!
>
> Now, please consider a real life (linux) system, which you use everyday,
> of course you could make every piece of code "better" by hand coding and
> optimizing, but what is the real benefit?
>
> Assuming these millions of lines of C having been implemented in optimized
> assembly, could it perform that much faster (if that is what you call
> "better"), or would you use "half" the memory for the same job?
>
> Now, what about it's stability and maintainability - not to mention COST,
> even you could find all those great human coders?
>
> Guess the pioneering days are over ;)
What gives you an impression that anyone is going to rewrite linux in asm?
I _only_ saying that compiler-generated asm is not 'good'. It's mediocre.
Nothing more. I am not asm zealot.
--
vda
next prev parent reply other threads:[~2003-09-05 17:32 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-04 10:42 nasm over gas? Fruhwirth Clemens
2003-09-04 12:32 ` Antonio Vargas
2003-09-04 13:44 ` Yann Droneaud
2003-09-04 14:05 ` Richard B. Johnson
2003-09-04 14:21 ` Sean Neakums
2003-09-04 14:33 ` Richard B. Johnson
2003-09-04 15:09 ` Yann Droneaud
2003-09-04 14:55 ` Yann Droneaud
2003-09-05 21:16 ` George Anzinger
2003-09-04 14:57 ` Michael Frank
2003-09-04 15:43 ` Fruhwirth Clemens
2003-09-04 22:28 ` insecure
2003-09-05 12:59 ` Michael Frank
2003-09-05 17:28 ` insecure [this message]
2003-09-05 17:45 ` Jörn Engel
2003-09-06 17:18 ` insecure
2003-09-07 18:49 ` Eric W. Biederman
2003-09-07 19:30 ` Jamie Lokier
2003-09-09 21:37 ` insecure
2003-09-09 21:34 ` insecure
2003-09-11 11:07 ` Ricardo Bugalho
2003-09-12 15:26 ` insecure
2003-09-12 17:27 ` Ricardo Bugalho
2003-09-12 22:17 ` Jörn Engel
2003-09-13 19:25 ` Jamie Lokier
2003-09-13 19:51 ` Jörn Engel
2003-09-11 14:03 ` Eric W. Biederman
2003-09-11 17:05 ` Jamie Lokier
2003-09-09 20:56 ` Pavel Machek
2003-09-05 13:27 ` Jesse Pollard
2003-09-05 23:51 ` Aaron Lehmann
2003-09-06 1:41 ` Valdis.Kletnieks
2003-09-04 14:56 ` Yann Droneaud
2003-09-05 11:42 ` Jörn Engel
2003-09-05 12:04 ` Fruhwirth Clemens
2003-09-05 12:37 ` Jörn Engel
-- strict thread matches above, loose matches on Subject: below --
2003-09-05 12:21 John Bradford
2003-09-05 12:25 John Bradford
2003-09-05 12:25 ` Fruhwirth Clemens
2003-09-06 22:08 ` Herbert Poetzl
2003-09-07 20:40 ` Fruhwirth Clemens
2003-09-05 13:20 ` Richard B. Johnson
2003-09-05 13:57 John Bradford
2003-09-05 15:39 ` Mehmet Ceyran
2003-09-06 20:24 ` David B. Stevens
[not found] <rZQN.83u.21@gated-at.bofh.it>
[not found] ` <saVL.7lR.1@gated-at.bofh.it>
[not found] ` <soFo.16a.1@gated-at.bofh.it>
[not found] ` <ssJa.6M6.25@gated-at.bofh.it>
[not found] ` <tcVB.rs.3@gated-at.bofh.it>
2003-09-08 12:03 ` Ihar 'Philips' Filipau
2003-09-08 13:53 ` Richard B. Johnson
2003-09-08 16:10 ` Jamie Lokier
2003-09-08 16:17 ` Jamie Lokier
2003-09-08 16:45 ` Ihar 'Philips' Filipau
2003-09-08 16:58 ` Jamie Lokier
2003-09-08 17:59 ` William Lee Irwin III
[not found] <snJB.8dk.25@gated-at.bofh.it>
[not found] ` <snTm.8qD.41@gated-at.bofh.it>
[not found] ` <sTpW.18Z.19@gated-at.bofh.it>
[not found] ` <teE5.2XZ.9@gated-at.bofh.it>
2003-09-08 12:07 ` Ihar 'Philips' Filipau
[not found] <tt0q.6Rc.17@gated-at.bofh.it>
[not found] ` <tt0r.6Rc.19@gated-at.bofh.it>
[not found] ` <tt0r.6Rc.21@gated-at.bofh.it>
[not found] ` <tt0r.6Rc.23@gated-at.bofh.it>
[not found] ` <tt0r.6Rc.25@gated-at.bofh.it>
[not found] ` <tt0q.6Rc.15@gated-at.bofh.it>
[not found] ` <tyCN.6RD.13@gated-at.bofh.it>
2003-09-08 20:08 ` Ihar 'Philips' Filipau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200309052028.37367.insecure@mail.od.ua \
--to=insecure@mail.od.ua \
--cc=clemens-dated-1063536166.2852@endorphin.org \
--cc=joern@wohnheim.fh-wedel.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mhf@linuxmail.org \
--cc=yann.droneaud@mbda.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox