Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!charon!dik From: dik@cwi.nl (Dik T. Winter) Newsgroups: comp.arch Subject: Re: overview of HP-PA Bitfield insts. Message-ID: <3352@charon.cwi.nl> Date: 18 Apr 91 00:02:39 GMT References: <51584@apple.Apple.COM> <1991Apr17.180036.3459@waikato.ac.nz> <3354@crdos1.crd.ge.COM> Sender: news@cwi.nl Organization: CWI, Amsterdam Lines: 31 In article <3354@crdos1.crd.ge.COM> davidsen@crdos1.crd.ge.com (bill davidsen) writes: > In article <1991Apr17.180036.3459@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: > | The only way I can see around this is to update the width value in > | the instruction itself--using self-modifying code. Hmmm, I seem to > | recall from another discussion some time ago that the HP-PA is one > | of those processors that will correctly invalidate its instruction cache > | if you do any writes to program code in memory. So this should work > | quite nicely. > Excuse me while I call Ralph on the porcelain intercom... this is a > good argument for an "execute" instruction, allowing you to build the > instruction in a register (hopefully) or the stack (if you must) and > then force an instruction fetch on it. > No matter how you do it you will slow things down to the point where > it's unlikely to be faster than the mask and shift, unfortunatly. Not so fast! You can have an execute instruction with delay slots! And as the true instruction has to be stuffed into the decoder, I think we need (at least) three delay slots. So we need also three annul bits to specify which of the following three instructions must be annulled. It gets a bit hairy of course if the instruction is an execute instruction again. More serious to the original question. Indeed, in applications like compress your bit fields vary (offhand I would not know other applications, e.g. there is no such need for Huffman coding as you only know the size if you know the value). What I would do if I did compress in assembler was doing different streams of code for 9 bits, 10 bits etc. When 9 bits is exhausted you just jump to the 10 bits stream. Of course the code will be larger, but the source only marginally so if you use macro's (and the HP assembler is a macro assembler). -- dik t. winter, cwi, amsterdam, nederland dik@cwi.nl