Re: PATCH - assembler glitches

Martin Dalecki (dalecki@cs.net.pl)
Wed, 13 Oct 1999 02:32:40 +0200


Linus Torvalds wrote:
>
> On Tue, 12 Oct 1999, Martin Dalecki wrote:
> >
> > The attached patch is sweepping out obvious errors in IA32 assembler
> > code.
>
> It's not "obvious errors", as it's actually "non-obvious features". The
>
> movl %ax,%ds
>
> thing actually used to generate the right (32-bit) move on gas, and
>
> movw %ax,%ds
>
> used to generate the WRONG (16-bit) move on gas.
>
> The reason the 32-bit move is the right one is that both the 32-bit and
> the 16-bit moves actually do the same thing (the target register is a
> 16-bit register after all), but the 32-bit move does so in smaller space
> and faster due to the lack of a size override.
>
> I'd like somebody to sacrifice their first-borne son, and write in blood
> that gas does the right thing every time these days. Otherwise I will keep
> the thing that looks strange but has a real explanation for it.
>
> Linus

OK I will have to doublecheck wahtever GAS is clever enough to handle
the segment registers correctly those days (supposeddly it is).
Otherwise it's giving apparently spurious warnings and there is room
for improvement there. (However the outb thing you already know about.)

--Marcin Dalecki

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/