C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Standardising 0xdeadbeef for pointers

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sat, 26 Jul 2025 20:37:53 -0700
On Saturday, 26 July 2025 03:52:30 Pacific Daylight Time Frederick Virchanza
Gotham via Std-Proposals wrote:
> We could actually use these optimized instructions for all bits one simply
> by flipping all the bits before comparing:
>
> not rdi // flip all one's to all zero's
> test rdi, rdi
> jz target_label

The TEST instruction is unnecessary, because the NOT instruction sets flags.
The NOT+JZ will also be macrofused since Intel's Lion Cove core.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel Platform & System Engineering

Received on 2025-07-27 03:38:00