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: Gas Problems


On Tue, Feb 19, 2002 at 03:27:26PM -0800, Randall Hyde wrote:
> 
> Here are some problems I've found:
> 
> (1) statements like the following get rejected:
> fstp float ptr [eax]
> fstp double ptr [eax]
> fstp tfloat ptr [eax]
> 
> By trial and error I've found appropriate AT&T suffix
> that work, but they are inconsistent, especially on the
> integer FP instructions.

I'm going to leave this problem for someone more familiar with masm
syntax of the modern variety.  My experience with masm dates back to
the early 1980s, so I'm just a little bit out of date.  ;-)

> (2) movq and other MMX ilk that support 64-bit operands
> don't allow "qword ptr" ("must have a 64-bit architecture"
> or some-such error results).

These regressions were introduced with x86_64 support.  I think the
tc-i386.c:process_suffix patch will fix the problem, but I'd like an
OK from the x86_64 maintainers.  Frankly, I'd rather have broken
intel mode support, especially as you can just leave off the
"qword ptr", rather than having broken x86_64 linux support.

	* config/tc-i386.c (process_suffix): Ignore QWORD_MNEM_SUFFIX if
	IgnoreSize.

Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.115
diff -u -p -r1.115 tc-i386.c
--- gas/config/tc-i386.c	10 Apr 2002 13:00:02 -0000	1.115
+++ gas/config/tc-i386.c	11 Apr 2002 10:04:44 -0000
@@ -2253,7 +2253,7 @@ process_suffix ()
 
       /* Set mode64 for an operand.  */
       if (i.suffix == QWORD_MNEM_SUFFIX
-	  && (i.tm.opcode_modifier & NoRex64) == 0)
+	  && (i.tm.opcode_modifier & (NoRex64 | IgnoreSize)) == 0)
 	{
 	  i.rex |= REX_MODE64;
 	  if (flag_code < CODE_64BIT)

> CMPSD and MOVSD don't assemble (the other string
> instructions are fine).

These were broken with SSE2 support, when SSE2 instructions with the
same names were added.  I'm committing the following to fix this.

	* i386.h: Add intel mode cmpsd and movsd.

Index: include/opcode/i386.h
===================================================================
RCS file: /cvs/src/src/include/opcode/i386.h,v
retrieving revision 1.36
diff -u -p -r1.36 i386.h
--- include/opcode/i386.h	18 Feb 2002 16:32:25 -0000	1.36
+++ include/opcode/i386.h	11 Apr 2002 10:04:39 -0000
@@ -1232,6 +1232,9 @@ static const template i386_optab[] = {
 {"cmpunordsd",2, 0xf20fc2,  3, CpuSSE2, FP|Modrm|ImmExt,{ RegXMM|LongMem, RegXMM, 0 } },
 {"cmppd",     3, 0x660fc2,  X, CpuSSE2, FP|Modrm,	{ Imm8, RegXMM|LLongMem, RegXMM } },
 {"cmpsd",     3, 0xf20fc2,  X, CpuSSE2, FP|Modrm,	{ Imm8, RegXMM|LongMem, RegXMM } },
+/* Intel mode string compare.  */
+{"cmpsd",     0, 0xa7,      X, 0, NoSuf|Size32|IsString, { 0, 0, 0} },
+{"cmpsd",     2, 0xa7,      X, 0, NoSuf|Size32|IsString, { AnyMem, AnyMem|EsSeg, 0} },
 {"comisd",    2, 0x660f2f,  X, CpuSSE2, FP|Modrm,	{ RegXMM|LongMem, RegXMM, 0 } },
 {"cvtpi2pd",  2, 0x660f2a,  X, CpuSSE2, FP|Modrm,	{ RegMMX|LLongMem, RegXMM, 0 } },
 {"cvtsi2sd",  2, 0xf20f2a,  X, CpuSSE2, lq_Suf|IgnoreSize|Modrm,{ Reg32|Reg64|WordMem|LLongMem, RegXMM, 0 } },
@@ -1251,6 +1254,9 @@ static const template i386_optab[] = {
 {"movntpd",   2, 0x660f2b,  X, CpuSSE2, FP|Modrm, 	{ RegXMM, LLongMem, 0 } },
 {"movsd",     2, 0xf20f10,  X, CpuSSE2, FP|Modrm,	{ RegXMM|LongMem, RegXMM, 0 } },
 {"movsd",     2, 0xf20f11,  X, CpuSSE2, FP|Modrm,	{ RegXMM, RegXMM|LongMem, 0 } },
+/* Intel mode string move.  */
+{"movsd",     0, 0xa5,      X, 0, NoSuf|Size32|IsString, { 0, 0, 0} },
+{"movsd",     2, 0xa5,      X, 0, NoSuf|Size32|IsString, { AnyMem, AnyMem|EsSeg, 0} },
 {"movupd",    2, 0x660f10,  X, CpuSSE2, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },
 {"movupd",    2, 0x660f11,  X, CpuSSE2, FP|Modrm,	{ RegXMM, RegXMM|LLongMem, 0 } },
 {"mulpd",     2, 0x660f59,  X, CpuSSE2, FP|Modrm,	{ RegXMM|LLongMem, RegXMM, 0 } },

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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