OSDN Git Service

Handle misaligned TFmode load/store.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 May 2011 20:00:11 +0000 (20:00 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 May 2011 20:00:11 +0000 (20:00 +0000)
gcc/

2011-05-30  H.J. Lu  <hongjiu.lu@intel.com>

PR target/49168
* config/i386/i386.md (*movtf_internal): Handle misaligned
load/store.

gcc/testsuite/

2011-05-30  H.J. Lu  <hongjiu.lu@intel.com>

PR target/49168
 * gcc.target/i386/pr49168-1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174451 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr49168-1.c [new file with mode: 0644]

index 5e9badf..45212c0 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/49168
+       * config/i386/i386.md (*movtf_internal): Handle misaligned
+       load/store.
+
 2011-05-30  Jakub Jelinek  <jakub@redhat.com>
 
        * dwarf2out.c (modified_type_die, gen_reference_type_die): Use
index 89e1173..6d3ae80 100644 (file)
     {
     case 0:
     case 1:
-      if (get_attr_mode (insn) == MODE_V4SF)
-       return "%vmovaps\t{%1, %0|%0, %1}";
+      /* Handle misaligned load/store since we don't have movmisaligntf
+        pattern. */
+      if (misaligned_operand (operands[0], TFmode)
+         || misaligned_operand (operands[1], TFmode))
+       {
+         if (get_attr_mode (insn) == MODE_V4SF)
+           return "%vmovups\t{%1, %0|%0, %1}";
+         else
+           return "%vmovdqu\t{%1, %0|%0, %1}";
+       }
       else
-       return "%vmovdqa\t{%1, %0|%0, %1}";
+       {
+         if (get_attr_mode (insn) == MODE_V4SF)
+           return "%vmovaps\t{%1, %0|%0, %1}";
+         else
+           return "%vmovdqa\t{%1, %0|%0, %1}";
+       }
 
     case 2:
       return standard_sse_constant_opcode (insn, operands[1]);
index e80c1b2..d8b0ef5 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/49168
+        * gcc.target/i386/pr49168-1.c: New.
+
 2011-05-30  Jakub Jelinek  <jakub@redhat.com>
            Eric Botcazou  <ebotcazou@adacore.com>
 
diff --git a/gcc/testsuite/gcc.target/i386/pr49168-1.c b/gcc/testsuite/gcc.target/i386/pr49168-1.c
new file mode 100644 (file)
index 0000000..9676dc8
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR target/49168  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2 -mtune=generic" } */
+/* { dg-final { scan-assembler-not "movdqa\[\t \]*%xmm\[0-9\]\+,\[^,\]*" } } */
+/* { dg-final { scan-assembler "movdqu\[\t \]*%xmm\[0-9\]\+,\[^,\]*" } } */
+
+void
+flt128_va (void *mem, __float128 d)
+{ 
+  __builtin_memcpy (mem, &d, sizeof (d));
+}