V2 [PATCH] x86: Add {disp16} pseudo prefix

H.J. Lu hjl.tools@gmail.com
Fri Jul 31 12:34:41 GMT 2020
On Fri, Jul 31, 2020 at 5:28 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 31.07.2020 13:52, H.J. Lu wrote:
> > On Fri, Jul 31, 2020 at 12:03 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>
> >> On 30.07.2020 01:39, H.J. Lu wrote:
> >>> Here is the updated patch.
> >>
> >> Just one more thing: Wouldn't it make sense to mark {disp16} CpuNo64,
> >> at least as long as it's not usable for controlling branch displacements
> >> (which, as said, I think it shouldn't get enabled for)?
> >
> > Since {disp16} can only be used for memory reference in 16-bit mode,
> > CpuNo64 isn't appropriate here.
>
> Wouldn't the diagnostic be more to the point? (The prefix isn't limited
> to 16-bit mode, but to 16-bit addressing, which can also be used from
> 32-bit mode, but not from 64-bit mode.)

It is checked with

          /* 32-bit/64-bit checks.  */
          if (i.disp_encoding == disp_encoding_16bit)
            {
            bad_disp:
              as_bad (_("invalid `%s' prefix"),
                      addr_mode == CODE_16BIT ? "{disp32}" : "{disp16}");
              return 0;
            }

and testcases are added.

--
H.J.


More information about the Binutils mailing list