[PATCH] Support {evex} pseudo prefix for decode evex promoted insns without egpr32.

Cui, Lili lili.cui@intel.com
Fri Mar 22 09:45:46 GMT 2024


> 
> > --- a/opcodes/i386-dis-evex-mod.h
> > +++ b/opcodes/i386-dis-evex-mod.h
> > @@ -1,10 +1,10 @@
> >    /* MOD_EVEX_MAP4_F8_P1 */
> >    {
> > -    { "enqcmds",	{ Gva, M }, 0 },
> > -    { "uwrmsr",		{ Gq, Eq }, 0 },
> > +    { "%XEenqcmds",		{ Gva, M }, 0 },
> > +    { "%XEuwrmsr",		{ Gq, Eq }, 0 },
> >    },
> >    /* MOD_EVEX_MAP4_F8_P3 */
> >    {
> > -    { "enqcmd",		{ Gva, M }, 0 },
> > -    { "urdmsr",		{ Eq, Gq }, 0 },
> > +    { "%XEenqcmd",		{ Gva, M }, 0 },
> > +    { "%XEurdmsr",		{ Eq, Gq }, 0 },
> >    },
> 
> Hmm. Once new encodings appear in Map4, I can see that we will need such
> distinction. But right now can't we get away without touching all of them
> again, by simply taking it being Map4 as an indication? The only place where it
> may be helpful to indeed add all of these right away is MOVBE, where its
> register form then would not have %XE added.
> 

Good idea, overall judgment can avoid missing instructions( found crc32 missing %XE).

> > --- a/opcodes/i386-dis-evex-reg.h
> > +++ b/opcodes/i386-dis-evex-reg.h
> > @@ -53,8 +53,8 @@
> >    {
> >      { "%NFaddA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> >      { "%NForA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > -    { "adcA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > -    { "sbbA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > +    { "%XEadcA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > +    { "%XEsbbA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> >      { "%NFandA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> >      { "%NFsubA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> >      { "%NFxorA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> 
> IOW this patch goes on top of the NF one, without that being said anywhere?
> Except not quite, as ...
> 
> > --- a/opcodes/i386-dis.c
> > +++ b/opcodes/i386-dis.c
> > @@ -2625,8 +2625,8 @@ static const struct dis386 reg_table[][8] = {
> >    {
> >      { "%NFrolA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> >      { "%NFrorA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > -    { "rclA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > -    { "rcrA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > +    { "%XErclA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> > +    { "%XErcrA",	{ VexGb, Eb, Ib }, NO_PREFIX },
> 
> ... that patch wrongly added %NF here. So looks like that patch was partly
> fixed already in this regard (the NOT adjustment there will then also need
> reflecting here). But please - anything like this needs making entirely
> transparent to the reader.
>

Ok.
 
> > @@ -10595,7 +10595,9 @@ putop (instr_info *ins, const char
> *in_template, int sizeflag)
> >  		  *ins->obufp++ = '}';
> >  		  *ins->obufp++ = ' ';
> >  		}
> > -	      else if (ins->evex_type == evex_from_legacy && !ins->vex.b)
> > +	      else if ((ins->evex_type == evex_from_legacy && !ins->vex.b)
> > +		       || (ins->evex_type == evex_from_vex
> > +			   && !((ins->rex2 & 7) || !ins->vex.v)))
> 
> This double negation is hard to follow:
> 
> 	      else if ((ins->evex_type == evex_from_legacy && !ins->vex.b)
> 		       || (ins->evex_type == evex_from_vex
> 			   && !(ins->rex2 & 7) && ins->vex.v))
> 
Done. 

Thanks,
Lili.


More information about the Binutils mailing list