> On 2006-03-24, Dmitry <di...@spec.ru> wrote: > > On Friday 24 March 2006 18:37, Grant Edwards wrote: > >> You're really going to add support to gcc for supporting > >> code/data pointers of different sizes (e.g. 20 bit code > >> pointers and 16 bit data pointers)? > > > > yes, gcc allows for this. > > Really? Cool. The last time I looked into that (which, now > that I think about it, was a couple years ago), gcc couldn't > support that and there didn't appear to be any plans in that > direction. > > -- > Grant Edwards grante Yow! I'm also against > at BODY-SURFING!! > visi.com >
I don't know much about the internals of gcc, but I do know that it has support for various different pointer arrangements. For example, on PPC targets, it supports the concept of a "small data segment", which is addressed by 16-bit offsets from a base register rather than as full 32-bit addresses. There is perhaps also support for mixed pointer sizes coming from the 64-bit arena - you might well have use for 64-bit address pointers, but I suspect 64-bit code pointers have less use. What might be more interesting is whether gcc can make use of the 20 bit data sizes for other purposes, such as for arithmetic. The slides in the posted link also hint at some direct support for 32-bit data (page 9, references to the A/L bit as "20-bit Address word/32-bit Long"). One thing that slightly concerns me, however, is preservation of registers in call stacks - are these now all going to need twice the stack space, since all 20 bits of a callee-preserved register must be saved?