diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e9292e6..d017fb8 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1599,6 +1599,19 @@ (set_attr "prefix" "maybe_vex") (set_attr "mode" "TI")]) +(define_insn "*sse2_movq128_2" + [(set (match_operand:V2DF 0 "register_operand" "=v") + (vec_concat:V2DF + (vec_select:DF + (match_operand:V2DF 1 "nonimmediate_operand" "vm") + (parallel [(const_int 0)])) + (match_operand:DF 2 "const0_operand")))] + "TARGET_SSE2" + "%vmovq\t{%1, %0|%0, %q1}" + [(set_attr "type" "ssemov") + (set_attr "prefix" "maybe_vex") + (set_attr "mode" "TI")]) + ;; Move a DI from a 32-bit register pair (e.g. %edx:%eax) to an xmm. ;; We'd rather avoid this entirely; if the 32-bit reg pair was loaded ;; from memory, we'd prefer to load the memory directly into the %xmm diff --git a/gcc/testsuite/gcc.target/i386/sse2-pr94680-2.c b/gcc/testsuite/gcc.target/i386/sse2-pr94680-2.c new file mode 100644 index 0000000..abd260a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/sse2-pr94680-2.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ +typedef double v2df __attribute__ ((vector_size (16))); +typedef long long v2di __attribute__((vector_size(16))); + +v2df foo_v2df (v2df x) +{ + return __builtin_shuffle (x, (v2df) { 0, 0 }, (v2di) { 0, 2 }); +} + +/* { dg-final { scan-assembler "movq" } } */ +/* { dg-final { scan-assembler-not "pxor" } } */ +