Path: utzoo!attcan!uunet!husc6!mailrus!iuvax!pur-ee!hankd From: hankd@pur-ee.UUCP (Hank Dietz) Newsgroups: comp.arch Subject: Re: A simple question on RISC Summary: Code replication solves this. Message-ID: <9867@pur-ee.UUCP> Date: 22 Nov 88 16:20:00 GMT References: <6544@xanth.cs.odu.edu> <75577@sun.uucp> <1618@imagine.PAWL.RPI.EDU> <11562@cup.portal.com> Organization: Purdue University Engineering Computer Network Lines: 34 In article <11562@cup.portal.com>, bcase@cup.portal.com (Brian bcase Case) writes: > > mov lower,i > > bra entry > >body foo > > add step,i > >entry cmp i,upper > > bge body > > Ok, but notice the label in the middle of the add-compare-branch sequence? > I don't think it is possible to specify the ACB instruction in a version > that has a branch destination in the middle! This is one of the points of > RISC: Hey, *I'M* the compiler, let *me* decide on the semantics of > instruction sequences. You can do the same thing by simply replicating the test code above the loop rather than jumping into the loop. It's a smidge harder to do, but it isn't *that* hard, and it works even if the branching-backward loop becomes a single instruction. The example would become: mov lower,i cmp i,upper ;replicated test blt skipit ;opposite condition to bge body foo add step,i cmp i,upper bge body skipit Which obviously doesn't mind having the code between body and skipit end up being a single instruction. -hankd@ee.ecn.purdue.edu PS: I'm not saying I like ACB, but you're not *my* compiler (:-).