spu.md ("mov<mode>"): Use nonimmediate_operand predicate for destination operand.
authorUlrich Weigand <uweigand@de.ibm.com>
Wed, 22 Dec 2010 15:09:17 +0000 (15:09 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Wed, 22 Dec 2010 15:09:17 +0000 (15:09 +0000)
* config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand
predicate for destination operand.
* config/spu/spu.c (spu_expand_mov): If move destination is an
invalid subreg, perform move in the subreg's inner mode instead.

From-SVN: r168169

gcc/ChangeLog
gcc/config/spu/spu.c
gcc/config/spu/spu.md

index cbbd5ae..9fb3152 100644 (file)
@@ -1,3 +1,10 @@
+2010-12-22  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/spu/spu.md ("mov<mode>"): Use nonimmediate_operand
+       predicate for destination operand.
+       * config/spu/spu.c (spu_expand_mov): If move destination is an
+       invalid subreg, perform move in the subreg's inner mode instead.
+
 2010-12-22  Martin Jambor  <mjambor@suse.cz>
 
        PR tree-optimization/45934
index bbe6edd..045fc87 100644 (file)
@@ -4608,7 +4608,13 @@ int
 spu_expand_mov (rtx * ops, enum machine_mode mode)
 {
   if (GET_CODE (ops[0]) == SUBREG && !valid_subreg (ops[0]))
-    abort ();
+    {
+      /* Perform the move in the destination SUBREG's inner mode.  */
+      ops[0] = SUBREG_REG (ops[0]);
+      mode = GET_MODE (ops[0]);
+      ops[1] = gen_lowpart_common (mode, ops[1]);
+      gcc_assert (ops[1]);
+    }
 
   if (GET_CODE (ops[1]) == SUBREG && !valid_subreg (ops[1]))
     {
index c9bf3c8..1aab660 100644 (file)
 ;; mov
 
 (define_expand "mov<mode>"
-  [(set (match_operand:ALL 0 "spu_nonimm_operand" "=r,r,r,m")
-       (match_operand:ALL 1 "general_operand" "r,i,m,r"))]
+  [(set (match_operand:ALL 0 "nonimmediate_operand" "")
+       (match_operand:ALL 1 "general_operand" ""))]
   ""
   {
     if (spu_expand_mov(operands, <MODE>mode))