PR target/46098
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Oct 2010 16:12:57 +0000 (16:12 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Oct 2010 16:12:57 +0000 (16:12 +0000)
* config/i386/sse.md (*avx_movu<ssemodesuffix><avxmodesuffix>):
Rename from avx_movu<ssemodesuffix><avxmodesuffix>.
(avx_movu<ssemodesuffix><avxmodesuffix>): New expander.
(*<sse>_movu<ssemodesuffix>): Rename from <sse>_movu<ssemodesuffix>.
(<sse>_movu<ssemodesuffix>): New expander.
(*avx_movdqu<avxmodesuffix>): Rename from avx_movdqu<avxmodesuffix>.
(avx_movdqu<avxmodesuffix>): New expander.
(*sse2_movdqu): Rename from sse2_movdqu.
(sse2_movdqu): New expander.

testsuite/ChangeLog:

PR target/46098
* gcc.target/i386/pr46098.c: New test.

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

gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr46098.c [new file with mode: 0644]

index 2d39d39..f249e41 100644 (file)
@@ -1,3 +1,16 @@
+2010-10-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/46098
+       * config/i386/sse.md (*avx_movu<ssemodesuffix><avxmodesuffix>):
+       Rename from avx_movu<ssemodesuffix><avxmodesuffix>.
+       (avx_movu<ssemodesuffix><avxmodesuffix>): New expander.
+       (*<sse>_movu<ssemodesuffix>): Rename from <sse>_movu<ssemodesuffix>.
+       (<sse>_movu<ssemodesuffix>): New expander.
+       (*avx_movdqu<avxmodesuffix>): Rename from avx_movdqu<avxmodesuffix>.
+       (avx_movdqu<avxmodesuffix>): New expander.
+       (*sse2_movdqu): Rename from sse2_movdqu.
+       (sse2_movdqu): New expander.
+
 2010-10-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45720
 2010-10-21  Iain Sandoe  <iains@gcc.gnu.org>
 
        Based on the CFString implementation in FSF apple/trunk branch.
-       
+
        * target.def (objc_construct_string): New Hook.
        * doc/tm.texi (objc_construct_string): Document.
        * doc/tm.texi.in (TARGET_OBJC_CONSTRUCT_STRING): New.
        (darwin_cfstring_p): Likewise.
        (darwin_enter_string_into_cfstring_table): Likewise.
        * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS) Update for CFString.
-       * config/darwin.c (darwin_running_cxx): New var. 
+       * config/darwin.c (darwin_running_cxx): New var.
        (machopic_select_section): Return cfstring_constant_object_section.
        (darwin_override_options): Set darwin_running_cxx.
        (add_builtin_field_decl): New.
index 635a460..362659a 100644 (file)
   DONE;
 })
 
