home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!mcsun!sunic!kth.se!dront.nada.kth.se!d88-jwa
- From: d88-jwa@dront.nada.kth.se (Jon WΣtte)
- Subject: Re: Proper way to do Self-Modifying code?
- Message-ID: <1993Jan5.202543.14793@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: dront.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <wfFp_jO00WB707kGgq@andrew.cmu.edu> <1993Jan5.183337.20064@gallant.apple.com>
- Date: Tue, 5 Jan 1993 20:25:43 GMT
- Lines: 43
-
- In <1993Jan5.183337.20064@gallant.apple.com> alexr@apple.com (Alexander M. Rosenberg) writes:
-
- >Immediate move instructions are generally faster than using an address
- >register. It adds up, especially when lots of small bitmaps may be necessary.
-
- Hmm, well, I'm not convinced. Let's say you move a bitmap. Using an
- address register, you will only have to change the register. For a
- "compiled" bitmap, you would have to change each and every immediate
- move instruction. Not to mention that immediate instructions and
- longer, and thus takes more bus cycles in fetch; those bus cycles
- do also compete with the cycles spent writing to VRAM. (Some slow
- NuBus cards take 7 cycles for a longword write, but then fetching
- an 8-byte instruction instead of a 4-byte one takes 4 extra cycles
- on an LC)
-
- It all comes out in amortized performance; if the blitting has to be
- raving fast, but you have ample of time to precompute the next
- image, compiled bitmaps would be OK (except they flush the cache on
- 040s; that's bad speed-wise) but if you have general throughput
- problems, register-relative blitting is DEFINATELY the right thing
- to do.
-
- Just pass rowBytes in d0 and the address of the first pixel in
- a0, and make VERY SURE that address is longword aligned or you
- will suffer much more from misaligned writes than you will from
- the difference in register-based and immediate addressing.
-
- >The one shot compile may even be possible to do at compile time, depending on
- >the way the screen bitmap is available on the target machine. The problem with
-
- Not on the Mac, of course. However, certain other systems have
- a measly register set and the screen card (note the singularis)
- on a fixed address; I'm sure the timings you cite are for VGA
- and not for anything flexible like the mac QD device model.
-
- Cheers,
-
- / h+
-
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
- This signature is kept shorter than 4 lines in the interests of UseNet
- S/N ratio.
-