Assembly or ....

Herman Rubin cik at l.cc.purdue.edu
Tue Nov 29 07:56:11 AEST 1988


In article <8993 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
> In article <1031 at l.cc.purdue.edu> cik at l.cc.purdue.edu (Herman Rubin) writes:
> >... on the various machines I know, there are operations
> >I want to use about which the compiler knows nothing.
> 
> There are many of us who don't feel obligated to make use of every
> little whiz-bang feature that hardware designers have so thoughtfully
> provided.  Life is too short to spend it in an effort to accommodate
> hardware quirks.

But these are the natural operations (to me as the algorithm designer).
Which of them are on a given machine varies.  A machine has few operations,
and if the information were provided for a mathematician as a reader, it 
would take not 1 day but 2-3 hours to understand a machine's instructions.

I find that the designers of the various languages have not considered the
type of operations which I would want to use WITHOUT KNOWLEDGE OF THE
MACHINE.  A trivial example is having a list of results to the left of
the replacement operator.  I do not mean a vector or a struct; the items
may be of different types, and should not be stored in adjacent memory
locations.  Most of the time, they should end up in registers.  I have
not seen a language which is claimed to produce even reasonably efficient
code with this property.  Some of these operations are even hardware.

Another effect of the HLL tyranny is that the operations which are beyond
the ken of th HLL designers are disappearing from the machines.  Other
useful operations are not getting in.  For example, suppose we want to
divide a by b, obtaining an integer result i and a remainder c.  I know
of no machine with this instruction, and this is not that unusual an 
instruction to demand.  It is cheap in hardware, and extremely expensive
in software--at least 4 instructions.

-- 
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907
Phone: (317)494-6054
hrubin at l.cc.purdue.edu (Internet, bitnet, UUCP)



More information about the Comp.lang.c mailing list