C++ Logo

std-proposals

Advanced search

Re: [std-proposals] TBAA and extended floating-point types

From: Lénárd Szolnoki <cpp_at_[hidden]>
Date: Sat, 16 Aug 2025 09:48:14 +0200
On 15 August 2025 21:43:51 CEST, Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
>
>-----Ursprüngliche Nachricht-----
>Von:Lénárd Szolnoki via Std-Proposals <std-proposals_at_[hidden]>
>Gesendet:Fr 15.08.2025 20:58
>Betreff:Re: [std-proposals] TBAA and extended floating-point types
>An:std-proposals_at_[hidden]; Jan Schultke via Std-Proposals <std-proposals_at_[hidden]>;
>CC:Lénárd Szolnoki <cpp_at_[hidden]>;
>
>
>> If we were able to do that, this would break optimizations
>>though since any write to a char could change the value of a char8_t,
>>and any write to a double could change a std::float64_t, and vice
>>versa.
>
>I would rather have the interoperability than these optimizations.
>
>
>Then rather constructs specifically allowing something identical for the interoperability case.
>
>

We have magic aliasing properties for std::complex exactly to bridge some interoperability issues.

I don't really advocate for more magic, I would rather have a generic framework for having distinct types that can alias each other. Then we can more freely decide for newly introduced types whether aliasing makes sense or not.

>
>Aliasing is also a correctness issue.
>
>

It's only a correctness issue if you break the rules. But we make the rules. Some types are already allowed to alias other types.

Cheers,
Lénárd

Received on 2025-08-16 07:48:34