Re: a common belief or a wrong C[++] compiler?

From: wolfgang kern (nowhere_at_nevernet.at)
Date: 08/15/04


Date: Sun, 15 Aug 2004 23:06:39 +0200


"gpcea" replied:
| I wrote:
| > There will be never any tool that can produce
| > better/faster/shorter/smarter code than a 'working' human brain.

| Yes, but don't you think that _large_ programs like
| gcc, glibc, windows, linux etc. will take too long
| to author in assembly/hexadecimal?

No, I could paste all code I've ever written during the last
twenty-five years into one huge file as well,
this would be about the size of windoze-NT including all backwards,
but I can't see any sense in doing this :)

And I don't need longer than any HLL-programmer to get
a piece of code working and added to whatsoever.

| Or, is it your opinion that the above projects are
| too bloated?

Yes, bloated by far useless detours and paranoid OS safety concepts.

| Also, compilers like gcc will achieve success only
| if they port to maximum architectures. How can that
| be done easily if the entire prog. is written in
| assembly/hexadecimal?

ASM isn't the language to make portable source for different CPUs.
IA-32 ASM created code is direct portable to all IA-32 CPUs
without re-compile with different compiler switches
(as long SSE/3Dnow isn't used, or both options are implemented).

| > If you already know 50% of the IA-32 instructions
| > (my view: half of the whole set is useless anyway)

| Really!? I'm rather new to assembly. Which instructions
| in the IA-32 set are useless? MMX? SSE[2/3]? 3D NOW!?...

For me, with my very own numeric types, almost all FP-instructions,
including single/double-packets, and:
BOUND/INTO/AAA/AAD/AAM/AAS/DAA/DAS/IDIV/INVLPG/ENTER/LEAVE/CMOV/LAR/
LLDT/LSL/LTR/SETcc/SLDT/STR/
and (these you may not recognise in ASM) all double coded
ADD/.../XOR, INC/DEC and MOV's.

But it will depend on the programmers taste,
which instructions may be seen useful or not.

| > Why is windoze that bloated?
| > When Billy started coding, programmers were paid per Kbyte.
| :-)) That's funny :-))
Yeah, funny. But unfortunately true.
__
wolfgang



Relevant Pages

  • Re: Cost of calling a standard library function
    ... > sense, since push Allocates memory, and pop deallocates it. ... Hence, all the CPU does is, basically: ... so forth...it's even possible to get "free" instructions (effectively ... what else is an ASM coder's job? ...
    (alt.lang.asm)
  • Re: amd64 cpu_switch in C.
    ... It has a few more branches than the in cvs asm version and the same number of extra branches as peter's asm version to support conditional gs/fsbase setting. ... It's worth noting that my C version is slower in some cases other than the microbenchmark due to extra instructions for optimizations that don't matter. ... the branch predictions fit in the branch prediction cache ... you have to load cr3 even for kernel threads because the page directory page or page directory pointer table at %cr3 can go away once you've switched out the old thread. ...
    (freebsd-arch)
  • Re: Why There are no Asm Apps
    ... > superiority of an assembly app over a Java app in terms of speed. ... But it fully doable in asm as well as HLL, ... remember that M$ programmers are on the avarage 100 times worse than most ... and even more likely to happen then with many other assemblers. ...
    (alt.lang.asm)
  • Re: Computer time -> Developer time -> User time?
    ... > del elli.com ... fulltime productions by mediocre programmers is simply wrong. ... Asm would be the best language for any form of ... Your maintainance claim is completly wrong. ...
    (alt.lang.asm)
  • Re: ASM Compiler?
    ... It is an excellent way to learn what kinds of things compilers are _bad_ at, and even more often, it is a way to learn how to write C code that your targeted compiler can turn into perfect code. ... These days I never bother with asm until I'm quite sure that I have a good basic algorithm, then I go in and write many, many snippets of asm, which often teaches me how I can translate the resulting algorithm back into portable C code. ... You can notice that there are some instructions which they are not needed. ... Do again to analyze and see if performance is improved. ...
    (comp.lang.asm.x86)