This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[PATCH, i386]: Fix PR56656, Suffix or operands invalid for 'movq'


Hello!

Attached patch detects assemblers that expects movd instead of movq
for interunit moves and adds fixup code only in case of broken
assembler.

2013-03-21  Uros Bizjak  <ubizjak@gmail.com>

	PR bootstrap/56656
	* configure.ac (HAVE_AS_IX86_INTERUNIT_MOVQ): New test.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/i386/i386.md (*movdf_internal): Use
	HAVE_AS_IX86_INTERUNIT_MOVQ to handle broken assemblers that require
	movd instead of movq mnemonic for interunit moves.
	(*movdi_internal): Ditto.

Tested on x86_64-pc-linux-gnu, committed to mainline SVN.

Uros.
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md	(revision 196841)
+++ config/i386/i386.md	(working copy)
@@ -1878,9 +1878,11 @@
       return "pxor\t%0, %0";
 
     case TYPE_MMXMOV:
+#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ
       /* Handle broken assemblers that require movd instead of movq.  */
       if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
 	return "movd\t{%1, %0|%0, %1}";
+#endif
       return "movq\t{%1, %0|%0, %1}";
 
     case TYPE_SSELOG1:
@@ -1890,9 +1892,11 @@
       switch (get_attr_mode (insn))
 	{
 	case MODE_DI:
+#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ
 	  /* Handle broken assemblers that require movd instead of movq.  */
 	  if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
 	    return "%vmovd\t{%1, %0|%0, %1}";
+#endif
 	  return "%vmovq\t{%1, %0|%0, %1}";
 	case MODE_TI:
 	  return "%vmovdqa\t{%1, %0|%0, %1}";
@@ -2797,9 +2801,11 @@
 	  return "movlpd\t{%1, %0|%0, %1}";
 
 	case MODE_DI:
+#ifndef HAVE_AS_IX86_INTERUNIT_MOVQ
 	  /* Handle broken assemblers that require movd instead of movq.  */
 	  if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1]))
 	    return "%vmovd\t{%1, %0|%0, %1}";
+#endif
  	  return "%vmovq\t{%1, %0|%0, %1}";
 
 	default:
Index: configure.ac
===================================================================
--- configure.ac	(revision 196841)
+++ configure.ac	(working copy)
@@ -3723,6 +3723,14 @@
       [AC_DEFINE(HAVE_AS_IX86_SAHF, 1,
         [Define if your assembler supports the sahf mnemonic in 64bit mode.])])
 
+    gcc_GAS_CHECK_FEATURE([interunit movq mnemonic],
+      gcc_cv_as_ix86_interunit_movq,,,
+      [.code64
+       movq %mm0, %rax
+       movq %rax, %xmm0],,
+      [AC_DEFINE(HAVE_AS_IX86_INTERUNIT_MOVQ, 1,
+        [Define if your assembler supports interunit movq mnemonic.])])
+
     gcc_GAS_CHECK_FEATURE([hle prefixes],
       gcc_cv_as_ix86_hle,,,
       [lock xacquire cmpxchg %esi, (%ecx)],,

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