C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::atomic_pointer_pair

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 31 Dec 2025 18:25:52 +0000
On Wednesday, December 31, 2025, Thiago Macieira wrote:

>
>
> Correct. Similarly, x86-64-v3 must emit VZEROUPPER before any function
> call if
> it has used YMM registers, which is also a performance penalty. Though for
> this one there is an ABI-changing -m option: -mno-vzeroupper.
>


The problem here can be generalised.

Here's the generalisation:
"The CPU I'm working with is version X, and I want to take full advantage
of all the possible optimizations that come with version X. I don't want to
be burdened by backward compatibility with versions earlier than X (nor
forward-compatibility with versions later than X).

One of these backward-compatible pessimisations is solved with:
    -mno-vzeroupper

And perhaps in the future we would remedy another pessimisation with:
    -mno-lockatomic16

But who wants to keep track of all these flags needed to pass to the
compiler? There should be one flag called something like "-mno-mixing" or
"-m1" that pulls in all these individual flags to disable these
pessimisations.

Received on 2025-12-31 18:25:55