re PR target/20415 (Vector init builtin produces invalid instruction pshufw)
authorRichard Henderson <rth@redhat.com>
Fri, 11 Mar 2005 17:50:30 +0000 (09:50 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 11 Mar 2005 17:50:30 +0000 (09:50 -0800)
        PR target/20415
        * config/i386/mmx.md (vec_dupv4hi): Fix predicate.
        * config/i386/i386.c (ix86_expand_vector_init_duplicate): Update
        to match.

From-SVN: r96304

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/mmx.md

index 4944b6cbe5dc3ba22ced8ee9fe5c349c92b9d58a..5c2b620571a15997340b959fa0e63ede7b262c45 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-11  Richard Henderson  <rth@redhat.com>
+
+       PR target/20415
+       * config/i386/mmx.md (vec_dupv4hi): Fix predicate.
+       * config/i386/i386.c (ix86_expand_vector_init_duplicate): Update
+       to match.
+
 2005-03-11  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/mips.h (mips_fix_vr4130_string): Declare.
index bc680c80df9c6bececa5e4ecfe82871015fef496..7ca47ed2f4b4de162ddf02c0cf4560404d2578fa 100644 (file)
@@ -16198,11 +16198,21 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum machine_mode mode,
     case V4HImode:
       if (!mmx_ok)
        return false;
-      val = gen_lowpart (SImode, val);
-      x = gen_rtx_TRUNCATE (HImode, val);
-      x = gen_rtx_VEC_DUPLICATE (mode, x);
-      emit_insn (gen_rtx_SET (VOIDmode, target, x));
-      return true;
+      if (TARGET_SSE || TARGET_3DNOW_A)
+       {
+         val = gen_lowpart (SImode, val);
+         x = gen_rtx_TRUNCATE (HImode, val);
+         x = gen_rtx_VEC_DUPLICATE (mode, x);
+         emit_insn (gen_rtx_SET (VOIDmode, target, x));
+         return true;
+       }
+      else
+       {
+         smode = HImode;
+         wsmode = SImode;
+         wvmode = V2SImode;
+         goto widen;
+       }
 
     case V8QImode:
       if (!mmx_ok)
index 9e374e44ebfae2a76dc94e58bfe01a1d8d375c2a..403501bf4dc4db13b137a5fdf4e33d757fa6d4df 100644 (file)
        (vec_duplicate:V4HI
          (truncate:HI
            (match_operand:SI 1 "register_operand" "0"))))]
-  "TARGET_MMX"
+  "TARGET_SSE || TARGET_3DNOW_A"
   "pshufw\t{$0, %0, %0|%0, %0, 0}"
   [(set_attr "type" "mmxcvt")
    (set_attr "mode" "DI")])