This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: i386/x86_64 segment register issuses


> asm volatile("movl %%gs,%0" : "=g" (gsindex));
>
>The new assembler will disallow them since those instructions with
>memory operand will only use the first 16bits. If the memory operand
>is 16bit, you won't see any problems. But if the memory destinatin
>is 32bit, the upper 16bits may have random values.

I'm pretty sure this isn't the case.  The memory operand can only
be 16-bit, as any operand size prefix (or lack thereof) is ignored.
It's only when the destination is a 32-bit register that the upper
16-bits are undefined.

I think gas should accept both "movl" and "movw" when moving between
a segment register and a memory operand.  Regardless of which suffix
is used the assembler should never emit an operand size prefix for
the instruction.

						Ross Ridge

-- 
 l/  //	  Ross Ridge -- The Great HTMU
[oo][oo]  rridge@csclub.uwaterloo.ca
-()-/()/  http://www.csclub.uwaterloo.ca/u/rridge/ 
 db  //	  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]