[PATCH] x86: Add Evw to emit w suffix for several instrctions for word ptr

Jiang, Haochen haochen.jiang@intel.com
Fri May 26 08:54:11 GMT 2023


> On 26.05.2023 10:26, Haochen Jiang wrote:
> > Currently, for instructions lldt/ltr/verr/verw/lkgs, we are missing w
> > suffix for memory operands like sldt/str do. Also the Ew usage is not
> > that precise under this scenario. Add Evw to fix this problem.
> 
> So why not Sv? It's used solely for segment register moves, sldt, str, and
> smsw right now. We're aiming for consistency among all insns loading /
> storing segment selector values (and smsw fits that pattern, but note that
> lmsw does not), so introducing a new Evw can't be the solution (or else Sv
> users would also need switching).

There is a little difference between lldt/ltr/lkgs/verr/verw and sldt/str. We need
to fix the register to 16 bit while sldt/str did not. That is why I am not using Sv. Sv
will emit 'lldt %eax' but not 'lldt %ax' for current testcases and I suppose that is not
desired. 

Also since lmsw did not fit the pattern so I did not touch that.

> 
> > gas/ChangeLog:
> >
> > 	* testsuite/gas/i386/i386.exp: Add LKGS suffix test.
> 
> Just as a remark: You'll need to re-base this over what I've committed half an
> hour or so ago.

Oh I see that, will rebase to that for v2 patch.

Thx,
Haochen

> 
> Jan


More information about the Binutils mailing list