Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!pioneer!lamaster From: lamaster@pioneer.arpa (Hugh LaMaster) Newsgroups: comp.arch Subject: Re: What should be in hardware but isn' Message-ID: <2910@ames.arpa> Date: Mon, 28-Sep-87 21:17:36 EDT Article-I.D.: ames.2910 Posted: Mon Sep 28 21:17:36 1987 Date-Received: Wed, 30-Sep-87 00:58:24 EDT References: <581@l.cc.purdue.edu> <28200048@ccvaxa> Sender: usenet@ames.arpa Reply-To: lamaster@ames.UUCP (Hugh LaMaster) Organization: NASA Ames Research Center, Moffett Field, Calif. Lines: 40 In article <28200048@ccvaxa> aglew@ccvaxa.UUCP writes: > > important. Say that I do have a code that needs to count the number > of set bits in a bitstring, and it already uses a POP function. > Well, I can simply replace the POP function by my POP instruction, > can't I? Unfortunately, most $%^^#@!!! languages do not let you; > you either have to wrap the POP instruction in a function call, > which loses most of it's benefit, or you have to use asms after > putting stuff into register variables that you *KNOW* the compiler > maps to R7 and R6... Not good either way. > It would be nice if the compiler could be made to know about every > instruction in the machine, even though it didn't generate code > for them; it would be nice if you could say As described, it is semi-machine-independent. This is hard to do. But, there have been compilers that let you put instructions in in a machine dependent way. This is a nice compromise with assembly language code, because most of the time you can let the compiler do the work. The Cyber 205 has a set of "Q8" calls, so called because they look like Q8MERGE say to use a "MERGE" instruction. The compiler uses program names to generate the addresses: e.g. CALL MERGE(A,B,C) so you don't have to do anything wierd to get the address. It is a nice feature, as long as it doesn't encourage the compiler writer to get lazy. ("Well, I won't bother to recognize that special case and generate the "MERGE" instruction, because if someone really needs it they can call it directly.") I wish more compilers had this feature; it eliminates the need for a lot of assembly language coding. (Or speeds up the process, depending on how you look at it.) Hugh LaMaster, m/s 233-9, UUCP {topaz,lll-crg,ucbvax}! NASA Ames Research Center ames!pioneer!lamaster Moffett Field, CA 94035 ARPA lamaster@ames-pioneer.arpa Phone: (415)694-6117 ARPA lamaster@pioneer.arc.nasa.gov (Disclaimer: "All opinions solely the author's responsibility")