Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!decwrl!sun!gnu From: gnu@sun.uucp (John Gilmore) Newsgroups: net.arch Subject: Re: 16032 code generation Message-ID: <2358@sun.uucp> Date: Thu, 27-Jun-85 05:42:28 EDT Article-I.D.: sun.2358 Posted: Thu Jun 27 05:42:28 1985 Date-Received: Sat, 29-Jun-85 23:42:25 EDT References: <254@greipa.UUCP> Organization: Sun Microsystems, Inc. Lines: 27 Paul Vixie, {pyramid,dual,decwrl}!greipa!paul, said: > The above code is not very pretty nor efficient. In each case I have done > five operations: move, multiply, add, add, move. The only real difference > is in the addressing modes; this seems common of compiler-generated code. Funny, I noticed a lot of differences in the opcodes too. Could it be that the compilers are not using the instruction set orthagonally because you can produce better code if you use a few special cases (e.g. "index"), or because the machine doesn't exactly implement the language (e.g. sign-extension instructions need to be added)? In both cases, the argument that the compiler can be simple has broken down. > I don't remember an external or frame-relative addressing mode; one assumes > that the many otherwise useless address registers will be used to hold the > current global and frame pointers, and the loader has alot of fixing up to > do on those globals - every reference needs modification, not just an extern > table (unless you plan to have your compiler generate enough low-level stuff > to do what the 32xxx external addressing mode does automagically). Typical 68000 loaders&compilers generate code just like for most other machines (eg pdp11, vax, 360, ...) and do "alot of fixing up" -- at link time, rather than at execution time. (When you buy Unix, even the Bell versions, it already knows how to do this.) The 16032 lets you do it either way, but it costs a lot of cycles to do it at run time. The 68000 requires careful compilers generating extra instructions to do runtime linking efficiently. The new expensive 68020 addressing modes let you simulate the 16032's expensive external modes if you really want.