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: Alan Modra <alan at SPRI dot Levels dot UniSA dot Edu dot Au>
- Date: Fri, 4 May 2001 16:59:48 +0930 (CST)
- cc: <hjl at lucon dot org>, <binutils at sourceware dot cygnus dot com>
On Thu, 3 May 2001, Phil Karn wrote:
> >How do you know for sure the Intel documentation is wrong? Could
> >someone please verify it with the Intel's ia32 assembler?
>
> Well, I verified it by the actual behavior of the Pentium-III and
> Pentium 4 on that instruction.
Duplicated here too. Try this patch.
include/opcode/ChangeLog
* i386.h (i386_optab): Move InvMem to first operand to reverse
mod/reg assignments.
opcodes/ChangeLog
* i386-dis.c (dis386_twobyte_att): Correct pmovmskb operands.
(dis386_twobyte_intel): Likewise.
(Ev, Ed): Remove duplicate define.
--
Alan Modra
Index: include/opcode/i386.h
===================================================================
RCS file: /cvs/src/src/include/opcode/i386.h,v
retrieving revision 1.31
diff -u -p -r1.31 i386.h
--- i386.h 2001/03/24 06:29:15 1.31
+++ i386.h 2001/05/04 07:21:06
@@ -1164,8 +1164,8 @@ static const template i386_optab[] = {
{"pminsw", 2, 0x660fea, X, CpuSSE2,FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
{"pminub", 2, 0x0fda, X, CpuSSE, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
{"pminub", 2, 0x660fda, X, CpuSSE2,FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
-{"pmovmskb", 2, 0x0fd7, X, CpuSSE, FP|Modrm, { RegMMX, Reg32|InvMem, 0 } },
-{"pmovmskb", 2, 0x660fd7, X, CpuSSE2,FP|Modrm, { RegXMM, Reg32|InvMem, 0 } },
+{"pmovmskb", 2, 0x0fd7, X, CpuSSE, FP|Modrm, { RegMMX|InvMem, Reg32, 0 } },
+{"pmovmskb", 2, 0x660fd7, X, CpuSSE2,FP|Modrm, { RegXMM|InvMem, Reg32, 0 } },
{"pmulhuw", 2, 0x0fe4, X, CpuSSE, FP|Modrm, { RegMMX|LLongMem, RegMMX, 0 } },
{"pmulhuw", 2, 0x660fe4, X, CpuSSE2,FP|Modrm, { RegXMM|LLongMem, RegXMM, 0 } },
{"prefetchnta", 1, 0x0f18, 0, CpuSSE, FP|Modrm, { LLongMem, 0, 0 } },
Index: opcodes/i386-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/i386-dis.c,v
retrieving revision 1.19
diff -u -p -r1.19 i386-dis.c
--- i386-dis.c 2001/04/06 09:27:33 1.19
+++ i386-dis.c 2001/05/04 07:21:35
@@ -149,14 +149,12 @@ fetch_data (info, addr)
#define Ev OP_E, v_mode
#define Ed OP_E, d_mode
#define indirEb OP_indirE, b_mode
-#define Gb OP_G, b_mode
-#define Ev OP_E, v_mode
-#define Ed OP_E, d_mode
#define indirEv OP_indirE, v_mode
#define Ew OP_E, w_mode
#define Ma OP_E, v_mode
#define M OP_E, 0 /* lea */
#define Mp OP_E, 0 /* 32 or 48 bit memory operand for LDS, LES etc */
+#define Gb OP_G, b_mode
#define Gv OP_G, v_mode
#define Gw OP_G, w_mode
#define Rd OP_Rd, d_mode
@@ -1859,7 +1857,7 @@ static const struct dis386 dis386_twobyt
{ "paddq", MX, EM, XX },
{ "pmullw", MX, EM, XX },
{ PREGRP21 },
- { "pmovmskb", Ev, MX, XX },
+ { "pmovmskb", Gv, EM, XX },
/* d8 */
{ "psubusb", MX, EM, XX },
{ "psubusw", MX, EM, XX },
@@ -2151,7 +2149,7 @@ static const struct dis386 dis386_twobyt
{ "paddq", MX, EM, XX },
{ "pmullw", MX, EM, XX },
{ PREGRP21 },
- { "pmovmskb", Ev, MX, XX },
+ { "pmovmskb", Gv, EM, XX },
/* d8 */
{ "psubusb", MX, EM, XX },
{ "psubusw", MX, EM, XX },