Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!eru!luth!sunic!mcsun!hp4nl!fwi.uva.nl!beemster From: beemster@fwi.uva.nl (Marcel Beemster) Newsgroups: comp.arch Subject: Re: RISC hard to program? Message-ID: <1145@carol.fwi.uva.nl> Date: 18 Jul 90 08:27:36 GMT References: <40088@mips.mips.COM> <2162@opus.cs.mcgill.ca> <3648@auspex.auspex.com> <2163@opus.cs.mcgill.ca> Sender: news@fwi.uva.nl Lines: 29 peterd@opus.cs.mcgill.ca (Peter Deutsch) writes: >[I want no alignment restrictions] (Sorry Peter, I had to shorten it a little.) But do you also want to pay for it? As an example take the 68040. Suppose it has to load the following misaligned Long Word: Address Data $0 xLLL $4 Lxxx To load this Long Word starting at address $1, it actually does 3 memory cycles (assuming cache miss). The first one to load: $0 xLxx, Reading a byte. The second one loads: $0 xxLL, Reading a word. And the third one to load: $1 Lxxx, Reading the last byte. If you don't believe me, check Section 8.2.1, page 8.8, Fig 8.4 of the user manual. I guess they couldn't afford the smarter way (out of microcode or something like that). And no, the second read of $0 will not be a cache hit. Now the question is, if you as a programmer know how misaligned access is going to cost precious memory cycles, are you going to avoid them? I know I do, and find the (software development) cost not that high. ++marcel beemster@fwi.uva.nl "So, they destroyed their planet. Why?" "That was better for the economy."