Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!marick From: marick@m.cs.uiuc.edu Newsgroups: comp.arch Subject: Re: Is handling off-alignment impor Message-ID: <3300155@m.cs.uiuc.edu> Date: 9 Aug 90 16:36:00 GMT References: <40711@mips.mips.COM> Lines: 30 Nf-ID: #R:mips.mips.COM:40711:m.cs.uiuc.edu:3300155:000:1284 Nf-From: m.cs.uiuc.edu!marick Aug 9 11:36:00 1990 Lisp objects are typed at runtime. This is usually implemented by using tag bits in the pointers to those objects. Objects small enough to fit in a word have tag bits that say, "I'm not a pointer; I'm a short integer" or whatever. In Lucid's Common Lisp, they used the two low-order bits as the tag. On a machine that simply ignored the low-order bits on dereferencing, they could avoid masking those bits off. I don't know whether they did so. Another advantage of this scheme is that the tag bits for short-integers are 0. No masking is needed before addition, and overflows can be detected by hardware. You do have to remember to shift integers before output. The Gould Powernode machines had 32 bit words, 24 bit addresses. The top 8 bits were ignored. In our Lisp, we put the tag bits there. Again, there was no need to mask before dereferences. The tag bits for positive short ints were 0x0 and for negative short ints were 0xff, so machine addition could be used without masking. However, you had to check for overflow into the tag bits. (Note: I didn't work for Lucid. As I recall, I learned this with their debugger. I think the trick has been floating around for a while.) Brian Marick Motorola @ University of Illinois marick@cs.uiuc.edu, uiucdcs!marick