Subject: Unsigned long compiler changes (#143) Index: lib/ccom/*, sys/types.h,inet.h, machparam.h, hostid.c 2.11BSD Description: The C compiler does not support the 'unsigned long' data type. Repeat-By: Experience and observation. Fix: SAVE YOUR OLD COMPILER EXECUTABLES!!! cp -p /lib/c0 /lib/c0.save cp -p /lib/c1 /lib/c1.save You may also wish (if you are really paranoid) to save the old compiler sources: cd /usr/src/lib mkdir ccom.save (cd ccom; tar -cf - .) | (cd ccom.save; tar -xf -) YOU MUST HAVE Patch #134 (the C runtime routines) installed before attempting to use the 'unsigned long' cability. The C compiler itself does *not* use 'unsigned long' so it is possible to create the new compiler with out the u_long arithmetic routines installed. The first patch updates the compiler itself. The next three patches modify a couple of the system include files (u_long becomes 'unsigned long' in types.h for example). The last patch fixes the hostid(1) program. NOTE: The limit on symbol length is still 8 characters. However the compiler has been modified to make it *extremely* easy to raise that limit once the assembler, linker, library archiver, etc have been rewritten. There is a total of *4* places in the entire compiler (all in 'c0') which depend on the symbol length. Unshar the file below into /tmp. Then: patch -p0 < /tmp/22 patch -p0 < /tmp/12 patch -p0 < /tmp/2 patch -p0 < /tmp/13 patch -p0 < /tmp/20 Next: cd /usr/src/lib/ccom make all make install cd /usr/src/bin make hostid install -s hostid /bin/hostid You now have a compiler present which supports the unsigned long data type. The compiler has been extensively tested. The entire source tree and kernel+networking has been recompiled and installed on my systems - no problems have been observed so far. If problems do appear they are most likely to be of the form: foo.c:123: No code table for op: 1 (83) type 6 this means the compiler recognizes the data type as unsigned long but doesn't know how to generate code for the expression. Send me the smallest possible sample program which exhibits the problem and I will fix the bug. ===========================cut here========================== #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # 22 # 12 # 2 # 13 # 20 # This archive created: Sat Jul 3 21:45:10 1993 export PATH; PATH=/bin:/usr/bin:$PATH if test -f '22' then echo shar: "will not over-write existing file '22'" else sed 's/^X//' << \SHAR_EOF > '22' Xdiff -c /usr/src/lib/ccom.old/Makefile /usr/src/lib/ccom/Makefile X*** /usr/src/lib/ccom.old/Makefile Sun May 6 14:20:48 1990 X--- /usr/src/lib/ccom/Makefile Sat Jun 12 23:24:50 1993 X*************** X*** 29,40 **** X install: c0 c1 X -mv ${DESTDIR}${LIB}/c0 ${DESTDIR}${LIB}/oc0 X -mv ${DESTDIR}${LIB}/c1 ${DESTDIR}${LIB}/oc1 X! install -s c0 ${DESTDIR}${LIB} X! install -s c1 ${DESTDIR}${LIB} X X restore: X mv ${DESTDIR}${LIB}/oc0 ${DESTDIR}${LIB}/c0 X mv ${DESTDIR}${LIB}/oc1 ${DESTDIR}${LIB}/c1 X X clean: X! rm -f *.o c0 c1 cvopt X--- 29,44 ---- X install: c0 c1 X -mv ${DESTDIR}${LIB}/c0 ${DESTDIR}${LIB}/oc0 X -mv ${DESTDIR}${LIB}/c1 ${DESTDIR}${LIB}/oc1 X! install -s c0 ${DESTDIR}${LIB}/c0 X! install -s c1 ${DESTDIR}${LIB}/c1 X X restore: X mv ${DESTDIR}${LIB}/oc0 ${DESTDIR}${LIB}/c0 X mv ${DESTDIR}${LIB}/oc1 ${DESTDIR}${LIB}/c1 X X+ lint: X+ lint -haxc -I. c0?.c > lint.c0 X+ lint -haxc -I. c1?.c > lint.c1 X+ X clean: X! rm -f *.o c0 c1 cvopt lint.c? XCommon subdirectories: /usr/src/lib/ccom.old/TEST and /usr/src/lib/ccom/TEST Xdiff -c /usr/src/lib/ccom.old/c0.h /usr/src/lib/ccom/c0.h X*** /usr/src/lib/ccom.old/c0.h Mon Oct 20 22:23:53 1986 X--- /usr/src/lib/ccom/c0.h Sun Jun 6 20:19:33 1993 X*************** X*** 5,17 **** X #include X X /* X! * parameters X! */ X X #define LTYPE long /* change to int if no long consts */ X #define MAXINT 077777 /* Largest positive short integer */ X #define MAXUINT 0177777 /* largest unsigned integer */ X- #define NCPS 8 /* # chars per symbol */ X #define HSHSIZ 300 /* # entries in hash table for names */ X #define CMSIZ 40 /* size of expression stack */ X #define SSIZE 40 /* size of other expression stack */ X--- 5,24 ---- X #include X X /* X! * This parameter is the _only_ one which affects the recognized length X! * of symbols. Symbol names are dynamically allocated and null terminated X! * now, the define below is the 'cutoff' or maximum length to permit. X! * X! * NOTE: there are _exactly_ 4 references to this in all of c0. There are X! * _NO_ references to it in c1. Just make sure that the value is less than X! * 79 and c1 will be oblivious to the length of a symbol name. X! */ X X+ #define MAXCPS 8 /* # chars per symbol */ X+ X #define LTYPE long /* change to int if no long consts */ X #define MAXINT 077777 /* Largest positive short integer */ X #define MAXUINT 0177777 /* largest unsigned integer */ X #define HSHSIZ 300 /* # entries in hash table for names */ X #define CMSIZ 40 /* size of expression stack */ X #define SSIZE 40 /* size of other expression stack */ X*************** X*** 52,58 **** X struct nmlist *nextnm; /* next name in chain */ X union str *sparent; /* Structure of which this is member */ X char hblklev; /* Block level of definition */ X! char name[NCPS]; /* ASCII name */ X }; X X /* X--- 59,65 ---- X struct nmlist *nextnm; /* next name in chain */ X union str *sparent; /* Structure of which this is member */ X char hblklev; /* Block level of definition */ X! char *name; /* ASCII name */ X }; X X /* X*************** X*** 155,161 **** X char filename[64]; X int opdope[]; X char ctab[]; X! char symbuf[NCPS+2]; X struct nmlist *hshtab[HSHSIZ]; X int kwhash[(HSHSIZ+LNBPW-1)/LNBPW]; X union tree **cp; X--- 162,168 ---- X char filename[64]; X int opdope[]; X char ctab[]; X! char symbuf[MAXCPS+2]; X struct nmlist *hshtab[HSHSIZ]; X int kwhash[(HSHSIZ+LNBPW-1)/LNBPW]; X union tree **cp; Xdiff -c /usr/src/lib/ccom.old/c00.c /usr/src/lib/ccom/c00.c X*** /usr/src/lib/ccom.old/c00.c Mon Oct 20 22:23:54 1986 X--- /usr/src/lib/ccom/c00.c Sat Jun 5 23:31:54 1993 X*************** X*** 134,140 **** X { X unsigned ihash; X register struct nmlist *rp; X- register char *sp, *np; X X ihash = hash(symbuf); X if (kwhash[ihash/LNBPW] & (1 << (ihash%LNBPW))) X--- 134,139 ---- X*************** X*** 142,151 **** X return(KEYW); X rp = hshtab[ihash]; X while (rp) { X! np = rp->name; X! for (sp=symbuf; sphflag&FKIND)) X goto no; X csym = rp; X--- 141,148 ---- X return(KEYW); X rp = hshtab[ihash]; X while (rp) { X! if (strcmp(symbuf, rp->name) != 0) X! goto no; X if (mossym != (rp->hflag&FKIND)) X goto no; X csym = rp; X*************** X*** 164,172 **** X rp->sparent = NULL; X rp->hblklev = blklev; X rp->hflag = mossym; X! sp = symbuf; X! for (np=rp->name; spsparent = NULL; X rp->hblklev = blklev; X rp->hflag = mossym; X! rp->name = Dblock((strlen(symbuf) + 1 + LNCPW - 1) & ~(LNCPW - 1)); X! strcpy(rp->name, symbuf); X csym = rp; X return(NAME); X } X*************** X*** 177,197 **** X findkw() X { X register struct kwtab *kp; X- register char *p1, *p2; X- char *wp; X- int firstc; X X! wp = symbuf; X! firstc = *wp; X! for (kp=kwtab; (p2 = kp->kwname); kp++) { X! p1 = wp; X! while (*p1 == *p2++) X! if (*p1++ == '\0') { X! cval = kp->kwval; X! return(1); X! } X } X- *wp = firstc; X return(0); X } X X--- 173,185 ---- X findkw() X { X register struct kwtab *kp; X X! for (kp=kwtab; kp->kwname; kp++) { X! if (strcmp(symbuf, kp->kwname) == 0) { X! cval = kp->kwval; X! return(1); X! } X } X return(0); X } X X*************** X*** 324,336 **** X X case LETTER: X sp = symbuf; X! while(ctab[c]==LETTER || ctab[c]==DIGIT) { X! if (sphtype = FUNC; X } else { X cs->hclass = STATIC; X! error("%.*s undefined; func. %.*s", X! NCPS, cs->name, NCPS, X funcsym ? funcsym->name : "(none)"); X } X *cp++ = nblock(cs); X--- 610,616 ---- X cs->htype = FUNC; X } else { X cs->hclass = STATIC; X! error("%s undefined; func. %s", cs->name, X funcsym ? funcsym->name : "(none)"); X } X *cp++ = nblock(cs); X*************** X*** 869,879 **** X char * X copnum(len) X { X! register char *s1, *s2, *s3; X X! s1 = s2 = Tblock((len+LNCPW-1) & ~(LNCPW-1)); X! s3 = numbuf; X! while (*s2++ = *s3++) X! ; X return(s1); X } X--- 855,863 ---- X char * X copnum(len) X { X! register char *s1; X X! s1 = Tblock((len+LNCPW-1) & ~(LNCPW-1)); X! strcpy(s1, numbuf); X return(s1); X } Xdiff -c /usr/src/lib/ccom.old/c01.c /usr/src/lib/ccom/c01.c X*** /usr/src/lib/ccom.old/c01.c Mon Aug 24 18:57:25 1987 X--- /usr/src/lib/ccom/c01.c Thu Jun 3 19:45:41 1993 X*************** X*** 306,313 **** X } X } X } else if (dope&RELAT) { X! if (op>=LESSEQ && (t1>=PTR||t2>=PTR||(t1==UNSIGN||t2==UNSIGN) X! && (t==INT||t==CHAR||t==UNSIGN))) X op += LESSEQP-LESSEQ; X if (cvn==ITP || cvn==PTI) X cvn = 0; X--- 306,313 ---- X } X } X } else if (dope&RELAT) { X! if (op>=LESSEQ && (t1>=PTR||t2>=PTR||(t1==UNSIGN||t1==UNLONG||t2==UNSIGN||t2==UNLONG) X! && (t==INT||t==CHAR||t==UNSIGN||t==UNLONG))) X op += LESSEQP-LESSEQ; X if (cvn==ITP || cvn==PTI) X cvn = 0; X*************** X*** 391,397 **** X if (np==NULL) X break; X namesame = 0; X! if (strncmp(p2->t.tr1->n.name, np->name, NCPS) != 0) X continue; X if ((p2->t.tr1->n.hflag&FKIND) != (np->hflag&FMOS)) X continue; X--- 391,397 ---- X if (np==NULL) X break; X namesame = 0; X! if (strcmp(p2->t.tr1->n.name, np->name) != 0) X continue; X if ((p2->t.tr1->n.hflag&FKIND) != (np->hflag&FMOS)) X continue; X*************** X*** 401,409 **** X vartypes++; X } X if (vartypes) X! error("Ambiguous structure reference for %.*s", NCPS, p2->t.tr1->n.name); X else X! werror("%.*s not member of cited struct/union", NCPS, p2->t.tr1->n.name); X return(p2); X } X X--- 401,409 ---- X vartypes++; X } X if (vartypes) X! error("Ambiguous structure reference for %s",p2->t.tr1->n.name); X else X! werror("%s not member of cited struct/union",p2->t.tr1->n.name); X return(p2); X } X X*************** X*** 499,507 **** X chkw(p, okt) X union tree *p; X { X! register int t; X X! if ((t=p->t.type)!=INT && tt.type; X X! if (t == UNLONG) X! t = LONG; X! if (t!=INT && t= coremax) { X--- 645,651 ---- X X p = treebase; X if (p==NULL) { X! error("c0 internal error: Tblock"); X exit(1); X } X if ((treebase += n) >= coremax) { X*************** X*** 727,732 **** X--- 729,735 ---- X if (p1->t.op!=CON) X return(0); X unsignf = p1->c.type==UNSIGN; X+ unsignf |= p1->c.type==UNLONG; X if (op==QUEST) { X if (p2->t.tr1->t.op==CON && p2->t.tr2->t.op==CON) { X p1->c.value = p1->c.value? p2->t.tr1->c.value: p2->t.tr2->c.value; X*************** X*** 741,746 **** X--- 744,750 ---- X return(0); X v2 = p2->c.value; X unsignf |= p2->c.type==UNSIGN; X+ unsignf |= p2->c.type==UNLONG; X } X v1 = p1->c.value; X switch (op) { Xdiff -c /usr/src/lib/ccom.old/c02.c /usr/src/lib/ccom/c02.c X*** /usr/src/lib/ccom.old/c02.c Sat Jan 31 12:18:09 1987 X--- /usr/src/lib/ccom/c02.c Thu Jun 3 19:50:57 1993 X*************** X*** 157,163 **** X np.htype = decref(realtype); X np.hsubsp++; X if (width==0 && flex==0) X! error("0-length row: %.*s", NCPS, anp->name); X o = length((union tree *)&np); X nel = (unsigned)width/o; X width = o; X--- 157,163 ---- X np.htype = decref(realtype); X np.hsubsp++; X if (width==0 && flex==0) X! error("0-length row: %s", anp->name); X o = length((union tree *)&np); X nel = (unsigned)width/o; X width = o; X*************** X*** 199,205 **** X rcexpr(*--cp); X else if (sclass==ENUMCON) { X if (s->t.op!=CON) X! error("Illegal enum constant for %.*s", NCPS, anp->name); X anp->hoffset = s->c.value; X } else X rcexpr(block(INIT,np.htype,(int *)NULL, X--- 199,205 ---- X rcexpr(*--cp); X else if (sclass==ENUMCON) { X if (s->t.op!=CON) X! error("Illegal enum constant for %s", anp->name); X anp->hoffset = s->c.value; X } else X rcexpr(block(INIT,np.htype,(int *)NULL, X*************** X*** 224,230 **** X if (flex && nel==0) { X np.hsubsp[-1] = ninit; X } else X! error("Too many initializers: %.*s", NCPS, anp->name); X nel = ninit; X } X return(nel*width); X--- 224,230 ---- X if (flex && nel==0) { X np.hsubsp[-1] = ninit; X } else X! error("Too many initializers: %s", anp->name); X nel = ninit; X } X return(nel*width); X*************** X*** 718,724 **** X for (pl=0; plnextnm) { X if (cs->hclass == ARG || cs->hclass==AREG) X! error("Not an argument: %.*s", NCPS, cs->name); X } X } X outcode("BN", SETREG, regvar); X--- 718,724 ---- X for (pl=0; plnextnm) { X if (cs->hclass == ARG || cs->hclass==AREG) X! error("Not an argument: %s", cs->name); X } X } X outcode("BN", SETREG, regvar); X*************** X*** 744,754 **** X { X register struct nmlist *cs, **lcs; X register i; X- int nnames; X X blklev--; X! nnames = 0; X! for (i=0; ihblklev > blklev X && (((cs->hflag&FLABL)==0 && cs->hclass!=EXTERN) || blklev<=0)) { X if (cs->hclass==0) X! error("%.*s undefined", NCPS, cs->name); X if (cs->hclass==EXTERN) X nameconflict(hshtab[i], cs); X *lcs = cs->nextnm; X! } else { X lcs = &cs->nextnm; X- nnames++; X- } X cs = cs->nextnm; X } X } X--- 753,764 ---- X if (cs->hblklev > blklev X && (((cs->hflag&FLABL)==0 && cs->hclass!=EXTERN) || blklev<=0)) { X if (cs->hclass==0) X! error("%s undefined", cs->name); X if (cs->hclass==EXTERN) X nameconflict(hshtab[i], cs); X *lcs = cs->nextnm; X! } else X lcs = &cs->nextnm; X cs = cs->nextnm; X } X } X*************** X*** 773,780 **** X { X X for (; ocs!=NULL; ocs = ocs->nextnm) X! if (ocs!=cs && ocs->hclass==EXTERN && strncmp(cs->name, ocs->name, 7) == 0) X! error("names %.*s and %.*s conflict", NCPS, cs->name, NCPS, ocs->name); X } X X /* X--- 769,777 ---- X { X X for (; ocs!=NULL; ocs = ocs->nextnm) X! if (ocs!=cs && ocs->hclass==EXTERN && X! strncmp(cs->name, ocs->name, MAXCPS-1) == 0) X! error("names %s and %s conflict", cs->name, ocs->name); X } X X /* Xdiff -c /usr/src/lib/ccom.old/c03.c /usr/src/lib/ccom/c03.c X*** /usr/src/lib/ccom.old/c03.c Fri Sep 21 20:18:32 1990 X--- /usr/src/lib/ccom/c03.c Thu Jun 3 19:55:51 1993 X*************** X*** 48,54 **** X for (;;) { X mosflg = isadecl? ismos: 0; X o = symbol(); X- /* v7.orig if (o==NAME && csym->hclass==TYPEDEF && tkw<0) { */ X if (o==NAME && csym->hclass==TYPEDEF) { X if (tkw >= 0) X error("type clash"); X--- 48,53 ---- X*************** X*** 78,87 **** X break; X X case LONG: X- if (unsignf) { X- werror("'unsigned long' treated as 'long'"); X- unsignf = 0; X- } X longf++; X break; X X--- 77,82 ---- X*************** X*** 122,127 **** X--- 117,124 ---- X tkw = UNSIGN; X else if (tkw==CHAR) X tkw = UNCHAR; X+ else if (tkw==LONG) X+ tkw = UNLONG; X else X error("Misplaced 'unsigned'"); X } X*************** X*** 130,135 **** X--- 127,134 ---- X tkw = DOUBLE; X else if (tkw==INT) X tkw = LONG; X+ else if (tkw==UNSIGN) X+ tkw = UNLONG; X else X error("Misplaced 'long'"); X } X*************** X*** 220,226 **** X bitoffs = savebits; X defsym = ds; X if (strp->S.ssize) X! error("%.*s redeclared", NCPS, ssym->name); X strp->S.ssize = elsize; X *memlist++ = NULL; X strp->S.memlist = (struct nmlist **)Dblock((memlist-mems)*sizeof(*memlist)); X--- 219,225 ---- X bitoffs = savebits; X defsym = ds; X if (strp->S.ssize) X! error("%s redeclared", ssym->name); X strp->S.ssize = elsize; X *memlist++ = NULL; X strp->S.memlist = (struct nmlist **)Dblock((memlist-mems)*sizeof(*memlist)); X*************** X*** 275,281 **** X abs.nextnm = 0; X abs.sparent = 0; X abs.hblklev = blklev; X! strcpy(abs.name, ""); X aptr = &abs; X } else X aptr = NULL; X--- 274,280 ---- X abs.nextnm = 0; X abs.sparent = 0; X abs.hblklev = blklev; X! abs.name = ""; X aptr = &abs; X } else X aptr = NULL; X*************** X*** 376,382 **** X if (skw==EXTERN) { X for (; dsym!=NULL; dsym = dsym->nextnm) { X if (dsym->hclass==EXTERN X! && strncmp(dsym->name, defsym->name, NCPS)==0) { X defsym = dsym; X break; X } X--- 375,381 ---- X if (skw==EXTERN) { X for (; dsym!=NULL; dsym = dsym->nextnm) { X if (dsym->hclass==EXTERN X! && strcmp(dsym->name, defsym->name)==0) { X defsym = dsym; X break; X } X*************** X*** 515,521 **** X isinit = 0; X } else if (skw==ENUM) { X if (type!=INT) X! error("Illegal enumeration %.*s", NCPS, dsym->name); X dsym->hclass = ENUMCON; X dsym->hoffset = offset; X if (isinit) X--- 514,520 ---- X isinit = 0; X } else if (skw==ENUM) { X if (type!=INT) X! error("Illegal enumeration %s", dsym->name); X dsym->hclass = ENUMCON; X dsym->hoffset = offset; X if (isinit) X*************** X*** 721,727 **** X */ X redec() X { X! error("%.*s redeclared", NCPS, defsym->name); X } X X /* X--- 720,726 ---- X */ X redec() X { X! error("%s redeclared", defsym->name); X } X X /* Xdiff -c /usr/src/lib/ccom.old/c04.c /usr/src/lib/ccom/c04.c X*** /usr/src/lib/ccom.old/c04.c Mon Oct 20 22:23:55 1986 X--- /usr/src/lib/ccom/c04.c Sun Jun 6 20:15:53 1993 X*************** X*** 211,216 **** X--- 211,217 ---- X elsz = SZFLOAT; X break; X X+ case UNLONG: X case LONG: X elsz = SZLONG; X break; X*************** X*** 330,337 **** X */ X doret() X { X- register union tree *t; X- X if (nextchar() != ';') { X register char *st; X X--- 331,336 ---- X*************** X*** 364,371 **** X { X register *ap; X register FILE *bufp; X- int n; X register char *np; X X bufp = stdout; X if (strflg) X--- 363,370 ---- X { X register *ap; X register FILE *bufp; X register char *np; X+ int n; X X bufp = stdout; X if (strflg) X*************** X*** 373,412 **** X ap = &a; X for (;;) switch(*s++) { X case 'B': X! putc(*ap++, bufp); X! putc(0376, bufp); X continue; X X case 'N': X! putc(*ap, bufp); X! putc(*ap++>>8, bufp); X continue; X X case 'F': X- n = 1000; X np = (char *)*ap++; X goto str; X X case 'S': X- n = NCPS; X np = (char *)*ap++; X if (*np) X! putc('_', bufp); X str: X! while (n-- && *np) { X! putc(*np++&0177, bufp); X } X! putc(0, bufp); X continue; X X case '1': X! putc(1, bufp); X! putc(0, bufp); X continue; X X case '0': X! putc(0, bufp); X! putc(0, bufp); X continue; X X case '\0': X--- 372,411 ---- X ap = &a; X for (;;) switch(*s++) { X case 'B': X! fputc(*ap++, bufp); X! fputc(0376, bufp); X continue; X X case 'N': X! fputc(*ap, bufp); X! fputc(*ap++>>8, bufp); X continue; X X case 'F': X np = (char *)*ap++; X+ n = 1000; X goto str; X X case 'S': X np = (char *)*ap++; X+ n = MAXCPS-1; X if (*np) X! fputc('_', bufp); X str: X! while(n-- && *np) { X! fputc(*np++ & 0177, bufp); X } X! fputc(0, bufp); X continue; X X case '1': X! fputc(1, bufp); X! fputc(0, bufp); X continue; X X case '0': X! fputc(0, bufp); X! fputc(0, bufp); X continue; X X case '\0': X*************** X*** 421,440 **** X } X } X X! unsigned X hash(sp) X register char *sp; X { X! register unsigned h; X! register c; X X h = 0; X! c = 7; X! do { X! if (*sp == 0) X! break; X h += h; X! h += *sp++; X! } while (--c != 0); X return(h%HSHSIZ); X } X--- 420,435 ---- X } X } X X! unsigned int X hash(sp) X register char *sp; X { X! register unsigned int h; X X h = 0; X! for (; *sp; sp++) { X h += h; X! h += *sp; X! } X return(h%HSHSIZ); X } Xdiff -c /usr/src/lib/ccom.old/c05.c /usr/src/lib/ccom/c05.c X*** /usr/src/lib/ccom.old/c05.c Mon Oct 20 22:23:55 1986 X--- /usr/src/lib/ccom/c05.c Tue Mar 30 16:15:09 1993 X*************** X*** 123,129 **** X 000000, /* 107 */ X 000000, /* 108 */ X 000000, /* char->int */ X! 000000 /* force r0 */ X }; X X /* X--- 123,149 ---- X 000000, /* 107 */ X 000000, /* 108 */ X 000000, /* char->int */ X! 000000, /* 109 - force r0 */ X! 000000, /* 110 */ X! 000000, /* 111 */ X! 000000, /* 112 */ X! 000000, /* 113 */ X! 000000, /* 114 */ X! 000000, /* 115 */ X! 000000, /* 116 */ X! 000000, /* 117 */ X! 000000, /* 118 */ X! 000000, /* 119 */ X! 000000, /* 120 */ X! 000000, /* 121 */ X! 000000, /* 122 */ X! 000000, /* 123 */ X! 000000, /* 124 */ X! 000000, /* 125 */ X! 000000, /* 126 */ X! 000000, /* 127 */ X! 026061, /* 128 - << unsigned long */ X! 012253 /* 129 - <<= unsigned long */ X }; X X /* Xdiff -c /usr/src/lib/ccom.old/c1.h /usr/src/lib/ccom/c1.h X*** /usr/src/lib/ccom.old/c1.h Sun Feb 15 19:22:57 1987 X--- /usr/src/lib/ccom/c1.h Thu Jun 3 08:13:40 1993 X*************** X*** 6,12 **** X #include X X #define LTYPE long /* change to int for no long consts */ X- #define NCPS 8 /* must match c0.h */ X #define NULL 0 X #define TNULL (union tree *)NULL X #define UNS(x) ((unsigned short)(x)) X--- 6,11 ---- X*************** X*** 43,49 **** X char class; X char regno; X int offset; X! char name[NCPS]; X }; X X /* X--- 42,48 ---- X char class; X char regno; X int offset; X! char *name; X }; X X /* X*************** X*** 303,308 **** X--- 302,316 ---- X #define UMOD 118 X #define ASUDIV 119 X #define ASUMOD 120 X+ #define ULTIMES 121 /* present for symmetry */ X+ #define ULDIV 122 X+ #define ULMOD 123 X+ #define ULASTIMES 124 /* present for symmetry */ X+ #define ULASDIV 125 X+ #define ULASMOD 126 X+ #define ULTOF 127 X+ #define ULLSHIFT 128 /* << for unsigned long */ X+ #define UASLSHL 129 /* <<= for unsigned long */ X X #define BDATA 200 X #define PROG 202 Xdiff -c /usr/src/lib/ccom.old/c10.c /usr/src/lib/ccom/c10.c X*** /usr/src/lib/ccom.old/c10.c Wed Oct 9 14:13:50 1991 X--- /usr/src/lib/ccom/c10.c Thu Jun 3 20:28:39 1993 X*************** X*** 1,16 **** X- # X /* X- X C compiler, part 2 X- X */ X X #include "c1.h" X X- #define dbprint(op) /* */ X #ifdef DEBUG X #define dbprint(op) printf(" / %s", opntab[op]) X #endif X X char maprel[] = { EQUAL, NEQUAL, GREATEQ, GREAT, LESSEQ, X LESS, GREATQP, GREATP, LESSEQP, LESSP X--- 1,15 ---- X /* X C compiler, part 2 X */ X X #include "c1.h" X X #ifdef DEBUG X #define dbprint(op) printf(" / %s", opntab[op]) X+ #else X+ #define dbprint(op) /* */ X #endif X+ int debug; X X char maprel[] = { EQUAL, NEQUAL, GREATEQ, GREAT, LESSEQ, X LESS, GREATQP, GREATP, LESSEQP, LESSP X*************** X*** 330,338 **** X /* X * Longs need special treatment. X */ X case ASLSH: X case LSHIFT: X! if (tree->t.type==LONG) { X if (tree->t.tr2->t.op==ITOL) X tree->t.tr2 = tree->t.tr2->t.tr1; X else X--- 329,354 ---- X /* X * Longs need special treatment. X */ X+ case ASULSH: /* 18 */ X+ case ULSH: /* 17 */ X+ if (tree->t.type != UNLONG) X+ break; X+ if (tree->t.tr2->t.op==ITOL) X+ tree->t.tr2 = tree->t.tr2->t.tr1; X+ else X+ tree->t.tr2 = optim(tnode(LTOI,INT,tree->t.tr2,TNULL)); X+ if (tree->t.op==ASULSH) X+ { X+ tree->t.op = UASLSHL; X+ tree->t.tr1 = tnode(AMPER, LONG+PTR, tree->t.tr1, TNULL); X+ } X+ else X+ tree->t.op = ULLSHIFT; X+ break; X+ X case ASLSH: X case LSHIFT: X! if (tree->t.type==LONG || tree->t.type==UNLONG) { X if (tree->t.tr2->t.op==ITOL) X tree->t.tr2 = tree->t.tr2->t.tr1; X else X*************** X*** 386,392 **** X modf = isfloat(tree); X dbprint(tree->t.op); X if (table==sptab || table==lsptab) { X! if (tree->t.type==LONG) { X printf("mov\tr%d,-(sp)\n",r+1); X nstack++; X } X--- 402,408 ---- X modf = isfloat(tree); X dbprint(tree->t.op); X if (table==sptab || table==lsptab) { X! if (tree->t.type==LONG || tree->t.type==UNLONG){ X printf("mov\tr%d,-(sp)\n",r+1); X nstack++; X } X*************** X*** 419,425 **** X if (tree->t.type == STRUCT) X error("Illegal operation on structure"); X else if (tree->t.op>0 && tree->t.opt.op]) X! error("No code table for op: %s", opntab[tree->t.op]); X else X error("No code table for op %d", tree->t.op); X return(reg); X--- 435,441 ---- X if (tree->t.type == STRUCT) X error("Illegal operation on structure"); X else if (tree->t.op>0 && tree->t.opt.op]) X! error("No code table for op: %s(%d) type: %d", opntab[tree->t.op],tree->t.op,tree->t.type); X else X error("No code table for op %d", tree->t.op); X return(reg); X*************** X*** 483,489 **** X /* X * long values take 2 registers. X */ X! if ((tree->t.type==LONG||opd&RELAT&&tree->t.tr1->t.type==LONG) X && tree->t.op!=ITOL) X reg1++; X /* X--- 499,505 ---- X /* X * long values take 2 registers. X */ X! if ((tree->t.type==LONG||tree->t.type==UNLONG||opd&RELAT&&(tree->t.tr1->t.type==LONG||tree->t.tr1->t.type==UNLONG)) X && tree->t.op!=ITOL) X reg1++; X /* X*************** X*** 544,550 **** X * r = nreg - reg - (reg-areg) - (reg1-reg-1); X */ X r = nreg - reg + areg - reg1 + 1; X! if (table!=cctab || c==INCAFT || c==DECAFT || tree->t.type==LONG X /* || c==ASRSH || c==ASLSH || c==ASULSH || tree->t.tr1->t.type==UNCHAR */ X || c==ASRSH || c==ASLSH || c==ASULSH X || (opt = match(tree, efftab, r, 0)) == 0) X--- 560,566 ---- X * r = nreg - reg - (reg-areg) - (reg1-reg-1); X */ X r = nreg - reg + areg - reg1 + 1; X! if (table!=cctab || c==INCAFT || c==DECAFT || tree->t.type==LONG || tree->t.type==UNLONG X /* || c==ASRSH || c==ASLSH || c==ASULSH || tree->t.tr1->t.type==UNCHAR */ X || c==ASRSH || c==ASLSH || c==ASULSH X || (opt = match(tree, efftab, r, 0)) == 0) X*************** X*** 727,732 **** X--- 743,749 ---- X reg1 = rreg; X } else if (rreg!=reg) X if ((c&020)==0 && oddreg(tree, 0)==0 && tree->t.type!=LONG X+ && tree->t.type!=UNLONG X && (flag&04 X || flag&01&&xdcalc(p2,nreg-rreg-1)<=(opt->tabdeg2&077) X || flag&02&&xdcalc(p1,nreg-rreg-1)<=(opt->tabdeg1&077))) { X*************** X*** 840,846 **** X case ASULSH: X p = tree->t.tr1; X lcasev: X! if (p->t.type!=LONG) { X if (uns(p) || uns(tree->t.tr2)) X printf("clr"); X else X--- 857,863 ---- X case ASULSH: X p = tree->t.tr1; X lcasev: X! if (p->t.type!=LONG && p->t.type!=UNLONG) { X if (uns(p) || uns(tree->t.tr2)) X printf("clr"); X else X*************** X*** 1122,1128 **** X q->n.regno = p->n.regno; X q->n.offset = p->n.offset; X if (q->n.class==EXTERN || q->n.class==XOFFS) X! strncpy(q->x.name, p->x.name, NCPS); X else X q->n.nloc = p->n.nloc; X return(q); X--- 1139,1145 ---- X q->n.regno = p->n.regno; X q->n.offset = p->n.offset; X if (q->n.class==EXTERN || q->n.class==XOFFS) X! q->x.name = p->x.name; X else X q->n.nloc = p->n.nloc; X return(q); X*************** X*** 1197,1203 **** X return(size*2); X } X normal: X! if (nstack || isfloat(tree) || tree->t.type==LONG) { X rcexpr(tree, sptab, 0); X retval = arlength(tree->t.type); X } else { X--- 1214,1220 ---- X return(size*2); X } X normal: X! if (nstack || isfloat(tree) || tree->t.type==LONG || tree->t.type==UNLONG) { X rcexpr(tree, sptab, 0); X retval = arlength(tree->t.type); X } else { X*************** X*** 1292,1297 **** X--- 1309,1315 ---- X ((unsigned short *)&fval)[3] ); X return; X X+ case UNLONG: X case LONG: X if (tree->t.op==FTOL) { X tree = tree->t.tr1; X*************** X*** 1327,1333 **** X X if (r0==r1) X return; X! if (tree->t.type==LONG) { X if (r0>=nreg || r1>=nreg) { X error("register overflow: compiler error"); X } X--- 1345,1351 ---- X X if (r0==r1) X return; X! if (tree->t.type==LONG || tree->t.type == UNLONG) { X if (r0>=nreg || r1>=nreg) { X error("register overflow: compiler error"); X } Xdiff -c /usr/src/lib/ccom.old/c11.c /usr/src/lib/ccom/c11.c X*** /usr/src/lib/ccom.old/c11.c Sat May 9 13:48:55 1987 X--- /usr/src/lib/ccom/c11.c Thu Jun 3 09:05:07 1993 X*************** X*** 117,123 **** X if (p->n.class==SOFFS || p->n.class==STATIC) X printf("L%d", p->n.nloc); X else X! printf("%.*s", NCPS, p->x.name); X } X X xdcalc(p, nrleft) X--- 117,123 ---- X if (p->n.class==SOFFS || p->n.class==STATIC) X printf("L%d", p->n.nloc); X else X! printf("%s", p->x.name); X } X X xdcalc(p, nrleft) X*************** X*** 170,179 **** X case STAR: X p1 = p->t.tr1; X if (p1->t.op==NAME||p1->t.op==CON||p1->t.op==AUTOI||p1->t.op==AUTOD) X! if (p->t.type!=LONG) X return(12); X } X! if (p->t.type==LONG) X nrleft--; X return(p->t.degree <= nrleft? 20: 24); X } X--- 170,179 ---- X case STAR: X p1 = p->t.tr1; X if (p1->t.op==NAME||p1->t.op==CON||p1->t.op==AUTOI||p1->t.op==AUTOD) X! if (p->t.type!=LONG && p->t.type!=UNLONG) X return(12); X } X! if (p->t.type==LONG || p->t.type==UNLONG) X nrleft--; X return(p->t.degree <= nrleft? 20: 24); X } X*************** X*** 245,251 **** X if (p==NULL) X return(0); X if (p->t.op==STAR) { X! if (p->t.type==LONG+PTR) /* avoid *x(r); *x+2(r) */ X return(0); X p = p->t.tr1; X } X--- 245,251 ---- X if (p==NULL) X return(0); X if (p->t.op==STAR) { X! if (p->t.type==LONG+PTR || p->t.type==UNLONG+PTR) /* avoid *x(r); *x+2(r) */ X return(0); X p = p->t.tr1; X } X*************** X*** 277,287 **** X X if (!isfloat(t)) { X if (opdope[t->t.op]&RELAT) { X! if (t->t.tr1->t.type==LONG) X return((reg+1) & ~01); X return(reg); X } X switch(t->t.op) { X case LLSHIFT: X case ASLSHL: X case PTOI: X--- 277,289 ---- X X if (!isfloat(t)) { X if (opdope[t->t.op]&RELAT) { X! if (t->t.tr1->t.type==LONG || t->t.tr1->t.type==UNLONG) X return((reg+1) & ~01); X return(reg); X } X switch(t->t.op) { X+ case ULLSHIFT: X+ case UASLSHL: X case LLSHIFT: X case ASLSHL: X case PTOI: X*************** X*** 315,320 **** X--- 317,323 ---- X case UNCHAR: X return(2); X X+ case UNLONG: X case LONG: X return(4); X X*************** X*** 623,630 **** X && uns(tree->t.tr1)) X tree->t.op = op = op+LESSEQP-LESSEQ; X } X! if (tree->t.type==LONG X! || opdope[op]&RELAT&&tree->t.tr1->t.type==LONG) { X longrel(tree, lbl, cond, reg); X return; X } X--- 626,633 ---- X && uns(tree->t.tr1)) X tree->t.op = op = op+LESSEQP-LESSEQ; X } X! if (tree->t.type==LONG || tree->t.type==UNLONG X! || opdope[op]&RELAT&&(tree->t.tr1->t.type==LONG || tree->t.tr1->t.type==UNLONG)) { X longrel(tree, lbl, cond, reg); X return; X } X*************** X*** 687,694 **** X xlab2 = 0; X xop = op; X xz = xzero; X! xzero = !isrel || tree->t.tr2->t.op==ITOL && tree->t.tr2->t.tr1->t.op==CON X! && tree->t.tr2->t.tr1->c.value==0; X if (tree->t.op==ANDN) { X tree->t.op = TAND; X tree->t.tr2 = optim(tnode(COMPL, LONG, tree->t.tr2, TNULL)); X--- 690,697 ---- X xlab2 = 0; X xop = op; X xz = xzero; X! xzero = !isrel || (tree->t.tr2->t.op==ITOL && tree->t.tr2->t.tr1->t.op==CON X! && tree->t.tr2->t.tr1->c.value==0); X if (tree->t.op==ANDN) { X tree->t.op = TAND; X tree->t.tr2 = optim(tnode(COMPL, LONG, tree->t.tr2, TNULL)); X*************** X*** 715,729 **** X * bhi YES (third) X * NO: ... X * Note some tests may not be needed. X */ X! char lrtab[2][3][6] = { X! 0, NEQUAL, LESS, LESS, GREAT, GREAT, X! NEQUAL, 0, GREAT, GREAT, LESS, LESS, X! EQUAL, NEQUAL, LESSEQP,LESSP, GREATQP,GREATP, X X! 0, NEQUAL, LESS, LESS, GREATEQ,GREAT, X! NEQUAL, 0, GREAT, 0, 0, LESS, X! EQUAL, NEQUAL, EQUAL, 0, 0, NEQUAL, X }; X X xlongrel(f) X--- 718,745 ---- X * bhi YES (third) X * NO: ... X * Note some tests may not be needed. X+ * X+ * EQUAL = 60 X+ * NEQUAL= 61 X+ * LESSEQ= 62 X+ * LESS = 63 X+ * GREATEQ=64 X+ * GREAT =65 X+ * LESSEQP=66 X+ * LESSP =67 X+ * GREATQP=68 X+ * GREATP =69 X+ * X+ * Third dimension (lrtab[][][x]) indexed by "x - EQUAL". X */ X! char lrtab[2][3][10] = { X! 0, NEQUAL, LESS, LESS, GREAT, GREAT, LESSP, LESSP, GREATP, GREATP, X! NEQUAL, 0, GREAT, GREAT, LESS, LESS, GREATP, GREATP, LESSP, LESSP, X! EQUAL,NEQUAL,LESSEQP,LESSP, GREATQP,GREATP,LESSEQP,LESSP,GREATQP,GREATP, X X! 0, NEQUAL, LESS, LESS, GREATEQ,GREAT, LESSP, LESSP, GREATQP, GREATP, X! NEQUAL, 0, GREAT, 0, 0, LESS, GREATP, 0, 0, LESSP, X! EQUAL, NEQUAL, EQUAL, 0, 0, NEQUAL, EQUAL, 0, 0, NEQUAL, X }; X X xlongrel(f) X*************** X*** 808,823 **** X #define STKS 100 X getree() X { X! union tree *expstack[STKS]; X! union tree **sp; X register union tree *tp; X! register t, op; X! static char s[80]; /* big for ASM stuff, else NCPS + 1 */ X struct swtab *swp; X- double atof(); X long outloc; X- char numbuf[64]; X int lbl, cond, lbl2, lbl3; X X curbase = funcbase; X sp = expstack; X--- 824,837 ---- X #define STKS 100 X getree() X { X! union tree *expstack[STKS], **sp; X register union tree *tp; X! register int t, op; X! char s[80]; /* big for asm() stuff & long variable names */ X struct swtab *swp; X long outloc; X int lbl, cond, lbl2, lbl3; X+ double atof(); X X curbase = funcbase; X sp = expstack; X*************** X*** 866,882 **** X X case SYMDEF: X outname(s); X! printf(".globl%s%.*s\n", s[0]?"\t":"", NCPS, s); X sfuncr.nloc = 0; X break; X X case RETRN: X! printf("jmp cret\n"); X break; X X case CSPACE: X outname(s); X! printf(".comm\t%.*s,%o\n", NCPS, s, UNS(geti())); X break; X X case SSPACE: X--- 880,896 ---- X X case SYMDEF: X outname(s); X! printf(".globl\t%s\n", s); X sfuncr.nloc = 0; X break; X X case RETRN: X! printf("jmp\tcret\n"); X break; X X case CSPACE: X outname(s); X! printf(".comm\t%s,%o\n", s, UNS(geti())); X break; X X case SSPACE: X*************** X*** 904,910 **** X t = geti(); X outname(s); X printf("mov $L%d,r0\njsr pc,mcount\n", t); X! printf(".data\nL%d:%.*s+1\n.text\n", t, NCPS, s); X break; X X case ASSEM: X--- 918,924 ---- X t = geti(); X outname(s); X printf("mov $L%d,r0\njsr pc,mcount\n", t); X! printf(".data\nL%d:%s+1\n.text\n", t, s); X break; X X case ASSEM: X*************** X*** 969,975 **** X else if (op==EXPR) X rcexpr(tp, efftab, 0); X else { X! if (tp->t.type==LONG) { X rcexpr(tnode(RFORCE, tp->t.type, tp, TNULL), efftab, 0); X printf("ashc $0,r0\n"); X } else { X--- 983,989 ---- X else if (op==EXPR) X rcexpr(tp, efftab, 0); X else { X! if (tp->t.type==LONG || tp->t.type==UNLONG) { X rcexpr(tnode(RFORCE, tp->t.type, tp, TNULL), efftab, 0); X printf("ashc $0,r0\n"); X } else { X*************** X*** 988,994 **** X if (t==EXTERN) { X tp = getblk(sizeof(struct xtname)); X tp->t.type = geti(); X! outname(tp->x.name); X } else { X tp = getblk(sizeof(struct tname)); X tp->t.type = geti(); X--- 1002,1010 ---- X if (t==EXTERN) { X tp = getblk(sizeof(struct xtname)); X tp->t.type = geti(); X! outname(s); X! tp->x.name = (char *)getblk(strlen(s) + 1); X! strcpy(tp->x.name, s); X } else { X tp = getblk(sizeof(struct tname)); X tp->t.type = geti(); X*************** X*** 1023,1034 **** X X case FCON: X t = geti(); X! outname(numbuf); X tp = getblk(sizeof(struct ftconst)); X tp->t.op = FCON; X tp->t.type = t; X tp->f.value = isn++; X! tp->f.fvalue = atof(numbuf); X *sp++ = tp; X break; X X--- 1039,1050 ---- X X case FCON: X t = geti(); X! outname(s); X tp = getblk(sizeof(struct ftconst)); X tp->t.op = FCON; X tp->t.type = t; X tp->f.value = isn++; X! tp->f.fvalue = atof(s); X *sp++ = tp; X break; X X*************** X*** 1061,1072 **** X X case NLABEL: X outname(s); X! printf("%.*s:\n", NCPS, s); X break; X X case RLABEL: X outname(s); X! printf("%.*s:\n~~%.*s:\n", NCPS, s, NCPS-1, s+1); X break; X X case BRANCH: X--- 1077,1088 ---- X X case NLABEL: X outname(s); X! printf("%s:\n", s); X break; X X case RLABEL: X outname(s); X! printf("%s:\n~~%s:\n", s, s+1); X break; X X case BRANCH: X*************** X*** 1101,1120 **** X return(i); X } X X outname(s) X register char *s; X { X! register c; X! register n; X X! n = 0; X! while (c = getchar()) { X *s++ = c; X! n++; X! } X! do { X! *s++ = 0; X! } while (n++ < NCPS); X } X X strasg(atp) X--- 1117,1131 ---- X return(i); X } X X+ static X outname(s) X register char *s; X { X! register int c; X X! while (c = getchar()) X *s++ = c; X! *s++ = '\0'; X } X X strasg(atp) Xdiff -c /usr/src/lib/ccom.old/c12.c /usr/src/lib/ccom/c12.c X*** /usr/src/lib/ccom.old/c12.c Mon Oct 20 22:23:56 1986 X--- /usr/src/lib/ccom/c12.c Thu Jun 3 08:41:25 1993 X*************** X*** 95,101 **** X /* X * long & pos-int is simpler X */ X! if (tree->t.type==LONG && tree->t.tr2->t.op==ITOL X && (tree->t.tr2->t.tr1->t.op==CON && tree->t.tr2->t.tr1->c.value>=0 X || uns(tree->t.tr2->t.tr1))) { X tree->t.type = UNSIGN; X--- 95,101 ---- X /* X * long & pos-int is simpler X */ X! if ((tree->t.type==LONG || tree->t.type==UNLONG) && tree->t.tr2->t.op==ITOL X && (tree->t.tr2->t.tr1->t.op==CON && tree->t.tr2->t.tr1->c.value>=0 X || uns(tree->t.tr2->t.tr1))) { X tree->t.type = UNSIGN; X*************** X*** 121,127 **** X again: X tree->t.tr1 = optim(tree->t.tr1); X tree->t.tr2 = optim(tree->t.tr2); X! if (tree->t.type == LONG) { X t = lconst(tree->t.op, tree->t.tr1, tree->t.tr2); X if (t) X return(t); X--- 121,127 ---- X again: X tree->t.tr1 = optim(tree->t.tr1); X tree->t.tr2 = optim(tree->t.tr2); X! if (tree->t.type == LONG || tree->t.type==UNLONG) { X t = lconst(tree->t.op, tree->t.tr1, tree->t.tr2); X if (t) X return(t); X*************** X*** 167,172 **** X--- 167,178 ---- X case UMOD: X case ASUDIV: X case ASUMOD: X+ case ULASMOD: X+ case ULTIMES: X+ case ULDIV: X+ case ULMOD: X+ case ULASTIMES: X+ case ULASDIV: X tree->t.degree = 10; X break; X X*************** X*** 207,213 **** X d1 += 2 + regpanic; X d2 += 2 + regpanic; X panicposs++; X! if (tree->t.type==LONG) X return(hardlongs(tree)); X if ((op==MOD || op==DIVIDE || op==ASMOD || op==ASDIV) X && (uns(tree->t.tr1) || uns(tree->t.tr2)) X--- 213,219 ---- X d1 += 2 + regpanic; X d2 += 2 + regpanic; X panicposs++; X! if (tree->t.type==LONG || tree->t.type==UNLONG) X return(hardlongs(tree)); X if ((op==MOD || op==DIVIDE || op==ASMOD || op==ASDIV) X && (uns(tree->t.tr1) || uns(tree->t.tr2)) X*************** X*** 236,242 **** X * PDP-11 special: turn right shifts into negative X * left shifts X */ X! if (tree->t.type == LONG) { X d1++; X d2++; X } X--- 242,248 ---- X * PDP-11 special: turn right shifts into negative X * left shifts X */ X! if (tree->t.type == LONG || tree->t.type==UNLONG) { X d1++; X d2++; X } X*************** X*** 266,272 **** X def: X default: X if (dope&RELAT) { X! if (tree->t.tr1->t.type==LONG) /* long relations are a mess */ X d1 = 10; X if (opdope[tree->t.tr1->t.op]&RELAT && tree->t.tr2->t.op==CON X && tree->t.tr2->c.value==0) { X--- 272,278 ---- X def: X default: X if (dope&RELAT) { X! if (tree->t.tr1->t.type==LONG || tree->t.tr1->t.type==UNLONG) /* long relations are a mess */ X d1 = 10; X if (opdope[tree->t.tr1->t.op]&RELAT && tree->t.tr2->t.op==CON X && tree->t.tr2->c.value==0) { X*************** X*** 339,344 **** X--- 345,352 ---- X tree->f.fvalue = subtre->l.lvalue; X return(optim(tree)); X } X+ if (subtre->t.type==UNLONG) X+ tree->t.op = ULTOF; X break; X X case ITOF: X*************** X*** 467,473 **** X return(subtre); X } X p = subtre->t.tr1; X! if ((subtre->t.op==INCAFT||subtre->t.op==DECBEF)&&tree->t.type!=LONG X && p->t.op==NAME && p->n.class==REG && p->t.type==subtre->t.type) { X p->t.type = tree->t.type; X p->t.op = subtre->t.op==INCAFT? AUTOI: AUTOD; X--- 475,482 ---- X return(subtre); X } X p = subtre->t.tr1; X! if ((subtre->t.op==INCAFT||subtre->t.op==DECBEF) X! && tree->t.type!=LONG && tree->t.type!=UNLONG X && p->t.op==NAME && p->n.class==REG && p->t.type==subtre->t.type) { X p->t.type = tree->t.type; X p->t.op = subtre->t.op==INCAFT? AUTOI: AUTOD; X*************** X*** 733,739 **** X t1->t.degree = d = d==d1? d+islong(t1->t.type): MAX(d, d1); X t1->t.tr1 = tree; X tree = t1; X! if (tree->t.type==LONG) { X if (tree->t.op==TIMES) X tree = hardlongs(tree); X else if (tree->t.op==PLUS && (t = isconstant(tree->t.tr1)) X--- 742,748 ---- X t1->t.degree = d = d==d1? d+islong(t1->t.type): MAX(d, d1); X t1->t.tr1 = tree; X tree = t1; X! if (tree->t.type==LONG || tree->t.type==UNLONG) { X if (tree->t.op==TIMES) X tree = hardlongs(tree); X else if (tree->t.op==PLUS && (t = isconstant(tree->t.tr1)) X*************** X*** 1133,1142 **** X { X register union tree *p; X X! if (size&01) { X! error("compiler botch: odd size"); X! exit(1); X! } X p = (union tree *)curbase; X if ((curbase += size) >= coremax) { X if (sbrk(1024) == (char *)-1) { X--- 1142,1149 ---- X { X register union tree *p; X X! if (size&01) X! size++; X p = (union tree *)curbase; X if ((curbase += size) >= coremax) { X if (sbrk(1024) == (char *)-1) { X*************** X*** 1150,1156 **** X X islong(t) X { X! if (t==LONG) X return(2); X return(1); X } X--- 1157,1163 ---- X X islong(t) X { X! if (t==LONG || t==UNLONG) X return(2); X return(1); X } X*************** X*** 1175,1187 **** X case TIMES: X case DIVIDE: X case MOD: X! t->t.op += LTIMES-TIMES; X break; X X case ASTIMES: X case ASDIV: X case ASMOD: X! t->t.op += LASTIMES-ASTIMES; X t->t.tr1 = tnode(AMPER, LONG+PTR, t->t.tr1, TNULL); X break; X X--- 1182,1200 ---- X case TIMES: X case DIVIDE: X case MOD: X! if (t->t.type == UNLONG) X! t->t.op += ULTIMES-TIMES; X! else X! t->t.op += LTIMES-TIMES; X break; X X case ASTIMES: X case ASDIV: X case ASMOD: X! if (t->t.type == UNLONG) X! t->t.op += ULASTIMES-ASTIMES; X! else X! t->t.op += LASTIMES-ASTIMES; X t->t.tr1 = tnode(AMPER, LONG+PTR, t->t.tr1, TNULL); X break; X X*************** X*** 1200,1206 **** X register t; X X t = tp->t.type; X! if (t==UNSIGN || t==UNCHAR || t&XTYPE) X return(1); X return(0); X } X--- 1213,1219 ---- X register t; X X t = tp->t.type; X! if (t==UNSIGN || t==UNCHAR || t==UNLONG || t&XTYPE) X return(1); X return(0); X } Xdiff -c /usr/src/lib/ccom.old/c13.c /usr/src/lib/ccom/c13.c X*** /usr/src/lib/ccom.old/c13.c Mon Oct 20 22:23:57 1986 X--- /usr/src/lib/ccom/c13.c Wed Mar 31 18:50:59 1993 X*************** X*** 24,30 **** X 000001, /* long->ptr */ X 000001, /* field assignment */ X 000001, /* >> unsigned */ X! 000001, /* >> unsigned */ X 000000, /* 19 */ X 000400, /* name */ X 000400, /* short constant */ X--- 24,30 ---- X 000001, /* long->ptr */ X 000001, /* field assignment */ X 000001, /* >> unsigned */ X! 000001, /* >>= unsigned */ X 000000, /* 19 */ X 000400, /* name */ X 000400, /* short constant */ X*************** X*** 93,100 **** X 032001, /* % (long) */ X 012253, /* &= ~ */ X 012213, /* *= (long) */ X! 012213, /* / (long) */ X! 012213, /* % (long) */ X 000000, /* 89 */ X 014201, /* ? */ X 026061, /* long << */ X--- 93,100 ---- X 032001, /* % (long) */ X 012253, /* &= ~ */ X 012213, /* *= (long) */ X! 012213, /* /= (long) */ X! 012213, /* %= (long) */ X 000000, /* 89 */ X 014201, /* ? */ X 026061, /* long << */ X*************** X*** 127,132 **** X--- 127,141 ---- X 032001, /* unsigned % */ X 012213, /* unsigned /= */ X 012213, /* unsigned %= */ X+ 032001, /* 121 unsigned long * */ X+ 032001, /* 122 unsigned long / */ X+ 032001, /* 123 unsigned long % */ X+ 012213, /* 124 unsigned long *= */ X+ 012213, /* 125 unsigned long /= */ X+ 012213, /* 126 unsigned long %= */ X+ 01000, /* 127 unsigned long -> float(double) */ X+ 026061, /* 128 unsigned long >> */ X+ 012253, /* 129 unsigned long >>= */ X }; X X char *opntab[] = { X*************** X*** 148,154 **** X "long->ptr", X "field assign", X ">>", X! ">>", X 0, X "name", X "short constant", X--- 157,163 ---- X "long->ptr", X "field assign", X ">>", X! ">>=", X 0, X "name", X "short constant", X*************** X*** 251,256 **** X--- 260,274 ---- X "%", X "/=", X "%=", X+ "*", /* unsigned long */ X+ "/", /* unsigned long */ X+ "%", /* unsigned long */ X+ "*=", /* unsigned long */ X+ "/=", /* unsigned long */ X+ "%=", /* unsigned long */ X+ "u_long->double", /* unsigned long */ X+ ">>", /* unsigned long */ X+ ">>=", /* unsigned long */ X }; X X /* X*************** X*** 283,288 **** X--- 301,313 ---- X char slmul[] = "lmul"; X char sldiv[] = "ldiv"; X char slrem[] = "lrem"; X+ char uldiv[] = "uldiv"; X+ char ulrem[] = "ulrem"; X+ char ualdiv[] = "ualdiv"; X+ char ualrem[] = "ualrem"; X+ char ultof[] = "ultof"; X+ char ulsh[] = "ulsh"; X+ char ualsh[] = "ualsh"; X char almul[] = "almul"; X char aldiv[] = "aldiv"; X char alrem[] = "alrem"; X*************** X*** 368,373 **** X--- 393,407 ---- X UMOD, urem, urem, X ASUDIV, udiv, udiv, X ASUMOD, urem, urem, X+ ULTIMES,slmul, slmul, /* symmetry */ X+ ULDIV, uldiv, uldiv, X+ ULMOD, ulrem, ulrem, X+ ULASTIMES,almul,almul, /* symmetry */ X+ ULASDIV,ualdiv, ualdiv, X+ ULASMOD,ualrem, ualrem, X+ ULTOF, ultof, ultof, X+ ULLSHIFT, ulsh, ulsh, X+ UASLSHL, ualsh, ualsh, X 0, 0, 0}; X X /* Xdiff -c /usr/src/lib/ccom.old/cvopt.c /usr/src/lib/ccom/cvopt.c X*** /usr/src/lib/ccom.old/cvopt.c Mon Oct 20 22:23:57 1986 X--- /usr/src/lib/ccom/cvopt.c Tue Mar 30 08:54:52 1993 X*************** X*** 370,379 **** X goto l1; X X case 'b': X! if (f==9) X! f = 10; X else X! f = 3; X goto l1; X X case 'f': X--- 370,379 ---- X goto l1; X X case 'b': X! if (f==9) /* unsigned word/int seen yet? */ X! f = 10; /* yes - it is unsigned byte */ X else X! f = 3; /* no - it is regular (signed) byte */ X goto l1; X X case 'f': X*************** X*** 385,394 **** X goto l1; X X case 'u': X! if (f==3) X! f = 10; X else X! f = 9; X goto l1; X X case 's': X--- 385,396 ---- X goto l1; X X case 'u': X! if (f==3) /* regular (signed) byte seen ? */ X! f = 10; /* yes - unsigned byte now */ X! else if (f == 8) /* regular (signed) long seen? */ X! f = 11; /* yes - it is unsigned long now */ X else X! f = 9; /* otherwise we have unsigned word */ X goto l1; X X case 's': X*************** X*** 396,402 **** X goto l1; X X case 'l': X! f = 8; X goto l1; X X case 'p': X--- 398,407 ---- X goto l1; X X case 'l': X! if (f == 9) /* seen unsigned yet? */ X! f = 11; /* yes - it is unsigned long now */ X! else X! f = 8; /* no - it is unsigned word now */ X goto l1; X X case 'p': XOnly in /usr/src/lib/ccom: ncc Xdiff -c /usr/src/lib/ccom.old/optable /usr/src/lib/ccom/optable X*** /usr/src/lib/ccom.old/optable Tue Jul 28 09:35:00 1992 X--- /usr/src/lib/ccom/optable Sun Jun 6 14:07:15 1993 X*************** X*** 59,64 **** X--- 59,73 ---- X {119,cr119}, X {120,cr119}, X {107,cr107}, X+ {121,cr121}, X+ {122,cr121}, X+ {123,cr121}, X+ {124,cr124}, X+ {125,cr124}, X+ {126,cr124}, X+ {127,cr127}, X+ {128,cr128}, X+ {129,cr129}, X {0} X }; X %} X*************** X*** 119,128 **** X--- 128,139 ---- X movof #1(R),R X X %al,n X+ %aul,n X mov A1+,R+ X mov A1,R X X %nl*,n X+ %nul*,n X F* X mov #1+2(R),R+ X mov #1(R),R X*************** X*** 181,191 **** X--- 192,204 ---- X bisb (sp)+,R X X %al,1 X+ %aul,1 X F X I $1,A1+ X V A1 X X %el*,1 X+ %eul*,1 X F1* X mov #1+2(R1),R+ X mov #1(R1),R X*************** X*** 193,198 **** X--- 206,212 ---- X V #1(R1) X X %nl*,1 X+ %nul*,1 X F* X mov #1+2(R),-(sp) X mov #1(R),-(sp) X*************** X*** 209,214 **** X--- 223,229 ---- X IBF R X X %nl,n X+ %nul,n X F X I R X I R+ X*************** X*** 286,296 **** X--- 301,317 ---- X movfo R,*(sp)+ X X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X S X mov R+,A1+ X mov R,A1 X X %el*,nl X+ %el*,nul X+ %eul*,nl X+ %eul*,nul X S X F1* X mov R+,2+#1(R1) X*************** X*** 297,302 **** X--- 318,326 ---- X mov R,#1(R1) X X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X FS* X S X mov R,*(sp) X*************** X*** 365,375 **** X--- 389,402 ---- X X %nl,c X %nl,au X+ %nul,c X+ %nul,au X F X I A2,R+ X V R X X %nl,eu X+ %nul,eu X F X S1 X I R1,R+ X*************** X*** 376,381 **** X--- 403,411 ---- X V R X X %nl,al X+ %nl,aul X+ %nul,al X+ %nul,aul X F X I A2,R X I A2+,R+ X*************** X*** 383,388 **** X--- 413,421 ---- X X %[addl1:] X %nl,el X+ %nl,eul X+ %nul,el X+ %nul,eul X F X S1 X I R1+,R+ X*************** X*** 391,396 **** X--- 424,432 ---- X X %[addl2:] X %nl,nl X+ %nl,nul X+ %nul,nl X+ %nul,nul X SS X F X I (sp)+,R X*************** X*** 409,417 **** X--- 445,459 ---- X mov (sp)+,R X X %nl,el X+ %nl,eul X+ %nul,el X+ %nul,eul X % [addl1] X X %nl,nl X+ %nl,nul X+ %nul,nl X+ %nul,nul X SS X F X I R,(sp) X*************** X*** 443,449 **** X %nf,nf X % [add5] X X! /* / R must be odd on integers */ X cr43: X %n,aw X F X--- 485,491 ---- X %nf,nf X % [add5] X X! /* / and >> R must be odd on integers */ X cr43: X %n,aw X F X*************** X*** 483,488 **** X--- 525,531 ---- X /* PTOI */ X cr14: X %nl,a X+ %nul,a X F! X div A2,R X X*************** X*** 609,614 **** X--- 652,658 ---- X X %[addq11:] X %al,c X+ %aul,c X I A2,A1+ X V A1 X F X*************** X*** 615,620 **** X--- 659,667 ---- X X %[addq12:] X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X I A2+,A1+ X V A1 X I A2,A1 X*************** X*** 622,627 **** X--- 669,677 ---- X X %[addq13:] X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X S X I R+,A1+ X V A1 X*************** X*** 630,635 **** X--- 680,686 ---- X X %[addq14:] X %nl*,c X+ %nul*,c X F* X I A2,#1+2(R) X V #1(R) X*************** X*** 638,643 **** X--- 689,697 ---- X X %[addq15:] X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X F* X I A2+,#1+2(R) X V #1(R) X*************** X*** 647,652 **** X--- 701,709 ---- X X %[addq16:] X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X SS X F* X I (sp)+,#1(R) X*************** X*** 757,763 **** X %nf*,nf X % [addq10] X X! /* =mod; R must be odd on integers */ X cr74: X %a,aw X movB1 A1',R X--- 814,820 ---- X %nf*,nf X % [addq10] X X! /* >>= and =mod; R must be odd on integers */ X cr74: X %a,aw X movB1 A1',R X*************** X*** 919,958 **** X--- 976,1051 ---- X % [addq10] X X %al,c X+ %aul,c X % [addq11] X X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X % [addq12] X X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X % [addq13] X X %nl*,c X+ %nul*,c X % [addq14] X X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X % [addq15] X X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X % [addq16] X X /* << for longs */ X cr91: X %nl,aw X+ %nul,aw X % [add1] X X %nl,ew* X+ %nul,ew* X % [add2] X X %nl,e X+ %nul,e X % [add3] X X %nl,nw* X+ %nul,nw* X % [add4] X X %nl,n X+ %nul,n X % [add5] X X+ /* >> for unsigned long */ X+ cr128: X+ %nl,n X+ %nul,n X+ SS X+ F X+ jsr pc,I X+ tst (sp)+ X+ X+ /* >>= for unsigned long */ X+ cr129: X+ %n,n X+ SS X+ FS X+ jsr pc,I X+ cmp (sp)+,(sp)+ X+ X /* int -> float */ X cr51: X %aw,n X*************** X*** 1001,1006 **** X--- 1094,1119 ---- X movif (sp)+,R X seti X X+ /* unsigned long to float(double) */ X+ cr127: X+ %aul,n X+ mov A1+,-(sp) X+ mov A1,-(sp) X+ jsr pc,I X+ cmp (sp)+,(sp)+ X+ X+ %nul*,n X+ F* X+ mov #1+2(R),-(sp) X+ mov #1(R),-(sp) X+ jsr pc,I X+ cmp (sp)+,(sp)+ X+ X+ %nul,n X+ FS X+ jsr pc,I X+ cmp (sp)+,(sp)+ X+ X /* integer to long */ X cr58: X %eu,n X*************** X*** 1024,1046 **** X--- 1137,1177 ---- X /* long to integer */ X cr59: X %al,n X+ %aul,n X mov A1+,R X X %nl*,n X+ %nul*,n X F* X mov #1+2(R),R X X /* *, /, remainder for longs. */ X cr82: X+ %[l82:] X %nl,nl X+ %nl,nul X+ %nul,nl X+ %nul,nul X SS X FS X jsr pc,I X add $10,sp X X+ /* *, /, rem for unsigned long */ X+ cr121: X+ %nul,nl X+ %nul,nul X+ % [l82] X+ X+ /* =*, =/, =rem for unsigned long */ X+ cr124: X+ %n,nul X+ % [l86] X+ X /* =*, =/, =rem for longs */ X /* Operands of the form &x op y, so stack space is known. */ X cr86: X+ %[l86:] X %n,nl X SS X FS X*************** X*** 1245,1254 **** X--- 1376,1387 ---- X movfi R,#1(R1) X X %al,z X+ %aul,z X clr A1 X clr A1+ X X %nl*,z X+ %nul*,z X F* X clr #1(R) X clr 2+#1(R) X*************** X*** 1255,1274 **** X--- 1388,1411 ---- X X %[move13a:] X %al,aw X+ %aul,aw X I A2,A1+ X V A1 X X %al,nw* X+ %aul,nw* X S* X mov #2(R),A1+ X V A1 X X %al,n X+ %aul,n X S X mov R,A1+ X V A1 X X %al,nf X+ %aul,nf X S X setl X movfi R,A1 X*************** X*** 1275,1280 **** X--- 1412,1418 ---- X seti X X %el*,nf X+ %eul*,nf X S X F1* X setl X*************** X*** 1283,1288 **** X--- 1421,1429 ---- X X %[move13:] X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X I A2,A1 X I A2+,A1+ X V A1 X*************** X*** 1289,1294 **** X--- 1430,1438 ---- X X %[move14:] X %al,nl* X+ %al,nul* X+ %aul,nl* X+ %aul,nul* X S* X I #2(R),A1 X I #2+2(R),A1+ X*************** X*** 1296,1301 **** X--- 1440,1448 ---- X X %[move15:] X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X S X I R,A1 X I R+,A1+ X*************** X*** 1303,1308 **** X--- 1450,1456 ---- X X %[move14a:] X %nl*,aw X+ %nul*,aw X F* X I A2,#1+2(R) X V #1(R) X*************** X*** 1309,1314 **** X--- 1457,1465 ---- X X %[move16a:] X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X F* X I A2+,#1+2(R) X V #1(R) X*************** X*** 1316,1321 **** X--- 1467,1475 ---- X X %[move16:] X %el*,nl X+ %el*,nul X+ %eul*,nl X+ %eul*,nul X S X F1* X I R+,#1+2(R1) X*************** X*** 1323,1328 **** X--- 1477,1483 ---- X I R,#1(R1) X X %nl*,n X+ %nul*,n X SS X F* X mov (sp)+,#1+2(R) X*************** X*** 1330,1335 **** X--- 1485,1493 ---- X X %[move17:] X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X SS X F* X I (sp)+,#1(R) X*************** X*** 1387,1424 **** X--- 1545,1612 ---- X X %al,c X %al,au X+ %aul,c X+ %aul,au X % [move13a] X X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X % [move13] X X %al,nl* X+ %al,nul* X+ %aul,nl* X+ %aul,nul* X % [move14] X X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X % [move15] X X %nl*,c X+ %nul*,c X % [move14a] X X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X % [move16a] X X %el*,nl X+ %el*,nul X+ %eul*,nl X+ %eul*,nul X % [move16] X X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X % [move17] X X /* =^ */ X ci79: X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X % [move15] X X %el*,nl X+ %el*,nul X+ %eul*,nl X+ %eul*,nul X % [move16] X X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X FS* X S X I R,*(sp) X*************** X*** 1492,1519 **** X--- 1680,1729 ---- X X %al,c X %al,au X+ %aul,au X+ %aul,c X % [move13a] X X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X % [move13] X X %al,nl* X+ %al,nul* X+ %aul,nl* X+ %aul,nul* X % [move14] X X %al,nl X+ %al,nul X+ %aul,nl X+ %aul,nul X % [move15] X X %nl*,c X %nl*,au X+ %nul*,c X+ %nul*,au X % [move14a] X X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X % [move16a] X X %el*,nl X+ %el*,nul X+ %eul*,nl X+ %eul*,nul X % [move16] X X %nl*,nl X+ %nl*,nul X+ %nul*,nl X+ %nul*,nul X % [move17] X X /* =>> (all harder cases handled by =<< -) */ X*************** X*** 1559,1564 **** X--- 1769,1775 ---- X /* =<< for longs */ X cr92: X %al,aw X+ %aul,aw X F X ashc A2,R X mov R,A1 X*************** X*** 1565,1570 **** X--- 1776,1782 ---- X mov R+,A1+ X X %al,n X+ %aul,n X SS X F X ashc (sp)+,R X*************** X*** 1572,1577 **** X--- 1784,1790 ---- X mov R+,A1+ X X %nl*,n X+ %nul*,n X FS* X SS X mov 2(sp),R X*************** X*** 1719,1724 **** X--- 1932,1938 ---- X % [add5] X X %al,z X+ %aul,z X tst A1 X X0 X tst A1+ X*************** X*** 1726,1731 **** X--- 1940,1947 ---- X X %al,c X %al,au X+ %aul,c X+ %aul,au X tst A1 X X0 X cmp A1+,A2 X*************** X*** 1733,1738 **** X--- 1949,1957 ---- X X %[lcmp1:] X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X I A1,A2 X X0 X I A1+,A2+ X*************** X*** 1739,1744 **** X--- 1958,1964 ---- X X1 X X %nl*,z X+ %nul*,z X F* X tst #1(R) X X0 X*************** X*** 1746,1752 **** X--- 1966,1974 ---- X X1 X X %nl*,c X+ %nul*,c X %nl*,au X+ %nul*,au X F* X tst #1(R) X X0 X*************** X*** 1755,1760 **** X--- 1977,1985 ---- X X %[lcmp2:] X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nl*,aul X F* X I #1(R),A2 X X0 X*************** X*** 1762,1767 **** X--- 1987,1993 ---- X X1 X X %nl,z X+ %nul,z X F X tst R X X0 X*************** X*** 1769,1775 **** X--- 1995,2003 ---- X X1 X X %nl,c X+ %nul,c X %nl,au X+ %nul,au X F X tst R X X0 X*************** X*** 1778,1783 **** X--- 2006,2014 ---- X X %[lcmp3:] X %nl,al X+ %nl,aul X+ %nul,al X+ %nul,aul X F X I R,A2 X X0 X*************** X*** 1786,1791 **** X--- 2017,2025 ---- X X %[lcmp4:] X %nl*,el* X+ %nl*,eul* X+ %nul*,el* X+ %nul*,eul* X F* X S1* X I #1(R),#2(R1) X*************** X*** 1795,1800 **** X--- 2029,2037 ---- X X %[lcmp5:] X %nl,el* X+ %nl,eul* X+ %nul,el* X+ %nul,eul* X F X S1* X I R,#2(R1) X*************** X*** 1804,1809 **** X--- 2041,2049 ---- X X %[lcmp6:] X %nl,nl X+ %nl,nul X+ %nul,nl X+ %nul,nul X FS X S X mov R,-(sp) X*************** X*** 1853,1888 **** X--- 2093,2152 ---- X % [add5] X X %al,c X+ %aul,c X %al,au X+ %aul,au X bit A2,A1+ X X1 X X %nl*,c X+ %nul*,c X %nl*,au X+ %nul*,au X F* X bit A2,#2+2(R) X X1 X X %al,al X+ %al,aul X+ %aul,al X+ %aul,aul X % [lcmp1] X X %nl*,al X+ %nl*,aul X+ %nul*,al X+ %nul*,aul X % [lcmp2] X X %nl,al X+ %nl,aul X+ %nul,al X+ %nul,aul X % [lcmp3] X X %nl*,el* X+ %nl*,eul* X+ %nul*,el* X+ %nul*,eul* X % [lcmp4] X X %nl,el* X+ %nl,eul* X+ %nul,el* X+ %nul,eul* X % [lcmp5] X X %nl,nl X+ %nl,nul X+ %nul,nl X+ %nul,nul X % [lcmp6] X X %nl,c X+ %nul,c X %nl,au X+ %nul,au X F X bit A2,R+ X X1 X*************** X*** 1928,1933 **** X--- 2192,2198 ---- X mov #1(R),-(sp) X X %al,n X+ %aul,n X mov A1+,-(sp) X mov A1,-(sp) X SHAR_EOF fi if test -f '12' then echo shar: "will not over-write existing file '12'" else sed 's/^X//' << \SHAR_EOF > '12' X*** /usr/src/sys/h/types.h.old Mon Sep 23 12:40:18 1991 X--- /usr/src/sys/h/types.h Sat Jun 5 22:50:14 1993 X*************** X*** 25,31 **** X typedef unsigned char u_char; X typedef unsigned short u_short; X typedef unsigned int u_int; X! typedef long u_long; /* watch out! no unsigned longs! */ X typedef unsigned short ushort; /* sys III compat */ X X #ifdef pdp11 X--- 25,31 ---- X typedef unsigned char u_char; X typedef unsigned short u_short; X typedef unsigned int u_int; X! typedef unsigned long u_long; /* see this! unsigned longs at last! */ X typedef unsigned short ushort; /* sys III compat */ X X #ifdef pdp11 SHAR_EOF fi if test -f '2' then echo shar: "will not over-write existing file '2'" else sed 's/^X//' << \SHAR_EOF > '2' X*** /usr/include/arpa/inet.h.old Wed May 10 16:21:25 1989 X--- /usr/include/arpa/inet.h Sun Jun 13 22:50:39 1993 X*************** X*** 14,20 **** X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2 (Berkeley) 6/27/88 X */ X X /* X--- 14,20 ---- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2.1 (2.11BSD GTE) 6/12/93 X */ X X /* X*************** X*** 22,40 **** X * functions in inet(3N) X */ X #ifdef BSD2_10 X! #include X X- long inet_addr(); X- char *inet_ntoa(); X- struct in_addr inet_makeaddr(); X- long inet_network(); X- long inet_netof(); X- long inet_lnaof(); X- X- #else X- X unsigned long inet_addr(); X char *inet_ntoa(); X struct in_addr inet_makeaddr(); X unsigned long inet_network(); X! #endif X--- 22,33 ---- X * functions in inet(3N) X */ X #ifdef BSD2_10 X! #include /* Hopefully this will go away soon */ X! #endif X X unsigned long inet_addr(); X char *inet_ntoa(); X struct in_addr inet_makeaddr(); X unsigned long inet_network(); X! unsigned long inet_netof(); X! unsigned long inet_lnaof(); X*** /usr/src/include/arpa/inet.h.old Wed May 10 16:21:25 1989 X--- /usr/src/include/arpa/inet.h Sun Jun 13 22:50:39 1993 X*************** X*** 14,20 **** X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2 (Berkeley) 6/27/88 X */ X X /* X--- 14,20 ---- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. X * X! * @(#)inet.h 5.2.1 (2.11BSD GTE) 6/12/93 X */ X X /* X*************** X*** 22,40 **** X * functions in inet(3N) X */ X #ifdef BSD2_10 X! #include X X- long inet_addr(); X- char *inet_ntoa(); X- struct in_addr inet_makeaddr(); X- long inet_network(); X- long inet_netof(); X- long inet_lnaof(); X- X- #else X- X unsigned long inet_addr(); X char *inet_ntoa(); X struct in_addr inet_makeaddr(); X unsigned long inet_network(); X! #endif X--- 22,33 ---- X * functions in inet(3N) X */ X #ifdef BSD2_10 X! #include /* Hopefully this will go away soon */ X! #endif X X unsigned long inet_addr(); X char *inet_ntoa(); X struct in_addr inet_makeaddr(); X unsigned long inet_network(); X! unsigned long inet_netof(); X! unsigned long inet_lnaof(); SHAR_EOF fi if test -f '13' then echo shar: "will not over-write existing file '13'" else sed 's/^X//' << \SHAR_EOF > '13' X*** /usr/src/sys/pdp/machparam.h.old Thu Dec 24 16:59:37 1992 X--- /usr/src/sys/pdp/machparam.h Sun Jun 6 12:18:21 1993 X*************** X*** 31,38 **** X #define htonl(x) (x) X #define htons(x) (x) X #else X! unsigned short ntohs(), htons(); X! long ntohl(), htonl(); X #endif X X #define CHAR_BIT NBBY X--- 31,39 ---- X #define htonl(x) (x) X #define htons(x) (x) X #else X! #include X! u_short ntohs(), htons(); X! u_long ntohl(), htonl(); X #endif X X #define CHAR_BIT NBBY SHAR_EOF fi if test -f '20' then echo shar: "will not over-write existing file '20'" else sed 's/^X//' << \SHAR_EOF > '20' X*** /usr/src/bin/hostid.c.old Wed Feb 11 20:04:18 1987 X--- /usr/src/bin/hostid.c Sat Jun 12 00:22:35 1993 X*************** X*** 4,19 **** X * specifies the terms and conditions for redistribution. X */ X X! #ifndef lint X char copyright[] = X "@(#) Copyright (c) 1983 Regents of the University of California.\n\ X All rights reserved.\n"; X! #endif not lint X X- #ifndef lint X- static char sccsid[] = "@(#)hostid.c 5.4 (Berkeley) 5/19/86"; X- #endif not lint X- X #include X #include X #include X--- 4,16 ---- X * specifies the terms and conditions for redistribution. X */ X X! #if !defined(lint) && defined(DOSCCS) X char copyright[] = X "@(#) Copyright (c) 1983 Regents of the University of California.\n\ X All rights reserved.\n"; X! static char sccsid[] = "@(#)hostid.c 1.1 (2.11BSD GTE) 6/12/93"; X! #endif X X #include X #include X #include X*************** X*** 20,30 **** X #include X X extern char *index(); X- #ifdef BSD2_10 X- extern long inet_addr(); X- #else !BSD2_10 X extern unsigned long inet_addr(); X- #endif BSD2_10 X extern long gethostid(); X X main(argc, argv) X--- 17,23 ---- SHAR_EOF fi exit 0 # End of shell archive