v02i018: Purdue speedups to Release 3 mfb code, Part02/02
Mike Wexler
mikew at wyse.wyse.com
Thu Nov 24 04:09:58 AEST 1988
Submitted-by: spaf at purdue.edu (Gene Spafford)
Posting-number: Volume 2, Issue 18
Archive-name: pspeedups/part02
[I applied these to X11 Release three with the first two patches. The
only problem I had is that the patch to mfbline.c fails in less the
-l option is supplied to patch. By the way I compiled it under Sun OS
3.5 and I am running it on Sun OS 4.0.]
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 2 (of 2)."
# Contents: AUTHOR mfb.h.patch mfbbitblt.c.patch mfbbstore.c.patch
# mfbfillrct.c.patch mfbgetsp.c.patch mfbhrzvert.c.patch
# mfbpntarea.c.patch mfbpolypnt.c.patch mfbsetsp.c.patch
# mfbtile.c.patch mfbwindow.c.patch
# Wrapped by mikew at wyse on Tue Nov 22 17:49:28 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'AUTHOR' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'AUTHOR'\"
else
echo shar: Extracting \"'AUTHOR'\" \(925 characters\)
sed "s/^X//" >'AUTHOR' <<'END_OF_FILE'
X(Message inbox:219)
XReturn-Path: news at purdue.edu
XReceived: from wyse by tarfoo.wyse.com (5.58/Wyse client/5-13-88)
X id AA01773; Thu, 17 Nov 88 20:18:04 PST
XReceived: by wyse.wyse.com (5.58/Wyse master/5-13-88)
X id AA29072; Thu, 17 Nov 88 20:17:22 PST
XReceived: from gatech.edu by uunet.UU.NET (5.59/1.14)
X id AA24634; Thu, 17 Nov 88 21:00:46 EST
XReceived: from medusa.cs.purdue.edu by gatech.edu (5.58/GATECH-8.0)
X id AA05158 for ; Thu, 17 Nov 88 20:29:17 EST
XReceived: by medusa.cs.purdue.edu; (5.54/3.16)
X id AA24624; Thu, 17 Nov 88 18:38:21 EST
XTo: comp-sources-x at gatech.edu
XPath: purdue!spaf
XFrom: spaf at purdue.edu (Gene Spafford)
XNewsgroups: comp.sources.x
XSubject: Purdue speedups to Release 3 mfb code
XMessage-Id: <5461 at medusa.cs.purdue.edu>
XDate: 17 Nov 88 23:38:19 GMT
XSender: news at purdue.edu
XReply-To: spaf at purdue.edu (Gene Spafford)
XOrganization: Department of Computer Science, Purdue University
XLines: 2391
X
X
X
END_OF_FILE
if test 925 -ne `wc -c <'AUTHOR'`; then
echo shar: \"'AUTHOR'\" unpacked with wrong size!
fi
# end of 'AUTHOR'
fi
if test -f 'mfb.h.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfb.h.patch'\"
else
echo shar: Extracting \"'mfb.h.patch'\" \(3974 characters\)
sed "s/^X//" >'mfb.h.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfb.h.orig Tue Sep 6 13:53:23 1988
X--- ./ddx/mfb/mfb.h Thu Nov 17 17:22:43 1988
X***************
X*** 249,254 ****
X--- 249,255 ----
X #define fnNAND(src, dst) (~(src & dst))
X #define fnSET(src, dst) (~0)
X
X+ #ifndef PURDUE
X /* Binary search to figure out what to do for the raster op. It may
X * do 5 comparisons, but at least it does no function calls
X * Special cases copy because it's so frequent
X***************
X*** 270,275 ****
X--- 271,345 ----
X (((alu) >= GXandReverse) ? \
X (((alu) == GXandReverse) ? ((src) & ~(dst)) : (src)) : \
X (((alu) == GXand) ? ((src) & (dst)) : 0))) ) )
X+ #else /* PURDUE */
X+ /* Using a "switch" statement is much faster in most cases
X+ * since the compiler can do a look-up table or multi-way branch
X+ * instruction, depending on the architecture. The result on
X+ * A Sun 3/50 is at least 2.5 times faster, assuming a uniform
X+ * distribution of RasterOp operation types.
X+ *
X+ * However, doing some profiling on a running system reveals
X+ * GXcopy is the operation over 99.5% of the time and
X+ * GXcopy is the next most frequent (about .4%), so we make special
X+ * checks for those first.
X+ *
X+ * Note that this requires a change to the "calling sequence"
X+ * since we can't engineer a "switch" statement to have an lvalue.
X+ */
X+ #define DoRop(result, alu, src, dst) \
X+ { \
X+ if (alu == GXcopy) \
X+ result = fnCOPY (src, dst); \
X+ else if (alu == GXxor) \
X+ result = fnXOR (src, dst); \
X+ else \
X+ switch (alu) \
X+ { \
X+ case GXclear: \
X+ result = fnCLEAR (src, dst); \
X+ break; \
X+ case GXand: \
X+ result = fnAND (src, dst); \
X+ break; \
X+ case GXandReverse: \
X+ result = fnANDREVERSE (src, dst); \
X+ break; \
X+ case GXandInverted: \
X+ result = fnANDINVERTED (src, dst); \
X+ break; \
X+ case GXnoop: \
X+ result = fnNOOP (src, dst); \
X+ break; \
X+ case GXor: \
X+ result = fnOR (src, dst); \
X+ break; \
X+ case GXnor: \
X+ result = fnNOR (src, dst); \
X+ break; \
X+ case GXequiv: \
X+ result = fnEQUIV (src, dst); \
X+ break; \
X+ case GXinvert: \
X+ result = fnINVERT (src, dst); \
X+ break; \
X+ case GXorReverse: \
X+ result = fnORREVERSE (src, dst); \
X+ break; \
X+ case GXcopyInverted: \
X+ result = fnCOPYINVERTED (src, dst); \
X+ break; \
X+ case GXorInverted: \
X+ result = fnORINVERTED (src, dst); \
X+ break; \
X+ case GXnand: \
X+ result = fnNAND (src, dst); \
X+ break; \
X+ case GXset: \
X+ result = fnSET (src, dst); \
X+ break; \
X+ } \
X+ }
X+ #endif /* PURDUE */
X
X
X #define DoRRop(alu, src, dst) \
X***************
X*** 277,279 ****
X--- 347,395 ----
X ((alu) == RROP_WHITE) ? ((dst) | (src)) : \
X ((alu) == RROP_INVERT) ? ((dst) ^ (src)) : \
X (dst))
X+
X+ #ifdef PURDUE
X+ #if defined(macII)
X+ /* A generalized form of a x4 Duff's Device for small cache systems */
X+ #define Duff(counter, block) \
X+ while (counter >= 4) {\
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ counter -= 4; \
X+ } \
X+ switch (counter & 3) { \
X+ case 3: { block; } \
X+ case 2: { block; } \
X+ case 1: { block; } \
X+ case 0: \
X+ counter = 0; \
X+ }
X+ #else /* MacII */
X+ /* A generalized form of a x8 Duff's Device -- better than x4 for Suns */
X+ #define Duff(counter, block) \
X+ while (counter >= 8) {\
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ { block; } \
X+ counter -= 8; \
X+ } \
X+ switch (counter & 7) { \
X+ case 7: { block; } \
X+ case 6: { block; } \
X+ case 5: { block; } \
X+ case 4: { block; } \
X+ case 3: { block; } \
X+ case 2: { block; } \
X+ case 1: { block; } \
X+ case 0: \
X+ counter = 0; \
X+ }
X+ #endif /* MacII */
X+ #endif /* PURDUE */
END_OF_FILE
if test 3974 -ne `wc -c <'mfb.h.patch'`; then
echo shar: \"'mfb.h.patch'\" unpacked with wrong size!
fi
# end of 'mfb.h.patch'
fi
if test -f 'mfbbitblt.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbbitblt.c.patch'\"
else
echo shar: Extracting \"'mfbbitblt.c.patch'\" \(3034 characters\)
sed "s/^X//" >'mfbbitblt.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbbitblt.c.orig Mon Oct 31 13:27:50 1988
X--- ./ddx/mfb/mfbbitblt.c Thu Nov 17 15:21:35 1988
X***************
X*** 243,248 ****
X--- 243,250 ----
X } \
X }
X
X+ #ifndef PURDUE
X+
X #define longRop(alu,from,to,count) \
X { \
X switch (count & 7) { \
X***************
X*** 267,273 ****
X } \
X }
X
X-
X #define getunalignedword(psrc, x, dst) \
X { \
X int m; \
X--- 269,274 ----
X***************
X*** 276,281 ****
X--- 277,293 ----
X (SCRRIGHT(*((psrc)+1), m) & starttab[m]); \
X }
X
X+ #else
X+ #define longRop(alu,from,to,count) Duff(count, DoRop (*to, alu, *from++, *to); to++)
X+
X+ #define getunalignedword(psrc, x, dst) \
X+ { \
X+ dst = (SCRLEFT((unsigned) *(psrc), (x))) | \
X+ (SCRRIGHT((unsigned) *((psrc)+1), 32-(x))); \
X+ }
X+
X+ #endif
X+
X mfbDoBitblt(pSrcDrawable, pDstDrawable, alu, prgnDst, pptSrc)
X DrawablePtr pSrcDrawable;
X DrawablePtr pDstDrawable;
X***************
X*** 552,559 ****
X--- 564,575 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbits(tmpSrc, 0, nend, pdst)
X+ #else
X+ getandputbits0(psrc, xoffSrc, nend, pdst);
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
X***************
X*** 577,588 ****
X--- 593,613 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbits(tmpSrc, 0, nend, pdst)
X+ #else
X+ getandputbits0(psrc, xoffSrc, nend, pdst);
X+ #endif
X }
X
X+ #ifndef PURDUE
X nl = nlMiddle + 1;
X while (--nl)
X+ #else
X+ nl = nlMiddle;
X+ while (nl--)
X+ #endif /* PURDUE */
X {
X --psrc;
X getunalignedword (psrc, xoffSrc, *--pdst)
X***************
X*** 694,700 ****
X--- 719,730 ----
X while (--nl)
X {
X getunalignedword (psrc, xoffSrc, tmpSrc)
X+ #ifndef PURDUE
X *pdst++ = DoRop (alu, tmpSrc, *pdst);
X+ #else
X+ DoRop (*pdst, alu, tmpSrc, *pdst);
X+ pdst++;
X+ #endif
X psrc++;
X }
X }
X***************
X*** 701,708 ****
X--- 731,742 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbitsrop(tmpSrc, 0, nend, pdst, alu)
X+ #else
X+ getandputrop0(psrc, xoffSrc, nend, pdst, alu);
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
X***************
X*** 726,733 ****
X--- 760,771 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbitsrop(tmpSrc, 0, nend, pdst, alu)
X+ #else
X+ getandputrop0(psrc, xoffSrc, nend, pdst, alu);
X+ #endif /* PURDUE */
X }
X
X nl = nlMiddle + 1;
X***************
X*** 736,742 ****
X--- 774,784 ----
X --psrc;
X --pdst;
X getunalignedword(psrc, xoffSrc, tmpSrc)
X+ #ifndef PURDUE
X *pdst = DoRop(alu, tmpSrc, *pdst);
X+ #else
X+ DoRop(*pdst, alu, tmpSrc, *pdst);
X+ #endif /* PURDUE */
X }
X
X if (startmask)
END_OF_FILE
if test 3034 -ne `wc -c <'mfbbitblt.c.patch'`; then
echo shar: \"'mfbbitblt.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbbitblt.c.patch'
fi
if test -f 'mfbbstore.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbbstore.c.patch'\"
else
echo shar: Extracting \"'mfbbstore.c.patch'\" \(1127 characters\)
sed "s/^X//" >'mfbbstore.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbbstore.c.orig Mon Oct 31 13:47:25 1988
X--- ./ddx/mfb/mfbbstore.c Thu Nov 17 15:21:32 1988
X***************
X*** 60,65 ****
X--- 60,66 ----
X
X pBox = prgnSave->rects;
X pPt = pPtsInit;
X+ #ifndef PURDUE
X for (i = prgnSave->numRects; i > 0; i--) {
X pPt->x = pBox->x1 + xorg;
X pPt->y = pBox->y1 + yorg;
X***************
X*** 66,71 ****
X--- 67,76 ----
X pPt++;
X pBox++;
X }
X+ #else
X+ i = prgnSave->numRects;
X+ Duff(i, pPt->x = pBox->x1 + xorg; pPt->y = pBox->y1 + yorg; pPt++; pBox++);
X+ #endif /* PURDUE */
X
X
X mfbDoBitblt((DrawablePtr)pPixmap->drawable.pScreen->devPrivate,
X***************
X*** 112,117 ****
X--- 117,123 ----
X
X pBox = prgnRestore->rects;
X pPt = pPtsInit;
X+ #ifndef PURDUE
X for (i = prgnRestore->numRects; i > 0; i--) {
X pPt->x = pBox->x1 - xorg;
X pPt->y = pBox->y1 - yorg;
X***************
X*** 118,123 ****
X--- 124,133 ----
X pPt++;
X pBox++;
X }
X+ #else
X+ i = prgnRestore->numRects;
X+ Duff(i, pPt->x = pBox->x1 - xorg; pPt->y = pBox->y1 - yorg; pPt++; pBox++);
X+ #endif /* PURDUE */
X
X
X mfbDoBitblt(pPixmap,
END_OF_FILE
if test 1127 -ne `wc -c <'mfbbstore.c.patch'`; then
echo shar: \"'mfbbstore.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbbstore.c.patch'
fi
if test -f 'mfbfillrct.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbfillrct.c.patch'\"
else
echo shar: Extracting \"'mfbfillrct.c.patch'\" \(534 characters\)
sed "s/^X//" >'mfbfillrct.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbfillrct.c.orig Mon Oct 31 13:34:23 1988
X--- ./ddx/mfb/mfbfillrct.c Thu Nov 17 15:21:36 1988
X***************
X*** 81,86 ****
X--- 81,87 ----
X yorg = ((WindowPtr)pDrawable)->absCorner.y;
X prect = prectInit;
X n = nrectFill;
X+ #ifndef PURDUE
X while(n--)
X {
X prect->x += xorg;
X***************
X*** 87,92 ****
X--- 88,96 ----
X prect->y += yorg;
X prect++;
X }
X+ #else
X+ Duff (n, prect->x += xorg; prect->y += yorg; prect++);
X+ #endif
X }
X
X prect = prectInit;
END_OF_FILE
if test 534 -ne `wc -c <'mfbfillrct.c.patch'`; then
echo shar: \"'mfbfillrct.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbfillrct.c.patch'
fi
if test -f 'mfbgetsp.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbgetsp.c.patch'\"
else
echo shar: Extracting \"'mfbgetsp.c.patch'\" \(1052 characters\)
sed "s/^X//" >'mfbgetsp.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbgetsp.c.orig Tue Nov 1 17:07:19 1988
X--- ./ddx/mfb/mfbgetsp.c Thu Nov 17 15:21:26 1988
X***************
X*** 110,117 ****
X--- 110,121 ----
X
X if (srcBit + w <= 32)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, w, tmpSrc);
X putbits(tmpSrc, 0, w, pdst);
X+ #else
X+ getandputbits0(psrc, srcBit, w, pdst);
X+ #endif /* PURDUE */
X pdst++;
X }
X else
X***************
X*** 127,134 ****
X--- 131,142 ----
X srcStartOver = srcBit + nstart > 31;
X if (startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, nstart, tmpSrc);
X putbits(tmpSrc, 0, nstart, pdst);
X+ #else
X+ getandputbits0(psrc, srcBit, nstart, pdst);
X+ #endif /* PURDUE */
X if(srcStartOver)
X psrc++;
X }
X***************
X*** 142,149 ****
X--- 150,161 ----
X }
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, 0, nend, tmpSrc);
X putbits(tmpSrc, nstart, nend, pdst);
X+ #else
X+ putbits(*psrc, nstart, nend, pdst);
X+ #endif /* PURDUE */
X if(nstart + nend > 32)
X pdst++;
X }
END_OF_FILE
if test 1052 -ne `wc -c <'mfbgetsp.c.patch'`; then
echo shar: \"'mfbgetsp.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbgetsp.c.patch'
fi
if test -f 'mfbhrzvert.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbhrzvert.c.patch'\"
else
echo shar: Extracting \"'mfbhrzvert.c.patch'\" \(2049 characters\)
sed "s/^X//" >'mfbhrzvert.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbhrzvert.c.orig Tue Sep 6 13:53:44 1988
X--- ./ddx/mfb/mfbhrzvert.c Thu Nov 17 15:21:31 1988
X***************
X*** 84,91 ****
X--- 84,95 ----
X {
X if (startmask)
X *addrl++ &= ~startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ = 0x0;
X+ #else
X+ Duff (nlmiddle, *addrl++ = 0x0);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl &= ~endmask;
X }
X***************
X*** 93,100 ****
X--- 97,108 ----
X {
X if (startmask)
X *addrl++ |= startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ = 0xffffffff;
X+ #else
X+ Duff (nlmiddle, *addrl++ = 0xffffffff);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl |= endmask;
X }
X***************
X*** 102,109 ****
X--- 110,121 ----
X {
X if (startmask)
X *addrl++ ^= startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ ^= 0xffffffff;
X+ #else
X+ Duff (nlmiddle, *addrl++ ^= 0xffffffff);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl ^= endmask;
X }
X***************
X*** 136,141 ****
X--- 148,154 ----
X if (rop == RROP_BLACK)
X {
X bitmask = rmask[x1&0x1f];
X+ #ifndef PURDUE
X do
X {
X *addrl &= bitmask;
X***************
X*** 142,151 ****
X--- 155,168 ----
X addrl += nlwidth;
X }
X while (--len);
X+ #else
X+ Duff(len, *addrl &= bitmask; addrl += nlwidth );
X+ #endif /* PURDUE */
X }
X else if (rop == RROP_WHITE)
X {
X bitmask = mask[x1&0x1f];
X+ #ifndef PURDUE
X do
X {
X *addrl |= bitmask;
X***************
X*** 152,161 ****
X--- 169,182 ----
X addrl += nlwidth;
X }
X while (--len);
X+ #else
X+ Duff(len, *addrl |= bitmask; addrl += nlwidth );
X+ #endif /* PURDUE */
X }
X else if (rop == RROP_INVERT)
X {
X bitmask = mask[x1&0x1f];
X+ #ifndef PURDUE
X do
X {
X *addrl ^= bitmask;
X***************
X*** 162,167 ****
X--- 183,191 ----
X addrl += nlwidth;
X }
X while (--len);
X+ #else
X+ Duff(len, *addrl ^= bitmask; addrl += nlwidth );
X+ #endif /* PURDUE */
X }
X }
X
END_OF_FILE
if test 2049 -ne `wc -c <'mfbhrzvert.c.patch'`; then
echo shar: \"'mfbhrzvert.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbhrzvert.c.patch'
fi
if test -f 'mfbpntarea.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbpntarea.c.patch'\"
else
echo shar: Extracting \"'mfbpntarea.c.patch'\" \(2915 characters\)
sed "s/^X//" >'mfbpntarea.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbpntarea.c.orig Mon Oct 31 02:12:18 1988
X--- ./ddx/mfb/mfbpntarea.c Thu Nov 17 15:21:29 1988
X***************
X*** 99,109 ****
X--- 99,113 ----
X {
X maskpartialbits(pbox->x1, w, startmask);
X nlwExtra = nlwidth;
X+ #ifndef PURDUE
X while (h--)
X {
X *p OPEQ startmask;
X p += nlwExtra;
X }
X+ #else
X+ Duff(h, *p OPEQ startmask; p += nlwExtra);
X+ #endif
X }
X else
X {
X***************
X*** 118,125 ****
X--- 122,133 ----
X nlw = nlwMiddle;
X *p OPEQ startmask;
X p++;
X+ #ifndef PURDUE
X while (nlw--)
X *p++ EQWHOLEWORD;
X+ #else
X+ Duff(nlw, *p++ EQWHOLEWORD);
X+ #endif /* PURDUE */
X *p OPEQ endmask;
X p += nlwExtra;
X }
X***************
X*** 132,139 ****
X--- 140,151 ----
X nlw = nlwMiddle;
X *p OPEQ startmask;
X p++;
X+ #ifndef PURDUE
X while (nlw--)
X *p++ EQWHOLEWORD;
X+ #else
X+ Duff(nlw, *p++ EQWHOLEWORD);
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 142,149 ****
X--- 154,165 ----
X while (h--)
X {
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X while (nlw--)
X *p++ EQWHOLEWORD;
X+ #else
X+ Duff(nlw, *p++ EQWHOLEWORD);
X+ #endif /* PURDUE */
X *p OPEQ endmask;
X p += nlwExtra;
X }
X***************
X*** 153,160 ****
X--- 169,180 ----
X while (h--)
X {
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X while (nlw--)
X *p++ EQWHOLEWORD;
X+ #else
X+ Duff(nlw, *p++ EQWHOLEWORD);
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 257,267 ****
X--- 277,291 ----
X nlw = nlwMiddle;
X *p OPEQ (srcpix & startmask);
X p++;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p OPEQ srcpix;
X p++;
X }
X+ #else
X+ Duff (nlw, *p++ OPEQ srcpix);
X+ #endif /* PURDUE */
X *p OPEQ (srcpix & endmask);
X p += nlwExtra;
X }
X***************
X*** 276,286 ****
X--- 300,314 ----
X nlw = nlwMiddle;
X *p OPEQ (srcpix & startmask);
X p++;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p OPEQ srcpix;
X p++;
X }
X+ #else
X+ Duff(nlw, *p++ OPEQ srcpix);
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 291,301 ****
X--- 319,333 ----
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p OPEQ srcpix;
X p++;
X }
X+ #else
X+ Duff(nlw, *p++ OPEQ srcpix);
X+ #endif /* PURDUE */
X *p OPEQ (srcpix & endmask);
X p += nlwExtra;
X }
X***************
X*** 307,317 ****
X--- 339,353 ----
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p OPEQ srcpix;
X p++;
X }
X+ #else
X+ Duff(nlw, *p++ OPEQ srcpix);
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
END_OF_FILE
if test 2915 -ne `wc -c <'mfbpntarea.c.patch'`; then
echo shar: \"'mfbpntarea.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbpntarea.c.patch'
fi
if test -f 'mfbpolypnt.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbpolypnt.c.patch'\"
else
echo shar: Extracting \"'mfbpolypnt.c.patch'\" \(798 characters\)
sed "s/^X//" >'mfbpolypnt.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbpolypnt.c.orig Mon Oct 31 02:07:58 1988
X--- ./ddx/mfb/mfbpolypnt.c Thu Nov 17 15:21:30 1988
X***************
X*** 102,112 ****
X--- 102,116 ----
X nptTmp = npt;
X if (mode == CoordModeOrigin)
X {
X+ #ifndef PURDUE
X while(nptTmp--)
X {
X ppt->x += xorg;
X ppt++->y += yorg;
X }
X+ #else
X+ Duff(nptTmp, ppt->x += xorg; ppt++->y += yorg );
X+ #endif
X }
X else
X {
X***************
X*** 113,118 ****
X--- 117,123 ----
X ppt->x += xorg;
X ppt->y += yorg;
X nptTmp--;
X+ #ifndef PURDUE
X while(nptTmp--)
X {
X ppt++;
X***************
X*** 119,124 ****
X--- 124,132 ----
X ppt->x += (ppt-1)->x;
X ppt->y += (ppt-1)->y;
X }
X+ #else
X+ Duff(nptTmp, ppt++; ppt->x += (ppt-1)->x; ppt->y += (ppt-1)->y);
X+ #endif
X }
X
X ppt = pptInit;
END_OF_FILE
if test 798 -ne `wc -c <'mfbpolypnt.c.patch'`; then
echo shar: \"'mfbpolypnt.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbpolypnt.c.patch'
fi
if test -f 'mfbsetsp.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbsetsp.c.patch'\"
else
echo shar: Extracting \"'mfbsetsp.c.patch'\" \(640 characters\)
sed "s/^X//" >'mfbsetsp.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbsetsp.c.orig Tue Sep 6 13:53:38 1988
X--- ./ddx/mfb/mfbsetsp.c Thu Nov 17 15:21:27 1988
X***************
X*** 104,117 ****
X--- 104,125 ----
X while (nl--)
X {
X getbits(psrc, offSrc, 32, tmpSrc);
X+ #ifndef PURDUE
X *pdst = DoRop(alu, tmpSrc, *pdst);
X+ #else /* PURDUE */
X+ DoRop(*pdst, alu, tmpSrc, *pdst);
X+ #endif /* PURDUE */
X pdst++;
X psrc++;
X }
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, offSrc, nend, tmpSrc);
X putbitsrop(tmpSrc, 0, nend, pdst, alu);
X+ #else
X+ getandputrop0(psrc, offSrc, nend, pdst, alu);
X+ #endif /* PURDUE */
X }
X
X }
END_OF_FILE
if test 640 -ne `wc -c <'mfbsetsp.c.patch'`; then
echo shar: \"'mfbsetsp.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbsetsp.c.patch'
fi
if test -f 'mfbtile.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbtile.c.patch'\"
else
echo shar: Extracting \"'mfbtile.c.patch'\" \(2995 characters\)
sed "s/^X//" >'mfbtile.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbtile.c.orig Tue Sep 6 13:53:54 1988
X--- ./ddx/mfb/mfbtile.c Thu Nov 17 15:21:34 1988
X***************
X*** 108,115 ****
X--- 108,123 ----
X {
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X+ #ifndef PURDUE
X *p = (*p & ~startmask) |
X (DoRop(alu, srcpix, *p) & startmask);
X+ #else /* PURDUE */
X+ {
X+ unsigned _p;
X+ DoRop(_p, alu, srcpix, *p);
X+ *p = (*p & ~startmask) | (_p & startmask);
X+ }
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 126,134 ****
X--- 134,151 ----
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X *p = (*p & ~startmask) |
X (DoRop(alu, srcpix, *p) & startmask);
X+ #else /* PURDUE */
X+ {
X+ unsigned _p;
X+ DoRop(_p, alu, srcpix, *p);
X+ *p = (*p & ~startmask) | (_p & startmask);
X+ }
X+ #endif /* PURDUE */
X p++;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p = DoRop(alu, srcpix, *p);
X***************
X*** 136,141 ****
X--- 153,171 ----
X }
X *p = (*p & ~endmask) |
X (DoRop(alu, srcpix, *p) & endmask);
X+ #else /* PURDUE */
X+ while (nlw--)
X+ {
X+ DoRop(*p, alu, srcpix, *p);
X+ p++;
X+ }
X+
X+ {
X+ unsigned _p;
X+ DoRop(_p, alu, srcpix, *p);
X+ *p = (*p & ~endmask) | (_p & endmask);
X+ }
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 147,158 ****
X--- 177,200 ----
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X *p = (*p & ~startmask) |
X (DoRop(alu, srcpix, *p) & startmask);
X+ #else /* PURDUE */
X+ {
X+ unsigned _p;
X+ DoRop(_p, alu, srcpix, *p);
X+ *p = (*p & ~startmask) | (_p & startmask);
X+ }
X+ #endif /* PURDUE */
X p++;
X while (nlw--)
X {
X+ #ifndef PURDUE
X *p = DoRop(alu, srcpix, *p);
X+ #else /* PURDUE */
X+ DoRop(*p, alu, srcpix, *p);
X+ #endif /* PURDUE */
X p++;
X }
X p += nlwExtra;
X***************
X*** 165,170 ****
X--- 207,213 ----
X srcpix = psrc[iy];
X iy = ++iy < tileHeight ? iy : 0;
X nlw = nlwMiddle;
X+ #ifndef PURDUE
X while (nlw--)
X {
X *p = DoRop(alu, srcpix, *p);
X***************
X*** 172,177 ****
X--- 215,233 ----
X }
X *p = (*p & ~endmask) |
X (DoRop(alu, srcpix, *p) & endmask);
X+ #else /* PURDUE */
X+ while (nlw--)
X+ {
X+ DoRop(*p, alu, srcpix, *p);
X+ p++;
X+ }
X+
X+ {
X+ unsigned _p;
X+ DoRop(_p, alu, srcpix, *p);
X+ *p = (*p & ~endmask) | (_p & endmask);
X+ }
X+ #endif /* PURDUE */
X p += nlwExtra;
X }
X }
X***************
X*** 184,190 ****
X--- 240,250 ----
X nlw = nlwMiddle;
X while (nlw--)
X {
X+ #ifndef PURDUE
X *p = DoRop(alu, srcpix, *p);
X+ #else /* PURDUE */
X+ DoRop(*p, alu, srcpix, *p);
X+ #endif /* PURDUE */
X p++;
X }
X p += nlwExtra;
END_OF_FILE
if test 2995 -ne `wc -c <'mfbtile.c.patch'`; then
echo shar: \"'mfbtile.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbtile.c.patch'
fi
if test -f 'mfbwindow.c.patch' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mfbwindow.c.patch'\"
else
echo shar: Extracting \"'mfbwindow.c.patch'\" \(546 characters\)
sed "s/^X//" >'mfbwindow.c.patch' <<'END_OF_FILE'
X*** ./ddx/mfb/mfbwindow.c.orig Mon Oct 31 13:56:04 1988
X--- ./ddx/mfb/mfbwindow.c Thu Nov 17 15:21:22 1988
X***************
X*** 190,200 ****
X--- 190,205 ----
X return;
X ppt = pptSrc;
X
X+ #ifndef PURDUE
X for (i=0; i<nbox; i++, ppt++, pbox++)
X {
X ppt->x = pbox->x1 + dx;
X ppt->y = pbox->y1 + dy;
X }
X+ #else
X+ i = nbox;
X+ Duff(i, ppt->x = pbox->x1 + dx; ppt->y = pbox->y1 + dy; ppt++; pbox++);
X+ #endif /* PURDUE */
X
X mfbDoBitblt(pwinRoot, pwinRoot, GXcopy, prgnDst, pptSrc);
X DEALLOCATE_LOCAL(pptSrc);
END_OF_FILE
if test 546 -ne `wc -c <'mfbwindow.c.patch'`; then
echo shar: \"'mfbwindow.c.patch'\" unpacked with wrong size!
fi
# end of 'mfbwindow.c.patch'
fi
echo shar: End of archive 2 \(of 2\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked both archives.
rm -f ark[1-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
--
Mike Wexler(wyse!mikew) Phone: (408)433-1000 x1330
Moderator of comp.sources.x
More information about the Comp.sources.x
mailing list