I see.
>
> The fact is that the intel manuals are not very clear on the issue (at
> least the PPro manual I have in front of me), but that the CPU's actually
> have well-defined behaviour that people depend on. So you can't just go by
> the manual, because the manual is often lacking in detail and somethins
> downright buggy (*).
My P II manual downloaded from www.intel.com is quite clear on moving
data between a segment register and a general purpose register. It
has one paragraph with examples like "MOV DS, AX" and "MOV DS, EAX"
in Intel syntax.
>
> (*) The exact details of what happens with some of the complex
> instructions with faults is different in different manuals.
>
> > As for mov, I will see if I can make "movl/mov %ds,eax" to work.
> > In the meantime, "mov/movw %ds,%ax" is more accurate.
>
> It is NOT "more accurate". They are two completely different instructions,
> as you'd see if you'd actually test them.
>
> > In
> > "movl/mov %ds,eax", the 2 high order bytes may be undefined,
> > depending on CPU.
>
> Even so, behaviour is decidedly different between
>
> movw %ds,%ax
The current gas emits "8c d8". Why is that slower?
>
> and
>
> movl %ds,%eax
>
> and the latter is smaller and faster. Gas should support (and default to)
> the latter because of it being smaller and faster, but gas _has_ to
> support the first version too because the first version is also something
> that people actually might want to use (imagine not wanting to trash the
> high 16 bits of %eax).
>
> In short, gas should always default to the 32-bit version when not told
> otherwise with a "w", but should honour the "w" when it exists (and if it
> accepts a "w" then it should also accept an "l" in order to be symmetric).
>
The current gas defaults to 16-bit and rejects movl. I can make it to
accept "movl". I don't see it should default to 32-bit.
BTW, the current gas is 2.8.1.0.25.
-- H.J. Lu (hjl@gnu.ai.mit.edu)- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu