]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
spu.h (CANNOT_CHANGE_MODE_CLASS): Allow (multi)word-sized SUBREG of multi-word hard...
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 5 Aug 2008 13:53:20 +0000 (13:53 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 5 Aug 2008 13:53:20 +0000 (13:53 +0000)
* config/spu/spu.h (CANNOT_CHANGE_MODE_CLASS): Allow (multi)word-sized
SUBREG of multi-word hard register.
* config/spu/spu.c (valid_subreg): Likewise.
(adjust_operand): Handle SUBREGs of multi-word hard registers.

From-SVN: r138711

gcc/ChangeLog
gcc/config/spu/spu.c
gcc/config/spu/spu.h

index 02ca43300fa1d5c69f3eb211724518c5a87af028..10385d926f89327e51708f4195fea9842545f09f 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-05  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/spu/spu.h (CANNOT_CHANGE_MODE_CLASS): Allow (multi)word-sized
+       SUBREG of multi-word hard register.
+       * config/spu/spu.c (valid_subreg): Likewise.
+       (adjust_operand): Handle SUBREGs of multi-word hard registers.
+
 2008-08-04  Richard Guenther  <rguenther@suse.de>
 
        * tree-ssa-loop-ivopts.c (add_iv_value_candidates): Also add
index 83bd9f51315ccd411bb3924bd5f8736b6026b2da..b40d12c014966e30b3caaa3a8a8d2df2e4ef7b52 100644 (file)
@@ -419,7 +419,8 @@ valid_subreg (rtx op)
   enum machine_mode im = GET_MODE (SUBREG_REG (op));
   return om != VOIDmode && im != VOIDmode
     && (GET_MODE_SIZE (im) == GET_MODE_SIZE (om)
-       || (GET_MODE_SIZE (im) <= 4 && GET_MODE_SIZE (om) <= 4));
+       || (GET_MODE_SIZE (im) <= 4 && GET_MODE_SIZE (om) <= 4)
+       || (GET_MODE_SIZE (im) >= 16 && GET_MODE_SIZE (om) >= 16));
 }
 
 /* When insv and ext[sz]v ar passed a TI SUBREG, we want to strip it off
@@ -429,8 +430,10 @@ adjust_operand (rtx op, HOST_WIDE_INT * start)
 {
   enum machine_mode mode;
   int op_size;
-  /* Strip any SUBREG */
-  if (GET_CODE (op) == SUBREG)
+  /* Strip any paradoxical SUBREG.  */
+  if (GET_CODE (op) == SUBREG
+      && (GET_MODE_BITSIZE (GET_MODE (op))
+         > GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op)))))
     {
       if (start)
        *start -=
index 729e0d707a8c8c2594b26479f4f5d7fbb819f972..4180c4e46384e63b184b5b2db29239fb64b20849 100644 (file)
@@ -263,6 +263,7 @@ enum reg_class {
    only true for SPU. */
 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
         ((GET_MODE_SIZE (FROM) > 4 || GET_MODE_SIZE (TO) > 4) \
+        && (GET_MODE_SIZE (FROM) < 16 || GET_MODE_SIZE (TO) < 16) \
         && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))
 
 #define REGISTER_TARGET_PRAGMAS() do {                                 \