utah rcsid 1.7 87/06/25 15:42:14: Spot sequences like 'cvtbl 4(ap),r0;
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 12 Dec 1987 12:16:23 +0000 (04:16 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 12 Dec 1987 12:16:23 +0000 (04:16 -0800)
movzbl r0,-4(fp)' in which the initial conversion is made redundant by a
subsequent one.

SCCS-vsn: old/pcc/c2.vax/c21.c 4.21

usr/src/old/pcc/c2.vax/c21.c

index 54bcc52..029e654 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)c21.c 4.20 %G%";
+static char sccsid[] = "@(#)c21.c 4.21 %G%";
 #endif
 /* char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22 JFR"}; /* sccs ident */
 
 #endif
 /* char C21[] = {"@(#)c21.c 1.83 80/10/16 21:18:22 JFR"}; /* sccs ident */
 
@@ -19,7 +19,7 @@ int bitsize[] = {     /* index by type codes */
        8,              /* 1    BYTE */
        16,             /* 2    WORD */
        32,             /* 3    LONG */
        8,              /* 1    BYTE */
        16,             /* 2    WORD */
        32,             /* 3    LONG */
-       32,             /* 4    FFLOAT /
+       32,             /* 4    FFLOAT */
        64,             /* 5    DFLOAT */
        64,             /* 6    QUAD */
        0,              /* 7    OP2 */
        64,             /* 5    DFLOAT */
        64,             /* 6    QUAD */
        0,              /* 7    OP2 */
@@ -577,6 +577,12 @@ register struct node *p;
        struct node *olduse=0;
        splitrand(p);
        if (p->op!=PUSH && p->subop && 0<=(r=isreg(lastrand)) && r<NUSE && uses[r]==p->forw) {
        struct node *olduse=0;
        splitrand(p);
        if (p->op!=PUSH && p->subop && 0<=(r=isreg(lastrand)) && r<NUSE && uses[r]==p->forw) {
+       if ((p->op==CVT || p->op==MOVZ)
+               && (p->forw->op==CVT || p->forw->op==MOVZ)
+               && p->forw->subop&0xf
+               && compat(p->subop,p->forw->subop)
+               && !source(cp1=regs[RT1])
+               && !indexa(cp1)) goto movit;
        if (equtype(p->subop,regs[r][0])
        || ((p->op==CVT || p->op==MOVZ)
                         && 0xf&regs[r][0] && compat(0xf&(p->subop>>4),regs[r][0]))) {
        if (equtype(p->subop,regs[r][0])
        || ((p->op==CVT || p->op==MOVZ)
                         && 0xf&regs[r][0] && compat(0xf&(p->subop>>4),regs[r][0]))) {