From 46fc230528907c9adc42104c73819415de8d0a6c Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Wed, 22 Dec 2010 15:09:17 +0000 Subject: [PATCH] spu.md ("mov"): Use nonimmediate_operand predicate for destination operand. * config/spu/spu.md ("mov"): 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 | 7 +++++++ gcc/config/spu/spu.c | 8 +++++++- gcc/config/spu/spu.md | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cbbd5aece33..9fb315209f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-12-22 Ulrich Weigand + + * config/spu/spu.md ("mov"): 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 PR tree-optimization/45934 diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index bbe6eddde2a..045fc8794ed 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -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])) { diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md index c9bf3c828d5..1aab660a8d2 100644 --- a/gcc/config/spu/spu.md +++ b/gcc/config/spu/spu.md @@ -269,8 +269,8 @@ ;; mov (define_expand "mov" - [(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)) -- 2.30.2