-(define_insn "avx_movu<ssemodesuffix><avxmodesuffix>"
+(define_expand "avx_movu<ssemodesuffix><avxmodesuffix>"
+  [(set (match_operand:AVXMODEF2P 0 "nonimmediate_operand" "")
+       (unspec:AVXMODEF2P
+         [(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "")]
+         UNSPEC_MOVU))]
+  "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+{
+  if (MEM_P (operands[0]) && MEM_P (operands[1]))
+    operands[1] = force_reg (<MODE>mode, operands[1]);
+})
+
+(define_insn "*avx_movu<ssemodesuffix><avxmodesuffix>"
   [(set (match_operand:AVXMODEF2P 0 "nonimmediate_operand" "=x,m")
        (unspec:AVXMODEF2P
          [(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "xm,x")]
    (set_attr "prefix" "maybe_vex")
    (set_attr "mode" "TI")])
 
-(define_insn "<sse>_movu<ssemodesuffix>"
+(define_expand "<sse>_movu<ssemodesuffix>"
+  [(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "")
+       (unspec:SSEMODEF2P
+         [(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")]
+         UNSPEC_MOVU))]
+  "SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
+{
+  if (MEM_P (operands[0]) && MEM_P (operands[1]))
+    operands[1] = force_reg (<MODE>mode, operands[1]);
+})
+
+(define_insn "*<sse>_movu<ssemodesuffix>"
   [(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "=x,m")
        (unspec:SSEMODEF2P
          [(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "xm,x")]
    (set_attr "movu" "1")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "avx_movdqu<avxmodesuffix>"
+(define_expand "avx_movdqu<avxmodesuffix>"
+  [(set (match_operand:AVXMODEQI 0 "nonimmediate_operand" "")
+       (unspec:AVXMODEQI
+         [(match_operand:AVXMODEQI 1 "nonimmediate_operand" "")]
+         UNSPEC_MOVU))]
+  "TARGET_AVX"
+{
+  if (MEM_P (operands[0]) && MEM_P (operands[1]))
+    operands[1] = force_reg (<MODE>mode, operands[1]);
+})
+
+(define_insn "*avx_movdqu<avxmodesuffix>"
   [(set (match_operand:AVXMODEQI 0 "nonimmediate_operand" "=x,m")
        (unspec:AVXMODEQI
          [(match_operand:AVXMODEQI 1 "nonimmediate_operand" "xm,x")]
    (set_attr "prefix" "vex")
    (set_attr "mode" "<avxvecmode>")])
 
-(define_insn "sse2_movdqu"
+(define_expand "sse2_movdqu"
+  [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
+       (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "")]
+                     UNSPEC_MOVU))]
+  "TARGET_SSE2"
+{
+  if (MEM_P (operands[0]) && MEM_P (operands[1]))
+    operands[1] = force_reg (V16QImode, operands[1]);
+})
+
+(define_insn "*sse2_movdqu"
   [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
        (unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")]
                      UNSPEC_MOVU))]
index b853e6e..96e42b8 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-22  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/46098
+       * gcc.target/i386/pr46098.c: New test.
+
 2010-10-22  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/45720
@@ -11,7 +16,7 @@
 2010-10-21  Iain Sandoe  <iains@gcc.gnu.org>
 
        Based on the CFString implementation in FSF apple/trunk branch.
-       
+
        * lib/objc-dg.exp (objc-dg-runtest): Merge flags and additional flags
        so that the latter can be used in dg-skip and dg-xfail clauses.
        * lib/obj-c++-dg.exp (obj-c++-dg-runtest): Likewise.
        * obj-c++.dg/torture/strings/const-cfstring-1.mm: New.
        * obj-c++.dg/torture/strings/const-cfstring-3.mm: New.
        * obj-c++.dg/torture/strings/const-cfstring-4.mm: New.
-       
-       * objc/execute/string1.m: Don't use CFStrings on Darwin. Update test
-       to use dg-additional-files for Object1, move to objc.dg/torture/strings/.
+
+       * objc/execute/string1.m: Don't use CFStrings on Darwin. Update test to
+       use dg-additional-files for Object1, move to objc.dg/torture/strings/.
        * objc/execute/string2.m: Likewise.
        * objc/execute/string3.m: Likewise.
        * objc/execute/string3.m: Likewise.
        * objc.dg/foreach-2.m: Don't use CFStrings on Darwin.
        * objc.dg/foreach-4.m: Likewise.
        * objc.dg/foreach-5.m: Likewise.
-       * objc.dg/const-str-3.m: Don't use CFStrings on Darwin. Update test
-       to use dg-additional-files for Object1, move to objc.dg/torture/strings/.
+       * objc.dg/const-str-3.m: Don't use CFStrings on Darwin. Update test to
+       use dg-additional-files for Object1, move to objc.dg/torture/strings/.
        * objc.dg/const-str-4.m: Likewise.
        * objc.dg/const-str-7.m: Likewise.
        * objc.dg/const-str-8.m: Likewise.
diff --git a/gcc/testsuite/gcc.target/i386/pr46098.c b/gcc/testsuite/gcc.target/i386/pr46098.c
new file mode 100644 (file)
index 0000000..4cc07c2
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-msse2 -ffloat-store" } */
+
+typedef double v2df __attribute__((vector_size (16)));
+
+v2df foo (double *d)
+{
+  return __builtin_ia32_loadupd (d);
+}