OSDN Git Service

PR target/32661
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jul 2007 18:42:44 +0000 (18:42 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 11 Jul 2007 18:42:44 +0000 (18:42 +0000)
        * config/i386/sse.md (*sse2_storeq_rex64): Handle 64bit mem->reg moves.
        (*vec_extractv2di_1_sse2): Disable for TARGET_64BIT.
        (*vec_extractv2di_1_rex64): New insn pattern.

testsuite/ChangeLog:

        PR target/32661
        * gcc.target/i386/pr32661-1.c: New test.

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

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

index 9b6a348..1e17ad3 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/32661
+       * config/i386/sse.md (*sse2_storeq_rex64): Handle 64bit mem->reg moves.
+       (*vec_extractv2di_1_sse2): Disable for TARGET_64BIT.
+       (*vec_extractv2di_1_rex64): New insn pattern.
+
 2007-07-11  David Daney  <ddaney@avtrex.com>
 
        * config/mips/linux-unwind.h (mips_fallback_frame_state): Rewrite
index 027d43b..3164077 100644 (file)
   "")
 
 (define_insn "*sse2_storeq_rex64"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,r")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,r,r")
        (vec_select:DI
-         (match_operand:V2DI 1 "register_operand" "x,Yi")
+         (match_operand:V2DI 1 "nonimmediate_operand" "x,Yi,o")
          (parallel [(const_int 0)])))]
-  "TARGET_64BIT && TARGET_SSE"
-  "#")
+  "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+  "@
+   #
+   #
+   mov{q}\t{%1, %0|%0, %1}"
+  [(set_attr "type" "*,*,imov")
+   (set_attr "mode" "*,*,DI")])
 
 (define_insn "*sse2_storeq"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=mx")
   operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));
 })
 
+(define_insn "*vec_extractv2di_1_rex64"
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x,r")
+       (vec_select:DI
+         (match_operand:V2DI 1 "nonimmediate_operand" "x,0,o,o")
+         (parallel [(const_int 1)])))]
+  "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+  "@
+   movhps\t{%1, %0|%0, %1}
+   psrldq\t{$8, %0|%0, 8}
+   movq\t{%H1, %0|%0, %H1}
+   mov{q}\t{%H1, %0|%0, %H1}"
+  [(set_attr "type" "ssemov,sseishft,ssemov,imov")
+   (set_attr "memory" "*,none,*,*")
+   (set_attr "mode" "V2SF,TI,TI,DI")])
+
 (define_insn "*vec_extractv2di_1_sse2"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x")
        (vec_select:DI
          (match_operand:V2DI 1 "nonimmediate_operand" "x,0,o")
          (parallel [(const_int 1)])))]
-  "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+  "!TARGET_64BIT
+   && TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
   "@
    movhps\t{%1, %0|%0, %1}
    psrldq\t{$8, %0|%0, 8}
index 0045618..02d37a0 100644 (file)
@@ -1,3 +1,8 @@
+2007-07-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/32661
+       * gcc.target/i386/pr32661-1.c: New test.
+
 2007-07-11  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/invariant_index.ad[sb]: New test.
diff --git a/gcc/testsuite/gcc.target/i386/pr32661-1.c b/gcc/testsuite/gcc.target/i386/pr32661-1.c
new file mode 100644 (file)
index 0000000..0354fc3
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && lp64 } } } */
+/* { dg-options "-O2" } */
+
+typedef long long __m128i __attribute__ ((__vector_size__ (16)));
+
+long long foo_0(__m128i* val)
+{
+  return __builtin_ia32_vec_ext_v2di(*val, 0);
+}
+
+long long foo_1(__m128i* val)
+{
+  return __builtin_ia32_vec_ext_v2di(*val, 1);
+}
+
+/* { dg-final { scan-assembler-times "mov" 2 } } */