🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: sci.image.processing
Article #803

Re: assembly vs C (was: FFTs for the 486)

#803
From: David Kastrup
Date: Mon, 14 Dec 1992 23:12
28 lines
2168 bytes
newberry@aquarius.as.arizona.edu (Mike Newberry) writes:

>One point you brought up that I forgot to mention about the Watcom C/386
>compiler is that it can pass and retrieve arguments using registers instead
>of pushing and popping the stack as per the original C standard.  That does
>save some time when your code calls a function inside a tight loop.  The
>Watcom C/386 compiler is an industrial strength package that one doesn't find
>all that often in the PC world. I understand that Metaware's compiler is
>of similar caliber but I can't speak from experience with it.
>.

One thing about the GNU compiler is that you can imbed fragments you write
yourself in assembly language in such an ingenious way into plain C code
(without calls or such), that the compiler chooses the addressing modes
best to employ in your assembly code, knows about the side effects,
and may optimize multiple use of your code away, if you tell it that
your code depends solely on the input parameters. You tell GNU as well
which registers are thrashed, and what registers CAN be used in your
instructions.

I have had the C compiler generate better code with only very short
templates than I would have done myself, because I was not as firm in
the use of addressing modes of the 386.

The GNU assembler templates are yet something I have to see surpassed
by ANY commercial compiler. Usually, IF you have a possibility of
inlining assembly code, one thing it does is throwing the optimizer
for a loop. Not so with GNU.
Technical Details
Message-ID: <dak.724374761@kaa>
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!urmel.informatik.rwth-aachen.de!kaa!dak
References: <1992Dec10.045027.8737@organpipe.uug.arizona.edu> <Bz2rKn.ByF@cantua.canterbury.ac.nz> <1992Dec11.232317.1859@organpipe.uug.arizona.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!urmel.informatik.rwth-aachen.de!kaa!dak
From: dak@kaa.informatik.rwth-aachen.de (David Kastrup)
Newsgroups: sci.image.processing
Subject: Re: assembly vs C (was: FFTs for the 486)
Message-ID: <dak.724374761@kaa>
Date: 14 Dec 92 23:12:41 GMT
References: <1992Dec10.045027.8737@organpipe.uug.arizona.edu> <Bz2rKn.ByF@cantua.canterbury.ac.nz> <1992Dec11.232317.1859@organpipe.uug.arizona.edu>
Organization: Rechnerbetrieb Informatik - RWTH Aachen
Lines: 28
NNTP-Posting-Host: kaa.informatik.rwth-aachen.de