Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!haven!vrdxhq!daitc!bms-at!stuart From: stuart@bms-at.UUCP (Stuart Gathman) Newsgroups: comp.arch Subject: RISC and emulated languages Message-ID: <158@bms-at.UUCP> Date: 26 Apr 89 17:05:04 GMT Organization: Business Management Systems, Inc., Fairfax, VA Lines: 28 There is one interesting feature of RISC architecture that I haven't seen mentioned much: the fact that an emulated/interpreted program will often run faster than a compiled one. I first noticed this in benchmark results for the ARM where BASIC ran the benchmarks faster than C! The conditions necessary for this to take place are: 1) the system uses slow main memory with a high speed cache. 2) the emulated code is significantly smaller than equivalent direct code. 3) the emulator mostly fits in the cache. 4) the emulator overhead is low enough not to swamp the benefits of 2. The most effective emulators are "semi-compiled", i.e. variable references and branch targets are resolved prior to execution. Table searches will kill condition 4. RM-cobol would be a typical example of an emulator meeting these conditions. (The interpreter is large, but the core routines are small.) This approach turns a RISC machine into a CISC machine with user defined microcode. Unlike loadable microcodes of yesteryear, the cache is swapped by line on a demand basis. -- Stuart D. Gathman <..!{vrdxhq|daitc}!bms-at!stuart>