Path: utzoo!utgpu!watserv1!watmath!att!rutgers!usc!samsung!uunet!motcid!wallach From: wallach@motcid.UUCP (Cliff H. Wallach) Newsgroups: comp.arch Subject: Re: Micrprocessor Forum Advance Program Message-ID: <4073@avocado5.UUCP> Date: 13 Jul 90 23:03:00 GMT References: <31530@cup.portal.com> Organization: Motorola Inc. - Cellular Infrastructure Div., Arlington Heights, IL 60004 Lines: 73 In article <40052@mips.mips.COM> Mashey writes: >Since this discussion pops up here every 6-9 months, maybe it's worth >a shot at some generalizations, to put some structure around the >flood of anecdotal examples and counter-examples. >First MY anecdote: I wrote all of the C string library in assembler for >the R2000 a long while back, because you ALWAYS do that when you do a new >UNIX. THEN, after looking at the generated code from the standard C functions, >we threw out most of the assmebly code, because the compiler was good >enough that it wasn't worth QAing the assembly code. Typically there is a learning curve... Has anyone immersed themselves in R2000 assembly and then written the C string library? >Generalizations: the following factors will encourage one to use >assembly code (left) or compiled code (right). I think most of the >anecdotes so far fit at least one of these. The interesting questions are: >1) Are there more good genralizations? >2) What kind of experiments can be done to quantify these more specifically? > >ASSEMBLER COMPILER >1. Old, non-optimizing compiler Modern, global optimizer, at least > In scientific world, vectorizer/parallizer > if appropriate. >2. Architecture/language mismatch Architecture/language well matched > > 2a. Architecture weird > 2b. Language not expressive enough > > >3. One architecture target, forever Portability > > (as in some embedded) (as in UNIX commands) > >4. Absolute speed requirement Premium on development cost, maintenance > >5. Absolute space requirement Space costs, but no hard, low limit > >6. Programming time is cheap Programming time is not cheap 7. A competitive environment 8. Easier to debug. Improved algorithms are independent of the language used. Assembly language provides a constant improvement over hll. It is commonly claimed that compiler code is almost as fast as assembler. It is also common for vendors to claim that this years compiler generates faster code than last years compiler. Cliff Wallach ...uunet!motcid!wallach filler more filler and more filler and still more filler