This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Remove InvMem from MMX/SSE instructions
On Sun, Jul 16, 2006 at 10:13:29AM -0700, H. J. Lu wrote:
> On Sun, Jul 16, 2006 at 01:23:56PM +0930, Alan Modra wrote:
> > On Thu, Jul 13, 2006 at 04:09:03PM -0700, H. J. Lu wrote:
> > > http://sourceware.org/ml/binutils/2001-05/msg00065.html
> > > http://sourceware.org/ml/binutils/2001-05/msg00187.html
> > >
> > > use InvMem on source operand to indicate that it must be register.
> > > I don't believe it is correct since RegYYY won't match memory anyway
> > > and InvMem is used to indicate how operand should be encoded. This
> > > patch removes it.
> >
> > It's true that the way the code is currently written that removing this
> > flag will not change the insn encoding. All InvMem does on *source*
> > operands of these reg->reg insns is document that the register is
> > encoded in the regmem field of the modrm byte. So why do you want to
> > remove documentation? There is certainly nothing wrong with InvMem on
> > these operands.
>
> Those operands only take registers and are encoded properly. What
> additional information does InvMem provide here?
Didn't you read what I said? To a programmer reading i386.h, InvMem
says that this particular register operand is encoded in the regmem
field, and the other register is encoded in the reg field.
> I am trying to clean up the usage of InvMem. The commennt says:
>
> /* InvMem is for instructions with a modrm byte that only allow a
> general register encoding in the i.tm.mode and i.tm.regmem fields,
> eg. control reg moves. They really ought to support a memory form,
> but don't, so we add an InvMem flag to the register operand to
> indicate that it should be encoded in the i.tm.regmem field. */
> #define InvMem 0x80000000
>
> However, there are
>
> {"sldt", 1, 0x0f00, 0, Cpu286, wlq_Suf|Modrm, { WordReg|InvMem, 0, 0} },
> {"smsw", 1, 0x0f01, 4, Cpu286, wlq_Suf|Modrm, { WordReg|InvMem, 0, 0} },
> {"str", 1, 0x0f00, 1, Cpu286, wlq_Suf|Modrm, { WordReg|InvMem, 0, 0} },
>
> Those instructions take memory operand.
Not this entry in the opcode table though.
> InvMem seems to be used for something else.
See above.
--
Alan Modra
IBM OzLabs - Linux Technology Centre