[PATCH 1/9] Make const_1_mode print $1 in AT&T syntax

Cui, Lili lili.cui@intel.com
Fri Nov 24 11:22:05 GMT 2023


> On 24.11.2023 08:02, Cui, Lili wrote:
> > Make const_1_mode print $1 in AT&T syntax, otherwise there will be
> > correctness issues when it is extended to support APX NDD,
> 
> Looks fine to me, but I could easily imagine this to face H.J.'s opposition (and
> hence my suggestion in this direction wasn't exactly this way). Since iirc he's
> going to be back soon, may be best to wait until then. One request
> though:
> 

> > --- a/opcodes/i386-dis.c
> > +++ b/opcodes/i386-dis.c
> > @@ -12090,6 +12090,8 @@ OP_I (instr_info *ins, int bytemode, int
> sizeflag)
> >      case const_1_mode:
> >        if (ins->intel_syntax)
> >  	oappend (ins, "1");
> > +      else
> > +	oappend (ins, "$1");
> >        return true;
> 
> This was already overlooked when output styling was introduced. Please
> switch to oappend_immediate(ins, 1) here (i.e. replcaing the entire if/else).
> As per above - from my pov okay with this change.
> 

If we use oappend_immediate(ins, 1), it will print $0x1 instead of $1, and then Imm1 and Imm8 will be confused.

regexp "^ +[a-f0-9]+:   d1 f0                   shl    \$1,%eax$"
line   " a57:   d1 f0                   shl    $0x1,%eax"

Lili.


More information about the Binutils mailing list