[phobos] 64-bit

Sean Kelly sean at invisibleduck.org
Wed Jun 30 21:43:31 PDT 2010


On Jun 30, 2010, at 9:39 PM, Walter Bright wrote:
> 
> Sean Kelly wrote:
>> 
>> 
>> What about the ABI changes for 64-bit?  Will function calls simply switch to stuffing the first arg into RAX instead of EAX and continue as-is?  Or is it too early to say?  I know the C calling convention is significantly different.
>> 
>>  
> 
> I intend to match the C 64 bit ABI. But that shouldn't affect D source code other than inline asm. The only problems D source code should have are:
> 
> 1. failure to account for changes in size_t and pointers
> 2. use of int and unsigned as indices for arrays that might get large
> 3. inline assembler (of course)
> 4. C header differences and differences in the C runtime library
> 
> If someone wants to get a head start on this, I'd start by reviewing the D files that interface with C, such as core.stdc.* and core.sys.* The system structs like _iobuf are surely different.

I put versions and conditionals in when I created those that should support 64-bit.  All that should be required is possibly some fiddling with core.sys.posix.config and possibly core.stdc.config.  The headers obviously haven't been tested as thoroughly in a 64-bit environment though, so it's possible I screwed something up and we just don't know it yet.  The asm in core.atomic should support 64-bit as well.  I haven't take care of core.thread yet though.



More information about the phobos mailing list