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

Hu, Lin1 lin1.hu@intel.com
Thu Oct 10 07:51:10 GMT 2024


> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Thursday, October 10, 2024 3:10 PM
> To: Hu, Lin1 <lin1.hu@intel.com>
> Cc: Binutils <binutils@sourceware.org>; Cui, Lili <lili.cui@intel.com>; H.J. Lu
> <hjl.tools@gmail.com>
> Subject: Re: [PATCH 2/2] x86/APX: support JMPABS also in assembler
> 
> On 10.10.2024 04:41, Hu, Lin1 wrote:
> > And I think 'movabs moffs64, %rax' and 'movabs imm64, %rax' are two
> different instructions, they have different opcode.
> 
> Yes.
> 
> > According to spec, jmpabs is closer to 'movabs imm64, %rax', because jmpabs
> only accept imm64.
> 
> The "because" here is unjustified, at least as long as you can't point me at where
> this is being said. Hence the "why" on the first part of the sentence remains open.
> 

On page 233 of Document (https://cdrdv2.intel.com/v1/dl/getContent/784266) it is written "The 64-bit immediate operand is treated an as absolute effective address, which is subject to canonicality checks."

>
> All the spec says is that there is a 64-bit field as the only operand. It says nothing
> on this being an immediate or a displacement. In fact, as
> (indirectly) pointed out before, the boundary between the two is actually fuzzy in
> the SDM; the strong distinction between them is something assemblers invented.
> 

In the document I posted above, I think it's kind of explicitly written clearly.

>
> > If jmpabs want to accept moffs64, it should use another opcode.
> > Even if we refer to movabs, we should recognize the possibility of the
> appearance of another instruction 'jmpabs moffs64'.  Abs suffix is not a
> constraint.
> >
> > And in terms of usage habits, I think people feel 0x123 is a offset rather than a
> absolute address.  People unfamiliar with jmpabs might see 0x123 and think the
> address is rip + 0x123 rather then just 0x123.
> 
> Then they simply missed the point of the "abs" in the mnemonic.
> 

Maybe, the same thing I think has happened with movabs. I think when people use "movabs moffs64, %rax", they ignore the "abs" in the mnemonic, too. They determine whether it's a relative address or immediate operand by the form of the operand rather than the "abs" in the mnemonic.

BRs,
Lin


More information about the Binutils mailing list