[PATCH v2 2/2] x86/APX: support JMPABS also in assembler

Cui, Lili lili.cui@intel.com
Thu Oct 31 02:54:46 GMT 2024



> -----Original Message-----
> From: H.J. Lu <hjl.tools@gmail.com>
> Sent: Monday, October 28, 2024 4:40 PM
> To: Beulich, Jan <JBeulich@suse.com>
> Cc: Binutils <binutils@sourceware.org>; Cui, Lili <lili.cui@intel.com>; Hu, Lin1
> <lin1.hu@intel.com>
> Subject: Re: [PATCH v2 2/2] x86/APX: support JMPABS also in assembler
> 
> On Mon, Oct 28, 2024 at 4:13 PM Jan Beulich <jbeulich@suse.com> wrote:
> >
> > On 19.10.2024 00:40, H.J. Lu wrote:
> > > On Fri, Oct 18, 2024, 8:08 PM Jan Beulich <jbeulich@suse.com> wrote:
> > >> @@ -8361,10 +8380,10 @@ optimize_disp (const insn_template *t)
> > >>         }
> > >>      }
> > >>
> > >> -  /* Don't optimize displacement for movabs since it only takes 64bit
> > >> -     displacement.  */
> > >> +  /* Don't optimize displacement for movabs / jmpabs since they only
> take
> > >> +     64-bit displacement.  */
> > >>    if (pp.disp_encoding > disp_encoding_8bit
> > >> -      || (flag_code == CODE_64BIT && t->mnem_off == MN_movabs))
> > >> +      || t->mnem_off == MN_movabs || t->mnem_off == MN_jmpabs)
> > >>
> > >
> > > Is this needed for AT&T syntax?
> >
> > No, but the check is benign there and hence adding yet another part to
> > the conditional would only be detrimental to performance, without
> > gaining us anything.
> >
> > > Is there 64bit displacement in the spec?
> >
> > As before - that depends on how one reads the spec.
> >
> 
> Lili, please ask the spec author for clarification.
> 
> 

The patch was checked in, I just want to convey the author's thoughts here.

Spec author says:" We have specific moffs64 instructions that effectively use a 32-bit immediate and a 32-bit displacement to act as a 64-bit immediate value. Moffs64 is the legacy usage of such a combined value and is used as a memory address. The JMPABS is a new usage of such a combined value and is used as a target. "

I think he wants to differentiate between MOV and JMPABS. Moffs64 prefers a memory address (the purpose is to get the value at the address). Target64 is different from Moffs64. It is the address that rip jumps to.

Thanks,
Lili.

> --
> H.J.


More information about the Binutils mailing list