public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH 7/8] x86: derive mandatory prefix attribute from base opcode
Date: Wed, 24 Mar 2021 06:43:22 -0700	[thread overview]
Message-ID: <CAMe9rOquW6+nCtNpZZjsVhASHruhet_4N1YoQMqDhc8WnNB=tQ@mail.gmail.com> (raw)
In-Reply-To: <dc51de3f-ece3-9335-0d34-e6fe523aba4d@suse.com>

On Wed, Mar 24, 2021 at 12:27 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 23.03.2021 19:34, H.J. Lu wrote:
> > On Tue, Mar 23, 2021 at 9:36 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>
> >> On 22.03.2021 19:03, H.J. Lu wrote:
> >>> On Mon, Mar 22, 2021 at 05:46:14PM +0100, Jan Beulich wrote:
> >>>> Just like is already done for legacy encoded insns, record the mandatory
> >>>> prefix information in the respective opcode modifier field. Do this
> >>>> without changing the source table, but rather by deriving the values from
> >>>> their existing source representation.
> >>>>
> >>>> gas/
> >>>> 2021-03-XX  Jan Beulich  <jbeulich@suse.com>
> >>>>
> >>>>      * config/tc-i386.c (md_begin): Add assertion.
> >>>>      (build_vex_prefix): Drop implied prefix calculation.
> >>>>      (build_evex_prefix): Likewise.
> >>>>      (optimize_encoding): Adjust opcode checks.
> >>>>      (load_insn_p): Also check opcodeprefix.
> >>>>      (match_template): Also check opcodespace.
> >>>>      (process_suffix): Likewise.
> >>>>      (process_operands): Likewise.
> >>>>      (output_insn): Likewise. Also check isprefix when discaring
> >>>>      standalone LOCK.
> >>>>      * config/tc-i386-intel.c (i386_intel_operand): Also check
> >>>>      opcodespace.
> >>>>
> >>>> opcodes/
> >>>> 2021-03-XX  Jan Beulich  <jbeulich@suse.com>
> >>>>
> >>>>      * i386-gen.c (process_i386_opcode_modifier): Return void. New
> >>>>      parameter "prefix". Drop local variable "regular_encoding".
> >>>>      Record prefix setting / check for consistency.
> >>>>      (output_i386_opcode): Parse opcode_length and base_opcode
> >>>>      earlier. Derive prefix encoding. Drop no longer applicable
> >>>>      consistency checking. Adjust process_i386_opcode_modifier()
> >>>>      invocation.
> >>>>      (process_i386_opcodes): Adjust process_i386_opcode_modifier()
> >>>>      invocation.
> >>>>      * i386-tbl.h: Re-generate.
> >>>
> >>> OK.  Thanks.
> >>
> >> Thanks. Just to confirm - you being okay with the approach here, are
> >> also okay with the outlined (in a post commit message remark) further
> >> planned course of action?
> >
> > Sounds good to me.  But I need to see the actual patch for sure.
>
> Well, there are multiple steps. The first one, to extract 0f etc
> "prefixes" from the opcodes, is less likely to be controversial.
> Reverting the PREFIX_0X<nn> uses on legacy encoded opcodes is
> likely to rank in the middle, while moving encoding space
> specification to the actual opcodes for VEX/XOP/EVEX templates is
> likely the most questionable one, not the least because of the
> need to "invent" a representation for XOP (I'm considering to use
> 8f0[89a] as a prefix, but I can also see alternatives).
>

We will see how it works out.

-- 
H.J.

  reply	other threads:[~2021-03-24 13:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 16:40 [PATCH 0/8] x86: work towards further opcode table compaction Jan Beulich
2021-03-22 16:42 ` [PATCH 1/8] x86: unbreak certain MPX insn operand forms Jan Beulich
2021-03-22 17:58   ` H.J. Lu
2021-03-22 16:42 ` [PATCH 2/8] x86: don't open-code PREFIX_NONE Jan Beulich
2021-03-22 17:58   ` H.J. Lu
2021-03-22 16:43 ` [PATCH 3/8] x86: don't use opcode_length to identify pseudo prefixes Jan Beulich
2021-03-22 17:55   ` H.J. Lu
2021-03-23  7:36     ` Jan Beulich
2021-03-23 12:05       ` H.J. Lu
2021-03-23 16:42         ` [PATCH v2] " Jan Beulich
2021-03-23 18:32           ` H.J. Lu
2021-03-22 16:44 ` [PATCH 5/8] x86: re-order two fields of struct insn_template Jan Beulich
2021-03-22 18:03   ` H.J. Lu
2021-03-22 16:45 ` [PATCH 6/8] x86: re-number PREFIX_0X<nn> Jan Beulich
2021-03-22 18:03   ` H.J. Lu
2021-03-22 16:46 ` [PATCH 7/8] x86: derive mandatory prefix attribute from base opcode Jan Beulich
2021-03-22 18:03   ` H.J. Lu
2021-03-23 16:36     ` Jan Beulich
2021-03-23 18:34       ` H.J. Lu
2021-03-24  7:27         ` Jan Beulich
2021-03-24 13:43           ` H.J. Lu [this message]
     [not found] ` <65b17a6a-cc6a-a706-5e95-a7284c45beb1@suse.com>
2021-03-22 18:02   ` [PATCH 8/8] x86: derive opcode length from opcode value H.J. Lu
     [not found] ` <f116024a-077d-c64e-f37c-1da8299272f0@suse.com>
2021-03-22 18:04   ` [PATCH 4/8] x86: split opcode prefix and opcode space representation H.J. Lu

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='CAMe9rOquW6+nCtNpZZjsVhASHruhet_4N1YoQMqDhc8WnNB=tQ@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.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).