Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!rochester!kodak!elmgate!jdg From: jdg@elmgate.UUCP Newsgroups: comp.sys.amiga Subject: Re: Manx C Message-ID: <708@elmgate.UUCP> Date: Sat, 15-Aug-87 17:15:18 EDT Article-I.D.: elmgate.708 Posted: Sat Aug 15 17:15:18 1987 Date-Received: Sun, 16-Aug-87 10:14:36 EDT References: <4540@jade.BERKELEY.EDU> <1836@vax135.UUCP> Reply-To: jdg@aurora.UUCP (Jeff Gortatowsky) Organization: Eastman Kodak Company, Rochester, NY Lines: 42 Keywords: type coercion, optimization In article <4524@videovax.Tek.COM> stever@videovax.Tek.COM (Steven E. Rice, P.E.) writes: [ ALL SORTS OF TEXT DELETED ] > >But, when the optimizer (or for that matter, the compiler) sees it is >generating a "movea.l ,Ax" / "cmp.l #0,Ax" sequence, it can >immediately delete the "cmp" instruction, because the 68000 sets the ^^^^^^^^^^^^^^^^^^^^^^^^^^ >condition codes when the register is loaded. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Steve Rice > >----------------------------------------------------------------------------- >new: stever@videovax.tv.Tek.com >old: {decvax | hplabs | ihnp4 | uw-beaver | cae780}!tektronix!videovax!stever I'm sure many will point this out, but technically your wrong: Page 115 Of the "MC68000 16/32 Bit Microprocessor Prgrammers R Reference Manual Fourth edition", shows the MOVEA ,An instruction does not effect the condition codes. No big deal of course, use a data register instead: MOVE.L _ptr, BEQ Somelabel Also having spent a bit of time looking into optimizing C compilers, the data flow section must determine if it is wiser to generate the move to the data register or to do the cmp instruction. If the data register has to be spilled to accomodate the faster test for zero the *OVERALL* effect may slow the code down . This assumes that optimizer has already determined what's in Dn "DESERVES" a data register all it's own, or it could be that it has delayed it's storage. Sorry for ramblin' but I find the subject of true optimizing compilers interesting for reasons I won't go into..... -- Jeff Gortatowsky {seismo,allegra}!rochester!kodak!elmgate!jdg Eastman Kodak Company These comments are mine alone and not Eastman Kodak's. How's that for a simple and complete disclaimer?