x86/APX: clarification needed for where REX2 may be applied

Jan Beulich jbeulich@suse.com
Fri Jan 24 11:28:46 GMT 2025


Hello,

the spec has two relevant bullet points:

– All instructions in legacy maps 0 and 1 that have explicit GPR or
  memory operands can use the REX2 prefix to access the upper 16 GPRs
  (namely, R16 to R31).

– Certain rows of opcodes in legacy maps 0 and 1 which do not have
  explicit GPR or memory operands are reserved under REX2 for future
  use.

Later those rows are enumerated. This row related statement is kind of
redundant though with the earlier one, for no insn in those rows
having any explicit GPR or memory operands (map 0 row A entries 0-3
are slightly special, but for the purpose here I take it these have
displacement operands, not "explicit memory" ones). Yet then, with
this being kind of redundant, the question arises how strict the first
statement really is (i.e. whether it implies "other insns can't").
Right now both gas and objdump don't follow that statement (or its
implication, to be precise), but implement the restriction purely
based on row numbers. The more I read the first statement though, the
more it looks to me that what we currently do is wrong. Therefore -
can this be clarified please, both here and in a future revision of
the spec?

Thanks, Jan


More information about the Binutils mailing list