C++ Logo

liaison

Advanced search

Re: [isocpp-wg14/wg21-liaison] P3248R0 Require [u]intptr_t

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Fri, 24 May 2024 10:06:10 +0200
Gonzalo,

on Fri, 24 May 2024 07:26:04 +0000 you (Gonzalo Brito
<gonzalob_at_[hidden]>) wrote:

> > There are only a few platforms that don't have these types, the
> > only ones we found have 128 bit pointers and 64 bit `uintmax_t`.
>
> The only one I’ve found is IBM AS/4000, which are supported both via
> their ILC compiler (which is stuck on only supporting an old C
> standard), but also has GCC 11 support, and through g++ also C++
> support, which lacks uintptr_t to avoid breaking their ABI, but could
> add it post C23 without breaking it.

yes and yes

> I’ve tried to get in contact with the IBM AS/4000 stakeholders
> through my network, but have been unsuccesful…

You might talk to Rajan who sits for IBM on WG14.

> - Do you know of other platforms beyond IBM AS/4000 ? (I’d like to
> include a comprehensive list in the paper)

Yes, we found a Russian chipset that basically had the same
problem. But information on that was even more scarce than for AS/400
and there doesn't seem anybody involved in C or C++ standards that
works for any of this.

For both platforms this does not seem to be simply "just designate a
128 bit type to map to", otherwise they probably would have done it
already, but has ABI implications. For AS/400 I have seen people
advertising something similar to just paint over with a `uint64_t[2]`
but whether or not this works as expected I don't know.

The problem here is to specify what you'd expect from such a mapping
of pointer values to integers. In TS 6010 we only claim three things:

- roundtrip
- equality check
- that order is respected where it is defined on both sides, that is
  if you are comparing two pointers from the same array, the converted
  integers compare the same way

There is no guarantee that the mapping is consistent with some form of
arithmetic (there can e.g be bumps in the address space) or that you
may easily deduce alignment properties.

> - Do you have the contact of these stakeholders and can put us in
> contact with them, so that we can involve them?

For IBM see above. For the Russian chip I don't know. I don't even
completely remember the name (it had something starting with "Rus")
but it seemed to be an important part of the infrastructure, there,
with several variants that had been produced.

One possibility to smoothen things could be to restart the initiative
in WG14, but it would really be good if you could get some opinion
from these stakeholders such that we see where we are getting into.

Thanks
Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Received on 2024-05-24 08:06:16