[PATCH 2/2] x86/APX: support JMPABS also in assembler
Cui, Lili
lili.cui@intel.com
Thu Oct 10 08:57:57 GMT 2024
> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Thursday, October 10, 2024 3:24 PM
> To: Cui, Lili <lili.cui@intel.com>
> Cc: Hu, Lin1 <lin1.hu@intel.com>; Binutils <binutils@sourceware.org>; H.J. Lu
> <hjl.tools@gmail.com>
> Subject: Re: [PATCH 2/2] x86/APX: support JMPABS also in assembler
>
> On 10.10.2024 04:54, Cui, Lili wrote:
> > 'jmpabs $foo' and 'jmpabs foo' are really two different things, if used as an
> offset, its access range is different from that of an immediate value.
>
> Can you clarify what you mean here, please? What's "access range"?
>
Forget it, I thought wrong before.
> > supporting both formats will confuse users.
>
> That's your view. Mine is that already the prior discussion here has proven
> that it'll actually help users, by allowing them freedom in how to write their
> code.
>
> > Is this an immediate value or an offset? But in fact, this is an immediate
> value.
>
> No more or less than the immediates in e.g. opcodes E8 and E9. As said in a
> reply to Lin, the distinction between "immediate" and "displacement"
> is blurred anyway in the SDM.
I checked the documentation for E8 and E9, and they are both offsets, so there is no ambiguity.
E8: Call near, relative, displacement relative to next instruction.
E9: Jump near, relative, displacement relative to next instruction. Not supported in 64-bit mode.
>
> > For the unknown future, we should not occupy this expression, movabs also
> support immediate and offset with different opcode.
> >
> > movabs, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, {
> > Disp64|Unspecified|Byte|Word|Dword|Qword,
> Acc|Byte|Word|Dword|Qword }
> > movabs, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf, { Imm64, Reg64 }
>
> Right, and necessarily so. Note however that the SDM doesn't know MOVABS
> at all. It's something gas invented (or borrowed from some other assembler);
> MASM for example doesn't appear to know of MOVABS at all.
>
They are aliases for the following two mov. Here also reminds users that offset and immediate are different. Also assemblers and disassemblers should be consistent.
mov, 0xa0, x64, D|W|CheckOperandSize|No_sSuf, { Disp64|Unspecified|Byte|Word|Dword|Qword, Acc|Byte|Word|Dword|Qword }
mov, 0xb8, x64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|Optimize, { Imm64, Reg64 }
Lili.
> Note however that I previously addressed this argument: A similar 2nd flavor
> of JMPABS is simply unnecessary, as "jmp *symbol" already fulfills that
> purpose. And I can't really see you expecting for just JMPABS (and no other
> instruction) to gain an indirect form allowing for a 64-bit displacement. Plus,
> as also said before, that would then still be "jmpabs *symbol", i.e.
> distinguishable from the non-immediate form I'm proposing to permit. The *,
> after all, was invented to be able to tell apart direct and indirect branches.
>
> Jan
More information about the Binutils
mailing list