Xref: utzoo comp.lang.c++:2102 comp.lang.c:14348 comp.lang.forth:661 comp.lang.fortran:1525 comp.lang.misc:2181 comp.arch:7347 Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!cwjcc!gatech!purdue!i.cc.purdue.edu!k.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.forth,comp.lang.fortran,comp.lang.misc,comp.arch Subject: Re: Assembly or .... Message-ID: <1032@l.cc.purdue.edu> Date: 28 Nov 88 21:56:11 GMT References: <1388@aucs.UUCP> <729@convex.UUCP> <1961@crete.cs.glasgow.ac.uk> <8993@smoke.BRL.MIL> Organization: Purdue University Statistics Department Lines: 36 In article <8993@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn ) writes: > In article <1031@l.cc.purdue.edu> cik@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@l.cc.purdue.edu (Internet, bitnet, UUCP)