Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.arch Subject: Re: Unaligned Accesses (was Re: How to use silicon) Summary: An example where unaligned is needed Message-ID: <1189@l.cc.purdue.edu> Date: 25 Mar 89 13:37:21 GMT References: <37196@bbn.COM> <1989Mar16.190043.23227@utzoo.uucp> <59@microsoft.UUCP> Organization: Purdue University Statistics Department Lines: 25 In article <59@microsoft.UUCP>, w-colinp@microsoft.UUCP (Colin Plumb) writes: > mlord@bnr-public.UUCP (Mark Lord) wrote: > > The "break into multiple aligned arrays" approach can work fine as long > > as one is dealing with arrays (of structures) to begin with. Unfortunately, > > I suspect that this is not of much use with dynamically allocated linked > > lists of structures, which is very likely when we are talking about multiple > > megabytes of data. .......................... Here is an actual example where unaligned is at least highly desirable. One has an array of bits; we may assume byte alignment is free. It is necessary to take a 24-bit block at a time to the right 24 bits of a 32-bit word. These 24 bits can be anywhere in the block, but this has to be done repeatedly, and can be vectorized if desired. Bits used may not be reused. It is also necessary to keep track of pointers, as the input array may need to be refilled, almost without warning and possibly at an unpredictable time. The refill procedure is somewhat costly. I believe that the penalty for unalignment will be cheaper than anything else if the necessary hardware is there. -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)