Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site frog.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!cybvax0!frog!john From: john@frog.UUCP (John Woods) Newsgroups: net.micro.68k,net.arch,net.micro.16k Subject: Re: RISC (Really NS32000 density stats) Message-ID: <195@frog.UUCP> Date: Wed, 12-Jun-85 12:25:41 EDT Article-I.D.: frog.195 Posted: Wed Jun 12 12:25:41 1985 Date-Received: Fri, 14-Jun-85 00:29:08 EDT References: <639@vax2.fluke.UUCP> <2743@nsc.UUCP> <576@terak.UUCP> <611@lll-crg.ARPA> <591@terak.UUCP> <5673@utzoo.UUCP> <810@mako.UUCP> Organization: Charles River Data Systems, Framingham MA Lines: 48 Xref: watmath net.micro.68k:905 net.arch:1375 net.micro.16k:337 > In article <5673@utzoo.UUCP> henry@utzoo.UUCP (Henry Spencer) writes: > >Also, don't be too sure that the 68* and 32* chips use 16-bit instructions > >a lot. Remember that things like offsets take extra bytes... >In my experience 16 bit instructions get used quite often on the NS32000 in >well written assembly code. The NS32000 has an edge over the MC68000 in code >density in that instructions need not be word-aligned. Henry is correct in >stating that offsets are used on virtually every memory reference, but those >offsets are usually 8 bits. Following is some statistics for one module >pulled at random from my present project. The code is highly optimized for >speed, so code density is not even as good as it should be, i.e. "jump" is >used instead of "br", saving one clock, but costing two bytes, etc. > Size Count Size Count > 8 0 16 14 > 24 13 32 1 > 40 0 48 2 > Total 30 Ave 22.1 bits per instruction. >The average instruction size of 22.1 bits is indeed more than the 16 bits the >original poster assumed, but much less than the 32 bits Henry expected, due >in large part to the large number of 24 bit instructions available on the >NS32000. I believe the MC68000 would have a larger number of 32 bit >instructions with the consequent increase in average bits-per-instruction. > I counted words for some random compiled code here for the 68000 (the famous Knight's Tour, which I still have lying around). Size (bytes) 2 4 6 8 Sample 1: 23 4 3 0 Average 21.3 bits / 30 main() Sample 2: 18 7 4 0 Average 23.4 bits instr. try() The Greenhills compiler tries to make good use of registers. On the other hand, I don't know how much these instructions actually accomplished. I wouldn't be surprised to find that the 32?32 does more with those 22 bits per instruction, but I wouldn't be horribly shocked to find that the 68000 does more [despite my employer, I am a closet 32032 fan, by the way- it is almost as nice as the PDP-11 !-) ]. I suppose the true lesson is that "bits per instruction" is yet another Red Herring in Heavy Oil: a computer with 64 bit instructions would have "poor" "code density", but if one of those instructions was "Solve the (reg0)x(reg0) Knight's Tour and output the table to channel (reg1)", the program would be awfully short !-). -- John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101 ...!decvax!frog!john, ...!mit-eddie!jfw, jfw%mit-ccc@MIT-XX.ARPA Five tons of flax!