Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!microsoft!w-colinp From: w-colinp@microsoft.UUCP (Colin Plumb) Newsgroups: comp.arch Subject: Re: quest for breakthroughs (long) Message-ID: <730@microsoft.UUCP> Date: 24 Feb 89 04:26:23 GMT References: <740@tetons.UUCP> <76700068@p.cs.uiuc.edu> <671@oracle.oracle.com> Reply-To: w-colinp@microsoft.uucp (Colin Plumb) Organization: very little Lines: 27 csimmons@oracle.UUCP (Charles Simmons) wrote: > [The desired code was]: > > nor $temp, $a, $b > and $c, $c, $temp > > The actual code generated [by the MIPS compiler] was: > > or $temp, $a, $b > nor $temp, $temp, $0 > and $c, $c, $temp > > Since the 'nor' instruction doesn't directly map into the C language, > I didn't really expect the compiler to handle this minor special case.) Really? I do. Since the sequence "or $c, $a, $b; not $c, $c" is exactly equivalent to "nor $c, $a, $b" and easily recognised by a peephole optimiser. If the code generator frequently uses extra temporary registers (say the first sequence ends in "not $d, $c"), you have to complicate this by checking to see if $c is dead after this point, but I expect MIPS have already fixed this. Well, guys? Have you? :-) -- -Colin (uunet!microsoft!w-colinp) "Don't listen to me. I never do."