Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site basser.SUN Path: utzoo!watmath!clyde!floyd!whuxle!mit-eddie!genrad!decvax!mulga!munnari!basser!chris From: chris@basser.SUN (Chris Maltby) Newsgroups: net.bugs.4bsd Subject: Re: 4.[12] Vax pcc generates bad code for real comparisons Message-ID: <259@basser.SUN> Date: Fri, 6-Apr-84 14:48:25 EST Article-I.D.: basser.259 Posted: Fri Apr 6 14:48:25 1984 Date-Received: Sat, 7-Apr-84 04:40:06 EST References: <6728@decwrl.UUCP> Organization: Dept of C.S., University of Sydney Lines: 38 x - marks the spot Here is a better fix to pcc for the problem described by Jeff of DEC western research labs. The real code generation problem is that the result of the cvtfd instruction can't be shared with its 'float' source. Of course, the double intermediate value needs 2 AREGS. In fact, the second table entry is unnecessary, as there is a rewrite rule which will convert the left operand to double (correctly) and then compare it. I leave it here mostly to keep the linenumbers right (and in case I overlooked something). ====== "table.c" line 228 - 238 OPLOG, FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TFLOAT, - NAREG|NASR, RESCC, " cvtfd AR,A1\n cmpd AL,A1\nZP", OPLOG, FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, - NAREG|NASL, RESCC, " cvtfd AL,A1\n cmpd A1,AR\nZP", ====== OPLOG, FORCC, SAREG|AWD, TDOUBLE, SAREG|AWD, TFLOAT, + 2*NAREG, RESCC, " cvtfd AR,A1\n cmpd AL,A1\nZP", OPLOG, FORCC, SAREG|AWD, TFLOAT, SAREG|AWD, TDOUBLE, + 2*NAREG, RESCC, " cvtfd AL,A1\n cmpd A1,AR\nZP", ======