[Issue 24412] No predefined version for 64bit ?!

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 26 15:06:52 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24412

--- Comment #9 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #7)
> https://dlang.org/spec/version.html
> 
> Says:
> 
> ```
>     D_LP64	Pointers are 64 bits (command line switch -m64). (Do not confuse
> this with C's LP64 model)
>     D_X32	Pointers are 32 bits, but words are still 64 bits (x32 ABI) (This
> can be defined in parallel to X86_64)
> ```
Introduced by https://github.com/dlang/dlang.org/pull/175

As one comment pointed out:
"""
X32 is a specific implementation for x86-64 hardware, but the description
refers to an abstract concept
"""

Adding "x32 ABI" was the compromise, but I don't think it's explicit enough.

Pick any wiki, and the description is better:
"""
X32 is an alternative ABI for x86-64 that uses the full 64-bit x86-64
instruction and register set and 32-bit pointers and longs.
"""
https://sourceware.org/glibc/wiki/x32

"""
The x32 ABI provides 32-bit integers, long and pointers (ILP32) on Intel and
AMD 64-bit hardware
"""
https://en.wikipedia.org/wiki/X32_ABI

> Note how something simple turned into a monstrosity that nobody can figure
> out, and the documentation is both wrong and incomplete. Sigh.
> 
> I suspect that the undocumented X32 is what Manu is looking for, but dmd
> never generates it. Does gdc or ldc?
That is a typo in dmd, introduced by https://github.com/dlang/dmd/pull/12508

D_X32 is predefined by gdc on X32 targets, itself is now a deprecated ABI of
X86_64.  I had and still have doubts that DMD would support such a `-target`
anyway.

A more informative version identifier for it would have been X86_64_X32, but
this was added at a time where brevity was preferred over clarity for some
reason. Which also left in the spec D_AVX and D_AVX2 (yuck!) instead of
X86_64_AVX and X86_64_AVX2.

--


More information about the Digitalmars-d-bugs mailing list