|
|
|
|
|
by kevincox
626 days ago
|
|
In theory you could use 3 extra bits for a bit pointer. Although the fact that a void* could hold it (or you need to make void* larger) would likely be an issue. The funny thing is that there are much more than 3 wasted bits on 64 bit pointers anyways. So we could just use bit pointers. Of course this has costs in the hardware. |
|
It doesn't seem too weird to me to make some kind of composite pointer that is a pointer plus some extra stuff. I've done some design work for a fantasy computer that has
- 48-bit words (fills up most of a Javascript double)
- 24-bit pointers (point to a 96 Mbyte address space)
- a "deep" extension that adds 6 bits to point to a starting bit and a 6 bit length field for an up to a 48 bit long extent -- extravagantly and maybe unrealistic for hardware these could extend into the next word. A zero length deep bit pointer could point to a UTF-8 character inside a word and there would be a load instruction that unpacks the next codepoint [2]
- a "wide" extension of 6 bits that points to one of 64 "address spaces" which are the unit of virtual memory management and could be contiguous to emulate a big address space bigger than 4GB with some room left for I/O spaces, video ram, etc.
- you're still left with 6 bits of "tag" to fill out a 48 bit word used for something defined by the OS or application
The backstory is that something like the IBM 360 had a baby with the PDP-10, had the word size doubled to get to VAX/370 XA size then had a baby with the Neo Geo arcade console to make a "home computer" that supports single/double width Unicode text. There would be extra points for there being a 24-bit instruction subset built in.
[1] https://arxiv.org/abs/2111.12800
[2] ... wouldn't it be nice to find a use for the illegal offset+length combinations?