OSDN Git Service

* combine.c (gen_lowpart_for_combine): Handle vector modes.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jul 2002 18:51:20 +0000 (18:51 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jul 2002 18:51:20 +0000 (18:51 +0000)
Supply non-VOID mode to simplify_gen_subreg.

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

gcc/ChangeLog
gcc/combine.c

index 2db2b0c..a71d09d 100644 (file)
@@ -1,3 +1,8 @@
+Wed Jul 10 19:50:03 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * combine.c (gen_lowpart_for_combine): Handle vector modes.
+       Supply non-VOID mode to simplify_gen_subreg.
+
 Wed Jul 10 18:48:55 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (ix86_init_mmx_sse_builtins): Fix thinko.
index 646abec..f9d4b40 100644 (file)
@@ -9831,12 +9831,6 @@ gen_lowpart_for_combine (mode, x)
            || GET_MODE_SIZE (GET_MODE (x)) == GET_MODE_SIZE (mode)))
     return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
 
-  /* simplify_gen_subreg does not know how to handle the case where we try
-     to convert an integer constant to a vector.
-     ??? We could try to teach it to generate CONST_VECTORs.  */
-  if (GET_MODE (x) == VOIDmode && VECTOR_MODE_P (mode))
-    return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
-
   /* X might be a paradoxical (subreg (mem)).  In that case, gen_lowpart
      won't know what to do.  So we will strip off the SUBREG here and
      process normally.  */
@@ -9903,9 +9897,15 @@ gen_lowpart_for_combine (mode, x)
     {
       int offset = 0;
       rtx res;
+      enum machine_mode sub_mode = GET_MODE (x);
 
-      offset = subreg_lowpart_offset (mode, GET_MODE (x));
-      res = simplify_gen_subreg (mode, x, GET_MODE (x), offset);
+      offset = subreg_lowpart_offset (mode, sub_mode);
+      if (sub_mode == VOIDmode)
+       {
+         sub_mode = int_mode_for_mode (mode);
+         x = gen_lowpart_common (sub_mode, x);
+       }
+      res = simplify_gen_subreg (mode, x, sub_mode, offset);
       if (res)
        return res;
       return gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);