Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!rpw3 From: rpw3@amdcad.AMD.COM (Rob Warnock) Newsgroups: comp.arch Subject: Re: Explanation, please! Message-ID: <22889@amdcad.AMD.COM> Date: 10 Sep 88 06:34:09 GMT References: <638@paris.ics.uci.edu> <566@pcrat.UUCP> <9087@pur-ee.UUCP> <5654@june.cs.washington.edu> <22859@amdcad.AMD.COM> Reply-To: rpw3@amdcad.UUCP (Rob Warnock) Organization: [Consultant] San Mateo, CA Lines: 37 In article <22859@amdcad.AMD.COM> tim@delirun.amd.com (Tim Olson) writes: +--------------- | We use an interesting trick in the Am29000 memcpy routine for | source/destination misalignment. In this case, we set up the alignment | difference in the funnel-count register, read in two source words, and | "extract" a destination word using the funnel-shifter's ability to | extract any 32-bit word from a 64-bit double-word in a single cycle. | The inner loop then consists of shifting the low source word to the high | source word, reading a new low source word, extracting a destination and | storing it... +--------------- It's even better than that, Tim. In the non-aligned case, the inner loop of the "bcopy()" routine in the 4.3 port for the 29000 uses load-multiple to grab a bunch of source words (making good use of "burst mode" in the memory, if any), a straight-line series of extract's, then a store-multiple, with a couple more instructions at either end of the inner block to propagate the "left-over" bits to the next block. Using this trick, an Am29000 can do large block transfers between arbitary *bit* boundaries with an asymptotic overhead of only one more cycle per word than word-aligned block-copy. Given single-cycle burst-mode memories (not hard to achieve, it's starting the burst that's expense), that puts the asymptotic performance of non-aligned transfers at 3 cycles/word, and word-aligned transfers at 2 cycles/word. Not too shabby... An assembly-language version of Duff's device keeps the overhead for small transfers reasonable, too. Rob Warnock Systems Architecture Consultant UUCP: {amdcad,fortune,sun}!redwood!rpw3 ATTmail: !rpw3 DDD: (415)572-2607 USPS: 627 26th Ave, San Mateo, CA 94403