[PATCH 2/2] x86/APX: support JMPABS also in assembler
Jan Beulich
jbeulich@suse.com
Thu Oct 10 07:09:37 GMT 2024
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.
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.
> 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.
Jan
More information about the Binutils
mailing list