Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.misc Subject: Re: Aggressive optimization Message-ID: <5961@lanl.gov> Date: 14 Nov 90 21:38:53 GMT References: <2732@l.cc.purdue.edu> Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 15 From article <2732@l.cc.purdue.edu>, by cik@l.cc.purdue.edu (Herman Rubin): > [...] > Well, here is an example which will definitely not work on all machines. > It is desired to move 3 bytes into the three least significant bytes of > a 4-byte word (other sizes are appropriate), and repeat this operation. > This can be done efficiently by using pointers to words on a machine with > unaligned reads. Even with overhead for unaligned reads, it is hard to > see how to do this efficiently otherwise. It's hard to see what this has to do with the array vs. pointer issue which was being discussed. It looks to me like you've got a word that's being 'mapped' as an array of bytes and your loop is filling the bottom three bytes. Where are the pointers? J. Giles