32 bit pointers on a 64 bit system

2013-03-06 Thread David McQuillan
Have there been any implementations of gcc for a 32 bit pointer system 
where the registers are 64 bits long?


I was looking at AArch64 and wondering about whether it mightn't be 
better for a 32 bit system than AArch32 if all the pointers were 32 bit, 
and as far as the ABI is concerned half the general registers were 
treated as 32 bit. If more than 32 bits of address space were put in it 
could be used for data by using assembler inserts to use a long pointer 
to access it. I can't see any particular problems but that doesn't mean 
there aren't any great big ones!


David McQuillan


Re: 32 bit pointers on a 64 bit system

2013-03-06 Thread Jonathan Wakely
On 6 March 2013 12:38, David McQuillan wrote:
 Have there been any implementations of gcc for a 32 bit pointer system where
 the registers are 64 bits long?

Yes, the new x32 ABI for x86_64, see
https://sites.google.com/site/x32abi/ and
http://lwn.net/Articles/456731/


Re: 32 bit pointers on a 64 bit system

2013-03-06 Thread Andreas Schwab
David McQuillan d...@fano.co.uk writes:

 Have there been any implementations of gcc for a 32 bit pointer system
 where the registers are 64 bits long?

x32.

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
And now for something completely different.


Re: 32 bit pointers on a 64 bit system

2013-03-06 Thread Paul_Koning

On Mar 6, 2013, at 7:38 AM, David McQuillan wrote:

 Have there been any implementations of gcc for a 32 bit pointer system where 
 the registers are 64 bits long?

MIPS (N32 ABI, and if you want, also O64) is another example.

paul




Re: 32 bit pointers on a 64 bit system

2013-03-06 Thread Jeff Law

On 03/06/2013 07:21 AM, paul_kon...@dell.com wrote:


On Mar 6, 2013, at 7:38 AM, David McQuillan wrote:


Have there been any implementations of gcc for a 32 bit pointer system where 
the registers are 64 bits long?


MIPS (N32 ABI, and if you want, also O64) is another example.
The PA2.0 chips were commonly used in this manner as well when they were 
first delivered.  It's referred to as narrow mode.


jeff


Re: 32 bit pointers on a 64 bit system

2013-03-06 Thread David McQuillan
Thanks for that about the MIPS and PA. Gosh now I feel rather silly, I 
remember doing something like this years and years ago in a company I 
was in at the time with MIPS and PowerPC but it was roll our own rather 
than gcc. Parameters were passed on stack at the size they were rather 
than widened to 64 as in N32 but callee save registers had to be saved 
as 64 bits wide - but it didn't matter much as there were lots of work 
registers.  And we did have 64 bit longs with 32 bit pointers without 
any special problems with software even then. An interesting thing was 
we normally tried to separate registers holding pointers from those 
holding data in the call ABI. Sorry, I really had completely forgotten 
about it, I just don't know how all that work could have completely 
slipped my mind.


David McQuillan

On 06/03/2013 14:26, Jeff Law wrote:

On 03/06/2013 07:21 AM, paul_kon...@dell.com wrote:


On Mar 6, 2013, at 7:38 AM, David McQuillan wrote:

Have there been any implementations of gcc for a 32 bit pointer 
system where the registers are 64 bits long?


MIPS (N32 ABI, and if you want, also O64) is another example.
The PA2.0 chips were commonly used in this manner as well when they 
were first delivered.  It's referred to as narrow mode.


jeff