From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9812 invoked from network); 1 Apr 2022 18:29:47 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 1 Apr 2022 18:29:47 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 12CB79D706; Sat, 2 Apr 2022 04:29:46 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C41339D6FA; Sat, 2 Apr 2022 04:28:49 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 2EAD59D6FA; Sat, 2 Apr 2022 04:28:42 +1000 (AEST) X-Greylist: delayed 3745 seconds by postgrey-1.36 at minnie.tuhs.org; Sat, 02 Apr 2022 04:28:41 AEST Received: from darkstar.fourwinds.com (fourwinds.com [63.64.179.162]) by minnie.tuhs.org (Postfix) with ESMTPS id 5C3239D6F9 for ; Sat, 2 Apr 2022 04:28:41 +1000 (AEST) Received: from darkstar.fourwinds.com (localhost [127.0.0.1]) by darkstar.fourwinds.com (8.16.1/8.15.2) with ESMTP id 231HQFQ73349499 for ; Fri, 1 Apr 2022 10:26:15 -0700 Received: from darkstar.fourwinds.com (jon@localhost) by darkstar.fourwinds.com (8.16.1/8.15.2/Submit) with ESMTP id 231HQFm03349496 for ; Fri, 1 Apr 2022 10:26:15 -0700 Message-Id: <202204011726.231HQFm03349496@darkstar.fourwinds.com> From: Jon Steinhart To: TUHS main list In-reply-to: <44FEFAE6-720F-4449-84DB-228B7A6C097C@kdbarto.org> References: <44FEFAE6-720F-4449-84DB-228B7A6C097C@kdbarto.org> Comments: In-reply-to David Barto message dated "Fri, 01 Apr 2022 10:15:11 -0700." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3349494.1648833975.1@darkstar.fourwinds.com> Date: Fri, 01 Apr 2022 10:26:15 -0700 X-JON-SPAM: local delivery Subject: Re: [TUHS] A Reiser tour de force X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" David Barto writes: > > > > > On Apr 1, 2022, at 8:59 AM, Douglas McIlroy wrote: > > > > The recent discussion about Research choosing BSD's paging over > > Reiser-London's brought to mind a stunning program by Reiser that > > Research did adopt. > > > > A critical primitive in the Blit terminal was bitblt (block transfer > > of a rectangular area). It was used ubiquitously, for example to > > refresh data when window-stacking changed, to move data within a > > window, or to pop up a menu.. The display memory was word-oriented, so > > bitblt was fraught with niggling details about bit alignment and > > overlap of source and destination. A general bitblt subroutine was a > > rats' nest of conditionals--grossly inefficient for important special > > cases like scrolling. > > > > Bitblt got refined (i.e. elaborated) several times before Reiser did > > away with it entirely. Instead he wrote a just-in-time generator of > > optimal code. Thousands of distinct variants, which varied in size > > from 16 to 72 bytes, could be produced by the same 400 lines of > > assembler code. > > > > Doug > > Does this exist for the rest of us to study? > > David It's not insanely complicated by modern standards. Without any knowledge of other work, I did the same thing for a 68020 based graphics system where the JIT code went into the I-cache and was amazingly fast for its day. If I remember correctly, things started with an outer-loop test to see if there were overlapping regions to determine whether to go forward to backwards to avoid having the destination trash the source. Then, there was an inner loop test for whether or not the left edge was on a word boundary, the right edge was on a word boundary, or whether or not both edges were inside of the same word. Depending on the results the generated inner loop code had left edge handling, non-edge handling, and right edge handling code. Finally, code was generated plugging in whatever was needed for the op-code. Maybe this is just a semantic nit, but to me this is just a better implementation of bitblt, not doing away with it. Jon