Xref: utzoo comp.arch:21481 comp.lang.misc:6881 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin From: hrubin@pop.stat.purdue.edu (Herman Rubin) Newsgroups: comp.arch,comp.lang.misc Subject: Re: Unusual instructions and constructions Message-ID: <7955@mentor.cc.purdue.edu> Date: 15 Mar 91 15:13:42 GMT References: <7499@mentor.cc.purdue.edu> <2378@tuvie.UUCP> Sender: news@mentor.cc.purdue.edu Followup-To: comp.arch Lines: 46 In article <2378@tuvie.UUCP>, alex@vmars.tuwien.ac.at (Alexander Vrchoticky) writes: > hrubin@pop.stat.purdue.edu (Herman Rubin) writes: > > > Even the addition of two vectors to > > produce a result should have different C code on different machines. > > For the purposes of design diversity? Are you sure you did not want to > type `machine' instead of `C' there? My statement is correct as it stands. The optimal C code to add two vectors is different on different machines, strange as it may seem. The different codes do exactly the same thing, IF all one wants to do is to add the vectors. If the index has to be used, or in some other cases, one code may be better than another because of other considerations. > > But the expressions themselves will have considerable > > portability, although if the expression is unknown in the target dialect, a > > dictionary will have to be provided. > > Was hat man im Zusammenhang mit Compilertechnologie unter einem `Dictionary' > zu verstehen? Unter `Portabilitaet von Ausdruecken'? > > [sorry, i could not resist :-)] Ich verstehe Deutsch, aber nicht sehr gut. A human has little difficulty in translating between two computer languages, and not too much problem between "natural" languages. Computer programs seem to have much more of a problem. I have relatively little difficulty in translating between mathematical constructions and HLL or machine constructions, but the current communication channels lack the flexibility for even fairly efficient compilers to take over. The compiler writer has provided the translation between x = y-z and machine code in such a way that the compiler can take into account types, locations, etc., in producing good code. The same type of translation should be available for other constructs. If a programmer must make the detailed translation, or even does this for reasons of efficiency, in each case, the language designers and architects will not see the uses of the constructs. If the programmer instead can use the dictionary, the construct is apparent, rather than its expansion, which is likely to mean little. How many would recognize the code for B'A^(-1)C, A positive definite, without expecting that to be done? -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet) {purdue,pur-ee}!l.cc!hrubin(UUCP)