C++ Logo


Advanced search

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

From: Gonzalo Brito <gonzalob_at_[hidden]>
Date: Fri, 24 May 2024 08:57:47 +0000
> You might talk to Rajan who sits for IBM on WG14.

Thank you Jens:
- added list of concrete impls lacking [u]intptr_t today (only includes IBM AS/400 right now)
- sent email to Rajan to involve them as a stakeholder and capture their feedback (you are in CC)

> The problem here is to specify what you'd expect from such a mapping of pointer values to integers. In

This proposal just requires [u]intptr_t . The semantics are not in the C++ standard, but in the C standard. This ensures that C and C++ do not diverge here. If the implementation provides TS 6010, then that’s what the user gets. If it doesn’t, the answer to some of these questions is anyone’s best guess (open up your compiler, and figure out what it does).

From: Jₑₙₛ Gustedt <jens.gustedt_at_[hidden]>
Date: Friday, 24. May 2024 at 10:06
To: Gonzalo Brito <gonzalob_at_[hidden]>
Cc: Nina Dinka Ranns via Liaison <liaison_at_[hidden]>, Nina Dinka Ranns <dinka.ranns_at_[hidden]>
Subject: Re: [isocpp-wg14/wg21-liaison] P3248R0 Require [u]intptr_t

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.


:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Ficube-icps.unistra.fr%2Findex.php%2FJens_Gustedt&data=05%7C02%7Cgonzalob%40nvidia.com%7Ca3cbea76822e4239848008dc7bc86161%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638521347790791436%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=kq8tzJ6MX%2BXtFzUEDCDSPxkAbjspa5drIkTmFDA9DyI%3D&reserved=0<https://icube-icps.unistra.fr/index.php/Jens_Gustedt> ::

Received on 2024-05-24 08:58:15