This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: pmovmskb bug in gas
- To: Phil Karn <karn at ka9q dot net>
- Subject: Re: pmovmskb bug in gas
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Thu, 3 May 2001 21:16:53 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <200105031932.f43JWTN30450@homer.ka9q.net>
On Thu, May 03, 2001 at 12:32:29PM -0700, Phil Karn wrote:
> Hi. I've encountered a bug in the Intel version of gas found in
> binutils 2.11.90.0.5. Due to an error in the Intel documentation, the
> "pmovmskb" instruction (introduced with the Pentium-III) is
> incorrectly assembled with the register fields reversed.
>
> For example, if you assemble
>
> pmovmskb %mm4,%eax
>
> you really get
>
> pmovmskb %mm0,%esp # %esp register field value is 4
>
> In my program this smashed the stack pointer, resulting in a segfault
> when the subroutine containing this instruction tried to return.
>
> That's because the register field value for mm4 is 4.
>
> The Intel documentation incorrectly gives the format of this instruction as
>
> 00001111:11010111:11 mmreg1 r32
>
> The correct format is
>
> 00001111:11010111:11 r32 mmreg1
>
> I see that binutils is now up to 2.11.90.0.7. I haven't tried that release
> yet, but I don't see any mention of this bug in the release notes so I
> assume it's still there.
How do you know for sure the Intel documentation is wrong? Could
someone please verify it with the Intel's ia32 assembler?
Thanks.
H.J.