public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Cui, Lili" <lili.cui@intel.com>
To: "Beulich, Jan" <JBeulich@suse.com>
Cc: "hjl.tools@gmail.com" <hjl.tools@gmail.com>,
	"binutils@sourceware.org" <binutils@sourceware.org>
Subject: RE: [PATCH V2] Support APX NF
Date: Tue, 12 Mar 2024 08:51:21 +0000	[thread overview]
Message-ID: <SJ0PR11MB56005470E3A3481AA09773439E2B2@SJ0PR11MB5600.namprd11.prod.outlook.com> (raw)
In-Reply-To: <874c75bf-5a07-406f-bd05-96a30d329c8f@suse.com>

> >>>> On 04.03.2024 09:15, Cui, Lili wrote:
> >>>>> @@ -7218,6 +7229,11 @@ parse_insn (const char *line, char
> >> *mnemonic,
> >>>> bool prefix_only)
> >>>>>  		  /* {rex2} */
> >>>>>  		  i.rex2_encoding = true;
> >>>>>  		  break;
> >>>>> +		case Prefix_NF:
> >>>>> +		  /* {nf} */
> >>>>> +		  i.has_nf = true;
> >>>>> +		  i.encoding = encoding_evex;
> >>>>> +		  break;
> >>>>
> >>>> It's not quite as easy, I'm afraid: Have you thought of the "{vex} {nf} ..."
> >>>> case? (I think I previously indicated that their combination,
> >>>> actually in either order, needs properly rejecting.) Without having
> >>>> spent much thought on it, perhaps it would suffice to check here
> >>>> that the field is still encoding_default, and leave the value alone
> >>>> otherwise (in order to reject bad combinations elsewhere).
> >>>>
> >>> Oh, good point. Do you think it's ok to report bad outside of "switch"?
> >>>
> >>>                 case Prefix_NF:
> >>>                   /* {nf} */
> >>>                   i.has_nf = true;
> >>> -                 i.encoding = encoding_evex;
> >>> +                 if (i.encoding == encoding_default)
> >>> +                   i.encoding = encoding_evex;
> >>>                   break;
> >>>                 case Prefix_NoOptimize:
> >>>                   /* {nooptimize} */
> >>>                   i.no_optimize = true;
> >>>                   break;
> >>>                 default:
> >>>                   abort ();
> >>>                 }
> >>> +             if (i.has_nf && i.encoding != encoding_evex)
> >>> +               {
> >>> +                 as_bad (_("{nf} cannot be combined with {vex}/{vex3}"));
> >>> +                 return NULL;
> >>> +               }
> >>
> >> Where the checking is done is secondary to me. My primary point is
> >> that the above isn't correct: There are more encoding variants than
> >> just vex, vex3, and evex.
> >>
> >> That said, reporting the error right here may lead to multiple
> >> identical errors being reported for a single line of input. This
> >> wants avoiding, at which point placing the check here is ruled out.
> >>
> >
> > Sorry,  I didn’t get you here, do you think the current implementation
> > is wrong? I think for parse_insn stage i.encodin only has those
> > encoding variants,
> 
> Hmm, you're right - operands weren't parsed yet at this point. While ...
> 
> > do you think we need to move further back? Maybe put them together with
> REX/REX2 prefix checking?
> >
> >       /* Check for explicit REX prefix.  */
> >       if (i.prefix[REX_PREFIX] || i.rex_encoding)
> >         {
> >           as_bad (_("REX prefix invalid with `%s'"), insn_name (&i.tm));
> >           return;
> >         }
> >
> >       /* Check for explicit REX2 prefix.  */
> >       if (i.rex2_encoding)
> >         {
> >           as_bad (_("{rex2} prefix invalid with `%s'"), insn_name (&i.tm));
> >           return;
> >         }
> 
> ... this would overall seem to be a more logical place to have such checks, I'd
> like to take back my earlier comment then: By having the check in
> parse_insn(), .insn handling is then also covered right away.
> 
> Jan

Ok.

Thanks,
Lili.

  reply	other threads:[~2024-03-12  8:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-04  8:15 Cui, Lili
2024-03-08  9:36 ` Jan Beulich
2024-03-11 13:54   ` Cui, Lili
2024-03-11 14:09     ` Jan Beulich
2024-03-12  6:12       ` Cui, Lili
2024-03-12  7:46         ` Jan Beulich
2024-03-12  8:51           ` Cui, Lili [this message]
2024-03-12 13:22   ` Cui, Lili
2024-03-12 13:53     ` Jan Beulich
2024-03-13  2:54       ` Cui, Lili
2024-03-13  7:36         ` Jan Beulich
2024-03-18 11:21           ` Cui, Lili
2024-03-18 11:50             ` Jan Beulich
2024-03-18 13:43               ` Cui, Lili
2024-03-19  1:24         ` Cui, Lili
2024-03-08 10:40 ` Jan Beulich

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=SJ0PR11MB56005470E3A3481AA09773439E2B2@SJ0PR11MB5600.namprd11.prod.outlook.com \
    --to=lili.cui@intel.com \
    --cc=JBeulich@suse.com \
    --cc=binutils@sourceware.org \
    --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).