Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.programmer Subject: Re: Mike Farren tutorial Message-ID: <20440@cbmvax.commodore.com> Date: 7 Apr 91 06:53:06 GMT References: <1991Apr7.000920.25630@watdragon.waterloo.edu> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 42 In article <1991Apr7.000920.25630@watdragon.waterloo.edu> ccplumb@rose.uwaterloo.ca (Colin Plumb) writes: >dillon@overload.Berkeley.CA.US (Matthew Dillon) wrote: >> The 1.3 OS was compiled with greenhills, I believe, which is a pretty >> good compiler. >Not to detract from your point, but I stepped through some of the >graphics.library code the other day and the quality makes me nauseous. >One particularly memorable part in ScrollVPort: > moveq #0,d0 > move.w offset(a2),d0 ; ViewPort->Modes, I recall... > move.l d0,d1 > moveq #0,d0 > move.w offset2(a2),d0 > (play with d1 a bit) > move.w d1,offset3(a3) > >Now, if the cast to 32 bits is in the source code, I admit it's a bit hard >for a compiler to look and see that it's not necessary. But if it's not, >it's pretty inexcusable to extend everything to 32 bits. And extending in >d0 and then moving to d1 so you can clobber d0 again... well, I'm disgusted. Note that graphics (and intuition) are the two main modules still in Greenhills. Greenhills was a reasonable compiler for ~1984, it's well below modern compilers, including SAS (especially with SAS's amiga-specific stuff - I would have hated to do Dos in Greenhills, since it needs it's args in d1,d2, etc). We consider graphics the next place we can reclaim large amounts of ROM space (with a bunch of work - note that Chris Green, the person who put forward the idea at Washington Devcon that the entire OS should be recoded in ASM, is now a senior graphics programmer here, as of a month or so ago). And I suspect it was promoting those values to ints (32-bit). However, it's possible that a good peephole optimizer, or really good global optimizer might be able to eliminate the extra instructions there. -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup Disclaimer: Nothing I say is anything other than my personal opinion. Thus spake the Master Ninjei: "To program a million-line operating system is easy, to change a man's temperament is more difficult." (From "The Zen of Programming") ;-)