[PATCH] x86/APX: limit printing of REX2 payload
H.J. Lu
hjl.tools@gmail.com
Wed Sep 9 06:36:19 GMT 2026
On Wed, Sep 9, 2026 at 1:52 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 09.09.2026 07:50, Jiang, Haochen wrote:
> >> From: Jan Beulich <jbeulich@suse.com>
> >> Sent: Tuesday, September 8, 2026 11:11 PM
> >>
> >> When set bits were properly consumed (and hence all we want is an
> >> indication that REX2-encoding is in use), print merely {rex2}, thus also
> >> better matching original input.
> >>
> >> While effectively copying parts of an existing conditional, also simplify
> >> the original: There's no need to apply the 3-bit mask twice.
> >>
> >> While adjusting testcases, also escape curly braces.
> >
> > Actually, when I am working on BHI_CTRL patch, I have the same question
> > for why we are printing {rex2 0x88}. Thus, I asked Lili for that. Lili told me
> > that back to the very beginning, it is H.J requested to add those additional
> > info to express the rex2 prefix.
>
> And we still do when there are unconsumed bits.
>
> > Maybe we need H.J's input on this.
>
> Sure, I'm not going to commit right away.
>
{rex} and {rex2} are different.
[hjl@gnu-tgl-3 tmp]$ cat x.s
{rex} movl %eax,%ebx
{rex2} movl %eax,%ebx
[hjl@gnu-tgl-3 tmp]$ gcc -c x.s
[hjl@gnu-tgl-3 tmp]$ objdump -dw x.o
x.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <.text>:
0: 40 89 c3 rex mov %eax,%ebx
3: d5 00 89 c3 {rex2 0x0} mov %eax,%ebx
[hjl@gnu-tgl-3 tmp]$
{rex} maps to 0x40. But {rex2} maps to different 2 bytes.
{rex2 0x0} tells what these 2 bytes are. I prefer to
keep it ASIS.
--
H.J.
More information about the Binutils
mailing list