public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Cui, Lili" <lili.cui@intel.com>
To: "Beulich, Jan" <JBeulich@suse.com>,
	"Jiang, Haochen" <haochen.jiang@intel.com>,
	"H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: RE: x86/APX: clarification needed for where REX2 may be applied
Date: Sun, 26 Jan 2025 03:27:31 +0000	[thread overview]
Message-ID: <SJ0PR11MB5600883F902506CC5911DFD49EED2@SJ0PR11MB5600.namprd11.prod.outlook.com> (raw)
In-Reply-To: <859dfa34-2872-4548-b46d-096f24b6cbe0@suse.com>

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Friday, January 24, 2025 7:29 PM
> To: Cui, Lili <lili.cui@intel.com>; Jiang, Haochen <haochen.jiang@intel.com>;
> H.J. Lu <hjl.tools@gmail.com>
> Cc: Binutils <binutils@sourceware.org>
> Subject: x86/APX: clarification needed for where REX2 may be applied
> 
> 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").

I think the early sentence emphasizes that we can use REX2 to access 16 GPRs, but it doesn't explicitly say that REX2 is disabled for instructions without GPR or memory, so the second sentence is needed to add this point. There may be a better way to express it, but I think there is no big problem with the current expression.

> 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?
> 

I'm curious if you found some special instructions (without GPR or memory) that are not included in the second sentence.

I can understand what you said earlier, the two summaries have different perspectives and there may be some omissions.

Thanks,
Lili.

> Thanks, Jan

  reply	other threads:[~2025-01-26  3:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24 11:28 Jan Beulich
2025-01-26  3:27 ` Cui, Lili [this message]
2025-01-27  8:42   ` Jan Beulich
2025-02-06  7:01     ` Cui, Lili
2025-02-06 11:23       ` Jan Beulich
2025-02-07  2:20         ` Cui, Lili

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR11MB5600883F902506CC5911DFD49EED2@SJ0PR11MB5600.namprd11.prod.outlook.com \
    --to=lili.cui@intel.com \
    --cc=JBeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=haochen.jiang@intel.com \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).