Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.arch Subject: Re: Bitfield instructions--a good idea? Message-ID: <3357@crdos1.crd.ge.COM> Date: 19 Apr 91 14:29:29 GMT References: <1991Apr15.193425.3436@waikato.ac.nz> <1991Apr18.093804.18183@odin.diku.dk> <1991Apr18.195841.10588@zoo.toronto.edu> Reply-To: davidsen@crdos1.crd.ge.com (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 19 In article <1991Apr18.195841.10588@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: | Unless access to memory is seriously expensive, table lookup can implement | both of these operations quite efficiently. Agreed, it's not as fast as | having them wired in... This is true, but the original topic was somewhat more general, breaking N bit chunks into parts and assembling them. In the case where N is a power of two I think the table lookup loses if I want the data elsewhere. I can generate it faster than I can read it from memory (on most machines). The problem comes when I want to go from words back to byte packing. In this case a lookup doesn't help, and I have to fetch, shift, and or the bits regardless of wether I do it with an instruction or a loop. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "Most of the VAX instructions are in microcode, but halt and no-op are in hardware for efficiency"