Ancestors

Toot

Written by Tobin Baker on 2024-10-02 at 22:08

Question about pointer tagging: I really need 17 bits for my tag but it won't fit into the 16 available high bits on Aarch64. Now I'm wondering about combining high/low bits in a single tag: shift 8- or 16-byte-aligned address right 3 or 4 bits, then use the high 19 or 20 bits for the tag, then shift and mask to use the pointer. Has anyone done anything like this before?

=> More informations about this toot | More toots from tobinbaker@discuss.systems

Descendants

Written by Greg Parker on 2024-10-03 at 00:53

@tobinbaker Been there, done that. aarch64's instructions can do this reasonably efficiently. Storing the pointer bits unshifted in the tagged representation is convenient for debuggability: it's easier for humans to recognize that there is an address inside the value. But sometimes it is more efficient to store it differently to optimize the instruction sequences.

=> More informations about this toot | More toots from gparker@discuss.systems

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113240106482849913
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
349.466476 milliseconds
Gemini-to-HTML Time
0.813954 milliseconds

This content has been proxied by September (ba2dc).