[Valgrind-developers] [PATCH 1/2] x86: optimize XCHG to MOV for same-register forms

Michael Matz matz@suse.de
Tue Jul 7 14:04:35 GMT 2026


Hey,

On Tue, 7 Jul 2026, Mark Wielaard wrote:

> OK. So it is the best I am willing to do. Because I personally wouldn't 
> want to do all that unnecessary work if we can just document to not to 
> use an optimizing compiler when building and we can detect that at 
> runtime. Patches welcome of course if you (or someone else) believes 
> they can do better and are willing to do the extra work.

Attached.  Using .byte in the public header, recognizing the mov form and 
giving some hint on unrecognized bytes after recognized preamble.

Tested with a normal make check and with a program excercising the 
problematic client requests (just playing with VALGRIND_MAKE_MEM_NOACCESS 
and seeing that I get unrecognized insns before and proper behaviour 
after), on 32bit and 64bit.  (Of course with an assembler that does the 
rewriting).


Ciao,
Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-x86-64-deal-with-rewriting-assemblers.patch
Type: text/x-patch
Size: 12263 bytes
Desc: 
URL: <https://sourceware.org/pipermail/binutils/attachments/20260707/459872fb/attachment.bin>


More information about the Binutils mailing list