This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH 4/6] x86/MPX: bndmk, bndldx, and bndstx only allow a memory operand
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: kirill dot yukhin at intel dot com, Binutils <binutils at sourceware dot org>
- Date: Wed, 9 Oct 2013 08:17:09 -0700
- Subject: Re: [PATCH 4/6] x86/MPX: bndmk, bndldx, and bndstx only allow a memory operand
- Authentication-results: sourceware.org; auth=none
- References: <5254349502000078000F9A3D at nat28 dot tlf dot novell dot com> <5254361802000078000F9A59 at nat28 dot tlf dot novell dot com> <CAMe9rOrBd=XHHyjTeCrS75bLC+wxrhprJu2tX8=x0t0_jPS8QA at mail dot gmail dot com> <525520C902000078000F9DBE at nat28 dot tlf dot novell dot com>
On Wed, Oct 9, 2013 at 12:24 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 08.10.13 at 17:28, "H.J. Lu" <email@example.com> wrote:
>> On Tue, Oct 8, 2013 at 7:43 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>> bndmk, bndldx, and bndstx only allow memory operands, so decoding should
>>> use OP_M() instead of OP_E().
>> The change isn't wrong. But register operand will never be used since
>> MOD != 3. Also, in this case, only register operand is possible for nop
>> since MOD == 0x3. If we want to make the change, we should also
>> replace Ev with Gv.
> Looks like I didn't look at mod_table's usage closely enough - I
> guess for consistency reasons I'll withdraw the patch rather than
> extending it (even though performance would perhaps be slightly
> improved by using the more specific operand handling routines
> here, but that would be the case for various other code paths /
> table entries too I believe).
OP_M (int bytemode, int sizeflag)
if (modrm.mod == 3)
/* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
OP_E (bytemode, sizeflag);
OP_M will be slower than OP_E. With mod_table, we can get rid
rid of OP_M. A patch is welcome.