force a test to be emitted if the source is a register; more tahoe
architecture grot...
SCCS-vsn: old/pcc/ccom.tahoe/local2.c 1.29
-static char sccsid[] = "@(#)local2.c 1.28 (Berkeley) %G%";
+static char sccsid[] = "@(#)local2.c 1.29 (Berkeley) %G%";
#endif
# include "pass2.h"
#endif
# include "pass2.h"
* ignored and the high bits of the source are copied. (Note
* that zero-extension is not a problem for immediate
* constants.)
* ignored and the high bits of the source are copied. (Note
* that zero-extension is not a problem for immediate
* constants.)
+ * Another problem -- condition codes for a conversion with a
+ * register source reflect the source rather than the destination.
*/
sconv(p, forcc)
NODE *p;
*/
sconv(p, forcc)
NODE *p;
}
genconv(ISUNSIGNED(srctype),
srclen, dst->in.op == REG ? SZINT/SZCHAR : dstlen,
}
genconv(ISUNSIGNED(srctype),
srclen, dst->in.op == REG ? SZINT/SZCHAR : dstlen,
tmp->tn.op = OREG;
tmp->tn.lval = srclen - dstlen;
}
tmp->tn.op = OREG;
tmp->tn.lval = srclen - dstlen;
}
- genconv(ISUNSIGNED(dsttype), dstlen, SZINT/SZCHAR, tmp, dst);
+ genconv(ISUNSIGNED(dsttype), dstlen, SZINT/SZCHAR, tmp, dst, forcc);
tmp->in.op = FREE;
return;
}
genconv(neg ? -1 : ISUNSIGNED(dsttype),
srclen, dst->in.op == REG ? SZINT/SZCHAR : dstlen,
tmp->in.op = FREE;
return;
}
genconv(neg ? -1 : ISUNSIGNED(dsttype),
srclen, dst->in.op == REG ? SZINT/SZCHAR : dstlen,
-genconv(srcflag, srclen, dstlen, src, dst)
+genconv(srcflag, srclen, dstlen, src, dst, forcc)
int srcflag;
register int srclen, dstlen;
NODE *src, *dst;
int srcflag;
register int srclen, dstlen;
NODE *src, *dst;
{
if (srclen != dstlen) {
if (srcflag > 0 && srclen < dstlen)
{
if (srclen != dstlen) {
if (srcflag > 0 && srclen < dstlen)
adrput(src);
putchar(',');
adrput(dst);
adrput(src);
putchar(',');
adrput(dst);
+
+ /*
+ * This hack is made necessary by architecture problems
+ * described above
+ */
+ if (forcc && src->in.op == REG && srclen > dstlen) {
+ putstr("\n\ttst");
+ prlen(dstlen);
+ putchar('\t');
+ adrput(dst);
+ }
}
rmove( rt, rs, t ) TWORD t; {
}
rmove( rt, rs, t ) TWORD t; {