home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / p2speedups / patch1 < prev    next >
Encoding:
Internet Message Format  |  1989-01-31  |  9.5 KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v03i007:  Purdue speedups to R3 server, Release 2, Patch1
  5. Message-ID: <2023@wyse.wyse.com>
  6. Date: 31 Jan 89 19:58:42 GMT
  7. Organization: Wyse Technology, San Jose
  8. Lines: 308
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: Gene Spafford <spaf@purdue.edu>
  12. Posting-number: Volume 3, Issue 7
  13. Archive-name: p2speedups/patch1
  14.  
  15.  
  16.  
  17. The patch set for Purdue.2.1 I sent out yesterday was wrong.
  18. Enclosed is the correct one.
  19.  
  20. This should be the last for a while.   The one works on Sun4 machines.
  21.  
  22. --spaf
  23.  
  24.  
  25. # Update #1 to Purdue/Purdue+ patches 2.0 release (2.1)
  26. # Shar archive.  Give the following as input to /bin/sh
  27. #  Packed Wed Jan 25 23:32:34 EST 1989 by spaf@uther.cs.purdue.edu
  28. #
  29. #  This archive contains:
  30. #    README
  31. #    maskbits.h.patch
  32. #    mfbplygblt.c.patch
  33. #
  34. #
  35. echo x - README
  36. sed 's/^X//' >README <<'*-*-END-of-README-*-*'
  37. XThis contains a slight bugfix to the Purdue 2.0 patchset
  38. X(maskbits.h.patch), and a bugfix to the way character glyphs are drawn
  39. Xto the screen (mfbplygblt.c).  The second bugfix is not actually part
  40. Xof the Purdue speedups, but fixes a bug present in the original
  41. Xserver.
  42. X
  43. XApply the:
  44. X   maskbits.h.patch file to the Purdue2.0 version of ddx/mfb/maskbits.h
  45. X   mfbplygblt.c.patch file to the X.V11R3 version of ddx/mfb/mfbplygblt.c
  46. X
  47. X>From: John Irwin <franz!sparky!jdi@ucbarpa.Berkeley.EDU>
  48. X>To: Gene Spafford <purdue.edu!spaf>
  49. X>Cc: citi.umich.edu!martin
  50. X>Date: Tue, 24 Jan 89 12:21:49 -0800
  51. X>Return-Path: <sparky!jdi>
  52. X>Subject: Re: Release 2.0 of Purdue/Purdue+ Speedups 
  53. X>In-Reply-To: Your message of Sun, 22 Jan 89 19:38:34 -0500.
  54. X>             <8901230038.AA05417@uther.cs.purdue.edu> 
  55. X>
  56. X>I guess neither of you has a Sun4, since I just tried to compile a sun4 server
  57. X>with the Purdue 2.0 patches in place and it failed.
  58. X>
  59. X>The problem is that mfbfillsp uses getandputrop.  Since FASTGETBITS and
  60. X>FASTPUTBITS are not defined on the sun4, since it isn't a vax or mc68020,
  61. X>getandputrop is defined as <getbits, putbitsrop>.  However, you put the
  62. X>definition of putbitsrop into a #ifndef PURDUE section, instead of putting it
  63. X>into #ifndef FASTPUTBITS section.  (Thus putbitsrop isn't defined at all)
  64. X>
  65. X>In fact, glancing at the code would indicate that building a sun3 server with
  66. X>NO_3_60_CG4 using sun's cc will fail similarly.
  67. X>
  68. X>    -- John
  69. X
  70. X
  71. XThanks John,
  72. X
  73. XGene & Martin        1/24/89
  74. X
  75. Xspaf@purdue.edu
  76. Xmartin@citi.umich.edu
  77. *-*-END-of-README-*-*
  78. echo x - maskbits.h.patch
  79. sed 's/^X//' >maskbits.h.patch <<'*-*-END-of-maskbits.h.patch-*-*'
  80. X*** ddx/mfb.purdue2.0/maskbits.h    Tue Jan 24 20:24:39 1989
  81. X--- ddx/mfb/maskbits.h    Wed Jan 25 18:34:38 1989
  82. X***************
  83. X*** 1,4 ****
  84. X! /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
  85. X  /***********************************************************
  86. X  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  87. X  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  88. X--- 1,4 ----
  89. X! /* Combined Purdue/PurduePlus patches, level 2.1, 1/24/89 */
  90. X  /***********************************************************
  91. X  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  92. X  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  93. X***************
  94. X*** 346,356 ****
  95. X  #endif mc68020
  96. X  #endif __GNUC__
  97. X  
  98. X! /*  The following version is used on 3/60+CG4 machines, and those
  99. X!  *  not defining FASTPUTBITS, above
  100. X   */
  101. X  
  102. X! #define u_putbits(src, x, w, pdst) \
  103. X  { \
  104. X      register int n = (x)+(w)-32; \
  105. X      \
  106. X--- 346,374 ----
  107. X  #endif mc68020
  108. X  #endif __GNUC__
  109. X  
  110. X! /*  The following flag is used to override a bugfix for sun 3/60+CG4 machines,
  111. X   */
  112. X  
  113. X! /*  We don't need to be careful about this unless we're dealing with sun3's 
  114. X!  *  We will default its usage for those who do not know anything, but will
  115. X!  *  override its effect if the machine doesn't look like a sun3 
  116. X!  */
  117. X! #if !defined(mc68020) || !defined(sun)
  118. X! #define NO_3_60_CG4
  119. X! #endif
  120. X! 
  121. X! /* This is gross.  We want to #define u_putbits as something which can be used
  122. X!  * in the case of the 3/60+CG4, but if we use /bin/cc or are on another
  123. X!  * machine type, we want nothing to do with u_putbits.  What a hastle.  Here
  124. X!  * I used slo_putbits as something which either u_putbits or putbits could be
  125. X!  * defined as.
  126. X!  *
  127. X!  * putbits gets it iff it is not already defined with FASTPUTBITS above.
  128. X!  * u_putbits gets it if we have FASTPUTBITS (putbits) from above and have not
  129. X!  *     overridden the NO_3_60_CG4 flag.
  130. X!  */
  131. X! 
  132. X! #define slo_putbits(src, x, w, pdst) \
  133. X  { \
  134. X      register int n = (x)+(w)-32; \
  135. X      \
  136. X***************
  137. X*** 370,385 ****
  138. X      } \
  139. X  }
  140. X  
  141. X! /*  We don't need this flag unless we're dealing with Suns */
  142. X! #ifndef mc68020
  143. X! #define NO_3_60_CG4
  144. X  #endif
  145. X  
  146. X! /* ...and we don't need this macro unless we have a 3/60+CG4 */
  147. X! #ifdef NO_3_60_CG4
  148. X! #undef u_putbits
  149. X! #define u_putbits(src, x, w, pdst)  putbits(src, x, w, pdst)
  150. X! #endif /* NO_3_60_C64 */
  151. X  
  152. X  /* Now if we have not gotten any really good bitfield macros, try some
  153. X   * moderately fast macros.  Alas, I don't know how to do asm instructions
  154. X--- 388,402 ----
  155. X      } \
  156. X  }
  157. X  
  158. X! #if defined(putbits) && !defined(NO_3_60_CG4)
  159. X! #define u_putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst)
  160. X! #else
  161. X! #define u_putbits(src, x, w, pdst) putbits(src, x, w, pdst)
  162. X  #endif
  163. X  
  164. X! #if !defined(putbits) 
  165. X! #define putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst)
  166. X! #endif
  167. X  
  168. X  /* Now if we have not gotten any really good bitfield macros, try some
  169. X   * moderately fast macros.  Alas, I don't know how to do asm instructions
  170. X***************
  171. X*** 386,395 ****
  172. X   * without gcc.
  173. X   */
  174. X  
  175. X- #ifndef putbits
  176. X- #define putbits(src, x, w, pdst)  u_putbits(src, x, w, pdst)
  177. X- #endif
  178. X- 
  179. X  #ifndef getbits
  180. X  #define getbits(psrc, x, w, dst) \
  181. X  { \
  182. X--- 403,408 ----
  183. X***************
  184. X*** 399,408 ****
  185. X  }
  186. X  #endif
  187. X  
  188. X- /* If our getbits and putbits are fast enough,
  189. X-  * do this brute force, it's faster
  190. X-  */
  191. X- 
  192. X  /*  We have to special-case putbitsrop because of 3/60+CG4 combos
  193. X   */
  194. X  
  195. X--- 412,417 ----
  196. X***************
  197. X*** 432,439 ****
  198. X      } \
  199. X  }
  200. X  
  201. X! #if defined(FASTPUTBITS) && defined(FASTGETBITS)
  202. X  
  203. X  #define putbitsrop(src, x, w, pdst, rop) \
  204. X  { \
  205. X    register int _tmp, _tmp2; \
  206. X--- 441,451 ----
  207. X      } \
  208. X  }
  209. X  
  210. X! /* If our getbits and putbits are FAST enough,
  211. X!  * do this brute force, it's faster
  212. X!  */
  213. X  
  214. X+ #if defined(FASTPUTBITS) && defined(FASTGETBITS) && defined(NO_3_60_CG4)
  215. X  #define putbitsrop(src, x, w, pdst, rop) \
  216. X  { \
  217. X    register int _tmp, _tmp2; \
  218. X***************
  219. X*** 442,455 ****
  220. X    DoRop(_tmp, rop, _tmp2, _tmp) \
  221. X    FASTPUTBITS(_tmp, x, w, pdst); \
  222. X  }
  223. X- 
  224. X- #ifdef NO_3_60_CG4
  225. X- #undef u_putbitsrop
  226. X- #else
  227. X- #undef putbitsrop
  228. X- #define putbitsrop(src, x, w, pdst, rop)  u_putbitsrop(src, x, w, pdst, rop)
  229. X- #endif /* NO_3_60_C64 */
  230. X- 
  231. X  #define putbitsrrop(src, x, w, pdst, rop) \
  232. X  { \
  233. X    register int _tmp, _tmp2; \
  234. X--- 454,459 ----
  235. X***************
  236. X*** 459,465 ****
  237. X--- 463,474 ----
  238. X    _tmp= DoRRop(rop, _tmp2, _tmp); \
  239. X    FASTPUTBITS(_tmp, x, w, pdst); \
  240. X  }
  241. X+ #undef u_putbitsrop
  242. X  #endif
  243. X+ 
  244. X+ #ifndef putbitsrop
  245. X+ #define putbitsrop(src, x, w, pdst, rop)  u_putbitsrop(src, x, w, pdst, rop)
  246. X+ #endif 
  247. X  
  248. X  #ifndef putbitsrrop
  249. X  #define putbitsrrop(src, x, w, pdst, rop) \
  250. *-*-END-of-maskbits.h.patch-*-*
  251. echo x - mfbplygblt.c.patch
  252. sed 's/^X//' >mfbplygblt.c.patch <<'*-*-END-of-mfbplygblt.c.patch-*-*'
  253. X*** ddx/mfb/mfbplygblt.c~    Tue Sep  6 14:54:07 1988
  254. X--- ddx/mfb/mfbplygblt.c    Tue Jan 24 17:48:54 1989
  255. X***************
  256. X*** 1,3 ****
  257. X--- 1,4 ----
  258. X+ /* Combined Purdue/PurduePlus patches, level 2.1, 1/24/89 */
  259. X  /***********************************************************
  260. X  Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  261. X  and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  262. X***************
  263. X*** 236,241 ****
  264. X--- 237,245 ----
  265. X      int glyphRow;        /* first row of glyph not wholly
  266. X                     clipped out */
  267. X      int glyphCol;        /* leftmost visible column of glyph */
  268. X+ #ifdef PURDUE
  269. X+     int getWidth;           /* bits to get from glyph */
  270. X+ #endif  /* PURDUE */
  271. X  
  272. X      if(!(ppos = (TEXTPOS *)ALLOCATE_LOCAL(nglyph * sizeof(TEXTPOS))))
  273. X          return;
  274. X***************
  275. X*** 327,332 ****
  276. X--- 331,339 ----
  277. X  
  278. X          glyphCol = (leftEdge - ppos[i].xpos) -
  279. X                 (pci->metrics.leftSideBearing);
  280. X+ #ifdef PURDUE
  281. X+         getWidth = w + glyphCol;
  282. X+ #endif  /* PURDUE */
  283. X          xoff = xchar + (leftEdge - ppos[i].xpos);
  284. X          if (xoff > 31)
  285. X          {
  286. X***************
  287. X*** 344,350 ****
  288. X--- 351,361 ----
  289. X              maskpartialbits(xoff, w, startmask);
  290. X              while (h--)
  291. X              {
  292. X+ #ifndef PURDUE
  293. X              getshiftedleftbits(pglyph, glyphCol, w, tmpSrc);
  294. X+ #else  /* PURDUE */
  295. X+             getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
  296. X+ #endif  /* PURDUE */
  297. X              *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  298. X              pglyph += widthGlyph;
  299. X              pdst += widthDst;
  300. X***************
  301. X*** 356,362 ****
  302. X--- 367,377 ----
  303. X              nFirst = 32 - xoff;
  304. X              while (h--)
  305. X              {
  306. X+ #ifndef PURDUE
  307. X              getshiftedleftbits(pglyph, glyphCol, w, tmpSrc);
  308. X+ #else  /* PURDUE */
  309. X+             getshiftedleftbits(pglyph, glyphCol, getWidth, tmpSrc);
  310. X+ #endif  /* PURDUE */
  311. X              *pdst OPEQ (SCRRIGHT(tmpSrc, xoff) & startmask);
  312. X              *(pdst+1) OPEQ (SCRLEFT(tmpSrc, nFirst) & endmask);
  313. X              pglyph += widthGlyph;
  314. *-*-END-of-mfbplygblt.c.patch-*-*
  315. exit
  316. -- 
  317. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  318. Moderator of comp.sources.x
  319.