From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9df86889c0a8a237 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1051a8,9df86889c0a8a237 X-Google-Attributes: gid1051a8,public X-Google-Thread: 102b75,9df86889c0a8a237 X-Google-Attributes: gid102b75,public X-Google-ArrivalTime: 1991-05-28 23:58:18 PST Path: gmdzi!unido!mcsun!uunet!elroy.jpl.nasa.gov!decwrl!netcomsv!craig From: craig@netcom.COM (Craig Hansen) Newsgroups: comp.arch,comp.sys.mips,comp.sys.dec Subject: Re: The MIPS EXECUTE instruction Summary: Sorry, Gene, it doesn't work... Message-ID: <1991May28.184617.11319@netcom.COM> Date: 28 May 91 18:46:17 GMT References: <1991May27.184311.11596@zeno.mn.org> Followup-To: comp.arch,comp.sys.mips,comp.sys.dec Organization: Netcom - Online Communication Services UNIX System {408 241-9760 guest} Xref: gmdzi comp.arch:68791 comp.sys.mips:1390 comp.sys.dec:24416 In article <1991May27.184311.11596@zeno.mn.org>, gene@zeno.mn.org (Gene H. Olson) writes: > Looking through all the documentation I have been able to find > on the MIPS processor (Including Gerry Kane's book) I haven't > found a rule about putting a branch in a branch delay slot. > > There is a very definite rule about doing this in the SPARC > architecture, probably because its not very useful, and may > have terrible implications in restarting instructions and so on. > > So I tried to figure why MIPS has not excluded this particular > combination. The sequence you describe will work on an HP-PA (Precision, Spectrum) machine, but not a MIPS machine. The reason is will not work is that I only put one exception PC on the MIPS architecture, where the HP-PA has a queue of PC. This means that if an exception were to occur between the two adjacent branches, the machine state cannot be recreated after handling the exception. This includes I/O interrupts, so in general, two adjacent branches do not produce an architecturally definite result. Also, the target of a conditional branch is computed via an offset from the address of the dynamically following instruction, so placing a conditional branch in a branch delay slot is a tricky proposition. The only potentially safe combination is to place a conditional branch in the delay slot of another conditional branch, provided that the conditions are mutually exclusive. I don't recall clearly, but even this combination may have been excluded via the ReservedInstruction exeception...if not, perhaps it should! Regards, Craig Hansen craig@microunity.com